From 3090830535c0cdbb95713395d936ce68d4cf6aa5 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 10:02:44 +0300 Subject: [PATCH 01/13] chore: update default versions --- .../src/create-twilio-function/versions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-twilio-function/src/create-twilio-function/versions.js b/packages/create-twilio-function/src/create-twilio-function/versions.js index b7ac1cc7..c2817478 100644 --- a/packages/create-twilio-function/src/create-twilio-function/versions.js +++ b/packages/create-twilio-function/src/create-twilio-function/versions.js @@ -8,6 +8,6 @@ module.exports = { twilioRun: pkgJson.dependencies['twilio-run'], node: '18', typescript: '^5.3.3', - serverlessRuntimeTypes: '^1.1', - copyfiles: '^2.2.0', + serverlessRuntimeTypes: '^4.0.0', + copyfiles: '^2.4.1', }; From 0b5d9e4612e0a05f6f30d1df044484e2744b8fd7 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 11:09:44 +0300 Subject: [PATCH 02/13] chore: try node 10 --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0a9f8fc4..f1bb3812 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,7 +26,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: Update npm to 8.x run: | - npm i -g npm@8 + npm i -g npm@10 - name: npm install, build, and test run: | npm install From c3b093729303457f8cad4cd906044652b3b5ea9c Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 11:11:33 +0300 Subject: [PATCH 03/13] chore: allow legacy peer deps --- .github/workflows/nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index f1bb3812..10389fe0 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,10 +26,10 @@ jobs: node-version: ${{ matrix.node-version }} - name: Update npm to 8.x run: | - npm i -g npm@10 + npm i -g npm@8 - name: npm install, build, and test run: | - npm install + npm install --legacy-peer-deps npm run build npm run test env: From 3fe55d1e179c90749cfa28132cbb44e9275f0cb2 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 11:35:55 +0300 Subject: [PATCH 04/13] chore: check --- .github/workflows/nodejs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 10389fe0..0105eae6 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -27,9 +27,11 @@ jobs: - name: Update npm to 8.x run: | npm i -g npm@8 + npm --version + node --version - name: npm install, build, and test run: | - npm install --legacy-peer-deps + npm install npm run build npm run test env: From 6a3b03d786509b602d04b7aba908aa616173d8b6 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 12:22:58 +0300 Subject: [PATCH 05/13] chore: update typedoc --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 77a3ee67..143f7701 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "prettier": "^2.2.1", "rimraf": "^3.0.2", "ts-jest": "^29.1.2", - "typedoc": "^0.25.12", + "typedoc": "^0.26.5", "typescript": "^5.3.3" }, "lint-staged": { From 6992d278757b37f28bc8f0aaddffe07527cacc4a Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 12:51:52 +0300 Subject: [PATCH 06/13] chore: fix readonly path error --- packages/twilio-run/src/runtime/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/twilio-run/src/runtime/server.ts b/packages/twilio-run/src/runtime/server.ts index 425a7e34..880f3cfc 100644 --- a/packages/twilio-run/src/runtime/server.ts +++ b/packages/twilio-run/src/runtime/server.ts @@ -199,8 +199,8 @@ export async function createServer( : undefined; debug('Legacy mode enabled'); app.use('/assets/*', (req, res, next) => { - req.path = req.path.replace('/assets/', '/'); - next(); + const newReq = { ...req, path: req.path.replace('/assets/', '/') }; + next(newReq); }); } From 6f5cc56a8167115b5717ff49a6b6f96f8b2634a3 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 13:17:56 +0300 Subject: [PATCH 07/13] Revert "chore: fix readonly path error" This reverts commit 6992d278757b37f28bc8f0aaddffe07527cacc4a. --- packages/twilio-run/src/runtime/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/twilio-run/src/runtime/server.ts b/packages/twilio-run/src/runtime/server.ts index 880f3cfc..425a7e34 100644 --- a/packages/twilio-run/src/runtime/server.ts +++ b/packages/twilio-run/src/runtime/server.ts @@ -199,8 +199,8 @@ export async function createServer( : undefined; debug('Legacy mode enabled'); app.use('/assets/*', (req, res, next) => { - const newReq = { ...req, path: req.path.replace('/assets/', '/') }; - next(newReq); + req.path = req.path.replace('/assets/', '/'); + next(); }); } From f97acba284dc098712630463c65ecb43a3f14c77 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 13:22:20 +0300 Subject: [PATCH 08/13] chore: fix express type --- packages/runtime-handler/src/dev-runtime/server.ts | 2 +- packages/serverless-runtime-types/package.json | 3 +-- packages/twilio-run/package.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/runtime-handler/src/dev-runtime/server.ts b/packages/runtime-handler/src/dev-runtime/server.ts index 9f847299..2405a291 100644 --- a/packages/runtime-handler/src/dev-runtime/server.ts +++ b/packages/runtime-handler/src/dev-runtime/server.ts @@ -132,7 +132,7 @@ export class LocalDevelopmentServer extends EventEmitter { : undefined; log('Legacy mode enabled'); app.use('/assets/*', (req, res, next) => { - req.path = req.path.replace('/assets/', '/'); + req.url = req.url.replace('/assets/', '/'); next(); }); } diff --git a/packages/serverless-runtime-types/package.json b/packages/serverless-runtime-types/package.json index 2f525732..6368004d 100644 --- a/packages/serverless-runtime-types/package.json +++ b/packages/serverless-runtime-types/package.json @@ -28,12 +28,11 @@ "url": "https://github.com/twilio-labs/serverless-toolkit/issues" }, "dependencies": { - "@types/express": "^4.17.11", + "@types/express": "^4.17.21", "@types/qs": "^6.9.4", "twilio": "^4.23.0" }, "devDependencies": { - "@types/express": "^4.17.11", "all-contributors-cli": "^6.7.0", "typescript": "^5.3.3" }, diff --git a/packages/twilio-run/package.json b/packages/twilio-run/package.json index 9c22f8b2..71a3463b 100644 --- a/packages/twilio-run/package.json +++ b/packages/twilio-run/package.json @@ -36,7 +36,7 @@ "dependencies": { "@twilio-labs/serverless-api": "^5.5.2", "@twilio-labs/serverless-runtime-types": "4.0.0", - "@types/express": "4.17.7", + "@types/express": "4.17.21", "@types/inquirer": "^6.0.3", "@types/is-ci": "^2.0.0", "@types/qs": "^6.9.4", From bfdfe12b5f4900b7e09ce92cd4d029d5d402e3d6 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 13:25:40 +0300 Subject: [PATCH 09/13] chore: fix express type --- packages/runtime-handler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-handler/package.json b/packages/runtime-handler/package.json index 7157cc3c..68828555 100644 --- a/packages/runtime-handler/package.json +++ b/packages/runtime-handler/package.json @@ -58,7 +58,7 @@ }, "dependencies": { "@twilio-labs/serverless-runtime-types": "^4.0.0", - "@types/express": "4.17.7", + "@types/express": "4.17.21", "chalk": "^4.1.1", "common-tags": "^1.8.0", "cookie-parser": "^1.4.5", From 83a5828a187cd20100fca68460fdc7d5cc3dbdd2 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 13:53:15 +0300 Subject: [PATCH 10/13] chore: fix express type --- packages/runtime-handler/package.json | 1 + packages/runtime-handler/src/dev-runtime/server.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime-handler/package.json b/packages/runtime-handler/package.json index 68828555..47107a16 100644 --- a/packages/runtime-handler/package.json +++ b/packages/runtime-handler/package.json @@ -44,6 +44,7 @@ "@types/cookie-parser": "^1.4.2", "@types/debug": "^4.1.4", "@types/express-useragent": "^0.2.21", + "@types/express-serve-static-core": "4.17.33", "@types/jest": "^26.0.24", "@types/lodash.debounce": "^4.0.6", "@types/node": "^18.0.0", diff --git a/packages/runtime-handler/src/dev-runtime/server.ts b/packages/runtime-handler/src/dev-runtime/server.ts index 2405a291..9f847299 100644 --- a/packages/runtime-handler/src/dev-runtime/server.ts +++ b/packages/runtime-handler/src/dev-runtime/server.ts @@ -132,7 +132,7 @@ export class LocalDevelopmentServer extends EventEmitter { : undefined; log('Legacy mode enabled'); app.use('/assets/*', (req, res, next) => { - req.url = req.url.replace('/assets/', '/'); + req.path = req.path.replace('/assets/', '/'); next(); }); } From 07950ae354bcaff0cbb035fc0eed2026adf566f2 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 13:57:51 +0300 Subject: [PATCH 11/13] chore: update compiler target --- tsconfig.base.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.base.json b/tsconfig.base.json index 4b07d41a..e09132ea 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -2,7 +2,7 @@ "compilerOptions": { /* Basic Options */ "incremental": false /* Enable incremental compilation */, - "target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, + "target": "es2018" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, "lib": [ "es2017", From 1ab63d5be2657db0bf2cc533490c4db2749119b4 Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 14:11:43 +0300 Subject: [PATCH 12/13] chore: changesets --- .changeset/flat-boxes-run.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .changeset/flat-boxes-run.md diff --git a/.changeset/flat-boxes-run.md b/.changeset/flat-boxes-run.md new file mode 100644 index 00000000..7fd45abf --- /dev/null +++ b/.changeset/flat-boxes-run.md @@ -0,0 +1,9 @@ +--- +'@twilio-labs/serverless-runtime-types': patch +'create-twilio-function': patch +'@twilio/runtime-handler': patch +'twilio-run': patch +--- + +- update default version for new projects +- bump dev dependencies @types/express and typedoc From f5ce74a98ab0910a3f92d4e7e4a256e8c4a59e6f Mon Sep 17 00:00:00 2001 From: Victor Ayogu Date: Thu, 1 Aug 2024 14:27:37 +0300 Subject: [PATCH 13/13] chore: use es2018 --- .github/workflows/nodejs.yml | 2 -- tsconfig.base.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 0105eae6..0a9f8fc4 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -27,8 +27,6 @@ jobs: - name: Update npm to 8.x run: | npm i -g npm@8 - npm --version - node --version - name: npm install, build, and test run: | npm install diff --git a/tsconfig.base.json b/tsconfig.base.json index e09132ea..41085f72 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -5,7 +5,7 @@ "target": "es2018" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, "lib": [ - "es2017", + "es2018", "dom" ] /* Specify library files to be included in the compilation. */, // "allowJs": true /* Allow javascript files to be compiled. */,