declapract-typescript-ehmpathy 0.43.12 → 0.43.16
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.
- package/dist/practices/cicd-package/best-practice/.github/workflows/.publish-npm.yml +28 -7
- package/dist/practices/cicd-package/best-practice/.github/workflows/publish.yml +0 -2
- package/dist/practices/domain/best-practice/package.json +1 -1
- package/dist/practices/lint/best-practice/biome.json +3 -2
- package/dist/practices/lint/best-practice/package.json +5 -5
- package/dist/practices/node/best-practice/.nvmrc +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,9 @@ name: .publish-npm
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
workflow_call:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
description: required credentials to authenticate with the aws account under which to publish
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
id-token: write # required for oidc
|
|
9
8
|
|
|
10
9
|
jobs:
|
|
11
10
|
install:
|
|
@@ -31,10 +30,32 @@ jobs:
|
|
|
31
30
|
path: ./node_modules
|
|
32
31
|
key: ${{ needs.install.outputs.node-modules-cache-key }}
|
|
33
32
|
|
|
33
|
+
- name: verify oidc auth
|
|
34
|
+
run: |
|
|
35
|
+
OIDC_TOKEN=$(curl -sS -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=npm:registry.npmjs.org" | jq -r '.value')
|
|
36
|
+
PACKAGE_NAME_PLAIN=$(jq -r '.name' package.json)
|
|
37
|
+
PACKAGE_NAME_ENCODED=$(printf '%s' "$PACKAGE_NAME_PLAIN" | jq -sRr @uri)
|
|
38
|
+
HTTP_CODE=$(curl -sS -o /dev/null -w '%{http_code}' -X POST -H "Authorization: Bearer $OIDC_TOKEN" "https://registry.npmjs.org/-/npm/v1/oidc/token/exchange/package/$PACKAGE_NAME_ENCODED")
|
|
39
|
+
if [[ "$HTTP_CODE" =~ ^2 ]]; then
|
|
40
|
+
echo "oidc: configured for $PACKAGE_NAME_PLAIN"
|
|
41
|
+
else
|
|
42
|
+
echo "::error::oidc: not configured for $PACKAGE_NAME_PLAIN (http $HTTP_CODE). add oidc by-hand at https://www.npmjs.com/package/$PACKAGE_NAME_ENCODED/access"
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
- name: verify oidc compat
|
|
47
|
+
run: |
|
|
48
|
+
NPM_VERSION=$(npm --version)
|
|
49
|
+
MIN_VERSION="11.5.1"
|
|
50
|
+
if [ "$(printf '%s\n' "$MIN_VERSION" "$NPM_VERSION" | sort -V | head -n1)" != "$MIN_VERSION" ]; then
|
|
51
|
+
echo "npm $NPM_VERSION < $MIN_VERSION, will upgrade npm now to support oidc..."
|
|
52
|
+
npm install -g npm@latest
|
|
53
|
+
else
|
|
54
|
+
echo "npm $NPM_VERSION >= $MIN_VERSION, ready to use!"
|
|
55
|
+
fi
|
|
56
|
+
|
|
34
57
|
- name: build
|
|
35
58
|
run: npm run build
|
|
36
59
|
|
|
37
60
|
- name: publish
|
|
38
|
-
run: npm publish --access public
|
|
39
|
-
env:
|
|
40
|
-
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token }}
|
|
61
|
+
run: npm publish --access public --provenance
|
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
"files": {
|
|
9
9
|
"includes": [
|
|
10
10
|
"**/src/**/*.ts",
|
|
11
|
+
"**/provision/**/*.ts",
|
|
11
12
|
"!**/dist",
|
|
12
13
|
"!**/coverage",
|
|
13
14
|
"!**/node_modules",
|
|
14
15
|
"!**/.artifact",
|
|
15
|
-
"!**/.generated
|
|
16
|
-
"!**/.test
|
|
16
|
+
"!**/.generated",
|
|
17
|
+
"!**/.test*"
|
|
17
18
|
]
|
|
18
19
|
},
|
|
19
20
|
"formatter": {
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
"@biomejs/biome": "2.3.8"
|
|
5
5
|
},
|
|
6
6
|
"scripts": {
|
|
7
|
-
"fix:format:biome": "biome check --write
|
|
8
|
-
"fix:lint": "biome check --write
|
|
9
|
-
"test:format:biome": "biome format
|
|
10
|
-
"test:lint:biome": "biome check
|
|
11
|
-
"test:lint:biome:all": "biome check
|
|
7
|
+
"fix:format:biome": "biome check --write",
|
|
8
|
+
"fix:lint": "biome check --write",
|
|
9
|
+
"test:format:biome": "biome format",
|
|
10
|
+
"test:lint:biome": "biome check --diagnostic-level=error",
|
|
11
|
+
"test:lint:biome:all": "biome check",
|
|
12
12
|
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
13
13
|
"test:lint": "npm run test:lint:biome && npm run test:lint:deps"
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v22.21.0
|
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.43.
|
|
5
|
+
"version": "0.43.16",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|