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,88 @@
|
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
|
+
|
|
3
|
+
import { asPackageJSON } from '../../../../utils/asPackageJSON';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* .what = detects rhachet and any rhachet-<family>-* package in production dependencies
|
|
7
|
+
* .why = these packages should be devDependencies or peerDependencies, never direct prod deps
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// the family segment is a char class `[a-z]+`, so it catches every rhachet family — not just
|
|
11
|
+
// `-roles-` but `-brains-` too — while it still excludes a single-segment `rhachet-*` (which
|
|
12
|
+
// lacks the second dash). a `-brains-` package missed here stays a prod dep, and if it is also
|
|
13
|
+
// a devDep with a different version the manifest carries a duplicate whose two versions conflict.
|
|
14
|
+
const rhachetPackagePattern = /^rhachet(-[a-z]+-.*)?$/;
|
|
15
|
+
const PRACTICE = 'rhachet/prod-deps';
|
|
16
|
+
|
|
17
|
+
export const check: FileCheckFunction = (contents) => {
|
|
18
|
+
if (!contents)
|
|
19
|
+
throw new Error(
|
|
20
|
+
`does not match bad practice: [${PRACTICE}] package.json has no contents to scan for a rhachet(-<family>-*) prod dep`,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const packageJSON = asPackageJSON({ contents }, { practice: PRACTICE });
|
|
24
|
+
const prodDeps = Object.keys(packageJSON.dependencies ?? {});
|
|
25
|
+
|
|
26
|
+
// check if any rhachet package is in prod dependencies
|
|
27
|
+
const rhachetInProdDeps = prodDeps.some((dep) =>
|
|
28
|
+
rhachetPackagePattern.test(dep),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
if (rhachetInProdDeps) return; // matches bad practice
|
|
32
|
+
// no violation — no rhachet(-<family>-*) package sits in dependencies
|
|
33
|
+
throw new Error(
|
|
34
|
+
'does not match bad practice: no rhachet(-<family>-*) package in dependencies',
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* .what = relocate every rhachet(-<family>-*) package from prod deps into dev deps by a pure
|
|
40
|
+
* partition, then return the two updated maps (inputs untouched, no in-place mutation).
|
|
41
|
+
* .why = names the relocation as one intent so `fix` reads what-not-how; the body partitions prod
|
|
42
|
+
* deps into relocated (rhachet) + retained (the rest) rather than a mutate-in-place loop a
|
|
43
|
+
* reader must simulate (`rule.forbid.inline-decode-friction`, immutability clause).
|
|
44
|
+
*/
|
|
45
|
+
const withRhachetDepsMovedToDevDeps = (input: {
|
|
46
|
+
prodDeps: Record<string, string>;
|
|
47
|
+
devDeps: Record<string, string>;
|
|
48
|
+
}): { prodDeps: Record<string, string>; devDeps: Record<string, string> } => {
|
|
49
|
+
const prodEntries = Object.entries(input.prodDeps);
|
|
50
|
+
// partition: rhachet packages relocate into dev deps; every other prod dep is retained as-is
|
|
51
|
+
const relocated = prodEntries.filter(([dep]) =>
|
|
52
|
+
rhachetPackagePattern.test(dep),
|
|
53
|
+
);
|
|
54
|
+
const retained = prodEntries.filter(
|
|
55
|
+
([dep]) => !rhachetPackagePattern.test(dep),
|
|
56
|
+
);
|
|
57
|
+
return {
|
|
58
|
+
prodDeps: Object.fromEntries(retained),
|
|
59
|
+
// a relocated rhachet dep wins over any prior devDeps entry of the same name (the prod version)
|
|
60
|
+
devDeps: { ...input.devDeps, ...Object.fromEntries(relocated) },
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const fix: FileFixFunction = (contents) => {
|
|
65
|
+
if (!contents) return { contents };
|
|
66
|
+
|
|
67
|
+
const packageJSON = asPackageJSON({ contents }, { practice: PRACTICE });
|
|
68
|
+
|
|
69
|
+
// relocate every rhachet package from prod deps into dev deps
|
|
70
|
+
const { prodDeps, devDeps } = withRhachetDepsMovedToDevDeps({
|
|
71
|
+
prodDeps: { ...packageJSON.dependencies },
|
|
72
|
+
devDeps: { ...packageJSON.devDependencies },
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// preserve each section's PRESENCE byte-for-byte: a section the consumer declared
|
|
76
|
+
// (even as an explicit empty `{}`) stays; a section it never had is added only when
|
|
77
|
+
// the move lands a package into it. this mirrors the leveled-term twin, so an
|
|
78
|
+
// already-clean manifest is a true no-op rather than a shape mutation.
|
|
79
|
+
const fixedPackageJSON = {
|
|
80
|
+
...packageJSON,
|
|
81
|
+
...('dependencies' in packageJSON ? { dependencies: prodDeps } : {}),
|
|
82
|
+
...('devDependencies' in packageJSON || Object.keys(devDeps).length > 0
|
|
83
|
+
? { devDependencies: devDeps }
|
|
84
|
+
: {}),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return { contents: JSON.stringify(fixedPackageJSON, null, 2) };
|
|
88
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FileCheckType, type FileFixFunction } from 'declapract';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* .what = detects committed peer-review artifacts under .behavior/**\/.reviews
|
|
5
|
+
* .why = peer-review files are noise; far less important than the root behavior
|
|
6
|
+
* files, so they should not be tracked in git
|
|
7
|
+
*
|
|
8
|
+
* .note = matches the old flat shape, where peer-review files sit directly in
|
|
9
|
+
* .reviews with `peer-review` in the filename
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const check = FileCheckType.EXISTS;
|
|
13
|
+
|
|
14
|
+
export const fix: FileFixFunction = () => {
|
|
15
|
+
return { contents: null }; // delete the file
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FileCheckType, type FileFixFunction } from 'declapract';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* .what = detects committed peer-review artifacts under .behavior/**\/.reviews/peer
|
|
5
|
+
* .why = peer-review files are noise; far less important than the root behavior
|
|
6
|
+
* files, so they should not be tracked in git
|
|
7
|
+
*
|
|
8
|
+
* .note = matches the new shape, where all peer-review files live under a
|
|
9
|
+
* dedicated `peer` directory
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export const check = FileCheckType.EXISTS;
|
|
13
|
+
|
|
14
|
+
export const fix: FileFixFunction = () => {
|
|
15
|
+
return { contents: null }; // delete the file
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
peer review artifacts should not be committed to git
|
|
2
|
+
|
|
3
|
+
these files live under `.behavior/**/.reviews/` and capture peer-review feedback
|
|
4
|
+
from the behavior build lifecycle. they are noise for the most part — far less
|
|
5
|
+
important than the root behavior files themselves.
|
|
6
|
+
|
|
7
|
+
two path shapes are removed:
|
|
8
|
+
|
|
9
|
+
- old (flat): `.behavior/**/.reviews/**/*peer-review*.md`
|
|
10
|
+
- new (peer dir): `.behavior/**/.reviews/peer/**/*.md`
|
|
11
|
+
|
|
12
|
+
self-reviews and other non-peer artifacts under `.reviews/` are intentionally left alone.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
|
+
import { ConstraintError } from 'helpful-errors';
|
|
3
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
+
import yaml from 'yaml';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* .what = the practices whose presence means the repo reaches aws with local credentials
|
|
8
|
+
* .why = such a repo needs AWS_PROFILE on a laptop (#487); a repo with none of them needs no
|
|
9
|
+
* aws key at all, so the findsert stays out of its keyrack.yml
|
|
10
|
+
*/
|
|
11
|
+
const AWS_PRACTICES: readonly string[] = [
|
|
12
|
+
'environments-aws',
|
|
13
|
+
'node-service',
|
|
14
|
+
'persist-with-dynamodb',
|
|
15
|
+
'persist-with-rds',
|
|
16
|
+
'serverless',
|
|
17
|
+
'terraform-aws',
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* .what = the AWS_PROFILE entry this practice declares, in the is-optional-if-has shape (#491)
|
|
22
|
+
* .why = a laptop sets AWS_PROFILE; ci sets AWS_ACCESS_KEY_ID via oidc. the key is optional when
|
|
23
|
+
* the alternative is present, so `keyrack.source({ mode: strict })` passes in ci too
|
|
24
|
+
*/
|
|
25
|
+
const declaredAwsProfileEntry = {
|
|
26
|
+
key: 'AWS_PROFILE',
|
|
27
|
+
'is-optional-if-has': 'AWS_ACCESS_KEY_ID',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* .what = whether a keyrack env seq item names AWS_PROFILE, as a bare string or a `key:` map
|
|
32
|
+
*/
|
|
33
|
+
const isAwsProfileItem = (item: unknown): boolean => {
|
|
34
|
+
if (yaml.isScalar(item)) return item.value === 'AWS_PROFILE';
|
|
35
|
+
if (yaml.isMap(item)) return item.get('key') === 'AWS_PROFILE';
|
|
36
|
+
return false;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* .what = the `env.*` seq nodes a keyrack.yml declares (env.all, env.test, env.prep, env.prod)
|
|
41
|
+
*/
|
|
42
|
+
const getEnvSeqs = (doc: yaml.Document): yaml.YAMLSeq[] => {
|
|
43
|
+
if (!yaml.isMap(doc.contents)) return [];
|
|
44
|
+
return doc.contents.items
|
|
45
|
+
.filter(
|
|
46
|
+
(pair) =>
|
|
47
|
+
yaml.isScalar(pair.key) &&
|
|
48
|
+
String(pair.key.value).startsWith('env.') &&
|
|
49
|
+
yaml.isSeq(pair.value),
|
|
50
|
+
)
|
|
51
|
+
.map((pair) => pair.value as yaml.YAMLSeq);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* .what = the keyrack.yml a repo should hold, given its extant one and its practices
|
|
56
|
+
* .why = a FINDSERT, scope-safe (rule.avoid.runtime-forks): it only adds or upgrades the
|
|
57
|
+
* AWS_PROFILE entry, never removes a line, so a narrow-scope apply (where the aws signal
|
|
58
|
+
* goes dark) leaves a correct file intact
|
|
59
|
+
* - no aws practice → the file as it stands
|
|
60
|
+
* - a bare `AWS_PROFILE` under any env.* section → upgraded in place to is-optional-if-has
|
|
61
|
+
* - AWS_PROFILE absent from every env.* section → added under env.all
|
|
62
|
+
* - AWS_PROFILE already a `key:` map → kept as the adopter shaped it
|
|
63
|
+
* .note = a fixed point: a conformant file is returned verbatim, so fix(fix(x)) === fix(x)
|
|
64
|
+
*/
|
|
65
|
+
const defineExpectedKeyrackContents = (input: {
|
|
66
|
+
contents: string;
|
|
67
|
+
projectPractices: string[];
|
|
68
|
+
}): string => {
|
|
69
|
+
// a repo with no aws practice: no aws key is owed
|
|
70
|
+
const isAws = input.projectPractices.some((practice) =>
|
|
71
|
+
AWS_PRACTICES.includes(practice),
|
|
72
|
+
);
|
|
73
|
+
if (!isAws) return input.contents;
|
|
74
|
+
|
|
75
|
+
// find each AWS_PROFILE entry the repo declares
|
|
76
|
+
const doc = yaml.parseDocument(input.contents);
|
|
77
|
+
const envSeqs = getEnvSeqs(doc);
|
|
78
|
+
const bareEntries = envSeqs.flatMap((seq) =>
|
|
79
|
+
seq.items
|
|
80
|
+
.map((item, index) => ({ seq, item, index }))
|
|
81
|
+
.filter(({ item }) => yaml.isScalar(item) && isAwsProfileItem(item)),
|
|
82
|
+
);
|
|
83
|
+
const hasAnyEntry = envSeqs.some((seq) => seq.items.some(isAwsProfileItem));
|
|
84
|
+
|
|
85
|
+
// already conformant → the file verbatim (no round-trip)
|
|
86
|
+
if (hasAnyEntry && bareEntries.length === 0) return input.contents;
|
|
87
|
+
|
|
88
|
+
// upgrade each bare entry in place, so its env section and its comment stay put
|
|
89
|
+
// .note = deliberate mutation — the yaml document api mutates nodes in place to keep comments
|
|
90
|
+
bareEntries.forEach(({ seq, item, index }) => {
|
|
91
|
+
const upgraded = doc.createNode(declaredAwsProfileEntry);
|
|
92
|
+
upgraded.commentBefore = (item as yaml.Scalar).commentBefore;
|
|
93
|
+
seq.items[index] = upgraded;
|
|
94
|
+
});
|
|
95
|
+
if (hasAnyEntry) return doc.toString();
|
|
96
|
+
|
|
97
|
+
// absent: add under env.all (seed the seq where env.all is null or absent)
|
|
98
|
+
const envAll = doc.get('env.all');
|
|
99
|
+
if (!yaml.isSeq(envAll)) {
|
|
100
|
+
doc.set('env.all', doc.createNode([declaredAwsProfileEntry]));
|
|
101
|
+
return doc.toString();
|
|
102
|
+
}
|
|
103
|
+
envAll.add(doc.createNode(declaredAwsProfileEntry));
|
|
104
|
+
return doc.toString();
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* .what = throws when the repo lacks a keyrack.yml, or an aws repo lacks the AWS_PROFILE entry
|
|
109
|
+
* .note = best-practice semantics: a THROW means violated (declapract-check-semantics.md)
|
|
110
|
+
*/
|
|
111
|
+
export const check: FileCheckFunction = (contents, context) => {
|
|
112
|
+
// the file must exist (rhachet init --keys writes it)
|
|
113
|
+
if (contents === null)
|
|
114
|
+
throw new ConstraintError('.agent/keyrack.yml is absent', {
|
|
115
|
+
hint: 'run `npx rhachet init --keys` to create it',
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// an aws repo must carry AWS_PROFILE in the is-optional-if-has shape
|
|
119
|
+
const expected = defineExpectedKeyrackContents({
|
|
120
|
+
contents,
|
|
121
|
+
projectPractices: context.projectPractices,
|
|
122
|
+
});
|
|
123
|
+
if (contents !== expected)
|
|
124
|
+
throw new ConstraintError(
|
|
125
|
+
'.agent/keyrack.yml lacks AWS_PROFILE (is-optional-if-has AWS_ACCESS_KEY_ID) for an aws repo',
|
|
126
|
+
{ relativeFilePath: context.relativeFilePath },
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* .what = findserts the AWS_PROFILE entry into an aws repo's keyrack.yml (#491, #487)
|
|
132
|
+
* .note = an absent file is left to `rhachet init --keys` (it knows the org); the fix returns no
|
|
133
|
+
* contents for it, which declapract reads as "no automatic fix"
|
|
134
|
+
*/
|
|
135
|
+
export const fix: FileFixFunction = (contents, context) => {
|
|
136
|
+
if (contents === null) return {};
|
|
137
|
+
return {
|
|
138
|
+
contents: defineExpectedKeyrackContents({
|
|
139
|
+
contents,
|
|
140
|
+
projectPractices: context.projectPractices,
|
|
141
|
+
}),
|
|
142
|
+
};
|
|
143
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# boot.yml — which briefs load into context at each boot
|
|
2
|
+
# say = full content, every boot (costs tokens)
|
|
3
|
+
# ref = path only, read on demand
|
|
4
|
+
# not = never booted
|
|
5
|
+
#
|
|
6
|
+
# no `say` key = say all, minus `ref` and `not`. a non-empty `say` = say only what it
|
|
7
|
+
# matches, ref all else. `say: []` = ref all. skills curate the same way, via `skills:`.
|
|
8
|
+
# to curate a large corpus, add a `say:` allowlist, e.g. `- briefs/rule.*.md`.
|
|
9
|
+
#
|
|
10
|
+
# an upgrade keeps your own entries and budget; it only adds the `not` globs below.
|
|
11
|
+
|
|
12
|
+
# budget = the token cap on the say payload; a boot over it halts.
|
|
13
|
+
# to fix a halt: demote a say glob to ref, use a .min brief, or raise the cap.
|
|
14
|
+
# plain `5000`, never `5_000`: yaml 1.2 reads an underscore integer as a string.
|
|
15
|
+
budget:
|
|
16
|
+
tokens: 5000
|
|
17
|
+
|
|
18
|
+
# each term's say file names its .reason path, so its variants never boot
|
|
19
|
+
briefs:
|
|
20
|
+
not:
|
|
21
|
+
- briefs/domain.terms/term=*._.choice.reason.md
|
|
22
|
+
- briefs/domain.terms/term=*._.choice.example=*.md
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
|
+
import expect from 'expect';
|
|
3
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
|
+
import yaml from 'yaml';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* .what = the `not` globs this practice declares — the deep glossary variants, dropped from boot.
|
|
8
|
+
* .why = each term's say file names its `.reason` path, so a ref line per variant adds no reach and
|
|
9
|
+
* costs a path line per term on every boot. `not` drops them. the findsert adds only these
|
|
10
|
+
* two globs, never the whole template, so a consumer's own boot entries survive.
|
|
11
|
+
*/
|
|
12
|
+
const declaredNotGlobs: readonly string[] = [
|
|
13
|
+
'briefs/domain.terms/term=*._.choice.reason.md',
|
|
14
|
+
'briefs/domain.terms/term=*._.choice.example=*.md',
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* .what = the token cap this practice findserts for the resident `say` payload at each boot.
|
|
19
|
+
* .why = a boot whose say-content exceeds this halts, so the corpus cannot silently bloat context.
|
|
20
|
+
* findserted so an extant consumer inherits the cap on upgrade, not only a fresh one — the
|
|
21
|
+
* template block ships to a new consumer, this findsert reaches the ones already on disk.
|
|
22
|
+
* findsert semantics: absent -> add; present -> leave the consumer's chosen value untouched,
|
|
23
|
+
* so a consumer who deliberately raised or lowered the cap is never reverted (F62).
|
|
24
|
+
*/
|
|
25
|
+
const declaredBudgetTokens = 5_000;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* .what = the comment the findsert attaches above the `budget:` key it injects.
|
|
29
|
+
* .why = a bare `budget:\n tokens: 5000` gives a consumer no clue why the value is plain, so a
|
|
30
|
+
* later tidy-up could "improve" it to `5_000` and silently make the cap a yaml STRING. the
|
|
31
|
+
* findserted block must carry the same NOTE the shipped template does, so the trap is warned
|
|
32
|
+
* at the exact spot the value lands — and it names the boot halt and its remedy.
|
|
33
|
+
* .note = the yaml serializer prefixes each line with `# `, so a space at the front renders `# budget`.
|
|
34
|
+
*/
|
|
35
|
+
const declaredBudgetComment = [
|
|
36
|
+
' budget = the token cap on the say payload; a boot over it halts.',
|
|
37
|
+
' to fix a halt: demote a say glob to ref, use a .min brief, or raise the cap.',
|
|
38
|
+
' plain `5000`, never `5_000`: yaml 1.2 reads an underscore integer as a string.',
|
|
39
|
+
].join('\n');
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* .what = true when a consumer's boot.yml already declares `budget.tokens` (any value).
|
|
43
|
+
* .why = the findsert gate: add the cap only when a consumer carries none, so a present value — even
|
|
44
|
+
* a divergent one a consumer chose on purpose — is preserved (findsert, never upsert).
|
|
45
|
+
*/
|
|
46
|
+
const hasBudgetTokens = (doc: yaml.Document): boolean =>
|
|
47
|
+
doc.getIn(['budget', 'tokens']) !== undefined;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* .what = true when the consumer curates in the legacy SUBJECT mode (`always.briefs`).
|
|
51
|
+
* .why = the findsert writes into whichever mode the consumer already uses, so a subject-mode
|
|
52
|
+
* consumer is never corrupted into an invalid mixed `always:` + `briefs:` file.
|
|
53
|
+
*/
|
|
54
|
+
const isSubjectMode = (doc: yaml.Document): boolean =>
|
|
55
|
+
doc.getIn(['always', 'briefs']) !== undefined;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* .what = the key path of a briefs level list (`ref` or `not`) in the consumer's mode.
|
|
59
|
+
*/
|
|
60
|
+
const asBriefsLevelPath = (input: {
|
|
61
|
+
doc: yaml.Document;
|
|
62
|
+
level: 'ref' | 'not';
|
|
63
|
+
}): string[] =>
|
|
64
|
+
isSubjectMode(input.doc)
|
|
65
|
+
? ['always', 'briefs', input.level]
|
|
66
|
+
: ['briefs', input.level];
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* .what = reads the globs a consumer's boot.yml carries at one level (`ref` or `not`).
|
|
70
|
+
* .why = the read half: the union and the move are computed against the consumer's real lists.
|
|
71
|
+
*/
|
|
72
|
+
const getCurrentLevelGlobs = (input: {
|
|
73
|
+
doc: yaml.Document;
|
|
74
|
+
level: 'ref' | 'not';
|
|
75
|
+
}): string[] => {
|
|
76
|
+
// the yaml node api is an external boundary; a documented projection to json is the in-repo norm
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
+
const node: any = input.doc.getIn(asBriefsLevelPath(input));
|
|
79
|
+
if (!yaml.isSeq(node)) return [];
|
|
80
|
+
return (node.toJSON() as string[] | null) ?? [];
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* .what = the mutable `not` seq node to union into: the consumer's extant one, or a seeded one.
|
|
85
|
+
* .why = a plain [] becomes a js array without the `.add` the union relies on, so seed a real seq.
|
|
86
|
+
*/
|
|
87
|
+
const getOrSeedNotSeq = (doc: yaml.Document): yaml.YAMLSeq => {
|
|
88
|
+
const path = asBriefsLevelPath({ doc, level: 'not' });
|
|
89
|
+
const extant = doc.getIn(path);
|
|
90
|
+
if (yaml.isSeq(extant)) return extant;
|
|
91
|
+
const seq = new yaml.YAMLSeq();
|
|
92
|
+
doc.setIn(path, seq);
|
|
93
|
+
return seq;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* .what = the boot.yml a consumer should hold: its extant file with the declared globs under `not`
|
|
98
|
+
* (and out of `ref`) and the budget cap findserted, or the whole template where it has none
|
|
99
|
+
* .why = a findsert by construction: a glob already under `not` stays there once, a consumer's own
|
|
100
|
+
* `ref` entries stay, a budget already set is left as the consumer chose it, and every other
|
|
101
|
+
* line (say entries, comments, mode) is preserved because the file is mutated in place via
|
|
102
|
+
* the yaml document api, never regenerated.
|
|
103
|
+
* .note = a fixed point — an already-conformant file is returned verbatim (no round-trip), so
|
|
104
|
+
* `fix(fix(x)) === fix(x)` and `check` passes on its own output.
|
|
105
|
+
*/
|
|
106
|
+
const defineExpectedContents = (
|
|
107
|
+
contents: string | null,
|
|
108
|
+
declaredContents: string,
|
|
109
|
+
): string => {
|
|
110
|
+
// a fresh consumer (no boot.yml) gets the whole declared template verbatim.
|
|
111
|
+
if (!contents) return declaredContents;
|
|
112
|
+
|
|
113
|
+
// measure what the consumer lacks
|
|
114
|
+
const doc = yaml.parseDocument(contents);
|
|
115
|
+
const notGlobs = getCurrentLevelGlobs({ doc, level: 'not' });
|
|
116
|
+
const refGlobs = getCurrentLevelGlobs({ doc, level: 'ref' });
|
|
117
|
+
const absentFromNot = declaredNotGlobs.filter(
|
|
118
|
+
(glob) => !notGlobs.includes(glob),
|
|
119
|
+
);
|
|
120
|
+
const strayInRef = declaredNotGlobs.filter((glob) => refGlobs.includes(glob));
|
|
121
|
+
const budgetAbsent = !hasBudgetTokens(doc);
|
|
122
|
+
|
|
123
|
+
// already conformant → return the consumer's file verbatim (no round-trip).
|
|
124
|
+
if (absentFromNot.length === 0 && strayInRef.length === 0 && !budgetAbsent)
|
|
125
|
+
return contents;
|
|
126
|
+
|
|
127
|
+
// move: drop each declared glob from `ref`; drop the `ref` key if it empties
|
|
128
|
+
// .note = deliberate mutation — the yaml document api mutates nodes in place to keep comments
|
|
129
|
+
if (strayInRef.length > 0) {
|
|
130
|
+
const refPath = asBriefsLevelPath({ doc, level: 'ref' });
|
|
131
|
+
const refSeq = doc.getIn(refPath) as yaml.YAMLSeq;
|
|
132
|
+
refSeq.items = refSeq.items.filter(
|
|
133
|
+
(item) =>
|
|
134
|
+
!strayInRef.includes(String(yaml.isScalar(item) ? item.value : item)),
|
|
135
|
+
);
|
|
136
|
+
if (refSeq.items.length === 0) doc.deleteIn(refPath);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// union: add each absent declared glob under `not`
|
|
140
|
+
if (absentFromNot.length > 0) {
|
|
141
|
+
const notSeq = getOrSeedNotSeq(doc);
|
|
142
|
+
absentFromNot.forEach((glob) => notSeq.add(glob));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// findsert the budget cap — only when the consumer declares none, so a chosen value survives.
|
|
146
|
+
// attach the NOTE above the `budget:` key so the plain-5000 yaml trap is warned where it lands.
|
|
147
|
+
if (budgetAbsent) {
|
|
148
|
+
// .note = a key built via a node (not `setIn`) is a Scalar, which can carry a commentBefore;
|
|
149
|
+
// a `setIn`-made key is a bare string and would drop the NOTE in silence
|
|
150
|
+
if (!yaml.isMap(doc.contents)) doc.contents = doc.createNode({});
|
|
151
|
+
const budgetKey = doc.createNode('budget');
|
|
152
|
+
budgetKey.commentBefore = declaredBudgetComment;
|
|
153
|
+
(doc.contents as yaml.YAMLMap).add(
|
|
154
|
+
doc.createPair(budgetKey, { tokens: declaredBudgetTokens }),
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return doc.toString();
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* .what = throws when a consumer's boot.yml lacks a declared `not` glob, still lists one under `ref`,
|
|
163
|
+
* lacks a budget, or is absent entirely.
|
|
164
|
+
* .why = `check` is the GATE: declapract runs `fix` only when `check` rejects.
|
|
165
|
+
* .note = best-practice semantics are inverted — a THROW means the practice is violated, a return
|
|
166
|
+
* means it is followed. see `.agent/repo=.this/role=any/briefs/declapract-check-semantics.md`.
|
|
167
|
+
* the equality is against the FINDSERT output, never the whole template, so a consumer's own
|
|
168
|
+
* boot entries pass the check untouched.
|
|
169
|
+
*/
|
|
170
|
+
export const check: FileCheckFunction = (contents, context) => {
|
|
171
|
+
expect(contents).toEqual(
|
|
172
|
+
defineExpectedContents(contents, context.declaredFileContents ?? ''),
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* .what = unions the declared `not` globs into a consumer's boot.yml (moved out of `ref`) and
|
|
178
|
+
* findserts the budget cap (or writes the template if absent).
|
|
179
|
+
* .why = fix forward once, for every consumer — never a whole-file overwrite that would drop a
|
|
180
|
+
* consumer's own say/ref curation (#105 req 1, #689).
|
|
181
|
+
*/
|
|
182
|
+
export const fix: FileFixFunction = (contents, context) => {
|
|
183
|
+
return {
|
|
184
|
+
contents: defineExpectedContents(
|
|
185
|
+
contents,
|
|
186
|
+
context.declaredFileContents ?? '',
|
|
187
|
+
),
|
|
188
|
+
};
|
|
189
|
+
};
|
package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.declapract.readme.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
rhachet boots roles, and role boots write scratch state into `.agent/.cache/`
|
|
2
|
+
|
|
3
|
+
so this practice declares the gitignore line for that dir — the practice that creates the scratch
|
|
4
|
+
declares its ignore, rather than a neighbor practice a repo may not have taken.
|
|
5
|
+
|
|
6
|
+
📖 several practices declare this same `.gitignore`. the contract they share — one shared
|
|
7
|
+
algorithm, the ordered tail, what a new declarer owes — is stated once at
|
|
8
|
+
`.agent/repo=.this/role=any/briefs/howto.declare-the-repo-gitignore.md`. read that before you add
|
|
9
|
+
a line here.
|
|
10
|
+
|
|
11
|
+
## it declares only `.agent/.cache/`, not `.cache/`
|
|
12
|
+
|
|
13
|
+
`.cache/` is generic tool scratch and belongs to the `git` practice. a practice declares the
|
|
14
|
+
ignore for the dirs it creates.
|
|
15
|
+
|
|
16
|
+
⚠️ **"rhachet owns it" does not mean "git should drop it".** the `git` practice declares
|
|
17
|
+
`.agent/.cache/` too, and that line stays: `app-react-native-expo` (`src/useCases.yml`) takes
|
|
18
|
+
`git` **without** `rhachet`, so for those repos git's line is the only explicit source of the
|
|
19
|
+
ignore.
|
|
20
|
+
|
|
21
|
+
## the end-to-end proof lives under the git practice
|
|
22
|
+
|
|
23
|
+
`src/practices/git/.declapract.integration.test.ts` → `[case2] a repo whose use case has rhachet
|
|
24
|
+
but NOT git`.
|
|
25
|
+
|
|
26
|
+
that is the scenario which justifies this declaration at all. it clones a demo repo whose use case
|
|
27
|
+
omits `git`, applies **this** practice alone, and asserts the agent cache path is ignored with no
|
|
28
|
+
help from git, that `.cache/` is correctly absent, that the negation is honored by git itself, and
|
|
29
|
+
that a re-apply changes zero bytes.
|
|
30
|
+
|
|
31
|
+
it sits there because one temp repo must hold both declarations to prove they agree. this pointer
|
|
32
|
+
exists so a reader in `src/practices/rhachet/` can find it.
|
|
33
|
+
|
|
34
|
+
## route robocode folds in a pr
|
|
35
|
+
|
|
36
|
+
this practice declares a `# [rhachet]` section of the repo-root `.gitattributes`: each file under
|
|
37
|
+
`.route/` and `.behavior/` is `linguist-generated`, so github renders it collapsed, except
|
|
38
|
+
`*.yield.*` files and `.radio/` records, which stay open. its section sits last among the declarers,
|
|
39
|
+
so those exceptions win over any earlier collapse line. to un-fold a path, see "what folds in a pr"
|
|
40
|
+
in `src/practices/git/best-practice/.declapract.readme.md`.
|
|
@@ -0,0 +1,65 @@
|
|
|
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: route robocode folds in pr diffs
|
|
11
|
+
* .why = rhachet installs the roles that drive routes (bhrain: `.route/`; bhuild:
|
|
12
|
+
* `.behavior/`). a route carries stones, guards, reviews, caches: the trail. the
|
|
13
|
+
* yields hold what the route concluded, and `.radio/` holds what it handed off. so a
|
|
14
|
+
* pr folds the trail and opens on the yields and the radio
|
|
15
|
+
* .note = order carries load: git takes the last line that matches, so each
|
|
16
|
+
* `-linguist-generated` exception follows the collapse line it carves out of.
|
|
17
|
+
* attributes never recurse from a dir, so each pattern ends in `/**`
|
|
18
|
+
*/
|
|
19
|
+
const sections: readonly GitattributesSection[] = [
|
|
20
|
+
{
|
|
21
|
+
header: {
|
|
22
|
+
latest:
|
|
23
|
+
'# [rhachet] collapse route robocode in pr diffs; yields and radio stay open',
|
|
24
|
+
retired: [],
|
|
25
|
+
},
|
|
26
|
+
entries: {
|
|
27
|
+
latest: [
|
|
28
|
+
'.route/** linguist-generated',
|
|
29
|
+
'.route/**/*.yield.* -linguist-generated',
|
|
30
|
+
'.route/**/.radio/** -linguist-generated',
|
|
31
|
+
'.behavior/** linguist-generated',
|
|
32
|
+
'.behavior/**/*.yield.* -linguist-generated',
|
|
33
|
+
'.behavior/**/.radio/** -linguist-generated',
|
|
34
|
+
],
|
|
35
|
+
retired: [],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* .what = emits the `.gitattributes` this practice declares, given the repo's extant one
|
|
42
|
+
* .why = several practices declare this file; they converge only through the shared util
|
|
43
|
+
*/
|
|
44
|
+
const defineExpectedContents = (input: { contents: string | null }): string =>
|
|
45
|
+
defineExpectedGitattributesContents({
|
|
46
|
+
contents: input.contents,
|
|
47
|
+
declarer: 'rhachet',
|
|
48
|
+
sections,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* .what = throws when the repo's `.gitattributes` differs from what the shared layout emits
|
|
53
|
+
* .why = `check` gates `fix` (a throw means violated); exact equality, so `check(x) ⟺ x === fix(x)`
|
|
54
|
+
*/
|
|
55
|
+
export const check: FileCheckFunction = (contents) => {
|
|
56
|
+
expect(contents).toEqual(defineExpectedContents({ contents }));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* .what = sets this practice's section into the repo's `.gitattributes`
|
|
61
|
+
* .why = a fixed point: a second fix changes zero, and `check` passes on the output
|
|
62
|
+
*/
|
|
63
|
+
export const fix: FileFixFunction = (contents) => ({
|
|
64
|
+
contents: defineExpectedContents({ contents }),
|
|
65
|
+
});
|