This package is primarily maintained by Prismic1. External contributions are welcome. Ask for help by opening an issue, or request a review by opening a pull request.
The following setup is required to work on this project:
- Node.js
- npm CLI
Tip
Please update this section with helpful notes for contributors.
- This package prioritizes the App Router. The top-level package (
@prismicio/next
) exports components and helpers designed for the App Router. - The Pages Router is supported through the
@prismicio/next/pages
entry. - Features should behave as closely as possible between the routers.
@prismicio/next
uses Playwright to test its APIs.- Using Playwright allows us to test the package's components and helpers against real Next.js apps.
- The package is tested against an App Router-based project and a Pages Router-based project.
Note
It's highly recommended to discuss your changes with the Prismic team before starting by opening an issue.2
A short discussion can accellerate your work and ship it faster.
# Clone and prepare the project.
git clone [email protected]:prismicio/prismic-next.git
cd prismic-next
npm install
# Create a new branch for your changes (e.g. lh/fix-win32-paths).
git checkout -b <your-initials>/<feature-or-fix-description>
# Start the development watcher.
# Run this command while you are working on your changes.
npm run dev
# Build the project for production.
# Run this command when you want to see the production version.
npm run build
# Lint your changes before requesting a review. No errors are allowed.
npm run lint
# Some errors can be fixed automatically:
npm run lint -- --fix
# Format your changes before requesting a review. No errors are allowed.
npm run format
# Create a .env.test.local file and provide a Prismic username and password.
# They will be used to run E2E tests.
# The file will not be committed.
cp .env.test.example .env.test.local
# Test your changes before requesting a review.
# All changes should be tested. No failing tests are allowed.
npm run test
# Run only E2E tests (optionally in UI mode):
npm run e2e
npm run e2e:ui
# Run only type tests
npm run types
Note
Code will be reviewed by the Prismic team before merging.3
Request a review by opening a pull request.
# Open a pull request. This example uses the GitHub CLI.
gh pr create
# Someone from the Prismic team will review your work. This review will at
# least consider the PR's general direction, code style, and test coverage.
# When ready, PRs should be merged using the "Squash and merge" option.
Caution
Publishing is restricted to the Prismic team.4
# Checkout the main branch and pull the latest changes.
git checkout main
git pull
# Perform a dry-run and verify the output.
# If it looks good, release a new version.
npm run release:dry
npm run release
# Or release an alpha.
# Perform a dry-run and verify the output.
# If it looks good, release a new alpha version.
npm run release:alpha:dry
npm run release:alpha
Footnotes
-
This package is maintained by the DevX team. Prismic employees can ask for help or a review in the #team-devx Slack channel. ↩
-
Prismic employees are highly encouraged to discuss changes with the DevX team in the #team-devx Slack channel before starting. ↩
-
Code should be reviewed by the DevX team before merging. Prismic employees can request a review in the #team-devx Slack channel. ↩
-
Prismic employees can ask the DevX team for npm publish access. ↩