From ac3df080ee12048dbf455f1bf02063285ca9c90c Mon Sep 17 00:00:00 2001 From: Edward Foyle Date: Mon, 25 Sep 2023 13:48:12 -0700 Subject: [PATCH] support jest 26 cjs loading of packages (#286) --- .changeset/chilly-tables-pump.md | 6 ++++++ package-lock.json | 9 ++++++++- packages/backend-auth/package.json | 1 + packages/backend-auth/tsconfig.json | 1 + packages/backend-function/package.json | 1 + packages/backend-function/tsconfig.json | 1 + packages/backend-graphql/package.json | 1 + packages/backend-graphql/tsconfig.json | 1 + packages/backend-output-schemas/package.json | 1 + packages/backend-output-storage/package.json | 4 ++++ packages/backend-output-storage/tsconfig.json | 2 +- packages/deployed-backend-client/package.json | 1 + packages/deployed-backend-client/tsconfig.json | 2 +- 13 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .changeset/chilly-tables-pump.md diff --git a/.changeset/chilly-tables-pump.md b/.changeset/chilly-tables-pump.md new file mode 100644 index 0000000000..9b5aa7eb68 --- /dev/null +++ b/.changeset/chilly-tables-pump.md @@ -0,0 +1,6 @@ +--- +'@aws-amplify/backend-output-schemas': patch +'@aws-amplify/backend-output-storage': patch +--- + +Add "main" field to package.json to support CJS loaders diff --git a/package-lock.json b/package-lock.json index 1ed6952ba0..6fd06ef4de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18396,7 +18396,8 @@ "name": "@aws-amplify/backend-auth", "version": "0.2.0-alpha.3", "dependencies": { - "@aws-amplify/auth-construct-alpha": "^0.2.0-alpha.5" + "@aws-amplify/auth-construct-alpha": "^0.2.0-alpha.5", + "@aws-amplify/backend-output-storage": "0.1.0" }, "devDependencies": { "@aws-amplify/backend": "^0.1.1-alpha.2" @@ -18423,6 +18424,7 @@ "name": "@aws-amplify/backend-function", "version": "0.1.1-alpha.2", "dependencies": { + "@aws-amplify/backend-output-storage": "0.1.0", "@aws-amplify/function-construct-alpha": "^0.1.1-alpha.1", "execa": "^7.1.1" }, @@ -18440,6 +18442,7 @@ "version": "0.1.1-alpha.3", "dependencies": { "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.2", + "@aws-amplify/backend-output-storage": "0.1.0", "@aws-amplify/graphql-construct-alpha": "^0.6.2" }, "devDependencies": { @@ -18464,6 +18467,9 @@ "packages/backend-output-storage": { "name": "@aws-amplify/backend-output-storage", "version": "0.1.0", + "dependencies": { + "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.2" + }, "peerDependencies": { "aws-cdk-lib": "^2.80.0" } @@ -18669,6 +18675,7 @@ "name": "@aws-amplify/deployed-backend-client", "version": "0.1.0", "dependencies": { + "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.2", "@aws-sdk/client-amplify": "^3.414.0", "@aws-sdk/client-cloudformation": "^3.414.0", "@aws-sdk/types": "^3.413.0", diff --git a/packages/backend-auth/package.json b/packages/backend-auth/package.json index 51c742f402..fae345911b 100644 --- a/packages/backend-auth/package.json +++ b/packages/backend-auth/package.json @@ -17,6 +17,7 @@ "update:api": "api-extractor run --local" }, "dependencies": { + "@aws-amplify/backend-output-storage": "0.1.0", "@aws-amplify/auth-construct-alpha": "^0.2.0-alpha.5" }, "devDependencies": { diff --git a/packages/backend-auth/tsconfig.json b/packages/backend-auth/tsconfig.json index 9ab4233701..1e1671a76a 100644 --- a/packages/backend-auth/tsconfig.json +++ b/packages/backend-auth/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "src", "outDir": "lib" }, "references": [ + { "path": "../backend-output-storage" }, { "path": "../auth-construct" }, { "path": "../backend" }, { "path": "../plugin-types" } diff --git a/packages/backend-function/package.json b/packages/backend-function/package.json index 569c3e02cf..7ceeeb60c3 100644 --- a/packages/backend-function/package.json +++ b/packages/backend-function/package.json @@ -17,6 +17,7 @@ "update:api": "api-extractor run --local" }, "dependencies": { + "@aws-amplify/backend-output-storage": "0.1.0", "@aws-amplify/function-construct-alpha": "^0.1.1-alpha.1", "execa": "^7.1.1" }, diff --git a/packages/backend-function/tsconfig.json b/packages/backend-function/tsconfig.json index de2d2feb46..2ef8022434 100644 --- a/packages/backend-function/tsconfig.json +++ b/packages/backend-function/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "src", "outDir": "lib" }, "references": [ + { "path": "../backend-output-storage" }, { "path": "../function-construct" }, { "path": "../backend" }, { "path": "../plugin-types" } diff --git a/packages/backend-graphql/package.json b/packages/backend-graphql/package.json index 818b82379f..f0858cdd2e 100644 --- a/packages/backend-graphql/package.json +++ b/packages/backend-graphql/package.json @@ -25,6 +25,7 @@ "constructs": "^10.0.0" }, "dependencies": { + "@aws-amplify/backend-output-storage": "0.1.0", "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.2", "@aws-amplify/graphql-construct-alpha": "^0.6.2" } diff --git a/packages/backend-graphql/tsconfig.json b/packages/backend-graphql/tsconfig.json index 9f7cf85f69..f4c38c765f 100644 --- a/packages/backend-graphql/tsconfig.json +++ b/packages/backend-graphql/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "src", "outDir": "lib" }, "references": [ + { "path": "../backend-output-storage" }, { "path": "../backend-output-schemas" }, { "path": "../backend" }, { "path": "../plugin-types" } diff --git a/packages/backend-output-schemas/package.json b/packages/backend-output-schemas/package.json index 5d8a1c85ac..dff375371f 100644 --- a/packages/backend-output-schemas/package.json +++ b/packages/backend-output-schemas/package.json @@ -32,6 +32,7 @@ "require": "./lib/storage/index.js" } }, + "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { "update:api": "api-extractor run --local" diff --git a/packages/backend-output-storage/package.json b/packages/backend-output-storage/package.json index 3759246b6e..09620b5b0c 100644 --- a/packages/backend-output-storage/package.json +++ b/packages/backend-output-storage/package.json @@ -12,10 +12,14 @@ "require": "./lib/index.js" } }, + "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { "update:api": "api-extractor run --local" }, + "dependencies": { + "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.2" + }, "peerDependencies": { "aws-cdk-lib": "^2.80.0" } diff --git a/packages/backend-output-storage/tsconfig.json b/packages/backend-output-storage/tsconfig.json index 2aab102e9b..c8abe72848 100644 --- a/packages/backend-output-storage/tsconfig.json +++ b/packages/backend-output-storage/tsconfig.json @@ -1,5 +1,5 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "src", "outDir": "lib" }, - "references": [] + "references": [{ "path": "../backend-output-schemas" }] } diff --git a/packages/deployed-backend-client/package.json b/packages/deployed-backend-client/package.json index 432ded1484..f1bba4c96a 100644 --- a/packages/deployed-backend-client/package.json +++ b/packages/deployed-backend-client/package.json @@ -17,6 +17,7 @@ "update:api": "api-extractor run --local" }, "dependencies": { + "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.2", "@aws-sdk/client-amplify": "^3.414.0", "@aws-sdk/client-cloudformation": "^3.414.0", "@aws-sdk/types": "^3.413.0", diff --git a/packages/deployed-backend-client/tsconfig.json b/packages/deployed-backend-client/tsconfig.json index 2aab102e9b..c8abe72848 100644 --- a/packages/deployed-backend-client/tsconfig.json +++ b/packages/deployed-backend-client/tsconfig.json @@ -1,5 +1,5 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "src", "outDir": "lib" }, - "references": [] + "references": [{ "path": "../backend-output-schemas" }] }