Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: manage samples via plugin #2805

Merged
merged 15 commits into from
May 6, 2020
Merged

feat: manage samples via plugin #2805

merged 15 commits into from
May 6, 2020

Conversation

boydc2014
Copy link
Contributor

@boydc2014 boydc2014 commented Apr 28, 2020

Closes #2835
Closes #2563 (partially, this PR includes the samples part, will split the task later)

This PR includes

  • Extend plugin interface to support AddBotTemplate(SampleBot), and AddBaseTemplate(BoilerPlate)
  public addBotTemplate(template: BotTemplate) // Sample bot
  public addBaseTemplate(template: BotTemplate) // Biolerplate
  • Extend interface of BotTemplate to include two more properties: tags, support to be able to support further operations based on runtime version
export interface BotTemplate {
  id: string;
  name: string;
  description: string;
  path: string; // absolute path
  tags?: string[]; // tags for further grouping and search secenario
  support?: string[]; // list of supported runtime versions
}
  • Create a samples plugins, which take over the samples and biolerplate, and move the assets from server/assets into plugins/samples/assets
  • Clean up AssetManager

@cwhitten cwhitten changed the title draft: manage samles via plugin draft: manage samples via plugin Apr 30, 2020
@boydc2014 boydc2014 force-pushed the donglei/sample-plugin branch from 15c747f to 2370c68 Compare May 5, 2020 07:54
@boydc2014 boydc2014 changed the title draft: manage samples via plugin feat: manage samples via plugin May 5, 2020
@boydc2014 boydc2014 marked this pull request as ready for review May 5, 2020 08:00
@boydc2014 boydc2014 requested a review from luhan2017 as a code owner May 5, 2020 08:01
@github-actions
Copy link

github-actions bot commented May 5, 2020

Coverage Status

Coverage remained the same at 0.0% when pulling bb7ef35 on donglei/sample-plugin into c329a2f on master.

@boydc2014
Copy link
Contributor Author

@cwhitten @a-b-r-o-w-n @benbrown this one is ready for review now

"build:plugins": "cd plugins/localPublish && yarn install && yarn build",
"build:plugins": "yarn build:plugins:localpublish && yarn build:plugins:samples",
"build:plugins:localpublish": "cd plugins/localPublish && yarn install && yarn build",
"build:plugins:samples": "cd plugins/samples && yarn install && yarn build",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't these just be a part of the yarn workspaces?

Copy link
Contributor Author

@boydc2014 boydc2014 May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i think those can and should be managed by yarn workspaces, it's just those plugins were not included when we started to use this plugin approach, and i haven't thought about that in this effort.

i created a new ticket to track this work #2901 to keep this one focused, make sense? because this one moved a lot of files, which is very easy to get a conflict.

/**************************************************************************************
* Add Base Template (aka, BoilerPlate)
*************************************************************************************/
public addBaseTemplate(template: BotTemplate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this one. What is meant by boilerplate?

Copy link
Contributor Author

@boydc2014 boydc2014 May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Andy, boilerPlate is introduced by #2837 which works as a baseTemplate for all sample bot. For example, contains as a README.md that could be copied into any created bot.

This PR don't add any features yet, just refactor the structure.

const samples = getSamples();
const biolerplates = getBiolerPlates();

export default async (composer: any): Promise<void> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export default async (composer: any): Promise<void> => {
export default async (composer: ComposerPluginRegistration): Promise<void> => {

Copy link
Contributor Author

@boydc2014 boydc2014 May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When i try to refer to pluginLoader package as dependencies, somehow the samples plugin can't build, with this error DefinitelyTyped/DefinitelyTyped#40905, seems related to we have multiple version of types/express-server-core-static, i will see i can fix it today, if not, probably i will keep use any and pick it later when using yarn workspace to manage plugins.

Copy link
Contributor Author

@boydc2014 boydc2014 May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out trickier than i thought. Tracked it in another issue. #2912

@boydc2014
Copy link
Contributor Author

E2E failed because we have some style changes in #2898, there is a fix in #2913

@cwhitten cwhitten merged commit d6c3d61 into master May 6, 2020
@cwhitten cwhitten deleted the donglei/sample-plugin branch May 6, 2020 14:42
alanlong9278 added a commit that referenced this pull request May 7, 2020
* master: (58 commits)
  fix: Copy skill manifests to the correct directory in the localPublish plugin (#2932)
  feat: Goto Begin Dialog after clicking dialog (#2922)
  fix: Improved Electron auto update UX (#2925)
  fix: Action Flow gradual left alignment (#2909)
  fix: word wrap in SendActivity (#2908)
  fix: Fixed various onboarding issues and updated content (#2900)
  chore: Component Governance (#2899)
  perf: improve property editor performance (#2921)
  fix: paste blank node (#2905)
  extract memory variables at lg lsp server (#2902)
  feat: manage samples via plugin (#2805)
  can not use event capture in visual editor (#2913)
  style: make focus styles more consistent (#2898)
  feat: azure publish plugin (#2733)
  fix: unable to clear form title (#2885)
  fix: Populate env variable with AppData folder (#2894)
  a11y: use Key/Value aria labels in object field (#2890)
  Fix border issue in visual editor (#2891)
  fix: changes manifest type from '.manifest' to '.json' (#2888)
  Fixed packaged folder structure. (#2887)
  ...
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* redo on a clean master

* fix dotnet tests path

* correct the typo

* update all other places

* fix the last path

* fix paths

* remove commented code

* fix typo

* fix comments

* fix comments

* update type

* align with local publisher

* revert the dependency to plugin-loader

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants