From d17297756e4494ad5979d5e984c369f0764f60ad Mon Sep 17 00:00:00 2001 From: Harold Hunt Date: Thu, 9 May 2024 17:17:03 -0400 Subject: [PATCH 1/3] Bump esbuild node version for CDK builds --- packages/microapps-cdk/.projen/tasks.json | 6 +++--- packages/microapps-cdk/.projenrc.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/microapps-cdk/.projen/tasks.json b/packages/microapps-cdk/.projen/tasks.json index f86de5ee..c80d66cf 100644 --- a/packages/microapps-cdk/.projen/tasks.json +++ b/packages/microapps-cdk/.projen/tasks.json @@ -90,13 +90,13 @@ "exec": "jsii --silence-warnings=reserved-word" }, { - "exec": "esbuild ../microapps-edge-to-origin/src/index.ts --bundle --minify --sourcemap --platform=node --target=node16 --external:aws-sdk --outfile=lib/microapps-edge-to-origin/index.js" + "exec": "esbuild ../microapps-edge-to-origin/src/index.ts --bundle --minify --sourcemap --platform=node --target=node18 --external:aws-sdk --outfile=lib/microapps-edge-to-origin/index.js" }, { - "exec": "esbuild ../microapps-deployer/src/index.ts --bundle --minify --sourcemap --platform=node --target=node16 --external:aws-sdk --outfile=lib/microapps-deployer/index.js" + "exec": "esbuild ../microapps-deployer/src/index.ts --bundle --minify --sourcemap --platform=node --target=node18 --external:aws-sdk --outfile=lib/microapps-deployer/index.js" }, { - "exec": "esbuild ../microapps-router/src/index.ts --bundle --minify --sourcemap --platform=node --target=node16 --external:aws-sdk --outfile=lib/microapps-router/index.js" + "exec": "esbuild ../microapps-router/src/index.ts --bundle --minify --sourcemap --platform=node --target=node18 --external:aws-sdk --outfile=lib/microapps-router/index.js" }, { "exec": "cp -R ../microapps-router/templates lib/microapps-router/" diff --git a/packages/microapps-cdk/.projenrc.js b/packages/microapps-cdk/.projenrc.js index a022aaea..2b19fe8f 100644 --- a/packages/microapps-cdk/.projenrc.js +++ b/packages/microapps-cdk/.projenrc.js @@ -1,6 +1,8 @@ // eslint-disable-next-line import/no-extraneous-dependencies const { awscdk, javascript } = require('projen'); const project = new awscdk.AwsCdkConstructLibrary({ + name: '@pwrdrvr/microapps-cdk', + license: 'MIT', author: 'PwrDrvr LLC', authorAddress: 'harold@pwrdrvr.com', authorOrganization: true, @@ -11,8 +13,6 @@ const project = new awscdk.AwsCdkConstructLibrary({ copyrightOwner: 'PwrDrvr LLC', copyrightPeriod: '2020', defaultReleaseBranch: 'main', - license: 'MIT', - name: '@pwrdrvr/microapps-cdk', releaseToNpm: true, npmAccess: javascript.NpmAccess.PUBLIC, packageManager: javascript.NodePackageManager.YARN_CLASSIC, @@ -95,13 +95,13 @@ project.preCompileTask.exec( // ); project.compileTask.exec( - 'esbuild ../microapps-edge-to-origin/src/index.ts --bundle --minify --sourcemap --platform=node --target=node16 --external:aws-sdk --outfile=lib/microapps-edge-to-origin/index.js', + 'esbuild ../microapps-edge-to-origin/src/index.ts --bundle --minify --sourcemap --platform=node --target=node18 --external:aws-sdk --outfile=lib/microapps-edge-to-origin/index.js', ); project.compileTask.exec( - 'esbuild ../microapps-deployer/src/index.ts --bundle --minify --sourcemap --platform=node --target=node16 --external:aws-sdk --outfile=lib/microapps-deployer/index.js', + 'esbuild ../microapps-deployer/src/index.ts --bundle --minify --sourcemap --platform=node --target=node18 --external:aws-sdk --outfile=lib/microapps-deployer/index.js', ); project.compileTask.exec( - 'esbuild ../microapps-router/src/index.ts --bundle --minify --sourcemap --platform=node --target=node16 --external:aws-sdk --outfile=lib/microapps-router/index.js', + 'esbuild ../microapps-router/src/index.ts --bundle --minify --sourcemap --platform=node --target=node18 --external:aws-sdk --outfile=lib/microapps-router/index.js', ); project.compileTask.exec('cp -R ../microapps-router/templates lib/microapps-router/'); project.compileTask.exec('cp ../microapps-router/templates/* lib/microapps-edge-to-origin/'); From e2ddd829e228419196379d3fbadad62085040a58 Mon Sep 17 00:00:00 2001 From: Harold Hunt Date: Thu, 9 May 2024 17:17:13 -0400 Subject: [PATCH 2/3] Remove unused rollup files --- tsconfig.bundle-deployer.json | 18 ------------------ tsconfig.bundle-router.json | 19 ------------------- 2 files changed, 37 deletions(-) delete mode 100644 tsconfig.bundle-deployer.json delete mode 100644 tsconfig.bundle-router.json diff --git a/tsconfig.bundle-deployer.json b/tsconfig.bundle-deployer.json deleted file mode 100644 index 977c3df8..00000000 --- a/tsconfig.bundle-deployer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "module": "ESNext", - "target": "es2019", - "moduleResolution": "node", - "noImplicitAny": true, - "sourceMap": true, - "allowJs": true, - "resolveJsonModule": true, - - // Used by ts-convict - "emitDecoratorMetadata": true, - "experimentalDecorators": true - }, - "include": ["packages/microapps-deployer/src/index.ts"] -} diff --git a/tsconfig.bundle-router.json b/tsconfig.bundle-router.json deleted file mode 100644 index e18db7ef..00000000 --- a/tsconfig.bundle-router.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "module": "ESNext", - "target": "es2019", - "moduleResolution": "node", - "noImplicitAny": true, - "sourceMap": true, - "strict": false, - "allowJs": true, - "resolveJsonModule": true, - - // Used by ts-convict - "emitDecoratorMetadata": true, - "experimentalDecorators": true - }, - "include": ["packages/microapps-router/src/index.ts"] -} From 7403fe42c62df18d8c4bf4036f1dd0c28fc12bb7 Mon Sep 17 00:00:00 2001 From: Harold Hunt Date: Wed, 15 May 2024 15:16:02 -0400 Subject: [PATCH 3/3] Skip removing types during projen preCompileTask --- packages/microapps-cdk/.projen/tasks.json | 7 +------ packages/microapps-cdk/.projenrc.js | 10 ++++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/microapps-cdk/.projen/tasks.json b/packages/microapps-cdk/.projen/tasks.json index c80d66cf..af4c4e97 100644 --- a/packages/microapps-cdk/.projen/tasks.json +++ b/packages/microapps-cdk/.projen/tasks.json @@ -242,12 +242,7 @@ }, "pre-compile": { "name": "pre-compile", - "description": "Prepare the project for compilation", - "steps": [ - { - "exec": "rm -rf ../../node_modules/@types/prettier/ ../../node_modules/@types/convict/ ../../node_modules/@types/convict-format-with-validator/" - } - ] + "description": "Prepare the project for compilation" }, "release": { "name": "release", diff --git a/packages/microapps-cdk/.projenrc.js b/packages/microapps-cdk/.projenrc.js index 2b19fe8f..a37e6226 100644 --- a/packages/microapps-cdk/.projenrc.js +++ b/packages/microapps-cdk/.projenrc.js @@ -84,10 +84,12 @@ const project = new awscdk.AwsCdkConstructLibrary({ // 114 ? K | `${K}.${PathImpl>}` // -project.preCompileTask.exec( - 'rm -rf ../../node_modules/@types/prettier/ ../../node_modules/@types/convict/ ../../node_modules/@types/convict-format-with-validator/', - // 'patch-package && if [ -d ../../node_modules ] ; then mv ../../node_modules ../../node_modules_hide; fi', -); + +// 2024-05-15 - This is no longer needed now that JSII has been upgrade from v1 to v5.4 +// project.preCompileTask.exec( +// 'rm -rf ../../node_modules/@types/prettier/ ../../node_modules/@types/convict/ ../../node_modules/@types/convict-format-with-validator/', +// // 'patch-package && if [ -d ../../node_modules ] ; then mv ../../node_modules ../../node_modules_hide; fi', +// ); // Move the parent node_modules back into place now that jsii is done // project.compileTask.exec(