Skip to content

Commit 979d500

Browse files
committed
Merge branch 'mk/canary-demo' into mk/edge-router
2 parents 2ec1d3c + 7abc8b8 commit 979d500

File tree

972 files changed

+38064
-20116
lines changed

Some content is hidden

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

972 files changed

+38064
-20116
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ demos
66
packages/runtime/src/templates/edge
77
packages/runtime/src/templates/edge-shared
88
packages/runtime/lib
9-
packages/runtime/dist-types
9+
packages/runtime/dist-types
10+
jestSetup.js

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = {
2929
'unicorn/filename-case': 0,
3030
'unicorn/no-array-push-push': 0,
3131
'unicorn/numeric-separators-style': 0,
32+
'max-lines': 0,
3233
},
3334
parserOptions: {
3435
sourceType: 'module',
@@ -46,6 +47,7 @@ module.exports = {
4647
// TODO: re-enable after dropping support for Node 12
4748
'n/no-unsupported-features/es-syntax': 'off',
4849
'@typescript-eslint/no-extra-semi': 'off',
50+
'n/no-missing-import': 'off',
4951
},
5052
},
5153
{

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--Please tag yourself as the Assignee and netlify/frameworks as the Reviewer -->
1+
<!-- Before opening a pull request, ensure you've read our contributing guildines, https://github.com/netlify/next-runtime/blob/main/CONTRIBUTING.md. -->
22

33
### Summary
44

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
name: Run e2e (canary demo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main
88
paths:
9-
- 'test/e2e/canary/**/*.{js,jsx,ts,tsx}'
10-
- 'demos/canary/**/*'
11-
- 'packages/**/*.{ts,js}'
9+
- 'demos/canary/**/*.{js,jsx,ts,tsx}'
10+
- 'cypress/integration/canary/**/*.{ts,js}'
11+
- 'src/**/*.{ts,js}'
1212
jobs:
13-
vitest:
14-
name: Vitest
13+
cypress:
14+
name: Cypress
1515
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
containers: [1, 2, 3, 4]
1620
steps:
1721
- name: Checkout
1822
uses: actions/checkout@v2
@@ -31,31 +35,39 @@ jobs:
3135
token: ${{ steps.get-token.outputs.token }}
3236
path: ./.github/actions/wait-for-netlify-deploy
3337

34-
- name: Node
35-
uses: actions/setup-node@v2
36-
with:
37-
node-version: 16
38-
cache: 'npm'
39-
40-
- name: Install npm dependencies
41-
run: npm install
42-
43-
- name: Install Playwright dependencies
44-
run: npm run playwright:install
45-
4638
- name: Wait for Netlify Deploy
4739
id: deploy
4840
uses: ./.github/actions/wait-for-netlify-deploy
4941
with:
50-
site-name: next-plugin-canary
42+
site-name: netlify-plugin-nextjs-demo
5143
timeout: 300
5244

5345
- name: Deploy successful
5446
if: ${{ steps.deploy.outputs.origin-url }}
5547
run: echo ${{ steps.deploy.outputs.origin-url }}
5648

57-
- name: Run e2e tests
49+
- name: Node
50+
uses: actions/setup-node@v2
51+
with:
52+
node-version: '16'
53+
54+
- run: npm install
55+
56+
- name: Cypress run
5857
if: ${{ steps.deploy.outputs.origin-url }}
59-
run: npm run test:e2e -- test/e2e/canary
58+
id: cypress
59+
uses: cypress-io/github-action@v2
60+
with:
61+
browser: chrome
62+
headless: true
63+
record: true
64+
parallel: true
65+
config-file: cypress/config/canary.json
66+
group: 'Next Runtime - Demo Canary'
67+
spec: cypress/integration/canary/*
6068
env:
61-
SITE_URL: ${{ steps.deploy.outputs.origin-url }}
69+
DEBUG: '@cypress/github-action'
70+
CYPRESS_baseUrl: ${{ steps.deploy.outputs.origin-url }}
71+
CYPRESS_NETLIFY_CONTEXT: ${{ steps.deploy.outputs.context }}
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
CYPRESS_RECORD_KEY: ${{ secrets.CANARY_CYPRESS_RECORD_KEY }}

.github/workflows/cypress-demo-nx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (Nx monorepo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/cypress-demo-static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (static root)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/cypress-demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (default demo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/cypress-middleware.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Run e2e (middleware demo)
22
on:
33
pull_request:
4-
types: [opened, labeled, unlabeled, synchronize]
4+
types: [opened, synchronize]
55
push:
66
branches:
77
- main

.github/workflows/e2e-appdir.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Next.js appdir test suite
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
setup:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
test-files: ${{ steps['set-test-files'].outputs['test-files'] }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
- run: npm install
17+
- id: set-test-files
18+
name: Get test files
19+
# Extracts the list of all test files as JSON and trims to be relative to the test dir to be easier to read
20+
run:
21+
echo "test-files=$(npx jest -c test/e2e/jest.config.appdir.js --listTests --json | jq -cM 'map(.[env.PWD |
22+
length + 10:])')" >> $GITHUB_OUTPUT
23+
# echo "test-files=$(npx jest -c test/e2e/jest.config.all.js --listTests --json | jq -cM 'map(.[env.PWD | length
24+
# + 10:])')" >> $GITHUB_OUTPUT
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
name: test (${{ matrix.test-file }})
29+
needs:
30+
- setup
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
# Creates a job for each chunk ID. This will be assigned one or more test files to run
35+
test-file: ${{ fromJson(needs.setup.outputs['test-files']) }}
36+
steps:
37+
- uses: actions/checkout@v3
38+
- run: npm install
39+
- name: Run tests
40+
run: npx jest --reporters=jest-junit --reporters=default -c test/e2e/jest.config.all.js ${{ matrix.test-file }}
41+
env:
42+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
43+
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
44+
NEXT_TEST_VERSION: canary
45+
- uses: actions/upload-artifact@v3
46+
if: ${{ always() }}
47+
name: Upload test results
48+
with:
49+
name: test-results
50+
path: reports/jest-*.xml
51+
report:
52+
name: Report appDir e2e test results
53+
runs-on: ubuntu-latest
54+
if: ${{ always() }}
55+
needs:
56+
- test
57+
steps:
58+
- uses: actions/checkout@v3
59+
- uses: actions/download-artifact@v3
60+
with:
61+
path: reports
62+
- name: Combine reports
63+
# The test reporter can handle multiple files, but these have random filenames so the output is better when combined
64+
run: npx junit-report-merger test-results.xml reports/**/*.xml
65+
- uses: phoenix-actions/test-reporting@v10
66+
with:
67+
name: Jest Tests
68+
output-to: 'step-summary'
69+
path: 'test-results.xml'
70+
max-annotations: 49
71+
reporter: jest-junit

.github/workflows/e2e-next.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Next.js e2e test suite
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
setup:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
test-files: ${{ steps['set-test-files'].outputs['test-files'] }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
- run: npm install
17+
- id: set-test-files
18+
name: Get test files
19+
# Extracts the list of all test files as JSON and trims to be relative to the test dir to be easier to read
20+
run:
21+
echo "test-files=$(npx jest -c test/e2e/jest.config.js --listTests --json | jq -cM 'map(.[env.PWD | length +
22+
10:])')" >> $GITHUB_OUTPUT
23+
# echo "test-files=$(npx jest -c test/e2e/jest.config.all.js --listTests --json | jq -cM 'map(.[env.PWD | length
24+
# + 10:])')" >> $GITHUB_OUTPUT
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
name: test (${{ matrix.test-file }})
29+
needs:
30+
- setup
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
# Creates a job for each chunk ID. This will be assigned one or more test files to run
35+
test-file: ${{ fromJson(needs.setup.outputs['test-files']) }}
36+
steps:
37+
- uses: actions/checkout@v3
38+
- run: npm install
39+
- name: Run tests
40+
run: npx jest --reporters=jest-junit --reporters=default -c test/e2e/jest.config.all.js ${{ matrix.test-file }}
41+
env:
42+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
43+
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
44+
# RUN_SKIPPED_TESTS: true
45+
46+
- uses: actions/upload-artifact@v3
47+
# upload test results
48+
if: ${{ always() }}
49+
name: Upload test results
50+
with:
51+
name: test-results
52+
path: reports/jest-*.xml
53+
report:
54+
name: Report Next.js e2e test results
55+
runs-on: ubuntu-latest
56+
if: ${{ always() }}
57+
needs:
58+
- test
59+
steps:
60+
- uses: actions/checkout@v3
61+
- uses: actions/download-artifact@v3
62+
with:
63+
path: reports
64+
- name: Combine reports
65+
# The test reporter can handle multiple files, but these have random filenames so the output is better when combined
66+
run: npx junit-report-merger test-results.xml reports/**/*.xml
67+
- uses: phoenix-actions/test-reporting@v10
68+
with:
69+
name: Jest Tests
70+
output-to: 'step-summary'
71+
path: 'test-results.xml'
72+
max-annotations: 49
73+
reporter: jest-junit

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest, macOS-latest, windows-latest]
18-
node-version: [12, '*']
18+
node-version: [14, '*']
1919
exclude:
2020
- os: macOS-latest
21-
node-version: 12
21+
node-version: 14
2222
- os: windows-latest
23-
node-version: 12
23+
node-version: 14
2424
fail-fast: false
2525

2626
steps:
@@ -50,12 +50,12 @@ jobs:
5050
strategy:
5151
matrix:
5252
os: [ubuntu-latest, macOS-latest, windows-latest]
53-
node-version: [12, '*']
53+
node-version: [14, '*']
5454
exclude:
5555
- os: macOS-latest
56-
node-version: 12
56+
node-version: 14
5757
- os: windows-latest
58-
node-version: 12
58+
node-version: 14
5959
fail-fast: false
6060

6161
if: github.ref_name == 'main'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,6 @@ packages/*/lib
150150

151151
# Cypress
152152
cypress/screenshots
153+
154+
# Test cases have node module fixtures
155+
!test/**/node_modules

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/runtime": "4.24.3",
3-
"packages/next": "1.3.1"
2+
"packages/runtime": "4.29.3",
3+
"packages/next": "1.4.2"
44
}

.vscode/feat-test.code-snippets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"\treturn (",
1717
"\t\t<div>",
1818
"\t\t<h1>$1</h1>",
19-
"\t\t<Link href=\"\"><a>Read Docs</a></Link>",
19+
"\t\t<Link href=\"\">Read Docs</Link>",
2020
"\t\t<p>Description of feature</p>",
2121
"\t\t<p>Example/test of feature</p>",
2222
"\t\t</div>",

CONTRIBUTING.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
🎉 Thanks for considering contributing to this project! 🎉
44

5-
These guidelines will help you send a pull request.
5+
When contributing to this repository, please first discuss the change you wish to make via an
6+
[issue](https://github.com/netlify/next-runtime/issues/new/choose). Please use the issue templates. They are there to
7+
help you and to help the maintainers gather information.
68

7-
If you're submitting an issue instead, please skip this document.
9+
Before working on an issue, ask to be assigned to it. This makes it clear to other potential contributors that someone
10+
is working on the issue.
811

9-
If your pull request is related to a typo or the documentation being unclear, please click on the relevant page's `Edit`
10-
button (pencil icon) and directly suggest a correction instead.
12+
When creating a PR, please use the template. The information in the template helps maintainers review your pull request.```
1113

1214
This project was made with ❤️. The simplest way to give back is by starring and sharing it online.
1315

@@ -37,9 +39,9 @@ We use [Conventional Commit messages](https://www.conventionalcommits.org/) to a
3739

3840
Most common commit message prefixes are:
3941

40-
* `fix:` which represents bug fixes, and generate a patch release.
41-
* `feat:` which represents a new feature, and generate a minor release.
42-
* `feat!:`, `fix!:` or `refactor!:` and generate a major release.
42+
- `fix:` which represents bug fixes, and generate a patch release.
43+
- `feat:` which represents a new feature, and generate a minor release.
44+
- `feat!:`, `fix!:` or `refactor!:` and generate a major release.
4345

4446
## Releasing
4547

0 commit comments

Comments
 (0)