diff --git a/.commitlintrc.json b/.commitlintrc.json
index c30e5a97..3d8d64aa 100644
--- a/.commitlintrc.json
+++ b/.commitlintrc.json
@@ -1,3 +1,4 @@
{
- "extends": ["@commitlint/config-conventional"]
+ "extends": ["@commitlint/config-conventional"],
+ "helpUrl": "https://github.com/chapter-three/next-drupal/blob/main/CONTRIBUTING.md#commits"
}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000..1f6919b7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,65 @@
+# Useful docs:
+# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
+# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
+# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
+
+name: Bug Report
+description: File a bug report
+labels: ["bug", "triage"]
+body:
+ - type: dropdown
+ id: package
+ attributes:
+ label: Package containing the bug
+ description: What package in this monorepo has the bug?
+ options:
+ - Not package-specific
+ - Iβm not sure
+ - next (Drupal module)
+ - next-drupal (NPM package)
+ - basic-starter
+ - graphql-starter
+ - example-auth
+ - example-blog
+ - example-client
+ - example-custom-auth
+ - example-custom-cache
+ - example-custom-fetcher
+ - example-custom-serializer
+ - example-graphql
+ - example-marketing
+ - example-query
+ - example-search-api
+ - example-umami
+ - example-webform
+ default: 1
+ validations:
+ required: true
+ - type: textarea
+ id: description
+ attributes:
+ label: Describe the bug
+ value: |
+ A clear and concise description of what the bug is.
+
+ If applicable, add screenshots to help explain your problem.
+
+ ### Expected behavior
+
+ A clear and concise description of what you expected to happen.
+
+ ### Steps to reproduce:
+
+ 1. First '...'
+ 2. Then '....'
+ 3. π’
+
+ ### Additional context
+
+ Add any other context about the problem here.
+ validations:
+ required: true
+ - type: markdown
+ attributes:
+ value: |
+
Thanks for taking the time to fill out this bug report!
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 00000000..c46c0d8e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,54 @@
+name: Feature Request
+description: Suggest an idea for this project
+labels: ["enhancement", "triage"]
+body:
+ - type: dropdown
+ id: package
+ attributes:
+ label: Package
+ description: The feature request is for what package in this monorepo?
+ options:
+ - Not package-specific
+ - Iβm not sure
+ - next (Drupal module)
+ - next-drupal (NPM package)
+ - basic-starter
+ - graphql-starter
+ - example-auth
+ - example-blog
+ - example-client
+ - example-custom-auth
+ - example-custom-cache
+ - example-custom-fetcher
+ - example-custom-serializer
+ - example-graphql
+ - example-marketing
+ - example-query
+ - example-search-api
+ - example-umami
+ - example-webform
+ default: 1
+ validations:
+ required: true
+ - type: textarea
+ id: description
+ attributes:
+ label: Describe the feature request
+ value: |
+ A clear and concise description of what the request is. If your feature request is related to a problem, please describe it.
+
+ If applicable, add screenshots to help explain your issue.
+
+ ### Describe the solution you'd like
+
+ ### Describe alternatives you've considered
+
+ ### Additional context
+
+ Add any other context about the problem here.
+ validations:
+ required: true
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to fill out this feature request!
diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml
new file mode 100644
index 00000000..91634117
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.yml
@@ -0,0 +1,50 @@
+name: Question
+description: Ask a question or make a support request
+labels: ["question", "triage"]
+body:
+ - type: dropdown
+ id: package
+ attributes:
+ label: Package
+ description: The question is for what package in this monorepo?
+ options:
+ - Not package-specific
+ - Iβm not sure
+ - next (Drupal module)
+ - next-drupal (NPM package)
+ - basic-starter
+ - graphql-starter
+ - example-auth
+ - example-blog
+ - example-client
+ - example-custom-auth
+ - example-custom-cache
+ - example-custom-fetcher
+ - example-custom-serializer
+ - example-graphql
+ - example-marketing
+ - example-query
+ - example-search-api
+ - example-umami
+ - example-webform
+ default: 1
+ validations:
+ required: true
+ - type: textarea
+ id: description
+ attributes:
+ label: Ask the question
+ value: |
+ A clear and concise description of what the question is.
+
+ If applicable, add screenshots to help explain your issue.
+
+ ### Additional context
+
+ Add any other context about the question here.
+ validations:
+ required: true
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to fill out this request form!
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..944c2ce3
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,21 @@
+This pull request is for: (mark with an "x")
+- [ ] `examples/*`
+- [ ] `modules/next`
+- [ ] `packages/next-drupal`
+- [ ] `starters/basic-starter`
+- [ ] `starters/graphql-starter`
+- [ ] Other
+
+GitHub Issue: #
+_Please add a link to the GitHub issue
+where this problem is discussed._
+
+- [ ] I need help adding tests. (mark with an "x")
+ _Code changes need test coverage. If you don't know
+ how to make tests, check this box to ask for help._
+
+## Describe your changes
+
+A clear and concise description of what the request is.
+
+If applicable, add screenshots to help explain your issue.
diff --git a/.github/workflows/next-drupal-query.yml b/.github/workflows/next-drupal-query.yml
index 5ebe1ccd..0e5515c5 100644
--- a/.github/workflows/next-drupal-query.yml
+++ b/.github/workflows/next-drupal-query.yml
@@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Install modules
run: yarn
- name: Run tests
diff --git a/.github/workflows/next-drupal.yml b/.github/workflows/next-drupal.yml
index f34d98c0..477cd61e 100644
--- a/.github/workflows/next-drupal.yml
+++ b/.github/workflows/next-drupal.yml
@@ -7,7 +7,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml
index 2c9b871d..58ddae48 100644
--- a/.github/workflows/next.yml
+++ b/.github/workflows/next.yml
@@ -10,11 +10,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- php: ["8.0", "8.1"]
- drupal: ["9.3", "9.4", "10.0.0-rc1"]
+ # Supported PHP versions: https://www.drupal.org/docs/getting-started/system-requirements/php-requirements
+ php: ["8.0", "8.1", "8.2"]
+ # Supported Drupal versions: https://www.drupal.org/project/drupal
+ drupal: ["9.5", "10.0"]
exclude:
- - php: "8.0"
- drupal: "10.0.0-rc1"
+ - drupal: "9.5"
+ php: "8.2"
+ - drupal: "10.0"
+ php: "8.0"
name: Drupal ${{ matrix.drupal }} - PHP ${{ matrix.php }}
services:
mysql:
@@ -26,7 +30,7 @@ jobs:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
@@ -37,17 +41,17 @@ jobs:
id: composercache
run: |
cd modules/next
- echo "::set-output name=dir::$(composer config cache-files-dir)"
- - uses: actions/cache@v2
+ echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
+ - uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.drupal }}-composer-${{ hashFiles('**/composer.json') }}
- restore-keys: ${{ runner.os }}-composer-
+ restore-keys: ${{ runner.os }}-${{ matrix.drupal }}-composer-
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Setup Drupal
run: |
- COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }} ~/drupal --no-interaction --no-install
+ COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }}.x ~/drupal --no-interaction --no-install
cd ~/drupal
composer config extra.enable-patching true
composer config extra.compile-mode all
@@ -57,22 +61,20 @@ jobs:
composer config repositories.0 path $GITHUB_WORKSPACE
composer config repositories.1 composer https://packages.drupal.org/8
composer config allow-plugins true -n
- COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:${{ matrix.drupal }} --no-suggest --no-install
+ COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev --no-install
composer install
- name: Add phpspec/prophecy-phpunit
run: |
cd ~/drupal
COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpspec/prophecy-phpunit:^2 -W
if: ${{ startsWith(matrix.drupal, '9') }}
+ - name: Run phpcs
+ run: |
+ ~/drupal/vendor/bin/phpcs -p -s --colors --standard=modules/next/phpcs.xml modules/next
- name: Copy module
run: cp -R ../next-drupal/modules/next ~/drupal/web/modules/next
- name: Run php built-in server
run: php -S 127.0.0.1:8080 -t ~/drupal/web &
- - name: Run phpcs
- run: |
- cd ~/drupal/web
- cp modules/next/phpcs.xml.dist .
- ../vendor/bin/phpcs --standard=./phpcs.xml.dist modules/next -p -s -n --colors
- name: Run PHPUnit
run: |
cd ~/drupal/web
diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml
index 028ab194..bfbb213d 100644
--- a/.github/workflows/release-pr.yml
+++ b/.github/workflows/release-pr.yml
@@ -10,7 +10,7 @@ jobs:
environment: Preview
steps:
- name: Init
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
diff --git a/.husky/commit-msg b/.husky/commit-msg
index 4974c35b..c160a771 100755
--- a/.husky/commit-msg
+++ b/.husky/commit-msg
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
-npx commitlint --edit $1
+npx --no -- commitlint --edit ${1}
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 00000000..4fd02195
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+engine-strict=true
\ No newline at end of file
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 00000000..6f7f377b
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+v16
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 20d96f24..d413922e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Contributing
-Thanks for your interest in contributing to Next.js for Drupal. We're happy to have you here.
+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.
@@ -90,3 +90,104 @@ yarn phpcs
Please ensure that the tests are passing when submitting a pull request. If you're adding new features, please include tests.
+## Commits
+
+This project uses git commit messages that follow the [Conventional Commits format](https://www.conventionalcommits.org/en/v1.0.0/). 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.
+
+### Format of the commit message:
+
+```
+():
+
+
+
+