├── examples └── styled-components │ ├── next.config.js │ ├── next-env.d.ts │ ├── babel.config.js │ ├── pages │ ├── gradient │ │ ├── index.page.tsx │ │ └── text-gradient.ts │ └── index.page.tsx │ ├── tsconfig.json │ └── package.json ├── docs ├── public │ └── static │ │ └── favicon.png ├── .babelrc ├── next.config.js ├── next-env.d.ts ├── .linariarc ├── tsconfig.json ├── package.json ├── build.js └── pages │ ├── CodeExample.tsx │ ├── Theme.tsx │ └── index.page.tsx ├── babel.config.cjs ├── swc ├── transform │ ├── tests │ │ └── __swc_snapshots__ │ │ │ └── src │ │ │ └── lib.rs │ │ │ ├── ignores_unknwon_modules.js │ │ │ ├── adds_variable_name.js │ │ │ ├── adds_variable_name_for_renamed.js │ │ │ ├── adds_variable_name_with_value.js │ │ │ ├── adds_camel_case_variable_name_with_display_name.js │ │ │ ├── adds_multiple_variable_names.js │ │ │ └── adds_variable_name_with_display_name.js │ ├── Cargo.toml │ ├── src │ │ ├── hash.rs │ │ └── lib.rs │ └── benches │ │ ├── nested.js │ │ ├── styledPage.tsx │ │ └── bench_main.rs ├── Cargo.toml ├── package.json ├── swc-plugin-css-variable │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── README.md └── Cargo.lock ├── jest.config.cjs ├── test ├── fixtures │ ├── renamed.js │ ├── createVar.js │ └── CSSVariable.js ├── package.json ├── swc │ ├── swc.test.js │ └── jest.config.js ├── without-babel.test.js ├── babel.test.js ├── examples.js └── __snapshots__ │ └── babel.test.js.snap ├── .gitignore ├── babel.commonjs.cjs ├── .github └── workflows │ ├── e2e-test.yml │ ├── docs.yml │ └── swc.yml ├── README.md ├── license ├── babel ├── hash.cjs └── index.cjs ├── package.json ├── CHANGELOG.md ├── src └── index.ts └── tsconfig.json /examples/styled-components/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pageExtensions: ["page.tsx"], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/public/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jantimon/css-variable/HEAD/docs/public/static/favicon.png -------------------------------------------------------------------------------- /babel.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "presets": ["@babel/preset-typescript"], 3 | "plugins": [ 4 | ] 5 | } -------------------------------------------------------------------------------- /swc/transform/tests/__swc_snapshots__/src/lib.rs/ignores_unknwon_modules.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "unknown"; 2 | createVar(); 3 | -------------------------------------------------------------------------------- /swc/transform/tests/__swc_snapshots__/src/lib.rs/adds_variable_name.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "css-variable"; 2 | createVar("hashed0"); 3 | -------------------------------------------------------------------------------- /docs/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "next/babel", 4 | "linaria/babel" 5 | ], 6 | "plugins": [ 7 | "css-variable/babel" 8 | ] 9 | } -------------------------------------------------------------------------------- /swc/transform/tests/__swc_snapshots__/src/lib.rs/adds_variable_name_for_renamed.js: -------------------------------------------------------------------------------- 1 | import { createVar as create } from "css-variable"; 2 | create("hashed0", "hello world"); 3 | -------------------------------------------------------------------------------- /jest.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "testPathIgnorePatterns" : [ 3 | // don't run swc tests during babel jest runs 4 | "/test/swc/*.*" 5 | ] 6 | }; -------------------------------------------------------------------------------- /swc/transform/tests/__swc_snapshots__/src/lib.rs/adds_variable_name_with_value.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "css-variable"; 2 | createVar("hashed0", { 3 | value: '0px' 4 | }); 5 | -------------------------------------------------------------------------------- /test/fixtures/renamed.js: -------------------------------------------------------------------------------- 1 | import { CSSVariable as CSSVar, createVar as createVariable } from "css-variable"; 2 | 3 | const primary = new CSSVar(); 4 | const secondary = createVariable(); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .next 3 | .swc 4 | .linaria-cache 5 | dist 6 | target 7 | package-lock.json 8 | yarn.lock 9 | pnpm-lock.yaml 10 | yarn-error.log 11 | out 12 | *.tgz 13 | -------------------------------------------------------------------------------- /swc/transform/tests/__swc_snapshots__/src/lib.rs/adds_camel_case_variable_name_with_display_name.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "css-variable"; 2 | const camelCase = createVar("camelCase--hashed0"); 3 | -------------------------------------------------------------------------------- /swc/transform/tests/__swc_snapshots__/src/lib.rs/adds_multiple_variable_names.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "css-variable"; 2 | createVar("hashed0"); 3 | createVar("hashed1"); 4 | createVar("hashed2"); 5 | -------------------------------------------------------------------------------- /docs/next.config.js: -------------------------------------------------------------------------------- 1 | const withLinaria = require('next-linaria'); 2 | 3 | module.exports = withLinaria({ 4 | pageExtensions: ['page.tsx'], 5 | webpack(config, options) { 6 | return config; 7 | }, 8 | }); -------------------------------------------------------------------------------- /docs/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /docs/.linariarc: -------------------------------------------------------------------------------- 1 | { 2 | babelOptions: { 3 | "presets": [ 4 | "next/babel", 5 | "linaria/babel" 6 | ], 7 | "plugins": [ 8 | "css-variable/babel" 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "test": "node ./examples.js" 7 | }, 8 | "dependencies": { 9 | "puppeteer": "^24.14.0", 10 | "rimraf": "3.0.2" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /babel.commonjs.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "presets": ["@babel/preset-typescript"], 3 | "plugins": [ 4 | ["@babel/plugin-transform-modules-commonjs", { 5 | "allowTopLevelThis": false, 6 | "importInterop": "none" 7 | }] 8 | ] 9 | } -------------------------------------------------------------------------------- /examples/styled-components/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | import "./.next/types/routes.d.ts"; 4 | 5 | // NOTE: This file should not be edited 6 | // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. 7 | -------------------------------------------------------------------------------- /examples/styled-components/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function (api) { 2 | api.cache(true); 3 | return { 4 | presets: ["next/babel"], 5 | plugins: [ 6 | ["css-variable/babel", { async: false }], 7 | ["babel-plugin-styled-components", { ssr: true }], 8 | ], 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /swc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["swc-plugin-css-variable", "transform"] 3 | resolver = "2" 4 | 5 | [profile.release] 6 | # This profile results in small binary size with acceptable impact on 7 | # performance, but there may well be further optimizations to be had. 8 | strip = "debuginfo" 9 | codegen-units = 1 10 | lto = true 11 | opt-level = "z" 12 | -------------------------------------------------------------------------------- /swc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "swc-plugin-css-variable", 3 | "version": "0.1.0", 4 | "description": "", 5 | "author": "", 6 | "license": "MIT", 7 | "keywords": [ 8 | "swc-plugin" 9 | ], 10 | "main": "target/wasm32-wasip1/release/swc_plugin_css_variable.wasm", 11 | "scripts": { 12 | "prepublishOnly": "cargo build --release" 13 | }, 14 | "files": [] 15 | } 16 | -------------------------------------------------------------------------------- /swc/transform/tests/__swc_snapshots__/src/lib.rs/adds_variable_name_with_display_name.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "css-variable"; 2 | const primary = createVar("primary--hashed0"); 3 | const theme = { 4 | colors: { 5 | primary: createVar("primary--colors--theme--hashed1"), 6 | secondary: { 7 | inner: createVar("inner--secondary--colors--theme--hashed2"), 8 | }, 9 | }, 10 | }; 11 | -------------------------------------------------------------------------------- /test/fixtures/createVar.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "css-variable"; 2 | 3 | const primary = createVar(); 4 | const secondary = createVar({ value: '#fff' }); 5 | 6 | const theme = { 7 | colors: { 8 | primary: createVar() 9 | } 10 | }; 11 | 12 | const generated = allColors.map((color) => createVar(color)); 13 | 14 | const generatedWithFallback = allColors.map((color) => createVar(color, { value: '#000' })); 15 | -------------------------------------------------------------------------------- /test/fixtures/CSSVariable.js: -------------------------------------------------------------------------------- 1 | import { CSSVariable } from "css-variable"; 2 | 3 | const primary = new CSSVariable(); 4 | const secondary = new CSSVariable({ value: '#fff' }); 5 | 6 | const theme = { 7 | colors: { 8 | primary: new CSSVariable() 9 | } 10 | }; 11 | 12 | const generated = allColors.map((color) => new CSSVariable(color)); 13 | 14 | const generatedWithFallback = allColors.map((color) => new CSSVariable(color, { value: '#000' })); 15 | -------------------------------------------------------------------------------- /swc/swc-plugin-css-variable/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "swc-plugin-css-variable" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | # cdylib is for dynamic system library and necessary to produce the Wasm plugin 8 | crate-type = ["cdylib"] 9 | 10 | [dependencies] 11 | lazy_static = "1.4.0" 12 | pathdiff = "0.2.1" 13 | regex = "1.10.3" 14 | serde_json = "1.0.111" 15 | swc_core = { version = "45.0.2", features = ["ecma_plugin_transform"] } 16 | 17 | transform = { path = "../transform" } 18 | -------------------------------------------------------------------------------- /test/swc/swc.test.js: -------------------------------------------------------------------------------- 1 | import {createVar} from "css-variable"; 2 | 3 | describe("createVar", () => { 4 | it("generates a variable name with swc plugin", () => { 5 | const foo = createVar(); 6 | const bar = createVar(); 7 | const baz = createVar(); 8 | expect(foo.name).toMatchInlineSnapshot(`"--foo--2hzhhy0"`); 9 | expect(bar.name).toMatchInlineSnapshot( `"--bar--2hzhhy1"`); 10 | expect(baz.name).toMatchInlineSnapshot( `"--baz--2hzhhy2"`); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/styled-components/pages/gradient/index.page.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | import { 3 | gradientEndColor, 4 | gradientHover, 5 | gradientStartColor, 6 | } from "./text-gradient"; 7 | 8 | const Link = styled.a` 9 | font-family: Arial, Helvetica, sans-serif; 10 | font-size: 20px; 11 | ${gradientStartColor.toStyle("#5610a5")}; 12 | ${gradientEndColor.toStyle("#2286ad")}; 13 | ${gradientHover}; 14 | `; 15 | 16 | const Page = () => Click me; 17 | 18 | export default Page; 19 | -------------------------------------------------------------------------------- /swc/transform/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "transform" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | base62 = "2.0.2" 8 | serde = { version = "1.0.195", features = ["derive"] } 9 | swc_core = "45.0.2" 10 | xxhash-rust = { version = "0.8.8", features = ["xxh32"] } 11 | 12 | [dev-dependencies] 13 | criterion = { version = "0.5.1", default-features = false } 14 | swc_core = { version = "45.0.2", features = ["ecma_parser", "ecma_plugin_transform"] } 15 | 16 | [[bench]] 17 | name = "bench_main" 18 | harness = false 19 | -------------------------------------------------------------------------------- /test/without-babel.test.js: -------------------------------------------------------------------------------- 1 | const {createVar} = require("../"); 2 | 3 | describe("createVar", () => { 4 | it("generates a variable name automatically", () => { 5 | const foo = createVar(); 6 | const bar = createVar(); 7 | const baz = createVar(); 8 | expect(foo.name).toMatch("--17179149"); 9 | expect(bar.name).toMatch("--1717914a"); 10 | expect(baz.name).toMatch("--1717914b"); 11 | }); 12 | 13 | it("allows to define a fallback variable", () => { 14 | const foo = createVar({value: "red"}); 15 | expect(foo.val).toMatch("var(--1717914c, red)"); 16 | }); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "strict": false, 12 | "forceConsistentCasingInFileNames": true, 13 | "noEmit": true, 14 | "esModuleInterop": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "jsx": "preserve", 20 | "incremental": true 21 | }, 22 | "include": [ 23 | "next-env.d.ts", 24 | "**/*.ts", 25 | "**/*.tsx" 26 | ], 27 | "exclude": [ 28 | "node_modules" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/e2e-test.yml: -------------------------------------------------------------------------------- 1 | name: e2e test 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | strategy: 10 | matrix: 11 | node-version: [20] 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | - name: Use Node.js ${{ matrix.node-version }} 16 | uses: actions/setup-node@v4 17 | with: 18 | node-version: ${{ matrix.node-version }} 19 | - run: npm install 20 | - run: npm run build 21 | - run: npm test 22 | env: 23 | CI: true 24 | NODE_OPTIONS: --openssl-legacy-provider 25 | PUPPETEER_ARGS: --no-sandbox 26 | - run: npx bundlesize -f dist/index.min.mjs 27 | -------------------------------------------------------------------------------- /test/swc/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rootDir: __dirname, 3 | moduleNameMapper: { 4 | "css-variable$": "../../", 5 | }, 6 | transform: { 7 | "^.+\\.(t|j)sx?$": [ 8 | "@swc/jest", 9 | { 10 | jsc: { 11 | experimental: { 12 | plugins: [ 13 | [ 14 | require.resolve( 15 | "../../swc/target/wasm32-wasip1/release/swc_plugin_css_variable.wasm" 16 | ), 17 | { 18 | basePath: __dirname, 19 | displayName: true, 20 | }, 21 | ], 22 | ], 23 | }, 24 | }, 25 | }, 26 | ], 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /examples/styled-components/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "strict": false, 12 | "forceConsistentCasingInFileNames": true, 13 | "noEmit": true, 14 | "esModuleInterop": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "jsx": "react-jsx", 20 | "incremental": true 21 | }, 22 | "include": [ 23 | "next-env.d.ts", 24 | "**/*.ts", 25 | "**/*.tsx" 26 | ], 27 | "exclude": [ 28 | "node_modules" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /examples/styled-components/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@example/styled-components", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "@types/react": "17.0.20", 12 | "@types/react-dom": "17.0.9", 13 | "@types/styled-components": "5.1.14", 14 | "babel-plugin-styled-components": "^1.13.2", 15 | "css-variable": "file:../../", 16 | "next": "^16.0.1", 17 | "react": "^18.2.0", 18 | "react-dom": "^18.2.0", 19 | "styled-components": "^6.1.11", 20 | "typescript": "5.4.5" 21 | }, 22 | "devDependencies": { 23 | "@types/node": "24.0.14" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "export": "next export" 10 | }, 11 | "dependencies": { 12 | "@babel/core": "7.15.5", 13 | "@babel/preset-env": "^7.15.4", 14 | "classnames": "2.3.1", 15 | "css-variable": "file:../", 16 | "linaria": "2.1.0", 17 | "next": "12.2.3", 18 | "next-linaria": "0.11.0", 19 | "react": "18.2.0", 20 | "react-dom": "18.2.0", 21 | "react-syntax-highlighter": "^15.4.4", 22 | "typescript": "^4.4.3" 23 | }, 24 | "devDependencies": { 25 | "@types/react": "^18.0.15", 26 | "@types/react-dom": "^18.0.6" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /swc/transform/src/hash.rs: -------------------------------------------------------------------------------- 1 | use xxhash_rust::xxh32::xxh32; 2 | 3 | /// Creates a CSS identifier using xxHash (https://cyan4973.github.io/xxHash/). 4 | /// Shortened to base62 (https://en.wikipedia.org/wiki/Base62) to avoid invalid characters. 5 | pub fn hash(data: &str) -> String { 6 | let hash = xxh32(data.as_bytes(), 0); 7 | base62::encode(hash) 8 | } 9 | 10 | #[cfg(test)] 11 | mod tests { 12 | use super::*; 13 | 14 | #[test] 15 | fn short() { 16 | assert_eq!(hash("hey"), "2Hy69D"); 17 | } 18 | 19 | #[test] 20 | fn longer() { 21 | assert_eq!(hash("hey how are you doing?"), "34D1Ek"); 22 | } 23 | 24 | #[test] 25 | fn longest() { 26 | assert_eq!( 27 | hash("hey how are you doing? I am doing fine, thanks for asking."), 28 | "1XQ5hm" 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - "docs/**" 9 | - ".github/workflows/docs.yml" 10 | 11 | jobs: 12 | deploy: 13 | runs-on: ubuntu-latest 14 | 15 | strategy: 16 | matrix: 17 | node-version: [20] 18 | 19 | steps: 20 | - uses: actions/checkout@v4 21 | - name: Use Node.js ${{ matrix.node-version }} 22 | uses: actions/setup-node@v4 23 | with: 24 | node-version: ${{ matrix.node-version }} 25 | - name: RustUp 26 | run: rustup target add wasm32-wasip1 27 | - run: npm install 28 | - run: (cd docs && npm install) 29 | - run: npm run prepublishOnly 30 | env: 31 | CI: true 32 | - run: npm run docs 33 | - name: Deploy 34 | uses: peaceiris/actions-gh-pages@v3 35 | with: 36 | github_token: ${{ secrets.GITHUB_TOKEN }} 37 | publish_dir: ./docs/out 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # css-variable 2 | 3 | [![npm](https://img.shields.io/npm/v/css-variable)](npmjs.com/package/css-variable) [![e2e test](https://github.com/jantimon/css-variable/actions/workflows/e2e-test.yml/badge.svg)](https://github.com/jantimon/css-variable/actions/workflows/e2e-test.yml) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/css-variable) ![npm type definitions](https://img.shields.io/npm/types/css-variable) ![NPM](https://img.shields.io/npm/l/css-variable) 4 | 5 | Tiny ( ~0.3 kb ) treeshakable library to define CSS custom properties (variables) in JS. 6 | Compatible with 👩‍🎤 Emotion / 💅 StyledComponents / Linaria and similar CSS-in-JS solutions. 7 | 8 | ## Install 9 | 10 | ```bash 11 | npm i css-variable 12 | ``` 13 | 14 | ## Docs 15 | 16 | [http://css-variable.js.org](http://css-variable.js.org) 17 | 18 | 19 | ## License 20 | 21 | Licensed under MIT 22 | Crafted with <3 [@jantimon](https://twitter.com/jantimon) 23 | 24 | Special thanks to [@4alpine](https://twitter.com/4lpine) for donating the package name. -------------------------------------------------------------------------------- /docs/build.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | /* 3 | * This script generates a static export for the docs 4 | */ 5 | const fs = require("fs"); 6 | const child_process = require("child_process"); 7 | 8 | async function run () { 9 | await spawnAsync("npm", ["install"], { cwd: __dirname, stdio: "inherit" }).promise; 10 | await spawnAsync("npm", ["run", "build"], { cwd: __dirname, stdio: "inherit" }).promise; 11 | await spawnAsync("npm", ["run", "export"], { cwd: __dirname, stdio: "inherit" }).promise; 12 | // CNAME for js.org 13 | fs.writeFileSync(__dirname + '/out/CNAME', 'css-variable.js.org'); 14 | } 15 | 16 | run(); 17 | function spawnAsync(command, args, options) { 18 | const child = child_process.spawn(command, args, options); 19 | return {child, promise: new Promise((resolve, reject) => { 20 | child.on("close", (code) => { 21 | if (code) { 22 | reject(new Error(`${command} failed - exit code: ${code}`)); 23 | } else { 24 | resolve(); 25 | } 26 | }); 27 | })}; 28 | } 29 | -------------------------------------------------------------------------------- /examples/styled-components/pages/gradient/text-gradient.ts: -------------------------------------------------------------------------------- 1 | import { createVar, CSSHexColor } from "css-variable"; 2 | import { css } from "styled-components"; 3 | 4 | export const fontColor = createVar({value: "currentColor"}); 5 | /** The linear gradient start color during hover */ 6 | export const gradientStartColor = createVar(); 7 | /** The linear gradient end color during hover */ 8 | export const gradientEndColor = createVar(); 9 | 10 | export const gradientHover = css` 11 | color: ${fontColor.val}; 12 | background: linear-gradient(to right, ${gradientStartColor.val}, ${gradientEndColor.val}); 13 | background-size: 200% 200%; 14 | animation: rainbow 2s ease-in-out infinite; 15 | background-clip: text; 16 | -webkit-background-clip:text; 17 | transition: color .2s ease-in-out; 18 | } 19 | :focus, 20 | :hover{ 21 | color:rgba(0,0,0,0); 22 | } 23 | @keyframes rainbow { 24 | 0%{background-position:left} 25 | 50%{background-position:right} 26 | 100%{background-position:left} 27 | } 28 | `; 29 | 30 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Jan Nicklas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /swc/transform/benches/nested.js: -------------------------------------------------------------------------------- 1 | import { createVar } from "css-variable"; 2 | 3 | export const tokens = { 4 | one: { 5 | two: { 6 | three: { 7 | four: { 8 | five: { 9 | six: { 10 | seven: { 11 | eight: { 12 | nine: { 13 | ten: { 14 | eleven: { 15 | twelve: { 16 | thirteen: { 17 | fourteen: { 18 | fifteen: { 19 | sixteen: { 20 | seventeen: { 21 | eighteen: { 22 | nineteen: { 23 | twenty: createVar(), 24 | }, 25 | }, 26 | }, 27 | }, 28 | }, 29 | }, 30 | }, 31 | }, 32 | }, 33 | }, 34 | }, 35 | }, 36 | }, 37 | }, 38 | }, 39 | }, 40 | }, 41 | }, 42 | }, 43 | }; 44 | -------------------------------------------------------------------------------- /swc/transform/benches/styledPage.tsx: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | import { CSSPixelValue, createVar, createGlobalTheme } from "css-variable"; 3 | import { styled } from "linaria/react"; 4 | 5 | const theme = { 6 | fontSize: createVar(), 7 | spacings: { 8 | s: createVar(), 9 | m: createVar(), 10 | l: createVar(), 11 | }, 12 | colors: { 13 | primary: createVar(), 14 | secondary: createVar(), 15 | }, 16 | }; 17 | 18 | const ThemeA = styled.div` 19 | ${createGlobalTheme("", theme, { 20 | fontSize: "12px", 21 | spacings: { 22 | s: "10px", 23 | m: "20px", 24 | l: "30px", 25 | }, 26 | colors: { 27 | primary: "#6290C3", 28 | secondary: "#C2E7DA", 29 | }, 30 | })} 31 | `; 32 | 33 | const ThemeB = styled.div` 34 | ${createGlobalTheme("", theme, { 35 | fontSize: "24px", 36 | spacings: { 37 | s: "20px", 38 | m: "40px", 39 | l: "60px", 40 | }, 41 | colors: { 42 | primary: "#7C9EB2", 43 | secondary: "#52528C", 44 | }, 45 | })} 46 | `; 47 | 48 | const colorVar = createVar({ value: theme.colors.primary }); 49 | const xVar = createVar({ value: "0" }); 50 | 51 | const StyledHeadline = styled.h1` 52 | font-family: Arial, Helvetica, sans-serif; 53 | font-size: ${theme.fontSize.val}; 54 | color: ${colorVar.val}; 55 | transform: translateX(${xVar.val}); 56 | width: calc(100% - 1 * ${xVar.val}); 57 | `; 58 | -------------------------------------------------------------------------------- /babel/hash.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * JS Implementation of MurmurHash2 3 | * 4 | * @author Gary Court 5 | * @see http://github.com/garycourt/murmurhash-js 6 | * @author Austin Appleby 7 | * @see http://sites.google.com/site/murmurhash/ 8 | * 9 | * @param {string} str ASCII only 10 | * @return {string} Base 36 encoded hash result 11 | */ 12 | function murmurhash2_32_gc(str) { 13 | let l = str.length 14 | let h = l 15 | let i = 0 16 | let k 17 | 18 | while (l >= 4) { 19 | k = 20 | (str.charCodeAt(i) & 0xff) | 21 | ((str.charCodeAt(++i) & 0xff) << 8) | 22 | ((str.charCodeAt(++i) & 0xff) << 16) | 23 | ((str.charCodeAt(++i) & 0xff) << 24) 24 | 25 | k = (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16) 26 | k ^= k >>> 24 27 | k = (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16) 28 | 29 | h = 30 | ((h & 0xffff) * 0x5bd1e995 + 31 | ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ 32 | k 33 | 34 | l -= 4 35 | ++i 36 | } // forgive existing code 37 | 38 | /* eslint-disable no-fallthrough */ switch (l) { 39 | case 3: 40 | h ^= (str.charCodeAt(i + 2) & 0xff) << 16 41 | case 2: 42 | h ^= (str.charCodeAt(i + 1) & 0xff) << 8 43 | case 1: 44 | h ^= str.charCodeAt(i) & 0xff 45 | h = 46 | (h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16) 47 | } 48 | /* eslint-enable no-fallthrough */ 49 | 50 | h ^= h >>> 13 51 | h = (h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16) 52 | h ^= h >>> 15 53 | 54 | return (h >>> 0).toString(36) 55 | } 56 | 57 | module.exports = murmurhash2_32_gc; -------------------------------------------------------------------------------- /.github/workflows/swc.yml: -------------------------------------------------------------------------------- 1 | name: SWC validation 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | rust: 14 | name: Rust tests & lints 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout sources 18 | uses: actions/checkout@v4 19 | - name: Install stable toolchain 20 | uses: dtolnay/rust-toolchain@stable 21 | - name: Enable caching 22 | uses: Swatinem/rust-cache@v2 23 | with: 24 | workspaces: swc 25 | - name: Run cargo check 26 | run: cargo check --manifest-path swc/Cargo.toml 27 | - name: Run cargo test 28 | run: cargo test --manifest-path swc/Cargo.toml 29 | - name: Run cargo fmt 30 | run: cargo fmt --manifest-path swc/Cargo.toml --all -- --check 31 | - name: Run cargo clippy 32 | run: cargo clippy --manifest-path swc/Cargo.toml -- -D warnings 33 | 34 | wasm: 35 | name: Wasm plugin tests 36 | strategy: 37 | fail-fast: false 38 | matrix: 39 | os: [ubuntu-latest, windows-latest] 40 | runs-on: ${{ matrix.os }} 41 | steps: 42 | - name: Checkout sources 43 | uses: actions/checkout@v4 44 | - name: Add wasm32-wasip1 target 45 | run: rustup target add wasm32-wasip1 46 | - name: Enable caching 47 | uses: Swatinem/rust-cache@v2 48 | with: 49 | workspaces: swc 50 | - name: Use Node.js 20 51 | uses: actions/setup-node@v4 52 | with: 53 | node-version: 20 54 | - name: Install NPM dependencies 55 | run: npm i 56 | - name: Build JS 57 | run: npm run build 58 | - name: Build SWC plugin 59 | run: npm run build:swc 60 | - name: Run tests 61 | run: npm run test:swc:jest 62 | -------------------------------------------------------------------------------- /swc/README.md: -------------------------------------------------------------------------------- 1 | # swc-plugin-css-variable 2 | 3 | This is the SWC counterpart to the babel plugin of this library. 4 | 5 | ## Structure 6 | 7 | This is a workspace with two crates: 8 | 9 | - `swc-plugin-css-variable` is the outer shell and only contains what's 10 | necessary to interface with SWC, which is essentially the main function that 11 | is decorated with `#[plugin_transform]` 12 | - `transform` has everything else, most importantly the visitor implementation 13 | 14 | The reason for the split is to enable benchmarking inside Wasm runtimes. If the 15 | code under test (the visitor) were in the same crate as `#[plugin_transform]`, 16 | code would be generated that requires functions to be linked in for accessing 17 | the environment and emitting diagnostics. Normally these are provided at 18 | runtime by SWC, but for only running benchmarks we don't want to have to 19 | fake them. 20 | 21 | ## Benchmarking 22 | 23 | The benchmarks can be run easily with `cargo bench`. Note that this builds and 24 | runs native code on your machine, which may not exhibit the exact same 25 | performance characteristics as a Wasm module in a runtime, as is the case for 26 | SWC transformations. 27 | 28 | To account for this, it's also possible to build a benchmark executable in Wasm 29 | format and execute it in your runtime of choice. Since SWC internally uses 30 | [Wasmer](https://wasmer.io), it makes sense to install this one. Then, it's 31 | just a matter of 32 | 33 | ```console 34 | $ cargo build --bench bench_main --release --target wasm32-wasip1 35 | # Get the name of the Wasm module we just built 36 | $ ls -t target/wasm32-wasip1/release/deps/*.wasm | head -n 1 37 | target/wasm32-wasip1/release/deps/bench_main-9530540cc15e2e67.wasm 38 | # Execute the benchmark 39 | $ wasmer target/wasm32-wasip1/release/deps/bench_main-9530540cc15e2e67.wasm -- --bench 40 | ``` 41 | 42 | With this you get the most accurate runtime behavior and can observe the 43 | difference to native code. However, you'll most likely find it negligible, with 44 | Wasm being just slightly slower and everything else scaling mostly linearly. A 45 | typical example: 46 | 47 | - `wasmer: visitor styledPage time: [6.6177 µs 6.6316 µs 6.6495 µs]` 48 | - `native: visitor styledPage time: [5.4191 µs 5.4736 µs 5.5150 µs]` 49 | 50 | For most changes that aren't Wasm-specific, it's therefore often good enough to 51 | just run the benchmarks normally with `cargo bench`. 52 | -------------------------------------------------------------------------------- /examples/styled-components/pages/index.page.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | import { CSSPixelValue, createVar, createGlobalTheme } from "css-variable"; 3 | 4 | const theme = { 5 | fontSize: createVar("FontSize"), 6 | spacings: { 7 | s: createVar(), 8 | m: createVar(), 9 | l: createVar(), 10 | }, 11 | colors: { 12 | primary: createVar("primary"), 13 | secondary: createVar("secondary"), 14 | }, 15 | }; 16 | 17 | const ThemeA = styled.div` 18 | ${createGlobalTheme("", theme, { 19 | fontSize: "12px", 20 | spacings: { 21 | s: "10px", 22 | m: "20px", 23 | l: "30px", 24 | }, 25 | colors: { 26 | primary: "#6290C3", 27 | secondary: "#C2E7DA", 28 | }, 29 | })} 30 | `; 31 | 32 | const ThemeB = styled.div` 33 | ${createGlobalTheme("", theme, { 34 | fontSize: "24px", 35 | spacings: { 36 | s: "20px", 37 | m: "40px", 38 | l: "60px", 39 | }, 40 | colors: { 41 | primary: "#7C9EB2", 42 | secondary: "#52528C", 43 | }, 44 | })} 45 | `; 46 | 47 | const colorVar = createVar({ value: theme.colors.primary }); 48 | const xVar = createVar({ value: "0" }); 49 | 50 | const StyledHeadline = styled.h1` 51 | font-family: Arial, Helvetica, sans-serif; 52 | font-size: ${theme.fontSize.val}; 53 | color: ${colorVar.val}; 54 | transform: translateX(${xVar.val}); 55 | width: calc(100% - 1 * ${xVar.val}); 56 | `; 57 | 58 | const FancyComponent: React.FunctionComponent<{color?:string}> = ({ color, children }) => { 59 | return ( 60 | 61 | {children} 62 | 63 | ); 64 | }; 65 | 66 | const BigBox = styled.div` 67 | background: ${theme.colors.secondary.val}; 68 | padding: ${theme.spacings.m.val}; 69 | 70 | ${colorVar.toStyle("grey")} 71 | ${xVar.toStyle('20px')} 72 | 73 | @media (min-width: 500px) { 74 | ${xVar.toStyle('250px')}; 75 | } 76 | `; 77 | 78 | const Demo = () => ( 79 | <> 80 | Demo 81 |
82 | xOffset 83 |
84 | 85 | Inside Box 86 | 87 | 88 | ); 89 | 90 | const Index = () => ( 91 | <> 92 | 93 | 94 | 95 |
96 |
97 | 98 | 99 | 100 | 101 | ); 102 | 103 | export default Index; 104 | -------------------------------------------------------------------------------- /docs/pages/CodeExample.tsx: -------------------------------------------------------------------------------- 1 | import { css } from "linaria"; 2 | import { styled } from "linaria/react"; 3 | import classnames from "classnames"; 4 | import { useState } from "react"; 5 | import SyntaxHighlighter from "react-syntax-highlighter"; 6 | import dark from "react-syntax-highlighter/dist/cjs/styles/hljs/a11y-dark"; 7 | 8 | const codeExampleStyles = css` 9 | margin: 0 auto; 10 | width: 100%; 11 | max-width: 600px; 12 | min-height: 50px; 13 | box-shadow: rgb(20 20 20 / 27%) 0.555556px 0.555556px 11.1111px; 14 | // Overrule react-syntax-highlighter style 15 | padding: 10px 20px !important; 16 | `; 17 | 18 | /** @param {{children, className?: string}} props */ 19 | export const CodeExample = ({ children, className }) => ( 20 | 25 | {children} 26 | 27 | ); 28 | 29 | const CodeExampleWrapper = styled.div` 30 | display: grid; 31 | max-width: 600px; 32 | margin: 0 auto; 33 | width: 100%; 34 | `; 35 | 36 | const gridOverlay = css` 37 | grid-column-start: 1; 38 | grid-column-end: 1; 39 | grid-row-start: 2; 40 | grid-row-end: 2; 41 | `; 42 | const invisble = css` 43 | opacity: 0; 44 | pointer-events: none; 45 | ` 46 | 47 | const CodeButtonWrapper = styled.div` 48 | grid-column-start: 1; 49 | grid-column-end: 1; 50 | grid-row-start: 1; 51 | grid-row-end: 1; 52 | justify-self: end; 53 | white-space: nowrap; 54 | margin-top: -5px; 55 | `; 56 | 57 | const MultiCodeButton = styled.button<{active?: boolean}>` 58 | background: #2b2b2b; 59 | transition: color 300ms; 60 | color: ${(props) => props.active ? 'rgba(230,230,230, 1)' : 'rgba(230,230,230, 0.7)'}; 61 | &:hover { 62 | color: rgba(230,230,230, 1); 63 | } 64 | position: relative; 65 | top: 5px; 66 | border: 0; 67 | margin: 0; 68 | padding: 5px 20px; 69 | cursor: pointer; 70 | & + & { 71 | box-shadow: -8px 0px 1px -7px white; 72 | } 73 | ` 74 | 75 | export const CodeExamples = ({ children }: {children: Record}) => { 76 | const keys = Object.keys(children); 77 | const [activeKey, setActiveKeys] = useState(keys[0]); 78 | return 79 | 80 | {keys.length > 1 && keys.map((key) => ( 81 | setActiveKeys(key)}>{key} 82 | ))} 83 | 84 | { 85 | keys.map((key) => ( 86 | {children[key]} 87 | )) 88 | } 89 | 90 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "css-variable", 3 | "version": "8.0.0", 4 | "description": "define CSS custom properties (variables) in JS", 5 | "main": "./dist/index.cjs", 6 | "module": "./dist/index.mjs", 7 | "type": "module", 8 | "exports": { 9 | ".": { 10 | "types": "./dist/index.d.ts", 11 | "import": "./dist/index.mjs", 12 | "require": "./dist/index.cjs" 13 | }, 14 | "./babel": "./babel/index.cjs", 15 | "./swc": "./swc/target/wasm32-wasip1/release/swc_plugin_css_variable.wasm" 16 | }, 17 | "types": "./dist/index.d.ts", 18 | "files": [ 19 | "src", 20 | "dist", 21 | "babel", 22 | "swc/package.json", 23 | "swc/target/wasm32-wasip1/release/swc_plugin_css_variable.wasm" 24 | ], 25 | "sideEffects": false, 26 | "scripts": { 27 | "prepublishOnly": "npm run build && npm run build:swc", 28 | "build": "npm run build:types && npm run build:commonjs && npm run build:module && npm run build:modulemin", 29 | "build:commonjs": "babel --config-file=./babel.commonjs.cjs -o dist/index.cjs src/index.ts", 30 | "build:module": "babel --config-file=./babel.config.cjs -o dist/index.mjs src/index.ts", 31 | "build:types": "tsc --skipLibCheck --emitDeclarationOnly --declaration --target ESNext --outDir dist src/index.ts", 32 | "build:modulemin": "terser ./dist/index.mjs -o ./dist/index.min.mjs -m --ecma 2017 --module --toplevel -b -c", 33 | "build:swc": "cargo build --manifest-path ./swc/Cargo.toml --release --target=wasm32-wasip1", 34 | "changelog": "npx standard-version", 35 | "test": "npm run test:e2e && npm run test:jest", 36 | "test:e2e": "node ./test/examples.js", 37 | "test:jest": "jest", 38 | "test:swc": "npm run test:swc:cargo && npm run build:swc && npm run test:swc:jest", 39 | "test:swc:jest": "jest --config test/swc/jest.config.js", 40 | "test:swc:cargo": "cargo test --manifest-path ./swc/Cargo.toml", 41 | "docs": "node ./docs/build.js" 42 | }, 43 | "repository": { 44 | "type": "git", 45 | "url": "git+https://github.com/jantimon/css-variable.git" 46 | }, 47 | "release": { 48 | "branches": [ 49 | "main" 50 | ] 51 | }, 52 | "keywords": [ 53 | "css" 54 | ], 55 | "author": "Jan Nicklas", 56 | "license": "MIT", 57 | "bugs": { 58 | "url": "https://github.com/jantimon/css-variable/issues" 59 | }, 60 | "homepage": "https://css-variable.js.org/", 61 | "devDependencies": { 62 | "@babel/cli": "7.19.3", 63 | "@babel/core": "7.22.0", 64 | "@babel/plugin-transform-modules-commonjs": "^7.19.6", 65 | "@babel/preset-typescript": "^7.18.6", 66 | "@babel/runtime": "^7.20.1", 67 | "@babel/types": "^7.22.0", 68 | "@swc/core": "1.12.1", 69 | "@swc/jest": "^0.2.37", 70 | "@types/jest": "^29.2.3", 71 | "jest": "^29.3.1", 72 | "terser": "5.15.1", 73 | "typescript": "^5.4.5" 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /docs/pages/Theme.tsx: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | import { createVar, createGlobalTheme } from "css-variable"; 3 | import { css } from "linaria"; 4 | import { styled } from "linaria/react"; 5 | 6 | export const theme = { 7 | fontSize: createVar("FontSize"), 8 | spacings: { 9 | s: createVar(), 10 | m: createVar(), 11 | l: createVar(), 12 | }, 13 | colors: { 14 | base: createVar("base"), 15 | primary: createVar("primary"), 16 | secondary: createVar("secondary"), 17 | backgroundPrimary: createVar(), 18 | backgroundSecondary: createVar(), 19 | }, 20 | }; 21 | 22 | export const Font = css` 23 | :global { 24 | @import url("https://fonts.googleapis.com/css?family=Noto%20Sans"); 25 | body { 26 | font-family: "Noto Sans"; 27 | } 28 | } 29 | `; 30 | 31 | export const Base = css` 32 | :global { 33 | * { box-sizing: inherit } 34 | body { 35 | min-width: min-content; 36 | margin: 0; 37 | padding: 0; 38 | background: ${theme.colors.backgroundPrimary.val}; 39 | box-sizing: border-box; 40 | } 41 | } 42 | `; 43 | 44 | const lightTheme = /*@__PURE__*/createGlobalTheme("", theme, { 45 | fontSize: "12px", 46 | spacings: { 47 | s: "10px", 48 | m: "20px", 49 | l: "30px", 50 | }, 51 | colors: { 52 | base: "#24292e", 53 | primary: "#6290C3", 54 | secondary: "#C2E7DA", 55 | backgroundPrimary: "#efefef", 56 | backgroundSecondary: "#e8e8e7", 57 | }, 58 | }); 59 | const darkTheme = /*@__PURE__*/createGlobalTheme("", theme, { 60 | fontSize: "12px", 61 | spacings: { 62 | s: "10px", 63 | m: "20px", 64 | l: "30px", 65 | }, 66 | colors: { 67 | base: "#efefef", 68 | primary: "#6290C3", 69 | secondary: "#C2E7DA", 70 | backgroundPrimary: "#24292e", 71 | backgroundSecondary: "#393939", 72 | }, 73 | }); 74 | 75 | const invertedTheme = css` 76 | ${darkTheme} 77 | @media (prefers-color-scheme: dark) { 78 | ${lightTheme} 79 | } 80 | `; 81 | 82 | const ThemeSwitchButton = styled.button` 83 | border: none; 84 | background: transparent; 85 | padding: 0; 86 | position: relative; 87 | overflow: hidden; 88 | font-size: 80%; 89 | cursor: pointer; 90 | :before { 91 | transition: transform 300ms ease-in-out; 92 | content: "🌙"; 93 | display: block; 94 | ${`.${invertedTheme}`} & { 95 | transform: translateY(-120%); 96 | } 97 | } 98 | :after { 99 | transition: transform 300ms ease-in-out; 100 | position: absolute; 101 | left: 0; 102 | top: 0; 103 | content: "☀️"; 104 | transform: translateY(240%); 105 | ${`.${invertedTheme}`} & { 106 | transform: translateY(0); 107 | } 108 | } 109 | `; 110 | 111 | export const ThemeSwitch = () => ( 112 | document.body.classList.toggle(invertedTheme)} 114 | title="Toggle Light/Dark Mode" 115 | /> 116 | ); 117 | 118 | export const DefaultTheme = css` 119 | :global() { 120 | :root { 121 | ${lightTheme} 122 | } 123 | @media (prefers-color-scheme: dark) { 124 | :root { 125 | ${darkTheme} 126 | } 127 | } 128 | } 129 | `; 130 | -------------------------------------------------------------------------------- /test/babel.test.js: -------------------------------------------------------------------------------- 1 | const transformFileSync = require("@babel/core").transformFileSync; 2 | const path = require("path"); 3 | const plugin = require("../babel"); 4 | 5 | describe("production transform", () => { 6 | it("CSSVariable", () => { 7 | const { code } = transformFileSync( 8 | path.join(__dirname, "fixtures/CSSVariable.js"), 9 | { 10 | plugins: [[plugin]], 11 | babelrc: false, 12 | } 13 | ); 14 | expect(code).toMatchSnapshot(); 15 | }); 16 | it("createVar", () => { 17 | const { code } = transformFileSync( 18 | path.join(__dirname, "fixtures/createVar.js"), 19 | { 20 | plugins: [[plugin]], 21 | babelrc: false, 22 | } 23 | ); 24 | expect(code).toMatchSnapshot(); 25 | }); 26 | it("renamed", () => { 27 | const { code } = transformFileSync( 28 | path.join(__dirname, "fixtures/renamed.js"), 29 | { 30 | plugins: [[plugin]], 31 | babelrc: false, 32 | } 33 | ); 34 | expect(code).toMatchSnapshot(); 35 | }); 36 | }); 37 | 38 | describe("development transform", () => { 39 | it("CSSVariable", () => { 40 | const { code } = transformFileSync( 41 | path.join(__dirname, "fixtures/CSSVariable.js"), 42 | { 43 | plugins: [[plugin]], 44 | babelrc: false, 45 | envName: "development" 46 | } 47 | ); 48 | expect(code).toMatchSnapshot(); 49 | }); 50 | it("createVar", () => { 51 | const { code } = transformFileSync( 52 | path.join(__dirname, "fixtures/createVar.js"), 53 | { 54 | plugins: [[plugin]], 55 | babelrc: false, 56 | envName: "development" 57 | } 58 | ); 59 | expect(code).toMatchSnapshot(); 60 | }); 61 | it("renamed", () => { 62 | const { code } = transformFileSync( 63 | path.join(__dirname, "fixtures/renamed.js"), 64 | { 65 | plugins: [[plugin]], 66 | babelrc: false, 67 | envName: "development" 68 | } 69 | ); 70 | expect(code).toMatchSnapshot(); 71 | }); 72 | }); 73 | 74 | describe("production transform with displayName", () => { 75 | it("CSSVariable", () => { 76 | const { code } = transformFileSync( 77 | path.join(__dirname, "fixtures/CSSVariable.js"), 78 | { 79 | plugins: [[plugin, { displayName: true }]], 80 | babelrc: false, 81 | } 82 | ); 83 | expect(code).toMatchSnapshot(); 84 | }); 85 | it("createVar", () => { 86 | const { code } = transformFileSync( 87 | path.join(__dirname, "fixtures/createVar.js"), 88 | { 89 | plugins: [[plugin, { displayName: true }]], 90 | babelrc: false, 91 | } 92 | ); 93 | expect(code).toMatchSnapshot(); 94 | }); 95 | it("renamed", () => { 96 | const { code } = transformFileSync( 97 | path.join(__dirname, "fixtures/renamed.js"), 98 | { 99 | plugins: [[plugin, { displayName: true }]], 100 | babelrc: false, 101 | } 102 | ); 103 | expect(code).toMatchSnapshot(); 104 | }); 105 | }); -------------------------------------------------------------------------------- /swc/swc-plugin-css-variable/src/lib.rs: -------------------------------------------------------------------------------- 1 | use pathdiff::diff_paths; 2 | use swc_core::{ 3 | ecma::{ast::*, visit::visit_mut_pass}, 4 | plugin::{ 5 | metadata::TransformPluginMetadataContextKind, plugin_transform, 6 | proxies::TransformPluginProgramMetadata, 7 | }, 8 | }; 9 | 10 | use transform::{hash, Config, TransformVisitor}; 11 | 12 | use regex::Regex; 13 | #[macro_use] 14 | extern crate lazy_static; 15 | 16 | /// Transforms a [`Program`]. 17 | #[plugin_transform] 18 | pub fn process_transform(program: Program, metadata: TransformPluginProgramMetadata) -> Program { 19 | let config: Config = serde_json::from_str( 20 | &metadata 21 | .get_transform_plugin_config() 22 | .expect("failed to get plugin config for swc-plugin-css-variable"), 23 | ) 24 | .expect("failed to parse plugin config"); 25 | 26 | let file_name = metadata 27 | .get_context(&TransformPluginMetadataContextKind::Filename) 28 | .expect("failed to get filename"); 29 | let deterministic_path = relative_posix_path(&config.base_path, &file_name); 30 | let hashed_filename = hash(&deterministic_path); 31 | 32 | program.apply(visit_mut_pass(&mut TransformVisitor::new( 33 | config, 34 | hashed_filename, 35 | ))) 36 | } 37 | 38 | /// Returns a relative POSIX path from the `base_path` to the filename. 39 | /// 40 | /// For example: 41 | /// - "/foo/", "/bar/baz.txt" -> "../bar/baz.txt" 42 | /// - "C:\foo\", "C:\foo\baz.txt" -> "../bar/baz.txt" 43 | /// 44 | /// The format of `base_path` and `filename` must match the current OS. 45 | fn relative_posix_path(base_path: &str, filename: &str) -> String { 46 | let normalized_base_path = convert_path_to_posix(base_path); 47 | let normalized_filename = convert_path_to_posix(filename); 48 | let relative_filename = diff_paths(normalized_filename, normalized_base_path) 49 | .expect("Could not create relative path"); 50 | let path_parts = relative_filename 51 | .components() 52 | .map(|component| component.as_os_str().to_str().unwrap()) 53 | .collect::>(); 54 | 55 | path_parts.join("/") 56 | } 57 | 58 | /// Returns the path converted to a POSIX path (naive approach). 59 | /// 60 | /// For example: 61 | /// - "C:\foo\bar" -> "c/foo/bar" 62 | /// - "/foo/bar" -> "/foo/bar" 63 | fn convert_path_to_posix(path: &str) -> String { 64 | lazy_static! { 65 | static ref PATH_REPLACEMENT_REGEX: Regex = Regex::new(r":\\|\\|:/").unwrap(); 66 | } 67 | 68 | PATH_REPLACEMENT_REGEX.replace_all(path, "/").to_string() 69 | } 70 | 71 | #[cfg(test)] 72 | mod tests { 73 | use super::*; 74 | 75 | #[test] 76 | fn test_relative_path_unix() { 77 | assert_eq!( 78 | relative_posix_path("/foo/", "/bar/baz.txt"), 79 | "../bar/baz.txt" 80 | ); 81 | } 82 | 83 | #[test] 84 | fn test_relative_path_windows() { 85 | assert_eq!( 86 | relative_posix_path(r"C:\foo\", r"C:\bar\baz.txt"), 87 | "../bar/baz.txt" 88 | ); 89 | } 90 | 91 | #[test] 92 | fn test_relative_path_windows_forward_slash() { 93 | assert_eq!( 94 | relative_posix_path(r"E:\foo", "E:/foo/bar/file.tsx"), 95 | "bar/file.tsx" 96 | ); 97 | } 98 | 99 | #[test] 100 | fn test_convert_unix_path() { 101 | assert_eq!(convert_path_to_posix(r"/foo/bar"), "/foo/bar"); 102 | } 103 | 104 | #[test] 105 | fn test_convert_windows_path() { 106 | assert_eq!(convert_path_to_posix(r"C:\foo\bar"), "C/foo/bar"); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /test/examples.js: -------------------------------------------------------------------------------- 1 | /// @ts-check 2 | const path = require("path"); 3 | const child_process = require("child_process"); 4 | const assert = require("assert"); 5 | let port = 47841; 6 | let runningChildren = new Set(); 7 | 8 | runTest().then( 9 | () => { 10 | console.log("\n\n✅ Next integration tests passed"); 11 | process.exit(0); 12 | }, 13 | (e) => { 14 | console.error("🤷‍♂️ Test failed because of ", e); 15 | process.exit(1); 16 | } 17 | ); 18 | 19 | async function runTest() { 20 | console.log("📦 install puppeteer"); 21 | await spawnAsync("npm", ["install"], { cwd: __dirname, stdio: "inherit" }).promise; 22 | console.log("🚀 test next <-> styled-component integration"); 23 | await launchExample(path.resolve(__dirname, "../examples/styled-components")); 24 | } 25 | 26 | /** @param {string} url */ 27 | async function testExample(url) { 28 | 29 | console.log("💻 start browser and open nextjs app"); 30 | const puppeteer = require('puppeteer'); 31 | const args = process.env.PUPPETEER_ARGS ? process.env.PUPPETEER_ARGS.split(" ") : []; 32 | const browser = await puppeteer.launch({args}); 33 | const page = await browser.newPage(); 34 | await page.goto(url, { 35 | waitUntil: 'networkidle2', 36 | }); 37 | const {fontSize,color} = await page.evaluate(() => { 38 | const styles = window.getComputedStyle(document.querySelector("h1")); 39 | return { 40 | fontSize: styles.fontSize, 41 | color: styles.color, 42 | }; 43 | }); 44 | 45 | assert(fontSize, '12px'); 46 | assert(color, 'rgb(255, 165, 0)'); 47 | 48 | console.log("✅ fontSize and color match"); 49 | 50 | await browser.close(); 51 | } 52 | 53 | /** @param {string} cwd */ 54 | async function launchExample(cwd) { 55 | const testPort = port++ 56 | console.log(`🧹 remove ${path.join(cwd, 'node_modules')}`); 57 | await removeDir(path.join(cwd, '.next')); 58 | await removeDir(path.join(cwd, 'node_modules')); 59 | await removeDir(path.join(cwd, '.linaria-cache')); 60 | console.log("📦 install example dependencies"); 61 | await spawnAsync("npm", ["install"], { cwd, stdio: "inherit" }).promise; 62 | console.log("🚀 build & launch nextjs"); 63 | await spawnAsync("npm", ["run", "build"], { cwd, stdio: "inherit" }).promise; 64 | const {child: server, promise: serverClosed} = spawnAsync("npm", ["start", "--", "-p", String(testPort)], { cwd, stdio: "inherit" }); 65 | await new Promise((resolve) => setTimeout(resolve, 500)); 66 | await Promise.race([ 67 | testExample(`http://localhost:${testPort}`), 68 | serverClosed 69 | ]); 70 | server.kill(); 71 | } 72 | 73 | function removeDir(directory) { 74 | return new Promise((resolve) => { 75 | require("rimraf")(directory, () => { 76 | resolve(true); 77 | }); 78 | }); 79 | } 80 | 81 | function spawnAsync(command, args, options) { 82 | const child = child_process.spawn(command, args, options); 83 | runningChildren.add(child); 84 | return {child, promise: new Promise((resolve, reject) => { 85 | child.on("close", (code) => { 86 | runningChildren.delete(child); 87 | if (code) { 88 | reject(new Error(`${command} failed - exit code: ${code}`)); 89 | } else { 90 | resolve(); 91 | } 92 | }); 93 | })}; 94 | } 95 | 96 | process.stdin.resume(); 97 | function exitHandler(exitCode) { 98 | Array.from(runningChildren).forEach((child) => { 99 | child.kill(); 100 | }); 101 | process.exit(exitCode || 0); 102 | } 103 | process.on('exit', exitHandler.bind(null)); 104 | process.on('SIGINT', exitHandler.bind(null)); 105 | process.on('SIGUSR1', exitHandler.bind(null)); 106 | process.on('SIGUSR2', exitHandler.bind(null)); 107 | process.on('uncaughtException', exitHandler.bind(null)); -------------------------------------------------------------------------------- /swc/transform/benches/bench_main.rs: -------------------------------------------------------------------------------- 1 | use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion}; 2 | use swc_core::{ 3 | common::{sync::Lrc, FileName, SourceMap}, 4 | ecma::{parser, visit::VisitMutWith}, 5 | }; 6 | 7 | use transform::{Config, TransformVisitor}; 8 | 9 | pub fn styled_page(c: &mut Criterion) { 10 | let source_map: Lrc = Default::default(); 11 | let source_file = source_map.new_source_file( 12 | Lrc::new(FileName::Custom("styledPage.tsx".into())), 13 | include_str!("styledPage.tsx").into(), 14 | ); 15 | 16 | let program = parser::parse_file_as_program( 17 | &source_file, 18 | Default::default(), 19 | Default::default(), 20 | None, 21 | &mut vec![], 22 | ) 23 | .unwrap(); 24 | 25 | c.bench_function("visitor styledPage", |b| { 26 | b.iter_batched( 27 | || { 28 | ( 29 | program.clone(), 30 | TransformVisitor::new(Default::default(), String::from("hashed")), 31 | ) 32 | }, 33 | |(mut program, mut visitor)| program.visit_mut_with(&mut visitor), 34 | BatchSize::SmallInput, 35 | ) 36 | }); 37 | 38 | c.bench_function("visitor styledPage display_name", |b| { 39 | b.iter_batched( 40 | || { 41 | ( 42 | program.clone(), 43 | TransformVisitor::new( 44 | Config { 45 | display_name: true, 46 | ..Default::default() 47 | }, 48 | String::from("hashed"), 49 | ), 50 | ) 51 | }, 52 | |(mut program, mut visitor)| program.visit_mut_with(&mut visitor), 53 | BatchSize::SmallInput, 54 | ) 55 | }); 56 | } 57 | 58 | pub fn nested(c: &mut Criterion) { 59 | let source_map: Lrc = Default::default(); 60 | let source_file = source_map.new_source_file( 61 | Lrc::new(FileName::Custom("nested.js".into())), 62 | include_str!("nested.js").into(), 63 | ); 64 | 65 | let program = parser::parse_file_as_program( 66 | &source_file, 67 | Default::default(), 68 | Default::default(), 69 | None, 70 | &mut vec![], 71 | ) 72 | .unwrap(); 73 | 74 | c.bench_function("visitor nested", |b| { 75 | b.iter_batched( 76 | || { 77 | ( 78 | program.clone(), 79 | TransformVisitor::new(Default::default(), String::from("hashed")), 80 | ) 81 | }, 82 | |(mut program, mut visitor)| program.visit_mut_with(&mut visitor), 83 | BatchSize::SmallInput, 84 | ) 85 | }); 86 | 87 | c.bench_function("visitor nested display_name", |b| { 88 | b.iter_batched( 89 | || { 90 | ( 91 | program.clone(), 92 | TransformVisitor::new( 93 | Config { 94 | display_name: true, 95 | ..Default::default() 96 | }, 97 | String::from("hashed"), 98 | ), 99 | ) 100 | }, 101 | |(mut program, mut visitor)| program.visit_mut_with(&mut visitor), 102 | BatchSize::SmallInput, 103 | ) 104 | }); 105 | } 106 | 107 | pub fn short_hash(c: &mut Criterion) { 108 | c.bench_function("short filename hash", |b| { 109 | b.iter(|| transform::hash(black_box("fileName.ts"))) 110 | }); 111 | } 112 | 113 | pub fn longer_hash(c: &mut Criterion) { 114 | c.bench_function("longer filename hash", |b| { 115 | b.iter(|| { 116 | transform::hash( 117 | black_box("some/slightly/somewhat/much/very/much/longer/harder/better/faster/stronger/convoluted/fileName.ts") 118 | ) 119 | }) 120 | }); 121 | } 122 | 123 | criterion_group!(benches, styled_page, nested, short_hash, longer_hash); 124 | criterion_main!(benches); 125 | -------------------------------------------------------------------------------- /test/__snapshots__/babel.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`development transform CSSVariable 1`] = ` 4 | "import { CSSVariable } from "css-variable"; 5 | const primary = /*@__PURE__*/new CSSVariable("primary--mobtag0"); 6 | const secondary = /*@__PURE__*/new CSSVariable("secondary--mobtag1", { 7 | value: '#fff' 8 | }); 9 | const theme = { 10 | colors: { 11 | primary: /*@__PURE__*/new CSSVariable("primary--mobtag2") 12 | } 13 | }; 14 | const generated = allColors.map(color => /*@__PURE__*/new CSSVariable("mobtag3", color)); 15 | const generatedWithFallback = allColors.map(color => /*@__PURE__*/new CSSVariable("mobtag4", color, { 16 | value: '#000' 17 | }));" 18 | `; 19 | 20 | exports[`development transform createVar 1`] = ` 21 | "import { createVar } from "css-variable"; 22 | const primary = /*@__PURE__*/createVar("primary--1c6m1ot0"); 23 | const secondary = /*@__PURE__*/createVar("secondary--1c6m1ot1", { 24 | value: '#fff' 25 | }); 26 | const theme = { 27 | colors: { 28 | primary: /*@__PURE__*/createVar("primary--1c6m1ot2") 29 | } 30 | }; 31 | const generated = allColors.map(color => /*@__PURE__*/createVar("1c6m1ot3", color)); 32 | const generatedWithFallback = allColors.map(color => /*@__PURE__*/createVar("1c6m1ot4", color, { 33 | value: '#000' 34 | }));" 35 | `; 36 | 37 | exports[`development transform renamed 1`] = ` 38 | "import { CSSVariable as CSSVar, createVar as createVariable } from "css-variable"; 39 | const primary = /*@__PURE__*/new CSSVar("primary--1ynmbls0"); 40 | const secondary = /*@__PURE__*/createVariable("secondary--1ynmbls1");" 41 | `; 42 | 43 | exports[`production transform CSSVariable 1`] = ` 44 | "import { CSSVariable } from "css-variable"; 45 | const primary = /*@__PURE__*/new CSSVariable("mobtag0"); 46 | const secondary = /*@__PURE__*/new CSSVariable("mobtag1", { 47 | value: '#fff' 48 | }); 49 | const theme = { 50 | colors: { 51 | primary: /*@__PURE__*/new CSSVariable("mobtag2") 52 | } 53 | }; 54 | const generated = allColors.map(color => /*@__PURE__*/new CSSVariable("mobtag3", color)); 55 | const generatedWithFallback = allColors.map(color => /*@__PURE__*/new CSSVariable("mobtag4", color, { 56 | value: '#000' 57 | }));" 58 | `; 59 | 60 | exports[`production transform createVar 1`] = ` 61 | "import { createVar } from "css-variable"; 62 | const primary = /*@__PURE__*/createVar("1c6m1ot0"); 63 | const secondary = /*@__PURE__*/createVar("1c6m1ot1", { 64 | value: '#fff' 65 | }); 66 | const theme = { 67 | colors: { 68 | primary: /*@__PURE__*/createVar("1c6m1ot2") 69 | } 70 | }; 71 | const generated = allColors.map(color => /*@__PURE__*/createVar("1c6m1ot3", color)); 72 | const generatedWithFallback = allColors.map(color => /*@__PURE__*/createVar("1c6m1ot4", color, { 73 | value: '#000' 74 | }));" 75 | `; 76 | 77 | exports[`production transform renamed 1`] = ` 78 | "import { CSSVariable as CSSVar, createVar as createVariable } from "css-variable"; 79 | const primary = /*@__PURE__*/new CSSVar("1ynmbls0"); 80 | const secondary = /*@__PURE__*/createVariable("1ynmbls1");" 81 | `; 82 | 83 | exports[`production transform with displayName CSSVariable 1`] = ` 84 | "import { CSSVariable } from "css-variable"; 85 | const primary = /*@__PURE__*/new CSSVariable("primary--mobtag0"); 86 | const secondary = /*@__PURE__*/new CSSVariable("secondary--mobtag1", { 87 | value: '#fff' 88 | }); 89 | const theme = { 90 | colors: { 91 | primary: /*@__PURE__*/new CSSVariable("primary--mobtag2") 92 | } 93 | }; 94 | const generated = allColors.map(color => /*@__PURE__*/new CSSVariable("mobtag3", color)); 95 | const generatedWithFallback = allColors.map(color => /*@__PURE__*/new CSSVariable("mobtag4", color, { 96 | value: '#000' 97 | }));" 98 | `; 99 | 100 | exports[`production transform with displayName createVar 1`] = ` 101 | "import { createVar } from "css-variable"; 102 | const primary = /*@__PURE__*/createVar("primary--1c6m1ot0"); 103 | const secondary = /*@__PURE__*/createVar("secondary--1c6m1ot1", { 104 | value: '#fff' 105 | }); 106 | const theme = { 107 | colors: { 108 | primary: /*@__PURE__*/createVar("primary--1c6m1ot2") 109 | } 110 | }; 111 | const generated = allColors.map(color => /*@__PURE__*/createVar("1c6m1ot3", color)); 112 | const generatedWithFallback = allColors.map(color => /*@__PURE__*/createVar("1c6m1ot4", color, { 113 | value: '#000' 114 | }));" 115 | `; 116 | 117 | exports[`production transform with displayName renamed 1`] = ` 118 | "import { CSSVariable as CSSVar, createVar as createVariable } from "css-variable"; 119 | const primary = /*@__PURE__*/new CSSVar("primary--1ynmbls0"); 120 | const secondary = /*@__PURE__*/createVariable("secondary--1ynmbls1");" 121 | `; 122 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | ## [8.0.0](https://github.com/jantimon/css-variable/compare/v7.0.0...v8.0.0) (2025-11-04) 6 | 7 | 8 | ### ⚠ BREAKING CHANGES 9 | 10 | * requires swc_core 45.x 11 | 12 | ### Features 13 | 14 | * add support for Next.js 16.0.1 15 | 16 | ## [7.0.0](https://github.com/jantimon/css-variable/compare/v6.0.0...v7.0.0) (2025-07-16) 17 | 18 | 19 | ### ⚠ BREAKING CHANGES 20 | 21 | * requires swc_core 27.x 22 | 23 | ### Features 24 | 25 | * add support for Next.js 15.4 26 | 27 | ## 6.0.0 (2025-02-27) 28 | 29 | 30 | ### ⚠ BREAKING CHANGES 31 | 32 | * **swc:** Update to swc_core 16.0.0 (compatible with @swc/core@1.11.1) 33 | 34 | ## 5.0.0 (2024-12-10) 35 | 36 | 37 | ### ⚠ BREAKING CHANGES 38 | 39 | * **swc** Update to swc_core 5.x (compatible with @swc/core@1.9.2) [#43](https://github.com/jantimon/css-variable/issues/43) 40 | 41 | ### Features 42 | 43 | * add support for Next.js 15.0.4 ([#43](https://github.com/jantimon/css-variable/issues/43)) ([0f9a5a6](https://github.com/jantimon/css-variable/commit/0f9a5a6e8b6ab586dad0460ae0ab4c09948e5aa0)) 44 | 45 | 46 | ## [4.0.0](https://github.com/jantimon/css-variable/compare/v3.10.2...v4.0.0) (2024-05-21) 47 | 48 | 49 | ### ⚠ BREAKING CHANGES 50 | 51 | * **swc:** Update to swc_core 0.90.x (compatible with @swc/core@1.4.x) (#34) 52 | 53 | ### Features 54 | 55 | * **swc:** Update to swc_core 0.90.x (compatible with @swc/core@1.4.x) ([#34](https://github.com/jantimon/css-variable/issues/34)) ([5daebad](https://github.com/jantimon/css-variable/commit/5daebadc893b77428da797b300f9037ab7482da6)) 56 | 57 | ### [3.10.2](https://github.com/jantimon/css-variable/compare/v3.10.1...v3.10.2) (2023-07-20) 58 | 59 | ### [3.10.1](https://github.com/jantimon/css-variable/compare/v3.10.0...v3.10.1) (2023-01-26) 60 | 61 | 62 | ### Bug Fixes 63 | 64 | * **swc:** include package.json properly ([#28](https://github.com/jantimon/css-variable/issues/28)) ([2077ec6](https://github.com/jantimon/css-variable/commit/2077ec6e01c9f9f58091326ddbe1dfdc2799e29f)) 65 | 66 | ## [3.10.0](https://github.com/jantimon/css-variable/compare/v3.9.0...v3.10.0) (2023-01-26) 67 | 68 | ### Features 69 | 70 | * faster hash generation with more readable hashes ([1a0006f](https://github.com/jantimon/css-variable/commit/1a0006f9f150231b319be74ccaf757eb257da764)) 71 | 72 | ### Bug Fixes 73 | 74 | * update dev dependencies ([d3dabe2](https://github.com/jantimon/css-variable/commit/d3dabe2c7ca948f080a67e9439074c40c71d13bc)) 75 | 76 | ### [3.9.1](https://github.com/jantimon/css-variable/compare/v3.9.0...v3.9.1) (2022-11-23) 77 | 78 | ### Features 79 | 80 | * add type declarations to exports field ([13e6696](https://github.com/jantimon/css-variable/commit/13e669626747d248d4f695ccf9d4f919f757bcf3)) in package.json. closes [#18] 81 | 82 | ### Bug Fixes 83 | 84 | * update dev dependencies ([9d6132e](https://github.com/jantimon/css-variable/commit/9d6132e06342d7e4aa17e746d920b5fc5f7d7f1b)) 85 | 86 | ## [3.9.0](https://github.com/jantimon/css-variable/compare/v3.8.0...v3.9.0) (2022-11-03) 87 | 88 | ### Features 89 | 90 | * improve css variable names ([2bd733f](https://github.com/jantimon/css-variable/commit/2bd733f793453bf1c954e87933a98b44998bd95f)) 91 | 92 | ## [3.8.0](https://github.com/jantimon/css-variable/compare/v3.7.0...v3.8.0) (2022-08-02) 93 | 94 | 95 | ### Features 96 | 97 | * update @swc/core ([9318847](https://github.com/jantimon/css-variable/commit/93188474cb7c6026a1f3458161f57c97d6b8b550)) 98 | 99 | # 3.7.0 (2022-07-15) 100 | 101 | 102 | ### Bug Fixes 103 | 104 | * **swc:** convert window paths to posix ([1f2fec0](https://github.com/jantimon/css-variable/commit/1f2fec0707f68ee6713dccb652bf733768e9b2a9)), closes [#6](https://github.com/jantimon/css-variable/issues/6) 105 | 106 | 107 | ### Features 108 | 109 | * add createVar, createGlobalTheme and assignVars ([7cde9d0](https://github.com/jantimon/css-variable/commit/7cde9d032bf3045484d8a9370cc5f414412bdf24)) 110 | * add displayName babel plugin option ([5843862](https://github.com/jantimon/css-variable/commit/58438622e3e58bfd0b199d9dc665db0211eae198)) 111 | * add full path to the dev variable name when using the swc plugin ([2af5985](https://github.com/jantimon/css-variable/commit/2af598512ce0596bb9a7890e32befacee9fb7708)) 112 | * add swc plugin ([#2](https://github.com/jantimon/css-variable/issues/2)) ([e7e09c7](https://github.com/jantimon/css-variable/commit/e7e09c717b505578089550e5a903c411fa1ae89e)) 113 | * reduze bundle size ([b726748](https://github.com/jantimon/css-variable/commit/b72674819369afc3f3cf6f95f5d19230c6e1ec79)) 114 | * replace random fallback id ([00c569d](https://github.com/jantimon/css-variable/commit/00c569df081f41463a64f3eadddc720b36d113d6)) 115 | -------------------------------------------------------------------------------- /babel/index.cjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const PACKAGE_NAME = "css-variable"; 3 | const hash = require("./hash.cjs"); 4 | const pathRelative = require("path").relative; 5 | 6 | /** @typedef {import("@babel/core")} babel */ 7 | 8 | /** 9 | * The context of a babel plugin run 10 | * @typedef {{ 11 | * minifyVariables: boolean, 12 | * varCount: number, 13 | * varPrefix: string, 14 | * isImportedInCurrentFile: boolean, 15 | * localVarNames: string[], 16 | * opts: babel.PluginOptions & { displayName?: boolean } 17 | * } & babel.PluginPass} PluginPass 18 | */ 19 | 20 | /** 21 | * @param {babel} babel 22 | * @returns {babel.PluginObj} 23 | */ 24 | module.exports = function (babel) { 25 | const { 26 | types: { stringLiteral }, 27 | } = babel; 28 | 29 | /** 30 | * @param {babel.NodePath | babel.NodePath} path; 31 | * @param {PluginPass} pluginPass 32 | */ 33 | const injectVariableName = (path, pluginPass) => { 34 | // Skip if no import statements where found 35 | if (!pluginPass.localVarNames.length) { 36 | return; 37 | } 38 | const callee = path.node.callee; 39 | if ( 40 | !("name" in callee) || 41 | !pluginPass.localVarNames.includes(callee.name) 42 | ) { 43 | return; 44 | } 45 | const readableName = 46 | !pluginPass.minifyVariables && dashed(getNameByUsage(path)); 47 | const readablePrefix = readableName ? `${readableName}--` : ""; 48 | // 49 | // Inject the variable prefix 50 | // 51 | // E.g. CSSVariable() -> CSSVariable("1isaui4-0") 52 | // E.g. CSSVariable({value: "10px"}) -> CSSVariable("1isaui4-0", {value: "10px"}) 53 | // 54 | const constructorArguments = path.node.arguments; 55 | const firstArg = constructorArguments[0]; 56 | if (!firstArg || firstArg.type !== "StringLiteral") { 57 | constructorArguments.unshift( 58 | stringLiteral( 59 | readablePrefix + getUniqueHash(pluginPass) + pluginPass.varCount++ 60 | ) 61 | ); 62 | } 63 | // 64 | // Inject @__PURE__ comment to tell terser that 65 | // creating s CSSVariable class instance will cause no 66 | // side effects and is save to be removed 67 | // 68 | path.addComment("leading", "@__PURE__"); 69 | }; 70 | 71 | return { 72 | name: `${PACKAGE_NAME} unique variable name injector`, 73 | pre() { 74 | this.isImportedInCurrentFile = false; 75 | this.varCount = 0; 76 | this.minifyVariables = 77 | this.opts.displayName !== undefined 78 | ? !this.opts.displayName 79 | : this.file.opts.envName !== "development"; 80 | this.localVarNames = []; 81 | }, 82 | visitor: { 83 | ImportDeclaration({ node }) { 84 | // Search for `import {CSSVariable} from "css-variable";` 85 | // Search for `import {CSSVariable as CustomName} from "css-variable";` 86 | const isLib = node.source.value === PACKAGE_NAME; 87 | if (!isLib) { 88 | return; 89 | } 90 | node.specifiers.forEach((specifier) => { 91 | const importSpecifier = "imported" in specifier && specifier.imported; 92 | if (!importSpecifier || !("name" in importSpecifier)) { 93 | return; 94 | } 95 | const localSpecifier = 96 | ("local" in specifier && specifier.local) || importSpecifier; 97 | if ( 98 | importSpecifier.name === "CSSVariable" || 99 | importSpecifier.name === "createVar" 100 | ) { 101 | this.localVarNames.push(localSpecifier.name); 102 | } 103 | }); 104 | this.isImportedInCurrentFile = this.localVarNames.length > 0; 105 | }, 106 | CallExpression(path) { 107 | return injectVariableName(path, this); 108 | }, 109 | NewExpression(path) { 110 | return injectVariableName(path, this); 111 | }, 112 | }, 113 | }; 114 | }; 115 | 116 | /** 117 | * Tries to extract the name for readable names in developments 118 | * e.g.: 119 | * 120 | * `const fontSize = createVar()` -> fontSize 121 | * `const theme = { primary: createVar() }` -> primary 122 | * 123 | * @param {babel.NodePath} path 124 | */ 125 | function getNameByUsage(path) { 126 | const parent = path.parent; 127 | if (!parent) return ""; 128 | if (parent.type === "ObjectProperty") { 129 | const key = parent.key; 130 | if (key && key.type === "Identifier" && key.name) { 131 | return key.name; 132 | } 133 | } 134 | if (parent.type === "VariableDeclarator") { 135 | const id = parent.id; 136 | if (id && id.type === "Identifier" && id.name) { 137 | return id.name; 138 | } 139 | } 140 | return ""; 141 | } 142 | 143 | /** @param {string} val*/ 144 | function dashed(val) { 145 | /** handle camelCase and CONSTANT_CASE */ 146 | return val 147 | .replace(/([0-9a-z])([A-Z])/g, "$1-$2") 148 | .toLowerCase() 149 | .replace(/_/g, "-"); 150 | } 151 | 152 | /** @type {WeakMap} */ 153 | const prefixCache = new WeakMap(); 154 | /** 155 | * Returns a unique name based on the processed filename 156 | * 157 | * @param {babel.PluginPass} pass 158 | */ 159 | function getUniqueHash(pass) { 160 | const fromCache = prefixCache.get(pass); 161 | if (fromCache) { 162 | return fromCache; 163 | } 164 | // Variables should keep the same generated name for 165 | // multiple builds. 166 | // 167 | // This is possible by hashing the source filename 168 | // which includes the CSSVariable. 169 | // 170 | // As an absolute file might be different from system to system 171 | // the relative filename is used instead 172 | const relativeFileName = pass.file.opts.filename 173 | ? pathRelative(__dirname, pass.file.opts.filename).replace(/\\/g, "/") 174 | : "jantimon"; 175 | const prefix = hash(relativeFileName); 176 | prefixCache.set(pass, prefix); 177 | return prefix; 178 | } 179 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export type CSSPixelValue = '0' | `${string}px`; 2 | export type CSSLengthValue = '0' | `${string}${| "%" 3 | | "ch" 4 | | "cm" 5 | | "em" 6 | | "ex" 7 | | "in" 8 | | "mm" 9 | | "pc" 10 | | "pt" 11 | | "px" 12 | | "rem" 13 | | "vh" 14 | | "vmax" 15 | | "vmin" 16 | | "vw" 17 | }`; 18 | export type CSSAngleValue = `${string}${| "deg" 19 | | "grad" 20 | | "rad" 21 | | "turn" 22 | }`; 23 | export type CSSHexColor = `#${string}`; 24 | 25 | type CSSVariableOptions = { value: TValue | CSSVariable }; 26 | 27 | /** 28 | * Usually css-variable should always be used with its babel plugin 29 | * 30 | * However in some scenarios e.g. storybook / jest it might be difficult 31 | * to setup. 32 | * For those cases this counter provides a very basic fallback to generate 33 | * different ids. 34 | */ 35 | let fallbackId = 9 ** 9; 36 | 37 | export class CSSVariable extends ( 38 | // Inherit from String to be compatible to most CSS-in-JS solutions 39 | // Hacky cast to any for reduced autocomplete 40 | String as any as { new(base: string): { toString: () => string } } 41 | ) { 42 | /** Name e.g. `--baseSize` */ 43 | readonly name: string; 44 | /** Value e.g. `var(--baseSize, 12px)` */ 45 | readonly val: string; 46 | /** 47 | * Creates a new CSS Variable with a unique autogenerated name 48 | * 49 | * E.g. `var(--1isaui4-0)` 50 | */ 51 | constructor(); 52 | /** 53 | * Creates a new CSS Variable with a custom defined name 54 | * 55 | * E.g. `var(--baseSize)` 56 | */ 57 | constructor(uniqueName: string); 58 | /** 59 | * Creates a new CSS Variable with a unique autogenerated name 60 | * and a fallback value 61 | * 62 | * E.g. `var(--1isaui4-0, 12px)` 63 | */ 64 | constructor(options: CSSVariableOptions); 65 | /** 66 | * Creates a new CSS Variable with a unique autogenerated name 67 | * and a fallback value 68 | * 69 | * E.g. `var(--baseSize, 12px)` 70 | */ 71 | constructor(uniqueName: string, options: CSSVariableOptions); 72 | /*#__PURE__*/ 73 | constructor( 74 | ...args: Array> 75 | ) { 76 | const optionArg = args.find( 77 | (arg): arg is CSSVariableOptions => typeof arg === "object" 78 | ); 79 | const name = 80 | "--" + 81 | (args.filter((arg): arg is string => typeof arg === "string").join('-').toLowerCase() || 82 | // Fallback if babel plugin is missing 83 | (fallbackId++).toString(16)); 84 | const val = `var(${name}${optionArg ? `, ${optionArg.value}` : ""})`; 85 | super(val); 86 | this.val = val; 87 | this.name = name; 88 | } 89 | /** Returns the variable name e.g. `--baseSize` */ 90 | getName() { 91 | return this.name; 92 | } 93 | /** Create a CSS Object e.g. `{ "--baseSize": '12px' }` */ 94 | toStyle(newValue: TValue | CSSVariable) { 95 | return { [this.name]: (`${newValue}` as unknown as TValue) }; 96 | } 97 | /** Create a CSS String e.g. `--baseSize:12px;` */ 98 | toCSS(newValue: TValue | CSSVariable) { 99 | return `${this.name}:${newValue};`; 100 | } 101 | } 102 | 103 | 104 | type ICreateVar = { 105 | /** 106 | * Creates a new CSS Variable with a unique autogenerated name 107 | * 108 | * E.g. `var(--1isaui4-0)` 109 | */ 110 | (): CSSVariable; 111 | /** 112 | * Creates a new CSS Variable with a custom defined name 113 | * 114 | * E.g. `var(--baseSize)` 115 | */ 116 | (uniqueName: string): CSSVariable; 117 | /** 118 | * Creates a new CSS Variable with a unique autogenerated name 119 | * and a fallback value 120 | * 121 | * E.g. `var(--1isaui4-0, 12px)` 122 | */ 123 | (options: CSSVariableOptions): CSSVariable; 124 | /** 125 | * Creates a new CSS Variable with a unique autogenerated name 126 | * and a fallback value 127 | * 128 | * E.g. `var(--baseSize, 12px)` 129 | */ 130 | (uniqueName: string, options: CSSVariableOptions): CSSVariable; 131 | } 132 | export const createVar: ICreateVar = (...args: any[]) => new (CSSVariable as any)(...args); 133 | 134 | /** 135 | * A theme structure groups multiple CSSVariable instances 136 | * in a nested object structure e.g.: 137 | * 138 | * ```ts 139 | * const theme = { 140 | * colors: { 141 | * primary: createVar(), 142 | * secondary: createVar() 143 | * }, 144 | * spacings: { 145 | * small: createVar(), 146 | * large: createVar() 147 | * } 148 | * } 149 | * ``` 150 | */ 151 | type ThemeStructure = { [key: string]: CSSVariable | ThemeStructure }; 152 | 153 | /** The allowed value type for the given CSSVariable */ 154 | export type CSSVariableValueArgument = T extends CSSVariable ? U : T 155 | /** 156 | * The ThemeValues type is a helper to map a ThemeStructure to a value type 157 | * to guarantee that the structure and values in createGlobalTheme match 158 | */ 159 | type ThemeValues = { 160 | [Property in keyof TThemeStructure]: TThemeStructure[Property] extends CSSVariable 161 | ? CSSVariableValueArgument | CSSVariable> 162 | : TThemeStructure[Property] extends ThemeStructure 163 | ? ThemeValues 164 | : never; 165 | }; 166 | 167 | type DeepPartial = T extends Function ? T : (T extends object ? { [P in keyof T]?: DeepPartial; } : T); 168 | 169 | /** 170 | * Assign multiple CSSVariables for a given flat or nested Theme Contract 171 | * 172 | * @example 173 | * ```js 174 | * const theme = { 175 | * colors: { 176 | * primary: createVar(), 177 | * secondary: createVar(), 178 | * } 179 | * } 180 | * 181 | * const brightThemeCSS = assignVars(theme, { 182 | * colors: { 183 | * primary: "#6290C3", 184 | * } 185 | * }) 186 | * 187 | * console.log(brightThemeCSS) // -> `--1isaui4-0:#6290C3;` 188 | * ``` 189 | */ 190 | export const assignVars = ( 191 | cssVariables: TTheme, 192 | cssVariableValues: DeepPartial> 193 | ): string => 194 | Object.keys(cssVariableValues) 195 | .map((key) => 196 | typeof cssVariableValues[key] === "string" 197 | ? (cssVariables[key] as CSSVariable).toCSS(cssVariableValues[key] as string) 198 | : assignVars( 199 | cssVariables[key] as ThemeStructure, 200 | cssVariableValues[key] as ThemeValues 201 | ) 202 | ) 203 | .join(""); 204 | 205 | /** 206 | * Serialize all CSS Variable values for an entire nested or flat Theme Contract 207 | * 208 | * @example 209 | * ```js 210 | * const theme = { 211 | * colors: { 212 | * primary: createVar(), 213 | * secondary: createVar(), 214 | * } 215 | * } 216 | * 217 | * const brightThemeCSS = createGlobalTheme(":root", theme, { 218 | * colors: { 219 | * primary: "#6290C3", 220 | * secondary: "#C2E7DA", 221 | * } 222 | * }) 223 | * 224 | * console.log(brightThemeCSS) // -> `:root { --1isaui4-0:#6290C3; --1isaui4-1:#C2E7DA; }` 225 | * ``` 226 | */ 227 | export const createGlobalTheme = (scope: string | undefined | null, 228 | cssVariables: TTheme, 229 | cssVariableValues: ThemeValues): string => `${scope ? `${scope}{` : ''}${assignVars(cssVariables, cssVariableValues as DeepPartial>)}${scope ? '}' : ''}`; -------------------------------------------------------------------------------- /swc/transform/src/lib.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | use std::{collections::HashSet, fmt::Write}; 3 | use swc_core::{ 4 | common::DUMMY_SP, 5 | ecma::ast::*, 6 | ecma::visit::{VisitMut, VisitMutWith}, 7 | }; 8 | 9 | mod hash; 10 | 11 | pub use hash::hash; 12 | 13 | /// Static plugin configuration. 14 | #[derive(Default, Deserialize)] 15 | #[serde(rename_all = "camelCase")] 16 | #[serde(deny_unknown_fields)] 17 | pub struct Config { 18 | /// Prefix variables with a readable name, e.g. `primary--2Hy69D0`. 19 | #[serde(default = "bool::default")] 20 | pub display_name: bool, 21 | /// The hash for a css-variable depends on the file name including createVar(). 22 | /// To ensure that the hash is consistent accross multiple systems the relative path 23 | /// from the base dir to the source file is used. 24 | #[serde()] 25 | pub base_path: String, 26 | } 27 | 28 | pub struct TransformVisitor { 29 | config: Config, 30 | filename_hash: String, 31 | local_idents: HashSet, 32 | variable_count: u32, 33 | current_var_declarator: Option, 34 | current_object_prop_declarators: Vec, 35 | } 36 | 37 | impl TransformVisitor { 38 | pub fn new(config: Config, filename_hash: String) -> Self { 39 | Self { 40 | config, 41 | filename_hash, 42 | local_idents: HashSet::new(), 43 | variable_count: 0, 44 | current_var_declarator: None, 45 | current_object_prop_declarators: vec![], 46 | } 47 | } 48 | } 49 | 50 | impl VisitMut for TransformVisitor { 51 | /// Searches all local names for `createVar`. 52 | /// 53 | /// For example: 54 | /// ```javascript 55 | /// import { createVar } from "css-variable"; 56 | /// import { createVar as x} from "css-variable"; 57 | /// import { foo as x, createVar as y } from "css-variable"; 58 | /// ``` 59 | fn visit_mut_import_decl(&mut self, import_decl: &mut ImportDecl) { 60 | if &import_decl.src.value != "css-variable" { 61 | return; 62 | } 63 | 64 | for specifier in &import_decl.specifiers { 65 | if let ImportSpecifier::Named(local) = specifier { 66 | let imported_ident = match &local.imported { 67 | Some(ModuleExportName::Ident(module_export)) => &module_export.sym, 68 | // import {createVar} from "css-variable"; 69 | _ => &local.local.sym, 70 | }; 71 | 72 | if imported_ident == "createVar" { 73 | self.local_idents.insert(String::from(&*local.local.sym)); 74 | } 75 | } 76 | } 77 | } 78 | 79 | fn visit_mut_var_declarator(&mut self, var_declarator: &mut VarDeclarator) { 80 | self.current_var_declarator = 81 | if let Pat::Ident(BindingIdent { id, .. }) = &var_declarator.name { 82 | Some(id.sym.to_string()) 83 | } else { 84 | None 85 | }; 86 | 87 | var_declarator.visit_mut_children_with(self); 88 | 89 | self.current_var_declarator = None; 90 | } 91 | 92 | fn visit_mut_key_value_prop(&mut self, key_value: &mut KeyValueProp) { 93 | if let PropName::Ident(id) = &key_value.key { 94 | self.current_object_prop_declarators 95 | .push(id.sym.to_string()); 96 | } 97 | 98 | key_value.visit_mut_children_with(self); 99 | 100 | self.current_object_prop_declarators.pop(); 101 | } 102 | 103 | fn visit_mut_call_expr(&mut self, call_expr: &mut CallExpr) { 104 | // Skip entire execution if no import call was found, see visit_mut_import_decl 105 | if self.local_idents.is_empty() { 106 | return; 107 | } 108 | 109 | call_expr.visit_mut_children_with(self); 110 | 111 | if let Callee::Expr(expr) = &call_expr.callee { 112 | if let Expr::Ident(id) = &**expr { 113 | if self.local_idents.contains(&*id.sym) { 114 | let mut variable_name = String::new(); 115 | 116 | if self.config.display_name { 117 | for object_prop_declarator in 118 | self.current_object_prop_declarators.iter().rev() 119 | { 120 | write!(&mut variable_name, "{object_prop_declarator}--").unwrap(); 121 | } 122 | 123 | if let Some(var_declarator) = &self.current_var_declarator { 124 | write!(&mut variable_name, "{var_declarator}--").unwrap(); 125 | } 126 | } 127 | 128 | write!( 129 | &mut variable_name, 130 | "{}{}", 131 | self.filename_hash, self.variable_count 132 | ) 133 | .unwrap(); 134 | self.variable_count += 1; 135 | 136 | call_expr.args.insert( 137 | 0, 138 | ExprOrSpread { 139 | spread: None, 140 | expr: Box::new(Expr::Lit(Lit::Str(Str { 141 | span: DUMMY_SP, 142 | value: variable_name.into(), 143 | raw: None, 144 | }))), 145 | }, 146 | ); 147 | } 148 | } 149 | } 150 | } 151 | } 152 | 153 | #[cfg(test)] 154 | mod tests { 155 | use swc_core::ecma::transforms::testing::test; 156 | use swc_core::ecma::visit::{visit_mut_pass, VisitMutPass}; 157 | 158 | use super::*; 159 | 160 | fn transform_visitor(config: Config) -> VisitMutPass { 161 | visit_mut_pass(TransformVisitor::new(config, String::from("hashed"))) 162 | } 163 | 164 | test!( 165 | Default::default(), 166 | |_| transform_visitor(Default::default()), 167 | adds_variable_name, 168 | r#"import {createVar} from "css-variable"; 169 | createVar();"# 170 | ); 171 | 172 | test!( 173 | Default::default(), 174 | |_| transform_visitor(Default::default()), 175 | adds_multiple_variable_names, 176 | r#"import {createVar} from "css-variable"; 177 | createVar(); 178 | createVar(); 179 | createVar();"# 180 | ); 181 | 182 | test!( 183 | Default::default(), 184 | |_| transform_visitor(Default::default()), 185 | ignores_unknwon_modules, 186 | r#"import {createVar} from "unknown"; 187 | createVar();"# 188 | ); 189 | 190 | test!( 191 | Default::default(), 192 | |_| transform_visitor(Default::default()), 193 | adds_variable_name_with_value, 194 | r#"import {createVar} from "css-variable"; 195 | createVar({ value: '0px' });"# 196 | ); 197 | 198 | test!( 199 | Default::default(), 200 | |_| transform_visitor(Default::default()), 201 | adds_variable_name_for_renamed, 202 | r#"import {createVar as create} from "css-variable"; 203 | create("hello world");"# 204 | ); 205 | 206 | test!( 207 | Default::default(), 208 | |_| transform_visitor(Config { 209 | display_name: true, 210 | base_path: "/".to_owned() 211 | }), 212 | adds_camel_case_variable_name_with_display_name, 213 | r#"import {createVar} from "css-variable"; 214 | const camelCase = createVar();"# 215 | ); 216 | 217 | test!( 218 | Default::default(), 219 | |_| transform_visitor(Config { 220 | display_name: true, 221 | base_path: "/".to_owned() 222 | }), 223 | adds_variable_name_with_display_name, 224 | r#"import {createVar} from "css-variable"; 225 | const primary = createVar(); 226 | const theme = { 227 | colors: { 228 | primary: createVar(), 229 | secondary: { 230 | inner: createVar() 231 | } 232 | } 233 | };"# 234 | ); 235 | } 236 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ 22 | // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | 26 | /* Modules */ 27 | "module": "commonjs", /* Specify what module code is generated. */ 28 | // "rootDir": "./", /* Specify the root folder within your source files. */ 29 | // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 30 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 31 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 32 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 33 | // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ 34 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 35 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 36 | // "resolveJsonModule": true, /* Enable importing .json files */ 37 | // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ 38 | 39 | /* JavaScript Support */ 40 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ 41 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 42 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ 43 | 44 | /* Emit */ 45 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 46 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 47 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 48 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 49 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ 50 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 51 | // "removeComments": true, /* Disable emitting comments. */ 52 | // "noEmit": true, /* Disable emitting files from a compilation. */ 53 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 54 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ 55 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 56 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 58 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 59 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 60 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 61 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 62 | // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ 63 | // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ 64 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 65 | // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ 66 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 67 | 68 | /* Interop Constraints */ 69 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 70 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 71 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ 72 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 73 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 74 | 75 | /* Type Checking */ 76 | "strict": true, /* Enable all strict type-checking options. */ 77 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ 78 | // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ 79 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 80 | // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ 81 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 82 | // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ 83 | // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ 84 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 85 | // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ 86 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ 87 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 88 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 89 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 90 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 91 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 92 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ 93 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 94 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 95 | 96 | /* Completeness */ 97 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 98 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 99 | }, 100 | } -------------------------------------------------------------------------------- /docs/pages/index.page.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from "linaria/lib/react"; 2 | import Head from "next/head"; 3 | import { CodeExamples } from "./CodeExample"; 4 | import "./Theme"; 5 | import { theme, ThemeSwitch } from "./Theme"; 6 | 7 | const HeaderWrapper = styled.header` 8 | background: ${theme.colors.backgroundSecondary.val}; 9 | position: fixed; 10 | top: 0; 11 | width: 100%; 12 | padding: 5px 10px; 13 | z-index: 10; 14 | `; 15 | 16 | const Header = styled.div` 17 | display: grid; 18 | grid-template-columns: auto max-content max-content max-content; 19 | grid-template-rows: 1fr; 20 | gap: 10px; 21 | color: ${theme.colors.base.val}; 22 | align-items: end; 23 | max-width: 1200px; 24 | margin: 0 auto; 25 | `; 26 | 27 | const TextLogo = styled.h1` 28 | font-size: 18px; 29 | margin: 0; 30 | letter-spacing: -1px; 31 | `; 32 | 33 | const HeaderLink = styled.a` 34 | font-size: 14px; 35 | color: ${theme.colors.base.val}; 36 | text-decoration: none; 37 | `; 38 | 39 | const Main = styled.main` 40 | padding: 80px 50px 0px; 41 | width: 100%; 42 | max-width: 900px; 43 | margin: 0 auto; 44 | display: flex; 45 | flex-direction: column; 46 | gap: ${theme.spacings.m.val}; 47 | 48 | @media (min-width: 860px) { 49 | padding-left: 10px; 50 | padding-right: 10px; 51 | } 52 | `; 53 | 54 | const Section = styled.section<{ reverse?: boolean }>` 55 | display: flex; 56 | gap: 30px; 57 | flex-wrap: wrap; 58 | flex-direction: ${({ reverse }) => (reverse ? "row-reverse" : "row")}; 59 | margin-bottom: 80px; 60 | @media (min-width: 860px) { 61 | flex-wrap: nowrap; 62 | margin-bottom: 120px; 63 | } 64 | `; 65 | 66 | const SectionContent = styled.div` 67 | display: flex; 68 | max-width: 600px; 69 | margin: 0 auto; 70 | gap: ${theme.spacings.m.val}; 71 | flex-direction: column; 72 | flex-grow: 0; 73 | flex-shrink: 1; 74 | width: 100%; 75 | @media (min-width: 860px) { 76 | flex-wrap: nowrap; 77 | margin-bottom: 40px; 78 | } 79 | `; 80 | 81 | const SectionExample = styled.div` 82 | display: flex; 83 | gap: 10px; 84 | flex-direction: column; 85 | flex-grow: 0; 86 | flex-shrink: 0; 87 | width: 100%; 88 | @media (min-width: 860px) { 89 | width: 65%; 90 | } 91 | `; 92 | 93 | const Intro = styled.h2` 94 | font-size: 20px; 95 | color: ${theme.colors.base.val}; 96 | text-align: center; 97 | margin-bottom: 40px; 98 | `; 99 | 100 | const Headline = styled.h2` 101 | font-size: 18px; 102 | color: ${theme.colors.base.val}; 103 | margin: 0 0 5px 0; 104 | `; 105 | 106 | const Text = styled.p` 107 | font-size: 16px; 108 | color: ${theme.colors.base.val}; 109 | margin: 0 0 15px 0; 110 | `; 111 | 112 | const Footer = styled.footer` 113 | font-size: 14px; 114 | background: ${theme.colors.backgroundSecondary.val}; 115 | color: ${theme.colors.base.val}; 116 | padding: 20px; 117 | `; 118 | 119 | const FooterContent = styled.div` 120 | max-width: 1200px; 121 | width: 100%; 122 | margin: 0 auto; 123 | text-align: center; 124 | `; 125 | 126 | const Badges = styled.div` 127 | display: inline-flex; 128 | gap: 8px; 129 | margin-right: 8px; 130 | margin-bottom: 8px; 131 | line-height: 0; 132 | `; 133 | 134 | const Index = () => ( 135 | <> 136 | 137 | 138 | 139 | 140 |
141 | CSS Variable 142 | 143 | GitHub 144 | 145 | 146 |
147 |
148 |
149 | CSS Variables for your CSS-in-JS solution 150 | 151 |
152 | 153 | Built with high focus on performance 154 | 155 | ✨ better css minification 156 | 157 | 158 | ✨ smaller virtual DOM updates 159 | 160 | 161 | ✨ less crititcal SSR CSS 162 | 163 | 164 | ✨ unique variable names 165 | 166 | 167 | 168 | 169 | {{ 170 | base: ` 171 | import { createVar } from 'css-variable'; 172 | 173 | export const tokens = { 174 | primary: createVar(), 175 | secondary: createVar(), 176 | }; 177 | `, 178 | }} 179 | 180 | 181 | 182 | {{ 183 | "styled-components": ` 184 | import { createGlobalTheme } from 'css-variable'; 185 | import { createGlobalStyle } from 'styled-components'; 186 | import { tokens } from './tokens'; 187 | 188 | export const GlobalStyles = createGlobalStyle\` 189 | $\{createGlobalTheme(":root", tokens, { 190 | primary: '#3a5779', 191 | secondary: '#23374e', 192 | })} 193 | \`; 194 | `, 195 | 196 | emotion: ` 197 | import { createGlobalTheme } from 'css-variable'; 198 | import { Global, css } from '@emotion/react'; 199 | import { tokens } from './tokens'; 200 | 201 | export const GlobalStyles = () => 202 | ; 208 | `, 209 | 210 | linaria: ` 211 | import { createGlobalTheme } from 'css-variable'; 212 | import { css } from 'linaria'; 213 | import { tokens } from './tokens'; 214 | 215 | export const globalStyles = css\`:global() { 216 | $\{createGlobalTheme(":root", tokens, { 217 | primary: '#3a5779', 218 | secondary: '#23374e', 219 | }) 220 | }\`; 221 | `, 222 | }} 223 | 224 | 225 | 226 | {{ 227 | "js source": ` 228 | import { tokens } from './tokens'; 229 | 230 | export const Headline = styled.h1\` 231 | color: \${tokens.primary}; 232 | \`; 233 | `, 234 | "css result": ` 235 | .se7gjt0-headline { 236 | color: var(--primary--1isauia0); 237 | } 238 | `, 239 | }} 240 | 241 | 242 |
243 | 244 |
245 | 246 | Create themable CSS Snippets 247 | 248 | Define which parts of your reusable css are customizable without 249 | overwrites 250 | 251 | 252 | 253 | 254 | {{ 255 | base: ` 256 | export const startColor = createVar({value: '#238f97'}); 257 | export const endColor = createVar({value: '#5442bb'}); 258 | 259 | export const gradientHover = css\` 260 | background: linear-gradient(to right, 261 | \${gradientStartColor.val}, 262 | \${gradientEndColor.val}); 263 | 264 | background-size: 200% 200%; 265 | animation: rainbow 2s ease-in-out infinite; 266 | background-clip: text; 267 | 268 | :focus, :hover { 269 | color:rgba(0,0,0,0); 270 | } 271 | @keyframes rainbow { 272 | 0%{background-position:left} 273 | 50%{background-position:right} 274 | 100%{background-position:left} 275 | } 276 | \`; 277 | `, 278 | }} 279 | 280 | 281 | {{ 282 | "js source": ` 283 | import { startColor, endColor, gradientHover } from './gradient'; 284 | 285 | export const Button = styled.button\` 286 | \${startColor.toStyle('#f5ab35')} 287 | \${endColor.toStyle('#8d1d1d')} 288 | \${gradientHover} 289 | \`; 290 | `, 291 | "css result": ` 292 | .se7gjt0-button { 293 | --1isauia0: #f5ab35; 294 | --1isauia1: #8d1d1d; 295 | /* the css from gradientHover */ 296 | } 297 | `, 298 | }} 299 | 300 | 301 |
302 | 303 |
304 | 305 | Unique and consistent variable names 306 | 307 | The recommended babel plugin generates unique variable names during 308 | build time 309 | 310 |

311 | Automatic DX 312 | 313 | All babel generated variable names will have human readable names 314 | during development 315 | 316 |
317 | 318 | 319 | {{ 320 | babel: ` 321 | { 322 | "plugins": [ 323 | "css-variable/babel" 324 | ] 325 | } 326 | `, 327 | swc: ` 328 | { 329 | "plugins": [ 330 | "css-variable/swc", { "basePath": __dirname }, 331 | ] 332 | } 333 | `, 334 | withOptions: ` 335 | { 336 | "plugins": [ 337 | ["css-variable/babel", { 338 | // Prefix vairables with a readable name e.g. 'primary--1isauia0' 339 | // Default for production: false 340 | // Default for development: true 341 | displayName: true 342 | }] 343 | ] 344 | } 345 | `, 346 | }} 347 | 348 | 349 | {{ 350 | original: ` 351 | import { createVar } from 'css-variable'; 352 | 353 | export const theme = { 354 | primary: createVar(), 355 | secondary: createVar(), 356 | }; 357 | `, 358 | "transpiled dev": ` 359 | import { createVar } from 'css-variable'; 360 | 361 | export const theme = { 362 | primary: /*@__PURE__*/createVar("primary--1isauia0"), 363 | secondary: /*@__PURE__*/createVar("secondary--1isauia1"), 364 | }; 365 | `, 366 | "transpiled prod": ` 367 | import { createVar } from 'css-variable'; 368 | 369 | export const theme = { 370 | primary: /*@__PURE__*/createVar("1isauia0"), 371 | secondary: /*@__PURE__*/createVar("1isauia1"), 372 | }; 373 | `, 374 | }} 375 | 376 | 377 |
378 | 379 |
380 | 381 | Typed Contracts 382 | 383 | By default any string is a valid value for a CSSVariable. 384 |
385 |
386 | But it doesn't end here - the generic interface allows to define 387 | explicitly which values are assignable 388 |
389 |
390 | 391 | 392 | {{ 393 | base: ` 394 | import { createVar } from 'css-variable'; 395 | import type { CSSHexColor, CSSPixelValue } from 'css-variable'; 396 | 397 | export const tokens = { 398 | colors: { 399 | primary: createVar(), 400 | secondary: createVar(), 401 | }, 402 | spacing: { 403 | large: createVar() 404 | } 405 | }; 406 | `, 407 | }} 408 | 409 | 410 |
411 |
412 | 459 | 460 | ); 461 | 462 | export default Index; 463 | -------------------------------------------------------------------------------- /swc/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.8.12" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" 10 | dependencies = [ 11 | "cfg-if", 12 | "once_cell", 13 | "version_check", 14 | "zerocopy", 15 | ] 16 | 17 | [[package]] 18 | name = "aho-corasick" 19 | version = "1.1.3" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 22 | dependencies = [ 23 | "memchr", 24 | ] 25 | 26 | [[package]] 27 | name = "allocator-api2" 28 | version = "0.2.21" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 31 | 32 | [[package]] 33 | name = "anes" 34 | version = "0.1.6" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" 37 | 38 | [[package]] 39 | name = "ansi_term" 40 | version = "0.12.1" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 43 | dependencies = [ 44 | "winapi", 45 | ] 46 | 47 | [[package]] 48 | name = "anstyle" 49 | version = "1.0.11" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" 52 | 53 | [[package]] 54 | name = "anyhow" 55 | version = "1.0.98" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" 58 | 59 | [[package]] 60 | name = "arrayvec" 61 | version = "0.7.6" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" 64 | 65 | [[package]] 66 | name = "ascii" 67 | version = "1.1.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" 70 | 71 | [[package]] 72 | name = "ast_node" 73 | version = "4.0.0" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "c4902c7f39335a2390500ee791d6cb1778e742c7b97952497ec81449a5bfa3a7" 76 | dependencies = [ 77 | "quote", 78 | "swc_macros_common", 79 | "syn", 80 | ] 81 | 82 | [[package]] 83 | name = "autocfg" 84 | version = "1.5.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 87 | 88 | [[package]] 89 | name = "base62" 90 | version = "2.2.1" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "10e52a7bcb1d6beebee21fb5053af9e3cbb7a7ed1a4909e534040e676437ab1f" 93 | dependencies = [ 94 | "rustversion", 95 | ] 96 | 97 | [[package]] 98 | name = "base64" 99 | version = "0.22.1" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 102 | 103 | [[package]] 104 | name = "base64-simd" 105 | version = "0.8.0" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" 108 | dependencies = [ 109 | "outref", 110 | "vsimd", 111 | ] 112 | 113 | [[package]] 114 | name = "better_scoped_tls" 115 | version = "1.0.1" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "7cd228125315b132eed175bf47619ac79b945b26e56b848ba203ae4ea8603609" 118 | dependencies = [ 119 | "scoped-tls", 120 | ] 121 | 122 | [[package]] 123 | name = "bitflags" 124 | version = "2.9.1" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" 127 | 128 | [[package]] 129 | name = "bitvec" 130 | version = "1.0.1" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 133 | dependencies = [ 134 | "funty", 135 | "radium", 136 | "tap", 137 | "wyz", 138 | ] 139 | 140 | [[package]] 141 | name = "block-buffer" 142 | version = "0.10.4" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 145 | dependencies = [ 146 | "generic-array", 147 | ] 148 | 149 | [[package]] 150 | name = "bumpalo" 151 | version = "3.19.0" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" 154 | dependencies = [ 155 | "allocator-api2", 156 | ] 157 | 158 | [[package]] 159 | name = "bytecheck" 160 | version = "0.8.1" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" 163 | dependencies = [ 164 | "bytecheck_derive", 165 | "ptr_meta", 166 | "rancor", 167 | "simdutf8", 168 | ] 169 | 170 | [[package]] 171 | name = "bytecheck_derive" 172 | version = "0.8.1" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" 175 | dependencies = [ 176 | "proc-macro2", 177 | "quote", 178 | "syn", 179 | ] 180 | 181 | [[package]] 182 | name = "bytes" 183 | version = "1.10.1" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 186 | 187 | [[package]] 188 | name = "bytes-str" 189 | version = "0.2.7" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "7c60b5ce37e0b883c37eb89f79a1e26fbe9c1081945d024eee93e8d91a7e18b3" 192 | dependencies = [ 193 | "bytes", 194 | "rkyv", 195 | "serde", 196 | ] 197 | 198 | [[package]] 199 | name = "camino" 200 | version = "1.1.10" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" 203 | dependencies = [ 204 | "serde", 205 | ] 206 | 207 | [[package]] 208 | name = "cargo-platform" 209 | version = "0.1.9" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" 212 | dependencies = [ 213 | "serde", 214 | ] 215 | 216 | [[package]] 217 | name = "cargo_metadata" 218 | version = "0.18.1" 219 | source = "registry+https://github.com/rust-lang/crates.io-index" 220 | checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" 221 | dependencies = [ 222 | "camino", 223 | "cargo-platform", 224 | "semver", 225 | "serde", 226 | "serde_json", 227 | "thiserror 1.0.69", 228 | ] 229 | 230 | [[package]] 231 | name = "cargo_metadata" 232 | version = "0.19.2" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" 235 | dependencies = [ 236 | "camino", 237 | "cargo-platform", 238 | "semver", 239 | "serde", 240 | "serde_json", 241 | "thiserror 2.0.12", 242 | ] 243 | 244 | [[package]] 245 | name = "cast" 246 | version = "0.3.0" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" 249 | 250 | [[package]] 251 | name = "castaway" 252 | version = "0.2.4" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" 255 | dependencies = [ 256 | "rustversion", 257 | ] 258 | 259 | [[package]] 260 | name = "cc" 261 | version = "1.2.29" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" 264 | dependencies = [ 265 | "shlex", 266 | ] 267 | 268 | [[package]] 269 | name = "cfg-if" 270 | version = "1.0.1" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" 273 | 274 | [[package]] 275 | name = "ciborium" 276 | version = "0.2.2" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" 279 | dependencies = [ 280 | "ciborium-io", 281 | "ciborium-ll", 282 | "serde", 283 | ] 284 | 285 | [[package]] 286 | name = "ciborium-io" 287 | version = "0.2.2" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" 290 | 291 | [[package]] 292 | name = "ciborium-ll" 293 | version = "0.2.2" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" 296 | dependencies = [ 297 | "ciborium-io", 298 | "half", 299 | ] 300 | 301 | [[package]] 302 | name = "clap" 303 | version = "4.5.41" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" 306 | dependencies = [ 307 | "clap_builder", 308 | ] 309 | 310 | [[package]] 311 | name = "clap_builder" 312 | version = "4.5.41" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" 315 | dependencies = [ 316 | "anstyle", 317 | "clap_lex", 318 | ] 319 | 320 | [[package]] 321 | name = "clap_lex" 322 | version = "0.7.5" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" 325 | 326 | [[package]] 327 | name = "compact_str" 328 | version = "0.7.1" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" 331 | dependencies = [ 332 | "castaway", 333 | "cfg-if", 334 | "itoa", 335 | "ryu", 336 | "static_assertions", 337 | ] 338 | 339 | [[package]] 340 | name = "cpufeatures" 341 | version = "0.2.17" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" 344 | dependencies = [ 345 | "libc", 346 | ] 347 | 348 | [[package]] 349 | name = "criterion" 350 | version = "0.5.1" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" 353 | dependencies = [ 354 | "anes", 355 | "cast", 356 | "ciborium", 357 | "clap", 358 | "criterion-plot", 359 | "is-terminal", 360 | "itertools", 361 | "num-traits", 362 | "once_cell", 363 | "oorandom", 364 | "regex", 365 | "serde", 366 | "serde_derive", 367 | "serde_json", 368 | "tinytemplate", 369 | "walkdir", 370 | ] 371 | 372 | [[package]] 373 | name = "criterion-plot" 374 | version = "0.5.0" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" 377 | dependencies = [ 378 | "cast", 379 | "itertools", 380 | ] 381 | 382 | [[package]] 383 | name = "crunchy" 384 | version = "0.2.4" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" 387 | 388 | [[package]] 389 | name = "crypto-common" 390 | version = "0.1.6" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 393 | dependencies = [ 394 | "generic-array", 395 | "typenum", 396 | ] 397 | 398 | [[package]] 399 | name = "darling" 400 | version = "0.20.11" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" 403 | dependencies = [ 404 | "darling_core", 405 | "darling_macro", 406 | ] 407 | 408 | [[package]] 409 | name = "darling_core" 410 | version = "0.20.11" 411 | source = "registry+https://github.com/rust-lang/crates.io-index" 412 | checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" 413 | dependencies = [ 414 | "fnv", 415 | "ident_case", 416 | "proc-macro2", 417 | "quote", 418 | "strsim", 419 | "syn", 420 | ] 421 | 422 | [[package]] 423 | name = "darling_macro" 424 | version = "0.20.11" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" 427 | dependencies = [ 428 | "darling_core", 429 | "quote", 430 | "syn", 431 | ] 432 | 433 | [[package]] 434 | name = "data-encoding" 435 | version = "2.9.0" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" 438 | 439 | [[package]] 440 | name = "debugid" 441 | version = "0.8.0" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" 444 | dependencies = [ 445 | "serde", 446 | "uuid", 447 | ] 448 | 449 | [[package]] 450 | name = "derive_builder" 451 | version = "0.20.2" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" 454 | dependencies = [ 455 | "derive_builder_macro", 456 | ] 457 | 458 | [[package]] 459 | name = "derive_builder_core" 460 | version = "0.20.2" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" 463 | dependencies = [ 464 | "darling", 465 | "proc-macro2", 466 | "quote", 467 | "syn", 468 | ] 469 | 470 | [[package]] 471 | name = "derive_builder_macro" 472 | version = "0.20.2" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" 475 | dependencies = [ 476 | "derive_builder_core", 477 | "syn", 478 | ] 479 | 480 | [[package]] 481 | name = "diff" 482 | version = "0.1.13" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" 485 | 486 | [[package]] 487 | name = "difference" 488 | version = "2.0.0" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" 491 | 492 | [[package]] 493 | name = "digest" 494 | version = "0.10.7" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 497 | dependencies = [ 498 | "block-buffer", 499 | "crypto-common", 500 | ] 501 | 502 | [[package]] 503 | name = "displaydoc" 504 | version = "0.2.5" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 507 | dependencies = [ 508 | "proc-macro2", 509 | "quote", 510 | "syn", 511 | ] 512 | 513 | [[package]] 514 | name = "either" 515 | version = "1.15.0" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 518 | 519 | [[package]] 520 | name = "equivalent" 521 | version = "1.0.2" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 524 | 525 | [[package]] 526 | name = "errno" 527 | version = "0.3.13" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" 530 | dependencies = [ 531 | "libc", 532 | "windows-sys 0.60.2", 533 | ] 534 | 535 | [[package]] 536 | name = "fastrand" 537 | version = "2.3.0" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 540 | 541 | [[package]] 542 | name = "fnv" 543 | version = "1.0.7" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 546 | 547 | [[package]] 548 | name = "form_urlencoded" 549 | version = "1.2.1" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 552 | dependencies = [ 553 | "percent-encoding", 554 | ] 555 | 556 | [[package]] 557 | name = "from_variant" 558 | version = "2.0.2" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "308530a56b099da144ebc5d8e179f343ad928fa2b3558d1eb3db9af18d6eff43" 561 | dependencies = [ 562 | "swc_macros_common", 563 | "syn", 564 | ] 565 | 566 | [[package]] 567 | name = "funty" 568 | version = "2.0.0" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 571 | 572 | [[package]] 573 | name = "generic-array" 574 | version = "0.14.7" 575 | source = "registry+https://github.com/rust-lang/crates.io-index" 576 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 577 | dependencies = [ 578 | "typenum", 579 | "version_check", 580 | ] 581 | 582 | [[package]] 583 | name = "getrandom" 584 | version = "0.3.3" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" 587 | dependencies = [ 588 | "cfg-if", 589 | "libc", 590 | "r-efi", 591 | "wasi", 592 | ] 593 | 594 | [[package]] 595 | name = "glob" 596 | version = "0.3.2" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" 599 | 600 | [[package]] 601 | name = "half" 602 | version = "2.6.0" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" 605 | dependencies = [ 606 | "cfg-if", 607 | "crunchy", 608 | ] 609 | 610 | [[package]] 611 | name = "hashbrown" 612 | version = "0.14.5" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 615 | dependencies = [ 616 | "ahash", 617 | "allocator-api2", 618 | ] 619 | 620 | [[package]] 621 | name = "hashbrown" 622 | version = "0.15.4" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" 625 | 626 | [[package]] 627 | name = "heck" 628 | version = "0.5.0" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 631 | 632 | [[package]] 633 | name = "hermit-abi" 634 | version = "0.5.2" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" 637 | 638 | [[package]] 639 | name = "hex" 640 | version = "0.4.3" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 643 | 644 | [[package]] 645 | name = "hstr" 646 | version = "2.1.0" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "31f11d91d7befd2ffd9d216e9e5ea1fae6174b20a2a1b67a688138003d2f4122" 649 | dependencies = [ 650 | "hashbrown 0.14.5", 651 | "new_debug_unreachable", 652 | "once_cell", 653 | "rustc-hash", 654 | "triomphe", 655 | ] 656 | 657 | [[package]] 658 | name = "icu_collections" 659 | version = "2.0.0" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" 662 | dependencies = [ 663 | "displaydoc", 664 | "potential_utf", 665 | "yoke", 666 | "zerofrom", 667 | "zerovec", 668 | ] 669 | 670 | [[package]] 671 | name = "icu_locale_core" 672 | version = "2.0.0" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" 675 | dependencies = [ 676 | "displaydoc", 677 | "litemap", 678 | "tinystr", 679 | "writeable", 680 | "zerovec", 681 | ] 682 | 683 | [[package]] 684 | name = "icu_normalizer" 685 | version = "2.0.0" 686 | source = "registry+https://github.com/rust-lang/crates.io-index" 687 | checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" 688 | dependencies = [ 689 | "displaydoc", 690 | "icu_collections", 691 | "icu_normalizer_data", 692 | "icu_properties", 693 | "icu_provider", 694 | "smallvec", 695 | "zerovec", 696 | ] 697 | 698 | [[package]] 699 | name = "icu_normalizer_data" 700 | version = "2.0.0" 701 | source = "registry+https://github.com/rust-lang/crates.io-index" 702 | checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" 703 | 704 | [[package]] 705 | name = "icu_properties" 706 | version = "2.0.1" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" 709 | dependencies = [ 710 | "displaydoc", 711 | "icu_collections", 712 | "icu_locale_core", 713 | "icu_properties_data", 714 | "icu_provider", 715 | "potential_utf", 716 | "zerotrie", 717 | "zerovec", 718 | ] 719 | 720 | [[package]] 721 | name = "icu_properties_data" 722 | version = "2.0.1" 723 | source = "registry+https://github.com/rust-lang/crates.io-index" 724 | checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" 725 | 726 | [[package]] 727 | name = "icu_provider" 728 | version = "2.0.0" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" 731 | dependencies = [ 732 | "displaydoc", 733 | "icu_locale_core", 734 | "stable_deref_trait", 735 | "tinystr", 736 | "writeable", 737 | "yoke", 738 | "zerofrom", 739 | "zerotrie", 740 | "zerovec", 741 | ] 742 | 743 | [[package]] 744 | name = "ident_case" 745 | version = "1.0.1" 746 | source = "registry+https://github.com/rust-lang/crates.io-index" 747 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 748 | 749 | [[package]] 750 | name = "idna" 751 | version = "1.0.3" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" 754 | dependencies = [ 755 | "idna_adapter", 756 | "smallvec", 757 | "utf8_iter", 758 | ] 759 | 760 | [[package]] 761 | name = "idna_adapter" 762 | version = "1.2.1" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 765 | dependencies = [ 766 | "icu_normalizer", 767 | "icu_properties", 768 | ] 769 | 770 | [[package]] 771 | name = "if_chain" 772 | version = "1.0.2" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" 775 | 776 | [[package]] 777 | name = "indexmap" 778 | version = "2.10.0" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" 781 | dependencies = [ 782 | "equivalent", 783 | "hashbrown 0.15.4", 784 | ] 785 | 786 | [[package]] 787 | name = "is-macro" 788 | version = "0.3.7" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | checksum = "1d57a3e447e24c22647738e4607f1df1e0ec6f72e16182c4cd199f647cdfb0e4" 791 | dependencies = [ 792 | "heck", 793 | "proc-macro2", 794 | "quote", 795 | "syn", 796 | ] 797 | 798 | [[package]] 799 | name = "is-terminal" 800 | version = "0.4.16" 801 | source = "registry+https://github.com/rust-lang/crates.io-index" 802 | checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" 803 | dependencies = [ 804 | "hermit-abi", 805 | "libc", 806 | "windows-sys 0.59.0", 807 | ] 808 | 809 | [[package]] 810 | name = "itertools" 811 | version = "0.10.5" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 814 | dependencies = [ 815 | "either", 816 | ] 817 | 818 | [[package]] 819 | name = "itoa" 820 | version = "1.0.15" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 823 | 824 | [[package]] 825 | name = "js-sys" 826 | version = "0.3.77" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" 829 | dependencies = [ 830 | "once_cell", 831 | "wasm-bindgen", 832 | ] 833 | 834 | [[package]] 835 | name = "lazy_static" 836 | version = "1.5.0" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 839 | 840 | [[package]] 841 | name = "libc" 842 | version = "0.2.174" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" 845 | 846 | [[package]] 847 | name = "linux-raw-sys" 848 | version = "0.9.4" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" 851 | 852 | [[package]] 853 | name = "litemap" 854 | version = "0.8.0" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" 857 | 858 | [[package]] 859 | name = "lock_api" 860 | version = "0.4.13" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" 863 | dependencies = [ 864 | "autocfg", 865 | "scopeguard", 866 | ] 867 | 868 | [[package]] 869 | name = "log" 870 | version = "0.4.27" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" 873 | 874 | [[package]] 875 | name = "matchers" 876 | version = "0.2.0" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" 879 | dependencies = [ 880 | "regex-automata", 881 | ] 882 | 883 | [[package]] 884 | name = "memchr" 885 | version = "2.7.5" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" 888 | 889 | [[package]] 890 | name = "miette" 891 | version = "7.6.0" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" 894 | dependencies = [ 895 | "cfg-if", 896 | "miette-derive", 897 | "owo-colors", 898 | "textwrap", 899 | "unicode-width 0.1.14", 900 | ] 901 | 902 | [[package]] 903 | name = "miette-derive" 904 | version = "7.6.0" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" 907 | dependencies = [ 908 | "proc-macro2", 909 | "quote", 910 | "syn", 911 | ] 912 | 913 | [[package]] 914 | name = "munge" 915 | version = "0.4.5" 916 | source = "registry+https://github.com/rust-lang/crates.io-index" 917 | checksum = "9cce144fab80fbb74ec5b89d1ca9d41ddf6b644ab7e986f7d3ed0aab31625cb1" 918 | dependencies = [ 919 | "munge_macro", 920 | ] 921 | 922 | [[package]] 923 | name = "munge_macro" 924 | version = "0.4.5" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "574af9cd5b9971cbfdf535d6a8d533778481b241c447826d976101e0149392a1" 927 | dependencies = [ 928 | "proc-macro2", 929 | "quote", 930 | "syn", 931 | ] 932 | 933 | [[package]] 934 | name = "new_debug_unreachable" 935 | version = "1.0.6" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" 938 | 939 | [[package]] 940 | name = "nu-ansi-term" 941 | version = "0.50.3" 942 | source = "registry+https://github.com/rust-lang/crates.io-index" 943 | checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" 944 | dependencies = [ 945 | "windows-sys 0.60.2", 946 | ] 947 | 948 | [[package]] 949 | name = "num-bigint" 950 | version = "0.4.6" 951 | source = "registry+https://github.com/rust-lang/crates.io-index" 952 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 953 | dependencies = [ 954 | "num-integer", 955 | "num-traits", 956 | "serde", 957 | ] 958 | 959 | [[package]] 960 | name = "num-integer" 961 | version = "0.1.46" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 964 | dependencies = [ 965 | "num-traits", 966 | ] 967 | 968 | [[package]] 969 | name = "num-traits" 970 | version = "0.2.19" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 973 | dependencies = [ 974 | "autocfg", 975 | ] 976 | 977 | [[package]] 978 | name = "num_cpus" 979 | version = "1.17.0" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" 982 | dependencies = [ 983 | "hermit-abi", 984 | "libc", 985 | ] 986 | 987 | [[package]] 988 | name = "once_cell" 989 | version = "1.21.3" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 992 | 993 | [[package]] 994 | name = "oorandom" 995 | version = "11.1.5" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" 998 | 999 | [[package]] 1000 | name = "outref" 1001 | version = "0.5.2" 1002 | source = "registry+https://github.com/rust-lang/crates.io-index" 1003 | checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" 1004 | 1005 | [[package]] 1006 | name = "owo-colors" 1007 | version = "4.2.2" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" 1010 | 1011 | [[package]] 1012 | name = "par-core" 1013 | version = "2.0.0" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "e96cbd21255b7fb29a5d51ef38a779b517a91abd59e2756c039583f43ef4c90f" 1016 | dependencies = [ 1017 | "once_cell", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "parking_lot" 1022 | version = "0.12.4" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" 1025 | dependencies = [ 1026 | "lock_api", 1027 | "parking_lot_core", 1028 | ] 1029 | 1030 | [[package]] 1031 | name = "parking_lot_core" 1032 | version = "0.9.11" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" 1035 | dependencies = [ 1036 | "cfg-if", 1037 | "libc", 1038 | "redox_syscall", 1039 | "smallvec", 1040 | "windows-targets 0.52.6", 1041 | ] 1042 | 1043 | [[package]] 1044 | name = "pathdiff" 1045 | version = "0.2.3" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" 1048 | 1049 | [[package]] 1050 | name = "percent-encoding" 1051 | version = "2.3.1" 1052 | source = "registry+https://github.com/rust-lang/crates.io-index" 1053 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 1054 | 1055 | [[package]] 1056 | name = "phf" 1057 | version = "0.11.3" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" 1060 | dependencies = [ 1061 | "phf_macros", 1062 | "phf_shared", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "phf_generator" 1067 | version = "0.11.3" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" 1070 | dependencies = [ 1071 | "phf_shared", 1072 | "rand", 1073 | ] 1074 | 1075 | [[package]] 1076 | name = "phf_macros" 1077 | version = "0.11.3" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" 1080 | dependencies = [ 1081 | "phf_generator", 1082 | "phf_shared", 1083 | "proc-macro2", 1084 | "quote", 1085 | "syn", 1086 | ] 1087 | 1088 | [[package]] 1089 | name = "phf_shared" 1090 | version = "0.11.3" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" 1093 | dependencies = [ 1094 | "siphasher 1.0.1", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "pin-project-lite" 1099 | version = "0.2.16" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 1102 | 1103 | [[package]] 1104 | name = "potential_utf" 1105 | version = "0.1.2" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" 1108 | dependencies = [ 1109 | "zerovec", 1110 | ] 1111 | 1112 | [[package]] 1113 | name = "pretty_assertions" 1114 | version = "1.4.1" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" 1117 | dependencies = [ 1118 | "diff", 1119 | "yansi", 1120 | ] 1121 | 1122 | [[package]] 1123 | name = "proc-macro2" 1124 | version = "1.0.95" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" 1127 | dependencies = [ 1128 | "unicode-ident", 1129 | ] 1130 | 1131 | [[package]] 1132 | name = "psm" 1133 | version = "0.1.26" 1134 | source = "registry+https://github.com/rust-lang/crates.io-index" 1135 | checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" 1136 | dependencies = [ 1137 | "cc", 1138 | ] 1139 | 1140 | [[package]] 1141 | name = "ptr_meta" 1142 | version = "0.3.0" 1143 | source = "registry+https://github.com/rust-lang/crates.io-index" 1144 | checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" 1145 | dependencies = [ 1146 | "ptr_meta_derive", 1147 | ] 1148 | 1149 | [[package]] 1150 | name = "ptr_meta_derive" 1151 | version = "0.3.0" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" 1154 | dependencies = [ 1155 | "proc-macro2", 1156 | "quote", 1157 | "syn", 1158 | ] 1159 | 1160 | [[package]] 1161 | name = "quote" 1162 | version = "1.0.40" 1163 | source = "registry+https://github.com/rust-lang/crates.io-index" 1164 | checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 1165 | dependencies = [ 1166 | "proc-macro2", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "r-efi" 1171 | version = "5.3.0" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 1174 | 1175 | [[package]] 1176 | name = "radium" 1177 | version = "0.7.0" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 1180 | 1181 | [[package]] 1182 | name = "rancor" 1183 | version = "0.1.0" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" 1186 | dependencies = [ 1187 | "ptr_meta", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "rand" 1192 | version = "0.8.5" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1195 | dependencies = [ 1196 | "rand_core", 1197 | ] 1198 | 1199 | [[package]] 1200 | name = "rand_core" 1201 | version = "0.6.4" 1202 | source = "registry+https://github.com/rust-lang/crates.io-index" 1203 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1204 | 1205 | [[package]] 1206 | name = "redox_syscall" 1207 | version = "0.5.13" 1208 | source = "registry+https://github.com/rust-lang/crates.io-index" 1209 | checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" 1210 | dependencies = [ 1211 | "bitflags", 1212 | ] 1213 | 1214 | [[package]] 1215 | name = "regex" 1216 | version = "1.11.1" 1217 | source = "registry+https://github.com/rust-lang/crates.io-index" 1218 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 1219 | dependencies = [ 1220 | "aho-corasick", 1221 | "memchr", 1222 | "regex-automata", 1223 | "regex-syntax", 1224 | ] 1225 | 1226 | [[package]] 1227 | name = "regex-automata" 1228 | version = "0.4.9" 1229 | source = "registry+https://github.com/rust-lang/crates.io-index" 1230 | checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" 1231 | dependencies = [ 1232 | "aho-corasick", 1233 | "memchr", 1234 | "regex-syntax", 1235 | ] 1236 | 1237 | [[package]] 1238 | name = "regex-syntax" 1239 | version = "0.8.5" 1240 | source = "registry+https://github.com/rust-lang/crates.io-index" 1241 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1242 | 1243 | [[package]] 1244 | name = "relative-path" 1245 | version = "1.9.3" 1246 | source = "registry+https://github.com/rust-lang/crates.io-index" 1247 | checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" 1248 | 1249 | [[package]] 1250 | name = "rend" 1251 | version = "0.5.2" 1252 | source = "registry+https://github.com/rust-lang/crates.io-index" 1253 | checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" 1254 | dependencies = [ 1255 | "bytecheck", 1256 | ] 1257 | 1258 | [[package]] 1259 | name = "rkyv" 1260 | version = "0.8.10" 1261 | source = "registry+https://github.com/rust-lang/crates.io-index" 1262 | checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" 1263 | dependencies = [ 1264 | "bytecheck", 1265 | "bytes", 1266 | "hashbrown 0.15.4", 1267 | "indexmap", 1268 | "munge", 1269 | "ptr_meta", 1270 | "rancor", 1271 | "rend", 1272 | "rkyv_derive", 1273 | "tinyvec", 1274 | "uuid", 1275 | ] 1276 | 1277 | [[package]] 1278 | name = "rkyv_derive" 1279 | version = "0.8.10" 1280 | source = "registry+https://github.com/rust-lang/crates.io-index" 1281 | checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" 1282 | dependencies = [ 1283 | "proc-macro2", 1284 | "quote", 1285 | "syn", 1286 | ] 1287 | 1288 | [[package]] 1289 | name = "rustc-hash" 1290 | version = "2.1.1" 1291 | source = "registry+https://github.com/rust-lang/crates.io-index" 1292 | checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" 1293 | 1294 | [[package]] 1295 | name = "rustix" 1296 | version = "1.0.8" 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" 1298 | checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" 1299 | dependencies = [ 1300 | "bitflags", 1301 | "errno", 1302 | "libc", 1303 | "linux-raw-sys", 1304 | "windows-sys 0.60.2", 1305 | ] 1306 | 1307 | [[package]] 1308 | name = "rustversion" 1309 | version = "1.0.21" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" 1312 | 1313 | [[package]] 1314 | name = "ryu" 1315 | version = "1.0.20" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 1318 | 1319 | [[package]] 1320 | name = "ryu-js" 1321 | version = "1.0.2" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" 1324 | 1325 | [[package]] 1326 | name = "same-file" 1327 | version = "1.0.6" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1330 | dependencies = [ 1331 | "winapi-util", 1332 | ] 1333 | 1334 | [[package]] 1335 | name = "scoped-tls" 1336 | version = "1.0.1" 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" 1338 | checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" 1339 | 1340 | [[package]] 1341 | name = "scopeguard" 1342 | version = "1.2.0" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1345 | 1346 | [[package]] 1347 | name = "semver" 1348 | version = "1.0.26" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" 1351 | dependencies = [ 1352 | "serde", 1353 | ] 1354 | 1355 | [[package]] 1356 | name = "seq-macro" 1357 | version = "0.3.6" 1358 | source = "registry+https://github.com/rust-lang/crates.io-index" 1359 | checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" 1360 | 1361 | [[package]] 1362 | name = "serde" 1363 | version = "1.0.228" 1364 | source = "registry+https://github.com/rust-lang/crates.io-index" 1365 | checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 1366 | dependencies = [ 1367 | "serde_core", 1368 | "serde_derive", 1369 | ] 1370 | 1371 | [[package]] 1372 | name = "serde_core" 1373 | version = "1.0.228" 1374 | source = "registry+https://github.com/rust-lang/crates.io-index" 1375 | checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 1376 | dependencies = [ 1377 | "serde_derive", 1378 | ] 1379 | 1380 | [[package]] 1381 | name = "serde_derive" 1382 | version = "1.0.228" 1383 | source = "registry+https://github.com/rust-lang/crates.io-index" 1384 | checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 1385 | dependencies = [ 1386 | "proc-macro2", 1387 | "quote", 1388 | "syn", 1389 | ] 1390 | 1391 | [[package]] 1392 | name = "serde_json" 1393 | version = "1.0.140" 1394 | source = "registry+https://github.com/rust-lang/crates.io-index" 1395 | checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" 1396 | dependencies = [ 1397 | "itoa", 1398 | "memchr", 1399 | "ryu", 1400 | "serde", 1401 | ] 1402 | 1403 | [[package]] 1404 | name = "sha2" 1405 | version = "0.10.9" 1406 | source = "registry+https://github.com/rust-lang/crates.io-index" 1407 | checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" 1408 | dependencies = [ 1409 | "cfg-if", 1410 | "cpufeatures", 1411 | "digest", 1412 | ] 1413 | 1414 | [[package]] 1415 | name = "sharded-slab" 1416 | version = "0.1.7" 1417 | source = "registry+https://github.com/rust-lang/crates.io-index" 1418 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 1419 | dependencies = [ 1420 | "lazy_static", 1421 | ] 1422 | 1423 | [[package]] 1424 | name = "shlex" 1425 | version = "1.3.0" 1426 | source = "registry+https://github.com/rust-lang/crates.io-index" 1427 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1428 | 1429 | [[package]] 1430 | name = "simdutf8" 1431 | version = "0.1.5" 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" 1433 | checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" 1434 | 1435 | [[package]] 1436 | name = "siphasher" 1437 | version = "0.3.11" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" 1440 | 1441 | [[package]] 1442 | name = "siphasher" 1443 | version = "1.0.1" 1444 | source = "registry+https://github.com/rust-lang/crates.io-index" 1445 | checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" 1446 | 1447 | [[package]] 1448 | name = "smallvec" 1449 | version = "1.15.1" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 1452 | 1453 | [[package]] 1454 | name = "smartstring" 1455 | version = "1.0.1" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" 1458 | dependencies = [ 1459 | "autocfg", 1460 | "static_assertions", 1461 | "version_check", 1462 | ] 1463 | 1464 | [[package]] 1465 | name = "stable_deref_trait" 1466 | version = "1.2.0" 1467 | source = "registry+https://github.com/rust-lang/crates.io-index" 1468 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1469 | 1470 | [[package]] 1471 | name = "stacker" 1472 | version = "0.1.21" 1473 | source = "registry+https://github.com/rust-lang/crates.io-index" 1474 | checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" 1475 | dependencies = [ 1476 | "cc", 1477 | "cfg-if", 1478 | "libc", 1479 | "psm", 1480 | "windows-sys 0.59.0", 1481 | ] 1482 | 1483 | [[package]] 1484 | name = "static_assertions" 1485 | version = "1.1.0" 1486 | source = "registry+https://github.com/rust-lang/crates.io-index" 1487 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1488 | 1489 | [[package]] 1490 | name = "string_enum" 1491 | version = "1.0.2" 1492 | source = "registry+https://github.com/rust-lang/crates.io-index" 1493 | checksum = "ae36a4951ca7bd1cfd991c241584a9824a70f6aff1e7d4f693fb3f2465e4030e" 1494 | dependencies = [ 1495 | "quote", 1496 | "swc_macros_common", 1497 | "syn", 1498 | ] 1499 | 1500 | [[package]] 1501 | name = "strsim" 1502 | version = "0.11.1" 1503 | source = "registry+https://github.com/rust-lang/crates.io-index" 1504 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1505 | 1506 | [[package]] 1507 | name = "swc-plugin-css-variable" 1508 | version = "0.1.0" 1509 | dependencies = [ 1510 | "lazy_static", 1511 | "pathdiff", 1512 | "regex", 1513 | "serde_json", 1514 | "swc_core", 1515 | "transform", 1516 | ] 1517 | 1518 | [[package]] 1519 | name = "swc_allocator" 1520 | version = "4.0.1" 1521 | source = "registry+https://github.com/rust-lang/crates.io-index" 1522 | checksum = "9d7eefd2c8b228a8c73056482b2ae4b3a1071fbe07638e3b55ceca8570cc48bb" 1523 | dependencies = [ 1524 | "allocator-api2", 1525 | "bumpalo", 1526 | "hashbrown 0.14.5", 1527 | "rustc-hash", 1528 | ] 1529 | 1530 | [[package]] 1531 | name = "swc_atoms" 1532 | version = "7.0.0" 1533 | source = "registry+https://github.com/rust-lang/crates.io-index" 1534 | checksum = "3500dcf04c84606b38464561edc5e46f5132201cb3e23cf9613ed4033d6b1bb2" 1535 | dependencies = [ 1536 | "bytecheck", 1537 | "hstr", 1538 | "once_cell", 1539 | "rancor", 1540 | "rkyv", 1541 | "serde", 1542 | ] 1543 | 1544 | [[package]] 1545 | name = "swc_common" 1546 | version = "15.0.0" 1547 | source = "registry+https://github.com/rust-lang/crates.io-index" 1548 | checksum = "13be0317490fc330a53ee9e64b26891503c35336b509eb69c4fc1dc4e0119ff9" 1549 | dependencies = [ 1550 | "anyhow", 1551 | "ast_node", 1552 | "better_scoped_tls", 1553 | "bytecheck", 1554 | "bytes-str", 1555 | "either", 1556 | "from_variant", 1557 | "new_debug_unreachable", 1558 | "num-bigint", 1559 | "once_cell", 1560 | "parking_lot", 1561 | "rancor", 1562 | "rkyv", 1563 | "rustc-hash", 1564 | "serde", 1565 | "siphasher 0.3.11", 1566 | "swc_atoms", 1567 | "swc_eq_ignore_macros", 1568 | "swc_sourcemap", 1569 | "swc_visit", 1570 | "termcolor", 1571 | "tracing", 1572 | "unicode-width 0.1.14", 1573 | "url", 1574 | ] 1575 | 1576 | [[package]] 1577 | name = "swc_core" 1578 | version = "45.0.2" 1579 | source = "registry+https://github.com/rust-lang/crates.io-index" 1580 | checksum = "54e3f7a14efb82fd970b90afb1fc1afe34d969ad4b2adc4a63803cfc95249f08" 1581 | dependencies = [ 1582 | "swc_allocator", 1583 | "swc_atoms", 1584 | "swc_common", 1585 | "swc_ecma_ast", 1586 | "swc_ecma_parser", 1587 | "swc_ecma_transforms_base", 1588 | "swc_ecma_transforms_testing", 1589 | "swc_ecma_visit", 1590 | "swc_plugin", 1591 | "swc_plugin_macro", 1592 | "swc_plugin_proxy", 1593 | "swc_transform_common", 1594 | "vergen", 1595 | ] 1596 | 1597 | [[package]] 1598 | name = "swc_ecma_ast" 1599 | version = "16.0.0" 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" 1601 | checksum = "add9298e06af471f29aea2f8d1b6232885bd2a634521d0e95dc9d5bde3d39d3d" 1602 | dependencies = [ 1603 | "bitflags", 1604 | "bytecheck", 1605 | "is-macro", 1606 | "num-bigint", 1607 | "once_cell", 1608 | "phf", 1609 | "rancor", 1610 | "rkyv", 1611 | "rustc-hash", 1612 | "string_enum", 1613 | "swc_atoms", 1614 | "swc_common", 1615 | "swc_visit", 1616 | "unicode-id-start", 1617 | ] 1618 | 1619 | [[package]] 1620 | name = "swc_ecma_codegen" 1621 | version = "18.0.0" 1622 | source = "registry+https://github.com/rust-lang/crates.io-index" 1623 | checksum = "c70760095f23e70a295bc86dd52d454f5de4050621c9e27681ae26d166b77be4" 1624 | dependencies = [ 1625 | "ascii", 1626 | "compact_str", 1627 | "memchr", 1628 | "num-bigint", 1629 | "once_cell", 1630 | "regex", 1631 | "rustc-hash", 1632 | "ryu-js", 1633 | "serde", 1634 | "swc_allocator", 1635 | "swc_atoms", 1636 | "swc_common", 1637 | "swc_ecma_ast", 1638 | "swc_ecma_codegen_macros", 1639 | "swc_sourcemap", 1640 | "tracing", 1641 | ] 1642 | 1643 | [[package]] 1644 | name = "swc_ecma_codegen_macros" 1645 | version = "2.0.2" 1646 | source = "registry+https://github.com/rust-lang/crates.io-index" 1647 | checksum = "e276dc62c0a2625a560397827989c82a93fd545fcf6f7faec0935a82cc4ddbb8" 1648 | dependencies = [ 1649 | "proc-macro2", 1650 | "swc_macros_common", 1651 | "syn", 1652 | ] 1653 | 1654 | [[package]] 1655 | name = "swc_ecma_lexer" 1656 | version = "24.0.1" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "d64b5db3b7cdba77d4063f7a0747333685cfb843fa2260d0c0765eff4bc82d0b" 1659 | dependencies = [ 1660 | "arrayvec", 1661 | "bitflags", 1662 | "either", 1663 | "num-bigint", 1664 | "phf", 1665 | "rustc-hash", 1666 | "seq-macro", 1667 | "serde", 1668 | "smallvec", 1669 | "smartstring", 1670 | "stacker", 1671 | "swc_atoms", 1672 | "swc_common", 1673 | "swc_ecma_ast", 1674 | "tracing", 1675 | ] 1676 | 1677 | [[package]] 1678 | name = "swc_ecma_parser" 1679 | version = "25.0.0" 1680 | source = "registry+https://github.com/rust-lang/crates.io-index" 1681 | checksum = "c8a43a89976cdbb42f152cfbd89a430b1fb693a9e0f2b5e2b1959466a88c3de0" 1682 | dependencies = [ 1683 | "either", 1684 | "num-bigint", 1685 | "serde", 1686 | "swc_atoms", 1687 | "swc_common", 1688 | "swc_ecma_ast", 1689 | "swc_ecma_lexer", 1690 | "tracing", 1691 | ] 1692 | 1693 | [[package]] 1694 | name = "swc_ecma_testing" 1695 | version = "16.0.0" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "464be50bb5a907f43cf3559ccecec38bd69f91b580bcdbda9a65a35d8627b7f3" 1698 | dependencies = [ 1699 | "anyhow", 1700 | "hex", 1701 | "sha2", 1702 | "testing", 1703 | "tracing", 1704 | ] 1705 | 1706 | [[package]] 1707 | name = "swc_ecma_transforms_base" 1708 | version = "28.0.1" 1709 | source = "registry+https://github.com/rust-lang/crates.io-index" 1710 | checksum = "f892bb70d780486b86485493a3c7f4df8d84d5caba7e1d83e2e700836c29d613" 1711 | dependencies = [ 1712 | "better_scoped_tls", 1713 | "indexmap", 1714 | "once_cell", 1715 | "par-core", 1716 | "phf", 1717 | "rustc-hash", 1718 | "serde", 1719 | "swc_atoms", 1720 | "swc_common", 1721 | "swc_ecma_ast", 1722 | "swc_ecma_parser", 1723 | "swc_ecma_utils", 1724 | "swc_ecma_visit", 1725 | "tracing", 1726 | ] 1727 | 1728 | [[package]] 1729 | name = "swc_ecma_transforms_testing" 1730 | version = "31.0.0" 1731 | source = "registry+https://github.com/rust-lang/crates.io-index" 1732 | checksum = "ba723011d5a35faa99e61ca0de21f6c61c3449423b3709d7dce52b7ac4d10aa4" 1733 | dependencies = [ 1734 | "ansi_term", 1735 | "anyhow", 1736 | "base64", 1737 | "hex", 1738 | "serde", 1739 | "serde_json", 1740 | "sha2", 1741 | "swc_common", 1742 | "swc_ecma_ast", 1743 | "swc_ecma_codegen", 1744 | "swc_ecma_parser", 1745 | "swc_ecma_testing", 1746 | "swc_ecma_transforms_base", 1747 | "swc_ecma_utils", 1748 | "swc_ecma_visit", 1749 | "swc_sourcemap", 1750 | "tempfile", 1751 | "testing", 1752 | ] 1753 | 1754 | [[package]] 1755 | name = "swc_ecma_utils" 1756 | version = "22.0.0" 1757 | source = "registry+https://github.com/rust-lang/crates.io-index" 1758 | checksum = "110befba503dcec034023f4ad3559b84991c7a4be977287300db9562955bda1d" 1759 | dependencies = [ 1760 | "indexmap", 1761 | "num_cpus", 1762 | "once_cell", 1763 | "par-core", 1764 | "rustc-hash", 1765 | "ryu-js", 1766 | "swc_atoms", 1767 | "swc_common", 1768 | "swc_ecma_ast", 1769 | "swc_ecma_visit", 1770 | "tracing", 1771 | ] 1772 | 1773 | [[package]] 1774 | name = "swc_ecma_visit" 1775 | version = "16.0.0" 1776 | source = "registry+https://github.com/rust-lang/crates.io-index" 1777 | checksum = "e8763b91f52a54d5836c1f922dd393b157d47c121c7aab87308f582daf345f77" 1778 | dependencies = [ 1779 | "new_debug_unreachable", 1780 | "num-bigint", 1781 | "swc_atoms", 1782 | "swc_common", 1783 | "swc_ecma_ast", 1784 | "swc_visit", 1785 | "tracing", 1786 | ] 1787 | 1788 | [[package]] 1789 | name = "swc_eq_ignore_macros" 1790 | version = "1.0.1" 1791 | source = "registry+https://github.com/rust-lang/crates.io-index" 1792 | checksum = "c16ce73424a6316e95e09065ba6a207eba7765496fed113702278b7711d4b632" 1793 | dependencies = [ 1794 | "proc-macro2", 1795 | "quote", 1796 | "syn", 1797 | ] 1798 | 1799 | [[package]] 1800 | name = "swc_error_reporters" 1801 | version = "17.0.0" 1802 | source = "registry+https://github.com/rust-lang/crates.io-index" 1803 | checksum = "61f991c703dea8982ebfb955a0b1c35fdfe551b24d8d13039c5a0b66e381edbd" 1804 | dependencies = [ 1805 | "anyhow", 1806 | "miette", 1807 | "once_cell", 1808 | "serde", 1809 | "swc_common", 1810 | ] 1811 | 1812 | [[package]] 1813 | name = "swc_macros_common" 1814 | version = "1.0.1" 1815 | source = "registry+https://github.com/rust-lang/crates.io-index" 1816 | checksum = "aae1efbaa74943dc5ad2a2fb16cbd78b77d7e4d63188f3c5b4df2b4dcd2faaae" 1817 | dependencies = [ 1818 | "proc-macro2", 1819 | "quote", 1820 | "syn", 1821 | ] 1822 | 1823 | [[package]] 1824 | name = "swc_plugin" 1825 | version = "1.0.1" 1826 | source = "registry+https://github.com/rust-lang/crates.io-index" 1827 | checksum = "92b27449420554de6ad8d49004ad3d36e6ac64ecb51d1b0fe1002afcd7a45d85" 1828 | dependencies = [ 1829 | "once_cell", 1830 | ] 1831 | 1832 | [[package]] 1833 | name = "swc_plugin_macro" 1834 | version = "1.1.0" 1835 | source = "registry+https://github.com/rust-lang/crates.io-index" 1836 | checksum = "ace467dfafbbdf3aecff786b8605b35db57d945e92fd88800569aa2cba0cdf61" 1837 | dependencies = [ 1838 | "proc-macro2", 1839 | "quote", 1840 | "syn", 1841 | ] 1842 | 1843 | [[package]] 1844 | name = "swc_plugin_proxy" 1845 | version = "16.0.0" 1846 | source = "registry+https://github.com/rust-lang/crates.io-index" 1847 | checksum = "ef02609fd5dc946a13448833f8443173f45ff1477eb7e3683c0abb03018cdf20" 1848 | dependencies = [ 1849 | "better_scoped_tls", 1850 | "bytecheck", 1851 | "rancor", 1852 | "rkyv", 1853 | "rustc-hash", 1854 | "swc_common", 1855 | "swc_ecma_ast", 1856 | "swc_trace_macro", 1857 | "tracing", 1858 | ] 1859 | 1860 | [[package]] 1861 | name = "swc_sourcemap" 1862 | version = "9.3.2" 1863 | source = "registry+https://github.com/rust-lang/crates.io-index" 1864 | checksum = "9755c673c6a83c461e98fa018f681adb8394a3f44f89a06f27e80fd4fe4fa1e4" 1865 | dependencies = [ 1866 | "base64-simd", 1867 | "bitvec", 1868 | "bytes-str", 1869 | "data-encoding", 1870 | "debugid", 1871 | "if_chain", 1872 | "rustc-hash", 1873 | "serde", 1874 | "serde_json", 1875 | "unicode-id-start", 1876 | "url", 1877 | ] 1878 | 1879 | [[package]] 1880 | name = "swc_trace_macro" 1881 | version = "2.0.2" 1882 | source = "registry+https://github.com/rust-lang/crates.io-index" 1883 | checksum = "dfd2b4b0adb82e36f2ac688d00a6a67132c7f4170c772617516793a701be89e8" 1884 | dependencies = [ 1885 | "quote", 1886 | "syn", 1887 | ] 1888 | 1889 | [[package]] 1890 | name = "swc_transform_common" 1891 | version = "9.0.0" 1892 | source = "registry+https://github.com/rust-lang/crates.io-index" 1893 | checksum = "2b0ccbb3fe8a93a2bbe6df94c205a0ca909bb8786705031d355904efbb89a2a3" 1894 | dependencies = [ 1895 | "better_scoped_tls", 1896 | "rustc-hash", 1897 | "serde", 1898 | "swc_common", 1899 | ] 1900 | 1901 | [[package]] 1902 | name = "swc_visit" 1903 | version = "2.0.1" 1904 | source = "registry+https://github.com/rust-lang/crates.io-index" 1905 | checksum = "62fb71484b486c185e34d2172f0eabe7f4722742aad700f426a494bb2de232a2" 1906 | dependencies = [ 1907 | "either", 1908 | "new_debug_unreachable", 1909 | ] 1910 | 1911 | [[package]] 1912 | name = "syn" 1913 | version = "2.0.104" 1914 | source = "registry+https://github.com/rust-lang/crates.io-index" 1915 | checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" 1916 | dependencies = [ 1917 | "proc-macro2", 1918 | "quote", 1919 | "unicode-ident", 1920 | ] 1921 | 1922 | [[package]] 1923 | name = "synstructure" 1924 | version = "0.13.2" 1925 | source = "registry+https://github.com/rust-lang/crates.io-index" 1926 | checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 1927 | dependencies = [ 1928 | "proc-macro2", 1929 | "quote", 1930 | "syn", 1931 | ] 1932 | 1933 | [[package]] 1934 | name = "tap" 1935 | version = "1.0.1" 1936 | source = "registry+https://github.com/rust-lang/crates.io-index" 1937 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 1938 | 1939 | [[package]] 1940 | name = "tempfile" 1941 | version = "3.20.0" 1942 | source = "registry+https://github.com/rust-lang/crates.io-index" 1943 | checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" 1944 | dependencies = [ 1945 | "fastrand", 1946 | "getrandom", 1947 | "once_cell", 1948 | "rustix", 1949 | "windows-sys 0.59.0", 1950 | ] 1951 | 1952 | [[package]] 1953 | name = "termcolor" 1954 | version = "1.4.1" 1955 | source = "registry+https://github.com/rust-lang/crates.io-index" 1956 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" 1957 | dependencies = [ 1958 | "winapi-util", 1959 | ] 1960 | 1961 | [[package]] 1962 | name = "testing" 1963 | version = "16.0.0" 1964 | source = "registry+https://github.com/rust-lang/crates.io-index" 1965 | checksum = "59f0f5f27bd9f0c9429a9330a223bc654804dcd9797f3414a491ac5190bf3cbc" 1966 | dependencies = [ 1967 | "cargo_metadata 0.18.1", 1968 | "difference", 1969 | "once_cell", 1970 | "pretty_assertions", 1971 | "regex", 1972 | "rustc-hash", 1973 | "serde", 1974 | "serde_json", 1975 | "swc_common", 1976 | "swc_error_reporters", 1977 | "testing_macros", 1978 | "tracing", 1979 | "tracing-subscriber", 1980 | ] 1981 | 1982 | [[package]] 1983 | name = "testing_macros" 1984 | version = "1.0.1" 1985 | source = "registry+https://github.com/rust-lang/crates.io-index" 1986 | checksum = "b7442bd3ca09f38d4788dc5ebafbc1967c3717726b4b074db011d470b353548b" 1987 | dependencies = [ 1988 | "anyhow", 1989 | "glob", 1990 | "once_cell", 1991 | "proc-macro2", 1992 | "quote", 1993 | "regex", 1994 | "relative-path", 1995 | "syn", 1996 | ] 1997 | 1998 | [[package]] 1999 | name = "textwrap" 2000 | version = "0.16.2" 2001 | source = "registry+https://github.com/rust-lang/crates.io-index" 2002 | checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" 2003 | dependencies = [ 2004 | "unicode-linebreak", 2005 | "unicode-width 0.2.1", 2006 | ] 2007 | 2008 | [[package]] 2009 | name = "thiserror" 2010 | version = "1.0.69" 2011 | source = "registry+https://github.com/rust-lang/crates.io-index" 2012 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 2013 | dependencies = [ 2014 | "thiserror-impl 1.0.69", 2015 | ] 2016 | 2017 | [[package]] 2018 | name = "thiserror" 2019 | version = "2.0.12" 2020 | source = "registry+https://github.com/rust-lang/crates.io-index" 2021 | checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" 2022 | dependencies = [ 2023 | "thiserror-impl 2.0.12", 2024 | ] 2025 | 2026 | [[package]] 2027 | name = "thiserror-impl" 2028 | version = "1.0.69" 2029 | source = "registry+https://github.com/rust-lang/crates.io-index" 2030 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 2031 | dependencies = [ 2032 | "proc-macro2", 2033 | "quote", 2034 | "syn", 2035 | ] 2036 | 2037 | [[package]] 2038 | name = "thiserror-impl" 2039 | version = "2.0.12" 2040 | source = "registry+https://github.com/rust-lang/crates.io-index" 2041 | checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" 2042 | dependencies = [ 2043 | "proc-macro2", 2044 | "quote", 2045 | "syn", 2046 | ] 2047 | 2048 | [[package]] 2049 | name = "thread_local" 2050 | version = "1.1.9" 2051 | source = "registry+https://github.com/rust-lang/crates.io-index" 2052 | checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" 2053 | dependencies = [ 2054 | "cfg-if", 2055 | ] 2056 | 2057 | [[package]] 2058 | name = "tinystr" 2059 | version = "0.8.1" 2060 | source = "registry+https://github.com/rust-lang/crates.io-index" 2061 | checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" 2062 | dependencies = [ 2063 | "displaydoc", 2064 | "zerovec", 2065 | ] 2066 | 2067 | [[package]] 2068 | name = "tinytemplate" 2069 | version = "1.2.1" 2070 | source = "registry+https://github.com/rust-lang/crates.io-index" 2071 | checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" 2072 | dependencies = [ 2073 | "serde", 2074 | "serde_json", 2075 | ] 2076 | 2077 | [[package]] 2078 | name = "tinyvec" 2079 | version = "1.9.0" 2080 | source = "registry+https://github.com/rust-lang/crates.io-index" 2081 | checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" 2082 | dependencies = [ 2083 | "tinyvec_macros", 2084 | ] 2085 | 2086 | [[package]] 2087 | name = "tinyvec_macros" 2088 | version = "0.1.1" 2089 | source = "registry+https://github.com/rust-lang/crates.io-index" 2090 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 2091 | 2092 | [[package]] 2093 | name = "tracing" 2094 | version = "0.1.41" 2095 | source = "registry+https://github.com/rust-lang/crates.io-index" 2096 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 2097 | dependencies = [ 2098 | "pin-project-lite", 2099 | "tracing-attributes", 2100 | "tracing-core", 2101 | ] 2102 | 2103 | [[package]] 2104 | name = "tracing-attributes" 2105 | version = "0.1.30" 2106 | source = "registry+https://github.com/rust-lang/crates.io-index" 2107 | checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" 2108 | dependencies = [ 2109 | "proc-macro2", 2110 | "quote", 2111 | "syn", 2112 | ] 2113 | 2114 | [[package]] 2115 | name = "tracing-core" 2116 | version = "0.1.34" 2117 | source = "registry+https://github.com/rust-lang/crates.io-index" 2118 | checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" 2119 | dependencies = [ 2120 | "once_cell", 2121 | "valuable", 2122 | ] 2123 | 2124 | [[package]] 2125 | name = "tracing-log" 2126 | version = "0.2.0" 2127 | source = "registry+https://github.com/rust-lang/crates.io-index" 2128 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 2129 | dependencies = [ 2130 | "log", 2131 | "once_cell", 2132 | "tracing-core", 2133 | ] 2134 | 2135 | [[package]] 2136 | name = "tracing-subscriber" 2137 | version = "0.3.20" 2138 | source = "registry+https://github.com/rust-lang/crates.io-index" 2139 | checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" 2140 | dependencies = [ 2141 | "matchers", 2142 | "nu-ansi-term", 2143 | "once_cell", 2144 | "regex-automata", 2145 | "sharded-slab", 2146 | "smallvec", 2147 | "thread_local", 2148 | "tracing", 2149 | "tracing-core", 2150 | "tracing-log", 2151 | ] 2152 | 2153 | [[package]] 2154 | name = "transform" 2155 | version = "0.1.0" 2156 | dependencies = [ 2157 | "base62", 2158 | "criterion", 2159 | "serde", 2160 | "swc_core", 2161 | "xxhash-rust", 2162 | ] 2163 | 2164 | [[package]] 2165 | name = "triomphe" 2166 | version = "0.1.14" 2167 | source = "registry+https://github.com/rust-lang/crates.io-index" 2168 | checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" 2169 | dependencies = [ 2170 | "serde", 2171 | "stable_deref_trait", 2172 | ] 2173 | 2174 | [[package]] 2175 | name = "typenum" 2176 | version = "1.18.0" 2177 | source = "registry+https://github.com/rust-lang/crates.io-index" 2178 | checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" 2179 | 2180 | [[package]] 2181 | name = "unicode-id-start" 2182 | version = "1.3.1" 2183 | source = "registry+https://github.com/rust-lang/crates.io-index" 2184 | checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" 2185 | 2186 | [[package]] 2187 | name = "unicode-ident" 2188 | version = "1.0.18" 2189 | source = "registry+https://github.com/rust-lang/crates.io-index" 2190 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 2191 | 2192 | [[package]] 2193 | name = "unicode-linebreak" 2194 | version = "0.1.5" 2195 | source = "registry+https://github.com/rust-lang/crates.io-index" 2196 | checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" 2197 | 2198 | [[package]] 2199 | name = "unicode-width" 2200 | version = "0.1.14" 2201 | source = "registry+https://github.com/rust-lang/crates.io-index" 2202 | checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" 2203 | 2204 | [[package]] 2205 | name = "unicode-width" 2206 | version = "0.2.1" 2207 | source = "registry+https://github.com/rust-lang/crates.io-index" 2208 | checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" 2209 | 2210 | [[package]] 2211 | name = "url" 2212 | version = "2.5.4" 2213 | source = "registry+https://github.com/rust-lang/crates.io-index" 2214 | checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" 2215 | dependencies = [ 2216 | "form_urlencoded", 2217 | "idna", 2218 | "percent-encoding", 2219 | ] 2220 | 2221 | [[package]] 2222 | name = "utf8_iter" 2223 | version = "1.0.4" 2224 | source = "registry+https://github.com/rust-lang/crates.io-index" 2225 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 2226 | 2227 | [[package]] 2228 | name = "uuid" 2229 | version = "1.17.0" 2230 | source = "registry+https://github.com/rust-lang/crates.io-index" 2231 | checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" 2232 | dependencies = [ 2233 | "js-sys", 2234 | "wasm-bindgen", 2235 | ] 2236 | 2237 | [[package]] 2238 | name = "valuable" 2239 | version = "0.1.1" 2240 | source = "registry+https://github.com/rust-lang/crates.io-index" 2241 | checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" 2242 | 2243 | [[package]] 2244 | name = "vergen" 2245 | version = "9.0.6" 2246 | source = "registry+https://github.com/rust-lang/crates.io-index" 2247 | checksum = "6b2bf58be11fc9414104c6d3a2e464163db5ef74b12296bda593cac37b6e4777" 2248 | dependencies = [ 2249 | "anyhow", 2250 | "cargo_metadata 0.19.2", 2251 | "derive_builder", 2252 | "regex", 2253 | "rustversion", 2254 | "vergen-lib", 2255 | ] 2256 | 2257 | [[package]] 2258 | name = "vergen-lib" 2259 | version = "0.1.6" 2260 | source = "registry+https://github.com/rust-lang/crates.io-index" 2261 | checksum = "9b07e6010c0f3e59fcb164e0163834597da68d1f864e2b8ca49f74de01e9c166" 2262 | dependencies = [ 2263 | "anyhow", 2264 | "derive_builder", 2265 | "rustversion", 2266 | ] 2267 | 2268 | [[package]] 2269 | name = "version_check" 2270 | version = "0.9.5" 2271 | source = "registry+https://github.com/rust-lang/crates.io-index" 2272 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 2273 | 2274 | [[package]] 2275 | name = "vsimd" 2276 | version = "0.8.0" 2277 | source = "registry+https://github.com/rust-lang/crates.io-index" 2278 | checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" 2279 | 2280 | [[package]] 2281 | name = "walkdir" 2282 | version = "2.5.0" 2283 | source = "registry+https://github.com/rust-lang/crates.io-index" 2284 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 2285 | dependencies = [ 2286 | "same-file", 2287 | "winapi-util", 2288 | ] 2289 | 2290 | [[package]] 2291 | name = "wasi" 2292 | version = "0.14.2+wasi-0.2.4" 2293 | source = "registry+https://github.com/rust-lang/crates.io-index" 2294 | checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 2295 | dependencies = [ 2296 | "wit-bindgen-rt", 2297 | ] 2298 | 2299 | [[package]] 2300 | name = "wasm-bindgen" 2301 | version = "0.2.100" 2302 | source = "registry+https://github.com/rust-lang/crates.io-index" 2303 | checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" 2304 | dependencies = [ 2305 | "cfg-if", 2306 | "once_cell", 2307 | "rustversion", 2308 | "wasm-bindgen-macro", 2309 | ] 2310 | 2311 | [[package]] 2312 | name = "wasm-bindgen-backend" 2313 | version = "0.2.100" 2314 | source = "registry+https://github.com/rust-lang/crates.io-index" 2315 | checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" 2316 | dependencies = [ 2317 | "bumpalo", 2318 | "log", 2319 | "proc-macro2", 2320 | "quote", 2321 | "syn", 2322 | "wasm-bindgen-shared", 2323 | ] 2324 | 2325 | [[package]] 2326 | name = "wasm-bindgen-macro" 2327 | version = "0.2.100" 2328 | source = "registry+https://github.com/rust-lang/crates.io-index" 2329 | checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" 2330 | dependencies = [ 2331 | "quote", 2332 | "wasm-bindgen-macro-support", 2333 | ] 2334 | 2335 | [[package]] 2336 | name = "wasm-bindgen-macro-support" 2337 | version = "0.2.100" 2338 | source = "registry+https://github.com/rust-lang/crates.io-index" 2339 | checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" 2340 | dependencies = [ 2341 | "proc-macro2", 2342 | "quote", 2343 | "syn", 2344 | "wasm-bindgen-backend", 2345 | "wasm-bindgen-shared", 2346 | ] 2347 | 2348 | [[package]] 2349 | name = "wasm-bindgen-shared" 2350 | version = "0.2.100" 2351 | source = "registry+https://github.com/rust-lang/crates.io-index" 2352 | checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" 2353 | dependencies = [ 2354 | "unicode-ident", 2355 | ] 2356 | 2357 | [[package]] 2358 | name = "winapi" 2359 | version = "0.3.9" 2360 | source = "registry+https://github.com/rust-lang/crates.io-index" 2361 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2362 | dependencies = [ 2363 | "winapi-i686-pc-windows-gnu", 2364 | "winapi-x86_64-pc-windows-gnu", 2365 | ] 2366 | 2367 | [[package]] 2368 | name = "winapi-i686-pc-windows-gnu" 2369 | version = "0.4.0" 2370 | source = "registry+https://github.com/rust-lang/crates.io-index" 2371 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2372 | 2373 | [[package]] 2374 | name = "winapi-util" 2375 | version = "0.1.9" 2376 | source = "registry+https://github.com/rust-lang/crates.io-index" 2377 | checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" 2378 | dependencies = [ 2379 | "windows-sys 0.59.0", 2380 | ] 2381 | 2382 | [[package]] 2383 | name = "winapi-x86_64-pc-windows-gnu" 2384 | version = "0.4.0" 2385 | source = "registry+https://github.com/rust-lang/crates.io-index" 2386 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2387 | 2388 | [[package]] 2389 | name = "windows-sys" 2390 | version = "0.59.0" 2391 | source = "registry+https://github.com/rust-lang/crates.io-index" 2392 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 2393 | dependencies = [ 2394 | "windows-targets 0.52.6", 2395 | ] 2396 | 2397 | [[package]] 2398 | name = "windows-sys" 2399 | version = "0.60.2" 2400 | source = "registry+https://github.com/rust-lang/crates.io-index" 2401 | checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 2402 | dependencies = [ 2403 | "windows-targets 0.53.2", 2404 | ] 2405 | 2406 | [[package]] 2407 | name = "windows-targets" 2408 | version = "0.52.6" 2409 | source = "registry+https://github.com/rust-lang/crates.io-index" 2410 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 2411 | dependencies = [ 2412 | "windows_aarch64_gnullvm 0.52.6", 2413 | "windows_aarch64_msvc 0.52.6", 2414 | "windows_i686_gnu 0.52.6", 2415 | "windows_i686_gnullvm 0.52.6", 2416 | "windows_i686_msvc 0.52.6", 2417 | "windows_x86_64_gnu 0.52.6", 2418 | "windows_x86_64_gnullvm 0.52.6", 2419 | "windows_x86_64_msvc 0.52.6", 2420 | ] 2421 | 2422 | [[package]] 2423 | name = "windows-targets" 2424 | version = "0.53.2" 2425 | source = "registry+https://github.com/rust-lang/crates.io-index" 2426 | checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" 2427 | dependencies = [ 2428 | "windows_aarch64_gnullvm 0.53.0", 2429 | "windows_aarch64_msvc 0.53.0", 2430 | "windows_i686_gnu 0.53.0", 2431 | "windows_i686_gnullvm 0.53.0", 2432 | "windows_i686_msvc 0.53.0", 2433 | "windows_x86_64_gnu 0.53.0", 2434 | "windows_x86_64_gnullvm 0.53.0", 2435 | "windows_x86_64_msvc 0.53.0", 2436 | ] 2437 | 2438 | [[package]] 2439 | name = "windows_aarch64_gnullvm" 2440 | version = "0.52.6" 2441 | source = "registry+https://github.com/rust-lang/crates.io-index" 2442 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 2443 | 2444 | [[package]] 2445 | name = "windows_aarch64_gnullvm" 2446 | version = "0.53.0" 2447 | source = "registry+https://github.com/rust-lang/crates.io-index" 2448 | checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" 2449 | 2450 | [[package]] 2451 | name = "windows_aarch64_msvc" 2452 | version = "0.52.6" 2453 | source = "registry+https://github.com/rust-lang/crates.io-index" 2454 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 2455 | 2456 | [[package]] 2457 | name = "windows_aarch64_msvc" 2458 | version = "0.53.0" 2459 | source = "registry+https://github.com/rust-lang/crates.io-index" 2460 | checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" 2461 | 2462 | [[package]] 2463 | name = "windows_i686_gnu" 2464 | version = "0.52.6" 2465 | source = "registry+https://github.com/rust-lang/crates.io-index" 2466 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 2467 | 2468 | [[package]] 2469 | name = "windows_i686_gnu" 2470 | version = "0.53.0" 2471 | source = "registry+https://github.com/rust-lang/crates.io-index" 2472 | checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" 2473 | 2474 | [[package]] 2475 | name = "windows_i686_gnullvm" 2476 | version = "0.52.6" 2477 | source = "registry+https://github.com/rust-lang/crates.io-index" 2478 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 2479 | 2480 | [[package]] 2481 | name = "windows_i686_gnullvm" 2482 | version = "0.53.0" 2483 | source = "registry+https://github.com/rust-lang/crates.io-index" 2484 | checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" 2485 | 2486 | [[package]] 2487 | name = "windows_i686_msvc" 2488 | version = "0.52.6" 2489 | source = "registry+https://github.com/rust-lang/crates.io-index" 2490 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 2491 | 2492 | [[package]] 2493 | name = "windows_i686_msvc" 2494 | version = "0.53.0" 2495 | source = "registry+https://github.com/rust-lang/crates.io-index" 2496 | checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" 2497 | 2498 | [[package]] 2499 | name = "windows_x86_64_gnu" 2500 | version = "0.52.6" 2501 | source = "registry+https://github.com/rust-lang/crates.io-index" 2502 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 2503 | 2504 | [[package]] 2505 | name = "windows_x86_64_gnu" 2506 | version = "0.53.0" 2507 | source = "registry+https://github.com/rust-lang/crates.io-index" 2508 | checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" 2509 | 2510 | [[package]] 2511 | name = "windows_x86_64_gnullvm" 2512 | version = "0.52.6" 2513 | source = "registry+https://github.com/rust-lang/crates.io-index" 2514 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 2515 | 2516 | [[package]] 2517 | name = "windows_x86_64_gnullvm" 2518 | version = "0.53.0" 2519 | source = "registry+https://github.com/rust-lang/crates.io-index" 2520 | checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" 2521 | 2522 | [[package]] 2523 | name = "windows_x86_64_msvc" 2524 | version = "0.52.6" 2525 | source = "registry+https://github.com/rust-lang/crates.io-index" 2526 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 2527 | 2528 | [[package]] 2529 | name = "windows_x86_64_msvc" 2530 | version = "0.53.0" 2531 | source = "registry+https://github.com/rust-lang/crates.io-index" 2532 | checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" 2533 | 2534 | [[package]] 2535 | name = "wit-bindgen-rt" 2536 | version = "0.39.0" 2537 | source = "registry+https://github.com/rust-lang/crates.io-index" 2538 | checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 2539 | dependencies = [ 2540 | "bitflags", 2541 | ] 2542 | 2543 | [[package]] 2544 | name = "writeable" 2545 | version = "0.6.1" 2546 | source = "registry+https://github.com/rust-lang/crates.io-index" 2547 | checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" 2548 | 2549 | [[package]] 2550 | name = "wyz" 2551 | version = "0.5.1" 2552 | source = "registry+https://github.com/rust-lang/crates.io-index" 2553 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 2554 | dependencies = [ 2555 | "tap", 2556 | ] 2557 | 2558 | [[package]] 2559 | name = "xxhash-rust" 2560 | version = "0.8.15" 2561 | source = "registry+https://github.com/rust-lang/crates.io-index" 2562 | checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" 2563 | 2564 | [[package]] 2565 | name = "yansi" 2566 | version = "1.0.1" 2567 | source = "registry+https://github.com/rust-lang/crates.io-index" 2568 | checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" 2569 | 2570 | [[package]] 2571 | name = "yoke" 2572 | version = "0.8.0" 2573 | source = "registry+https://github.com/rust-lang/crates.io-index" 2574 | checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" 2575 | dependencies = [ 2576 | "serde", 2577 | "stable_deref_trait", 2578 | "yoke-derive", 2579 | "zerofrom", 2580 | ] 2581 | 2582 | [[package]] 2583 | name = "yoke-derive" 2584 | version = "0.8.0" 2585 | source = "registry+https://github.com/rust-lang/crates.io-index" 2586 | checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" 2587 | dependencies = [ 2588 | "proc-macro2", 2589 | "quote", 2590 | "syn", 2591 | "synstructure", 2592 | ] 2593 | 2594 | [[package]] 2595 | name = "zerocopy" 2596 | version = "0.8.26" 2597 | source = "registry+https://github.com/rust-lang/crates.io-index" 2598 | checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" 2599 | dependencies = [ 2600 | "zerocopy-derive", 2601 | ] 2602 | 2603 | [[package]] 2604 | name = "zerocopy-derive" 2605 | version = "0.8.26" 2606 | source = "registry+https://github.com/rust-lang/crates.io-index" 2607 | checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" 2608 | dependencies = [ 2609 | "proc-macro2", 2610 | "quote", 2611 | "syn", 2612 | ] 2613 | 2614 | [[package]] 2615 | name = "zerofrom" 2616 | version = "0.1.6" 2617 | source = "registry+https://github.com/rust-lang/crates.io-index" 2618 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 2619 | dependencies = [ 2620 | "zerofrom-derive", 2621 | ] 2622 | 2623 | [[package]] 2624 | name = "zerofrom-derive" 2625 | version = "0.1.6" 2626 | source = "registry+https://github.com/rust-lang/crates.io-index" 2627 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 2628 | dependencies = [ 2629 | "proc-macro2", 2630 | "quote", 2631 | "syn", 2632 | "synstructure", 2633 | ] 2634 | 2635 | [[package]] 2636 | name = "zerotrie" 2637 | version = "0.2.2" 2638 | source = "registry+https://github.com/rust-lang/crates.io-index" 2639 | checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" 2640 | dependencies = [ 2641 | "displaydoc", 2642 | "yoke", 2643 | "zerofrom", 2644 | ] 2645 | 2646 | [[package]] 2647 | name = "zerovec" 2648 | version = "0.11.2" 2649 | source = "registry+https://github.com/rust-lang/crates.io-index" 2650 | checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" 2651 | dependencies = [ 2652 | "yoke", 2653 | "zerofrom", 2654 | "zerovec-derive", 2655 | ] 2656 | 2657 | [[package]] 2658 | name = "zerovec-derive" 2659 | version = "0.11.1" 2660 | source = "registry+https://github.com/rust-lang/crates.io-index" 2661 | checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" 2662 | dependencies = [ 2663 | "proc-macro2", 2664 | "quote", 2665 | "syn", 2666 | ] 2667 | --------------------------------------------------------------------------------