diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88b98ac..2b51361 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,21 +12,19 @@ jobs: fail-fast: false matrix: include: - - image: ubuntu-latest + - image: blacksmith-4vcpu-ubuntu-2404 target: x64 - - image: ubuntu-24.04-arm + - image: blacksmith-4vcpu-ubuntu-2404-arm target: arm64 - - image: macos-latest + - image: blacksmith-6vcpu-macos-latest target: arm64 - - image: windows-latest + - image: blacksmith-4vcpu-windows-2025 target: x64 - - image: windows-11-arm - target: arm64 runs-on: ${{ matrix.image }} steps: - uses: Pistonight/mono-dev/actions/setup@main with: - submodules: true + mono-dev: false rust: stable rust-native: ${{ matrix.target }} - uses: Pistonight/mono-dev/actions/rust-xplat@main diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a15f948..c3bcb1d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,16 +11,15 @@ jobs: steps: - uses: Pistonight/mono-dev/actions/setup@main with: - runner: blacksmith - submodules: true + mono-dev: false ecma-pnpm: true - ecma-bun: true rust: stable rust-wasm: true tool-cargo-binstall: workex=Pistonite/workex - - run: task install-ci + - run: pnpm install + - run: task post-install - run: task build - - uses: actions/upload-pages-artifact@v3 + - uses: actions/upload-pages-artifact@v5 with: path: packages/app/dist retention-days: 3 @@ -38,4 +37,4 @@ jobs: runs-on: ubuntu-latest steps: - id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5453b64..138ea20 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -5,44 +5,18 @@ on: - main jobs: - check: + check-pr: runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - uses: Pistonight/mono-dev/actions/setup@main with: - runner: blacksmith - submodules: true + mono-dev: false ecma-pnpm: true - ecma-bun: true rust: stable rust-wasm: true tool-cargo-binstall: workex=Pistonite/workex - - run: task install-ci + - run: pnpm install + - run: task post-install - run: task check - test: - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - uses: Pistonight/mono-dev/actions/setup@main - with: - runner: blacksmith - submodules: true - ecma-pnpm: true - ecma-bun: true - rust: stable - tool-cargo-binstall: workex=Pistonite/workex - - run: task install-ci - run: task test - build-app: - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - uses: Pistonight/mono-dev/actions/setup@main - with: - runner: blacksmith - submodules: true - ecma-pnpm: true - ecma-bun: true - rust: stable - rust-wasm: true - tool-cargo-binstall: workex=Pistonite/workex - - run: task install-ci - run: task build-dev diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 02b48d1..0000000 --- a/.gitmodules +++ /dev/null @@ -1,12 +0,0 @@ -[submodule "mono-dev"] - path = packages/mono-dev - url = https://github.com/Pistonight/mono-dev - branch = main -[submodule "intwc"] - path = packages/intwc - url = https://github.com/Pistonight/intwc - branch = main -[submodule "shared-controls"] - path = packages/shared-controls - url = https://github.com/Pistonight/shared-controls - branch = main diff --git a/Cargo.lock b/Cargo.lock index e389cb9..86e36e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.21" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -88,9 +88,9 @@ checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] @@ -230,9 +230,9 @@ dependencies = [ [[package]] name = "boa_ast" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc119a5ad34c3f459062a96907f53358989b173d104258891bb74f95d93747e8" +checksum = "6339a700715bda376f5ea65c76e8fe8fc880930d8b0638cea68e7f3da6538e0a" dependencies = [ "bitflags", "boa_interner", @@ -245,9 +245,9 @@ dependencies = [ [[package]] name = "boa_engine" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e637ec52ea66d76b0ca86180c259d6c7bb6e6a6e14b2f36b85099306d8b00cc3" +checksum = "1521be326f8a5c8887e95d4ce7f002917a002a23f7b93b9a6a2bf50ed4157824" dependencies = [ "aligned-vec", "arrayvec", @@ -261,7 +261,7 @@ dependencies = [ "bytemuck", "cfg-if", "cow-utils", - "dashmap 6.1.0", + "dashmap", "dynify", "fast-float2", "float16", @@ -309,9 +309,9 @@ dependencies = [ [[package]] name = "boa_interner" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9626505d33dc63d349662437297df1d3afd9d5fc4a2b3ad34e5e1ce879a78848" +checksum = "20510b8b02bcde9b0a01cf34c0c308c56156503d1d91cdab4c8cfbd292b747ea" dependencies = [ "boa_gc", "boa_macros", @@ -325,9 +325,9 @@ dependencies = [ [[package]] name = "boa_macros" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f36418a46544b152632c141b0a0b7a453cd69ca150caeef83aee9e2f4b48b7d" +checksum = "5822cb4f146d243060e588bc5a5f2e709683fdad3d7111f42c48e6b5c921d23d" dependencies = [ "cfg-if", "cow-utils", @@ -339,9 +339,9 @@ dependencies = [ [[package]] name = "boa_parser" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f99bf5b684f0de946378fcfe5f38c3a0fbd51cbf83a0f39ff773a0e218541f" +checksum = "35bd957fa9fa93e3a001a8aba5a5cd40c2bbfde486378be4c4b472fd304aaddb" dependencies = [ "bitflags", "boa_ast", @@ -357,9 +357,9 @@ dependencies = [ [[package]] name = "boa_string" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ce9d7aa5563a2e14eab111e2ae1a06a69a812f6c0c3d843196c9d03fbef440" +checksum = "ca2da1d7f4a76fd9040788a122f0d807910800a7b86f5952e9244848c36511de" dependencies = [ "fast-float2", "itoa", @@ -501,9 +501,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.60" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", "clap_derive", @@ -511,9 +511,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.60" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream", "anstyle", @@ -523,9 +523,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.55" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" dependencies = [ "heck", "proc-macro2", @@ -630,9 +630,9 @@ dependencies = [ [[package]] name = "csscolorparser" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a878cfd6075649977f548ed439564cfdbe1f190a6656a00b48af7740f2f148" +checksum = "199f851bd3cb5004c09474252c7f74e7c047441ed0979bf3688a7106a13da952" dependencies = [ "num-traits", "phf 0.13.1", @@ -642,28 +642,15 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.5.1" +version = "3.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73736a89c4aff73035ba2ed2e565061954da00d4970fc9ac25dcc85a2a20d790" +checksum = "e0b1fab2ae45819af2d0731d60f2afe17227ebb1a1538a236da84c93e9a60162" dependencies = [ "dispatch2", "nix", "windows-sys 0.61.2", ] -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core", -] - [[package]] name = "dashmap" version = "6.1.0" @@ -805,20 +792,14 @@ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "env_filter" -version = "0.1.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" dependencies = [ "log", "regex", ] -[[package]] -name = "env_home" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" - [[package]] name = "equator" version = "0.4.2" @@ -852,7 +833,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1041,6 +1022,24 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1128,9 +1127,9 @@ checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hstr" -version = "3.0.4" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa57007c3c9dab34df2fa4c1fb52fe9c34ec5a27ed9d8edea53254b50cd7887" +checksum = "c1b94e40256e78ddd4e30490aa931bec17e65e9413a6ad11f64ec67815da9323" dependencies = [ "hashbrown 0.14.5", "new_debug_unreachable", @@ -1361,10 +1360,12 @@ checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] @@ -1397,9 +1398,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.182" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libm" @@ -1526,9 +1527,9 @@ checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nix" -version = "0.30.1" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ "bitflags", "cfg-if", @@ -1661,9 +1662,9 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "oneshot" -version = "0.1.13" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269bca4c2591a28585d6bf10d9ed0332b7d76900a1b02bec41bdc3a2cdcda107" +checksum = "cfe21416a02c693fb9f980befcb230ecc70b0b3d1cc4abf88b9675c4c1457f0c" [[package]] name = "outref" @@ -1731,12 +1732,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "path-clean" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" - [[package]] name = "path-clean" version = "1.0.1" @@ -1886,9 +1881,9 @@ checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pistonite-cu" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b18427d8fab2be730e99547fc7d8561b88dcfdbc44ad0c12b133cf54c09511" +checksum = "1333590fd1f0a9dddde3f234f523e6e8d16d47b26ebc35567db0472caea9f6fd" dependencies = [ "anyhow", "clap", @@ -1915,18 +1910,18 @@ dependencies = [ [[package]] name = "pistonite-cu-proc-macros" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e718dd81a0ec3dd511004e565b521c63a26204d7bfce9100007bbd3e7a11cebf" +checksum = "ed27c751a41bf48c5c1eb34a6ece4fb92dfa8adca8c14a78964a94ad3cee4123" dependencies = [ "pistonite-pm", ] [[package]] name = "pistonite-pm" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb759ff95dafff75b9b43ed487a6eff22630bbf8d2d4b220ba97f307dfea2c65" +checksum = "89a883403461bbd5ad506f710a7ee13fc531e7532a1b41116fd5dde5c294b059" dependencies = [ "proc-macro2", "quote", @@ -1984,13 +1979,13 @@ checksum = "84350ffee5cedfabf9bee3e8825721f651da8ff79d50fe7a37cf0ca015c428ee" [[package]] name = "preset_env_base" -version = "7.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d4639c317ff6c06bfbca5d56a763dbd599766acf7d8f1e350eab15caf219b20" +checksum = "082198922376223e37e74c5015259c6702ec2930e7ac5f244d2b1df131d0e8e4" dependencies = [ "anyhow", "browserslist-rs", - "dashmap 5.5.3", + "dashmap", "from_variant", "once_cell", "rustc-hash", @@ -2002,7 +1997,7 @@ dependencies = [ [[package]] name = "prism-cli" -version = "0.1.1" +version = "0.1.2" dependencies = [ "pistonite-cu", "prism-lib", @@ -2085,9 +2080,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -2286,7 +2281,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -2477,6 +2472,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "slotmap" version = "1.0.7" @@ -2596,14 +2597,14 @@ dependencies = [ [[package]] name = "swc" -version = "56.0.0" +version = "64.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ceeae046d148c779be1bb207909600adbda56ca33cb6e47587c460bd45b1a9" +checksum = "b84c09355c735beb8534d629b06468dd7f536e5f3920aeebeae7920c5c442202" dependencies = [ "anyhow", "base64", "bytes-str", - "dashmap 5.5.3", + "dashmap", "either", "indexmap", "jsonc-parser", @@ -2659,9 +2660,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "9.0.0" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ccbe2ecad10ad7432100f878a107b1d972a8aee83ca53184d00c23a078bb8a" +checksum = "ecbd7177c71140b23dc6b1b9c1a9f16f96d0337cb999f5a79bb49ca4d82eded0" dependencies = [ "hstr", "once_cell", @@ -2670,9 +2671,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "19.0.0" +version = "21.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "623a4ee8bb19d87de6fc781e44e1696af20136d1c1eabf9f3712ff1fb50b6189" +checksum = "da38f2cee8e659bf0ec7f51ec5b37ec58c9127de755d3fe0b2c2353ec9474b09" dependencies = [ "anyhow", "ast_node", @@ -2697,9 +2698,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "49.0.0" +version = "56.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9840f1fb3e2c98f55a4b4f7485d062b374d929d94c02dfb5002b9325768678a9" +checksum = "f6537a4d89b8689d8e085e3b0f58f8032da63e2dd0fd9415470a4a4eeb2f5145" dependencies = [ "anyhow", "base64", @@ -2723,13 +2724,13 @@ dependencies = [ [[package]] name = "swc_config" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9cc428c17cfb0fc7d31177b413d9c131a99a9c2d08ff30260261c4c3058449" +checksum = "6ee60aaa4eaea81fb9c730e64a0b88c363b5c237b774d114c97cba82f8655fdb" dependencies = [ "anyhow", "bytes-str", - "dashmap 5.5.3", + "dashmap", "globset", "indexmap", "once_cell", @@ -2756,9 +2757,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "21.0.0" +version = "23.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27111582629a1cc116f9cffa6bfa501e6c849e0e66fafdf78cd404dce919117d" +checksum = "550ee54eab536fe357090fec6d42d083c28cf44cc9bcfa93b1ea5e1606f3b2f7" dependencies = [ "bitflags", "is-macro", @@ -2776,9 +2777,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "24.0.0" +version = "26.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b8dbdc2be434883934cda8c3f6638130390032c44e1952e543252fcafd67e0" +checksum = "fafbcdd29cc03b0c04860bb0143e781e13a4e2dac03eb8747df520f602e0aa94" dependencies = [ "ascii", "compact_str", @@ -2810,9 +2811,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "43.0.0" +version = "48.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc75856ed940f4d7dd6c930479fcdc82f3826f3cf766cc0e6d562f6d862065b" +checksum = "18c83464946e2263439b6826e673075114a621418085933d0975059f98405d2d" dependencies = [ "rustc-hash", "swc_atoms", @@ -2828,9 +2829,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "34.0.0" +version = "38.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d968f907f4e9bff56d6f4a29b8b2e41ad857276c28ab198be6e4cc28d91753" +checksum = "b8119b1753c18a4fe7a8947bf0afe4e6666c9e2facd7e73134b976643d4b9738" dependencies = [ "swc_common", "swc_ecma_ast", @@ -2840,9 +2841,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "43.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb06fa8eee27d26df6e6a60c1ca4c59275af7efea6d3f088137e212952369fa3" +checksum = "207d9015a9a9c036735eaa18810a99c1372c4e877d76f28ce5a4b640b0847918" dependencies = [ "arrayvec", "indexmap", @@ -2868,9 +2869,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "39.0.0" +version = "43.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35a473127d4730dc01db478fc80021140f513bd94eb31c4d44e1fb6c0dbab9ea" +checksum = "c63e2fda7259b25b6bab5ee86b5aa78955c92c7874ad0721a308e48aebfbabf0" dependencies = [ "swc_ecma_ast", "swc_ecma_transformer", @@ -2881,9 +2882,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "39.0.0" +version = "43.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1008be88e6750ff1a868aa14e58a9866336b1372dc515e85aacf409af0e3127" +checksum = "8a358aa832bb4137a8eddd952f6d670c304514a0a558706bd489a12bdc48cdcb" dependencies = [ "serde", "swc_common", @@ -2896,9 +2897,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "40.0.0" +version = "44.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8ba224f97507565fb08be97d1bcab911eeafe2726f78e473305aa27c9a60e0" +checksum = "c556df42cc18645a1b3b85305f9870788dd3dffcbbce11d5195dfa8e38e3fb40" dependencies = [ "serde", "swc_ecma_ast", @@ -2910,9 +2911,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "39.0.0" +version = "43.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "482d527b58a8789b23477e7d838f514c9219539da1d231d60f38335d2299ffdf" +checksum = "1cc56b01664bed45eefc0316847d7e439f05587dcb7285fcfc3c62e89e90c288" dependencies = [ "swc_common", "swc_ecma_ast", @@ -2924,9 +2925,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "41.0.0" +version = "45.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d44c002ae40c600054f791978073981943406f5058a17c027239ff3ba58bcccd" +checksum = "2f57606cbd07a019079ec9b9cfeb32a5141c97a71441fc97c2cada52500e030e" dependencies = [ "serde", "swc_common", @@ -2941,9 +2942,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "39.0.0" +version = "43.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47fac38a09c94c63222fd90bfe7b526afe6f74bd5e3521e9929c9faa3dd365c3" +checksum = "d7dca6ddcfe2cabd285163b70b4b04b16232ca08cba448390b492512190f24f3" dependencies = [ "swc_ecma_ast", "swc_ecma_transformer", @@ -2954,9 +2955,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "41.0.0" +version = "45.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "105286915785d3cf0f1024092cfe9112ee377bfca1e2c6f4a2a76761b6d32416" +checksum = "7e4d44d6c7317a8e1189785e8aa5c82ab3b491722db46c82a9b82bc70f892b27" dependencies = [ "rustc-hash", "swc_atoms", @@ -2974,9 +2975,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_regexp" -version = "2.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4840cc8ba3f03756c2b3f5f73c53964f77b6ba7b8164ce53772b56016e0331" +checksum = "bf01bca3c32928c9cbc436f05efce56b5007ace2b3ac870eb710211b0fffa570" dependencies = [ "icu_properties", "swc_ecma_regexp_ast", @@ -2985,9 +2986,9 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "27.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "044961e27feff62f927950355f1a66c0599653727c106b929456cc635b858d86" +checksum = "b81ca56fdd7170e23194ab05e6be528de490432eeadfa4b9a287be231017d46b" dependencies = [ "phf 0.11.3", "swc_common", @@ -2998,9 +2999,9 @@ dependencies = [ [[package]] name = "swc_ecma_hooks" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15c2c9ef00252fed90e19e709e77fe6160922bb6838e6906a364bceaee0d744" +checksum = "ee7662517362f6726b0e107a3caec2b4cc7d629f9bf702958948e9350722e52f" dependencies = [ "swc_atoms", "swc_common", @@ -3010,12 +3011,12 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "28.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b4dafded16a43a165dbbb7e423222326155129b8bf439e5d2c9c6ec3737750" +checksum = "dc0436ef87267e38b021e17951d422627c6cbcd99d610733cf0c96474a1d2fc8" dependencies = [ "auto_impl", - "dashmap 5.5.3", + "dashmap", "par-core", "parking_lot", "regex", @@ -3031,17 +3032,17 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "19.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b798cee30450c4ea55f17cd6968e69097411bc3c5ec3ca3430e1d0ebfaf629" +checksum = "562c983a163ca2a016626d03f037390a9c1de8f004605ecf44f4fa92a292ae42" dependencies = [ "anyhow", - "dashmap 5.5.3", + "dashmap", "lru", "normpath", "once_cell", "parking_lot", - "path-clean 0.1.0", + "path-clean", "pathdiff", "rustc-hash", "serde", @@ -3053,9 +3054,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "46.0.0" +version = "53.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3975f1c2347ec502c975e4df17dff27f5ba70281e02a314448055ad689979e2a" +checksum = "76c9d429baf26f3e5efb0f98fd5f16425ae14becc2f82cd78e39512f1fd68a5e" dependencies = [ "arrayvec", "bitflags", @@ -3081,7 +3082,6 @@ dependencies = [ "swc_ecma_parser", "swc_ecma_transforms_base", "swc_ecma_transforms_optimization", - "swc_ecma_usage_analyzer", "swc_ecma_utils", "swc_ecma_visit", "swc_timer", @@ -3090,9 +3090,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "35.0.0" +version = "39.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943b8743c57783b35b6c173b0a8ef539a6c1d06ee5d1588b2821992c3fd35f39" +checksum = "76e6934ad1cf59a947528f034943be40d06fb3332def0d71db29ba6ad8181283" dependencies = [ "bitflags", "either", @@ -3111,9 +3111,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "49.0.0" +version = "54.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ac43696834e7125772e94f514bf1dea183c97bac510376d27088f7edce63d8" +checksum = "c4a2b1cfbb23db2bcd002b86aa28c4e7bd2645ea778d8a4a4d410c9196e1cd1f" dependencies = [ "anyhow", "foldhash 0.1.5", @@ -3136,9 +3136,9 @@ dependencies = [ [[package]] name = "swc_ecma_regexp" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729ebdefd7efa85c90c4a1b273d9bff533c63c24caa494ee884996aa0230005f" +checksum = "4afafa422a0c86bde3e7cc3d3d1073f13ea05047c5c08bcc15df6f9b470de1eb" dependencies = [ "phf 0.11.3", "rustc-hash", @@ -3152,9 +3152,9 @@ dependencies = [ [[package]] name = "swc_ecma_regexp_ast" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35f7e4a026dbd065141006fc36556848c9892337f8213dd607198cd9c50da67" +checksum = "5e01fc6155c5fcdce85f253c96fe764877ebaa1dc50ab0639b383dafb46a6427" dependencies = [ "bitflags", "is-macro", @@ -3171,9 +3171,9 @@ checksum = "0a0a09a9e4dc09c97f07273695bd4b58e46b99dbb0cb788ce0dad2a181eb1e94" [[package]] name = "swc_ecma_regexp_visit" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae310f36e2f8b09e352d2165102d0c9502080407845523c97ba54827d278089" +checksum = "73317054bba9a6fed553ce2c830702b8602fc5f5c08d9328bd3ab9d8489ce827" dependencies = [ "serde", "swc_atoms", @@ -3184,9 +3184,9 @@ dependencies = [ [[package]] name = "swc_ecma_transformer" -version = "10.0.0" +version = "14.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cda2816c9b381606dec412433804f36a01985b226b46f59bea4ca2de4c9191" +checksum = "54f5623374970e628160f83784af5e4f3e1fd75f79393f270df421439a3920b3" dependencies = [ "rustc-hash", "swc_atoms", @@ -3203,9 +3203,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "48.0.0" +version = "53.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e3b8482a2ccf4f9b031aef2408c57d98d816b44cdab5852a636663851c2ae80" +checksum = "2a0269f4ccf7a83a1a3bef7bde5257143e6794d2523db1fa6c5b03a6ab9fb430" dependencies = [ "par-core", "swc_common", @@ -3222,9 +3222,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "38.0.0" +version = "42.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a6bfa9bb82de047afae2eadef24e7ac4e4578fe11c977d8f61423131bdef9e4" +checksum = "1f0c8ee943a8f9099391cecef5b3eafc98aba64dfa5f6f7cd336a32989d92d1a" dependencies = [ "better_scoped_tls", "indexmap", @@ -3244,9 +3244,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "38.0.0" +version = "42.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f1701026c80526a50c822e212196650a49cc8dfb4e8fa190ce274a066639d3" +checksum = "136e114c3d98aafbdbe6800ff40299a9661fd8bd3902fffb248fd9fe8194e3fd" dependencies = [ "swc_common", "swc_ecma_ast", @@ -3257,9 +3257,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "44.0.0" +version = "49.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa3a557bf293ea6e19c780bb147f380f5f97f7f0955a49db85a8e1abcc5d08b9" +checksum = "9739057661ec031d05deb8588b5b90025212bf080e060cb82ed4c7095618dc2d" dependencies = [ "indexmap", "par-core", @@ -3297,16 +3297,16 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "42.0.1" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f72dc1e23c723c34248d0cf7f0aa8e9ba968cf28d4272c08a84310c2ceb7ce" +checksum = "50f4bed3e69e05890ea326df97035412071a37da59d6fc0a6488c3cf200c6f08" dependencies = [ "Inflector", "anyhow", "bitflags", "indexmap", "is-macro", - "path-clean 1.0.1", + "path-clean", "pathdiff", "regex", "rustc-hash", @@ -3325,12 +3325,12 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "40.0.0" +version = "45.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f43dc268f8164b5363c44a0fe9408808155f1506684e25f32685f77fe9df4b6" +checksum = "b462cdbe5561316a2b15898fa2d8536c363d337285f78fc31a2f2a39b62ce99d" dependencies = [ "bytes-str", - "dashmap 5.5.3", + "dashmap", "indexmap", "once_cell", "par-core", @@ -3349,9 +3349,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "38.0.0" +version = "42.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f57be5a8374390872b4311d04f924da5ee832315198db777289aa1decd5a44" +checksum = "369f6af2a00c85232aaa60c085ff5d63c34e48996723e6bceabba33dabb71228" dependencies = [ "either", "rustc-hash", @@ -3367,9 +3367,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "42.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e3d8ec79bf7d04c8fe05b31b667d4de3dd60fa0f489ab25efe8cb4bbbfe3f1" +checksum = "8989e4d64e0d219f1c471c4ecd2190bab717a15ad48c4ce3ba603f6501fc551d" dependencies = [ "base64", "bytes-str", @@ -3392,9 +3392,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "42.0.0" +version = "47.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a87d3eb0b68efa61c5d467d38d1e6f4879a6f1b84526603b8e8b964458ffebb" +checksum = "ae0e18e9b19ff547a187b5fd5706a85fcd23ad472b9056202918ac0126a3aa06" dependencies = [ "bytes-str", "rustc-hash", @@ -3408,29 +3408,11 @@ dependencies = [ "swc_ecma_visit", ] -[[package]] -name = "swc_ecma_usage_analyzer" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26a2082f0ab640cb8fa48c7b5708000c188178a891c9cb970ad714e40350825" -dependencies = [ - "bitflags", - "indexmap", - "rustc-hash", - "swc_atoms", - "swc_common", - "swc_ecma_ast", - "swc_ecma_utils", - "swc_ecma_visit", - "swc_timer", - "tracing", -] - [[package]] name = "swc_ecma_utils" -version = "27.0.0" +version = "29.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c91e3ed13767ac74670e9cc9895d8c3502a9086fe69fe8a23295da08e6f7e02" +checksum = "3d69b480aa02b5ff2ab951478d8e7633eeda42940aeb5fe0386eebc19dd3b1e4" dependencies = [ "dragonbox_ecma", "indexmap", @@ -3447,9 +3429,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "21.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c1b3a04c999c14f09d81c959f8a84f71d594f2ad2456470eb38d78532e82dda" +checksum = "ad65d392ed427dc9e94f16a3d802b02e27722c21227639c8d5f45f19757b447b" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -3473,9 +3455,9 @@ dependencies = [ [[package]] name = "swc_error_reporters" -version = "21.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bce8f4474b6f874cc49d745b41d610342a3ea0e1dc57dbc4bf223162b196e7a" +checksum = "a901e41bea44b4ec8237b1cde1d2e7ae0a3b5c87c6d1100103de45caf440f972" dependencies = [ "anyhow", "miette", @@ -3497,11 +3479,11 @@ dependencies = [ [[package]] name = "swc_node_comments" -version = "19.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cec41c72e5a6a5c5591b7ea4358b1ac64d6d6fac8209ff9e083bce53db6d7b0a" +checksum = "2fa52abc79bfc58486c79581c869dbadaa99fa2fc1f6b3ab9ca30c0af9aa09a3" dependencies = [ - "dashmap 5.5.3", + "dashmap", "rustc-hash", "swc_atoms", "swc_common", @@ -3547,9 +3529,9 @@ dependencies = [ [[package]] name = "swc_transform_common" -version = "13.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1874cae422d398137e9b7cb39ceb2d91068342ca152ab3137709dbc175cc965f" +checksum = "fbf6619f4691d3934610de7d0acf4807634161f395bf44d695810ebae9e405d2" dependencies = [ "better_scoped_tls", "rustc-hash", @@ -3559,9 +3541,9 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "26.0.0" +version = "28.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9de0870cc3714a8cde78372d132da6ecffaa03d085a621f9abee1ebf4eff1c" +checksum = "a86cf04561e92a19f5f37b7fcfdb442e749b9e360bc2796f731599967dfcb8cd" dependencies = [ "bitflags", "petgraph", @@ -3585,9 +3567,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.116" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df424c70518695237746f84cede799c9c58fcb37450d7b23716568cc8bc69cb" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -3619,12 +3601,12 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "terminal_size" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3691,7 +3673,6 @@ checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "itoa", - "js-sys", "libc", "num-conv", "num_threads", @@ -3771,9 +3752,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.49.0" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ "pin-project-lite", "tokio-macros", @@ -3781,9 +3762,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", @@ -4078,9 +4059,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" dependencies = [ "cfg-if", "once_cell", @@ -4091,9 +4072,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4101,9 +4082,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" dependencies = [ "bumpalo", "proc-macro2", @@ -4114,9 +4095,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" dependencies = [ "unicode-ident", ] @@ -4129,13 +4110,11 @@ checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "which" -version = "8.0.0" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fabb953106c3c8eea8306e4393700d7657561cb43122571b172bbfb7c7ba1d" +checksum = "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" dependencies = [ - "env_home", - "rustix", - "winsafe", + "libc", ] [[package]] @@ -4225,16 +4204,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", + "windows-targets", ] [[package]] @@ -4252,31 +4222,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -4285,96 +4238,48 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - [[package]] name = "winnow" version = "0.7.14" @@ -4384,12 +4289,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winsafe" -version = "0.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" - [[package]] name = "wit-bindgen" version = "0.51.0" diff --git a/Cargo.toml b/Cargo.toml index b5b05d5..9a1f854 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,10 +9,22 @@ resolver = "2" [workspace.dependencies.cu] package = "pistonite-cu" -version = "0.7.4" +version = "0.8.2" [workspace.dependencies] +thiserror = "2.0.18" num-traits = "0.2.19" -serde = "1.0.228" -tsify = "0.5.6" -wasm-bindgen = "0.2.114" +tsify = { version = "0.5.6", default-features = false } +wasm-bindgen = "0.2.121" +csscolorparser = "0.8.3" +resvg = "0.47.0" +tiny-skia = "0.12.0" +usvg = "0.47.0" + +swc = "64.0.0" +swc_common = "21.0.2" +swc_ecma_ast = "23.0.1" +swc_ecma_parser = "39.1.0" +swc_ecma_transforms_typescript = "47.0.0" + +boa_engine = "0.21.1" diff --git a/README.md b/README.md index 159a6fe..a134f63 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ + + # Prism ![Build Badge](https://img.shields.io/github/check-runs/Pistonite/prism/main) ![License Badge](https://img.shields.io/github/license/Pistonite/prism) ![Issue Badge](https://img.shields.io/github/issues/Pistonite/prism) -Hex Grid Drawing Tool. https://prism.pistonite.dev +Isometric hex grid drawing tool for making icons and graphics. Web app: https://prism.pistonite.dev +## Syntax The shapes are defined using TypeScript, which is transpiled with SWC -and executed using a custom runtime built with the BOA JS engine to -create the 3D shape data. The data is then rendered onto a 2D hex grid +and executed in a sandboxed runtime (built with the [BOA](https://github.com/boa-dev/boa) JS engine) +to create the 3D shape data. The data is then projected onto a 2D hex grid and turned into an optimized SVG. +## CLI The web app allows for quick prototyping of a design. However, it is hard to keep track of the source code after the design is made. Therefore, prism is also a CLI tool to help with just that! @@ -33,16 +37,18 @@ prism shape.ts --png shape.png ``` You can also import multiple files or specifying additional command to run directly -from the CLI. (note the `-c` command is not transpiled) +from the CLI. (note the command passed via `-c` is not transpiled, so it must be JS and not TS) ``` # suppose the TS files define a function `main` to be called with a color prism util.ts common.ts -c "main('red')" ``` -Moreover, the CLI tool supports `import "script";` statements in TypeScript. +## Source Splitting +The CLI tool supports `import "source";` statements in TypeScript. The path is resolved as a local path and the full file path -must be given (i.e. `script.ts` instead of `script`). ESM and node_modules -are not supported - you shouldn't need them anyway +must be given (i.e. `./source.ts` instead of `source`). Other ESM and `node_modules` +resolution are not supported currently. The files are simply concatenated +and transpiled as a single file (like a preprocessor feature, not real ESM). Lastly, you can emit the `.d.ts` file for local development by calling without an input diff --git a/Taskfile.yml b/Taskfile.yml index be2a8f8..f5311fa 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -2,33 +2,14 @@ version: '3' includes: common: - taskfile: ./packages/mono-dev/task/common.yaml + taskfile: ./node_modules/mono-dev/task/common.yaml flatten: true optional: true - intwc: - taskfile: ./packages/intwc - dir: ./packages/intwc - internal: true - - app: - taskfile: ./packages/app - dir: ./packages/app - internal: true - - lib: - taskfile: ./packages/prism-lib - dir: ./packages/prism-lib - internal: true - - wasm: - taskfile: ./packages/prism-wasm - dir: ./packages/prism-wasm - - cli: - taskfile: ./packages/prism-cli - dir: ./packages/prism-cli - + app: { taskfile: ./packages/app, dir: ./packages/app, internal: true } + lib: { taskfile: ./packages/prism-lib, dir: ./packages/prism-lib, internal: true } + wasm: { taskfile: ./packages/prism-wasm, dir: ./packages/prism-wasm, internal: true } + cli: { taskfile: ./packages/prism-cli, dir: ./packages/prism-cli, internal: true } tasks: install-cargo-extra-tools: @@ -36,7 +17,7 @@ tasks: cmds: - task: cargo-binstall vars: - PACKAGES: magoo wasm-pack + PACKAGES: wasm-pack - task: cargo-binstall vars: PACKAGES: workex --git https://github.com/Pistonite/workex @@ -44,18 +25,11 @@ tasks: install: desc: Install dependencies for local development cmds: - - magoo install - pnpm install - task: post-install - install-ci: - cmds: - - pnpm install --frozen-lockfile - - task: post-install - post-install: cmds: - - task: intwc:install - task: app:install - task: wasm:install @@ -73,9 +47,8 @@ tasks: - task: lib:test build-dev: - desc: Sanity build pass + desc: Sanity build pass for web app cmds: - - task: cli:build - task: wasm:wasm-dev-build - task: app:build @@ -85,4 +58,33 @@ tasks: - task: wasm:build - task: app:build + pnpm-dev-link: + cmds: + - | + for f in packages/*/package.json; do + sed -i 's|"@pistonite/{{.CLI_ARGS}}": "catalog:"|"@pistonite/{{.CLI_ARGS}}": "link:../../../{{.CLI_ARGS}}"|g' "$f" + done + - pnpm i + + pnpm-dev-unlink: + cmds: + - | + for f in packages/*/package.json; do + sed -i 's|"@pistonite/{{.CLI_ARGS}}": "link:../../../{{.CLI_ARGS}}"|"@pistonite/{{.CLI_ARGS}}": "catalog:"|g' "$f" + done + - pnpm i + + upgrade: + - > + pnpm up -r mono-dev react react-dom @types/react @types/react-dom + @pistonite/pure @pistonite/celera @pistonite/workex @fluentui/react-components @fluentui/react-icons + @pistonite/intwc + - pnpm dedupe + - pnpm dedupe --check + - cargo upgrade + + clean: + - rm -rf node_modules + - cargo clean + - rm -rf packages/prism-wasm/target diff --git a/package.json b/package.json index 5f382c4..83b186f 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,12 @@ { - "version": "0.1.1", + "version": "0.1.2", "pnpm": { - "patchedDependencies": { - "monaco-editor@0.52.2": "packages/intwc/patches/monaco-editor@0.52.2.patch" - }, "onlyBuiltDependencies": [ - "@swc/core", "esbuild" ] }, "devDependencies": { - "eslint": "^9.31.0" + "eslint": "^9", + "mono-dev": "catalog:" } } diff --git a/packages/app/.gitignore b/packages/app/.gitignore index a90333f..b1f4b86 100644 --- a/packages/app/.gitignore +++ b/packages/app/.gitignore @@ -25,7 +25,7 @@ dist-ssr .eslintcache .npmrc -/src/PrismLib.ts +*.gen.ts /.prettierignore /eslint.config.js diff --git a/packages/app/Taskfile.yml b/packages/app/Taskfile.yml index b047305..d60f69b 100644 --- a/packages/app/Taskfile.yml +++ b/packages/app/Taskfile.yml @@ -2,26 +2,19 @@ version: '3' includes: ecma: - taskfile: ../mono-dev/task/ecma.yaml + taskfile: ./node_modules/mono-dev/task/ecma.yaml internal: true + optional: true tasks: dev: - cmds: - - task: ecma:vite-dev - + - task: ecma:app-dev build: - cmds: - - task: ecma:vite-build - + - task: ecma:app-build check: - cmds: - - task: ecma:mono-check - + - task: ecma:check fix: - cmds: - - task: ecma:mono-fix - + - task: ecma:fix install: cmds: - - cp ../prism-lib/src/runtime/ts/index.d.ts src/PrismLib.ts + - cp ../prism-lib/src/runtime/ts/index.d.ts src/prism_lib.gen.ts diff --git a/packages/app/package.json b/packages/app/package.json index 36fd19a..bec2aea 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,26 +1,33 @@ { + "private": true, "type": "module", "dependencies": { "@fluentui/react-components": "catalog:", "@fluentui/react-icons": "catalog:", - "@pistonite/intwc": "workspace:*", + "@pistonite/intwc": "catalog:", "@pistonite/pure": "catalog:", - "@pistonite/pure-i18next": "catalog:", - "@pistonite/pure-react": "catalog:", - "@pistonite/shared-controls": "workspace:*", + "@pistonite/celera": "catalog:", "@pistonite/workex": "catalog:", + "@pistonite/webfs": "catalog:", + "@uidotdev/usehooks": "catalog:", "prism-wasm": "workspace:*", "react": "catalog:", "react-dom": "catalog:", - "react-i18next": "*", - "zustand": "^5.0.3" + "zustand": "catalog:" }, "devDependencies": { - "@pistonite/vite-plugin-intwc": "workspace:*", "@types/react": "catalog:", "@types/react-dom": "catalog:", - "monaco-editor": "*", - "mono-dev": "workspace:*", - "vite": "catalog:" + "mono-dev": "catalog:" + }, + "imports": { + "#components": "./src/components/index.ts", + "#i18n": "./src/i18n/index.ts", + "#store": "./src/store/index.ts", + "#worker": "./src/worker/index.ts" + }, + "pistonight/mono-dev": { + "wasm": true, + "worker": "es" } } diff --git a/packages/app/src/App.tsx b/packages/app/src/app.tsx similarity index 62% rename from packages/app/src/App.tsx rename to packages/app/src/app.tsx index 0e9ed8e..f633f13 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/app.tsx @@ -1,16 +1,15 @@ -import { useRef } from "react"; -import { - FluentProvider, - makeStaticStyles, - makeStyles, - webDarkTheme, - webLightTheme, -} from "@fluentui/react-components"; -import { useDark } from "@pistonite/pure-react"; -import { ResizeLayout } from "@pistonite/shared-controls"; +import { lazy, Suspense, useRef } from "react"; +import { makeStaticStyles, makeStyles, Spinner } from "@fluentui/react-components"; +import { ResizeLayout, ThemeProvider } from "@pistonite/celera"; -import { Canvas, type CanvasApi, Editor, Toolbar } from "self::components"; -import { setSideWindowPercentage, useStore } from "self::store"; +import { Canvas, type CanvasApi, Toolbar } from "#components"; +import { setSideWindowPercentage, useStore } from "#store"; +import { useStyleEngine } from "./components/style"; + +const EditorLazy = lazy(async () => { + const { getEditorComponent } = await import("./editor.ts"); + return { default: await getEditorComponent() }; +}); const useStaticStyles = makeStaticStyles({ ":root": { @@ -33,14 +32,14 @@ const useStyles = makeStyles({ export const App: React.FC = () => { useStaticStyles(); const styles = useStyles(); + const m = useStyleEngine(); const canvas = useRef(null); - const dark = useDark(); const percentage = useStore((state) => state.sideWindowPercentage); return ( - +
{ setValuePercent={setSideWindowPercentage} >
- + + +
+ } + > + +
@@ -62,6 +69,6 @@ export const App: React.FC = () => {
-
+ ); }; diff --git a/packages/app/src/components/Editor.tsx b/packages/app/src/components/Editor.tsx deleted file mode 100644 index cd4f35f..0000000 --- a/packages/app/src/components/Editor.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { makeStyles, Text, MessageBar, MessageBarBody } from "@fluentui/react-components"; -import { ResizeLayout } from "@pistonite/shared-controls"; -import { CodeEditor, getNormalizedPath } from "@pistonite/intwc"; - -import { setCodeWindowPercentage, setScript, useStore } from "self::store"; - -const useStyles = makeStyles({ - container: { width: "100%", height: "100%" }, - console: { - padding: "8px", - boxSizing: "border-box", - overflowY: "auto", - overflowX: "hidden", - height: "100%", - }, - consoleScroll: { maxHeight: 0 }, -}); - -const FILE_NAME = getNormalizedPath("main.ts"); - -export const Editor: React.FC = () => { - const styles = useStyles(); - const scriptError = useStore((state) => state.scriptError); - const messages = useStore((state) => state.output?.messages); - const percentage = useStore((state) => state.codeWindowPercentage); - - return ( - - { - editor.openFile(FILE_NAME, useStore.getState().script, "typescript"); - const unsubsribeStore = useStore.subscribe((state) => { - editor.setFileContent(FILE_NAME, state.script); - }); - const unsubscribeEditor = editor.subscribe("content-changed", (file) => { - if (file !== FILE_NAME) { - return; - } - setScript(editor.getFileContent(file)); - }); - return () => { - unsubsribeStore(); - unsubscribeEditor(); - }; - }} - /> -
- {!!scriptError && ( - - {scriptError} - - )} -
- {messages?.map((message, i) => ( - - {message} - - ))} -
-
-
- ); -}; diff --git a/packages/app/src/components/Canvas.tsx b/packages/app/src/components/canvas.tsx similarity index 77% rename from packages/app/src/components/Canvas.tsx rename to packages/app/src/components/canvas.tsx index 86c3bf2..3ac9465 100644 --- a/packages/app/src/components/Canvas.tsx +++ b/packages/app/src/components/canvas.tsx @@ -1,35 +1,25 @@ -import { useDark } from "@pistonite/pure-react"; import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react"; -import { makeStyles } from "@fluentui/react-components"; +import { useDark } from "@pistonite/celera"; -import { useStore, setTranslate } from "self::store"; +import { useStore, setTranslate } from "#store"; -import { useCanvas } from "./useCanvas.ts"; -import { CanvasGrid } from "./CanvasGrid.tsx"; +import { useCanvas } from "./use_canvas.tsx"; +import { CanvasGrid } from "./canvas_grid.tsx"; +import { useStyleEngine } from "./style.ts"; -const useStyles = makeStyles({ - canvasContainer: { - position: "relative", - width: "100%", - height: "100%", - overflow: "hidden", - }, - svgContainer: { backgroundColor: "transparent" }, -}); - -export type CanvasApi = { +export interface CanvasApi { /** Change zoom level center at the canvas center */ setZoomAtCanvasCenter: (zoom: number) => void; /** Change zoom level center at the client point (relative to canvas origin) */ setZoomAtClientPoint: (zoom: number, clientX: number, clientY: number) => void; -}; +} export const Canvas = forwardRef((_, ref) => { const canvasApi = useCanvas(); useImperativeHandle(ref, () => canvasApi, [canvasApi]); - const { canvasRef, setZoomAtClientPoint } = canvasApi; + const { canvasRef, width, height, setZoomAtClientPoint } = canvasApi; const zoom = useStore((state) => state.zoom); const translateX = useStore((state) => state.translateX); const translateY = useStore((state) => state.translateY); @@ -37,13 +27,13 @@ export const Canvas = forwardRef((_, ref) => { const [dragStart, setDragStart] = useState<[number, number] | undefined>(); const dark = useDark(); const showGrid = useStore((state) => state.showGrid); - const styles = useStyles(); + const m = useStyleEngine(); const svgRef = useUpdateSvg(); return (
{ @@ -69,8 +59,8 @@ export const Canvas = forwardRef((_, ref) => { > {!dragStart && showGrid && ( diff --git a/packages/app/src/components/CanvasGrid.tsx b/packages/app/src/components/canvas_grid.tsx similarity index 75% rename from packages/app/src/components/CanvasGrid.tsx rename to packages/app/src/components/canvas_grid.tsx index 9dcfd49..0d0eb59 100644 --- a/packages/app/src/components/CanvasGrid.tsx +++ b/packages/app/src/components/canvas_grid.tsx @@ -1,9 +1,8 @@ import { makeStyles } from "@fluentui/react-components"; -import { useMemo } from "react"; -import { useStore, useSvgTransform } from "self::store"; +import { useStore, useSvgTransform } from "#store"; -type CanvasGridProps = { +interface CanvasGridProps { /// The canvas width width: number; /// The canvas height @@ -12,7 +11,7 @@ type CanvasGridProps = { color: string; /** Color of the axis */ axisColor: string; -}; +} const useStyles = makeStyles({ gridContainer: { @@ -26,7 +25,8 @@ const useStyles = makeStyles({ }); /** Grid lines for the canvas */ -export const CanvasGrid: React.FC = ({ width, height, color }) => { +export const CanvasGrid: React.FC = (props) => { + const { width, height, color } = props; const zoom = useStore((state) => state.zoom); const translateX = useStore((state) => state.translateX); const translateY = useStore((state) => state.translateY); @@ -34,13 +34,13 @@ export const CanvasGrid: React.FC = ({ width, height, color }) const yOffset = width / Math.sqrt(3); - const lines = useMemo(() => { + const xLines: number[] = []; + const y1Lines: number[] = []; + const y2Lines: number[] = []; + let xSpacing = ((unit * Math.sqrt(3)) / 2) * zoom; + let ySpacing = unit * zoom; + if (xSpacing !== 0 && ySpacing !== 0) { // Unit lengths (spacing between lines) - let xSpacing = ((unit * Math.sqrt(3)) / 2) * zoom; - let ySpacing = unit * zoom; - if (xSpacing === 0 || ySpacing === 0) { - return { x: [], y1: [], y2: [] }; - } // cap how many lines are drawn if the units are too small while (xSpacing < 10 || ySpacing < 10) { xSpacing *= 2; @@ -58,9 +58,6 @@ export const CanvasGrid: React.FC = ({ width, height, color }) ((-shiftX * unit * zoom) / Math.sqrt(3) + translateX / Math.sqrt(3)) + translateY + ySpacing / 2; - - // The offset needed to maintain the grid angle - const xLines = []; for (let x = xOrigin; x < width; x += xSpacing) { xLines.push(x); } @@ -68,7 +65,6 @@ export const CanvasGrid: React.FC = ({ width, height, color }) xLines.push(x); } - const y1Lines = []; for (let y = y1Origin; y < height + yOffset; y += ySpacing) { y1Lines.push(y); } @@ -76,30 +72,26 @@ export const CanvasGrid: React.FC = ({ width, height, color }) y1Lines.push(y); } - const y2Lines = []; for (let y = y2Origin; y < height; y += ySpacing) { y2Lines.push(y); } for (let y = y2Origin - ySpacing; y > -Math.abs(translateY) - yOffset; y -= ySpacing) { y2Lines.push(y); } - - return { x: xLines, y1: y1Lines, y2: y2Lines }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [unit, shiftX, shiftY, width, height, zoom, translateX, translateY]); + } const styles = useStyles(); return (
- {lines.x.map((x, i) => ( + {xLines.map((x, i) => ( ))} - {lines.y1.map((y, i) => ( + {y1Lines.map((y, i) => ( ))} - {lines.y2.map((y, i) => ( + {y2Lines.map((y, i) => ( ))} diff --git a/packages/app/src/components/editor.tsx b/packages/app/src/components/editor.tsx new file mode 100644 index 0000000..2358562 --- /dev/null +++ b/packages/app/src/components/editor.tsx @@ -0,0 +1,63 @@ +import { ResizeLayout, useTranslation } from "@pistonite/celera"; +import { SimpleEditor, StatusItemPreset } from "@pistonite/intwc"; +import { useDebounce } from "@uidotdev/usehooks"; + +import { setCodeWindowPercentage, setScript, useStore } from "#store"; + +import { useStyleEngine } from "./style.ts"; + +export const Editor: React.FC = () => { + const m = useStyleEngine(); + const scriptError = useStore((state) => state.scriptError); + const messages = useStore((state) => state.output?.messages); + const percentage = useStore((state) => state.codeWindowPercentage); + const script = useStore((state) => state.script); + + const consoleValueImmediate = scriptError ? scriptError : messages?.join("\n") || ""; + const consoleValue = useDebounce(consoleValueImmediate, 200); + + const t = useTranslation(); + + return ( + + + {}} + filename="console" + editorOptions={{ + readOnly: true, + }} + statusLeft={[t("output_window")]} + statusRight={[StatusItemPreset.WordWrap]} + /> + + ); +}; diff --git a/packages/app/src/components/index.ts b/packages/app/src/components/index.ts index 031e2ca..41f7e89 100644 --- a/packages/app/src/components/index.ts +++ b/packages/app/src/components/index.ts @@ -1,3 +1,2 @@ -export * from "./Canvas.tsx"; -export * from "./Editor.tsx"; -export * from "./Toolbar.tsx"; +export * from "./canvas.tsx"; +export * from "./toolbar.tsx"; diff --git a/packages/app/src/components/style.ts b/packages/app/src/components/style.ts new file mode 100644 index 0000000..46c2832 --- /dev/null +++ b/packages/app/src/components/style.ts @@ -0,0 +1,16 @@ +import { gale } from "@pistonite/celera"; + +export const useStyleEngine = gale({ + "pad-4": { + padding: "4px", + }, + "gap-4": { + gap: "4px", + }, + "pad-8": { + padding: "8px", + }, + transparent: { + background: "transparent", + }, +}); diff --git a/packages/app/src/components/Toolbar.tsx b/packages/app/src/components/toolbar.tsx similarity index 63% rename from packages/app/src/components/Toolbar.tsx rename to packages/app/src/components/toolbar.tsx index 03dd0d5..6bc605b 100644 --- a/packages/app/src/components/Toolbar.tsx +++ b/packages/app/src/components/toolbar.tsx @@ -1,42 +1,33 @@ -import { Tooltip, Text, ToggleButton, makeStyles, Button } from "@fluentui/react-components"; -import { fsSave } from "@pistonite/pure/fs"; -import { useTranslation } from "react-i18next"; +import { Tooltip, Text, ToggleButton, Button } from "@fluentui/react-components"; +import { fsSave } from "@pistonite/webfs"; import { ArrowDownload24Regular, Grid24Regular, Square24Regular } from "@fluentui/react-icons"; -import { useDark } from "@pistonite/pure-react"; -import { DarkToggle, GitHubLink, LanguagePicker } from "@pistonite/shared-controls"; +import { DarkToggle, GitHubLink, LanguagePicker, useDark, useTranslation } from "@pistonite/celera"; -import { setForceSquare, setShowGrid, useStore, useSvgContent } from "self::store"; +import { setForceSquare, setShowGrid, useStore, useSvgContent } from "#store"; -import { Zoom } from "./Zoom.tsx"; +import { Zoom } from "./zoom.tsx"; +import { useStyleEngine } from "./style.ts"; -export type ToolbarProps = { setZoom: (zoom: number) => void }; +export interface ToolbarProps { + setZoom: (zoom: number) => void; +} -const useStyles = makeStyles({ - toolbar: { - display: "flex", - flexDirection: "row", - gap: "4px", - alignItems: "center", - padding: "4px", - }, - referenceText: { margin: "0" }, -}); - -export const Toolbar: React.FC = ({ setZoom }) => { - const { t } = useTranslation(); +export const Toolbar: React.FC = (props) => { + const { setZoom } = props; + const t = useTranslation(); const showGrid = useStore((state) => state.showGrid); const forceSquare = useStore((state) => state.forceSquare); - const styles = useStyles(); const svg = useSvgContent(); const dark = useDark(); + const m = useStyleEngine(); return (
-
+
- {t("ui.size")}: {toHumanReadableBytes(svg.length)}{" "} + {t("size")}: {toHumanReadableBytes(svg.length)}{" "} - +