declapract-typescript-ehmpathy 0.41.0 → 0.42.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.
@@ -5,10 +5,10 @@ on:
5
5
  outputs:
6
6
  node-modules-cache-key:
7
7
  description: a max(stable) cache key to the node modules of this commit's dependencies
8
- value: ${{ jobs.npm.outputs.node-modules-cache-key }}
8
+ value: ${{ jobs.pnpm.outputs.node-modules-cache-key }}
9
9
 
10
10
  jobs:
11
- npm:
11
+ pnpm:
12
12
  runs-on: ubuntu-24.04
13
13
  outputs:
14
14
  node-modules-cache-key: ${{ steps.cache.outputs.cache-primary-key }}
@@ -16,15 +16,18 @@ jobs:
16
16
  - name: checkout
17
17
  uses: actions/checkout@v3
18
18
 
19
+ - name: setup pnpm
20
+ uses: pnpm/action-setup@v4
21
+
19
22
  - name: set node-version
20
23
  uses: actions/setup-node@v3
21
24
  with:
22
- node-version-file: '.nvmrc'
25
+ node-version-file: ".nvmrc"
23
26
 
24
27
  - name: node-modules deps hash
25
28
  id: deps-hash
26
29
  run: |
27
- PACKAGE_DEPS_HASH=$(jq '.packages' package-lock.json | jq 'del(."".version)' | md5sum | awk '{print $1}');
30
+ PACKAGE_DEPS_HASH=$(md5sum pnpm-lock.yaml | awk '{print $1}');
28
31
  echo "PACKAGE_DEPS_HASH=$PACKAGE_DEPS_HASH"
29
32
  echo "package-deps-hash=$PACKAGE_DEPS_HASH" >> "$GITHUB_OUTPUT"
30
33
  - name: node-modules cache get
@@ -32,11 +35,11 @@ jobs:
32
35
  id: cache
33
36
  with:
34
37
  path: ./node_modules
35
- key: ${{ runner.os }}-node-${{ steps.deps-hash.outputs.package-deps-hash }}
38
+ key: ${{ runner.os }}-pnpm-${{ steps.deps-hash.outputs.package-deps-hash }}
36
39
 
37
40
  - name: node-modules cache miss install
38
41
  if: steps.cache.outputs.cache-hit != 'true'
39
- run: npm ci --ignore-scripts --prefer-offline --no-audit
42
+ run: pnpm install --frozen-lockfile --ignore-scripts
40
43
 
41
44
  - name: node-modules cache set
42
45
  if: steps.cache.outputs.cache-hit != 'true'
@@ -67,14 +67,10 @@ jobs:
67
67
 
68
68
  - name: node-modules cache get
69
69
  uses: actions/cache/restore@v4
70
- id: cache
71
70
  with:
72
71
  path: ./node_modules
73
72
  key: ${{ needs.install.outputs.node-modules-cache-key }}
74
-
75
- - name: node-modules cache miss install
76
- if: steps.cache.outputs.cache-hit != 'true'
77
- run: npm ci --ignore-scripts --prefer-offline --no-audit
73
+ fail-on-cache-miss: true
78
74
 
79
75
  - name: deploy
80
76
  run: STAGE=${{ inputs.stage }} DEPLOYER_NAME=$GITHUB_ACTOR npm run deploy
@@ -107,14 +103,10 @@ jobs:
107
103
 
108
104
  - name: node-modules cache get
109
105
  uses: actions/cache/restore@v4
110
- id: cache
111
106
  with:
112
107
  path: ./node_modules
113
108
  key: ${{ needs.install.outputs.node-modules-cache-key }}
114
-
115
- - name: node-modules cache miss install
116
- if: steps.cache.outputs.cache-hit != 'true'
117
- run: npm ci --ignore-scripts --prefer-offline --no-audit
109
+ fail-on-cache-miss: true
118
110
 
119
111
  - name: vpc:tunnel:open
120
112
  if: inputs.needs-vpn-for-acceptance
@@ -160,14 +152,10 @@ jobs:
160
152
 
161
153
  - name: node-modules cache get
162
154
  uses: actions/cache/restore@v4
163
- id: cache
164
155
  with:
165
156
  path: ./node_modules
166
157
  key: ${{ needs.install.outputs.node-modules-cache-key }}
167
-
168
- - name: node-modules cache miss install
169
- if: steps.cache.outputs.cache-hit != 'true'
170
- run: npm ci --ignore-scripts --prefer-offline --no-audit
158
+ fail-on-cache-miss: true
171
159
 
172
160
  - name: prune
173
161
  run: STAGE=${{ inputs.stage }} DEPLOYER_NAME=$GITHUB_ACTOR npm run deploy:prune
@@ -48,14 +48,10 @@ jobs:
48
48
 
49
49
  - name: node-modules cache get
50
50
  uses: actions/cache/restore@v4
51
- id: cache
52
51
  with:
53
52
  path: ./node_modules
54
53
  key: ${{ needs.install.outputs.node-modules-cache-key }}
55
-
56
- - name: node-modules cache miss install
57
- if: steps.cache.outputs.cache-hit != 'true'
58
- run: npm ci --ignore-scripts --prefer-offline --no-audit
54
+ fail-on-cache-miss: true
59
55
 
60
56
  - name: configure aws credentials
61
57
  uses: aws-actions/configure-aws-credentials@v1
@@ -114,14 +110,10 @@ jobs:
114
110
 
115
111
  - name: node-modules cache get
116
112
  uses: actions/cache/restore@v4
117
- id: cache
118
113
  with:
119
114
  path: ./node_modules
120
115
  key: ${{ needs.install.outputs.node-modules-cache-key }}
121
-
122
- - name: node-modules cache miss install
123
- if: steps.cache.outputs.cache-hit != 'true'
124
- run: npm ci --ignore-scripts --prefer-offline --no-audit
116
+ fail-on-cache-miss: true
125
117
 
126
118
  - name: configure aws credentials
127
119
  uses: aws-actions/configure-aws-credentials@v1
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.EXISTS;
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # SKILL: use.npm.alias
4
+ #
5
+ # Installs shell aliases that redirect npm commands to pnpm for faster package management.
6
+ #
7
+ # What it does:
8
+ # 1. Creates an alias 'npm.slow' pointing to the original npm binary
9
+ # 2. Creates an alias 'npm' that redirects to pnpm
10
+ # 3. Persists aliases to ~/.bash_aliases (sourced by ~/.bashrc)
11
+ #
12
+ # When to use:
13
+ # - After setting up a new development environment
14
+ # - When you want npm commands to use pnpm transparently
15
+ #
16
+ # Usage:
17
+ # ./.agent/repo=.this/skills/use.npm.alias.sh
18
+ #
19
+ set -euo pipefail
20
+
21
+ BASH_ALIASES="${HOME}/.bash_aliases"
22
+
23
+ # ensure ~/.bash_aliases exists
24
+ touch "$BASH_ALIASES"
25
+
26
+ # findsert npm.slow (only add if not already defined)
27
+ if ! grep -q "^alias npm.slow=" "$BASH_ALIASES" 2>/dev/null; then
28
+ NPM_PATH=$(which npm)
29
+ echo "alias npm.slow=\"$NPM_PATH\"" >> "$BASH_ALIASES"
30
+ echo "Added: alias npm.slow=\"$NPM_PATH\""
31
+ fi
32
+
33
+ # upsert npm => pnpm
34
+ if grep -q "^alias npm=" "$BASH_ALIASES" 2>/dev/null; then
35
+ sed -i 's/^alias npm=.*/alias npm="pnpm"/' "$BASH_ALIASES"
36
+ else
37
+ echo 'alias npm="pnpm"' >> "$BASH_ALIASES"
38
+ fi
39
+ echo "Added: alias npm=\"pnpm\""
40
+
41
+ # report
42
+ echo ""
43
+ echo "Aliases installed to $BASH_ALIASES"
44
+ echo "Run 'source $BASH_ALIASES' or open a new terminal to activate."
@@ -0,0 +1,3 @@
1
+ {
2
+ "packageManager": "pnpm@10.24.0"
3
+ }
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.CONTAINS;
package/dist/useCases.yml CHANGED
@@ -17,6 +17,7 @@ use-cases:
17
17
  - prettier
18
18
  - tests
19
19
  - typescript
20
+ - pnpm
20
21
  npm-package:
21
22
  extends:
22
23
  - typescript-project
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "declapract-typescript-ehmpathy",
3
3
  "author": "ehmpathy",
4
4
  "description": "declapract best practices declarations for typescript",
5
- "version": "0.41.0",
5
+ "version": "0.42.0",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "repository": "ehmpathy/declapract-typescript-ehmpathy",