diff --git a/.changeset/fuzzy-cooks-battle.md b/.changeset/fuzzy-cooks-battle.md new file mode 100644 index 0000000000..896e97a49f --- /dev/null +++ b/.changeset/fuzzy-cooks-battle.md @@ -0,0 +1,5 @@ +--- +'@aws-amplify/form-generator': minor +--- + +Use "use client"; directive in generated React components diff --git a/.changeset/good-suns-rescue.md b/.changeset/good-suns-rescue.md new file mode 100644 index 0000000000..8889bb037d --- /dev/null +++ b/.changeset/good-suns-rescue.md @@ -0,0 +1,7 @@ +--- +'@aws-amplify/integration-tests': patch +'@aws-amplify/auth-construct-alpha': patch +'@aws-amplify/backend-auth': patch +--- + +Flatten loginWith type to improve autocompletion. diff --git a/.github/workflows/poc-e2e-flow-test.yml b/.github/workflows/poc-e2e-flow-test.yml new file mode 100644 index 0000000000..9f1870dc93 --- /dev/null +++ b/.github/workflows/poc-e2e-flow-test.yml @@ -0,0 +1,57 @@ +# Description: This workflow mimic the flow of behaviors when user using Amplify CLI; + +name: 'poc-e2e-flow-test' + +on: # TODO: need to change the trigger + push: + branches: + - poc/e2e-test + +jobs: + create-amplify-project: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + node-version: [18] + pkg-manager: [npm, yarn, yarn-stable, pnpm] + runs-on: ${{ matrix.os }} + env: + PACKAGE_MANAGER_EXECUTABLE: ${{ matrix.pkg-manager }} # TODO: remove PACKAGE_MANAGER_EXECUTABLE once CLI is able to getPackageManager(). + steps: + - name: Checkout aws-amplify/amplify-cli repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1. TODO: try only fetch .github/workflow + - name: Setup Node.js + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 #4.0.0 + with: + node-version: ${{ matrix.node-version }} + cache: npm + - name: Local Publish create-amplify + shell: bash + run: npm run install:local && npm run build && npm run vend + - name: ${{matrix.pkg-manager}}-create-amplify-project + if: matrix.pkg-manager != 'yarn-stable' + shell: bash + run: + | # TODO: last step `create amplify` should be replaced by `run e2e` + mkdir -p /tmp/amplify-project; cd /tmp/amplify-project + npm install -g ${{matrix.pkg-manager}} + echo "$(${{matrix.pkg-manager}}) config set registry http://localhost:4873" + ${{matrix.pkg-manager}} config set registry http://localhost:4873 + echo "$(${{matrix.pkg-manager}}) config get registry" + ${{matrix.pkg-manager}} config get registry + ${{matrix.pkg-manager}} create amplify --yes + + - name: yarn-stable-create-amplify-project + if: matrix.pkg-manager == 'yarn-stable' + shell: bash + run: + | # TODO: last step `create amplify` should be replaced by `run e2e` + mkdir -p /tmp/amplify-project; cd /tmp/amplify-project + corepack enable + echo "yarn set version stable" + yarn set version stable + echo "yarn version $(yarn --version)" + yarn config set unsafeHttpWhitelist localhost + yarn config set npmRegistryServer http://localhost:4873 + PACKAGE_MANAGER_EXECUTABLE=yarn yarn create amplify --yes diff --git a/examples/simple_react/amplify/auth/resource.ts b/examples/simple_react/amplify/auth/resource.ts index e21daa4553..cd2d859508 100644 --- a/examples/simple_react/amplify/auth/resource.ts +++ b/examples/simple_react/amplify/auth/resource.ts @@ -1,4 +1,4 @@ -import { defineAuth } from '@aws-amplify/backend-auth'; +import { defineAuth } from '@aws-amplify/backend'; export const auth = defineAuth({ loginWith: { diff --git a/examples/simple_react/amplify/backend.ts b/examples/simple_react/amplify/backend.ts index 7e5c96bfa5..56375d22c4 100644 --- a/examples/simple_react/amplify/backend.ts +++ b/examples/simple_react/amplify/backend.ts @@ -1,8 +1,8 @@ -import { Backend } from '@aws-amplify/backend'; +import { defineBackend } from '@aws-amplify/backend'; import { auth } from './auth/resource.js'; import { data } from './data/resource.js'; -new Backend({ +defineBackend({ auth, data, }); diff --git a/examples/simple_react/amplify/data/resource.ts b/examples/simple_react/amplify/data/resource.ts index f45931f5cf..031e65110a 100644 --- a/examples/simple_react/amplify/data/resource.ts +++ b/examples/simple_react/amplify/data/resource.ts @@ -1,4 +1,4 @@ -import { defineData } from '@aws-amplify/backend-graphql'; +import { defineData } from '@aws-amplify/backend'; const schema = ` type Todo @model @auth(rules: [{ allow: private }]) { diff --git a/package-lock.json b/package-lock.json index 61715c9086..c666694509 100644 --- a/package-lock.json +++ b/package-lock.json @@ -470,20 +470,20 @@ "link": true }, "node_modules/@aws-amplify/codegen-ui": { - "version": "2.19.1", - "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui/-/codegen-ui-2.19.1.tgz", - "integrity": "sha512-tmjJr3XXWpRSiqBbBrPg+PlYRafJL8Uk48e424scMsfmlmIIJbeb/FTcwi8aB7rihvgFwe/Z4pCS5OU9gnBciQ==", + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui/-/codegen-ui-2.19.3.tgz", + "integrity": "sha512-Ny9y8QG8BrSDxRlwWoSxxaICyY0PZtvlvOKclDjz3yE6hy3AXA/hzInFA3O3zY1qJ6HQNUQ83+atzJuiBvfT+w==", "dependencies": { "change-case": "^4.1.2", "yup": "^0.32.11" } }, "node_modules/@aws-amplify/codegen-ui-react": { - "version": "2.19.1", - "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui-react/-/codegen-ui-react-2.19.1.tgz", - "integrity": "sha512-ufnwMF7p3Qi+LiLeCsqrM43LfHWZcuJ23SheXjI9Jmv07Kqeh82k+KNukV5M4pMGJupJdHGQj5ShpV2/91Mk5A==", + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui-react/-/codegen-ui-react-2.19.3.tgz", + "integrity": "sha512-u/XlznCqD3oXTgmSO7amK+j6nvrypyzbWmQMXSIEqFHaPPipuU4i2fDmY2fSizRn+GZWa0/+8odBBJ1oGX9dag==", "dependencies": { - "@aws-amplify/codegen-ui": "2.19.1", + "@aws-amplify/codegen-ui": "2.19.3", "@typescript/vfs": "~1.3.5", "pluralize": "^8.0.0", "semver": "^7.5.4", @@ -19374,12 +19374,12 @@ }, "packages/auth-construct": { "name": "@aws-amplify/auth-construct-alpha", - "version": "0.2.0-alpha.18", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "^0.2.0", + "@aws-amplify/plugin-types": "^0.2.0" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -19388,19 +19388,19 @@ }, "packages/backend": { "name": "@aws-amplify/backend", - "version": "0.2.0-alpha.12", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { "@aws-amplify/amplify-api-next-alpha": "^0.6.2", - "@aws-amplify/backend-auth": "^0.2.0-alpha.15", - "@aws-amplify/backend-function": "^0.1.1-alpha.11", - "@aws-amplify/backend-graphql": "^0.2.0-alpha.13", - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6", - "@aws-amplify/backend-secret": "^0.2.0-alpha.5", - "@aws-amplify/backend-storage": "^0.2.0-alpha.10", - "@aws-amplify/platform-core": "^0.1.1-alpha.4", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/backend-auth": "^0.2.0", + "@aws-amplify/backend-function": "^0.1.1", + "@aws-amplify/backend-graphql": "^0.2.0", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "^0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/backend-storage": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0" }, "devDependencies": { "@types/aws-lambda": "^8.10.119", @@ -19413,15 +19413,15 @@ }, "packages/backend-auth": { "name": "@aws-amplify/backend-auth", - "version": "0.2.0-alpha.15", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/auth-construct-alpha": "^0.2.0-alpha.18", - "@aws-amplify/backend-output-storage": "0.2.0-alpha.6", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/auth-construct-alpha": "^0.2.0", + "@aws-amplify/backend-output-storage": "0.2.0", + "@aws-amplify/plugin-types": "^0.2.0" }, "devDependencies": { - "@aws-amplify/backend-platform-test-stubs": "^0.1.0" + "@aws-amplify/backend-platform-test-stubs": "^0.1.1" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -19430,11 +19430,11 @@ }, "packages/backend-deployer": { "name": "@aws-amplify/backend-deployer", - "version": "0.2.0-alpha.11", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/platform-core": "^0.1.1-alpha.3", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0", "execa": "^7.2.0", "tsx": "^3.12.6" }, @@ -19445,16 +19445,16 @@ }, "packages/backend-function": { "name": "@aws-amplify/backend-function", - "version": "0.1.1-alpha.11", + "version": "0.1.1", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-storage": "0.2.0-alpha.6", - "@aws-amplify/function-construct-alpha": "^0.2.0-alpha.7", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11", + "@aws-amplify/backend-output-storage": "0.2.0", + "@aws-amplify/function-construct-alpha": "^0.2.0", + "@aws-amplify/plugin-types": "^0.2.0", "execa": "^7.1.1" }, "devDependencies": { - "@aws-amplify/backend-platform-test-stubs": "^0.1.0" + "@aws-amplify/backend-platform-test-stubs": "^0.1.1" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -19463,17 +19463,17 @@ }, "packages/backend-graphql": { "name": "@aws-amplify/backend-graphql", - "version": "0.2.0-alpha.13", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { "@aws-amplify/amplify-api-next-types-alpha": "^0.0.4", - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "0.2.0-alpha.6", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "0.2.0", "@aws-amplify/graphql-api-construct": "^1.1.4", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/plugin-types": "^0.2.0" }, "devDependencies": { - "@aws-amplify/backend-platform-test-stubs": "^0.1.0" + "@aws-amplify/backend-platform-test-stubs": "^0.1.1" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -19482,10 +19482,10 @@ }, "packages/backend-output-schemas": { "name": "@aws-amplify/backend-output-schemas", - "version": "0.2.0-alpha.8", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { - "@aws-amplify/plugin-types": "0.2.0-alpha.11" + "@aws-amplify/plugin-types": "0.2.0" }, "peerDependencies": { "zod": "^3.21.4" @@ -19493,11 +19493,11 @@ }, "packages/backend-output-storage": { "name": "@aws-amplify/backend-output-storage", - "version": "0.2.0-alpha.6", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/platform-core": "^0.1.1-alpha.4" + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0" @@ -19505,7 +19505,7 @@ }, "packages/backend-platform-test-stubs": { "name": "@aws-amplify/backend-platform-test-stubs", - "version": "0.1.0", + "version": "0.1.1", "license": "Apache-2.0", "dependencies": { "aws-cdk-lib": "^2.100.0", @@ -19514,11 +19514,11 @@ }, "packages/backend-secret": { "name": "@aws-amplify/backend-secret", - "version": "0.2.0-alpha.6", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/platform-core": "^0.1.1-alpha.2", - "@aws-amplify/plugin-types": "^0.2.0-alpha.9", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0", "@aws-sdk/client-ssm": "^3.398.0" }, "devDependencies": { @@ -19527,15 +19527,15 @@ }, "packages/backend-storage": { "name": "@aws-amplify/backend-storage", - "version": "0.2.0-alpha.10", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11", - "@aws-amplify/storage-construct-alpha": "^0.2.0-alpha.11" + "@aws-amplify/backend-output-storage": "^0.2.0", + "@aws-amplify/plugin-types": "^0.2.0", + "@aws-amplify/storage-construct-alpha": "^0.2.0" }, "devDependencies": { - "@aws-amplify/backend-platform-test-stubs": "^0.1.0" + "@aws-amplify/backend-platform-test-stubs": "^0.1.1" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -19552,18 +19552,18 @@ }, "packages/cli": { "name": "@aws-amplify/backend-cli", - "version": "0.2.0-alpha.15", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.7", - "@aws-amplify/backend-secret": "^0.2.0-alpha.6", - "@aws-amplify/cli-core": "^0.1.0-alpha.4", - "@aws-amplify/client-config": "^0.2.0-alpha.12", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.11", - "@aws-amplify/form-generator": "^0.2.0-alpha.4", - "@aws-amplify/model-generator": "^0.2.0-alpha.7", - "@aws-amplify/platform-core": "^0.1.1-alpha.3", - "@aws-amplify/sandbox": "^0.2.0-alpha.18", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/cli-core": "^0.1.0", + "@aws-amplify/client-config": "^0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", + "@aws-amplify/form-generator": "^0.2.0", + "@aws-amplify/model-generator": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/sandbox": "^0.2.0", "@aws-sdk/credential-provider-ini": "^3.360.0", "@aws-sdk/credential-providers": "^3.360.0", "execa": "^7.2.0", @@ -19586,7 +19586,7 @@ }, "packages/cli-core": { "name": "@aws-amplify/cli-core", - "version": "0.1.0-alpha.4", + "version": "0.1.0", "license": "Apache-2.0", "dependencies": { "@inquirer/prompts": "^3.0.0" @@ -19694,12 +19694,12 @@ }, "packages/client-config": { "name": "@aws-amplify/client-config", - "version": "0.2.0-alpha.12", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.6", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.3", - "@aws-amplify/model-generator": "^0.2.0-alpha.5", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", + "@aws-amplify/model-generator": "^0.2.0", "@aws-sdk/client-amplify": "^3.376.0", "@aws-sdk/client-cloudformation": "^3.376.0", "@aws-sdk/client-ssm": "^3.398.0", @@ -19721,10 +19721,10 @@ } }, "packages/create-amplify": { - "version": "0.2.0-alpha.15", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/cli-core": "^0.1.0-alpha.4", + "@aws-amplify/cli-core": "^0.1.0", "execa": "^7.2.0", "yargs": "^17.7.2" }, @@ -19847,11 +19847,11 @@ }, "packages/deployed-backend-client": { "name": "@aws-amplify/deployed-backend-client", - "version": "0.2.0-alpha.11", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/platform-core": "^0.1.1-alpha.4", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", "@aws-sdk/client-amplify": "^3.414.0", "@aws-sdk/client-cloudformation": "^3.414.0", "@aws-sdk/client-s3": "^3.414.0", @@ -19861,12 +19861,12 @@ }, "packages/form-generator": { "name": "@aws-amplify/form-generator", - "version": "0.2.0-alpha.4", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { "@aws-amplify/appsync-modelgen-plugin": "^2.6.0", "@aws-amplify/codegen-ui": "^2.19.1", - "@aws-amplify/codegen-ui-react": "^2.19.1", + "@aws-amplify/codegen-ui-react": "^2.19.3", "@aws-amplify/graphql-docs-generator": "^4.1.0", "@aws-sdk/client-amplifyuibuilder": "^3.398.0", "@aws-sdk/client-appsync": "^3.398.0", @@ -19880,10 +19880,10 @@ }, "packages/function-construct": { "name": "@aws-amplify/function-construct-alpha", - "version": "0.2.0-alpha.7", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6" + "@aws-amplify/backend-output-storage": "^0.2.0" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -19892,15 +19892,15 @@ }, "packages/integration-tests": { "name": "@aws-amplify/integration-tests", - "version": "0.2.0-alpha.10", + "version": "0.2.0", "license": "Apache-2.0", "devDependencies": { "@aws-amplify/amplify-api-next-alpha": "^0.3.2", - "@aws-amplify/backend": "0.2.0-alpha.12", - "@aws-amplify/backend-auth": "0.2.0-alpha.15", - "@aws-amplify/backend-secret": "^0.2.0-alpha.5", - "@aws-amplify/backend-storage": "0.2.0-alpha.10", - "@aws-amplify/platform-core": "^0.1.1-alpha.4", + "@aws-amplify/backend": "0.2.0", + "@aws-amplify/backend-auth": "0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/backend-storage": "0.2.0", + "@aws-amplify/platform-core": "^0.1.1", "@aws-sdk/client-cloudformation": "^3.421.0", "execa": "^8.0.1", "fs-extra": "^11.1.1", @@ -19962,11 +19962,11 @@ }, "packages/model-generator": { "name": "@aws-amplify/model-generator", - "version": "0.2.0-alpha.7", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.5", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.11", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", "@aws-amplify/graphql-generator": "^0.1.3", "@aws-amplify/graphql-types-generator": "^3.4.4", "@aws-sdk/client-appsync": "^3.398.0", @@ -20230,15 +20230,15 @@ }, "packages/platform-core": { "name": "@aws-amplify/platform-core", - "version": "0.1.1-alpha.4", + "version": "0.1.1", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/plugin-types": "^0.2.0-alpha.7" + "@aws-amplify/plugin-types": "^0.2.0" } }, "packages/plugin-types": { "name": "@aws-amplify/plugin-types", - "version": "0.2.0-alpha.11", + "version": "0.2.0", "license": "Apache-2.0", "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -20247,15 +20247,15 @@ }, "packages/sandbox": { "name": "@aws-amplify/sandbox", - "version": "0.2.0-alpha.18", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-deployer": "0.2.0-alpha.11", - "@aws-amplify/backend-secret": "^0.2.0-alpha.4", - "@aws-amplify/cli-core": "^0.1.0-alpha.3", - "@aws-amplify/client-config": "0.2.0-alpha.12", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.9", - "@aws-amplify/platform-core": "^0.1.1-alpha.3", + "@aws-amplify/backend-deployer": "0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/cli-core": "^0.1.0", + "@aws-amplify/client-config": "0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", "@aws-sdk/client-cloudformation": "^3.421.0", "@aws-sdk/credential-providers": "^3.382.0", "@aws-sdk/types": "^3.378.0", @@ -20275,14 +20275,14 @@ }, "packages/storage-construct": { "name": "@aws-amplify/storage-construct-alpha", - "version": "0.2.0-alpha.11", + "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6" + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "^0.2.0" }, "devDependencies": { - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/plugin-types": "^0.2.0" }, "peerDependencies": { "aws-cdk-lib": "^2.103.0", @@ -20573,24 +20573,24 @@ "@aws-amplify/auth-construct-alpha": { "version": "file:packages/auth-construct", "requires": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "^0.2.0", + "@aws-amplify/plugin-types": "^0.2.0" } }, "@aws-amplify/backend": { "version": "file:packages/backend", "requires": { "@aws-amplify/amplify-api-next-alpha": "^0.6.2", - "@aws-amplify/backend-auth": "^0.2.0-alpha.15", - "@aws-amplify/backend-function": "^0.1.1-alpha.11", - "@aws-amplify/backend-graphql": "^0.2.0-alpha.13", - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6", - "@aws-amplify/backend-secret": "^0.2.0-alpha.5", - "@aws-amplify/backend-storage": "^0.2.0-alpha.10", - "@aws-amplify/platform-core": "^0.1.1-alpha.4", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11", + "@aws-amplify/backend-auth": "^0.2.0", + "@aws-amplify/backend-function": "^0.1.1", + "@aws-amplify/backend-graphql": "^0.2.0", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "^0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/backend-storage": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0", "@types/aws-lambda": "^8.10.119", "aws-lambda": "^1.0.7" }, @@ -20608,24 +20608,24 @@ "@aws-amplify/backend-auth": { "version": "file:packages/backend-auth", "requires": { - "@aws-amplify/auth-construct-alpha": "^0.2.0-alpha.18", - "@aws-amplify/backend-output-storage": "0.2.0-alpha.6", - "@aws-amplify/backend-platform-test-stubs": "^0.1.0", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/auth-construct-alpha": "^0.2.0", + "@aws-amplify/backend-output-storage": "0.2.0", + "@aws-amplify/backend-platform-test-stubs": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0" } }, "@aws-amplify/backend-cli": { "version": "file:packages/cli", "requires": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.7", - "@aws-amplify/backend-secret": "^0.2.0-alpha.6", - "@aws-amplify/cli-core": "^0.1.0-alpha.4", - "@aws-amplify/client-config": "^0.2.0-alpha.12", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.11", - "@aws-amplify/form-generator": "^0.2.0-alpha.4", - "@aws-amplify/model-generator": "^0.2.0-alpha.7", - "@aws-amplify/platform-core": "^0.1.1-alpha.3", - "@aws-amplify/sandbox": "^0.2.0-alpha.18", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/cli-core": "^0.1.0", + "@aws-amplify/client-config": "^0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", + "@aws-amplify/form-generator": "^0.2.0", + "@aws-amplify/model-generator": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/sandbox": "^0.2.0", "@aws-sdk/credential-provider-ini": "^3.360.0", "@aws-sdk/credential-providers": "^3.360.0", "@types/yargs": "^17.0.24", @@ -20700,8 +20700,8 @@ "@aws-amplify/backend-deployer": { "version": "file:packages/backend-deployer", "requires": { - "@aws-amplify/platform-core": "^0.1.1-alpha.3", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0", "execa": "^7.2.0", "tsx": "^3.12.6" } @@ -20709,10 +20709,10 @@ "@aws-amplify/backend-function": { "version": "file:packages/backend-function", "requires": { - "@aws-amplify/backend-output-storage": "0.2.0-alpha.6", - "@aws-amplify/backend-platform-test-stubs": "^0.1.0", - "@aws-amplify/function-construct-alpha": "^0.2.0-alpha.7", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11", + "@aws-amplify/backend-output-storage": "0.2.0", + "@aws-amplify/backend-platform-test-stubs": "^0.1.1", + "@aws-amplify/function-construct-alpha": "^0.2.0", + "@aws-amplify/plugin-types": "^0.2.0", "execa": "^7.1.1" } }, @@ -20720,24 +20720,24 @@ "version": "file:packages/backend-graphql", "requires": { "@aws-amplify/amplify-api-next-types-alpha": "^0.0.4", - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "0.2.0-alpha.6", - "@aws-amplify/backend-platform-test-stubs": "^0.1.0", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "0.2.0", + "@aws-amplify/backend-platform-test-stubs": "^0.1.1", "@aws-amplify/graphql-api-construct": "^1.1.4", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/plugin-types": "^0.2.0" } }, "@aws-amplify/backend-output-schemas": { "version": "file:packages/backend-output-schemas", "requires": { - "@aws-amplify/plugin-types": "0.2.0-alpha.11" + "@aws-amplify/plugin-types": "0.2.0" } }, "@aws-amplify/backend-output-storage": { "version": "file:packages/backend-output-storage", "requires": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/platform-core": "^0.1.1-alpha.4" + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1" } }, "@aws-amplify/backend-platform-test-stubs": { @@ -20750,8 +20750,8 @@ "@aws-amplify/backend-secret": { "version": "file:packages/backend-secret", "requires": { - "@aws-amplify/platform-core": "^0.1.1-alpha.2", - "@aws-amplify/plugin-types": "^0.2.0-alpha.9", + "@aws-amplify/platform-core": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0", "@aws-sdk/client-ssm": "^3.398.0", "@aws-sdk/types": "^3.370.0" } @@ -20759,10 +20759,10 @@ "@aws-amplify/backend-storage": { "version": "file:packages/backend-storage", "requires": { - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6", - "@aws-amplify/backend-platform-test-stubs": "^0.1.0", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11", - "@aws-amplify/storage-construct-alpha": "^0.2.0-alpha.11" + "@aws-amplify/backend-output-storage": "^0.2.0", + "@aws-amplify/backend-platform-test-stubs": "^0.1.1", + "@aws-amplify/plugin-types": "^0.2.0", + "@aws-amplify/storage-construct-alpha": "^0.2.0" } }, "@aws-amplify/cli-core": { @@ -20774,9 +20774,9 @@ "@aws-amplify/client-config": { "version": "file:packages/client-config", "requires": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.6", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.3", - "@aws-amplify/model-generator": "^0.2.0-alpha.5", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", + "@aws-amplify/model-generator": "^0.2.0", "@aws-sdk/client-amplify": "^3.376.0", "@aws-sdk/client-cloudformation": "^3.376.0", "@aws-sdk/client-ssm": "^3.398.0", @@ -20786,20 +20786,20 @@ } }, "@aws-amplify/codegen-ui": { - "version": "2.19.1", - "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui/-/codegen-ui-2.19.1.tgz", - "integrity": "sha512-tmjJr3XXWpRSiqBbBrPg+PlYRafJL8Uk48e424scMsfmlmIIJbeb/FTcwi8aB7rihvgFwe/Z4pCS5OU9gnBciQ==", + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui/-/codegen-ui-2.19.3.tgz", + "integrity": "sha512-Ny9y8QG8BrSDxRlwWoSxxaICyY0PZtvlvOKclDjz3yE6hy3AXA/hzInFA3O3zY1qJ6HQNUQ83+atzJuiBvfT+w==", "requires": { "change-case": "^4.1.2", "yup": "^0.32.11" } }, "@aws-amplify/codegen-ui-react": { - "version": "2.19.1", - "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui-react/-/codegen-ui-react-2.19.1.tgz", - "integrity": "sha512-ufnwMF7p3Qi+LiLeCsqrM43LfHWZcuJ23SheXjI9Jmv07Kqeh82k+KNukV5M4pMGJupJdHGQj5ShpV2/91Mk5A==", + "version": "2.19.3", + "resolved": "https://registry.npmjs.org/@aws-amplify/codegen-ui-react/-/codegen-ui-react-2.19.3.tgz", + "integrity": "sha512-u/XlznCqD3oXTgmSO7amK+j6nvrypyzbWmQMXSIEqFHaPPipuU4i2fDmY2fSizRn+GZWa0/+8odBBJ1oGX9dag==", "requires": { - "@aws-amplify/codegen-ui": "2.19.1", + "@aws-amplify/codegen-ui": "2.19.3", "@typescript/vfs": "~1.3.5", "pluralize": "^8.0.0", "prettier": "2.3.2", @@ -20823,8 +20823,8 @@ "@aws-amplify/deployed-backend-client": { "version": "file:packages/deployed-backend-client", "requires": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/platform-core": "^0.1.1-alpha.4", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", "@aws-sdk/client-amplify": "^3.414.0", "@aws-sdk/client-cloudformation": "^3.414.0", "@aws-sdk/client-s3": "^3.414.0", @@ -20837,7 +20837,7 @@ "requires": { "@aws-amplify/appsync-modelgen-plugin": "^2.6.0", "@aws-amplify/codegen-ui": "^2.19.1", - "@aws-amplify/codegen-ui-react": "^2.19.1", + "@aws-amplify/codegen-ui-react": "^2.19.3", "@aws-amplify/graphql-docs-generator": "^4.1.0", "@aws-sdk/client-amplifyuibuilder": "^3.398.0", "@aws-sdk/client-appsync": "^3.398.0", @@ -20852,7 +20852,7 @@ "@aws-amplify/function-construct-alpha": { "version": "file:packages/function-construct", "requires": { - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6" + "@aws-amplify/backend-output-storage": "^0.2.0" } }, "@aws-amplify/graphql-api-construct": { @@ -21592,11 +21592,11 @@ "version": "file:packages/integration-tests", "requires": { "@aws-amplify/amplify-api-next-alpha": "^0.3.2", - "@aws-amplify/backend": "0.2.0-alpha.12", - "@aws-amplify/backend-auth": "0.2.0-alpha.15", - "@aws-amplify/backend-secret": "^0.2.0-alpha.5", - "@aws-amplify/backend-storage": "0.2.0-alpha.10", - "@aws-amplify/platform-core": "^0.1.1-alpha.4", + "@aws-amplify/backend": "0.2.0", + "@aws-amplify/backend-auth": "0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/backend-storage": "0.2.0", + "@aws-amplify/platform-core": "^0.1.1", "@aws-sdk/client-cloudformation": "^3.421.0", "execa": "^8.0.1", "fs-extra": "^11.1.1", @@ -21637,8 +21637,8 @@ "@aws-amplify/model-generator": { "version": "file:packages/model-generator", "requires": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.5", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.11", + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", "@aws-amplify/graphql-generator": "^0.1.3", "@aws-amplify/graphql-types-generator": "^3.4.4", "@aws-sdk/client-appsync": "^3.398.0", @@ -21846,7 +21846,7 @@ "@aws-amplify/platform-core": { "version": "file:packages/platform-core", "requires": { - "@aws-amplify/plugin-types": "^0.2.0-alpha.7" + "@aws-amplify/plugin-types": "^0.2.0" } }, "@aws-amplify/plugin-types": { @@ -21856,12 +21856,12 @@ "@aws-amplify/sandbox": { "version": "file:packages/sandbox", "requires": { - "@aws-amplify/backend-deployer": "0.2.0-alpha.11", - "@aws-amplify/backend-secret": "^0.2.0-alpha.4", - "@aws-amplify/cli-core": "^0.1.0-alpha.3", - "@aws-amplify/client-config": "0.2.0-alpha.12", - "@aws-amplify/deployed-backend-client": "^0.2.0-alpha.9", - "@aws-amplify/platform-core": "^0.1.1-alpha.3", + "@aws-amplify/backend-deployer": "0.2.0", + "@aws-amplify/backend-secret": "^0.2.0", + "@aws-amplify/cli-core": "^0.1.0", + "@aws-amplify/client-config": "0.2.0", + "@aws-amplify/deployed-backend-client": "^0.2.0", + "@aws-amplify/platform-core": "^0.1.1", "@aws-sdk/client-cloudformation": "^3.421.0", "@aws-sdk/credential-providers": "^3.382.0", "@aws-sdk/types": "^3.378.0", @@ -21877,9 +21877,9 @@ "@aws-amplify/storage-construct-alpha": { "version": "file:packages/storage-construct", "requires": { - "@aws-amplify/backend-output-schemas": "^0.2.0-alpha.8", - "@aws-amplify/backend-output-storage": "^0.2.0-alpha.6", - "@aws-amplify/plugin-types": "^0.2.0-alpha.11" + "@aws-amplify/backend-output-schemas": "^0.2.0", + "@aws-amplify/backend-output-storage": "^0.2.0", + "@aws-amplify/plugin-types": "^0.2.0" } }, "@aws-cdk/asset-awscli-v1": { @@ -28740,7 +28740,7 @@ "create-amplify": { "version": "file:packages/create-amplify", "requires": { - "@aws-amplify/cli-core": "^0.1.0-alpha.4", + "@aws-amplify/cli-core": "^0.1.0", "execa": "^7.2.0", "yargs": "^17.7.2" }, diff --git a/packages/auth-construct/API.md b/packages/auth-construct/API.md index 72540a748c..afd6c6f0fd 100644 --- a/packages/auth-construct/API.md +++ b/packages/auth-construct/API.md @@ -30,19 +30,17 @@ export type AppleProviderProps = Omit; }; -// @public -export type BasicLoginOptions = { - email?: EmailLogin; - phone?: PhoneNumberLogin; -}; - // @public export type EmailLogin = true | EmailLoginSettings; @@ -66,11 +64,6 @@ export type ExternalProviderOptions = { logoutUrls?: string[]; }; -// @public -export type ExternalProviderProps = { - externalProviders?: ExternalProviderOptions; -}; - // @public export type FacebookProviderProps = Omit; diff --git a/packages/auth-construct/src/index.ts b/packages/auth-construct/src/index.ts index 21efbd44eb..f1416ee72d 100644 --- a/packages/auth-construct/src/index.ts +++ b/packages/auth-construct/src/index.ts @@ -1,6 +1,5 @@ export { AuthProps, - BasicLoginOptions, EmailLogin, EmailLoginSettings, GoogleProviderProps, @@ -10,7 +9,6 @@ export { OidcProviderProps, SamlProviderProps, ExternalProviderOptions, - ExternalProviderProps, MFA, MFASettings, PhoneNumberLogin, diff --git a/packages/auth-construct/src/types.ts b/packages/auth-construct/src/types.ts index 79809191d0..892160d179 100644 --- a/packages/auth-construct/src/types.ts +++ b/packages/auth-construct/src/types.ts @@ -52,26 +52,6 @@ export type PhoneNumberLogin = */ verificationMessage?: (code: string) => string; }; -/** - * Basic login options require at least email or phone number. - * Additional settings may be configured, such as email messages or sms verification messages. - */ -export type BasicLoginOptions = { - /** - * Email login options. - * - * If true, email login will be enabled with default settings. - * If settings are provided, email login will be enabled with the specified settings. - */ - email?: EmailLogin; - /** - * Phone number login options. - * - * If true, phone number login will be enabled with default settings. - * If settings are provided, phone number login will be enabled with the specified settings. - */ - phone?: PhoneNumberLogin; -}; /** * Configure the MFA types that users can use. Ignored if MFA mode is set to OFF. @@ -207,16 +187,6 @@ export type ExternalProviderOptions = { logoutUrls?: string[]; }; -/** - * External auth provider. - */ -export type ExternalProviderProps = { - /** - * Configure OAuth, OIDC, and SAML login providers - */ - externalProviders?: ExternalProviderOptions; -}; - /** * Union type of all supported auth trigger events */ @@ -227,9 +197,28 @@ export type TriggerEvent = (typeof triggerEvents)[number]; */ export type AuthProps = { /** - * Specify the allowed login mechanisms - */ - loginWith: BasicLoginOptions & ExternalProviderProps; + * Specify how you would like users to log in. You can choose from email, phone, and even external providers such as LoginWithAmazon. + */ + loginWith: { + /** + * Email login options. + * + * If true, email login will be enabled with default settings. + * If settings are provided, email login will be enabled with the specified settings. + */ + email?: EmailLogin; + /** + * Phone number login options. + * + * If true, phone number login will be enabled with default settings. + * If settings are provided, phone number login will be enabled with the specified settings. + */ + phone?: PhoneNumberLogin; + /** + * Configure OAuth, OIDC, and SAML login providers + */ + externalProviders?: ExternalProviderOptions; + }; /** * The set of attributes that are required for every user in the user pool. Read more on attributes here - https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html * @default - email/phone will be added as required user attributes if they are included as login methods diff --git a/packages/backend-auth/API.md b/packages/backend-auth/API.md index 8ff7244649..ed3ca76abe 100644 --- a/packages/backend-auth/API.md +++ b/packages/backend-auth/API.md @@ -10,10 +10,8 @@ import { AppleProviderProps } from '@aws-amplify/auth-construct-alpha'; import { AuthProps } from '@aws-amplify/auth-construct-alpha'; import { AuthResources } from '@aws-amplify/plugin-types'; import { BackendSecret } from '@aws-amplify/plugin-types'; -import { BasicLoginOptions } from '@aws-amplify/auth-construct-alpha'; import { ConstructFactory } from '@aws-amplify/plugin-types'; import { ExternalProviderOptions } from '@aws-amplify/auth-construct-alpha'; -import { ExternalProviderProps } from '@aws-amplify/auth-construct-alpha'; import { FacebookProviderProps } from '@aws-amplify/auth-construct-alpha'; import { FunctionResources } from '@aws-amplify/plugin-types'; import { GoogleProviderProps } from '@aws-amplify/auth-construct-alpha'; @@ -41,16 +39,13 @@ export type AppleProviderFactoryProps = Omit & { + externalProviders?: ExternalProviderSpecificFactoryProps; +}; // @public export const defineAuth: (props: AmplifyAuthFactoryProps) => ConstructFactory>; -// @public -export type ExternalProviderFactoryProps = Omit & { - externalProviders?: ExternalProviderSpecificFactoryProps; -}; - // @public export type ExternalProviderGeneralFactoryProps = Omit; diff --git a/packages/backend-auth/src/translate_auth_props.test.ts b/packages/backend-auth/src/translate_auth_props.test.ts index 1c0480e6ff..c91f9c67ac 100644 --- a/packages/backend-auth/src/translate_auth_props.test.ts +++ b/packages/backend-auth/src/translate_auth_props.test.ts @@ -6,11 +6,7 @@ import { import { describe, it } from 'node:test'; import { AuthLoginWithFactoryProps } from './types.js'; import { Construct } from 'constructs'; -import { - BasicLoginOptions, - ExternalProviderProps, - PhoneNumberLogin, -} from '@aws-amplify/auth-construct-alpha'; +import { AuthProps, PhoneNumberLogin } from '@aws-amplify/auth-construct-alpha'; import { SecretValue } from 'aws-cdk-lib'; import assert from 'node:assert'; import { translateToAuthConstructLoginWith } from './translate_auth_props.js'; @@ -91,7 +87,7 @@ void describe('translateToAuthConstructLoginWith', () => { backendResolver ); - const expected: BasicLoginOptions & ExternalProviderProps = { + const expected: AuthProps['loginWith'] = { phone, externalProviders: { google: { @@ -136,7 +132,7 @@ void describe('translateToAuthConstructLoginWith', () => { backendResolver ); - const expected: BasicLoginOptions & ExternalProviderProps = { + const expected: AuthProps['loginWith'] = { phone, externalProviders: { callbackUrls: callbackUrls, @@ -155,7 +151,7 @@ void describe('translateToAuthConstructLoginWith', () => { backendResolver ); - const expected: BasicLoginOptions & ExternalProviderProps = { + const expected: AuthProps['loginWith'] = { phone, }; assert.deepStrictEqual(translated, expected); diff --git a/packages/backend-auth/src/translate_auth_props.ts b/packages/backend-auth/src/translate_auth_props.ts index fa620f9f96..60da0d466b 100644 --- a/packages/backend-auth/src/translate_auth_props.ts +++ b/packages/backend-auth/src/translate_auth_props.ts @@ -1,8 +1,7 @@ import { AmazonProviderProps, AppleProviderProps, - BasicLoginOptions, - ExternalProviderProps, + AuthProps, FacebookProviderProps, GoogleProviderProps, OidcProviderProps, @@ -26,9 +25,9 @@ import { export const translateToAuthConstructLoginWith = ( authFactoryLoginWith: AuthLoginWithFactoryProps, backendSecretResolver: BackendSecretResolver -): BasicLoginOptions & ExternalProviderProps => { - const result: BasicLoginOptions & ExternalProviderProps = - authFactoryLoginWith as BasicLoginOptions; +): AuthProps['loginWith'] => { + const result: AuthProps['loginWith'] = + authFactoryLoginWith as AuthProps['loginWith']; if (!authFactoryLoginWith.externalProviders) { return result; } diff --git a/packages/backend-auth/src/types.ts b/packages/backend-auth/src/types.ts index 28d448a338..a78497149f 100644 --- a/packages/backend-auth/src/types.ts +++ b/packages/backend-auth/src/types.ts @@ -1,9 +1,8 @@ import { AmazonProviderProps, AppleProviderProps, - BasicLoginOptions, + AuthProps, ExternalProviderOptions, - ExternalProviderProps, FacebookProviderProps, GoogleProviderProps, OidcProviderProps, @@ -133,17 +132,14 @@ export type ExternalProviderSpecificFactoryProps = }; /** - * External provider properties. + * Auth factory loginWith attribute. */ -export type ExternalProviderFactoryProps = Omit< - ExternalProviderProps, +export type AuthLoginWithFactoryProps = Omit< + AuthProps['loginWith'], 'externalProviders' > & { + /** + * External provider properties. + */ externalProviders?: ExternalProviderSpecificFactoryProps; }; - -/** - * Auth factory loginWith attribute. - */ -export type AuthLoginWithFactoryProps = BasicLoginOptions & - ExternalProviderFactoryProps; diff --git a/packages/create-amplify/src/tsconfig_initializer.ts b/packages/create-amplify/src/tsconfig_initializer.ts index 5c88dc8198..0ad229653d 100644 --- a/packages/create-amplify/src/tsconfig_initializer.ts +++ b/packages/create-amplify/src/tsconfig_initializer.ts @@ -57,10 +57,14 @@ export class TsConfigInitializer { } try { - await this.execa(this.executableName, tscArgs, { - stdio: 'inherit', - cwd: this.projectRoot, - }); + await this.execa( + this.executableName === 'npm' ? 'npx' : this.executableName, + tscArgs, + { + stdio: 'inherit', + cwd: this.projectRoot, + } + ); } catch { throw new Error( `\`${ diff --git a/packages/form-generator/package.json b/packages/form-generator/package.json index 4acb7f4adb..a4d0f883ab 100644 --- a/packages/form-generator/package.json +++ b/packages/form-generator/package.json @@ -20,7 +20,7 @@ "dependencies": { "@aws-amplify/appsync-modelgen-plugin": "^2.6.0", "@aws-amplify/codegen-ui": "^2.19.1", - "@aws-amplify/codegen-ui-react": "^2.19.1", + "@aws-amplify/codegen-ui-react": "^2.19.3", "@aws-amplify/graphql-docs-generator": "^4.1.0", "@aws-sdk/client-amplifyuibuilder": "^3.398.0", "@aws-sdk/client-appsync": "^3.398.0", diff --git a/packages/form-generator/src/local_codegen_graphql_form_generator.ts b/packages/form-generator/src/local_codegen_graphql_form_generator.ts index e5b5ebd6ba..2a2d0be1b3 100644 --- a/packages/form-generator/src/local_codegen_graphql_form_generator.ts +++ b/packages/form-generator/src/local_codegen_graphql_form_generator.ts @@ -94,6 +94,7 @@ export class LocalGraphqlFormGenerator implements GraphqlFormGenerator { module: ModuleKind.ES2020, target: ScriptTarget.ES2020, script: ScriptKind.JSX, + includeUseClientDirective: true, renderTypeDeclarations: true, apiConfiguration: { dataApi: 'GraphQL', diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplify-testAppId-testBranchName.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplify-testAppId-testBranchName.template.json index e83c06b484..48586fd7b8 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplify-testAppId-testBranchName.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplify-testAppId-testBranchName.template.json @@ -181,7 +181,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/6ba9f860a2dc910090281e5a118e15a973a885091f83213d560125a18786aa31.json" + "/f0d3060f91da8f5b8062d42780fd3fba7c2b533136e30e7880ac9fc32efdf58c.json" ] ] } diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplifytestAppIdtestBranchNameauth8722F3FC.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplifytestAppIdtestBranchNameauth8722F3FC.nested.template.json index 5610568f21..177fee5559 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplifytestAppIdtestBranchNameauth8722F3FC.nested.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers/expected-cdk-out/amplifytestAppIdtestBranchNameauth8722F3FC.nested.template.json @@ -205,7 +205,7 @@ "backendId": "testAppId", "branchName": "testBranchName", "secretName": "testAmazonId", - "secretLastUpdated": 1698693218594 + "secretLastUpdated": 1698712367508 }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -222,7 +222,7 @@ "backendId": "testAppId", "branchName": "testBranchName", "secretName": "testAmazonSecret", - "secretLastUpdated": 1698693218595 + "secretLastUpdated": 1698712367509 }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -239,7 +239,7 @@ "backendId": "testAppId", "branchName": "testBranchName", "secretName": "testFacebookId", - "secretLastUpdated": 1698693218595 + "secretLastUpdated": 1698712367509 }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -256,7 +256,7 @@ "backendId": "testAppId", "branchName": "testBranchName", "secretName": "testFacebookSecret", - "secretLastUpdated": 1698693218595 + "secretLastUpdated": 1698712367509 }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -273,7 +273,7 @@ "backendId": "testAppId", "branchName": "testBranchName", "secretName": "testGoogleId", - "secretLastUpdated": 1698693218595 + "secretLastUpdated": 1698712367509 }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete" @@ -290,7 +290,7 @@ "backendId": "testAppId", "branchName": "testBranchName", "secretName": "testGoogleSecret", - "secretLastUpdated": 1698693218595 + "secretLastUpdated": 1698712367510 }, "UpdateReplacePolicy": "Delete", "DeletionPolicy": "Delete"