Skip to content

Commit a0bdcb9

Browse files
fix: update dependencies
- Replace Prettier with oxfmt for formatting - Update Node engine requirement from >=14.15.0 to >=20 - Update tsconfig: moduleResolution "bundler", enable declaration/declarationMap - Update oxlintrc: add $schema, remove padding-line-between-statements - Consolidate 4 publish workflows into single publish.yml - Add MODE: production env to validate build job - Clean up .gitignore (add *.tgz, remove stale entries) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0b1f818 commit a0bdcb9

53 files changed

Lines changed: 1679 additions & 2899 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/prerelease-canary.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/prerelease-pr-cleanup.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/prerelease-pr.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
types: [opened, synchronize, reopened, closed]
8+
9+
jobs:
10+
release:
11+
if: github.event_name == 'push' && github.repository_owner == 'prismicio'
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
issues: write
16+
pull-requests: write
17+
id-token: write
18+
env:
19+
MODE: production
20+
outputs:
21+
release_created: ${{ steps.release.outputs.release_created }}
22+
steps:
23+
- uses: googleapis/release-please-action@v4
24+
id: release
25+
continue-on-error: true
26+
with:
27+
release-type: node
28+
- uses: actions/checkout@v6
29+
if: steps.release.outputs.release_created == 'true'
30+
- uses: actions/setup-node@v6
31+
if: steps.release.outputs.release_created == 'true'
32+
with:
33+
node-version: 24
34+
registry-url: "https://registry.npmjs.org"
35+
- if: steps.release.outputs.release_created == 'true'
36+
run: npm ci
37+
- name: "Publish release"
38+
if: steps.release.outputs.release_created == 'true'
39+
run: npm publish --provenance
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
43+
prerelease:
44+
if: "!cancelled() && github.repository_owner == 'prismicio'"
45+
needs: [release]
46+
runs-on: ubuntu-latest
47+
permissions:
48+
contents: read
49+
id-token: write
50+
env:
51+
MODE: production
52+
steps:
53+
- uses: actions/checkout@v6
54+
- uses: actions/setup-node@v6
55+
with:
56+
node-version: 24
57+
registry-url: "https://registry.npmjs.org"
58+
59+
# Canary
60+
- name: "Deprecate previous canary"
61+
if: github.event_name == 'push' && needs.release.outputs.release_created != 'true'
62+
continue-on-error: true
63+
run: |
64+
PACKAGE_NAME=$(jq -r ".name" package.json)
65+
PREVIOUS_VERSION=$(npm view "$PACKAGE_NAME" dist-tags.canary 2>/dev/null || true)
66+
if [ -n "$PREVIOUS_VERSION" ]; then
67+
npm deprecate "$PACKAGE_NAME@$PREVIOUS_VERSION" "Replaced by newer canary version"
68+
fi
69+
env:
70+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
71+
72+
- name: "Publish canary"
73+
if: github.event_name == 'push' && needs.release.outputs.release_created != 'true'
74+
run: |
75+
SHORT_SHA=$(git rev-parse --short HEAD)
76+
CURRENT_VERSION=$(jq -r '.version' package.json)
77+
npm ci
78+
npm version "${CURRENT_VERSION}-canary.${SHORT_SHA}" --no-git-tag-version
79+
npm publish --provenance --tag canary
80+
env:
81+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
82+
83+
# Pull request
84+
- name: "Deprecate previous PR prerelease"
85+
if: github.event_name == 'pull_request' && github.event.action != 'closed'
86+
continue-on-error: true
87+
run: |
88+
PACKAGE_NAME=$(jq -r ".name" package.json)
89+
TAG="pr-${{ github.event.number }}"
90+
PREVIOUS_VERSION=$(npm view "$PACKAGE_NAME" dist-tags."$TAG" 2>/dev/null || true)
91+
if [ -n "$PREVIOUS_VERSION" ]; then
92+
npm deprecate "$PACKAGE_NAME@$PREVIOUS_VERSION" "Replaced by newer prerelease version"
93+
fi
94+
env:
95+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
96+
97+
- name: "Publish PR prerelease"
98+
if: github.event_name == 'pull_request' && github.event.action != 'closed'
99+
run: |
100+
SHORT_SHA=$(git rev-parse --short HEAD)
101+
CURRENT_VERSION=$(jq -r '.version' package.json)
102+
npm ci
103+
npm version "${CURRENT_VERSION}-pr.${{ github.event.number }}.${SHORT_SHA}" --no-git-tag-version
104+
npm publish --provenance --tag pr-${{ github.event.number }}
105+
env:
106+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
107+
108+
- name: "Clean up PR prerelease"
109+
if: github.event_name == 'pull_request' && github.event.action == 'closed'
110+
continue-on-error: true
111+
run: |
112+
PACKAGE_NAME=$(jq -r ".name" package.json)
113+
TAG="pr-${{ github.event.number }}"
114+
VERSION=$(npm view "$PACKAGE_NAME" dist-tags."$TAG" 2>/dev/null || echo "")
115+
if [ -n "$VERSION" ]; then
116+
npm deprecate "$PACKAGE_NAME@$VERSION" "PR ${{ github.event.number }} was closed"
117+
npm dist-tag rm "$PACKAGE_NAME" "$TAG"
118+
fi
119+
env:
120+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616

1717
build:
1818
runs-on: ubuntu-latest
19+
env:
20+
MODE: production
1921
steps:
2022
- uses: actions/checkout@v6
2123
- uses: actions/setup-node@v6

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# custom
2+
*.tgz
23
dist
34
examples/**/package-lock.json
4-
playground/**/package-lock.json
5-
.next
6-
out
7-
next-env.d.ts
85

96
# os
107
.DS_Store

.oxfmtrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"semi": false,
4+
"sortImports": true,
5+
"jsdoc": true
6+
}

.oxlintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
23
"plugins": ["unicorn", "typescript", "oxc", "jsdoc"],
34
"rules": {
45
"no-console": ["warn", { "allow": ["debug", "info", "warn", "error"] }],
56
"no-debugger": "warn",
67
"prefer-const": "error",
7-
"padding-line-between-statements": [
8-
"error",
9-
{ "blankLine": "always", "prev": "*", "next": "return" }
10-
],
118
"no-unused-vars": [
129
"error",
1310
{

.prettierignore

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)