From 712f995fb4a4d337403e09de963ef90f2c32cf1f Mon Sep 17 00:00:00 2001 From: CeciliaAvila Date: Thu, 14 Nov 2024 09:08:13 -0300 Subject: [PATCH 1/5] Update templates' package.json files --- .../app/templates/core/package-with-tests.json.js | 10 +++++----- .../app/templates/core/package-with-tests.json.ts | 13 +++++++------ .../generators/app/templates/core/package.json.js | 8 ++++---- .../generators/app/templates/core/package.json.ts | 11 ++++++----- .../generators/app/templates/core/tsconfig.json | 6 ++++-- .../generators/app/templates/echo/package.json.js | 4 ++-- .../generators/app/templates/echo/package.json.ts | 7 ++++--- .../generators/app/templates/echo/tsconfig.json | 6 ++++-- .../generators/app/templates/empty/package.json.js | 4 ++-- .../generators/app/templates/empty/package.json.ts | 7 ++++--- .../generators/app/templates/empty/tsconfig.json | 6 ++++-- 11 files changed, 46 insertions(+), 36 deletions(-) diff --git a/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.js b/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.js index f35f2a3bf8..34fa721c40 100644 --- a/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.js +++ b/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.js @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -17,10 +17,10 @@ }, "dependencies": { "@microsoft/recognizers-text-data-types-timex-expression": "1.1.4", - "botbuilder": "^4.23.1", - "botbuilder-ai": "^4.23.1", - "botbuilder-dialogs": "^4.23.1", - "botbuilder-testing": "^4.23.1", + "botbuilder": "4.1.6", + "botbuilder-ai": "4.1.6", + "botbuilder-dialogs": "4.1.6", + "botbuilder-testing": "4.1.6", "dotenv": "^8.2.0", "restify": "^11.1.0" }, diff --git a/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts b/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts index 85690fbade..dc170b6f11 100644 --- a/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -38,22 +38,23 @@ }, "dependencies": { "@microsoft/recognizers-text-data-types-timex-expression": "1.1.4", - "botbuilder": "^4.23.1", - "botbuilder-ai": "^4.23.1", - "botbuilder-dialogs": "^4.23.1", - "botbuilder-testing": "^4.23.1", + "botbuilder": "4.1.6", + "botbuilder-ai": "4.1.6", + "botbuilder-dialogs": "4.1.6", + "botbuilder-testing": "4.1.6", "dotenv": "^8.2.0", "replace": "~1.2.0", "restify": "~11.1.0" }, "devDependencies": { "@types/mocha": "^7.0.2", + "@types/node": "^18.19.47", "@types/restify": "8.4.2", "mocha": "^7.1.2", "nodemon": "^2.0.4", "nyc": "^15.0.1", "ts-node": "^8.10.1", "tslint": "^6.1.2", - "typescript": "^4.0.7" + "typescript": "^4.9.3" } } diff --git a/generators/generator-botbuilder/generators/app/templates/core/package.json.js b/generators/generator-botbuilder/generators/app/templates/core/package.json.js index 6b03ed1f59..6b8ae1f9c1 100644 --- a/generators/generator-botbuilder/generators/app/templates/core/package.json.js +++ b/generators/generator-botbuilder/generators/app/templates/core/package.json.js @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -17,9 +17,9 @@ }, "dependencies": { "@microsoft/recognizers-text-data-types-timex-expression": "1.1.4", - "botbuilder": "^4.23.1, - "botbuilder-ai": "^4.23.1", - "botbuilder-dialogs": "^4.23.1", + "botbuilder": "4.1.6", + "botbuilder-ai": "4.1.6", + "botbuilder-dialogs": "4.1.6", "dotenv": "~8.2.0", "restify": "~11.1.0" }, diff --git a/generators/generator-botbuilder/generators/app/templates/core/package.json.ts b/generators/generator-botbuilder/generators/app/templates/core/package.json.ts index 1dfcdb7ecf..85ea67d6c9 100644 --- a/generators/generator-botbuilder/generators/app/templates/core/package.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/core/package.json.ts @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -19,21 +19,22 @@ }, "dependencies": { "@microsoft/recognizers-text-data-types-timex-expression": "1.1.4", - "botbuilder": "^4.23.1", - "botbuilder-ai": "^4.23.1", - "botbuilder-dialogs": "^4.23.1", + "botbuilder": "4.1.6", + "botbuilder-ai": "4.1.6", + "botbuilder-dialogs": "4.1.6", "dotenv": "~8.2.0", "replace": "~1.2.0", "restify": "~11.1.0" }, "devDependencies": { "@types/mocha": "^7.0.2", + "@types/node": "^18.19.47", "@types/restify": "8.4.2", "mocha": "^7.1.2", "nodemon": "^2.0.4", "nyc": "^15.0.1", "ts-node": "^8.10.1", "tslint": "^6.1.2", - "typescript": "^4.0.7" + "typescript": "^4.9.3" } } diff --git a/generators/generator-botbuilder/generators/app/templates/core/tsconfig.json b/generators/generator-botbuilder/generators/app/templates/core/tsconfig.json index fa77e0ac62..7c70e81a34 100644 --- a/generators/generator-botbuilder/generators/app/templates/core/tsconfig.json +++ b/generators/generator-botbuilder/generators/app/templates/core/tsconfig.json @@ -3,13 +3,15 @@ "composite": true, "declaration": true, "target": "es2017", - "module": "commonjs", + "module": "NodeNext", + "moduleResolution": "NodeNext", "outDir": "./lib", "rootDir": "./src", "resolveJsonModule": true, "rootDirs": ["./src", "./resources"], "sourceMap": true, "incremental": true, - "tsBuildInfoFile": "./lib/.tsbuildinfo" + "tsBuildInfoFile": "./lib/.tsbuildinfo", + "esModuleInterop": true } } diff --git a/generators/generator-botbuilder/generators/app/templates/echo/package.json.js b/generators/generator-botbuilder/generators/app/templates/echo/package.json.js index 28b9cfd6b5..775968502c 100644 --- a/generators/generator-botbuilder/generators/app/templates/echo/package.json.js +++ b/generators/generator-botbuilder/generators/app/templates/echo/package.json.js @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -16,7 +16,7 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "^4.23.1", + "botbuilder": "4.1.6", "dotenv": "~8.2.0", "restify": "~11.1.0" }, diff --git a/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts b/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts index 010bb3bb55..7612efdd7b 100644 --- a/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -18,15 +18,16 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "~4.23.1", + "botbuilder": "4.1.6", "dotenv": "~8.2.0", "replace": "~1.2.0", "restify": "~11.1.0" }, "devDependencies": { + "@types/node": "^18.19.47", "@types/restify": "8.4.2", "nodemon": "^2.0.4", "tslint": "^6.1.2", - "typescript": "^4.0.7" + "typescript": "^4.9.3" } } diff --git a/generators/generator-botbuilder/generators/app/templates/echo/tsconfig.json b/generators/generator-botbuilder/generators/app/templates/echo/tsconfig.json index c482a9fa3b..e8548514ec 100644 --- a/generators/generator-botbuilder/generators/app/templates/echo/tsconfig.json +++ b/generators/generator-botbuilder/generators/app/templates/echo/tsconfig.json @@ -2,11 +2,13 @@ "compilerOptions": { "declaration": true, "target": "es2017", - "module": "commonjs", + "moduleResolution": "NodeNext", + "module": "NodeNext", "outDir": "./lib", "rootDir": "./src", "sourceMap": true, "incremental": true, - "tsBuildInfoFile": "./lib/.tsbuildinfo" + "tsBuildInfoFile": "./lib/.tsbuildinfo", + "esModuleInterop": true } } diff --git a/generators/generator-botbuilder/generators/app/templates/empty/package.json.js b/generators/generator-botbuilder/generators/app/templates/empty/package.json.js index e639bc8d7c..1789e68fcd 100644 --- a/generators/generator-botbuilder/generators/app/templates/empty/package.json.js +++ b/generators/generator-botbuilder/generators/app/templates/empty/package.json.js @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -16,7 +16,7 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "^4.23.1", + "botbuilder": "4.1.6", "restify": "~11.1.0" }, "devDependencies": { diff --git a/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts b/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts index 61ebfb57bb..eec344a949 100644 --- a/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts @@ -1,6 +1,6 @@ { "name": "<%= botname %>", - "version": "1.0.0", + "version": "4.1.6", "description": "<%= botDescription %>", "author": "Generated using Microsoft Bot Builder Yeoman generator v<%= version %>", "license": "MIT", @@ -18,14 +18,15 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "^4.23.1", + "botbuilder": "4.1.6", "replace": "~1.2.0", "restify": "~11.1.0" }, "devDependencies": { + "@types/node": "^18.19.47", "@types/restify": "8.4.2", "nodemon": "^2.0.4", "tslint": "^6.1.2", - "typescript": "^4.0.7" + "typescript": "^4.9.3" } } diff --git a/generators/generator-botbuilder/generators/app/templates/empty/tsconfig.json b/generators/generator-botbuilder/generators/app/templates/empty/tsconfig.json index c482a9fa3b..2948716aa0 100644 --- a/generators/generator-botbuilder/generators/app/templates/empty/tsconfig.json +++ b/generators/generator-botbuilder/generators/app/templates/empty/tsconfig.json @@ -2,11 +2,13 @@ "compilerOptions": { "declaration": true, "target": "es2017", - "module": "commonjs", + "module": "NodeNext", + "moduleResolution": "NodeNext", "outDir": "./lib", "rootDir": "./src", "sourceMap": true, "incremental": true, - "tsBuildInfoFile": "./lib/.tsbuildinfo" + "tsBuildInfoFile": "./lib/.tsbuildinfo", + "esModuleInterop": true } } From 8af3364fb2e0525d0dd9a88682e3fbb7283da332 Mon Sep 17 00:00:00 2001 From: CeciliaAvila Date: Thu, 14 Nov 2024 09:08:54 -0300 Subject: [PATCH 2/5] Include generators in update-versions script --- libraries/botbuilder-repo-utils/src/package.ts | 2 +- libraries/botbuilder-repo-utils/src/updateVersions.ts | 7 ++++++- libraries/botbuilder-repo-utils/src/workspace.ts | 6 +++++- package.json | 8 ++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libraries/botbuilder-repo-utils/src/package.ts b/libraries/botbuilder-repo-utils/src/package.ts index afcbdc1913..366c291e76 100644 --- a/libraries/botbuilder-repo-utils/src/package.ts +++ b/libraries/botbuilder-repo-utils/src/package.ts @@ -11,7 +11,7 @@ export interface Package { deprecated?: boolean; internal?: boolean; - workspaces?: { packages: string[] }; + workspaces?: { packages: string[]; generators: string[] }; dependencies?: Record; devDependencies?: Record; diff --git a/libraries/botbuilder-repo-utils/src/updateVersions.ts b/libraries/botbuilder-repo-utils/src/updateVersions.ts index 8b5eddb247..c8d04ed10f 100644 --- a/libraries/botbuilder-repo-utils/src/updateVersions.ts +++ b/libraries/botbuilder-repo-utils/src/updateVersions.ts @@ -94,8 +94,13 @@ export const command = (argv: string[], quiet = false) => async (): Promise>( diff --git a/libraries/botbuilder-repo-utils/src/workspace.ts b/libraries/botbuilder-repo-utils/src/workspace.ts index 7e9ca6c358..aa2feea71c 100644 --- a/libraries/botbuilder-repo-utils/src/workspace.ts +++ b/libraries/botbuilder-repo-utils/src/workspace.ts @@ -41,7 +41,11 @@ export async function collectWorkspacePackages( filters: Partial = {} ): Promise> { // Note: posix is required, this emits absolute paths that are platform specific - const paths = await glob(workspaces.map((workspace) => path.posix.join(repoRoot, workspace, 'package.json'))); + const paths = await glob( + workspaces.map((workspace) => + path.posix.join(repoRoot, workspace, '{package.json,package-with-tests.json}{,.js,.ts}'), + ), + ); const maybeWorkspaces = await Promise.all( paths.map( diff --git a/package.json b/package.json index ce3dfe13d9..41f3220fab 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,12 @@ "workspaces": { "packages": [ "libraries/*", - "libraries/functional-tests/dialogToDialog/*", - "libraries/testskills/*", "testing/*", "testing/browser-functional/browser-echo-bot", - "tools", - "transcripts" + "tools" + ], + "generators": [ + "generators/generator-botbuilder/generators/app/templates/*" ], "nohoist": [ "**/@types/selenium-webdriver" From 0f918f1bd78010500b9176a33b38962b8030d762 Mon Sep 17 00:00:00 2001 From: CeciliaAvila Date: Thu, 14 Nov 2024 10:36:26 -0300 Subject: [PATCH 3/5] Fix pattern in unit tests --- libraries/botbuilder-repo-utils/tests/updateVersions.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/botbuilder-repo-utils/tests/updateVersions.test.ts b/libraries/botbuilder-repo-utils/tests/updateVersions.test.ts index 6121beefca..b2f9ec1f3b 100644 --- a/libraries/botbuilder-repo-utils/tests/updateVersions.test.ts +++ b/libraries/botbuilder-repo-utils/tests/updateVersions.test.ts @@ -189,8 +189,8 @@ describe('updateVersions', function () { return { ...workspace, relPath, - absPath: path.join(root, ...relPath, 'package.json'), - posixPath: path.posix.join(root, ...relPath, 'package.json'), + absPath: path.join(root, ...relPath, '{package.json,package-with-tests.json}{,.js,.ts}'), + posixPath: path.posix.join(root, ...relPath, '{package.json,package-with-tests.json}{,.js,.ts}'), }; }); From 445c8c7ce5d3b9390381af136bc940139bd9788b Mon Sep 17 00:00:00 2001 From: CeciliaAvila Date: Tue, 19 Nov 2024 10:47:58 -0300 Subject: [PATCH 4/5] Fix indentation --- libraries/botbuilder-repo-utils/src/updateVersions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/botbuilder-repo-utils/src/updateVersions.ts b/libraries/botbuilder-repo-utils/src/updateVersions.ts index c8d04ed10f..5894824e31 100644 --- a/libraries/botbuilder-repo-utils/src/updateVersions.ts +++ b/libraries/botbuilder-repo-utils/src/updateVersions.ts @@ -100,7 +100,7 @@ export const command = (argv: string[], quiet = false) => async (): Promise>( From 4ab14411a2b0ac6d31fdcab340cfe1c1d6b2db7c Mon Sep 17 00:00:00 2001 From: CeciliaAvila Date: Thu, 21 Nov 2024 12:58:59 -0300 Subject: [PATCH 5/5] Upgrade TS version to latest --- .../generators/app/templates/core/package-with-tests.json.ts | 2 +- .../generators/app/templates/core/package.json.ts | 2 +- .../generators/app/templates/echo/package.json.ts | 2 +- .../generators/app/templates/empty/package.json.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts b/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts index dc170b6f11..bc24385700 100644 --- a/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/core/package-with-tests.json.ts @@ -55,6 +55,6 @@ "nyc": "^15.0.1", "ts-node": "^8.10.1", "tslint": "^6.1.2", - "typescript": "^4.9.3" + "typescript": "^5.6.3" } } diff --git a/generators/generator-botbuilder/generators/app/templates/core/package.json.ts b/generators/generator-botbuilder/generators/app/templates/core/package.json.ts index 85ea67d6c9..9514e6dc6f 100644 --- a/generators/generator-botbuilder/generators/app/templates/core/package.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/core/package.json.ts @@ -35,6 +35,6 @@ "nyc": "^15.0.1", "ts-node": "^8.10.1", "tslint": "^6.1.2", - "typescript": "^4.9.3" + "typescript": "^5.6.3" } } diff --git a/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts b/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts index 7612efdd7b..a585870422 100644 --- a/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/echo/package.json.ts @@ -28,6 +28,6 @@ "@types/restify": "8.4.2", "nodemon": "^2.0.4", "tslint": "^6.1.2", - "typescript": "^4.9.3" + "typescript": "^5.6.3" } } diff --git a/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts b/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts index eec344a949..37fd94e37c 100644 --- a/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts +++ b/generators/generator-botbuilder/generators/app/templates/empty/package.json.ts @@ -27,6 +27,6 @@ "@types/restify": "8.4.2", "nodemon": "^2.0.4", "tslint": "^6.1.2", - "typescript": "^4.9.3" + "typescript": "^5.6.3" } }