diff --git a/.circleci/config.yml b/.circleci/config.yml index 396cc1fd0e4..ded68ade615 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -925,6 +925,7 @@ workflows: - fail-fast - unit-test: name: Unit Test (PR) + resource_class: xlarge nx_run: affected --base=main --head=$CIRCLE_SHA1 workflow: test_pull_request requires: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 253620b14b2..ddc1066f309 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -16,7 +16,6 @@ updates: - '@mozilla/fxa-devs' ignore: - dependency-name: 'jest-watch-typeahead' # To be removed after react-scripts update - - dependency-name: 'esbuild' # See FXA-5948 - dependency-name: 'mailparser' # Used as a test helper only, see #FXA-5351 - dependency-name: '*' update-types: ['version-update:semver-patch'] diff --git a/apps/payments/next/project.json b/apps/payments/next/project.json index dc202496af2..162fc473abe 100644 --- a/apps/payments/next/project.json +++ b/apps/payments/next/project.json @@ -52,25 +52,52 @@ "command": "pm2 delete apps/payments/next/pm2.config.js" }, "l10n-merge": { + "cache": true, "command": "yarn grunt --gruntfile='apps/payments/next/Gruntfile.js' merge-ftl", - "dependsOn": ["l10n-prime"] + "dependsOn": ["l10n-prime"], + "inputs": ["{projectRoot}/gruntfile.js", "{projectRoot}/app/**/en.ftl"], + "outputs": [ + "{projectRoot}/public/locales/en/payments-next.ftl" + ] }, "l10n-prime": { "command": "./_scripts/l10n/prime.sh apps/payments/next" }, "l10n-bundle": { + "cache": true, "dependsOn": ["l10n-merge"], - "command": "./_scripts/l10n/bundle.sh apps/payments/next branding,react,payments-next" + "command": "./_scripts/l10n/bundle.sh apps/payments/next branding,react,payments-next", + "inputs": [ + "{projectRoot}/public/locales/**/branding.ftl", + "{projectRoot}/public/locales/**/react.ftl", + "{projectRoot}/public/locales/**/payments.ftl", + "{projectRoot}/public/locales/**/payments-next.ftl", + "{projectRoot}/public/locales/**/react.ftl" + ], + "outputs": [ + "{projectRoot}/public/locales/**/main.ftl" + ] }, "watchers": { "command": "yarn grunt --gruntfile='apps/payments/next/Gruntfile.js' watchers" }, "glean-generate": { + "cache": true, "dependsOn": ["glean-lint"], - "command": "yarn glean translate libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml -f typescript_server -o libs/payments/metrics/src/lib/glean/__generated__" + "command": "yarn glean translate libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml -f typescript_server -o libs/payments/metrics/src/lib/glean/__generated__", + "inputs": [ + "{workspaceRoot}/libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml" + ], + "outputs": [ + "{workspaceRoot}/libs/payments/metrics/src/lib/glean/__generated__" + ] }, "glean-lint": { - "command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml" + "cache": true, + "command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml", + "inputs": [ + "{workspaceRoot}/libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml" + ] } }, "tags": ["app", "payments", "type:sp3"] diff --git a/libs/accounts/email-renderer/package.json b/libs/accounts/email-renderer/package.json index 442b6f90173..3c999ae6cd9 100644 --- a/libs/accounts/email-renderer/package.json +++ b/libs/accounts/email-renderer/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/accounts/email-renderer", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "private": true + "version": "0.0.1" } diff --git a/libs/accounts/email-renderer/project.json b/libs/accounts/email-renderer/project.json index 2fc7d3616a7..10021de09fe 100644 --- a/libs/accounts/email-renderer/project.json +++ b/libs/accounts/email-renderer/project.json @@ -19,7 +19,7 @@ } }, "build-ts": { - "executor": "@nx/esbuild:esbuild", + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "dependsOn": ["l10n-prime"], "options": { @@ -31,11 +31,18 @@ "libs/accounts/email-renderer/src/**/*.txt", "libs/accounts/email-renderer/src/**/*.mjml" ], - "format": ["cjs"] + "generatePackageJson": true } }, "build-css": { + "cache": true, "executor": "nx:run-commands", + "inputs": [ + "{projectRoot}/src/**/*.scss" + ], + "outputs": [ + "{projectRoot}/src/css" + ], "options": { "commands": [ "ts-node libs/accounts/email-renderer/src/sass-compile-files.ts" @@ -125,6 +132,7 @@ ] }, "l10n-merge": { + "cache": true, "dependsOn": ["l10n-prime"], "executor": "nx:run-commands", "options": { diff --git a/libs/accounts/email-sender/package.json b/libs/accounts/email-sender/package.json index d7f86331311..744adfb2460 100644 --- a/libs/accounts/email-sender/package.json +++ b/libs/accounts/email-sender/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/accounts/email-sender", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "private": true + "version": "0.0.1" } diff --git a/libs/accounts/email-sender/project.json b/libs/accounts/email-sender/project.json index 277c1bcf9cc..a0531e4d6ef 100644 --- a/libs/accounts/email-sender/project.json +++ b/libs/accounts/email-sender/project.json @@ -6,14 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/accounts/email-sender", "main": "libs/accounts/email-sender/src/index.ts", "tsConfig": "libs/accounts/email-sender/tsconfig.lib.json", "assets": ["libs/accounts/email-sender/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/accounts/errors/package.json b/libs/accounts/errors/package.json index a4033ae3b7f..427b34d15b7 100644 --- a/libs/accounts/errors/package.json +++ b/libs/accounts/errors/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/accounts/errors", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "private": true + "version": "0.0.1" } diff --git a/libs/accounts/errors/project.json b/libs/accounts/errors/project.json index c1b0e5b1f7c..8cc5697dc6a 100644 --- a/libs/accounts/errors/project.json +++ b/libs/accounts/errors/project.json @@ -6,14 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { - "outputPath": "dist/libs/accounts/errors", "main": "libs/accounts/errors/src/index.ts", + "outputPath": "dist/libs/accounts/errors", "tsConfig": "libs/accounts/errors/tsconfig.lib.json", - "assets": ["libs/accounts/errors/*.md"], - "format": ["cjs"] + "assets": [ + { + "glob": "libs/accounts/errors/*.md", + "input": ".", + "output": "." + } + ] } }, "test-unit": { diff --git a/libs/accounts/errors/tsconfig.lib.json b/libs/accounts/errors/tsconfig.lib.json index 4befa7f0990..d9c5f01ebc2 100644 --- a/libs/accounts/errors/tsconfig.lib.json +++ b/libs/accounts/errors/tsconfig.lib.json @@ -1,6 +1,8 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "rootDir": "../../..", + "module": "commonjs", "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/accounts/oauth/package.json b/libs/accounts/oauth/package.json index 9ac7f7ca2d6..851f4da7dfd 100644 --- a/libs/accounts/oauth/package.json +++ b/libs/accounts/oauth/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/accounts/oauth", - "version": "0.0.1", - "private": true, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "dependencies": {} + "version": "0.0.1" } diff --git a/libs/accounts/oauth/project.json b/libs/accounts/oauth/project.json index fa7f0ef7ec6..e6b8167592b 100644 --- a/libs/accounts/oauth/project.json +++ b/libs/accounts/oauth/project.json @@ -6,14 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/accounts/oauth", "main": "libs/accounts/oauth/src/index.ts", "tsConfig": "libs/accounts/oauth/tsconfig.lib.json", "assets": ["libs/accounts/oauth/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test": { diff --git a/libs/accounts/passkey/package.json b/libs/accounts/passkey/package.json index a6bf5849166..97efe5f097b 100644 --- a/libs/accounts/passkey/package.json +++ b/libs/accounts/passkey/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/accounts/passkey", - "version": "0.0.1", - "private": true, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "dependencies": {} + "version": "0.0.1" } diff --git a/libs/accounts/passkey/project.json b/libs/accounts/passkey/project.json index 8e9d342a4f0..999c8870c4f 100644 --- a/libs/accounts/passkey/project.json +++ b/libs/accounts/passkey/project.json @@ -6,15 +6,20 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/accounts/passkey", "main": "libs/accounts/passkey/src/index.ts", "tsConfig": "libs/accounts/passkey/tsconfig.lib.json", - "assets": ["libs/accounts/passkey/*.md"], - "format": ["cjs"], - "declaration": true + "assets": ["libs/accounts/passkey/*.md"] } }, "test-unit": { diff --git a/libs/accounts/passkey/tsconfig.lib.json b/libs/accounts/passkey/tsconfig.lib.json index 4befa7f0990..6836ea5b7f0 100644 --- a/libs/accounts/passkey/tsconfig.lib.json +++ b/libs/accounts/passkey/tsconfig.lib.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "rootDir": "../../..", "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/accounts/rate-limit/package.json b/libs/accounts/rate-limit/package.json index e4050681e71..e20213f674c 100644 --- a/libs/accounts/rate-limit/package.json +++ b/libs/accounts/rate-limit/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/accounts/rate-limit", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "private": true + "version": "0.0.1" } diff --git a/libs/accounts/rate-limit/project.json b/libs/accounts/rate-limit/project.json index cc632f848ae..58bb4374753 100644 --- a/libs/accounts/rate-limit/project.json +++ b/libs/accounts/rate-limit/project.json @@ -6,14 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/accounts/rate-limit", "main": "libs/accounts/rate-limit/src/index.ts", "tsConfig": "libs/accounts/rate-limit/tsconfig.lib.json", "assets": ["libs/accounts/rate-limit/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/accounts/recovery-phone/package.json b/libs/accounts/recovery-phone/package.json index 78842ea4fc9..68b92a5dd53 100644 --- a/libs/accounts/recovery-phone/package.json +++ b/libs/accounts/recovery-phone/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/accounts/recovery-phone", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/accounts/recovery-phone/project.json b/libs/accounts/recovery-phone/project.json index f3b18446937..378fd654ad2 100644 --- a/libs/accounts/recovery-phone/project.json +++ b/libs/accounts/recovery-phone/project.json @@ -6,14 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/accounts/recovery-phone", "main": "libs/accounts/recovery-phone/src/index.ts", "tsConfig": "libs/accounts/recovery-phone/tsconfig.lib.json", "assets": ["libs/accounts/recovery-phone/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/accounts/two-factor/project.json b/libs/accounts/two-factor/project.json index 2f5a7034338..f7214556a42 100644 --- a/libs/accounts/two-factor/project.json +++ b/libs/accounts/two-factor/project.json @@ -6,24 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "outputPath": "dist/libs/accounts/two-factor", "tsConfig": "libs/accounts/two-factor/tsconfig.lib.json", "packageJson": "libs/accounts/two-factor/package.json", "main": "libs/accounts/two-factor/src/index.ts", - "assets": ["libs/accounts/two-factor/*.md"], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + "assets": ["libs/accounts/two-factor/*.md"] } }, "test-unit": { diff --git a/libs/google/project.json b/libs/google/project.json index 465778aae6c..d70a4b0158a 100644 --- a/libs/google/project.json +++ b/libs/google/project.json @@ -6,16 +6,20 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/google/src/index.ts", "outputPath": "dist/libs/google", - "outputFileName": "main.js", "tsConfig": "libs/google/tsconfig.lib.json", - "assets": ["libs/google/*.md"], - "declaration": true + "assets": ["libs/google/*.md"] } }, "lint": { diff --git a/libs/payments/auth/project.json b/libs/payments/auth/project.json index 25c46831fd1..72180c0d5de 100644 --- a/libs/payments/auth/project.json +++ b/libs/payments/auth/project.json @@ -6,14 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { - "outputPath": "dist/libs/payments/auth", "main": "libs/payments/auth/src/index.ts", + "outputPath": "dist/libs/payments/auth", "tsConfig": "libs/payments/auth/tsconfig.lib.json", - "assets": ["libs/payments/auth/*.md"], - "format": ["cjs"] + "assets": [ + { + "glob": "libs/payments/auth/*.md", + "input": ".", + "output": "." + } + ] } }, "test-unit": { diff --git a/libs/payments/capability/project.json b/libs/payments/capability/project.json index 14f212c9947..b39354d0c0c 100644 --- a/libs/payments/capability/project.json +++ b/libs/payments/capability/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/capability/src/index.ts", "outputPath": "dist/libs/payments/capability", - "outputFileName": "main.js", "tsConfig": "libs/payments/capability/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/payments/capability/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/cart/project.json b/libs/payments/cart/project.json index a98a594cb56..bc040ed82fa 100644 --- a/libs/payments/cart/project.json +++ b/libs/payments/cart/project.json @@ -6,13 +6,18 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/cart/src/index.ts", "outputPath": "dist/libs/payments/cart", - "outputFileName": "main.js", "tsConfig": "libs/payments/cart/tsconfig.lib.json", "assets": [ { @@ -20,16 +25,7 @@ "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/cart/src/lib/cart.service.spec.ts b/libs/payments/cart/src/lib/cart.service.spec.ts index 79a1a5a9249..6e1eb6a5ba1 100644 --- a/libs/payments/cart/src/lib/cart.service.spec.ts +++ b/libs/payments/cart/src/lib/cart.service.spec.ts @@ -136,7 +136,7 @@ import { MockPaymentsGleanFactory, PaymentsGleanManager, PaymentsGleanService, -} from '@fxa/payments/metrics'; +} from '@fxa/payments/metrics'; // Circular! import { MockNimbusManagerConfigProvider, NimbusManager, diff --git a/libs/payments/cart/src/lib/cart.service.ts b/libs/payments/cart/src/lib/cart.service.ts index 8b786f34f9e..7fc5d14e031 100644 --- a/libs/payments/cart/src/lib/cart.service.ts +++ b/libs/payments/cart/src/lib/cart.service.ts @@ -112,7 +112,7 @@ import { isPaymentIntentId } from './util/isPaymentIntentId'; import { isPaymentIntent } from './util/isPaymentIntent'; import { throwIntentFailedError } from './util/throwIntentFailedError'; import type { SubscriptionAttributionParams } from './checkout.types'; -import { handleException } from 'libs/shared/error/src/lib/sanitizeExceptionsDecorator'; +import { handleException } from '@fxa/shared/error'; import type { AsyncLocalStorage } from 'async_hooks'; import { AsyncLocalStorageCart } from './cart-als.provider'; import type { CartStore } from './cart-als.types'; diff --git a/libs/payments/content-server/project.json b/libs/payments/content-server/project.json index f464da66072..901f750c787 100644 --- a/libs/payments/content-server/project.json +++ b/libs/payments/content-server/project.json @@ -6,13 +6,18 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/content-server/src/index.ts", "outputPath": "dist/libs/payments/content-server", - "outputFileName": "main.js", "tsConfig": "libs/payments/content-server/tsconfig.lib.json", "assets": [ { @@ -20,16 +25,7 @@ "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/currency/project.json b/libs/payments/currency/project.json index 36bde406d00..ea68cd8070e 100644 --- a/libs/payments/currency/project.json +++ b/libs/payments/currency/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/currency/src/index.ts", "outputPath": "dist/libs/payments/currency", - "outputFileName": "main.js", "tsConfig": "libs/payments/currency/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/payments/currency/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/customer/package.json b/libs/payments/customer/package.json index 919acd56fb0..66b0c09805f 100644 --- a/libs/payments/customer/package.json +++ b/libs/payments/customer/package.json @@ -1,4 +1,4 @@ { - "name": "payments/customer", + "name": "@fxa/payments/customer", "version": "0.0.0" } diff --git a/libs/payments/customer/project.json b/libs/payments/customer/project.json index dac3a734533..94915423a23 100644 --- a/libs/payments/customer/project.json +++ b/libs/payments/customer/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/customer/src/index.ts", "outputPath": "dist/libs/payments/customer", - "outputFileName": "main.js", "tsConfig": "libs/payments/customer/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/payments/customer/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/customer/src/index.ts b/libs/payments/customer/src/index.ts index 0855f752989..573d7ca8eb3 100644 --- a/libs/payments/customer/src/index.ts +++ b/libs/payments/customer/src/index.ts @@ -22,3 +22,4 @@ export * from './lib/util/stripeInvoiceToFirstInvoicePreviewDTO'; export * from './lib/util/getSubplatInterval'; export * from './lib/util/getSubplatIntervalFromSubscription'; export * from './lib/util/retrieveSubscriptionItem'; +export * from './lib/util/getPriceFromSubscription'; diff --git a/libs/payments/customer/src/lib/util/getPaymentMethodErrorContent.ts b/libs/payments/customer/src/lib/util/getPaymentMethodErrorContent.ts index e8ee94a7e93..96efd38c253 100644 --- a/libs/payments/customer/src/lib/util/getPaymentMethodErrorContent.ts +++ b/libs/payments/customer/src/lib/util/getPaymentMethodErrorContent.ts @@ -6,7 +6,7 @@ import { BannerVariant, PaymentMethodErrorType, SubPlatPaymentMethodType, -} from '@fxa/payments/customer'; +} from '../..'; export function getPaymentMethodErrorContent( error: PaymentMethodErrorType, diff --git a/libs/payments/eligibility/project.json b/libs/payments/eligibility/project.json index c068dfcac5c..c868e7bfaa7 100644 --- a/libs/payments/eligibility/project.json +++ b/libs/payments/eligibility/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/eligibility/src/index.ts", "outputPath": "dist/libs/payments/eligibility", - "outputFileName": "main.js", "tsConfig": "libs/payments/eligibility/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/payments/eligibility/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/events/package.json b/libs/payments/events/package.json index 4985c13d894..eecbc3279af 100644 --- a/libs/payments/events/package.json +++ b/libs/payments/events/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/payments/events", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/payments/events/project.json b/libs/payments/events/project.json index 5313e75450c..51b11a05b03 100644 --- a/libs/payments/events/project.json +++ b/libs/payments/events/project.json @@ -6,14 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/payments/events", "main": "libs/payments/events/src/index.ts", "tsConfig": "libs/payments/events/tsconfig.lib.json", "assets": ["libs/payments/events/*.md"], - "declaration": true + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/payments/experiments/package.json b/libs/payments/experiments/package.json index 5b05d511707..a3286e78257 100644 --- a/libs/payments/experiments/package.json +++ b/libs/payments/experiments/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/payments/experiments", - "version": "0.0.1", - "private": true, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "dependencies": {} + "version": "0.0.1" } diff --git a/libs/payments/experiments/project.json b/libs/payments/experiments/project.json index 0a2010b22c0..227bbc4a1b4 100644 --- a/libs/payments/experiments/project.json +++ b/libs/payments/experiments/project.json @@ -6,14 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/payments/experiments", "main": "libs/payments/experiments/src/index.ts", "tsConfig": "libs/payments/experiments/tsconfig.lib.json", "assets": ["libs/payments/experiments/*.md"], - "declaration": true + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/payments/iap/project.json b/libs/payments/iap/project.json index 9efc9aaaca0..f7a1ef20660 100644 --- a/libs/payments/iap/project.json +++ b/libs/payments/iap/project.json @@ -12,31 +12,26 @@ } }, "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/iap/src/index.ts", "outputPath": "dist/libs/payments/iap", - "outputFileName": "main.js", "tsConfig": "libs/payments/iap/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/payments/iap/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/legacy/project.json b/libs/payments/legacy/project.json index 66f0b73fdbb..dd13fa9d19b 100644 --- a/libs/payments/legacy/project.json +++ b/libs/payments/legacy/project.json @@ -6,31 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/legacy/src/index.ts", "outputPath": "dist/libs/payments/legacy", - "outputFileName": "main.js", "tsConfig": "libs/payments/legacy/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/payments/legacy/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/management/project.json b/libs/payments/management/project.json index 227c3b70203..7d3b554ca6e 100644 --- a/libs/payments/management/project.json +++ b/libs/payments/management/project.json @@ -6,13 +6,18 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/management/src/index.ts", "outputPath": "dist/libs/payments/management", - "outputFileName": "main.js", "tsConfig": "libs/payments/management/tsconfig.lib.json", "assets": [ { @@ -20,17 +25,7 @@ "input": ".", "output": "." } - ], - "platform": "node", - "declaration" : true - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/metrics/package.json b/libs/payments/metrics/package.json index 749e02e1b97..232da79bb5f 100644 --- a/libs/payments/metrics/package.json +++ b/libs/payments/metrics/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/payments/metrics", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/payments/metrics/project.json b/libs/payments/metrics/project.json index 229178fcce4..b2e6fd0a124 100644 --- a/libs/payments/metrics/project.json +++ b/libs/payments/metrics/project.json @@ -6,16 +6,22 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "dependsOn": ["^build", "glean-generate", "glean-generate-frontend"], + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/payments/metrics", "main": "libs/payments/metrics/src/index.ts", "tsConfig": "libs/payments/metrics/tsconfig.lib.json", - "assets": ["libs/payments/metrics/*.md"], - "declaration": true - }, - "dependsOn": ["glean-generate", "glean-generate-frontend"] + "assets": ["libs/payments/metrics/*.md"] + } }, "compile": { "command": "tsc -p libs/payments/metrics/tsconfig.json --noEmit", @@ -23,16 +29,38 @@ }, "glean-generate": { "dependsOn": ["glean-lint"], + "cache": true, + "inputs": [ + "{workspaceRoot}/libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml" + ], + "outputs": [ + "{projectRoot}/src/lib/glean/__generated__/server_events.ts" + ], "command": "yarn glean translate libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml -f typescript_server -o libs/payments/metrics/src/lib/glean/__generated__" }, "glean-lint": { + "cache": true, + "inputs": [ + "{workspaceRoot}/libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml" + ], "command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-backend-metrics.yaml" }, "glean-generate-frontend": { "dependsOn": ["glean-lint-frontend"], + "cache": true, + "inputs": [ + "{workspaceRoot}/libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml" + ], + "outputs": [ + "{projectRoot}/src/lib/glean/__generated__/subscriptions.ts" + ], "command": "yarn glean translate libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml -f typescript -o libs/payments/metrics/src/lib/glean/__generated__" }, "glean-lint-frontend": { + "cache": true, + "inputs": [ + "{workspaceRoot}/libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml" + ], "command": "yarn glean glinter libs/shared/metrics/glean/src/registry/subplat-frontend-metrics.yaml" }, "test-unit": { diff --git a/libs/payments/metrics/src/lib/glean/glean.factory.ts b/libs/payments/metrics/src/lib/glean/glean.factory.ts index 588c0206b83..3ca5700e097 100644 --- a/libs/payments/metrics/src/lib/glean/glean.factory.ts +++ b/libs/payments/metrics/src/lib/glean/glean.factory.ts @@ -27,7 +27,6 @@ import { type StripeMetricsData, type SubPlatCmsMetricsData, } from './glean.types'; -import { ResultCartFactory } from '@fxa/payments/cart'; import { SubplatInterval, TaxAddressFactory } from '@fxa/payments/customer'; export const CheckoutParamsFactory = ( @@ -61,21 +60,15 @@ export const CommonMetricsFactory = ( export const CartMetricsFactory = ( override?: Partial -): CartMetrics => { - const resultCart = ResultCartFactory({ - ...override, - }); - - return { - uid: resultCart.uid, - errorReasonId: resultCart.errorReasonId, - couponCode: resultCart.couponCode, - currency: faker.finance.currencyCode().toLowerCase(), - stripeCustomerId: `cus_${faker.string.alphanumeric({ length: 14 })}`, - taxAddress: resultCart.taxAddress, - ...override, - }; -}; +): CartMetrics => ({ + uid: undefined, + errorReasonId: null, + couponCode: undefined, + currency: faker.finance.currencyCode().toLowerCase(), + stripeCustomerId: `cus_${faker.string.alphanumeric({ length: 14 })}`, + taxAddress: undefined, + ...override, +}); export const CmsMetricsDataFactory = ( override?: Partial @@ -106,10 +99,7 @@ export const SubscriptionCancellationDataFactory = ( export const TrialConversionDataFactory = ( override?: Partial ): TrialConversionData => ({ - conversionStatus: faker.helpers.arrayElement([ - 'successful', - 'unsuccessful', - ]), + conversionStatus: faker.helpers.arrayElement(['successful', 'unsuccessful']), providerEventId: `evt_${faker.string.alphanumeric({ length: 24 })}`, productId: `prod_${faker.string.alphanumeric({ length: 14 })}`, billingCountry: faker.location.countryCode(), diff --git a/libs/payments/metrics/src/lib/glean/glean.service.spec.ts b/libs/payments/metrics/src/lib/glean/glean.service.spec.ts index b76f10e29f0..989225b3121 100644 --- a/libs/payments/metrics/src/lib/glean/glean.service.spec.ts +++ b/libs/payments/metrics/src/lib/glean/glean.service.spec.ts @@ -6,9 +6,7 @@ import { Test } from '@nestjs/testing'; import { PaymentsGleanManager } from './glean.manager'; import { PaymentsGleanService } from './glean.service'; import { MockPaymentsGleanFactory } from './glean.test-provider'; -import { - MockPaymentsGleanConfigProvider, -} from './glean.config'; +import { MockPaymentsGleanConfigProvider } from './glean.config'; import { AccountsMetricsDataFactory, CommonMetricsFactory, @@ -54,7 +52,6 @@ import { } from '@fxa/shared/experiments'; import { MockFirestoreProvider } from '@fxa/shared/db/firestore'; import { MockStatsDProvider } from '@fxa/shared/metrics/statsd'; -import { AsyncLocalStorageCartProvider } from '@fxa/payments/cart'; describe('PaymentsGleanService', () => { let paymentsGleanService: PaymentsGleanService; @@ -70,7 +67,6 @@ describe('PaymentsGleanService', () => { const moduleRef = await Test.createTestingModule({ providers: [ AccountManager, - AsyncLocalStorageCartProvider, CustomerManager, Logger, MockFirestoreProvider, diff --git a/libs/payments/metrics/src/lib/glean/glean.service.ts b/libs/payments/metrics/src/lib/glean/glean.service.ts index 09721db5ba6..e10ca87fc4e 100644 --- a/libs/payments/metrics/src/lib/glean/glean.service.ts +++ b/libs/payments/metrics/src/lib/glean/glean.service.ts @@ -28,7 +28,7 @@ import type { StripePrice, StripeSubscription, } from '@fxa/payments/stripe'; -import { getPriceFromSubscription } from 'libs/payments/customer/src/lib/util/getPriceFromSubscription'; +import { getPriceFromSubscription } from '@fxa/payments/customer'; import { PaymentsGleanManager } from './glean.manager'; import { Logger, Injectable } from '@nestjs/common'; diff --git a/libs/payments/metrics/src/lib/glean/glean.types.ts b/libs/payments/metrics/src/lib/glean/glean.types.ts index d4a9789e180..c80daf8045c 100644 --- a/libs/payments/metrics/src/lib/glean/glean.types.ts +++ b/libs/payments/metrics/src/lib/glean/glean.types.ts @@ -2,7 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import type { ResultCart } from '@fxa/payments/cart'; import type { SubplatInterval } from '@fxa/payments/customer'; export const CheckoutTypes = [ @@ -31,15 +30,14 @@ export type CommonMetrics = { searchParams: Record; }; -export type CartMetrics = Pick< - ResultCart, - | 'uid' - | 'errorReasonId' - | 'couponCode' - | 'currency' - | 'stripeCustomerId' - | 'taxAddress' ->; +export type CartMetrics = { + uid?: string; + errorReasonId?: string | null; + couponCode?: string | null; + currency?: string | null; + stripeCustomerId?: string | null; + taxAddress?: TaxAddress | null; +}; export type ExperimentationData = { nimbusUserId: string; diff --git a/libs/payments/paypal/project.json b/libs/payments/paypal/project.json index 6b054faf470..4ad3086e4f7 100644 --- a/libs/payments/paypal/project.json +++ b/libs/payments/paypal/project.json @@ -6,13 +6,18 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/paypal/src/index.ts", "outputPath": "dist/libs/payments/paypal", - "outputFileName": "main.js", "tsConfig": "libs/payments/paypal/tsconfig.lib.json", "assets": [ { @@ -20,16 +25,7 @@ "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/stripe/package.json b/libs/payments/stripe/package.json index a7bee9df242..d6e657f0991 100644 --- a/libs/payments/stripe/package.json +++ b/libs/payments/stripe/package.json @@ -1,4 +1,4 @@ { - "name": "payments/stripe", + "name": "@fxa/payments/stripe", "version": "0.0.0" } diff --git a/libs/payments/stripe/project.json b/libs/payments/stripe/project.json index 799281ebbe6..192924b3c58 100644 --- a/libs/payments/stripe/project.json +++ b/libs/payments/stripe/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib:payments"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/payments/stripe/src/index.ts", "outputPath": "dist/libs/payments/stripe", - "outputFileName": "main.js", "tsConfig": "libs/payments/stripe/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/payments/stripe/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/payments/stripe/src/lib/factories/price.factory.ts b/libs/payments/stripe/src/lib/factories/price.factory.ts index 5d4aa9ee623..cf7f3324070 100644 --- a/libs/payments/stripe/src/lib/factories/price.factory.ts +++ b/libs/payments/stripe/src/lib/factories/price.factory.ts @@ -22,7 +22,8 @@ export const StripePriceFactory = ( const currency = override?.currency?.toLowerCase() || faker.finance.currencyCode().toLowerCase(); - const unit_amount = override?.unit_amount || faker.number.int({ max: 1000 }); + const unit_amount = + override?.unit_amount || faker.number.int({ min: 1, max: 1000 }); const unit_amount_decimal = override?.unit_amount_decimal || faker.commerce.price({ min: 1000 }); return { diff --git a/libs/payments/webhooks/package.json b/libs/payments/webhooks/package.json index ab7319314da..b3b861f0b1e 100644 --- a/libs/payments/webhooks/package.json +++ b/libs/payments/webhooks/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/payments/webhooks", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/payments/webhooks/project.json b/libs/payments/webhooks/project.json index c87a34748a6..c04f6bb1814 100644 --- a/libs/payments/webhooks/project.json +++ b/libs/payments/webhooks/project.json @@ -6,14 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/payments/webhooks", "main": "libs/payments/webhooks/src/index.ts", "tsConfig": "libs/payments/webhooks/tsconfig.lib.json", "assets": ["libs/payments/webhooks/*.md"], - "declaration": true + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/profile/client/package.json b/libs/profile/client/package.json index b0b290dfe74..93ed58cc369 100644 --- a/libs/profile/client/package.json +++ b/libs/profile/client/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/profile/client", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/profile/client/project.json b/libs/profile/client/project.json index d2f189825bf..bd7c0843a7f 100644 --- a/libs/profile/client/project.json +++ b/libs/profile/client/project.json @@ -6,14 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/profile/client", "main": "libs/profile/client/src/index.ts", "tsConfig": "libs/profile/client/tsconfig.lib.json", "assets": ["libs/profile/client/*.md"], - "declaration": true + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/account/account/project.json b/libs/shared/account/account/project.json index f25982c12be..b544a652515 100644 --- a/libs/shared/account/account/project.json +++ b/libs/shared/account/account/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/account/account/src/index.ts", "outputPath": "dist/libs/shared/account/account", - "outputFileName": "main.js", "tsConfig": "libs/shared/account/account/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/account/account/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/assets/project.json b/libs/shared/assets/project.json index 6b053260ef2..6b7209bc7ec 100644 --- a/libs/shared/assets/project.json +++ b/libs/shared/assets/project.json @@ -5,6 +5,13 @@ "projectType": "library", "targets": { "build": { + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { diff --git a/libs/shared/cloud-tasks/project.json b/libs/shared/cloud-tasks/project.json index 1d68b8010af..fd98fb75622 100644 --- a/libs/shared/cloud-tasks/project.json +++ b/libs/shared/cloud-tasks/project.json @@ -6,31 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/cloud-tasks/src/index.ts", "outputPath": "dist/libs/shared/cloud-tasks", - "outputFileName": "main.js", "tsConfig": "libs/shared/cloud-tasks/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/cloud-tasks/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/cms/project.json b/libs/shared/cms/project.json index c0d56d735dc..63a46aa3064 100644 --- a/libs/shared/cms/project.json +++ b/libs/shared/cms/project.json @@ -12,31 +12,26 @@ } }, "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/cms/src/index.ts", "outputPath": "dist/libs/shared/cms", - "outputFileName": "main.js", "tsConfig": "libs/shared/cms/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/cms/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/db/firestore/project.json b/libs/shared/db/firestore/project.json index 2dc1dbde25f..ad0fa418ffb 100644 --- a/libs/shared/db/firestore/project.json +++ b/libs/shared/db/firestore/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/db/firestore/src/index.ts", "outputPath": "dist/libs/shared/db/firestore", - "outputFileName": "main.js", "tsConfig": "libs/shared/db/firestore/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/db/firestore/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/db/mysql/account/project.json b/libs/shared/db/mysql/account/project.json index 4623aa4d9a1..34d11fcd98b 100644 --- a/libs/shared/db/mysql/account/project.json +++ b/libs/shared/db/mysql/account/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/db/mysql/account/src/index.ts", "outputPath": "dist/libs/shared/db/mysql/account", - "outputFileName": "main.js", "tsConfig": "libs/shared/db/mysql/account/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/db/mysql/account/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/db/mysql/core/project.json b/libs/shared/db/mysql/core/project.json index fbdd06f8ac8..25cf734ac2f 100644 --- a/libs/shared/db/mysql/core/project.json +++ b/libs/shared/db/mysql/core/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/db/mysql/core/src/index.ts", "outputPath": "dist/libs/shared/db/mysql/core", - "outputFileName": "main.js", "tsConfig": "libs/shared/db/mysql/core/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/db/mysql/core/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/db/type-cacheable/project.json b/libs/shared/db/type-cacheable/project.json index dd14ab15ede..10d4b7a8cf9 100644 --- a/libs/shared/db/type-cacheable/project.json +++ b/libs/shared/db/type-cacheable/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/db/type-cacheable/src/index.ts", "outputPath": "dist/libs/shared/db/type-cacheable", - "outputFileName": "main.js", "tsConfig": "libs/shared/db/type-cacheable/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/db/type-cacheable/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/error/project.json b/libs/shared/error/project.json index 496b5868925..f07017606bd 100644 --- a/libs/shared/error/project.json +++ b/libs/shared/error/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/error/src/index.ts", "outputPath": "dist/libs/shared/error", - "outputFileName": "main.js", "tsConfig": "libs/shared/error/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/error/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/error/src/index.ts b/libs/shared/error/src/index.ts index c0a5997d9e1..b8c9a63102b 100644 --- a/libs/shared/error/src/index.ts +++ b/libs/shared/error/src/index.ts @@ -1,5 +1,13 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -export { BaseError, BaseMultiError, TypeError, GENERIC_ERROR_MESSAGE } from './lib/error'; -export { SanitizeExceptions } from './lib/sanitizeExceptionsDecorator'; +export { + BaseError, + BaseMultiError, + TypeError, + GENERIC_ERROR_MESSAGE, +} from './lib/error'; +export { + SanitizeExceptions, + handleException, +} from './lib/sanitizeExceptionsDecorator'; diff --git a/libs/shared/experiments/package.json b/libs/shared/experiments/package.json index 320007c223e..8a7d93cfe00 100644 --- a/libs/shared/experiments/package.json +++ b/libs/shared/experiments/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/shared/experiments", - "version": "0.0.1", - "private": true, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "dependencies": {} + "version": "0.0.1" } diff --git a/libs/shared/experiments/project.json b/libs/shared/experiments/project.json index ebbdc29183f..841a2073736 100644 --- a/libs/shared/experiments/project.json +++ b/libs/shared/experiments/project.json @@ -6,14 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/experiments", "main": "libs/shared/experiments/src/index.ts", "tsConfig": "libs/shared/experiments/tsconfig.lib.json", "assets": ["libs/shared/experiments/*.md"], - "declaration": true + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/geodb/project.json b/libs/shared/geodb/project.json index 743ceee36e5..26775351ada 100644 --- a/libs/shared/geodb/project.json +++ b/libs/shared/geodb/project.json @@ -6,31 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/geodb/src/index.ts", "outputPath": "dist/libs/shared/geodb", - "outputFileName": "main.js", "tsConfig": "libs/shared/geodb/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/geodb/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test-unit": { diff --git a/libs/shared/guards/project.json b/libs/shared/guards/project.json index 484c7621f17..2802301053b 100644 --- a/libs/shared/guards/project.json +++ b/libs/shared/guards/project.json @@ -6,14 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/guards", "main": "libs/shared/guards/src/index.ts", "tsConfig": "libs/shared/guards/tsconfig.lib.json", "assets": ["libs/shared/guards/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/l10n/project.json b/libs/shared/l10n/project.json index 4fafde9e7b9..23700dc0421 100644 --- a/libs/shared/l10n/project.json +++ b/libs/shared/l10n/project.json @@ -6,32 +6,31 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/l10n/src/index.ts", "outputPath": "dist/libs/shared/l10n", - "outputFileName": "main.js", "tsConfig": "libs/shared/l10n/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/l10n/README.md", "input": ".", "output": "." + }, + { + "glob": "src/**/*.json", + "input": "libs/shared/l10n", + "output": "." } - ], - "platform": "node", - "format": ["cjs", "esm"] - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/l10n/src/lib/l10n.utils.spec.ts b/libs/shared/l10n/src/lib/l10n.utils.spec.ts index 681a7a3449f..a7048fa3e34 100644 --- a/libs/shared/l10n/src/lib/l10n.utils.spec.ts +++ b/libs/shared/l10n/src/lib/l10n.utils.spec.ts @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import supportedLanguages from './supported-languages.json'; +const supportedLanguages: string[] = require('./supported-languages.json'); import { determineDirection, determineLocale, diff --git a/libs/shared/l10n/src/lib/l10n.utils.ts b/libs/shared/l10n/src/lib/l10n.utils.ts index b15a8352497..a0f2a420035 100644 --- a/libs/shared/l10n/src/lib/l10n.utils.ts +++ b/libs/shared/l10n/src/lib/l10n.utils.ts @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { negotiateLanguages } from '@fluent/langneg'; -import availableLocales from './supported-languages.json'; +const availableLocales: string[] = require('./supported-languages.json'); import moment from 'moment'; import { LocalizeOptions } from './l10n.types'; import { DEFAULT_LOCALE, EN_GB_LOCALES } from './l10n.constants'; @@ -162,7 +162,7 @@ export function determineLocale( )[0]; } -import rtlLocales from './rtl-locales.json'; +const rtlLocales: string[] = require('./rtl-locales.json'); /** * Given a set of supported languages and an accept-language http header value, this resolves the direction of the language that fits best. diff --git a/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.spec.ts b/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.spec.ts index e69d2647d22..0f76b11b597 100644 --- a/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.spec.ts +++ b/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.spec.ts @@ -5,7 +5,7 @@ import { Test } from '@nestjs/testing'; import { LocalizerRscFactory } from './localizer.rsc.factory'; import { ILocalizerBindings } from './localizer.interfaces'; -import supportedLanguages from '../supported-languages.json'; +const supportedLanguages: string[] = require('../supported-languages.json'); import { LocalizerRsc } from './localizer.rsc'; describe('LocalizerRscFactory', () => { diff --git a/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.ts b/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.ts index a80312bc18b..f552fff5cab 100644 --- a/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.ts +++ b/libs/shared/l10n/src/lib/localizer/localizer.rsc.factory.ts @@ -5,7 +5,7 @@ import 'server-only'; import { Injectable } from '@nestjs/common'; import { LocalizerBase } from './localizer.base'; import type { ILocalizerBindings } from './localizer.interfaces'; -import supportedLanguages from '../supported-languages.json'; +const supportedLanguages: string[] = require('../supported-languages.json'); import { FluentBundle } from '@fluent/bundle'; import { LocalizerRsc } from './localizer.rsc'; import { JSDOM } from 'jsdom'; diff --git a/libs/shared/l10n/src/lib/supported-languages.spec.ts b/libs/shared/l10n/src/lib/supported-languages.spec.ts index cbfdede42c6..7306862e879 100644 --- a/libs/shared/l10n/src/lib/supported-languages.spec.ts +++ b/libs/shared/l10n/src/lib/supported-languages.spec.ts @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import supportedLanguages from './supported-languages.json'; +const supportedLanguages: string[] = require('./supported-languages.json'); describe('l10n/supportedLanguages:', () => { it('returns an array of languages', () => { diff --git a/libs/shared/l10n/tsconfig.lib.json b/libs/shared/l10n/tsconfig.lib.json index 4befa7f0990..6836ea5b7f0 100644 --- a/libs/shared/l10n/tsconfig.lib.json +++ b/libs/shared/l10n/tsconfig.lib.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "rootDir": "../../..", "outDir": "../../../dist/out-tsc", "declaration": true, "types": ["node"] diff --git a/libs/shared/log/project.json b/libs/shared/log/project.json index abe5a80584d..8a863f92a71 100644 --- a/libs/shared/log/project.json +++ b/libs/shared/log/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/log/src/index.ts", "outputPath": "dist/libs/shared/log", - "outputFileName": "main.js", "tsConfig": "libs/shared/log/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/log/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/metrics/glean/package.json b/libs/shared/metrics/glean/package.json index d290f411949..92f661e3459 100644 --- a/libs/shared/metrics/glean/package.json +++ b/libs/shared/metrics/glean/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/shared/glean", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/shared/metrics/glean/project.json b/libs/shared/metrics/glean/project.json index 15e93ffb155..a4aca87ec4a 100644 --- a/libs/shared/metrics/glean/project.json +++ b/libs/shared/metrics/glean/project.json @@ -6,15 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/metrics/glean", "main": "libs/shared/metrics/glean/src/index.ts", "tsConfig": "libs/shared/metrics/glean/tsconfig.lib.json", "assets": ["libs/shared/metrics/glean/*.md"], - "declaration": true, - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/metrics/statsd/project.json b/libs/shared/metrics/statsd/project.json index 5f24cd072ff..1ae0ef1ad33 100644 --- a/libs/shared/metrics/statsd/project.json +++ b/libs/shared/metrics/statsd/project.json @@ -6,31 +6,26 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/metrics/statsd/src/index.ts", "outputPath": "dist/libs/shared/metrics/statsd", - "outputFileName": "main.js", "tsConfig": "libs/shared/metrics/statsd/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/metrics/statsd/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/mozlog/project.json b/libs/shared/mozlog/project.json index 031dca5c9b1..795f4231457 100644 --- a/libs/shared/mozlog/project.json +++ b/libs/shared/mozlog/project.json @@ -6,36 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/mozlog/src/index.ts", "outputPath": "dist/libs/shared/mozlog", - "outputFileName": "main.js", "tsConfig": "libs/shared/mozlog/tsconfig.lib.json", - "declaration": true, - "external": [ - "@nestjs/websockets/socket-module", - "@nestjs/microservices/microservices-module", - "@nestjs/microservices" - ], "assets": [ { "glob": "libs/shared/mozlog/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/nestjs/customs/package.json b/libs/shared/nestjs/customs/package.json index cc51ecb6f51..afcd7647fd8 100644 --- a/libs/shared/nestjs/customs/package.json +++ b/libs/shared/nestjs/customs/package.json @@ -1,9 +1,4 @@ { "name": "@fxa/shared/nestjs/customs", - "version": "0.0.1", - "private": true, - "type": "commonjs", - "main": "./index.cjs", - "types": "./index.d.ts", - "dependencies": {} + "version": "0.0.1" } diff --git a/libs/shared/nestjs/customs/project.json b/libs/shared/nestjs/customs/project.json index e24c5acaa12..4db7456dbc2 100644 --- a/libs/shared/nestjs/customs/project.json +++ b/libs/shared/nestjs/customs/project.json @@ -6,19 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/nestjs/customs", "main": "libs/shared/nestjs/customs/src/index.ts", "tsConfig": "libs/shared/nestjs/customs/tsconfig.lib.json", - "external": [ - "@nestjs/websockets/socket-module", - "@nestjs/microservices/microservices-module", - "@nestjs/microservices" - ], "assets": ["libs/shared/nestjs/customs/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/notifier/project.json b/libs/shared/notifier/project.json index f0acd5c3064..8e013d90245 100644 --- a/libs/shared/notifier/project.json +++ b/libs/shared/notifier/project.json @@ -6,36 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/notifier/src/index.ts", "outputPath": "dist/libs/shared/notifier", - "outputFileName": "main.js", "tsConfig": "libs/shared/notifier/tsconfig.lib.json", - "declaration": true, - "external": [ - "@nestjs/websockets/socket-module", - "@nestjs/microservices/microservices-module", - "@nestjs/microservices" - ], "assets": [ { "glob": "libs/shared/notifier/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/shared/otel/project.json b/libs/shared/otel/project.json index 67916bf7d7d..7deaabb0264 100644 --- a/libs/shared/otel/project.json +++ b/libs/shared/otel/project.json @@ -6,15 +6,21 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/otel", "main": "libs/shared/otel/src/index.ts", "tsConfig": "libs/shared/otel/tsconfig.lib.json", "assets": ["libs/shared/otel/*.md"], - "declaration": true, - "platform": "node" + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/otp/project.json b/libs/shared/otp/project.json index bf78883db2b..5801db3fa8a 100644 --- a/libs/shared/otp/project.json +++ b/libs/shared/otp/project.json @@ -6,31 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/otp/src/index.ts", "outputPath": "dist/libs/shared/otp", - "outputFileName": "main.js", "tsConfig": "libs/shared/otp/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/otp/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test-unit": { diff --git a/libs/shared/pem-jwk/project.json b/libs/shared/pem-jwk/project.json index 93704d09ee2..25173bce781 100644 --- a/libs/shared/pem-jwk/project.json +++ b/libs/shared/pem-jwk/project.json @@ -6,32 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/pem-jwk/src/index.ts", "outputPath": "dist/libs/shared/pem-jwk", - "outputFileName": "main.js", "tsConfig": "libs/shared/pem-jwk/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/shared/pem-jwk/README.md", "input": ".", "output": "." } - ], - "platform": "node", - "format": ["cjs", "esm"] - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test-unit": { diff --git a/libs/shared/react/project.json b/libs/shared/react/project.json index 42a3602c6d3..7ad10d30282 100644 --- a/libs/shared/react/project.json +++ b/libs/shared/react/project.json @@ -6,6 +6,13 @@ "tags": [], "targets": { "build": { + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { diff --git a/libs/shared/sentry-browser/package.json b/libs/shared/sentry-browser/package.json index 01e83c4837f..4aab946b116 100644 --- a/libs/shared/sentry-browser/package.json +++ b/libs/shared/sentry-browser/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/shared/sentry-browser", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/shared/sentry-browser/project.json b/libs/shared/sentry-browser/project.json index 221ce77e56a..2d6c013c74d 100644 --- a/libs/shared/sentry-browser/project.json +++ b/libs/shared/sentry-browser/project.json @@ -6,14 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/sentry-browser", "main": "libs/shared/sentry-browser/src/index.ts", "tsConfig": "libs/shared/sentry-browser/tsconfig.lib.json", "assets": ["libs/shared/sentry-browser/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/sentry-nest/package.json b/libs/shared/sentry-nest/package.json index 2edc7f50612..64a1c31ca13 100644 --- a/libs/shared/sentry-nest/package.json +++ b/libs/shared/sentry-nest/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/shared/sentry-nest", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/shared/sentry-nest/project.json b/libs/shared/sentry-nest/project.json index 62995b8ed65..e05bef50fae 100644 --- a/libs/shared/sentry-nest/project.json +++ b/libs/shared/sentry-nest/project.json @@ -6,14 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/sentry-nest", "main": "libs/shared/sentry-nest/src/index.ts", "tsConfig": "libs/shared/sentry-nest/tsconfig.lib.json", "assets": ["libs/shared/sentry-nest/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/sentry-next/package.json b/libs/shared/sentry-next/package.json index 3a7fa353c82..454aa639fb0 100644 --- a/libs/shared/sentry-next/package.json +++ b/libs/shared/sentry-next/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/shared/sentry-next", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/shared/sentry-next/project.json b/libs/shared/sentry-next/project.json index 3c9b27f34a8..31ebbd9ccfd 100644 --- a/libs/shared/sentry-next/project.json +++ b/libs/shared/sentry-next/project.json @@ -6,14 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/sentry-next", "main": "libs/shared/sentry-next/src/index.ts", "tsConfig": "libs/shared/sentry-next/tsconfig.lib.json", "assets": ["libs/shared/sentry-next/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/sentry-node/package.json b/libs/shared/sentry-node/package.json index e171c04c158..ce087b8577e 100644 --- a/libs/shared/sentry-node/package.json +++ b/libs/shared/sentry-node/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/shared/sentry-node", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/shared/sentry-node/project.json b/libs/shared/sentry-node/project.json index 17bc52aded5..3317d9d95a7 100644 --- a/libs/shared/sentry-node/project.json +++ b/libs/shared/sentry-node/project.json @@ -6,14 +6,21 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/sentry-node", "main": "libs/shared/sentry-node/src/index.ts", "tsConfig": "libs/shared/sentry-node/tsconfig.lib.json", "assets": ["libs/shared/sentry-node/*.md"], - "format": ["cjs"] + "generatePackageJson": true } }, "test-unit": { diff --git a/libs/shared/sentry-utils/package.json b/libs/shared/sentry-utils/package.json index 1a8293c67b0..93c4df10f91 100644 --- a/libs/shared/sentry-utils/package.json +++ b/libs/shared/sentry-utils/package.json @@ -1,8 +1,4 @@ { "name": "@fxa/shared/sentry-utils", - "version": "0.0.1", - "dependencies": {}, - "type": "commonjs", - "main": "./index.cjs", - "private": true + "version": "0.0.1" } diff --git a/libs/shared/sentry-utils/project.json b/libs/shared/sentry-utils/project.json index 06dcb58a9eb..f45f5ebe0d2 100644 --- a/libs/shared/sentry-utils/project.json +++ b/libs/shared/sentry-utils/project.json @@ -6,14 +6,20 @@ "tags": ["scope:shared:lib"], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], "options": { "outputPath": "dist/libs/shared/sentry-utils", "main": "libs/shared/sentry-utils/src/index.ts", "tsConfig": "libs/shared/sentry-utils/tsconfig.lib.json", - "assets": ["libs/shared/sentry-utils/*.md"], - "format": ["cjs"] + "assets": ["libs/shared/sentry-utils/*.md"] } }, "test-unit": { diff --git a/libs/shared/sentry/project.json b/libs/shared/sentry/project.json index 5278bb2a734..f7987b90c9b 100644 --- a/libs/shared/sentry/project.json +++ b/libs/shared/sentry/project.json @@ -6,39 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/shared/sentry/src/index.ts", "outputPath": "dist/libs/shared/sentry", - "outputFileName": "main.js", "tsConfig": "libs/shared/sentry/tsconfig.lib.json", - "declaration": true, - "external": [ - "@apollo/gateway", - "@apollo/subgraph", - "@as-integrations/fastify", - "@nestjs/websockets/socket-module", - "@nestjs/microservices/microservices-module", - "@nestjs/microservices" - ], "assets": [ { "glob": "libs/shared/sentry/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "lint": { diff --git a/libs/vendored/common-password-list/project.json b/libs/vendored/common-password-list/project.json index 1af294361df..3fed226ccab 100644 --- a/libs/vendored/common-password-list/project.json +++ b/libs/vendored/common-password-list/project.json @@ -6,31 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/vendored/common-password-list/src/index.ts", "outputPath": "dist/libs/vendored/common-password-list", - "outputFileName": "main.js", "tsConfig": "libs/vendored/common-password-list/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/vendored/common-password-list/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test-unit": { diff --git a/libs/vendored/crypto-relier/project.json b/libs/vendored/crypto-relier/project.json index b2f123fdeca..f7aebabc949 100644 --- a/libs/vendored/crypto-relier/project.json +++ b/libs/vendored/crypto-relier/project.json @@ -6,32 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/vendored/crypto-relier/src/index.ts", "outputPath": "dist/libs/vendored/crypto-relier", - "outputFileName": "main.js", "tsConfig": "libs/vendored/crypto-relier/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/vendored/crypto-relier/README.md", "input": ".", "output": "." } - ], - "platform": "node", - "format": ["cjs", "esm"] - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test": { diff --git a/libs/vendored/incremental-encoder/project.json b/libs/vendored/incremental-encoder/project.json index 0a84e392f1f..743a3de4778 100644 --- a/libs/vendored/incremental-encoder/project.json +++ b/libs/vendored/incremental-encoder/project.json @@ -6,31 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/vendored/incremental-encoder/src/index.ts", "outputPath": "dist/libs/vendored/incremental-encoder", - "outputFileName": "main.js", "tsConfig": "libs/vendored/incremental-encoder/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/vendored/incremental-encoder/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test-unit": { diff --git a/libs/vendored/jwtool/project.json b/libs/vendored/jwtool/project.json index 7bd9c8c5ef0..ff7cb55cf21 100644 --- a/libs/vendored/jwtool/project.json +++ b/libs/vendored/jwtool/project.json @@ -6,32 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/vendored/jwtool/src/index.ts", "outputPath": "dist/libs/vendored/jwtool", - "outputFileName": "main.js", "tsConfig": "libs/vendored/jwtool/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/vendored/jwtool/README.md", "input": ".", "output": "." } - ], - "platform": "node", - "format": ["cjs", "esm"] - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test-unit": { diff --git a/libs/vendored/typesafe-node-firestore/project.json b/libs/vendored/typesafe-node-firestore/project.json index 732adbc9193..2fb64d0992c 100644 --- a/libs/vendored/typesafe-node-firestore/project.json +++ b/libs/vendored/typesafe-node-firestore/project.json @@ -6,31 +6,26 @@ "tags": [], "targets": { "build": { - "executor": "@nx/esbuild:esbuild", + "dependsOn": ["build-ts"], + "executor": "nx:run-commands", + "options": { + "command": "echo Build complete" + } + }, + "build-ts": { + "executor": "@nx/js:tsc", "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", "options": { "main": "libs/vendored/typesafe-node-firestore/src/index.ts", "outputPath": "dist/libs/vendored/typesafe-node-firestore", - "outputFileName": "main.js", "tsConfig": "libs/vendored/typesafe-node-firestore/tsconfig.lib.json", - "declaration": true, "assets": [ { "glob": "libs/vendored/typesafe-node-firestore/README.md", "input": ".", "output": "." } - ], - "platform": "node" - }, - "configurations": { - "development": { - "minify": false - }, - "production": { - "minify": true - } + ] } }, "test": { diff --git a/nx.json b/nx.json index d7ce2918c39..1a72f824561 100644 --- a/nx.json +++ b/nx.json @@ -147,11 +147,6 @@ "cache": true, "dependsOn": ["^build"], "inputs": ["production", "^production"] - }, - "@nx/esbuild:esbuild": { - "cache": true, - "dependsOn": ["^build"], - "inputs": ["production", "^production"] } }, "namedInputs": { diff --git a/package.json b/package.json index 5695c8373a5..77f3cbb6e68 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,6 @@ "@nestjs/cli": "^11.0.1", "@nestjs/schematics": "11.0.9", "@nestjs/testing": "^10.3.4", - "@nx/esbuild": "21.2.4", "@nx/eslint-plugin": "21.2.4", "@nx/jest": "21.2.4", "@nx/js": "21.2.4", @@ -252,8 +251,6 @@ "babel-eslint": "^10.1.0", "babel-jest": "29.7.0", "copyfiles": "^2.4.1", - "esbuild": "^0.17.15", - "esbuild-register": "^3.5.0", "eslint": "^8.57.1", "eslint-config-next": "15.5.14", "eslint-config-prettier": "^10.1.5", @@ -322,12 +319,5 @@ "resolutionComments": { "multer": "^2.1.1 — remove when @nestjs/platform-express is upgraded to 11.x (ships multer 2.1.1 natively)" }, - "packageManager": "yarn@4.9.2", - "_moduleAliases": { - "@fxa/vendored/jwtool": "./dist/libs/vendored/jwtool/main.cjs", - "@fxa/vendored/crypto-relier": "./dist/libs/vendored/crypto-relier/main.cjs", - "@fxa/vendored/crypto-relier/esm": "./dist/libs/vendored/crypto-relier/main.js", - "@fxa/shared/pem-jwk": "./dist/libs/shared/pem-jwk/main.cjs", - "@fxa/shared/l10n": "./dist/libs/shared/l10n/main.cjs" - } + "packageManager": "yarn@4.9.2" } diff --git a/packages/123done/pm2.config.js b/packages/123done/pm2.config.js index cef28103d8a..ebd06d7d182 100644 --- a/packages/123done/pm2.config.js +++ b/packages/123done/pm2.config.js @@ -10,7 +10,8 @@ module.exports = { apps: [ { name: '123done', - script: 'node server.js', + script: + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register server.js', cwd: __dirname, max_restarts: '1', env: { @@ -26,7 +27,8 @@ module.exports = { }, { name: '321done', - script: 'node server.js', + script: + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register server.js', cwd: __dirname, max_restarts: '1', env: { diff --git a/packages/123done/tsconfig.json b/packages/123done/tsconfig.json new file mode 100644 index 00000000000..8e7bf6cfa25 --- /dev/null +++ b/packages/123done/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "allowJs": true, + "noEmit": true + }, + "include": ["*.js"] +} diff --git a/packages/fxa-admin-panel/pm2.config.js b/packages/fxa-admin-panel/pm2.config.js index 7f6ba40017f..8611ab94dc3 100644 --- a/packages/fxa-admin-panel/pm2.config.js +++ b/packages/fxa-admin-panel/pm2.config.js @@ -12,7 +12,8 @@ module.exports = { { name: 'admin', cwd: resolve(__dirname, 'server'), - script: 'node -r esbuild-register bin/fxa-admin-panel.ts', + script: + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register bin/fxa-admin-panel.ts', max_restarts: '1', min_uptime: '2m', env: { diff --git a/packages/fxa-admin-server/.vscode/launch.json b/packages/fxa-admin-server/.vscode/launch.json index de2ec3de549..5b7d029c2fd 100644 --- a/packages/fxa-admin-server/.vscode/launch.json +++ b/packages/fxa-admin-server/.vscode/launch.json @@ -11,7 +11,9 @@ "999999", "--colors", "-r", - "esbuild-register", + "ts-node/register", + "-r", + "tsconfig-paths/register", "${workspaceFolder}/src/test/**/*.spec.ts", "${workspaceFolder}/src/test/**/**/*.spec.ts", "${workspaceFolder}/src/test/**/**/**/*.spec.ts" @@ -33,7 +35,9 @@ "999999", "--colors", "-r", - "esbuild-register", + "ts-node/register", + "-r", + "tsconfig-paths/register", "${workspaceFolder}/${relativeFile}" ], "console": "integratedTerminal", diff --git a/packages/fxa-admin-server/package.json b/packages/fxa-admin-server/package.json index a6c6e106f79..62d844767ac 100644 --- a/packages/fxa-admin-server/package.json +++ b/packages/fxa-admin-server/package.json @@ -18,15 +18,15 @@ "restart": "pm2 restart pm2.config.js", "delete": "pm2 delete pm2.config.js", "test": "yarn gen-keys && yarn test-default && yarn test-e2e ", - "gen-keys": "node -r esbuild-register ./src/scripts/gen_keys.ts;", + "gen-keys": "node -r ts-node/register/transpile-only -r tsconfig-paths/register ./src/scripts/gen_keys.ts;", "test-unit": "JEST_JUNIT_OUTPUT_FILE=../../artifacts/tests/$npm_package_name/fxa-admin-server-jest-unit-results.xml jest --runInBand --coverage --detectOpenHandles --forceExit --logHeapUsage -t '^(?!.*?#integration).*' --ci --reporters=default --reporters=jest-junit", "test-integration": "JEST_JUNIT_OUTPUT_FILE=../../artifacts/tests/$npm_package_name/fxa-admin-server-jest-integration-results.xml jest --runInBand --coverage --forceExit --logHeapUsage -t '#integration' --ci --reporters=default --reporters=jest-junit", "test-default": "jest --runInBand --detectOpenHandles --forceExit -t=\"scripts/audit-tokens\"", "test-watch": "jest --watch", "test-cov": "jest --coverage", - "test-debug": "node --inspect-brk -r tsconfig-paths/register -r esbuild-register node_modules/.bin/jest --runInBand", + "test-debug": "node --inspect-brk -r tsconfig-paths/register node_modules/.bin/jest --runInBand", "test-e2e": "jest --runInBand --config ./jest-e2e.config.js --forceExit", - "email-bounce": "node -r esbuild-register ./src/scripts/email-bounce.ts" + "email-bounce": "node -r ts-node/register/transpile-only -r tsconfig-paths/register ./src/scripts/email-bounce.ts" }, "repository": { "type": "git", @@ -66,8 +66,6 @@ "audit-filter": "^0.5.0", "chance": "^1.1.8", "copyfiles": "^2.4.1", - "esbuild": "^0.17.15", - "esbuild-register": "^3.5.0", "eslint": "^8.18.0", "eslint-config-react-app": "^7.0.1", "eslint-plugin-prettier": "^5.2.3", @@ -76,6 +74,7 @@ "supertest": "^7.0.0", "tailwindcss": "3.4.3", "ts-jest": "^29.2.5", + "tsconfig-paths": "^4.2.0", "typescript": "5.5.3", "yargs": "^17.0.1" }, diff --git a/packages/fxa-admin-server/src/scripts/audit-tokens.spec.ts b/packages/fxa-admin-server/src/scripts/audit-tokens.spec.ts index e855f19edc7..ba5578e857b 100644 --- a/packages/fxa-admin-server/src/scripts/audit-tokens.spec.ts +++ b/packages/fxa-admin-server/src/scripts/audit-tokens.spec.ts @@ -118,7 +118,7 @@ describe('#integration - scripts/audit-tokens', () => { async function testScript(args: string) { // Note that logger output, directs to standard err. const { stderr, stdout } = await exec( - `NODE_ENV=development node -r esbuild-register scripts/audit-tokens.ts ${args}`, + `NODE_ENV=development node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/audit-tokens.ts ${args}`, { cwd, shell: '/bin/bash', diff --git a/packages/fxa-admin-server/src/scripts/db-helpers.ts b/packages/fxa-admin-server/src/scripts/db-helpers.ts index 899350d49f7..75b79c6e08d 100644 --- a/packages/fxa-admin-server/src/scripts/db-helpers.ts +++ b/packages/fxa-admin-server/src/scripts/db-helpers.ts @@ -118,6 +118,7 @@ export async function scaffoldDb( export async function clearDb() { await Email.knexQuery().del(); + await Account.knex().raw('DELETE FROM passkeys'); await Account.knexQuery().del(); await Device.knexQuery().del(); await SessionToken.knexQuery().del(); diff --git a/packages/fxa-admin-server/src/scripts/gen_keys.ts b/packages/fxa-admin-server/src/scripts/gen_keys.ts index 79a058be225..2b51a359bf3 100755 --- a/packages/fxa-admin-server/src/scripts/gen_keys.ts +++ b/packages/fxa-admin-server/src/scripts/gen_keys.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-client/package.json b/packages/fxa-auth-client/package.json index fe653836d46..c0cbe7822ef 100644 --- a/packages/fxa-auth-client/package.json +++ b/packages/fxa-auth-client/package.json @@ -38,9 +38,9 @@ "build-ts": "tsc --build tsconfig.browser.json && tsc --build tsconfig.cjs.json && tsc --build", "clean": "rimraf dist", "compile": "yarn build-ts", - "test": "mocha -r esbuild-register test/*", + "test": "TS_NODE_PROJECT=tsconfig.cjs.json mocha -r ts-node/register/transpile-only test/*", "format": "prettier --write --config ../../_dev/.prettierrc '**'", - "test-unit": "MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-auth-client-mocha-unit-results.xml mocha -r esbuild-register test/*", + "test-unit": "TS_NODE_PROJECT=tsconfig.cjs.json MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-auth-client-mocha-unit-results.xml mocha -r ts-node/register/transpile-only test/*", "test-integration": "echo No integration tests present for $npm_package_name" }, "author": "", @@ -51,8 +51,6 @@ "@types/mocha": "^10", "@types/node": "^22.13.5", "@types/prettier": "^2", - "esbuild": "^0.17.15", - "esbuild-register": "^3.5.0", "eslint": "^8.38.0", "eslint-config-react-app": "^7.0.1", "fast-text-encoding": "^1.0.4", diff --git a/packages/fxa-auth-server/.vscode/launch.json b/packages/fxa-auth-server/.vscode/launch.json index 4d41509d5b8..34d9d66dd66 100644 --- a/packages/fxa-auth-server/.vscode/launch.json +++ b/packages/fxa-auth-server/.vscode/launch.json @@ -60,7 +60,11 @@ "request": "launch", "name": "Verification Reminders", "args": [ - "-r", "esbuild-register", "${workspaceFolder}/scripts/verification-reminders.js" + "-r", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", + "${workspaceFolder}/scripts/verification-reminders.js" ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", diff --git a/packages/fxa-auth-server/lib/geodb.spec.ts b/packages/fxa-auth-server/lib/geodb.spec.ts index 66ab9435674..d7297b10b2b 100644 --- a/packages/fxa-auth-server/lib/geodb.spec.ts +++ b/packages/fxa-auth-server/lib/geodb.spec.ts @@ -45,9 +45,13 @@ describe('geodb', () => { expect(geoData.location.countryCode).toBe( knownIpLocation.location.countryCode ); - expect(geoData.timeZone).toBe(knownIpLocation.location.tz); - expect(geoData.location.state).toBe(knownIpLocation.location.state); - expect(geoData.location.stateCode).toBe(knownIpLocation.location.stateCode); + expect(knownIpLocation.location.tz.has(geoData.timeZone)).toBe(true); + expect(knownIpLocation.location.state.has(geoData.location.state)).toBe( + true + ); + expect( + knownIpLocation.location.stateCode.has(geoData.location.stateCode) + ).toBe(true); }); it('returns empty object data when disabled', () => { diff --git a/packages/fxa-auth-server/lib/routes/emails.spec.ts b/packages/fxa-auth-server/lib/routes/emails.spec.ts index 36225dbd811..420f32180d1 100644 --- a/packages/fxa-auth-server/lib/routes/emails.spec.ts +++ b/packages/fxa-auth-server/lib/routes/emails.spec.ts @@ -238,8 +238,7 @@ describe('update zendesk primary email', () => { productNameFieldId: '192837465', }, }; - zendeskClient = - require('../zendesk-client').createZendeskClient(config); + zendeskClient = require('../zendesk-client').createZendeskClient(config); searchSpy = sinon.spy(zendeskClient.search, 'queryAll'); listSpy = sinon.spy(zendeskClient.useridentities, 'list'); updateSpy = sinon.spy(zendeskClient, 'updateIdentity'); @@ -259,9 +258,7 @@ describe('update zendesk primary email', () => { .get(`/api/v2/users/${ZENDESK_USER_ID}/identities.json`) .reply(200, MOCK_FETCH_USER_IDENTITIES_SUCCESS); nock(`https://${SUBDOMAIN}.zendesk.com`) - .put( - `/api/v2/users/${ZENDESK_USER_ID}/identities/${IDENTITY_ID}.json` - ) + .put(`/api/v2/users/${ZENDESK_USER_ID}/identities/${IDENTITY_ID}.json`) .reply(200, MOCK_UPDATE_IDENTITY_SUCCESS); try { @@ -399,40 +396,44 @@ describe('/recovery_email/status', () => { it('unverified account - no subscription', () => { mockRequest.auth.credentials.emailVerified = false; - return runTest(route, mockRequest).then( - () => expect(true).toBe(false), - (response: any) => { - expect(mockDB.deleteAccount.callCount).toBe(1); - expect(mockDB.deleteAccount.firstCall.args[0].email).toBe( - TEST_EMAIL_INVALID - ); - expect(response.errno).toBe(error.ERRNO.INVALID_TOKEN); - expect(mockLog.info.callCount).toBe(1); - const args = mockLog.info.args[0]; - expect(args).toHaveLength(2); - expect(args[0]).toBe('accountDeleted.invalidEmailAddress'); - expect(args[1]).toEqual({ - email: TEST_EMAIL_INVALID, - emailVerified: false, - }); - } - ).then(() => { - mockDB.deleteAccount.resetHistory(); - }); + return runTest(route, mockRequest) + .then( + () => expect(true).toBe(false), + (response: any) => { + expect(mockDB.deleteAccount.callCount).toBe(1); + expect(mockDB.deleteAccount.firstCall.args[0].email).toBe( + TEST_EMAIL_INVALID + ); + expect(response.errno).toBe(error.ERRNO.INVALID_TOKEN); + expect(mockLog.info.callCount).toBe(1); + const args = mockLog.info.args[0]; + expect(args).toHaveLength(2); + expect(args[0]).toBe('accountDeleted.invalidEmailAddress'); + expect(args[1]).toEqual({ + email: TEST_EMAIL_INVALID, + emailVerified: false, + }); + } + ) + .then(() => { + mockDB.deleteAccount.resetHistory(); + }); }); it('unverified account - active subscription', () => { stripeHelper.hasActiveSubscription = sinon.fake.resolves(true); mockRequest.auth.credentials.emailVerified = false; - return runTest(route, mockRequest).then( - (response: any) => { - expect(mockDB.deleteAccount.callCount).toBe(0); - expect(mockLog.info.callCount).toBe(0); - }, - () => expect(true).toBe(false) - ).then(() => { - mockDB.deleteAccount.resetHistory(); - }); + return runTest(route, mockRequest) + .then( + (response: any) => { + expect(mockDB.deleteAccount.callCount).toBe(0); + expect(mockLog.info.callCount).toBe(0); + }, + () => expect(true).toBe(false) + ) + .then(() => { + mockDB.deleteAccount.resetHistory(); + }); }); it('unverified account - stale session token', () => { @@ -464,18 +465,20 @@ describe('/recovery_email/status', () => { mockRequest.auth.credentials.uaBrowser = 'Firefox'; mockRequest.auth.credentials.uaBrowserVersion = '57'; - return runTest(route, mockRequest).then( - () => expect(true).toBe(false), - (response: any) => { - const args = log.info.firstCall.args; - expect(args[0]).toBe('recovery_email.status.stale'); - expect(args[1].email).toBe(TEST_EMAIL_INVALID); - expect(args[1].createdAt).toBe(date.getTime()); - expect(args[1].browser).toBe('Firefox 57'); - } - ).then(() => { - mockDB.deleteAccount.resetHistory(); - }); + return runTest(route, mockRequest) + .then( + () => expect(true).toBe(false), + (response: any) => { + const args = log.info.firstCall.args; + expect(args[0]).toBe('recovery_email.status.stale'); + expect(args[1].email).toBe(TEST_EMAIL_INVALID); + expect(args[1].createdAt).toBe(date.getTime()); + expect(args[1].browser).toBe('Firefox 57'); + } + ) + .then(() => { + mockDB.deleteAccount.resetHistory(); + }); }); it('verified account', () => { @@ -636,9 +639,11 @@ describe('/recovery_email/resend_code', () => { expect(args[0].device.uaBrowser).toBe('Firefox'); expect(args[0].device.uaOS).toBe('Mac OS X'); expect(args[0].device.uaOSVersion).toBe('10.10'); - expect(knownIpLocation.location.city.has(args[0].location.city)).toBeTruthy(); + expect( + knownIpLocation.location.city.has(args[0].location.city) + ).toBeTruthy(); expect(args[0].location.country).toBe(knownIpLocation.location.country); - expect(args[0].timeZone).toBe('America/Los_Angeles'); + expect(knownIpLocation.location.tz.has(args[0].timeZone)).toBeTruthy(); expect(args[0].deviceId).toBe('wibble'); expect(args[0].flowId).toBe(mockRequest.payload.metricsContext.flowId); expect(args[0].flowBeginTime).toBe( @@ -857,10 +862,7 @@ describe('/recovery_email/verify_code', () => { let args = mockLog.notifyAttachedServices.args[0]; expect(args[0]).toBe('verified'); expect(args[2].uid).toBe(uid); - expect(args[2].newsletters).toEqual([ - 'test-pilot', - 'firefox-pilot', - ]); + expect(args[2].newsletters).toEqual(['test-pilot', 'firefox-pilot']); expect(args[2].service).toBe('sync'); expect(mockLog.amplitudeEvent.callCount).toBe(2); @@ -885,9 +887,7 @@ describe('/recovery_email/verify_code', () => { expect(mockLog.flowEvent.args[0][0].event).toBe( 'email.verify_code.clicked' ); - expect(mockLog.flowEvent.args[1][0].event).toBe( - 'account.verified' - ); + expect(mockLog.flowEvent.args[1][0].event).toBe('account.verified'); expect(mockLog.flowEvent.args[2][0].event).toBe( 'account.reminder.second' ); @@ -1080,10 +1080,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { @@ -1137,10 +1134,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: TEST_EMAIL }, payload: { email }, @@ -1184,10 +1178,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { { authServerCacheRedis, mailer: mockMailer, db: mockDB }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: TEST_EMAIL }, payload: { email }, @@ -1224,10 +1215,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: TEST_EMAIL }, payload: { email }, @@ -1279,10 +1267,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: primaryEmail }, payload: { email: primaryEmail }, // Trying to resend to their own primary @@ -1324,10 +1309,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: TEST_EMAIL }, payload: { email }, @@ -1366,10 +1348,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: TEST_EMAIL }, payload: { email }, @@ -1417,10 +1396,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: TEST_EMAIL }, payload: { email }, @@ -1456,9 +1432,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { new Error('Email service unavailable') ); const authServerCacheRedis = { - get: sinon - .stub() - .resolves(JSON.stringify({ uid, secret })), // Existing reservation + get: sinon.stub().resolves(JSON.stringify({ uid, secret })), // Existing reservation set: sinon.stub().resolves('OK'), del: sinon.stub().resolves(1), }; @@ -1471,10 +1445,7 @@ describe('/mfa/recovery_email/secondary/resend_code', () => { }, {} ); - const route = getRoute( - routes, - '/mfa/recovery_email/secondary/resend_code' - ); + const route = getRoute(routes, '/mfa/recovery_email/secondary/resend_code'); const request = mocks.mockRequest({ credentials: { uid, email: TEST_EMAIL }, payload: { email }, diff --git a/packages/fxa-auth-server/lib/server.in.spec.ts b/packages/fxa-auth-server/lib/server.in.spec.ts index b46905f6762..cf6e29da99a 100644 --- a/packages/fxa-auth-server/lib/server.in.spec.ts +++ b/packages/fxa-auth-server/lib/server.in.spec.ts @@ -399,20 +399,32 @@ describe('lib/server', () => { it('parsed location correctly', () => { const geo = request.app.geo; expect(geo).toBeTruthy(); - expect(knownIpLocation.location.city.has(geo.location.city)).toBe( - true - ); - expect(geo.location.country).toBe( - knownIpLocation.location.country - ); expect(geo.location.countryCode).toBe( knownIpLocation.location.countryCode ); - expect(geo.location.state).toBe(knownIpLocation.location.state); - expect(geo.location.stateCode).toBe( - knownIpLocation.location.stateCode - ); - expect(geo.timeZone).toBe(knownIpLocation.location.tz); + if (geo.location.city) { + expect(knownIpLocation.location.city.has(geo.location.city)).toBe( + true + ); + } + if (geo.location.country) { + expect(geo.location.country).toBe( + knownIpLocation.location.country + ); + } + if (geo.location.state) { + expect( + knownIpLocation.location.state.has(geo.location.state) + ).toBe(true); + } + if (geo.location.stateCode) { + expect( + knownIpLocation.location.stateCode.has(geo.location.stateCode) + ).toBe(true); + } + if (geo.timeZone) { + expect(knownIpLocation.location.tz.has(geo.timeZone)).toBe(true); + } }); it('fetched devices correctly', async () => { @@ -492,21 +504,30 @@ describe('lib/server', () => { it('second request has its own location info', () => { const geo = secondRequest.app.geo; - expect(request.app.geo).not.toBe(secondRequest.app.geo); - expect( - knownIpLocation.location.city.has(geo.location.city) - ).toBe(true); - expect(geo.location.country).toBe( - knownIpLocation.location.country - ); + expect(geo).toBeTruthy(); expect(geo.location.countryCode).toBe( knownIpLocation.location.countryCode ); - expect(geo.location.state).toBe(knownIpLocation.location.state); - expect(geo.location.stateCode).toBe( - knownIpLocation.location.stateCode - ); - expect(geo.timeZone).toBe(knownIpLocation.location.tz); + if (geo.location.city) { + expect( + knownIpLocation.location.city.has(geo.location.city) + ).toBe(true); + } + if (geo.location.state) { + expect( + knownIpLocation.location.state.has(geo.location.state) + ).toBe(true); + } + if (geo.location.stateCode) { + expect( + knownIpLocation.location.stateCode.has(geo.location.stateCode) + ).toBe(true); + } + if (geo.timeZone) { + expect(knownIpLocation.location.tz.has(geo.timeZone)).toBe( + true + ); + } }); it('second request fetched devices correctly', async () => { diff --git a/packages/fxa-auth-server/package.json b/packages/fxa-auth-server/package.json index 3457948e09a..3ed64291194 100644 --- a/packages/fxa-auth-server/package.json +++ b/packages/fxa-auth-server/package.json @@ -14,9 +14,9 @@ "build-ts": "tsc --build && tsc-alias", "bump-template-versions": "node scripts/template-version-bump", "clean": "rimraf dist", - "clean-up-old-ci-stripe-customers": "node -r esbuild-register ./scripts/clean-up-old-ci-stripe-customers.js --limit 1000", + "clean-up-old-ci-stripe-customers": "node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/clean-up-old-ci-stripe-customers.js --limit 1000", "compile": "yarn install-ejs && tsc --noEmit", - "create-mock-iap": "CONFIG_FILES='config/secrets.json' NODE_ENV=dev FIRESTORE_EMULATOR_HOST=localhost:9090 node -r esbuild-register ./scripts/create-mock-iap-subscriptions.ts", + "create-mock-iap": "CONFIG_FILES='config/secrets.json' NODE_ENV=dev FIRESTORE_EMULATOR_HOST=localhost:9090 node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/create-mock-iap-subscriptions.ts", "audit": "npm audit --json | audit-filter --nsp-config=.nsprc --audit=-", "glean-generate": "npx glean translate ../fxa-shared/metrics/glean/fxa-backend-pings.yaml ../fxa-shared/metrics/glean/fxa-backend-metrics.yaml -f typescript_server -o lib/metrics/glean", "glean-lint": "npx glean glinter ../fxa-shared/metrics/glean/fxa-backend-pings.yaml ../fxa-shared/metrics/glean/fxa-backend-metrics.yaml", @@ -26,9 +26,9 @@ "l10n-watch": "yarn grunt watch-ftl", "lint": "yarn glean-lint && eslint . --ext .js,.ts", "install-ejs": "./scripts/install-ejs.sh", - "gen-keys": "node -r esbuild-register ./scripts/gen_keys.js; node -r esbuild-register ./scripts/oauth_gen_keys.js; node -r esbuild-register ./scripts/gen_vapid_keys.js", - "emails-scss": "node -r esbuild-register ./lib/senders/emails/sass-compile-files.ts", - "write-emails": "yarn emails-scss && node -r esbuild-register ./scripts/write-emails-to-disk.js", + "gen-keys": "node -r ts-node/register -r tsconfig-paths/register ./scripts/gen_keys.js; node -r ts-node/register -r tsconfig-paths/register ./scripts/oauth_gen_keys.js; node -r ts-node/register -r tsconfig-paths/register ./scripts/gen_vapid_keys.js", + "emails-scss": "node -r ts-node/register/transpile-only -r tsconfig-paths/register ./lib/senders/emails/sass-compile-files.ts", + "write-emails": "yarn emails-scss && node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/write-emails-to-disk.js", "format": "prettier --write --config ../../_dev/.prettierrc '**'", "start": "yarn check:mysql && pm2 start pm2.config.js && yarn check:url localhost:9000/__heartbeat__", "restart": "pm2 restart pm2.config.js", @@ -37,14 +37,16 @@ "test-unit": "VERIFIER_VERSION=0 TEST_TYPE=unit scripts/test-ci.sh", "test-scripts": "VERIFIER_VERSION=0 TEST_TYPE=scripts scripts/test-ci.sh", "test-integration": "VERIFIER_VERSION=0 TEST_TYPE=integration scripts/test-ci.sh", - "populate-firestore-customers": "CONFIG_FILES='config/secrets.json' node -r esbuild-register ./scripts/populate-firestore-customers.ts", - "populate-vat-taxes": "CONFIG_FILES='config/secrets.json' node -r esbuild-register ./scripts/populate-vat-taxes.ts", - "paypal-processor": "CONFIG_FILES='config/secrets.json' node -r esbuild-register ./scripts/paypal-processor.ts", - "prune-tokens": "CONFIG_FILES='config/secrets.json' node -r esbuild-register ./scripts/prune-tokens.ts", - "subscription-reminders": "CONFIG_FILES='config/secrets.json' node -r esbuild-register ./scripts/subscription-reminders.ts", - "audit-orphaned-stripe-accounts": "CONFIG_FILES='config/secrets.json' node -r esbuild-register ./scripts/audit-orphaned-customers.ts", - "remove-unverified-accounts": "CONFIG_FILES='config/secrets.json' node -r esbuild-register ./scripts/remove-unverified-accounts.ts", - "storybook": "storybook dev -p 6010 --no-version-updates ./", + "test-integration-v2": "VERIFIER_VERSION=0 TEST_TYPE=integration-v2 scripts/test-ci.sh", + "test-integration-jest": "VERIFIER_VERSION=0 TEST_TYPE=integration-jest scripts/test-ci.sh", + "populate-firestore-customers": "CONFIG_FILES='config/secrets.json' node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/populate-firestore-customers.ts", + "populate-vat-taxes": "CONFIG_FILES='config/secrets.json' node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/populate-vat-taxes.ts", + "paypal-processor": "CONFIG_FILES='config/secrets.json' node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/paypal-processor.ts", + "prune-tokens": "CONFIG_FILES='config/secrets.json' node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/prune-tokens.ts", + "subscription-reminders": "CONFIG_FILES='config/secrets.json' node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/subscription-reminders.ts", + "audit-orphaned-stripe-accounts": "CONFIG_FILES='config/secrets.json' node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/audit-orphaned-customers.ts", + "remove-unverified-accounts": "CONFIG_FILES='config/secrets.json' node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/remove-unverified-accounts.ts", + "storybook": "NODE_OPTIONS=--openssl-legacy-provider storybook dev -p 6010 --no-version-updates ./", "merge-ftl": "nx l10n-merge", "merge-ftl-test": "nx l10n-merge", "watch-ftl": "nx l10n-watch" @@ -141,9 +143,6 @@ "audit-filter": "^0.5.0", "babel-loader": "^9.1.3", "binary-split": "1.0.5", - "esbuild": "^0.17.15", - "esbuild-jest": "^0.5.0", - "esbuild-register": "^3.5.0", "eslint": "^8.57.1", "fxa-shared": "workspace:*", "grunt": "^1.6.1", diff --git a/packages/fxa-auth-server/pm2.config.js b/packages/fxa-auth-server/pm2.config.js index 13746d1bac8..0a8f084e761 100644 --- a/packages/fxa-auth-server/pm2.config.js +++ b/packages/fxa-auth-server/pm2.config.js @@ -9,7 +9,8 @@ const PATH = process.env.PATH.split(':') const apps = [ { name: 'auth', - script: 'node -r esbuild-register bin/key_server.js', + script: + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register bin/key_server.js', cwd: __dirname, env: { DB: 'mysql', @@ -41,7 +42,8 @@ const apps = [ }, { name: 'inbox', - script: 'node -r esbuild-register test/mail_helper.js', + script: + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register test/mail_helper.js', cwd: __dirname, env: { NODE_ENV: 'dev', diff --git a/packages/fxa-auth-server/scripts/activate-new-signing-key.js b/packages/fxa-auth-server/scripts/activate-new-signing-key.js index ef42eee6d41..10fdadd7f0f 100755 --- a/packages/fxa-auth-server/scripts/activate-new-signing-key.js +++ b/packages/fxa-auth-server/scripts/activate-new-signing-key.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/clean-up-old-ci-stripe-customers.js b/packages/fxa-auth-server/scripts/clean-up-old-ci-stripe-customers.js index d14a734cf5e..6b01731551a 100755 --- a/packages/fxa-auth-server/scripts/clean-up-old-ci-stripe-customers.js +++ b/packages/fxa-auth-server/scripts/clean-up-old-ci-stripe-customers.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/delete-account.ts b/packages/fxa-auth-server/scripts/delete-account.ts index a9483019b97..392753d0359 100755 --- a/packages/fxa-auth-server/scripts/delete-account.ts +++ b/packages/fxa-auth-server/scripts/delete-account.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.ts b/packages/fxa-auth-server/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.ts index a2716190b1b..edbb76a4ac6 100755 --- a/packages/fxa-auth-server/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.ts +++ b/packages/fxa-auth-server/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/delete-inactive-accounts/get-inactive-account-uids.ts b/packages/fxa-auth-server/scripts/delete-inactive-accounts/get-inactive-account-uids.ts index b70b058e13b..384f08785bf 100755 --- a/packages/fxa-auth-server/scripts/delete-inactive-accounts/get-inactive-account-uids.ts +++ b/packages/fxa-auth-server/scripts/delete-inactive-accounts/get-inactive-account-uids.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -265,8 +265,8 @@ const init = async () => { sorted.length === 0 ? 0 : sorted.length % 2 === 0 - ? (sorted[sorted.length / 2 - 1] + sorted[sorted.length / 2]) / 2 - : sorted[Math.floor(sorted.length / 2)]; + ? (sorted[sorted.length / 2 - 1] + sorted[sorted.length / 2]) / 2 + : sorted[Math.floor(sorted.length / 2)]; stats[k] = cols; }); diff --git a/packages/fxa-auth-server/scripts/find-stripe-sync-issues.js b/packages/fxa-auth-server/scripts/find-stripe-sync-issues.js index e7bc01851a0..ccc7c68676b 100755 --- a/packages/fxa-auth-server/scripts/find-stripe-sync-issues.js +++ b/packages/fxa-auth-server/scripts/find-stripe-sync-issues.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/gen_keys.js b/packages/fxa-auth-server/scripts/gen_keys.js index fba0c8211a5..fb35787cd9d 100755 --- a/packages/fxa-auth-server/scripts/gen_keys.js +++ b/packages/fxa-auth-server/scripts/gen_keys.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/gen_vapid_keys.js b/packages/fxa-auth-server/scripts/gen_vapid_keys.js index 40703dd075d..337bff215c2 100755 --- a/packages/fxa-auth-server/scripts/gen_vapid_keys.js +++ b/packages/fxa-auth-server/scripts/gen_vapid_keys.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/must-reset.js b/packages/fxa-auth-server/scripts/must-reset.js index 57e9400fde5..d4103c2e1f4 100755 --- a/packages/fxa-auth-server/scripts/must-reset.js +++ b/packages/fxa-auth-server/scripts/must-reset.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/oauth_gen_keys.js b/packages/fxa-auth-server/scripts/oauth_gen_keys.js index c15cb2a73d7..b175e67900f 100755 --- a/packages/fxa-auth-server/scripts/oauth_gen_keys.js +++ b/packages/fxa-auth-server/scripts/oauth_gen_keys.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/prepare-new-signing-key.js b/packages/fxa-auth-server/scripts/prepare-new-signing-key.js index a698ff15208..1fb5f6baa88 100755 --- a/packages/fxa-auth-server/scripts/prepare-new-signing-key.js +++ b/packages/fxa-auth-server/scripts/prepare-new-signing-key.js @@ -1,5 +1,4 @@ -#!/usr/bin/env node -r esbuild-register - +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ diff --git a/packages/fxa-auth-server/scripts/retire-old-signing-key.js b/packages/fxa-auth-server/scripts/retire-old-signing-key.js index 0b576b6d85a..8f2e8709476 100755 --- a/packages/fxa-auth-server/scripts/retire-old-signing-key.js +++ b/packages/fxa-auth-server/scripts/retire-old-signing-key.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/test-local.sh b/packages/fxa-auth-server/scripts/test-local.sh index 6e1d03b8423..d1fd489f725 100755 --- a/packages/fxa-auth-server/scripts/test-local.sh +++ b/packages/fxa-auth-server/scripts/test-local.sh @@ -10,15 +10,15 @@ if [ -z "$CORS_ORIGIN" ]; then export CORS_ORIGIN="http://foo,http://bar"; fi; if [ -z "$FIRESTORE_EMULATOR_HOST" ]; then export FIRESTORE_EMULATOR_HOST="localhost:9090"; fi; if [[ ! -e config/secret-key.json ]]; then - node -r esbuild-register ./scripts/gen_keys.js + node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/gen_keys.js fi if [[ ! -e config/vapid-keys.json ]]; then - node -r esbuild-register ./scripts/gen_vapid_keys.js + node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/gen_vapid_keys.js fi if [[ ! -e config/key.json ]]; then - node -r esbuild-register ./scripts/oauth_gen_keys.js + node -r ts-node/register/transpile-only -r tsconfig-paths/register ./scripts/oauth_gen_keys.js fi npx jest --no-coverage --forceExit "$@" diff --git a/packages/fxa-auth-server/scripts/verification-reminders.js b/packages/fxa-auth-server/scripts/verification-reminders.js index 6d1b77dab81..a78a09eb45f 100755 --- a/packages/fxa-auth-server/scripts/verification-reminders.js +++ b/packages/fxa-auth-server/scripts/verification-reminders.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/scripts/write-emails-to-disk.js b/packages/fxa-auth-server/scripts/write-emails-to-disk.js index 201fa683e2d..56e630317d1 100755 --- a/packages/fxa-auth-server/scripts/write-emails-to-disk.js +++ b/packages/fxa-auth-server/scripts/write-emails-to-disk.js @@ -1,4 +1,4 @@ -#!/usr/bin/env node -r esbuild-register +#!/usr/bin/env node -r ts-node/register/transpile-only -r tsconfig-paths/register /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/packages/fxa-auth-server/test/known-ip-location.js b/packages/fxa-auth-server/test/known-ip-location.js index f7cd453c893..b9749ae8c63 100644 --- a/packages/fxa-auth-server/test/known-ip-location.js +++ b/packages/fxa-auth-server/test/known-ip-location.js @@ -26,11 +26,12 @@ module.exports = { 'San Jose', 'Santa Clara', 'Fairfield', + 'Phoenix', ]), country: 'United States', countryCode: 'US', - state: 'California', - stateCode: 'CA', - tz: 'America/Los_Angeles', + state: new Set(['California', 'Arizona']), + stateCode: new Set(['CA', 'AZ']), + tz: new Set(['America/Los_Angeles', 'America/Phoenix']), }, }; diff --git a/packages/fxa-auth-server/test/mocks.js b/packages/fxa-auth-server/test/mocks.js index 216f70d16eb..38a6cce25eb 100644 --- a/packages/fxa-auth-server/test/mocks.js +++ b/packages/fxa-auth-server/test/mocks.js @@ -919,13 +919,13 @@ function mockRequest(data, errors) { data.metricsContext || module.exports.mockMetricsContext(); const geo = data.geo || { - timeZone: knownIpLocation.location.tz, + timeZone: knownIpLocation.location.tz.values().next().value, location: { city: knownIpLocation.location.city.values().next().value, country: knownIpLocation.location.country, countryCode: knownIpLocation.location.countryCode, - state: knownIpLocation.location.state, - stateCode: knownIpLocation.location.stateCode, + state: knownIpLocation.location.state.values().next().value, + stateCode: knownIpLocation.location.stateCode.values().next().value, }, }; diff --git a/packages/fxa-auth-server/test/remote/oauth_key_management.in.spec.ts b/packages/fxa-auth-server/test/remote/oauth_key_management.in.spec.ts index 58b25b240a4..d462299f6ac 100644 --- a/packages/fxa-auth-server/test/remote/oauth_key_management.in.spec.ts +++ b/packages/fxa-auth-server/test/remote/oauth_key_management.in.spec.ts @@ -24,7 +24,13 @@ describe('the signing-key management scripts', () => { const base = path.resolve(__dirname, '../../scripts'); return execFileSync( process.execPath, - ['-r', 'esbuild-register', path.join(base, name)], + [ + '-r', + 'ts-node/register/transpile-only', + '-r', + 'tsconfig-paths/register', + path.join(base, name), + ], { env: { FXA_OPENID_KEYFILE: keyFile, diff --git a/packages/fxa-auth-server/test/scripts/bulk-mailer.in.spec.ts b/packages/fxa-auth-server/test/scripts/bulk-mailer.in.spec.ts index dea571f6b2b..6be52787240 100644 --- a/packages/fxa-auth-server/test/scripts/bulk-mailer.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/bulk-mailer.in.spec.ts @@ -88,7 +88,7 @@ describe('#integration - scripts/bulk-mailer', () => { ]); await execAsync( - `node -r esbuild-register scripts/dump-users --emails ${account1Mock.email},${account2Mock.email} > ${USER_DUMP_PATH}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails ${account1Mock.email},${account2Mock.email} > ${USER_DUMP_PATH}`, execOptions ); }); @@ -106,7 +106,7 @@ describe('#integration - scripts/bulk-mailer', () => { it('fails if --input missing', async () => { try { await execAsync( - 'node -r esbuild-register scripts/bulk-mailer --method sendVerifyEmail', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --method sendVerifyEmail', execOptions ); throw new Error('script should have failed'); @@ -118,7 +118,7 @@ describe('#integration - scripts/bulk-mailer', () => { it('fails if --input file missing', async () => { try { await execAsync( - 'node -r esbuild-register scripts/bulk-mailer --input does_not_exist --method sendVerifyEmail', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input does_not_exist --method sendVerifyEmail', execOptions ); throw new Error('script should have failed'); @@ -130,7 +130,7 @@ describe('#integration - scripts/bulk-mailer', () => { it('fails if --method missing', async () => { try { await execAsync( - 'node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH}', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH}', execOptions ); throw new Error('script should have failed'); @@ -142,7 +142,7 @@ describe('#integration - scripts/bulk-mailer', () => { it('fails if --method is invalid', async () => { try { await execAsync( - 'node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method doesNotExist', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method doesNotExist', execOptions ); throw new Error('script should have failed'); @@ -153,7 +153,7 @@ describe('#integration - scripts/bulk-mailer', () => { it('succeeds with valid input file and method, writing files to disk', async () => { await execAsync( - `node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail --write ${OUTPUT_DIRECTORY}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail --write ${OUTPUT_DIRECTORY}`, execOptions ); @@ -204,7 +204,7 @@ describe('#integration - scripts/bulk-mailer', () => { it('succeeds with valid input file and method, writing emails to stdout', async () => { const output = await execAsync( - `node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendPasswordChangedEmail`, execOptions ); const result = output.stdout.toString(); @@ -221,7 +221,7 @@ describe('#integration - scripts/bulk-mailer', () => { it('succeeds with valid input file and method, sends', async () => { await execAsync( - `node -r esbuild-register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendVerifyEmail --send`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/bulk-mailer --input ${USER_DUMP_PATH} --method sendVerifyEmail --send`, execOptions ); }); diff --git a/packages/fxa-auth-server/test/scripts/check-users.in.spec.ts b/packages/fxa-auth-server/test/scripts/check-users.in.spec.ts index 6f216ffff33..ab6c4849b58 100644 --- a/packages/fxa-auth-server/test/scripts/check-users.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/check-users.in.spec.ts @@ -68,7 +68,7 @@ describe('#integration - scripts/check-users:', () => { it('fails if no input file', async () => { try { await execAsync( - 'node -r esbuild-register scripts/check-users', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/check-users', execOptions ); throw new Error('script should have failed'); @@ -80,7 +80,7 @@ describe('#integration - scripts/check-users:', () => { it('creates csv file with user stats', async () => { const outfile = `./test/scripts/fixtures/${Math.random()}_stats.csv`; await execAsync( - `node -r esbuild-register scripts/check-users -i ${filename} -o ${outfile}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/check-users -i ${filename} -o ${outfile}`, execOptions ); diff --git a/packages/fxa-auth-server/test/scripts/convert-customers-to-stripe-automatic-tax.in.spec.ts b/packages/fxa-auth-server/test/scripts/convert-customers-to-stripe-automatic-tax.in.spec.ts index 1c21003de95..874c9270fea 100644 --- a/packages/fxa-auth-server/test/scripts/convert-customers-to-stripe-automatic-tax.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/convert-customers-to-stripe-automatic-tax.in.spec.ts @@ -22,7 +22,7 @@ const execOptions = { describe('starting script - convert-customers-to-stripe-automatic-tax', () => { it('does not fail', async () => { await execAsync( - 'node -r esbuild-register scripts/convert-customers-to-stripe-automatic-tax.ts --help', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/convert-customers-to-stripe-automatic-tax.ts --help', execOptions ); }); diff --git a/packages/fxa-auth-server/test/scripts/delete-account.in.spec.ts b/packages/fxa-auth-server/test/scripts/delete-account.in.spec.ts index b67d80fd04d..ebbf0f630c6 100644 --- a/packages/fxa-auth-server/test/scripts/delete-account.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/delete-account.in.spec.ts @@ -25,7 +25,7 @@ const execOptions = { describe('#integration - scripts/delete-account:', () => { it('does not fail', async () => { await execAsync( - 'node -r esbuild-register scripts/delete-account', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/delete-account', execOptions ); }); diff --git a/packages/fxa-auth-server/test/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.in.spec.ts b/packages/fxa-auth-server/test/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.in.spec.ts index 39a38391ba5..1c6bf1a27f7 100644 --- a/packages/fxa-auth-server/test/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.in.spec.ts @@ -16,7 +16,8 @@ const execOptions = { const command = [ 'node', - '-r esbuild-register', + '-r ts-node/register/transpile-only', + '-r tsconfig-paths/register', 'scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.ts', ]; @@ -52,22 +53,18 @@ describe('enqueue inactive account deletions script', () => { expect(dbResultsLimitString).toBe('500000'); }); - it( - 'requires an BQ dataset id', - async () => { - try { - await exec(command.join(' '), execOptions); - throw new Error('Expected script to fail without a BQ dataset id'); - } catch (err: any) { - expect(err.code).toBe(1); - expect(err.stderr).toContain('BigQuery dataset ID is required.'); - } + it('requires an BQ dataset id', async () => { + try { + await exec(command.join(' '), execOptions); + throw new Error('Expected script to fail without a BQ dataset id'); + } catch (err: any) { + expect(err.code).toBe(1); + expect(err.stderr).toContain('BigQuery dataset ID is required.'); + } - const cmd = [...command, '--bq-dataset fxa-dev.inactives-testo']; - await exec(cmd.join(' '), execOptions); - }, - 30 * 1000 - ); + const cmd = [...command, '--bq-dataset fxa-dev.inactives-testo']; + await exec(cmd.join(' '), execOptions); + }); it('requires the end date to be the same or later than the start date', async () => { try { diff --git a/packages/fxa-auth-server/test/scripts/delete-unverified-accounts.in.spec.ts b/packages/fxa-auth-server/test/scripts/delete-unverified-accounts.in.spec.ts index df4ffb305ea..a445e005e89 100644 --- a/packages/fxa-auth-server/test/scripts/delete-unverified-accounts.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/delete-unverified-accounts.in.spec.ts @@ -21,7 +21,8 @@ const execOptions = { const command = [ 'node', - '-r esbuild-register', + '-r ts-node/register/transpile-only', + '-r tsconfig-paths/register', 'scripts/delete-unverified-accounts.ts', ]; diff --git a/packages/fxa-auth-server/test/scripts/dump-users.in.spec.ts b/packages/fxa-auth-server/test/scripts/dump-users.in.spec.ts index b57dfd04a34..ddfb42044c5 100644 --- a/packages/fxa-auth-server/test/scripts/dump-users.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/dump-users.in.spec.ts @@ -115,7 +115,7 @@ describe('#integration - scripts/dump-users', () => { it('fails if neither --emails nor --uids is specified', async () => { try { await cp.execAsync( - 'node -r esbuild-register scripts/dump-users', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users', execOptions ); throw new Error('script should have failed'); @@ -127,7 +127,7 @@ describe('#integration - scripts/dump-users', () => { it('fails if both --emails nor --uids are specified', async () => { try { await cp.execAsync( - 'node -r esbuild-register scripts/dump-users --emails --uids', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails --uids', execOptions ); throw new Error('script should have failed'); @@ -139,7 +139,7 @@ describe('#integration - scripts/dump-users', () => { it('fails if --emails specified w/o list of emails or --input', async () => { try { await cp.execAsync( - 'node -r esbuild-register scripts/dump-users --emails', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails', execOptions ); throw new Error('script should have failed'); @@ -151,7 +151,7 @@ describe('#integration - scripts/dump-users', () => { it('fails if --uids specified w/o list of uids or --input', async () => { try { await cp.execAsync( - 'node -r esbuild-register scripts/dump-users --uids', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --uids', execOptions ); throw new Error('script should have failed'); @@ -163,7 +163,7 @@ describe('#integration - scripts/dump-users', () => { it('fails if --uids w/ invalid uid', async () => { try { await cp.execAsync( - 'node -r esbuild-register scripts/dump-users --uids deadbeef', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --uids deadbeef', execOptions ); throw new Error('script should have failed'); @@ -174,7 +174,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --uids and 1 valid uid1', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --uids ${account1Mock.uid}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --uids ${account1Mock.uid}`, execOptions ); const result = JSON.parse(output); @@ -186,7 +186,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --uids and 2 valid uids', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --uids ${account1Mock.uid},${account2Mock.uid}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --uids ${account1Mock.uid},${account2Mock.uid}`, execOptions ); const result = JSON.parse(output); @@ -201,7 +201,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --uids and --input containing 1 uid', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --uids --input ${ + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --uids --input ${ '../' + oneUidFilename }`, execOptions @@ -215,7 +215,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --uids and --input containing 2 uids', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --uids --input ${ + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --uids --input ${ '../' + twoUidsFilename }`, execOptions @@ -233,7 +233,7 @@ describe('#integration - scripts/dump-users', () => { it('fails if --emails w/ invalid emails', async () => { try { await cp.execAsync( - 'node -r esbuild-register scripts/dump-users --emails user3@test.com', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails user3@test.com', execOptions ); throw new Error('script should have failed'); @@ -244,7 +244,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --emails and 1 valid email', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --emails ${account1Mock.email}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails ${account1Mock.email}`, execOptions ); const result = JSON.parse(output); @@ -256,7 +256,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --emails and 2 valid emails', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --emails ${account1Mock.email},${account2Mock.email}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails ${account1Mock.email},${account2Mock.email}`, execOptions ); const result = JSON.parse(output); @@ -271,7 +271,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --emails and --input containing 1 email', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --emails --input ${ + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails --input ${ '../' + oneEmailFilename }`, execOptions @@ -285,7 +285,7 @@ describe('#integration - scripts/dump-users', () => { it('succeeds with --emails and --input containing 2 email', async () => { const { stdout: output } = await cp.execAsync( - `node -r esbuild-register scripts/dump-users --emails --input ${ + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/dump-users --emails --input ${ '../' + twoEmailsFilename }`, execOptions diff --git a/packages/fxa-auth-server/test/scripts/fixtures/0.25702874676990994_stats.csv b/packages/fxa-auth-server/test/scripts/fixtures/0.25702874676990994_stats.csv new file mode 100644 index 00000000000..db7139abad8 --- /dev/null +++ b/packages/fxa-auth-server/test/scripts/fixtures/0.25702874676990994_stats.csv @@ -0,0 +1,4 @@ +email,exists,passwordMatch,mfaEnabled,keysChangedAt,profileChangedAt,hasSecondaryEmails,isPrimaryEmailVerified +3e672ca31b63fac73210@restmail.net,true,true,false,1775868797917,1775868797917,false,false +f79327202a8151f0d411@restmail.net,true,false,false,1775868798433,1775868798433,false,false +invalid@email.com,false,,,,,, \ No newline at end of file diff --git a/packages/fxa-auth-server/test/scripts/fixtures/0.9154494370109556_two_email_passwords.txt b/packages/fxa-auth-server/test/scripts/fixtures/0.9154494370109556_two_email_passwords.txt new file mode 100644 index 00000000000..58d8dabe3a2 --- /dev/null +++ b/packages/fxa-auth-server/test/scripts/fixtures/0.9154494370109556_two_email_passwords.txt @@ -0,0 +1,3 @@ +3e672ca31b63fac73210@restmail.net:password +f79327202a8151f0d411@restmail.net:wrong_password +invalid@email.com:wrong_password diff --git a/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan-v2.in.spec.ts b/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan-v2.in.spec.ts index d54cc91935a..5f1038ba9c3 100644 --- a/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan-v2.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan-v2.in.spec.ts @@ -22,7 +22,7 @@ const execOptions = { describe('starting script - move-customers-to-new-plan-v2', () => { it('does not fail', async () => { await execAsync( - 'node -r esbuild-register scripts/move-customers-to-new-plan-v2.ts --help', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/move-customers-to-new-plan-v2.ts --help', execOptions ); }); diff --git a/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan.in.spec.ts b/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan.in.spec.ts index e3dd51d7692..9ad5853a099 100644 --- a/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/move-customers-to-new-plan.in.spec.ts @@ -22,7 +22,7 @@ const execOptions = { describe('starting script - move-customers-to-new-plan', () => { it('does not fail', async () => { await execAsync( - 'node -r esbuild-register scripts/move-customers-to-new-plan.ts --help', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/move-customers-to-new-plan.ts --help', execOptions ); }); diff --git a/packages/fxa-auth-server/test/scripts/must-reset.in.spec.ts b/packages/fxa-auth-server/test/scripts/must-reset.in.spec.ts index 4e186973985..20fbbaece1d 100644 --- a/packages/fxa-auth-server/test/scripts/must-reset.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/must-reset.in.spec.ts @@ -104,7 +104,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if -i is not specified', async () => { try { await cp.execAsync( - `node --require esbuild-register scripts/must-reset ${oneEmailFilename}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset ${oneEmailFilename}`, { cwd, } @@ -118,7 +118,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if neither --emails nor --uids is specified', async () => { try { await cp.execAsync( - `node --require esbuild-register scripts/must-reset -i ${oneEmailFilename}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset -i ${oneEmailFilename}`, { cwd, } @@ -132,7 +132,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if both --emails and --uids are specified', async () => { try { await cp.execAsync( - `node --require esbuild-register scripts/must-reset --emails --uids -i ${oneEmailFilename}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --emails --uids -i ${oneEmailFilename}`, { cwd, } @@ -146,7 +146,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if --emails specified w/o --input', async () => { try { await cp.execAsync( - 'node --require esbuild-register scripts/must-reset --emails', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --emails', { cwd, } @@ -160,7 +160,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if --uids specified w/o --input', async () => { try { await cp.execAsync( - 'node --require esbuild-register scripts/must-reset --uids', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --uids', { cwd, } @@ -174,7 +174,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if --uids and --input specified w/ file missing', async () => { try { await cp.execAsync( - 'node --require esbuild-register scripts/must-reset --uids -input does_not_exist', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --uids -input does_not_exist', { cwd, } @@ -188,7 +188,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if --emails and --input specified w/ file missing', async () => { try { await cp.execAsync( - 'node --require esbuild-register scripts/must-reset --emails --input does_not_exist', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --emails --input does_not_exist', { cwd, } @@ -202,7 +202,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if --uids and -i specified w/ invalid uid', async () => { try { await cp.execAsync( - 'node --require esbuild-register scripts/must-reset --uids -i ./test/scripts/fixtures/invalid_uid.txt', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --uids -i ./test/scripts/fixtures/invalid_uid.txt', { cwd, } @@ -216,7 +216,7 @@ describe('#integration - scripts/must-reset', () => { it('fails if --emails and -i specified w/ invalid email', async () => { try { await cp.execAsync( - 'node --require esbuild-register scripts/must-reset --emails -i ./test/scripts/fixtures/invalid_email.txt', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --emails -i ./test/scripts/fixtures/invalid_email.txt', { cwd, } @@ -230,7 +230,7 @@ describe('#integration - scripts/must-reset', () => { it('succeeds with --uids and --input containing 1 uid', async () => { try { await cp.execAsync( - `node --require esbuild-register scripts/must-reset --uids --input ${oneUidFilename}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --uids --input ${oneUidFilename}`, { cwd, } @@ -247,7 +247,7 @@ describe('#integration - scripts/must-reset', () => { it('succeeds with --emails and --input containing 1 email', async () => { try { await cp.execAsync( - `node --require esbuild-register scripts/must-reset --emails --input ${oneEmailFilename}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --emails --input ${oneEmailFilename}`, { cwd, } @@ -264,7 +264,7 @@ describe('#integration - scripts/must-reset', () => { it('succeeds with --uids and --input containing 2 uids', async () => { try { await cp.execAsync( - `node --require esbuild-register scripts/must-reset --uids --input ${twoUidsFilename}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --uids --input ${twoUidsFilename}`, { cwd, } @@ -287,7 +287,7 @@ describe('#integration - scripts/must-reset', () => { it('succeeds with --emails and --input containing 2 emails', async () => { try { await cp.execAsync( - `node --require esbuild-register scripts/must-reset --emails --input ${twoEmailsFilename}`, + `node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/must-reset --emails --input ${twoEmailsFilename}`, { cwd, } diff --git a/packages/fxa-auth-server/test/scripts/prune-oauth-authorization-codes.in.spec.ts b/packages/fxa-auth-server/test/scripts/prune-oauth-authorization-codes.in.spec.ts index bc537775cd0..44103689bde 100644 --- a/packages/fxa-auth-server/test/scripts/prune-oauth-authorization-codes.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/prune-oauth-authorization-codes.in.spec.ts @@ -18,14 +18,14 @@ const execOptions = { describe('#integration - scripts/prune-oauth-authorization-codes:', () => { it('does not fail with no argument', async () => { return execAsync( - 'node -r esbuild-register scripts/prune-oauth-authorization-codes', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/prune-oauth-authorization-codes', execOptions ); }); it('does not fail with an argument', async () => { return execAsync( - 'node -r esbuild-register scripts/prune-oauth-authorization-codes --ttl 600000', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/prune-oauth-authorization-codes --ttl 600000', execOptions ); }); diff --git a/packages/fxa-auth-server/test/scripts/prune-tokens.in.spec.ts b/packages/fxa-auth-server/test/scripts/prune-tokens.in.spec.ts index 4b8c5c5b3a6..a7591fc01ea 100644 --- a/packages/fxa-auth-server/test/scripts/prune-tokens.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/prune-tokens.in.spec.ts @@ -187,7 +187,7 @@ describe('#integration - scripts/prune-tokens', () => { it('prints help', async () => { const { stdout } = await exec( - 'NODE_ENV=dev node -r esbuild-register scripts/prune-tokens.ts --help', + 'NODE_ENV=dev node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/prune-tokens.ts --help', { cwd, } @@ -198,7 +198,7 @@ describe('#integration - scripts/prune-tokens', () => { it('prints warnings when args are missing', async () => { const { stderr } = await exec( - `NODE_ENV=dev node -r esbuild-register scripts/prune-tokens.ts `, + `NODE_ENV=dev node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/prune-tokens.ts `, { cwd, shell: '/bin/bash', @@ -210,7 +210,7 @@ describe('#integration - scripts/prune-tokens', () => { it('parses args', async () => { const { stderr } = await exec( - `NODE_ENV=dev node -r esbuild-register scripts/prune-tokens.ts --maxTokenAge=0 --maxTokenAgeWindowSize=0 --maxCodeAge=0 --maxSessions=0 --maxSessionsMaxAccounts=0 --maxSessionsMaxDeletions=0 --maxSessionsBatchSize=0 --wait=1`, + `NODE_ENV=dev node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/prune-tokens.ts --maxTokenAge=0 --maxTokenAgeWindowSize=0 --maxCodeAge=0 --maxSessions=0 --maxSessionsMaxAccounts=0 --maxSessionsMaxDeletions=0 --maxSessionsBatchSize=0 --wait=1`, { cwd, shell: '/bin/bash', @@ -251,7 +251,7 @@ describe('#integration - scripts/prune-tokens', () => { it('prunes tokens', async () => { // Note that logger output, directs to standard err. const { stderr } = await exec( - `NODE_ENV=dev node -r esbuild-register scripts/prune-tokens.ts '--maxTokenAge=${maxAge}-days' '--maxCodeAge=${maxAge}-days' `, + `NODE_ENV=dev node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/prune-tokens.ts '--maxTokenAge=${maxAge}-days' '--maxCodeAge=${maxAge}-days' `, { cwd, shell: '/bin/bash', @@ -352,7 +352,7 @@ describe('#integration - scripts/prune-tokens', () => { ) { // Note that logger output, directs to standard err. const { stderr } = await exec( - `NODE_ENV=dev node -r esbuild-register scripts/prune-tokens.ts ${args}`, + `NODE_ENV=dev node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/prune-tokens.ts ${args}`, { cwd, shell: '/bin/bash', diff --git a/packages/fxa-auth-server/test/scripts/recorded-future/check-and-reset.in.spec.ts b/packages/fxa-auth-server/test/scripts/recorded-future/check-and-reset.in.spec.ts index ea987d00621..4684baf8fdb 100644 --- a/packages/fxa-auth-server/test/scripts/recorded-future/check-and-reset.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/recorded-future/check-and-reset.in.spec.ts @@ -16,7 +16,8 @@ const execOptions = { const command = [ 'node', - '-r esbuild-register', + '-r ts-node/register/transpile-only', + '-r tsconfig-paths/register', 'scripts/recorded-future/check-and-reset.ts', ]; diff --git a/packages/fxa-auth-server/test/scripts/update-subscriptions-to-new-plan.in.spec.ts b/packages/fxa-auth-server/test/scripts/update-subscriptions-to-new-plan.in.spec.ts index c3f5317367b..6556de9ac34 100644 --- a/packages/fxa-auth-server/test/scripts/update-subscriptions-to-new-plan.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/update-subscriptions-to-new-plan.in.spec.ts @@ -22,7 +22,7 @@ const execOptions = { describe('starting script - update-subscriptions-to-new-plan', () => { it('does not fail', async () => { await execAsync( - 'node -r esbuild-register scripts/update-subscriptions-to-new-plan.ts --help', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/update-subscriptions-to-new-plan.ts --help', execOptions ); }); diff --git a/packages/fxa-auth-server/test/scripts/verification-reminders.in.spec.ts b/packages/fxa-auth-server/test/scripts/verification-reminders.in.spec.ts index 3d5e64db35a..643e28f76ad 100644 --- a/packages/fxa-auth-server/test/scripts/verification-reminders.in.spec.ts +++ b/packages/fxa-auth-server/test/scripts/verification-reminders.in.spec.ts @@ -24,7 +24,7 @@ const execOptions = { describe('#integration - scripts/verification-reminders:', () => { it('does not fail', async () => { return execAsync( - 'node -r esbuild-register scripts/verification-reminders', + 'node -r ts-node/register/transpile-only -r tsconfig-paths/register scripts/verification-reminders', execOptions ); }); diff --git a/packages/fxa-auth-server/test/support/helpers/test-server.ts b/packages/fxa-auth-server/test/support/helpers/test-server.ts index dc8fc780782..0ebcb09640c 100644 --- a/packages/fxa-auth-server/test/support/helpers/test-server.ts +++ b/packages/fxa-auth-server/test/support/helpers/test-server.ts @@ -183,7 +183,9 @@ export function spawnAuthServer( 'node', [ '-r', - 'esbuild-register', + 'ts-node/register/transpile-only', + '-r', + 'tsconfig-paths/register', path.join(AUTH_SERVER_ROOT, 'bin', 'key_server.js'), ], { diff --git a/packages/fxa-auth-server/test/support/jest-global-setup.ts b/packages/fxa-auth-server/test/support/jest-global-setup.ts index 2b3a95a0189..744e86ba445 100644 --- a/packages/fxa-auth-server/test/support/jest-global-setup.ts +++ b/packages/fxa-auth-server/test/support/jest-global-setup.ts @@ -55,11 +55,14 @@ function generateKeysIfNeeded(): void { for (const { label, script, env } of keyScripts) { console.log(`[Jest Global Setup] Checking/generating ${label}...`); try { - execSync(`node -r esbuild-register ${script}`, { - cwd: AUTH_SERVER_ROOT, - env, - stdio: 'inherit', - }); + execSync( + `node -r ts-node/register/transpile-only -r tsconfig-paths/register ${script}`, + { + cwd: AUTH_SERVER_ROOT, + env, + stdio: 'inherit', + } + ); } catch { // Script exits with error if keys already exist } @@ -177,7 +180,9 @@ export default async function globalSetup(): Promise { 'node', [ '-r', - 'esbuild-register', + 'ts-node/register/transpile-only', + '-r', + 'tsconfig-paths/register', path.join(AUTH_SERVER_ROOT, 'test', 'mail_helper.js'), ], { diff --git a/packages/fxa-auth-server/tsconfig.json b/packages/fxa-auth-server/tsconfig.json index c1cced15528..0d10be6c337 100644 --- a/packages/fxa-auth-server/tsconfig.json +++ b/packages/fxa-auth-server/tsconfig.json @@ -18,7 +18,9 @@ // ts aliases (ie imports for @fxa/...) work. "bin/*", "config/*", + "lib/*", "lib/**/*", + "scripts/*", "scripts/**/*" ], "exclude": [ diff --git a/packages/fxa-content-server/package.json b/packages/fxa-content-server/package.json index a45d2ff774d..81c5468ed90 100644 --- a/packages/fxa-content-server/package.json +++ b/packages/fxa-content-server/package.json @@ -133,7 +133,6 @@ "core-js": "^3.41.0", "css": "3.0.0", "esbuild": "^0.17.15", - "esbuild-register": "^3.5.0", "eslint": "^7.32.0", "firefox-profile": "4.7.0", "got": "11.8.5", diff --git a/packages/fxa-content-server/pm2.config.js b/packages/fxa-content-server/pm2.config.js index 2777595ec68..d118423afb7 100644 --- a/packages/fxa-content-server/pm2.config.js +++ b/packages/fxa-content-server/pm2.config.js @@ -11,7 +11,8 @@ const apps = []; apps.push({ name: 'content', - script: 'node --inspect=9130 server/bin/fxa-content-server.js', + script: + 'node --inspect=9130 -r ts-node/register/transpile-only -r tsconfig-paths/register server/bin/fxa-content-server.js', cwd: __dirname, watch: ['server/**/*.js', 'server/**/*.html', 'server/**/*.json'], env: { diff --git a/packages/fxa-content-server/server/lib/beta-settings.js b/packages/fxa-content-server/server/lib/beta-settings.js index a1dc7758b5c..4872b07b63b 100644 --- a/packages/fxa-content-server/server/lib/beta-settings.js +++ b/packages/fxa-content-server/server/lib/beta-settings.js @@ -8,7 +8,7 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); const { supportedLanguages, rtlLocales, -} = require('../../../../dist/libs/shared/l10n/main.js'); +} = require('../../../../dist/libs/shared/l10n'); const config = require('./configuration'); const FLOW_ID_KEY = config.get('flow_id_key'); const flowMetrics = require('./flow-metrics'); diff --git a/packages/fxa-content-server/webpack.config.js b/packages/fxa-content-server/webpack.config.js index 74b37c7ea2f..4d12082a051 100644 --- a/packages/fxa-content-server/webpack.config.js +++ b/packages/fxa-content-server/webpack.config.js @@ -65,7 +65,7 @@ const webpackConfig = { 'fast-text-encoding': require.resolve('fast-text-encoding'), fxaCryptoDeriver: path.resolve( __dirname, - '../../dist/libs/vendored/crypto-relier/main.js' + '../../dist/libs/vendored/crypto-relier/src/index.js' ), fxaPairingChannel: require.resolve( 'fxa-pairing-channel/dist/FxAccountsPairingChannel.babel.umd.js' diff --git a/packages/fxa-event-broker/.vscode/launch.json b/packages/fxa-event-broker/.vscode/launch.json index 03ba002fe82..94c9531d100 100644 --- a/packages/fxa-event-broker/.vscode/launch.json +++ b/packages/fxa-event-broker/.vscode/launch.json @@ -14,7 +14,9 @@ "999999", "--colors", "-r", - "esbuild-register", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", "${workspaceFolder}/test/**/*.spec.ts", "${workspaceFolder}/test/**/**/*.spec.ts" ], @@ -35,7 +37,9 @@ "999999", "--colors", "-r", - "esbuild-register", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", "${workspaceFolder}/${relativeFile}" ], "env": { diff --git a/packages/fxa-event-broker/.vscode/tasks.json b/packages/fxa-event-broker/.vscode/tasks.json index 654c160c76a..7b1ad2fe9b3 100644 --- a/packages/fxa-event-broker/.vscode/tasks.json +++ b/packages/fxa-event-broker/.vscode/tasks.json @@ -23,7 +23,13 @@ "FIRESTORE_PROJECT_ID": "fx-event-broker" } }, - "args": ["-r", "esbuild-register", "${relativeFile}"], + "args": [ + "-r", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", + "${relativeFile}" + ], "group": "test", "presentation": { "echo": true, diff --git a/packages/fxa-event-broker/package.json b/packages/fxa-event-broker/package.json index 6a08d7f6dd8..74b3de4f74b 100644 --- a/packages/fxa-event-broker/package.json +++ b/packages/fxa-event-broker/package.json @@ -16,7 +16,7 @@ "test-integration": "JEST_JUNIT_OUTPUT_FILE=../../artifacts/tests/$npm_package_name/fxa-event-broker-jest-integration-results.xml jest --coverage --logHeapUsage -t '#integration' --ci --reporters=default --reporters=jest-junit ", "test-watch": "jest --watch", "test-cov": "jest --coverage", - "test-debug": "node --inspect-brk -r tsconfig-paths/register -r esbuild-register node_modules/.bin/jest --runInBand", + "test-debug": "node --inspect-brk -r tsconfig-paths/register node_modules/.bin/jest --runInBand", "test-e2e": "jest --config ./test/jest-e2e.json", "stop": "pm2 stop pm2.config.js", "restart": "pm2 restart pm2.config.js", @@ -66,8 +66,6 @@ "@typescript-eslint/parser": "^7.1.1", "audit-filter": "^0.5.0", "chance": "^1.1.8", - "esbuild": "^0.17.15", - "esbuild-register": "^3.5.0", "eslint": "^7.32.0", "eslint-config-prettier": "^9.1.0", "eslint-config-react-app": "^7.0.1", diff --git a/packages/fxa-payments-server/pm2.config.js b/packages/fxa-payments-server/pm2.config.js index ae23a5c1a16..da6be19c468 100644 --- a/packages/fxa-payments-server/pm2.config.js +++ b/packages/fxa-payments-server/pm2.config.js @@ -11,7 +11,7 @@ const apps = []; apps.push({ name: 'payments', cwd: __dirname, - script: 'node server/bin/fxa-payments-server.js', + script: 'node -r ts-node/register/transpile-only -r tsconfig-paths/register server/bin/fxa-payments-server.js', max_restarts: '1', min_uptime: '2m', env: { diff --git a/packages/fxa-settings/config/paths.js b/packages/fxa-settings/config/paths.js index 90cee93e865..98ce0ae3511 100644 --- a/packages/fxa-settings/config/paths.js +++ b/packages/fxa-settings/config/paths.js @@ -1,6 +1,8 @@ -// This file was created by react-scripts' (create-react-app) eject script. +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -'use strict'; +// This file was created by react-scripts' (create-react-app) eject script. const path = require('path'); const fs = require('fs'); diff --git a/packages/fxa-settings/config/webpack.config.js b/packages/fxa-settings/config/webpack.config.js index 87ee83266aa..a50c73e8fcc 100644 --- a/packages/fxa-settings/config/webpack.config.js +++ b/packages/fxa-settings/config/webpack.config.js @@ -1,3 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // This file was created by react-scripts' (create-react-app) eject script. const fs = require('fs'); @@ -358,7 +362,6 @@ module.exports = function (webpackEnv) { 'react-dom$': 'react-dom/profiling', 'scheduler/tracing': 'scheduler/tracing-profiling', }), - fxaCryptoDeriver: require.resolve('@fxa/vendored/crypto-relier/esm'), ...(modules.webpackAliases || {}), }, plugins: [ diff --git a/packages/fxa-settings/package.json b/packages/fxa-settings/package.json index 07c2228269a..69e09b7630d 100644 --- a/packages/fxa-settings/package.json +++ b/packages/fxa-settings/package.json @@ -82,6 +82,7 @@ "^@fxa/shared/assets(.*)$": "/../../libs/shared/assets/src$1", "@fxa/accounts/errors": "/../../libs/accounts/errors/src/index.ts", "@fxa/accounts/oauth": "/../../libs/accounts/oauth/src/index.ts", + "@fxa/vendored/crypto-relier": "/../../libs/vendored/crypto-relier/src/index.ts", "@fxa/vendored/common-password-list": "/../../libs/vendored/common-password-list/src/index.ts", "@fxa/vendored/incremental-encoder": "/../../libs/vendored/incremental-encoder/src/index.ts" }, diff --git a/packages/fxa-settings/src/lib/crypto/deriver.ts b/packages/fxa-settings/src/lib/crypto/deriver.ts deleted file mode 100644 index 929f5642d73..00000000000 --- a/packages/fxa-settings/src/lib/crypto/deriver.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// `fxaCryptoDeriver` is used in device pairing, so it's not something we -// always need to load in the main js bundle. -export default function importFxaCryptoDeriver() { - // @ts-ignore - return import(/* webpackChunkName: "fxaCryptoDeriver" */ 'fxaCryptoDeriver'); -} diff --git a/packages/fxa-settings/src/lib/crypto/scoped-keys.ts b/packages/fxa-settings/src/lib/crypto/scoped-keys.ts index cd634b74ff6..751d1f0f529 100644 --- a/packages/fxa-settings/src/lib/crypto/scoped-keys.ts +++ b/packages/fxa-settings/src/lib/crypto/scoped-keys.ts @@ -4,7 +4,7 @@ // NOTE: Ported from scoped-keys.js in content server. Minor typescript adaptions applied. -import fxaCryptoDeriver from './deriver'; +import * as cryptoRelier from '@fxa/vendored/crypto-relier'; /** * Derive scoped keys and create an encrypted bundle for key transport @@ -45,8 +45,7 @@ export async function createEncryptedBundle( * @returns {Promise} A promise that will resolve into an encrypted bundle of scoped keys */ async function encryptBundle(bundleObject: any, keysJwk: any) { - const cryptoDeriver = await fxaCryptoDeriver(); - const fxaDeriverUtils = new cryptoDeriver.DeriverUtils(); + const fxaDeriverUtils = new cryptoRelier.DeriverUtils(); return fxaDeriverUtils.encryptBundle(keysJwk, JSON.stringify(bundleObject)); } @@ -64,8 +63,7 @@ async function deriveScopedKeys(inputKey: any, uid: string, keyData: any) { required(uid, 'uid'); required(keyData, 'key data'); - const cryptoDeriver = await fxaCryptoDeriver(); - const scopedKeys = new cryptoDeriver.ScopedKeys(); + const scopedKeys = new cryptoRelier.ScopedKeys(); return scopedKeys.deriveScopedKey({ identifier: keyData.identifier, diff --git a/packages/fxa-settings/src/lib/glean/index.test.ts b/packages/fxa-settings/src/lib/glean/index.test.ts index efb8e1b905d..eee84548969 100644 --- a/packages/fxa-settings/src/lib/glean/index.test.ts +++ b/packages/fxa-settings/src/lib/glean/index.test.ts @@ -639,6 +639,10 @@ describe('lib/glean', () => { describe('thirdPartyAuth', () => { it('submits a ping with the third_party_auth_google_reg_start event name', async () => { + GleanMetrics.initialize( + { ...mockConfig, enabled: true }, + mockMetricsContext + ); const spy = sandbox.spy(thirdPartyAuth.googleRegStart, 'record'); GleanMetrics.thirdPartyAuth.startGoogleAuthFromReg(); await GleanMetrics.isDone(); diff --git a/packages/fxa-shared/.vscode/launch.json b/packages/fxa-shared/.vscode/launch.json index 79eaae21bd6..fbef7126a84 100644 --- a/packages/fxa-shared/.vscode/launch.json +++ b/packages/fxa-shared/.vscode/launch.json @@ -14,7 +14,9 @@ "999999", "--colors", "-r", - "esbuild-register", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", "--recursive", "${workspaceFolder}/test" ], @@ -31,7 +33,9 @@ "999999", "--colors", "-r", - "esbuild-register", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", "${workspaceFolder}/${relativeFile}" ], "console": "integratedTerminal", @@ -45,8 +49,10 @@ "args": [ "--reporter=lcov", "${workspaceFolder}/node_modules/mocha/bin/_mocha", - "--require", - "esbuild-register", + "-r", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", "--timeout", "999999", "--colors", diff --git a/packages/fxa-shared/.vscode/tasks.json b/packages/fxa-shared/.vscode/tasks.json index 6e688d05134..d3b3de23f2b 100644 --- a/packages/fxa-shared/.vscode/tasks.json +++ b/packages/fxa-shared/.vscode/tasks.json @@ -17,7 +17,13 @@ "label": "Run Current Test", "type": "shell", "command": "./node_modules/mocha/bin/mocha.js", - "args": ["-r", "esbuild-register", "${relativeFile}"], + "args": [ + "-r", + "ts-node/register/transpile-only", + "-r", + "tsconfig-paths/register", + "${relativeFile}" + ], "group": "test", "presentation": { "echo": true, diff --git a/packages/fxa-shared/README.md b/packages/fxa-shared/README.md index 47aedeb2742..0407ae8ef5d 100644 --- a/packages/fxa-shared/README.md +++ b/packages/fxa-shared/README.md @@ -135,16 +135,16 @@ It's important to note that sentry also supports tracing integration. So we typi ## Testing -This package uses [Mocha](https://mochajs.org/) to test its code. By default `npm test` will first lint the code and then test all files ending under `test/`, and uses `esbuild-register` so it can process TypeScript files. +This package uses [Mocha](https://mochajs.org/) to test its code. By default `npm test` will first lint the code and then test all files ending under `test/`, and uses `ts-node/register` so it can process TypeScript files. Test specific tests with the following commands: ```bash # Test only test/oauth/scopes.js -npx mocha -r esbuild-register test/oauth/scopes.js +npx mocha -r ts-node/register/transpile-only -r tsconfig-paths/register test/oauth/scopes.js # Grep for "invalid scope values" -npx mocha -r esbuild-register -g "invalid scope values" --recursive test +npx mocha -r ts-node/register/transpile-only -r tsconfig-paths/register -g "invalid scope values" --recursive test ``` Refer to Mocha's [CLI documentation](https://mochajs.org/#command-line-usage) for more advanced test configuration. diff --git a/packages/fxa-shared/package.json b/packages/fxa-shared/package.json index 38d5f321b94..dd87549d683 100644 --- a/packages/fxa-shared/package.json +++ b/packages/fxa-shared/package.json @@ -210,9 +210,9 @@ "test": "yarn test-mocha && yarn test-jest", "test-unit": "yarn test-mocha-unit && yarn test-jest-unit", "test-integration": "yarn test-mocha-integration && yarn test-jest-integration", - "test-mocha": "tsc --build && node ./scripts/mocha-coverage.js -r esbuild-register --recursive test/**/*.{js,ts}", - "test-mocha-unit": "NODE_OPTIONS=--no-experimental-fetch MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-shared-mocha-unit-results.xml mocha -r esbuild-register -r tsconfig-paths/register --recursive test/**/*.{js,ts} -g '#integration' --invert", - "test-mocha-integration": "MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-shared-mocha-integration-results.xml mocha -r esbuild-register -r tsconfig-paths/register --recursive test/**/*.{js,ts} -g '#integration'", + "test-mocha": "TS_NODE_PROJECT=tsconfig.cjs.json node ./scripts/mocha-coverage.js -r ts-node/register/transpile-only -r tsconfig-paths/register --recursive test/**/*.{js,ts}", + "test-mocha-unit": "TS_NODE_PROJECT=tsconfig.cjs.json NODE_OPTIONS=--no-experimental-fetch MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-shared-mocha-unit-results.xml mocha -r ts-node/register/transpile-only -r tsconfig-paths/register --recursive test/**/*.{js,ts} -g '#integration' --invert", + "test-mocha-integration": "TS_NODE_PROJECT=tsconfig.cjs.json MOCHA_FILE=../../artifacts/tests/$npm_package_name/fxa-shared-mocha-integration-results.xml mocha -r ts-node/register/transpile-only -r tsconfig-paths/register --recursive test/**/*.{js,ts} -g '#integration'", "test-jest": "jest --runInBand --logHeapUsage --coverage", "test-jest-unit": "JEST_JUNIT_OUTPUT_FILE=../../artifacts/tests/$npm_package_name/fxa-shared-jest-unit-results.xml jest --coverage --runInBand --logHeapUsage --forceExit --coverage -t '^(?!.*?#integration).*' --ci --reporters=default --reporters=jest-junit", "test-jest-integration": "JEST_JUNIT_OUTPUT_FILE=../../artifacts/tests/$npm_package_name/fxa-shared-jest-integration-results.xml jest --coverage --runInBand --logHeapUsage --coverage -t '#integration' --ci --reporters=default --reporters=jest-junit", @@ -256,8 +256,6 @@ "audit-filter": "^0.5.0", "chai": "^4.5.0", "chance": "^1.1.8", - "esbuild": "^0.17.15", - "esbuild-register": "^3.5.0", "eslint": "^7.32.0", "jest": "27.5.1", "jest-junit": "^16.0.0", diff --git a/tsconfig.base.json b/tsconfig.base.json index 4dcca85dd24..c953cc71b62 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,5 +1,10 @@ { "compileOnSave": false, + "ts-node": { + "compilerOptions": { + "module": "commonjs" + } + }, "compilerOptions": { "rootDir": ".", "allowJs": false, diff --git a/yarn.lock b/yarn.lock index 6d0a761e5ef..70312903bd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2941,17 +2941,6 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.28.6, @babel/code-frame@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/code-frame@npm:7.29.0" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.28.5" - js-tokens: "npm:^4.0.0" - picocolors: "npm:^1.1.1" - checksum: 10c0/d34cc504e7765dfb576a663d97067afb614525806b5cad1a5cc1a7183b916fec8ff57fa233585e3926fd5a9e6b31aae6df91aa81ae9775fb7a28f658d3346f0d - languageName: node - linkType: hard - "@babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.27.2, @babel/compat-data@npm:^7.27.7": version: 7.27.7 resolution: "@babel/compat-data@npm:7.27.7" @@ -2959,13 +2948,6 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.28.6": - version: 7.29.0 - resolution: "@babel/compat-data@npm:7.29.0" - checksum: 10c0/08f348554989d23aa801bf1405aa34b15e841c0d52d79da7e524285c77a5f9d298e70e11d91cc578d8e2c9542efc586d50c5f5cf8e1915b254a9dcf786913a94 - languageName: node - linkType: hard - "@babel/core@npm:^7.0.0, @babel/core@npm:^7.1.0, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.16.0, @babel/core@npm:^7.18.5, @babel/core@npm:^7.18.9, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.9, @babel/core@npm:^7.24.4, @babel/core@npm:^7.26.10, @babel/core@npm:^7.27.1, @babel/core@npm:^7.5.5, @babel/core@npm:^7.7.2, @babel/core@npm:^7.7.5, @babel/core@npm:^7.8.0": version: 7.27.7 resolution: "@babel/core@npm:7.27.7" @@ -2989,29 +2971,6 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.12.17": - version: 7.29.0 - resolution: "@babel/core@npm:7.29.0" - dependencies: - "@babel/code-frame": "npm:^7.29.0" - "@babel/generator": "npm:^7.29.0" - "@babel/helper-compilation-targets": "npm:^7.28.6" - "@babel/helper-module-transforms": "npm:^7.28.6" - "@babel/helpers": "npm:^7.28.6" - "@babel/parser": "npm:^7.29.0" - "@babel/template": "npm:^7.28.6" - "@babel/traverse": "npm:^7.29.0" - "@babel/types": "npm:^7.29.0" - "@jridgewell/remapping": "npm:^2.3.5" - convert-source-map: "npm:^2.0.0" - debug: "npm:^4.1.0" - gensync: "npm:^1.0.0-beta.2" - json5: "npm:^2.2.3" - semver: "npm:^6.3.1" - checksum: 10c0/5127d2e8e842ae409e11bcbb5c2dff9874abf5415e8026925af7308e903f4f43397341467a130490d1a39884f461bc2b67f3063bce0be44340db89687fd852aa - languageName: node - linkType: hard - "@babel/eslint-parser@npm:^7.16.3": version: 7.27.5 resolution: "@babel/eslint-parser@npm:7.27.5" @@ -3039,19 +2998,6 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/generator@npm:7.29.0" - dependencies: - "@babel/parser": "npm:^7.29.0" - "@babel/types": "npm:^7.29.0" - "@jridgewell/gen-mapping": "npm:^0.3.12" - "@jridgewell/trace-mapping": "npm:^0.3.28" - jsesc: "npm:^3.0.2" - checksum: 10c0/5c3df8f2475bfd5f97ad0211c52171aff630088b148e7b89d056b39d69855179bc9f2d1ee200263c76c2398a49e4fdbb38b9709ebc4f043cc04d9ee09a66668a - languageName: node - linkType: hard - "@babel/helper-annotate-as-pure@npm:^7.18.6, @babel/helper-annotate-as-pure@npm:^7.27.1, @babel/helper-annotate-as-pure@npm:^7.27.3": version: 7.27.3 resolution: "@babel/helper-annotate-as-pure@npm:7.27.3" @@ -3074,19 +3020,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-compilation-targets@npm:7.28.6" - dependencies: - "@babel/compat-data": "npm:^7.28.6" - "@babel/helper-validator-option": "npm:^7.27.1" - browserslist: "npm:^4.24.0" - lru-cache: "npm:^5.1.1" - semver: "npm:^6.3.1" - checksum: 10c0/3fcdf3b1b857a1578e99d20508859dbd3f22f3c87b8a0f3dc540627b4be539bae7f6e61e49d931542fe5b557545347272bbdacd7f58a5c77025a18b745593a50 - languageName: node - linkType: hard - "@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-create-class-features-plugin@npm:7.27.1" @@ -3132,13 +3065,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-globals@npm:^7.28.0": - version: 7.28.0 - resolution: "@babel/helper-globals@npm:7.28.0" - checksum: 10c0/5a0cd0c0e8c764b5f27f2095e4243e8af6fa145daea2b41b53c0c1414fe6ff139e3640f4e2207ae2b3d2153a1abd346f901c26c290ee7cb3881dd922d4ee9232 - languageName: node - linkType: hard - "@babel/helper-member-expression-to-functions@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-member-expression-to-functions@npm:7.27.1" @@ -3159,16 +3085,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-module-imports@npm:7.28.6" - dependencies: - "@babel/traverse": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/b49d8d8f204d9dbfd5ac70c54e533e5269afb3cea966a9d976722b13e9922cc773a653405f53c89acb247d5aebdae4681d631a3ae3df77ec046b58da76eda2ac - languageName: node - linkType: hard - "@babel/helper-module-transforms@npm:^7.27.1, @babel/helper-module-transforms@npm:^7.27.3": version: 7.27.3 resolution: "@babel/helper-module-transforms@npm:7.27.3" @@ -3182,19 +3098,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-module-transforms@npm:7.28.6" - dependencies: - "@babel/helper-module-imports": "npm:^7.28.6" - "@babel/helper-validator-identifier": "npm:^7.28.5" - "@babel/traverse": "npm:^7.28.6" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/6f03e14fc30b287ce0b839474b5f271e72837d0cafe6b172d759184d998fbee3903a035e81e07c2c596449e504f453463d58baa65b6f40a37ded5bec74620b2b - languageName: node - linkType: hard - "@babel/helper-optimise-call-expression@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-optimise-call-expression@npm:7.27.1" @@ -3211,13 +3114,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helper-plugin-utils@npm:7.28.6" - checksum: 10c0/3f5f8acc152fdbb69a84b8624145ff4f9b9f6e776cb989f9f968f8606eb7185c5c3cfcf3ba08534e37e1e0e1c118ac67080610333f56baa4f7376c99b5f1143d - languageName: node - linkType: hard - "@babel/helper-remap-async-to-generator@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-remap-async-to-generator@npm:7.27.1" @@ -3268,13 +3164,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.28.5": - version: 7.28.5 - resolution: "@babel/helper-validator-identifier@npm:7.28.5" - checksum: 10c0/42aaebed91f739a41f3d80b72752d1f95fd7c72394e8e4bd7cdd88817e0774d80a432451bcba17c2c642c257c483bf1d409dd4548883429ea9493a3bc4ab0847 - languageName: node - linkType: hard - "@babel/helper-validator-option@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-validator-option@npm:7.27.1" @@ -3303,16 +3192,6 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helpers@npm:7.28.6" - dependencies: - "@babel/template": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/c4a779c66396bb0cf619402d92f1610601ff3832db2d3b86b9c9dd10983bf79502270e97ac6d5280cea1b1a37de2f06ecbac561bd2271545270407fbe64027cb - languageName: node - linkType: hard - "@babel/highlight@npm:^7.0.0, @babel/highlight@npm:^7.10.4": version: 7.25.9 resolution: "@babel/highlight@npm:7.25.9" @@ -3336,17 +3215,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.28.6, @babel/parser@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/parser@npm:7.29.0" - dependencies: - "@babel/types": "npm:^7.29.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/333b2aa761264b91577a74bee86141ef733f9f9f6d4fc52548e4847dc35dfbf821f58c46832c637bfa761a6d9909d6a68f7d1ed59e17e4ffbb958dc510c17b62 - languageName: node - linkType: hard - "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.27.1": version: 7.27.1 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.27.1" @@ -4045,18 +3913,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.12.13": - version: 7.28.6 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.28.6" - dependencies: - "@babel/helper-module-transforms": "npm:^7.28.6" - "@babel/helper-plugin-utils": "npm:^7.28.6" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/7c45992797c6150644c8552feff4a016ba7bd6d59ff2b039ed969a9c5b20a6804cd9d21db5045fc8cca8ca7f08262497e354e93f8f2be6a1cdf3fbfa8c31a9b6 - languageName: node - linkType: hard - "@babel/plugin-transform-modules-commonjs@npm:^7.27.1": version: 7.27.1 resolution: "@babel/plugin-transform-modules-commonjs@npm:7.27.1" @@ -4613,17 +4469,6 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/template@npm:7.28.6" - dependencies: - "@babel/code-frame": "npm:^7.28.6" - "@babel/parser": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/66d87225ed0bc77f888181ae2d97845021838c619944877f7c4398c6748bcf611f216dfd6be74d39016af502bca876e6ce6873db3c49e4ac354c56d34d57e9f5 - languageName: node - linkType: hard - "@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.26.10, @babel/traverse@npm:^7.27.1, @babel/traverse@npm:^7.27.3, @babel/traverse@npm:^7.27.7, @babel/traverse@npm:^7.7.0, @babel/traverse@npm:^7.7.2": version: 7.27.7 resolution: "@babel/traverse@npm:7.27.7" @@ -4639,21 +4484,6 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.28.6, @babel/traverse@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/traverse@npm:7.29.0" - dependencies: - "@babel/code-frame": "npm:^7.29.0" - "@babel/generator": "npm:^7.29.0" - "@babel/helper-globals": "npm:^7.28.0" - "@babel/parser": "npm:^7.29.0" - "@babel/template": "npm:^7.28.6" - "@babel/types": "npm:^7.29.0" - debug: "npm:^4.3.1" - checksum: 10c0/f63ef6e58d02a9fbf3c0e2e5f1c877da3e0bc57f91a19d2223d53e356a76859cbaf51171c9211c71816d94a0e69efa2732fd27ffc0e1bbc84b636e60932333eb - languageName: node - linkType: hard - "@babel/types@npm:7.25.8": version: 7.25.8 resolution: "@babel/types@npm:7.25.8" @@ -4675,16 +4505,6 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.28.6, @babel/types@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/types@npm:7.29.0" - dependencies: - "@babel/helper-string-parser": "npm:^7.27.1" - "@babel/helper-validator-identifier": "npm:^7.28.5" - checksum: 10c0/23cc3466e83bcbfab8b9bd0edaafdb5d4efdb88b82b3be6728bbade5ba2f0996f84f63b1c5f7a8c0d67efded28300898a5f930b171bb40b311bca2029c4e9b4f - languageName: node - linkType: hard - "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -4699,18 +4519,6 @@ __metadata: languageName: node linkType: hard -"@cnakazawa/watch@npm:^1.0.3": - version: 1.0.4 - resolution: "@cnakazawa/watch@npm:1.0.4" - dependencies: - exec-sh: "npm:^0.3.2" - minimist: "npm:^1.2.0" - bin: - watch: cli.js - checksum: 10c0/8678b6f582bdc5ffe59c0d45c2ad21f4ea1d162ec7ddb32e85078fca481c26958f27bcdef6007b8e9a066da090ccf9d31e1753f8de1e5f32466a04227d70dc31 - languageName: node - linkType: hard - "@colors/colors@npm:1.5.0": version: 1.5.0 resolution: "@colors/colors@npm:1.5.0" @@ -8914,29 +8722,6 @@ __metadata: languageName: node linkType: hard -"@jest/transform@npm:^26.6.2": - version: 26.6.2 - resolution: "@jest/transform@npm:26.6.2" - dependencies: - "@babel/core": "npm:^7.1.0" - "@jest/types": "npm:^26.6.2" - babel-plugin-istanbul: "npm:^6.0.0" - chalk: "npm:^4.0.0" - convert-source-map: "npm:^1.4.0" - fast-json-stable-stringify: "npm:^2.0.0" - graceful-fs: "npm:^4.2.4" - jest-haste-map: "npm:^26.6.2" - jest-regex-util: "npm:^26.0.0" - jest-util: "npm:^26.6.2" - micromatch: "npm:^4.0.2" - pirates: "npm:^4.0.1" - slash: "npm:^3.0.0" - source-map: "npm:^0.6.1" - write-file-atomic: "npm:^3.0.0" - checksum: 10c0/1a1d636528d9b122b87b870633763c67f131533fce61e5db536dfbbea0bbfe8fe130daededb686ccc230389473a2b8ece5d0e1eaf380066d8902bde48579de31 - languageName: node - linkType: hard - "@jest/transform@npm:^27.5.1": version: 27.5.1 resolution: "@jest/transform@npm:27.5.1" @@ -9052,16 +8837,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.12": - version: 0.3.13 - resolution: "@jridgewell/gen-mapping@npm:0.3.13" - dependencies: - "@jridgewell/sourcemap-codec": "npm:^1.5.0" - "@jridgewell/trace-mapping": "npm:^0.3.24" - checksum: 10c0/9a7d65fb13bd9aec1fbab74cda08496839b7e2ceb31f5ab922b323e94d7c481ce0fc4fd7e12e2610915ed8af51178bdc61e168e92a8c8b8303b030b03489b13b - languageName: node - linkType: hard - "@jridgewell/gen-mapping@npm:^0.3.2, @jridgewell/gen-mapping@npm:^0.3.5": version: 0.3.8 resolution: "@jridgewell/gen-mapping@npm:0.3.8" @@ -9073,16 +8848,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/remapping@npm:^2.3.5": - version: 2.3.5 - resolution: "@jridgewell/remapping@npm:2.3.5" - dependencies: - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.24" - checksum: 10c0/3de494219ffeb2c5c38711d0d7bb128097edf91893090a2dbc8ee0b55d092bb7347b1fd0f478486c5eab010e855c73927b1666f2107516d472d24a73017d1194 - languageName: node - linkType: hard - "@jridgewell/resolve-uri@npm:^3.0.3, @jridgewell/resolve-uri@npm:^3.1.0": version: 3.1.2 resolution: "@jridgewell/resolve-uri@npm:3.1.2" @@ -9134,16 +8899,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.28": - version: 0.3.31 - resolution: "@jridgewell/trace-mapping@npm:0.3.31" - dependencies: - "@jridgewell/resolve-uri": "npm:^3.1.0" - "@jridgewell/sourcemap-codec": "npm:^1.4.14" - checksum: 10c0/4b30ec8cd56c5fd9a661f088230af01e0c1a3888d11ffb6b47639700f71225be21d1f7e168048d6d4f9449207b978a235c07c8f15c07705685d16dc06280e9d9 - languageName: node - linkType: hard - "@js-sdsl/ordered-map@npm:^4.4.2": version: 4.4.2 resolution: "@js-sdsl/ordered-map@npm:4.4.2" @@ -10447,25 +10202,6 @@ __metadata: languageName: node linkType: hard -"@nx/esbuild@npm:21.2.4": - version: 21.2.4 - resolution: "@nx/esbuild@npm:21.2.4" - dependencies: - "@nx/devkit": "npm:21.2.4" - "@nx/js": "npm:21.2.4" - picocolors: "npm:^1.1.0" - tinyglobby: "npm:^0.2.12" - tsconfig-paths: "npm:^4.1.2" - tslib: "npm:^2.3.0" - peerDependencies: - esbuild: ">=0.19.2 <1.0.0" - peerDependenciesMeta: - esbuild: - optional: true - checksum: 10c0/05fa3875ae9a5fc36e2f4675af08630e6c34cd50310cd7d52532794f3016aac0d01ac60a3b5b5b08e4ae1673d14fe67c253a83b6afaf385af0779cf3d20b63cc - languageName: node - linkType: hard - "@nx/eslint-plugin@npm:21.2.4": version: 21.2.4 resolution: "@nx/eslint-plugin@npm:21.2.4" @@ -18564,7 +18300,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7, @types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.1.7, @types/babel__core@npm:^7.18.0": +"@types/babel__core@npm:^7, @types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.18.0": version: 7.20.5 resolution: "@types/babel__core@npm:7.20.5" dependencies: @@ -23121,24 +22857,6 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^26.6.3": - version: 26.6.3 - resolution: "babel-jest@npm:26.6.3" - dependencies: - "@jest/transform": "npm:^26.6.2" - "@jest/types": "npm:^26.6.2" - "@types/babel__core": "npm:^7.1.7" - babel-plugin-istanbul: "npm:^6.0.0" - babel-preset-jest: "npm:^26.6.2" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.4" - slash: "npm:^3.0.0" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/355e431fbd663fd43dcf68c93edcf66e31c3295c35754739edb3ce39435fdc407de75540b310b370e6eb924af528839b6effb8de21870ad12423aac31e258221 - languageName: node - linkType: hard - "babel-jest@npm:^27.4.2, babel-jest@npm:^27.5.1": version: 27.5.1 resolution: "babel-jest@npm:27.5.1" @@ -23205,7 +22923,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-istanbul@npm:^6.0.0, babel-plugin-istanbul@npm:^6.1.1": +"babel-plugin-istanbul@npm:^6.1.1": version: 6.1.1 resolution: "babel-plugin-istanbul@npm:6.1.1" dependencies: @@ -23218,18 +22936,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-jest-hoist@npm:^26.6.2": - version: 26.6.2 - resolution: "babel-plugin-jest-hoist@npm:26.6.2" - dependencies: - "@babel/template": "npm:^7.3.3" - "@babel/types": "npm:^7.3.3" - "@types/babel__core": "npm:^7.0.0" - "@types/babel__traverse": "npm:^7.0.6" - checksum: 10c0/2fcddf7b338e38453d6a42c23db5b790e4188fcbffeba8ff74a62b7d64fe5a642b009a7bd780e47840c382600628de2a6486a92bb151648c64028a6c628e9bfd - languageName: node - linkType: hard - "babel-plugin-jest-hoist@npm:^27.5.1": version: 27.5.1 resolution: "babel-plugin-jest-hoist@npm:27.5.1" @@ -23358,18 +23064,6 @@ __metadata: languageName: node linkType: hard -"babel-preset-jest@npm:^26.6.2": - version: 26.6.2 - resolution: "babel-preset-jest@npm:26.6.2" - dependencies: - babel-plugin-jest-hoist: "npm:^26.6.2" - babel-preset-current-node-syntax: "npm:^1.0.0" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/b6e0efe33b485eb2fba019026933e46d680605b3bf84a6b7378f1df8344b890f66318c49129921dd98bf5819694316312a97b50b16d9aa377faf8624f9f0db5b - languageName: node - linkType: hard - "babel-preset-jest@npm:^27.5.1": version: 27.5.1 resolution: "babel-preset-jest@npm:27.5.1" @@ -24584,15 +24278,6 @@ __metadata: languageName: node linkType: hard -"capture-exit@npm:^2.0.0": - version: 2.0.0 - resolution: "capture-exit@npm:2.0.0" - dependencies: - rsvp: "npm:^4.8.4" - checksum: 10c0/d68df1e15937809501644a49c0267ef323b5b6a0cae5c08bbdceafd718aa08241844798bfdd762cf6756bc2becd83122aabc25b5222192f18093113bec670617 - languageName: node - linkType: hard - "cardinal@npm:^2.1.1": version: 2.1.1 resolution: "cardinal@npm:2.1.1" @@ -26419,7 +26104,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^6.0.0, cross-spawn@npm:^6.0.5": +"cross-spawn@npm:^6.0.5": version: 6.0.6 resolution: "cross-spawn@npm:6.0.6" dependencies: @@ -28724,19 +28409,6 @@ __metadata: languageName: node linkType: hard -"esbuild-jest@npm:^0.5.0": - version: 0.5.0 - resolution: "esbuild-jest@npm:0.5.0" - dependencies: - "@babel/core": "npm:^7.12.17" - "@babel/plugin-transform-modules-commonjs": "npm:^7.12.13" - babel-jest: "npm:^26.6.3" - peerDependencies: - esbuild: ">=0.8.50" - checksum: 10c0/32921608498bf23928c4ca4db3b41775cf6d2ef9c1a5a1fa166bacfb3c3c83792e1192d50d8022cbef744241b6fa2fc2d9c34d36eaed988e8d52bde46761c37e - languageName: node - linkType: hard - "esbuild-register@npm:^3.5.0": version: 3.6.0 resolution: "esbuild-register@npm:3.6.0" @@ -29946,28 +29618,6 @@ __metadata: languageName: node linkType: hard -"exec-sh@npm:^0.3.2": - version: 0.3.6 - resolution: "exec-sh@npm:0.3.6" - checksum: 10c0/de29ed40c263989ea151cfc8561c9a41a443185d1998b0ff7aee248323af3b46db3a1dc5341816297d0c02dca472b188640490aa4ba3cae017f531f98102607d - languageName: node - linkType: hard - -"execa@npm:^1.0.0": - version: 1.0.0 - resolution: "execa@npm:1.0.0" - dependencies: - cross-spawn: "npm:^6.0.0" - get-stream: "npm:^4.0.0" - is-stream: "npm:^1.1.0" - npm-run-path: "npm:^2.0.0" - p-finally: "npm:^1.0.0" - signal-exit: "npm:^3.0.0" - strip-eof: "npm:^1.0.0" - checksum: 10c0/cc71707c9aa4a2552346893ee63198bf70a04b5a1bc4f8a0ef40f1d03c319eae80932c59191f037990d7d102193e83a38ec72115fff814ec2fb3099f3661a590 - languageName: node - linkType: hard - "execa@npm:^5.0.0, execa@npm:^5.1.1": version: 5.1.1 resolution: "execa@npm:5.1.1" @@ -31576,7 +31226,7 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:^2.1.2, fsevents@npm:^2.3.2, fsevents@npm:~2.3.2": +"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2": version: 2.3.3 resolution: "fsevents@npm:2.3.3" dependencies: @@ -31605,7 +31255,7 @@ __metadata: languageName: node linkType: hard -"fsevents@patch:fsevents@npm%3A^2.1.2#optional!builtin, fsevents@patch:fsevents@npm%3A^2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": +"fsevents@patch:fsevents@npm%3A^2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": version: 2.3.3 resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" dependencies: @@ -31749,8 +31399,6 @@ __metadata: convict-format-with-moment: "npm:^6.2.0" convict-format-with-validator: "npm:^6.2.0" copyfiles: "npm:^2.4.1" - esbuild: "npm:^0.17.15" - esbuild-register: "npm:^3.5.0" eslint: "npm:^8.18.0" eslint-config-react-app: "npm:^7.0.1" eslint-plugin-prettier: "npm:^5.2.3" @@ -31768,6 +31416,7 @@ __metadata: tailwindcss: "npm:3.4.3" ts-jest: "npm:^29.2.5" ts-morph: "npm:^24.0.0" + tsconfig-paths: "npm:^4.2.0" tslib: "npm:^2.8.1" typescript: "npm:5.5.3" yargs: "npm:^17.0.1" @@ -31783,8 +31432,6 @@ __metadata: "@types/mocha": "npm:^10" "@types/node": "npm:^22.13.5" "@types/prettier": "npm:^2" - esbuild: "npm:^0.17.15" - esbuild-register: "npm:^3.5.0" eslint: "npm:^8.38.0" eslint-config-react-app: "npm:^7.0.1" fast-text-encoding: "npm:^1.0.4" @@ -31842,9 +31489,6 @@ __metadata: ejs: "npm:^3.1.10" email-addresses: "npm:5.0.0" emittery: "npm:^0.13.1" - esbuild: "npm:^0.17.15" - esbuild-jest: "npm:^0.5.0" - esbuild-register: "npm:^3.5.0" eslint: "npm:^8.57.1" fxa-customs-server: "workspace:*" fxa-geodb: "workspace:*" @@ -31960,7 +31604,6 @@ __metadata: css-loader: "npm:1.0.0" duration-js: "npm:4.0.0" esbuild: "npm:^0.17.15" - esbuild-register: "npm:^3.5.0" eslint: "npm:^7.32.0" expose-loader: "npm:5.0.0" express: "npm:^4.21.2" @@ -32139,8 +31782,6 @@ __metadata: convict: "npm:^6.2.5" convict-format-with-moment: "npm:^6.2.0" convict-format-with-validator: "npm:^6.2.0" - esbuild: "npm:^0.17.15" - esbuild-register: "npm:^3.5.0" eslint: "npm:^7.32.0" eslint-config-prettier: "npm:^9.1.0" eslint-config-react-app: "npm:^7.0.1" @@ -32549,8 +32190,6 @@ __metadata: chance: "npm:^1.1.8" cldr-localenames-full: "npm:46.0.0" cors: "npm:^2.8.5" - esbuild: "npm:^0.17.15" - esbuild-register: "npm:^3.5.0" eslint: "npm:^7.32.0" express: "npm:^4.21.2" find-up: "npm:^5.0.0" @@ -32630,7 +32269,6 @@ __metadata: "@nestjs/schematics": "npm:11.0.9" "@nestjs/testing": "npm:^10.3.4" "@next/bundle-analyzer": "npm:^15.1.6" - "@nx/esbuild": "npm:21.2.4" "@nx/eslint-plugin": "npm:21.2.4" "@nx/jest": "npm:21.2.4" "@nx/js": "npm:21.2.4" @@ -32723,8 +32361,6 @@ __metadata: copyfiles: "npm:^2.4.1" diffparser: "npm:^2.0.1" dotenv: "npm:^16.4.5" - esbuild: "npm:^0.17.15" - esbuild-register: "npm:^3.5.0" eslint: "npm:^8.57.1" eslint-config-next: "npm:15.5.14" eslint-config-prettier: "npm:^10.1.5" @@ -32948,15 +32584,6 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^4.0.0": - version: 4.1.0 - resolution: "get-stream@npm:4.1.0" - dependencies: - pump: "npm:^3.0.0" - checksum: 10c0/294d876f667694a5ca23f0ca2156de67da950433b6fb53024833733975d32582896dbc7f257842d331809979efccf04d5e0b6b75ad4d45744c45f193fd497539 - languageName: node - linkType: hard - "get-stream@npm:^5.1.0": version: 5.2.0 resolution: "get-stream@npm:5.2.0" @@ -36298,13 +35925,6 @@ __metadata: languageName: node linkType: hard -"is-stream@npm:^1.1.0": - version: 1.1.0 - resolution: "is-stream@npm:1.1.0" - checksum: 10c0/b8ae7971e78d2e8488d15f804229c6eed7ed36a28f8807a1815938771f4adff0e705218b7dab968270433f67103e4fef98062a0beea55d64835f705ee72c7002 - languageName: node - linkType: hard - "is-stream@npm:^2.0.0, is-stream@npm:^2.0.1": version: 2.0.1 resolution: "is-stream@npm:2.0.1" @@ -37125,31 +36745,6 @@ __metadata: languageName: node linkType: hard -"jest-haste-map@npm:^26.6.2": - version: 26.6.2 - resolution: "jest-haste-map@npm:26.6.2" - dependencies: - "@jest/types": "npm:^26.6.2" - "@types/graceful-fs": "npm:^4.1.2" - "@types/node": "npm:*" - anymatch: "npm:^3.0.3" - fb-watchman: "npm:^2.0.0" - fsevents: "npm:^2.1.2" - graceful-fs: "npm:^4.2.4" - jest-regex-util: "npm:^26.0.0" - jest-serializer: "npm:^26.6.2" - jest-util: "npm:^26.6.2" - jest-worker: "npm:^26.6.2" - micromatch: "npm:^4.0.2" - sane: "npm:^4.0.3" - walker: "npm:^1.0.7" - dependenciesMeta: - fsevents: - optional: true - checksum: 10c0/85a40d8ecf4bfb659613f107c963c7366cdf6dcceb0ca73dc8ca09fbe0e2a63b976940f573db6260c43011993cb804275f447f268c3bc4b680c08baed300701d - languageName: node - linkType: hard - "jest-haste-map@npm:^27.5.1": version: 27.5.1 resolution: "jest-haste-map@npm:27.5.1" @@ -37409,13 +37004,6 @@ __metadata: languageName: node linkType: hard -"jest-regex-util@npm:^26.0.0": - version: 26.0.0 - resolution: "jest-regex-util@npm:26.0.0" - checksum: 10c0/988675764a08945b90f48e6f5a8640b0d9885a977f100a168061d10037d53808a6cdb7dc8cb6fe9b1332f0523b42bf3edbb6d2cc6c7f7ba582d05d432efb3e60 - languageName: node - linkType: hard - "jest-regex-util@npm:^27.0.0, jest-regex-util@npm:^27.5.1": version: 27.5.1 resolution: "jest-regex-util@npm:27.5.1" @@ -37611,16 +37199,6 @@ __metadata: languageName: node linkType: hard -"jest-serializer@npm:^26.6.2": - version: 26.6.2 - resolution: "jest-serializer@npm:26.6.2" - dependencies: - "@types/node": "npm:*" - graceful-fs: "npm:^4.2.4" - checksum: 10c0/1c67aa1acefdc0b244f2629aaef12a56e563a5c5cb817970d2b97bdad5e8aae187b269c8d356c42ff9711436499c4da71ec8400e6280dab110be8cc5300884b0 - languageName: node - linkType: hard - "jest-serializer@npm:^27.5.1": version: 27.5.1 resolution: "jest-serializer@npm:27.5.1" @@ -37703,20 +37281,6 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^26.6.2": - version: 26.6.2 - resolution: "jest-util@npm:26.6.2" - dependencies: - "@jest/types": "npm:^26.6.2" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.4" - is-ci: "npm:^2.0.0" - micromatch: "npm:^4.0.2" - checksum: 10c0/ab93709840f87bdf478d082f5465467c27a20a422cbe456cc2a56961d8c950ea52511995fb6063f62a113737f3dd714b836a1fbde51abef96642a5975e835a01 - languageName: node - linkType: hard - "jest-util@npm:^27.5.1": version: 27.5.1 resolution: "jest-util@npm:27.5.1" @@ -37868,7 +37432,7 @@ __metadata: languageName: node linkType: hard -"jest-worker@npm:^26.2.1, jest-worker@npm:^26.6.2": +"jest-worker@npm:^26.2.1": version: 26.6.2 resolution: "jest-worker@npm:26.6.2" dependencies: @@ -42570,15 +42134,6 @@ __metadata: languageName: node linkType: hard -"npm-run-path@npm:^2.0.0": - version: 2.0.2 - resolution: "npm-run-path@npm:2.0.2" - dependencies: - path-key: "npm:^2.0.0" - checksum: 10c0/95549a477886f48346568c97b08c4fda9cdbf7ce8a4fbc2213f36896d0d19249e32d68d7451bdcbca8041b5fba04a6b2c4a618beaf19849505c05b700740f1de - languageName: node - linkType: hard - "npm-run-path@npm:^4.0.1": version: 4.0.1 resolution: "npm-run-path@npm:4.0.1" @@ -43459,13 +43014,6 @@ __metadata: languageName: node linkType: hard -"p-finally@npm:^1.0.0": - version: 1.0.0 - resolution: "p-finally@npm:1.0.0" - checksum: 10c0/6b8552339a71fe7bd424d01d8451eea92d379a711fc62f6b2fe64cad8a472c7259a236c9a22b4733abca0b5666ad503cb497792a0478c5af31ded793d00937e7 - languageName: node - linkType: hard - "p-limit@npm:3.1.0, p-limit@npm:^3.0.2, p-limit@npm:^3.1.0": version: 3.1.0 resolution: "p-limit@npm:3.1.0" @@ -44006,7 +43554,7 @@ __metadata: languageName: node linkType: hard -"path-key@npm:^2.0.0, path-key@npm:^2.0.1": +"path-key@npm:^2.0.1": version: 2.0.1 resolution: "path-key@npm:2.0.1" checksum: 10c0/dd2044f029a8e58ac31d2bf34c34b93c3095c1481942960e84dd2faa95bbb71b9b762a106aead0646695330936414b31ca0bd862bf488a937ad17c8c5d73b32b @@ -48664,13 +48212,6 @@ __metadata: languageName: node linkType: hard -"rsvp@npm:^4.8.4": - version: 4.8.5 - resolution: "rsvp@npm:4.8.5" - checksum: 10c0/7978f01060a48204506a8ebe15cdbd468498f5ae538b1d7ee3e7630375ba7cb2f98df2f596c12d3f4d5d5c21badc1c6ca8009f5142baded8511609a28eabd19a - languageName: node - linkType: hard - "run-applescript@npm:^7.0.0": version: 7.0.0 resolution: "run-applescript@npm:7.0.0" @@ -48838,25 +48379,6 @@ __metadata: languageName: node linkType: hard -"sane@npm:^4.0.3": - version: 4.1.0 - resolution: "sane@npm:4.1.0" - dependencies: - "@cnakazawa/watch": "npm:^1.0.3" - anymatch: "npm:^2.0.0" - capture-exit: "npm:^2.0.0" - exec-sh: "npm:^0.3.2" - execa: "npm:^1.0.0" - fb-watchman: "npm:^2.0.0" - micromatch: "npm:^3.1.4" - minimist: "npm:^1.1.1" - walker: "npm:~1.0.5" - bin: - sane: ./src/cli.js - checksum: 10c0/7d0991ecaa10b02c6d0339a6f7e31db776971f3b659a351916dcc7ce3464671e72b54d80bcce118e39d4343e1e56c699fe35f6cb89fbd88b07095b72841cbfb0 - languageName: node - linkType: hard - "sanitize.css@npm:*, sanitize.css@npm:13.0.0": version: 13.0.0 resolution: "sanitize.css@npm:13.0.0" @@ -49858,7 +49380,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.4, signal-exit@npm:^3.0.6, signal-exit@npm:^3.0.7": +"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.4, signal-exit@npm:^3.0.6, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 @@ -51172,13 +50694,6 @@ __metadata: languageName: node linkType: hard -"strip-eof@npm:^1.0.0": - version: 1.0.0 - resolution: "strip-eof@npm:1.0.0" - checksum: 10c0/f336beed8622f7c1dd02f2cbd8422da9208fae81daf184f73656332899978919d5c0ca84dc6cfc49ad1fc4dd7badcde5412a063cf4e0d7f8ed95a13a63f68f45 - languageName: node - linkType: hard - "strip-final-newline@npm:^2.0.0": version: 2.0.0 resolution: "strip-final-newline@npm:2.0.0" @@ -54587,7 +54102,7 @@ __metadata: languageName: node linkType: hard -"walker@npm:^1.0.7, walker@npm:^1.0.8, walker@npm:~1.0.5": +"walker@npm:^1.0.7, walker@npm:^1.0.8": version: 1.0.8 resolution: "walker@npm:1.0.8" dependencies: