Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: 🚨 Bug report
name: "\U0001F6A8 Bug report"
about: Report a bug report to help improve the package.
title: ""
labels: "bug"
Expand All @@ -16,13 +16,13 @@ assignees: ""

### Versions

- `@prismicio/next`: <!-- ex: v0.1.0 -->
- `next`: <!-- ex: v12.1.0 -->
- node: <!-- ex: v12.14.0 -->
- @prismicio/next: <!-- ex: v0.1.0 -->
- next: <!-- ex: v14.0.0 -->
- node: <!-- ex: v14.15.0 -->

### Reproduction

<!-- If possible link to a minimal test case, without a reproduction, it is so hard to address problems :( -->
<!-- If possible link to a minimal test case. Without a reproduction, it is very difficult to address problems. :( -->

<details open>
<summary>Additional Details</summary>
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/prerelease-canary.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/prerelease-pr-cleanup.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/prerelease-pr.yml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: publish

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, closed]

jobs:
release:
if: github.event_name == 'push' && github.repository_owner == 'prismicio'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
env:
MODE: production
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
continue-on-error: true
with:
release-type: node
- uses: actions/checkout@v6
if: steps.release.outputs.release_created == 'true'
- uses: actions/setup-node@v6
if: steps.release.outputs.release_created == 'true'
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
- if: steps.release.outputs.release_created == 'true'
run: npm ci
- name: "Publish release"
if: steps.release.outputs.release_created == 'true'
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

prerelease:
if: "!cancelled() && github.repository_owner == 'prismicio'"
needs: [release]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
env:
MODE: production
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: "https://registry.npmjs.org"

# Canary
- name: "Deprecate previous canary"
if: github.event_name == 'push' && needs.release.outputs.release_created != 'true'
continue-on-error: true
run: |
PACKAGE_NAME=$(jq -r ".name" package.json)
PREVIOUS_VERSION=$(npm view "$PACKAGE_NAME" dist-tags.canary 2>/dev/null || true)
if [ -n "$PREVIOUS_VERSION" ]; then
npm deprecate "$PACKAGE_NAME@$PREVIOUS_VERSION" "Replaced by newer canary version"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: "Publish canary"
if: github.event_name == 'push' && needs.release.outputs.release_created != 'true'
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
CURRENT_VERSION=$(jq -r '.version' package.json)
npm ci
npm version "${CURRENT_VERSION}-canary.${SHORT_SHA}" --no-git-tag-version
npm publish --provenance --tag canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Pull request
- name: "Deprecate previous PR prerelease"
if: github.event_name == 'pull_request' && github.event.action != 'closed'
continue-on-error: true
run: |
PACKAGE_NAME=$(jq -r ".name" package.json)
TAG="pr-${{ github.event.number }}"
PREVIOUS_VERSION=$(npm view "$PACKAGE_NAME" dist-tags."$TAG" 2>/dev/null || true)
if [ -n "$PREVIOUS_VERSION" ]; then
npm deprecate "$PACKAGE_NAME@$PREVIOUS_VERSION" "Replaced by newer prerelease version"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: "Publish PR prerelease"
if: github.event_name == 'pull_request' && github.event.action != 'closed'
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
CURRENT_VERSION=$(jq -r '.version' package.json)
npm ci
npm version "${CURRENT_VERSION}-pr.${{ github.event.number }}.${SHORT_SHA}" --no-git-tag-version
npm publish --provenance --tag pr-${{ github.event.number }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: "Clean up PR prerelease"
if: github.event_name == 'pull_request' && github.event.action == 'closed'
continue-on-error: true
run: |
PACKAGE_NAME=$(jq -r ".name" package.json)
TAG="pr-${{ github.event.number }}"
VERSION=$(npm view "$PACKAGE_NAME" dist-tags."$TAG" 2>/dev/null || echo "")
if [ -n "$VERSION" ]; then
npm deprecate "$PACKAGE_NAME@$VERSION" "PR ${{ github.event.number }} was closed"
npm dist-tag rm "$PACKAGE_NAME" "$TAG"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34 changes: 0 additions & 34 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

build:
runs-on: ubuntu-latest
env:
MODE: production
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
Expand Down
6 changes: 6 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"semi": false,
"sortImports": true,
"jsdoc": true
}
2 changes: 2 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["unicorn", "typescript", "oxc", "jsdoc", "react"],
"rules": {
"no-console": ["warn", { "allow": ["info", "warn", "error"] }],
"no-debugger": "warn",
"prefer-const": "error",
"no-unused-vars": [
"error",
{
Expand Down
46 changes: 0 additions & 46 deletions .prettierignore

This file was deleted.

21 changes: 0 additions & 21 deletions .prettierrc

This file was deleted.

Loading
Loading