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
|
@@ -4,6 +4,7 @@ import fs from 'node:fs/promises';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
|
|
6
6
|
import { executeApply, executePlan } from 'declapract';
|
|
7
|
+
import { ConstraintError, MalfunctionError } from 'helpful-errors';
|
|
7
8
|
import { genTempDir, given, then, useBeforeAll, when } from 'test-fns';
|
|
8
9
|
|
|
9
10
|
import { asPackageJSON } from './utils/asPackageJSON';
|
|
@@ -12,6 +13,10 @@ import { asPackageJSON } from './utils/asPackageJSON';
|
|
|
12
13
|
* .what = the pnpm this repo pins in its own `packageManager`, run via npx
|
|
13
14
|
* .why = a ci test job restores node_modules from cache and puts no pnpm on its PATH, so a bare
|
|
14
15
|
* `pnpm` spawn fails ENOENT. npx fetches the pinned version, so the run needs no host pnpm
|
|
16
|
+
* .note = `--loglevel=error` sits before the package spec, so it quiets npx's own npm and reaches
|
|
17
|
+
* neither pnpm nor tsc: npx reads the emitted `.npmrc`, and a newer host npm warns on each
|
|
18
|
+
* pnpm-only key in it (`node-linker`, `public-hoist-pattern`), which says naught of the
|
|
19
|
+
* templates and would vary each snapshot with the host's npm
|
|
15
20
|
*/
|
|
16
21
|
const PNPM_VIA_NPX = (() => {
|
|
17
22
|
const packageManager: string = asPackageJSON(
|
|
@@ -23,7 +28,10 @@ const PNPM_VIA_NPX = (() => {
|
|
|
23
28
|
},
|
|
24
29
|
{ practice: 'typecheck-best-practice-templates' },
|
|
25
30
|
).packageManager;
|
|
26
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
command: 'npx',
|
|
33
|
+
argsBefore: ['--yes', '--loglevel=error', packageManager],
|
|
34
|
+
};
|
|
27
35
|
})();
|
|
28
36
|
|
|
29
37
|
/**
|
|
@@ -55,6 +63,12 @@ const PNPM_VIA_NPX = (() => {
|
|
|
55
63
|
* .teeth = restore `/\bs3\s*:/` as the s3 key pattern in `cache/bad-practices/cache-directory-options`
|
|
56
64
|
* — the config template `src/utils/config/getOneCacheDirectory.ts` is flagged in each
|
|
57
65
|
* usecase that ships it.
|
|
66
|
+
* .what = also runs each usecase's emitted cycle check (`test:lint:cycles`) on the installed tree,
|
|
67
|
+
* and clamps that no cycle runs through pg-pool. dpdm walks node_modules (`exclude: []`),
|
|
68
|
+
* so a cycle in a shipped prod dep reddens every adopter's lint gate at once. every other
|
|
69
|
+
* cycle it finds is held in a snapshot, so a new one shows in review.
|
|
70
|
+
* .teeth = drop the `pg-pool` key from `persist-with-rds/best-practice/package.json`
|
|
71
|
+
* `pnpm.patchedDependencies` — `lambda-service-with-rds` reports `pg -> pg-pool`.
|
|
58
72
|
* .note = the test lives at `src/` (not under `src/.test/`): jest skips dot dirs, so a test there
|
|
59
73
|
* would never run.
|
|
60
74
|
*/
|
|
@@ -70,6 +84,10 @@ const USECASES = [
|
|
|
70
84
|
] as const;
|
|
71
85
|
type Usecase = (typeof USECASES)[number];
|
|
72
86
|
|
|
87
|
+
// the usecases whose install holds pg-pool; `[t3]` checks this set against each real install, so
|
|
88
|
+
// a usecase that gains pg reddens until it joins, and its pg-pool verdict is never vacuous
|
|
89
|
+
const USECASES_WITH_PG_POOL: readonly Usecase[] = ['lambda-service-with-rds'];
|
|
90
|
+
|
|
73
91
|
// every `@declapract{variable.*}` any practice in any usecase references
|
|
74
92
|
const VARIABLES_YML = `
|
|
75
93
|
variables:
|
|
@@ -114,6 +132,8 @@ const runInRepo = (input: {
|
|
|
114
132
|
const child = spawn(input.command, input.args, {
|
|
115
133
|
cwd: input.cwd,
|
|
116
134
|
env: { ...process.env, CI: 'true', FORCE_COLOR: '0' },
|
|
135
|
+
// a stalled registry kills the child (status null) instead of a silent park of the run
|
|
136
|
+
timeout: 900_000,
|
|
117
137
|
});
|
|
118
138
|
const chunks: string[] = [];
|
|
119
139
|
child.stdout.on('data', (chunk) => chunks.push(String(chunk)));
|
|
@@ -144,6 +164,39 @@ const asMaskedOutput = (input: { output: string; dirs: string[] }): string =>
|
|
|
144
164
|
input.output,
|
|
145
165
|
);
|
|
146
166
|
|
|
167
|
+
/**
|
|
168
|
+
* .what = the package each segment of one dpdm cycle line sits in, joined in cycle order
|
|
169
|
+
* .why = a raw cycle line names pnpm store dirs whose suffix hashes shift with every peer set;
|
|
170
|
+
* the packages alone are the stable fact a snapshot can hold
|
|
171
|
+
*/
|
|
172
|
+
const asCyclePackages = (input: { line: string }): string =>
|
|
173
|
+
input.line
|
|
174
|
+
.split(' -> ')
|
|
175
|
+
.map((segment) => {
|
|
176
|
+
const afterStore = segment.trim().split('node_modules/').pop() ?? '';
|
|
177
|
+
const match = afterStore.match(/^((?:@[^/]+\/)?[^/]+)/);
|
|
178
|
+
return match?.[1] ?? segment.trim();
|
|
179
|
+
})
|
|
180
|
+
.join(' -> ');
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* .what = the verdict of one `test:lint:cycles` run: whether dpdm analyzed a tree, and each
|
|
184
|
+
* cycle it found, as package chains
|
|
185
|
+
* .why = a bare repo of a usecase that emits no `src/**\/*.ts` gives dpdm no entry file, which it
|
|
186
|
+
* reports as a failure; that is not a cycle, so the summary keeps the two apart
|
|
187
|
+
*/
|
|
188
|
+
const asCycleSummary = (input: {
|
|
189
|
+
output: string;
|
|
190
|
+
}): { analyzed: boolean; cycles: string[] } => ({
|
|
191
|
+
analyzed: input.output.includes('Analyze done!'),
|
|
192
|
+
cycles: input.output
|
|
193
|
+
.split('\n')
|
|
194
|
+
.map((line) => line.match(/^\s*\d+\)\s+(.+)$/)?.[1])
|
|
195
|
+
.filter((line): line is string => line !== undefined)
|
|
196
|
+
.map((line) => asCyclePackages({ line }))
|
|
197
|
+
.sort(), // dpdm reports cycles in traversal order, which shifts between runs
|
|
198
|
+
});
|
|
199
|
+
|
|
147
200
|
/**
|
|
148
201
|
* .what = applies one usecase into its temp repo, installs the emitted deps, and compiles
|
|
149
202
|
* .why = the three steps an adopter takes before their first `tsc`
|
|
@@ -155,8 +208,11 @@ const genTypecheckResult = async (input: {
|
|
|
155
208
|
}): Promise<{
|
|
156
209
|
config: string;
|
|
157
210
|
tsconfigFound: boolean;
|
|
211
|
+
holdsPgPool: boolean;
|
|
212
|
+
srcImportsPg: boolean;
|
|
158
213
|
install: { status: number | null; output: string };
|
|
159
214
|
compile: { status: number | null; output: string };
|
|
215
|
+
cycles: { status: number | null; output: string };
|
|
160
216
|
}> => {
|
|
161
217
|
// declare the usecase this repo adopts, from declarations that live outside the repo
|
|
162
218
|
// .note = declapract joins `declarations` onto the config's dir, so the path is relative, and both
|
|
@@ -225,17 +281,48 @@ const genTypecheckResult = async (input: {
|
|
|
225
281
|
],
|
|
226
282
|
});
|
|
227
283
|
|
|
284
|
+
const compiledAt = Date.now();
|
|
285
|
+
|
|
286
|
+
// run the emitted cycle check, as the adopter's `npm run test:lint` does
|
|
287
|
+
const cycles = await runInRepo({
|
|
288
|
+
cwd,
|
|
289
|
+
command: PNPM_VIA_NPX.command,
|
|
290
|
+
args: [...PNPM_VIA_NPX.argsBefore, 'run', 'test:lint:cycles'],
|
|
291
|
+
});
|
|
292
|
+
|
|
228
293
|
// report the per-phase cost, so a slow usecase is visible in the run log
|
|
229
294
|
console.log(`typecheck-templates ${input.usecase} phase cost`, {
|
|
230
295
|
applyMs: appliedAt - startedAt,
|
|
231
296
|
installMs: installedAt - appliedAt,
|
|
232
|
-
compileMs:
|
|
297
|
+
compileMs: compiledAt - installedAt,
|
|
298
|
+
cyclesMs: Date.now() - compiledAt,
|
|
233
299
|
});
|
|
234
300
|
|
|
301
|
+
// whether the install holds pg-pool at all; pnpm keeps a transitive dep only in its store
|
|
302
|
+
const pnpmStore = path.join(cwd, 'node_modules', '.pnpm');
|
|
303
|
+
const holdsPgPool =
|
|
304
|
+
existsSync(pnpmStore) &&
|
|
305
|
+
(await fs.readdir(pnpmStore)).some((name) => name.startsWith('pg-pool@'));
|
|
306
|
+
|
|
307
|
+
// whether any emitted src file imports pg; without one, dpdm never reaches pg-pool
|
|
308
|
+
const srcDir = path.join(cwd, 'src');
|
|
309
|
+
const srcFiles = existsSync(srcDir)
|
|
310
|
+
? (await fs.readdir(srcDir, { recursive: true }))
|
|
311
|
+
.map(String)
|
|
312
|
+
.filter((file) => file.endsWith('.ts'))
|
|
313
|
+
: [];
|
|
314
|
+
const srcImportsPg = (
|
|
315
|
+
await Promise.all(
|
|
316
|
+
srcFiles.map((file) => fs.readFile(path.join(srcDir, file), 'utf-8')),
|
|
317
|
+
)
|
|
318
|
+
).some((contents) => /from 'pg'/.test(contents));
|
|
319
|
+
|
|
235
320
|
const dirs = [cwd, input.tempDir];
|
|
236
321
|
return {
|
|
237
322
|
config,
|
|
238
323
|
tsconfigFound,
|
|
324
|
+
holdsPgPool,
|
|
325
|
+
srcImportsPg,
|
|
239
326
|
install: {
|
|
240
327
|
status: install.status,
|
|
241
328
|
output: asMaskedOutput({ output: install.output, dirs }),
|
|
@@ -244,6 +331,10 @@ const genTypecheckResult = async (input: {
|
|
|
244
331
|
status: compile.status,
|
|
245
332
|
output: asMaskedOutput({ output: compile.output, dirs }),
|
|
246
333
|
},
|
|
334
|
+
cycles: {
|
|
335
|
+
status: cycles.status,
|
|
336
|
+
output: asMaskedOutput({ output: cycles.output, dirs }),
|
|
337
|
+
},
|
|
247
338
|
};
|
|
248
339
|
};
|
|
249
340
|
|
|
@@ -326,8 +417,8 @@ describe('typecheck best-practice templates', () => {
|
|
|
326
417
|
});
|
|
327
418
|
|
|
328
419
|
// read one usecase's result; a usecase whose preparation threw fails each of its thens loud
|
|
329
|
-
const getScene = (usecase: Usecase) => {
|
|
330
|
-
const result = settled[usecase];
|
|
420
|
+
const getScene = (input: { usecase: Usecase }) => {
|
|
421
|
+
const result = settled[input.usecase];
|
|
331
422
|
if (result.status === 'rejected') throw result.reason;
|
|
332
423
|
return result.value;
|
|
333
424
|
};
|
|
@@ -358,8 +449,8 @@ describe('typecheck best-practice templates', () => {
|
|
|
358
449
|
});
|
|
359
450
|
|
|
360
451
|
// read one usecase's plan flags; a plan that threw fails each of its thens loud
|
|
361
|
-
const getPlan = (usecase: Usecase) => {
|
|
362
|
-
const result = plans[usecase];
|
|
452
|
+
const getPlan = (input: { usecase: Usecase }) => {
|
|
453
|
+
const result = plans[input.usecase];
|
|
363
454
|
if (result.status === 'rejected') throw result.reason;
|
|
364
455
|
return result.value;
|
|
365
456
|
};
|
|
@@ -368,55 +459,126 @@ describe('typecheck best-practice templates', () => {
|
|
|
368
459
|
given(`[usecase] ${usecase} applied to a bare repo`, () => {
|
|
369
460
|
when('[t0] the emitted deps are installed', () => {
|
|
370
461
|
then('the install exits 0', () => {
|
|
371
|
-
const scene = getScene(usecase);
|
|
462
|
+
const scene = getScene({ usecase });
|
|
372
463
|
if (scene.install.status !== 0)
|
|
373
|
-
throw new
|
|
374
|
-
|
|
375
|
-
|
|
464
|
+
throw new MalfunctionError(`pnpm install failed for ${usecase}`, {
|
|
465
|
+
status: scene.install.status,
|
|
466
|
+
output: scene.install.output,
|
|
467
|
+
hint: 'read the install output above; a registry or cache fault is the usual cause',
|
|
468
|
+
});
|
|
376
469
|
expect(scene.install.status).toEqual(0);
|
|
377
470
|
});
|
|
378
471
|
});
|
|
379
472
|
|
|
380
473
|
when('[t1] the emitted tree is compiled with the emitted tsconfig', () => {
|
|
381
474
|
then('the usecase emits a tsconfig.json', () => {
|
|
382
|
-
expect(getScene(usecase).tsconfigFound).toEqual(true);
|
|
475
|
+
expect(getScene({ usecase }).tsconfigFound).toEqual(true);
|
|
383
476
|
});
|
|
384
477
|
|
|
385
478
|
then('the tsc diagnostics match snapshot', () => {
|
|
386
|
-
expect(getScene(usecase).compile.output).toMatchSnapshot(
|
|
479
|
+
expect(getScene({ usecase }).compile.output).toMatchSnapshot(
|
|
387
480
|
`${usecase} — tsc --noEmit diagnostics`,
|
|
388
481
|
);
|
|
389
482
|
});
|
|
390
483
|
|
|
391
484
|
then('tsc --noEmit exits 0', () => {
|
|
392
|
-
const scene = getScene(usecase);
|
|
485
|
+
const scene = getScene({ usecase });
|
|
393
486
|
if (scene.compile.status !== 0)
|
|
394
|
-
throw new
|
|
395
|
-
|
|
396
|
-
|
|
487
|
+
throw new ConstraintError(`tsc --noEmit failed for ${usecase}`, {
|
|
488
|
+
status: scene.compile.status,
|
|
489
|
+
output: scene.compile.output,
|
|
490
|
+
hint: 'a template the usecase ships does not compile; the diagnostics name it',
|
|
491
|
+
});
|
|
397
492
|
expect(scene.compile.status).toEqual(0);
|
|
398
493
|
});
|
|
399
494
|
});
|
|
400
495
|
|
|
401
496
|
when('[t2] the twice-applied repo is planned again', () => {
|
|
402
497
|
then('no file is flagged for an automatic fix (the apply converges)', () => {
|
|
403
|
-
expect(getPlan(usecase).automatic).toEqual([]);
|
|
498
|
+
expect(getPlan({ usecase }).automatic).toEqual([]);
|
|
404
499
|
});
|
|
405
500
|
|
|
406
501
|
then('no file the apply wrote is flagged by its own usecase', () => {
|
|
407
502
|
const cwd = realpathSync(tempDirs[usecase].repo);
|
|
408
|
-
const flaggedWritten = getPlan(usecase).manual.filter((file) =>
|
|
503
|
+
const flaggedWritten = getPlan({ usecase }).manual.filter((file) =>
|
|
409
504
|
existsSync(path.join(cwd, file)),
|
|
410
505
|
);
|
|
411
506
|
expect(flaggedWritten).toEqual([]);
|
|
412
507
|
});
|
|
413
508
|
|
|
414
509
|
then('the files left for a human to author match snapshot', () => {
|
|
415
|
-
expect(getPlan(usecase).manual).toMatchSnapshot(
|
|
510
|
+
expect(getPlan({ usecase }).manual).toMatchSnapshot(
|
|
416
511
|
`${usecase} — files flagged for a human`,
|
|
417
512
|
);
|
|
418
513
|
});
|
|
419
514
|
});
|
|
515
|
+
|
|
516
|
+
when('[t3] the emitted cycle check runs, as `npm run test:lint` does', () => {
|
|
517
|
+
then('the install holds pg-pool exactly where the usecase is declared to', () => {
|
|
518
|
+
const scene = getScene({ usecase });
|
|
519
|
+
const declared = USECASES_WITH_PG_POOL.includes(usecase);
|
|
520
|
+
if (scene.holdsPgPool !== declared)
|
|
521
|
+
throw new ConstraintError(`pg-pool presence drifted for ${usecase}`, {
|
|
522
|
+
holdsPgPool: scene.holdsPgPool,
|
|
523
|
+
declared,
|
|
524
|
+
hint: 'update USECASES_WITH_PG_POOL to match the install, so the pg-pool verdict below stays real',
|
|
525
|
+
});
|
|
526
|
+
expect(scene.holdsPgPool).toEqual(declared);
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
then('it reports no cycle through pg-pool', () => {
|
|
530
|
+
const { cycles } = asCycleSummary({
|
|
531
|
+
output: getScene({ usecase }).cycles.output,
|
|
532
|
+
});
|
|
533
|
+
const cyclesThroughPgPool = cycles.filter((cycle) =>
|
|
534
|
+
cycle.includes('pg-pool'),
|
|
535
|
+
);
|
|
536
|
+
if (cyclesThroughPgPool.length > 0)
|
|
537
|
+
throw new ConstraintError(`pg-pool cycle found for ${usecase}`, {
|
|
538
|
+
cyclesThroughPgPool,
|
|
539
|
+
hint: 'the shipped patches/pg-pool.patch did not apply; check its key in persist-with-rds package.json, and whether pg-pool moved the line (pnpm warns by name)',
|
|
540
|
+
});
|
|
541
|
+
expect(cyclesThroughPgPool).toEqual([]);
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
if (USECASES_WITH_PG_POOL.includes(usecase))
|
|
545
|
+
then('it analyzes the tree, so the pg-pool verdict is real', () => {
|
|
546
|
+
expect(
|
|
547
|
+
asCycleSummary({ output: getScene({ usecase }).cycles.output })
|
|
548
|
+
.analyzed,
|
|
549
|
+
).toEqual(true);
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
if (USECASES_WITH_PG_POOL.includes(usecase))
|
|
553
|
+
then('its emitted src imports pg, so dpdm can reach pg-pool', () => {
|
|
554
|
+
expect(getScene({ usecase }).srcImportsPg).toEqual(true);
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
// a drift in dpdm's cycle line format would parse to zero cycles and pass the pg-pool verdict blind
|
|
558
|
+
then('the parsed cycles agree with the verdict dpdm prints', () => {
|
|
559
|
+
const { output } = getScene({ usecase }).cycles;
|
|
560
|
+
const summary = asCycleSummary({ output });
|
|
561
|
+
if (!summary.analyzed) return expect(summary.cycles).toEqual([]);
|
|
562
|
+
const noneFound = output.includes('no circular dependency was found');
|
|
563
|
+
if (noneFound !== (summary.cycles.length === 0))
|
|
564
|
+
throw new MalfunctionError(`cycle parse drifted for ${usecase}`, {
|
|
565
|
+
noneFound,
|
|
566
|
+
cyclesParsed: summary.cycles.length,
|
|
567
|
+
hint: 'dpdm changed its cycle line format; update the line pattern in asCycleSummary',
|
|
568
|
+
});
|
|
569
|
+
expect(noneFound).toEqual(summary.cycles.length === 0);
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
// .note = the exit status rides in the snapshot, so a pass/fail flip shows in review. it is not
|
|
573
|
+
// asserted 0: a bare repo with no src entry, and cycles at floor versions outside pg-pool,
|
|
574
|
+
// each exit the check 1 for causes this clamp does not own
|
|
575
|
+
then('the exit status and the cycles it finds match snapshot', () => {
|
|
576
|
+
expect({
|
|
577
|
+
status: getScene({ usecase }).cycles.status,
|
|
578
|
+
...asCycleSummary({ output: getScene({ usecase }).cycles.output }),
|
|
579
|
+
}).toMatchSnapshot(`${usecase} — test:lint:cycles summary`);
|
|
580
|
+
});
|
|
581
|
+
});
|
|
420
582
|
});
|
|
421
583
|
});
|
|
422
584
|
});
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { UnexpectedCodePathError } from 'helpful-errors';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* .what = one section of a `.gitattributes`: a header comment, then its entries
|
|
5
|
+
* .why = a section is the unit a practice owns. `retired` names the forms a section once
|
|
6
|
+
* took, so a fix lifts them out of an extant file rather than leave them to linger. the
|
|
7
|
+
* gitignore declarers name the same concept `ignoresRetired`
|
|
8
|
+
* .note = `header.latest` must open with the declarer tag, `# [<declarer>] `. the tag is how every
|
|
9
|
+
* other declarer recognizes this section and keeps it in place
|
|
10
|
+
*/
|
|
11
|
+
export type GitattributesSection = {
|
|
12
|
+
header: { latest: string; retired: readonly string[] };
|
|
13
|
+
entries: { latest: readonly string[]; retired: readonly string[] };
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* .what = every practice that declares the repo-root `.gitattributes`, in emit order
|
|
18
|
+
* .why = git takes the last line that matches a path, so the order of sections decides which
|
|
19
|
+
* declarer wins where two match one path. `rhachet` sits last: its exceptions
|
|
20
|
+
* (`*.yield.*`, `.radio/**` → `-linguist-generated`) must be the last managed match for
|
|
21
|
+
* a route path, or a later collapse line (`*.test.ts`) would fold a yield or a radio
|
|
22
|
+
* record named like a test
|
|
23
|
+
* .note = a new declarer adds itself here, at the place its lines must hold. the util throws on
|
|
24
|
+
* a declarer absent from this list, so that place is decided, never defaulted
|
|
25
|
+
*/
|
|
26
|
+
export const declarersOrderedForGitattributes: readonly string[] = [
|
|
27
|
+
'git',
|
|
28
|
+
'tests-any',
|
|
29
|
+
'persist-with-rds',
|
|
30
|
+
'persist-with-dynamodb',
|
|
31
|
+
'rhachet',
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* .what = emits the `.gitattributes` a practice declares, given the repo's extant one
|
|
36
|
+
* .why = shared across every practice that declares this file. git takes the last line
|
|
37
|
+
* that matches a path, so order carries load, and a sorted union (the `.gitignore`
|
|
38
|
+
* method) cannot serve. every declarer must emit one identical layout, or each
|
|
39
|
+
* rewrites the file the other produced, on every `declapract apply`:
|
|
40
|
+
* - managed sections first, grouped by declarer in `declarersOrderedForGitattributes`
|
|
41
|
+
* order, each declarer's sections in the order it declares them
|
|
42
|
+
* - a tagged block whose declarer is not in that list (a hand-written tag) after the
|
|
43
|
+
* known declarers, in code-unit order
|
|
44
|
+
* - the repo's own lines last, in their own order, so a repo-own
|
|
45
|
+
* `<path> -linguist-generated` line wins over a managed collapse line
|
|
46
|
+
* .why = each declarer knows only its own sections. it recognizes another declarer's section
|
|
47
|
+
* by the tag in its header and keeps that block verbatim, in canonical place. so
|
|
48
|
+
* `fix_A(fix_B(x)) === fix_B(fix_A(x))`, and each is a fixed point
|
|
49
|
+
* .note = no fix edits another declarer's section, not even to drop a line it also holds. two
|
|
50
|
+
* sections may then both carry one entry (the dao `.generated/` fold, rds and dynamodb);
|
|
51
|
+
* both are collapse lines above every exception, so a repeat is inert under last-match-wins
|
|
52
|
+
*
|
|
53
|
+
* .note = a new declarer of the repo-root `.gitattributes` imports this rather than re-derive
|
|
54
|
+
* it: a hand-rolled copy can pass its own check and still oscillate against the rest.
|
|
55
|
+
* the cross-declarer clamps sit in `src/gitattributesDeclarers.declapract.test.ts` and
|
|
56
|
+
* `src/gitattributesDeclarers.declapract.integration.test.ts`.
|
|
57
|
+
*/
|
|
58
|
+
export const defineExpectedGitattributesContents = (input: {
|
|
59
|
+
contents: string | null;
|
|
60
|
+
declarer: string;
|
|
61
|
+
sections: readonly GitattributesSection[];
|
|
62
|
+
}): string => {
|
|
63
|
+
// reject a declarer with no decided place in the emit order
|
|
64
|
+
if (!declarersOrderedForGitattributes.includes(input.declarer))
|
|
65
|
+
throw new UnexpectedCodePathError(
|
|
66
|
+
'gitattributes declarer has no place in declarersOrderedForGitattributes',
|
|
67
|
+
{ declarer: input.declarer, declarers: declarersOrderedForGitattributes },
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// reject a section whose header does not carry this declarer's tag; the layout rests on it
|
|
71
|
+
input.sections.forEach((section) => {
|
|
72
|
+
if (asDeclarerOfHeader({ line: section.header.latest }) !== input.declarer)
|
|
73
|
+
throw new UnexpectedCodePathError(
|
|
74
|
+
'gitattributes section header lacks its declarer tag',
|
|
75
|
+
{ declarer: input.declarer, header: section.header.latest },
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// split the extant file into blocks; a blank run ends a block (crlf in, lf out)
|
|
80
|
+
const blocks = asGitattributesBlocks({ contents: input.contents ?? '' });
|
|
81
|
+
|
|
82
|
+
// keep each block another declarer tagged, verbatim
|
|
83
|
+
const sectionsForeign = asSectionsForeign({
|
|
84
|
+
blocks,
|
|
85
|
+
declarer: input.declarer,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// the rest is repo-own, minus every line this declarer manages, wherever it sits
|
|
89
|
+
const blocksRepoOwn = asBlocksRepoOwn({
|
|
90
|
+
blocks,
|
|
91
|
+
declarer: input.declarer,
|
|
92
|
+
sections: input.sections,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// order every managed section: by declarer rank, then as declared or as found
|
|
96
|
+
const sectionsOrdered = asSectionsOrdered({
|
|
97
|
+
sections: [
|
|
98
|
+
...sectionsForeign,
|
|
99
|
+
...asSectionsOwn({ declarer: input.declarer, sections: input.sections }),
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// emit managed sections, then the repo-own blocks, one blank line apart
|
|
104
|
+
return asGitattributesContents({
|
|
105
|
+
blocks: [...sectionsOrdered.map((section) => section.lines), ...blocksRepoOwn],
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* .what = the declarer a header line names via its `# [<declarer>] ` tag, or null
|
|
111
|
+
* .why = the tag is how a declarer tells another declarer's section from a repo-own comment
|
|
112
|
+
*/
|
|
113
|
+
const asDeclarerOfHeader = (input: { line: string }): string | null =>
|
|
114
|
+
input.line.match(/^# \[([a-z0-9-]+)\] /)?.[1] ?? null;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* .what = a managed section as it sits in a file: its declarer, then its lines (header first)
|
|
118
|
+
*/
|
|
119
|
+
type GitattributesSectionFound = { declarer: string; lines: readonly string[] };
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* .what = the blocks another declarer tagged, each kept verbatim
|
|
123
|
+
* .why = a declarer knows only its own sections; the tag is how it keeps every other one
|
|
124
|
+
*/
|
|
125
|
+
const asSectionsForeign = (input: {
|
|
126
|
+
blocks: readonly (readonly string[])[];
|
|
127
|
+
declarer: string;
|
|
128
|
+
}): GitattributesSectionFound[] =>
|
|
129
|
+
input.blocks
|
|
130
|
+
.map((lines) => ({
|
|
131
|
+
declarer: asDeclarerOfHeader({ line: lines[0]! }),
|
|
132
|
+
lines,
|
|
133
|
+
}))
|
|
134
|
+
.filter(
|
|
135
|
+
(block): block is GitattributesSectionFound =>
|
|
136
|
+
block.declarer !== null && block.declarer !== input.declarer,
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* .what = the repo's own blocks: untagged or this declarer's, minus each line it manages
|
|
141
|
+
* .why = a managed line found anywhere (a hand copy, a prior form) lifts into its section
|
|
142
|
+
*/
|
|
143
|
+
const asBlocksRepoOwn = (input: {
|
|
144
|
+
blocks: readonly (readonly string[])[];
|
|
145
|
+
declarer: string;
|
|
146
|
+
sections: readonly GitattributesSection[];
|
|
147
|
+
}): string[][] => {
|
|
148
|
+
const linesManaged = asLinesManaged({ sections: input.sections });
|
|
149
|
+
return input.blocks
|
|
150
|
+
.filter((lines) => {
|
|
151
|
+
const declarer = asDeclarerOfHeader({ line: lines[0]! });
|
|
152
|
+
return declarer === null || declarer === input.declarer;
|
|
153
|
+
})
|
|
154
|
+
.map((lines) =>
|
|
155
|
+
lines.filter(
|
|
156
|
+
(line) =>
|
|
157
|
+
!linesManaged.has(line.trim()) &&
|
|
158
|
+
asDeclarerOfHeader({ line }) !== input.declarer,
|
|
159
|
+
),
|
|
160
|
+
)
|
|
161
|
+
.filter((lines) => lines.length > 0);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* .what = every line a declarer manages: each header and entry, latest and prior
|
|
166
|
+
*/
|
|
167
|
+
const asLinesManaged = (input: {
|
|
168
|
+
sections: readonly GitattributesSection[];
|
|
169
|
+
}): ReadonlySet<string> =>
|
|
170
|
+
new Set(
|
|
171
|
+
input.sections.flatMap((section) => [
|
|
172
|
+
section.header.latest,
|
|
173
|
+
...section.header.retired,
|
|
174
|
+
...section.entries.latest,
|
|
175
|
+
...section.entries.retired,
|
|
176
|
+
]),
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* .what = this declarer's sections, in their latest form
|
|
181
|
+
*/
|
|
182
|
+
const asSectionsOwn = (input: {
|
|
183
|
+
declarer: string;
|
|
184
|
+
sections: readonly GitattributesSection[];
|
|
185
|
+
}): GitattributesSectionFound[] =>
|
|
186
|
+
input.sections.map((section) => ({
|
|
187
|
+
declarer: input.declarer,
|
|
188
|
+
lines: [section.header.latest, ...section.entries.latest],
|
|
189
|
+
}));
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* .what = sections sorted by declarer rank, then by declarer code unit
|
|
193
|
+
* .why = a stable sort keeps each declarer's own sections in the order found
|
|
194
|
+
*/
|
|
195
|
+
const asSectionsOrdered = (input: {
|
|
196
|
+
sections: readonly GitattributesSectionFound[];
|
|
197
|
+
}): GitattributesSectionFound[] =>
|
|
198
|
+
[...input.sections].sort(
|
|
199
|
+
(a, b) =>
|
|
200
|
+
asDeclarerRank({ declarer: a.declarer }) -
|
|
201
|
+
asDeclarerRank({ declarer: b.declarer }) ||
|
|
202
|
+
asCodeUnitOrder({ a: a.declarer, b: b.declarer }),
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* .what = the file text: blocks one blank line apart, one newline at the end
|
|
207
|
+
*/
|
|
208
|
+
const asGitattributesContents = (input: {
|
|
209
|
+
blocks: readonly (readonly string[])[];
|
|
210
|
+
}): string =>
|
|
211
|
+
`${input.blocks.map((lines) => lines.join('\n')).join('\n\n')}\n`;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* .what = a declarer's place in the emit order; a declarer absent from the list ranks after all
|
|
215
|
+
* .why = a hand-written tag must still sort the same way in every declarer's output
|
|
216
|
+
*/
|
|
217
|
+
const asDeclarerRank = (input: { declarer: string }): number => {
|
|
218
|
+
const rank = declarersOrderedForGitattributes.indexOf(input.declarer);
|
|
219
|
+
return rank === -1 ? declarersOrderedForGitattributes.length : rank;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* .what = a sort comparator by code unit: negative, zero, or positive
|
|
224
|
+
* .why = `localeCompare` varies by host locale; every declarer must sort one way on every host
|
|
225
|
+
*/
|
|
226
|
+
const asCodeUnitOrder = (input: { a: string; b: string }): number => {
|
|
227
|
+
if (input.a < input.b) return -1;
|
|
228
|
+
if (input.a > input.b) return 1;
|
|
229
|
+
return 0;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* .what = parses a `.gitattributes` into blocks: runs of lines apart by blank lines
|
|
234
|
+
* .why = a section is one block (header + entries), so a blank line bounds it
|
|
235
|
+
*/
|
|
236
|
+
const asGitattributesBlocks = (input: { contents: string }): string[][] =>
|
|
237
|
+
input.contents
|
|
238
|
+
.split('\n')
|
|
239
|
+
.map((line) => line.replace(/\r$/, ''))
|
|
240
|
+
.reduce<string[][]>(
|
|
241
|
+
(blocks, line) =>
|
|
242
|
+
line.trim() === ''
|
|
243
|
+
? [...blocks, []]
|
|
244
|
+
: [...blocks.slice(0, -1), [...(blocks.slice(-1)[0] ?? []), line]],
|
|
245
|
+
[[]],
|
|
246
|
+
)
|
|
247
|
+
.filter((block) => block.length > 0);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "declapract best practices declarations for typescript",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.50.0",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|
|
@@ -77,15 +77,15 @@
|
|
|
77
77
|
"esbuild-register": "3.6.0",
|
|
78
78
|
"husky": "8.0.3",
|
|
79
79
|
"jest": "30.2.0",
|
|
80
|
-
"rhachet": "1.
|
|
80
|
+
"rhachet": "1.50.1",
|
|
81
81
|
"rhachet-brains-anthropic": "0.4.3",
|
|
82
82
|
"rhachet-brains-fireworksai": "0.2.3",
|
|
83
|
-
"rhachet-brains-openrouter": "0.1.
|
|
83
|
+
"rhachet-brains-openrouter": "0.1.4",
|
|
84
84
|
"rhachet-brains-xai": "0.3.3",
|
|
85
|
-
"rhachet-roles-bhrain": "0.
|
|
85
|
+
"rhachet-roles-bhrain": "0.42.4",
|
|
86
86
|
"rhachet-roles-bhrowser": "0.1.0",
|
|
87
|
-
"rhachet-roles-bhuild": "0.
|
|
88
|
-
"rhachet-roles-ehmpathy": "1.
|
|
87
|
+
"rhachet-roles-bhuild": "0.24.0",
|
|
88
|
+
"rhachet-roles-ehmpathy": "1.41.0",
|
|
89
89
|
"rhachet-roles-ghlitch": "0.3.0",
|
|
90
90
|
"rhachet-roles-rhachet": "0.1.7",
|
|
91
91
|
"sdk-aws-lambda": "0.7.2",
|
package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# exclude package locks from git diff; https://stackoverflow.com/a/72834452/3068233
|
|
2
|
-
pnpm-lock.yaml -diff
|
|
3
|
-
package-lock.json -diff
|
|
4
|
-
|
|
5
|
-
# auto-resolve lock file conflicts by taking theirs; run install after merge
|
|
6
|
-
pnpm-lock.yaml merge=theirs
|
|
7
|
-
package-lock.json merge=theirs
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# exclude package locks from git diff; https://stackoverflow.com/a/72834452/3068233
|
|
2
|
-
pnpm-lock.yaml -diff
|
|
3
|
-
package-lock.json -diff
|
|
4
|
-
|
|
5
|
-
# auto-resolve lock file conflicts by taking theirs; run install after merge
|
|
6
|
-
pnpm-lock.yaml merge=theirs
|
|
7
|
-
package-lock.json merge=theirs
|