Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Javascript Generators #746

Merged
merged 36 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c01121d
feat: js adaptive bot
Mar 2, 2021
2d57b14
feat: js empty bot
Mar 3, 2021
8532aa3
refactor to shared base generator
Mar 12, 2021
37df376
add plugin interface to welcome/help packages
Mar 13, 2021
ab07a68
feat: declarative option validation
Mar 15, 2021
ca90003
fix: minor touch ups so composer runs bot
Mar 15, 2021
1053d22
fix: proper plugin/package resolution, missing resource files
Mar 15, 2021
51c605a
fix: clean up options shape
Mar 15, 2021
8eeb7f8
fix: remove errand workspace ref
Mar 15, 2021
6351413
fix: remove console log
Mar 15, 2021
ccea88d
fix: bundle root js files
Mar 15, 2021
3828ac4
fix: lint as github action
Mar 15, 2021
e47a905
fix: clarify lint
Mar 15, 2021
47402b8
fix: yarn cache
Mar 15, 2021
cb20280
fix: azure functions deployment
Mar 15, 2021
0243434
Merge branch 'main' into jpg/js-generators
Mar 16, 2021
e3d8390
fix: typo
Mar 16, 2021
b58d8f4
fix: another typo
Mar 16, 2021
01bc6e9
Merge branch 'main' into jpg/js-generators
Mar 16, 2021
b3a35a9
fix: runtime key/command
Mar 16, 2021
3fb5e57
fix: include web.config for webapp deployment
Mar 16, 2021
486d635
fix: webapp dynamic port
Mar 16, 2021
029330b
fix: web.config paths
Mar 17, 2021
001c053
fix: consolidate package refs and plugins
Mar 17, 2021
220bffe
fix: array style package references
Mar 17, 2021
f1daefd
Merge branch 'main' into jpg/js-generators
Mar 17, 2021
40b754c
fix: lint issue
Mar 17, 2021
b4f7f0a
fix: do not coerce port to int
Mar 17, 2021
28a7fad
Merge branch 'main' into jpg/js-generators
Mar 17, 2021
09ee4d3
fix: find instead of filter
Mar 17, 2021
b6a77a7
fix: clean up webapp start script, deps
Mar 17, 2021
d767618
Merge branch 'main' into jpg/js-generators
Mar 18, 2021
5b99645
fix: provide dev server for functions local testing
Mar 18, 2021
e509fce
Merge branch 'main' into jpg/js-generators
Mar 18, 2021
11f950f
fix: runtime command
Mar 18, 2021
463d996
fix: simplify node functions runtime
Mar 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint Workspaces

on:
push:
branches: ["main"]

pull_request:
branches: ["main"]

jobs:
lint:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: use node 12.x
uses: actions/setup-node@v2-beta
with:
node-version: 12.x

- uses: actions/cache@v2
with:
path: .yarn/cache
key: windows-latest-node12.x-yarn-${{ hashFiles('**/yarn.lock') }}

- name: yarn
run: yarn --immutable

- name: yarn lint
run: yarn lint
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,7 @@ experimental/generator-dotnet-yeoman/node_modules
.pnp.*

# Ignore package lock files
package-lock.json
package-lock.json

# Ignore test bots
testing/*
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = class extends Generator {
),
{
arguments: this.args,
packageReferences: [],
applicationSettingsDirectory: 'settings',
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = class extends Generator {
),
{
arguments: this.args,
packageReferences: [],
applicationSettingsDirectory: 'settings',
}
);
Expand Down
1 change: 0 additions & 1 deletion generators/generator-bot-qna-maker/generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = class extends Generator {
),
{
arguments: this.args,
packageReferences: [],
applicationSettingsDirectory: 'settings',
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ module.exports = class extends Generator {
initializing() {
this.composeWith(require.resolve('generator-adaptive-bot/generators/app'), {
arguments: this.args,
applicationSettingsDirectory: 'settings',
packageReferences: [
// PLACE COMPONENT PACKAGES THAT YOUR BOT TEMPLATE USES HERE
],
applicationSettingsDirectory: 'settings',
includeApplicationSettings: false,
});
}

Expand Down
1 change: 0 additions & 1 deletion generators/generator-bot-who/generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = class extends Generator {
),
{
arguments: this.args,
packageReferences: [],
applicationSettingsDirectory: 'settings',
}
);
Expand Down
6 changes: 6 additions & 0 deletions generators/generator-microsoft-bot-adaptive/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": [
"generators/**/templates/**"
]
}
51 changes: 51 additions & 0 deletions generators/generator-microsoft-bot-adaptive/baseGenerator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

const Generator = require('yeoman-generator');
const assert = require('assert');
const integrations = require('./integrations');
const platforms = require('./platforms');

module.exports = class extends Generator {
constructor(args, opts) {
super(args, opts);

this.argument('botName', {
type: String,
required: true,
});

this.option('platform', {
desc: `The programming platform to use, one of: ${Object.keys(
platforms
).join(', ')}`,
type: String,
default: platforms.dotnet,
alias: 'p',
});

this.option('integration', {
desc: `The host integration to use, one of: ${Object.keys(
integrations
).join(', ')}`,
type: String,
default: integrations.webapp,
alias: 'i',
});

const { botName, platform, integration } = this.options;
assert(botName, 'botName is required');
assert(typeof botName === 'string', 'botName must be a string');

assert(platform, 'platform is required');
assert(typeof platform === 'string', 'platform must be a string');
assert(platforms[platform], `${platform} is not a registered platform`);

assert(integration, 'integration is required');
assert(typeof integration === 'string', 'integration must be a string');
assert(
integrations[integration],
`${integration} is not a registered integration`
);
}
};
Loading