Skip to content

Commit

Permalink
upgrade vite (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon authored Jul 23, 2024
1 parent 107ea14 commit def05ec
Show file tree
Hide file tree
Showing 15 changed files with 500 additions and 538 deletions.
4 changes: 2 additions & 2 deletions packages/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"dependencies": {
"next": "14.2.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"next-yak": "workspace:*",
"styled-components": "6.1.1"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const { withYak } = require('next-yak/withYak');
import { withYak } from 'next-yak/withYak';

/** @type {import('next').NextConfig} */
const nextConfig = {

}

module.exports = withYak({
export default withYak({
experiments: {
crossFileSelectors: true
}
Expand Down
5 changes: 3 additions & 2 deletions packages/example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "next-yak-example",
"version": "0.1.0",
"type": "module",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -17,8 +18,8 @@
"@types/react": "18.2.28",
"@types/react-dom": "18.2.7",
"next": "14.2.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"typescript": "5.5.2",
"next-yak": "workspace:*"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/example/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
plugins: {
'postcss-nested':{},
}
Expand Down
6 changes: 3 additions & 3 deletions packages/next-yak/loaders/__tests__/cssloader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ const headline = css\`
).toMatchInlineSnapshot(`
".headline {
:before {
content: \\"\\\\2022\\";
content: "\\2022";
}
:after {
content: \\"\\\\2022\\";
content: "\\2022";
}
content: \\"\\\\\\\\\\"
content: "\\\\"
;
}"
`);
Expand Down
18 changes: 9 additions & 9 deletions packages/next-yak/loaders/__tests__/parseCss.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ test("parseCss inComplete css 1 ending inside a double quote string", () => {
"type": "selector",
},
],
"value": "url(\\"https://example.com
"value": "url("https://example.com
",
},
],
Expand All @@ -203,7 +203,7 @@ test("parseCss inComplete css 1 ending inside a double quote string", () => {
"type": "selector",
},
],
"value": "url(\\"https://example.com
"value": "url("https://example.com
",
},
"currentScopes": [
Expand All @@ -218,7 +218,7 @@ test("parseCss inComplete css 1 ending inside a double quote string", () => {
],
"isInsideAtRule": false,
"isInsidePropertyValue": true,
"isInsideString": "\\"",
"isInsideString": """,
},
}
`);
Expand Down Expand Up @@ -413,7 +413,7 @@ test("parseCss complete css with @media rule", () => {
"type": "selector",
},
],
"value": "url(\\"https://example.com\\")",
"value": "url("https://example.com")",
},
{
"closed": true,
Expand Down Expand Up @@ -447,7 +447,7 @@ test("parseCss complete css with @media rule", () => {
"type": "selector",
},
],
"value": "url(\\"https://example.com\\")",
"value": "url("https://example.com")",
},
{
"closed": true,
Expand Down Expand Up @@ -633,7 +633,7 @@ test("parseCss inComplete css 1 ending outside a // comment", () => {
test("Handles escaped backslashes in strings", () => {
expect(
parseCss(`a { content: "\\\\"; }`).declarations[0].value,
).toMatchInlineSnapshot('"\\"\\\\\\\\\\""');
).toMatchInlineSnapshot(`""\\\\""`);
});

test("Handles empty declarations", () => {
Expand All @@ -651,7 +651,7 @@ test("Handles empty declarations", () => {
"type": "selector",
},
],
"value": "\\"blue\\"",
"value": ""blue"",
},
{
"closed": true,
Expand Down Expand Up @@ -706,8 +706,8 @@ test("Handles newlines in property values", () => {
"type": "selector",
},
],
"value": "\\"line1
line2\\"",
"value": ""line1
line2"",
},
]
`);
Expand Down
4 changes: 2 additions & 2 deletions packages/next-yak/loaders/__tests__/toCss.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ test("handles escapes correctly", () => {
).toMatchInlineSnapshot(`
"
.foo {
content: \\"line1\\\\
line2\\";
content: "line1\\
line2";
}"
`);
});
Loading

0 comments on commit def05ec

Please sign in to comment.