declapract-typescript-ehmpathy 0.49.15 → 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 (390) 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/best-practice/.declapract.readme.md +7 -0
  35. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  36. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/.declapract.integration.test.ts +15 -21
  37. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.declapract.integration.test.ts +2 -2
  38. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  39. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  40. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  41. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  42. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  43. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  44. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  45. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  46. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  47. package/dist/.test/assets/expo-migration/declarations/practices/git/.declapract.integration.test.ts +2 -2
  48. package/dist/.test/assets/expo-migration/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  49. package/dist/.test/assets/expo-migration/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  50. package/dist/.test/assets/expo-migration/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  51. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  52. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  53. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  54. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  55. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  56. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  57. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  58. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  59. package/dist/.test/assets/git/declarations/declapract.declare.yml +8 -0
  60. package/dist/.test/assets/git/declarations/practices/git/.declapract.integration.test.ts +1001 -0
  61. package/dist/.test/assets/git/declarations/practices/git/.gitattributes.declapract.integration.test.ts +120 -0
  62. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/.gitattributes +6 -0
  63. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +7 -0
  64. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/package.json +4 -0
  65. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/declapract.use.yml +6 -0
  66. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/package.json +4 -0
  67. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/declapract.use.yml +9 -0
  68. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/package.json +4 -0
  69. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +55 -0
  70. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +24 -0
  71. package/dist/.test/assets/git/declarations/practices/git/best-practice/.declapract.readme.md +60 -0
  72. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitattributes.declapract.ts +77 -0
  73. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitignore.declapract.ts +100 -0
  74. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.declapract.integration.test.ts +181 -0
  75. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.declare.yml +4 -0
  76. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.use.yml +11 -0
  77. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/package.json +1 -0
  78. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/useCases.yml +8 -0
  79. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/__snapshots__/.declapract.integration.test.ts.snap +234 -0
  80. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  81. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/codegen.dynamodb.dao.ts +16 -0
  82. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json +16 -0
  83. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json.declapract.ts +3 -0
  84. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/provision/docker/integration-test-db/docker-compose.yml +9 -0
  85. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.declapract.integration.test.ts +237 -0
  86. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +159 -0
  87. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declapract.use.yml +20 -0
  88. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declarations/declapract.declare.yml +6 -0
  89. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/package.json +4 -0
  90. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/codegen.sql.dao.yml +20 -0
  91. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.declare.yml +4 -0
  92. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.use.yml +19 -0
  93. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/package.json +4 -0
  94. 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
  95. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.declare.yml +4 -0
  96. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.use.yml +21 -0
  97. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/package.json +4 -0
  98. 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
  99. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
  100. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
  101. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
  102. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
  103. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  104. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  105. 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
  106. 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
  107. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  108. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +77 -0
  109. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/config-validates-schema.declapract.integration.test.ts.snap +500 -0
  110. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/database-wrappers-typecheck.declapract.integration.test.ts.snap +10 -0
  111. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
  112. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/engine-upgrade.declapract.integration.test.ts.snap +151 -0
  113. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  114. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
  115. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/ssm-param-names.declapract.integration.test.ts.snap +9 -0
  116. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
  117. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/with-connection-in-input.declapract.integration.test.ts.snap +57 -0
  118. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.integration.test.ts +71 -0
  119. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.readme.md +6 -0
  120. 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
  121. 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
  122. 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
  123. 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
  124. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/__snapshots__/.declapract.integration.test.ts.snap +39 -0
  125. 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
  126. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/.declapract.readme.md +5 -0
  127. 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
  128. 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
  129. 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
  130. 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
  131. 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
  132. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-config-file-names/codegen.sql.yml.declapract.ts +3 -0
  133. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +23 -0
  134. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.integration.test.ts +221 -0
  135. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.readme.md +11 -0
  136. 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
  137. 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
  138. 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
  139. 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
  140. 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
  141. 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
  142. 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
  143. 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
  144. 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
  145. 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
  146. 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
  147. 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
  148. 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
  149. 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
  150. 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
  151. 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
  152. 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
  153. 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
  154. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/__snapshots__/.declapract.integration.test.ts.snap +75 -0
  155. 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
  156. 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
  157. 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
  158. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/.declapract.readme.md +1 -0
  159. 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
  160. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/.declapract.readme.md +1 -0
  161. 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
  162. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/.declapract.readme.md +1 -0
  163. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json +8 -0
  164. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +10 -0
  165. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json +9 -0
  166. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +22 -0
  167. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-param-placeholder/config/<star>.json.declapract.ts +14 -0
  168. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.integration.test.ts +86 -0
  169. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.readme.md +9 -0
  170. 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
  171. 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
  172. 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
  173. 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
  174. 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
  175. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/__snapshots__/.declapract.integration.test.ts.snap +72 -0
  176. 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
  177. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/.declapract.readme.md +1 -0
  178. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +12 -0
  179. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +13 -0
  180. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.declapract.integration.test.ts +95 -0
  181. 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
  182. 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
  183. 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
  184. 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
  185. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/__snapshots__/.declapract.integration.test.ts.snap +60 -0
  186. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/provision/aws/product/parameter-store.tf.declapract.ts +94 -0
  187. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.declapract.readme.md +10 -0
  188. 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
  189. 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
  190. 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
  191. 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
  192. 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
  193. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +114 -0
  194. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  195. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +18 -0
  196. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml.declapract.ts +35 -0
  197. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.schema.yml +6 -0
  198. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.types.yml +16 -0
  199. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json +40 -0
  200. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json.declapract.ts +11 -0
  201. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json +40 -0
  202. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +11 -0
  203. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json +37 -0
  204. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +11 -0
  205. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json +36 -0
  206. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json.declapract.ts +3 -0
  207. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  208. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/readme.md +113 -0
  209. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +60 -0
  210. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.ts +30 -0
  211. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile +7 -0
  212. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile.declapract.ts +37 -0
  213. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.integration.test.ts +115 -0
  214. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.sh +165 -0
  215. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/compose.sh +43 -0
  216. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/docker-compose.yml +19 -0
  217. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/.gitignore +3 -0
  218. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/readme.md +3 -0
  219. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +25 -0
  220. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/connection.config.js +36 -0
  221. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/control.yml +7 -0
  222. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +97 -0
  223. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.database.sql +10 -0
  224. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql +16 -0
  225. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +46 -0
  226. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.schema.sql +11 -0
  227. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.cicd.sql +14 -0
  228. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.datalakedb.sql +12 -0
  229. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/default_transaction_isolation.sql +6 -0
  230. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/user.service.sql +16 -0
  231. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml +9 -0
  232. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml.declapract.ts +3 -0
  233. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbIdentity.ts +52 -0
  234. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbPort.ts +17 -0
  235. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +77 -0
  236. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.test.ts +82 -0
  237. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.ts +52 -0
  238. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/databaseClientTimeouts.ts +14 -0
  239. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts +10 -0
  240. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts +119 -0
  241. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabasePort.ts +30 -0
  242. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.test.ts +51 -0
  243. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.ts +86 -0
  244. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +54 -0
  245. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +35 -0
  246. package/dist/.test/assets/git/declarations/practices/persist-with-rds/config-validates-schema.declapract.integration.test.ts +332 -0
  247. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-client.declapract.integration.test.ts +291 -0
  248. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-wrappers-typecheck.declapract.integration.test.ts +225 -0
  249. package/dist/.test/assets/git/declarations/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
  250. package/dist/.test/assets/git/declarations/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
  251. package/dist/.test/assets/git/declarations/practices/persist-with-rds/engine-upgrade.declapract.integration.test.ts +243 -0
  252. package/dist/.test/assets/git/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  253. package/dist/.test/assets/git/declarations/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
  254. package/dist/.test/assets/git/declarations/practices/persist-with-rds/ssm-param-names.declapract.integration.test.ts +154 -0
  255. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-per-worktree.declapract.integration.test.ts +332 -0
  256. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
  257. package/dist/.test/assets/git/declarations/practices/persist-with-rds/with-connection-in-input.declapract.integration.test.ts +97 -0
  258. package/dist/.test/assets/git/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
  259. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +9 -0
  260. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
  261. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
  262. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
  263. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/.agent/keyrack.yml +9 -0
  264. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.node.yml +4 -0
  265. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.yml +4 -0
  266. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/package.json +4 -0
  267. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/declapract.use.yml +4 -0
  268. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/package.json +22 -0
  269. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  270. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
  271. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +33 -0
  272. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/keyrack-yml-findsert.declapract.integration.test.ts.snap +28 -0
  273. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/self-link-build-order.declapract.integration.test.ts.snap +81 -0
  274. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/.declapract.readme.md +11 -0
  275. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/rhachet.use.ts.declapract.ts +12 -0
  276. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +59 -0
  277. 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
  278. 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
  279. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
  280. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json +5 -0
  281. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +88 -0
  282. 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
  283. 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
  284. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
  285. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/keyrack.yml.declapract.ts +143 -0
  286. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +22 -0
  287. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +189 -0
  288. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.declapract.readme.md +40 -0
  289. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  290. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +94 -0
  291. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json +19 -0
  292. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json.declapract.ts +51 -0
  293. package/dist/.test/assets/git/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +91 -0
  294. package/dist/.test/assets/git/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +149 -0
  295. package/dist/.test/assets/git/declarations/practices/rhachet/keyrack-yml-findsert.declapract.integration.test.ts +105 -0
  296. package/dist/.test/assets/git/declarations/practices/rhachet/self-link-build-order.declapract.integration.test.ts +88 -0
  297. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/blackbox/lambdas/consumeSESEmailEventFromSNS.acceptance.test.ts +23 -0
  298. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/declapract.use.yml +9 -0
  299. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/package.json +4 -0
  300. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  301. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/declapract.use.yml +9 -0
  302. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/package.json +4 -0
  303. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  304. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/declapract.use.yml +9 -0
  305. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/package.json +4 -0
  306. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  307. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/livedb-wake-branches.declapract.integration.test.ts.snap +6 -0
  308. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/old-acceptance-test-utils.declapract.integration.test.ts.snap +162 -0
  309. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/test-kind-seam.declapract.integration.test.ts.snap +9 -0
  310. package/dist/.test/assets/git/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +111 -0
  311. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.integration.test.ts +69 -0
  312. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.readme.md +19 -0
  313. 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
  314. 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
  315. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/__snapshots__/.declapract.integration.test.ts.snap +43 -0
  316. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/package.json.declapract.ts +81 -0
  317. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/.declapract.readme.md +1 -0
  318. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/jest.<star>.js.declapract.ts +17 -0
  319. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/.declapract.readme.md +8 -0
  320. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.js +3 -0
  321. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.ts +3 -0
  322. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.integration.test.ts +83 -0
  323. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.readme.md +22 -0
  324. 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
  325. 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
  326. 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
  327. 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
  328. 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
  329. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/accept.blackbox/<star><star>/<star>.declapract.ts +19 -0
  330. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/acceptance/<star><star>/<star>.declapract.ts +19 -0
  331. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +31 -0
  332. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/<star><star>/<star>.ts.declapract.ts +25 -0
  333. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/getDataFromLastOpenBracketAtStartOfLine.ts.declapract.ts +3 -0
  334. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/invokeLambda.ts.declapract.ts +3 -0
  335. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +49 -0
  336. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-2/blackbox/lambdas/<star>.ts.declapract.ts +27 -0
  337. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/_utils/environment.ts.declapract.ts +3 -0
  338. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/lambdas/<star>.ts.declapract.ts +23 -0
  339. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/.declapract.readme.md +3 -0
  340. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.acceptance.ts.declapract.ts +11 -0
  341. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.integration.ts.declapract.ts +11 -0
  342. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/.declapract.readme.md +8 -0
  343. 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
  344. 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
  345. 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
  346. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.readme.md +52 -0
  347. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.todo.md +3 -0
  348. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  349. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json +18 -0
  350. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json.declapract.ts +3 -0
  351. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/.test/useWakeOfLivedb.ts +209 -0
  352. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.integration.test.ts.declapract.ts +8 -0
  353. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.test.ts.declapract.ts +7 -0
  354. package/dist/.test/assets/git/declarations/practices/tests-any/build-ifstale.declapract.integration.test.ts +124 -0
  355. package/dist/.test/assets/git/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  356. package/dist/.test/assets/git/declarations/practices/tests-any/livedb-wake-branches.declapract.integration.test.ts +315 -0
  357. package/dist/.test/assets/git/declarations/practices/tests-any/old-acceptance-test-utils.declapract.integration.test.ts +122 -0
  358. package/dist/.test/assets/git/declarations/practices/tests-any/package.json.shell-flags.declapract.integration.test.ts +139 -0
  359. package/dist/.test/assets/git/declarations/practices/tests-any/test-kind-seam.declapract.integration.test.ts +87 -0
  360. package/dist/.test/assets/git/declarations/useCases.yml +29 -0
  361. package/dist/.test/assets/{expo-fullusecase/declarations/practices/git/best-practice → git/repo-with-all-gitattributes-declarers}/.gitattributes +3 -0
  362. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/declapract.use.yml +26 -0
  363. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/package.json +4 -0
  364. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  365. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  366. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  367. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  368. package/dist/__snapshots__/gitattributesDeclarers.declapract.integration.test.ts.snap +79 -0
  369. package/dist/__snapshots__/repoSkills.declapract.acceptance.test.ts.snap +512 -0
  370. package/dist/gitattributesDeclarers.declapract.integration.test.ts +438 -0
  371. package/dist/practiceOwnerPerFile.declapract.integration.test.ts +53 -0
  372. package/dist/practices/cicd-common/.declapract.integration.test.ts +15 -21
  373. package/dist/practices/git/.declapract.integration.test.ts +2 -2
  374. package/dist/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  375. package/dist/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  376. package/dist/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  377. package/dist/practices/git/best-practice/.declapract.readme.md +37 -0
  378. package/dist/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  379. package/dist/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  380. package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +7 -0
  381. package/dist/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  382. package/dist/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  383. package/dist/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  384. package/dist/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  385. package/dist/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  386. package/dist/repoSkills.declapract.acceptance.test.ts +1150 -0
  387. package/dist/utils/defineExpectedGitattributesContents.ts +247 -0
  388. package/package.json +4 -4
  389. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes +0 -7
  390. package/dist/practices/git/best-practice/.gitattributes +0 -7
@@ -0,0 +1,161 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+
6
+ import { given, then, useBeforeAll, when } from 'test-fns';
7
+
8
+ /**
9
+ * .what = integration test for the report-slow-tests shell the .test.yml workflow shells out to.
10
+ * .why = the prior inline report filtered on `perfStats.runtime`, a key jest 30 dropped — so it
11
+ * matched zero rows and went silent-green for its whole life (radio #602). this clamps the
12
+ * go-forward: it reads endTime-startTime, ranks by wall-clock, and — the whole point of the
13
+ * fix — fails LOUD if a future schema change zeroes the durations again, never silent-green.
14
+ * .how = spawn the shipped best-practice/.github/workflows/report-slow-tests.sh against fixture
15
+ * jest-results.json files, with GITHUB_STEP_SUMMARY pointed at a temp file, and assert the
16
+ * exit code, the summary table, and the stdout annotations.
17
+ * .note = subject is the SHIPPED shell template. this file sits at the PRACTICE ROOT (not under
18
+ * best-practice/), so declapract's loader — which walks only best-practice/ for templates —
19
+ * never reads it as a declaration and never copies it to a consumer. it is the play-test
20
+ * counterpart to husky/check.timestamps.play.declapract.integration.test.ts.
21
+ */
22
+
23
+ // the shell under test (the distributed best-practice template)
24
+ const scriptPath = path.join(
25
+ __dirname,
26
+ 'best-practice/.github/workflows/report-slow-tests.sh',
27
+ );
28
+
29
+ // write a fixture jest-results.json + a fresh summary sink into a temp dir; return their paths
30
+ const genFixture = (
31
+ jestResults: unknown,
32
+ ): { resultsPath: string; summaryPath: string } => {
33
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'report-slow-tests-'));
34
+ const resultsPath = path.join(dir, 'jest-results.json');
35
+ const summaryPath = path.join(dir, 'step-summary.md');
36
+ fs.writeFileSync(resultsPath, JSON.stringify(jestResults));
37
+ fs.writeFileSync(summaryPath, '');
38
+ return { resultsPath, summaryPath };
39
+ };
40
+
41
+ // spawn the report against a fixture; return exit code + stdout + the summary file contents
42
+ const runReport = (
43
+ jestResults: unknown,
44
+ ): { code: number | null; stdout: string; summary: string } => {
45
+ const { resultsPath, summaryPath } = genFixture(jestResults);
46
+ const res = spawnSync('bash', [scriptPath, resultsPath], {
47
+ encoding: 'utf-8',
48
+ env: { ...process.env, GITHUB_STEP_SUMMARY: summaryPath },
49
+ });
50
+ // mask the random fixture dir, so a snapshot neither churns per run nor holds a host path
51
+ const asMaskedFixtureDir = (text: string): string =>
52
+ text.split(path.dirname(resultsPath)).join('[fixture]');
53
+ return {
54
+ code: res.status,
55
+ stdout: asMaskedFixtureDir(res.stdout),
56
+ summary: asMaskedFixtureDir(fs.readFileSync(summaryPath, 'utf-8')),
57
+ };
58
+ };
59
+
60
+ describe('report-slow-tests', () => {
61
+ given('[case1] a report with a slow (>30s), a medium (>10s), and a fast file', () => {
62
+ when('[t0] the report runs', () => {
63
+ const result = useBeforeAll(() =>
64
+ runReport({
65
+ testResults: [
66
+ { name: '/repo/src/medium.test.ts', startTime: 1000, endTime: 16000 }, // 15s
67
+ { name: '/repo/src/fast.test.ts', startTime: 1000, endTime: 3000 }, // 2s
68
+ { name: '/repo/src/slow.test.ts', startTime: 1000, endTime: 41000 }, // 40s
69
+ ],
70
+ }),
71
+ );
72
+
73
+ then('it exits 0', () => {
74
+ expect(result.code).toEqual(0);
75
+ });
76
+
77
+ then('the summary carries the ranked table', () => {
78
+ expect(result.summary).toContain('### slowest test files');
79
+ expect(result.summary).toContain('| duration | file |');
80
+ });
81
+
82
+ then('the slowest file is ranked first in the table', () => {
83
+ const slowIdx = result.summary.indexOf('/repo/src/slow.test.ts');
84
+ const mediumIdx = result.summary.indexOf('/repo/src/medium.test.ts');
85
+ const fastIdx = result.summary.indexOf('/repo/src/fast.test.ts');
86
+ expect(slowIdx).toBeGreaterThan(-1);
87
+ expect(slowIdx).toBeLessThan(mediumIdx);
88
+ expect(mediumIdx).toBeLessThan(fastIdx);
89
+ });
90
+
91
+ then('it emits a warn annotation for the >30s file', () => {
92
+ expect(result.stdout).toContain(
93
+ '::warning file=/repo/src/slow.test.ts::slow test: 40s',
94
+ );
95
+ });
96
+
97
+ then('it emits a notice annotation for the >10s file', () => {
98
+ expect(result.stdout).toContain(
99
+ '::notice file=/repo/src/medium.test.ts::test duration: 15s',
100
+ );
101
+ });
102
+
103
+ then('it emits no annotation for the fast file', () => {
104
+ expect(result.stdout).not.toContain('/repo/src/fast.test.ts::');
105
+ });
106
+
107
+ then('the summary and annotations match snapshot', () => {
108
+ expect(result.summary).toMatchSnapshot('step summary — ranked');
109
+ expect(result.stdout).toMatchSnapshot('stdout annotations — ranked');
110
+ });
111
+ });
112
+ });
113
+
114
+ given('[case2] a non-empty report whose durations are all zero (schema drift)', () => {
115
+ // the exact silent-death #602 fixed: testResults present, but no real duration to be read.
116
+ when('[t0] the report runs', () => {
117
+ const result = useBeforeAll(() =>
118
+ runReport({
119
+ testResults: [
120
+ { name: '/repo/src/a.test.ts', startTime: 1000, endTime: 1000 },
121
+ { name: '/repo/src/b.test.ts', startTime: 2000, endTime: 2000 },
122
+ ],
123
+ }),
124
+ );
125
+
126
+ then('it fails loud with exit 1 (never silent-green)', () => {
127
+ expect(result.code).toEqual(1);
128
+ });
129
+
130
+ then('it prints an error annotation that names the schema drift', () => {
131
+ expect(result.stdout).toContain('::error::');
132
+ expect(result.stdout).toContain('jest --json duration schema');
133
+ expect(result.stdout).toContain('read endTime/startTime'); // names the next move
134
+ expect(result.stdout).not.toMatch(/#\d+/); // a bare issue ref dangles in a consumer repo
135
+ });
136
+
137
+ then('the error output matches snapshot', () => {
138
+ expect(result.stdout).toMatchSnapshot('stdout — schema drift');
139
+ });
140
+ });
141
+ });
142
+
143
+ given('[case3] an empty shard (0 test files)', () => {
144
+ when('[t0] the report runs', () => {
145
+ const result = useBeforeAll(() => runReport({ testResults: [] }));
146
+
147
+ then('it exits 0 (an empty shard is legitimate)', () => {
148
+ expect(result.code).toEqual(0);
149
+ });
150
+
151
+ then('the summary states the empty-shard state explicitly', () => {
152
+ expect(result.summary).toContain('0 test files');
153
+ expect(result.summary).toContain('empty shard');
154
+ });
155
+
156
+ then('the summary matches snapshot', () => {
157
+ expect(result.summary).toMatchSnapshot('step summary — empty shard');
158
+ });
159
+ });
160
+ });
161
+ });
@@ -0,0 +1,11 @@
1
+ # minimal use case for the action-pin integration test
2
+ #
3
+ # .why = only `cicd-common` is carried. the claim under test is that declapract's
4
+ # default EQUALS path delivers a pinned workflow template to a consumer
5
+ # verbatim, and one practice that declares one workflow is the whole of it.
6
+ # a broader use case would slow every apply with declarations that have no
7
+ # bearing on the pin.
8
+ use-cases:
9
+ typescript-project:
10
+ practices:
11
+ - cicd-common
@@ -105,3 +105,10 @@ a service **without** rds (`lambda-service`, `lambda-service-with-dynamodb`) doe
105
105
  `declapract apply --practice cicd-service` cannot strip an rds repo's own jobs (the additive-delta
106
106
  EQUALS hazard). if you add a new rds-coupled provision job, add it to that gate the same way — a
107
107
  caller that names a callee this practice supplies must be reconciled against this practice's presence.
108
+
109
+ ## the dao-generator output folds in a pr
110
+
111
+ this practice declares a `# [persist-with-rds]` section of the repo-root `.gitattributes`: it marks
112
+ `src/access/daos/**/.generated/**` and `provision/schema/**/.generated/**` as
113
+ `linguist-generated`, so github renders them collapsed. the daos and the schemas themselves stay
114
+ open: they are the internal contracts, so a reviewer reads them. to un-fold a path, see "what folds in a pr" in `src/practices/git/best-practice/.declapract.readme.md`.
@@ -0,0 +1,64 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+ import expect from 'expect';
3
+
4
+ import {
5
+ defineExpectedGitattributesContents,
6
+ type GitattributesSection,
7
+ } from '../../../utils/defineExpectedGitattributesContents';
8
+
9
+ /**
10
+ * .what = the `.gitattributes` section this practice owns: `.generated/` dirs fold in pr diffs
11
+ * .why = the daos and the schemas are the internal contracts, so a reviewer reads them open.
12
+ * a `.generated/` dir holds derived code (casts, query types, query functions) that
13
+ * every regen rewrites. github folds a file marked `linguist-generated`, one click away
14
+ * .note = `codegen.sql.types.yml` and the dao generator write `src/access/daos/.generated/`.
15
+ * the `**` keeps a nested `.generated/` folded too, under the daos and the schemas
16
+ * alike; every other dao and schema file stays open
17
+ */
18
+ const sections: readonly GitattributesSection[] = [
19
+ {
20
+ header: {
21
+ latest: '# [persist-with-rds] collapse dao-generator output in pr diffs',
22
+ retired: [],
23
+ },
24
+ entries: {
25
+ latest: [
26
+ 'src/access/daos/**/.generated/** linguist-generated',
27
+ 'provision/schema/**/.generated/** linguist-generated',
28
+ ],
29
+ retired: [
30
+ 'src/access/daos/** linguist-generated',
31
+ 'provision/schema/sql/tables/** linguist-generated',
32
+ 'provision/schema/sql/views/** linguist-generated',
33
+ 'provision/schema/sql/functions/** linguist-generated',
34
+ ],
35
+ },
36
+ },
37
+ ];
38
+
39
+ /**
40
+ * .what = emits the `.gitattributes` this practice declares, given the repo's extant one
41
+ * .why = several practices declare this file; they converge only through the shared util
42
+ */
43
+ const defineExpectedContents = (input: { contents: string | null }): string =>
44
+ defineExpectedGitattributesContents({
45
+ contents: input.contents,
46
+ declarer: 'persist-with-rds',
47
+ sections,
48
+ });
49
+
50
+ /**
51
+ * .what = throws when the repo's `.gitattributes` differs from what the shared layout emits
52
+ * .why = `check` gates `fix` (a throw means violated); exact equality, so `check(x) ⟺ x === fix(x)`
53
+ */
54
+ export const check: FileCheckFunction = (contents) => {
55
+ expect(contents).toEqual(defineExpectedContents({ contents }));
56
+ };
57
+
58
+ /**
59
+ * .what = sets this practice's section into the repo's `.gitattributes`
60
+ * .why = a fixed point: a second fix changes zero, and `check` passes on the output
61
+ */
62
+ export const fix: FileFixFunction = (contents) => ({
63
+ contents: defineExpectedContents({ contents }),
64
+ });
@@ -2,7 +2,9 @@ import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
 
4
4
  import { executeApply } from 'declapract';
5
- import { genTempDir, given, then, useBeforeAll, useThen, when } from 'test-fns';
5
+ import { given, then, useBeforeAll, useThen, when } from 'test-fns';
6
+
7
+ import { genTempRepoWithDeclarationsOutside } from '../../utils/genTempRepoWithDeclarationsOutside';
6
8
 
7
9
  // executeApply is slow (full practice evaluation before the file filter narrows it)
8
10
  // .note = this suite scopes each apply with `file: '.github/workflows/review.yml'`, which
@@ -76,14 +78,12 @@ const getAllActionRefLines = (input: { contents: string }): string[] =>
76
78
  */
77
79
  describe('cicd-common workflow templates', () => {
78
80
  given('[case1] a consumer repo whose workflow still carries a tag ref', () => {
79
- const tempDir = genTempDir({
81
+ const tempDir = genTempRepoWithDeclarationsOutside({
80
82
  slug: 'cicd-common-action-pins',
81
83
  clone:
82
84
  './src/practices/cicd-common/.test/assets/repo-with-unpinned-workflow',
83
- symlink: [
84
- { at: 'declarations', to: './.test/assets/cicd-common/declarations' },
85
- { at: 'node_modules', to: 'node_modules' },
86
- ],
85
+ declarations: './src/.test/assets/cicd-common/declarations',
86
+ symlink: [{ at: 'node_modules', to: 'node_modules' }],
87
87
  });
88
88
 
89
89
  when('[t0] before any apply', () => {
@@ -237,14 +237,12 @@ describe('cicd-common workflow templates', () => {
237
237
  * case runs the real pipeline, so an empty delivery goes red on byte-equality
238
238
  */
239
239
  given('[case2] a consumer whose .test.yml is stale, on the custom-fix path', () => {
240
- const tempDir = genTempDir({
240
+ const tempDir = genTempRepoWithDeclarationsOutside({
241
241
  slug: 'cicd-common-action-pins-test-yml',
242
242
  clone:
243
243
  './src/practices/cicd-common/.test/assets/repo-with-unpinned-workflow',
244
- symlink: [
245
- { at: 'declarations', to: './.test/assets/cicd-common/declarations' },
246
- { at: 'node_modules', to: 'node_modules' },
247
- ],
244
+ declarations: './src/.test/assets/cicd-common/declarations',
245
+ symlink: [{ at: 'node_modules', to: 'node_modules' }],
248
246
  });
249
247
 
250
248
  when('[t0] before any apply', () => {
@@ -419,14 +417,12 @@ describe('cicd-common workflow templates', () => {
419
417
  * claim to mean what it says
420
418
  */
421
419
  given('[case3] a consumer repo that also has a workflow of its OWN', () => {
422
- const tempDir = genTempDir({
420
+ const tempDir = genTempRepoWithDeclarationsOutside({
423
421
  slug: 'cicd-common-consumer-owned',
424
422
  clone:
425
423
  './src/practices/cicd-common/.test/assets/repo-with-unpinned-workflow',
426
- symlink: [
427
- { at: 'declarations', to: './.test/assets/cicd-common/declarations' },
428
- { at: 'node_modules', to: 'node_modules' },
429
- ],
424
+ declarations: './src/.test/assets/cicd-common/declarations',
425
+ symlink: [{ at: 'node_modules', to: 'node_modules' }],
430
426
  });
431
427
 
432
428
  when('[t0] the whole practice is applied, unscoped', () => {
@@ -532,14 +528,12 @@ describe('cicd-common workflow templates', () => {
532
528
  * could drift from the first and quietly cease to be the same repo
533
529
  */
534
530
  given('[case4] a consumer repo where the declared workflow is ABSENT', () => {
535
- const tempDir = genTempDir({
531
+ const tempDir = genTempRepoWithDeclarationsOutside({
536
532
  slug: 'cicd-common-absent-workflow',
537
533
  clone:
538
534
  './src/practices/cicd-common/.test/assets/repo-with-unpinned-workflow',
539
- symlink: [
540
- { at: 'declarations', to: './.test/assets/cicd-common/declarations' },
541
- { at: 'node_modules', to: 'node_modules' },
542
- ],
535
+ declarations: './src/.test/assets/cicd-common/declarations',
536
+ symlink: [{ at: 'node_modules', to: 'node_modules' }],
543
537
  });
544
538
 
545
539
  when('[t0] before any apply, with the workflow removed', () => {
@@ -152,7 +152,7 @@ describe('gitignore practices', () => {
152
152
  slug: 'git-cache-dirs',
153
153
  clone: './src/practices/git/.test/assets/repo-without-cache-ignores',
154
154
  symlink: [
155
- { at: 'declarations', to: './.test/assets/git/declarations' },
155
+ { at: 'declarations', to: './src/.test/assets/git/declarations' },
156
156
  { at: 'node_modules', to: 'node_modules' },
157
157
  ],
158
158
  });
@@ -602,7 +602,7 @@ describe('gitignore practices', () => {
602
602
  slug: 'git-rhachet-only',
603
603
  clone: './src/practices/git/.test/assets/repo-with-rhachet-only',
604
604
  symlink: [
605
- { at: 'declarations', to: './.test/assets/git/declarations' },
605
+ { at: 'declarations', to: './src/.test/assets/git/declarations' },
606
606
  { at: 'node_modules', to: 'node_modules' },
607
607
  ],
608
608
  });
@@ -4,9 +4,24 @@ import path from 'node:path';
4
4
  import { executeApply } from 'declapract';
5
5
  import { genTempDir, given, then, useBeforeAll, useThen, when } from 'test-fns';
6
6
 
7
- // executeApply evaluates the whole git practice before the `file` filter narrows it
7
+ import { check as checkGit } from './best-practice/.gitattributes.declapract';
8
+
9
+ // executeApply evaluates the whole practice before the `file` filter narrows it
8
10
  jest.setTimeout(5 * 60 * 1000);
9
11
 
12
+ const context = {} as Parameters<typeof checkGit>[1]; // .note = the check reads no context
13
+
14
+ // .note = a literal, independent of the declaration: the check is `x === fix(x)`, so it passes on
15
+ // any fixed point and cannot by itself prove the bytes are the ones the practice promises
16
+ const MANAGED_SECTIONS = `# [git] exclude package locks from git diff; https://stackoverflow.com/a/72834452/3068233
17
+ pnpm-lock.yaml -diff
18
+ package-lock.json -diff
19
+
20
+ # [git] auto-resolve lock file conflicts by taking theirs; run install after merge
21
+ pnpm-lock.yaml merge=theirs
22
+ package-lock.json merge=theirs
23
+ `;
24
+
10
25
  const MANAGED_ENTRIES = [
11
26
  'pnpm-lock.yaml -diff',
12
27
  'package-lock.json -diff',
@@ -15,15 +30,13 @@ const MANAGED_ENTRIES = [
15
30
  ];
16
31
 
17
32
  /**
18
- * .what = proves the .gitattributes fix through the real declapract pipeline
19
- * .why = the unit suite proves the fix in isolation; only executeApply proves the declared path
20
- * reaches the repo-root file, the CONTAINS check gates the fix, and the settled file
21
- * satisfies that check — so a rerun is a no-op and the plan stops to flag it
33
+ * .what = proves the git `.gitattributes` declaration through the real declapract pipeline
34
+ * .why = the unit suite proves the fix in isolation; only executeApply proves the declared
35
+ * path reaches the repo-root file, the check gates the fix, and the settled file
36
+ * satisfies the check — so a rerun is a no-op and the plan stops to flag it
22
37
  * (rule.require.declapract-integration-tests, rule.require.idempotent-fixes)
23
- * .teeth = emit any section's entries out of declared order, and [t1] `contains the template`
24
- * reddens while [t2] stays a byte-identical fixed point — the reflag loop a fixed-point
25
- * test alone cannot see. the prior fix (sections re-assembled in place, a stray entry
26
- * left outside its section) was in exactly that state
38
+ * .note = all five declarers together, and this repo's own file, are proven in
39
+ * `src/gitattributesDeclarers.declapract.integration.test.ts`
27
40
  */
28
41
  describe('git .gitattributes', () => {
29
42
  given('[case1] a repo whose .gitattributes holds a legacy header, a legacy entry, and an out-of-section entry', () => {
@@ -31,7 +44,7 @@ describe('git .gitattributes', () => {
31
44
  slug: 'git-gitattributes-legacy',
32
45
  clone: './src/practices/git/.test/assets/repo-with-legacy-gitattributes',
33
46
  symlink: [
34
- { at: 'declarations', to: './.test/assets/git/declarations' },
47
+ { at: 'declarations', to: './src/.test/assets/git/declarations' },
35
48
  { at: 'node_modules', to: 'node_modules' },
36
49
  ],
37
50
  });
@@ -53,15 +66,15 @@ describe('git .gitattributes', () => {
53
66
  when('[t1] apply runs', () => {
54
67
  const scene = useThen('apply settles', async () => {
55
68
  await apply();
56
- const template = await fs.readFile(
57
- path.join(__dirname, 'best-practice/.gitattributes'),
58
- 'utf-8',
59
- );
60
- return { after: await read(), template };
69
+ return { after: await read() };
70
+ });
71
+
72
+ then('the git check passes on the file', () => {
73
+ expect(() => checkGit(scene.after, context)).not.toThrow();
61
74
  });
62
75
 
63
- then('the file contains the template verbatim — the CONTAINS check passes', () => {
64
- expect(scene.after).toContain(scene.template.trim());
76
+ then('the file holds the managed sections verbatim, then the repo-own line', () => {
77
+ expect(scene.after).toEqual(`${MANAGED_SECTIONS}\n*.png binary\n`);
65
78
  });
66
79
 
67
80
  then('the legacy header and the legacy entry are gone', () => {
@@ -77,8 +90,10 @@ describe('git .gitattributes', () => {
77
90
  );
78
91
  });
79
92
 
80
- then('the repo-own line survives', () => {
81
- expect(scene.after).toContain('*.png binary');
93
+ then('the repo-own line survives, after the managed sections', () => {
94
+ expect(scene.after.trim().split('\n').slice(-1)[0]).toEqual(
95
+ '*.png binary',
96
+ );
82
97
  });
83
98
 
84
99
  then('no declapract template syntax leaked', () => {
@@ -1,7 +1,7 @@
1
- # .note = declarations dir is symlinked by the test to .test/assets/git/declarations
1
+ # .note = declarations dir is symlinked by the test to src/.test/assets/git/declarations
2
2
  # .why = a repo whose .gitattributes predates the current template: a legacy header, a legacy
3
- # entry, and a managed entry outside any section — so the CONTAINS check fails and the
4
- # git practice's fix runs
3
+ # entry, and a managed entry outside any section — so the check fails and the git
4
+ # practice's fix runs
5
5
  # .note = NO `variables:` block — `git` and `rhachet` reference zero `@declapract{variable.*}`
6
6
  declarations: 'declarations/declapract.declare.yml'
7
7
  useCase: typescript-project
@@ -11,14 +11,14 @@ pnpm-lock.yaml merge=theirs
11
11
  `;
12
12
 
13
13
  exports[`git .gitattributes given: [case1] a repo whose .gitattributes holds a legacy header, a legacy entry, and an out-of-section entry when: [t1] apply runs then: the output matches snapshot: .gitattributes — after 1`] = `
14
- "*.png binary
15
-
16
- # exclude package locks from git diff; https://stackoverflow.com/a/72834452/3068233
14
+ "# [git] exclude package locks from git diff; https://stackoverflow.com/a/72834452/3068233
17
15
  pnpm-lock.yaml -diff
18
16
  package-lock.json -diff
19
17
 
20
- # auto-resolve lock file conflicts by taking theirs; run install after merge
18
+ # [git] auto-resolve lock file conflicts by taking theirs; run install after merge
21
19
  pnpm-lock.yaml merge=theirs
22
20
  package-lock.json merge=theirs
21
+
22
+ *.png binary
23
23
  "
24
24
  `;
@@ -5,6 +5,43 @@ ordered tail, what a new declarer owes — is stated once at
5
5
  `.agent/repo=.this/role=any/briefs/howto.declare-the-repo-gitignore.md`. read that before you add
6
6
  a line here.
7
7
 
8
+ 📖 several practices declare the `.gitattributes` too, and there order carries load. their shared
9
+ contract — the canonical layout, the declarer tag, what a new declarer owes — is stated once at
10
+ `.agent/repo=.this/role=any/briefs/howto.declare-the-repo-gitattributes.md`.
11
+
12
+ ## what folds in a pr, and how to un-fold a path
13
+
14
+ a repo that adopts these practices gets `linguist-generated` lines, so github renders robocode
15
+ collapsed in a pr. each stays one click away.
16
+
17
+ | folds | declared by |
18
+ |-------|-------------|
19
+ | `*.test.ts`, `*.test.tsx` | `tests-any` |
20
+ | `src/access/daos/**/.generated/**`, `provision/schema/**/.generated/**` | `persist-with-rds` |
21
+ | `src/access/daos/**/.generated/**` | `persist-with-dynamodb` |
22
+ | `.route/**`, `.behavior/**`, except `*.yield.*` and `.radio/**` | `rhachet` |
23
+
24
+ snapshots (`*.snap`) stay open: no line names them. the daos and the schemas stay open too: they
25
+ are the internal contracts. only the `.generated/` dirs within them fold.
26
+
27
+ to un-fold a path, add a line at the bottom of `.gitattributes`, below every `# [<declarer>]`
28
+ section and apart from them by a blank line:
29
+
30
+ ```
31
+ src/access/daos/.generated/** -linguist-generated
32
+ ```
33
+
34
+ the repo's own lines always sit last, and git takes the last line that matches, so this line wins.
35
+
36
+ - a dir-level line un-folds every file under it, test files included, since it outranks the
37
+ `tests-any` line too
38
+ - one file un-folds with a line of its own:
39
+ `src/access/daos/.generated/queryFunctions.ts -linguist-generated`
40
+ - leave your own lines untagged. a `# [<word>]` header marks a managed block: it floats above the
41
+ repo-own lines, and one that names a declarer is rewritten by that declarer's fix
42
+
43
+ a folded file may also drop out of github code search, which skips generated files.
44
+
8
45
  ## `.agent/.cache/` is declared here and by the rhachet practice
9
46
 
10
47
  deliberate, and neither is redundant. rhachet owns the dir in the causal sense — it creates it —