Skip to content

Commit ab97d6e

Browse files
authored
Merge branch 'main' into rs/transform-named-capture-groups
2 parents 72be87d + 49756be commit ab97d6e

File tree

51 files changed

+1065
-1123
lines changed

Some content is hidden

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

51 files changed

+1065
-1123
lines changed

.github/workflows/test-deno.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Deno tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Git Checkout Deno Module
15+
uses: actions/checkout@v2
16+
- name: Use Deno Version ${{ matrix.deno-version }}
17+
uses: denolib/setup-deno@v2
18+
with:
19+
deno-version: vx.x.x
20+
- name: Test Deno
21+
run: deno test packages/runtime/src/templates/edge-shared/

.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.29.3",
3-
"packages/next": "1.4.2"
2+
"packages/runtime": "4.29.4",
3+
"packages/next": "1.4.3"
44
}

cypress/integration/middleware/enhanced.spec.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
describe('Enhanced middleware', () => {
2-
it('adds request headers', () => {
3-
cy.request('/api/hello').then((response) => {
4-
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
5-
})
6-
})
7-
8-
it('adds request headers to a rewrite', () => {
9-
cy.request('/headers').then((response) => {
10-
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
11-
})
12-
})
13-
142
it('rewrites the response body', () => {
153
cy.visit('/static')
164
cy.get('#message').contains('This was static but has been transformed in')

cypress/integration/middleware/standard.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
describe('Standard middleware', () => {
2+
it('adds request headers', () => {
3+
cy.request('/api/hello').then((response) => {
4+
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
5+
})
6+
})
7+
8+
it('adds request headers to a rewrite', () => {
9+
cy.request('/headers').then((response) => {
10+
expect(response.body).to.have.nested.property('headers.x-hello', 'world')
11+
})
12+
})
13+
214
it('rewrites to internal page', () => {
315
// preview mode is off by default
416
cy.visit('/shows/rewriteme')

demos/base-path/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"typescript": "^4.6.3"
1515
},
1616
"dependencies": {
17-
"next": "^13.0.6"
17+
"next": "^13.0.7"
1818
},
1919
"scripts": {
2020
"test": "echo \"Error: no test specified\" && exit 1"
@@ -29,4 +29,4 @@
2929
"url": "https://github.com/netlify/next-runtime/issues"
3030
},
3131
"homepage": "https://github.com/netlify/next-runtime#readme"
32-
}
32+
}

demos/canary/package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,15 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"next": "^12.3.1",
13-
"react": "^18.2.0",
14-
"react-dom": "^18.2.0"
12+
"nanoid": "^3.3.4",
13+
"next": "^13.0.7",
14+
"react": "latest",
15+
"react-dom": "latest",
16+
"sass": "latest",
17+
"swr": "2.0.0-rc.0"
1518
},
1619
"devDependencies": {
17-
"@netlify/next": "*",
18-
"@netlify/plugin-nextjs": "*",
19-
"@types/fs-extra": "^9.0.13",
20-
"@types/jest": "^27.4.1",
21-
"@types/node": "^17.0.25",
22-
"critters": "^0.0.16",
23-
"husky": "^7.0.4",
24-
"if-env": "^1.0.4",
25-
"npm-run-all": "^4.1.5",
20+
"@netlify/plugin-nextjs": "file:plugin-wrapper",
2621
"typescript": "^4.6.3"
2722
}
2823
}

demos/custom-routes/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"typescript": "^4.7.4"
1616
},
1717
"dependencies": {
18-
"next": "^13.0.6"
18+
"next": "^13.0.7"
1919
},
2020
"scripts": {
2121
"build": "next build",
@@ -30,4 +30,4 @@
3030
"url": "https://github.com/netlify/next-runtime/issues"
3131
},
3232
"homepage": "https://github.com/netlify/next-runtime#readme"
33-
}
33+
}

demos/default/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@reach/dialog": "^0.16.2",
2323
"@reach/visually-hidden": "^0.16.0",
2424
"@vercel/og": "^0.0.21",
25-
"next": "^13.0.6",
25+
"next": "^13.0.7",
2626
"react": "^18.2.0",
2727
"react-dom": "^18.2.0"
2828
},

demos/default/pages/api/shows/[...params].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async (req, res) => {
1010
const id = params[0]
1111

1212
// Get the data
13-
const fetchRes = await fetch(`https://api.tvmaze.com/shows/${id}`)
13+
const fetchRes = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
1414
const data = await fetchRes.json()
1515

1616
// If show was found, return it

demos/default/pages/api/shows/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default async (req, res) => {
77
const { id } = query
88

99
// Get the data
10-
const fetchRes = await fetch(`https://api.tvmaze.com/shows/${id}`)
10+
const fetchRes = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
1111
const data = await fetchRes.json()
1212

1313
// If show was found, return it

demos/default/pages/deep/import.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const Show = ({ show }) => (
2525
)
2626

2727
export const getServerSideProps = async ({ params }) => {
28-
const res = await fetch('https://api.tvmaze.com/shows/42')
28+
const res = await fetch('https://tvproxy.netlify.app/shows/42')
2929
const data = await res.json()
3030

3131
return {

demos/default/pages/getServerSideProps/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const getServerSideProps = async ({ params }) => {
3434
// The ID to render
3535
const { id } = params
3636

37-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
37+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3838
const data = await res.json()
3939

4040
// Set error code if show item could not be found

demos/default/pages/getServerSideProps/all/[[...slug]].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const getServerSideProps = async ({ params }) => {
3434
// The ID to render
3535
const { slug } = params
3636

37-
const res = await fetch(`https://api.tvmaze.com/shows/${slug[0]}`)
37+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(slug[0])}`)
3838
const data = await res.json()
3939

4040
// Set error code if show item could not be found

demos/default/pages/getServerSideProps/static.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Show = ({ show }) => (
2222
)
2323

2424
export const getServerSideProps = async ({ params }) => {
25-
const res = await fetch('https://api.tvmaze.com/shows/42')
25+
const res = await fetch('https://tvproxy.netlify.app/shows/42')
2626
const data = await res.json()
2727

2828
return {

demos/default/pages/getStaticProps/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function getStaticProps({ params }) {
2828
// The ID to render
2929
const { id } = params
3030

31-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
31+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3232
const data = await res.json()
3333
const time = new Date().toLocaleTimeString()
3434

demos/default/pages/getStaticProps/static.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Show = ({ show }) => (
1616
)
1717

1818
export async function getStaticProps(context) {
19-
const res = await fetch(`https://api.tvmaze.com/shows/71`)
19+
const res = await fetch(`https://tvproxy.netlify.app/shows/71`)
2020
const data = await res.json()
2121

2222
return {

demos/default/pages/getStaticProps/with-revalidate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Show = ({ show }) => (
1616
)
1717

1818
export async function getStaticProps(context) {
19-
const res = await fetch(`https://api.tvmaze.com/shows/71`)
19+
const res = await fetch(`https://tvproxy.netlify.app/shows/71`)
2020
const data = await res.json()
2121

2222
return {

demos/default/pages/getStaticProps/withFallback/[...slug].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getStaticProps({ params }) {
4242
const { slug } = params
4343
const id = slug[slug.length - 1]
4444

45-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
45+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
4646
const data = await res.json()
4747
const time = new Date().toLocaleTimeString()
4848

demos/default/pages/getStaticProps/withFallback/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function getStaticProps({ params }) {
4141
// The ID to render
4242
const { id } = params
4343

44-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
44+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
4545
const data = await res.json()
4646
const time = new Date().toLocaleTimeString()
4747

demos/default/pages/getStaticProps/withFallbackBlocking/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export async function getStaticProps({ params }) {
3030
// The ID to render
3131
const { id } = params
3232

33-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
33+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3434
const data = await res.json()
3535
const time = new Date().toLocaleTimeString()
3636

demos/default/pages/getStaticProps/withRevalidate/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function getStaticProps({ params }) {
2929
// The ID to render
3030
const { id } = params
3131

32-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
32+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3333
const data = await res.json()
3434
const time = new Date().toLocaleTimeString()
3535

demos/default/pages/getStaticProps/withRevalidate/withFallback/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function getStaticProps({ params }) {
4242
// The ID to render
4343
const { id } = params
4444

45-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
45+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
4646
const data = await res.json()
4747
const time = new Date().toLocaleTimeString()
4848

demos/default/pages/getStaticProps/withRevalidate/withFallbackBlocking/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function getStaticProps({ params }) {
2929
// The ID to render
3030
const { id } = params
3131

32-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
32+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3333
const data = await res.json()
3434
const time = new Date().toLocaleTimeString()
3535

demos/default/pages/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ Index.getInitialProps = async function () {
183183
const randomPage = Math.floor(Math.random() * 100) + 1
184184
// FIXME: stub out in dev
185185
const server = dev
186-
? `https://api.tvmaze.com/shows?page=${randomPage}`
187-
: `https://api.tvmaze.com/shows?page=${randomPage}`
186+
? `https://tvproxy.netlify.app/shows/page/${randomPage}`
187+
: `https://tvproxy.netlify.app/shows/page/${randomPage}`
188188

189189
// Get the data
190190
const res = await fetch(server)

demos/default/pages/shows/[...params].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ CatchAll.getInitialProps = async ({ res: req, query }) => {
4747
const id = params[0]
4848

4949
// Get the data
50-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
50+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
5151
const data = await res.json()
5252

5353
// Set error code if show item could not be found

demos/default/pages/shows/[id].js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Show.getInitialProps = async ({ res: req, query }) => {
3535
const { id } = query
3636

3737
// Get the data
38-
const res = await fetch(`https://api.tvmaze.com/shows/${id}`)
38+
const res = await fetch(`https://tvproxy.netlify.app/shows/${Number(id)}`)
3939
const data = await res.json()
4040

4141
// Set error code if show item could not be found

0 commit comments

Comments
 (0)