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,9 @@
1
+ # .note = declarations dir is symlinked by the test to src/.test/assets/tests-any-only/declarations
2
+ # the variables stay: the fix reads projectName from this file for the `which` it emits
3
+ declarations: 'declarations/declapract.declare.yml'
4
+ useCase: tests-any-only
5
+ variables:
6
+ organizationName: 'test-org'
7
+ projectName: 'svc-images'
8
+ reviewers:
9
+ users: ['user1']
@@ -0,0 +1,19 @@
1
+ import { invokeLambdaForTesting } from 'simple-lambda-testing-methods';
2
+
3
+ import { locally } from '../_utils/environment';
4
+
5
+ describe('addDecoratedImage', () => {
6
+ it('it should be possible to add a decorated image', async () => {
7
+ const response = await invokeLambdaForTesting({
8
+ service: 'svc-images',
9
+ function: 'addDecoratedImage',
10
+ locally,
11
+ event: {
12
+ url: 'https://some.url',
13
+ description: 'bo vine at his gig, moooooin the lawn',
14
+ focalArea: null,
15
+ },
16
+ });
17
+ expect(response.image).toHaveProperty('uuid');
18
+ });
19
+ });
@@ -0,0 +1,9 @@
1
+ # .note = declarations dir is symlinked by the test to src/.test/assets/tests-any-only/declarations
2
+ # the variables stay: the fix reads projectName from this file for the `which` it emits
3
+ declarations: 'declarations/declapract.declare.yml'
4
+ useCase: tests-any-only
5
+ variables:
6
+ organizationName: 'test-org'
7
+ projectName: 'svc-images'
8
+ reviewers:
9
+ users: ['user1']
@@ -0,0 +1,8 @@
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`tests-any changedSince=origin/main policy given: the shipped best-practice/package.json when: the changed-file test commands are read then: the emitted changed-file commands match snapshot: tests-any changed-file commands 1`] = `
4
+ {
5
+ "test:integration": "set -eu && jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -n "\${CI:-}" ] && echo '--ci') $([ "\${THOROUGH:-}" != "true" ] && echo '--changedSince=origin/main') $([ "\${RESNAP:-}" = "true" ] && echo '--updateSnapshot')",
6
+ "test:unit": "set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n "\${CI:-}" ] && echo '--ci') $([ "\${THOROUGH:-}" != "true" ] && echo '--changedSince=origin/main') $([ "\${RESNAP:-}" = "true" ] && echo '--updateSnapshot')",
7
+ }
8
+ `;
@@ -0,0 +1,6 @@
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`the useWakeOfLivedb decide-gate runs its real branches (executed, no live infra) given: the wake command fails when: it fails with a child-process shape (a non-zero exit) then: the wake-failure warn matches snapshot: useWakeOfLivedb wake-failure warn 1`] = `
4
+ "useWakeOfLivedb: 'rhx use.rds.capacity --env prep' failed (non-fatal): {"status":1}
5
+ "
6
+ `;
@@ -0,0 +1,162 @@
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`tests-any old-acceptance-test-utils given: [case1] a repo on the old-acceptance-test-utils shape when: [t0] the input (before any fix) then: the file holds the old import, and matches snapshot: old-acceptance-test-utils — before 1`] = `
4
+ "import { SNSEventRecord, SNSMessage, SNSEvent } from 'aws-lambda';
5
+
6
+ import { exampleEmailClickEvent } from '../../src/.test/assets/exampleEmailClickEvent';
7
+ import { invokeLambda } from '../_utils/invokeLambda';
8
+
9
+ describe('consumeSESEmailEventFromSNS', () => {
10
+ it('should be possible to invoke the lambda', async () => {
11
+ const exampleSnsEvent: SNSEvent = {
12
+ Records: [
13
+ {
14
+ Sns: {
15
+ Message: JSON.stringify(exampleEmailClickEvent),
16
+ } as SNSMessage,
17
+ } as SNSEventRecord,
18
+ ],
19
+ };
20
+ const response = await invokeLambda({
21
+ name: 'consumeSESEmailEventFromSNS',
22
+ data: exampleSnsEvent,
23
+ });
24
+ expect(response).toBeDefined();
25
+ });
26
+ });
27
+ "
28
+ `;
29
+
30
+ exports[`tests-any old-acceptance-test-utils given: [case1] a repo on the old-acceptance-test-utils shape when: [t1] the fix is applied then: no template token leaks, and the file matches snapshot: old-acceptance-test-utils — after 1`] = `
31
+ "import { SNSEventRecord, SNSMessage, SNSEvent } from 'aws-lambda';
32
+
33
+ import { exampleEmailClickEvent } from '../../src/.test/assets/exampleEmailClickEvent';
34
+ import { runLambdaEndpoint } from 'sdk-aws-lambda';
35
+ import { sdkAwsLambdaEnvAccessContemp } from '@src/access/sdks/sdkAwsLambdaEnvAccessContemp';
36
+ import { log } from '@src/utils/logger';
37
+ import { locally } from '../environment';
38
+
39
+ describe('consumeSESEmailEventFromSNS', () => {
40
+ it('should be possible to invoke the lambda', async () => {
41
+ const exampleSnsEvent: SNSEvent = {
42
+ Records: [
43
+ {
44
+ Sns: {
45
+ Message: JSON.stringify(exampleEmailClickEvent),
46
+ } as SNSMessage,
47
+ } as SNSEventRecord,
48
+ ],
49
+ };
50
+ const response = await runLambdaEndpoint.onSerialized<unknown, Record<string, any>>(
51
+ {
52
+ which: { service: 'svc-notifications', function: 'consumeSESEmailEventFromSNS' },
53
+ event: exampleSnsEvent,
54
+ at: locally ? 'local' : 'cloud',
55
+ },
56
+ { log, env: { access: sdkAwsLambdaEnvAccessContemp() } },
57
+ );
58
+ expect(response).toBeDefined();
59
+ });
60
+ });
61
+ "
62
+ `;
63
+
64
+ exports[`tests-any old-acceptance-test-utils given: [case2] a repo on the old-acceptance-test-utils-2 shape when: [t0] the input (before any fix) then: the file holds the old import, and matches snapshot: old-acceptance-test-utils-2 — before 1`] = `
65
+ "import { invokeLambdaForTesting } from 'simple-lambda-testing-methods';
66
+
67
+ import { locally } from '../__test_utils__/environment';
68
+
69
+ describe('addDecoratedImage', () => {
70
+ it('it should be possible to add a decorated image', async () => {
71
+ const response = await invokeLambdaForTesting({
72
+ service: 'svc-images',
73
+ function: 'addDecoratedImage',
74
+ locally,
75
+ event: {
76
+ url: 'https://some.url',
77
+ description: 'bo vine at his gig, moooooin the lawn',
78
+ focalArea: null,
79
+ },
80
+ });
81
+ expect(response.image).toHaveProperty('uuid');
82
+ });
83
+ });
84
+ "
85
+ `;
86
+
87
+ exports[`tests-any old-acceptance-test-utils given: [case2] a repo on the old-acceptance-test-utils-2 shape when: [t1] the fix is applied then: no template token leaks, and the file matches snapshot: old-acceptance-test-utils-2 — after 1`] = `
88
+ "import { runLambdaEndpoint } from 'sdk-aws-lambda';
89
+ import { sdkAwsLambdaEnvAccessContemp } from '@src/access/sdks/sdkAwsLambdaEnvAccessContemp';
90
+ import { log } from '@src/utils/logger';
91
+
92
+ import { locally } from '../environment';
93
+
94
+ describe('addDecoratedImage', () => {
95
+ it('it should be possible to add a decorated image', async () => {
96
+ const response = await runLambdaEndpoint.onSerialized<unknown, Record<string, any>>(
97
+ {
98
+ which: { service: 'svc-images', function: 'addDecoratedImage' },
99
+ event: {
100
+ url: 'https://some.url',
101
+ description: 'bo vine at his gig, moooooin the lawn',
102
+ focalArea: null,
103
+ },
104
+ at: locally ? 'local' : 'cloud',
105
+ },
106
+ { log, env: { access: sdkAwsLambdaEnvAccessContemp() } },
107
+ );
108
+ expect(response.image).toHaveProperty('uuid');
109
+ });
110
+ });
111
+ "
112
+ `;
113
+
114
+ exports[`tests-any old-acceptance-test-utils given: [case3] a repo on the old-acceptance-test-utils-3 shape when: [t0] the input (before any fix) then: the file holds the old import, and matches snapshot: old-acceptance-test-utils-3 — before 1`] = `
115
+ "import { invokeLambdaForTesting } from 'simple-lambda-testing-methods';
116
+
117
+ import { locally } from '../_utils/environment';
118
+
119
+ describe('addDecoratedImage', () => {
120
+ it('it should be possible to add a decorated image', async () => {
121
+ const response = await invokeLambdaForTesting({
122
+ service: 'svc-images',
123
+ function: 'addDecoratedImage',
124
+ locally,
125
+ event: {
126
+ url: 'https://some.url',
127
+ description: 'bo vine at his gig, moooooin the lawn',
128
+ focalArea: null,
129
+ },
130
+ });
131
+ expect(response.image).toHaveProperty('uuid');
132
+ });
133
+ });
134
+ "
135
+ `;
136
+
137
+ exports[`tests-any old-acceptance-test-utils given: [case3] a repo on the old-acceptance-test-utils-3 shape when: [t1] the fix is applied then: no template token leaks, and the file matches snapshot: old-acceptance-test-utils-3 — after 1`] = `
138
+ "import { runLambdaEndpoint } from 'sdk-aws-lambda';
139
+ import { sdkAwsLambdaEnvAccessContemp } from '@src/access/sdks/sdkAwsLambdaEnvAccessContemp';
140
+ import { log } from '@src/utils/logger';
141
+
142
+ import { locally } from '../environment';
143
+
144
+ describe('addDecoratedImage', () => {
145
+ it('it should be possible to add a decorated image', async () => {
146
+ const response = await runLambdaEndpoint.onSerialized<unknown, Record<string, any>>(
147
+ {
148
+ which: { service: 'svc-images', function: 'addDecoratedImage' },
149
+ event: {
150
+ url: 'https://some.url',
151
+ description: 'bo vine at his gig, moooooin the lawn',
152
+ focalArea: null,
153
+ },
154
+ at: locally ? 'local' : 'cloud',
155
+ },
156
+ { log, env: { access: sdkAwsLambdaEnvAccessContemp() } },
157
+ );
158
+ expect(response.image).toHaveProperty('uuid');
159
+ });
160
+ });
161
+ "
162
+ `;
@@ -0,0 +1,9 @@
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`#679 test-kind presence accepts the \`._.\` seam given: [case] the tests-any integration declaration, on a repo with no test of either form then: the check still fails 1`] = `"expected at least one test file under src/ named *.integration.test.ts or *._.intg.test.ts"`;
4
+
5
+ exports[`#679 test-kind presence accepts the \`._.\` seam given: [case] the tests-service blackbox acceptance declaration, on a repo with no test of either form then: the check still fails 1`] = `"expected at least one test file under blackbox/ named *.acceptance.test.ts or *._.acpt.test.ts"`;
6
+
7
+ exports[`#679 test-kind presence accepts the \`._.\` seam given: [case] the tests-service integration declaration, on a repo with no test of either form then: the check still fails 1`] = `"expected at least one test file under src/ named *.integration.test.ts or *._.intg.test.ts"`;
8
+
9
+ exports[`#679 test-kind presence accepts the \`._.\` seam given: [case] the tests-service lambda acceptance declaration, on a repo with no test of either form then: the check still fails 1`] = `"expected at least one test file under blackbox/lambdas/ named *.acceptance.test.ts or *._.acpt.test.ts"`;
@@ -0,0 +1,111 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+
4
+ import { given, then, when } from 'test-fns';
5
+
6
+ /**
7
+ * .what = clamps that every jest config template the tests-node / tests-expo practices ship
8
+ * REACHES both autoprune hooks -- never one without the other -- whether it wires the
9
+ * autoprune setup DIRECTLY or through a COMPOSITE globalSetup.
10
+ * .why = test-fns >=1.16 reclaims the temp dirs genTempDir makes, but jest needs TWO keys:
11
+ * globalSetup stamps the run, globalTeardown reclaims its dirs. a config with globalSetup
12
+ * and NO globalTeardown stamps every dir and reclaims none -- the half-wired state #590
13
+ * names, which test-fns itself detects + reports but the practice must never SHIP. the
14
+ * floor bump (tests-any package.json, test-fns >=1.17.0) delivers the capability; this
15
+ * clamp guards the wire-up so a future edit cannot drop one key and leave the other.
16
+ * .why-composite = #598 makes the two node suite configs (integration + acceptance) COMPOSE an
17
+ * livedb wake with autoprune's setup, so their `globalSetup` points at a local
18
+ * `jest.<suite>.prepare.ts` rather than the `test-fns/autoprune.setup.jest` subpath
19
+ * directly. jest allows ONE globalSetup, so the composite is how both run. this clamp
20
+ * follows the indirection: a composite config still REACHES autoprune iff its globalSetup
21
+ * file imports the autoprune subpath. so a drop of the autoprune import from a composite
22
+ * reddens here exactly as a drop of the direct key would.
23
+ * .teeth = remove `globalTeardown` from any config, OR remove the autoprune setup from a direct
24
+ * config, OR drop the `test-fns/autoprune.setup.jest` import from a composite globalSetup
25
+ * file, and the matched case reddens (the both-reached-together assertion).
26
+ * .note = the subject is the shipped TEMPLATE text, read as a string -- so this clamp is
27
+ * independent of which test-fns version is installed here (the autoprune subpaths only
28
+ * need to load in a CONSUMER, which the floor bump guarantees). the `.declapract.test.ts`
29
+ * suffix is this repo's UNIT-test marker; declapract's loader excludes `.test.ts`, so this
30
+ * file is neither loaded as a declaration nor copied to a consumer.
31
+ */
32
+
33
+ // a DIRECT config wires the setup as `globalSetup: 'test-fns/autoprune.setup.jest'`; a COMPOSITE
34
+ // file IMPORTS it as `... from 'test-fns/autoprune.setup.jest'`. the two forms are distinct on
35
+ // purpose: a `.why` comment may quote the `globalSetup: '...'` form as prose, so the composite
36
+ // reach-check matches the IMPORT form (`from '...'`), which a comment does not carry -- else a
37
+ // mere mention of the subpath in a comment would satisfy the clamp (a teeth hole caught in dogfood).
38
+ const SETUP_DIRECT_KEY = "globalSetup: 'test-fns/autoprune.setup.jest'";
39
+ const SETUP_IMPORT = "from 'test-fns/autoprune.setup.jest'";
40
+ const TEARDOWN_KEY = "globalTeardown: 'test-fns/autoprune.teardown.jest'";
41
+
42
+ // anchor on __dirname, not process.cwd(): the repo-root-relative paths below must point at the same
43
+ // file wherever jest is invoked from (a nested `jest src/practices/...` run has a different cwd).
44
+ // from this file (src/practices/tests-any/) the repo root is three segments up.
45
+ const REPO_ROOT = join(__dirname, '../../..');
46
+
47
+ // each config either wires the autoprune setup DIRECTLY, or COMPOSES it via a local globalSetup
48
+ // file that imports the autoprune subpath. `composite` names that file, relative to the practice.
49
+ const configs: { relPath: string; composite: string | null }[] = [
50
+ { relPath: 'src/practices/tests-node/best-practice/jest.unit.config.ts', composite: null },
51
+ {
52
+ relPath: 'src/practices/tests-node/best-practice/jest.integration.config.ts',
53
+ composite: 'src/practices/tests-node/best-practice/jest.integration.prepare.ts',
54
+ },
55
+ {
56
+ relPath: 'src/practices/tests-node/best-practice/jest.acceptance.config.ts',
57
+ composite: 'src/practices/tests-node/best-practice/jest.acceptance.prepare.ts',
58
+ },
59
+ { relPath: 'src/practices/tests-expo/best-practice/jest.unit.config.ts', composite: null },
60
+ // #621: the expo integration + acceptance configs compose the livedb wake (via-gateway) too
61
+ {
62
+ relPath: 'src/practices/tests-expo/best-practice/jest.integration.config.ts',
63
+ composite: 'src/practices/tests-expo/best-practice/jest.integration.prepare.ts',
64
+ },
65
+ {
66
+ relPath: 'src/practices/tests-expo/best-practice/jest.acceptance.config.ts',
67
+ composite: 'src/practices/tests-expo/best-practice/jest.acceptance.prepare.ts',
68
+ },
69
+ ];
70
+
71
+ /**
72
+ * .what = whether a config REACHES the autoprune setup -- directly, or through its composite.
73
+ * .why = the invariant #590 guards is "setup is reached", not "setup is inline". a composite
74
+ * config reaches it iff its globalSetup file imports the autoprune subpath.
75
+ */
76
+ const reachesAutopruneSetup = (input: {
77
+ configContents: string;
78
+ composite: string | null;
79
+ }): boolean => {
80
+ // direct: the config itself wires `globalSetup: 'test-fns/autoprune.setup.jest'`
81
+ if (input.configContents.includes(SETUP_DIRECT_KEY)) return true;
82
+
83
+ // composite: the config points at a local globalSetup file that IMPORTS the autoprune subpath
84
+ if (!input.composite) return false;
85
+ const compositeContents = readFileSync(join(REPO_ROOT, input.composite), 'utf8');
86
+ return compositeContents.includes(SETUP_IMPORT);
87
+ };
88
+
89
+ describe('autoprune hook reach across the shipped jest configs', () => {
90
+ for (const { relPath, composite } of configs) {
91
+ given(`[case] ${relPath}${composite ? ' (composite)' : ' (direct)'}`, () => {
92
+ const configContents = readFileSync(join(REPO_ROOT, relPath), 'utf8');
93
+
94
+ when('[t0] the shipped config is read', () => {
95
+ then('it reaches the autoprune setup (stamps the run)', () => {
96
+ expect(reachesAutopruneSetup({ configContents, composite })).toEqual(true);
97
+ });
98
+
99
+ then('it wires globalTeardown (reclaims the dirs)', () => {
100
+ expect(configContents).toContain(TEARDOWN_KEY);
101
+ });
102
+
103
+ then('it never ships one hook without the other (half-wired = stamp, no reclaim)', () => {
104
+ const reachesSetup = reachesAutopruneSetup({ configContents, composite });
105
+ const hasTeardown = configContents.includes(TEARDOWN_KEY);
106
+ expect(reachesSetup).toEqual(hasTeardown);
107
+ });
108
+ });
109
+ });
110
+ }
111
+ });
@@ -0,0 +1,69 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'node:path';
3
+
4
+ import { executeApply } from 'declapract';
5
+ import { genTempDir, given, then, useBeforeAll, when } from 'test-fns';
6
+
7
+ // executeApply evaluates the whole practice
8
+ jest.setTimeout(240_000);
9
+
10
+ /**
11
+ * .what = proves `declapract fix` on tests-any removes a stale test-fns from dependencies, so the
12
+ * floored devDependencies entry is the one that installs (#657)
13
+ * .why = the floor raised devDependencies alone; a `dependencies: 1.4.x` duplicate won the install
14
+ */
15
+ describe('tests-any dev-tool-in-dependencies — pipeline', () => {
16
+ given('[case1] a repo with test-fns 1.4.0 in dependencies and 1.15.0 in devDependencies', () => {
17
+ const tempDir = genTempDir({
18
+ slug: 'declapract-dev-tool-in-deps',
19
+ clone:
20
+ './src/practices/tests-any/bad-practices/dev-tool-in-dependencies/.test/assets/demo-repo-with-stale-test-fns-dep',
21
+ // evaluate tests-any alone against the tiny repo; a symlink of this repo's whole src makes
22
+ // the practice's src/** globs walk every fixture here (minutes per apply)
23
+ symlink: [
24
+ { at: 'declarations', to: './src/.test/assets/tests-any-only/declarations' },
25
+ { at: 'node_modules', to: 'node_modules' },
26
+ ],
27
+ });
28
+
29
+ const read = () => fs.readFile(path.join(tempDir, 'package.json'), 'utf-8');
30
+
31
+ const state = useBeforeAll(async () => {
32
+ const config = path.join(tempDir, 'declapract.use.yml');
33
+ const before = await read();
34
+ await executeApply({ config, practice: 'tests-any', file: 'package.json' });
35
+ const after1 = await read();
36
+ await executeApply({ config, practice: 'tests-any', file: 'package.json' });
37
+ const after2 = await read();
38
+ await executeApply({ config, practice: 'tests-any', file: 'package.json' });
39
+ const after3 = await read();
40
+ return { before, after1, after2, after3 };
41
+ }, 230_000);
42
+
43
+ when('[t0] declapract fix is applied', () => {
44
+ then('test-fns is gone from dependencies, and the runtime dep stays', () => {
45
+ const pkg = JSON.parse(state.after2);
46
+ expect(pkg.dependencies['test-fns']).toBeUndefined();
47
+ expect(pkg.dependencies['domain-objects']).toEqual('0.31.0');
48
+ });
49
+
50
+ then('devDependencies holds test-fns at or above the floor', () => {
51
+ const pkg = JSON.parse(state.after2);
52
+ expect(pkg.devDependencies['test-fns']).not.toEqual('1.4.0');
53
+ expect(pkg.devDependencies['test-fns']).not.toEqual('1.15.0');
54
+ expect(pkg.devDependencies['test-fns']).not.toContain('@declapract{');
55
+ });
56
+
57
+ then('before + after match snapshot', () => {
58
+ expect(state.before).toMatchSnapshot('package.json — before');
59
+ expect(state.after2).toMatchSnapshot('package.json — after');
60
+ });
61
+ });
62
+
63
+ when('[t1] declapract fix is re-applied', () => {
64
+ then('the package.json is a fixed point once settled', () => {
65
+ expect(state.after3).toEqual(state.after2);
66
+ });
67
+ });
68
+ });
69
+ });
@@ -0,0 +1,19 @@
1
+ # tests-any dev-tool-in-dependencies bad practice
2
+
3
+ ## what
4
+
5
+ detects a test tool that tests-any declares in `devDependencies` (`jest`, `@jest/globals`,
6
+ `@types/jest`, `test-fns`, `tsx`, `esbuild-register`) when it also, or only, sits in
7
+ `dependencies`.
8
+
9
+ ## why
10
+
11
+ the tests-any best-practice floor raises the `devDependencies` entry alone. a stale duplicate in
12
+ `dependencies` wins the install, so plan reports the floor met while the old release lands. jest
13
+ then fails to load a reporter or setup that the old release predates.
14
+
15
+ ## fix
16
+
17
+ removes each such tool from `dependencies`. where `devDependencies` lacks it, the version moves
18
+ there; where `devDependencies` already holds it, that entry wins and the best-practice floor
19
+ raises it.
@@ -0,0 +1,3 @@
1
+ # .note = declarations dir is symlinked by the test to src/.test/assets/tests-any-only/declarations
2
+ declarations: 'declarations/declapract.declare.yml'
3
+ useCase: tests-any-only
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "test-project",
3
+ "version": "1.0.0",
4
+ "dependencies": {
5
+ "domain-objects": "0.31.0",
6
+ "test-fns": "1.4.0"
7
+ },
8
+ "devDependencies": {
9
+ "test-fns": "1.15.0"
10
+ }
11
+ }
@@ -0,0 +1,43 @@
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`tests-any dev-tool-in-dependencies — pipeline given: [case1] a repo with test-fns 1.4.0 in dependencies and 1.15.0 in devDependencies when: [t0] declapract fix is applied then: before + after match snapshot: package.json — after 1`] = `
4
+ "{
5
+ "name": "test-project",
6
+ "version": "1.0.0",
7
+ "dependencies": {
8
+ "domain-objects": "0.31.0"
9
+ },
10
+ "devDependencies": {
11
+ "test-fns": "1.17.0",
12
+ "@jest/globals": "30.2.0",
13
+ "@types/jest": "30.0.0",
14
+ "jest": "30.2.0",
15
+ "esbuild-register": "3.6.0",
16
+ "tsx": "4.20.6"
17
+ },
18
+ "scripts": {
19
+ "build:ifstale": "set -eu && if [ -f dist/.build.stamp ] && [ -z \\"$(find src assets package.json pnpm-lock.yaml tsconfig.json tsconfig.build.json app.json app.config.ts -newer dist/.build.stamp -type f ! -name '*.test.ts' ! -name '*.test.tsx' ! -name '*.snap' -print -quit 2>/dev/null)\\" ]; then echo '👌 dist is fresh, build skipped'; else npm run build && touch dist/.build.stamp; fi",
20
+ "test:unit": "set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n \\"\${CI:-}\\" ] && echo '--ci') $([ \\"\${THOROUGH:-}\\" != \\"true\\" ] && echo '--changedSince=origin/main') $([ \\"\${RESNAP:-}\\" = \\"true\\" ] && echo '--updateSnapshot')",
21
+ "test:integration": "set -eu && jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -n \\"\${CI:-}\\" ] && echo '--ci') $([ \\"\${THOROUGH:-}\\" != \\"true\\" ] && echo '--changedSince=origin/main') $([ \\"\${RESNAP:-}\\" = \\"true\\" ] && echo '--updateSnapshot')",
22
+ "test:acceptance:locally": "set -eu && npm run build:ifstale && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \\"\${RESNAP:-}\\" = \\"true\\" ] && echo '--updateSnapshot')",
23
+ "test": "set -eu && npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally",
24
+ "test:acceptance": "set -eu && npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \\"\${CI:-}\\" ] && echo '--ci') $([ \\"\${RESNAP:-}\\" = \\"true\\" ] && echo '--updateSnapshot')"
25
+ }
26
+ }
27
+ "
28
+ `;
29
+
30
+ exports[`tests-any dev-tool-in-dependencies — pipeline given: [case1] a repo with test-fns 1.4.0 in dependencies and 1.15.0 in devDependencies when: [t0] declapract fix is applied then: before + after match snapshot: package.json — before 1`] = `
31
+ "{
32
+ "name": "test-project",
33
+ "version": "1.0.0",
34
+ "dependencies": {
35
+ "domain-objects": "0.31.0",
36
+ "test-fns": "1.4.0"
37
+ },
38
+ "devDependencies": {
39
+ "test-fns": "1.15.0"
40
+ }
41
+ }
42
+ "
43
+ `;
@@ -0,0 +1,81 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+
3
+ import { asPackageJSON } from '../../../../utils/asPackageJSON';
4
+
5
+ /**
6
+ * .what = detects a test tool the tests-any practice floors in `devDependencies` that ALSO (or
7
+ * only) sits in `dependencies`
8
+ * .why = the best-practice floor raises the `devDependencies` entry alone. a stale duplicate in
9
+ * `dependencies` wins the install, so plan reports the floor met while the old release
10
+ * lands, and jest cannot load a reporter or setup that release predates (#657)
11
+ */
12
+ const PRACTICE = 'tests-any/dev-tool-in-dependencies';
13
+
14
+ // the test tools tests-any declares in devDependencies (its best-practice package.json)
15
+ export const DEV_TOOLS = [
16
+ '@jest/globals',
17
+ '@types/jest',
18
+ 'esbuild-register',
19
+ 'jest',
20
+ 'test-fns',
21
+ 'tsx',
22
+ ];
23
+
24
+ export const check: FileCheckFunction = (contents) => {
25
+ if (!contents)
26
+ throw new Error(
27
+ `does not match bad practice: [${PRACTICE}] package.json has no contents to scan`,
28
+ );
29
+
30
+ const packageJSON = asPackageJSON({ contents }, { practice: PRACTICE });
31
+ const prodDeps = Object.keys(packageJSON.dependencies ?? {});
32
+
33
+ // a dev tool in dependencies = the bad practice
34
+ if (prodDeps.some((dep) => DEV_TOOLS.includes(dep))) return;
35
+
36
+ throw new Error(
37
+ 'does not match bad practice: no tests-any dev tool in dependencies',
38
+ );
39
+ };
40
+
41
+ /**
42
+ * .what = remove each dev tool from prod deps; carry its version into dev deps only where dev
43
+ * deps lacks it, so an extant dev deps entry (the one the floor raises) wins
44
+ * .why = names the relocation as one intent, via a pure partition (inputs untouched)
45
+ */
46
+ const withDevToolsMovedToDevDeps = (input: {
47
+ prodDeps: Record<string, string>;
48
+ devDeps: Record<string, string>;
49
+ }): { prodDeps: Record<string, string>; devDeps: Record<string, string> } => {
50
+ const prodEntries = Object.entries(input.prodDeps);
51
+ const relocated = prodEntries.filter(([dep]) => DEV_TOOLS.includes(dep));
52
+ const retained = prodEntries.filter(([dep]) => !DEV_TOOLS.includes(dep));
53
+ return {
54
+ prodDeps: Object.fromEntries(retained),
55
+ devDeps: { ...Object.fromEntries(relocated), ...input.devDeps },
56
+ };
57
+ };
58
+
59
+ export const fix: FileFixFunction = (contents) => {
60
+ if (!contents) return { contents };
61
+
62
+ const packageJSON = asPackageJSON({ contents }, { practice: PRACTICE });
63
+
64
+ // relocate every dev tool out of prod deps
65
+ const { prodDeps, devDeps } = withDevToolsMovedToDevDeps({
66
+ prodDeps: { ...packageJSON.dependencies },
67
+ devDeps: { ...packageJSON.devDependencies },
68
+ });
69
+
70
+ // keep each section's presence: a declared section stays; dev deps is added only when the move
71
+ // lands a package into it
72
+ const fixedPackageJSON = {
73
+ ...packageJSON,
74
+ ...('dependencies' in packageJSON ? { dependencies: prodDeps } : {}),
75
+ ...('devDependencies' in packageJSON || Object.keys(devDeps).length > 0
76
+ ? { devDependencies: devDeps }
77
+ : {}),
78
+ };
79
+
80
+ return { contents: JSON.stringify(fixedPackageJSON, null, 2) };
81
+ };
@@ -0,0 +1 @@
1
+ we've migrated to using `.ts` config files for jest config, rather than `.js`
@@ -0,0 +1,17 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
4
+
5
+ /**
6
+ * .what = deletes a stale `.js` jest config file
7
+ * .why = the go-forward jest config is `.ts` (see .declapract.readme.md). a leftover
8
+ * `.js` jest config (e.g. a jsdom `jest.config.js` or a `jest.unit.config.js`)
9
+ * is redundant and fights the shipped `.ts` config — the dual-source hazard the
10
+ * app-protools-native migration must reconcile. drop the redundant `.js`; the
11
+ * best-practice supplies the canonical `.ts` config in the same pass.
12
+ * .note = `{ contents: null }` removes the file. idempotent: once gone, the EXISTS
13
+ * check no longer detects it, so a re-run is a no-op.
14
+ */
15
+ export const fix: FileFixFunction = () => {
16
+ return { contents: null };
17
+ };
@@ -0,0 +1,8 @@
1
+ should not have any `__mock__` directories
2
+
3
+ these are hard to track down and are too "magical" and affect _all_ tests (i.e., inter test dependency)
4
+
5
+ just explicitly mocks manually in each test OR root level in setup env with:
6
+ ```ts
7
+ jest.mock("...");
8
+ ```