diff --git a/.changeset/integration.md b/.changeset/integration.md new file mode 100644 index 00000000..a5d39a61 --- /dev/null +++ b/.changeset/integration.md @@ -0,0 +1,7 @@ +--- +'@vanilla-extract/integration': major +--- + +Use absolute paths internally to make sure Vite resolves modules correctly + +This change only affects integrations that use the vite-node compiler, which is currently the esbuild (next) and Vite plugins diff --git a/.changeset/plugins.md b/.changeset/plugins.md new file mode 100644 index 00000000..ffe0fb7a --- /dev/null +++ b/.changeset/plugins.md @@ -0,0 +1,6 @@ +--- +'@vanilla-extract/vite-plugin': patch +'@vanilla-extract/esbuild-plugin-next': patch +--- + +Correctly resolve module paths when using Vite plugins that affect module resolution, such as [`vite-tsconfig-paths`](https://github.com/aleclarson/vite-tsconfig-paths) diff --git a/package.json b/package.json index e91b822a..14a3c274 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "start-site": "pnpm --filter=site start", "build-site": "pnpm --filter=site build", "test:unit": "pnpm test:jest && pnpm test:vitest", - "test:jest": "jest", + "test:jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest", "test:vitest": "vitest --watch=false", "test:playwright": "NODE_OPTIONS=--no-experimental-fetch playwright test", "format": "prettier --write .", @@ -41,8 +41,9 @@ "@types/testing-library__jest-dom": "^5.14.5", "@vanilla-extract/jest-transform": "*", "babel-jest": "^27.3.1", + "cross-env": "^7.0.3", "fast-glob": "^3.2.7", - "jest": "^29.3.1", + "jest": "^29.7.0", "jest-environment-jsdom": "^29.3.1", "prettier": "^2.8.8", "resolve.exports": "^1.1.0", @@ -50,8 +51,8 @@ "rollup-plugin-dts": "^4.2.2", "rollup-plugin-node-externals": "^5.0.0", "ts-node": "^10.0.0", - "typescript": "^4.9.4", - "vitest": "^1.1.0" + "typescript": "^5.3.3", + "vitest": "^1.2.2" }, "preconstruct": { "___experimentalFlags_WILL_CHANGE_IN_PATCH": { diff --git a/packages/esbuild-plugin-next/src/index.ts b/packages/esbuild-plugin-next/src/index.ts index 1d0f9bdb..ad896d43 100644 --- a/packages/esbuild-plugin-next/src/index.ts +++ b/packages/esbuild-plugin-next/src/index.ts @@ -53,9 +53,9 @@ export function vanillaExtractPlugin({ build.onLoad( { filter: /.*/, namespace: vanillaCssNamespace }, async ({ path }) => { - const [rootRelativePath] = path.split('.vanilla.css'); + const [vanillaModulePath] = path.split('.vanilla.css'); - let { css, filePath } = compiler.getCssForFile(rootRelativePath); + let { css, filePath } = compiler.getCssForFile(vanillaModulePath); if (typeof processCss === 'function') { css = await processCss(css); diff --git a/packages/integration/src/compiler.ts b/packages/integration/src/compiler.ts index 511c65fe..c2137571 100644 --- a/packages/integration/src/compiler.ts +++ b/packages/integration/src/compiler.ts @@ -1,4 +1,4 @@ -import { join, relative, isAbsolute } from 'path'; +import { join, isAbsolute } from 'path'; import type { Adapter } from '@vanilla-extract/css'; import { transformCss } from '@vanilla-extract/css/transformCss'; import type { ModuleNode, InlineConfig as ViteConfig } from 'vite'; @@ -16,7 +16,7 @@ type Composition = Parameters[0]; const globalAdapterIdentifier = '__vanilla_globalCssAdapter__'; -const scanModule = (entryModule: ModuleNode, root: string) => { +const scanModule = (entryModule: ModuleNode) => { const queue = new Set([entryModule]); const cssDeps = new Set(); const watchFiles = new Set(); @@ -26,10 +26,8 @@ const scanModule = (entryModule: ModuleNode, root: string) => { continue; } - const relativePath = moduleNode.id && relative(root, moduleNode.id); - - if (relativePath && cssFileFilter.test(relativePath)) { - cssDeps.add(relativePath); + if (moduleNode.id && cssFileFilter.test(moduleNode.id)) { + cssDeps.add(moduleNode.id); } if (moduleNode.file) { watchFiles.add(moduleNode.file); @@ -151,7 +149,7 @@ class NormalizedMap extends Map { #normalizePath(filePath: string) { return normalizePath( - isAbsolute(filePath) ? relative(this.root, filePath) : filePath, + isAbsolute(filePath) ? filePath : join(this.root, filePath), ); } @@ -319,7 +317,7 @@ export const createCompiler = ({ const cssImports = []; - const { cssDeps, watchFiles } = scanModule(moduleNode, root); + const { cssDeps, watchFiles } = scanModule(moduleNode); for (const cssDep of cssDeps) { const cssDepModuleId = normalizePath(cssDep); @@ -388,9 +386,7 @@ export const createCompiler = ({ }, getCssForFile(filePath: string) { filePath = isAbsolute(filePath) ? filePath : join(root, filePath); - const rootRelativePath = relative(root, filePath); - - const moduleId = normalizePath(rootRelativePath); + const moduleId = normalizePath(filePath); const result = cssCache.get(moduleId); if (!result) { @@ -399,7 +395,7 @@ export const createCompiler = ({ return { css: result.css, - filePath: rootRelativePath, + filePath: filePath, resolveDir: root, }; }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e1f679d..a9e6559b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,12 +61,15 @@ importers: babel-jest: specifier: ^27.3.1 version: 27.3.1(@babel/core@7.20.7) + cross-env: + specifier: ^7.0.3 + version: 7.0.3 fast-glob: specifier: ^3.2.7 version: 3.3.2 jest: - specifier: ^29.3.1 - version: 29.4.3(@types/node@20.9.5)(ts-node@10.9.1) + specifier: ^29.7.0 + version: 29.7.0(@types/node@20.9.5)(ts-node@10.9.1) jest-environment-jsdom: specifier: ^29.3.1 version: 29.4.3 @@ -81,19 +84,19 @@ importers: version: 2.79.1 rollup-plugin-dts: specifier: ^4.2.2 - version: 4.2.2(rollup@2.79.1)(typescript@4.9.4) + version: 4.2.2(rollup@2.79.1)(typescript@5.3.3) rollup-plugin-node-externals: specifier: ^5.0.0 version: 5.0.0(rollup@2.79.1) ts-node: specifier: ^10.0.0 - version: 10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@4.9.4) + version: 10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@5.3.3) typescript: - specifier: ^4.9.4 - version: 4.9.4 + specifier: ^5.3.3 + version: 5.3.3 vitest: - specifier: ^1.1.0 - version: 1.1.0(@types/node@20.9.5) + specifier: ^1.2.2 + version: 1.2.2(@types/node@20.9.5) examples/next: dependencies: @@ -142,7 +145,7 @@ importers: version: 9.1.3(@babel/core@7.20.7)(webpack@5.90.0) css-loader: specifier: ^6.9.1 - version: 6.9.1(webpack@5.90.0) + version: 6.10.0(webpack@5.90.0) html-webpack-plugin: specifier: ^5.3.1 version: 5.5.0(webpack@5.90.0) @@ -405,7 +408,7 @@ importers: devDependencies: '@jest/transform': specifier: ^29.0.3 - version: 29.4.3 + version: 29.7.0 packages/next-plugin: dependencies: @@ -615,7 +618,7 @@ importers: version: 8.1.1(webpack@5.90.0) css-loader: specifier: ^6.9.1 - version: 6.9.1(webpack@5.90.0) + version: 6.10.0(webpack@5.90.0) csstype: specifier: ^3.0.7 version: 3.0.10 @@ -732,7 +735,7 @@ importers: version: 9.1.3(@babel/core@7.20.7)(webpack@5.90.0) css-loader: specifier: ^6.9.1 - version: 6.9.1(webpack@5.90.0) + version: 6.10.0(webpack@5.90.0) cssnano: specifier: ^5.1.15 version: 5.1.15(postcss@8.4.33) @@ -827,6 +830,9 @@ importers: '@vanilla-extract/sprinkles': specifier: '*' version: link:../packages/sprinkles + vite-tsconfig-paths: + specifier: ^4.3.1 + version: 4.3.1(typescript@5.3.3) packages: @@ -2731,20 +2737,20 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} - /@jest/console@29.4.3: - resolution: {integrity: sha512-W/o/34+wQuXlgqlPYTansOSiBnuxrTv61dEVkA6HNmpcgHLUjfaUbdqt6oVvOzaawwo9IdW9QOtMgQ1ScSZC4A==} + /@jest/console@29.7.0: + resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 '@types/node': 20.9.5 chalk: 4.1.2 - jest-message-util: 29.4.3 - jest-util: 29.4.3 + jest-message-util: 29.7.0 + jest-util: 29.7.0 slash: 3.0.0 dev: false - /@jest/core@29.4.3(ts-node@10.9.1): - resolution: {integrity: sha512-56QvBq60fS4SPZCuM7T+7scNrkGIe7Mr6PVIXUpu48ouvRaWOFqRPV91eifvFM0ay2HmfswXiGf97NGUN5KofQ==} + /@jest/core@29.7.0(ts-node@10.9.1): + resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -2752,92 +2758,93 @@ packages: node-notifier: optional: true dependencies: - '@jest/console': 29.4.3 - '@jest/reporters': 29.4.3 - '@jest/test-result': 29.4.3 - '@jest/transform': 29.4.3 - '@jest/types': 29.4.3 + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.10 - jest-changed-files: 29.4.3 - jest-config: 29.4.3(@types/node@20.9.5)(ts-node@10.9.1) - jest-haste-map: 29.4.3 - jest-message-util: 29.4.3 - jest-regex-util: 29.4.3 - jest-resolve: 29.4.3 - jest-resolve-dependencies: 29.4.3 - jest-runner: 29.4.3 - jest-runtime: 29.4.3 - jest-snapshot: 29.4.3 - jest-util: 29.4.3 - jest-validate: 29.4.3 - jest-watcher: 29.4.3 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.9.5)(ts-node@10.9.1) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 micromatch: 4.0.5 pretty-format: 29.7.0 slash: 3.0.0 strip-ansi: 6.0.1 transitivePeerDependencies: + - babel-plugin-macros - supports-color - ts-node dev: false - /@jest/environment@29.4.3: - resolution: {integrity: sha512-dq5S6408IxIa+lr54zeqce+QgI+CJT4nmmA+1yzFgtcsGK8c/EyiUb9XQOgz3BMKrRDfKseeOaxj2eO8LlD3lA==} + /@jest/environment@29.7.0: + resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/fake-timers': 29.4.3 - '@jest/types': 29.4.3 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 - jest-mock: 29.4.3 + jest-mock: 29.7.0 dev: false - /@jest/expect-utils@29.4.3: - resolution: {integrity: sha512-/6JWbkxHOP8EoS8jeeTd9dTfc9Uawi+43oLKHfp6zzux3U2hqOOVnV3ai4RpDYHOccL6g+5nrxpoc8DmJxtXVQ==} + /@jest/expect-utils@29.7.0: + resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 29.4.3 + jest-get-type: 29.6.3 dev: false - /@jest/expect@29.4.3: - resolution: {integrity: sha512-iktRU/YsxEtumI9zsPctYUk7ptpC+AVLLk1Ax3AsA4g1C+8OOnKDkIQBDHtD5hA/+VtgMd5AWI5gNlcAlt2vxQ==} + /@jest/expect@29.7.0: + resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - expect: 29.4.3 - jest-snapshot: 29.4.3 + expect: 29.7.0 + jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color dev: false - /@jest/fake-timers@29.4.3: - resolution: {integrity: sha512-4Hote2MGcCTWSD2gwl0dwbCpBRHhE6olYEuTj8FMowdg3oQWNKr2YuxenPQYZ7+PfqPY1k98wKDU4Z+Hvd4Tiw==} + /@jest/fake-timers@29.7.0: + resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.0.2 '@types/node': 20.9.5 - jest-message-util: 29.4.3 - jest-mock: 29.4.3 - jest-util: 29.4.3 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-util: 29.7.0 dev: false - /@jest/globals@29.4.3: - resolution: {integrity: sha512-8BQ/5EzfOLG7AaMcDh7yFCbfRLtsc+09E1RQmRBI4D6QQk4m6NSK/MXo+3bJrBN0yU8A2/VIcqhvsOLFmziioA==} + /@jest/globals@29.7.0: + resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.4.3 - '@jest/expect': 29.4.3 - '@jest/types': 29.4.3 - jest-mock: 29.4.3 + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/types': 29.6.3 + jest-mock: 29.7.0 transitivePeerDependencies: - supports-color dev: false - /@jest/reporters@29.4.3: - resolution: {integrity: sha512-sr2I7BmOjJhyqj9ANC6CTLsL4emMoka7HkQpcoMRlhCbQJjz2zsRzw0BDPiPyEFDXAbxKgGFYuQZiSJ1Y6YoTg==} + /@jest/reporters@29.7.0: + resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -2846,10 +2853,10 @@ packages: optional: true dependencies: '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.4.3 - '@jest/test-result': 29.4.3 - '@jest/transform': 29.4.3 - '@jest/types': 29.4.3 + '@jest/console': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.22 '@types/node': 20.9.5 chalk: 4.1.2 @@ -2858,13 +2865,13 @@ packages: glob: 7.2.0 graceful-fs: 4.2.10 istanbul-lib-coverage: 3.2.0 - istanbul-lib-instrument: 5.1.0 + istanbul-lib-instrument: 6.0.1 istanbul-lib-report: 3.0.0 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.5 - jest-message-util: 29.4.3 - jest-util: 29.4.3 - jest-worker: 29.4.3 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + jest-worker: 29.7.0 slash: 3.0.0 string-length: 4.0.2 strip-ansi: 6.0.1 @@ -2879,8 +2886,8 @@ packages: dependencies: '@sinclair/typebox': 0.27.8 - /@jest/source-map@29.4.3: - resolution: {integrity: sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==} + /@jest/source-map@29.6.3: + resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jridgewell/trace-mapping': 0.3.22 @@ -2888,23 +2895,23 @@ packages: graceful-fs: 4.2.10 dev: false - /@jest/test-result@29.4.3: - resolution: {integrity: sha512-Oi4u9NfBolMq9MASPwuWTlC5WvmNRwI4S8YrQg5R5Gi47DYlBe3sh7ILTqi/LGrK1XUE4XY9KZcQJTH1WJCLLA==} + /@jest/test-result@29.7.0: + resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.4.3 - '@jest/types': 29.4.3 + '@jest/console': 29.7.0 + '@jest/types': 29.6.3 '@types/istanbul-lib-coverage': 2.0.3 collect-v8-coverage: 1.0.1 dev: false - /@jest/test-sequencer@29.4.3: - resolution: {integrity: sha512-yi/t2nES4GB4G0mjLc0RInCq/cNr9dNwJxcGg8sslajua5Kb4kmozAc+qPLzplhBgfw1vLItbjyHzUN92UXicw==} + /@jest/test-sequencer@29.7.0: + resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.4.3 + '@jest/test-result': 29.7.0 graceful-fs: 4.2.10 - jest-haste-map: 29.4.3 + jest-haste-map: 29.7.0 slash: 3.0.0 dev: false @@ -2931,21 +2938,21 @@ packages: - supports-color dev: false - /@jest/transform@29.4.3: - resolution: {integrity: sha512-8u0+fBGWolDshsFgPQJESkDa72da/EVwvL+II0trN2DR66wMwiQ9/CihaGfHdlLGFzbBZwMykFtxuwFdZqlKwg==} + /@jest/transform@29.7.0: + resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.20.7 - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.22 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 fast-json-stable-stringify: 2.1.0 graceful-fs: 4.2.10 - jest-haste-map: 29.4.3 - jest-regex-util: 29.4.3 - jest-util: 29.4.3 + jest-haste-map: 29.7.0 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 micromatch: 4.0.5 pirates: 4.0.5 slash: 3.0.0 @@ -2984,8 +2991,8 @@ packages: '@types/yargs': 16.0.4 chalk: 4.1.2 - /@jest/types@29.4.3: - resolution: {integrity: sha512-bPYfw8V65v17m2Od1cv44FH+SiKW7w2Xu7trhcdTLUmSv85rfKsP+qXSjO4KGJr4dtPSzl/gvslZBXctf1qGEA==} + /@jest/types@29.6.3: + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/schemas': 29.6.3 @@ -4741,12 +4748,8 @@ packages: playwright: 1.40.1 dev: false - /@polka/url@1.0.0-next.21: - resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} - /@polka/url@1.0.0-next.24: resolution: {integrity: sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==} - dev: false /@preconstruct/cli@2.8.2: resolution: {integrity: sha512-/nra7Arq622kVCfvQi4nhrZN+0m1OVq0PAuUcMLKNUR8O/JHOmesultWpeTGB17HzYEx8qYWO11QaTF7oz1yAQ==} @@ -5467,7 +5470,7 @@ packages: /@types/jest@29.2.5: resolution: {integrity: sha512-H2cSxkKgVmqNHXP7TC2L/WUorrZu8ZigyRywfVzv6EyBlxj39n4C00hjXYQWsbwqgElaj/CiAeSRmk5GoaKTgw==} dependencies: - expect: 29.4.3 + expect: 29.7.0 pretty-format: 29.7.0 dev: false @@ -5566,6 +5569,7 @@ packages: /@types/prettier@2.4.2: resolution: {integrity: sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA==} + dev: true /@types/prop-types@15.7.4: resolution: {integrity: sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==} @@ -5817,40 +5821,41 @@ packages: - supports-color dev: true - /@vitest/expect@1.1.0: - resolution: {integrity: sha512-9IE2WWkcJo2BR9eqtY5MIo3TPmS50Pnwpm66A6neb2hvk/QSLfPXBz2qdiwUOQkwyFuuXEUj5380CbwfzW4+/w==} + /@vitest/expect@1.2.2: + resolution: {integrity: sha512-3jpcdPAD7LwHUUiT2pZTj2U82I2Tcgg2oVPvKxhn6mDI2On6tfvPQTjAI4628GUGDZrCm4Zna9iQHm5cEexOAg==} dependencies: - '@vitest/spy': 1.1.0 - '@vitest/utils': 1.1.0 + '@vitest/spy': 1.2.2 + '@vitest/utils': 1.2.2 chai: 4.3.10 dev: false - /@vitest/runner@1.1.0: - resolution: {integrity: sha512-zdNLJ00pm5z/uhbWF6aeIJCGMSyTyWImy3Fcp9piRGvueERFlQFbUwCpzVce79OLm2UHk9iwaMSOaU9jVHgNVw==} + /@vitest/runner@1.2.2: + resolution: {integrity: sha512-JctG7QZ4LSDXr5CsUweFgcpEvrcxOV1Gft7uHrvkQ+fsAVylmWQvnaAr/HDp3LAH1fztGMQZugIheTWjaGzYIg==} dependencies: - '@vitest/utils': 1.1.0 + '@vitest/utils': 1.2.2 p-limit: 5.0.0 pathe: 1.1.1 dev: false - /@vitest/snapshot@1.1.0: - resolution: {integrity: sha512-5O/wyZg09V5qmNmAlUgCBqflvn2ylgsWJRRuPrnHEfDNT6tQpQ8O1isNGgo+VxofISHqz961SG3iVvt3SPK/QQ==} + /@vitest/snapshot@1.2.2: + resolution: {integrity: sha512-SmGY4saEw1+bwE1th6S/cZmPxz/Q4JWsl7LvbQIky2tKE35US4gd0Mjzqfr84/4OD0tikGWaWdMja/nWL5NIPA==} dependencies: magic-string: 0.30.5 pathe: 1.1.1 pretty-format: 29.7.0 dev: false - /@vitest/spy@1.1.0: - resolution: {integrity: sha512-sNOVSU/GE+7+P76qYo+VXdXhXffzWZcYIPQfmkiRxaNCSPiLANvQx5Mx6ZURJ/ndtEkUJEpvKLXqAYTKEY+lTg==} + /@vitest/spy@1.2.2: + resolution: {integrity: sha512-k9Gcahssw8d7X3pSLq3e3XEu/0L78mUkCjivUqCQeXJm9clfXR/Td8+AP+VC1O6fKPIDLcHDTAmBOINVuv6+7g==} dependencies: tinyspy: 2.2.0 dev: false - /@vitest/utils@1.1.0: - resolution: {integrity: sha512-z+s510fKmYz4Y41XhNs3vcuFTFhcij2YF7F8VQfMEYAAUfqQh0Zfg7+w9xdgFGhPf3tX3TicAe+8BDITk6ampQ==} + /@vitest/utils@1.2.2: + resolution: {integrity: sha512-WKITBHLsBHlpjnDQahr+XK6RE7MiAsgrIkr0pGhQ9ygoxBfUeG0lUG5iLlzqjmKSlBv3+j5EGsriBzh+C3Tq9g==} dependencies: diff-sequences: 29.6.3 + estree-walker: 3.0.3 loupe: 2.3.7 pretty-format: 29.7.0 dev: false @@ -6011,7 +6016,7 @@ packages: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} dependencies: acorn: 8.11.2 - acorn-walk: 8.3.1 + acorn-walk: 8.3.2 dev: false /acorn-import-assertions@1.9.0(acorn@8.11.2): @@ -6032,8 +6037,8 @@ packages: resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==} engines: {node: '>=0.4.0'} - /acorn-walk@8.3.1: - resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==} + /acorn-walk@8.3.2: + resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} engines: {node: '>=0.4.0'} /acorn@7.4.1: @@ -6507,17 +6512,17 @@ packages: - supports-color dev: false - /babel-jest@29.4.3(@babel/core@7.20.7): - resolution: {integrity: sha512-o45Wyn32svZE+LnMVWv/Z4x0SwtLbh4FyGcYtR20kIWd+rdrDZ9Fzq8Ml3MYLD+mZvEdzCjZsCnYZ2jpJyQ+Nw==} + /babel-jest@29.7.0(@babel/core@7.20.7): + resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: '@babel/core': 7.20.7 - '@jest/transform': 29.4.3 + '@jest/transform': 29.7.0 '@types/babel__core': 7.1.20 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.4.3(@babel/core@7.20.7) + babel-preset-jest: 29.6.3(@babel/core@7.20.7) chalk: 4.1.2 graceful-fs: 4.2.10 slash: 3.0.0 @@ -6575,8 +6580,8 @@ packages: '@types/babel__traverse': 7.14.2 dev: false - /babel-plugin-jest-hoist@29.4.3: - resolution: {integrity: sha512-mB6q2q3oahKphy5V7CpnNqZOCkxxZ9aokf1eh82Dy3jQmg4xvM1tGrh5y6BQUJh4a3Pj9+eLfwvAZ7VNKg7H8Q==} + /babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/template': 7.20.7 @@ -6649,14 +6654,14 @@ packages: babel-preset-current-node-syntax: 1.0.1(@babel/core@7.20.7) dev: false - /babel-preset-jest@29.4.3(@babel/core@7.20.7): - resolution: {integrity: sha512-gWx6COtSuma6n9bw+8/F+2PCXrIgxV/D1TJFnp6OyBK2cxPWg0K9p/sriNYeifKjpUkMViWQ09DSWtzJQRETsw==} + /babel-preset-jest@29.6.3(@babel/core@7.20.7): + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.20.7 - babel-plugin-jest-hoist: 29.4.3 + babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.20.7) dev: false @@ -7682,6 +7687,25 @@ packages: readable-stream: 3.6.0 dev: true + /create-jest@29.7.0(@types/node@20.9.5)(ts-node@10.9.1): + resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.10 + jest-config: 29.7.0(@types/node@20.9.5)(ts-node@10.9.1) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + dev: false + /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -7692,6 +7716,14 @@ packages: luxon: 3.0.4 dev: true + /cross-env@7.0.3: + resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} + engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} + hasBin: true + dependencies: + cross-spawn: 7.0.3 + dev: false + /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -7725,11 +7757,17 @@ packages: postcss: 8.4.33 dev: false - /css-loader@6.9.1(webpack@5.90.0): - resolution: {integrity: sha512-OzABOh0+26JKFdMzlK6PY1u5Zx8+Ck7CVRlcGNZoY9qwJjdfu2VWFuprTIpPW+Av5TZTVViYWcFQaEEQURLknQ==} + /css-loader@6.10.0(webpack@5.90.0): + resolution: {integrity: sha512-LTSA/jWbwdMlk+rhmElbDR2vbtQoTBPr7fkJE+mxrHj+7ru0hUmHafDRzWIjIHTwpitWVaqY2/UWGRca3yUgRw==} engines: {node: '>= 12.13.0'} peerDependencies: + '@rspack/core': 0.x || 1.x webpack: ^5.0.0 + peerDependenciesMeta: + '@rspack/core': + optional: true + webpack: + optional: true dependencies: icss-utils: 5.1.0(postcss@8.4.33) postcss: 8.4.33 @@ -8079,8 +8117,13 @@ packages: strip-dirs: 2.1.0 dev: true - /dedent@0.7.0: - resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} + /dedent@1.5.1: + resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true dev: false /deep-eql@4.1.3: @@ -8798,6 +8841,12 @@ packages: /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + /estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + dependencies: + '@types/estree': 1.0.5 + dev: false + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -8890,15 +8939,15 @@ packages: transitivePeerDependencies: - supports-color - /expect@29.4.3: - resolution: {integrity: sha512-uC05+Q7eXECFpgDrHdXA4k2rpMyStAYPItEDLyQDo5Ta7fVkJnNA/4zh/OIVkVVNZ1oOK1PipQoyNjuZ6sz6Dg==} + /expect@29.7.0: + resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/expect-utils': 29.4.3 - jest-get-type: 29.4.3 - jest-matcher-utils: 29.4.3 - jest-message-util: 29.4.3 - jest-util: 29.4.3 + '@jest/expect-utils': 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 dev: false /express-logging@1.1.1: @@ -9746,6 +9795,10 @@ packages: transitivePeerDependencies: - supports-color + /globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + dev: false + /gonzales-pe@4.3.0: resolution: {integrity: sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==} engines: {node: '>=0.6.0'} @@ -11100,6 +11153,19 @@ packages: transitivePeerDependencies: - supports-color + /istanbul-lib-instrument@6.0.1: + resolution: {integrity: sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==} + engines: {node: '>=10'} + dependencies: + '@babel/core': 7.20.7 + '@babel/parser': 7.20.7 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + dev: false + /istanbul-lib-report@3.0.0: resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} engines: {node: '>=8'} @@ -11140,43 +11206,46 @@ packages: resolution: {integrity: sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==} dev: false - /jest-changed-files@29.4.3: - resolution: {integrity: sha512-Vn5cLuWuwmi2GNNbokPOEcvrXGSGrqVnPEZV7rC6P7ck07Dyw9RFnvWglnupSh+hGys0ajGtw/bc2ZgweljQoQ==} + /jest-changed-files@29.7.0: + resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: execa: 5.1.1 + jest-util: 29.7.0 p-limit: 3.1.0 dev: false - /jest-circus@29.4.3: - resolution: {integrity: sha512-Vw/bVvcexmdJ7MLmgdT3ZjkJ3LKu8IlpefYokxiqoZy6OCQ2VAm6Vk3t/qHiAGUXbdbJKJWnc8gH3ypTbB/OBw==} + /jest-circus@29.7.0: + resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.4.3 - '@jest/expect': 29.4.3 - '@jest/test-result': 29.4.3 - '@jest/types': 29.4.3 + '@jest/environment': 29.7.0 + '@jest/expect': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 chalk: 4.1.2 co: 4.6.0 - dedent: 0.7.0 + dedent: 1.5.1 is-generator-fn: 2.1.0 - jest-each: 29.4.3 - jest-matcher-utils: 29.4.3 - jest-message-util: 29.4.3 - jest-runtime: 29.4.3 - jest-snapshot: 29.4.3 - jest-util: 29.4.3 + jest-each: 29.7.0 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 p-limit: 3.1.0 pretty-format: 29.7.0 + pure-rand: 6.0.4 slash: 3.0.0 stack-utils: 2.0.5 transitivePeerDependencies: + - babel-plugin-macros - supports-color dev: false - /jest-cli@29.4.3(@types/node@20.9.5)(ts-node@10.9.1): - resolution: {integrity: sha512-PiiAPuFNfWWolCE6t3ZrDXQc6OsAuM3/tVW0u27UWc1KE+n/HSn5dSE6B2juqN7WP+PP0jAcnKtGmI4u8GMYCg==} + /jest-cli@29.7.0(@types/node@20.9.5)(ts-node@10.9.1): + resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -11185,26 +11254,26 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.4.3(ts-node@10.9.1) - '@jest/test-result': 29.4.3 - '@jest/types': 29.4.3 + '@jest/core': 29.7.0(ts-node@10.9.1) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 chalk: 4.1.2 + create-jest: 29.7.0(@types/node@20.9.5)(ts-node@10.9.1) exit: 0.1.2 - graceful-fs: 4.2.10 import-local: 3.0.3 - jest-config: 29.4.3(@types/node@20.9.5)(ts-node@10.9.1) - jest-util: 29.4.3 - jest-validate: 29.4.3 - prompts: 2.4.2 + jest-config: 29.7.0(@types/node@20.9.5)(ts-node@10.9.1) + jest-util: 29.7.0 + jest-validate: 29.7.0 yargs: 17.7.2 transitivePeerDependencies: - '@types/node' + - babel-plugin-macros - supports-color - ts-node dev: false - /jest-config@29.4.3(@types/node@20.9.5)(ts-node@10.9.1): - resolution: {integrity: sha512-eCIpqhGnIjdUCXGtLhz4gdDoxKSWXKjzNcc5r+0S1GKOp2fwOipx5mRcwa9GB/ArsxJ1jlj2lmlD9bZAsBxaWQ==} + /jest-config@29.7.0(@types/node@20.9.5)(ts-node@10.9.1): + resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@types/node': '*' @@ -11216,58 +11285,59 @@ packages: optional: true dependencies: '@babel/core': 7.20.7 - '@jest/test-sequencer': 29.4.3 - '@jest/types': 29.4.3 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 - babel-jest: 29.4.3(@babel/core@7.20.7) + babel-jest: 29.7.0(@babel/core@7.20.7) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.2.2 glob: 7.2.0 graceful-fs: 4.2.10 - jest-circus: 29.4.3 - jest-environment-node: 29.4.3 - jest-get-type: 29.4.3 - jest-regex-util: 29.4.3 - jest-resolve: 29.4.3 - jest-runner: 29.4.3 - jest-util: 29.4.3 - jest-validate: 29.4.3 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 micromatch: 4.0.5 parse-json: 5.2.0 pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@4.9.4) + ts-node: 10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@5.3.3) transitivePeerDependencies: + - babel-plugin-macros - supports-color dev: false - /jest-diff@29.4.3: - resolution: {integrity: sha512-YB+ocenx7FZ3T5O9lMVMeLYV4265socJKtkwgk/6YUz/VsEzYDkiMuMhWzZmxm3wDRQvayJu/PjkjjSkjoHsCA==} + /jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 diff-sequences: 29.6.3 - jest-get-type: 29.4.3 + jest-get-type: 29.6.3 pretty-format: 29.7.0 dev: false - /jest-docblock@29.4.3: - resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} + /jest-docblock@29.7.0: + resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: detect-newline: 3.1.0 dev: false - /jest-each@29.4.3: - resolution: {integrity: sha512-1ElHNAnKcbJb/b+L+7j0/w7bDvljw4gTv1wL9fYOczeJrbTbkMGQ5iQPFJ3eFQH19VPTx1IyfePdqSpePKss7Q==} + /jest-each@29.7.0: + resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 chalk: 4.1.2 - jest-get-type: 29.4.3 - jest-util: 29.4.3 + jest-get-type: 29.6.3 + jest-util: 29.7.0 pretty-format: 29.7.0 dev: false @@ -11280,13 +11350,13 @@ packages: canvas: optional: true dependencies: - '@jest/environment': 29.4.3 - '@jest/fake-timers': 29.4.3 - '@jest/types': 29.4.3 + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 '@types/jsdom': 20.0.1 '@types/node': 20.9.5 - jest-mock: 29.4.3 - jest-util: 29.4.3 + jest-mock: 29.7.0 + jest-util: 29.7.0 jsdom: 20.0.3 transitivePeerDependencies: - bufferutil @@ -11294,16 +11364,16 @@ packages: - utf-8-validate dev: false - /jest-environment-node@29.4.3: - resolution: {integrity: sha512-gAiEnSKF104fsGDXNkwk49jD/0N0Bqu2K9+aMQXA6avzsA9H3Fiv1PW2D+gzbOSR705bWd2wJZRFEFpV0tXISg==} + /jest-environment-node@29.7.0: + resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.4.3 - '@jest/fake-timers': 29.4.3 - '@jest/types': 29.4.3 + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 - jest-mock: 29.4.3 - jest-util: 29.4.3 + jest-mock: 29.7.0 + jest-util: 29.7.0 dev: false /jest-get-type@25.2.6: @@ -11316,8 +11386,8 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dev: true - /jest-get-type@29.4.3: - resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==} + /jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: false @@ -11341,48 +11411,48 @@ packages: fsevents: 2.3.3 dev: false - /jest-haste-map@29.4.3: - resolution: {integrity: sha512-eZIgAS8tvm5IZMtKlR8Y+feEOMfo2pSQkmNbufdbMzMSn9nitgGxF1waM/+LbryO3OkMcKS98SUb+j/cQxp/vQ==} + /jest-haste-map@29.7.0: + resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.5 '@types/node': 20.9.5 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 - jest-regex-util: 29.4.3 - jest-util: 29.4.3 - jest-worker: 29.4.3 + jest-regex-util: 29.6.3 + jest-util: 29.7.0 + jest-worker: 29.7.0 micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 - /jest-leak-detector@29.4.3: - resolution: {integrity: sha512-9yw4VC1v2NspMMeV3daQ1yXPNxMgCzwq9BocCwYrRgXe4uaEJPAN0ZK37nFBhcy3cUwEVstFecFLaTHpF7NiGA==} + /jest-leak-detector@29.7.0: + resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 29.4.3 + jest-get-type: 29.6.3 pretty-format: 29.7.0 dev: false - /jest-matcher-utils@29.4.3: - resolution: {integrity: sha512-TTciiXEONycZ03h6R6pYiZlSkvYgT0l8aa49z/DLSGYjex4orMUcafuLXYyyEDWB1RKglq00jzwY00Ei7yFNVg==} + /jest-matcher-utils@29.7.0: + resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - jest-diff: 29.4.3 - jest-get-type: 29.4.3 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 pretty-format: 29.7.0 dev: false - /jest-message-util@29.4.3: - resolution: {integrity: sha512-1Y8Zd4ZCN7o/QnWdMmT76If8LuDv23Z1DRovBj/vcSFNlGCJGoO8D1nJDw1AdyAGUk0myDLFGN5RbNeJyCRGCw==} + /jest-message-util@29.7.0: + resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.18.6 - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.10 @@ -11392,16 +11462,16 @@ packages: stack-utils: 2.0.5 dev: false - /jest-mock@29.4.3: - resolution: {integrity: sha512-LjFgMg+xed9BdkPMyIJh+r3KeHt1klXPJYBULXVVAkbTaaKjPX1o1uVCAZADMEp/kOxGTwy/Ot8XbvgItOrHEg==} + /jest-mock@29.7.0: + resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 '@types/node': 20.9.5 - jest-util: 29.4.3 + jest-util: 29.7.0 dev: false - /jest-pnp-resolver@1.2.2(jest-resolve@29.4.3): + /jest-pnp-resolver@1.2.2(jest-resolve@29.7.0): resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} engines: {node: '>=6'} peerDependencies: @@ -11410,7 +11480,7 @@ packages: jest-resolve: optional: true dependencies: - jest-resolve: 29.4.3 + jest-resolve: 29.7.0 dev: false /jest-regex-util@27.0.6: @@ -11418,88 +11488,88 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dev: false - /jest-regex-util@29.4.3: - resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} + /jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - /jest-resolve-dependencies@29.4.3: - resolution: {integrity: sha512-uvKMZAQ3nmXLH7O8WAOhS5l0iWyT3WmnJBdmIHiV5tBbdaDZ1wqtNX04FONGoaFvSOSHBJxnwAVnSn1WHdGVaw==} + /jest-resolve-dependencies@29.7.0: + resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-regex-util: 29.4.3 - jest-snapshot: 29.4.3 + jest-regex-util: 29.6.3 + jest-snapshot: 29.7.0 transitivePeerDependencies: - supports-color dev: false - /jest-resolve@29.4.3: - resolution: {integrity: sha512-GPokE1tzguRyT7dkxBim4wSx6E45S3bOQ7ZdKEG+Qj0Oac9+6AwJPCk0TZh5Vu0xzeX4afpb+eDmgbmZFFwpOw==} + /jest-resolve@29.7.0: + resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 graceful-fs: 4.2.10 - jest-haste-map: 29.4.3 - jest-pnp-resolver: 1.2.2(jest-resolve@29.4.3) - jest-util: 29.4.3 - jest-validate: 29.4.3 + jest-haste-map: 29.7.0 + jest-pnp-resolver: 1.2.2(jest-resolve@29.7.0) + jest-util: 29.7.0 + jest-validate: 29.7.0 resolve: 1.22.8 resolve.exports: 2.0.0 slash: 3.0.0 dev: false - /jest-runner@29.4.3: - resolution: {integrity: sha512-GWPTEiGmtHZv1KKeWlTX9SIFuK19uLXlRQU43ceOQ2hIfA5yPEJC7AMkvFKpdCHx6pNEdOD+2+8zbniEi3v3gA==} + /jest-runner@29.7.0: + resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.4.3 - '@jest/environment': 29.4.3 - '@jest/test-result': 29.4.3 - '@jest/transform': 29.4.3 - '@jest/types': 29.4.3 + '@jest/console': 29.7.0 + '@jest/environment': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.10 - jest-docblock: 29.4.3 - jest-environment-node: 29.4.3 - jest-haste-map: 29.4.3 - jest-leak-detector: 29.4.3 - jest-message-util: 29.4.3 - jest-resolve: 29.4.3 - jest-runtime: 29.4.3 - jest-util: 29.4.3 - jest-watcher: 29.4.3 - jest-worker: 29.4.3 + jest-docblock: 29.7.0 + jest-environment-node: 29.7.0 + jest-haste-map: 29.7.0 + jest-leak-detector: 29.7.0 + jest-message-util: 29.7.0 + jest-resolve: 29.7.0 + jest-runtime: 29.7.0 + jest-util: 29.7.0 + jest-watcher: 29.7.0 + jest-worker: 29.7.0 p-limit: 3.1.0 source-map-support: 0.5.13 transitivePeerDependencies: - supports-color dev: false - /jest-runtime@29.4.3: - resolution: {integrity: sha512-F5bHvxSH+LvLV24vVB3L8K467dt3y3dio6V3W89dUz9nzvTpqd/HcT9zfYKL2aZPvD63vQFgLvaUX/UpUhrP6Q==} + /jest-runtime@29.7.0: + resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.4.3 - '@jest/fake-timers': 29.4.3 - '@jest/globals': 29.4.3 - '@jest/source-map': 29.4.3 - '@jest/test-result': 29.4.3 - '@jest/transform': 29.4.3 - '@jest/types': 29.4.3 + '@jest/environment': 29.7.0 + '@jest/fake-timers': 29.7.0 + '@jest/globals': 29.7.0 + '@jest/source-map': 29.6.3 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 glob: 7.2.0 graceful-fs: 4.2.10 - jest-haste-map: 29.4.3 - jest-message-util: 29.4.3 - jest-mock: 29.4.3 - jest-regex-util: 29.4.3 - jest-resolve: 29.4.3 - jest-snapshot: 29.4.3 - jest-util: 29.4.3 + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-mock: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 slash: 3.0.0 strip-bom: 4.0.0 transitivePeerDependencies: @@ -11514,31 +11584,27 @@ packages: graceful-fs: 4.2.10 dev: false - /jest-snapshot@29.4.3: - resolution: {integrity: sha512-NGlsqL0jLPDW91dz304QTM/SNO99lpcSYYAjNiX0Ou+sSGgkanKBcSjCfp/pqmiiO1nQaOyLp6XQddAzRcx3Xw==} + /jest-snapshot@29.7.0: + resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.20.7 '@babel/generator': 7.20.7 '@babel/plugin-syntax-jsx': 7.18.6(@babel/core@7.20.7) '@babel/plugin-syntax-typescript': 7.20.0(@babel/core@7.20.7) - '@babel/traverse': 7.20.10 '@babel/types': 7.20.7 - '@jest/expect-utils': 29.4.3 - '@jest/transform': 29.4.3 - '@jest/types': 29.4.3 - '@types/babel__traverse': 7.14.2 - '@types/prettier': 2.4.2 + '@jest/expect-utils': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.20.7) chalk: 4.1.2 - expect: 29.4.3 + expect: 29.7.0 graceful-fs: 4.2.10 - jest-diff: 29.4.3 - jest-get-type: 29.4.3 - jest-haste-map: 29.4.3 - jest-matcher-utils: 29.4.3 - jest-message-util: 29.4.3 - jest-util: 29.4.3 + jest-diff: 29.7.0 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.7.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 natural-compare: 1.4.0 pretty-format: 29.7.0 semver: 7.5.4 @@ -11558,11 +11624,11 @@ packages: picomatch: 2.3.1 dev: false - /jest-util@29.4.3: - resolution: {integrity: sha512-ToSGORAz4SSSoqxDSylWX8JzkOQR7zoBtNRsA7e+1WUX5F8jrOwaNpuh1YfJHJKDHXLHmObv5eOjejUd+/Ws+Q==} + /jest-util@29.7.0: + resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 '@types/node': 20.9.5 chalk: 4.1.2 ci-info: 3.9.0 @@ -11593,29 +11659,29 @@ packages: pretty-format: 27.5.1 dev: true - /jest-validate@29.4.3: - resolution: {integrity: sha512-J3u5v7aPQoXPzaar6GndAVhdQcZr/3osWSgTeKg5v574I9ybX/dTyH0AJFb5XgXIB7faVhf+rS7t4p3lL9qFaw==} + /jest-validate@29.7.0: + resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.3 + '@jest/types': 29.6.3 camelcase: 6.2.1 chalk: 4.1.2 - jest-get-type: 29.4.3 + jest-get-type: 29.6.3 leven: 3.1.0 pretty-format: 29.7.0 dev: false - /jest-watcher@29.4.3: - resolution: {integrity: sha512-zwlXH3DN3iksoIZNk73etl1HzKyi5FuQdYLnkQKm5BW4n8HpoG59xSwpVdFrnh60iRRaRBGw0gcymIxjJENPcA==} + /jest-watcher@29.7.0: + resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.4.3 - '@jest/types': 29.4.3 + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 '@types/node': 20.9.5 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 - jest-util: 29.4.3 + jest-util: 29.7.0 string-length: 4.0.2 dev: false @@ -11636,17 +11702,17 @@ packages: merge-stream: 2.0.0 supports-color: 8.1.1 - /jest-worker@29.4.3: - resolution: {integrity: sha512-GLHN/GTAAMEy5BFdvpUfzr9Dr80zQqBrh0fz1mtRMe05hqP45+HfQltu7oTBfduD0UeZs09d+maFtFYAXFWvAA==} + /jest-worker@29.7.0: + resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@types/node': 20.9.5 - jest-util: 29.4.3 + jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - /jest@29.4.3(@types/node@20.9.5)(ts-node@10.9.1): - resolution: {integrity: sha512-XvK65feuEFGZT8OO0fB/QAQS+LGHvQpaadkH5p47/j3Ocqq3xf2pK9R+G0GzgfuhXVxEv76qCOOcMb5efLk6PA==} + /jest@29.7.0(@types/node@20.9.5)(ts-node@10.9.1): + resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -11655,12 +11721,13 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.4.3(ts-node@10.9.1) - '@jest/types': 29.4.3 + '@jest/core': 29.7.0(ts-node@10.9.1) + '@jest/types': 29.6.3 import-local: 3.0.3 - jest-cli: 29.4.3(@types/node@20.9.5)(ts-node@10.9.1) + jest-cli: 29.7.0(@types/node@20.9.5)(ts-node@10.9.1) transitivePeerDependencies: - '@types/node' + - babel-plugin-macros - supports-color - ts-node dev: false @@ -14197,7 +14264,7 @@ packages: dependencies: import-cwd: 3.0.0 lilconfig: 2.1.0 - ts-node: 10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@4.9.4) + ts-node: 10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@5.3.3) yaml: 1.10.2 /postcss-merge-longhand@5.1.7(postcss@8.4.33): @@ -14717,6 +14784,10 @@ packages: escape-goat: 2.1.1 dev: true + /pure-rand@6.0.4: + resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} + dev: false + /purgecss@4.0.3: resolution: {integrity: sha512-PYOIn5ibRIP34PBU9zohUcCI09c7drPJJtTDAc0Q6QlRz2/CHQ8ywGLdE7ZhxU2VTqB7p5wkvj5Qcm05Rz3Jmw==} hasBin: true @@ -15374,7 +15445,7 @@ packages: dependencies: glob: 7.2.0 - /rollup-plugin-dts@4.2.2(rollup@2.79.1)(typescript@4.9.4): + /rollup-plugin-dts@4.2.2(rollup@2.79.1)(typescript@5.3.3): resolution: {integrity: sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==} engines: {node: '>=v12.22.11'} peerDependencies: @@ -15383,7 +15454,7 @@ packages: dependencies: magic-string: 0.26.4 rollup: 2.79.1 - typescript: 4.9.4 + typescript: 5.3.3 optionalDependencies: '@babel/code-frame': 7.18.6 dev: false @@ -15770,7 +15841,7 @@ packages: resolution: {integrity: sha512-f2AOPogZmXgJ9Ma2M22ZEhc1dNtRIzcEkiflMFeVTRq+OViOZMvH1IPMVOwrKaxpSaHioBJiDR0SluRqGa7atA==} engines: {node: '>= 10'} dependencies: - '@polka/url': 1.0.0-next.21 + '@polka/url': 1.0.0-next.24 mime: 2.6.0 totalist: 1.1.0 @@ -16661,8 +16732,8 @@ packages: resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==} dev: false - /tinypool@0.8.1: - resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==} + /tinypool@0.8.2: + resolution: {integrity: sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==} engines: {node: '>=14.0.0'} dev: false @@ -16844,7 +16915,7 @@ packages: '@tsconfig/node16': 1.0.2 '@types/node': 16.11.10 acorn: 8.11.2 - acorn-walk: 8.3.1 + acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 @@ -16854,7 +16925,7 @@ packages: yn: 3.1.1 dev: true - /ts-node@10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@4.9.4): + /ts-node@10.9.1(@swc/core@1.2.112)(@types/node@20.9.5)(typescript@5.3.3): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -16876,15 +16947,28 @@ packages: '@tsconfig/node16': 1.0.2 '@types/node': 20.9.5 acorn: 8.11.2 - acorn-walk: 8.3.1 + acorn-walk: 8.3.2 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.4 + typescript: 5.3.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + /tsconfck@3.0.1(typescript@5.3.3): + resolution: {integrity: sha512-7ppiBlF3UEddCLeI1JRx5m2Ryq+xk4JrZuq4EuYXykipebaq1dV0Fhgr1hb7CkmHt32QSgOZlcqVLEtHBG4/mg==} + engines: {node: ^18 || >=20} + hasBin: true + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + dependencies: + typescript: 5.3.3 + dev: false + /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true @@ -17022,6 +17106,12 @@ packages: resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} engines: {node: '>=4.2.0'} hasBin: true + dev: true + + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + engines: {node: '>=14.17'} + hasBin: true /typographic-apostrophes-for-possessive-plurals@1.0.5: resolution: {integrity: sha512-sBUA/sFTAFFjd/ey9Xtld1cq2fXCZJ0tQHmlDovttMC9D1WJDOt2f49b9DxA0Yk2iK3yoDFm0HQAs/mKO24sDg==} @@ -17477,27 +17567,6 @@ packages: vfile-message: 2.0.4 dev: true - /vite-node@1.1.0(@types/node@20.9.5): - resolution: {integrity: sha512-jV48DDUxGLEBdHCQvxL1mEh7+naVy+nhUUUaPAZLd3FJgXuxQiewHcfeZebbJ6onDqNGkP4r3MhQ342PRlG81Q==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - dependencies: - cac: 6.7.14 - debug: 4.3.4(supports-color@9.2.3) - pathe: 1.1.1 - picocolors: 1.0.0 - vite: 5.0.12(@types/node@20.9.5) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - dev: false - /vite-node@1.2.2(@types/node@20.9.5): resolution: {integrity: sha512-1as4rDTgVWJO3n1uHmUYqq7nsFgINQ9u+mRcXpjeOMJUmviqNKjcZB7UfRZrlM7MjYXMKpuWp5oGkjaFLnjawg==} engines: {node: ^18.0.0 || >=20.0.0} @@ -17544,6 +17613,22 @@ packages: - supports-color dev: false + /vite-tsconfig-paths@4.3.1(typescript@5.3.3): + resolution: {integrity: sha512-cfgJwcGOsIxXOLU/nELPny2/LUD/lcf1IbfyeKTv2bsupVbTH/xpFtdQlBmIP1GEK2CjjLxYhFfB+QODFAx5aw==} + peerDependencies: + vite: '*' + peerDependenciesMeta: + vite: + optional: true + dependencies: + debug: 4.3.4(supports-color@9.2.3) + globrex: 0.1.2 + tsconfck: 3.0.1(typescript@5.3.3) + transitivePeerDependencies: + - supports-color + - typescript + dev: false + /vite@5.0.12(@types/node@20.9.5): resolution: {integrity: sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==} engines: {node: ^18.0.0 || >=20.0.0} @@ -17579,8 +17664,8 @@ packages: optionalDependencies: fsevents: 2.3.3 - /vitest@1.1.0(@types/node@20.9.5): - resolution: {integrity: sha512-oDFiCrw7dd3Jf06HoMtSRARivvyjHJaTxikFxuqJjO76U436PqlVw1uLn7a8OSPrhSfMGVaRakKpA2lePdw79A==} + /vitest@1.2.2(@types/node@20.9.5): + resolution: {integrity: sha512-d5Ouvrnms3GD9USIK36KG8OZ5bEvKEkITFtnGv56HFaSlbItJuYr7hv2Lkn903+AvRAgSixiamozUVfORUekjw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -17605,12 +17690,12 @@ packages: optional: true dependencies: '@types/node': 20.9.5 - '@vitest/expect': 1.1.0 - '@vitest/runner': 1.1.0 - '@vitest/snapshot': 1.1.0 - '@vitest/spy': 1.1.0 - '@vitest/utils': 1.1.0 - acorn-walk: 8.3.1 + '@vitest/expect': 1.2.2 + '@vitest/runner': 1.2.2 + '@vitest/snapshot': 1.2.2 + '@vitest/spy': 1.2.2 + '@vitest/utils': 1.2.2 + acorn-walk: 8.3.2 cac: 6.7.14 chai: 4.3.10 debug: 4.3.4(supports-color@9.2.3) @@ -17622,9 +17707,9 @@ packages: std-env: 3.7.0 strip-literal: 1.3.0 tinybench: 2.5.1 - tinypool: 0.8.1 + tinypool: 0.8.2 vite: 5.0.12(@types/node@20.9.5) - vite-node: 1.1.0(@types/node@20.9.5) + vite-node: 1.2.2(@types/node@20.9.5) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -17704,7 +17789,7 @@ packages: hasBin: true dependencies: acorn: 8.11.2 - acorn-walk: 8.3.1 + acorn-walk: 8.3.2 chalk: 4.1.2 commander: 7.2.0 gzip-size: 6.0.0 diff --git a/tests/compiler/compiler.test.ts b/tests/compiler/compiler.test.ts new file mode 100644 index 00000000..1cd70474 --- /dev/null +++ b/tests/compiler/compiler.test.ts @@ -0,0 +1,449 @@ +import path from 'path'; +import { createCompiler, normalizePath } from '@vanilla-extract/integration'; +import tsconfigPaths from 'vite-tsconfig-paths'; + +expect.addSnapshotSerializer({ + test: (val) => typeof val === 'string', + print: (val) => + (val as string).replaceAll(normalizePath(__dirname), '{{__dirname}}'), +}); + +function getLocalFiles(files: Set) { + const posixDirname = normalizePath(__dirname); + + return [...files] + .map(normalizePath) + .filter((file) => file.startsWith(posixDirname)); +} + +describe('compiler', () => { + let compilers: Record< + | 'default' + | 'cssImportSpecifier' + | 'shortIdentifiers' + | 'viteResolve' + | 'vitePlugins' + | 'tsconfigPaths', + ReturnType + >; + + beforeAll(async () => { + compilers = { + default: createCompiler({ + root: __dirname, + }), + cssImportSpecifier: createCompiler({ + root: __dirname, + cssImportSpecifier: (filePath) => filePath + '.custom-extension.css', + }), + shortIdentifiers: createCompiler({ + root: __dirname, + identifiers: 'short', + }), + viteResolve: createCompiler({ + root: __dirname, + viteResolve: { + alias: { + '@util': path.resolve(__dirname, 'fixtures/vite-config/util'), + }, + }, + }), + vitePlugins: createCompiler({ + root: __dirname, + vitePlugins: [ + { + name: 'test-plugin', + resolveId(id) { + if (id === '~/vars') { + return '\0resolved-vars'; + } + }, + load: (id) => { + if (id === '\0resolved-vars') { + return `export const color = "green"`; + } + }, + }, + ], + }), + tsconfigPaths: createCompiler({ + root: __dirname, + vitePlugins: [tsconfigPaths()], + }), + }; + }); + + afterAll(async () => { + await Promise.allSettled( + Object.values(compilers).map((compiler) => compiler.close()), + ); + }); + + test('absolute paths', async () => { + const compiler = compilers.default; + + const cssPath = path.join( + __dirname, + 'fixtures/class-composition/styles.css.ts', + ); + const sharedCssPath = path.join( + __dirname, + 'fixtures/class-composition/shared.css.ts', + ); + + const output = await compiler.processVanillaFile(cssPath); + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/class-composition/shared.css.ts.vanilla.css'; + import '{{__dirname}}/fixtures/class-composition/styles.css.ts.vanilla.css'; + export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920'; + `); + + const localWatchFiles = getLocalFiles(output.watchFiles); + expect(localWatchFiles).toMatchInlineSnapshot(` + [ + {{__dirname}}/fixtures/class-composition/styles.css.ts, + {{__dirname}}/fixtures/class-composition/shared.css.ts, + ] + `); + + { + const { css, filePath } = compiler.getCssForFile(cssPath); + expect(css).toMatchInlineSnapshot(` + .styles_className__q7x3ow0 { + color: red; + } + `); + expect(normalizePath(filePath)).toMatchInlineSnapshot( + `{{__dirname}}/fixtures/class-composition/styles.css.ts`, + ); + } + + { + const { css, filePath } = compiler.getCssForFile(sharedCssPath); + expect(css).toMatchInlineSnapshot(` + .shared_shared__16bmd920 { + background: blue; + } + `); + expect(normalizePath(filePath)).toMatchInlineSnapshot( + `{{__dirname}}/fixtures/class-composition/shared.css.ts`, + ); + } + }); + + test('root relative paths', async () => { + const compiler = compilers.default; + + const cssPath = 'fixtures/class-composition/styles.css.ts'; + const sharedCssPath = 'fixtures/class-composition/shared.css.ts'; + + const output = await compiler.processVanillaFile(cssPath); + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/class-composition/shared.css.ts.vanilla.css'; + import '{{__dirname}}/fixtures/class-composition/styles.css.ts.vanilla.css'; + export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920'; + `); + + const localWatchFiles = getLocalFiles(output.watchFiles); + expect(localWatchFiles).toMatchInlineSnapshot(` + [ + {{__dirname}}/fixtures/class-composition/styles.css.ts, + {{__dirname}}/fixtures/class-composition/shared.css.ts, + ] + `); + + { + const { css, filePath } = compiler.getCssForFile(cssPath); + expect(css).toMatchInlineSnapshot(` + .styles_className__q7x3ow0 { + color: red; + } + `); + expect(normalizePath(filePath)).toMatchInlineSnapshot( + `{{__dirname}}/fixtures/class-composition/styles.css.ts`, + ); + } + + { + const { css, filePath } = compiler.getCssForFile(sharedCssPath); + expect(css).toMatchInlineSnapshot(` + .shared_shared__16bmd920 { + background: blue; + } + `); + expect(normalizePath(filePath)).toMatchInlineSnapshot( + `{{__dirname}}/fixtures/class-composition/shared.css.ts`, + ); + } + }); + + test('root relative paths starting with dot', async () => { + const compiler = compilers.default; + + const cssPath = './fixtures/class-composition/styles.css.ts'; + const sharedCssPath = './fixtures/class-composition/shared.css.ts'; + + const output = await compiler.processVanillaFile(cssPath); + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/class-composition/shared.css.ts.vanilla.css'; + import '{{__dirname}}/fixtures/class-composition/styles.css.ts.vanilla.css'; + export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920'; + `); + + const localWatchFiles = getLocalFiles(output.watchFiles); + expect(localWatchFiles).toMatchInlineSnapshot(` + [ + {{__dirname}}/fixtures/class-composition/styles.css.ts, + {{__dirname}}/fixtures/class-composition/shared.css.ts, + ] + `); + + { + const { css, filePath } = compiler.getCssForFile(cssPath); + expect(css).toMatchInlineSnapshot(` + .styles_className__q7x3ow0 { + color: red; + } + `); + expect(normalizePath(filePath)).toMatchInlineSnapshot( + `{{__dirname}}/fixtures/class-composition/styles.css.ts`, + ); + } + + { + const { css, filePath } = compiler.getCssForFile(sharedCssPath); + expect(css).toMatchInlineSnapshot(` + .shared_shared__16bmd920 { + background: blue; + } + `); + expect(normalizePath(filePath)).toMatchInlineSnapshot( + `{{__dirname}}/fixtures/class-composition/shared.css.ts`, + ); + } + }); + + test('throws on getCssForFile when file does not exist', async () => { + const compiler = compilers.default; + let error: Error; + + try { + compiler.getCssForFile('does-not-exist.css.ts'); + } catch (_error) { + error = _error as Error; + } + + expect( + // We know `error.message` is defined here + normalizePath(error!.message), + ).toMatchInlineSnapshot( + `No CSS for file: {{__dirname}}/does-not-exist.css.ts`, + ); + }); + + test('short identifiers', async () => { + const compiler = compilers.shortIdentifiers; + + const cssPath = path.join( + __dirname, + 'fixtures/class-composition/styles.css.ts', + ); + const output = await compiler.processVanillaFile(cssPath); + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/class-composition/shared.css.ts.vanilla.css'; + import '{{__dirname}}/fixtures/class-composition/styles.css.ts.vanilla.css'; + export var className = 'q7x3ow0 _16bmd920'; + `); + const { css } = compiler.getCssForFile(cssPath); + expect(css).toMatchInlineSnapshot(` + .q7x3ow0 { + color: red; + } + `); + }); + + test('custom cssImportSpecifier', async () => { + const compiler = compilers.cssImportSpecifier; + + const cssPath = path.join( + __dirname, + 'fixtures/class-composition/styles.css.ts', + ); + const output = await compiler.processVanillaFile(cssPath); + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/class-composition/shared.css.ts.custom-extension.css'; + import '{{__dirname}}/fixtures/class-composition/styles.css.ts.custom-extension.css'; + export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920'; + `); + }); + + test('does not remove unused composition classes', async () => { + const compiler = compilers.default; + + const cssPathA = './fixtures/unused-compositions/styles_a.css.ts'; + const cssPathB = './fixtures/unused-compositions/styles_b.css.ts'; + const sharedCssPath = './fixtures/unused-compositions/shared.css.ts'; + + // Process the file multiple times with different args to test caching + await compiler.processVanillaFile(cssPathA, { outputCss: false }); + const outputA = await compiler.processVanillaFile(cssPathA); + + // The `root` className string should be a composition of multiple classes: + expect(outputA.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/unused-compositions/shared.css.ts.vanilla.css'; + export var root = 'styles_a_root__mh4uy80 shared_shared__5i7sy00'; + `); + + // Process the file multiple times with different args to test caching + await compiler.processVanillaFile(cssPathB, { outputCss: false }); + const outputB = await compiler.processVanillaFile(cssPathB); + + // The `root` className string should be a composition of multiple classes: + expect(outputB.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/unused-compositions/shared.css.ts.vanilla.css'; + export var root = 'styles_b_root__1k6843p0 shared_shared__5i7sy00'; + `); + + const { css } = compiler.getCssForFile(sharedCssPath); + expect(css).toMatchInlineSnapshot(` + .shared_shared__5i7sy00 { + padding: 20px; + background: peachpuff; + } + `); + }); + + test('getter selector', async () => { + const compiler = compilers.default; + + const cssPath = path.join(__dirname, 'fixtures/selectors/getter.css.ts'); + const output = await compiler.processVanillaFile(cssPath); + const { css } = compiler.getCssForFile(cssPath); + + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/selectors/getter.css.ts.vanilla.css'; + export var child = 'getter_child__ux95kn0'; + export var parent = 'getter_parent__ux95kn1'; + `); + + expect(css).toMatchInlineSnapshot(` + .getter_child__ux95kn0 { + background: blue; + } + .getter_parent__ux95kn1 .getter_child__ux95kn0 { + color: red; + } + .getter_parent__ux95kn1 { + background: yellow; + } + .getter_parent__ux95kn1:has(.getter_child__ux95kn0) { + padding: 10px; + } + `); + }); + + test('recipes class names', async () => { + const compiler = compilers.default; + + const cssPath = path.join( + __dirname, + 'fixtures/recipes/recipeClassNames.css.ts', + ); + const output = await compiler.processVanillaFile(cssPath); + const { css } = compiler.getCssForFile(cssPath); + + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/recipes/recipeClassNames.css.ts.vanilla.css'; + import { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn'; + export var recipeWithReferences = _7a468({defaultClassName:'recipeClassNames_recipeWithReferences__129pj258',variantClassNames:{first:{true:'recipeClassNames_recipeWithReferences_first_true__129pj259'}},defaultVariants:{},compoundVariants:[]}); + `); + + expect(css).toMatchInlineSnapshot(` + .recipeClassNames_basic_rounded_true__129pj257 { + border-radius: 999px; + } + .recipeClassNames_recipeWithReferences__129pj258 { + color: red; + } + .recipeClassNames__129pj250 .recipeClassNames_recipeWithReferences__129pj258 { + color: blue; + } + .recipeClassNames_basic_spaceWithDefault_large__129pj252 .recipeClassNames_recipeWithReferences__129pj258 { + color: yellow; + } + .recipeClassNames_basic_spaceWithoutDefault_small__129pj253 .recipeClassNames_recipeWithReferences__129pj258 { + color: green; + } + .recipeClassNames_basic_color_red__129pj255 .recipeClassNames_recipeWithReferences_first_true__129pj259 { + color: black; + } + .recipeClassNames_basic_spaceWithDefault_large__129pj252.recipeClassNames_basic_rounded_true__129pj257 .recipeClassNames_recipeWithReferences_first_true__129pj259 { + color: white; + } + `); + }); + + test('Vite resolve', async () => { + const compiler = compilers.viteResolve; + + const cssPath = path.join(__dirname, 'fixtures/vite-config/alias.css.ts'); + const output = await compiler.processVanillaFile(cssPath); + const { css } = compiler.getCssForFile(cssPath); + + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/vite-config/util/vars.css.ts.vanilla.css'; + import '{{__dirname}}/fixtures/vite-config/alias.css.ts.vanilla.css'; + export var root = 'alias_root__ez4dr20'; + `); + + expect(css).toMatchInlineSnapshot(` + .alias_root__ez4dr20 { + --border__13z1r1g0: 1px solid black; + border: var(--border__13z1r1g0); + } + `); + }); + + test('Vite plugins', async () => { + const compiler = compilers.vitePlugins; + + const cssPath = path.join(__dirname, 'fixtures/vite-config/plugin.css.ts'); + const output = await compiler.processVanillaFile(cssPath); + const { css } = compiler.getCssForFile(cssPath); + + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/vite-config/plugin.css.ts.vanilla.css'; + export var root = 'plugin_root__1e902gk0'; + `); + + expect(css).toMatchInlineSnapshot(` + .plugin_root__1e902gk0 { + color: green; + } + `); + }); + + test('vite-tsconfig-paths', async () => { + const compiler = compilers.tsconfigPaths; + + const cssPath = path.join( + __dirname, + 'fixtures/tsconfig-paths/src/main.css.ts', + ); + const output = await compiler.processVanillaFile(cssPath); + const { css } = compiler.getCssForFile(cssPath); + + expect(output.source).toMatchInlineSnapshot(` + import '{{__dirname}}/fixtures/tsconfig-paths/src/main.css.ts.vanilla.css'; + export var box = 'main_box__1tm7bbb0'; + `); + + expect(css).toMatchInlineSnapshot(` + .main_box__1tm7bbb0 { + box-sizing: border-box; + margin: 0; + padding: 0; + } + `); + }); +}); diff --git a/tests/compiler/compiler.vitest.test.ts b/tests/compiler/compiler.vitest.test.ts index 3de0d327..a8529fdd 100644 --- a/tests/compiler/compiler.vitest.test.ts +++ b/tests/compiler/compiler.vitest.test.ts @@ -2,22 +2,24 @@ import path from 'path'; import { describe, beforeAll, afterAll, test, expect } from 'vitest'; import { createCompiler, normalizePath } from '@vanilla-extract/integration'; -function getLocalFiles(files: Set) { - const posixDirname = normalizePath(__dirname); - - return [...files] - .map(normalizePath) - .filter((file) => file.startsWith(posixDirname)) - .map((file) => file.replace(posixDirname, '')); -} +// Vitest has trouble with snapshots that don't contain wrapping quotes. See this regex and the functions above/below it: +// https://github.com/vitest-dev/vitest/blob/ae73f2737607a878ba589d548aa6f8ba639dc07c/packages/snapshot/src/port/inlineSnapshot.ts#L96 +// We want to replace __dirname in strings, so we need to add a snapshot serializer for strings. +// But we also need to add quotes around the string to make sure Vitest doesn't get confused. +// In fact, just updating the snapshot from now on will mangle the test file ¯\_(ツ)_/¯ +expect.addSnapshotSerializer({ + test: (val) => typeof val === 'string', + print: (val) => + '"' + + (val as string).replaceAll(normalizePath(__dirname), '{{__dirname}}') + + '"', +}); -describe('compiler', () => { +// ! These tests are to ensure that the compiler works correctly in Vitest. +// ! Please add tests to `compiler.test.ts` going forward. +describe('compiler running in Vitest', () => { let compilers: Record< - | 'default' - | 'cssImportSpecifier' - | 'shortIdentifiers' - | 'vitePlugins' - | 'viteResolve', + 'default' | 'vitePlugins' | 'viteResolve', ReturnType >; @@ -26,14 +28,6 @@ describe('compiler', () => { default: createCompiler({ root: __dirname, }), - cssImportSpecifier: createCompiler({ - root: __dirname, - cssImportSpecifier: (filePath) => filePath + '.custom-extension.css', - }), - shortIdentifiers: createCompiler({ - root: __dirname, - identifiers: 'short', - }), vitePlugins: createCompiler({ root: __dirname, vitePlugins: [ @@ -69,318 +63,40 @@ describe('compiler', () => { ); }); - test('absolute paths', async () => { + test('with no plugins', async () => { const compiler = compilers.default; const cssPath = path.join( __dirname, 'fixtures/class-composition/styles.css.ts', ); - const sharedCssPath = path.join( - __dirname, - 'fixtures/class-composition/shared.css.ts', - ); - - const output = await compiler.processVanillaFile(cssPath); - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/class-composition/shared.css.ts.vanilla.css'; - import 'fixtures/class-composition/styles.css.ts.vanilla.css'; - export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920';" - `); - const localWatchFiles = getLocalFiles(output.watchFiles); - expect(localWatchFiles).toMatchInlineSnapshot(` - [ - "/fixtures/class-composition/styles.css.ts", - "/fixtures/class-composition/shared.css.ts", - ] - `); - - await (async () => { - const { css, filePath } = compiler.getCssForFile(cssPath); - expect(css).toMatchInlineSnapshot(` - ".styles_className__q7x3ow0 { - color: red; - }" - `); - expect(normalizePath(filePath)).toBe( - 'fixtures/class-composition/styles.css.ts', - ); - })(); - await (async () => { - const { css, filePath } = compiler.getCssForFile(sharedCssPath); - expect(css).toMatchInlineSnapshot(` - ".shared_shared__16bmd920 { - background: blue; - }" - `); - expect(normalizePath(filePath)).toBe( - 'fixtures/class-composition/shared.css.ts', - ); - })(); - }); - - test('root relative paths', async () => { - const compiler = compilers.default; - - const cssPath = 'fixtures/class-composition/styles.css.ts'; - const sharedCssPath = 'fixtures/class-composition/shared.css.ts'; - - const output = await compiler.processVanillaFile(cssPath); - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/class-composition/shared.css.ts.vanilla.css'; - import 'fixtures/class-composition/styles.css.ts.vanilla.css'; - export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920';" - `); - - const localWatchFiles = getLocalFiles(output.watchFiles); - expect(localWatchFiles).toMatchInlineSnapshot(` - [ - "/fixtures/class-composition/styles.css.ts", - "/fixtures/class-composition/shared.css.ts", - ] - `); - - await (async () => { - const { css, filePath } = compiler.getCssForFile(cssPath); - expect(css).toMatchInlineSnapshot(` - ".styles_className__q7x3ow0 { - color: red; - }" - `); - expect(normalizePath(filePath)).toBe( - 'fixtures/class-composition/styles.css.ts', - ); - })(); - - await (async () => { - const { css, filePath } = compiler.getCssForFile(sharedCssPath); - expect(css).toMatchInlineSnapshot(` - ".shared_shared__16bmd920 { - background: blue; - }" - `); - expect(normalizePath(filePath)).toBe( - 'fixtures/class-composition/shared.css.ts', - ); - })(); - }); - - test('root relative paths starting with dot', async () => { - const compiler = compilers.default; - - const cssPath = './fixtures/class-composition/styles.css.ts'; - const sharedCssPath = './fixtures/class-composition/shared.css.ts'; - - const output = await compiler.processVanillaFile(cssPath); - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/class-composition/shared.css.ts.vanilla.css'; - import 'fixtures/class-composition/styles.css.ts.vanilla.css'; - export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920';" - `); - - const localWatchFiles = getLocalFiles(output.watchFiles); - expect(localWatchFiles).toMatchInlineSnapshot(` - [ - "/fixtures/class-composition/styles.css.ts", - "/fixtures/class-composition/shared.css.ts", - ] - `); - - await (async () => { - const { css, filePath } = compiler.getCssForFile(cssPath); - expect(css).toMatchInlineSnapshot(` - ".styles_className__q7x3ow0 { - color: red; - }" - `); - expect(normalizePath(filePath)).toBe( - 'fixtures/class-composition/styles.css.ts', - ); - })(); - - await (async () => { - const { css, filePath } = compiler.getCssForFile(sharedCssPath); - expect(css).toMatchInlineSnapshot(` - ".shared_shared__16bmd920 { - background: blue; - }" - `); - expect(normalizePath(filePath)).toBe( - 'fixtures/class-composition/shared.css.ts', - ); - })(); - }); - - test('throws on getCssForFile when file does not exist', async () => { - const compiler = compilers.default; - let error: Error | undefined; - - try { - compiler.getCssForFile('does-not-exist.css.ts'); - } catch (_error) { - error = _error as Error; - } - - expect( - // We know `error.message` is defined, and we want make the snapshot consistent across machines - normalizePath(error!.message!.replace(__dirname, '{{__dirname}}')), - ).toMatchInlineSnapshot( - `"No CSS for file: {{__dirname}}/does-not-exist.css.ts"`, - ); - }); - - test('short identifiers', async () => { - const compiler = compilers.shortIdentifiers; - - const cssPath = path.join( - __dirname, - 'fixtures/class-composition/styles.css.ts', - ); - const output = await compiler.processVanillaFile(cssPath); - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/class-composition/shared.css.ts.vanilla.css'; - import 'fixtures/class-composition/styles.css.ts.vanilla.css'; - export var className = 'q7x3ow0 _16bmd920';" - `); + const { source } = await compiler.processVanillaFile(cssPath); const { css } = compiler.getCssForFile(cssPath); - expect(css).toMatchInlineSnapshot(` - ".q7x3ow0 { - color: red; - }" - `); - }); - - test('custom cssImportSpecifier', async () => { - const compiler = compilers.cssImportSpecifier; - const cssPath = path.join( - __dirname, - 'fixtures/class-composition/styles.css.ts', - ); - const output = await compiler.processVanillaFile(cssPath); - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/class-composition/shared.css.ts.custom-extension.css'; - import 'fixtures/class-composition/styles.css.ts.custom-extension.css'; + expect(source).toMatchInlineSnapshot(` + "import '{{__dirname}}/fixtures/class-composition/shared.css.ts.vanilla.css'; + import '{{__dirname}}/fixtures/class-composition/styles.css.ts.vanilla.css'; export var className = 'styles_className__q7x3ow0 shared_shared__16bmd920';" `); - }); - - test('does not remove unused composition classes', async () => { - const compiler = compilers.default; - const cssPathA = './fixtures/unused-compositions/styles_a.css.ts'; - const cssPathB = './fixtures/unused-compositions/styles_b.css.ts'; - const sharedCssPath = './fixtures/unused-compositions/shared.css.ts'; - - // Process the file multiple times with different args to test caching - await compiler.processVanillaFile(cssPathA, { outputCss: false }); - const outputA = await compiler.processVanillaFile(cssPathA); - - // The `root` className string should be a composition of multiple classes: - expect(outputA.source).toMatchInlineSnapshot(` - "import 'fixtures/unused-compositions/shared.css.ts.vanilla.css'; - export var root = 'styles_a_root__mh4uy80 shared_shared__5i7sy00';" - `); - - // Process the file multiple times with different args to test caching - await compiler.processVanillaFile(cssPathB, { outputCss: false }); - const outputB = await compiler.processVanillaFile(cssPathB); - - // The `root` className string should be a composition of multiple classes: - expect(outputB.source).toMatchInlineSnapshot(` - "import 'fixtures/unused-compositions/shared.css.ts.vanilla.css'; - export var root = 'styles_b_root__1k6843p0 shared_shared__5i7sy00';" - `); - - const { css } = compiler.getCssForFile(sharedCssPath); expect(css).toMatchInlineSnapshot(` - ".shared_shared__5i7sy00 { - padding: 20px; - background: peachpuff; - }" - `); - }); - - test('getter selector', async () => { - const compiler = compilers.default; - - const cssPath = path.join(__dirname, 'fixtures/selectors/getter.css.ts'); - const output = await compiler.processVanillaFile(cssPath); - const { css } = compiler.getCssForFile(cssPath); - - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/selectors/getter.css.ts.vanilla.css'; - export var child = 'getter_child__ux95kn0'; - export var parent = 'getter_parent__ux95kn1';" - `); - - expect(css).toMatchInlineSnapshot(` - ".getter_child__ux95kn0 { - background: blue; - } - .getter_parent__ux95kn1 .getter_child__ux95kn0 { - color: red; - } - .getter_parent__ux95kn1 { - background: yellow; - } - .getter_parent__ux95kn1:has(.getter_child__ux95kn0) { - padding: 10px; - }" - `); - }); - - test('recipes class names', async () => { - const compiler = compilers.default; - - const cssPath = path.join( - __dirname, - 'fixtures/recipes/recipeClassNames.css.ts', - ); - const output = await compiler.processVanillaFile(cssPath); - const { css } = compiler.getCssForFile(cssPath); - - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/recipes/recipeClassNames.css.ts.vanilla.css'; - import { createRuntimeFn as _7a468 } from '@vanilla-extract/recipes/createRuntimeFn'; - export var recipeWithReferences = _7a468({defaultClassName:'recipeClassNames_recipeWithReferences__129pj258',variantClassNames:{first:{true:'recipeClassNames_recipeWithReferences_first_true__129pj259'}},defaultVariants:{},compoundVariants:[]});" - `); - - expect(css).toMatchInlineSnapshot(` - ".recipeClassNames_basic_rounded_true__129pj257 { - border-radius: 999px; - } - .recipeClassNames_recipeWithReferences__129pj258 { + ".styles_className__q7x3ow0 { color: red; - } - .recipeClassNames__129pj250 .recipeClassNames_recipeWithReferences__129pj258 { - color: blue; - } - .recipeClassNames_basic_spaceWithDefault_large__129pj252 .recipeClassNames_recipeWithReferences__129pj258 { - color: yellow; - } - .recipeClassNames_basic_spaceWithoutDefault_small__129pj253 .recipeClassNames_recipeWithReferences__129pj258 { - color: green; - } - .recipeClassNames_basic_color_red__129pj255 .recipeClassNames_recipeWithReferences_first_true__129pj259 { - color: black; - } - .recipeClassNames_basic_spaceWithDefault_large__129pj252.recipeClassNames_basic_rounded_true__129pj257 .recipeClassNames_recipeWithReferences_first_true__129pj259 { - color: white; }" `); }); - test('Vite plugins', async () => { + test('with Vite plugins', async () => { const compiler = compilers.vitePlugins; const cssPath = path.join(__dirname, 'fixtures/vite-config/plugin.css.ts'); - const output = await compiler.processVanillaFile(cssPath); + + const { source } = await compiler.processVanillaFile(cssPath); const { css } = compiler.getCssForFile(cssPath); - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/vite-config/plugin.css.ts.vanilla.css'; + expect(source).toMatchInlineSnapshot(` + "import '{{__dirname}}/fixtures/vite-config/plugin.css.ts.vanilla.css'; export var root = 'plugin_root__1e902gk0';" `); @@ -391,16 +107,17 @@ describe('compiler', () => { `); }); - test('Vite resolve', async () => { + test('with Vite resolve', async () => { const compiler = compilers.viteResolve; const cssPath = path.join(__dirname, 'fixtures/vite-config/alias.css.ts'); - const output = await compiler.processVanillaFile(cssPath); + + const { source } = await compiler.processVanillaFile(cssPath); const { css } = compiler.getCssForFile(cssPath); - expect(output.source).toMatchInlineSnapshot(` - "import 'fixtures/vite-config/util/vars.css.ts.vanilla.css'; - import 'fixtures/vite-config/alias.css.ts.vanilla.css'; + expect(source).toMatchInlineSnapshot(` + "import '{{__dirname}}/fixtures/vite-config/util/vars.css.ts.vanilla.css'; + import '{{__dirname}}/fixtures/vite-config/alias.css.ts.vanilla.css'; export var root = 'alias_root__ez4dr20';" `); diff --git a/tests/compiler/fixtures/tsconfig-paths/src/main.css.ts b/tests/compiler/fixtures/tsconfig-paths/src/main.css.ts new file mode 100644 index 00000000..016d1cdd --- /dev/null +++ b/tests/compiler/fixtures/tsconfig-paths/src/main.css.ts @@ -0,0 +1,7 @@ +import { style } from '@vanilla-extract/css'; + +export const box = style({ + boxSizing: 'border-box', + margin: 0, + padding: 0, +}); diff --git a/tests/compiler/fixtures/tsconfig-paths/src/main.tsx b/tests/compiler/fixtures/tsconfig-paths/src/main.tsx new file mode 100644 index 00000000..3f304bd1 --- /dev/null +++ b/tests/compiler/fixtures/tsconfig-paths/src/main.tsx @@ -0,0 +1,5 @@ +import { box } from 'main.css'; + +document.getElementById('root')!.innerHTML = ` +
hello world
+`; diff --git a/tests/compiler/fixtures/tsconfig-paths/tsconfig.json b/tests/compiler/fixtures/tsconfig-paths/tsconfig.json new file mode 100644 index 00000000..0de0d4d7 --- /dev/null +++ b/tests/compiler/fixtures/tsconfig-paths/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "isolatedModules": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "baseUrl": "./src" + } +} diff --git a/tests/package.json b/tests/package.json index 58e7688b..82906365 100644 --- a/tests/package.json +++ b/tests/package.json @@ -13,6 +13,7 @@ "@vanilla-extract/dynamic": "*", "@vanilla-extract/integration": "*", "@vanilla-extract/recipes": "*", - "@vanilla-extract/sprinkles": "*" + "@vanilla-extract/sprinkles": "*", + "vite-tsconfig-paths": "^4.3.1" } } diff --git a/tests/sprinkles/sprinkles-type-tests.ts b/tests/sprinkles/sprinkles-type-tests.ts index f7fe450d..386d0c99 100644 --- a/tests/sprinkles/sprinkles-type-tests.ts +++ b/tests/sprinkles/sprinkles-type-tests.ts @@ -214,15 +214,8 @@ const noop = (...args: Array) => {}; responsiveValue = ['NOPE']; // @ts-expect-error responsiveValue = [123]; - responsiveValue = [ - 'row', - 'row', - 'row', - // @ts-expect-error - 'your', - // @ts-expect-error - 'boat', - ]; + // @ts-expect-error + responsiveValue = ['row', 'row', 'row', 'your', 'boat']; // @ts-expect-error responsiveValue = { mobile: 'nope' }; // @ts-expect-error diff --git a/tsconfig.json b/tsconfig.json index a3a82483..04f590d3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,11 @@ "isolatedModules": true, "downlevelIteration": true }, - "exclude": ["node_modules", "**/dist/**"], + "exclude": [ + "node_modules", + "**/dist/**", + "tests/compiler/fixtures/tsconfig-paths/**" + ], "include": [ "@types/testing-library__jest-dom", "./jest.setup.ts",