declapract-typescript-ehmpathy 0.49.8 → 0.49.10

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 (38) hide show
  1. package/dist/__snapshots__/actionPins.declapract.integration.test.ts.snap +70 -0
  2. package/dist/actionPins.declapract.integration.test.ts +785 -0
  3. package/dist/practices/cicd-app-react-native-expo/best-practice/.declapract.readme.md +27 -0
  4. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/.deploy-expo.yml +10 -10
  5. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/deploy.yml +4 -0
  6. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/test.yml +4 -0
  7. package/dist/practices/cicd-app-react-native-expo/best-practice/.gitignore.declapract.ts +18 -11
  8. package/dist/practices/cicd-common/.declapract.integration.test.ts +572 -0
  9. package/dist/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/.test.yml +19 -0
  10. package/dist/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/consumer-owned.yml +21 -0
  11. package/dist/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/review.yml +26 -0
  12. package/dist/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/declapract.use.yml +6 -0
  13. package/dist/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/package.json +4 -0
  14. package/dist/practices/cicd-common/__snapshots__/.declapract.integration.test.ts.snap +550 -0
  15. package/dist/practices/cicd-common/best-practice/.declapract.readme.md +5 -0
  16. package/dist/practices/cicd-common/best-practice/.github/workflows/.declastruct.yml +12 -12
  17. package/dist/practices/cicd-common/best-practice/.github/workflows/.install.yml +5 -5
  18. package/dist/practices/cicd-common/best-practice/.github/workflows/.test.yml +25 -25
  19. package/dist/practices/cicd-common/best-practice/.github/workflows/release.yml +2 -2
  20. package/dist/practices/cicd-common/best-practice/.github/workflows/review.yml +1 -1
  21. package/dist/practices/cicd-package/best-practice/.github/workflows/.publish-npm.yml +3 -3
  22. package/dist/practices/cicd-package/best-practice/.github/workflows/provision.yml +4 -0
  23. package/dist/practices/cicd-service/best-practice/.github/workflows/.deploy-sls.yml +13 -13
  24. package/dist/practices/cicd-service/best-practice/.github/workflows/.sql-schema-control.yml +8 -8
  25. package/dist/practices/cicd-service/best-practice/.github/workflows/.terraform.yml +6 -6
  26. package/dist/practices/cicd-service/best-practice/.github/workflows/provision.yml +4 -0
  27. package/dist/practices/git/.declapract.integration.test.ts +950 -0
  28. package/dist/practices/git/.test/assets/repo-with-rhachet-only/declapract.use.yml +6 -0
  29. package/dist/practices/git/.test/assets/repo-with-rhachet-only/package.json +4 -0
  30. package/dist/practices/git/.test/assets/repo-without-cache-ignores/declapract.use.yml +9 -0
  31. package/dist/practices/git/.test/assets/repo-without-cache-ignores/package.json +4 -0
  32. package/dist/practices/git/__snapshots__/.declapract.integration.test.ts.snap +51 -0
  33. package/dist/practices/git/best-practice/.declapract.readme.md +23 -0
  34. package/dist/practices/git/best-practice/.gitignore.declapract.ts +59 -33
  35. package/dist/practices/rhachet/best-practice/.declapract.readme.md +32 -0
  36. package/dist/practices/rhachet/best-practice/.gitignore.declapract.ts +64 -0
  37. package/dist/utils/defineExpectedGitignoreContents.ts +84 -0
  38. package/package.json +7 -7
@@ -0,0 +1,27 @@
1
+ the cicd workflows and gitignore for an expo app
2
+
3
+ this practice declares `android/` and `ios/` — the build output `expo prebuild` emits, which is
4
+ scratch in a managed-workflow repo.
5
+
6
+ 📖 several practices declare this same `.gitignore`. the contract they share — one shared
7
+ algorithm, the ordered tail, what a new declarer owes — is stated once at
8
+ `.agent/repo=.this/role=any/briefs/howto.declare-the-repo-gitignore.md`. read that before you add
9
+ a line here.
10
+
11
+ ## this declaration once went stale, and that is why it imports
12
+
13
+ it was authored 2024-09-11, cloned from the `git` practice's shape at the time. `git` gained its
14
+ ordered tail in #404 on 2026-01-31, and this copy never caught up — so it sorted every line,
15
+ which hoisted the `!` negations above their target and turned them inert.
16
+
17
+ fixed 2026-07-30 (#537) by an import of the shared algorithm rather than a re-derivation.
18
+ consumers saw no content change: an expo repo already received the ordered tail from `git`; what
19
+ changed is that this practice no longer hoists it.
20
+
21
+ the clamp is `.gitignore.declapract.test.ts` → `convergence with the git practice`, which asserts
22
+ both checks pass once both have run, that the settled file is a fixed point under either, and
23
+ that the negations stay below `node_modules`.
24
+
25
+ ⚠️ its declared set is **disjoint** from git's, so neither practice's output alone satisfies the
26
+ other's check — both must run. this differs from `rhachet`, whose one line is a subset of git's.
27
+ do not copy an assertion between those two suites without that check.
@@ -49,21 +49,21 @@ jobs:
49
49
  runs-on: ubuntu-latest
50
50
  steps:
51
51
  - name: checkout
52
- uses: actions/checkout@v4
52
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
53
53
 
54
54
  - name: set node-version
55
- uses: actions/setup-node@v4
55
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
56
56
  with:
57
57
  node-version-file: ".nvmrc"
58
58
 
59
59
  - name: configure aws credentials (oidc)
60
- uses: aws-actions/configure-aws-credentials@v4
60
+ uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
61
61
  with:
62
62
  role-to-assume: ${{ inputs.creds-aws-role-arn }}
63
63
  aws-region: ${{ inputs.creds-aws-region }}
64
64
 
65
65
  - name: node-modules cache get
66
- uses: actions/cache/restore@v4
66
+ uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
67
67
  id: cache
68
68
  with:
69
69
  path: ./node_modules
@@ -74,7 +74,7 @@ jobs:
74
74
  run: npm ci --ignore-scripts --prefer-offline --no-audit
75
75
 
76
76
  - name: setup expo
77
- uses: expo/expo-github-action@v8
77
+ uses: expo/expo-github-action@c7b66a9c327a43a8fa7c0158e7f30d6040d2481e # v8
78
78
  with:
79
79
  eas-version: latest
80
80
  token: ${{ secrets.expo-token }}
@@ -91,21 +91,21 @@ jobs:
91
91
  if: ${{ inputs.stage == 'prod' && inputs.app-web-deployment-s3-bucket }}
92
92
  steps:
93
93
  - name: checkout
94
- uses: actions/checkout@v4
94
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
95
95
 
96
96
  - name: set node-version
97
- uses: actions/setup-node@v4
97
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
98
98
  with:
99
99
  node-version-file: ".nvmrc"
100
100
 
101
101
  - name: configure aws credentials (oidc)
102
- uses: aws-actions/configure-aws-credentials@v4
102
+ uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
103
103
  with:
104
104
  role-to-assume: ${{ inputs.creds-aws-role-arn }}
105
105
  aws-region: ${{ inputs.creds-aws-region }}
106
106
 
107
107
  - name: node-modules cache get
108
- uses: actions/cache/restore@v4
108
+ uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
109
109
  id: cache
110
110
  with:
111
111
  path: ./node_modules
@@ -116,7 +116,7 @@ jobs:
116
116
  run: npm ci --ignore-scripts --prefer-offline --no-audit
117
117
 
118
118
  - name: setup expo
119
- uses: expo/expo-github-action@v8
119
+ uses: expo/expo-github-action@c7b66a9c327a43a8fa7c0158e7f30d6040d2481e # v8
120
120
  with:
121
121
  eas-version: latest
122
122
  token: ${{ secrets.expo-token }}
@@ -30,6 +30,10 @@ concurrency:
30
30
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} # per [workflow] x [branch, tag] x [event]
31
31
  cancel-in-progress: true # only cancel work flows on non-latest commits
32
32
 
33
+ permissions:
34
+ id-token: write # required for oidc; a called workflow cannot exceed its caller's grant
35
+ contents: read
36
+
33
37
  jobs:
34
38
  test:
35
39
  uses: ./.github/workflows/.test.yml
@@ -12,6 +12,10 @@ concurrency:
12
12
  group: ${{ github.workflow }}-${{ github.ref }} # per [workflow] x [branch, tag]
13
13
  cancel-in-progress: true # cancel workflows for non-latest commits
14
14
 
15
+ permissions:
16
+ id-token: write # required for oidc; a called workflow cannot exceed its caller's grant
17
+ contents: read
18
+
15
19
  jobs:
16
20
  suite:
17
21
  uses: ./.github/workflows/.test.yml
@@ -1,21 +1,28 @@
1
1
  import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
- import { dedupe } from 'domain-objects';
3
2
  import expect from 'expect';
4
3
 
5
- const expectedIgnores = ['android/', 'ios/'].sort();
4
+ import { defineExpectedGitignoreContents } from '../../../utils/defineExpectedGitignoreContents';
6
5
 
7
- const defineExpectedContents = (contents: string | null): string => {
8
- const ignoresAlreadyDefined = contents ? contents.split('\n') : [];
9
- const finalLines = dedupe([...ignoresAlreadyDefined, ...expectedIgnores])
10
- .sort() // sorted
11
- .filter((line) => !!line); // without empty lines
12
- return [...finalLines.sort(), ''].join('\n');
13
- };
6
+ /**
7
+ * .what = the ignores this practice declares — the build output an expo app emits
8
+ * .why = `android/` and `ios/` are generated by `expo prebuild`, so they are scratch
9
+ * in a managed-workflow repo.
10
+ * .note = this list is NOT sorted here, and that is deliberate.
11
+ * `defineExpectedGitignoreContents` sorts the union of these lines with the
12
+ * repo's own, so a `.sort()` at this site would be a second sort that changes
13
+ * no output -- while it mutates a module-cached array in place. `readonly`
14
+ * forbids that mutation outright.
15
+ */
16
+ const ignoresSortable: readonly string[] = ['android/', 'ios/'];
14
17
 
15
18
  export const check: FileCheckFunction = (contents) => {
16
- expect(contents).toEqual(defineExpectedContents(contents));
19
+ expect(contents).toEqual(
20
+ defineExpectedGitignoreContents({ contents, ignoresSortable }),
21
+ );
17
22
  };
18
23
 
19
24
  export const fix: FileFixFunction = (contents) => {
20
- return { contents: defineExpectedContents(contents) };
25
+ return {
26
+ contents: defineExpectedGitignoreContents({ contents, ignoresSortable }),
27
+ };
21
28
  };