├── crates ├── debug_label │ ├── tests │ │ ├── fixtures │ │ │ ├── nextjs-app-page │ │ │ │ ├── config.json │ │ │ │ ├── output.js │ │ │ │ └── input.js │ │ │ ├── nextjs-page │ │ │ │ ├── config.json │ │ │ │ ├── input.js │ │ │ │ └── output.js │ │ │ └── custom-atom-names │ │ │ │ ├── input.js │ │ │ │ ├── config.json │ │ │ │ └── output.js │ │ └── fixture.rs │ ├── package.json │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── react_refresh │ ├── tests │ │ ├── fixtures │ │ │ ├── nextjs-page │ │ │ │ ├── config.json │ │ │ │ ├── input.js │ │ │ │ └── output.js │ │ │ ├── nextjs-app-page │ │ │ │ ├── config.json │ │ │ │ ├── output.js │ │ │ │ └── input.js │ │ │ └── custom-atom-names │ │ │ │ ├── input.js │ │ │ │ ├── config.json │ │ │ │ └── output.js │ │ └── fixture.rs │ ├── Cargo.toml │ ├── package.json │ └── src │ │ └── lib.rs └── common │ ├── src │ ├── lib.rs │ ├── config.rs │ ├── constants.rs │ └── atom_import_map.rs │ └── Cargo.toml ├── .gitignore ├── rust-toolchain.toml ├── .cargo └── config.toml ├── Cargo.toml ├── .github └── workflows │ ├── cd.yml │ └── ci.yml ├── LICENSE ├── README.md ├── .vscode └── launch.json └── Cargo.lock /crates/debug_label/tests/fixtures/nextjs-app-page/config.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/nextjs-page/config.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/nextjs-page/config.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/nextjs-app-page/config.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .DS_Store 3 | 4 | node_modules 5 | *.wasm 6 | .yarn/ -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/custom-atom-names/input.js: -------------------------------------------------------------------------------- 1 | const myCustomAtom = customAtom(0); 2 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/custom-atom-names/input.js: -------------------------------------------------------------------------------- 1 | const myCustomAtom = customAtom(0); 2 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/custom-atom-names/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "atomNames": ["customAtom"] 3 | } 4 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/custom-atom-names/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "atomNames": ["customAtom"] 3 | } 4 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/custom-atom-names/output.js: -------------------------------------------------------------------------------- 1 | const myCustomAtom = customAtom(0); 2 | myCustomAtom.debugLabel = "myCustomAtom"; 3 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly-2025-05-06" 3 | components = ["rustfmt", "clippy"] 4 | profile = "minimal" 5 | targets = ["wasm32-unknown-unknown", "wasm32-wasip1"] 6 | -------------------------------------------------------------------------------- /crates/common/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod atom_import_map; 2 | mod config; 3 | mod constants; 4 | 5 | pub use atom_import_map::AtomImportMap; 6 | pub use config::{parse_plugin_config, Config}; 7 | pub use constants::ATOM_IMPORTS; 8 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/nextjs-app-page/output.js: -------------------------------------------------------------------------------- 1 | import { Provider } from "jotai"; 2 | function MyApp({ Component, pageProps }) { 3 | return 4 | 5 | ; 6 | } 7 | export default MyApp; 8 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/nextjs-app-page/output.js: -------------------------------------------------------------------------------- 1 | import { Provider } from "jotai"; 2 | function MyApp({ Component, pageProps }) { 3 | return 4 | 5 | ; 6 | } 7 | export default MyApp; 8 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | # These command aliases are not final, may change 2 | [alias] 3 | # Alias to build actual plugin binary for the specified target. 4 | prepublish = "build --target wasm32-wasip1" 5 | 6 | [target.'cfg(target_arch = "wasm32")'] 7 | rustflags = ["--cfg=swc_ast_unknown"] 8 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/nextjs-app-page/input.js: -------------------------------------------------------------------------------- 1 | import { Provider } from "jotai"; 2 | 3 | function MyApp({ Component, pageProps }) { 4 | return ( 5 | 6 | 7 | 8 | ); 9 | } 10 | 11 | export default MyApp; 12 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/nextjs-app-page/input.js: -------------------------------------------------------------------------------- 1 | import { Provider } from "jotai"; 2 | 3 | function MyApp({ Component, pageProps }) { 4 | return ( 5 | 6 | 7 | 8 | ); 9 | } 10 | 11 | export default MyApp; 12 | -------------------------------------------------------------------------------- /crates/common/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Mathis Møller"] 3 | description = "Common code for jotai SWC plugins" 4 | license = "MIT" 5 | name = "common" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | [dependencies] 10 | serde = "1.0.160" 11 | serde_json = "1.0.96" 12 | swc_core = { workspace = true, features = ["common", "ecma_ast"] } 13 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = ["crates/common", "crates/debug_label", "crates/react_refresh"] 4 | 5 | [workspace.dependencies] 6 | swc_core = "50.0.0" 7 | testing = "19.0.0" 8 | 9 | [profile.release] 10 | # This removes more dead code 11 | codegen-units = 1 12 | lto = true 13 | # Optimize for size 14 | opt-level = "s" 15 | # Strip debug symbols 16 | strip = "symbols" 17 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/nextjs-page/input.js: -------------------------------------------------------------------------------- 1 | import { atom, useAtom } from "jotai"; 2 | 3 | const countAtom = atom(0); 4 | 5 | export default function AboutPage() { 6 | const [count, setCount] = useAtom(countAtom); 7 | return ( 8 |
9 |
About us
10 | {count} 11 |
12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/nextjs-page/input.js: -------------------------------------------------------------------------------- 1 | import { atom, useAtom } from "jotai"; 2 | 3 | const countAtom = atom(0); 4 | 5 | export default function AboutPage() { 6 | const [count, setCount] = useAtom(countAtom); 7 | return ( 8 |
9 |
About us
10 | {count} 11 |
12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixtures/nextjs-page/output.js: -------------------------------------------------------------------------------- 1 | import { atom, useAtom } from "jotai"; 2 | const countAtom = atom(0); 3 | countAtom.debugLabel = "countAtom"; 4 | export default function AboutPage() { 5 | const [count, setCount] = useAtom(countAtom); 6 | return
7 |
About us
8 | {count} 9 |
; 10 | } 11 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/custom-atom-names/output.js: -------------------------------------------------------------------------------- 1 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 2 | cache: new Map(), 3 | get(name, inst) { 4 | if (this.cache.has(name)) { 5 | return this.cache.get(name); 6 | } 7 | this.cache.set(name, inst); 8 | return inst; 9 | }, 10 | }; 11 | const myCustomAtom = globalThis.jotaiAtomCache.get( 12 | "atoms.ts/myCustomAtom", 13 | customAtom(0) 14 | ); 15 | -------------------------------------------------------------------------------- /crates/common/src/config.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | use swc_core::ecma::atoms::Atom; 3 | 4 | /// Static plugin configuration. 5 | #[derive(Clone, Default, Serialize, Deserialize)] 6 | #[serde(rename_all = "camelCase", deny_unknown_fields)] 7 | pub struct Config { 8 | #[serde(default)] 9 | pub atom_names: Vec, 10 | } 11 | 12 | pub fn parse_plugin_config(plugin_str: &str) -> Config { 13 | serde_json::from_str::(plugin_str).expect("Invalid plugin config") 14 | } 15 | -------------------------------------------------------------------------------- /crates/common/src/constants.rs: -------------------------------------------------------------------------------- 1 | pub static ATOM_IMPORTS: &[&str] = &[ 2 | "abortableAtom", 3 | "atom", 4 | "atomFamily", 5 | "atomWithDefault", 6 | "atomWithHash", 7 | "atomWithImmer", 8 | "atomWithInfiniteQuery", 9 | "atomWithMachine", 10 | "atomWithMutation", 11 | "atomWithObservable", 12 | "atomWithProxy", 13 | "atomWithQuery", 14 | "atomWithReducer", 15 | "atomWithReset", 16 | "atomWithSubscription", 17 | "atomWithStorage", 18 | "atomWithStore", 19 | "freezeAtom", 20 | "loadable", 21 | "selectAtom", 22 | "splitAtom", 23 | ]; 24 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixtures/nextjs-page/output.js: -------------------------------------------------------------------------------- 1 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 2 | cache: new Map(), 3 | get (name, inst) { 4 | if (this.cache.has(name)) { 5 | return this.cache.get(name); 6 | } 7 | this.cache.set(name, inst); 8 | return inst; 9 | } 10 | }; 11 | import { atom, useAtom } from "jotai"; 12 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0)); 13 | export default function AboutPage() { 14 | const [count, setCount] = useAtom(countAtom); 15 | return
16 |
About us
17 | {count} 18 |
; 19 | } 20 | -------------------------------------------------------------------------------- /crates/debug_label/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@swc-jotai/debug-label", 3 | "version": "0.5.0", 4 | "description": "SWC plugin for automatic jotai atom debug labels", 5 | "author": "Mathis Møller", 6 | "license": "MIT", 7 | "keywords": [ 8 | "swc-plugin", 9 | "jotai" 10 | ], 11 | "homepage": "https://jotai.org/", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/pmndrs/swc-jotai" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/pmndrs/swc-jotai/issues" 18 | }, 19 | "main": "swc_jotai_debug_label.wasm", 20 | "scripts": { 21 | "prepack": "cargo prepublish --release && cp ../../target/wasm32-wasip1/release/swc_jotai_debug_label.wasm ." 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /crates/debug_label/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "swc_jotai_debug_label" 3 | authors = ["Mathis Møller"] 4 | description = "SWC plugin for automatic jotai atom debug labels" 5 | license = "MIT" 6 | version = "0.0.1" 7 | edition = "2021" 8 | 9 | [lib] 10 | crate-type = ["cdylib", "rlib"] 11 | 12 | [dependencies] 13 | common = { path = "../common" } 14 | swc_core = { workspace = true, features = [ 15 | "ecma_ast", 16 | "ecma_parser", 17 | "ecma_utils", 18 | "ecma_visit", 19 | "ecma_plugin_transform", 20 | ] } 21 | 22 | [dev-dependencies] 23 | swc_core = { workspace = true, features = [ 24 | "ecma_plugin_transform", 25 | "ecma_transforms_react", 26 | "testing_transform", 27 | ] } 28 | testing = { workspace = true } 29 | -------------------------------------------------------------------------------- /crates/react_refresh/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "swc_jotai_react_refresh" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | crate-type = ["cdylib", "rlib"] 8 | 9 | [dependencies] 10 | common = { path = "../common" } 11 | swc_core = { workspace = true, features = [ 12 | "ecma_ast", 13 | "ecma_quote", 14 | "ecma_parser", 15 | "ecma_utils", 16 | "ecma_visit", 17 | "ecma_plugin_transform", 18 | ] } 19 | 20 | [dev-dependencies] 21 | swc_core = { workspace = true, features = [ 22 | "ecma_plugin_transform", 23 | "ecma_transforms_react", 24 | "testing_transform", 25 | ] } 26 | testing = { workspace = true } 27 | 28 | [lints.rust] 29 | unexpected_cfgs = { level = "warn", check-cfg = ['cfg(swc_ast_unknown)'] } 30 | -------------------------------------------------------------------------------- /crates/react_refresh/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@swc-jotai/react-refresh", 3 | "version": "0.5.0", 4 | "description": "SWC plugin for supporting React Refresh with Jotai", 5 | "author": "Mathis Møller", 6 | "license": "MIT", 7 | "keywords": [ 8 | "swc-plugin", 9 | "jotai" 10 | ], 11 | "homepage": "https://jotai.org/", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/pmndrs/swc-jotai" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/pmndrs/swc-jotai/issues" 18 | }, 19 | "main": "swc_jotai_react_refresh.wasm", 20 | "scripts": { 21 | "prepack": "cargo prepublish --release && cp ../../target/wasm32-wasip1/release/swc_jotai_react_refresh.wasm ." 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: cd 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | 8 | permissions: 9 | id-token: write 10 | contents: read 11 | 12 | jobs: 13 | publish: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v6 17 | - uses: actions/setup-node@v6 18 | with: 19 | node-version: 'lts/*' 20 | registry-url: 'https://registry.npmjs.org' 21 | - name: Install Rust toolchain 22 | uses: dtolnay/rust-toolchain@stable 23 | with: 24 | targets: wasm32-wasip1 25 | - name: Publish debug-label 26 | working-directory: ./crates/debug_label 27 | run: npm publish 28 | - name: Publish react-refresh 29 | working-directory: ./crates/react_refresh 30 | run: npm publish 31 | -------------------------------------------------------------------------------- /crates/debug_label/tests/fixture.rs: -------------------------------------------------------------------------------- 1 | use std::{fs::read_to_string, path::PathBuf}; 2 | 3 | use common::parse_plugin_config; 4 | use swc_core::{ 5 | common::FileName, 6 | ecma::parser::{EsSyntax, Syntax}, 7 | ecma::transforms::testing::test_fixture, 8 | }; 9 | use swc_jotai_debug_label::debug_label; 10 | use testing::fixture; 11 | 12 | #[fixture("tests/fixtures/**/input.js")] 13 | fn test(input: PathBuf) { 14 | let config = 15 | read_to_string(input.with_file_name("config.json")).expect("Failed to read config.json"); 16 | let config = parse_plugin_config(&config); 17 | let output = input.with_file_name("output.js"); 18 | 19 | test_fixture( 20 | Syntax::Es(EsSyntax { 21 | jsx: true, 22 | ..Default::default() 23 | }), 24 | &|_t| debug_label(config.clone(), FileName::Real("atoms.ts".parse().unwrap())), 25 | &input, 26 | &output, 27 | Default::default(), 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /crates/react_refresh/tests/fixture.rs: -------------------------------------------------------------------------------- 1 | use std::{fs::read_to_string, path::PathBuf}; 2 | 3 | use common::parse_plugin_config; 4 | use swc_core::{ 5 | common::FileName, 6 | ecma::parser::{EsSyntax, Syntax}, 7 | ecma::transforms::testing::test_fixture, 8 | }; 9 | use swc_jotai_react_refresh::react_refresh; 10 | use testing::fixture; 11 | 12 | #[fixture("tests/fixtures/**/input.js")] 13 | fn test(input: PathBuf) { 14 | let config = 15 | read_to_string(input.with_file_name("config.json")).expect("Failed to read config.json"); 16 | let config = parse_plugin_config(&config); 17 | let output = input.with_file_name("output.js"); 18 | 19 | test_fixture( 20 | Syntax::Es(EsSyntax { 21 | jsx: true, 22 | ..Default::default() 23 | }), 24 | &|_t| react_refresh(config.clone(), FileName::Real("atoms.ts".parse().unwrap())), 25 | &input, 26 | &output, 27 | Default::default(), 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Poimandres 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 all 13 | 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 THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | types: [opened, synchronize] 8 | 9 | env: 10 | CARGO_INCREMENTAL: 0 11 | CARGO_TERM_COLOR: always 12 | 13 | jobs: 14 | fmt: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v6 18 | - uses: dtolnay/rust-toolchain@stable 19 | with: 20 | components: rustfmt 21 | - name: Run cargo fmt 22 | run: cargo fmt --all -- --check 23 | clippy: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@v6 27 | - uses: dtolnay/rust-toolchain@stable 28 | with: 29 | components: clippy 30 | - name: Check 31 | run: cargo clippy --all 32 | check: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v6 36 | - uses: dtolnay/rust-toolchain@stable 37 | with: 38 | target: wasm32-wasip1 39 | - name: Run cargo check 40 | run: cargo check 41 | test: 42 | runs-on: ubuntu-latest 43 | steps: 44 | - uses: actions/checkout@v6 45 | - uses: dtolnay/rust-toolchain@stable 46 | with: 47 | target: wasm32-wasip1 48 | - name: Run cargo test 49 | run: cargo test 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # swc-jotai 2 | 3 | SWC plugins for [Jotai](https://github.com/pmndrs/jotai). 4 | 5 | [Try it out using CodeSandbox](https://codesandbox.io/s/next-js-with-custom-swc-plugins-ygiuzm). 6 | 7 | ## Install 8 | 9 | ```sh 10 | npm install --save-dev @swc-jotai/debug-label @swc-jotai/react-refresh 11 | ``` 12 | 13 | The plugins can be used by themselves as well. 14 | 15 | ## Usage 16 | 17 | You can add the plugins to `.swcrc`: 18 | 19 | Then update your `.swcrc` file like below: 20 | 21 | ```json 22 | { 23 | "jsc": { 24 | "experimental": { 25 | "plugins": [ 26 | ["@swc-jotai/debug-label", {}], 27 | ["@swc-jotai/react-refresh", {}] 28 | ] 29 | } 30 | } 31 | } 32 | ``` 33 | 34 | You can use the plugins with [experimental SWC plugins feature](https://nextjs.org/docs/advanced-features/compiler#swc-plugins-experimental) in Next.js. 35 | 36 | ```js 37 | module.exports = { 38 | experimental: { 39 | swcPlugins: [ 40 | ["@swc-jotai/debug-label", {}], 41 | ["@swc-jotai/react-refresh", {}], 42 | ], 43 | }, 44 | }; 45 | ``` 46 | 47 | ### Custom atom names 48 | 49 | You can enable the plugins for your custom atoms. You can supply them to the plugins like below: 50 | 51 | ```js 52 | module.exports = { 53 | experimental: { 54 | swcPlugins: [ 55 | ["@swc-jotai/debug-label", { atomNames: ["customAtom"] }], 56 | ["@swc-jotai/react-refresh", { atomNames: ["customAtom"] }], 57 | ], 58 | }, 59 | }; 60 | ``` 61 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "lldb", 9 | "request": "launch", 10 | "name": "Debug unit tests in library 'common'", 11 | "cargo": { 12 | "args": [ 13 | "test", 14 | "--no-run", 15 | "--lib", 16 | "--package=common" 17 | ], 18 | "filter": { 19 | "name": "common", 20 | "kind": "lib" 21 | } 22 | }, 23 | "args": [], 24 | "cwd": "${workspaceFolder}" 25 | }, 26 | { 27 | "type": "lldb", 28 | "request": "launch", 29 | "name": "Debug unit tests in library 'swc_jotai_debug_label'", 30 | "cargo": { 31 | "args": [ 32 | "test", 33 | "--no-run", 34 | "--lib", 35 | "--package=swc_jotai_debug_label" 36 | ], 37 | "filter": { 38 | "name": "swc_jotai_debug_label", 39 | "kind": "lib" 40 | } 41 | }, 42 | "args": [], 43 | "cwd": "${workspaceFolder}" 44 | }, 45 | { 46 | "type": "lldb", 47 | "request": "launch", 48 | "name": "Debug integration test 'fixture'", 49 | "cargo": { 50 | "args": [ 51 | "test", 52 | "--no-run", 53 | "--test=fixture", 54 | "--package=swc_jotai_debug_label" 55 | ], 56 | "filter": { 57 | "name": "fixture", 58 | "kind": "test" 59 | } 60 | }, 61 | "args": [], 62 | "cwd": "${workspaceFolder}" 63 | }, 64 | { 65 | "type": "lldb", 66 | "request": "launch", 67 | "name": "Debug unit tests in library 'react_refresh'", 68 | "cargo": { 69 | "args": [ 70 | "test", 71 | "--no-run", 72 | "--lib", 73 | "--package=react_refresh" 74 | ], 75 | "filter": { 76 | "name": "react_refresh", 77 | "kind": "lib" 78 | } 79 | }, 80 | "args": [], 81 | "cwd": "${workspaceFolder}" 82 | } 83 | ] 84 | } -------------------------------------------------------------------------------- /crates/common/src/atom_import_map.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashSet; 2 | use swc_core::ecma::{ast::*, atoms::Atom}; 3 | 4 | use crate::ATOM_IMPORTS; 5 | 6 | #[derive(Debug)] 7 | pub struct AtomImportMap { 8 | atom_names: Vec, 9 | imports: HashSet, 10 | namespace_imports: HashSet, 11 | } 12 | 13 | impl AtomImportMap { 14 | pub fn new(atom_names: Vec) -> Self { 15 | AtomImportMap { 16 | atom_names, 17 | imports: Default::default(), 18 | namespace_imports: Default::default(), 19 | } 20 | } 21 | 22 | pub fn visit_import_decl(&mut self, import: &ImportDecl) { 23 | if !import.src.value.starts_with("jotai") { 24 | return; 25 | } 26 | 27 | for s in &import.specifiers { 28 | let local_ident = match s { 29 | ImportSpecifier::Named(ImportNamedSpecifier { 30 | local, 31 | imported: Some(ModuleExportName::Ident(ident)), 32 | .. 33 | }) => { 34 | if ATOM_IMPORTS.contains(&&*ident.sym) { 35 | local.sym.clone() 36 | } else { 37 | continue; 38 | } 39 | } 40 | ImportSpecifier::Named(ImportNamedSpecifier { local, .. }) => { 41 | if ATOM_IMPORTS.contains(&&*local.sym) { 42 | local.sym.clone() 43 | } else { 44 | continue; 45 | } 46 | } 47 | ImportSpecifier::Namespace(..) => { 48 | self.namespace_imports 49 | .insert(import.src.value.to_atom_lossy().into_owned()); 50 | continue; 51 | } 52 | _ => continue, 53 | }; 54 | 55 | self.imports.insert(local_ident); 56 | } 57 | } 58 | 59 | pub fn is_atom_import(&self, expr: &Expr) -> bool { 60 | match expr { 61 | // Handles default export expressions 62 | Expr::Call(CallExpr { 63 | callee: Callee::Expr(e), 64 | .. 65 | }) => self.is_atom_import(e), 66 | // Handles: const countAtom = atom(0); 67 | Expr::Ident(i) => self.atom_names.contains(&i.sym) || self.imports.contains(&i.sym), 68 | // Handles: const countAtom = jotai.atom(0); 69 | Expr::Member(MemberExpr { 70 | obj, 71 | prop: MemberProp::Ident(prop), 72 | .. 73 | }) => { 74 | if let Expr::Ident(obj) = &**obj { 75 | if self.namespace_imports.contains(&obj.sym) { 76 | return ATOM_IMPORTS.contains(&&*prop.sym); 77 | } 78 | } 79 | false 80 | } 81 | _ => false, 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /crates/debug_label/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::not_unsafe_ptr_arg_deref)] 2 | 3 | use common::{parse_plugin_config, AtomImportMap, Config}; 4 | use swc_core::{ 5 | common::{util::take::Take, FileName, SyntaxContext, DUMMY_SP}, 6 | ecma::{ 7 | ast::*, 8 | atoms::Atom, 9 | utils::{ModuleItemLike, StmtLike}, 10 | visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, 11 | }, 12 | plugin::{ 13 | metadata::TransformPluginMetadataContextKind, plugin_transform, 14 | proxies::TransformPluginProgramMetadata, 15 | }, 16 | }; 17 | 18 | struct DebugLabelTransformVisitor { 19 | atom_import_map: AtomImportMap, 20 | current_var_declarator: Option, 21 | debug_label_expr: Option, 22 | file_name: FileName, 23 | } 24 | 25 | fn create_debug_label_assign_expr(atom_name_id: Id) -> Expr { 26 | let atom_name = atom_name_id.0.clone(); 27 | Expr::Assign(AssignExpr { 28 | left: AssignTarget::Simple(SimpleAssignTarget::Member(MemberExpr { 29 | obj: Box::new(Expr::Ident(atom_name_id.into())), 30 | prop: MemberProp::Ident("debugLabel".into()), 31 | span: DUMMY_SP, 32 | })), 33 | right: Box::new(Expr::Lit(Lit::Str(Str { 34 | value: atom_name.into(), 35 | span: DUMMY_SP, 36 | raw: None, 37 | }))), 38 | op: op!("="), 39 | span: DUMMY_SP, 40 | }) 41 | } 42 | 43 | impl DebugLabelTransformVisitor { 44 | pub fn new(config: Config, file_name: FileName) -> Self { 45 | Self { 46 | atom_import_map: AtomImportMap::new(config.atom_names), 47 | current_var_declarator: None, 48 | debug_label_expr: None, 49 | file_name, 50 | } 51 | } 52 | } 53 | 54 | impl DebugLabelTransformVisitor { 55 | fn visit_mut_stmt_like(&mut self, stmts: &mut Vec) 56 | where 57 | Vec: VisitMutWith, 58 | T: VisitMutWith + StmtLike + ModuleItemLike, 59 | { 60 | let mut stmts_updated: Vec = Vec::with_capacity(stmts.len()); 61 | 62 | for stmt in stmts.take() { 63 | let stmt = match stmt.try_into_stmt() { 64 | Ok(mut stmt) => { 65 | stmt.visit_mut_with(self); 66 | T::from(stmt) 67 | } 68 | Err(node) => match node.try_into_module_decl() { 69 | Ok(mut module_decl) => { 70 | match module_decl { 71 | ModuleDecl::ExportDefaultExpr(mut default_export) => { 72 | if !self.atom_import_map.is_atom_import(&default_export.expr) { 73 | default_export.visit_mut_with(self); 74 | stmts_updated.push( 75 | ::try_from_module_decl( 76 | default_export.into(), 77 | ) 78 | .unwrap(), 79 | ); 80 | continue; 81 | } 82 | 83 | let atom_name: Atom = match &self.file_name { 84 | FileName::Real(real_file_name) => { 85 | if let Some(file_stem) = 86 | real_file_name.file_stem().map(|s| s.to_string_lossy()) 87 | { 88 | file_stem.into() 89 | } else { 90 | real_file_name 91 | .parent() 92 | .unwrap() 93 | .join("default_atom") 94 | .display() 95 | .to_string() 96 | .into() 97 | } 98 | } 99 | _ => "default_atom".into(), 100 | }; 101 | 102 | // Variable declaration 103 | stmts_updated.push(T::from(Stmt::Decl(Decl::Var(Box::new( 104 | VarDecl { 105 | declare: Default::default(), 106 | decls: vec![VarDeclarator { 107 | definite: false, 108 | init: Some(default_export.expr), 109 | name: Pat::Ident(atom_name.clone().into()), 110 | span: DUMMY_SP, 111 | }], 112 | kind: VarDeclKind::Const, 113 | span: DUMMY_SP, 114 | ctxt: SyntaxContext::empty(), 115 | }, 116 | ))))); 117 | // Assign debug label 118 | stmts_updated.push(T::from(Stmt::Expr(ExprStmt { 119 | span: DUMMY_SP, 120 | expr: Box::new(create_debug_label_assign_expr(( 121 | atom_name.clone(), 122 | SyntaxContext::empty(), 123 | ))), 124 | }))); 125 | // export default expression 126 | stmts_updated.push( 127 | ::try_from_module_decl( 128 | ModuleDecl::ExportDefaultExpr(ExportDefaultExpr { 129 | expr: Box::new(Expr::Ident(atom_name.into())), 130 | span: DUMMY_SP, 131 | }), 132 | ) 133 | .unwrap(), 134 | ); 135 | continue; 136 | } 137 | _ => { 138 | module_decl.visit_mut_with(self); 139 | ::try_from_module_decl(module_decl).unwrap() 140 | } 141 | } 142 | } 143 | Err(..) => unreachable!(), 144 | }, 145 | }; 146 | stmts_updated.push(stmt); 147 | 148 | if self.debug_label_expr.is_none() { 149 | continue; 150 | } 151 | 152 | stmts_updated.push(T::from(Stmt::Expr(ExprStmt { 153 | span: DUMMY_SP, 154 | expr: Box::new(self.debug_label_expr.take().unwrap()), 155 | }))) 156 | } 157 | 158 | *stmts = stmts_updated; 159 | } 160 | } 161 | 162 | impl VisitMut for DebugLabelTransformVisitor { 163 | noop_visit_mut_type!(); 164 | 165 | fn visit_mut_import_decl(&mut self, import: &mut ImportDecl) { 166 | self.atom_import_map.visit_import_decl(import); 167 | } 168 | 169 | fn visit_mut_var_declarator(&mut self, var_declarator: &mut VarDeclarator) { 170 | let old_var_declarator = self.current_var_declarator.take(); 171 | 172 | self.current_var_declarator = if let Pat::Ident(id) = &var_declarator.name { 173 | Some(id.to_id()) 174 | } else { 175 | None 176 | }; 177 | 178 | var_declarator.visit_mut_children_with(self); 179 | 180 | self.current_var_declarator = old_var_declarator; 181 | } 182 | 183 | fn visit_mut_call_expr(&mut self, call_expr: &mut CallExpr) { 184 | if self.current_var_declarator.is_none() { 185 | return; 186 | } 187 | 188 | call_expr.visit_mut_children_with(self); 189 | 190 | let atom_name = self.current_var_declarator.as_ref().unwrap(); 191 | if let Callee::Expr(expr) = &call_expr.callee { 192 | if self.atom_import_map.is_atom_import(expr) { 193 | self.debug_label_expr = Some(create_debug_label_assign_expr(atom_name.clone())) 194 | } 195 | } 196 | } 197 | 198 | fn visit_mut_module_items(&mut self, items: &mut Vec) { 199 | self.visit_mut_stmt_like(items); 200 | } 201 | 202 | fn visit_mut_stmts(&mut self, stmts: &mut Vec) { 203 | self.visit_mut_stmt_like(stmts); 204 | } 205 | } 206 | 207 | pub fn debug_label(config: Config, file_name: FileName) -> impl Pass { 208 | visit_mut_pass(DebugLabelTransformVisitor::new(config, file_name)) 209 | } 210 | 211 | #[plugin_transform] 212 | pub fn debug_label_transform( 213 | program: Program, 214 | metadata: TransformPluginProgramMetadata, 215 | ) -> Program { 216 | let config = parse_plugin_config( 217 | &metadata 218 | .get_transform_plugin_config() 219 | .expect("Failed to get plugin config for @swc-jotai/debug-label"), 220 | ); 221 | let file_name = match &metadata.get_context(&TransformPluginMetadataContextKind::Filename) { 222 | Some(file_name) => FileName::Real(file_name.into()), 223 | None => FileName::Anon, 224 | }; 225 | program.apply(&mut visit_mut_pass(DebugLabelTransformVisitor::new( 226 | config, file_name, 227 | ))) 228 | } 229 | 230 | #[cfg(test)] 231 | mod tests { 232 | use std::path::PathBuf; 233 | 234 | use super::*; 235 | use swc_core::ecma::{ 236 | parser::Syntax, 237 | transforms::testing::{test, test_inline}, 238 | visit::visit_mut_pass, 239 | }; 240 | 241 | fn transform(config: Option, file_name: Option) -> impl Pass { 242 | visit_mut_pass(DebugLabelTransformVisitor::new( 243 | config.unwrap_or_default(), 244 | file_name.unwrap_or(FileName::Real(PathBuf::from("atoms.ts"))), 245 | )) 246 | } 247 | 248 | test_inline!( 249 | Syntax::default(), 250 | |_| transform(None, None), 251 | basic, 252 | r#" 253 | import { atom } from "jotai"; 254 | const countAtom = atom(0);"#, 255 | r#" 256 | import { atom } from "jotai"; 257 | const countAtom = atom(0); 258 | countAtom.debugLabel = "countAtom";"# 259 | ); 260 | 261 | test_inline!( 262 | Syntax::default(), 263 | |_| transform(None, None), 264 | exported_atom, 265 | r#" 266 | import { atom } from "jotai"; 267 | export const countAtom = atom(0);"#, 268 | r#" 269 | import { atom } from "jotai"; 270 | export const countAtom = atom(0); 271 | countAtom.debugLabel = "countAtom";"# 272 | ); 273 | 274 | test_inline!( 275 | Syntax::default(), 276 | |_| transform(None, None), 277 | multiple_atoms, 278 | r#" 279 | import { atom } from "jotai"; 280 | const countAtom = atom(0); 281 | const doubleAtom = atom((get) => get(countAtom) * 2);"#, 282 | r#" 283 | import { atom } from "jotai"; 284 | const countAtom = atom(0); 285 | countAtom.debugLabel = "countAtom"; 286 | const doubleAtom = atom((get) => get(countAtom) * 2); 287 | doubleAtom.debugLabel = "doubleAtom";"# 288 | ); 289 | 290 | test_inline!( 291 | Syntax::default(), 292 | |_| transform(None, None), 293 | multiple_atoms_between_code, 294 | r#" 295 | import { atom } from "jotai"; 296 | const countAtom = atom(0); 297 | let counter = 0; 298 | const increment = () => ++counter; 299 | const doubleAtom = atom((get) => get(countAtom) * 2);"#, 300 | r#" 301 | import { atom } from "jotai"; 302 | const countAtom = atom(0); 303 | countAtom.debugLabel = "countAtom"; 304 | let counter = 0; 305 | const increment = () => ++counter; 306 | const doubleAtom = atom((get) => get(countAtom) * 2); 307 | doubleAtom.debugLabel = "doubleAtom";"# 308 | ); 309 | 310 | test_inline!( 311 | Syntax::default(), 312 | |_| transform(None, None), 313 | import_alias, 314 | r#" 315 | import { atom as blah } from "jotai"; 316 | const countAtom = blah(0);"#, 317 | r#" 318 | import { atom as blah } from "jotai"; 319 | const countAtom = blah(0); 320 | countAtom.debugLabel = "countAtom";"# 321 | ); 322 | 323 | test_inline!( 324 | Syntax::default(), 325 | |_| transform(None, None), 326 | ignore_non_jotai_imports, 327 | r#" 328 | import React from "react"; 329 | import { atom } from "jotai"; 330 | import { defaultCount } from "./utils"; 331 | const countAtom = atom(0);"#, 332 | r#" 333 | import React from "react"; 334 | import { atom } from "jotai"; 335 | import { defaultCount } from "./utils"; 336 | const countAtom = atom(0); 337 | countAtom.debugLabel = "countAtom";"# 338 | ); 339 | 340 | test_inline!( 341 | Syntax::default(), 342 | |_| transform(None, None), 343 | namespace_import, 344 | r#" 345 | import * as jotai from "jotai"; 346 | const countAtom = jotai.atom(0);"#, 347 | r#" 348 | import * as jotai from "jotai"; 349 | const countAtom = jotai.atom(0); 350 | countAtom.debugLabel = "countAtom";"# 351 | ); 352 | 353 | test_inline!( 354 | Syntax::default(), 355 | |_| transform(None, None), 356 | atom_from_another_package, 357 | r#" 358 | import { atom } from "some-library"; 359 | const countAtom = atom(0);"#, 360 | r#" 361 | import { atom } from "some-library"; 362 | const countAtom = atom(0);"# 363 | ); 364 | 365 | test_inline!( 366 | Syntax::default(), 367 | |_| transform(None, None), 368 | no_jotai_import, 369 | "const countAtom = atom(0);", 370 | "const countAtom = atom(0);" 371 | ); 372 | 373 | test_inline!( 374 | Syntax::default(), 375 | |_| transform(None, None), 376 | handle_default_export, 377 | r#" 378 | import { atom } from "jotai"; 379 | export default atom(0);"#, 380 | r#" 381 | import { atom } from "jotai"; 382 | const atoms = atom(0); 383 | atoms.debugLabel = "atoms"; 384 | export default atoms;"# 385 | ); 386 | 387 | test_inline!( 388 | Syntax::default(), 389 | |_| transform(None, Some(FileName::Real("countAtom.ts".parse().unwrap()))), 390 | handle_file_naming_default_export, 391 | r#" 392 | import { atom } from "jotai"; 393 | export default atom(0);"#, 394 | r#" 395 | import { atom } from "jotai"; 396 | const countAtom = atom(0); 397 | countAtom.debugLabel = "countAtom"; 398 | export default countAtom;"# 399 | ); 400 | 401 | test_inline!( 402 | Syntax::default(), 403 | |_| transform( 404 | None, 405 | Some(FileName::Real("src/atoms/countAtom.ts".parse().unwrap())) 406 | ), 407 | handle_file_path_default_export, 408 | r#" 409 | import { atom } from "jotai"; 410 | export default atom(0);"#, 411 | r#" 412 | import { atom } from "jotai"; 413 | const countAtom = atom(0); 414 | countAtom.debugLabel = "countAtom"; 415 | export default countAtom;"# 416 | ); 417 | 418 | test_inline!( 419 | Syntax::default(), 420 | |_| transform(None, None), 421 | jotai_utils_import, 422 | r#" 423 | import { atomWithImmer } from "jotai/immer"; 424 | import { atomWithMachine } from "jotai/xstate"; 425 | const immerAtom = atomWithImmer(0); 426 | const toggleMachineAtom = atomWithMachine(() => toggleMachine);"#, 427 | r#" 428 | import { atomWithImmer } from "jotai/immer"; 429 | import { atomWithMachine } from "jotai/xstate"; 430 | const immerAtom = atomWithImmer(0); 431 | immerAtom.debugLabel = "immerAtom"; 432 | const toggleMachineAtom = atomWithMachine(() => toggleMachine); 433 | toggleMachineAtom.debugLabel = "toggleMachineAtom";"# 434 | ); 435 | 436 | test_inline!( 437 | Syntax::default(), 438 | |_| transform(None, None), 439 | test_default_export, 440 | r#" 441 | function fn() { return true; } 442 | 443 | export default fn;"#, 444 | r#" 445 | function fn() { return true; } 446 | 447 | export default fn;"# 448 | ); 449 | 450 | test_inline!( 451 | Syntax::default(), 452 | |_| transform(None, None), 453 | basic_with_existing_debug_label, 454 | r#" 455 | import { atom } from "jotai"; 456 | const countAtom = atom(0); 457 | countAtom.debugLabel = "fancyAtomName";"#, 458 | r#" 459 | import { atom } from "jotai"; 460 | const countAtom = atom(0); 461 | countAtom.debugLabel = "countAtom"; 462 | countAtom.debugLabel = "fancyAtomName";"# 463 | ); 464 | 465 | test_inline!( 466 | Syntax::default(), 467 | |_| transform( 468 | Some(Config { 469 | atom_names: vec!["customAtom".into()] 470 | }), 471 | None 472 | ), 473 | custom_atom_names, 474 | r#" 475 | const myCustomAtom = customAtom(0);"#, 476 | r#" 477 | const myCustomAtom = customAtom(0); 478 | myCustomAtom.debugLabel = "myCustomAtom";"# 479 | ); 480 | 481 | test_inline!( 482 | Syntax::default(), 483 | |_| transform(None, Some(FileName::Anon)), 484 | filename_anon, 485 | r#" 486 | import { atom } from "jotai"; 487 | const countAtom = atom(0);"#, 488 | r#" 489 | import { atom } from "jotai"; 490 | const countAtom = atom(0); 491 | countAtom.debugLabel = "countAtom";"# 492 | ); 493 | } 494 | -------------------------------------------------------------------------------- /crates/react_refresh/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::not_unsafe_ptr_arg_deref)] 2 | 3 | use common::{parse_plugin_config, AtomImportMap, Config}; 4 | use swc_core::{ 5 | common::{FileName, SyntaxContext, DUMMY_SP}, 6 | ecma::{ 7 | ast::*, 8 | visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith}, 9 | }, 10 | plugin::{ 11 | metadata::TransformPluginMetadataContextKind, plugin_transform, 12 | proxies::TransformPluginProgramMetadata, 13 | }, 14 | quote, 15 | }; 16 | 17 | pub struct ReactRefreshTransformVisitor { 18 | atom_import_map: AtomImportMap, 19 | #[allow(dead_code)] 20 | file_name: FileName, 21 | /// We're currently at the top level 22 | top_level: bool, 23 | /// We're currently at the module level (not inside functions/blocks) 24 | module_level: bool, 25 | /// Any atom was used. 26 | used_atom: bool, 27 | /// Path to the current expression when walking object and array literals. 28 | /// For instance, when walking this expression: 29 | /// ```js 30 | /// const foo = [{}, { bar: [ 123 ]}] 31 | /// ``` 32 | /// the path will be `["foo", "1", "bar", "0"]` when visiting `123`. 33 | access_path: Vec, 34 | } 35 | 36 | fn create_react_refresh_call_expr_(key: String, atom_expr: &CallExpr) -> CallExpr { 37 | CallExpr { 38 | span: DUMMY_SP, 39 | ctxt: SyntaxContext::empty(), 40 | callee: Callee::Expr(Box::new(Expr::Member(MemberExpr { 41 | span: DUMMY_SP, 42 | obj: Box::new(Expr::Member(MemberExpr { 43 | span: DUMMY_SP, 44 | obj: Box::new(Expr::Ident("globalThis".into())), 45 | prop: MemberProp::Ident("jotaiAtomCache".into()), 46 | })), 47 | prop: MemberProp::Ident("get".into()), 48 | }))), 49 | args: vec![ 50 | ExprOrSpread { 51 | spread: None, 52 | expr: Box::new(Expr::Lit(Lit::Str(Str { 53 | value: key.into(), 54 | span: DUMMY_SP, 55 | raw: None, 56 | }))), 57 | }, 58 | ExprOrSpread { 59 | spread: None, 60 | expr: Box::new(Expr::Call(atom_expr.clone())), 61 | }, 62 | ], 63 | type_args: None, 64 | } 65 | } 66 | 67 | fn show_prop_name(pn: &PropName) -> String { 68 | use PropName::*; 69 | match pn { 70 | Ident(ref i) => i.sym.to_string(), 71 | Str(ref s) => s.value.to_string_lossy().to_string(), 72 | Num(ref n) => n 73 | .raw 74 | .as_ref() 75 | .expect("Num(c).raw should be Some") 76 | .to_string(), 77 | Computed(ref c) => format!("computed:{:?}", c.span), 78 | BigInt(ref b) => b 79 | .raw 80 | .as_ref() 81 | .expect("BigInt(b).raw should be Some") 82 | .to_string(), 83 | #[cfg(swc_ast_unknown)] 84 | _ => panic!("unknown node"), 85 | } 86 | } 87 | 88 | impl ReactRefreshTransformVisitor { 89 | pub fn new(config: Config, file_name: FileName) -> Self { 90 | Self { 91 | atom_import_map: AtomImportMap::new(config.atom_names), 92 | file_name, 93 | top_level: false, 94 | module_level: true, 95 | used_atom: false, 96 | access_path: Vec::new(), 97 | } 98 | } 99 | 100 | fn create_cache_key(&self) -> String { 101 | match self.file_name { 102 | FileName::Real(ref real_file_name) => format!( 103 | "{}/{}", 104 | real_file_name.display(), 105 | self.access_path.join(".") 106 | ), 107 | _ => self.access_path.join("."), 108 | } 109 | } 110 | } 111 | 112 | impl VisitMut for ReactRefreshTransformVisitor { 113 | noop_visit_mut_type!(); 114 | 115 | fn visit_mut_program(&mut self, program: &mut Program) { 116 | match program { 117 | Program::Module(module) => { 118 | self.visit_mut_module(module); 119 | } 120 | Program::Script(script) => { 121 | // For scripts, we need to handle cache insertion manually 122 | self.top_level = true; 123 | self.module_level = true; 124 | script.visit_mut_children_with(self); 125 | 126 | if self.used_atom { 127 | let jotai_cache_stmt = quote!( 128 | "globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 129 | cache: new Map(), 130 | get(name, inst) { 131 | if (this.cache.has(name)) { 132 | return this.cache.get(name) 133 | } 134 | this.cache.set(name, inst) 135 | return inst 136 | }, 137 | }" as Stmt 138 | ); 139 | 140 | // Find the position to insert the cache statement 141 | // Insert after directives but before other statements 142 | let mut insert_pos = 0; 143 | for (i, stmt) in script.body.iter().enumerate() { 144 | match stmt { 145 | Stmt::Expr(ExprStmt { expr, .. }) => { 146 | if let Expr::Lit(Lit::Str(str_lit)) = &**expr { 147 | if str_lit.value.as_str() == Some("use client") 148 | || str_lit.value.as_str() == Some("use strict") 149 | { 150 | insert_pos = i + 1; 151 | continue; 152 | } 153 | } 154 | // Not a directive, so this is where we should insert before regular statements 155 | break; 156 | } 157 | _ => { 158 | // For any other statement, this is where we should stop looking 159 | break; 160 | } 161 | } 162 | } 163 | 164 | script.body.insert(insert_pos, jotai_cache_stmt); 165 | } 166 | } 167 | #[cfg(swc_ast_unknown)] 168 | _ => panic!("unknown node"), 169 | } 170 | } 171 | 172 | fn visit_mut_module(&mut self, module: &mut Module) { 173 | self.visit_mut_module_items(&mut module.body); 174 | } 175 | 176 | fn visit_mut_import_decl(&mut self, import: &mut ImportDecl) { 177 | self.atom_import_map.visit_import_decl(import); 178 | } 179 | 180 | fn visit_mut_module_items(&mut self, items: &mut Vec) { 181 | self.top_level = true; 182 | self.module_level = true; 183 | items.visit_mut_children_with(self); 184 | if self.used_atom { 185 | let jotai_cache_stmt = quote!( 186 | "globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 187 | cache: new Map(), 188 | get(name, inst) { 189 | if (this.cache.has(name)) { 190 | return this.cache.get(name) 191 | } 192 | this.cache.set(name, inst) 193 | return inst 194 | }, 195 | }" as Stmt 196 | ); 197 | let mi: ModuleItem = jotai_cache_stmt.into(); 198 | 199 | // Find the position to insert the cache statement 200 | // Insert at the very beginning, before imports and directives 201 | let mut insert_pos = 0; 202 | for (i, item) in items.iter().enumerate() { 203 | match item { 204 | ModuleItem::Stmt(Stmt::Expr(ExprStmt { expr, .. })) => { 205 | // Check if this is a directive like 'use client' or 'use strict' 206 | if let Expr::Lit(Lit::Str(str_lit)) = &**expr { 207 | if str_lit.value.as_str() == Some("use client") 208 | || str_lit.value.as_str() == Some("use strict") 209 | { 210 | insert_pos = i + 1; 211 | continue; 212 | } 213 | } 214 | // Not a directive, so insert before this 215 | break; 216 | } 217 | _ => { 218 | // For any other item (including imports), insert before it 219 | break; 220 | } 221 | } 222 | } 223 | 224 | items.insert(insert_pos, mi); 225 | } 226 | } 227 | 228 | fn visit_mut_stmts(&mut self, stmts: &mut Vec) { 229 | let top_level = self.top_level; 230 | // Only set top_level to false, but keep module_level as is 231 | // This is important: statements at module level should still be considered module_level 232 | self.top_level = false; 233 | stmts.visit_mut_children_with(self); 234 | self.top_level = top_level; 235 | } 236 | 237 | fn visit_mut_var_declarator(&mut self, var_declarator: &mut VarDeclarator) { 238 | // Module-level variable declarations should be processed even when not at top_level 239 | // This is necessary for custom atom names to work properly 240 | // But only process if we're at module level to avoid function-scoped variables 241 | if !self.module_level { 242 | return; 243 | } 244 | 245 | let key = if let Pat::Ident(BindingIdent { 246 | id: Ident { sym, .. }, 247 | .. 248 | }) = &var_declarator.name 249 | { 250 | sym.to_string() 251 | } else { 252 | "[missing-declarator]".to_string() 253 | }; 254 | 255 | self.access_path.push(key); 256 | var_declarator.visit_mut_children_with(self); 257 | self.access_path.pop(); 258 | } 259 | 260 | fn visit_mut_arrow_expr(&mut self, arrow: &mut ArrowExpr) { 261 | let module_level = self.module_level; 262 | self.module_level = false; 263 | arrow.visit_mut_children_with(self); 264 | self.module_level = module_level; 265 | } 266 | 267 | fn visit_mut_function(&mut self, func: &mut Function) { 268 | let module_level = self.module_level; 269 | self.module_level = false; 270 | func.visit_mut_children_with(self); 271 | self.module_level = module_level; 272 | } 273 | 274 | fn visit_mut_array_lit(&mut self, array: &mut ArrayLit) { 275 | if !self.module_level { 276 | return; 277 | } 278 | for (i, child) in array.elems.iter_mut().enumerate() { 279 | self.access_path.push(i.to_string()); 280 | child.visit_mut_with(self); 281 | self.access_path.pop(); 282 | } 283 | } 284 | 285 | fn visit_mut_object_lit(&mut self, object: &mut ObjectLit) { 286 | if !self.module_level { 287 | return; 288 | } 289 | // For each prop in the object we need to record the path down to build up the ind-path 290 | // down to any atoms in the literal. 291 | for prop in object.props.iter_mut() { 292 | match prop { 293 | PropOrSpread::Prop(ref mut prop) => match prop.as_mut() { 294 | Prop::Shorthand(ref mut s) => { 295 | self.access_path.push(s.sym.to_string()); 296 | prop.visit_mut_with(self); 297 | self.access_path.pop(); 298 | } 299 | Prop::KeyValue(ref mut kv) => { 300 | self.access_path.push(show_prop_name(&kv.key)); 301 | prop.visit_mut_with(self); 302 | self.access_path.pop(); 303 | } 304 | _ => prop.visit_mut_with(self), 305 | }, 306 | _ => prop.visit_mut_with(self), 307 | } 308 | } 309 | } 310 | 311 | fn visit_mut_call_expr(&mut self, call_expr: &mut CallExpr) { 312 | // If this is an atom, replace it with the cached `get` expression. 313 | // Check for atoms regardless of top_level status to support custom atom names 314 | // But only at module level to avoid function-scoped atoms 315 | if self.module_level { 316 | if let Callee::Expr(expr) = &call_expr.callee { 317 | if self.atom_import_map.is_atom_import(expr) { 318 | *call_expr = 319 | create_react_refresh_call_expr_(self.create_cache_key(), call_expr); 320 | self.used_atom = true; 321 | return; 322 | } 323 | } 324 | } 325 | call_expr.visit_mut_children_with(self); 326 | } 327 | } 328 | 329 | pub fn react_refresh(config: Config, file_name: FileName) -> impl Pass { 330 | visit_mut_pass(ReactRefreshTransformVisitor::new(config, file_name)) 331 | } 332 | 333 | #[plugin_transform] 334 | pub fn react_refresh_transform( 335 | program: Program, 336 | metadata: TransformPluginProgramMetadata, 337 | ) -> Program { 338 | let config = parse_plugin_config( 339 | &metadata 340 | .get_transform_plugin_config() 341 | .expect("Failed to get plugin config for @swc-jotai/debug-label"), 342 | ); 343 | let file_name = match &metadata.get_context(&TransformPluginMetadataContextKind::Filename) { 344 | Some(file_name) => FileName::Real(file_name.into()), 345 | None => FileName::Anon, 346 | }; 347 | program.apply(&mut visit_mut_pass(ReactRefreshTransformVisitor::new( 348 | config, file_name, 349 | ))) 350 | } 351 | 352 | #[cfg(test)] 353 | mod tests { 354 | use std::path::PathBuf; 355 | 356 | use super::*; 357 | use swc_core::ecma::{ 358 | parser::Syntax, 359 | transforms::testing::{test, test_inline}, 360 | visit::visit_mut_pass, 361 | }; 362 | 363 | fn transform(config: Option, file_name: Option) -> impl Pass { 364 | visit_mut_pass(ReactRefreshTransformVisitor::new( 365 | config.unwrap_or_default(), 366 | file_name.unwrap_or(FileName::Real(PathBuf::from("atoms.ts"))), 367 | )) 368 | } 369 | 370 | test_inline!( 371 | Syntax::default(), 372 | |_| transform(None, None), 373 | basic, 374 | r#" 375 | import { atom } from "jotai"; 376 | const countAtom = atom(0);"#, 377 | r#" 378 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 379 | cache: new Map(), 380 | get(name, inst) { 381 | if (this.cache.has(name)) { 382 | return this.cache.get(name) 383 | } 384 | this.cache.set(name, inst) 385 | return inst 386 | }, 387 | } 388 | import { atom } from "jotai"; 389 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0));"# 390 | ); 391 | 392 | test_inline!( 393 | Syntax::default(), 394 | |_| transform(None, None), 395 | multiple_atoms, 396 | r#" 397 | import { atom } from "jotai"; 398 | const countAtom = atom(0); 399 | const doubleAtom = atom((get) => get(countAtom) * 2);"#, 400 | r#" 401 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 402 | cache: new Map(), 403 | get(name, inst) { 404 | if (this.cache.has(name)) { 405 | return this.cache.get(name) 406 | } 407 | this.cache.set(name, inst) 408 | return inst 409 | }, 410 | } 411 | import { atom } from "jotai"; 412 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0)); 413 | const doubleAtom = globalThis.jotaiAtomCache.get("atoms.ts/doubleAtom", atom((get)=>get(countAtom) * 2));"# 414 | ); 415 | 416 | test_inline!( 417 | Syntax::default(), 418 | |_| transform(None, None), 419 | multiple_atoms_between_code, 420 | r#" 421 | import { atom } from "jotai"; 422 | const countAtom = atom(0); 423 | let counter = 0; 424 | const increment = () => ++counter; 425 | const doubleAtom = atom((get) => get(countAtom) * 2);"#, 426 | r#" 427 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 428 | cache: new Map(), 429 | get(name, inst) { 430 | if (this.cache.has(name)) { 431 | return this.cache.get(name) 432 | } 433 | this.cache.set(name, inst) 434 | return inst 435 | }, 436 | } 437 | import { atom } from "jotai"; 438 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0)); 439 | let counter = 0; 440 | const increment = () => ++counter; 441 | const doubleAtom = globalThis.jotaiAtomCache.get("atoms.ts/doubleAtom", atom((get)=>get(countAtom) * 2));"# 442 | ); 443 | 444 | test_inline!( 445 | Syntax::default(), 446 | |_| transform(None, None), 447 | import_alias, 448 | r#" 449 | import { atom as blah } from "jotai"; 450 | const countAtom = blah(0);"#, 451 | r#" 452 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 453 | cache: new Map(), 454 | get(name, inst) { 455 | if (this.cache.has(name)) { 456 | return this.cache.get(name) 457 | } 458 | this.cache.set(name, inst) 459 | return inst 460 | }, 461 | } 462 | import { atom as blah } from "jotai"; 463 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", blah(0));"# 464 | ); 465 | 466 | test_inline!( 467 | Syntax::default(), 468 | |_| transform(None, None), 469 | ignore_non_jotai_imports, 470 | r#" 471 | import React from "react"; 472 | import { atom } from "jotai"; 473 | import { defaultCount } from "./utils"; 474 | const countAtom = atom(0);"#, 475 | r#" 476 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 477 | cache: new Map(), 478 | get(name, inst) { 479 | if (this.cache.has(name)) { 480 | return this.cache.get(name) 481 | } 482 | this.cache.set(name, inst) 483 | return inst 484 | }, 485 | } 486 | import React from "react"; 487 | import { atom } from "jotai"; 488 | import { defaultCount } from "./utils"; 489 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0));"# 490 | ); 491 | 492 | test_inline!( 493 | Syntax::default(), 494 | |_| transform(None, None), 495 | namespace_import, 496 | r#" 497 | import * as jotai from "jotai"; 498 | const countAtom = jotai.atom(0);"#, 499 | r#" 500 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 501 | cache: new Map(), 502 | get(name, inst) { 503 | if (this.cache.has(name)) { 504 | return this.cache.get(name) 505 | } 506 | this.cache.set(name, inst) 507 | return inst 508 | }, 509 | } 510 | import * as jotai from "jotai"; 511 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", jotai.atom(0));"# 512 | ); 513 | 514 | test_inline!( 515 | Syntax::default(), 516 | |_| transform(None, None), 517 | atom_from_another_package, 518 | r#" 519 | import { atom } from "some-library"; 520 | const countAtom = atom(0);"#, 521 | r#" 522 | import { atom } from "some-library"; 523 | const countAtom = atom(0);"# 524 | ); 525 | 526 | test_inline!( 527 | Syntax::default(), 528 | |_| transform(None, None), 529 | no_jotai_import, 530 | "const countAtom = atom(0);", 531 | "const countAtom = atom(0);" 532 | ); 533 | 534 | test_inline!( 535 | Syntax::default(), 536 | |_| transform(None, None), 537 | handle_default_export, 538 | r#" 539 | import { atom } from "jotai"; 540 | export default atom(0);"#, 541 | r#" 542 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 543 | cache: new Map(), 544 | get(name, inst) { 545 | if (this.cache.has(name)) { 546 | return this.cache.get(name) 547 | } 548 | this.cache.set(name, inst) 549 | return inst 550 | }, 551 | } 552 | import { atom } from "jotai"; 553 | export default globalThis.jotaiAtomCache.get("atoms.ts/", atom(0));"# 554 | ); 555 | 556 | test_inline!( 557 | Syntax::default(), 558 | |_| transform(None, Some(FileName::Real("countAtom.ts".parse().unwrap()))), 559 | handle_file_naming_default_export, 560 | r#" 561 | import { atom } from "jotai"; 562 | export default atom(0);"#, 563 | r#" 564 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 565 | cache: new Map(), 566 | get(name, inst) { 567 | if (this.cache.has(name)) { 568 | return this.cache.get(name) 569 | } 570 | this.cache.set(name, inst) 571 | return inst 572 | }, 573 | } 574 | import { atom } from "jotai"; 575 | export default globalThis.jotaiAtomCache.get("countAtom.ts/", atom(0));"# 576 | ); 577 | 578 | test_inline!( 579 | Syntax::default(), 580 | |_| transform( 581 | None, 582 | Some(FileName::Real("src/atoms/countAtom.ts".parse().unwrap())) 583 | ), 584 | handle_file_path_default_export, 585 | r#" 586 | import { atom } from "jotai"; 587 | export default atom(0);"#, 588 | r#" 589 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 590 | cache: new Map(), 591 | get(name, inst) { 592 | if (this.cache.has(name)) { 593 | return this.cache.get(name) 594 | } 595 | this.cache.set(name, inst) 596 | return inst 597 | }, 598 | } 599 | import { atom } from "jotai"; 600 | export default globalThis.jotaiAtomCache.get("src/atoms/countAtom.ts/", atom(0));"# 601 | ); 602 | 603 | test_inline!( 604 | Syntax::default(), 605 | |_| transform(None, None), 606 | jotai_utils_import, 607 | r#" 608 | import { atomWithImmer } from "jotai/immer"; 609 | import { atomWithMachine } from "jotai/xstate"; 610 | const immerAtom = atomWithImmer(0); 611 | const toggleMachineAtom = atomWithMachine(() => toggleMachine);"#, 612 | r#" 613 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 614 | cache: new Map(), 615 | get(name, inst) { 616 | if (this.cache.has(name)) { 617 | return this.cache.get(name) 618 | } 619 | this.cache.set(name, inst) 620 | return inst 621 | }, 622 | } 623 | import { atomWithImmer } from "jotai/immer"; 624 | import { atomWithMachine } from "jotai/xstate"; 625 | const immerAtom = globalThis.jotaiAtomCache.get("atoms.ts/immerAtom", atomWithImmer(0)); 626 | const toggleMachineAtom = globalThis.jotaiAtomCache.get("atoms.ts/toggleMachineAtom", atomWithMachine(()=>toggleMachine));"# 627 | ); 628 | 629 | test_inline!( 630 | Syntax::default(), 631 | |_| transform(None, None), 632 | test_default_export, 633 | r#" 634 | function fn() { return true; } 635 | 636 | export default fn;"#, 637 | r#" 638 | function fn() { return true; } 639 | 640 | export default fn;"# 641 | ); 642 | 643 | test_inline!( 644 | Syntax::default(), 645 | |_| transform( 646 | Some(Config { 647 | atom_names: vec!["customAtom".into()] 648 | }), 649 | None 650 | ), 651 | custom_atom_names, 652 | r#" 653 | const myCustomAtom = customAtom(0);"#, 654 | r#" 655 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 656 | cache: new Map(), 657 | get(name, inst) { 658 | if (this.cache.has(name)) { 659 | return this.cache.get(name) 660 | } 661 | this.cache.set(name, inst) 662 | return inst 663 | }, 664 | } 665 | const myCustomAtom = globalThis.jotaiAtomCache.get("atoms.ts/myCustomAtom", customAtom(0));"# 666 | ); 667 | 668 | test_inline!( 669 | Syntax::default(), 670 | |_| transform(None, None), 671 | exported_atom, 672 | r#" 673 | import { atom } from "jotai"; 674 | export const countAtom = atom(0);"#, 675 | r#" 676 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 677 | cache: new Map(), 678 | get(name, inst) { 679 | if (this.cache.has(name)) { 680 | return this.cache.get(name) 681 | } 682 | this.cache.set(name, inst) 683 | return inst 684 | }, 685 | } 686 | import { atom } from "jotai"; 687 | export const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0));"# 688 | ); 689 | 690 | test_inline!( 691 | Syntax::default(), 692 | |_| transform(None, None), 693 | multiple_exported_atoms, 694 | r#" 695 | import { atom } from "jotai"; 696 | export const countAtom = atom(0); 697 | export const doubleAtom = atom((get) => get(countAtom) * 2);"#, 698 | r#" 699 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 700 | cache: new Map(), 701 | get(name, inst) { 702 | if (this.cache.has(name)) { 703 | return this.cache.get(name) 704 | } 705 | this.cache.set(name, inst) 706 | return inst 707 | }, 708 | } 709 | import { atom } from "jotai"; 710 | export const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0)); 711 | export const doubleAtom = globalThis.jotaiAtomCache.get("atoms.ts/doubleAtom", atom((get)=>get(countAtom) * 2));"# 712 | ); 713 | 714 | test_inline!( 715 | Syntax::default(), 716 | |_| transform(None, None), 717 | ignore_non_top_level_atoms, 718 | r#" 719 | import { atom } from "jotai"; 720 | function createAtom(ov) { 721 | const valueAtom = atom(ov); 722 | const observableValueAtom = atom((get) => { 723 | const value = get(valueAtom); 724 | return value; 725 | }, 726 | (_get, set, nextValue) => { 727 | set(valueAtom, nextValue); 728 | }); 729 | return observableValueAtom; 730 | } 731 | 732 | const value1Atom = createAtom('Hello String!'); 733 | const countAtom = atom(0);"#, 734 | r#" 735 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 736 | cache: new Map(), 737 | get(name, inst) { 738 | if (this.cache.has(name)) { 739 | return this.cache.get(name) 740 | } 741 | this.cache.set(name, inst) 742 | return inst 743 | }, 744 | } 745 | import { atom } from "jotai"; 746 | function createAtom(ov) { 747 | const valueAtom = atom(ov); 748 | const observableValueAtom = atom((get) => { 749 | const value = get(valueAtom); 750 | return value; 751 | }, 752 | (_get, set, nextValue) => { 753 | set(valueAtom, nextValue); 754 | }); 755 | return observableValueAtom; 756 | } 757 | 758 | const value1Atom = createAtom('Hello String!'); 759 | const countAtom = globalThis.jotaiAtomCache.get("atoms.ts/countAtom", atom(0));"# 760 | ); 761 | 762 | test_inline!( 763 | Syntax::default(), 764 | |_| transform(None, Some(FileName::Anon)), 765 | nested_top_level_atoms, 766 | r#" 767 | import { atom } from "jotai"; 768 | 769 | const three = atom(atom(atom(0))); 770 | "#, 771 | r#" 772 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 773 | cache: new Map(), 774 | get(name, inst) { 775 | if (this.cache.has(name)) { 776 | return this.cache.get(name) 777 | } 778 | this.cache.set(name, inst) 779 | return inst 780 | }, 781 | } 782 | import { atom } from "jotai"; 783 | const three = globalThis.jotaiAtomCache.get("three", atom(atom(atom(0)))); 784 | "# 785 | ); 786 | 787 | test_inline!( 788 | Syntax::default(), 789 | |_| transform(None, Some(FileName::Anon)), 790 | higher_order_fn_to_atom, 791 | r#" 792 | import { atom } from "jotai"; 793 | 794 | function getAtom() { 795 | return atom(1); 796 | } 797 | const getAtom2 = () => atom(2); 798 | const getAtom3 = () => { return atom(3) }; 799 | "#, 800 | r#" 801 | import { atom } from "jotai"; 802 | 803 | function getAtom() { 804 | return atom(1); 805 | } 806 | const getAtom2 = () => atom(2); 807 | const getAtom3 = () => { return atom(3) }; 808 | "# 809 | ); 810 | 811 | test_inline!( 812 | Syntax::default(), 813 | |_| transform(None, Some(FileName::Anon)), 814 | atom_in_atom_reader_stmt, 815 | r#" 816 | import { atom } from "jotai"; 817 | 818 | export const state = atom(() => { 819 | return atom(0); 820 | });"#, 821 | r#" 822 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 823 | cache: new Map(), 824 | get(name, inst) { 825 | if (this.cache.has(name)) { 826 | return this.cache.get(name) 827 | } 828 | this.cache.set(name, inst) 829 | return inst 830 | }, 831 | } 832 | import { atom } from "jotai"; 833 | 834 | export const state = globalThis.jotaiAtomCache.get("state", atom(() => { 835 | return atom(0); 836 | }));"# 837 | ); 838 | 839 | test_inline!( 840 | Syntax::default(), 841 | |_| transform(None, Some(FileName::Anon)), 842 | array_and_object_top_level, 843 | r#" 844 | import { atom } from "jotai"; 845 | 846 | const arr = [ 847 | atom(3), 848 | atom(4), 849 | ]; 850 | 851 | const obj = { 852 | five: atom(5), 853 | six: atom(6), 854 | }; 855 | 856 | function keepThese() { 857 | const a = [atom(7)]; 858 | const b = { eight: atom(8) }; 859 | } 860 | "#, 861 | r#" 862 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 863 | cache: new Map(), 864 | get(name, inst) { 865 | if (this.cache.has(name)) { 866 | return this.cache.get(name) 867 | } 868 | this.cache.set(name, inst) 869 | return inst 870 | }, 871 | } 872 | import { atom } from "jotai"; 873 | 874 | const arr = [ 875 | globalThis.jotaiAtomCache.get("arr.0", atom(3)), 876 | globalThis.jotaiAtomCache.get("arr.1", atom(4)), 877 | ]; 878 | 879 | const obj = { 880 | five: globalThis.jotaiAtomCache.get("obj.five", atom(5)), 881 | six: globalThis.jotaiAtomCache.get("obj.six", atom(6)), 882 | }; 883 | 884 | function keepThese() { 885 | const a = [atom(7)]; 886 | const b = { eight: atom(8) }; 887 | } 888 | "# 889 | ); 890 | 891 | test_inline!( 892 | Syntax::default(), 893 | |_| transform(None, Some(FileName::Anon)), 894 | object_edge_cases, 895 | r#" 896 | import { atom } from "jotai"; 897 | 898 | const obj = { 899 | five: atom(5), 900 | six: atom(6), 901 | ...({ 902 | six: atom(66), 903 | }) 904 | }; 905 | "#, 906 | r#" 907 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 908 | cache: new Map(), 909 | get(name, inst) { 910 | if (this.cache.has(name)) { 911 | return this.cache.get(name) 912 | } 913 | this.cache.set(name, inst) 914 | return inst 915 | }, 916 | } 917 | import { atom } from "jotai"; 918 | 919 | const obj = { 920 | five: globalThis.jotaiAtomCache.get("obj.five", atom(5)), 921 | six: globalThis.jotaiAtomCache.get("obj.six", atom(6)), 922 | ...{ 923 | six: globalThis.jotaiAtomCache.get("obj.six", atom(66)), 924 | } 925 | }; 926 | "# 927 | ); 928 | 929 | test_inline!( 930 | Syntax::default(), 931 | |_| transform(None, Some(FileName::Anon)), 932 | compound_export, 933 | r#" 934 | import { atom } from "jotai"; 935 | 936 | export const one = atom(1), 937 | two = atom(2); 938 | "#, 939 | r#" 940 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 941 | cache: new Map(), 942 | get(name, inst) { 943 | if (this.cache.has(name)) { 944 | return this.cache.get(name) 945 | } 946 | this.cache.set(name, inst) 947 | return inst 948 | }, 949 | } 950 | import { atom } from "jotai"; 951 | 952 | export const one = globalThis.jotaiAtomCache.get("one", atom(1)), two = globalThis.jotaiAtomCache.get("two", atom(2)); 953 | "# 954 | ); 955 | 956 | // Test for Issue #21: 'use client' directive placement 957 | test_inline!( 958 | Syntax::default(), 959 | |_| transform(None, Some(FileName::Anon)), 960 | use_client_directive_placement, 961 | r#" 962 | 'use client'; 963 | import { atom } from "jotai"; 964 | const countAtom = atom(0); 965 | "#, 966 | r#" 967 | 'use client'; 968 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 969 | cache: new Map(), 970 | get(name, inst) { 971 | if (this.cache.has(name)) { 972 | return this.cache.get(name) 973 | } 974 | this.cache.set(name, inst) 975 | return inst 976 | }, 977 | } 978 | import { atom } from "jotai"; 979 | const countAtom = globalThis.jotaiAtomCache.get("countAtom", atom(0)); 980 | "# 981 | ); 982 | 983 | test_inline!( 984 | Syntax::default(), 985 | |_| transform(None, Some(FileName::Anon)), 986 | use_strict_directive_placement, 987 | r#" 988 | 'use strict'; 989 | import { atom } from "jotai"; 990 | const countAtom = atom(0); 991 | "#, 992 | r#" 993 | 'use strict'; 994 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 995 | cache: new Map(), 996 | get(name, inst) { 997 | if (this.cache.has(name)) { 998 | return this.cache.get(name) 999 | } 1000 | this.cache.set(name, inst) 1001 | return inst 1002 | }, 1003 | } 1004 | import { atom } from "jotai"; 1005 | const countAtom = globalThis.jotaiAtomCache.get("countAtom", atom(0)); 1006 | "# 1007 | ); 1008 | 1009 | test_inline!( 1010 | Syntax::default(), 1011 | |_| transform(None, Some(FileName::Anon)), 1012 | multiple_directives_placement, 1013 | r#" 1014 | 'use strict'; 1015 | 'use client'; 1016 | import { atom } from "jotai"; 1017 | const countAtom = atom(0); 1018 | "#, 1019 | r#" 1020 | 'use strict'; 1021 | 'use client'; 1022 | globalThis.jotaiAtomCache = globalThis.jotaiAtomCache || { 1023 | cache: new Map(), 1024 | get(name, inst) { 1025 | if (this.cache.has(name)) { 1026 | return this.cache.get(name) 1027 | } 1028 | this.cache.set(name, inst) 1029 | return inst 1030 | }, 1031 | } 1032 | import { atom } from "jotai"; 1033 | const countAtom = globalThis.jotaiAtomCache.get("countAtom", atom(0)); 1034 | "# 1035 | ); 1036 | 1037 | test_inline!( 1038 | Syntax::default(), 1039 | |_| transform(None, Some(FileName::Anon)), 1040 | use_client_without_imports, 1041 | r#" 1042 | 'use client'; 1043 | const countAtom = customAtom(0); 1044 | "#, 1045 | r#" 1046 | 'use client'; 1047 | const countAtom = customAtom(0); 1048 | "# 1049 | ); 1050 | } 1051 | -------------------------------------------------------------------------------- /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 = "ansi_term" 34 | version = "0.12.1" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 37 | dependencies = [ 38 | "winapi", 39 | ] 40 | 41 | [[package]] 42 | name = "anyhow" 43 | version = "1.0.98" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" 46 | 47 | [[package]] 48 | name = "ascii" 49 | version = "1.1.0" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" 52 | 53 | [[package]] 54 | name = "ast_node" 55 | version = "5.0.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "2eb025ef00a6da925cf40870b9c8d008526b6004ece399cb0974209720f0b194" 58 | dependencies = [ 59 | "quote", 60 | "swc_macros_common", 61 | "syn", 62 | ] 63 | 64 | [[package]] 65 | name = "autocfg" 66 | version = "1.5.0" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 69 | 70 | [[package]] 71 | name = "base64" 72 | version = "0.22.1" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 75 | 76 | [[package]] 77 | name = "base64-simd" 78 | version = "0.8.0" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" 81 | dependencies = [ 82 | "outref", 83 | "vsimd", 84 | ] 85 | 86 | [[package]] 87 | name = "better_scoped_tls" 88 | version = "1.0.1" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "7cd228125315b132eed175bf47619ac79b945b26e56b848ba203ae4ea8603609" 91 | dependencies = [ 92 | "scoped-tls", 93 | ] 94 | 95 | [[package]] 96 | name = "bitflags" 97 | version = "2.9.1" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" 100 | 101 | [[package]] 102 | name = "bitvec" 103 | version = "1.0.1" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 106 | dependencies = [ 107 | "funty", 108 | "radium", 109 | "tap", 110 | "wyz", 111 | ] 112 | 113 | [[package]] 114 | name = "block-buffer" 115 | version = "0.10.4" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 118 | dependencies = [ 119 | "generic-array", 120 | ] 121 | 122 | [[package]] 123 | name = "bumpalo" 124 | version = "3.19.0" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" 127 | dependencies = [ 128 | "allocator-api2", 129 | ] 130 | 131 | [[package]] 132 | name = "bytecheck" 133 | version = "0.8.1" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "50690fb3370fb9fe3550372746084c46f2ac8c9685c583d2be10eefd89d3d1a3" 136 | dependencies = [ 137 | "bytecheck_derive", 138 | "ptr_meta", 139 | "rancor", 140 | "simdutf8", 141 | ] 142 | 143 | [[package]] 144 | name = "bytecheck_derive" 145 | version = "0.8.1" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71" 148 | dependencies = [ 149 | "proc-macro2", 150 | "quote", 151 | "syn", 152 | ] 153 | 154 | [[package]] 155 | name = "bytes" 156 | version = "1.10.1" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 159 | 160 | [[package]] 161 | name = "bytes-str" 162 | version = "0.2.7" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "7c60b5ce37e0b883c37eb89f79a1e26fbe9c1081945d024eee93e8d91a7e18b3" 165 | dependencies = [ 166 | "bytes", 167 | "rkyv", 168 | "serde", 169 | ] 170 | 171 | [[package]] 172 | name = "camino" 173 | version = "1.1.10" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" 176 | dependencies = [ 177 | "serde", 178 | ] 179 | 180 | [[package]] 181 | name = "cargo-platform" 182 | version = "0.1.9" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" 185 | dependencies = [ 186 | "serde", 187 | ] 188 | 189 | [[package]] 190 | name = "cargo_metadata" 191 | version = "0.18.1" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" 194 | dependencies = [ 195 | "camino", 196 | "cargo-platform", 197 | "semver", 198 | "serde", 199 | "serde_json", 200 | "thiserror 1.0.69", 201 | ] 202 | 203 | [[package]] 204 | name = "cargo_metadata" 205 | version = "0.19.2" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" 208 | dependencies = [ 209 | "camino", 210 | "cargo-platform", 211 | "semver", 212 | "serde", 213 | "serde_json", 214 | "thiserror 2.0.12", 215 | ] 216 | 217 | [[package]] 218 | name = "castaway" 219 | version = "0.2.4" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" 222 | dependencies = [ 223 | "rustversion", 224 | ] 225 | 226 | [[package]] 227 | name = "cbor4ii" 228 | version = "1.2.2" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "faed1a83001dc2c9201451030cc317e35bef36c84d3781d7c5bb9f343c397da8" 231 | 232 | [[package]] 233 | name = "cc" 234 | version = "1.2.30" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" 237 | dependencies = [ 238 | "shlex", 239 | ] 240 | 241 | [[package]] 242 | name = "cfg-if" 243 | version = "1.0.1" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" 246 | 247 | [[package]] 248 | name = "common" 249 | version = "0.1.0" 250 | dependencies = [ 251 | "serde", 252 | "serde_json", 253 | "swc_core", 254 | ] 255 | 256 | [[package]] 257 | name = "compact_str" 258 | version = "0.7.1" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" 261 | dependencies = [ 262 | "castaway", 263 | "cfg-if", 264 | "itoa", 265 | "ryu", 266 | "static_assertions", 267 | ] 268 | 269 | [[package]] 270 | name = "cpufeatures" 271 | version = "0.2.17" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" 274 | dependencies = [ 275 | "libc", 276 | ] 277 | 278 | [[package]] 279 | name = "crypto-common" 280 | version = "0.1.6" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 283 | dependencies = [ 284 | "generic-array", 285 | "typenum", 286 | ] 287 | 288 | [[package]] 289 | name = "darling" 290 | version = "0.20.11" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" 293 | dependencies = [ 294 | "darling_core", 295 | "darling_macro", 296 | ] 297 | 298 | [[package]] 299 | name = "darling_core" 300 | version = "0.20.11" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" 303 | dependencies = [ 304 | "fnv", 305 | "ident_case", 306 | "proc-macro2", 307 | "quote", 308 | "strsim", 309 | "syn", 310 | ] 311 | 312 | [[package]] 313 | name = "darling_macro" 314 | version = "0.20.11" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" 317 | dependencies = [ 318 | "darling_core", 319 | "quote", 320 | "syn", 321 | ] 322 | 323 | [[package]] 324 | name = "data-encoding" 325 | version = "2.9.0" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" 328 | 329 | [[package]] 330 | name = "debugid" 331 | version = "0.8.0" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" 334 | dependencies = [ 335 | "serde", 336 | "uuid", 337 | ] 338 | 339 | [[package]] 340 | name = "derive_builder" 341 | version = "0.20.2" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" 344 | dependencies = [ 345 | "derive_builder_macro", 346 | ] 347 | 348 | [[package]] 349 | name = "derive_builder_core" 350 | version = "0.20.2" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" 353 | dependencies = [ 354 | "darling", 355 | "proc-macro2", 356 | "quote", 357 | "syn", 358 | ] 359 | 360 | [[package]] 361 | name = "derive_builder_macro" 362 | version = "0.20.2" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" 365 | dependencies = [ 366 | "derive_builder_core", 367 | "syn", 368 | ] 369 | 370 | [[package]] 371 | name = "diff" 372 | version = "0.1.13" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" 375 | 376 | [[package]] 377 | name = "difference" 378 | version = "2.0.0" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" 381 | 382 | [[package]] 383 | name = "digest" 384 | version = "0.10.7" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 387 | dependencies = [ 388 | "block-buffer", 389 | "crypto-common", 390 | ] 391 | 392 | [[package]] 393 | name = "displaydoc" 394 | version = "0.2.5" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 397 | dependencies = [ 398 | "proc-macro2", 399 | "quote", 400 | "syn", 401 | ] 402 | 403 | [[package]] 404 | name = "either" 405 | version = "1.15.0" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 408 | 409 | [[package]] 410 | name = "equivalent" 411 | version = "1.0.2" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 414 | 415 | [[package]] 416 | name = "errno" 417 | version = "0.3.13" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" 420 | dependencies = [ 421 | "libc", 422 | "windows-sys 0.60.2", 423 | ] 424 | 425 | [[package]] 426 | name = "fastrand" 427 | version = "2.3.0" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 430 | 431 | [[package]] 432 | name = "fnv" 433 | version = "1.0.7" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 436 | 437 | [[package]] 438 | name = "form_urlencoded" 439 | version = "1.2.1" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 442 | dependencies = [ 443 | "percent-encoding", 444 | ] 445 | 446 | [[package]] 447 | name = "from_variant" 448 | version = "3.0.0" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "e5ff35a391aef949120a0340d690269b3d9f63460a6106e99bd07b961f345ea9" 451 | dependencies = [ 452 | "swc_macros_common", 453 | "syn", 454 | ] 455 | 456 | [[package]] 457 | name = "funty" 458 | version = "2.0.0" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 461 | 462 | [[package]] 463 | name = "generic-array" 464 | version = "0.14.7" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 467 | dependencies = [ 468 | "typenum", 469 | "version_check", 470 | ] 471 | 472 | [[package]] 473 | name = "getrandom" 474 | version = "0.3.3" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" 477 | dependencies = [ 478 | "cfg-if", 479 | "libc", 480 | "r-efi", 481 | "wasi", 482 | ] 483 | 484 | [[package]] 485 | name = "glob" 486 | version = "0.3.2" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" 489 | 490 | [[package]] 491 | name = "hashbrown" 492 | version = "0.14.5" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 495 | dependencies = [ 496 | "ahash", 497 | "allocator-api2", 498 | ] 499 | 500 | [[package]] 501 | name = "hashbrown" 502 | version = "0.15.4" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" 505 | 506 | [[package]] 507 | name = "heck" 508 | version = "0.5.0" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 511 | 512 | [[package]] 513 | name = "hermit-abi" 514 | version = "0.5.2" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" 517 | 518 | [[package]] 519 | name = "hex" 520 | version = "0.4.3" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 523 | 524 | [[package]] 525 | name = "hstr" 526 | version = "3.0.3" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "0c43c0a9e8fbdb3bb9dc8eee85e1e2ac81605418b4c83b6b7413cbf14d56ca5c" 529 | dependencies = [ 530 | "hashbrown 0.14.5", 531 | "new_debug_unreachable", 532 | "once_cell", 533 | "rustc-hash", 534 | "serde", 535 | "triomphe", 536 | ] 537 | 538 | [[package]] 539 | name = "icu_collections" 540 | version = "2.0.0" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" 543 | dependencies = [ 544 | "displaydoc", 545 | "potential_utf", 546 | "yoke", 547 | "zerofrom", 548 | "zerovec", 549 | ] 550 | 551 | [[package]] 552 | name = "icu_locale_core" 553 | version = "2.0.0" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" 556 | dependencies = [ 557 | "displaydoc", 558 | "litemap", 559 | "tinystr", 560 | "writeable", 561 | "zerovec", 562 | ] 563 | 564 | [[package]] 565 | name = "icu_normalizer" 566 | version = "2.0.0" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" 569 | dependencies = [ 570 | "displaydoc", 571 | "icu_collections", 572 | "icu_normalizer_data", 573 | "icu_properties", 574 | "icu_provider", 575 | "smallvec", 576 | "zerovec", 577 | ] 578 | 579 | [[package]] 580 | name = "icu_normalizer_data" 581 | version = "2.0.0" 582 | source = "registry+https://github.com/rust-lang/crates.io-index" 583 | checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" 584 | 585 | [[package]] 586 | name = "icu_properties" 587 | version = "2.0.1" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" 590 | dependencies = [ 591 | "displaydoc", 592 | "icu_collections", 593 | "icu_locale_core", 594 | "icu_properties_data", 595 | "icu_provider", 596 | "potential_utf", 597 | "zerotrie", 598 | "zerovec", 599 | ] 600 | 601 | [[package]] 602 | name = "icu_properties_data" 603 | version = "2.0.1" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" 606 | 607 | [[package]] 608 | name = "icu_provider" 609 | version = "2.0.0" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" 612 | dependencies = [ 613 | "displaydoc", 614 | "icu_locale_core", 615 | "stable_deref_trait", 616 | "tinystr", 617 | "writeable", 618 | "yoke", 619 | "zerofrom", 620 | "zerotrie", 621 | "zerovec", 622 | ] 623 | 624 | [[package]] 625 | name = "ident_case" 626 | version = "1.0.1" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 629 | 630 | [[package]] 631 | name = "idna" 632 | version = "1.0.3" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" 635 | dependencies = [ 636 | "idna_adapter", 637 | "smallvec", 638 | "utf8_iter", 639 | ] 640 | 641 | [[package]] 642 | name = "idna_adapter" 643 | version = "1.2.1" 644 | source = "registry+https://github.com/rust-lang/crates.io-index" 645 | checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 646 | dependencies = [ 647 | "icu_normalizer", 648 | "icu_properties", 649 | ] 650 | 651 | [[package]] 652 | name = "if_chain" 653 | version = "1.0.2" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" 656 | 657 | [[package]] 658 | name = "indexmap" 659 | version = "2.10.0" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" 662 | dependencies = [ 663 | "equivalent", 664 | "hashbrown 0.15.4", 665 | ] 666 | 667 | [[package]] 668 | name = "is-macro" 669 | version = "0.3.7" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "1d57a3e447e24c22647738e4607f1df1e0ec6f72e16182c4cd199f647cdfb0e4" 672 | dependencies = [ 673 | "heck", 674 | "proc-macro2", 675 | "quote", 676 | "syn", 677 | ] 678 | 679 | [[package]] 680 | name = "itoa" 681 | version = "1.0.15" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 684 | 685 | [[package]] 686 | name = "js-sys" 687 | version = "0.3.77" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" 690 | dependencies = [ 691 | "once_cell", 692 | "wasm-bindgen", 693 | ] 694 | 695 | [[package]] 696 | name = "lazy_static" 697 | version = "1.5.0" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 700 | 701 | [[package]] 702 | name = "libc" 703 | version = "0.2.174" 704 | source = "registry+https://github.com/rust-lang/crates.io-index" 705 | checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" 706 | 707 | [[package]] 708 | name = "linux-raw-sys" 709 | version = "0.9.4" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" 712 | 713 | [[package]] 714 | name = "litemap" 715 | version = "0.8.0" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" 718 | 719 | [[package]] 720 | name = "lock_api" 721 | version = "0.4.13" 722 | source = "registry+https://github.com/rust-lang/crates.io-index" 723 | checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" 724 | dependencies = [ 725 | "autocfg", 726 | "scopeguard", 727 | ] 728 | 729 | [[package]] 730 | name = "log" 731 | version = "0.4.27" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" 734 | 735 | [[package]] 736 | name = "matchers" 737 | version = "0.2.0" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" 740 | dependencies = [ 741 | "regex-automata", 742 | ] 743 | 744 | [[package]] 745 | name = "memchr" 746 | version = "2.7.5" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" 749 | 750 | [[package]] 751 | name = "miette" 752 | version = "7.6.0" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" 755 | dependencies = [ 756 | "cfg-if", 757 | "miette-derive", 758 | "owo-colors", 759 | "textwrap", 760 | "unicode-width 0.1.14", 761 | ] 762 | 763 | [[package]] 764 | name = "miette-derive" 765 | version = "7.6.0" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" 768 | dependencies = [ 769 | "proc-macro2", 770 | "quote", 771 | "syn", 772 | ] 773 | 774 | [[package]] 775 | name = "munge" 776 | version = "0.4.5" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "9cce144fab80fbb74ec5b89d1ca9d41ddf6b644ab7e986f7d3ed0aab31625cb1" 779 | dependencies = [ 780 | "munge_macro", 781 | ] 782 | 783 | [[package]] 784 | name = "munge_macro" 785 | version = "0.4.5" 786 | source = "registry+https://github.com/rust-lang/crates.io-index" 787 | checksum = "574af9cd5b9971cbfdf535d6a8d533778481b241c447826d976101e0149392a1" 788 | dependencies = [ 789 | "proc-macro2", 790 | "quote", 791 | "syn", 792 | ] 793 | 794 | [[package]] 795 | name = "new_debug_unreachable" 796 | version = "1.0.6" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" 799 | 800 | [[package]] 801 | name = "nu-ansi-term" 802 | version = "0.50.3" 803 | source = "registry+https://github.com/rust-lang/crates.io-index" 804 | checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" 805 | dependencies = [ 806 | "windows-sys 0.60.2", 807 | ] 808 | 809 | [[package]] 810 | name = "num-bigint" 811 | version = "0.4.6" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 814 | dependencies = [ 815 | "num-integer", 816 | "num-traits", 817 | "serde", 818 | ] 819 | 820 | [[package]] 821 | name = "num-integer" 822 | version = "0.1.46" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 825 | dependencies = [ 826 | "num-traits", 827 | ] 828 | 829 | [[package]] 830 | name = "num-traits" 831 | version = "0.2.19" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 834 | dependencies = [ 835 | "autocfg", 836 | ] 837 | 838 | [[package]] 839 | name = "num_cpus" 840 | version = "1.17.0" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" 843 | dependencies = [ 844 | "hermit-abi", 845 | "libc", 846 | ] 847 | 848 | [[package]] 849 | name = "once_cell" 850 | version = "1.21.3" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 853 | 854 | [[package]] 855 | name = "outref" 856 | version = "0.5.2" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" 859 | 860 | [[package]] 861 | name = "owo-colors" 862 | version = "4.2.2" 863 | source = "registry+https://github.com/rust-lang/crates.io-index" 864 | checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" 865 | 866 | [[package]] 867 | name = "par-core" 868 | version = "2.0.0" 869 | source = "registry+https://github.com/rust-lang/crates.io-index" 870 | checksum = "e96cbd21255b7fb29a5d51ef38a779b517a91abd59e2756c039583f43ef4c90f" 871 | dependencies = [ 872 | "once_cell", 873 | ] 874 | 875 | [[package]] 876 | name = "parking_lot" 877 | version = "0.12.4" 878 | source = "registry+https://github.com/rust-lang/crates.io-index" 879 | checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" 880 | dependencies = [ 881 | "lock_api", 882 | "parking_lot_core", 883 | ] 884 | 885 | [[package]] 886 | name = "parking_lot_core" 887 | version = "0.9.11" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" 890 | dependencies = [ 891 | "cfg-if", 892 | "libc", 893 | "redox_syscall", 894 | "smallvec", 895 | "windows-targets 0.52.6", 896 | ] 897 | 898 | [[package]] 899 | name = "percent-encoding" 900 | version = "2.3.1" 901 | source = "registry+https://github.com/rust-lang/crates.io-index" 902 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 903 | 904 | [[package]] 905 | name = "phf" 906 | version = "0.11.3" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" 909 | dependencies = [ 910 | "phf_macros", 911 | "phf_shared", 912 | ] 913 | 914 | [[package]] 915 | name = "phf_generator" 916 | version = "0.11.3" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" 919 | dependencies = [ 920 | "phf_shared", 921 | "rand", 922 | ] 923 | 924 | [[package]] 925 | name = "phf_macros" 926 | version = "0.11.3" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" 929 | dependencies = [ 930 | "phf_generator", 931 | "phf_shared", 932 | "proc-macro2", 933 | "quote", 934 | "syn", 935 | ] 936 | 937 | [[package]] 938 | name = "phf_shared" 939 | version = "0.11.3" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" 942 | dependencies = [ 943 | "siphasher 1.0.1", 944 | ] 945 | 946 | [[package]] 947 | name = "pin-project-lite" 948 | version = "0.2.16" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 951 | 952 | [[package]] 953 | name = "potential_utf" 954 | version = "0.1.2" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" 957 | dependencies = [ 958 | "zerovec", 959 | ] 960 | 961 | [[package]] 962 | name = "pretty_assertions" 963 | version = "1.4.1" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" 966 | dependencies = [ 967 | "diff", 968 | "yansi", 969 | ] 970 | 971 | [[package]] 972 | name = "proc-macro2" 973 | version = "1.0.95" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" 976 | dependencies = [ 977 | "unicode-ident", 978 | ] 979 | 980 | [[package]] 981 | name = "psm" 982 | version = "0.1.26" 983 | source = "registry+https://github.com/rust-lang/crates.io-index" 984 | checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" 985 | dependencies = [ 986 | "cc", 987 | ] 988 | 989 | [[package]] 990 | name = "ptr_meta" 991 | version = "0.3.0" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" 994 | dependencies = [ 995 | "ptr_meta_derive", 996 | ] 997 | 998 | [[package]] 999 | name = "ptr_meta_derive" 1000 | version = "0.3.0" 1001 | source = "registry+https://github.com/rust-lang/crates.io-index" 1002 | checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" 1003 | dependencies = [ 1004 | "proc-macro2", 1005 | "quote", 1006 | "syn", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "quote" 1011 | version = "1.0.40" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 1014 | dependencies = [ 1015 | "proc-macro2", 1016 | ] 1017 | 1018 | [[package]] 1019 | name = "r-efi" 1020 | version = "5.3.0" 1021 | source = "registry+https://github.com/rust-lang/crates.io-index" 1022 | checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 1023 | 1024 | [[package]] 1025 | name = "radium" 1026 | version = "0.7.0" 1027 | source = "registry+https://github.com/rust-lang/crates.io-index" 1028 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 1029 | 1030 | [[package]] 1031 | name = "rancor" 1032 | version = "0.1.0" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "caf5f7161924b9d1cea0e4cabc97c372cea92b5f927fc13c6bca67157a0ad947" 1035 | dependencies = [ 1036 | "ptr_meta", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "rand" 1041 | version = "0.8.5" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1044 | dependencies = [ 1045 | "rand_core", 1046 | ] 1047 | 1048 | [[package]] 1049 | name = "rand_core" 1050 | version = "0.6.4" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1053 | 1054 | [[package]] 1055 | name = "redox_syscall" 1056 | version = "0.5.16" 1057 | source = "registry+https://github.com/rust-lang/crates.io-index" 1058 | checksum = "7251471db004e509f4e75a62cca9435365b5ec7bcdff530d612ac7c87c44a792" 1059 | dependencies = [ 1060 | "bitflags", 1061 | ] 1062 | 1063 | [[package]] 1064 | name = "regex" 1065 | version = "1.11.1" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 1068 | dependencies = [ 1069 | "aho-corasick", 1070 | "memchr", 1071 | "regex-automata", 1072 | "regex-syntax", 1073 | ] 1074 | 1075 | [[package]] 1076 | name = "regex-automata" 1077 | version = "0.4.9" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" 1080 | dependencies = [ 1081 | "aho-corasick", 1082 | "memchr", 1083 | "regex-syntax", 1084 | ] 1085 | 1086 | [[package]] 1087 | name = "regex-syntax" 1088 | version = "0.8.5" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 1091 | 1092 | [[package]] 1093 | name = "relative-path" 1094 | version = "1.9.3" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" 1097 | 1098 | [[package]] 1099 | name = "rend" 1100 | version = "0.5.2" 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" 1102 | checksum = "a35e8a6bf28cd121053a66aa2e6a2e3eaffad4a60012179f0e864aa5ffeff215" 1103 | dependencies = [ 1104 | "bytecheck", 1105 | ] 1106 | 1107 | [[package]] 1108 | name = "rkyv" 1109 | version = "0.8.10" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65" 1112 | dependencies = [ 1113 | "bytecheck", 1114 | "bytes", 1115 | "hashbrown 0.15.4", 1116 | "indexmap", 1117 | "munge", 1118 | "ptr_meta", 1119 | "rancor", 1120 | "rend", 1121 | "rkyv_derive", 1122 | "tinyvec", 1123 | "uuid", 1124 | ] 1125 | 1126 | [[package]] 1127 | name = "rkyv_derive" 1128 | version = "0.8.10" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a" 1131 | dependencies = [ 1132 | "proc-macro2", 1133 | "quote", 1134 | "syn", 1135 | ] 1136 | 1137 | [[package]] 1138 | name = "rustc-hash" 1139 | version = "2.1.1" 1140 | source = "registry+https://github.com/rust-lang/crates.io-index" 1141 | checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" 1142 | 1143 | [[package]] 1144 | name = "rustix" 1145 | version = "1.0.8" 1146 | source = "registry+https://github.com/rust-lang/crates.io-index" 1147 | checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" 1148 | dependencies = [ 1149 | "bitflags", 1150 | "errno", 1151 | "libc", 1152 | "linux-raw-sys", 1153 | "windows-sys 0.60.2", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "rustversion" 1158 | version = "1.0.21" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" 1161 | 1162 | [[package]] 1163 | name = "ryu" 1164 | version = "1.0.20" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 1167 | 1168 | [[package]] 1169 | name = "ryu-js" 1170 | version = "1.0.2" 1171 | source = "registry+https://github.com/rust-lang/crates.io-index" 1172 | checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" 1173 | 1174 | [[package]] 1175 | name = "scoped-tls" 1176 | version = "1.0.1" 1177 | source = "registry+https://github.com/rust-lang/crates.io-index" 1178 | checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" 1179 | 1180 | [[package]] 1181 | name = "scopeguard" 1182 | version = "1.2.0" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1185 | 1186 | [[package]] 1187 | name = "semver" 1188 | version = "1.0.26" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" 1191 | dependencies = [ 1192 | "serde", 1193 | ] 1194 | 1195 | [[package]] 1196 | name = "seq-macro" 1197 | version = "0.3.6" 1198 | source = "registry+https://github.com/rust-lang/crates.io-index" 1199 | checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" 1200 | 1201 | [[package]] 1202 | name = "serde" 1203 | version = "1.0.228" 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" 1205 | checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 1206 | dependencies = [ 1207 | "serde_core", 1208 | "serde_derive", 1209 | ] 1210 | 1211 | [[package]] 1212 | name = "serde_core" 1213 | version = "1.0.228" 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" 1215 | checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 1216 | dependencies = [ 1217 | "serde_derive", 1218 | ] 1219 | 1220 | [[package]] 1221 | name = "serde_derive" 1222 | version = "1.0.228" 1223 | source = "registry+https://github.com/rust-lang/crates.io-index" 1224 | checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 1225 | dependencies = [ 1226 | "proc-macro2", 1227 | "quote", 1228 | "syn", 1229 | ] 1230 | 1231 | [[package]] 1232 | name = "serde_json" 1233 | version = "1.0.141" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3" 1236 | dependencies = [ 1237 | "itoa", 1238 | "memchr", 1239 | "ryu", 1240 | "serde", 1241 | ] 1242 | 1243 | [[package]] 1244 | name = "sha1" 1245 | version = "0.10.6" 1246 | source = "registry+https://github.com/rust-lang/crates.io-index" 1247 | checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 1248 | dependencies = [ 1249 | "cfg-if", 1250 | "cpufeatures", 1251 | "digest", 1252 | ] 1253 | 1254 | [[package]] 1255 | name = "sha2" 1256 | version = "0.10.9" 1257 | source = "registry+https://github.com/rust-lang/crates.io-index" 1258 | checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" 1259 | dependencies = [ 1260 | "cfg-if", 1261 | "cpufeatures", 1262 | "digest", 1263 | ] 1264 | 1265 | [[package]] 1266 | name = "sharded-slab" 1267 | version = "0.1.7" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 1270 | dependencies = [ 1271 | "lazy_static", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "shlex" 1276 | version = "1.3.0" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1279 | 1280 | [[package]] 1281 | name = "simdutf8" 1282 | version = "0.1.5" 1283 | source = "registry+https://github.com/rust-lang/crates.io-index" 1284 | checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" 1285 | 1286 | [[package]] 1287 | name = "siphasher" 1288 | version = "0.3.11" 1289 | source = "registry+https://github.com/rust-lang/crates.io-index" 1290 | checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" 1291 | 1292 | [[package]] 1293 | name = "siphasher" 1294 | version = "1.0.1" 1295 | source = "registry+https://github.com/rust-lang/crates.io-index" 1296 | checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" 1297 | 1298 | [[package]] 1299 | name = "smallvec" 1300 | version = "1.15.1" 1301 | source = "registry+https://github.com/rust-lang/crates.io-index" 1302 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 1303 | 1304 | [[package]] 1305 | name = "smartstring" 1306 | version = "1.0.1" 1307 | source = "registry+https://github.com/rust-lang/crates.io-index" 1308 | checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" 1309 | dependencies = [ 1310 | "autocfg", 1311 | "static_assertions", 1312 | "version_check", 1313 | ] 1314 | 1315 | [[package]] 1316 | name = "stable_deref_trait" 1317 | version = "1.2.0" 1318 | source = "registry+https://github.com/rust-lang/crates.io-index" 1319 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 1320 | 1321 | [[package]] 1322 | name = "stacker" 1323 | version = "0.1.21" 1324 | source = "registry+https://github.com/rust-lang/crates.io-index" 1325 | checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" 1326 | dependencies = [ 1327 | "cc", 1328 | "cfg-if", 1329 | "libc", 1330 | "psm", 1331 | "windows-sys 0.59.0", 1332 | ] 1333 | 1334 | [[package]] 1335 | name = "static_assertions" 1336 | version = "1.1.0" 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" 1338 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1339 | 1340 | [[package]] 1341 | name = "string_enum" 1342 | version = "1.0.2" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "ae36a4951ca7bd1cfd991c241584a9824a70f6aff1e7d4f693fb3f2465e4030e" 1345 | dependencies = [ 1346 | "quote", 1347 | "swc_macros_common", 1348 | "syn", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "strsim" 1353 | version = "0.11.1" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1356 | 1357 | [[package]] 1358 | name = "swc_allocator" 1359 | version = "4.0.1" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "9d7eefd2c8b228a8c73056482b2ae4b3a1071fbe07638e3b55ceca8570cc48bb" 1362 | dependencies = [ 1363 | "allocator-api2", 1364 | "bumpalo", 1365 | "hashbrown 0.14.5", 1366 | "rustc-hash", 1367 | ] 1368 | 1369 | [[package]] 1370 | name = "swc_atoms" 1371 | version = "9.0.0" 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" 1373 | checksum = "d4ccbe2ecad10ad7432100f878a107b1d972a8aee83ca53184d00c23a078bb8a" 1374 | dependencies = [ 1375 | "bytecheck", 1376 | "cbor4ii", 1377 | "hstr", 1378 | "once_cell", 1379 | "rancor", 1380 | "rkyv", 1381 | "serde", 1382 | ] 1383 | 1384 | [[package]] 1385 | name = "swc_common" 1386 | version = "18.0.1" 1387 | source = "registry+https://github.com/rust-lang/crates.io-index" 1388 | checksum = "a1c06698254e9b47daaf9bbb062af489a350bd8d10dfaab0cabbd32d46cec69d" 1389 | dependencies = [ 1390 | "anyhow", 1391 | "ast_node", 1392 | "better_scoped_tls", 1393 | "bytecheck", 1394 | "bytes-str", 1395 | "cbor4ii", 1396 | "either", 1397 | "from_variant", 1398 | "num-bigint", 1399 | "once_cell", 1400 | "parking_lot", 1401 | "rancor", 1402 | "rkyv", 1403 | "rustc-hash", 1404 | "serde", 1405 | "siphasher 0.3.11", 1406 | "swc_atoms", 1407 | "swc_eq_ignore_macros", 1408 | "swc_sourcemap", 1409 | "swc_visit", 1410 | "termcolor", 1411 | "tracing", 1412 | "unicode-width 0.2.1", 1413 | "url", 1414 | ] 1415 | 1416 | [[package]] 1417 | name = "swc_config" 1418 | version = "3.1.2" 1419 | source = "registry+https://github.com/rust-lang/crates.io-index" 1420 | checksum = "72e90b52ee734ded867104612218101722ad87ff4cf74fe30383bd244a533f97" 1421 | dependencies = [ 1422 | "anyhow", 1423 | "bytes-str", 1424 | "indexmap", 1425 | "serde", 1426 | "serde_json", 1427 | "swc_config_macro", 1428 | ] 1429 | 1430 | [[package]] 1431 | name = "swc_config_macro" 1432 | version = "1.0.1" 1433 | source = "registry+https://github.com/rust-lang/crates.io-index" 1434 | checksum = "7b416e8ce6de17dc5ea496e10c7012b35bbc0e3fef38d2e065eed936490db0b3" 1435 | dependencies = [ 1436 | "proc-macro2", 1437 | "quote", 1438 | "swc_macros_common", 1439 | "syn", 1440 | ] 1441 | 1442 | [[package]] 1443 | name = "swc_core" 1444 | version = "50.0.0" 1445 | source = "registry+https://github.com/rust-lang/crates.io-index" 1446 | checksum = "a54c1aed1e2ff44fa189d3ae6d60412be423c7cb6668a9b3fa97532a37c9bb8f" 1447 | dependencies = [ 1448 | "swc_allocator", 1449 | "swc_atoms", 1450 | "swc_common", 1451 | "swc_ecma_ast", 1452 | "swc_ecma_parser", 1453 | "swc_ecma_quote_macros", 1454 | "swc_ecma_transforms_base", 1455 | "swc_ecma_transforms_react", 1456 | "swc_ecma_transforms_testing", 1457 | "swc_ecma_utils", 1458 | "swc_ecma_visit", 1459 | "swc_plugin", 1460 | "swc_plugin_macro", 1461 | "swc_plugin_proxy", 1462 | "swc_transform_common", 1463 | "vergen", 1464 | ] 1465 | 1466 | [[package]] 1467 | name = "swc_ecma_ast" 1468 | version = "19.0.0" 1469 | source = "registry+https://github.com/rust-lang/crates.io-index" 1470 | checksum = "724195600825cbdd2a899d5473d2ce1f24ae418bff1231f160ecf38a3bc81f46" 1471 | dependencies = [ 1472 | "bitflags", 1473 | "cbor4ii", 1474 | "is-macro", 1475 | "num-bigint", 1476 | "once_cell", 1477 | "phf", 1478 | "rustc-hash", 1479 | "string_enum", 1480 | "swc_atoms", 1481 | "swc_common", 1482 | "swc_visit", 1483 | "unicode-id-start", 1484 | ] 1485 | 1486 | [[package]] 1487 | name = "swc_ecma_codegen" 1488 | version = "21.0.0" 1489 | source = "registry+https://github.com/rust-lang/crates.io-index" 1490 | checksum = "5c77d9d21345ca986ae3b5ff1a4fa3607b15b07ed397506e6dba32e867cf40fd" 1491 | dependencies = [ 1492 | "ascii", 1493 | "compact_str", 1494 | "memchr", 1495 | "num-bigint", 1496 | "once_cell", 1497 | "regex", 1498 | "rustc-hash", 1499 | "ryu-js", 1500 | "serde", 1501 | "swc_allocator", 1502 | "swc_atoms", 1503 | "swc_common", 1504 | "swc_ecma_ast", 1505 | "swc_ecma_codegen_macros", 1506 | "swc_sourcemap", 1507 | "tracing", 1508 | ] 1509 | 1510 | [[package]] 1511 | name = "swc_ecma_codegen_macros" 1512 | version = "2.0.2" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "e276dc62c0a2625a560397827989c82a93fd545fcf6f7faec0935a82cc4ddbb8" 1515 | dependencies = [ 1516 | "proc-macro2", 1517 | "swc_macros_common", 1518 | "syn", 1519 | ] 1520 | 1521 | [[package]] 1522 | name = "swc_ecma_parser" 1523 | version = "29.0.0" 1524 | source = "registry+https://github.com/rust-lang/crates.io-index" 1525 | checksum = "0c2c1a432a5fa26e01db57a272aea12c4682fe882796418d30ca47fdf7b7ceec" 1526 | dependencies = [ 1527 | "bitflags", 1528 | "either", 1529 | "num-bigint", 1530 | "phf", 1531 | "rustc-hash", 1532 | "seq-macro", 1533 | "serde", 1534 | "smartstring", 1535 | "stacker", 1536 | "swc_atoms", 1537 | "swc_common", 1538 | "swc_ecma_ast", 1539 | "tracing", 1540 | ] 1541 | 1542 | [[package]] 1543 | name = "swc_ecma_quote_macros" 1544 | version = "29.0.0" 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" 1546 | checksum = "596dbb78166e8a0984f422fe3f635ef7f3dd94606af4cd4ad5d5cb0473b48025" 1547 | dependencies = [ 1548 | "anyhow", 1549 | "proc-macro2", 1550 | "quote", 1551 | "rustc-hash", 1552 | "swc_atoms", 1553 | "swc_common", 1554 | "swc_ecma_ast", 1555 | "swc_ecma_parser", 1556 | "swc_macros_common", 1557 | "syn", 1558 | ] 1559 | 1560 | [[package]] 1561 | name = "swc_ecma_testing" 1562 | version = "19.0.0" 1563 | source = "registry+https://github.com/rust-lang/crates.io-index" 1564 | checksum = "177244625cdecd268a07534c3b087f7f263604dd40f3ec7c7a984ca95351b632" 1565 | dependencies = [ 1566 | "anyhow", 1567 | "hex", 1568 | "sha2", 1569 | "testing", 1570 | "tracing", 1571 | ] 1572 | 1573 | [[package]] 1574 | name = "swc_ecma_transforms_base" 1575 | version = "32.0.0" 1576 | source = "registry+https://github.com/rust-lang/crates.io-index" 1577 | checksum = "499486ed875ba49af2f36d0d809f61ce6e42943a3aa1d97f592d96f10fe734cc" 1578 | dependencies = [ 1579 | "better_scoped_tls", 1580 | "indexmap", 1581 | "once_cell", 1582 | "par-core", 1583 | "phf", 1584 | "rustc-hash", 1585 | "serde", 1586 | "swc_atoms", 1587 | "swc_common", 1588 | "swc_ecma_ast", 1589 | "swc_ecma_parser", 1590 | "swc_ecma_utils", 1591 | "swc_ecma_visit", 1592 | "tracing", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "swc_ecma_transforms_react" 1597 | version = "35.0.0" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "35d917bf232b72a3fee91b6eb281930264bab6ae1c20b311f5d27f9c918bb8ea" 1600 | dependencies = [ 1601 | "base64", 1602 | "bytes-str", 1603 | "indexmap", 1604 | "once_cell", 1605 | "rustc-hash", 1606 | "serde", 1607 | "sha1", 1608 | "string_enum", 1609 | "swc_atoms", 1610 | "swc_common", 1611 | "swc_config", 1612 | "swc_ecma_ast", 1613 | "swc_ecma_parser", 1614 | "swc_ecma_transforms_base", 1615 | "swc_ecma_utils", 1616 | "swc_ecma_visit", 1617 | ] 1618 | 1619 | [[package]] 1620 | name = "swc_ecma_transforms_testing" 1621 | version = "35.0.0" 1622 | source = "registry+https://github.com/rust-lang/crates.io-index" 1623 | checksum = "29ec7851260522b2864983caa3fc7004ebb080842f49ee49a5461b779277378d" 1624 | dependencies = [ 1625 | "ansi_term", 1626 | "anyhow", 1627 | "base64", 1628 | "hex", 1629 | "serde", 1630 | "serde_json", 1631 | "sha2", 1632 | "swc_common", 1633 | "swc_ecma_ast", 1634 | "swc_ecma_codegen", 1635 | "swc_ecma_parser", 1636 | "swc_ecma_testing", 1637 | "swc_ecma_transforms_base", 1638 | "swc_ecma_utils", 1639 | "swc_ecma_visit", 1640 | "swc_sourcemap", 1641 | "tempfile", 1642 | "testing", 1643 | ] 1644 | 1645 | [[package]] 1646 | name = "swc_ecma_utils" 1647 | version = "25.0.0" 1648 | source = "registry+https://github.com/rust-lang/crates.io-index" 1649 | checksum = "2dd5ee449d21110a271e73d0a9f7640a8854a62cb0e2cb0c9db3445383598e21" 1650 | dependencies = [ 1651 | "indexmap", 1652 | "num_cpus", 1653 | "once_cell", 1654 | "par-core", 1655 | "rustc-hash", 1656 | "ryu-js", 1657 | "swc_atoms", 1658 | "swc_common", 1659 | "swc_ecma_ast", 1660 | "swc_ecma_visit", 1661 | "tracing", 1662 | ] 1663 | 1664 | [[package]] 1665 | name = "swc_ecma_visit" 1666 | version = "19.0.0" 1667 | source = "registry+https://github.com/rust-lang/crates.io-index" 1668 | checksum = "a69d63f7f704a2ec937edef90a3eba1f64602eceb60c8deb260c01131f680e8b" 1669 | dependencies = [ 1670 | "new_debug_unreachable", 1671 | "num-bigint", 1672 | "swc_atoms", 1673 | "swc_common", 1674 | "swc_ecma_ast", 1675 | "swc_visit", 1676 | "tracing", 1677 | ] 1678 | 1679 | [[package]] 1680 | name = "swc_eq_ignore_macros" 1681 | version = "1.0.1" 1682 | source = "registry+https://github.com/rust-lang/crates.io-index" 1683 | checksum = "c16ce73424a6316e95e09065ba6a207eba7765496fed113702278b7711d4b632" 1684 | dependencies = [ 1685 | "proc-macro2", 1686 | "quote", 1687 | "syn", 1688 | ] 1689 | 1690 | [[package]] 1691 | name = "swc_error_reporters" 1692 | version = "20.0.0" 1693 | source = "registry+https://github.com/rust-lang/crates.io-index" 1694 | checksum = "bbbc236f3f44337cbc13f49c7e25e92082e59279c268cbd928c3568f339d3fe0" 1695 | dependencies = [ 1696 | "anyhow", 1697 | "miette", 1698 | "once_cell", 1699 | "serde", 1700 | "swc_common", 1701 | ] 1702 | 1703 | [[package]] 1704 | name = "swc_jotai_debug_label" 1705 | version = "0.0.1" 1706 | dependencies = [ 1707 | "common", 1708 | "swc_core", 1709 | "testing", 1710 | ] 1711 | 1712 | [[package]] 1713 | name = "swc_jotai_react_refresh" 1714 | version = "0.1.0" 1715 | dependencies = [ 1716 | "common", 1717 | "swc_core", 1718 | "testing", 1719 | ] 1720 | 1721 | [[package]] 1722 | name = "swc_macros_common" 1723 | version = "1.0.1" 1724 | source = "registry+https://github.com/rust-lang/crates.io-index" 1725 | checksum = "aae1efbaa74943dc5ad2a2fb16cbd78b77d7e4d63188f3c5b4df2b4dcd2faaae" 1726 | dependencies = [ 1727 | "proc-macro2", 1728 | "quote", 1729 | "syn", 1730 | ] 1731 | 1732 | [[package]] 1733 | name = "swc_plugin" 1734 | version = "1.0.1" 1735 | source = "registry+https://github.com/rust-lang/crates.io-index" 1736 | checksum = "92b27449420554de6ad8d49004ad3d36e6ac64ecb51d1b0fe1002afcd7a45d85" 1737 | dependencies = [ 1738 | "once_cell", 1739 | ] 1740 | 1741 | [[package]] 1742 | name = "swc_plugin_macro" 1743 | version = "1.1.0" 1744 | source = "registry+https://github.com/rust-lang/crates.io-index" 1745 | checksum = "ace467dfafbbdf3aecff786b8605b35db57d945e92fd88800569aa2cba0cdf61" 1746 | dependencies = [ 1747 | "proc-macro2", 1748 | "quote", 1749 | "syn", 1750 | ] 1751 | 1752 | [[package]] 1753 | name = "swc_plugin_proxy" 1754 | version = "19.0.0" 1755 | source = "registry+https://github.com/rust-lang/crates.io-index" 1756 | checksum = "8f976dc63cd8b1916f265ee7d2647c28a85b433640099a5bf07153346dedffda" 1757 | dependencies = [ 1758 | "better_scoped_tls", 1759 | "cbor4ii", 1760 | "rustc-hash", 1761 | "swc_common", 1762 | "swc_ecma_ast", 1763 | "swc_trace_macro", 1764 | "tracing", 1765 | ] 1766 | 1767 | [[package]] 1768 | name = "swc_sourcemap" 1769 | version = "9.3.4" 1770 | source = "registry+https://github.com/rust-lang/crates.io-index" 1771 | checksum = "de08ef00f816acdd1a58ee8a81c0e1a59eefef2093aefe5611f256fa6b64c4d7" 1772 | dependencies = [ 1773 | "base64-simd", 1774 | "bitvec", 1775 | "bytes-str", 1776 | "data-encoding", 1777 | "debugid", 1778 | "if_chain", 1779 | "rustc-hash", 1780 | "serde", 1781 | "serde_json", 1782 | "unicode-id-start", 1783 | "url", 1784 | ] 1785 | 1786 | [[package]] 1787 | name = "swc_trace_macro" 1788 | version = "2.0.2" 1789 | source = "registry+https://github.com/rust-lang/crates.io-index" 1790 | checksum = "dfd2b4b0adb82e36f2ac688d00a6a67132c7f4170c772617516793a701be89e8" 1791 | dependencies = [ 1792 | "quote", 1793 | "syn", 1794 | ] 1795 | 1796 | [[package]] 1797 | name = "swc_transform_common" 1798 | version = "12.0.0" 1799 | source = "registry+https://github.com/rust-lang/crates.io-index" 1800 | checksum = "6cc4a0e2aa9fac44d383127e01327710416dda5b637b0d134b7b8cf2ba6bde8e" 1801 | dependencies = [ 1802 | "better_scoped_tls", 1803 | "rustc-hash", 1804 | "serde", 1805 | "swc_common", 1806 | ] 1807 | 1808 | [[package]] 1809 | name = "swc_visit" 1810 | version = "2.0.1" 1811 | source = "registry+https://github.com/rust-lang/crates.io-index" 1812 | checksum = "62fb71484b486c185e34d2172f0eabe7f4722742aad700f426a494bb2de232a2" 1813 | dependencies = [ 1814 | "either", 1815 | "new_debug_unreachable", 1816 | ] 1817 | 1818 | [[package]] 1819 | name = "syn" 1820 | version = "2.0.104" 1821 | source = "registry+https://github.com/rust-lang/crates.io-index" 1822 | checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" 1823 | dependencies = [ 1824 | "proc-macro2", 1825 | "quote", 1826 | "unicode-ident", 1827 | ] 1828 | 1829 | [[package]] 1830 | name = "synstructure" 1831 | version = "0.13.2" 1832 | source = "registry+https://github.com/rust-lang/crates.io-index" 1833 | checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 1834 | dependencies = [ 1835 | "proc-macro2", 1836 | "quote", 1837 | "syn", 1838 | ] 1839 | 1840 | [[package]] 1841 | name = "tap" 1842 | version = "1.0.1" 1843 | source = "registry+https://github.com/rust-lang/crates.io-index" 1844 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 1845 | 1846 | [[package]] 1847 | name = "tempfile" 1848 | version = "3.20.0" 1849 | source = "registry+https://github.com/rust-lang/crates.io-index" 1850 | checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" 1851 | dependencies = [ 1852 | "fastrand", 1853 | "getrandom", 1854 | "once_cell", 1855 | "rustix", 1856 | "windows-sys 0.59.0", 1857 | ] 1858 | 1859 | [[package]] 1860 | name = "termcolor" 1861 | version = "1.4.1" 1862 | source = "registry+https://github.com/rust-lang/crates.io-index" 1863 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" 1864 | dependencies = [ 1865 | "winapi-util", 1866 | ] 1867 | 1868 | [[package]] 1869 | name = "testing" 1870 | version = "19.0.0" 1871 | source = "registry+https://github.com/rust-lang/crates.io-index" 1872 | checksum = "ad1506c602222ebab5d96100180f8d3c015b2394eceb00a46d20c25b8b1e5100" 1873 | dependencies = [ 1874 | "cargo_metadata 0.18.1", 1875 | "difference", 1876 | "once_cell", 1877 | "pretty_assertions", 1878 | "regex", 1879 | "rustc-hash", 1880 | "serde", 1881 | "serde_json", 1882 | "swc_common", 1883 | "swc_error_reporters", 1884 | "testing_macros", 1885 | "tracing", 1886 | "tracing-subscriber", 1887 | ] 1888 | 1889 | [[package]] 1890 | name = "testing_macros" 1891 | version = "1.0.1" 1892 | source = "registry+https://github.com/rust-lang/crates.io-index" 1893 | checksum = "b7442bd3ca09f38d4788dc5ebafbc1967c3717726b4b074db011d470b353548b" 1894 | dependencies = [ 1895 | "anyhow", 1896 | "glob", 1897 | "once_cell", 1898 | "proc-macro2", 1899 | "quote", 1900 | "regex", 1901 | "relative-path", 1902 | "syn", 1903 | ] 1904 | 1905 | [[package]] 1906 | name = "textwrap" 1907 | version = "0.16.2" 1908 | source = "registry+https://github.com/rust-lang/crates.io-index" 1909 | checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" 1910 | dependencies = [ 1911 | "unicode-linebreak", 1912 | "unicode-width 0.2.1", 1913 | ] 1914 | 1915 | [[package]] 1916 | name = "thiserror" 1917 | version = "1.0.69" 1918 | source = "registry+https://github.com/rust-lang/crates.io-index" 1919 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" 1920 | dependencies = [ 1921 | "thiserror-impl 1.0.69", 1922 | ] 1923 | 1924 | [[package]] 1925 | name = "thiserror" 1926 | version = "2.0.12" 1927 | source = "registry+https://github.com/rust-lang/crates.io-index" 1928 | checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" 1929 | dependencies = [ 1930 | "thiserror-impl 2.0.12", 1931 | ] 1932 | 1933 | [[package]] 1934 | name = "thiserror-impl" 1935 | version = "1.0.69" 1936 | source = "registry+https://github.com/rust-lang/crates.io-index" 1937 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" 1938 | dependencies = [ 1939 | "proc-macro2", 1940 | "quote", 1941 | "syn", 1942 | ] 1943 | 1944 | [[package]] 1945 | name = "thiserror-impl" 1946 | version = "2.0.12" 1947 | source = "registry+https://github.com/rust-lang/crates.io-index" 1948 | checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" 1949 | dependencies = [ 1950 | "proc-macro2", 1951 | "quote", 1952 | "syn", 1953 | ] 1954 | 1955 | [[package]] 1956 | name = "thread_local" 1957 | version = "1.1.9" 1958 | source = "registry+https://github.com/rust-lang/crates.io-index" 1959 | checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" 1960 | dependencies = [ 1961 | "cfg-if", 1962 | ] 1963 | 1964 | [[package]] 1965 | name = "tinystr" 1966 | version = "0.8.1" 1967 | source = "registry+https://github.com/rust-lang/crates.io-index" 1968 | checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" 1969 | dependencies = [ 1970 | "displaydoc", 1971 | "zerovec", 1972 | ] 1973 | 1974 | [[package]] 1975 | name = "tinyvec" 1976 | version = "1.9.0" 1977 | source = "registry+https://github.com/rust-lang/crates.io-index" 1978 | checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" 1979 | dependencies = [ 1980 | "tinyvec_macros", 1981 | ] 1982 | 1983 | [[package]] 1984 | name = "tinyvec_macros" 1985 | version = "0.1.1" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1988 | 1989 | [[package]] 1990 | name = "tracing" 1991 | version = "0.1.41" 1992 | source = "registry+https://github.com/rust-lang/crates.io-index" 1993 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 1994 | dependencies = [ 1995 | "pin-project-lite", 1996 | "tracing-attributes", 1997 | "tracing-core", 1998 | ] 1999 | 2000 | [[package]] 2001 | name = "tracing-attributes" 2002 | version = "0.1.30" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" 2005 | dependencies = [ 2006 | "proc-macro2", 2007 | "quote", 2008 | "syn", 2009 | ] 2010 | 2011 | [[package]] 2012 | name = "tracing-core" 2013 | version = "0.1.34" 2014 | source = "registry+https://github.com/rust-lang/crates.io-index" 2015 | checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" 2016 | dependencies = [ 2017 | "once_cell", 2018 | "valuable", 2019 | ] 2020 | 2021 | [[package]] 2022 | name = "tracing-log" 2023 | version = "0.2.0" 2024 | source = "registry+https://github.com/rust-lang/crates.io-index" 2025 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 2026 | dependencies = [ 2027 | "log", 2028 | "once_cell", 2029 | "tracing-core", 2030 | ] 2031 | 2032 | [[package]] 2033 | name = "tracing-subscriber" 2034 | version = "0.3.20" 2035 | source = "registry+https://github.com/rust-lang/crates.io-index" 2036 | checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" 2037 | dependencies = [ 2038 | "matchers", 2039 | "nu-ansi-term", 2040 | "once_cell", 2041 | "regex-automata", 2042 | "sharded-slab", 2043 | "smallvec", 2044 | "thread_local", 2045 | "tracing", 2046 | "tracing-core", 2047 | "tracing-log", 2048 | ] 2049 | 2050 | [[package]] 2051 | name = "triomphe" 2052 | version = "0.1.14" 2053 | source = "registry+https://github.com/rust-lang/crates.io-index" 2054 | checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" 2055 | dependencies = [ 2056 | "serde", 2057 | "stable_deref_trait", 2058 | ] 2059 | 2060 | [[package]] 2061 | name = "typenum" 2062 | version = "1.18.0" 2063 | source = "registry+https://github.com/rust-lang/crates.io-index" 2064 | checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" 2065 | 2066 | [[package]] 2067 | name = "unicode-id-start" 2068 | version = "1.3.1" 2069 | source = "registry+https://github.com/rust-lang/crates.io-index" 2070 | checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" 2071 | 2072 | [[package]] 2073 | name = "unicode-ident" 2074 | version = "1.0.18" 2075 | source = "registry+https://github.com/rust-lang/crates.io-index" 2076 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 2077 | 2078 | [[package]] 2079 | name = "unicode-linebreak" 2080 | version = "0.1.5" 2081 | source = "registry+https://github.com/rust-lang/crates.io-index" 2082 | checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" 2083 | 2084 | [[package]] 2085 | name = "unicode-width" 2086 | version = "0.1.14" 2087 | source = "registry+https://github.com/rust-lang/crates.io-index" 2088 | checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" 2089 | 2090 | [[package]] 2091 | name = "unicode-width" 2092 | version = "0.2.1" 2093 | source = "registry+https://github.com/rust-lang/crates.io-index" 2094 | checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" 2095 | 2096 | [[package]] 2097 | name = "url" 2098 | version = "2.5.4" 2099 | source = "registry+https://github.com/rust-lang/crates.io-index" 2100 | checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" 2101 | dependencies = [ 2102 | "form_urlencoded", 2103 | "idna", 2104 | "percent-encoding", 2105 | ] 2106 | 2107 | [[package]] 2108 | name = "utf8_iter" 2109 | version = "1.0.4" 2110 | source = "registry+https://github.com/rust-lang/crates.io-index" 2111 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 2112 | 2113 | [[package]] 2114 | name = "uuid" 2115 | version = "1.17.0" 2116 | source = "registry+https://github.com/rust-lang/crates.io-index" 2117 | checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" 2118 | dependencies = [ 2119 | "js-sys", 2120 | "wasm-bindgen", 2121 | ] 2122 | 2123 | [[package]] 2124 | name = "valuable" 2125 | version = "0.1.1" 2126 | source = "registry+https://github.com/rust-lang/crates.io-index" 2127 | checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" 2128 | 2129 | [[package]] 2130 | name = "vergen" 2131 | version = "9.0.6" 2132 | source = "registry+https://github.com/rust-lang/crates.io-index" 2133 | checksum = "6b2bf58be11fc9414104c6d3a2e464163db5ef74b12296bda593cac37b6e4777" 2134 | dependencies = [ 2135 | "anyhow", 2136 | "cargo_metadata 0.19.2", 2137 | "derive_builder", 2138 | "regex", 2139 | "rustversion", 2140 | "vergen-lib", 2141 | ] 2142 | 2143 | [[package]] 2144 | name = "vergen-lib" 2145 | version = "0.1.6" 2146 | source = "registry+https://github.com/rust-lang/crates.io-index" 2147 | checksum = "9b07e6010c0f3e59fcb164e0163834597da68d1f864e2b8ca49f74de01e9c166" 2148 | dependencies = [ 2149 | "anyhow", 2150 | "derive_builder", 2151 | "rustversion", 2152 | ] 2153 | 2154 | [[package]] 2155 | name = "version_check" 2156 | version = "0.9.5" 2157 | source = "registry+https://github.com/rust-lang/crates.io-index" 2158 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 2159 | 2160 | [[package]] 2161 | name = "vsimd" 2162 | version = "0.8.0" 2163 | source = "registry+https://github.com/rust-lang/crates.io-index" 2164 | checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" 2165 | 2166 | [[package]] 2167 | name = "wasi" 2168 | version = "0.14.2+wasi-0.2.4" 2169 | source = "registry+https://github.com/rust-lang/crates.io-index" 2170 | checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 2171 | dependencies = [ 2172 | "wit-bindgen-rt", 2173 | ] 2174 | 2175 | [[package]] 2176 | name = "wasm-bindgen" 2177 | version = "0.2.100" 2178 | source = "registry+https://github.com/rust-lang/crates.io-index" 2179 | checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" 2180 | dependencies = [ 2181 | "cfg-if", 2182 | "once_cell", 2183 | "rustversion", 2184 | "wasm-bindgen-macro", 2185 | ] 2186 | 2187 | [[package]] 2188 | name = "wasm-bindgen-backend" 2189 | version = "0.2.100" 2190 | source = "registry+https://github.com/rust-lang/crates.io-index" 2191 | checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" 2192 | dependencies = [ 2193 | "bumpalo", 2194 | "log", 2195 | "proc-macro2", 2196 | "quote", 2197 | "syn", 2198 | "wasm-bindgen-shared", 2199 | ] 2200 | 2201 | [[package]] 2202 | name = "wasm-bindgen-macro" 2203 | version = "0.2.100" 2204 | source = "registry+https://github.com/rust-lang/crates.io-index" 2205 | checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" 2206 | dependencies = [ 2207 | "quote", 2208 | "wasm-bindgen-macro-support", 2209 | ] 2210 | 2211 | [[package]] 2212 | name = "wasm-bindgen-macro-support" 2213 | version = "0.2.100" 2214 | source = "registry+https://github.com/rust-lang/crates.io-index" 2215 | checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" 2216 | dependencies = [ 2217 | "proc-macro2", 2218 | "quote", 2219 | "syn", 2220 | "wasm-bindgen-backend", 2221 | "wasm-bindgen-shared", 2222 | ] 2223 | 2224 | [[package]] 2225 | name = "wasm-bindgen-shared" 2226 | version = "0.2.100" 2227 | source = "registry+https://github.com/rust-lang/crates.io-index" 2228 | checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" 2229 | dependencies = [ 2230 | "unicode-ident", 2231 | ] 2232 | 2233 | [[package]] 2234 | name = "winapi" 2235 | version = "0.3.9" 2236 | source = "registry+https://github.com/rust-lang/crates.io-index" 2237 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2238 | dependencies = [ 2239 | "winapi-i686-pc-windows-gnu", 2240 | "winapi-x86_64-pc-windows-gnu", 2241 | ] 2242 | 2243 | [[package]] 2244 | name = "winapi-i686-pc-windows-gnu" 2245 | version = "0.4.0" 2246 | source = "registry+https://github.com/rust-lang/crates.io-index" 2247 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2248 | 2249 | [[package]] 2250 | name = "winapi-util" 2251 | version = "0.1.9" 2252 | source = "registry+https://github.com/rust-lang/crates.io-index" 2253 | checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" 2254 | dependencies = [ 2255 | "windows-sys 0.59.0", 2256 | ] 2257 | 2258 | [[package]] 2259 | name = "winapi-x86_64-pc-windows-gnu" 2260 | version = "0.4.0" 2261 | source = "registry+https://github.com/rust-lang/crates.io-index" 2262 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2263 | 2264 | [[package]] 2265 | name = "windows-sys" 2266 | version = "0.59.0" 2267 | source = "registry+https://github.com/rust-lang/crates.io-index" 2268 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 2269 | dependencies = [ 2270 | "windows-targets 0.52.6", 2271 | ] 2272 | 2273 | [[package]] 2274 | name = "windows-sys" 2275 | version = "0.60.2" 2276 | source = "registry+https://github.com/rust-lang/crates.io-index" 2277 | checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" 2278 | dependencies = [ 2279 | "windows-targets 0.53.2", 2280 | ] 2281 | 2282 | [[package]] 2283 | name = "windows-targets" 2284 | version = "0.52.6" 2285 | source = "registry+https://github.com/rust-lang/crates.io-index" 2286 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 2287 | dependencies = [ 2288 | "windows_aarch64_gnullvm 0.52.6", 2289 | "windows_aarch64_msvc 0.52.6", 2290 | "windows_i686_gnu 0.52.6", 2291 | "windows_i686_gnullvm 0.52.6", 2292 | "windows_i686_msvc 0.52.6", 2293 | "windows_x86_64_gnu 0.52.6", 2294 | "windows_x86_64_gnullvm 0.52.6", 2295 | "windows_x86_64_msvc 0.52.6", 2296 | ] 2297 | 2298 | [[package]] 2299 | name = "windows-targets" 2300 | version = "0.53.2" 2301 | source = "registry+https://github.com/rust-lang/crates.io-index" 2302 | checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" 2303 | dependencies = [ 2304 | "windows_aarch64_gnullvm 0.53.0", 2305 | "windows_aarch64_msvc 0.53.0", 2306 | "windows_i686_gnu 0.53.0", 2307 | "windows_i686_gnullvm 0.53.0", 2308 | "windows_i686_msvc 0.53.0", 2309 | "windows_x86_64_gnu 0.53.0", 2310 | "windows_x86_64_gnullvm 0.53.0", 2311 | "windows_x86_64_msvc 0.53.0", 2312 | ] 2313 | 2314 | [[package]] 2315 | name = "windows_aarch64_gnullvm" 2316 | version = "0.52.6" 2317 | source = "registry+https://github.com/rust-lang/crates.io-index" 2318 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 2319 | 2320 | [[package]] 2321 | name = "windows_aarch64_gnullvm" 2322 | version = "0.53.0" 2323 | source = "registry+https://github.com/rust-lang/crates.io-index" 2324 | checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" 2325 | 2326 | [[package]] 2327 | name = "windows_aarch64_msvc" 2328 | version = "0.52.6" 2329 | source = "registry+https://github.com/rust-lang/crates.io-index" 2330 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 2331 | 2332 | [[package]] 2333 | name = "windows_aarch64_msvc" 2334 | version = "0.53.0" 2335 | source = "registry+https://github.com/rust-lang/crates.io-index" 2336 | checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" 2337 | 2338 | [[package]] 2339 | name = "windows_i686_gnu" 2340 | version = "0.52.6" 2341 | source = "registry+https://github.com/rust-lang/crates.io-index" 2342 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 2343 | 2344 | [[package]] 2345 | name = "windows_i686_gnu" 2346 | version = "0.53.0" 2347 | source = "registry+https://github.com/rust-lang/crates.io-index" 2348 | checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" 2349 | 2350 | [[package]] 2351 | name = "windows_i686_gnullvm" 2352 | version = "0.52.6" 2353 | source = "registry+https://github.com/rust-lang/crates.io-index" 2354 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 2355 | 2356 | [[package]] 2357 | name = "windows_i686_gnullvm" 2358 | version = "0.53.0" 2359 | source = "registry+https://github.com/rust-lang/crates.io-index" 2360 | checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" 2361 | 2362 | [[package]] 2363 | name = "windows_i686_msvc" 2364 | version = "0.52.6" 2365 | source = "registry+https://github.com/rust-lang/crates.io-index" 2366 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 2367 | 2368 | [[package]] 2369 | name = "windows_i686_msvc" 2370 | version = "0.53.0" 2371 | source = "registry+https://github.com/rust-lang/crates.io-index" 2372 | checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" 2373 | 2374 | [[package]] 2375 | name = "windows_x86_64_gnu" 2376 | version = "0.52.6" 2377 | source = "registry+https://github.com/rust-lang/crates.io-index" 2378 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 2379 | 2380 | [[package]] 2381 | name = "windows_x86_64_gnu" 2382 | version = "0.53.0" 2383 | source = "registry+https://github.com/rust-lang/crates.io-index" 2384 | checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" 2385 | 2386 | [[package]] 2387 | name = "windows_x86_64_gnullvm" 2388 | version = "0.52.6" 2389 | source = "registry+https://github.com/rust-lang/crates.io-index" 2390 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 2391 | 2392 | [[package]] 2393 | name = "windows_x86_64_gnullvm" 2394 | version = "0.53.0" 2395 | source = "registry+https://github.com/rust-lang/crates.io-index" 2396 | checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" 2397 | 2398 | [[package]] 2399 | name = "windows_x86_64_msvc" 2400 | version = "0.52.6" 2401 | source = "registry+https://github.com/rust-lang/crates.io-index" 2402 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 2403 | 2404 | [[package]] 2405 | name = "windows_x86_64_msvc" 2406 | version = "0.53.0" 2407 | source = "registry+https://github.com/rust-lang/crates.io-index" 2408 | checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" 2409 | 2410 | [[package]] 2411 | name = "wit-bindgen-rt" 2412 | version = "0.39.0" 2413 | source = "registry+https://github.com/rust-lang/crates.io-index" 2414 | checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 2415 | dependencies = [ 2416 | "bitflags", 2417 | ] 2418 | 2419 | [[package]] 2420 | name = "writeable" 2421 | version = "0.6.1" 2422 | source = "registry+https://github.com/rust-lang/crates.io-index" 2423 | checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" 2424 | 2425 | [[package]] 2426 | name = "wyz" 2427 | version = "0.5.1" 2428 | source = "registry+https://github.com/rust-lang/crates.io-index" 2429 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 2430 | dependencies = [ 2431 | "tap", 2432 | ] 2433 | 2434 | [[package]] 2435 | name = "yansi" 2436 | version = "1.0.1" 2437 | source = "registry+https://github.com/rust-lang/crates.io-index" 2438 | checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" 2439 | 2440 | [[package]] 2441 | name = "yoke" 2442 | version = "0.8.0" 2443 | source = "registry+https://github.com/rust-lang/crates.io-index" 2444 | checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" 2445 | dependencies = [ 2446 | "serde", 2447 | "stable_deref_trait", 2448 | "yoke-derive", 2449 | "zerofrom", 2450 | ] 2451 | 2452 | [[package]] 2453 | name = "yoke-derive" 2454 | version = "0.8.0" 2455 | source = "registry+https://github.com/rust-lang/crates.io-index" 2456 | checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" 2457 | dependencies = [ 2458 | "proc-macro2", 2459 | "quote", 2460 | "syn", 2461 | "synstructure", 2462 | ] 2463 | 2464 | [[package]] 2465 | name = "zerocopy" 2466 | version = "0.8.26" 2467 | source = "registry+https://github.com/rust-lang/crates.io-index" 2468 | checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" 2469 | dependencies = [ 2470 | "zerocopy-derive", 2471 | ] 2472 | 2473 | [[package]] 2474 | name = "zerocopy-derive" 2475 | version = "0.8.26" 2476 | source = "registry+https://github.com/rust-lang/crates.io-index" 2477 | checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" 2478 | dependencies = [ 2479 | "proc-macro2", 2480 | "quote", 2481 | "syn", 2482 | ] 2483 | 2484 | [[package]] 2485 | name = "zerofrom" 2486 | version = "0.1.6" 2487 | source = "registry+https://github.com/rust-lang/crates.io-index" 2488 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 2489 | dependencies = [ 2490 | "zerofrom-derive", 2491 | ] 2492 | 2493 | [[package]] 2494 | name = "zerofrom-derive" 2495 | version = "0.1.6" 2496 | source = "registry+https://github.com/rust-lang/crates.io-index" 2497 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 2498 | dependencies = [ 2499 | "proc-macro2", 2500 | "quote", 2501 | "syn", 2502 | "synstructure", 2503 | ] 2504 | 2505 | [[package]] 2506 | name = "zerotrie" 2507 | version = "0.2.2" 2508 | source = "registry+https://github.com/rust-lang/crates.io-index" 2509 | checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" 2510 | dependencies = [ 2511 | "displaydoc", 2512 | "yoke", 2513 | "zerofrom", 2514 | ] 2515 | 2516 | [[package]] 2517 | name = "zerovec" 2518 | version = "0.11.2" 2519 | source = "registry+https://github.com/rust-lang/crates.io-index" 2520 | checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" 2521 | dependencies = [ 2522 | "yoke", 2523 | "zerofrom", 2524 | "zerovec-derive", 2525 | ] 2526 | 2527 | [[package]] 2528 | name = "zerovec-derive" 2529 | version = "0.11.1" 2530 | source = "registry+https://github.com/rust-lang/crates.io-index" 2531 | checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" 2532 | dependencies = [ 2533 | "proc-macro2", 2534 | "quote", 2535 | "syn", 2536 | ] 2537 | --------------------------------------------------------------------------------