Thanks for your interest in contributing to Next.js for Drupal. We're happy to have you here.
Please take a moment to review this document before submitting your first pull request.
If you need any help, feel free to reach out on Drupal Slack. Look for us in the #nextjs channel.
This repository is a monorepo. This is where we develop all modules, packages and starters.
- We use Yarn and
yarn workspacesfor development. - We use Turborepo as our build system.
- We use Lerna for versioning and publishing.
git clone [email protected]:chapter-three/next-drupal.git
yarn install
You can use the yarn workspace [WORKSPACE] command to start the development process for a workspace.
- To run the
next-drupal.orgwebsite:
yarn workspace www dev
- To run the
next-drupalpackage:
yarn workspace next-drupal dev
You can run all the tests from the root of the repository.
Due to the current CI/CD setup it is not possible to run the tests locally. A running Drupal instance with a secret configuration is required to run the tests.
To add the required env vars to Jest run:
cp packages/next-drupal/.env.example packages/next-drupal/.env
We use jest for testing the next-drupal package.
yarn test packages/next-drupal
We use phpunit for testing the next module.
yarn test:next
yarn lint
yarn phpcs
Please ensure that the tests are passing when submitting a pull request. If you're adding new features, please include tests.
This project uses git commit messages that follow the Conventional Commits format. A minor change to your commit message style can:
- make you a better programmer
- helps to automate the CHANGELOG generated for other developers
Don’t worry. You can still submit a Pull Request and if you don’t properly use semantic commit messages, we will edit the commits to add them. But we like them, so you might too.
<type>(<scope>)<!>: <subject>
<body>
<footer>
feat(next-drupual): add support for Next.js 13 and React 18
Next-drupal now requires Next.js 12 or 13 and React 17 or 18.
BREAKING CHANGE:
Dropped support for Next.js 11 and React 16.
Fixes #371
The first line includes a brief description of the change in the <subject> after the semicolon. The type and scope should always be lowercase as shown below.
- ✨
featA new feature - 🐛
fixA bug fix - 📚
docsDocumentation only changes - 💎
styleCode formatting changes (like missing semicolons, etc.) that do not affect the meaning of the code - 📦
refactorA code change that neither fixes a bug nor adds a feature - 🚀
perfA code change that improves performance - 🚨
testAdding missing tests or correcting existing tests - 🛠
buildChanges that affect the build system or external dependencies (example scopes: lerna, yarn) - ⚙️
ciChanges to our CI configuration files and scripts - ♻️
choreOther changes that don't modify src or test files - 🗑
revertReverts a previous commit
To include the change in a specific package of this monorepo, the scope should be the name of the folder inside:
/packages/*/modules/*/examples/*
For example:
next-drupalFor changes in/packages/next-drupalnextFor changes in/modules/nextbasic-starterFor changes in/starters/basic-starterexample-authFor changes in/examples/example-auth
The <scope> can be empty (e.g. if the change is a global or difficult to assign to a single component), in which case the parentheses are omitted and the first line just becomes: <type>: <subject>
The <!> is optional. It should be used for a BREAKING CHANGE. For example, fix(widgets)!: Fix incompatibility with widget v2 indicates the bugfix required a breaking change. Note that the "BREAKING CHANGE:" FOOTER is REQUIRED (see below).
The <body> is optional. Just as in the <subject>, use the imperative, present tense: "change" not "changed" nor "changes". Message body should include motivation for the change and contrasts with previous behavior.
The commit message footer can have multiple paragraphs in it.
Closed issues should be listed on a separate line in the footer prefixed with "Fixes" keyword like this:
Fixes #234
or in the case of multiple issues:
Fixes #123, #245, #992
All breaking changes have to be mentioned in footer with the description of the change, justification and migration notes.
BREAKING CHANGE:
Dropped support for Next.js 11 and React 16. Users
requiring these older versions should stick to v1.6.