diff --git a/.changeset/mean-toys-repeat.md b/.changeset/mean-toys-repeat.md new file mode 100644 index 00000000000..52f3dda4894 --- /dev/null +++ b/.changeset/mean-toys-repeat.md @@ -0,0 +1,5 @@ +--- +'@aws-amplify/backend-data': minor +--- + +Added experimental option to map data resources to nested stacks diff --git a/.changeset/spicy-rules-speak.md b/.changeset/spicy-rules-speak.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/spicy-rules-speak.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/health_checks.yml b/.github/workflows/health_checks.yml index 290dc2a5ef3..75ca3cef8e5 100644 --- a/.github/workflows/health_checks.yml +++ b/.github/workflows/health_checks.yml @@ -392,7 +392,9 @@ jobs: - uses: ./.github/actions/setup_node - uses: ./.github/actions/restore_install_cache - run: git fetch origin - - run: npm run diff:check ${{ github.event.pull_request.base.sha }} + - run: npm run diff:check "$BASE_SHA" + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} check_pr_changesets: if: github.event_name == 'pull_request' && github.event.pull_request.user.login != 'github-actions[bot]' runs-on: ubuntu-latest @@ -406,9 +408,13 @@ jobs: - uses: ./.github/actions/setup_node - uses: ./.github/actions/restore_install_cache - name: Validate that PR has changeset - run: npx changeset status --since origin/${{ github.event.pull_request.base.ref }} + run: npx changeset status --since origin/"$BASE_REF" + env: + BASE_REF: ${{ github.event.pull_request.base.ref }} - name: Validate changeset is not missing packages - run: npx tsx scripts/check_changeset_completeness.ts ${{ github.event.pull_request.base.sha }} + run: npx tsx scripts/check_changeset_completeness.ts "$BASE_SHA" + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} - name: Validate that changeset has necessary dependency updates run: | npx changeset version diff --git a/packages/backend-data/API.md b/packages/backend-data/API.md index 56e54db5079..0ef98a3696f 100644 --- a/packages/backend-data/API.md +++ b/packages/backend-data/API.md @@ -30,6 +30,7 @@ export type DataProps = { name?: string; authorizationModes?: AuthorizationModes; functions?: Record>; + experimentalStackMapping?: Record; }; // @public diff --git a/packages/backend-data/src/factory.ts b/packages/backend-data/src/factory.ts index d5df45219ea..a4f36cf9723 100644 --- a/packages/backend-data/src/factory.ts +++ b/packages/backend-data/src/factory.ts @@ -239,6 +239,7 @@ class DataGenerator implements ConstructContainerEntryGenerator { authorizationModes, outputStorageStrategy: this.outputStorageStrategy, functionNameMap, + stackMappings: this.props.experimentalStackMapping, translationBehavior: { sandboxModeEnabled, /** diff --git a/packages/backend-data/src/types.ts b/packages/backend-data/src/types.ts index 031636986eb..3fabb81fdb7 100644 --- a/packages/backend-data/src/types.ts +++ b/packages/backend-data/src/types.ts @@ -139,6 +139,12 @@ export type DataProps = { * Functions invokable by the API. The specific input type of the function is subject to change or removal. */ functions?: Record>; + + /** + * ExperimentalStackMapping override the assigned nested stack on a per-resource basis. Only applies to resolvers, and takes the form + * { : } + */ + experimentalStackMapping?: Record; }; export type AmplifyDataError = diff --git a/scripts/publish_runner.ts b/scripts/publish_runner.ts index 933f2229162..c49e0fb98ef 100644 --- a/scripts/publish_runner.ts +++ b/scripts/publish_runner.ts @@ -1,6 +1,8 @@ import { Options, execa } from 'execa'; import { runVersion } from './version_runner.js'; import { NpmClient } from './components/npm_client.js'; +import fs from 'fs'; +import path from 'path'; export type PublishOptions = { /** @@ -52,9 +54,10 @@ export const runPublish = async (props?: PublishOptions, cwd?: string) => { } if (options.snapshotRelease) { - // Snapshot releases are not allowed in pre mode. - // Exit pre mode. This is no-op if not in pre mode. - await execa('changeset', ['pre', 'exit'], execaOptions); + if (fs.existsSync(path.join('.changeset', 'pre.json'))) { + // Snapshot releases are not allowed in pre mode. + await execa('changeset', ['pre', 'exit'], execaOptions); + } await runVersion(['--snapshot', snapshotTag], cwd); }