Skip to content

Commit

Permalink
Merge branch 'main' into split-api-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt authored May 12, 2023
2 parents 6287e15 + 5ee2fce commit fdcf8d5
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 231 deletions.
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"packages/runtime": "4.36.0",
"packages/next": "1.4.5"
"packages/runtime": "4.36.1",
"packages/next": "1.4.6"
}
448 changes: 224 additions & 224 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@babel/preset-env": "^7.15.8",
"@babel/preset-typescript": "^7.16.0",
"@delucis/if-env": "^1.1.2",
"@netlify/build": "^29.11.1",
"@netlify/build": "^29.11.2",
"@netlify/eslint-config-node": "^7.0.1",
"@testing-library/cypress": "^9.0.0",
"@types/fs-extra": "^9.0.13",
Expand Down
7 changes: 7 additions & 0 deletions packages/next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.4.6](https://github.com/netlify/next-runtime/compare/next-v1.4.5...next-v1.4.6) (2023-05-08)


### Bug Fixes

* update next to 13.3.0 & ensure compatibility ([#2056](https://github.com/netlify/next-runtime/issues/2056)) ([75ed977](https://github.com/netlify/next-runtime/commit/75ed977553edc36ac018191bee5bba08b800f722))

## [1.4.5](https://github.com/netlify/next-runtime/compare/next-v1.4.4...next-v1.4.5) (2023-04-10)


Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netlify/next",
"version": "1.4.5",
"version": "1.4.6",
"description": "Enhanced Next.js features on Netlify",
"main": "lib/index.js",
"files": [
Expand Down
13 changes: 13 additions & 0 deletions packages/runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [4.36.1](https://github.com/netlify/next-runtime/compare/plugin-nextjs-v4.36.0...plugin-nextjs-v4.36.1) (2023-05-08)


### Bug Fixes

* add shim for `require('node:buffer')` ([#2050](https://github.com/netlify/next-runtime/issues/2050)) ([e007b08](https://github.com/netlify/next-runtime/commit/e007b08aad356674279ab6649ef4e27d355918f0))
* Legacy fallback env var ([#2074](https://github.com/netlify/next-runtime/issues/2074)) ([aad9e5f](https://github.com/netlify/next-runtime/commit/aad9e5f738e5f3e1391e1c0e8f65a526bcbc9ac8))
* make large lambda warning message more informative ([#2057](https://github.com/netlify/next-runtime/issues/2057)) ([b4cb75b](https://github.com/netlify/next-runtime/commit/b4cb75b7d71901aa8c1902067ffafecad19fd9d8))
* resolve next-server from next app directory and not from plugin ([#2059](https://github.com/netlify/next-runtime/issues/2059)) ([38f34c7](https://github.com/netlify/next-runtime/commit/38f34c7d8f7f06c96073ebed54675fea38eca7fa))
* Respect `pageExtensions` config setting ([#2073](https://github.com/netlify/next-runtime/issues/2073)) ([940cbbc](https://github.com/netlify/next-runtime/commit/940cbbc38d320677bdc8ade4616d1733ebfda2c7))
* update next to 13.3.0 & ensure compatibility ([#2056](https://github.com/netlify/next-runtime/issues/2056)) ([75ed977](https://github.com/netlify/next-runtime/commit/75ed977553edc36ac018191bee5bba08b800f722))
* workaround netlify-cli not matching prod ([#2030](https://github.com/netlify/next-runtime/issues/2030)) ([fd29ea5](https://github.com/netlify/next-runtime/commit/fd29ea5b7b608d71fcb111c17a92f3dec6d021a9))

## [4.36.0](https://github.com/netlify/next-runtime/compare/plugin-nextjs-v4.35.0...plugin-nextjs-v4.36.0) (2023-04-24)


Expand Down
6 changes: 3 additions & 3 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netlify/plugin-nextjs",
"version": "4.36.0",
"version": "4.36.1",
"description": "Run Next.js seamlessly on Netlify",
"main": "index.js",
"files": [
Expand All @@ -12,7 +12,7 @@
],
"dependencies": {
"@netlify/esbuild": "0.14.39",
"@netlify/functions": "^1.4.0",
"@netlify/functions": "^1.6.0",
"@netlify/ipx": "^1.4.0",
"@vercel/node-bridge": "^2.1.0",
"chalk": "^4.1.2",
Expand All @@ -37,7 +37,7 @@
},
"devDependencies": {
"@delucis/if-env": "^1.1.2",
"@netlify/build": "^29.11.1",
"@netlify/build": "^29.11.2",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.4.1",
"@types/merge-stream": "^1.1.2",
Expand Down
5 changes: 5 additions & 0 deletions packages/runtime/src/helpers/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ export const getSourceFileForPage = (page: string, roots: string[], pageExtensio
if (existsSync(file)) {
return file
}

const fileAtFolderIndex = join(root, page, `index.${extension}`)
if (existsSync(fileAtFolderIndex)) {
return fileAtFolderIndex
}
}
}
console.log('Could not find source file for page', page)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// noop
9 changes: 9 additions & 0 deletions test/helpers/files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,13 @@ describe('getSourceFileForPage', () => {

expect(filePath.replace(TEST_DIR, '')).toBe('/fixtures/page-extensions/custom/pages/api/custom.api.js')
})

it('handles getting file when index of folder', () => {
const pagesDir = resolve(__dirname, '../fixtures/page-extensions/index/pages')
const apiRoute = '/api/index'

const filePath = getSourceFileForPage(apiRoute, [pagesDir])

expect(filePath.replace(TEST_DIR, '')).toBe('/fixtures/page-extensions/index/pages/api/index/index.js')
})
})

0 comments on commit fdcf8d5

Please sign in to comment.