Skip to content

Commit

Permalink
Update test refs
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 18, 2024
1 parent 58b42f4 commit 5e55403
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:14:1]
,-[input.js:15:1]
14 | Welcome!
15 | <style jsx>{``}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^
16 | </h1>
`----

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:22:1]
,-[input.js:23:1]
22 | Hello world!
23 | <style jsx global>{``}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 | </h1>
`----

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:27:1]
,-[input.js:28:1]
27 | <>
28 | <style jsx>{styles}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:14:1]
,-[input.js:15:1]
14 | Welcome!
15 | <style jsx>{``}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^
16 | </h1>
`----

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:22:1]
,-[input.js:23:1]
22 | Hello world!
23 | <style jsx global>{``}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 | </h1>
`----

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:27:1]
,-[input.js:28:1]
27 | <>
28 | <style jsx>{styles}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected one child under JSX style tag, but got 0.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | <style jsx></style>
: ^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected one child under JSX style tag, but got 0.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | <style jsx></style>
: ^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

x /some-project/src/some-file.ts uses `css.resolve`, but ends with `.ts`. The file extension needs to be `.tsx` so that the jsx injected by `css.resolve` will be transformed.
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

x /some-project/src/some-file.ts uses `css.resolve`, but ends with `.ts`. The file extension needs to be `.tsx` so that the jsx injected by `css.resolve` will be transformed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected one child under JSX style tag, but got 2.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | ,-> <style jsx>
4 | | {`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected one child under JSX style tag, but got 2.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | ,-> <style jsx>
4 | | {`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected a single child of type JSXExpressionContainer under JSX Style tag.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | <style jsx>10</style>
: ^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected a single child of type JSXExpressionContainer under JSX Style tag.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | <style jsx>10</style>
: ^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected a template literal, string or identifier inside the JSXExpressionContainer.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | <style jsx>{[]}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Expected a template literal, string or identifier inside the JSXExpressionContainer.
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
,-[input.js:2:1]
,-[input.js:3:1]
2 | <div>
3 | <style jsx>{[]}</style>
: ^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:21:1]
,-[input.js:22:1]
21 |
22 | ,-> <style jsx>{`
23 | | .text:hover {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

x Detected nested styled-jsx tag.
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
,-[input.js:21:1]
,-[input.js:22:1]
21 |
22 | ,-> <style jsx>{`
23 | | .text:hover {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _JSXStyle from "styled-jsx/style";
const { className: cardClassName, styles } = {
styles: <_JSXStyle id={"a1e91057ca36c79d"}>{`.jsx-a1e91057ca36c79d:hover{z-index:${hoverAnimation ? "1" : "auto"}}`}</_JSXStyle>,
className: "jsx-a1e91057ca36c79d"
styles: <_JSXStyle id={"d662e9d5783da781"}>{`.jsx-d662e9d5783da781:hover{z-index:${hoverAnimation ? "1" : "auto"}}`}</_JSXStyle>,
className: "jsx-d662e9d5783da781"
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _JSXStyle from "styled-jsx/style";
const { className: cardClassName, styles } = {
styles: <_JSXStyle id={"a1e91057ca36c79d"}>{`.jsx-a1e91057ca36c79d:hover{z-index:${hoverAnimation ? "1" : "auto"}}`}</_JSXStyle>,
className: "jsx-a1e91057ca36c79d"
styles: <_JSXStyle id={"d662e9d5783da781"}>{`.jsx-d662e9d5783da781:hover{z-index:${hoverAnimation ? "1" : "auto"}}`}</_JSXStyle>,
className: "jsx-d662e9d5783da781"
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ bar.__hash = "aaed0341accea8f";
const baz = new String("div{font-size:3em}");
baz.__hash = "aaed0341accea8f";
const a = new String(`div{font-size:${size}em}`);
a.__hash = "191c4a18d2e37256";
a.__hash = "f3f709dce236d2c7";
export const uh = bar;
export const foo = new String(`div.jsx-4741e5e93407b746{color:${color}}`);
foo.__hash = "4741e5e93407b746";
export const foo = new String(`div.jsx-58279132b4e97b93{color:${color}}`);
foo.__hash = "58279132b4e97b93";
({
styles: <_JSXStyle id={"221225cea79e61ac"}>{`div.jsx-221225cea79e61ac{color:${colors.green.light}}a.jsx-221225cea79e61ac{color:red}`}</_JSXStyle>,
className: "jsx-221225cea79e61ac"
styles: <_JSXStyle id={"4616b980b67d37b1"}>{`div.jsx-4616b980b67d37b1{color:${colors.green.light}}a.jsx-4616b980b67d37b1{color:red}`}</_JSXStyle>,
className: "jsx-4616b980b67d37b1"
});
const b = {
styles: <_JSXStyle id={"d0a60866d0a6e507"}>{`div.jsx-d0a60866d0a6e507{color:${colors.green.light}}a.jsx-d0a60866d0a6e507{color:red}`}</_JSXStyle>,
className: "jsx-d0a60866d0a6e507"
styles: <_JSXStyle id={"1d9f9a0af736c476"}>{`div.jsx-1d9f9a0af736c476{color:${colors.green.light}}a.jsx-1d9f9a0af736c476{color:red}`}</_JSXStyle>,
className: "jsx-1d9f9a0af736c476"
};
const dynamic = (colors)=>{
const b = {
styles: <_JSXStyle id={"16174681411c9a0d"} dynamic={[
styles: <_JSXStyle id={"bde9d329308be70b"} dynamic={[
colors.green.light
]}>{`div.__jsx-style-dynamic-selector{color:${colors.green.light}}a.__jsx-style-dynamic-selector{color:red}`}</_JSXStyle>,
className: _JSXStyle.dynamic([
[
"16174681411c9a0d",
"bde9d329308be70b",
[
colors.green.light
]
Expand All @@ -34,6 +34,6 @@ const dynamic = (colors)=>{
};
};
export default {
styles: <_JSXStyle id={"cdd18b1c7798f128"}>{`div.jsx-cdd18b1c7798f128{font-size:3em}p.jsx-cdd18b1c7798f128{color:${color}}`}</_JSXStyle>,
className: "jsx-cdd18b1c7798f128"
styles: <_JSXStyle id={"2707c6e87ff4b8f7"}>{`div.jsx-2707c6e87ff4b8f7{font-size:3em}p.jsx-2707c6e87ff4b8f7{color:${color}}`}</_JSXStyle>,
className: "jsx-2707c6e87ff4b8f7"
};
22 changes: 11 additions & 11 deletions packages/styled-jsx/transform/tests/fixture/styles/output.swc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ bar.__hash = "aaed0341accea8f";
const baz = new String("div{font-size:3em}");
baz.__hash = "aaed0341accea8f";
const a = new String(`div{font-size:${size}em}`);
a.__hash = "191c4a18d2e37256";
a.__hash = "f3f709dce236d2c7";
export const uh = bar;
export const foo = new String(`div.jsx-4741e5e93407b746{color:${color}}`);
foo.__hash = "4741e5e93407b746";
export const foo = new String(`div.jsx-58279132b4e97b93{color:${color}}`);
foo.__hash = "58279132b4e97b93";
({
styles: <_JSXStyle id={"221225cea79e61ac"}>{`div.jsx-221225cea79e61ac{color:${colors.green.light}}a.jsx-221225cea79e61ac{color:red}`}</_JSXStyle>,
className: "jsx-221225cea79e61ac"
styles: <_JSXStyle id={"4616b980b67d37b1"}>{`div.jsx-4616b980b67d37b1{color:${colors.green.light}}a.jsx-4616b980b67d37b1{color:red}`}</_JSXStyle>,
className: "jsx-4616b980b67d37b1"
});
const b = {
styles: <_JSXStyle id={"d0a60866d0a6e507"}>{`div.jsx-d0a60866d0a6e507{color:${colors.green.light}}a.jsx-d0a60866d0a6e507{color:red}`}</_JSXStyle>,
className: "jsx-d0a60866d0a6e507"
styles: <_JSXStyle id={"1d9f9a0af736c476"}>{`div.jsx-1d9f9a0af736c476{color:${colors.green.light}}a.jsx-1d9f9a0af736c476{color:red}`}</_JSXStyle>,
className: "jsx-1d9f9a0af736c476"
};
const dynamic = (colors)=>{
const b = {
styles: <_JSXStyle id={"16174681411c9a0d"} dynamic={[
styles: <_JSXStyle id={"bde9d329308be70b"} dynamic={[
colors.green.light
]}>{`div.__jsx-style-dynamic-selector{color:${colors.green.light}}a.__jsx-style-dynamic-selector{color:red}`}</_JSXStyle>,
className: _JSXStyle.dynamic([
[
"16174681411c9a0d",
"bde9d329308be70b",
[
colors.green.light
]
Expand All @@ -34,6 +34,6 @@ const dynamic = (colors)=>{
};
};
export default {
styles: <_JSXStyle id={"cdd18b1c7798f128"}>{`div.jsx-cdd18b1c7798f128{font-size:3em}p.jsx-cdd18b1c7798f128{color:${color}}`}</_JSXStyle>,
className: "jsx-cdd18b1c7798f128"
styles: <_JSXStyle id={"2707c6e87ff4b8f7"}>{`div.jsx-2707c6e87ff4b8f7{font-size:3em}p.jsx-2707c6e87ff4b8f7{color:${color}}`}</_JSXStyle>,
className: "jsx-2707c6e87ff4b8f7"
};

0 comments on commit 5e55403

Please sign in to comment.