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.
Files changed (440) hide show
  1. package/dist/.test/assets/cicd-common/declarations/declapract.declare.yml +8 -0
  2. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.declapract.integration.test.ts +597 -0
  3. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/.test.yml +19 -0
  4. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/consumer-owned.yml +21 -0
  5. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/review.yml +26 -0
  6. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/declapract.use.yml +6 -0
  7. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/package.json +4 -0
  8. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/.declapract.integration.test.ts.snap +604 -0
  9. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/declastruct-insync-grep.declapract.integration.test.ts.snap +3 -0
  10. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/report-slow-tests.play.declapract.integration.test.ts.snap +28 -0
  11. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/has-changelog-file/changelog.md.declapract.ts +11 -0
  12. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci-on-commit.yml.declapract.ts +3 -0
  13. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci_on_commit.yml.declapract.ts +3 -0
  14. 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
  15. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test-on-commit.yml.declapract.ts +3 -0
  16. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test_on_commit.yml.declapract.ts +3 -0
  17. 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
  18. 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
  19. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.declapract.readme.md +8 -0
  20. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/please-release/action.yml +469 -0
  21. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/test-shards-setup/action.yml +68 -0
  22. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.declastruct.yml +218 -0
  23. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.install.yml +56 -0
  24. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml +434 -0
  25. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml.declapract.ts +26 -0
  26. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/release.yml +32 -0
  27. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/report-slow-tests.sh +65 -0
  28. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/review.yml +26 -0
  29. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml +25 -0
  30. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml.declapract.ts +15 -0
  31. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/declastruct-insync-grep.declapract.integration.test.ts +49 -0
  32. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/report-slow-tests.play.declapract.integration.test.ts +161 -0
  33. package/dist/.test/assets/cicd-common/declarations/useCases.yml +11 -0
  34. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  35. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  36. 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
  37. 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
  38. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  39. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
  40. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  41. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/package.json +5 -0
  42. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  43. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  44. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/.declapract.integration.test.ts +15 -21
  45. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.declapract.integration.test.ts +2 -2
  46. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  47. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  48. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  49. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  50. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  51. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  52. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  53. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  54. 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
  55. 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
  56. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  57. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  58. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  59. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  60. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  61. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  62. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  63. package/dist/.test/assets/expo-migration/declarations/practices/git/.declapract.integration.test.ts +2 -2
  64. package/dist/.test/assets/expo-migration/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  65. package/dist/.test/assets/expo-migration/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  66. package/dist/.test/assets/expo-migration/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  67. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  68. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  69. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  70. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  71. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  72. 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
  73. 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
  74. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  75. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  76. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  77. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  78. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  79. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  80. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  81. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  82. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  83. package/dist/.test/assets/git/declarations/declapract.declare.yml +8 -0
  84. package/dist/.test/assets/git/declarations/practices/git/.declapract.integration.test.ts +1001 -0
  85. package/dist/.test/assets/git/declarations/practices/git/.gitattributes.declapract.integration.test.ts +120 -0
  86. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/.gitattributes +6 -0
  87. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +7 -0
  88. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/package.json +4 -0
  89. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/declapract.use.yml +6 -0
  90. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/package.json +4 -0
  91. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/declapract.use.yml +9 -0
  92. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/package.json +4 -0
  93. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +55 -0
  94. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +24 -0
  95. package/dist/.test/assets/git/declarations/practices/git/best-practice/.declapract.readme.md +60 -0
  96. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitattributes.declapract.ts +77 -0
  97. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitignore.declapract.ts +100 -0
  98. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.declapract.integration.test.ts +181 -0
  99. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.declare.yml +4 -0
  100. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.use.yml +11 -0
  101. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/package.json +1 -0
  102. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/useCases.yml +8 -0
  103. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/__snapshots__/.declapract.integration.test.ts.snap +234 -0
  104. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  105. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/codegen.dynamodb.dao.ts +16 -0
  106. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json +16 -0
  107. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json.declapract.ts +3 -0
  108. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/provision/docker/integration-test-db/docker-compose.yml +9 -0
  109. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.declapract.integration.test.ts +237 -0
  110. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +159 -0
  111. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declapract.use.yml +20 -0
  112. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declarations/declapract.declare.yml +6 -0
  113. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/package.json +4 -0
  114. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/codegen.sql.dao.yml +20 -0
  115. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.declare.yml +4 -0
  116. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.use.yml +19 -0
  117. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/package.json +4 -0
  118. 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
  119. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.declare.yml +4 -0
  120. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.use.yml +21 -0
  121. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/package.json +4 -0
  122. 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
  123. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
  124. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
  125. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
  126. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
  127. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  128. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  129. 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
  130. 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
  131. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  132. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +77 -0
  133. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/config-validates-schema.declapract.integration.test.ts.snap +500 -0
  134. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/database-wrappers-typecheck.declapract.integration.test.ts.snap +10 -0
  135. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
  136. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/engine-upgrade.declapract.integration.test.ts.snap +151 -0
  137. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  138. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
  139. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/ssm-param-names.declapract.integration.test.ts.snap +9 -0
  140. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
  141. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/with-connection-in-input.declapract.integration.test.ts.snap +57 -0
  142. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.integration.test.ts +71 -0
  143. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.readme.md +6 -0
  144. 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
  145. 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
  146. 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
  147. 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
  148. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/__snapshots__/.declapract.integration.test.ts.snap +39 -0
  149. 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
  150. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/.declapract.readme.md +5 -0
  151. 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
  152. 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
  153. 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
  154. 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
  155. 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
  156. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-config-file-names/codegen.sql.yml.declapract.ts +3 -0
  157. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +23 -0
  158. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.integration.test.ts +221 -0
  159. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.readme.md +11 -0
  160. 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
  161. 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
  162. 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
  163. 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
  164. 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
  165. 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
  166. 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
  167. 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
  168. 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
  169. 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
  170. 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
  171. 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
  172. 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
  173. 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
  174. 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
  175. 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
  176. 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
  177. 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
  178. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/__snapshots__/.declapract.integration.test.ts.snap +75 -0
  179. 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
  180. 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
  181. 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
  182. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/.declapract.readme.md +1 -0
  183. 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
  184. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/.declapract.readme.md +1 -0
  185. 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
  186. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/.declapract.readme.md +1 -0
  187. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json +8 -0
  188. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +10 -0
  189. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json +9 -0
  190. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +22 -0
  191. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-param-placeholder/config/<star>.json.declapract.ts +14 -0
  192. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.integration.test.ts +86 -0
  193. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.readme.md +9 -0
  194. 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
  195. 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
  196. 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
  197. 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
  198. 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
  199. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/__snapshots__/.declapract.integration.test.ts.snap +72 -0
  200. 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
  201. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/.declapract.readme.md +1 -0
  202. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +12 -0
  203. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +13 -0
  204. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.declapract.integration.test.ts +95 -0
  205. 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
  206. 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
  207. 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
  208. 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
  209. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/__snapshots__/.declapract.integration.test.ts.snap +60 -0
  210. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/provision/aws/product/parameter-store.tf.declapract.ts +94 -0
  211. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.declapract.readme.md +10 -0
  212. 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
  213. 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
  214. 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
  215. 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
  216. 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
  217. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +114 -0
  218. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  219. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +18 -0
  220. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml.declapract.ts +35 -0
  221. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.schema.yml +6 -0
  222. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.types.yml +16 -0
  223. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json +40 -0
  224. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json.declapract.ts +11 -0
  225. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json +40 -0
  226. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +11 -0
  227. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json +37 -0
  228. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +11 -0
  229. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json +36 -0
  230. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json.declapract.ts +3 -0
  231. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  232. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/readme.md +113 -0
  233. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +60 -0
  234. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.ts +30 -0
  235. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile +7 -0
  236. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile.declapract.ts +37 -0
  237. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.integration.test.ts +115 -0
  238. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.sh +165 -0
  239. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/compose.sh +43 -0
  240. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/docker-compose.yml +19 -0
  241. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/.gitignore +3 -0
  242. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/readme.md +3 -0
  243. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +25 -0
  244. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/connection.config.js +36 -0
  245. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/control.yml +7 -0
  246. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +97 -0
  247. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.database.sql +10 -0
  248. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql +16 -0
  249. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +46 -0
  250. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.schema.sql +11 -0
  251. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.cicd.sql +14 -0
  252. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.datalakedb.sql +12 -0
  253. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/default_transaction_isolation.sql +6 -0
  254. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/user.service.sql +16 -0
  255. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml +9 -0
  256. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml.declapract.ts +3 -0
  257. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbIdentity.ts +52 -0
  258. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbPort.ts +17 -0
  259. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +77 -0
  260. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.test.ts +82 -0
  261. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.ts +52 -0
  262. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/databaseClientTimeouts.ts +14 -0
  263. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts +10 -0
  264. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts +119 -0
  265. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabasePort.ts +30 -0
  266. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.test.ts +51 -0
  267. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.ts +86 -0
  268. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +54 -0
  269. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +35 -0
  270. package/dist/.test/assets/git/declarations/practices/persist-with-rds/config-validates-schema.declapract.integration.test.ts +332 -0
  271. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-client.declapract.integration.test.ts +291 -0
  272. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-wrappers-typecheck.declapract.integration.test.ts +225 -0
  273. package/dist/.test/assets/git/declarations/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
  274. package/dist/.test/assets/git/declarations/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
  275. package/dist/.test/assets/git/declarations/practices/persist-with-rds/engine-upgrade.declapract.integration.test.ts +243 -0
  276. package/dist/.test/assets/git/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  277. package/dist/.test/assets/git/declarations/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
  278. package/dist/.test/assets/git/declarations/practices/persist-with-rds/ssm-param-names.declapract.integration.test.ts +154 -0
  279. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-per-worktree.declapract.integration.test.ts +332 -0
  280. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
  281. package/dist/.test/assets/git/declarations/practices/persist-with-rds/with-connection-in-input.declapract.integration.test.ts +97 -0
  282. package/dist/.test/assets/git/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
  283. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +9 -0
  284. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
  285. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
  286. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
  287. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/.agent/keyrack.yml +9 -0
  288. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.node.yml +4 -0
  289. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.yml +4 -0
  290. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/package.json +4 -0
  291. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/declapract.use.yml +4 -0
  292. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/package.json +22 -0
  293. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  294. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
  295. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +33 -0
  296. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/keyrack-yml-findsert.declapract.integration.test.ts.snap +28 -0
  297. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/self-link-build-order.declapract.integration.test.ts.snap +81 -0
  298. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/.declapract.readme.md +11 -0
  299. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/rhachet.use.ts.declapract.ts +12 -0
  300. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +59 -0
  301. 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
  302. 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
  303. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
  304. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json +5 -0
  305. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +88 -0
  306. 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
  307. 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
  308. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
  309. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/keyrack.yml.declapract.ts +143 -0
  310. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +22 -0
  311. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +189 -0
  312. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.declapract.readme.md +40 -0
  313. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  314. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +94 -0
  315. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json +19 -0
  316. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json.declapract.ts +51 -0
  317. package/dist/.test/assets/git/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +91 -0
  318. package/dist/.test/assets/git/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +149 -0
  319. package/dist/.test/assets/git/declarations/practices/rhachet/keyrack-yml-findsert.declapract.integration.test.ts +105 -0
  320. package/dist/.test/assets/git/declarations/practices/rhachet/self-link-build-order.declapract.integration.test.ts +88 -0
  321. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/blackbox/lambdas/consumeSESEmailEventFromSNS.acceptance.test.ts +23 -0
  322. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/declapract.use.yml +9 -0
  323. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/package.json +4 -0
  324. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  325. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/declapract.use.yml +9 -0
  326. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/package.json +4 -0
  327. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  328. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/declapract.use.yml +9 -0
  329. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/package.json +4 -0
  330. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  331. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/livedb-wake-branches.declapract.integration.test.ts.snap +6 -0
  332. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/old-acceptance-test-utils.declapract.integration.test.ts.snap +162 -0
  333. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/test-kind-seam.declapract.integration.test.ts.snap +9 -0
  334. package/dist/.test/assets/git/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +111 -0
  335. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.integration.test.ts +69 -0
  336. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.readme.md +19 -0
  337. 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
  338. 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
  339. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/__snapshots__/.declapract.integration.test.ts.snap +43 -0
  340. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/package.json.declapract.ts +81 -0
  341. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/.declapract.readme.md +1 -0
  342. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/jest.<star>.js.declapract.ts +17 -0
  343. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/.declapract.readme.md +8 -0
  344. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.js +3 -0
  345. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.ts +3 -0
  346. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.integration.test.ts +83 -0
  347. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.readme.md +22 -0
  348. 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
  349. 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
  350. 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
  351. 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
  352. 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
  353. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/accept.blackbox/<star><star>/<star>.declapract.ts +19 -0
  354. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/acceptance/<star><star>/<star>.declapract.ts +19 -0
  355. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +31 -0
  356. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/<star><star>/<star>.ts.declapract.ts +25 -0
  357. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/getDataFromLastOpenBracketAtStartOfLine.ts.declapract.ts +3 -0
  358. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/invokeLambda.ts.declapract.ts +3 -0
  359. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +49 -0
  360. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-2/blackbox/lambdas/<star>.ts.declapract.ts +27 -0
  361. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/_utils/environment.ts.declapract.ts +3 -0
  362. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/lambdas/<star>.ts.declapract.ts +23 -0
  363. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/.declapract.readme.md +3 -0
  364. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.acceptance.ts.declapract.ts +11 -0
  365. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.integration.ts.declapract.ts +11 -0
  366. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/.declapract.readme.md +8 -0
  367. 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
  368. 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
  369. 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
  370. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.readme.md +52 -0
  371. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.todo.md +3 -0
  372. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  373. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json +18 -0
  374. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json.declapract.ts +3 -0
  375. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/.test/useWakeOfLivedb.ts +209 -0
  376. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.integration.test.ts.declapract.ts +8 -0
  377. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.test.ts.declapract.ts +7 -0
  378. package/dist/.test/assets/git/declarations/practices/tests-any/build-ifstale.declapract.integration.test.ts +124 -0
  379. package/dist/.test/assets/git/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  380. package/dist/.test/assets/git/declarations/practices/tests-any/livedb-wake-branches.declapract.integration.test.ts +315 -0
  381. package/dist/.test/assets/git/declarations/practices/tests-any/old-acceptance-test-utils.declapract.integration.test.ts +122 -0
  382. package/dist/.test/assets/git/declarations/practices/tests-any/package.json.shell-flags.declapract.integration.test.ts +139 -0
  383. package/dist/.test/assets/git/declarations/practices/tests-any/test-kind-seam.declapract.integration.test.ts +87 -0
  384. package/dist/.test/assets/git/declarations/useCases.yml +29 -0
  385. package/dist/.test/assets/{expo-fullusecase/declarations/practices/git/best-practice → git/repo-with-all-gitattributes-declarers}/.gitattributes +3 -0
  386. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/declapract.use.yml +26 -0
  387. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/package.json +4 -0
  388. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  389. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  390. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  391. 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
  392. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
  393. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  394. package/dist/.test/assets/pnpm/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  395. package/dist/.test/assets/pnpm/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  396. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  397. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  398. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  399. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  400. package/dist/__snapshots__/gitattributesDeclarers.declapract.integration.test.ts.snap +79 -0
  401. package/dist/__snapshots__/repoSkills.declapract.acceptance.test.ts.snap +512 -0
  402. package/dist/__snapshots__/typecheckBestPracticeTemplates.declapract.integration.test.ts.snap +80 -0
  403. package/dist/gitattributesDeclarers.declapract.integration.test.ts +438 -0
  404. package/dist/practiceOwnerPerFile.declapract.integration.test.ts +53 -0
  405. package/dist/practices/cicd-common/.declapract.integration.test.ts +15 -21
  406. package/dist/practices/git/.declapract.integration.test.ts +2 -2
  407. package/dist/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  408. package/dist/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  409. package/dist/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  410. package/dist/practices/git/best-practice/.declapract.readme.md +37 -0
  411. package/dist/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  412. package/dist/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  413. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  414. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  415. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
  416. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
  417. package/dist/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  418. package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
  419. package/dist/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  420. package/dist/practices/persist-with-rds/best-practice/package.json +5 -0
  421. package/dist/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  422. package/dist/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  423. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  424. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  425. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  426. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
  427. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
  428. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  429. package/dist/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  430. package/dist/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  431. package/dist/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  432. package/dist/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  433. package/dist/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  434. package/dist/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  435. package/dist/repoSkills.declapract.acceptance.test.ts +1150 -0
  436. package/dist/typecheckBestPracticeTemplates.declapract.integration.test.ts +181 -19
  437. package/dist/utils/defineExpectedGitattributesContents.ts +247 -0
  438. package/package.json +6 -6
  439. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes +0 -7
  440. 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 { command: 'npx', argsBefore: ['--yes', packageManager] };
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: Date.now() - installedAt,
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 Error(
374
- `pnpm install failed for ${usecase} (exit ${scene.install.status}):\n${scene.install.output}`,
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 Error(
395
- `tsc --noEmit failed for ${usecase} (exit ${scene.compile.status}):\n${scene.compile.output}`,
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.49.14",
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.49.2",
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.3",
83
+ "rhachet-brains-openrouter": "0.1.4",
84
84
  "rhachet-brains-xai": "0.3.3",
85
- "rhachet-roles-bhrain": "0.39.3",
85
+ "rhachet-roles-bhrain": "0.42.4",
86
86
  "rhachet-roles-bhrowser": "0.1.0",
87
- "rhachet-roles-bhuild": "0.23.2",
88
- "rhachet-roles-ehmpathy": "1.39.5",
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",
@@ -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