diff --git a/.github/actions/next-integration-stat/src/index.ts b/.github/actions/next-integration-stat/src/index.ts index e4a16f4b66c36..ba7c7eda34438 100644 --- a/.github/actions/next-integration-stat/src/index.ts +++ b/.github/actions/next-integration-stat/src/index.ts @@ -447,29 +447,32 @@ async function getTestResultDiffBase( // Find the latest test result tree, iterate results file names to find out the latest one. // Filename follow ${yyyyMMddHHmm}-${sha}.json format. - const actualTestResultTree = testResultJsonTree.reduce((acc, value) => { - const dateStr = value.path?.split('-')[0].match(/(....)(..)(..)(..)(..)/) + const actualTestResultTree = testResultJsonTree.reduce( + (acc, value) => { + const dateStr = value.path?.split('-')[0].match(/(....)(..)(..)(..)(..)/) - if (!dateStr || dateStr.length < 5) { - return acc - } + if (!dateStr || dateStr.length < 5) { + return acc + } - const date = new Date( - dateStr![1] as any, - (dateStr![2] as any) - 1, - dateStr![3] as any, - dateStr![4] as any, - dateStr![5] as any - ) - if (!acc) { - return { - date, - value, + const date = new Date( + dateStr![1] as any, + (dateStr![2] as any) - 1, + dateStr![3] as any, + dateStr![4] as any, + dateStr![5] as any + ) + if (!acc) { + return { + date, + value, + } } - } - return acc.date >= date ? acc : { date, value } - }, null as any as { date: Date; value: (typeof testResultJsonTree)[0] }) + return acc.date >= date ? acc : { date, value } + }, + null as any as { date: Date; value: (typeof testResultJsonTree)[0] } + ) if (!actualTestResultTree || !actualTestResultTree?.value?.sha) { console.log('There is no test results json stored in the base yet') diff --git a/.github/actions/next-stats-action/src/add-comment.js b/.github/actions/next-stats-action/src/add-comment.js index c65e54236e44d..5001ff558e033 100644 --- a/.github/actions/next-stats-action/src/add-comment.js +++ b/.github/actions/next-stats-action/src/add-comment.js @@ -106,8 +106,8 @@ module.exports = async function addComment( ? '⚠️ ' : '' : change > 0 - ? '⚠️ ' - : '' + ? '⚠️ ' + : '' change = `${warn}${change < 0 ? '-' : '+'}${ useRawValue ? absChange : prettify(absChange, prettyType) }` diff --git a/.github/actions/next-stats-action/src/prepare/load-stats-config.js b/.github/actions/next-stats-action/src/prepare/load-stats-config.js index 55cecb54faad3..54bc3efe6f395 100644 --- a/.github/actions/next-stats-action/src/prepare/load-stats-config.js +++ b/.github/actions/next-stats-action/src/prepare/load-stats-config.js @@ -10,11 +10,9 @@ function loadStatsConfig() { for (const configPath of allowedConfigLocations) { try { relativeStatsAppDir = configPath - statsConfig = require(path.join( - diffRepoDir, - configPath, - 'stats-config.js' - )) + statsConfig = require( + path.join(diffRepoDir, configPath, 'stats-config.js') + ) break } catch (err) { if (err.code !== 'MODULE_NOT_FOUND') { diff --git a/.prettierignore b/.prettierignore index a297d08637c34..e89841d37cce1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,7 +4,6 @@ _next/ __tmp__/ dist/ -node_modules/ target/ compiled/ @@ -19,6 +18,14 @@ packages/next/src/bundles/webpack/packages/lazy-compilation-*.js packages/next-swc/crates/**/tests/**/output* packages/next-swc/crates/core/tests/loader/issue-32553/input.js +# prettier destroys the directives here +packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/client-graph/use-client/input.js +packages/next-swc/crates/next-custom-transforms/tests/errors/react-server-components/server-graph/fake-client-entry/input.js +packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/8/input.js +packages/next-swc/crates/next-custom-transforms/tests/errors/server-actions/server-graph/9/input.js +packages/next-swc/crates/next-custom-transforms/tests/fixture/optimize-barrel/normal/4/input.js +packages/next-swc/crates/next-custom-transforms/tests/fixture/react-server-components/client-graph/client-entry/input.js +packages/next-swc/crates/next-custom-transforms/tests/fixture/react-server-components/server-graph/client-entry/input.js packages/next-swc/native/**/* packages/next-swc/docs/assets/**/* diff --git a/.prettierignore_staged b/.prettierignore_staged deleted file mode 100644 index f1c268594d2f3..0000000000000 --- a/.prettierignore_staged +++ /dev/null @@ -1,17 +0,0 @@ -**/.next/** -**/_next/** -**/dist/** -packages/next-swc/crates/** -packages/next/src/compiled/**/* -packages/next/bundles/webpack/packages/*.runtime.js -lerna.json -packages/next-codemod/transforms/__testfixtures__/**/* -packages/next-codemod/transforms/__tests__/**/* -test/development/basic/hmr/components/parse-error.js -pnpm-lock.yaml -.github/actions/validate-docs-links/lib/index.js -.github/actions/needs-triage/index.js -.github/actions/*/index.mjs -**/convex/_generated/** -test/lib/amp-validator-wasm.js -test/production/pages-dir/production/fixture/amp-validator-wasm.js diff --git a/bench/next-minimal-server/bin/minimal-server.js b/bench/next-minimal-server/bin/minimal-server.js index 44861262aee06..332e53d0b727e 100755 --- a/bench/next-minimal-server/bin/minimal-server.js +++ b/bench/next-minimal-server/bin/minimal-server.js @@ -10,11 +10,9 @@ const path = require('path') const appDir = process.cwd() const distDir = '.next' -const compiledConfig = require(path.join( - appDir, - distDir, - 'required-server-files.json' -)).config +const compiledConfig = require( + path.join(appDir, distDir, 'required-server-files.json') +).config process.chdir(appDir) diff --git a/examples/app-dir-mdx/app/page.module.css b/examples/app-dir-mdx/app/page.module.css index 87f36d6d8565b..2182ce1cacb40 100644 --- a/examples/app-dir-mdx/app/page.module.css +++ b/examples/app-dir-mdx/app/page.module.css @@ -51,7 +51,9 @@ border-radius: var(--border-radius); background: rgba(var(--card-rgb), 0); border: 1px solid rgba(var(--card-border-rgb), 0); - transition: background 200ms, border 200ms; + transition: + background 200ms, + border 200ms; } .card span { diff --git a/examples/basic-css/styles.module.css b/examples/basic-css/styles.module.css index b841ef4cfaddb..7c8b0abdf8371 100644 --- a/examples/basic-css/styles.module.css +++ b/examples/basic-css/styles.module.css @@ -1,5 +1,8 @@ .hello { - font: 15px Helvetica, Arial, sans-serif; + font: + 15px Helvetica, + Arial, + sans-serif; background: #eee; padding: 100px; text-align: center; diff --git a/examples/blog/styles/main.css b/examples/blog/styles/main.css index 326b847a94042..b12ceb0ba74f3 100644 --- a/examples/blog/styles/main.css +++ b/examples/blog/styles/main.css @@ -15,12 +15,30 @@ } body { - font-family: "Inter var", system-ui, -apple-system, BlinkMacSystemFont, - "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, - "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: + "Inter var", + system-ui, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + "Helvetica Neue", + Arial, + "Noto Sans", + sans-serif, + "Apple Color Emoji", + "Segoe UI Emoji", + "Segoe UI Symbol", + "Noto Color Emoji"; -webkit-font-smoothing: subpixel-antialiased; - font-feature-settings: "case" 1, "cpsp" 1, "dlig" 1, "cv01" 1, "cv02", - "cv03" 1, "cv04" 1; + font-feature-settings: + "case" 1, + "cpsp" 1, + "dlig" 1, + "cv01" 1, + "cv02", + "cv03" 1, + "cv04" 1; font-variation-settings: "wght" 450; font-variant: common-ligatures contextual; letter-spacing: -0.02em; diff --git a/examples/cms-buttercms/css/lineicons.css b/examples/cms-buttercms/css/lineicons.css index 6ec975873914b..92267341185bc 100644 --- a/examples/cms-buttercms/css/lineicons.css +++ b/examples/cms-buttercms/css/lineicons.css @@ -7,7 +7,8 @@ Author: lineicons.com @font-face { font-family: "LineIcons"; src: url("fonts/LineIcons.eot"); - src: url("fonts/LineIcons.eot") format("embedded-opentype"), + src: + url("fonts/LineIcons.eot") format("embedded-opentype"), url("fonts/LineIcons.woff2") format("woff2"), url("fonts/LineIcons.woff") format("woff"), url("fonts/LineIcons.ttf") format("truetype"), diff --git a/examples/cms-buttercms/css/tiny-slider.min.css b/examples/cms-buttercms/css/tiny-slider.min.css index 89689dde2b99e..d1c1047edbb82 100644 --- a/examples/cms-buttercms/css/tiny-slider.min.css +++ b/examples/cms-buttercms/css/tiny-slider.min.css @@ -49,9 +49,15 @@ .tns-gallery > .tns-item { position: absolute; left: -100%; - -webkit-transition: transform 0s, opacity 0s; - -moz-transition: transform 0s, opacity 0s; - transition: transform 0s, opacity 0s; + -webkit-transition: + transform 0s, + opacity 0s; + -moz-transition: + transform 0s, + opacity 0s; + transition: + transform 0s, + opacity 0s; } .tns-gallery > .tns-slide-active { position: relative; diff --git a/examples/cms-contentful/lib/api.ts b/examples/cms-contentful/lib/api.ts index 9c4249c319dbe..4983a8c191bea 100644 --- a/examples/cms-contentful/lib/api.ts +++ b/examples/cms-contentful/lib/api.ts @@ -92,8 +92,8 @@ export async function getPostAndMorePosts( const entry = await fetchGraphQL( `query { postCollection(where: { slug: "${slug}" }, preview: ${ - preview ? "true" : "false" - }, limit: 1) { + preview ? "true" : "false" + }, limit: 1) { items { ${POST_GRAPHQL_FIELDS} } @@ -104,8 +104,8 @@ export async function getPostAndMorePosts( const entries = await fetchGraphQL( `query { postCollection(where: { slug_not_in: "${slug}" }, order: date_DESC, preview: ${ - preview ? "true" : "false" - }, limit: 2) { + preview ? "true" : "false" + }, limit: 2) { items { ${POST_GRAPHQL_FIELDS} } diff --git a/examples/cms-kontent-ai/pages/posts/[slug].tsx b/examples/cms-kontent-ai/pages/posts/[slug].tsx index 81f100b4ad00d..cf7452731a2fb 100644 --- a/examples/cms-kontent-ai/pages/posts/[slug].tsx +++ b/examples/cms-kontent-ai/pages/posts/[slug].tsx @@ -89,7 +89,7 @@ export async function getStaticPaths() { params: { slug, }, - } || []), + }) || [], ), fallback: false, }; diff --git a/examples/cms-plasmic/pages/[[...catchall]].tsx b/examples/cms-plasmic/pages/[[...catchall]].tsx index 081359a7a8944..601dd525c4e29 100644 --- a/examples/cms-plasmic/pages/[[...catchall]].tsx +++ b/examples/cms-plasmic/pages/[[...catchall]].tsx @@ -32,8 +32,8 @@ export const getStaticProps: GetStaticProps = async (context) => { typeof catchall === "string" ? catchall : Array.isArray(catchall) - ? `/${catchall.join("/")}` - : "/"; + ? `/${catchall.join("/")}` + : "/"; const plasmicData = await PLASMIC.maybeFetchComponentData(plasmicPath); if (!plasmicData) { // This is some non-Plasmic catch-all page diff --git a/examples/cms-plasmic/styles/globals.css b/examples/cms-plasmic/styles/globals.css index e5e2dcc23baf1..51a2a4eaacd86 100644 --- a/examples/cms-plasmic/styles/globals.css +++ b/examples/cms-plasmic/styles/globals.css @@ -2,8 +2,18 @@ html, body { padding: 0; margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + font-family: + -apple-system, + BlinkMacSystemFont, + Segoe UI, + Roboto, + Oxygen, + Ubuntu, + Cantarell, + Fira Sans, + Droid Sans, + Helvetica Neue, + sans-serif; } a { diff --git a/examples/cms-sitecore-xmcloud/src/assets/sass/base/typehead/_typehead.scss b/examples/cms-sitecore-xmcloud/src/assets/sass/base/typehead/_typehead.scss index 32bc1aaaae49e..eca0feb45233f 100644 --- a/examples/cms-sitecore-xmcloud/src/assets/sass/base/typehead/_typehead.scss +++ b/examples/cms-sitecore-xmcloud/src/assets/sass/base/typehead/_typehead.scss @@ -22,7 +22,9 @@ border: 1px solid $tt-dropdown-border; max-height: 300px; overflow-y: auto; - box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08); + box-shadow: + 0 3px 8px 0 rgba(0, 0, 0, 0.2), + 0 0 0 1px rgba(0, 0, 0, 0.08); } .tt-suggestion { padding: 4px 10px; diff --git a/examples/cms-sitecore-xmcloud/src/lib/page-props-factory/index.ts b/examples/cms-sitecore-xmcloud/src/lib/page-props-factory/index.ts index 292d54702ac8c..3733970c00b1d 100644 --- a/examples/cms-sitecore-xmcloud/src/lib/page-props-factory/index.ts +++ b/examples/cms-sitecore-xmcloud/src/lib/page-props-factory/index.ts @@ -37,11 +37,14 @@ export class SitecorePagePropsFactory { ): Promise { const extendedProps = await (Object.values(plugins) as Plugin[]) .sort((p1, p2) => p1.order - p2.order) - .reduce(async (result, plugin) => { - const props = await result; - const newProps = await plugin.exec(props, context); - return newProps; - }, Promise.resolve({} as SitecorePageProps)); + .reduce( + async (result, plugin) => { + const props = await result; + const newProps = await plugin.exec(props, context); + return newProps; + }, + Promise.resolve({} as SitecorePageProps), + ); return extendedProps; } diff --git a/examples/cms-wordpress/lib/api.ts b/examples/cms-wordpress/lib/api.ts index c42d8c5ed782a..2d77b5f3bcb4f 100644 --- a/examples/cms-wordpress/lib/api.ts +++ b/examples/cms-wordpress/lib/api.ts @@ -4,9 +4,8 @@ async function fetchAPI(query = "", { variables }: Record = {}) { const headers = { "Content-Type": "application/json" }; if (process.env.WORDPRESS_AUTH_REFRESH_TOKEN) { - headers[ - "Authorization" - ] = `Bearer ${process.env.WORDPRESS_AUTH_REFRESH_TOKEN}`; + headers["Authorization"] = + `Bearer ${process.env.WORDPRESS_AUTH_REFRESH_TOKEN}`; } // WPGraphQL Plugin must be enabled diff --git a/examples/markdoc/public/globals.css b/examples/markdoc/public/globals.css index d97aabc5a0042..ed5a46bd05606 100644 --- a/examples/markdoc/public/globals.css +++ b/examples/markdoc/public/globals.css @@ -1,7 +1,19 @@ body { - font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, - "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, - "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-family: + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + "Helvetica Neue", + Arial, + "Noto Sans", + sans-serif, + "Apple Color Emoji", + "Segoe UI Emoji", + "Segoe UI Symbol", + "Noto Color Emoji"; color: rgba(60, 66, 87, 1); margin: 0; } diff --git a/examples/nested-components/components/paragraph.tsx b/examples/nested-components/components/paragraph.tsx index f92085a6f121f..815587f4bfb6c 100644 --- a/examples/nested-components/components/paragraph.tsx +++ b/examples/nested-components/components/paragraph.tsx @@ -8,7 +8,9 @@ export default function Paragraph({ children }: ParagraphProps) { {children} diff --git a/examples/nested-components/components/post.tsx b/examples/nested-components/components/post.tsx index 7a4388408cc7f..7e93d63ba95d3 100644 --- a/examples/nested-components/components/post.tsx +++ b/examples/nested-components/components/post.tsx @@ -10,7 +10,9 @@ export default function Post({ title, children }: PostProps) { {children}