Skip to content

Commit

Permalink
Merge branch 'canary' into get-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaykulk621 authored Jun 5, 2023
2 parents c2c77d6 + ccee374 commit 1397bdf
Show file tree
Hide file tree
Showing 23 changed files with 153 additions and 146 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "13.4.5-canary.4"
"version": "13.4.5-canary.5"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"keywords": [
"react",
"next",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-next",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"description": "ESLint configuration used by NextJS.",
"main": "index.js",
"license": "MIT",
Expand All @@ -9,7 +9,7 @@
"directory": "packages/eslint-config-next"
},
"dependencies": {
"@next/eslint-plugin-next": "13.4.5-canary.4",
"@next/eslint-plugin-next": "13.4.5-canary.5",
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.42.0",
"eslint-import-resolver-node": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"description": "ESLint plugin for NextJS.",
"main": "dist/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/font/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/font",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"repository": {
"url": "vercel/next.js",
"directory": "packages/font"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"main": "index.js",
"types": "index.d.ts",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/env",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-module/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-module",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
"main": "dist/polyfill-module.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/swc",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
Expand Down
14 changes: 7 additions & 7 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "13.4.5-canary.4",
"version": "13.4.5-canary.5",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -83,7 +83,7 @@
]
},
"dependencies": {
"@next/env": "13.4.5-canary.4",
"@next/env": "13.4.5-canary.5",
"@swc/helpers": "0.5.1",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
Expand Down Expand Up @@ -140,11 +140,11 @@
"@jest/types": "29.5.0",
"@napi-rs/cli": "2.14.7",
"@napi-rs/triples": "1.1.0",
"@next/polyfill-module": "13.4.5-canary.4",
"@next/polyfill-nomodule": "13.4.5-canary.4",
"@next/react-dev-overlay": "13.4.5-canary.4",
"@next/react-refresh-utils": "13.4.5-canary.4",
"@next/swc": "13.4.5-canary.4",
"@next/polyfill-module": "13.4.5-canary.5",
"@next/polyfill-nomodule": "13.4.5-canary.5",
"@next/react-dev-overlay": "13.4.5-canary.5",
"@next/react-refresh-utils": "13.4.5-canary.5",
"@next/swc": "13.4.5-canary.5",
"@opentelemetry/api": "1.4.1",
"@segment/ajv-human-errors": "2.1.2",
"@taskr/clear": "1.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
PAGES_DIR_ALIAS,
INSTRUMENTATION_HOOK_FILENAME,
} from '../lib/constants'
import { fileExists } from '../lib/file-exists'
import { FileType, fileExists } from '../lib/file-exists'
import { findPagesDir } from '../lib/find-pages-dir'
import loadCustomRoutes, {
CustomRoutes,
Expand Down Expand Up @@ -588,7 +588,7 @@ export default async function build(
for (const page in mappedPages) {
const hasPublicPageFile = await fileExists(
path.join(publicDir, page === '/' ? '/index' : page),
'file'
FileType.File
)
if (hasPublicPageFile) {
conflictingPublicFiles.push(page)
Expand Down
41 changes: 11 additions & 30 deletions packages/next/src/build/webpack/loaders/metadata/discover.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type webpack from 'webpack'
import type {
CollectingMetadata,
PossibleStaticMetadataFileNameConvention,
Expand All @@ -7,6 +6,7 @@ import path from 'path'
import { stringify } from 'querystring'
import { STATIC_METADATA_IMAGES } from '../../../../lib/metadata/is-metadata-route'
import { WEBPACK_RESOURCE_QUERIES } from '../../../../lib/constants'
import { MetadataResolver } from '../next-app-loader'

const METADATA_TYPE = 'metadata'

Expand All @@ -16,16 +16,14 @@ async function enumMetadataFiles(
filename: string,
extensions: readonly string[],
{
resolvePath,
loaderContext,
metadataResolver,
// When set to true, possible filename without extension could: icon, icon0, ..., icon9
numericSuffix,
}: {
resolvePath: (pathname: string) => Promise<string>
loaderContext: webpack.LoaderContext<any>
metadataResolver: MetadataResolver
numericSuffix: boolean
}
) {
): Promise<string[]> {
const collectedFiles: string[] = []

const possibleFileNames = [filename].concat(
Expand All @@ -36,19 +34,9 @@ async function enumMetadataFiles(
: []
)
for (const name of possibleFileNames) {
for (const ext of extensions) {
const pathname = path.join(dir, `${name}.${ext}`)
try {
const resolved = await resolvePath(pathname)
loaderContext.addDependency(resolved)

collectedFiles.push(resolved)
} catch (err: any) {
if (!err.message.includes("Can't resolve")) {
throw err
}
loaderContext.addMissingDependency(pathname)
}
const resolved = await metadataResolver(path.join(dir, name), extensions)
if (resolved) {
collectedFiles.push(resolved)
}
}

Expand All @@ -59,16 +47,14 @@ export async function createStaticMetadataFromRoute(
resolvedDir: string,
{
segment,
resolvePath,
metadataResolver,
isRootLayoutOrRootPage,
loaderContext,
pageExtensions,
basePath,
}: {
segment: string
resolvePath: (pathname: string) => Promise<string>
metadataResolver: MetadataResolver
isRootLayoutOrRootPage: boolean
loaderContext: webpack.LoaderContext<any>
pageExtensions: string[]
basePath: string
}
Expand All @@ -82,11 +68,6 @@ export async function createStaticMetadataFromRoute(
manifest: undefined,
}

const opts = {
resolvePath,
loaderContext,
}

async function collectIconModuleIfExists(
type: PossibleStaticMetadataFileNameConvention
) {
Expand All @@ -96,7 +77,7 @@ export async function createStaticMetadataFromRoute(
resolvedDir,
'manifest',
staticManifestExtension.concat(pageExtensions),
{ ...opts, numericSuffix: false }
{ metadataResolver, numericSuffix: false }
)
if (manifestFile.length > 0) {
hasStaticMetadataFiles = true
Expand All @@ -116,7 +97,7 @@ export async function createStaticMetadataFromRoute(
...STATIC_METADATA_IMAGES[type].extensions,
...(type === 'favicon' ? [] : pageExtensions),
],
{ ...opts, numericSuffix: true }
{ metadataResolver, numericSuffix: true }
)
resolvedMetadataFiles
.sort((a, b) => a.localeCompare(b))
Expand Down
Loading

0 comments on commit 1397bdf

Please sign in to comment.