From 3da3403e601df8b0fa476e2ad4d4614d4990d4b4 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 15:42:44 +1030 Subject: [PATCH 01/13] fix: add log to merge gitignores for nx --- .gitignore | 4 +- packages/prerender-fargate/project.json | 12 ++++- tools/scripts/merge-gitignore.mjs | 72 +++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 tools/scripts/merge-gitignore.mjs diff --git a/.gitignore b/.gitignore index 6aba2523..16b3ae97 100644 --- a/.gitignore +++ b/.gitignore @@ -68,10 +68,12 @@ cdk.out *.tsbuildinfo *.d.ts -*.js .nx/cache .nx/workspace-data !jest.preset.js + +# Used during the publish stage +.npmignore diff --git a/packages/prerender-fargate/project.json b/packages/prerender-fargate/project.json index 62be1c77..7001d1ad 100644 --- a/packages/prerender-fargate/project.json +++ b/packages/prerender-fargate/project.json @@ -9,8 +9,10 @@ "options": { "main": "packages/prerender-fargate/index.ts", "outputPath": "dist/prerender-fargate", - "tsConfig": "packages/prerender-fargate/tsconfig.app.json" - } + "tsConfig": "packages/prerender-fargate/tsconfig.app.json", + "assets": ["packages/prerender-fargate/lib/prerender/**"] + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +29,12 @@ "publish": { "command": "node tools/scripts/publish.mjs prerender-fargate {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs prerender-fargate" + } } }, "tags": [] diff --git a/tools/scripts/merge-gitignore.mjs b/tools/scripts/merge-gitignore.mjs new file mode 100644 index 00000000..071abd14 --- /dev/null +++ b/tools/scripts/merge-gitignore.mjs @@ -0,0 +1,72 @@ +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; + +// Get the current directory using `import.meta.url` +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +function invariant(condition, message) { + if (!condition) { + console.error(message); + process.exit(1); + } +} + +const [, , packageName] = process.argv; +invariant(packageName, `No package name provided.`); + +const rootGitIgnorePath = path.resolve(__dirname, "../../.gitignore"); +const packageDirectory = path.resolve( + __dirname, + `../../packages/${packageName}` +); +const rootNpmIgnorePath = path.resolve(__dirname, "../../.npmignore"); + +// Read and process the root .gitignore +const rootGitIgnore = fs.existsSync(rootGitIgnorePath) + ? fs.readFileSync(rootGitIgnorePath, "utf-8") + : ""; + +// Read and process the package's ignore files +function readIgnoreFile(fileName) { + const filePath = `${packageDirectory}/${fileName}`; + + if (fs.existsSync(filePath)) { + // Get the relative path to the root + const fileRelativeDirectory = path.relative( + path.resolve(__dirname, "../.."), + packageDirectory + ); + + return fs + .readFileSync(filePath, "utf-8") + .split("\n") + .map(line => { + // Adjust relative paths, skip comments and empty lines + if (!line.trim() || line.startsWith("#")) return line; + if (line.startsWith("!")) { + return `!${path.join(fileRelativeDirectory, line.slice(1))}`; + } + return path.join(fileRelativeDirectory, line); + }) + .join("\n"); + } +} + +// Combine and de-duplicate lines +const combinedGitIgnore = Array.from( + new Set([ + ...rootGitIgnore.split("\n"), + "# Ignores added from .gitignore at the package level", + ...readIgnoreFile(".gitignore").split("\n"), + "# Ignores added from .npmignore at the package level", + ...readIgnoreFile(".npmignore").split("\n"), + ]) +) + .filter(Boolean) + .join("\n"); + +// Write the merged .npmignore +fs.writeFileSync(rootNpmIgnorePath, combinedGitIgnore); +console.log(`Merged .gitignore written to ${rootGitIgnorePath}`); From 27dbfbbd4820f483b0fa043e446f3597ae1cc586 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 15:52:32 +1030 Subject: [PATCH 02/13] fix: include handlers in basic auth --- packages/basic-auth/.gitignore | 58 ------------------------------- packages/basic-auth/.npmignore | 11 ------ packages/basic-auth/.npmrc | 1 - packages/basic-auth/.nvmrc | 1 - packages/basic-auth/project.json | 12 +++++-- tools/scripts/merge-gitignore.mjs | 2 ++ 6 files changed, 12 insertions(+), 73 deletions(-) delete mode 100644 packages/basic-auth/.gitignore delete mode 100644 packages/basic-auth/.npmignore delete mode 100644 packages/basic-auth/.npmrc delete mode 100644 packages/basic-auth/.nvmrc diff --git a/packages/basic-auth/.gitignore b/packages/basic-auth/.gitignore deleted file mode 100644 index 75ecda95..00000000 --- a/packages/basic-auth/.gitignore +++ /dev/null @@ -1,58 +0,0 @@ -# These are some examples of commonly ignored file patterns. -# You should customize this list as applicable to your project. -# Learn more about .gitignore: -# https://www.atlassian.com/git/tutorials/saving-changes/gitignore - -# Node artifact files -node_modules/ -dist/ - -# Compiled Java class files -*.class - -# Compiled Python bytecode -*.py[cod] - -# Log files -*.log - -# Package files -*.jar - -# Maven -target/ -dist/ - -# JetBrains IDE -.idea/ - -# Unit test reports -TEST*.xml - -# Generated by MacOS -.DS_Store - -# Generated by Windows -Thumbs.db - -# Applications -*.app -*.exe -*.war - -# Large media files -*.mp4 -*.tiff -*.avi -*.flv -*.mov -*.wmv - -!jest.config.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -*.d.ts -*.js \ No newline at end of file diff --git a/packages/basic-auth/.npmignore b/packages/basic-auth/.npmignore deleted file mode 100644 index 1464bb5c..00000000 --- a/packages/basic-auth/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ \ No newline at end of file diff --git a/packages/basic-auth/.npmrc b/packages/basic-auth/.npmrc deleted file mode 100644 index 3b9bddfc..00000000 --- a/packages/basic-auth/.npmrc +++ /dev/null @@ -1 +0,0 @@ -10.1.0 \ No newline at end of file diff --git a/packages/basic-auth/.nvmrc b/packages/basic-auth/.nvmrc deleted file mode 100644 index ef1520fc..00000000 --- a/packages/basic-auth/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20.7.0 \ No newline at end of file diff --git a/packages/basic-auth/project.json b/packages/basic-auth/project.json index 4bc57253..83c7aa23 100644 --- a/packages/basic-auth/project.json +++ b/packages/basic-auth/project.json @@ -9,8 +9,10 @@ "options": { "main": "packages/basic-auth/index.ts", "outputPath": "dist/basic-auth", - "tsConfig": "packages/basic-auth/tsconfig.app.json" - } + "tsConfig": "packages/basic-auth/tsconfig.app.json", + "assets": ["packages/basic-auth/lib/handlers/**"] + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +29,12 @@ "publish": { "command": "node tools/scripts/publish.mjs basic-auth {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs basic-auth" + } } }, "tags": [] diff --git a/tools/scripts/merge-gitignore.mjs b/tools/scripts/merge-gitignore.mjs index 071abd14..311cbdd8 100644 --- a/tools/scripts/merge-gitignore.mjs +++ b/tools/scripts/merge-gitignore.mjs @@ -51,6 +51,8 @@ function readIgnoreFile(fileName) { return path.join(fileRelativeDirectory, line); }) .join("\n"); + } else { + return ""; } } From 2757f5b196ffea966703d9fc1affd7862203e797 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:09:39 +1030 Subject: [PATCH 03/13] fix: include handlers cf security headers --- packages/cloudfront-security-headers/.gitignore | 8 -------- packages/cloudfront-security-headers/.npmignore | 11 ----------- packages/cloudfront-security-headers/.npmrc | 1 - packages/cloudfront-security-headers/.nvmrc | 1 - packages/cloudfront-security-headers/project.json | 12 ++++++++++-- 5 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 packages/cloudfront-security-headers/.gitignore delete mode 100644 packages/cloudfront-security-headers/.npmignore delete mode 100644 packages/cloudfront-security-headers/.npmrc delete mode 100644 packages/cloudfront-security-headers/.nvmrc diff --git a/packages/cloudfront-security-headers/.gitignore b/packages/cloudfront-security-headers/.gitignore deleted file mode 100644 index f60797b6..00000000 --- a/packages/cloudfront-security-headers/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.js -!jest.config.js -*.d.ts -node_modules - -# CDK asset staging directory -.cdk.staging -cdk.out diff --git a/packages/cloudfront-security-headers/.npmignore b/packages/cloudfront-security-headers/.npmignore deleted file mode 100644 index bfd115ba..00000000 --- a/packages/cloudfront-security-headers/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ diff --git a/packages/cloudfront-security-headers/.npmrc b/packages/cloudfront-security-headers/.npmrc deleted file mode 100644 index 3b9bddfc..00000000 --- a/packages/cloudfront-security-headers/.npmrc +++ /dev/null @@ -1 +0,0 @@ -10.1.0 \ No newline at end of file diff --git a/packages/cloudfront-security-headers/.nvmrc b/packages/cloudfront-security-headers/.nvmrc deleted file mode 100644 index ef1520fc..00000000 --- a/packages/cloudfront-security-headers/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20.7.0 \ No newline at end of file diff --git a/packages/cloudfront-security-headers/project.json b/packages/cloudfront-security-headers/project.json index 3dc6d82c..7be271a9 100644 --- a/packages/cloudfront-security-headers/project.json +++ b/packages/cloudfront-security-headers/project.json @@ -9,8 +9,10 @@ "options": { "main": "packages/cloudfront-security-headers/index.ts", "outputPath": "dist/cloudfront-security-headers", - "tsConfig": "packages/cloudfront-security-headers/tsconfig.app.json" - } + "tsConfig": "packages/cloudfront-security-headers/tsconfig.app.json", + "assets": ["packages/cloudfront-security-headers/lib/handlers/**"] + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +29,12 @@ "publish": { "command": "node tools/scripts/publish.mjs cloudfront-security-headers {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs cloudfront-security-headers" + } } }, "tags": [] From 1eec2147b27d1c1080002f8a3374a70b2d359a5b Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:24:34 +1030 Subject: [PATCH 04/13] fix: add merge gitignore step --- packages/esbuild/.npmignore | 3 --- packages/esbuild/project.json | 9 ++++++++- 2 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 packages/esbuild/.npmignore diff --git a/packages/esbuild/.npmignore b/packages/esbuild/.npmignore deleted file mode 100644 index 01a5f85d..00000000 --- a/packages/esbuild/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*.ts -!*.d.ts -!*.js diff --git a/packages/esbuild/project.json b/packages/esbuild/project.json index c01f9adc..2b989b88 100644 --- a/packages/esbuild/project.json +++ b/packages/esbuild/project.json @@ -10,7 +10,8 @@ "main": "packages/esbuild/index.ts", "outputPath": "dist/esbuild", "tsConfig": "packages/esbuild/tsconfig.app.json" - } + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +28,12 @@ "publish": { "command": "node tools/scripts/publish.mjs esbuild {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs esbuild" + } } }, "tags": [] From 09bd62bdfc8601a18ef0be0a3491557bfcd9a7e4 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:27:48 +1030 Subject: [PATCH 05/13] fix: add merge gitignore script to feature env handlers --- packages/feature-env-handlers/project.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/feature-env-handlers/project.json b/packages/feature-env-handlers/project.json index f6cccc67..dcbf23e3 100644 --- a/packages/feature-env-handlers/project.json +++ b/packages/feature-env-handlers/project.json @@ -10,7 +10,8 @@ "main": "packages/feature-env-handlers/index.ts", "outputPath": "dist/feature-env-handlers", "tsConfig": "packages/feature-env-handlers/tsconfig.app.json" - } + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +28,12 @@ "publish": { "command": "node tools/scripts/publish.mjs feature-env-handlers {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs feature-env-handlers" + } } }, "tags": [] From dd608cf80a215610ee7313d992d79c65db218e50 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:31:39 +1030 Subject: [PATCH 06/13] fix: include geoip redirect handlers --- packages/geoip-redirect/.gitignore | 58 ---------------------------- packages/geoip-redirect/.npmignore | 11 ------ packages/geoip-redirect/project.json | 12 +++++- 3 files changed, 10 insertions(+), 71 deletions(-) delete mode 100644 packages/geoip-redirect/.gitignore delete mode 100644 packages/geoip-redirect/.npmignore diff --git a/packages/geoip-redirect/.gitignore b/packages/geoip-redirect/.gitignore deleted file mode 100644 index 8f77f768..00000000 --- a/packages/geoip-redirect/.gitignore +++ /dev/null @@ -1,58 +0,0 @@ -# These are some examples of commonly ignored file patterns. -# You should customize this list as applicable to your project. -# Learn more about .gitignore: -# https://www.atlassian.com/git/tutorials/saving-changes/gitignore - -# Node artifact files -node_modules/ -dist/ - -# Compiled Java class files -*.class - -# Compiled Python bytecode -*.py[cod] - -# Log files -*.log - -# Package files -*.jar - -# Maven -target/ -dist/ - -# JetBrains IDE -.idea/ - -# Unit test reports -TEST*.xml - -# Generated by MacOS -.DS_Store - -# Generated by Windows -Thumbs.db - -# Applications -*.app -*.exe -*.war - -# Large media files -*.mp4 -*.tiff -*.avi -*.flv -*.mov -*.wmv - -!jest.config.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -*.d.ts -*.js diff --git a/packages/geoip-redirect/.npmignore b/packages/geoip-redirect/.npmignore deleted file mode 100644 index bfd115ba..00000000 --- a/packages/geoip-redirect/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ diff --git a/packages/geoip-redirect/project.json b/packages/geoip-redirect/project.json index ffe1d882..c47c11c8 100644 --- a/packages/geoip-redirect/project.json +++ b/packages/geoip-redirect/project.json @@ -9,8 +9,10 @@ "options": { "main": "packages/geoip-redirect/index.ts", "outputPath": "dist/geoip-redirect", - "tsConfig": "packages/geoip-redirect/tsconfig.app.json" - } + "tsConfig": "packages/geoip-redirect/tsconfig.app.json", + "assets": ["packages/geoip-redirect/lib/handlers/**"] + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +29,12 @@ "publish": { "command": "node tools/scripts/publish.mjs geoip-redirect {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs geoip-redirect" + } } }, "tags": [] From a1f33e43a5bcc08c6226c3e8c28b129d59bd28f7 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:34:04 +1030 Subject: [PATCH 07/13] fix: include assets for graphql-mesh-server --- packages/graphql-mesh-server/.npmignore | 11 ----------- packages/graphql-mesh-server/project.json | 12 ++++++++++-- 2 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 packages/graphql-mesh-server/.npmignore diff --git a/packages/graphql-mesh-server/.npmignore b/packages/graphql-mesh-server/.npmignore deleted file mode 100644 index b41cc365..00000000 --- a/packages/graphql-mesh-server/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!assets/handlers/**/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ diff --git a/packages/graphql-mesh-server/project.json b/packages/graphql-mesh-server/project.json index 6a66a28a..7fa43e11 100644 --- a/packages/graphql-mesh-server/project.json +++ b/packages/graphql-mesh-server/project.json @@ -9,8 +9,10 @@ "options": { "main": "packages/graphql-mesh-server/index.ts", "outputPath": "dist/graphql-mesh-server", - "tsConfig": "packages/graphql-mesh-server/tsconfig.app.json" - } + "tsConfig": "packages/graphql-mesh-server/tsconfig.app.json", + "assets": ["packages/graphql-mesh-server/assets/**"] + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +29,12 @@ "publish": { "command": "node tools/scripts/publish.mjs graphql-mesh-server {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs graphql-mesh-server" + } } }, "tags": [] From a9cedb0f6479af42a307ddc57c529006b14a377a Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:35:30 +1030 Subject: [PATCH 08/13] fix: remove ignore files from prerender-fargate --- packages/prerender-fargate/.gitignore | 1 - packages/prerender-fargate/.npmignore | 11 ----------- 2 files changed, 12 deletions(-) delete mode 100644 packages/prerender-fargate/.gitignore delete mode 100644 packages/prerender-fargate/.npmignore diff --git a/packages/prerender-fargate/.gitignore b/packages/prerender-fargate/.gitignore deleted file mode 100644 index 14559189..00000000 --- a/packages/prerender-fargate/.gitignore +++ /dev/null @@ -1 +0,0 @@ -!lib/prerender/** diff --git a/packages/prerender-fargate/.npmignore b/packages/prerender-fargate/.npmignore deleted file mode 100644 index bfd115ba..00000000 --- a/packages/prerender-fargate/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ From 1af341d01607e26ece72c221fc5b6d673b513fec Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:47:44 +1030 Subject: [PATCH 09/13] fix: include headers in prerender proxy --- packages/prerender-proxy/.npmignore | 11 ----------- packages/prerender-proxy/project.json | 12 ++++++++++-- 2 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 packages/prerender-proxy/.npmignore diff --git a/packages/prerender-proxy/.npmignore b/packages/prerender-proxy/.npmignore deleted file mode 100644 index 1464bb5c..00000000 --- a/packages/prerender-proxy/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ \ No newline at end of file diff --git a/packages/prerender-proxy/project.json b/packages/prerender-proxy/project.json index 7086bc2e..c8b23d8c 100644 --- a/packages/prerender-proxy/project.json +++ b/packages/prerender-proxy/project.json @@ -9,8 +9,10 @@ "options": { "main": "packages/prerender-proxy/index.ts", "outputPath": "dist/prerender-proxy", - "tsConfig": "packages/prerender-proxy/tsconfig.app.json" - } + "tsConfig": "packages/prerender-proxy/tsconfig.app.json", + "assets": ["packages/prerender-proxy/lib/handlers/**"] + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -30,6 +32,12 @@ "publish": { "command": "node tools/scripts/publish.mjs prerender-proxy {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs prerender-proxy" + } } }, "tags": [] From f76a9503ceb6eaf752952145249037ae71403a0d Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:48:54 +1030 Subject: [PATCH 10/13] fix: add gitignore merge logic to rabbitmq --- packages/rabbitmq/.gitignore | 8 -------- packages/rabbitmq/.npmignore | 11 ----------- packages/rabbitmq/.npmrc | 1 - packages/rabbitmq/.nvmrc | 1 - packages/rabbitmq/project.json | 9 ++++++++- 5 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 packages/rabbitmq/.gitignore delete mode 100644 packages/rabbitmq/.npmignore delete mode 100644 packages/rabbitmq/.npmrc delete mode 100644 packages/rabbitmq/.nvmrc diff --git a/packages/rabbitmq/.gitignore b/packages/rabbitmq/.gitignore deleted file mode 100644 index 4bdca62e..00000000 --- a/packages/rabbitmq/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.js -!jest.config.js -*.d.ts -node_modules - -# CDK asset staging directory -.cdk.staging -cdk.out \ No newline at end of file diff --git a/packages/rabbitmq/.npmignore b/packages/rabbitmq/.npmignore deleted file mode 100644 index 1464bb5c..00000000 --- a/packages/rabbitmq/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ \ No newline at end of file diff --git a/packages/rabbitmq/.npmrc b/packages/rabbitmq/.npmrc deleted file mode 100644 index 3b9bddfc..00000000 --- a/packages/rabbitmq/.npmrc +++ /dev/null @@ -1 +0,0 @@ -10.1.0 \ No newline at end of file diff --git a/packages/rabbitmq/.nvmrc b/packages/rabbitmq/.nvmrc deleted file mode 100644 index ef1520fc..00000000 --- a/packages/rabbitmq/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20.7.0 \ No newline at end of file diff --git a/packages/rabbitmq/project.json b/packages/rabbitmq/project.json index 24079ab9..3aed5d23 100644 --- a/packages/rabbitmq/project.json +++ b/packages/rabbitmq/project.json @@ -10,7 +10,8 @@ "main": "packages/rabbitmq/index.ts", "outputPath": "dist/rabbitmq", "tsConfig": "packages/rabbitmq/tsconfig.app.json" - } + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +28,12 @@ "publish": { "command": "node tools/scripts/publish.mjs rabbitmq {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs rabbitmq" + } } }, "tags": [] From 9cb21c2ac9cfbf77f63242b5c23aeed657cb588c Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:51:15 +1030 Subject: [PATCH 11/13] fix: added gitignore merge logic to shared vpc --- packages/shared-vpc/.gitignore | 8 -------- packages/shared-vpc/.npmignore | 11 ----------- packages/shared-vpc/project.json | 9 ++++++++- 3 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 packages/shared-vpc/.gitignore delete mode 100644 packages/shared-vpc/.npmignore diff --git a/packages/shared-vpc/.gitignore b/packages/shared-vpc/.gitignore deleted file mode 100644 index f60797b6..00000000 --- a/packages/shared-vpc/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.js -!jest.config.js -*.d.ts -node_modules - -# CDK asset staging directory -.cdk.staging -cdk.out diff --git a/packages/shared-vpc/.npmignore b/packages/shared-vpc/.npmignore deleted file mode 100644 index 1464bb5c..00000000 --- a/packages/shared-vpc/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ \ No newline at end of file diff --git a/packages/shared-vpc/project.json b/packages/shared-vpc/project.json index 68677b75..c42bd1fb 100644 --- a/packages/shared-vpc/project.json +++ b/packages/shared-vpc/project.json @@ -10,7 +10,8 @@ "main": "packages/shared-vpc/index.ts", "outputPath": "dist/shared-vpc", "tsConfig": "packages/shared-vpc/tsconfig.app.json" - } + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +28,12 @@ "publish": { "command": "node tools/scripts/publish.mjs shared-vpc {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs shared-vpc" + } } }, "tags": [] From 2bf69763b8dab053931264edd8d08810f615b882 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 16:58:20 +1030 Subject: [PATCH 12/13] fix: include handlers in static hosting construct --- packages/static-hosting/.gitignore | 58 ---------------------------- packages/static-hosting/.npmignore | 11 ------ packages/static-hosting/.npmrc | 1 - packages/static-hosting/.nvmrc | 1 - packages/static-hosting/project.json | 12 +++++- 5 files changed, 10 insertions(+), 73 deletions(-) delete mode 100644 packages/static-hosting/.gitignore delete mode 100644 packages/static-hosting/.npmignore delete mode 100644 packages/static-hosting/.npmrc delete mode 100644 packages/static-hosting/.nvmrc diff --git a/packages/static-hosting/.gitignore b/packages/static-hosting/.gitignore deleted file mode 100644 index 8f77f768..00000000 --- a/packages/static-hosting/.gitignore +++ /dev/null @@ -1,58 +0,0 @@ -# These are some examples of commonly ignored file patterns. -# You should customize this list as applicable to your project. -# Learn more about .gitignore: -# https://www.atlassian.com/git/tutorials/saving-changes/gitignore - -# Node artifact files -node_modules/ -dist/ - -# Compiled Java class files -*.class - -# Compiled Python bytecode -*.py[cod] - -# Log files -*.log - -# Package files -*.jar - -# Maven -target/ -dist/ - -# JetBrains IDE -.idea/ - -# Unit test reports -TEST*.xml - -# Generated by MacOS -.DS_Store - -# Generated by Windows -Thumbs.db - -# Applications -*.app -*.exe -*.war - -# Large media files -*.mp4 -*.tiff -*.avi -*.flv -*.mov -*.wmv - -!jest.config.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -*.d.ts -*.js diff --git a/packages/static-hosting/.npmignore b/packages/static-hosting/.npmignore deleted file mode 100644 index bfd115ba..00000000 --- a/packages/static-hosting/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ diff --git a/packages/static-hosting/.npmrc b/packages/static-hosting/.npmrc deleted file mode 100644 index 3b9bddfc..00000000 --- a/packages/static-hosting/.npmrc +++ /dev/null @@ -1 +0,0 @@ -10.1.0 \ No newline at end of file diff --git a/packages/static-hosting/.nvmrc b/packages/static-hosting/.nvmrc deleted file mode 100644 index ef1520fc..00000000 --- a/packages/static-hosting/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20.7.0 \ No newline at end of file diff --git a/packages/static-hosting/project.json b/packages/static-hosting/project.json index e2295d52..6bd116aa 100644 --- a/packages/static-hosting/project.json +++ b/packages/static-hosting/project.json @@ -9,8 +9,10 @@ "options": { "main": "packages/static-hosting/index.ts", "outputPath": "dist/static-hosting", - "tsConfig": "packages/static-hosting/tsconfig.app.json" - } + "tsConfig": "packages/static-hosting/tsconfig.app.json", + "assets": ["packages/static-hosting/lib/handlers/**"] + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +29,12 @@ "publish": { "command": "node tools/scripts/publish.mjs static-hosting {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs static-hosting" + } } }, "tags": [] From 0e5d02941eb6f474bd3d438ba311d51508ea0fb6 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Ploeg Date: Thu, 5 Dec 2024 17:01:06 +1030 Subject: [PATCH 13/13] fix: add gitignore merge logic to waf construct --- packages/waf/.gitignore | 58 --------------------------------------- packages/waf/.npmignore | 11 -------- packages/waf/.npmrc | 1 - packages/waf/.nvmrc | 1 - packages/waf/project.json | 9 +++++- 5 files changed, 8 insertions(+), 72 deletions(-) delete mode 100644 packages/waf/.gitignore delete mode 100644 packages/waf/.npmignore delete mode 100644 packages/waf/.npmrc delete mode 100644 packages/waf/.nvmrc diff --git a/packages/waf/.gitignore b/packages/waf/.gitignore deleted file mode 100644 index 8f77f768..00000000 --- a/packages/waf/.gitignore +++ /dev/null @@ -1,58 +0,0 @@ -# These are some examples of commonly ignored file patterns. -# You should customize this list as applicable to your project. -# Learn more about .gitignore: -# https://www.atlassian.com/git/tutorials/saving-changes/gitignore - -# Node artifact files -node_modules/ -dist/ - -# Compiled Java class files -*.class - -# Compiled Python bytecode -*.py[cod] - -# Log files -*.log - -# Package files -*.jar - -# Maven -target/ -dist/ - -# JetBrains IDE -.idea/ - -# Unit test reports -TEST*.xml - -# Generated by MacOS -.DS_Store - -# Generated by Windows -Thumbs.db - -# Applications -*.app -*.exe -*.war - -# Large media files -*.mp4 -*.tiff -*.avi -*.flv -*.mov -*.wmv - -!jest.config.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -*.d.ts -*.js diff --git a/packages/waf/.npmignore b/packages/waf/.npmignore deleted file mode 100644 index bfd115ba..00000000 --- a/packages/waf/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ts -!lib/handlers/*.ts -!*.d.ts -!*.js - -# CDK asset staging directory -.cdk.staging -cdk.out - -# Samples -sample/ diff --git a/packages/waf/.npmrc b/packages/waf/.npmrc deleted file mode 100644 index 3b9bddfc..00000000 --- a/packages/waf/.npmrc +++ /dev/null @@ -1 +0,0 @@ -10.1.0 \ No newline at end of file diff --git a/packages/waf/.nvmrc b/packages/waf/.nvmrc deleted file mode 100644 index ef1520fc..00000000 --- a/packages/waf/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20.7.0 \ No newline at end of file diff --git a/packages/waf/project.json b/packages/waf/project.json index 4ba6c7d3..a51d9a44 100644 --- a/packages/waf/project.json +++ b/packages/waf/project.json @@ -10,7 +10,8 @@ "main": "packages/waf/index.ts", "outputPath": "dist/waf", "tsConfig": "packages/waf/tsconfig.app.json" - } + }, + "dependsOn": ["merge-gitignore"] }, "lint": { "executor": "@nx/eslint:lint", @@ -27,6 +28,12 @@ "publish": { "command": "node tools/scripts/publish.mjs waf {args.ver} {args.tag}", "dependsOn": ["build"] + }, + "merge-gitignore": { + "executor": "nx:run-commands", + "options": { + "command": "node tools/scripts/merge-gitignore.mjs waf" + } } }, "tags": []