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,43 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+
3
+ import { asTemplateFingerprint } from '../../../../../../../utils/asTemplateFingerprint';
4
+ import {
5
+ isGetDatabaseConnectionImporter,
6
+ withGetDatabaseConnectionRepointed,
7
+ } from '../../../../../../../utils/withGetDatabaseConnectionRepointed';
8
+
9
+ /**
10
+ * .what = the fingerprint of the one test body persist-with-rds shipped at this path
11
+ * .why = that test duplicates getOneDatabaseConnection.integration.test.ts, so the fix deletes it
12
+ * when the repo still holds the shipped body; an edited copy is repointed instead
13
+ */
14
+ export const OLD_TEST_TEMPLATE_FINGERPRINTS: string[] = [
15
+ '9f828d9d66611826e89a00ba28a28496d0648f13d2b937b8d599844256f63213', // 66284e3, unchanged through b8d4803
16
+ ];
17
+
18
+ export const check: FileCheckFunction = (contents) => {
19
+ // detect the shipped duplicate, or any copy that still reaches the retired module
20
+ if (
21
+ contents !== null &&
22
+ (OLD_TEST_TEMPLATE_FINGERPRINTS.includes(
23
+ asTemplateFingerprint({ source: contents }),
24
+ ) ||
25
+ isGetDatabaseConnectionImporter({ source: contents }))
26
+ )
27
+ return; // bad practice detected
28
+ throw new Error(
29
+ 'does not match bad practice: no shipped getDatabaseConnection test, and no import of the retired module',
30
+ );
31
+ };
32
+
33
+ export const fix: FileFixFunction = (contents) => {
34
+ if (contents === null) return { contents };
35
+
36
+ // delete the shipped duplicate
37
+ const fingerprint = asTemplateFingerprint({ source: contents });
38
+ if (OLD_TEST_TEMPLATE_FINGERPRINTS.includes(fingerprint))
39
+ return { contents: null };
40
+
41
+ // keep an edited copy, repointed onto the new factory
42
+ return { contents: withGetDatabaseConnectionRepointed({ source: contents }) };
43
+ };
@@ -0,0 +1,51 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+
3
+ import { asTemplateFingerprint } from '../../../../../../../utils/asTemplateFingerprint';
4
+
5
+ /**
6
+ * .what = the fingerprint of every body persist-with-rds ever shipped at this path
7
+ * .why = the fix deletes the file only when the repo still holds one of these bodies; an adopter's
8
+ * edit must never be dropped silently. one per template revision, 2021-08 through 2026-05,
9
+ * each proven by a fixture in this bad-practice's `.test/assets/old-templates/`
10
+ * .note = ten revisions, eight fingerprints: 66284e3 → d1e8cd7 → ef25ae0 were format-only changes
11
+ */
12
+ export const OLD_TEMPLATE_FINGERPRINTS: string[] = [
13
+ '4652212f6406f8245aec5c8595975b1bb60a0f18b0191af5c5943fa40b372e7d', // 66284e3, d1e8cd7, ef25ae0
14
+ 'c4382197566f98a406536c74c34637ddd93d894fa69e6608a6a665599fe46a9f', // 3a193e5
15
+ 'a6b220f1ffffb81c1d793744be5c4324f401e45e1bc2c5b8d2f88525e04118e3', // 9e1bdc4
16
+ 'ef6e06c5aaafbee194a5e209178b6b1e40a57f5870fd76f7ac33aa108d3a653e', // c6cef7e
17
+ 'e38f23c3ef7b148ae1974001e65e05f1f92ebcb5eade23974ac6de40df68cbd7', // eab15c0
18
+ '8b1ffaa9a42d778b7a8ca07bda6cc7d405665aa44a02aec15379992d6e57970d', // c8eb35b
19
+ '0283efcee1fc208d125a24fe1c101599cecad67828a33108b2fa8c8a849b71d7', // 68cf8ba
20
+ '6871c674157bb59da937231cf8aac7e17e3c34a0c2e59c580fcf33e2709a64f2', // e0c53d8
21
+ ];
22
+
23
+ /**
24
+ * .what = the review pointer stamped above an edited copy
25
+ * .why = an edited copy is kept, so `plan` stays red; the pointer names what a human must do
26
+ */
27
+ const REVIEW_MARKER =
28
+ '// @declapract:review: getDatabaseConnection.ts is retired — its importers now read getOneDatabaseConnection. move any local edit into getOneDatabaseConnection.ts, then delete this file';
29
+
30
+ export const check: FileCheckFunction = (contents) => {
31
+ if (contents !== null) return; // bad practice detected: the retired factory is still here
32
+ throw new Error(
33
+ 'does not match bad practice: getDatabaseConnection.ts is absent',
34
+ );
35
+ };
36
+
37
+ export const fix: FileFixFunction = (contents) => {
38
+ if (contents === null) return { contents };
39
+
40
+ // delete the file when it is still a template the practice shipped
41
+ const fingerprint = asTemplateFingerprint({ source: contents });
42
+ if (OLD_TEMPLATE_FINGERPRINTS.includes(fingerprint))
43
+ return { contents: null };
44
+
45
+ // otherwise keep the adopter's edit, and stamp the pointer once
46
+ if (
47
+ contents.includes('@declapract:review: getDatabaseConnection.ts is retired')
48
+ )
49
+ return { contents };
50
+ return { contents: `${REVIEW_MARKER}\n${contents}` };
51
+ };
@@ -0,0 +1 @@
1
+ we switched from `provision/docker/integration_test_db` to `provision/docker/testdb`
@@ -0,0 +1,15 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS; // if a file exists with this path pattern, then it's bad practice
4
+
5
+ export const fix: FileFixFunction = async (contents, { relativeFilePath }) => {
6
+ // Move from integration_test_db to testdb
7
+ const newPath = relativeFilePath.replace(
8
+ 'provision/docker/integration_test_db',
9
+ 'provision/docker/testdb',
10
+ );
11
+ return {
12
+ contents,
13
+ relativeFilePath: newPath,
14
+ };
15
+ };
@@ -0,0 +1 @@
1
+ we switched from `provision/docker/integration-test-db` to `provision/docker/testdb`
@@ -0,0 +1,15 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS; // if a file exists with this path pattern, then it's bad practice
4
+
5
+ export const fix: FileFixFunction = async (contents, { relativeFilePath }) => {
6
+ // Move from integration-test-db to testdb
7
+ const newPath = relativeFilePath.replace(
8
+ 'provision/docker/integration-test-db',
9
+ 'provision/docker/testdb',
10
+ );
11
+ return {
12
+ contents,
13
+ relativeFilePath: newPath,
14
+ };
15
+ };
@@ -0,0 +1 @@
1
+ we switched from `provision/docker/integration-test-db` to `provision/docker/testdb` - this detects old paths in package.json scripts
@@ -0,0 +1,8 @@
1
+ {
2
+ "scripts": {
3
+ "provision:testdb:docker:prepare": "@declapract{check.contains('integration-test-db')}",
4
+ "provision:testdb:docker:up": "@declapract{check.contains('integration-test-db')}",
5
+ "provision:testdb:docker:await": "@declapract{check.contains('integration-test-db')}",
6
+ "provision:testdb:docker:down": "@declapract{check.contains('integration-test-db')}"
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.CONTAINS;
4
+
5
+ export const fix: FileFixFunction = (contents) => {
6
+ if (!contents) return { contents }; // do nothing if no contents
7
+ // Replace integration-test-db with testdb in all paths
8
+ const fixed = contents.replace(/integration-test-db/g, 'testdb');
9
+ return { contents: fixed };
10
+ };
@@ -0,0 +1,9 @@
1
+ {
2
+ "scripts": {
3
+ "provision:docker:clear": "docker rm -f $(docker ps -a -f 'publish=7821' -q) 2>/dev/null || true && echo 'ensured port is available 👍'",
4
+ "provision:docker:prepare": "cp provision/schema/sql/init/.extensions.sql provision/docker/integration-test-db/init/extensions.sql && cp provision/schema/sql/init/.schema.sql provision/docker/integration-test-db/init/schema.sql && cp provision/schema/sql/init/.user.cicd.sql provision/docker/integration-test-db/init/user.cicd.sql",
5
+ "provision:docker:up": "docker compose -f ./provision/docker/integration-test-db/docker-compose.yml up -d --force-recreate --build --renew-anon-volumes",
6
+ "provision:docker:await": "docker compose -f ./provision/docker/integration-test-db/docker-compose.yml exec -T postgres /root/wait-for-postgres.sh",
7
+ "provision:docker:down": "docker compose -f ./provision/docker/integration-test-db/docker-compose.yml down"
8
+ }
9
+ }
@@ -0,0 +1,22 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.CONTAINS;
4
+
5
+ export const fix: FileFixFunction = (contents) => {
6
+ if (!contents) return { contents }; // do nothing if no contents
7
+ const packageJSON = JSON.parse(contents);
8
+ const updatedPackageJSON = {
9
+ ...packageJSON,
10
+ scripts: {
11
+ ...packageJSON.scripts,
12
+ 'provision:docker:clear': undefined,
13
+ 'provision:docker:prepare': undefined,
14
+ 'provision:docker:up': undefined,
15
+ 'provision:docker:await': undefined,
16
+ 'provision:docker:down': undefined,
17
+ },
18
+ };
19
+ return {
20
+ contents: JSON.stringify(updatedPackageJSON, null, 2),
21
+ };
22
+ };
@@ -0,0 +1,14 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+
3
+ export const check: FileCheckFunction = (contents) => {
4
+ if (contents?.includes('__PARAM__')) return; // bad practice detected
5
+ throw new Error('does not match bad practice');
6
+ };
7
+
8
+ export const fix: FileFixFunction = (contents) => {
9
+ if (!contents) return { contents };
10
+
11
+ return {
12
+ contents: contents.replace(/"__PARAM__"/g, '"$.at(aws::param)"'),
13
+ };
14
+ };
@@ -0,0 +1,86 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'node:path';
3
+
4
+ import { executeApply } from 'declapract';
5
+ import { genTempDir, given, then, useThen, when } from 'test-fns';
6
+
7
+ /**
8
+ * .what = end-to-end proof of the pg-client-without-ssl fix (#652), run through the REAL declapract
9
+ * apply pipeline against a genTempDir clone of a consumer repo
10
+ * .why = a unit test of `fix` never proves the `src/**\/*.ts` glob reaches a client the repo built
11
+ * on its own, nor that one apply leaves it converged. a client that reads the app config is
12
+ * given verified tls; a client that does not is flagged for a human, and never guessed at
13
+ * .note = each touched file is snapshotted in full, before AND after, per
14
+ * rule.require.declapract-integration-tests
15
+ */
16
+ // each apply evaluates the whole practice, which runs long under a full suite
17
+ jest.setTimeout(10 * 60 * 1000);
18
+
19
+ describe('pg-client-without-ssl (#652)', () => {
20
+ given('[case1] a repo with two plaintext pg clients of its own', () => {
21
+ const tempDir = genTempDir({
22
+ slug: 'declapract-persist-with-rds-pg-client-without-ssl',
23
+ clone:
24
+ './src/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client',
25
+ symlink: [{ at: 'declarations', to: 'src' }],
26
+ });
27
+ const files = [
28
+ 'src/utils/database/getSurfReportConnection.ts',
29
+ 'src/access/sdks/sdkWaveArchive.ts',
30
+ ];
31
+ const read = (relativePath: string) =>
32
+ fs.readFile(path.join(tempDir, relativePath), 'utf-8');
33
+ const applyAll = async () => {
34
+ for (const file of files)
35
+ await executeApply({
36
+ config: path.join(tempDir, 'declapract.use.yml'),
37
+ practice: 'persist-with-rds',
38
+ file,
39
+ });
40
+ };
41
+
42
+ when('[t0] the input, before any fix', () => {
43
+ then('each client file matches snapshot', async () => {
44
+ for (const file of files)
45
+ expect(await read(file)).toMatchSnapshot(`${file} — before`);
46
+ });
47
+ });
48
+
49
+ when('[t1] apply runs', () => {
50
+ useThen('apply the fix', async () => applyAll());
51
+
52
+ then('the config-backed client declares verified tls, and matches snapshot', async () => {
53
+ const after = await read(files[0]!);
54
+ expect(after).toContain(
55
+ 'ssl: asDatabaseClientSsl({ clusterEndpoint: config.database.tunnel.lambda?.host ?? null }),',
56
+ );
57
+ expect(after).toContain(
58
+ "import { asDatabaseClientSsl } from '@src/utils/database/asDatabaseClientSsl';",
59
+ );
60
+ expect(after).toMatchSnapshot(`${files[0]} — after`);
61
+ });
62
+
63
+ then('the client outside the config is flagged, not guessed at, and matches snapshot', async () => {
64
+ const after = await read(files[1]!);
65
+ expect(after.split('\n')[0]).toContain('@declapract:review: a pg Client here');
66
+ expect(after).toContain(
67
+ 'new pg.Client({ host: process.env.WAVE_ARCHIVE_HOST });',
68
+ );
69
+ expect(after).toMatchSnapshot(`${files[1]} — after`);
70
+ });
71
+ });
72
+
73
+ when('[t2] apply runs again (idempotency)', () => {
74
+ const passes = useThen('a second apply', async () => {
75
+ const before = await Promise.all(files.map((file) => read(file)));
76
+ await applyAll();
77
+ const after = await Promise.all(files.map((file) => read(file)));
78
+ return { before, after };
79
+ });
80
+
81
+ then('the second apply changes zero bytes', () => {
82
+ expect(passes.after).toEqual(passes.before);
83
+ });
84
+ });
85
+ });
86
+ });
@@ -0,0 +1,9 @@
1
+ a pg `Client` built with no `ssl` option connects in plaintext. a postgres 17 cluster forces ssl
2
+ by default, so that client fails to connect at all once the cluster is upgraded.
3
+
4
+ this fix gives each such client `ssl: asDatabaseClientSsl({ clusterEndpoint })`, which verifies the
5
+ cluster certificate against the rds us-east-1 roots and connects plain to the local testdb.
6
+
7
+ the fix names the endpoint as `config.database.tunnel.lambda?.host`, so it applies only where the
8
+ file already reads `config.database.tunnel`. any other file gets a review pointer at its top, since
9
+ a human must pick the endpoint there.
@@ -0,0 +1,4 @@
1
+ declare:
2
+ examples: declarations/examples
3
+ practices: declarations/practices
4
+ use-cases: declarations/useCases.yml
@@ -0,0 +1,19 @@
1
+ declarations: './'
2
+ useCase: lambda-service-with-rds
3
+ variables:
4
+ organizationName: 'test-org'
5
+ projectName: 'test-project'
6
+ databaseName: 'testdb'
7
+ databaseClusterName: 'testdb'
8
+ databaseUserName:
9
+ cicdUser: 'testdb_cicd'
10
+ serviceUser: 'testdb_service'
11
+ databaseTunnelHost:
12
+ prep: 'localhost'
13
+ prod: 'localhost'
14
+ databaseClusterHost:
15
+ prep: 'localhost'
16
+ prod: 'localhost'
17
+ awsAccountId:
18
+ prep: '123456789012'
19
+ prod: '123456789012'
@@ -0,0 +1,7 @@
1
+ import pg from 'pg';
2
+
3
+ /**
4
+ * .what = a client for a wave archive outside the app config
5
+ */
6
+ export const getWaveArchiveClient = () =>
7
+ new pg.Client({ host: process.env.WAVE_ARCHIVE_HOST });
@@ -0,0 +1,19 @@
1
+ import { Client } from 'pg';
2
+
3
+ import { getConfig } from '@src/utils/config/getConfig';
4
+
5
+ /**
6
+ * .what = a second connection the repo built on its own, for the surf report replica
7
+ */
8
+ export const getSurfReportConnection = async () => {
9
+ const config = await getConfig();
10
+ const client = new Client({
11
+ host: config.database.tunnel.local.host,
12
+ port: config.database.tunnel.local.port,
13
+ user: config.database.role.crud.username,
14
+ password: config.database.role.crud.password,
15
+ database: config.database.target.database,
16
+ });
17
+ await client.connect();
18
+ return client;
19
+ };
@@ -0,0 +1,72 @@
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`pg-client-without-ssl (#652) given: [case1] a repo with two plaintext pg clients of its own when: [t0] the input, before any fix then: each client file matches snapshot: src/access/sdks/sdkWaveArchive.ts — before 1`] = `
4
+ "import pg from 'pg';
5
+
6
+ /**
7
+ * .what = a client for a wave archive outside the app config
8
+ */
9
+ export const getWaveArchiveClient = () =>
10
+ new pg.Client({ host: process.env.WAVE_ARCHIVE_HOST });
11
+ "
12
+ `;
13
+
14
+ exports[`pg-client-without-ssl (#652) given: [case1] a repo with two plaintext pg clients of its own when: [t0] the input, before any fix then: each client file matches snapshot: src/utils/database/getSurfReportConnection.ts — before 1`] = `
15
+ "import { Client } from 'pg';
16
+
17
+ import { getConfig } from '@src/utils/config/getConfig';
18
+
19
+ /**
20
+ * .what = a second connection the repo built on its own, for the surf report replica
21
+ */
22
+ export const getSurfReportConnection = async () => {
23
+ const config = await getConfig();
24
+ const client = new Client({
25
+ host: config.database.tunnel.local.host,
26
+ port: config.database.tunnel.local.port,
27
+ user: config.database.role.crud.username,
28
+ password: config.database.role.crud.password,
29
+ database: config.database.target.database,
30
+ });
31
+ await client.connect();
32
+ return client;
33
+ };
34
+ "
35
+ `;
36
+
37
+ exports[`pg-client-without-ssl (#652) given: [case1] a repo with two plaintext pg clients of its own when: [t1] apply runs then: the client outside the config is flagged, not guessed at, and matches snapshot: src/access/sdks/sdkWaveArchive.ts — after 1`] = `
38
+ "// @declapract:review: a pg Client here connects with no tls. pass \`ssl: asDatabaseClientSsl({ clusterEndpoint })\` from @src/utils/database/asDatabaseClientSsl
39
+ import pg from 'pg';
40
+
41
+ /**
42
+ * .what = a client for a wave archive outside the app config
43
+ */
44
+ export const getWaveArchiveClient = () =>
45
+ new pg.Client({ host: process.env.WAVE_ARCHIVE_HOST });
46
+ "
47
+ `;
48
+
49
+ exports[`pg-client-without-ssl (#652) given: [case1] a repo with two plaintext pg clients of its own when: [t1] apply runs then: the config-backed client declares verified tls, and matches snapshot: src/utils/database/getSurfReportConnection.ts — after 1`] = `
50
+ "import { Client } from 'pg';
51
+
52
+ import { getConfig } from '@src/utils/config/getConfig';
53
+ import { asDatabaseClientSsl } from '@src/utils/database/asDatabaseClientSsl';
54
+
55
+ /**
56
+ * .what = a second connection the repo built on its own, for the surf report replica
57
+ */
58
+ export const getSurfReportConnection = async () => {
59
+ const config = await getConfig();
60
+ const client = new Client({
61
+ host: config.database.tunnel.local.host,
62
+ port: config.database.tunnel.local.port,
63
+ user: config.database.role.crud.username,
64
+ password: config.database.role.crud.password,
65
+ database: config.database.target.database,
66
+ ssl: asDatabaseClientSsl({ clusterEndpoint: config.database.tunnel.lambda?.host ?? null }),
67
+ });
68
+ await client.connect();
69
+ return client;
70
+ };
71
+ "
72
+ `;
@@ -0,0 +1,32 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+
3
+ import {
4
+ isPgClientWithoutSsl,
5
+ withPgClientSslDeclared,
6
+ } from '../../../../../../utils/withPgClientSslDeclared';
7
+
8
+ /**
9
+ * .what = the retired factory files that `old-get-database-connection` declares by their own path
10
+ * .why = that bad-practice deletes them on a template match; were this wildcard to flag them too,
11
+ * two fixes would race on one file (a rewrite turns a template match into a kept edit, or
12
+ * a second unlink hits a file already gone), so the retired files are left to their owner
13
+ */
14
+ const RETIRED_FILE_PATHS = [
15
+ 'src/utils/database/getDatabaseConnection.ts',
16
+ 'src/utils/database/getDatabaseConnection.integration.test.ts',
17
+ ];
18
+
19
+ export const check: FileCheckFunction = (contents, context) => {
20
+ if (
21
+ contents !== null &&
22
+ !RETIRED_FILE_PATHS.includes(context.relativeFilePath) &&
23
+ isPgClientWithoutSsl({ source: contents })
24
+ )
25
+ return; // bad practice detected
26
+ throw new Error('does not match bad practice: every pg Client declares ssl');
27
+ };
28
+
29
+ export const fix: FileFixFunction = (contents) => {
30
+ if (contents === null) return { contents };
31
+ return { contents: withPgClientSslDeclared({ source: contents }) };
32
+ };
@@ -0,0 +1,12 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
4
+
5
+ export const fix: FileFixFunction = (_, context) => {
6
+ return {
7
+ relativeFilePath: context.relativeFilePath.replace(
8
+ /provision\/schema\/entities\//g,
9
+ 'provision/schema/domain/',
10
+ ),
11
+ };
12
+ };
@@ -0,0 +1,13 @@
1
+ import { FileCheckType, type FileFixFunction } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
4
+
5
+ export const fix: FileFixFunction = (_, context) => {
6
+ return {
7
+ // rename file to "domain.yml"
8
+ relativeFilePath: context.relativeFilePath.replace(
9
+ /entities\.yml$/,
10
+ 'domain.yml',
11
+ ),
12
+ };
13
+ };
@@ -0,0 +1,95 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'node:path';
3
+
4
+ import { executeApply } from 'declapract';
5
+ import { genTempDir, given, then, useThen, when } from 'test-fns';
6
+
7
+ /**
8
+ * .what = end-to-end proof of the terraform-parameters forget, run through the REAL
9
+ * declapract apply pipeline against a genTempDir clone of a consumer repo.
10
+ * .why = the bad-practice fix must rewrite every `resource "aws_ssm_parameter"` into
11
+ * a `removed{}` forget block (never a destroy), and drop the `data` seed-reads —
12
+ * so terraform lets go of the params without loss of the live value. the
13
+ * go-forward declastruct wish declares its own names separately; the OLD names
14
+ * here are simply orphaned (forgotten from terraform, not adopted by declastruct).
15
+ * .note = the terraform file is snapshotted in full (before AND after) so a reviewer
16
+ * can eyeball the exact end-state, per rule.require.declapract-integration-tests.
17
+ */
18
+ // the practice-scoped apply evaluates the whole persist-with-rds practice; under suite load it can outlast the default
19
+ jest.setTimeout(600_000);
20
+
21
+ describe('terraform-parameters forget', () => {
22
+ given(
23
+ '[case1] a repo with terraform-managed ssm params',
24
+ () => {
25
+ const tempDir = genTempDir({
26
+ slug: 'declapract-terraform-parameters',
27
+ clone: './src/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm',
28
+ symlink: [{ at: 'declarations', to: 'src' }],
29
+ });
30
+
31
+ const tfPath = 'provision/aws/product/parameter-store.tf';
32
+ const read = (relativePath: string) =>
33
+ fs.readFile(path.join(tempDir, relativePath), 'utf-8');
34
+ const applyForget = () =>
35
+ executeApply({
36
+ config: path.join(tempDir, 'declapract.use.yml'),
37
+ practice: 'persist-with-rds',
38
+ file: tfPath,
39
+ });
40
+
41
+ when('[t0] the migration input (before any fix)', () => {
42
+ then('the terraform input matches snapshot', async () => {
43
+ expect(await read(tfPath)).toMatchSnapshot(
44
+ 'parameter-store.tf — before',
45
+ );
46
+ });
47
+ });
48
+
49
+ when('[t1] the bad-practice forget fix is applied', () => {
50
+ useThen('forget the terraform params', async () => applyForget());
51
+
52
+ then(
53
+ 'the terraform file holds only removed{} forget blocks (no resource/data blocks) and matches snapshot',
54
+ async () => {
55
+ const tf = await read(tfPath);
56
+ expect(tf).not.toContain('resource "aws_ssm_parameter"');
57
+ expect(tf).not.toContain('data "aws_ssm_parameter"');
58
+ expect(tf).toContain(
59
+ 'from = aws_ssm_parameter.secret_database_role_crud_password',
60
+ );
61
+ expect(tf).toContain(
62
+ 'from = aws_ssm_parameter.secret_twilio_authToken',
63
+ );
64
+ expect(tf).toContain('destroy = false');
65
+ // the admin forget names its two copy targets under the derived names (#686)
66
+ expect(tf).toContain(
67
+ '# copy this value before the first plan → /test-org/test-project/{config}/database.role.cicd.for-plan.password, /test-org/test-project/{config}/database.role.cicd.for-apply.password (see provision/aws/readme.md)\nremoved {\n from = aws_ssm_parameter.secret_database_admin_password',
68
+ );
69
+ // full content, for the reviewer's eye
70
+ expect(tf).toMatchSnapshot('parameter-store.tf — after');
71
+ },
72
+ );
73
+ });
74
+
75
+ when('[t2] the forget fix is applied a second time (idempotency)', () => {
76
+ // capture the post-first-forget state, apply again, capture again — assert
77
+ // zero change. the forget regex must not re-match its own removed{} output
78
+ // (per rule.require.idempotent-fixes).
79
+ const passes = useThen(
80
+ 'a second forget over its own output',
81
+ async () => {
82
+ const before = await read(tfPath); // post-first-forget
83
+ await applyForget(); // second apply
84
+ const after = await read(tfPath);
85
+ return { before, after };
86
+ },
87
+ );
88
+
89
+ then('the second forget is a no-op', () => {
90
+ expect(passes.after).toEqual(passes.before);
91
+ });
92
+ });
93
+ },
94
+ );
95
+ });
@@ -0,0 +1,4 @@
1
+ declare:
2
+ examples: declarations/examples
3
+ practices: declarations/practices
4
+ use-cases: declarations/useCases.yml
@@ -0,0 +1,18 @@
1
+ declarations: './'
2
+ useCase: lambda-service-with-rds
3
+ variables:
4
+ organizationName: 'test-org'
5
+ projectName: 'test-project'
6
+ databaseName: 'testdb'
7
+ databaseUserName:
8
+ cicdUser: 'testdb_cicd'
9
+ serviceUser: 'testdb_service'
10
+ databaseTunnelHost:
11
+ prep: 'localhost'
12
+ prod: 'localhost'
13
+ databaseClusterHost:
14
+ prep: 'localhost'
15
+ prod: 'localhost'
16
+ awsAccountId:
17
+ prep: '123456789012'
18
+ prod: '123456789012'