diff --git a/packages/basic-auth/package.json b/packages/basic-auth/package.json index 66d6a454..a04a5708 100644 --- a/packages/basic-auth/package.json +++ b/packages/basic-auth/package.json @@ -4,8 +4,7 @@ "description": "A Cloudfront Lambda@Edge stack for performing basic auth protection", "main": "index.js", "scripts": { - "build": "tsc && cd ./lib/handlers && npm ci", - "prepublish": "tsc && cd ./lib/handlers && npm ci" + "build": "tsc && cd ./lib/handlers && npm ci" }, "repository": { "type": "git", @@ -24,7 +23,8 @@ "jest": "^29.7.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "@aligent/esbuild": "^2.0" }, "dependencies": { "aws-cdk-lib": "2.97.0", diff --git a/packages/cloudfront-security-headers/lib/index.ts b/packages/cloudfront-security-headers/lib/index.ts index 3df24046..d5f33bdb 100644 --- a/packages/cloudfront-security-headers/lib/index.ts +++ b/packages/cloudfront-security-headers/lib/index.ts @@ -19,7 +19,9 @@ export class SecurityHeaderFunction extends Construct { ) { super(scope, id); - const defineOptions: any = {}; + const defineOptions: { + __CONTENT_SECURITY_POLICY__?: string; + } = {}; if (props?.contentSecurityPolicy) { defineOptions.__CONTENT_SECURITY_POLICY__ = JSON.stringify( diff --git a/packages/cloudfront-security-headers/package.json b/packages/cloudfront-security-headers/package.json index 21b3d112..5b866b0b 100644 --- a/packages/cloudfront-security-headers/package.json +++ b/packages/cloudfront-security-headers/package.json @@ -6,7 +6,6 @@ "types": "lib/index.d.ts", "scripts": { "build": "tsc && cd ./lib/handlers && npm ci", - "prepublish": "tsc && cd ./lib/handlers && npm ci", "watch": "tsc -w", "test": "jest" }, @@ -18,7 +17,8 @@ "jest": "^29.7.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "@aligent/esbuild": "^2.0" }, "dependencies": { "aws-cdk-lib": "2.97.0", diff --git a/packages/cloudfront-security-headers/test/cdk-cloudfront-security-headers.test.ts b/packages/cloudfront-security-headers/test/cdk-cloudfront-security-headers.test.ts deleted file mode 100644 index f862c662..00000000 --- a/packages/cloudfront-security-headers/test/cdk-cloudfront-security-headers.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -// import { expect as expectCDK, countResources } from "@aws-cdk/assert"; -// import * as cdk from "aws-cdk-lib"; -// import { SecurityHeaderFunction } from "../lib/index"; - -/* - * Example test - */ -// test("Lambda Function Created", () => { -// const app = new cdk.App(); -// const stack = new cdk.Stack(app, "TestStack", { -// env: { region: "us-east-1" }, -// }); -// // WHEN -// new SecurityHeaderFunction(stack, "MyTestConstruct"); -// // THEN -// expectCDK(stack).to(countResources("AWS::Lambda::Function", 1)); -// }); diff --git a/packages/esbuild/package.json b/packages/esbuild/package.json index 913393a4..889265d2 100644 --- a/packages/esbuild/package.json +++ b/packages/esbuild/package.json @@ -5,8 +5,7 @@ "main": "index.js", "license": "GPL-3.0-only", "scripts": { - "build": "tsc", - "prepublish": "tsc" + "build": "tsc" }, "devDependencies": { "@types/jest": "^29.5.5", diff --git a/packages/esbuild/tsconfig.json b/packages/esbuild/tsconfig.json index 4082f16a..99bd998d 100644 --- a/packages/esbuild/tsconfig.json +++ b/packages/esbuild/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "../../tsconfig.json" + "extends": "../../tsconfig.json", + "compilerOptions": { + "skipLibCheck": true + } } diff --git a/packages/geoip-redirect/package.json b/packages/geoip-redirect/package.json index 2da8c69f..004b873d 100644 --- a/packages/geoip-redirect/package.json +++ b/packages/geoip-redirect/package.json @@ -4,8 +4,7 @@ "description": "A Cloudfront Lambda@Edge stack for performing redirection based on CloudFront-Viewer-Country", "main": "index.js", "scripts": { - "build": "tsc && cd ./lib/handlers && npm ci", - "prepublish": "tsc && cd ./lib/handlers && npm ci" + "build": "tsc && cd ./lib/handlers && npm ci" }, "repository": { "type": "git", @@ -24,7 +23,8 @@ "jest": "^29.7.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "@aligent/esbuild": "^2.0" }, "dependencies": { "aws-cdk-lib": "2.97.0", diff --git a/packages/graphql-mesh-server/package.json b/packages/graphql-mesh-server/package.json index df512e91..2377029c 100644 --- a/packages/graphql-mesh-server/package.json +++ b/packages/graphql-mesh-server/package.json @@ -4,8 +4,7 @@ "description": "A construct to host Graphql Mesh in Fargate", "main": "index.js", "scripts": { - "build": "tsc", - "prepublish": "tsc" + "build": "tsc" }, "repository": { "type": "git", diff --git a/packages/lambda-at-edge-handlers/package.json b/packages/lambda-at-edge-handlers/package.json index aba08db8..087c22d1 100644 --- a/packages/lambda-at-edge-handlers/package.json +++ b/packages/lambda-at-edge-handlers/package.json @@ -5,7 +5,6 @@ "main": "index.js", "scripts": { "build": "tsc", - "prepublish": "tsc", "watch": "tsc -w", "test": "echo \"No test specified\" && exit 0" }, diff --git a/packages/prerender-fargate/package.json b/packages/prerender-fargate/package.json index 64543be1..d3544625 100644 --- a/packages/prerender-fargate/package.json +++ b/packages/prerender-fargate/package.json @@ -4,8 +4,7 @@ "description": "A construct to host Prerender in Fargate", "main": "index.js", "scripts": { - "build": "tsc", - "prepublish": "tsc" + "build": "tsc" }, "repository": { "type": "git", diff --git a/packages/prerender-proxy/package.json b/packages/prerender-proxy/package.json index 4725ac32..0990f017 100644 --- a/packages/prerender-proxy/package.json +++ b/packages/prerender-proxy/package.json @@ -4,8 +4,7 @@ "description": "Cloudfront Lambda@Edge constructs for integrating with prerender.io", "main": "index.js", "scripts": { - "build": "tsc && cd ./lib/handlers && npm ci", - "prepublish": "tsc && cd ./lib/handlers && npm ci" + "build": "tsc" }, "repository": { "type": "git", @@ -24,7 +23,8 @@ "jest": "^29.7.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "@aligent/esbuild": "^2.0" }, "dependencies": { "aws-cdk-lib": "2.97.0", diff --git a/packages/rabbitmq/package.json b/packages/rabbitmq/package.json index 0b47cdd5..66b4772d 100644 --- a/packages/rabbitmq/package.json +++ b/packages/rabbitmq/package.json @@ -10,8 +10,7 @@ }, "types": "index.d.ts", "scripts": { - "build": "tsc", - "prepublish": "tsc" + "build": "tsc" }, "devDependencies": { "@types/jest": "^29.5.5", diff --git a/packages/shared-vpc/package.json b/packages/shared-vpc/package.json index 36738100..41279b9d 100644 --- a/packages/shared-vpc/package.json +++ b/packages/shared-vpc/package.json @@ -3,8 +3,7 @@ "version": "2.0.0", "main": "index.js", "scripts": { - "build": "tsc", - "prepublish": "tsc" + "build": "tsc" }, "devDependencies": { "@types/jest": "^29.5.5", diff --git a/packages/static-hosting/package.json b/packages/static-hosting/package.json index 1420065d..bcef5366 100644 --- a/packages/static-hosting/package.json +++ b/packages/static-hosting/package.json @@ -10,8 +10,7 @@ }, "types": "index.d.ts", "scripts": { - "build": "tsc", - "prepublish": "tsc" + "build": "tsc" }, "devDependencies": { "@types/jest": "^29.5.5", @@ -21,7 +20,8 @@ "jest": "^29.7.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "@aligent/esbuild": "^2.0" }, "dependencies": { "aws-cdk-lib": "2.97.0", diff --git a/packages/waf/package.json b/packages/waf/package.json index fe511827..4ab8df1f 100644 --- a/packages/waf/package.json +++ b/packages/waf/package.json @@ -10,8 +10,7 @@ }, "types": "index.d.ts", "scripts": { - "build": "tsc", - "prepublish": "tsc" + "build": "tsc" }, "devDependencies": { "@types/jest": "^29.5.5", diff --git a/tsconfig.json b/tsconfig.json index a9f72ce6..7da08403 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2018", "module": "commonjs", - "lib": ["es2018"], + "lib": ["es2018", "DOM"], "noEmit": false, "declaration": true, "strict": true, @@ -19,12 +19,7 @@ "experimentalDecorators": true, "strictPropertyInitialization": false, "typeRoots": ["./node_modules/@types"], - "types": ["node", "jest"], - - // https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/826 - // Ideally this should only be specified in packages/esbuild/tsconfig.json, however it doesn't seem to be - // loading that config file during build. - "skipLibCheck": true + "types": ["node", "jest"] }, "exclude": ["**/node_modules", "cdk.out", "**/handlers/**"] }