Unverified Commit 4354edad authored by Leah's avatar Leah Committed by GitHub

fix snapshots broken by prettier (also fix .prettierignore) (#48586)

### What?
Fix snapshots that were no longer fulfilling the original purpose after
prettier had its way.

The `.prettierignore` also had the old `target/` directory (prior to the
`Cargo.toml` move in #48198) so running `pnpm prettier-fix` formatted
files in the `target/` directory
parent a06fef09
node_modules # Build artifacts
**/.next/** .next/
**/_next/** .turbo/
**/dist/** _next/
__tmp__/
dist/
node_modules/
target/
compiled/
lerna.json
test-timings.json
pnpm-lock.yaml
packages/next/src/bundles/webpack/packages/*.runtime.js packages/next/src/bundles/webpack/packages/*.runtime.js
packages/next/src/bundles/webpack/packages/lazy-compilation-*.js packages/next/src/bundles/webpack/packages/lazy-compilation-*.js
packages/next/src/compiled/**
packages/react-refresh-utils/**/*.js
packages/react-refresh-utils/**/*.d.ts
packages/react-dev-overlay/lib/**
**/__tmp__/**
lerna.json
.github/actions/next-stats-action/.work .github/actions/next-stats-action/.work
.github/actions/issue-validator/index.mjs .github/actions/issue-validator/index.mjs
.github/actions/issue-labeler/lib/index.js .github/actions/issue-labeler/lib/index.js
packages/next-swc/crates/next-core/js/src/compiled/**/*
packages/next-swc/crates/**/tests/**/output* packages/next-swc/crates/**/tests/**/output*
packages/next-swc/target/**/* packages/next-swc/crates/core/tests/loader/issue-32553/input.js
packages/next-swc/native/**/* packages/next-swc/native/**/*
packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/* packages/next-codemod/transforms/__testfixtures__/**
packages/next-codemod/transforms/__tests__/**
packages/next-codemod/**/*.js packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts packages/next-env/**/*.d.ts
test-timings.json
test/**/out/** test/**/out/**
test/development/basic/hmr/components/parse-error.js test/development/basic/hmr/components/parse-error.js
bench/nested-deps/pages/**/* bench/nested-deps/pages/**/*
bench/nested-deps/components/**/* bench/nested-deps/components/**/*
pnpm-lock.yaml
**/convex/_generated/** **/convex/_generated/**
import 'react' import 'react'
;('use client')
// prettier-ignore
'use client'
export default function () { export default function () {
return null return null
......
import 'react'; import 'react';
'use client';
export default function() { export default function() {
return null; return null;
} }
x NEXT_RSC_ERR_CLIENT_DIRECTIVE_PAREN x NEXT_RSC_ERR_CLIENT_DIRECTIVE
,-[input.js:1:1] ,-[input.js:3:1]
1 | import 'react' 3 | // prettier-ignore
2 | ;('use client') 4 | 'use client'
: ^^^^^^^^^^^^^^ : ^^^^^^^^^^^^
`---- `----
...@@ -5,5 +5,7 @@ const foo = async () => { ...@@ -5,5 +5,7 @@ const foo = async () => {
const bar = async () => { const bar = async () => {
const x = 1 const x = 1
;('use server')
// prettier-ignore
'use server'
} }
...@@ -5,5 +5,6 @@ export const $$ACTION_1 = async (closure)=>{ ...@@ -5,5 +5,6 @@ export const $$ACTION_1 = async (closure)=>{
var $$ACTION_0; var $$ACTION_0;
const bar = async ()=>{ const bar = async ()=>{
const x = 1; const x = 1;
// prettier-ignore
'use server'; 'use server';
}; };
x The "use server" directive must be at the top of the function body.
,-[input.js:9:1]
9 | // prettier-ignore
10 | 'use server'
: ^^^^^^^^^^^^
11 | }
`----
import 'my-module' import 'my-module'
;('use server')
// prettier-ignore
'use server'
import 'my-module'; import 'my-module';
// prettier-ignore
'use server'; 'use server';
x The "use server" directive must be at the top of the file, and cannot be wrapped in parentheses. x The "use server" directive must be at the top of the file.
,-[input.js:1:1] ,-[input.js:3:1]
1 | import 'my-module' 3 | // prettier-ignore
2 | ;('use server') 4 | 'use server'
: ^^^^^^^^^^^^^^ : ^^^^^^^^^^^^
`---- `----
...@@ -15,12 +15,16 @@ ...@@ -15,12 +15,16 @@
'use client' 'use client'
import 'fs' import 'fs'
;('bar')
// prettier-ignore
'bar'
// This is a comment. // This is a comment.
1 + 1 1 + 1
;('baz')
// prettier-ignore
'baz'
export default function () { export default function () {
return null return null
......
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
// This is a comment. // This is a comment.
'foo'; 'foo';
import 'fs'; import 'fs';
// prettier-ignore
'bar'; 'bar';
// This is a comment. // This is a comment.
1 + 1; 1 + 1;
// prettier-ignore
'baz'; 'baz';
export default function() { export default function() {
return null; return null;
} }
...@@ -13,12 +13,16 @@ ...@@ -13,12 +13,16 @@
'random-directive' 'random-directive'
import 'fs' import 'fs'
;('qwerty')
// prettier-ignore
'qwerty'
// This is a comment. // This is a comment.
1 + 1 1 + 1
;('sasaya')
// prettier-ignore
'sasaya'
export default function () { export default function () {
return null return null
......
;<div>children</div> <div>children</div>; '<>hello</>'
;('<>hello</>')
use turbo_binding::turbo::tasks_build::{generate_register, rerun_if_glob}; use turbo_binding::turbo::tasks_build::generate_register;
use vergen::{vergen, Config}; use vergen::{vergen, Config};
fn main() { fn main() {
generate_register(); generate_register();
rerun_if_glob("tests/integration/*/*", "tests/integration");
// Attempt to collect some build time env values but will skip if there are any // Attempt to collect some build time env values but will skip if there are any
// errors. // errors.
let _ = vergen(Config::default()); let _ = vergen(Config::default());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment