declapract-typescript-ehmpathy 0.46.11 → 0.46.13

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.
@@ -42,7 +42,7 @@ jobs:
42
42
  pull-request-title-pattern: "chore(release): v${version} 🎉"
43
43
  changelog-path: changelog.md
44
44
 
45
- - name: upvibe the pr, if pr
45
+ - name: upvibe the pr, on upsert
46
46
  if: ${{ steps.release.outputs.pr }}
47
47
  run: |
48
48
  PR="${{ fromJson(steps.release.outputs.pr).number }}"
@@ -58,3 +58,22 @@ jobs:
58
58
  gh pr edit "$PR" --body "$updated"
59
59
  env:
60
60
  GH_TOKEN: ${{ steps.github-token.outputs.token }}
61
+
62
+ - name: upvibe the pr, on release
63
+ if: ${{ steps.release.outputs.release_created }}
64
+ run: |
65
+ PR="${{ fromJson(steps.release.outputs.pr).number }}"
66
+ TAG="${{ steps.release.outputs.tag_name }}"
67
+ RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${TAG}"
68
+
69
+ # find the release-please comment with the robot emoji and edit it
70
+ COMMENT_ID=$(gh api "repos/${{ github.repository }}/issues/${PR}/comments" \
71
+ --jq '.[] | select(.body | startswith(":robot: Release is at")) | .id' | head -1)
72
+
73
+ if [ -n "$COMMENT_ID" ]; then
74
+ gh api "repos/${{ github.repository }}/issues/comments/${COMMENT_ID}" \
75
+ -X PATCH \
76
+ -f body="🌊 released at ${RELEASE_URL}"
77
+ fi
78
+ env:
79
+ GH_TOKEN: ${{ steps.github-token.outputs.token }}
@@ -58,4 +58,35 @@ jobs:
58
58
  run: npm run build
59
59
 
60
60
  - name: publish
61
+ id: publish
62
+ continue-on-error: true
61
63
  run: npm publish --access public --provenance
64
+
65
+ # if publish fails, check whether the intent was successful still, for behavioral idempotency (i.e., if the failure just reported that this is a retry, then its an idempotent success)
66
+ - name: idempotify
67
+ if: steps.publish.outcome == 'failure'
68
+ run: |
69
+ # get package info
70
+ PACKAGE_NAME=$(jq -r '.name' package.json)
71
+ PACKAGE_VERSION=$(jq -r '.version' package.json)
72
+
73
+ # check if version exists on npm
74
+ if ! npm view "$PACKAGE_NAME@$PACKAGE_VERSION" dist.shasum > /dev/null 2>&1; then
75
+ echo "::error::publish: this version failed to be published. see prior step for cause"
76
+ exit 1
77
+ fi
78
+
79
+ # get shasums: local (via dry-run) and published (via registry)
80
+ EXPECTED_SHASUM=$(npm pack --dry-run --json 2>/dev/null | jq -r '.[0].shasum')
81
+ DETECTED_SHASUM=$(npm view "$PACKAGE_NAME@$PACKAGE_VERSION" dist.shasum)
82
+ echo "EXPECTED_SHASUM=$EXPECTED_SHASUM"
83
+ echo "DETECTED_SHASUM=$DETECTED_SHASUM"
84
+
85
+ # compare shasums
86
+ if [ "$EXPECTED_SHASUM" = "$DETECTED_SHASUM" ]; then
87
+ echo "publish: idempotent success. detected version matches expected version. this was a succesful retry"
88
+ exit 0
89
+ else
90
+ echo "::error::publish: this version was already published with a different payload. overwrites are forbidden. EXPECTED_SHASUM=$EXPECTED_SHASUM, DETECTED_SHASUM=$DETECTED_SHASUM"
91
+ exit 1
92
+ fi
@@ -4,6 +4,6 @@
4
4
  "rhachet-roles-ehmpathy": "@declapract{check.minVersion('1.15.7')}"
5
5
  },
6
6
  "scripts": {
7
- "prepare:rhachet": "rhachet init --force && rhachet roles link --role mechanic && .agent/repo=ehmpathy/role=mechanic/skills/.skills/init.claude.sh"
7
+ "prepare:rhachet": "rhachet init && rhachet roles link --role mechanic && .agent/repo=ehmpathy/role=mechanic/skills/.skills/init.claude.sh"
8
8
  }
9
9
  }
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.46.11",
5
+ "version": "0.46.13",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "repository": "ehmpathy/declapract-typescript-ehmpathy",
@@ -43,7 +43,7 @@
43
43
  "preversion": "npm run prepush",
44
44
  "postversion": "git push origin HEAD --tags --no-verify",
45
45
  "prepare:husky": "husky install && chmod ug+x .husky/*",
46
- "prepare:rhachet": "rhachet init --force && rhachet roles link --role mechanic && .agent/repo=ehmpathy/role=mechanic/skills/.skills/init.claude.sh",
46
+ "prepare:rhachet": "rhachet init && rhachet roles link --role mechanic && .agent/repo=ehmpathy/role=mechanic/skills/.skills/init.claude.sh",
47
47
  "prepare": "if [ -e .git ] && [ -z $CI ]; then npm run prepare:husky && npm run prepare:rhachet; fi"
48
48
  },
49
49
  "dependencies": {