declapract-typescript-ehmpathy 0.49.14 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.test/assets/cicd-common/declarations/declapract.declare.yml +8 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.declapract.integration.test.ts +597 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/.test.yml +19 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/consumer-owned.yml +21 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/review.yml +26 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/declapract.use.yml +6 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/package.json +4 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/.declapract.integration.test.ts.snap +604 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/declastruct-insync-grep.declapract.integration.test.ts.snap +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/report-slow-tests.play.declapract.integration.test.ts.snap +28 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/has-changelog-file/changelog.md.declapract.ts +11 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci-on-commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci_on_commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/pr-release-on-main.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test-on-commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test_on_commit.yml.declapract.ts +3 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-use-apikeys/.agent/repo=.this/role=any/skills/use.apikeys.json.declapract.ts +7 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-use-apikeys/.agent/repo=.this/role=any/skills/use.apikeys.sh.declapract.ts +7 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/please-release/action.yml +469 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/test-shards-setup/action.yml +68 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.declastruct.yml +218 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.install.yml +56 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml +434 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml.declapract.ts +26 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/release.yml +32 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/report-slow-tests.sh +65 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/review.yml +26 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml +25 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml.declapract.ts +15 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/declastruct-insync-grep.declapract.integration.test.ts +49 -0
- package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/report-slow-tests.play.declapract.integration.test.ts +161 -0
- package/dist/.test/assets/cicd-common/declarations/useCases.yml +11 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/package.json +5 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
- package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/.declapract.integration.test.ts +15 -21
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.declapract.integration.test.ts +2 -2
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/expo-migration/declarations/practices/git/.declapract.integration.test.ts +2 -2
- package/dist/.test/assets/expo-migration/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
- package/dist/.test/assets/expo-migration/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
- package/dist/.test/assets/expo-migration/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
- package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
- package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/expo-migration/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/git/declarations/declapract.declare.yml +8 -0
- package/dist/.test/assets/git/declarations/practices/git/.declapract.integration.test.ts +1001 -0
- package/dist/.test/assets/git/declarations/practices/git/.gitattributes.declapract.integration.test.ts +120 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/.gitattributes +6 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +7 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/declapract.use.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +55 -0
- package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +24 -0
- package/dist/.test/assets/git/declarations/practices/git/best-practice/.declapract.readme.md +60 -0
- package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitattributes.declapract.ts +77 -0
- package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitignore.declapract.ts +100 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.declapract.integration.test.ts +181 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.use.yml +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/package.json +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/useCases.yml +8 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/__snapshots__/.declapract.integration.test.ts.snap +234 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/codegen.dynamodb.dao.ts +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/provision/docker/integration-test-db/docker-compose.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.declapract.integration.test.ts +237 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +159 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declapract.use.yml +20 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declarations/declapract.declare.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/codegen.sql.dao.yml +20 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/provision/docker/testdb/build-image.dockerfile +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.use.yml +21 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/provision/schema/sql/init/.extensions.sql +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +77 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/config-validates-schema.declapract.integration.test.ts.snap +500 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/database-wrappers-typecheck.declapract.integration.test.ts.snap +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/engine-upgrade.declapract.integration.test.ts.snap +151 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/ssm-param-names.declapract.integration.test.ts.snap +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/with-connection-in-input.declapract.integration.test.ts.snap +57 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.integration.test.ts +71 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.readme.md +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/provision/schema/sql/init.yml +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/__snapshots__/.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/provision/schema/<star><star>/<star>.yml.declapract.ts +68 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/.declapract.readme.md +5 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/database.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/extensions.sql.declapract.ts +13 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/schema.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.cicd.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.datalakedb.sql.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-config-file-names/codegen.sql.yml.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +23 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.integration.test.ts +221 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.readme.md +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/access/daos/daoSurfer.ts +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/domain.operations/getSurfLesson.ts +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/utils/database/getDatabaseConnection.integration.test.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/utils/database/getDatabaseConnection.ts +68 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.3a193e5.ts +65 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.66284e3.ts +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.68cf8ba.ts +90 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.9e1bdc4.ts +65 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.c6cef7e.ts +68 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.c8eb35b.ts +90 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.d1e8cd7.ts +31 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.e0c53d8.ts +90 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.eab15c0.ts +89 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.ef25ae0.ts +32 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.integration.test.66284e3.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/__snapshots__/.declapract.integration.test.ts.snap +75 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/<star><star>/<star>.ts.declapract.ts +33 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/utils/database/getDatabaseConnection.integration.test.ts.declapract.ts +43 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/utils/database/getDatabaseConnection.ts.declapract.ts +51 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/provision/docker/integration_test_db/<star><star>/<star>.declapract.ts +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/provision/docker/integration-test-db/<star><star>/<star>.declapract.ts +15 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json +8 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +22 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-param-placeholder/config/<star>.json.declapract.ts +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.integration.test.ts +86 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.readme.md +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/declapract.use.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/src/access/sdks/sdkWaveArchive.ts +7 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/src/utils/database/getSurfReportConnection.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/__snapshots__/.declapract.integration.test.ts.snap +72 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/src/<star><star>/<star>.ts.declapract.ts +32 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +12 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +13 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.declapract.integration.test.ts +95 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.use.yml +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/provision/aws/product/parameter-store.tf +32 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/__snapshots__/.declapract.integration.test.ts.snap +60 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/provision/aws/product/parameter-store.tf.declapract.ts +94 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.declapract.readme.md +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/declapract.use.yml +2 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/src/domain.operations/findSurferById.ts +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/src/utils/database/withDatabaseConnection.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/src/<star><star>/<star>.ts.declapract.ts +55 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +114 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +18 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml.declapract.ts +35 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.schema.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.types.yml +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json +40 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json +40 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json +37 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json +36 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/readme.md +113 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +60 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.ts +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile +7 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile.declapract.ts +37 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.integration.test.ts +115 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.sh +165 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/compose.sh +43 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/docker-compose.yml +19 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/.gitignore +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/readme.md +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +25 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/connection.config.js +36 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/control.yml +7 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +97 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.database.sql +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +46 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.schema.sql +11 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.cicd.sql +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.datalakedb.sql +12 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/default_transaction_isolation.sql +6 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/user.service.sql +16 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbIdentity.ts +52 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbPort.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +77 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.test.ts +82 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.ts +52 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/databaseClientTimeouts.ts +14 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts +10 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts +119 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabasePort.ts +30 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.test.ts +51 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.ts +86 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +54 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +35 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/config-validates-schema.declapract.integration.test.ts +332 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-client.declapract.integration.test.ts +291 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-wrappers-typecheck.declapract.integration.test.ts +225 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/engine-upgrade.declapract.integration.test.ts +243 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/ssm-param-names.declapract.integration.test.ts +154 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-per-worktree.declapract.integration.test.ts +332 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
- package/dist/.test/assets/git/declarations/practices/persist-with-rds/with-connection-in-input.declapract.integration.test.ts +97 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/.agent/keyrack.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.node.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/declapract.use.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/package.json +22 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +46 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +33 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/keyrack-yml-findsert.declapract.integration.test.ts.snap +28 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/self-link-build-order.declapract.integration.test.ts.snap +81 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/.declapract.readme.md +11 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/rhachet.use.ts.declapract.ts +12 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +59 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.declare.yml +4 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.use.yml +2 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json +5 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +88 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/<star><star>/<star>peer-review<star>.md.declapract.ts +16 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/peer/<star><star>/<star>.md.declapract.ts +16 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/keyrack.yml.declapract.ts +143 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +22 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +189 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.declapract.readme.md +40 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +94 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json +19 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json.declapract.ts +51 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +91 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +149 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/keyrack-yml-findsert.declapract.integration.test.ts +105 -0
- package/dist/.test/assets/git/declarations/practices/rhachet/self-link-build-order.declapract.integration.test.ts +88 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/blackbox/lambdas/consumeSESEmailEventFromSNS.acceptance.test.ts +23 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/declapract.use.yml +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/livedb-wake-branches.declapract.integration.test.ts.snap +6 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/old-acceptance-test-utils.declapract.integration.test.ts.snap +162 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/test-kind-seam.declapract.integration.test.ts.snap +9 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +111 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.integration.test.ts +69 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.readme.md +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.test/assets/demo-repo-with-stale-test-fns-dep/declapract.use.yml +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.test/assets/demo-repo-with-stale-test-fns-dep/package.json +11 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/__snapshots__/.declapract.integration.test.ts.snap +43 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/package.json.declapract.ts +81 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/.declapract.readme.md +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/jest.<star>.js.declapract.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/.declapract.readme.md +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.js +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.integration.test.ts +83 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.readme.md +22 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/.test/assets/.agent/config.yml +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/.test/assets/.rhachet/manifest.json +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/somefile.ts +1 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/declapract.use.yml +6 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/package.json +4 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/accept.blackbox/<star><star>/<star>.declapract.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/acceptance/<star><star>/<star>.declapract.ts +19 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +31 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/<star><star>/<star>.ts.declapract.ts +25 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/getDataFromLastOpenBracketAtStartOfLine.ts.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/invokeLambda.ts.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +49 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-2/blackbox/lambdas/<star>.ts.declapract.ts +27 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/_utils/environment.ts.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/lambdas/<star>.ts.declapract.ts +23 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/.declapract.readme.md +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.acceptance.ts.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.integration.ts.declapract.ts +11 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/.declapract.readme.md +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/<star>.ts.declapract.ts +27 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/__test_assets__/<star><star>/<star>.declapract.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/__test_utils__/<star><star>/<star>.declapract.ts +17 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.readme.md +52 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.todo.md +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json +18 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json.declapract.ts +3 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/.test/useWakeOfLivedb.ts +209 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.integration.test.ts.declapract.ts +8 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.test.ts.declapract.ts +7 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/build-ifstale.declapract.integration.test.ts +124 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/livedb-wake-branches.declapract.integration.test.ts +315 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/old-acceptance-test-utils.declapract.integration.test.ts +122 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/package.json.shell-flags.declapract.integration.test.ts +139 -0
- package/dist/.test/assets/git/declarations/practices/tests-any/test-kind-seam.declapract.integration.test.ts +87 -0
- package/dist/.test/assets/git/declarations/useCases.yml +29 -0
- package/dist/.test/assets/{expo-fullusecase/declarations/practices/git/best-practice → git/repo-with-all-gitattributes-declarers}/.gitattributes +3 -0
- package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/declapract.use.yml +26 -0
- package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/package.json +4 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/.test/assets/pnpm/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/__snapshots__/gitattributesDeclarers.declapract.integration.test.ts.snap +79 -0
- package/dist/__snapshots__/repoSkills.declapract.acceptance.test.ts.snap +512 -0
- package/dist/__snapshots__/typecheckBestPracticeTemplates.declapract.integration.test.ts.snap +80 -0
- package/dist/gitattributesDeclarers.declapract.integration.test.ts +438 -0
- package/dist/practiceOwnerPerFile.declapract.integration.test.ts +53 -0
- package/dist/practices/cicd-common/.declapract.integration.test.ts +15 -21
- package/dist/practices/git/.declapract.integration.test.ts +2 -2
- package/dist/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
- package/dist/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
- package/dist/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
- package/dist/practices/git/best-practice/.declapract.readme.md +37 -0
- package/dist/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
- package/dist/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
- package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
- package/dist/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
- package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
- package/dist/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
- package/dist/practices/persist-with-rds/best-practice/package.json +5 -0
- package/dist/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
- package/dist/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
- package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
- package/dist/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
- package/dist/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
- package/dist/practices/rhachet/best-practice/.declapract.readme.md +8 -0
- package/dist/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
- package/dist/practices/tests-any/best-practice/.declapract.readme.md +7 -0
- package/dist/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
- package/dist/repoSkills.declapract.acceptance.test.ts +1150 -0
- package/dist/typecheckBestPracticeTemplates.declapract.integration.test.ts +181 -19
- package/dist/utils/defineExpectedGitattributesContents.ts +247 -0
- package/package.json +6 -6
- package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes +0 -7
- package/dist/practices/git/best-practice/.gitattributes +0 -7
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { executeApply } from 'declapract';
|
|
5
|
+
import { genTempDir, given, then, useBeforeAll, useThen, when } from 'test-fns';
|
|
6
|
+
|
|
7
|
+
import { DYNAMODB_INSERTS as JEST_INSERTS } from '../tests-node/best-practice/jest.integration.env.ts.declapract';
|
|
8
|
+
import { DYNAMODB_INSERTS as TF_INSERTS } from '../terraform-aws/best-practice/provision/aws/environments/test/main.tf.declapract';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* .what = end-to-end proof that a persist-with-dynamodb service still gets its local dynamodb
|
|
12
|
+
* endpoint, now that tests-node and terraform-aws are the one owner of each file (#630)
|
|
13
|
+
* .why = persist-with-dynamodb once redeclared `jest.integration.env.ts` and the test `main.tf`
|
|
14
|
+
* beside their owners. the two declarations fought, so each apply left one file manual or
|
|
15
|
+
* rewrote it. the dynamodb delta now rides on each owner as a usecase-aware findsert insert;
|
|
16
|
+
* this clamp proves the REAL apply pipeline delivers it, keeps it under a narrow scope, and
|
|
17
|
+
* converges on a second apply.
|
|
18
|
+
* .teeth = swap `'persist-with-dynamodb'` in `jest.integration.env.ts.declapract.ts` for any other
|
|
19
|
+
* name and case1 reddens: the env is written without the endpoint line.
|
|
20
|
+
* .note = applies scope by `file` only, never `practice`: a `practice` filter makes
|
|
21
|
+
* `projectPractices` hold just that practice, so the dynamodb branch would go dark
|
|
22
|
+
* (rule.require.declapract-integration-tests, gotchas).
|
|
23
|
+
* .note = the fixture declares a local three-practice usecase (the two owners plus
|
|
24
|
+
* persist-with-dynamodb), so a `file`-scoped apply evaluates three practices, not dozens.
|
|
25
|
+
*/
|
|
26
|
+
// a `file`-scoped apply evaluates every practice of the usecase, so one apply can outlast the
|
|
27
|
+
// default 90s under a busy host
|
|
28
|
+
jest.setTimeout(15 * 60 * 1000);
|
|
29
|
+
|
|
30
|
+
const FIXTURE =
|
|
31
|
+
'./src/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb';
|
|
32
|
+
const JEST_ENV = 'jest.integration.env.ts';
|
|
33
|
+
const TF_TEST = 'provision/aws/environments/test/main.tf';
|
|
34
|
+
const ENDPOINT_LINE =
|
|
35
|
+
"process.env.USE_CUSTOM_DYNAMODB_ENDPOINT = 'http://localhost:7337';";
|
|
36
|
+
const TEMPLATE_JEST_ENV = path.join(
|
|
37
|
+
__dirname,
|
|
38
|
+
'../tests-node/best-practice',
|
|
39
|
+
JEST_ENV,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const genRepo = (slug: string) =>
|
|
43
|
+
genTempDir({ slug, clone: FIXTURE, symlink: [{ at: 'declarations', to: 'src' }] });
|
|
44
|
+
const read = (root: string, rel: string) =>
|
|
45
|
+
fs.readFile(path.join(root, rel), 'utf-8');
|
|
46
|
+
const apply = (root: string, input: { file: string; practice?: string }) =>
|
|
47
|
+
executeApply({ config: path.join(root, 'declapract.use.yml'), ...input });
|
|
48
|
+
const strip = (contents: string, inserts: { text: string }[]) =>
|
|
49
|
+
inserts.reduce((text, insert) => text.split(insert.text).join(''), contents);
|
|
50
|
+
|
|
51
|
+
describe('persist-with-dynamodb — local dynamodb endpoint via the usecase-aware owners (#630)', () => {
|
|
52
|
+
given('[case1] a dynamodb service with neither file yet', () => {
|
|
53
|
+
const root = genRepo('declapract-dynamodb-endpoint-absent');
|
|
54
|
+
|
|
55
|
+
when('[t0] the jest integration env is applied', () => {
|
|
56
|
+
useThen('apply the env', async () => apply(root, { file: JEST_ENV }));
|
|
57
|
+
|
|
58
|
+
then('the env sets the local dynamodb endpoint, under the test access', async () => {
|
|
59
|
+
const after = await read(root, JEST_ENV);
|
|
60
|
+
expect(after).toContain(ENDPOINT_LINE);
|
|
61
|
+
expect(after).toContain("if (access === 'test')");
|
|
62
|
+
expect(after).toContain("import { access } from './src/utils/environment';");
|
|
63
|
+
expect(after).toMatchSnapshot('jest.integration.env.ts — after');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
then('the rest of the env is the tests-node template, byte for byte', async () => {
|
|
67
|
+
const after = await read(root, JEST_ENV);
|
|
68
|
+
const template = await fs.readFile(TEMPLATE_JEST_ENV, 'utf-8');
|
|
69
|
+
expect(strip(after, JEST_INSERTS)).toEqual(template);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
when('[t1] the test environment main.tf is applied', () => {
|
|
74
|
+
useThen('apply the main.tf', async () => apply(root, { file: TF_TEST }));
|
|
75
|
+
|
|
76
|
+
then('the aws provider points dynamodb at the local container', async () => {
|
|
77
|
+
const after = await read(root, TF_TEST);
|
|
78
|
+
expect(after).toContain('dynamodb = "http://localhost:7337/"');
|
|
79
|
+
expect(after).toMatch(/provider "aws" \{\n {2}endpoints \{/);
|
|
80
|
+
expect(after).not.toContain('@declapract{');
|
|
81
|
+
expect(after).toMatchSnapshot('test/main.tf — after');
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
when('[t2] both files are applied a second time (idempotency)', () => {
|
|
86
|
+
const passes = useThen('a second apply over its own output', async () => {
|
|
87
|
+
const before = {
|
|
88
|
+
env: await read(root, JEST_ENV),
|
|
89
|
+
tf: await read(root, TF_TEST),
|
|
90
|
+
};
|
|
91
|
+
await apply(root, { file: JEST_ENV });
|
|
92
|
+
await apply(root, { file: TF_TEST });
|
|
93
|
+
return {
|
|
94
|
+
before,
|
|
95
|
+
after: { env: await read(root, JEST_ENV), tf: await read(root, TF_TEST) },
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
then('the second apply is a no-op', () => {
|
|
100
|
+
expect(passes.after).toEqual(passes.before);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
given('[case2] a dynamodb service whose env is the plain tests-node template', () => {
|
|
106
|
+
const root = genRepo('declapract-dynamodb-endpoint-union');
|
|
107
|
+
const scene = useBeforeAll(async () => {
|
|
108
|
+
const template = await fs.readFile(TEMPLATE_JEST_ENV, 'utf-8');
|
|
109
|
+
await fs.writeFile(path.join(root, JEST_ENV), template);
|
|
110
|
+
return { template };
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
when('[t0] the env is applied', () => {
|
|
114
|
+
useThen('apply the env', async () => apply(root, { file: JEST_ENV }));
|
|
115
|
+
|
|
116
|
+
then('the endpoint is unioned in and the base stays intact', async () => {
|
|
117
|
+
const after = await read(root, JEST_ENV);
|
|
118
|
+
expect(scene.template).not.toContain(ENDPOINT_LINE);
|
|
119
|
+
expect(after).toContain(ENDPOINT_LINE);
|
|
120
|
+
expect(strip(after, JEST_INSERTS)).toEqual(scene.template);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
when('[t1] a narrow apply scoped to tests-node alone runs over it', () => {
|
|
125
|
+
const passes = useThen('a narrow-scope apply', async () => {
|
|
126
|
+
const before = await read(root, JEST_ENV);
|
|
127
|
+
await apply(root, { file: JEST_ENV, practice: 'tests-node' });
|
|
128
|
+
return { before, after: await read(root, JEST_ENV) };
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
then('the dynamodb lines are kept, never stripped', () => {
|
|
132
|
+
expect(passes.after).toContain(ENDPOINT_LINE);
|
|
133
|
+
expect(passes.after).toEqual(passes.before);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
given('[case4] a dynamodb service whose endpoint line drifted to another port', () => {
|
|
139
|
+
// the drift the prior owner repaired: the base strips clean only with the canonical insert,
|
|
140
|
+
// so a drifted endpoint makes the base differ, and the findsert rewrites from the template
|
|
141
|
+
const root = genRepo('declapract-dynamodb-endpoint-drift');
|
|
142
|
+
const scene = useBeforeAll(async () => {
|
|
143
|
+
const template = await fs.readFile(TEMPLATE_JEST_ENV, 'utf-8');
|
|
144
|
+
const canonical = JEST_INSERTS.reduce((text, insert) => {
|
|
145
|
+
const end = text.indexOf(insert.after) + insert.after.length;
|
|
146
|
+
return `${text.slice(0, end)}${insert.text}${text.slice(end)}`;
|
|
147
|
+
}, template);
|
|
148
|
+
const before = canonical.replace('localhost:7337', 'localhost:9999');
|
|
149
|
+
await fs.writeFile(path.join(root, JEST_ENV), before);
|
|
150
|
+
return { template, before };
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
when('[t0] the env is applied', () => {
|
|
154
|
+
const result = useThen('apply the env', async () => {
|
|
155
|
+
await apply(root, { file: JEST_ENV });
|
|
156
|
+
return { after: await read(root, JEST_ENV) };
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
then('the drifted port is repaired to the local container', () => {
|
|
160
|
+
expect(scene.before).toContain('localhost:9999');
|
|
161
|
+
expect(result.after).not.toContain('9999');
|
|
162
|
+
expect(result.after).toContain(ENDPOINT_LINE);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
then('the rest of the env is the tests-node template, byte for byte', () => {
|
|
166
|
+
expect(strip(result.after, JEST_INSERTS)).toEqual(scene.template);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
then('before + after match snapshot', () => {
|
|
170
|
+
expect(scene.before).toMatchSnapshot('jest.integration.env.ts — drifted, before');
|
|
171
|
+
expect(result.after).toMatchSnapshot('jest.integration.env.ts — drifted, after');
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
given('[case3] the terraform insert, against its own declaration', () => {
|
|
177
|
+
then('the insert sits inside the aws provider block', () => {
|
|
178
|
+
expect(TF_INSERTS[0]!.after).toEqual('provider "aws" {');
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declarations: './'
|
|
2
|
+
useCase: dynamodb-owners
|
|
3
|
+
variables:
|
|
4
|
+
organizationName: 'test-org'
|
|
5
|
+
projectName: 'test-project'
|
|
6
|
+
infrastructureNamespaceId: 'testns'
|
|
7
|
+
databaseName: 'testdb'
|
|
8
|
+
slackWebhookUrl: 'https://hooks.slack.test/webhook'
|
|
9
|
+
awsAccountId:
|
|
10
|
+
prep: '123456789012'
|
|
11
|
+
prod: '123456789012'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "name": "test-project", "version": "1.0.0" }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# a minimal usecase: the two owners of the dynamodb inserts, plus the practice that signals them.
|
|
2
|
+
# the full lambda-service-with-dynamodb usecase evaluates dozens of practices per apply.
|
|
3
|
+
use-cases:
|
|
4
|
+
dynamodb-owners:
|
|
5
|
+
practices:
|
|
6
|
+
- tests-node
|
|
7
|
+
- terraform-aws
|
|
8
|
+
- persist-with-dynamodb
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
|
+
|
|
3
|
+
exports[`persist-with-dynamodb — local dynamodb endpoint via the usecase-aware owners (#630) given: [case1] a dynamodb service with neither file yet when: [t0] the jest integration env is applied then: the env sets the local dynamodb endpoint, under the test access: jest.integration.env.ts — after 1`] = `
|
|
4
|
+
"import { existsSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import util from 'node:util';
|
|
7
|
+
|
|
8
|
+
import { jest } from '@jest/globals';
|
|
9
|
+
import { ConstraintError } from 'helpful-errors';
|
|
10
|
+
|
|
11
|
+
import { useTestdbPortOverride } from './src/.test/assets/database/useTestdbPortOverride';
|
|
12
|
+
import { useWakeOfTestdb } from './src/.test/useWakeOfTestdb';
|
|
13
|
+
import { access } from './src/utils/environment';
|
|
14
|
+
|
|
15
|
+
jest.setTimeout(90000); // since we're calling downstream apis
|
|
16
|
+
|
|
17
|
+
// set console.log to not truncate nested objects
|
|
18
|
+
util.inspect.defaultOptions.depth = 5;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* .what = verify that we're running from a valid project directory; otherwise, fail fast
|
|
22
|
+
* .why = prevent confusion and hard-to-debug errors from running tests in the wrong directory
|
|
23
|
+
*/
|
|
24
|
+
if (!existsSync(join(process.cwd(), 'package.json')))
|
|
25
|
+
throw new ConstraintError(
|
|
26
|
+
'no package.json found in cwd — run the integration suite from the git root',
|
|
27
|
+
{ cwd: process.cwd() },
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* sanity check that unit tests are only run the 'test' environment
|
|
32
|
+
*
|
|
33
|
+
* usecases
|
|
34
|
+
* - prevent polluting prod state with test data
|
|
35
|
+
* - prevent executing financially impacting mutations
|
|
36
|
+
*/
|
|
37
|
+
if (
|
|
38
|
+
(process.env.NODE_ENV !== 'test' ||
|
|
39
|
+
(process.env.CONFIG && process.env.CONFIG !== 'test')) &&
|
|
40
|
+
process.env.I_KNOW_THE_RISKS !== 'true'
|
|
41
|
+
)
|
|
42
|
+
throw new ConstraintError(
|
|
43
|
+
\`integration.test config must be 'test' — set NODE_ENV=test and CONFIG=test (or I_KNOW_THE_RISKS=true to override)\`,
|
|
44
|
+
{ nodeEnv: process.env.NODE_ENV ?? null, config: process.env.CONFIG ?? null },
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* .what = declare this checkout's testdb port as TESTDB_PORT, before any test opens a connection.
|
|
49
|
+
* .why = a worktree's testdb binds a port of its own; the app dials TESTDB_PORT under test access,
|
|
50
|
+
* so a worktree's suite reaches its own db, never another checkout's.
|
|
51
|
+
*/
|
|
52
|
+
useTestdbPortOverride();
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* .what = preflight the LOCAL testdb when this service declares its own db (databaseUserName).
|
|
56
|
+
* .why = prevent time wasted on a suite that fails deep in a query because the local testdb was never
|
|
57
|
+
* provisioned, or was provisioned for a different repo; useWakeOfTestdb fails loud and names
|
|
58
|
+
* the fix. it is the LOCAL own-db half; the shared prep cluster its peers query is woken by
|
|
59
|
+
* useWakeOfLivedb in globalSetup, since both test and prep access reach the prep peers.
|
|
60
|
+
*/
|
|
61
|
+
useWakeOfTestdb();
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* .what = point dynamodb at the local dynamodb container, under the test access
|
|
65
|
+
* .why = a dynamodb suite must never reach a live table
|
|
66
|
+
*/
|
|
67
|
+
if (access === 'test')
|
|
68
|
+
process.env.USE_CUSTOM_DYNAMODB_ENDPOINT = 'http://localhost:7337';
|
|
69
|
+
"
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
exports[`persist-with-dynamodb — local dynamodb endpoint via the usecase-aware owners (#630) given: [case1] a dynamodb service with neither file yet when: [t1] the test environment main.tf is applied then: the aws provider points dynamodb at the local container: test/main.tf — after 1`] = `
|
|
73
|
+
"provider "aws" {
|
|
74
|
+
endpoints {
|
|
75
|
+
dynamodb = "http://localhost:7337/" # the test environment tables live in the local dynamodb
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
region = "us-east-1"
|
|
79
|
+
allowed_account_ids = ["123456789012"] # \`test\` environment resources are provisioned in the \`prep\` aws account
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
terraform {
|
|
83
|
+
backend "s3" {
|
|
84
|
+
bucket = "terraform-state-testns-test"
|
|
85
|
+
key = "test-project-test"
|
|
86
|
+
region = "us-east-1"
|
|
87
|
+
encrypt = true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
module "product" {
|
|
92
|
+
source = "../../product"
|
|
93
|
+
environment = "test"
|
|
94
|
+
}
|
|
95
|
+
"
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
exports[`persist-with-dynamodb — local dynamodb endpoint via the usecase-aware owners (#630) given: [case4] a dynamodb service whose endpoint line drifted to another port when: [t0] the env is applied then: before + after match snapshot: jest.integration.env.ts — drifted, after 1`] = `
|
|
99
|
+
"import { existsSync } from 'node:fs';
|
|
100
|
+
import { join } from 'node:path';
|
|
101
|
+
import util from 'node:util';
|
|
102
|
+
|
|
103
|
+
import { jest } from '@jest/globals';
|
|
104
|
+
import { ConstraintError } from 'helpful-errors';
|
|
105
|
+
|
|
106
|
+
import { useTestdbPortOverride } from './src/.test/assets/database/useTestdbPortOverride';
|
|
107
|
+
import { useWakeOfTestdb } from './src/.test/useWakeOfTestdb';
|
|
108
|
+
import { access } from './src/utils/environment';
|
|
109
|
+
|
|
110
|
+
jest.setTimeout(90000); // since we're calling downstream apis
|
|
111
|
+
|
|
112
|
+
// set console.log to not truncate nested objects
|
|
113
|
+
util.inspect.defaultOptions.depth = 5;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* .what = verify that we're running from a valid project directory; otherwise, fail fast
|
|
117
|
+
* .why = prevent confusion and hard-to-debug errors from running tests in the wrong directory
|
|
118
|
+
*/
|
|
119
|
+
if (!existsSync(join(process.cwd(), 'package.json')))
|
|
120
|
+
throw new ConstraintError(
|
|
121
|
+
'no package.json found in cwd — run the integration suite from the git root',
|
|
122
|
+
{ cwd: process.cwd() },
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* sanity check that unit tests are only run the 'test' environment
|
|
127
|
+
*
|
|
128
|
+
* usecases
|
|
129
|
+
* - prevent polluting prod state with test data
|
|
130
|
+
* - prevent executing financially impacting mutations
|
|
131
|
+
*/
|
|
132
|
+
if (
|
|
133
|
+
(process.env.NODE_ENV !== 'test' ||
|
|
134
|
+
(process.env.CONFIG && process.env.CONFIG !== 'test')) &&
|
|
135
|
+
process.env.I_KNOW_THE_RISKS !== 'true'
|
|
136
|
+
)
|
|
137
|
+
throw new ConstraintError(
|
|
138
|
+
\`integration.test config must be 'test' — set NODE_ENV=test and CONFIG=test (or I_KNOW_THE_RISKS=true to override)\`,
|
|
139
|
+
{ nodeEnv: process.env.NODE_ENV ?? null, config: process.env.CONFIG ?? null },
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* .what = declare this checkout's testdb port as TESTDB_PORT, before any test opens a connection.
|
|
144
|
+
* .why = a worktree's testdb binds a port of its own; the app dials TESTDB_PORT under test access,
|
|
145
|
+
* so a worktree's suite reaches its own db, never another checkout's.
|
|
146
|
+
*/
|
|
147
|
+
useTestdbPortOverride();
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* .what = preflight the LOCAL testdb when this service declares its own db (databaseUserName).
|
|
151
|
+
* .why = prevent time wasted on a suite that fails deep in a query because the local testdb was never
|
|
152
|
+
* provisioned, or was provisioned for a different repo; useWakeOfTestdb fails loud and names
|
|
153
|
+
* the fix. it is the LOCAL own-db half; the shared prep cluster its peers query is woken by
|
|
154
|
+
* useWakeOfLivedb in globalSetup, since both test and prep access reach the prep peers.
|
|
155
|
+
*/
|
|
156
|
+
useWakeOfTestdb();
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* .what = point dynamodb at the local dynamodb container, under the test access
|
|
160
|
+
* .why = a dynamodb suite must never reach a live table
|
|
161
|
+
*/
|
|
162
|
+
if (access === 'test')
|
|
163
|
+
process.env.USE_CUSTOM_DYNAMODB_ENDPOINT = 'http://localhost:7337';
|
|
164
|
+
"
|
|
165
|
+
`;
|
|
166
|
+
|
|
167
|
+
exports[`persist-with-dynamodb — local dynamodb endpoint via the usecase-aware owners (#630) given: [case4] a dynamodb service whose endpoint line drifted to another port when: [t0] the env is applied then: before + after match snapshot: jest.integration.env.ts — drifted, before 1`] = `
|
|
168
|
+
"import { existsSync } from 'node:fs';
|
|
169
|
+
import { join } from 'node:path';
|
|
170
|
+
import util from 'node:util';
|
|
171
|
+
|
|
172
|
+
import { jest } from '@jest/globals';
|
|
173
|
+
import { ConstraintError } from 'helpful-errors';
|
|
174
|
+
|
|
175
|
+
import { useTestdbPortOverride } from './src/.test/assets/database/useTestdbPortOverride';
|
|
176
|
+
import { useWakeOfTestdb } from './src/.test/useWakeOfTestdb';
|
|
177
|
+
import { access } from './src/utils/environment';
|
|
178
|
+
|
|
179
|
+
jest.setTimeout(90000); // since we're calling downstream apis
|
|
180
|
+
|
|
181
|
+
// set console.log to not truncate nested objects
|
|
182
|
+
util.inspect.defaultOptions.depth = 5;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* .what = verify that we're running from a valid project directory; otherwise, fail fast
|
|
186
|
+
* .why = prevent confusion and hard-to-debug errors from running tests in the wrong directory
|
|
187
|
+
*/
|
|
188
|
+
if (!existsSync(join(process.cwd(), 'package.json')))
|
|
189
|
+
throw new ConstraintError(
|
|
190
|
+
'no package.json found in cwd — run the integration suite from the git root',
|
|
191
|
+
{ cwd: process.cwd() },
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* sanity check that unit tests are only run the 'test' environment
|
|
196
|
+
*
|
|
197
|
+
* usecases
|
|
198
|
+
* - prevent polluting prod state with test data
|
|
199
|
+
* - prevent executing financially impacting mutations
|
|
200
|
+
*/
|
|
201
|
+
if (
|
|
202
|
+
(process.env.NODE_ENV !== 'test' ||
|
|
203
|
+
(process.env.CONFIG && process.env.CONFIG !== 'test')) &&
|
|
204
|
+
process.env.I_KNOW_THE_RISKS !== 'true'
|
|
205
|
+
)
|
|
206
|
+
throw new ConstraintError(
|
|
207
|
+
\`integration.test config must be 'test' — set NODE_ENV=test and CONFIG=test (or I_KNOW_THE_RISKS=true to override)\`,
|
|
208
|
+
{ nodeEnv: process.env.NODE_ENV ?? null, config: process.env.CONFIG ?? null },
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* .what = declare this checkout's testdb port as TESTDB_PORT, before any test opens a connection.
|
|
213
|
+
* .why = a worktree's testdb binds a port of its own; the app dials TESTDB_PORT under test access,
|
|
214
|
+
* so a worktree's suite reaches its own db, never another checkout's.
|
|
215
|
+
*/
|
|
216
|
+
useTestdbPortOverride();
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* .what = preflight the LOCAL testdb when this service declares its own db (databaseUserName).
|
|
220
|
+
* .why = prevent time wasted on a suite that fails deep in a query because the local testdb was never
|
|
221
|
+
* provisioned, or was provisioned for a different repo; useWakeOfTestdb fails loud and names
|
|
222
|
+
* the fix. it is the LOCAL own-db half; the shared prep cluster its peers query is woken by
|
|
223
|
+
* useWakeOfLivedb in globalSetup, since both test and prep access reach the prep peers.
|
|
224
|
+
*/
|
|
225
|
+
useWakeOfTestdb();
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* .what = point dynamodb at the local dynamodb container, under the test access
|
|
229
|
+
* .why = a dynamodb suite must never reach a live table
|
|
230
|
+
*/
|
|
231
|
+
if (access === 'test')
|
|
232
|
+
process.env.USE_CUSTOM_DYNAMODB_ENDPOINT = 'http://localhost:9999';
|
|
233
|
+
"
|
|
234
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
|
+
import expect from 'expect';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
defineExpectedGitattributesContents,
|
|
6
|
+
type GitattributesSection,
|
|
7
|
+
} from '../../../utils/defineExpectedGitattributesContents';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* .what = the `.gitattributes` section this practice owns: the dao `.generated/` dir folds in pr diffs
|
|
11
|
+
* .why = the daos are the internal contracts, so a reviewer reads them open. a `.generated/` dir
|
|
12
|
+
* under `src/access/daos` holds derived code that every regen rewrites. github folds a
|
|
13
|
+
* file marked `linguist-generated`, one click away
|
|
14
|
+
* .note = the generator's terraform dir, `provision/aws/product`, also holds hand-written infra,
|
|
15
|
+
* and an infra change owes open eyes, so it stays open
|
|
16
|
+
*/
|
|
17
|
+
const sections: readonly GitattributesSection[] = [
|
|
18
|
+
{
|
|
19
|
+
header: {
|
|
20
|
+
latest:
|
|
21
|
+
'# [persist-with-dynamodb] collapse dao-generator output in pr diffs',
|
|
22
|
+
retired: [],
|
|
23
|
+
},
|
|
24
|
+
entries: {
|
|
25
|
+
latest: ['src/access/daos/**/.generated/** linguist-generated'],
|
|
26
|
+
retired: ['src/access/daos/** linguist-generated'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* .what = emits the `.gitattributes` this practice declares, given the repo's extant one
|
|
33
|
+
* .why = several practices declare this file; they converge only through the shared util
|
|
34
|
+
*/
|
|
35
|
+
const defineExpectedContents = (input: { contents: string | null }): string =>
|
|
36
|
+
defineExpectedGitattributesContents({
|
|
37
|
+
contents: input.contents,
|
|
38
|
+
declarer: 'persist-with-dynamodb',
|
|
39
|
+
sections,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* .what = throws when the repo's `.gitattributes` differs from what the shared layout emits
|
|
44
|
+
* .why = `check` gates `fix` (a throw means violated); exact equality, so `check(x) ⟺ x === fix(x)`
|
|
45
|
+
*/
|
|
46
|
+
export const check: FileCheckFunction = (contents) => {
|
|
47
|
+
expect(contents).toEqual(defineExpectedContents({ contents }));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* .what = sets this practice's section into the repo's `.gitattributes`
|
|
52
|
+
* .why = a fixed point: a second fix changes zero, and `check` passes on the output
|
|
53
|
+
*/
|
|
54
|
+
export const fix: FileFixFunction = (contents) => ({
|
|
55
|
+
contents: defineExpectedContents({ contents }),
|
|
56
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeclaredDaoSpecification,
|
|
3
|
+
DeclaredDomainObjectIntrospectionPaths,
|
|
4
|
+
DeclaredOutputDirectories,
|
|
5
|
+
} from 'dynamodb-dao-generator';
|
|
6
|
+
|
|
7
|
+
export const introspect: DeclaredDomainObjectIntrospectionPaths = [
|
|
8
|
+
'./src/domain.objects/index.ts',
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export const directories: DeclaredOutputDirectories = {
|
|
12
|
+
terraform: `provision/aws/product`,
|
|
13
|
+
dao: `src/access/daos`,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const specifications: DeclaredDaoSpecification[] = [];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"simple-dynamodb-client": "@declapract{check.minVersion('0.10.4')}"
|
|
4
|
+
},
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"dynamodb-dao-generator": "@declapract{check.minVersion('1.1.0')}"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"generate:dao:dynamodb": "dynamodb-dao-generator generate && npm run fix:format",
|
|
10
|
+
"provision:testdb:docker:up": "docker compose -f ./provision/docker/integration-test-db/docker-compose.yml up -d --force-recreate --build --renew-anon-volumes",
|
|
11
|
+
"provision:testdb:docker:down": "docker compose -f ./provision/docker/integration-test-db/docker-compose.yml down",
|
|
12
|
+
"provision:testdb:dynamodb:schema": "terraform -chdir=provision/aws/environments/test apply -auto-approve",
|
|
13
|
+
"provision:testdb": "npm run provision:testdb:docker:up && npm run provision:testdb:dynamodb:schema",
|
|
14
|
+
"start:testdb": "npm run provision:testdb"
|
|
15
|
+
}
|
|
16
|
+
}
|