From b7620b305ff0d86b24b103d9116ff6ba69062f4e Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Fri, 3 Jan 2025 08:48:05 -0800 Subject: [PATCH] fix(esm): updating jest to support esm --- infrastructure/otel-collector/package.json | 2 +- .../parser-graphql-wrapper/package.json | 2 +- infrastructure/pocket-event-bridge/package.json | 2 +- infrastructure/push-server/package.json | 2 +- infrastructure/sendgrid-data/package.json | 2 +- infrastructure/shareable-lists-api/package.json | 2 +- .../shared-snowplow-consumer/package.json | 2 +- infrastructure/shares-api/package.json | 2 +- .../transactional-emails/package.json | 2 +- infrastructure/user-api/package.json | 2 +- infrastructure/v3-proxy-api/package.json | 2 +- .../jest.config.js | 9 --------- .../jest.config.ts | 17 +++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 .../package.json | 2 +- .../tsconfig.json | 2 +- .../account-data-deleter-events/jest.config.js | 8 -------- .../account-data-deleter-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 .../account-data-deleter-events/package.json | 2 +- .../account-data-deleter-events/tsconfig.json | 2 +- lambdas/account-delete-monitor/jest.config.js | 8 -------- lambdas/account-delete-monitor/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/account-delete-monitor/package.json | 2 +- lambdas/account-delete-monitor/tsconfig.json | 2 +- lambdas/annotations-api-events/jest.config.js | 8 -------- lambdas/annotations-api-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/annotations-api-events/package.json | 2 +- lambdas/annotations-api-events/tsconfig.json | 2 +- lambdas/fxa-webook-proxy-gateway/jest.config.js | 7 ------- lambdas/fxa-webook-proxy-gateway/jest.config.ts | 15 +++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/fxa-webook-proxy-gateway/package.json | 2 +- lambdas/fxa-webook-proxy-sqs/jest.config.js | 7 ------- lambdas/fxa-webook-proxy-sqs/jest.config.ts | 15 +++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/instant-sync-events/jest.config.js | 8 -------- lambdas/instant-sync-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/instant-sync-events/package.json | 2 +- lambdas/instant-sync-events/tsconfig.json | 2 +- lambdas/sendgrid-data/jest.config.js | 7 ------- lambdas/sendgrid-data/jest.config.ts | 15 +++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/sendgrid-data/package.json | 2 +- lambdas/sendgrid-data/src/index.ts | 6 +++++- .../shareable-lists-api-events/jest.config.js | 8 -------- .../shareable-lists-api-events/jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 lambdas/shareable-lists-api-events/package.json | 2 +- .../shareable-lists-api-events/tsconfig.json | 2 +- lambdas/transactional-emails/jest.config.js | 6 ------ lambdas/transactional-emails/jest.config.ts | 14 ++++++++++++++ lambdas/transactional-emails/package.json | 2 +- .../jest.config.js | 8 -------- .../jest.config.ts | 16 ++++++++++++++++ .../{jest.setup.js => jest.setup.ts} | 0 .../package.json | 2 +- .../tsconfig.json | 2 +- lambdas/user-list-search-events/jest.config.js | 7 ------- lambdas/user-list-search-events/jest.config.ts | 15 +++++++++++++++ lambdas/user-list-search-events/package.json | 2 +- lambdas/user-list-search-events/tsconfig.json | 2 +- .../{jest.config.js => jest.config.ts} | 10 +++++++++- lambdas/user-list-search-indexing/package.json | 2 +- lambdas/user-list-search-indexing/tsconfig.json | 4 ++-- .../{jest.config.js => jest.config.ts} | 10 +++++++++- .../package.json | 2 +- .../tsconfig.json | 2 +- packages/eslint-config/base.js | 2 ++ packages/event-bridge/package.json | 2 +- servers/annotations-api/package.json | 2 +- servers/braze-content-proxy/package.json | 2 +- servers/notes-api/package.json | 6 +++--- servers/notes-api/src/__generated__/db.ts | 9 +++++---- servers/parser-graphql-wrapper/package.json | 2 +- servers/shareable-lists-api/package.json | 6 +++--- servers/shares-api/package.json | 2 +- servers/user-list-search/package.json | 2 +- servers/v3-proxy-api/package.json | 2 +- 82 files changed, 265 insertions(+), 146 deletions(-) delete mode 100644 lambdas/account-data-deleter-batch-delete/jest.config.js create mode 100644 lambdas/account-data-deleter-batch-delete/jest.config.ts rename lambdas/account-data-deleter-batch-delete/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/account-data-deleter-events/jest.config.js create mode 100644 lambdas/account-data-deleter-events/jest.config.ts rename lambdas/account-data-deleter-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/account-delete-monitor/jest.config.js create mode 100644 lambdas/account-delete-monitor/jest.config.ts rename lambdas/account-delete-monitor/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/annotations-api-events/jest.config.js create mode 100644 lambdas/annotations-api-events/jest.config.ts rename lambdas/annotations-api-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/fxa-webook-proxy-gateway/jest.config.js create mode 100644 lambdas/fxa-webook-proxy-gateway/jest.config.ts rename lambdas/fxa-webook-proxy-gateway/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/fxa-webook-proxy-sqs/jest.config.js create mode 100644 lambdas/fxa-webook-proxy-sqs/jest.config.ts rename lambdas/fxa-webook-proxy-sqs/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/instant-sync-events/jest.config.js create mode 100644 lambdas/instant-sync-events/jest.config.ts rename lambdas/instant-sync-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/sendgrid-data/jest.config.js create mode 100644 lambdas/sendgrid-data/jest.config.ts rename lambdas/sendgrid-data/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/shareable-lists-api-events/jest.config.js create mode 100644 lambdas/shareable-lists-api-events/jest.config.ts rename lambdas/shareable-lists-api-events/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/transactional-emails/jest.config.js create mode 100644 lambdas/transactional-emails/jest.config.ts delete mode 100644 lambdas/user-list-search-corpus-indexing/jest.config.js create mode 100644 lambdas/user-list-search-corpus-indexing/jest.config.ts rename lambdas/user-list-search-corpus-indexing/{jest.setup.js => jest.setup.ts} (100%) delete mode 100644 lambdas/user-list-search-events/jest.config.js create mode 100644 lambdas/user-list-search-events/jest.config.ts rename lambdas/user-list-search-indexing/{jest.config.js => jest.config.ts} (57%) rename lambdas/user-list-search-kinesis-to-sqs/{jest.config.js => jest.config.ts} (57%) diff --git a/infrastructure/otel-collector/package.json b/infrastructure/otel-collector/package.json index 8a187d05f..79db8b4a9 100644 --- a/infrastructure/otel-collector/package.json +++ b/infrastructure/otel-collector/package.json @@ -2,9 +2,9 @@ "name": "otel-collector-cdk", "version": "1.0.0", "private": true, + "type": "module", "main": "dist/main.js", "types": "src/main.ts", - "type":"module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/parser-graphql-wrapper/package.json b/infrastructure/parser-graphql-wrapper/package.json index 57e8e6806..e07277e56 100644 --- a/infrastructure/parser-graphql-wrapper/package.json +++ b/infrastructure/parser-graphql-wrapper/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "src/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/pocket-event-bridge/package.json b/infrastructure/pocket-event-bridge/package.json index 7b36f00b2..bf175e20d 100644 --- a/infrastructure/pocket-event-bridge/package.json +++ b/infrastructure/pocket-event-bridge/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "dist/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/push-server/package.json b/infrastructure/push-server/package.json index ec4b29ed5..e1273fcbd 100644 --- a/infrastructure/push-server/package.json +++ b/infrastructure/push-server/package.json @@ -2,9 +2,9 @@ "name": "push-server-cdk", "version": "1.0.0", "private": true, + "type": "module", "main": "dist/main.js", "types": "src/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/sendgrid-data/package.json b/infrastructure/sendgrid-data/package.json index c6cd3092b..1889a69da 100644 --- a/infrastructure/sendgrid-data/package.json +++ b/infrastructure/sendgrid-data/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "src/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/shareable-lists-api/package.json b/infrastructure/shareable-lists-api/package.json index 202b8292c..38b390a40 100644 --- a/infrastructure/shareable-lists-api/package.json +++ b/infrastructure/shareable-lists-api/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "dist/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/shared-snowplow-consumer/package.json b/infrastructure/shared-snowplow-consumer/package.json index 1035214c5..c2104805f 100644 --- a/infrastructure/shared-snowplow-consumer/package.json +++ b/infrastructure/shared-snowplow-consumer/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "dist/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/shares-api/package.json b/infrastructure/shares-api/package.json index 7499fc52f..cfcdd80ed 100644 --- a/infrastructure/shares-api/package.json +++ b/infrastructure/shares-api/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "dist/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/transactional-emails/package.json b/infrastructure/transactional-emails/package.json index e1e8350a5..9bdbd91c4 100644 --- a/infrastructure/transactional-emails/package.json +++ b/infrastructure/transactional-emails/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "dist/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/user-api/package.json b/infrastructure/user-api/package.json index 0840c04b9..a81528f0d 100644 --- a/infrastructure/user-api/package.json +++ b/infrastructure/user-api/package.json @@ -2,9 +2,9 @@ "name": "user-api-cdk", "version": "1.0.0", "private": true, + "type": "module", "main": "dist/src/main.js", "types": "src/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/infrastructure/v3-proxy-api/package.json b/infrastructure/v3-proxy-api/package.json index f94091c28..c603111e3 100644 --- a/infrastructure/v3-proxy-api/package.json +++ b/infrastructure/v3-proxy-api/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "license": "MPL-2.0", + "type": "module", "main": "dist/main.js", "types": "dist/main.ts", - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "compile": "tsc --pretty", diff --git a/lambdas/account-data-deleter-batch-delete/jest.config.js b/lambdas/account-data-deleter-batch-delete/jest.config.js deleted file mode 100644 index 3d9ee9b60..000000000 --- a/lambdas/account-data-deleter-batch-delete/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-batchdelete', - testTimeout: 1000000, -}; diff --git a/lambdas/account-data-deleter-batch-delete/jest.config.ts b/lambdas/account-data-deleter-batch-delete/jest.config.ts new file mode 100644 index 000000000..e433d0c6d --- /dev/null +++ b/lambdas/account-data-deleter-batch-delete/jest.config.ts @@ -0,0 +1,17 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-batchdelete', + testTimeout: 1000000, + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/account-data-deleter-batch-delete/jest.setup.js b/lambdas/account-data-deleter-batch-delete/jest.setup.ts similarity index 100% rename from lambdas/account-data-deleter-batch-delete/jest.setup.js rename to lambdas/account-data-deleter-batch-delete/jest.setup.ts diff --git a/lambdas/account-data-deleter-batch-delete/package.json b/lambdas/account-data-deleter-batch-delete/package.json index 14e4cfa18..a2f852228 100644 --- a/lambdas/account-data-deleter-batch-delete/package.json +++ b/lambdas/account-data-deleter-batch-delete/package.json @@ -4,8 +4,8 @@ "description": "", "license": "ISC", "author": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/account-data-deleter-batch-delete/tsconfig.json b/lambdas/account-data-deleter-batch-delete/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/account-data-deleter-batch-delete/tsconfig.json +++ b/lambdas/account-data-deleter-batch-delete/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/account-data-deleter-events/jest.config.js b/lambdas/account-data-deleter-events/jest.config.js deleted file mode 100644 index b2dc1525d..000000000 --- a/lambdas/account-data-deleter-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-events', -}; diff --git a/lambdas/account-data-deleter-events/jest.config.ts b/lambdas/account-data-deleter-events/jest.config.ts new file mode 100644 index 000000000..ed3aaf353 --- /dev/null +++ b/lambdas/account-data-deleter-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-events', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/account-data-deleter-events/jest.setup.js b/lambdas/account-data-deleter-events/jest.setup.ts similarity index 100% rename from lambdas/account-data-deleter-events/jest.setup.js rename to lambdas/account-data-deleter-events/jest.setup.ts diff --git a/lambdas/account-data-deleter-events/package.json b/lambdas/account-data-deleter-events/package.json index 7b5b1e70e..0f4b7f7bc 100644 --- a/lambdas/account-data-deleter-events/package.json +++ b/lambdas/account-data-deleter-events/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/account-data-deleter-events/tsconfig.json b/lambdas/account-data-deleter-events/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/account-data-deleter-events/tsconfig.json +++ b/lambdas/account-data-deleter-events/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/account-delete-monitor/jest.config.js b/lambdas/account-delete-monitor/jest.config.js deleted file mode 100644 index e9466d4f1..000000000 --- a/lambdas/account-delete-monitor/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - displayName: 'account-delete-monitor', - setupFiles: ['./jest.setup.js'], -}; diff --git a/lambdas/account-delete-monitor/jest.config.ts b/lambdas/account-delete-monitor/jest.config.ts new file mode 100644 index 000000000..f5f5bf999 --- /dev/null +++ b/lambdas/account-delete-monitor/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + displayName: 'account-delete-monitor', + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/account-delete-monitor/jest.setup.js b/lambdas/account-delete-monitor/jest.setup.ts similarity index 100% rename from lambdas/account-delete-monitor/jest.setup.js rename to lambdas/account-delete-monitor/jest.setup.ts diff --git a/lambdas/account-delete-monitor/package.json b/lambdas/account-delete-monitor/package.json index 47cd40ec9..743d438a0 100644 --- a/lambdas/account-delete-monitor/package.json +++ b/lambdas/account-delete-monitor/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/account-delete-monitor/tsconfig.json b/lambdas/account-delete-monitor/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/account-delete-monitor/tsconfig.json +++ b/lambdas/account-delete-monitor/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/annotations-api-events/jest.config.js b/lambdas/annotations-api-events/jest.config.js deleted file mode 100644 index b2dc1525d..000000000 --- a/lambdas/annotations-api-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-events', -}; diff --git a/lambdas/annotations-api-events/jest.config.ts b/lambdas/annotations-api-events/jest.config.ts new file mode 100644 index 000000000..ed3aaf353 --- /dev/null +++ b/lambdas/annotations-api-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-events', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/annotations-api-events/jest.setup.js b/lambdas/annotations-api-events/jest.setup.ts similarity index 100% rename from lambdas/annotations-api-events/jest.setup.js rename to lambdas/annotations-api-events/jest.setup.ts diff --git a/lambdas/annotations-api-events/package.json b/lambdas/annotations-api-events/package.json index 1629e3f49..f94f72784 100644 --- a/lambdas/annotations-api-events/package.json +++ b/lambdas/annotations-api-events/package.json @@ -4,8 +4,8 @@ "description": "", "license": "ISC", "author": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/annotations-api-events/tsconfig.json b/lambdas/annotations-api-events/tsconfig.json index a5a29e107..d53d82381 100644 --- a/lambdas/annotations-api-events/tsconfig.json +++ b/lambdas/annotations-api-events/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": [ "src/**/*.ts", ] diff --git a/lambdas/fxa-webook-proxy-gateway/jest.config.js b/lambdas/fxa-webook-proxy-gateway/jest.config.js deleted file mode 100644 index 4abea8986..000000000 --- a/lambdas/fxa-webook-proxy-gateway/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|functional).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - }; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-gateway/jest.config.ts b/lambdas/fxa-webook-proxy-gateway/jest.config.ts new file mode 100644 index 000000000..587780227 --- /dev/null +++ b/lambdas/fxa-webook-proxy-gateway/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|functional).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-gateway/jest.setup.js b/lambdas/fxa-webook-proxy-gateway/jest.setup.ts similarity index 100% rename from lambdas/fxa-webook-proxy-gateway/jest.setup.js rename to lambdas/fxa-webook-proxy-gateway/jest.setup.ts diff --git a/lambdas/fxa-webook-proxy-gateway/package.json b/lambdas/fxa-webook-proxy-gateway/package.json index 4a0fdcd7c..ac1d768e9 100644 --- a/lambdas/fxa-webook-proxy-gateway/package.json +++ b/lambdas/fxa-webook-proxy-gateway/package.json @@ -5,8 +5,8 @@ "keywords": [], "license": "ISC", "author": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/fxa-webook-proxy-sqs/jest.config.js b/lambdas/fxa-webook-proxy-sqs/jest.config.js deleted file mode 100644 index 4abea8986..000000000 --- a/lambdas/fxa-webook-proxy-sqs/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|functional).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - }; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-sqs/jest.config.ts b/lambdas/fxa-webook-proxy-sqs/jest.config.ts new file mode 100644 index 000000000..587780227 --- /dev/null +++ b/lambdas/fxa-webook-proxy-sqs/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|functional).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/fxa-webook-proxy-sqs/jest.setup.js b/lambdas/fxa-webook-proxy-sqs/jest.setup.ts similarity index 100% rename from lambdas/fxa-webook-proxy-sqs/jest.setup.js rename to lambdas/fxa-webook-proxy-sqs/jest.setup.ts diff --git a/lambdas/instant-sync-events/jest.config.js b/lambdas/instant-sync-events/jest.config.js deleted file mode 100644 index 47d5660b4..000000000 --- a/lambdas/instant-sync-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - displayName: 'instant-sync-events', - setupFiles: ['./jest.setup.js'], -}; diff --git a/lambdas/instant-sync-events/jest.config.ts b/lambdas/instant-sync-events/jest.config.ts new file mode 100644 index 000000000..e31a29cca --- /dev/null +++ b/lambdas/instant-sync-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + displayName: 'instant-sync-events', + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/instant-sync-events/jest.setup.js b/lambdas/instant-sync-events/jest.setup.ts similarity index 100% rename from lambdas/instant-sync-events/jest.setup.js rename to lambdas/instant-sync-events/jest.setup.ts diff --git a/lambdas/instant-sync-events/package.json b/lambdas/instant-sync-events/package.json index a7d84465c..e6addbcf2 100644 --- a/lambdas/instant-sync-events/package.json +++ b/lambdas/instant-sync-events/package.json @@ -2,12 +2,12 @@ "name": "instant-sync-events", "version": "1.0.0", "description": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/instant-sync-events/tsconfig.json b/lambdas/instant-sync-events/tsconfig.json index a307e8817..7d6da88c9 100644 --- a/lambdas/instant-sync-events/tsconfig.json +++ b/lambdas/instant-sync-events/tsconfig.json @@ -4,6 +4,6 @@ "rootDir": "src", "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": ["./**/*.ts"] } \ No newline at end of file diff --git a/lambdas/sendgrid-data/jest.config.js b/lambdas/sendgrid-data/jest.config.js deleted file mode 100644 index 4abea8986..000000000 --- a/lambdas/sendgrid-data/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|functional).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - }; \ No newline at end of file diff --git a/lambdas/sendgrid-data/jest.config.ts b/lambdas/sendgrid-data/jest.config.ts new file mode 100644 index 000000000..587780227 --- /dev/null +++ b/lambdas/sendgrid-data/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|functional).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/sendgrid-data/jest.setup.js b/lambdas/sendgrid-data/jest.setup.ts similarity index 100% rename from lambdas/sendgrid-data/jest.setup.js rename to lambdas/sendgrid-data/jest.setup.ts diff --git a/lambdas/sendgrid-data/package.json b/lambdas/sendgrid-data/package.json index fa82aa755..f867e6ce8 100644 --- a/lambdas/sendgrid-data/package.json +++ b/lambdas/sendgrid-data/package.json @@ -2,12 +2,12 @@ "name": "sendgrid-data", "version": "1.0.0", "description": "", + "type": "module", "main": "index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/sendgrid-data/src/index.ts b/lambdas/sendgrid-data/src/index.ts index 70cb21389..ac780c34f 100644 --- a/lambdas/sendgrid-data/src/index.ts +++ b/lambdas/sendgrid-data/src/index.ts @@ -5,7 +5,11 @@ Sentry.init({ release: config.sentry.release, environment: config.environment, }); -import { deliverEvents, logEventsError, logEventsReceived } from './sendgrid/index.ts'; +import { + deliverEvents, + logEventsError, + logEventsReceived, +} from './sendgrid/index.ts'; import { captureException } from './sentry.ts'; import type { APIGatewayEvent, APIGatewayProxyResult } from 'aws-lambda'; diff --git a/lambdas/shareable-lists-api-events/jest.config.js b/lambdas/shareable-lists-api-events/jest.config.js deleted file mode 100644 index b2dc1525d..000000000 --- a/lambdas/shareable-lists-api-events/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'lambda-events', -}; diff --git a/lambdas/shareable-lists-api-events/jest.config.ts b/lambdas/shareable-lists-api-events/jest.config.ts new file mode 100644 index 000000000..ed3aaf353 --- /dev/null +++ b/lambdas/shareable-lists-api-events/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'lambda-events', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/shareable-lists-api-events/jest.setup.js b/lambdas/shareable-lists-api-events/jest.setup.ts similarity index 100% rename from lambdas/shareable-lists-api-events/jest.setup.js rename to lambdas/shareable-lists-api-events/jest.setup.ts diff --git a/lambdas/shareable-lists-api-events/package.json b/lambdas/shareable-lists-api-events/package.json index b3803ddff..89216d2bf 100644 --- a/lambdas/shareable-lists-api-events/package.json +++ b/lambdas/shareable-lists-api-events/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/shareable-lists-api-events/tsconfig.json b/lambdas/shareable-lists-api-events/tsconfig.json index 7b34686ba..a61c684ef 100644 --- a/lambdas/shareable-lists-api-events/tsconfig.json +++ b/lambdas/shareable-lists-api-events/tsconfig.json @@ -4,6 +4,6 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ys", "jest.setup.ts"], "include": ["src/**/*.ts"] } diff --git a/lambdas/transactional-emails/jest.config.js b/lambdas/transactional-emails/jest.config.js deleted file mode 100644 index 0db0fc753..000000000 --- a/lambdas/transactional-emails/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], -}; diff --git a/lambdas/transactional-emails/jest.config.ts b/lambdas/transactional-emails/jest.config.ts new file mode 100644 index 000000000..36021fa72 --- /dev/null +++ b/lambdas/transactional-emails/jest.config.ts @@ -0,0 +1,14 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/transactional-emails/package.json b/lambdas/transactional-emails/package.json index b06ab3a2b..941831d36 100644 --- a/lambdas/transactional-emails/package.json +++ b/lambdas/transactional-emails/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/main.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "dev": "tsc -w", diff --git a/lambdas/user-list-search-corpus-indexing/jest.config.js b/lambdas/user-list-search-corpus-indexing/jest.config.js deleted file mode 100644 index 1b6af6d6a..000000000 --- a/lambdas/user-list-search-corpus-indexing/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - setupFiles: ['./jest.setup.js'], - displayName: 'corpus-index-lambda', -}; diff --git a/lambdas/user-list-search-corpus-indexing/jest.config.ts b/lambdas/user-list-search-corpus-indexing/jest.config.ts new file mode 100644 index 000000000..9455eec46 --- /dev/null +++ b/lambdas/user-list-search-corpus-indexing/jest.config.ts @@ -0,0 +1,16 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + setupFiles: ['./jest.setup.ts'], + displayName: 'corpus-index-lambda', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-corpus-indexing/jest.setup.js b/lambdas/user-list-search-corpus-indexing/jest.setup.ts similarity index 100% rename from lambdas/user-list-search-corpus-indexing/jest.setup.js rename to lambdas/user-list-search-corpus-indexing/jest.setup.ts diff --git a/lambdas/user-list-search-corpus-indexing/package.json b/lambdas/user-list-search-corpus-indexing/package.json index 0e454d794..4d5776225 100644 --- a/lambdas/user-list-search-corpus-indexing/package.json +++ b/lambdas/user-list-search-corpus-indexing/package.json @@ -4,12 +4,12 @@ "description": "", "license": "ISC", "author": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/user-list-search-corpus-indexing/tsconfig.json b/lambdas/user-list-search-corpus-indexing/tsconfig.json index 7b34686ba..28c15a0e1 100644 --- a/lambdas/user-list-search-corpus-indexing/tsconfig.json +++ b/lambdas/user-list-search-corpus-indexing/tsconfig.json @@ -4,6 +4,6 @@ "outDir": "dist", "rootDir": "src" }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.ts"], "include": ["src/**/*.ts"] } diff --git a/lambdas/user-list-search-events/jest.config.js b/lambdas/user-list-search-events/jest.config.js deleted file mode 100644 index a25fbdea9..000000000 --- a/lambdas/user-list-search-events/jest.config.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|integration).ts'], - testPathIgnorePatterns: ['/dist/'], - displayName: 'events-lambda', -}; diff --git a/lambdas/user-list-search-events/jest.config.ts b/lambdas/user-list-search-events/jest.config.ts new file mode 100644 index 000000000..e4acc4cc4 --- /dev/null +++ b/lambdas/user-list-search-events/jest.config.ts @@ -0,0 +1,15 @@ +import type { Config } from 'jest'; + +const config: Config = { + preset: 'ts-jest', + testEnvironment: 'node', + testMatch: ['**/?(*.)+(spec|integration).ts'], + testPathIgnorePatterns: ['/dist/'], + displayName: 'events-lambda', + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, +}; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-events/package.json b/lambdas/user-list-search-events/package.json index 3d4a220dc..c965bab33 100644 --- a/lambdas/user-list-search-events/package.json +++ b/lambdas/user-list-search-events/package.json @@ -2,12 +2,12 @@ "name": "user-list-search-events", "version": "1.0.0", "description": "", + "type": "module", "main": "dist/index.js", "files": [ "dist", "package.json" ], - "type": "module", "scripts": { "build": "rm -rf dist && tsc", "format": "eslint --fix", diff --git a/lambdas/user-list-search-events/tsconfig.json b/lambdas/user-list-search-events/tsconfig.json index 0ac23e2db..36de10316 100644 --- a/lambdas/user-list-search-events/tsconfig.json +++ b/lambdas/user-list-search-events/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.cjs", "jest.setup.js"], "include": ["./**/*.ts"] } \ No newline at end of file diff --git a/lambdas/user-list-search-indexing/jest.config.js b/lambdas/user-list-search-indexing/jest.config.ts similarity index 57% rename from lambdas/user-list-search-indexing/jest.config.js rename to lambdas/user-list-search-indexing/jest.config.ts index e3bce1880..70c768064 100644 --- a/lambdas/user-list-search-indexing/jest.config.js +++ b/lambdas/user-list-search-indexing/jest.config.ts @@ -1,8 +1,16 @@ -module.exports = { +import type { Config } from 'jest'; + +const config: Config = { preset: 'ts-jest', testEnvironment: 'node', testMatch: ['**/?(*.)+(spec|integration).ts'], testPathIgnorePatterns: ['/dist/'], displayName: 'user-list-search-kinesis-to-sqs-lambda', setupFilesAfterEnv: ['jest-extended/all'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, }; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-indexing/package.json b/lambdas/user-list-search-indexing/package.json index 1f0f259c2..1bce8345b 100644 --- a/lambdas/user-list-search-indexing/package.json +++ b/lambdas/user-list-search-indexing/package.json @@ -2,8 +2,8 @@ "name": "user-list-search-indexing", "version": "1.0.0", "description": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/user-list-search-indexing/tsconfig.json b/lambdas/user-list-search-indexing/tsconfig.json index 34b628a03..44893ad3b 100644 --- a/lambdas/user-list-search-indexing/tsconfig.json +++ b/lambdas/user-list-search-indexing/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], - "include": ["./**/*.ts"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.js"], + "include": ["./**/*.ts", "jest.config.ts"], "files": ["node_modules/jest-extended/types/index.d.ts"] } \ No newline at end of file diff --git a/lambdas/user-list-search-kinesis-to-sqs/jest.config.js b/lambdas/user-list-search-kinesis-to-sqs/jest.config.ts similarity index 57% rename from lambdas/user-list-search-kinesis-to-sqs/jest.config.js rename to lambdas/user-list-search-kinesis-to-sqs/jest.config.ts index e3bce1880..70c768064 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/jest.config.js +++ b/lambdas/user-list-search-kinesis-to-sqs/jest.config.ts @@ -1,8 +1,16 @@ -module.exports = { +import type { Config } from 'jest'; + +const config: Config = { preset: 'ts-jest', testEnvironment: 'node', testMatch: ['**/?(*.)+(spec|integration).ts'], testPathIgnorePatterns: ['/dist/'], displayName: 'user-list-search-kinesis-to-sqs-lambda', setupFilesAfterEnv: ['jest-extended/all'], + moduleNameMapper: { + "^(\\.\\/.+)\\.js$": "$1", + "^(\\..\\/.+)\\.js$": "$1" + }, }; + +export default config; \ No newline at end of file diff --git a/lambdas/user-list-search-kinesis-to-sqs/package.json b/lambdas/user-list-search-kinesis-to-sqs/package.json index 6f534f112..1d6d0c67a 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/package.json +++ b/lambdas/user-list-search-kinesis-to-sqs/package.json @@ -2,8 +2,8 @@ "name": "user-list-search-kinesis-to-sqs", "version": "1.0.0", "description": "", - "main": "dist/index.js", "type": "module", + "main": "dist/index.js", "files": [ "dist", "package.json" diff --git a/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json b/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json index 34b628a03..8fae1b426 100644 --- a/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json +++ b/lambdas/user-list-search-kinesis-to-sqs/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "dist", }, - "exclude": ["node_modules", "jest.config.js", "jest.setup.js"], + "exclude": ["node_modules", "jest.config.ts", "jest.setup.js"], "include": ["./**/*.ts"], "files": ["node_modules/jest-extended/types/index.d.ts"] } \ No newline at end of file diff --git a/packages/eslint-config/base.js b/packages/eslint-config/base.js index 5a2d1b8b3..489d912fa 100644 --- a/packages/eslint-config/base.js +++ b/packages/eslint-config/base.js @@ -42,6 +42,8 @@ export default tseslint.config( '**/*.js', 'codegen.ts', 'prisma/**/*', + 'jest.config.ts', + 'jest.setup.ts', ], }, { diff --git a/packages/event-bridge/package.json b/packages/event-bridge/package.json index e3c818806..4f19c2463 100644 --- a/packages/event-bridge/package.json +++ b/packages/event-bridge/package.json @@ -19,11 +19,11 @@ "package.json" ], "scripts": { + "prebuild": "pnpm ts-json-schema-generator --additional-properties --validation-keywords removeEmptyObject --path './src/events/types/index.ts' > ./src/events/generated/schema.json", "build": "tsup src/index.ts --format cjs,esm --dts", "dev": "pnpm run build --watch", "format": "eslint --fix", "lint": "eslint --fix-dry-run", - "prebuild": "pnpm ts-json-schema-generator --additional-properties --validation-keywords removeEmptyObject --path './src/events/types/index.ts' > ./src/events/generated/schema.json", "presemantic-release": "pnpm run build", "semantic-release": "semantic-release", "test": "jest", diff --git a/servers/annotations-api/package.json b/servers/annotations-api/package.json index 9be027be8..9dbd2dfd7 100644 --- a/servers/annotations-api/package.json +++ b/servers/annotations-api/package.json @@ -11,12 +11,12 @@ "package.json" ], "scripts": { + "prebuild": "graphql-codegen", "build": "rm -rf dist && tsc && npm run build-schema", "build-schema": "node dist/server/apollo/buildSchema.js", "dev": "npm run build && npm run watch", "format": "eslint --fix", "lint": "eslint --fix-dry-run", - "prebuild": "graphql-codegen", "start": "node dist/main.js", "test": "jest \"\\.spec\\.ts\"", "test-integrations": "jest \"\\.integration\\.ts\" --runInBand", diff --git a/servers/braze-content-proxy/package.json b/servers/braze-content-proxy/package.json index 374bca07a..5fd336201 100644 --- a/servers/braze-content-proxy/package.json +++ b/servers/braze-content-proxy/package.json @@ -3,11 +3,11 @@ "version": "1.0.0", "main": "dist/main.js", "scripts": { + "prebuild": "graphql-codegen", "build": "rm -rf dist && tsc", "dev": "pnpm run build && pnpm run watch", "format": "eslint --fix", "lint": "eslint --fix-dry-run", - "prebuild": "graphql-codegen", "start": "node dist/main.js", "test": "jest \"\\.spec\\.ts\"", "test-integrations": "jest \"\\.integration\\.ts\" --runInBand", diff --git a/servers/notes-api/package.json b/servers/notes-api/package.json index 7cb3b91a0..53ad577ed 100644 --- a/servers/notes-api/package.json +++ b/servers/notes-api/package.json @@ -12,6 +12,7 @@ "prisma" ], "scripts": { + "prebuild": "graphql-codegen && pnpm run prisma:generate", "build": "rm -rf dist && tsc && pnpm run build-schema", "build-schema": "node dist/apollo/schema/buildSchema.js", "db:generate": "prisma generate", @@ -24,13 +25,12 @@ "migrate:deploy": "prisma migrate deploy", "migrate:dev": "dotenv -e .env.ci -- prisma migrate dev && pnpm run kysely:generate", "migrate:reset": "dotenv -e .env.ci -- prisma migrate reset", - "prebuild": "graphql-codegen && pnpm run prisma:generate", - "pretest": "pnpm run prisma:generate", - "pretest-integrations": "dotenv -e .env.ci -- prisma migrate reset --skip-seed --force", "prisma:generate": "dotenv -e .env.ci -- prisma generate && pnpm run kysely:generate", "prisma:pull": "dotenv -e .env.ci -- prisma db pull", "start": "pnpm run migrate:deploy && node dist/main.js", + "pretest": "pnpm run prisma:generate", "test": "jest \"\\.spec\\.ts\"", + "pretest-integrations": "dotenv -e .env.ci -- prisma migrate reset --skip-seed --force", "test-integrations": "jest \"\\.integration\\.ts\" --runInBand", "test:watch": "pnpm test -- --watchAll", "watch": "concurrently --names \"CodeGen,TS,Nodemon\" -c \"bgYellow,bgBlue,bgMagenta\" \"graphql-codegen --watch 'src/**/*.ts'\" \"tsc -w --preserveWatchOutput\" \"nodemon --config ../../nodemon.json ./dist/main.js\"" diff --git a/servers/notes-api/src/__generated__/db.ts b/servers/notes-api/src/__generated__/db.ts index 914077ebd..9e94750d7 100644 --- a/servers/notes-api/src/__generated__/db.ts +++ b/servers/notes-api/src/__generated__/db.ts @@ -3,11 +3,12 @@ * Please do not edit it manually. */ -import type { ColumnType } from "kysely"; +import type { ColumnType } from 'kysely'; -export type Generated = T extends ColumnType - ? ColumnType - : ColumnType; +export type Generated = + T extends ColumnType + ? ColumnType + : ColumnType; export type Json = JsonValue; diff --git a/servers/parser-graphql-wrapper/package.json b/servers/parser-graphql-wrapper/package.json index 6631ba3f4..59abf49bd 100644 --- a/servers/parser-graphql-wrapper/package.json +++ b/servers/parser-graphql-wrapper/package.json @@ -6,13 +6,13 @@ "author": "", "main": "dist/main.js", "scripts": { + "prebuild": "graphql-codegen", "build": "rm -rf dist && tsc", "dev": "npm run build && npm run watch", "format": "eslint --fix", "generate:database:types:readitlab": "DATABASE_URL=mysql://root@localhost:3306/readitla_b kysely-codegen --include-pattern=\"readitla_b.items_resolver\" --out-file=src/__generated__/readitlab.d.ts", "generate:database:types:shares": "DATABASE_URL=mysql://root@localhost:3306/readitla_shares kysely-codegen --include-pattern=\"readitla_shares.share_urls\" --out-file=src/__generated__/readitlaShares.d.ts", "lint": "eslint --fix-dry-run", - "prebuild": "graphql-codegen", "start": "node dist/main.js", "test": "jest \"\\.spec\\.ts\" --runInBand", "test-integrations": "jest \"\\.integration\\.ts\" --runInBand --force-exit", diff --git a/servers/shareable-lists-api/package.json b/servers/shareable-lists-api/package.json index c52370744..63321c832 100644 --- a/servers/shareable-lists-api/package.json +++ b/servers/shareable-lists-api/package.json @@ -11,6 +11,7 @@ "prisma" ], "scripts": { + "prebuild": "dotenv -e .env.ci -- prisma generate", "build": "rm -rf dist && tsc && npm run build-schema-admin && npm run build-schema-public", "build-schema-admin": "node dist/admin/buildSchema.js", "build-schema-public": "node dist/public/buildSchema.js", @@ -23,11 +24,10 @@ "migrate:deploy": "prisma migrate deploy", "migrate:dev": "npm run export-env && prisma migrate dev", "migrate:reset": "prisma migrate reset", - "prebuild": "dotenv -e .env.ci -- prisma generate", - "pretest": "dotenv -e .env.ci -- prisma generate", - "pretest-integrations": "dotenv -e .env.ci -- prisma migrate reset --skip-seed --force", "start": "npm run migrate:deploy && node dist/main.js", + "pretest": "dotenv -e .env.ci -- prisma generate", "test": "jest \"\\.spec\\.ts\"", + "pretest-integrations": "dotenv -e .env.ci -- prisma migrate reset --skip-seed --force", "test-integrations": "jest \"\\.integration\\.ts\" --runInBand", "test:watch": "npm test -- --watchAll", "watch": "tsc -w & nodemon" diff --git a/servers/shares-api/package.json b/servers/shares-api/package.json index f5b9f61a9..ab7704695 100644 --- a/servers/shares-api/package.json +++ b/servers/shares-api/package.json @@ -11,12 +11,12 @@ "package.json" ], "scripts": { + "prebuild": "graphql-codegen", "build": "rm -rf dist && tsc && npm run build-schema", "build-schema": "node dist/apollo/buildSchema.js", "dev": "npm run build && npm run watch", "format": "eslint --fix", "lint": "eslint --fix-dry-run", - "prebuild": "graphql-codegen", "start": "node dist/main.js", "test": "jest \"\\.spec\\.ts\"", "test-integrations": "jest \"\\.integration\\.ts\" --runInBand", diff --git a/servers/user-list-search/package.json b/servers/user-list-search/package.json index 27dae687a..7d7ac05e9 100644 --- a/servers/user-list-search/package.json +++ b/servers/user-list-search/package.json @@ -4,13 +4,13 @@ "description": "", "main": "dist/main.js", "scripts": { + "prebuild": "graphql-codegen", "build": "rm -rf dist && tsc && npm run build-schema", "build-schema": "node dist/server/buildSchema.js", "build:js": "npm run build", "dev": "NODE_ENV=development npm run build && NODE_ENV=development npm run watch", "format": "eslint --fix", "lint": "eslint --fix-dry-run", - "prebuild": "graphql-codegen", "snowplow:generate": "snowtype generate", "start": "node dist/main.js", "task:es-create-index": "node dist/tasks/createESIndex.js", diff --git a/servers/v3-proxy-api/package.json b/servers/v3-proxy-api/package.json index 1650d925c..301f1907e 100644 --- a/servers/v3-proxy-api/package.json +++ b/servers/v3-proxy-api/package.json @@ -4,11 +4,11 @@ "description": "", "main": "dist/main.js", "scripts": { + "prebuild": "graphql-codegen", "build": "rm -rf dist && tsc", "dev": "npm run build && npm run watch", "format": "eslint --fix", "lint": "eslint --fix-dry-run", - "prebuild": "graphql-codegen", "start": "node dist/main.js", "test": "jest \"\\.spec\\.ts\" --runInBand", "test-integrations": "jest \"\\.integration\\.ts\" --runInBand --force-exit",