Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update prettier to 3.2.5 #65092

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions .github/actions/next-integration-stat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/next-stats-action/src/add-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ module.exports = async function addComment(
? '⚠️ '
: ''
: change > 0
? '⚠️ '
: ''
? '⚠️ '
: ''
change = `${warn}${change < 0 ? '-' : '+'}${
useRawValue ? absChange : prettify(absChange, prettyType)
}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
9 changes: 8 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
_next/
__tmp__/
dist/
node_modules/
target/
compiled/

Expand All @@ -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/**/*

Expand Down
17 changes: 0 additions & 17 deletions .prettierignore_staged

This file was deleted.

8 changes: 3 additions & 5 deletions bench/next-minimal-server/bin/minimal-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion examples/app-dir-mdx/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion examples/basic-css/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.hello {
font: 15px Helvetica, Arial, sans-serif;
font:
15px Helvetica,
Arial,
sans-serif;
background: #eee;
padding: 100px;
text-align: center;
Expand Down
28 changes: 23 additions & 5 deletions examples/blog/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion examples/cms-buttercms/css/lineicons.css
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
12 changes: 9 additions & 3 deletions examples/cms-buttercms/css/tiny-slider.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions examples/cms-contentful/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand All @@ -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}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cms-kontent-ai/pages/posts/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function getStaticPaths() {
params: {
slug,
},
} || []),
}) || [],
),
fallback: false,
};
Expand Down
4 changes: 2 additions & 2 deletions examples/cms-plasmic/pages/[[...catchall]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions examples/cms-plasmic/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ export class SitecorePagePropsFactory {
): Promise<SitecorePageProps> {
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;
}
Expand Down
5 changes: 2 additions & 3 deletions examples/cms-wordpress/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ async function fetchAPI(query = "", { variables }: Record<string, any> = {}) {
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
Expand Down
18 changes: 15 additions & 3 deletions examples/markdoc/public/globals.css
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion examples/nested-components/components/paragraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default function Paragraph({ children }: ParagraphProps) {
{children}
<style jsx>{`
p {
font: 13px Helvetica, Arial;
font:
13px Helvetica,
Arial;
margin: 10px 0;
}
`}</style>
Expand Down
4 changes: 3 additions & 1 deletion examples/nested-components/components/post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export default function Post({ title, children }: PostProps) {
{children}
<style jsx>{`
.main {
font: 15px Helvetica, Arial;
font:
15px Helvetica,
Arial;
border: 1px solid #eee;
padding: 0 10px;
}
Expand Down
15 changes: 12 additions & 3 deletions examples/progressive-web-app/styles/Home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,15 @@
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
font-family:
Menlo,
Monaco,
Lucida Console,
Liberation Mono,
DejaVu Sans Mono,
Bitstream Vera Sans Mono,
Courier New,
monospace;
}

.grid {
Expand All @@ -90,7 +97,9 @@
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
transition:
color 0.15s ease,
border-color 0.15s ease;
}

.card:hover,
Expand Down
Loading
Loading