├── src ├── testdata │ ├── source │ │ ├── a.ts │ │ ├── data.json │ │ ├── mapped.js │ │ ├── b.ts │ │ ├── child1.ts │ │ ├── child2.ts │ │ ├── external.ts │ │ ├── main.ts │ │ ├── grandchild1.ts │ │ ├── parent.ts │ │ ├── grandchild2.ts │ │ ├── import_map.json │ │ ├── wasm.ts │ │ ├── import_import_map.js │ │ ├── npm_imports_submodule.ts │ │ ├── math.wasm │ │ ├── dynamic_data.ts │ │ ├── json.ts │ │ ├── npm_imports_main.ts │ │ └── dynamic.ts │ ├── emit │ │ ├── data.json │ │ ├── b.ts │ │ ├── main.ts │ │ ├── json.ts │ │ ├── dynamic_data.ts │ │ ├── b.ts.map │ │ ├── main.ts.map │ │ └── dynamic.ts │ ├── redirect_data │ │ ├── b.ts │ │ ├── main.ts │ │ ├── b.ts.map │ │ └── main.ts.map │ ├── deno_jsonc_as_import_map │ │ ├── a.ts │ │ ├── main.ts │ │ └── deno.jsonc │ ├── json.eszip2 │ ├── wasm.eszip2_3 │ ├── redirect.eszip2 │ ├── npm_packages.eszip2_1 │ ├── no_npm_packages.eszip2_1 │ ├── npm_packages_invalid_1.eszip2_1 │ └── basic.json ├── snapshots │ ├── eszip__v2__tests__opaque_data.snap │ ├── eszip__v2__tests__npm_empty_snapshot.snap │ ├── eszip__v2__tests__npm_packages.snap │ └── eszip__v2__tests__file_format_roundtrippable.snap ├── error.rs ├── examples │ ├── viewer.rs │ └── builder.rs ├── v1.rs └── lib.rs ├── rust-toolchain.toml ├── js ├── examples │ ├── chainloading │ │ ├── handlers │ │ │ ├── bar │ │ │ │ ├── helpers.js │ │ │ │ └── index.ts │ │ │ └── foo.ts │ │ └── bundler.ts │ ├── build.ts │ ├── worker.tsx │ └── build_custom.ts ├── README.md ├── loader.ts ├── mod.ts ├── eszip_test.ts └── eszip.ts ├── .rustfmt.toml ├── .gitignore ├── deno.json ├── .github └── workflows │ ├── publish.yml │ ├── release.yml │ └── ci.yml ├── lib ├── Cargo.toml └── lib.rs ├── LICENSE ├── README.md ├── Cargo.toml ├── benches └── source_hash_function.rs └── Cargo.lock /src/testdata/source/a.ts: -------------------------------------------------------------------------------- 1 | b.ts -------------------------------------------------------------------------------- /src/testdata/emit/data.json: -------------------------------------------------------------------------------- 1 | 1234 2 | -------------------------------------------------------------------------------- /src/testdata/source/data.json: -------------------------------------------------------------------------------- 1 | 1234 2 | -------------------------------------------------------------------------------- /src/testdata/emit/b.ts: -------------------------------------------------------------------------------- 1 | export const b = "b"; 2 | -------------------------------------------------------------------------------- /src/testdata/source/mapped.js: -------------------------------------------------------------------------------- 1 | import "a"; 2 | -------------------------------------------------------------------------------- /src/testdata/source/b.ts: -------------------------------------------------------------------------------- 1 | export const b = "b"; 2 | -------------------------------------------------------------------------------- /src/testdata/emit/main.ts: -------------------------------------------------------------------------------- 1 | export * as a from "./a.ts"; 2 | -------------------------------------------------------------------------------- /src/testdata/redirect_data/b.ts: -------------------------------------------------------------------------------- 1 | export const b = "b"; 2 | -------------------------------------------------------------------------------- /src/testdata/source/child1.ts: -------------------------------------------------------------------------------- 1 | import "./grandchild1.ts"; -------------------------------------------------------------------------------- /src/testdata/source/child2.ts: -------------------------------------------------------------------------------- 1 | import "./grandchild2.ts"; -------------------------------------------------------------------------------- /src/testdata/source/external.ts: -------------------------------------------------------------------------------- 1 | export * as fs from "extern:fs"; -------------------------------------------------------------------------------- /src/testdata/source/main.ts: -------------------------------------------------------------------------------- 1 | export * as a from "./a.ts"; 2 | -------------------------------------------------------------------------------- /src/testdata/deno_jsonc_as_import_map/a.ts: -------------------------------------------------------------------------------- 1 | export const b = "b"; 2 | -------------------------------------------------------------------------------- /src/testdata/redirect_data/main.ts: -------------------------------------------------------------------------------- 1 | export * as a from "./a.ts"; 2 | -------------------------------------------------------------------------------- /src/testdata/deno_jsonc_as_import_map/main.ts: -------------------------------------------------------------------------------- 1 | export * as a from "./a.ts"; 2 | -------------------------------------------------------------------------------- /src/testdata/source/grandchild1.ts: -------------------------------------------------------------------------------- 1 | export const grandchild1 = "grandchild1"; -------------------------------------------------------------------------------- /src/testdata/source/parent.ts: -------------------------------------------------------------------------------- 1 | import "./child1.ts"; 2 | import "./child2.ts"; -------------------------------------------------------------------------------- /src/testdata/source/grandchild2.ts: -------------------------------------------------------------------------------- 1 | 2 | export const grandchild2 = "grandchild2"; -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.89.0" 3 | components = ["clippy", "rustfmt"] 4 | -------------------------------------------------------------------------------- /src/testdata/json.eszip2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/eszip/main/src/testdata/json.eszip2 -------------------------------------------------------------------------------- /src/testdata/source/import_map.json: -------------------------------------------------------------------------------- 1 | { 2 | "imports": { 3 | "a": "./a.ts" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/testdata/source/wasm.ts: -------------------------------------------------------------------------------- 1 | import { add } from "./math.wasm"; 2 | console.log(add(1, 2)); 3 | -------------------------------------------------------------------------------- /src/testdata/source/import_import_map.js: -------------------------------------------------------------------------------- 1 | import m from "./import_map.json" assert { type: "json" }; 2 | -------------------------------------------------------------------------------- /src/testdata/source/npm_imports_submodule.ts: -------------------------------------------------------------------------------- 1 | import "npm:a@^1.2/bar"; 2 | import "npm:other/bar"; 3 | -------------------------------------------------------------------------------- /src/testdata/wasm.eszip2_3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/eszip/main/src/testdata/wasm.eszip2_3 -------------------------------------------------------------------------------- /js/examples/chainloading/handlers/bar/helpers.js: -------------------------------------------------------------------------------- 1 | export function add(x, y) { 2 | return x + y; 3 | } 4 | -------------------------------------------------------------------------------- /src/testdata/emit/json.ts: -------------------------------------------------------------------------------- 1 | export { default as data } from "./data.json" with { 2 | type: "json" 3 | }; 4 | -------------------------------------------------------------------------------- /src/testdata/redirect.eszip2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/eszip/main/src/testdata/redirect.eszip2 -------------------------------------------------------------------------------- /src/testdata/source/math.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/eszip/main/src/testdata/source/math.wasm -------------------------------------------------------------------------------- /src/testdata/npm_packages.eszip2_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/eszip/main/src/testdata/npm_packages.eszip2_1 -------------------------------------------------------------------------------- /src/testdata/source/dynamic_data.ts: -------------------------------------------------------------------------------- 1 | const {Nani} = await import("data:application/javascript,export const Nani = '何'"); -------------------------------------------------------------------------------- /src/testdata/source/json.ts: -------------------------------------------------------------------------------- 1 | export { default as data } from "./data.json" assert { 2 | type: "json" 3 | }; 4 | -------------------------------------------------------------------------------- /src/testdata/emit/dynamic_data.ts: -------------------------------------------------------------------------------- 1 | const { Nani } = await import("data:application/javascript,export const Nani = '何'"); 2 | -------------------------------------------------------------------------------- /src/testdata/no_npm_packages.eszip2_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/eszip/main/src/testdata/no_npm_packages.eszip2_1 -------------------------------------------------------------------------------- /js/examples/chainloading/handlers/foo.ts: -------------------------------------------------------------------------------- 1 | export default async (req: Request) => { 2 | return new Response(`foo: ${req.url}`); 3 | }; 4 | -------------------------------------------------------------------------------- /src/testdata/npm_packages_invalid_1.eszip2_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denoland/eszip/main/src/testdata/npm_packages_invalid_1.eszip2_1 -------------------------------------------------------------------------------- /js/README.md: -------------------------------------------------------------------------------- 1 | # eszip 2 | 3 | The eszip format lets you losslessly serialize an ECMAScript module graph into a 4 | single compact file. 5 | -------------------------------------------------------------------------------- /.rustfmt.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. 2 | max_width = 80 3 | tab_spaces = 2 4 | edition = "2018" -------------------------------------------------------------------------------- /src/testdata/source/npm_imports_main.ts: -------------------------------------------------------------------------------- 1 | import "npm:d/foo"; 2 | import "./npm_imports_submodule.ts"; 3 | import "npm:other"; 4 | import "npm:a@^1.2/foo"; -------------------------------------------------------------------------------- /js/loader.ts: -------------------------------------------------------------------------------- 1 | export type { 2 | Loader, 3 | LoadResponse, 4 | LoadResponseExternal, 5 | LoadResponseModule, 6 | } from "jsr:@deno/cache-dir@0.8"; 7 | -------------------------------------------------------------------------------- /src/testdata/emit/b.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["file:///b.ts"],"sourcesContent":["export const b = \"b\";\n"],"names":[],"mappings":"AAAA,OAAO,MAAM,IAAI,IAAI"} -------------------------------------------------------------------------------- /src/testdata/emit/main.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["file:///main.ts"],"sourcesContent":["export * as a from \"./a.ts\";\n"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS"} -------------------------------------------------------------------------------- /src/testdata/redirect_data/b.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["file:///b.ts"],"sourcesContent":["export const b = \"b\";\n"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAG"} -------------------------------------------------------------------------------- /src/testdata/redirect_data/main.ts.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["file:///main.ts"],"sourcesContent":["export * as a from \"./a.ts\";\n"],"names":[],"mappings":"AAAA,MAAM,MAAM,CAAC,MAAM,CAAQ"} -------------------------------------------------------------------------------- /src/testdata/deno_jsonc_as_import_map/deno.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": { 3 | "run": "deno run main.ts" 4 | }, 5 | // comment 6 | "imports": { 7 | "a": "./a.ts" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | /target 3 | es.zip 4 | /npm 5 | deno.lock 6 | js/snippets 7 | js/eszip_wasm_bg.wasm 8 | js/eszip_wasm.generated.d.ts 9 | js/eszip_wasm.generated.js 10 | js/LICENSE 11 | -------------------------------------------------------------------------------- /src/testdata/source/dynamic.ts: -------------------------------------------------------------------------------- 1 | const { default: data } = await import("./data.json", { 2 | assert: { type: "json" }, 3 | }); 4 | await import("./relative_doesnt_exist.ts"); 5 | await import("not_real"); -------------------------------------------------------------------------------- /js/examples/chainloading/handlers/bar/index.ts: -------------------------------------------------------------------------------- 1 | import { add } from "./helpers.js"; 2 | 3 | export default async (req: Request) => { 4 | return new Response(`bar: ${req.url} [${add(1, 2)}]`); 5 | }; 6 | -------------------------------------------------------------------------------- /js/examples/build.ts: -------------------------------------------------------------------------------- 1 | import { build } from "../mod.ts"; 2 | 3 | const path = new URL("./worker.tsx", import.meta.url).href; 4 | console.log(path); 5 | const eszip = await build([path]); 6 | console.log(eszip); 7 | -------------------------------------------------------------------------------- /src/testdata/emit/dynamic.ts: -------------------------------------------------------------------------------- 1 | const { default: data } = await import("./data.json", { 2 | assert: { 3 | type: "json" 4 | } 5 | }); 6 | await import("./relative_doesnt_exist.ts"); 7 | await import("not_real"); 8 | -------------------------------------------------------------------------------- /deno.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": { 3 | "build": "cp LICENSE js/LICENSE && RUSTFLAGS=--cfg=web_sys_unstable_apis deno run -A jsr:@deno/wasmbuild@0.17.1 --all-features --out js", 4 | "node": "deno run -A ./build_npm.ts 0.0.0", 5 | "test": "deno test -A js/", 6 | "fmt": "deno fmt && cargo fmt --all" 7 | }, 8 | "exclude": ["./npm", "./src/testdata/", "./target"] 9 | } 10 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | permissions: 12 | contents: read 13 | id-token: write 14 | steps: 15 | - name: Clone repository 16 | uses: actions/checkout@v5 17 | - uses: rust-lang/crates-io-auth-action@v1 18 | id: auth 19 | - run: cargo publish 20 | env: 21 | CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} 22 | -------------------------------------------------------------------------------- /js/examples/worker.tsx: -------------------------------------------------------------------------------- 1 | import { serve } from "https://deno.land/std@0.114.0/http/server.ts"; 2 | import { h, ssr, tw } from "https://crux.land/nanossr@0.0.1"; 3 | 4 | const Hello = (props) => ( 5 |
6 |

7 | Hello {props.name}! 8 |

9 |
10 | ); 11 | 12 | console.log("Listening on http://localhost:8000"); 13 | await serve((req) => { 14 | const url = new URL(req.url); 15 | const name = url.searchParams.get("name") ?? "world"; 16 | return ssr(() => ); 17 | }); 18 | -------------------------------------------------------------------------------- /js/examples/build_custom.ts: -------------------------------------------------------------------------------- 1 | import { build } from "../mod.ts"; 2 | 3 | // Bundle a new eszip. 4 | const eszip = await build([ 5 | "https://example.com/mod.ts", 6 | "https://example.com/dep1.ts", 7 | ], async (specifier: string) => { 8 | if (specifier === "https://example.com/dep1.ts") { 9 | return { 10 | specifier, 11 | headers: { 12 | "content-type": "text/typescript", 13 | }, 14 | content: "export const a = 1;", 15 | }; 16 | } 17 | 18 | return { 19 | specifier: "https://example.com/mod.ts", 20 | headers: { 21 | "content-type": "application/typescript", 22 | }, 23 | content: `import { a } from "https://example.com/dep1.ts";`, 24 | }; 25 | }); 26 | 27 | console.log(eszip); 28 | -------------------------------------------------------------------------------- /src/snapshots/eszip__v2__tests__opaque_data.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/v2.rs 3 | expression: bytes 4 | --- 5 | [ 6 | 69, 7 | 83, 8 | 90, 9 | 73, 10 | 80, 11 | 50, 12 | 46, 13 | 51, 14 | 0, 15 | 0, 16 | 0, 17 | 4, 18 | 0, 19 | 0, 20 | 1, 21 | 0, 22 | 0, 23 | 0, 24 | 0, 25 | 31, 26 | 0, 27 | 0, 28 | 0, 29 | 9, 30 | 43, 31 | 115, 32 | 47, 33 | 102, 34 | 111, 35 | 111, 36 | 98, 37 | 97, 38 | 114, 39 | 0, 40 | 0, 41 | 0, 42 | 0, 43 | 0, 44 | 0, 45 | 0, 46 | 0, 47 | 3, 48 | 0, 49 | 0, 50 | 0, 51 | 0, 52 | 0, 53 | 0, 54 | 0, 55 | 0, 56 | 3, 57 | 0, 58 | 0, 59 | 0, 60 | 0, 61 | 0, 62 | 0, 63 | 0, 64 | 3, 65 | 1, 66 | 2, 67 | 3, 68 | 0, 69 | 0, 70 | 0, 71 | 0, 72 | ] 73 | -------------------------------------------------------------------------------- /lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eszip_wasm" 3 | version = "0.0.0" 4 | authors = ["the Deno authors"] 5 | edition = "2021" 6 | description = "A utility that can download JavaScript and TypeScript module graphs and store them locally in a special zip file" 7 | license = "MIT" 8 | 9 | [lib] 10 | name = "eszip_wasm" 11 | path = "lib.rs" 12 | crate-type = ["cdylib"] 13 | 14 | [dependencies] 15 | anyhow = "1" 16 | console_error_panic_hook = "0.1.7" 17 | deno_graph = { workspace = true } 18 | deno_error.workspace = true 19 | eszip = { path = "../" } 20 | getrandom = { version = "*", features = ["js"] } 21 | import_map = { workspace = true } 22 | js-sys = { version = "0.3.69" } 23 | futures = "0.3.19" 24 | wasm-bindgen = { version = "=0.2.92" } 25 | wasm-bindgen-futures = { version = "=0.4.42" } 26 | serde = { workspace = true } 27 | serde-wasm-bindgen = "0.5.0" 28 | web-sys = { version = "=0.3.69", features = ["ReadableStreamByobReader"] } 29 | sys_traits = { version = "0.1.12", features = ["real", "wasm"] } 30 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | releaseKind: 7 | description: 'Kind of release' 8 | default: 'minor' 9 | type: choice 10 | options: 11 | - patch 12 | - minor 13 | required: true 14 | 15 | jobs: 16 | rust: 17 | name: release 18 | runs-on: ubuntu-latest 19 | timeout-minutes: 30 20 | 21 | steps: 22 | - name: Clone repository 23 | uses: actions/checkout@v5 24 | with: 25 | token: ${{ secrets.DENOBOT_PAT }} 26 | 27 | - uses: denoland/setup-deno@v1 28 | - uses: dsherret/rust-toolchain-file@v1 29 | 30 | - name: Tag and release 31 | env: 32 | GITHUB_TOKEN: ${{ secrets.DENOBOT_PAT }} 33 | GH_WORKFLOW_ACTOR: ${{ github.actor }} 34 | run: | 35 | git config user.email "denobot@users.noreply.github.com" 36 | git config user.name "denobot" 37 | deno run -A jsr:@deno/rust-automation@0.22.1/tasks/publish-release --${{github.event.inputs.releaseKind}} eszip 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright 2021-2024 Deno Land Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /src/testdata/basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "modules": { 4 | "https://gist.githubusercontent.com/lucacasonato/f3e21405322259ca4ed155722390fda2/raw/e25acb49b681e8e1da5a2a33744b7a36d538712d/hello.js": { 5 | "Source": { 6 | "source": "addEventListener(\"fetch\", (event) => {\n event.respondWith(new Response(\"Hello World\", {\n headers: { \"content-type\": \"text/plain\" },\n }));\n});", 7 | "transpiled": "addEventListener(\"fetch\", (event)=>{\n event.respondWith(new Response(\"Hello World\", {\n headers: {\n \"content-type\": \"text/plain\"\n }\n }));\n});\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIjxodHRwczovL2dpc3QuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2x1Y2FjYXNvbmF0by9mM2UyMTQwNTMyMjI1OWNhNGVkMTU1NzIyMzkwZmRhMi9yYXcvZTI1YWNiNDliNjgxZThlMWRhNWEyYTMzNzQ0YjdhMzZkNTM4NzEyZC9oZWxsby5qcz4iXSwic291cmNlc0NvbnRlbnQiOlsiYWRkRXZlbnRMaXN0ZW5lcihcImZldGNoXCIsIChldmVudCkgPT4ge1xuICBldmVudC5yZXNwb25kV2l0aChuZXcgUmVzcG9uc2UoXCJIZWxsbyBXb3JsZFwiLCB7XG4gICAgaGVhZGVyczogeyBcImNvbnRlbnQtdHlwZVwiOiBcInRleHQvcGxhaW5cIiB9LFxuICB9KSk7XG59KTsiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQUEsRUFBQSxLQUFBLElBQUEsS0FBQTtBQUNBLFNBQUEsQ0FBQSxXQUFBLEtBQUEsUUFBQSxFQUFBLFdBQUE7QUFDQSxlQUFBO2FBQUEsWUFBQSxJQUFBLFVBQUEifQ==", 8 | "content_type": "text/plain; charset=utf-8", 9 | "deps": [] 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/error.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. 2 | 3 | use thiserror::Error; 4 | 5 | #[derive(Debug, Error)] 6 | pub enum ParseError { 7 | #[error("invalid eszip v1: {0}")] 8 | InvalidV1Json(serde_json::Error), 9 | #[error("invalid eszip v1 version: got {0}, expected 1")] 10 | InvalidV1Version(u32), 11 | #[error("invalid eszip v2")] 12 | InvalidV2, 13 | #[error("invalid eszip v2 header hash")] 14 | InvalidV2HeaderHash, 15 | #[error("invalid specifier in eszip v2 header at offset {0}")] 16 | InvalidV2Specifier(usize), 17 | #[error("invalid entry kind {0} in eszip v2 header at offset {0}")] 18 | InvalidV2EntryKind(u8, usize), 19 | #[error("invalid module kind {0} in eszip v2 header at offset {0}")] 20 | InvalidV2ModuleKind(u8, usize), 21 | #[error("invalid eszip v2 header: {0}")] 22 | InvalidV2Header(&'static str), 23 | #[error("invalid eszip v2 source offset ({0})")] 24 | InvalidV2SourceOffset(usize), 25 | #[error("invalid eszip v2 source hash (specifier {0})")] 26 | InvalidV2SourceHash(String), 27 | #[error("invalid eszip v2.1 npm snapshot hash")] 28 | InvalidV2NpmSnapshotHash, 29 | #[error("invalid eszip v2.1 npm package at index {0}. {1:#}")] 30 | InvalidV2NpmPackageOffset(usize, std::io::Error), 31 | #[error("invalid eszip v2.1 npm package '{0}'. {1:#}")] 32 | InvalidV2NpmPackage(String, anyhow::Error), 33 | #[error("invalid eszip v2.1 npm req '{0}'. {1:#}")] 34 | InvalidV2NpmPackageReq(String, anyhow::Error), 35 | #[error("invalid eszip v2.2 options header")] 36 | InvalidV22OptionsHeader(String), 37 | #[error("invalid eszip v2.2 options header hash")] 38 | InvalidV22OptionsHeaderHash, 39 | 40 | #[error(transparent)] 41 | Io(#[from] std::io::Error), 42 | } 43 | -------------------------------------------------------------------------------- /js/mod.ts: -------------------------------------------------------------------------------- 1 | import type { Loader } from "./loader.ts"; 2 | import { 3 | instantiate, 4 | Parser as InternalParser, 5 | } from "./eszip_wasm.generated.js"; 6 | import { 7 | CacheSetting, 8 | createCache, 9 | } from "jsr:@deno/cache-dir@0.8"; 10 | export type { LoadResponse } from "./loader.ts"; 11 | 12 | const encoder = new TextEncoder(); 13 | 14 | export const options: { wasmURL: URL | undefined } = { wasmURL: undefined }; 15 | 16 | export class Parser extends InternalParser { 17 | private constructor() { 18 | super(); 19 | } 20 | 21 | static async createInstance() { 22 | // insure instantiate is called 23 | await instantiate({ url: options.wasmURL }); 24 | return new Parser(); 25 | } 26 | } 27 | 28 | export async function build( 29 | roots: string[], 30 | loader: Loader["load"] = createCache().load, 31 | importMapUrl?: string, 32 | ): Promise { 33 | const { build } = await instantiate({ url: options.wasmURL }); 34 | return build( 35 | roots, 36 | (specifier: string, options: { 37 | isDynamic: boolean; 38 | cacheSetting: CacheSetting; 39 | checksum: string | undefined; 40 | }) => { 41 | return loader( 42 | specifier, 43 | options.isDynamic, 44 | options.cacheSetting, 45 | options.checksum, 46 | ).then((result) => { 47 | if (result?.kind === "module") { 48 | if (typeof result.content === "string") { 49 | result.content = encoder.encode(result.content); 50 | } 51 | // need to convert to an array for serde_wasm_bindgen to work 52 | // deno-lint-ignore no-explicit-any 53 | (result as any).content = Array.from(result.content); 54 | } 55 | return result; 56 | }).catch((err) => Promise.reject(String(err))); 57 | }, 58 | importMapUrl, 59 | ); 60 | } 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eszip 2 | 3 | The eszip format lets you losslessly serialize an ECMAScript module graph 4 | (represented by [`deno_graph::ModuleGraph`][module_graph]) into a single compact 5 | file. 6 | 7 | The eszip file format is designed to be compact and streaming capable. This 8 | allows for efficient loading of large ECMAScript module graphs. 9 | 10 | https://eszip-viewer.deno.dev/ is a tool for inspecting eszip files. 11 | 12 | [module_graph]: https://docs.rs/deno_graph/latest/deno_graph/struct.ModuleGraph.html 13 | 14 | ## Examples 15 | 16 | ### Creating an eszip 17 | 18 | ```shell 19 | cargo run --example eszip_builder https://deno.land/std/http/file_server.ts file_server.eszip2 20 | ``` 21 | 22 | ### Viewing the contents of an eszip 23 | 24 | ```shell 25 | cargo run --example eszip_viewer file_server.eszip2 26 | ``` 27 | 28 | ### Loading the eszip into V8 29 | 30 | ```shell 31 | cargo run --example eszip_load file_server.eszip2 https://deno.land/std/http/file_server.ts 32 | ``` 33 | 34 | ## File format 35 | 36 | The file format looks as follows: 37 | 38 | ``` 39 | Eszip: 40 | | Magic (8) | Header size (4) | Header (n) | Header hash (32) | Sources size (4) | Sources (n) | SourceMaps size (4) | SourceMaps (n) | 41 | 42 | Header: 43 | ( | Specifier size (4) | Specifier (n) | Entry type (1) | Entry (n) | )* 44 | 45 | Entry (redirect): 46 | | Specifier size (4) | Specifier (n) | 47 | 48 | Entry (module): 49 | | Source offset (4) | Source size (4) | SourceMap offset (4) | SourceMap size (4) | Module type (1) | 50 | 51 | Sources: 52 | ( | Source (n) | Hash (32) | )* 53 | 54 | SourceMaps: 55 | ( | SourceMap (n) | Hash (32) | )* 56 | ``` 57 | 58 | There is one optimization for empty source / source map entries. If both the 59 | offset and size are set to 0, no entry and no hash is present in the data 60 | sections for that module. 61 | 62 | ## Development 63 | 64 | When opening a PR make sure to rebuild Wasm by running: 65 | 66 | ``` 67 | deno task build 68 | ``` 69 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "eszip" 3 | version = "0.106.0" 4 | authors = ["the Deno authors"] 5 | edition = "2024" 6 | repository = "https://github.com/denoland/eszip" 7 | description = "A utility that can download JavaScript and TypeScript module graphs and store them locally in a special zip file" 8 | license = "MIT" 9 | 10 | [workspace] 11 | members = ["lib"] 12 | 13 | [workspace.dependencies] 14 | deno_graph = { version = "0.105.0", default-features = false } 15 | deno_ast = { version = "0.52.0", features = ["transpiling"] } 16 | import_map = "0.24.0" 17 | serde = "1" 18 | deno_error = "0.7.0" 19 | 20 | [profile.release] 21 | codegen-units = 1 22 | lto = true 23 | opt-level = "z" 24 | 25 | [lib] 26 | name = "eszip" 27 | path = "src/lib.rs" 28 | 29 | [[example]] 30 | name = "eszip_builder" 31 | path = "src/examples/builder.rs" 32 | 33 | [[example]] 34 | name = "eszip_viewer" 35 | path = "src/examples/viewer.rs" 36 | 37 | [[bench]] 38 | name = "source_hash_function" 39 | harness = false 40 | 41 | [features] 42 | xxhash3 = ["xxhash-rust/xxh3"] 43 | sha256 = ["dep:sha2"] 44 | # backwards compatibility. Disabling sha256 will break compatibility with eszips older than v2.2 45 | default = ["sha256"] 46 | 47 | [dependencies] 48 | anyhow = "1" 49 | async-trait = "0.1.68" 50 | base64 = "0.21.0" 51 | deno_ast = { workspace = true } 52 | deno_error.workspace = true 53 | deno_graph = { workspace = true, features = ["swc"] } 54 | deno_npm = { version = "0.42.0" } 55 | deno_semver = "0.9.0" 56 | futures = "0.3.26" 57 | hashlink = "0.8.2" 58 | indexmap = "2" 59 | serde = { workspace = true } 60 | serde_json = "1" 61 | sha2 = { version = "0.10.1", optional = true } 62 | thiserror = "2" 63 | url = "2.2.2" 64 | xxhash-rust = { version = "0.8", optional = true } 65 | 66 | [dev-dependencies] 67 | import_map = { workspace = true } 68 | pretty_assertions = "1" 69 | tokio = { version = "1", features = ["macros", "rt"] } 70 | reqwest = { version = "0.11.23", features = ["rustls-tls"] } 71 | jsonc-parser = { version = "0.23.0", features = ["serde"] } 72 | insta = "1.34.0" 73 | criterion = { version = "0.5", features = ["async_tokio"] } 74 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build-rust: 6 | runs-on: ubuntu-latest 7 | env: 8 | RUST_BACKTRACE: full 9 | # https://github.com/rust-unofficial/patterns/blob/master/anti_patterns/deny-warnings.md 10 | RUSTFLAGS: -D warnings 11 | 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v5 15 | - name: Install rust 16 | uses: dsherret/rust-toolchain-file@v1 17 | - name: Clippy 18 | run: | 19 | cargo clippy --all-targets --locked --no-default-features 20 | cargo clippy --all-targets --locked 21 | cargo clippy --all-targets --locked --all-features 22 | - name: Test 23 | run: cargo test --all-features --locked 24 | 25 | build-javascript: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v5 30 | - name: Install rust 31 | uses: dsherret/rust-toolchain-file@v1 32 | - name: Install Deno 33 | uses: denoland/setup-deno@v1 34 | with: 35 | deno-version: 2.x 36 | - uses: actions/setup-node@v5 37 | with: 38 | node-version: '20.x' 39 | registry-url: 'https://registry.npmjs.org' 40 | 41 | - name: Build 42 | run: deno task build && deno task node 43 | - name: Test 44 | run: deno task test 45 | - name: Get tag version 46 | if: startsWith(github.ref, 'refs/tags/') 47 | id: get_tag_version 48 | run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> "$GITHUB_OUTPUT" 49 | - name: Publish deno.land/x 50 | uses: denoland/publish-folder@82ce065074e7174baf444332c4b7c40869a4909a 51 | if: startsWith(github.ref, 'refs/tags/') 52 | with: 53 | folder: js 54 | branch: deno_registry 55 | tag: deno/${{ steps.get_tag_version.outputs.TAG_VERSION }} 56 | token: ${{ secrets.DENOBOT_PAT }} 57 | git-user-name: denobot 58 | git-user-email: denobot@users.noreply.github.com 59 | - name: Build npm 60 | run: deno run -A ./build_npm.ts ${{ github.ref_name }} 61 | - name: Publish npm 62 | if: | 63 | github.repository == 'denoland/eszip' && 64 | startsWith(github.ref, 'refs/tags/') 65 | env: 66 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 67 | run: | 68 | cd npm/ && npm publish 69 | -------------------------------------------------------------------------------- /js/eszip_test.ts: -------------------------------------------------------------------------------- 1 | import { build, Parser } from "./mod.ts"; 2 | import { 3 | assert, 4 | assertEquals, 5 | assertRejects, 6 | } from "jsr:@std/assert@0.223"; 7 | 8 | Deno.test("roundtrip build + parse", async () => { 9 | const eszip = await build([ 10 | "https://example.com/mod.ts", 11 | "https://example.com/a.ts", 12 | "external:main.js", 13 | ], async (specifier: string) => { 14 | if (specifier === "external:main.js") { 15 | return { 16 | kind: "external", 17 | specifier, 18 | }; 19 | } 20 | 21 | if (specifier === "https://example.com/a.ts") { 22 | return { 23 | kind: "module", 24 | specifier, 25 | headers: { 26 | "content-type": "text/typescript", 27 | }, 28 | content: "export const a = 1;", 29 | }; 30 | } 31 | 32 | return { 33 | kind: "module", 34 | specifier: "https://example.com/mod.ts", 35 | headers: { 36 | "content-type": "application/typescript", 37 | }, 38 | content: `import "https://example.com/a.ts";`, 39 | }; 40 | }); 41 | 42 | assert(eszip instanceof Uint8Array); 43 | const parser = await Parser.createInstance(); 44 | const specifiers = await parser.parseBytes(eszip); 45 | assertEquals(specifiers.sort(), [ 46 | "https://example.com/a.ts", 47 | "https://example.com/mod.ts", 48 | ]); 49 | 50 | await parser.load(); 51 | const mod = await parser.getModuleSource("https://example.com/mod.ts"); 52 | assertEquals(mod, 'import "https://example.com/a.ts";\n'); 53 | const a = await parser.getModuleSource("https://example.com/a.ts"); 54 | assertEquals(a, "export const a = 1;\n"); 55 | }); 56 | 57 | Deno.test("build default loader", async () => { 58 | const eszip = await build(["https://deno.land/std@0.123.0/fs/mod.ts"]); 59 | assert(eszip instanceof Uint8Array); 60 | }); 61 | 62 | Deno.test("build with import map", async () => { 63 | const eszip = await build( 64 | ["data:application/javascript,import 'std/fs/mod.ts'"], 65 | undefined, 66 | 'data:application/json,{"imports":{"std/":"https://deno.land/std/"}}', 67 | ); 68 | assert(eszip instanceof Uint8Array); 69 | }); 70 | 71 | Deno.test("loader errors", async () => { 72 | await assertRejects( 73 | () => 74 | build( 75 | ["https://deno.land/std@0.123.0/fs/mod.ts"], 76 | (specifier: string) => Promise.reject(new Error("oops")), 77 | ), 78 | Error, 79 | "oops", 80 | ); 81 | }); 82 | -------------------------------------------------------------------------------- /src/examples/viewer.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. 2 | 3 | use futures::io::AllowStdIo; 4 | use futures::io::BufReader; 5 | use std::env; 6 | use std::fs; 7 | use std::path::PathBuf; 8 | 9 | #[tokio::main(flavor = "current_thread")] 10 | async fn main() { 11 | let args: Vec = env::args().collect(); 12 | let (eszip_path, output_dir) = match parse_args(args) { 13 | Ok(result) => result, 14 | Err(err) => { 15 | eprintln!("Error: {}", err); 16 | print_help(); 17 | return; 18 | } 19 | }; 20 | 21 | let file = std::fs::File::open(&eszip_path).unwrap(); 22 | let bufreader = BufReader::new(AllowStdIo::new(file)); 23 | let (eszip, loader) = eszip::EszipV2::parse(bufreader).await.unwrap(); 24 | 25 | let fut = async move { 26 | for (specifier, module) in eszip { 27 | if module.specifier == specifier { 28 | // skip extracting data specifiers. 29 | if specifier.starts_with("data:") { 30 | continue; 31 | } 32 | let source = module.source().await.expect("source already taken"); 33 | let source = std::str::from_utf8(&source).unwrap(); 34 | 35 | if let Some(ref output_dir) = output_dir { 36 | let specifier = specifier 37 | .trim_start_matches("file:///") 38 | .trim_start_matches("http://") 39 | .trim_start_matches("https://"); 40 | let file_path = output_dir.join( 41 | PathBuf::from(&specifier) 42 | .strip_prefix("/") 43 | .unwrap_or(&PathBuf::from(&specifier)), 44 | ); 45 | if let Some(parent) = file_path.parent() { 46 | fs::create_dir_all(parent).expect("Failed to create directory"); 47 | } 48 | fs::write(&file_path, source).expect("Failed to write file"); 49 | println!("Extracted {}", file_path.display()); 50 | } else { 51 | println!("Specifier: {specifier}",); 52 | println!("Kind: {kind:?}", kind = module.kind); 53 | println!("---"); 54 | println!("{source}"); 55 | 56 | let source_map = module.source_map().await; 57 | if let Some(source_map) = source_map { 58 | let source_map = std::str::from_utf8(&source_map).unwrap(); 59 | println!("---"); 60 | println!("{source_map}"); 61 | } 62 | 63 | println!("============"); 64 | } 65 | } 66 | } 67 | 68 | Ok(()) 69 | }; 70 | 71 | tokio::try_join!(loader, fut).unwrap(); 72 | } 73 | 74 | fn print_help() { 75 | println!("Usage:"); 76 | println!(" viewer "); 77 | println!(" viewer --output "); 78 | println!(" viewer -o "); 79 | } 80 | 81 | fn parse_args(args: Vec) -> Result<(PathBuf, Option), String> { 82 | let mut output_dir = None; 83 | let mut eszip_path = None; 84 | let mut args_iter = args.into_iter().skip(1); 85 | while let Some(arg) = args_iter.next() { 86 | match arg.as_str() { 87 | "--output" | "-o" => { 88 | output_dir = Some(PathBuf::from( 89 | args_iter.next().ok_or("Missing output directory")?, 90 | )); 91 | } 92 | _ if eszip_path.is_none() => { 93 | eszip_path = Some(PathBuf::from(arg)); 94 | } 95 | _ => return Err(format!("Unknown argument: {}", arg)), 96 | } 97 | } 98 | let eszip_path = eszip_path.ok_or("Missing eszip path")?; 99 | Ok((eszip_path, output_dir)) 100 | } 101 | -------------------------------------------------------------------------------- /js/examples/chainloading/bundler.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S deno run --allow-read --allow-write --allow-net --no-check 2 | import { load } from "../../loader.ts"; 3 | import { build, LoadResponse } from "../../mod.ts"; 4 | // import { load } from "https://deno.land/x/eszip@v0.18.0/loader.ts"; 5 | // import { build, LoadResponse } from "https://deno.land/x/eszip@v0.18.0/mod.ts"; 6 | 7 | import * as path from "https://deno.land/std@0.127.0/path/mod.ts"; 8 | 9 | const STAGE1_SPECIFIER = "acme:stage1"; 10 | const STAGE2_SPECIFIER = "acme:stage2"; 11 | 12 | function stage1() { 13 | return ` 14 | import * as stage2 from "${STAGE2_SPECIFIER}"; 15 | import { serve } from "https://deno.land/std@0.127.0/http/server.ts"; 16 | 17 | await serve(async (req) => { 18 | const url = new URL(req.url); 19 | const handler = stage2.config.urls[url.pathname]; 20 | const handlerFn = stage2.handlers[handler]; 21 | return handlerFn ? await handlerFn(req) : new Response("DEFAULT"); 22 | }); 23 | `; 24 | } 25 | 26 | function inlineTsMod(specifier: string, content: string): LoadResponse { 27 | return { 28 | content, 29 | headers: { 30 | "content-type": "application/typescript", 31 | }, 32 | kind: "module", 33 | specifier, 34 | }; 35 | } 36 | 37 | function stage1Loader() { 38 | return (specifier: string): Promise => { 39 | if (specifier === STAGE1_SPECIFIER) { 40 | // Load stage 1 wrapper from net/disk or codegenerated in-memory 41 | return Promise.resolve(inlineTsMod(specifier, stage1())); 42 | } else if (specifier === STAGE2_SPECIFIER) { 43 | // Dangling reference to stage2 44 | return Promise.resolve({ kind: "external", specifier }); 45 | } 46 | // Falling back to the default loading logic. 47 | return load(specifier); 48 | }; 49 | } 50 | 51 | interface Stage2Config { 52 | paths: Record; // handler_name => entrypoint_path (absolute) 53 | urls: Record; // url => handler_name mapping 54 | localSrcRoot: string; 55 | } 56 | 57 | function stage2(conf: Stage2Config) { 58 | const handlerNames = Object.keys(conf.paths); 59 | const handlerImports = handlerNames.map((name) => { 60 | return `import ${name} from "${nsSpec(conf, name)}";`; 61 | }).join("\n"); 62 | return ` 63 | ${handlerImports} 64 | export const handlers = { ${handlerNames.join(", ")} }; 65 | export const config = ${JSON.stringify(conf)}; 66 | `; 67 | } 68 | 69 | /// Namespaced specifier, file:///src/... (relative to root) 70 | function nsSpec(conf: Stage2Config, name: string) { 71 | const filepath = conf.paths[name]; 72 | const rel = path.relative(conf.localSrcRoot, filepath); 73 | return path.toFileUrl(path.join("/src", rel)); 74 | } 75 | 76 | function stage2Loader(conf: Stage2Config) { 77 | return async (specifier: string): Promise => { 78 | if (specifier === STAGE2_SPECIFIER) { 79 | // Codegen stage2 from config to include handler specifics 80 | return inlineTsMod(specifier, stage2(conf)); 81 | } else if (specifier.startsWith("file:///src/")) { 82 | // Local specifier (handler entrypoint or relative import) 83 | const localRoot = path.toFileUrl(conf.localSrcRoot).toString(); 84 | const trueSpec = specifier.replace("file:///src", localRoot); 85 | const resp = await load(trueSpec); 86 | return resp && { 87 | ...resp, 88 | specifier, // preserve original spec 89 | }; 90 | } 91 | // Falling back to the default loading logic. 92 | return await load(specifier); 93 | }; 94 | } 95 | 96 | function unifiedLoader(conf: Stage2Config) { 97 | const s2Loader = stage2Loader(conf); 98 | return (specifier: string): Promise => { 99 | if (specifier === STAGE1_SPECIFIER) { 100 | return Promise.resolve(inlineTsMod(specifier, stage1())); 101 | } 102 | return s2Loader(specifier); 103 | }; 104 | } 105 | 106 | async function main(allArgs: string[]) { 107 | // Specifics of how you obtain the list of handlers is up to you 108 | // e.g: conf/project files, FS walking, etc... 109 | const cwd = Deno.cwd(); 110 | const stage2Config: Stage2Config = { 111 | paths: { 112 | foo: path.join(cwd, "handlers", "foo.ts"), 113 | bar: path.join(cwd, "handlers", "bar", "index.ts"), 114 | }, 115 | urls: { 116 | "/foo": "foo", 117 | "/kungfu": "foo", 118 | "/bar": "bar", 119 | "/drink": "bar", 120 | }, 121 | localSrcRoot: cwd, 122 | }; 123 | 124 | const [cmd, ...args] = allArgs; 125 | switch (cmd) { 126 | // Produces an ESZIP with only stage1 127 | case "stage1": { 128 | const [destPath] = args; 129 | const bytes = await build([STAGE1_SPECIFIER], stage1Loader()); 130 | return await Deno.writeFile(destPath, bytes); 131 | } 132 | // Produces an ESZIP with only stage2 133 | case "stage2": { 134 | const [destPath] = args; 135 | const bytes = await build([STAGE2_SPECIFIER], stage2Loader(stage2Config)); 136 | return await Deno.writeFile(destPath, bytes); 137 | } 138 | // Produces an ESZIP with stage1 & stage2 139 | case "unified": { 140 | const [destPath] = args; 141 | const bytes = await build( 142 | [STAGE1_SPECIFIER], 143 | unifiedLoader(stage2Config), 144 | ); 145 | return await Deno.writeFile(destPath, bytes); 146 | } 147 | } 148 | } 149 | await main(Deno.args); 150 | -------------------------------------------------------------------------------- /js/eszip.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S deno run --allow-run=deno --allow-read --allow-write --allow-net=deno.land --no-check 2 | 3 | // CLI utility to build/list/extract/run ESZIPs 4 | 5 | import { build, Parser } from "./mod.ts"; 6 | import { dirname, join } from "jsr:@std/path@1"; 7 | import { assertStrictEquals } from "jsr:@std/assert@1"; 8 | 9 | function hasV2Header(bytes: Uint8Array) { 10 | const magicV2 = new TextDecoder().decode(bytes.slice(0, 8)); 11 | return magicV2 === "ESZIP_V2"; 12 | } 13 | 14 | interface ESZIP { 15 | extract(dest: string): Promise; 16 | list(): string[]; 17 | } 18 | 19 | interface V1Entry { 20 | Source: { 21 | source: string; 22 | transpiled: string; 23 | }; 24 | } 25 | 26 | class V1 { 27 | inner: Record; 28 | 29 | constructor(bytes: Uint8Array) { 30 | const json = new TextDecoder().decode(bytes); 31 | const eszip = JSON.parse(json); 32 | assertStrictEquals(eszip.version, 1); 33 | this.inner = eszip; 34 | } 35 | 36 | static load(bytes: Uint8Array) { 37 | return Promise.resolve(new V1(bytes)); 38 | } 39 | 40 | *entries() { 41 | for ( 42 | const [ 43 | url, 44 | { 45 | Source: { source, transpiled }, 46 | }, 47 | ] of Object.entries(this.inner.modules) 48 | ) { 49 | yield { url, source, transpiled }; 50 | } 51 | } 52 | 53 | async extract(dest: string) { 54 | for (const { url, source, transpiled } of this.entries()) { 55 | await write(join(dest, "source", url2path(url)), source); 56 | await write( 57 | join(dest, "transpiled", url2path(url)), 58 | transpiled ?? source, 59 | ); 60 | } 61 | } 62 | 63 | list() { 64 | return Array.from(this.entries()).map((e) => e.url); 65 | } 66 | } 67 | 68 | class V2 { 69 | parser: Parser; 70 | specifiers: string[]; 71 | 72 | constructor(parser: Parser, specifiers: string[]) { 73 | this.parser = parser; 74 | this.specifiers = specifiers; 75 | } 76 | 77 | static async load(bytes: Uint8Array) { 78 | const parser = await Parser.createInstance(); 79 | const specifiers = await parser.parseBytes(bytes); 80 | await parser.load(); 81 | return new V2(parser, specifiers as string[]); 82 | } 83 | 84 | async extract(dest: string) { 85 | const imports: Record = {}; 86 | 87 | for (const specifier of this.specifiers) { 88 | const module = await this.parser.getModuleSource(specifier); 89 | await write(join(dest, "source", url2path(specifier)), module); 90 | // Track import 91 | imports[specifier] = `./${url2path(specifier)}`; 92 | } 93 | // Write import map 94 | const importMap = JSON.stringify({ imports }, null, 2); 95 | await Deno.writeTextFile( 96 | join(dest, "source", "import_map.json"), 97 | importMap, 98 | ); 99 | } 100 | 101 | list() { 102 | return this.specifiers; 103 | } 104 | } 105 | 106 | async function loadESZIP(filename: string): Promise { 107 | const bytes = await Deno.readFile(filename); 108 | if (hasV2Header(bytes)) { 109 | console.log("Loading eszip v2"); 110 | return await V2.load(bytes); 111 | } 112 | console.log("Loading eszip v1"); 113 | return await V1.load(bytes); 114 | } 115 | 116 | function url2path(url: string) { 117 | return join(...(new URL(url).pathname.split("/").filter(Boolean))); 118 | } 119 | 120 | async function write(path: string, content: string) { 121 | await Deno.mkdir(dirname(path), { recursive: true }); 122 | await Deno.writeTextFile(path, content); 123 | } 124 | 125 | async function run(eszip: ESZIP, specifier: string) { 126 | // Extract to tmp directory 127 | const tmpDir = await Deno.makeTempDir({ prefix: "esz" }); 128 | try { 129 | // Extract 130 | await eszip.extract(tmpDir); 131 | const importMap = join(tmpDir, "source", "import_map.json"); 132 | // Run 133 | const p = new Deno.Command("deno", { 134 | args: [ 135 | "run", 136 | "-A", 137 | "--no-check", 138 | "--import-map", 139 | importMap, 140 | specifier, 141 | ], 142 | }); 143 | await p.output(); 144 | } finally { 145 | // Cleanup 146 | await Deno.remove(tmpDir, { recursive: true }); 147 | } 148 | } 149 | 150 | // Main 151 | async function main() { 152 | const args = Deno.args; 153 | const [subcmd, filename, ...rest] = args; 154 | 155 | if (subcmd === "help") { 156 | return console.log("TODO"); 157 | } 158 | 159 | switch (subcmd) { 160 | case "build": 161 | case "b": { 162 | const eszip = await build([filename]); 163 | let out = rest[0]; 164 | if (!out) { 165 | // Create outfile name from url filename 166 | out = new URL(filename).pathname.split("/").pop() || "out"; 167 | } 168 | console.log(`${out}.eszip: ${eszip.length} bytes`); 169 | await Deno.writeFile(`${out}.eszip`, eszip); 170 | return; 171 | } 172 | case "x": 173 | case "extract": { 174 | const eszip = await loadESZIP(filename); 175 | return await eszip.extract(rest[0] ?? Deno.cwd()); 176 | } 177 | case "l": 178 | case "ls": 179 | case "list": { 180 | const eszip = await loadESZIP(filename); 181 | return console.log(eszip.list().join("\n")); 182 | } 183 | case "r": 184 | case "run": { 185 | const eszip = await loadESZIP(filename); 186 | const specifier = rest[0]; 187 | if (!specifier) { 188 | return console.error("Please provide a specifier to run"); 189 | } 190 | return await run(eszip, specifier); 191 | } 192 | } 193 | } 194 | 195 | await main(); 196 | -------------------------------------------------------------------------------- /benches/source_hash_function.rs: -------------------------------------------------------------------------------- 1 | use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main}; 2 | use deno_ast::{EmitOptions, TranspileOptions}; 3 | use deno_graph::{ 4 | BuildOptions, GraphKind, ModuleGraph, ModuleSpecifier, 5 | ast::CapturingModuleAnalyzer, 6 | source::{MemoryLoader, Source}, 7 | }; 8 | use eszip::{EszipV2, v2::Checksum}; 9 | use futures::io::{AllowStdIo, BufReader}; 10 | 11 | #[cfg(feature = "sha256")] 12 | fn into_bytes_sha256(mut eszip: EszipV2) -> Vec { 13 | eszip.set_checksum(Checksum::Sha256); 14 | eszip.into_bytes() 15 | } 16 | 17 | #[cfg(feature = "xxhash3")] 18 | fn into_bytes_xxhash3(mut eszip: EszipV2) -> Vec { 19 | eszip.set_checksum(Checksum::XxHash3); 20 | eszip.into_bytes() 21 | } 22 | 23 | fn into_bytes_no_checksum(mut eszip: EszipV2) -> Vec { 24 | eszip.set_checksum(Checksum::NoChecksum); 25 | eszip.into_bytes() 26 | } 27 | 28 | async fn parse(bytes: &[u8]) -> EszipV2 { 29 | let (eszip, fut) = EszipV2::parse(BufReader::new(AllowStdIo::new(bytes))) 30 | .await 31 | .unwrap(); 32 | fut.await.unwrap(); 33 | eszip 34 | } 35 | 36 | fn bench_into_bytes(c: &mut Criterion) { 37 | let mut group = c.benchmark_group("into_bytes()"); 38 | group.sample_size(10); 39 | for mb in (1..200).step_by(20) { 40 | group.throughput(criterion::Throughput::Bytes((mb as u64) << 20)); 41 | #[cfg(feature = "sha256")] 42 | group.bench_with_input( 43 | BenchmarkId::new("SHA256", format!("{mb}MB")), 44 | &mb, 45 | |b, mb| { 46 | b.iter_batched( 47 | || { 48 | let rt = tokio::runtime::Builder::new_current_thread() 49 | .build() 50 | .unwrap(); 51 | rt.block_on(build_eszip(*mb)) 52 | }, 53 | into_bytes_sha256, 54 | criterion::BatchSize::SmallInput, 55 | ) 56 | }, 57 | ); 58 | #[cfg(feature = "xxhash3")] 59 | group.bench_with_input( 60 | BenchmarkId::new("XXHASH3", format!("{mb}MB")), 61 | &mb, 62 | |b, mb| { 63 | b.iter_batched( 64 | || { 65 | let rt = tokio::runtime::Builder::new_current_thread() 66 | .build() 67 | .unwrap(); 68 | rt.block_on(build_eszip(*mb)) 69 | }, 70 | into_bytes_xxhash3, 71 | criterion::BatchSize::SmallInput, 72 | ) 73 | }, 74 | ); 75 | group.bench_with_input( 76 | BenchmarkId::new("NO-CHECkSUM", format!("{mb}MB")), 77 | &mb, 78 | |b, mb| { 79 | b.iter_batched( 80 | || { 81 | let rt = tokio::runtime::Builder::new_current_thread() 82 | .build() 83 | .unwrap(); 84 | rt.block_on(build_eszip(*mb)) 85 | }, 86 | into_bytes_no_checksum, 87 | criterion::BatchSize::SmallInput, 88 | ) 89 | }, 90 | ); 91 | } 92 | group.finish(); 93 | } 94 | 95 | fn bench_parse(c: &mut Criterion) { 96 | let mut group = c.benchmark_group("parse()"); 97 | group.sample_size(10); 98 | for mb in (1..200).step_by(20) { 99 | group.throughput(criterion::Throughput::Bytes((mb as u64) << 20)); 100 | let rt = tokio::runtime::Builder::new_current_thread() 101 | .build() 102 | .unwrap(); 103 | 104 | #[cfg(feature = "sha256")] 105 | { 106 | let mut eszip = rt.block_on(build_eszip(mb)); 107 | eszip.set_checksum(Checksum::Sha256); 108 | let bytes = eszip.into_bytes(); 109 | group.bench_with_input( 110 | BenchmarkId::new("SHA256", format!("{mb}MB")), 111 | &bytes, 112 | |b, bytes| b.to_async(&rt).iter(|| parse(bytes)), 113 | ); 114 | } 115 | #[cfg(feature = "xxhash3")] 116 | { 117 | let mut eszip = rt.block_on(build_eszip(mb)); 118 | eszip.set_checksum(Checksum::XxHash3); 119 | let bytes = eszip.into_bytes(); 120 | group.bench_with_input( 121 | BenchmarkId::new("XXHASH3", format!("{mb}MB")), 122 | &bytes, 123 | |b, bytes| b.to_async(&rt).iter(|| parse(bytes)), 124 | ); 125 | } 126 | let mut eszip = rt.block_on(build_eszip(mb)); 127 | eszip.set_checksum(Checksum::NoChecksum); 128 | let bytes = eszip.into_bytes(); 129 | group.bench_with_input( 130 | BenchmarkId::new("NO-CHECKSUM", format!("{mb}MB")), 131 | &bytes, 132 | |b, bytes| b.to_async(&rt).iter(|| parse(bytes)), 133 | ); 134 | } 135 | group.finish(); 136 | } 137 | 138 | criterion_group!(benches, bench_into_bytes, bench_parse); 139 | criterion_main!(benches); 140 | 141 | async fn build_eszip(mb: usize) -> EszipV2 { 142 | let roots = vec![ModuleSpecifier::parse("file:///module1.js").unwrap()]; 143 | let analyzer = CapturingModuleAnalyzer::default(); 144 | let mut graph = ModuleGraph::new(GraphKind::CodeOnly); 145 | let mut sources = vec![( 146 | String::from("file:///module1.js"), 147 | Source::Module { 148 | specifier: String::from("file:///module1.js"), 149 | maybe_headers: None, 150 | content: (2..=mb) 151 | .map(|x| format!(r#"import "./module{x}.js";"#)) 152 | .chain([build_comment_module(1)]) 153 | .collect::>() 154 | .join("\n"), 155 | }, 156 | )]; 157 | for x in 2..=mb { 158 | let specifier = format!("file:///module{x}.js"); 159 | sources.push(( 160 | specifier.clone(), 161 | Source::Module { 162 | specifier, 163 | maybe_headers: None, 164 | content: build_comment_module(1), 165 | }, 166 | )) 167 | } 168 | let loader = MemoryLoader::new(sources, Vec::new()); 169 | graph 170 | .build( 171 | roots, 172 | Vec::new(), 173 | &loader, 174 | BuildOptions { 175 | module_analyzer: &analyzer, 176 | ..Default::default() 177 | }, 178 | ) 179 | .await; 180 | graph.valid().unwrap(); 181 | EszipV2::from_graph(eszip::FromGraphOptions { 182 | graph, 183 | module_kind_resolver: Default::default(), 184 | parser: analyzer.as_capturing_parser(), 185 | transpile_options: TranspileOptions::default(), 186 | emit_options: EmitOptions::default(), 187 | relative_file_base: None, 188 | npm_packages: None, 189 | npm_snapshot: Default::default(), 190 | }) 191 | .unwrap() 192 | } 193 | 194 | fn build_comment_module(mb: usize) -> String { 195 | format!("// {}", "a".repeat(mb << 20)) 196 | } 197 | -------------------------------------------------------------------------------- /src/snapshots/eszip__v2__tests__npm_empty_snapshot.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/v2.rs 3 | expression: bytes 4 | --- 5 | [ 6 | 69, 7 | 83, 8 | 90, 9 | 73, 10 | 80, 11 | 50, 12 | 46, 13 | 51, 14 | 0, 15 | 0, 16 | 0, 17 | 4, 18 | 0, 19 | 0, 20 | 1, 21 | 0, 22 | 0, 23 | 0, 24 | 0, 25 | 104, 26 | 0, 27 | 0, 28 | 0, 29 | 15, 30 | 102, 31 | 105, 32 | 108, 33 | 101, 34 | 58, 35 | 47, 36 | 47, 37 | 47, 38 | 109, 39 | 97, 40 | 105, 41 | 110, 42 | 46, 43 | 116, 44 | 115, 45 | 0, 46 | 0, 47 | 0, 48 | 0, 49 | 0, 50 | 0, 51 | 0, 52 | 0, 53 | 29, 54 | 0, 55 | 0, 56 | 0, 57 | 0, 58 | 0, 59 | 0, 60 | 0, 61 | 151, 62 | 0, 63 | 0, 64 | 0, 65 | 0, 66 | 12, 67 | 102, 68 | 105, 69 | 108, 70 | 101, 71 | 58, 72 | 47, 73 | 47, 74 | 47, 75 | 98, 76 | 46, 77 | 116, 78 | 115, 79 | 0, 80 | 0, 81 | 0, 82 | 0, 83 | 29, 84 | 0, 85 | 0, 86 | 0, 87 | 22, 88 | 0, 89 | 0, 90 | 0, 91 | 151, 92 | 0, 93 | 0, 94 | 0, 95 | 136, 96 | 0, 97 | 0, 98 | 0, 99 | 0, 100 | 12, 101 | 102, 102 | 105, 103 | 108, 104 | 101, 105 | 58, 106 | 47, 107 | 47, 108 | 47, 109 | 97, 110 | 46, 111 | 116, 112 | 115, 113 | 1, 114 | 0, 115 | 0, 116 | 0, 117 | 12, 118 | 102, 119 | 105, 120 | 108, 121 | 101, 122 | 58, 123 | 47, 124 | 47, 125 | 47, 126 | 98, 127 | 46, 128 | 116, 129 | 115, 130 | 0, 131 | 0, 132 | 0, 133 | 0, 134 | 0, 135 | 0, 136 | 0, 137 | 51, 138 | 101, 139 | 120, 140 | 112, 141 | 111, 142 | 114, 143 | 116, 144 | 32, 145 | 42, 146 | 32, 147 | 97, 148 | 115, 149 | 32, 150 | 97, 151 | 32, 152 | 102, 153 | 114, 154 | 111, 155 | 109, 156 | 32, 157 | 34, 158 | 46, 159 | 47, 160 | 97, 161 | 46, 162 | 116, 163 | 115, 164 | 34, 165 | 59, 166 | 10, 167 | 101, 168 | 120, 169 | 112, 170 | 111, 171 | 114, 172 | 116, 173 | 32, 174 | 99, 175 | 111, 176 | 110, 177 | 115, 178 | 116, 179 | 32, 180 | 98, 181 | 32, 182 | 61, 183 | 32, 184 | 34, 185 | 98, 186 | 34, 187 | 59, 188 | 10, 189 | 0, 190 | 0, 191 | 1, 192 | 31, 193 | 123, 194 | 34, 195 | 118, 196 | 101, 197 | 114, 198 | 115, 199 | 105, 200 | 111, 201 | 110, 202 | 34, 203 | 58, 204 | 51, 205 | 44, 206 | 34, 207 | 115, 208 | 111, 209 | 117, 210 | 114, 211 | 99, 212 | 101, 213 | 115, 214 | 34, 215 | 58, 216 | 91, 217 | 34, 218 | 102, 219 | 105, 220 | 108, 221 | 101, 222 | 58, 223 | 47, 224 | 47, 225 | 47, 226 | 109, 227 | 97, 228 | 105, 229 | 110, 230 | 46, 231 | 116, 232 | 115, 233 | 34, 234 | 93, 235 | 44, 236 | 34, 237 | 115, 238 | 111, 239 | 117, 240 | 114, 241 | 99, 242 | 101, 243 | 115, 244 | 67, 245 | 111, 246 | 110, 247 | 116, 248 | 101, 249 | 110, 250 | 116, 251 | 34, 252 | 58, 253 | 91, 254 | 34, 255 | 101, 256 | 120, 257 | 112, 258 | 111, 259 | 114, 260 | 116, 261 | 32, 262 | 42, 263 | 32, 264 | 97, 265 | 115, 266 | 32, 267 | 97, 268 | 32, 269 | 102, 270 | 114, 271 | 111, 272 | 109, 273 | 32, 274 | 92, 275 | 34, 276 | 46, 277 | 47, 278 | 97, 279 | 46, 280 | 116, 281 | 115, 282 | 92, 283 | 34, 284 | 59, 285 | 92, 286 | 110, 287 | 34, 288 | 93, 289 | 44, 290 | 34, 291 | 110, 292 | 97, 293 | 109, 294 | 101, 295 | 115, 296 | 34, 297 | 58, 298 | 91, 299 | 93, 300 | 44, 301 | 34, 302 | 109, 303 | 97, 304 | 112, 305 | 112, 306 | 105, 307 | 110, 308 | 103, 309 | 115, 310 | 34, 311 | 58, 312 | 34, 313 | 65, 314 | 65, 315 | 65, 316 | 65, 317 | 44, 318 | 79, 319 | 65, 320 | 65, 321 | 79, 322 | 44, 323 | 75, 324 | 65, 325 | 65, 326 | 75, 327 | 44, 328 | 67, 329 | 65, 330 | 65, 331 | 67, 332 | 44, 333 | 77, 334 | 65, 335 | 65, 336 | 77, 337 | 44, 338 | 83, 339 | 65, 340 | 65, 341 | 83, 342 | 34, 343 | 125, 344 | 123, 345 | 34, 346 | 118, 347 | 101, 348 | 114, 349 | 115, 350 | 105, 351 | 111, 352 | 110, 353 | 34, 354 | 58, 355 | 51, 356 | 44, 357 | 34, 358 | 115, 359 | 111, 360 | 117, 361 | 114, 362 | 99, 363 | 101, 364 | 115, 365 | 34, 366 | 58, 367 | 91, 368 | 34, 369 | 102, 370 | 105, 371 | 108, 372 | 101, 373 | 58, 374 | 47, 375 | 47, 376 | 47, 377 | 98, 378 | 46, 379 | 116, 380 | 115, 381 | 34, 382 | 93, 383 | 44, 384 | 34, 385 | 115, 386 | 111, 387 | 117, 388 | 114, 389 | 99, 390 | 101, 391 | 115, 392 | 67, 393 | 111, 394 | 110, 395 | 116, 396 | 101, 397 | 110, 398 | 116, 399 | 34, 400 | 58, 401 | 91, 402 | 34, 403 | 101, 404 | 120, 405 | 112, 406 | 111, 407 | 114, 408 | 116, 409 | 32, 410 | 99, 411 | 111, 412 | 110, 413 | 115, 414 | 116, 415 | 32, 416 | 98, 417 | 32, 418 | 61, 419 | 32, 420 | 92, 421 | 34, 422 | 98, 423 | 92, 424 | 34, 425 | 59, 426 | 92, 427 | 110, 428 | 34, 429 | 93, 430 | 44, 431 | 34, 432 | 110, 433 | 97, 434 | 109, 435 | 101, 436 | 115, 437 | 34, 438 | 58, 439 | 91, 440 | 93, 441 | 44, 442 | 34, 443 | 109, 444 | 97, 445 | 112, 446 | 112, 447 | 105, 448 | 110, 449 | 103, 450 | 115, 451 | 34, 452 | 58, 453 | 34, 454 | 65, 455 | 65, 456 | 65, 457 | 65, 458 | 44, 459 | 79, 460 | 65, 461 | 65, 462 | 79, 463 | 44, 464 | 77, 465 | 65, 466 | 65, 467 | 77, 468 | 44, 469 | 73, 470 | 65, 471 | 65, 472 | 73, 473 | 44, 474 | 73, 475 | 65, 476 | 65, 477 | 73, 478 | 34, 479 | 125, 480 | ] 481 | -------------------------------------------------------------------------------- /src/examples/builder.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. 2 | 3 | use std::collections::HashMap; 4 | use std::sync::Arc; 5 | 6 | use deno_ast::EmitOptions; 7 | use deno_ast::TranspileOptions; 8 | use deno_error::JsErrorBox; 9 | use deno_graph::BuildOptions; 10 | use deno_graph::GraphKind; 11 | use deno_graph::ModuleGraph; 12 | use deno_graph::ast::CapturingModuleAnalyzer; 13 | use deno_graph::source::CacheSetting; 14 | use deno_graph::source::ResolveError; 15 | use import_map::ImportMap; 16 | use reqwest::StatusCode; 17 | use url::Url; 18 | 19 | #[tokio::main(flavor = "current_thread")] 20 | async fn main() { 21 | let args = std::env::args().collect::>(); 22 | let url = args.get(1).unwrap(); 23 | let url = Url::parse(url).unwrap(); 24 | let out = args.get(2).unwrap(); 25 | let maybe_import_map = args.get(3).map(|url| Url::parse(url).unwrap()); 26 | 27 | let loader = Loader; 28 | let (maybe_import_map, maybe_import_map_data) = 29 | if let Some(import_map_url) = maybe_import_map { 30 | let resp = deno_graph::source::Loader::load( 31 | &loader, 32 | &import_map_url, 33 | deno_graph::source::LoadOptions { 34 | in_dynamic_branch: false, 35 | was_dynamic_root: false, 36 | cache_setting: CacheSetting::Use, 37 | maybe_checksum: None, 38 | }, 39 | ) 40 | .await 41 | .unwrap() 42 | .unwrap(); 43 | match resp { 44 | deno_graph::source::LoadResponse::Module { 45 | specifier, content, .. 46 | } => { 47 | let content = String::from_utf8(content.to_vec()).unwrap(); 48 | let import_map = 49 | import_map::parse_from_json(specifier.clone(), &content).unwrap(); 50 | (Some(import_map.import_map), Some((specifier, content))) 51 | } 52 | _ => unimplemented!(), 53 | } 54 | } else { 55 | (None, None) 56 | }; 57 | 58 | let analyzer = CapturingModuleAnalyzer::default(); 59 | 60 | let mut graph = ModuleGraph::new(GraphKind::CodeOnly); 61 | graph 62 | .build( 63 | vec![url], 64 | Vec::new(), 65 | &loader, 66 | BuildOptions { 67 | resolver: Some(&Resolver(maybe_import_map)), 68 | module_analyzer: &analyzer, 69 | ..Default::default() 70 | }, 71 | ) 72 | .await; 73 | 74 | graph.valid().unwrap(); 75 | 76 | let mut eszip = eszip::EszipV2::from_graph(eszip::FromGraphOptions { 77 | graph, 78 | parser: analyzer.as_capturing_parser(), 79 | module_kind_resolver: Default::default(), 80 | transpile_options: TranspileOptions::default(), 81 | emit_options: EmitOptions::default(), 82 | relative_file_base: None, 83 | npm_packages: None, 84 | npm_snapshot: Default::default(), 85 | }) 86 | .unwrap(); 87 | if let Some((import_map_specifier, import_map_content)) = 88 | maybe_import_map_data 89 | { 90 | eszip.add_import_map( 91 | eszip::ModuleKind::Json, 92 | import_map_specifier.to_string(), 93 | Arc::from(import_map_content.into_bytes()), 94 | ) 95 | } 96 | for specifier in eszip.specifiers() { 97 | println!("source: {specifier}") 98 | } 99 | 100 | let bytes = eszip.into_bytes(); 101 | 102 | std::fs::write(out, bytes).unwrap(); 103 | } 104 | 105 | #[derive(Debug)] 106 | struct Resolver(Option); 107 | 108 | impl deno_graph::source::Resolver for Resolver { 109 | fn resolve( 110 | &self, 111 | specifier: &str, 112 | referrer_range: &deno_graph::Range, 113 | _kind: deno_graph::source::ResolutionKind, 114 | ) -> Result { 115 | if let Some(import_map) = &self.0 { 116 | import_map 117 | .resolve(specifier, &referrer_range.specifier) 118 | .map_err(ResolveError::ImportMap) 119 | } else { 120 | Ok(deno_graph::resolve_import( 121 | specifier, 122 | &referrer_range.specifier, 123 | )?) 124 | } 125 | } 126 | } 127 | 128 | struct Loader; 129 | 130 | impl deno_graph::source::Loader for Loader { 131 | fn load( 132 | &self, 133 | specifier: &deno_graph::ModuleSpecifier, 134 | _options: deno_graph::source::LoadOptions, 135 | ) -> deno_graph::source::LoadFuture { 136 | let specifier = specifier.clone(); 137 | 138 | Box::pin(async move { 139 | match specifier.scheme() { 140 | "data" => { 141 | deno_graph::source::load_data_url(&specifier).map_err(|err| { 142 | deno_graph::source::LoadError::Other(Arc::new( 143 | JsErrorBox::from_err(err), 144 | )) 145 | }) 146 | } 147 | "file" => { 148 | let path = std::fs::canonicalize(specifier.to_file_path().unwrap()) 149 | .map_err(|err| { 150 | deno_graph::source::LoadError::Other(Arc::new( 151 | JsErrorBox::from_err(err), 152 | )) 153 | })?; 154 | let content = std::fs::read(&path).map_err(|err| { 155 | deno_graph::source::LoadError::Other(Arc::new( 156 | JsErrorBox::from_err(err), 157 | )) 158 | })?; 159 | Ok(Some(deno_graph::source::LoadResponse::Module { 160 | specifier: Url::from_file_path(&path).unwrap(), 161 | maybe_headers: None, 162 | mtime: None, 163 | content: Arc::from(content), 164 | })) 165 | } 166 | "http" | "https" => { 167 | let resp = reqwest::get(specifier.as_str()).await.map_err(|err| { 168 | deno_graph::source::LoadError::Other(Arc::new(JsErrorBox::generic( 169 | err.to_string(), 170 | ))) 171 | })?; 172 | if resp.status() == StatusCode::NOT_FOUND { 173 | Ok(None) 174 | } else { 175 | let resp = resp.error_for_status().map_err(|err| { 176 | deno_graph::source::LoadError::Other(Arc::new( 177 | JsErrorBox::generic(err.to_string()), 178 | )) 179 | })?; 180 | let mut headers = HashMap::new(); 181 | for key in resp.headers().keys() { 182 | let key_str = key.to_string(); 183 | let values = resp.headers().get_all(key); 184 | let values_str = values 185 | .iter() 186 | .filter_map(|e| e.to_str().ok()) 187 | .collect::>() 188 | .join(","); 189 | headers.insert(key_str, values_str); 190 | } 191 | let url = resp.url().clone(); 192 | let content = resp.bytes().await.map_err(|err| { 193 | deno_graph::source::LoadError::Other(Arc::new( 194 | JsErrorBox::generic(err.to_string()), 195 | )) 196 | })?; 197 | Ok(Some(deno_graph::source::LoadResponse::Module { 198 | specifier: url, 199 | mtime: None, 200 | maybe_headers: Some(headers), 201 | content: Arc::from(content.as_ref()), 202 | })) 203 | } 204 | } 205 | _ => { 206 | let err: Arc = 207 | Arc::new(JsErrorBox::generic(format!( 208 | "unsupported scheme: {}", 209 | specifier.scheme() 210 | ))); 211 | Err(deno_graph::source::LoadError::Other(err)) 212 | } 213 | } 214 | }) 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /src/snapshots/eszip__v2__tests__npm_packages.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/v2.rs 3 | expression: bytes 4 | --- 5 | [ 6 | 69, 7 | 83, 8 | 90, 9 | 73, 10 | 80, 11 | 50, 12 | 46, 13 | 51, 14 | 0, 15 | 0, 16 | 0, 17 | 4, 18 | 0, 19 | 0, 20 | 1, 21 | 0, 22 | 0, 23 | 0, 24 | 0, 25 | 156, 26 | 0, 27 | 0, 28 | 0, 29 | 15, 30 | 102, 31 | 105, 32 | 108, 33 | 101, 34 | 58, 35 | 47, 36 | 47, 37 | 47, 38 | 109, 39 | 97, 40 | 105, 41 | 110, 42 | 46, 43 | 116, 44 | 115, 45 | 0, 46 | 0, 47 | 0, 48 | 0, 49 | 0, 50 | 0, 51 | 0, 52 | 0, 53 | 29, 54 | 0, 55 | 0, 56 | 0, 57 | 0, 58 | 0, 59 | 0, 60 | 0, 61 | 151, 62 | 0, 63 | 0, 64 | 0, 65 | 0, 66 | 12, 67 | 102, 68 | 105, 69 | 108, 70 | 101, 71 | 58, 72 | 47, 73 | 47, 74 | 47, 75 | 98, 76 | 46, 77 | 116, 78 | 115, 79 | 0, 80 | 0, 81 | 0, 82 | 0, 83 | 29, 84 | 0, 85 | 0, 86 | 0, 87 | 22, 88 | 0, 89 | 0, 90 | 0, 91 | 151, 92 | 0, 93 | 0, 94 | 0, 95 | 136, 96 | 0, 97 | 0, 98 | 0, 99 | 0, 100 | 12, 101 | 102, 102 | 105, 103 | 108, 104 | 101, 105 | 58, 106 | 47, 107 | 47, 108 | 47, 109 | 97, 110 | 46, 111 | 116, 112 | 115, 113 | 1, 114 | 0, 115 | 0, 116 | 0, 117 | 12, 118 | 102, 119 | 105, 120 | 108, 121 | 101, 122 | 58, 123 | 47, 124 | 47, 125 | 47, 126 | 98, 127 | 46, 128 | 116, 129 | 115, 130 | 0, 131 | 0, 132 | 0, 133 | 3, 134 | 100, 135 | 64, 136 | 53, 137 | 2, 138 | 0, 139 | 0, 140 | 0, 141 | 3, 142 | 0, 143 | 0, 144 | 0, 145 | 12, 146 | 112, 147 | 97, 148 | 99, 149 | 107, 150 | 97, 151 | 103, 152 | 101, 153 | 64, 154 | 94, 155 | 49, 156 | 46, 157 | 50, 158 | 2, 159 | 0, 160 | 0, 161 | 0, 162 | 5, 163 | 0, 164 | 0, 165 | 0, 166 | 10, 167 | 112, 168 | 97, 169 | 99, 170 | 107, 171 | 97, 172 | 103, 173 | 101, 174 | 64, 175 | 94, 176 | 49, 177 | 2, 178 | 0, 179 | 0, 180 | 0, 181 | 5, 182 | 0, 183 | 0, 184 | 0, 185 | 158, 186 | 0, 187 | 0, 188 | 0, 189 | 7, 190 | 97, 191 | 64, 192 | 50, 193 | 46, 194 | 50, 195 | 46, 196 | 51, 197 | 0, 198 | 0, 199 | 0, 200 | 0, 201 | 0, 202 | 0, 203 | 0, 204 | 7, 205 | 98, 206 | 64, 207 | 49, 208 | 46, 209 | 50, 210 | 46, 211 | 51, 212 | 0, 213 | 0, 214 | 0, 215 | 1, 216 | 0, 217 | 0, 218 | 0, 219 | 18, 220 | 115, 221 | 111, 222 | 109, 223 | 101, 224 | 111, 225 | 116, 226 | 104, 227 | 101, 228 | 114, 229 | 115, 230 | 112, 231 | 101, 232 | 99, 233 | 105, 234 | 102, 235 | 105, 236 | 101, 237 | 114, 238 | 0, 239 | 0, 240 | 0, 241 | 2, 242 | 0, 243 | 0, 244 | 0, 245 | 7, 246 | 99, 247 | 64, 248 | 49, 249 | 46, 250 | 49, 251 | 46, 252 | 49, 253 | 0, 254 | 0, 255 | 0, 256 | 0, 257 | 0, 258 | 0, 259 | 0, 260 | 7, 261 | 100, 262 | 64, 263 | 53, 264 | 46, 265 | 48, 266 | 46, 267 | 48, 268 | 0, 269 | 0, 270 | 0, 271 | 1, 272 | 0, 273 | 0, 274 | 0, 275 | 1, 276 | 101, 277 | 0, 278 | 0, 279 | 0, 280 | 4, 281 | 0, 282 | 0, 283 | 0, 284 | 7, 285 | 101, 286 | 64, 287 | 54, 288 | 46, 289 | 48, 290 | 46, 291 | 48, 292 | 0, 293 | 0, 294 | 0, 295 | 1, 296 | 0, 297 | 0, 298 | 0, 299 | 1, 300 | 100, 301 | 0, 302 | 0, 303 | 0, 304 | 3, 305 | 0, 306 | 0, 307 | 0, 308 | 13, 309 | 112, 310 | 97, 311 | 99, 312 | 107, 313 | 97, 314 | 103, 315 | 101, 316 | 64, 317 | 49, 318 | 46, 319 | 50, 320 | 46, 321 | 50, 322 | 0, 323 | 0, 324 | 0, 325 | 2, 326 | 0, 327 | 0, 328 | 0, 329 | 1, 330 | 97, 331 | 0, 332 | 0, 333 | 0, 334 | 0, 335 | 0, 336 | 0, 337 | 0, 338 | 1, 339 | 98, 340 | 0, 341 | 0, 342 | 0, 343 | 1, 344 | 0, 345 | 0, 346 | 0, 347 | 51, 348 | 101, 349 | 120, 350 | 112, 351 | 111, 352 | 114, 353 | 116, 354 | 32, 355 | 42, 356 | 32, 357 | 97, 358 | 115, 359 | 32, 360 | 97, 361 | 32, 362 | 102, 363 | 114, 364 | 111, 365 | 109, 366 | 32, 367 | 34, 368 | 46, 369 | 47, 370 | 97, 371 | 46, 372 | 116, 373 | 115, 374 | 34, 375 | 59, 376 | 10, 377 | 101, 378 | 120, 379 | 112, 380 | 111, 381 | 114, 382 | 116, 383 | 32, 384 | 99, 385 | 111, 386 | 110, 387 | 115, 388 | 116, 389 | 32, 390 | 98, 391 | 32, 392 | 61, 393 | 32, 394 | 34, 395 | 98, 396 | 34, 397 | 59, 398 | 10, 399 | 0, 400 | 0, 401 | 1, 402 | 31, 403 | 123, 404 | 34, 405 | 118, 406 | 101, 407 | 114, 408 | 115, 409 | 105, 410 | 111, 411 | 110, 412 | 34, 413 | 58, 414 | 51, 415 | 44, 416 | 34, 417 | 115, 418 | 111, 419 | 117, 420 | 114, 421 | 99, 422 | 101, 423 | 115, 424 | 34, 425 | 58, 426 | 91, 427 | 34, 428 | 102, 429 | 105, 430 | 108, 431 | 101, 432 | 58, 433 | 47, 434 | 47, 435 | 47, 436 | 109, 437 | 97, 438 | 105, 439 | 110, 440 | 46, 441 | 116, 442 | 115, 443 | 34, 444 | 93, 445 | 44, 446 | 34, 447 | 115, 448 | 111, 449 | 117, 450 | 114, 451 | 99, 452 | 101, 453 | 115, 454 | 67, 455 | 111, 456 | 110, 457 | 116, 458 | 101, 459 | 110, 460 | 116, 461 | 34, 462 | 58, 463 | 91, 464 | 34, 465 | 101, 466 | 120, 467 | 112, 468 | 111, 469 | 114, 470 | 116, 471 | 32, 472 | 42, 473 | 32, 474 | 97, 475 | 115, 476 | 32, 477 | 97, 478 | 32, 479 | 102, 480 | 114, 481 | 111, 482 | 109, 483 | 32, 484 | 92, 485 | 34, 486 | 46, 487 | 47, 488 | 97, 489 | 46, 490 | 116, 491 | 115, 492 | 92, 493 | 34, 494 | 59, 495 | 92, 496 | 110, 497 | 34, 498 | 93, 499 | 44, 500 | 34, 501 | 110, 502 | 97, 503 | 109, 504 | 101, 505 | 115, 506 | 34, 507 | 58, 508 | 91, 509 | 93, 510 | 44, 511 | 34, 512 | 109, 513 | 97, 514 | 112, 515 | 112, 516 | 105, 517 | 110, 518 | 103, 519 | 115, 520 | 34, 521 | 58, 522 | 34, 523 | 65, 524 | 65, 525 | 65, 526 | 65, 527 | 44, 528 | 79, 529 | 65, 530 | 65, 531 | 79, 532 | 44, 533 | 75, 534 | 65, 535 | 65, 536 | 75, 537 | 44, 538 | 67, 539 | 65, 540 | 65, 541 | 67, 542 | 44, 543 | 77, 544 | 65, 545 | 65, 546 | 77, 547 | 44, 548 | 83, 549 | 65, 550 | 65, 551 | 83, 552 | 34, 553 | 125, 554 | 123, 555 | 34, 556 | 118, 557 | 101, 558 | 114, 559 | 115, 560 | 105, 561 | 111, 562 | 110, 563 | 34, 564 | 58, 565 | 51, 566 | 44, 567 | 34, 568 | 115, 569 | 111, 570 | 117, 571 | 114, 572 | 99, 573 | 101, 574 | 115, 575 | 34, 576 | 58, 577 | 91, 578 | 34, 579 | 102, 580 | 105, 581 | 108, 582 | 101, 583 | 58, 584 | 47, 585 | 47, 586 | 47, 587 | 98, 588 | 46, 589 | 116, 590 | 115, 591 | 34, 592 | 93, 593 | 44, 594 | 34, 595 | 115, 596 | 111, 597 | 117, 598 | 114, 599 | 99, 600 | 101, 601 | 115, 602 | 67, 603 | 111, 604 | 110, 605 | 116, 606 | 101, 607 | 110, 608 | 116, 609 | 34, 610 | 58, 611 | 91, 612 | 34, 613 | 101, 614 | 120, 615 | 112, 616 | 111, 617 | 114, 618 | 116, 619 | 32, 620 | 99, 621 | 111, 622 | 110, 623 | 115, 624 | 116, 625 | 32, 626 | 98, 627 | 32, 628 | 61, 629 | 32, 630 | 92, 631 | 34, 632 | 98, 633 | 92, 634 | 34, 635 | 59, 636 | 92, 637 | 110, 638 | 34, 639 | 93, 640 | 44, 641 | 34, 642 | 110, 643 | 97, 644 | 109, 645 | 101, 646 | 115, 647 | 34, 648 | 58, 649 | 91, 650 | 93, 651 | 44, 652 | 34, 653 | 109, 654 | 97, 655 | 112, 656 | 112, 657 | 105, 658 | 110, 659 | 103, 660 | 115, 661 | 34, 662 | 58, 663 | 34, 664 | 65, 665 | 65, 666 | 65, 667 | 65, 668 | 44, 669 | 79, 670 | 65, 671 | 65, 672 | 79, 673 | 44, 674 | 77, 675 | 65, 676 | 65, 677 | 77, 678 | 44, 679 | 73, 680 | 65, 681 | 65, 682 | 73, 683 | 44, 684 | 73, 685 | 65, 686 | 65, 687 | 73, 688 | 34, 689 | 125, 690 | ] 691 | -------------------------------------------------------------------------------- /src/snapshots/eszip__v2__tests__file_format_roundtrippable.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/v2.rs 3 | expression: bytes 4 | --- 5 | [ 6 | 69, 7 | 83, 8 | 90, 9 | 73, 10 | 80, 11 | 50, 12 | 46, 13 | 51, 14 | 0, 15 | 0, 16 | 0, 17 | 4, 18 | 0, 19 | 1, 20 | 1, 21 | 32, 22 | 93, 23 | 165, 24 | 28, 25 | 55, 26 | 117, 27 | 128, 28 | 240, 29 | 183, 30 | 115, 31 | 90, 32 | 129, 33 | 122, 34 | 136, 35 | 28, 36 | 245, 37 | 21, 38 | 233, 39 | 64, 40 | 253, 41 | 55, 42 | 203, 43 | 126, 44 | 13, 45 | 171, 46 | 123, 47 | 185, 48 | 36, 49 | 119, 50 | 36, 51 | 75, 52 | 26, 53 | 21, 54 | 0, 55 | 0, 56 | 0, 57 | 104, 58 | 0, 59 | 0, 60 | 0, 61 | 15, 62 | 102, 63 | 105, 64 | 108, 65 | 101, 66 | 58, 67 | 47, 68 | 47, 69 | 47, 70 | 109, 71 | 97, 72 | 105, 73 | 110, 74 | 46, 75 | 116, 76 | 115, 77 | 0, 78 | 0, 79 | 0, 80 | 0, 81 | 0, 82 | 0, 83 | 0, 84 | 0, 85 | 29, 86 | 0, 87 | 0, 88 | 0, 89 | 0, 90 | 0, 91 | 0, 92 | 0, 93 | 151, 94 | 0, 95 | 0, 96 | 0, 97 | 0, 98 | 12, 99 | 102, 100 | 105, 101 | 108, 102 | 101, 103 | 58, 104 | 47, 105 | 47, 106 | 47, 107 | 98, 108 | 46, 109 | 116, 110 | 115, 111 | 0, 112 | 0, 113 | 0, 114 | 0, 115 | 61, 116 | 0, 117 | 0, 118 | 0, 119 | 22, 120 | 0, 121 | 0, 122 | 0, 123 | 183, 124 | 0, 125 | 0, 126 | 0, 127 | 151, 128 | 0, 129 | 0, 130 | 0, 131 | 0, 132 | 12, 133 | 102, 134 | 105, 135 | 108, 136 | 101, 137 | 58, 138 | 47, 139 | 47, 140 | 47, 141 | 97, 142 | 46, 143 | 116, 144 | 115, 145 | 1, 146 | 0, 147 | 0, 148 | 0, 149 | 12, 150 | 102, 151 | 105, 152 | 108, 153 | 101, 154 | 58, 155 | 47, 156 | 47, 157 | 47, 158 | 98, 159 | 46, 160 | 116, 161 | 115, 162 | 72, 163 | 28, 164 | 222, 165 | 153, 166 | 19, 167 | 208, 168 | 7, 169 | 135, 170 | 152, 171 | 187, 172 | 213, 173 | 35, 174 | 44, 175 | 124, 176 | 73, 177 | 98, 178 | 68, 179 | 248, 180 | 37, 181 | 203, 182 | 153, 183 | 163, 184 | 243, 185 | 141, 186 | 149, 187 | 244, 188 | 226, 189 | 122, 190 | 96, 191 | 73, 192 | 232, 193 | 144, 194 | 0, 195 | 0, 196 | 0, 197 | 0, 198 | 227, 199 | 176, 200 | 196, 201 | 66, 202 | 152, 203 | 252, 204 | 28, 205 | 20, 206 | 154, 207 | 251, 208 | 244, 209 | 200, 210 | 153, 211 | 111, 212 | 185, 213 | 36, 214 | 39, 215 | 174, 216 | 65, 217 | 228, 218 | 100, 219 | 155, 220 | 147, 221 | 76, 222 | 164, 223 | 149, 224 | 153, 225 | 27, 226 | 120, 227 | 82, 228 | 184, 229 | 85, 230 | 0, 231 | 0, 232 | 0, 233 | 115, 234 | 101, 235 | 120, 236 | 112, 237 | 111, 238 | 114, 239 | 116, 240 | 32, 241 | 42, 242 | 32, 243 | 97, 244 | 115, 245 | 32, 246 | 97, 247 | 32, 248 | 102, 249 | 114, 250 | 111, 251 | 109, 252 | 32, 253 | 34, 254 | 46, 255 | 47, 256 | 97, 257 | 46, 258 | 116, 259 | 115, 260 | 34, 261 | 59, 262 | 10, 263 | 47, 264 | 43, 265 | 32, 266 | 46, 267 | 117, 268 | 220, 269 | 233, 270 | 51, 271 | 234, 272 | 223, 273 | 154, 274 | 133, 275 | 115, 276 | 170, 277 | 205, 278 | 173, 279 | 253, 280 | 179, 281 | 31, 282 | 174, 283 | 255, 284 | 191, 285 | 245, 286 | 128, 287 | 155, 288 | 184, 289 | 97, 290 | 88, 291 | 208, 292 | 31, 293 | 136, 294 | 210, 295 | 101, 296 | 120, 297 | 112, 298 | 111, 299 | 114, 300 | 116, 301 | 32, 302 | 99, 303 | 111, 304 | 110, 305 | 115, 306 | 116, 307 | 32, 308 | 98, 309 | 32, 310 | 61, 311 | 32, 312 | 34, 313 | 98, 314 | 34, 315 | 59, 316 | 10, 317 | 195, 318 | 125, 319 | 168, 320 | 132, 321 | 12, 322 | 51, 323 | 241, 324 | 62, 325 | 31, 326 | 13, 327 | 95, 328 | 201, 329 | 65, 330 | 196, 331 | 80, 332 | 30, 333 | 66, 334 | 11, 335 | 109, 336 | 88, 337 | 13, 338 | 143, 339 | 234, 340 | 241, 341 | 249, 342 | 0, 343 | 6, 344 | 233, 345 | 191, 346 | 196, 347 | 22, 348 | 196, 349 | 0, 350 | 0, 351 | 1, 352 | 110, 353 | 123, 354 | 34, 355 | 118, 356 | 101, 357 | 114, 358 | 115, 359 | 105, 360 | 111, 361 | 110, 362 | 34, 363 | 58, 364 | 51, 365 | 44, 366 | 34, 367 | 115, 368 | 111, 369 | 117, 370 | 114, 371 | 99, 372 | 101, 373 | 115, 374 | 34, 375 | 58, 376 | 91, 377 | 34, 378 | 102, 379 | 105, 380 | 108, 381 | 101, 382 | 58, 383 | 47, 384 | 47, 385 | 47, 386 | 109, 387 | 97, 388 | 105, 389 | 110, 390 | 46, 391 | 116, 392 | 115, 393 | 34, 394 | 93, 395 | 44, 396 | 34, 397 | 115, 398 | 111, 399 | 117, 400 | 114, 401 | 99, 402 | 101, 403 | 115, 404 | 67, 405 | 111, 406 | 110, 407 | 116, 408 | 101, 409 | 110, 410 | 116, 411 | 34, 412 | 58, 413 | 91, 414 | 34, 415 | 101, 416 | 120, 417 | 112, 418 | 111, 419 | 114, 420 | 116, 421 | 32, 422 | 42, 423 | 32, 424 | 97, 425 | 115, 426 | 32, 427 | 97, 428 | 32, 429 | 102, 430 | 114, 431 | 111, 432 | 109, 433 | 32, 434 | 92, 435 | 34, 436 | 46, 437 | 47, 438 | 97, 439 | 46, 440 | 116, 441 | 115, 442 | 92, 443 | 34, 444 | 59, 445 | 92, 446 | 110, 447 | 34, 448 | 93, 449 | 44, 450 | 34, 451 | 110, 452 | 97, 453 | 109, 454 | 101, 455 | 115, 456 | 34, 457 | 58, 458 | 91, 459 | 93, 460 | 44, 461 | 34, 462 | 109, 463 | 97, 464 | 112, 465 | 112, 466 | 105, 467 | 110, 468 | 103, 469 | 115, 470 | 34, 471 | 58, 472 | 34, 473 | 65, 474 | 65, 475 | 65, 476 | 65, 477 | 44, 478 | 77, 479 | 65, 480 | 65, 481 | 77, 482 | 44, 483 | 77, 484 | 65, 485 | 65, 486 | 77, 487 | 44, 488 | 67, 489 | 65, 490 | 65, 491 | 67, 492 | 44, 493 | 77, 494 | 65, 495 | 65, 496 | 77, 497 | 44, 498 | 67, 499 | 65, 500 | 65, 501 | 81, 502 | 34, 503 | 125, 504 | 217, 505 | 253, 506 | 126, 507 | 48, 508 | 67, 509 | 114, 510 | 34, 511 | 179, 512 | 49, 513 | 61, 514 | 214, 515 | 16, 516 | 190, 517 | 14, 518 | 207, 519 | 9, 520 | 127, 521 | 94, 522 | 228, 523 | 37, 524 | 155, 525 | 212, 526 | 243, 527 | 253, 528 | 179, 529 | 32, 530 | 161, 531 | 74, 532 | 181, 533 | 190, 534 | 243, 535 | 94, 536 | 123, 537 | 34, 538 | 118, 539 | 101, 540 | 114, 541 | 115, 542 | 105, 543 | 111, 544 | 110, 545 | 34, 546 | 58, 547 | 51, 548 | 44, 549 | 34, 550 | 115, 551 | 111, 552 | 117, 553 | 114, 554 | 99, 555 | 101, 556 | 115, 557 | 34, 558 | 58, 559 | 91, 560 | 34, 561 | 102, 562 | 105, 563 | 108, 564 | 101, 565 | 58, 566 | 47, 567 | 47, 568 | 47, 569 | 98, 570 | 46, 571 | 116, 572 | 115, 573 | 34, 574 | 93, 575 | 44, 576 | 34, 577 | 115, 578 | 111, 579 | 117, 580 | 114, 581 | 99, 582 | 101, 583 | 115, 584 | 67, 585 | 111, 586 | 110, 587 | 116, 588 | 101, 589 | 110, 590 | 116, 591 | 34, 592 | 58, 593 | 91, 594 | 34, 595 | 101, 596 | 120, 597 | 112, 598 | 111, 599 | 114, 600 | 116, 601 | 32, 602 | 99, 603 | 111, 604 | 110, 605 | 115, 606 | 116, 607 | 32, 608 | 98, 609 | 32, 610 | 61, 611 | 32, 612 | 92, 613 | 34, 614 | 98, 615 | 92, 616 | 34, 617 | 59, 618 | 92, 619 | 110, 620 | 34, 621 | 93, 622 | 44, 623 | 34, 624 | 110, 625 | 97, 626 | 109, 627 | 101, 628 | 115, 629 | 34, 630 | 58, 631 | 91, 632 | 93, 633 | 44, 634 | 34, 635 | 109, 636 | 97, 637 | 112, 638 | 112, 639 | 105, 640 | 110, 641 | 103, 642 | 115, 643 | 34, 644 | 58, 645 | 34, 646 | 65, 647 | 65, 648 | 65, 649 | 65, 650 | 44, 651 | 77, 652 | 65, 653 | 65, 654 | 77, 655 | 44, 656 | 67, 657 | 65, 658 | 65, 659 | 67, 660 | 44, 661 | 75, 662 | 65, 663 | 65, 664 | 75, 665 | 44, 666 | 67, 667 | 65, 668 | 65, 669 | 67, 670 | 44, 671 | 67, 672 | 65, 673 | 65, 674 | 67, 675 | 44, 676 | 71, 677 | 65, 678 | 65, 679 | 71, 680 | 44, 681 | 67, 682 | 65, 683 | 65, 684 | 71, 685 | 34, 686 | 125, 687 | 108, 688 | 118, 689 | 224, 690 | 22, 691 | 49, 692 | 2, 693 | 139, 694 | 84, 695 | 17, 696 | 178, 697 | 219, 698 | 36, 699 | 167, 700 | 159, 701 | 14, 702 | 66, 703 | 118, 704 | 252, 705 | 4, 706 | 108, 707 | 73, 708 | 29, 709 | 44, 710 | 69, 711 | 146, 712 | 142, 713 | 207, 714 | 61, 715 | 11, 716 | 157, 717 | 41, 718 | 9, 719 | ] 720 | -------------------------------------------------------------------------------- /src/v1.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. 2 | 3 | use std::collections::HashMap; 4 | use std::collections::HashSet; 5 | use std::sync::Arc; 6 | use std::sync::Mutex; 7 | 8 | use serde::Deserialize; 9 | use serde::Serialize; 10 | use url::Url; 11 | 12 | use crate::Module; 13 | use crate::ModuleInner; 14 | use crate::ModuleKind; 15 | use crate::ParseError; 16 | 17 | const ESZIP_V1_GRAPH_VERSION: u32 = 1; 18 | 19 | #[derive(Clone, Debug, Deserialize, Serialize)] 20 | pub struct EszipV1 { 21 | version: u32, 22 | modules: Arc>>, 23 | } 24 | 25 | impl EszipV1 { 26 | pub fn from_modules(modules: HashMap) -> Self { 27 | Self { 28 | version: ESZIP_V1_GRAPH_VERSION, 29 | modules: Arc::new(Mutex::new(modules)), 30 | } 31 | } 32 | 33 | pub fn parse(data: &[u8]) -> Result { 34 | let eszip: EszipV1 = 35 | serde_json::from_slice(data).map_err(ParseError::InvalidV1Json)?; 36 | if eszip.version != ESZIP_V1_GRAPH_VERSION { 37 | return Err(ParseError::InvalidV1Version(eszip.version)); 38 | } 39 | Ok(eszip) 40 | } 41 | 42 | pub fn into_bytes(self) -> Vec { 43 | serde_json::to_vec(&self).unwrap() 44 | } 45 | 46 | pub fn get_module(&self, specifier: &str) -> Option { 47 | let mut specifier = &Url::parse(specifier).ok()?; 48 | let mut visited = HashSet::new(); 49 | let modules = self.modules.lock().unwrap(); 50 | loop { 51 | visited.insert(specifier); 52 | let module = modules.get(specifier)?; 53 | match module { 54 | ModuleInfo::Redirect(redirect) => { 55 | specifier = redirect; 56 | if visited.contains(specifier) { 57 | return None; 58 | } 59 | } 60 | ModuleInfo::Source(..) => { 61 | let module = Module { 62 | specifier: specifier.to_string(), 63 | kind: ModuleKind::JavaScript, 64 | inner: ModuleInner::V1(EszipV1 { 65 | version: self.version, 66 | modules: self.modules.clone(), 67 | }), 68 | }; 69 | return Some(module); 70 | } 71 | } 72 | } 73 | } 74 | 75 | pub fn get_import_map(&self, _specifier: &str) -> Option { 76 | // V1 never contains an import map in it. This method exists to make it 77 | // consistent with V2's interface. 78 | None 79 | } 80 | 81 | /// Get source code of the module. 82 | pub(crate) fn get_module_source(&self, specifier: &str) -> Option> { 83 | let specifier = &Url::parse(specifier).ok()?; 84 | let modules = self.modules.lock().unwrap(); 85 | let module = modules.get(specifier).unwrap(); 86 | match module { 87 | ModuleInfo::Redirect(_) => panic!("Redirects should be resolved"), 88 | ModuleInfo::Source(module) => { 89 | let source = module.transpiled.as_ref().unwrap_or(&module.source); 90 | Some(source.clone().into()) 91 | } 92 | } 93 | } 94 | 95 | /// Removes the module from the modules map and returns the source code. 96 | pub(crate) fn take(&self, specifier: &str) -> Option> { 97 | let specifier = &Url::parse(specifier).ok()?; 98 | let mut modules = self.modules.lock().unwrap(); 99 | // Note: we don't have a need to preserve the module in the map for v1, so we can 100 | // remove the module from the map. In v2, we need to preserve the module in the map 101 | // to be able to get source map for the module. 102 | let module = modules.remove(specifier)?; 103 | match module { 104 | ModuleInfo::Redirect(_) => panic!("Redirects should be resolved"), 105 | ModuleInfo::Source(module_source) => { 106 | let source = module_source.transpiled.unwrap_or(module_source.source); 107 | Some(source.into()) 108 | } 109 | } 110 | } 111 | 112 | fn specifiers(&self) -> Vec { 113 | let modules = self.modules.lock().unwrap(); 114 | modules.keys().cloned().collect() 115 | } 116 | } 117 | 118 | /// Get an iterator over all the modules in this eszip archive. 119 | /// 120 | /// Note that the iterator will iterate over the specifiers' "snapshot" of the 121 | /// archive. If a new module is added to the archive after the iterator is 122 | /// created via `into_iter()`, that module will not be iterated over. 123 | impl IntoIterator for EszipV1 { 124 | type Item = (String, Module); 125 | type IntoIter = std::vec::IntoIter; 126 | 127 | fn into_iter(self) -> Self::IntoIter { 128 | let specifiers = self.specifiers(); 129 | let mut v = Vec::with_capacity(specifiers.len()); 130 | for specifier in specifiers { 131 | let Some(module) = self.get_module(specifier.as_str()) else { 132 | continue; 133 | }; 134 | v.push((specifier.to_string(), module)); 135 | } 136 | 137 | v.into_iter() 138 | } 139 | } 140 | 141 | #[derive(Clone, Debug, Serialize, Deserialize)] 142 | pub enum ModuleInfo { 143 | Redirect(Url), 144 | Source(ModuleSource), 145 | } 146 | 147 | #[derive(Clone, Debug, Serialize, Deserialize)] 148 | pub struct ModuleSource { 149 | pub source: Arc, 150 | pub transpiled: Option>, 151 | pub content_type: Option, 152 | pub deps: Vec, 153 | } 154 | 155 | #[cfg(test)] 156 | mod tests { 157 | use super::*; 158 | use pretty_assertions::assert_eq; 159 | 160 | #[test] 161 | fn file_format_parse() { 162 | let data = include_bytes!("./testdata/basic.json"); 163 | let eszip = EszipV1::parse(data).unwrap(); 164 | assert_eq!(eszip.version, 1); 165 | assert_eq!(eszip.modules.lock().unwrap().len(), 1); 166 | let specifier = "https://gist.githubusercontent.com/lucacasonato/f3e21405322259ca4ed155722390fda2/raw/e25acb49b681e8e1da5a2a33744b7a36d538712d/hello.js"; 167 | let module = eszip.get_module(specifier).unwrap(); 168 | assert_eq!(module.specifier, specifier); 169 | let inner = module.inner; 170 | let bytes = match inner { 171 | crate::ModuleInner::V1(eszip) => { 172 | eszip.get_module_source(specifier).unwrap() 173 | } 174 | crate::ModuleInner::V2(_) => unreachable!(), 175 | }; 176 | assert_eq!(&*bytes, b"addEventListener(\"fetch\", (event)=>{\n event.respondWith(new Response(\"Hello World\", {\n headers: {\n \"content-type\": \"text/plain\"\n }\n }));\n});\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIjxodHRwczovL2dpc3QuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2x1Y2FjYXNvbmF0by9mM2UyMTQwNTMyMjI1OWNhNGVkMTU1NzIyMzkwZmRhMi9yYXcvZTI1YWNiNDliNjgxZThlMWRhNWEyYTMzNzQ0YjdhMzZkNTM4NzEyZC9oZWxsby5qcz4iXSwic291cmNlc0NvbnRlbnQiOlsiYWRkRXZlbnRMaXN0ZW5lcihcImZldGNoXCIsIChldmVudCkgPT4ge1xuICBldmVudC5yZXNwb25kV2l0aChuZXcgUmVzcG9uc2UoXCJIZWxsbyBXb3JsZFwiLCB7XG4gICAgaGVhZGVyczogeyBcImNvbnRlbnQtdHlwZVwiOiBcInRleHQvcGxhaW5cIiB9LFxuICB9KSk7XG59KTsiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQUEsRUFBQSxLQUFBLElBQUEsS0FBQTtBQUNBLFNBQUEsQ0FBQSxXQUFBLEtBQUEsUUFBQSxFQUFBLFdBQUE7QUFDQSxlQUFBO2FBQUEsWUFBQSxJQUFBLFVBQUEifQ=="); 177 | } 178 | 179 | #[tokio::test] 180 | async fn get_transpiled_for_ts() { 181 | let data = include_bytes!("./testdata/dotland.json"); 182 | let eszip = EszipV1::parse(data).unwrap(); 183 | assert_eq!(eszip.version, 1); 184 | 185 | let module = eszip.get_module("file:///src/worker/handler.ts").unwrap(); 186 | assert_eq!(module.specifier, "file:///src/worker/handler.ts"); 187 | let bytes = module.source().await.unwrap(); 188 | let text = std::str::from_utf8(&bytes).unwrap(); 189 | assert!(!text.contains("import type { ConnInfo }")); 190 | } 191 | 192 | #[tokio::test] 193 | async fn eszipv1_iterator_yields_all_modules() { 194 | let data = include_bytes!("./testdata/dotland.json"); 195 | let eszip = EszipV1::parse(data).unwrap(); 196 | assert_eq!(eszip.version, 1); 197 | 198 | let expected_modules: HashSet = [ 199 | "file:///src/util/registry_utils.ts".to_string(), 200 | "file:///src/worker/handler.ts".to_string(), 201 | "file:///src/worker/main.ts".to_string(), 202 | "file:///src/worker/registry.ts".to_string(), 203 | "file:///src/worker/registry_config.ts".to_string(), 204 | "file:///src/worker/suggestions.ts".to_string(), 205 | "file:///src/worker/vscode.ts".to_string(), 206 | "https://cdn.esm.sh/v64/twas@2.1.2/deno/twas.js".to_string(), 207 | "https://deno.land/std@0.108.0/async/deadline.ts".to_string(), 208 | "https://deno.land/std@0.108.0/async/debounce.ts".to_string(), 209 | "https://deno.land/std@0.108.0/async/deferred.ts".to_string(), 210 | "https://deno.land/std@0.108.0/async/delay.ts".to_string(), 211 | "https://deno.land/std@0.108.0/async/mod.ts".to_string(), 212 | "https://deno.land/std@0.108.0/async/mux_async_iterator.ts".to_string(), 213 | "https://deno.land/std@0.108.0/async/pool.ts".to_string(), 214 | "https://deno.land/std@0.108.0/async/tee.ts".to_string(), 215 | "https://deno.land/std@0.108.0/http/server.ts".to_string(), 216 | "https://deno.land/std@0.120.0/async/deadline.ts".to_string(), 217 | "https://deno.land/std@0.120.0/async/debounce.ts".to_string(), 218 | "https://deno.land/std@0.120.0/async/deferred.ts".to_string(), 219 | "https://deno.land/std@0.120.0/async/delay.ts".to_string(), 220 | "https://deno.land/std@0.120.0/async/mod.ts".to_string(), 221 | "https://deno.land/std@0.120.0/async/mux_async_iterator.ts".to_string(), 222 | "https://deno.land/std@0.120.0/async/pool.ts".to_string(), 223 | "https://deno.land/std@0.120.0/async/tee.ts".to_string(), 224 | "https://deno.land/std@0.120.0/fmt/colors.ts".to_string(), 225 | "https://deno.land/std@0.120.0/http/http_status.ts".to_string(), 226 | "https://deno.land/x/fuse@v6.4.1/dist/fuse.esm.js".to_string(), 227 | "https://deno.land/x/g_a@0.1.2/mod.ts".to_string(), 228 | "https://deno.land/x/oak_commons@0.1.1/negotiation.ts".to_string(), 229 | "https://deno.land/x/oak_commons@0.1.1/negotiation/common.ts".to_string(), 230 | "https://deno.land/x/oak_commons@0.1.1/negotiation/encoding.ts" 231 | .to_string(), 232 | "https://deno.land/x/oak_commons@0.1.1/negotiation/language.ts" 233 | .to_string(), 234 | "https://deno.land/x/oak_commons@0.1.1/negotiation/mediaType.ts" 235 | .to_string(), 236 | "https://deno.land/x/path_to_regexp@v6.2.0/index.ts".to_string(), 237 | "https://deno.land/x/pretty_bytes@v1.0.5/mod.ts".to_string(), 238 | "https://esm.sh/twas@2.1.2".to_string(), 239 | ] 240 | .into_iter() 241 | .collect(); 242 | let actual_modules = eszip 243 | .into_iter() 244 | .map(|(module_specifier, _)| module_specifier) 245 | .collect(); 246 | 247 | assert_eq!(expected_modules, actual_modules); 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /lib/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. 2 | 3 | #![deny(clippy::print_stderr)] 4 | #![deny(clippy::print_stdout)] 5 | 6 | use deno_error::JsErrorBox; 7 | use deno_graph::source::load_data_url; 8 | use deno_graph::source::CacheInfo; 9 | use deno_graph::source::LoadFuture; 10 | use deno_graph::source::LoadOptions; 11 | use deno_graph::source::Loader; 12 | use deno_graph::source::ResolveError; 13 | use deno_graph::source::Resolver; 14 | use deno_graph::BuildOptions; 15 | use deno_graph::GraphKind; 16 | use deno_graph::ModuleGraph; 17 | use deno_graph::ModuleSpecifier; 18 | use eszip::v2::Url; 19 | use eszip::ModuleKind; 20 | use futures::io::AsyncRead; 21 | use futures::io::BufReader; 22 | use import_map::ImportMap; 23 | use js_sys::Promise; 24 | use js_sys::TypeError; 25 | use js_sys::Uint8Array; 26 | use serde::Serialize; 27 | use std::cell::RefCell; 28 | use std::future::Future; 29 | use std::io::Error; 30 | use std::io::ErrorKind; 31 | use std::pin::Pin; 32 | use std::rc::Rc; 33 | use std::sync::Arc; 34 | use std::task::Context; 35 | use std::task::Poll; 36 | use wasm_bindgen::prelude::*; 37 | use wasm_bindgen::JsCast; 38 | use wasm_bindgen_futures::JsFuture; 39 | use web_sys::ReadableStreamByobReader; 40 | 41 | /// A `Stream` holds a Byob reader and the 42 | /// future of the current `reader.read` operation. 43 | struct Stream { 44 | inner: Option, 45 | fut: Option, 46 | } 47 | 48 | impl Stream { 49 | fn new(inner: ReadableStreamByobReader) -> Self { 50 | Self { 51 | inner: Some(inner), 52 | fut: None, 53 | } 54 | } 55 | } 56 | 57 | #[wasm_bindgen] 58 | extern "C" { 59 | /// Result of a read on BYOB reader. 60 | /// { value: Uint8Array, done: boolean } 61 | pub type ReadResult; 62 | #[wasm_bindgen(method, getter, js_name = done)] 63 | pub fn is_done(this: &ReadResult) -> bool; 64 | 65 | #[wasm_bindgen(method, getter, js_name = value)] 66 | pub fn value(this: &ReadResult) -> Option; 67 | } 68 | 69 | /// A `ParserStream` is a wrapper around 70 | /// Byob stream that also supports reading 71 | /// through in-memory buffers. 72 | /// 73 | /// We need this because `#[wasm_bindgen]` 74 | /// structs cannot have type parameters. 75 | enum ParserStream { 76 | Byob(Stream), 77 | Buffer(Vec), 78 | } 79 | 80 | impl AsyncRead for ParserStream { 81 | fn poll_read( 82 | mut self: Pin<&mut Self>, 83 | cx: &mut Context<'_>, 84 | buf: &mut [u8], 85 | ) -> Poll> { 86 | match *self { 87 | ParserStream::Byob(ref mut stream) => { 88 | // If we have a pending future, poll it. 89 | // otherwise, schedule a new one. 90 | let fut = match stream.fut.as_mut() { 91 | Some(fut) => fut, 92 | None => { 93 | let length = buf.len(); 94 | let buffer = Uint8Array::new_with_length(length as u32); 95 | match &stream.inner { 96 | Some(reader) => { 97 | let fut = 98 | JsFuture::from(reader.read_with_array_buffer_view(&buffer)); 99 | stream.fut.insert(fut) 100 | } 101 | None => return Poll::Ready(Ok(0)), 102 | } 103 | } 104 | }; 105 | let result = match Pin::new(fut).poll(cx) { 106 | Poll::Ready(result) => result, 107 | Poll::Pending => return Poll::Pending, 108 | }; 109 | // Clear slot for next `read()`. 110 | stream.fut = None; 111 | 112 | match result { 113 | Ok(result) => { 114 | let result = result.unchecked_into::(); 115 | match result.is_done() { 116 | true => { 117 | // Drop the readable stream. 118 | stream.inner = None; 119 | Poll::Ready(Ok(0)) 120 | } 121 | false => { 122 | let value = result.value().unwrap_throw(); 123 | let length = value.byte_length() as usize; 124 | 125 | value.copy_to(buf); 126 | 127 | Poll::Ready(Ok(length)) 128 | } 129 | } 130 | } 131 | Err(e) => Poll::Ready(Err(Error::new( 132 | ErrorKind::Other, 133 | js_sys::Object::try_from(&e) 134 | .map(|e| e.to_string().as_string().unwrap_throw()) 135 | .unwrap_or("Unknown error".to_string()), 136 | ))), 137 | } 138 | } 139 | ParserStream::Buffer(ref mut buffer) => { 140 | // Put the requested bytes into the buffer and 141 | // assign the remaining bytes back into the sink. 142 | let amt = std::cmp::min(buffer.len(), buf.len()); 143 | let (a, b) = buffer.split_at(amt); 144 | buf[..amt].copy_from_slice(a); 145 | *buffer = b.to_vec(); 146 | Poll::Ready(Ok(amt)) 147 | } 148 | } 149 | } 150 | } 151 | 152 | type LoaderFut = 153 | Pin, eszip::ParseError>>>>; 154 | type ParseResult = (eszip::EszipV2, LoaderFut); 155 | 156 | #[wasm_bindgen] 157 | pub struct Parser { 158 | parser: Rc>>>, 159 | } 160 | 161 | #[wasm_bindgen] 162 | impl Parser { 163 | #[wasm_bindgen(constructor)] 164 | pub fn new() -> Self { 165 | std::panic::set_hook(Box::new(console_error_panic_hook::hook)); 166 | Self { 167 | parser: Rc::new(RefCell::new(None)), 168 | } 169 | } 170 | 171 | /// Parse from a BYOB readable stream. 172 | pub fn parse(&self, stream: ReadableStreamByobReader) -> Promise { 173 | let reader = BufReader::new(ParserStream::Byob(Stream::new(stream))); 174 | self.parse_reader(reader) 175 | } 176 | 177 | /// Parse from an in-memory buffer. 178 | #[wasm_bindgen(js_name = parseBytes)] 179 | pub fn parse_bytes(&self, buffer: Vec) -> Promise { 180 | let reader = BufReader::new(ParserStream::Buffer(buffer)); 181 | self.parse_reader(reader) 182 | } 183 | 184 | fn parse_reader(&self, reader: BufReader) -> Promise { 185 | let parser = Rc::clone(&self.parser); 186 | 187 | wasm_bindgen_futures::future_to_promise(async move { 188 | let (eszip, loader) = eszip::EszipV2::parse(reader).await.unwrap(); 189 | let specifiers = eszip.specifiers(); 190 | parser.borrow_mut().replace((eszip, Box::pin(loader))); 191 | Ok( 192 | specifiers 193 | .iter() 194 | .map(JsValue::from) 195 | .collect::() 196 | .into(), 197 | ) 198 | }) 199 | } 200 | 201 | /// Load module sources. 202 | pub fn load(&mut self) -> Promise { 203 | let parser = Rc::clone(&self.parser); 204 | 205 | wasm_bindgen_futures::future_to_promise(async move { 206 | let mut p = parser.borrow_mut(); 207 | let (_, loader) = p.as_mut().unwrap_throw(); 208 | loader.await.unwrap(); 209 | Ok(JsValue::UNDEFINED) 210 | }) 211 | } 212 | 213 | /// Get a module source. 214 | #[wasm_bindgen(js_name = getModuleSource)] 215 | pub fn get_module_source(&self, specifier: String) -> Promise { 216 | let parser = Rc::clone(&self.parser); 217 | 218 | wasm_bindgen_futures::future_to_promise(async move { 219 | let p = parser.borrow(); 220 | let (eszip, _) = p.as_ref().unwrap(); 221 | let module = eszip 222 | .get_module(&specifier) 223 | .or_else(|| eszip.get_import_map(&specifier)) 224 | .ok_or(TypeError::new(&format!("module '{}' not found", specifier)))?; 225 | 226 | // Drop the borrow for the loader 227 | // to mutably borrow. 228 | drop(p); 229 | let source = module.source().await.ok_or(TypeError::new(&format!( 230 | "source for '{}' already taken", 231 | specifier 232 | )))?; 233 | let source = std::str::from_utf8(&source).unwrap(); 234 | Ok(source.to_string().into()) 235 | }) 236 | } 237 | 238 | /// Get a module sourcemap. 239 | #[wasm_bindgen(js_name = getModuleSourceMap)] 240 | pub fn get_module_source_map(&self, specifier: String) -> Promise { 241 | let parser = Rc::clone(&self.parser); 242 | 243 | wasm_bindgen_futures::future_to_promise(async move { 244 | let p = parser.borrow(); 245 | let (eszip, _) = p.as_ref().unwrap(); 246 | let module = eszip 247 | .get_module(&specifier) 248 | .or_else(|| eszip.get_import_map(&specifier)) 249 | .ok_or(TypeError::new(&format!("module '{}' not found", specifier)))?; 250 | 251 | // Drop the borrow for the loader 252 | // to mutably borrow. 253 | drop(p); 254 | match module.source_map().await { 255 | Some(source_map) => { 256 | let source_map = std::str::from_utf8(&source_map).unwrap(); 257 | Ok(source_map.to_string().into()) 258 | } 259 | None => Ok(JsValue::NULL), 260 | } 261 | }) 262 | } 263 | } 264 | 265 | /// Serialize a module graph into eszip. 266 | #[wasm_bindgen(js_name = build)] 267 | pub async fn build_eszip( 268 | roots: JsValue, 269 | loader: js_sys::Function, 270 | import_map_url: JsValue, 271 | ) -> Result { 272 | std::panic::set_hook(Box::new(console_error_panic_hook::hook)); 273 | let roots: Vec = 274 | serde_wasm_bindgen::from_value(roots) 275 | .map_err(|e| js_sys::Error::new(&e.to_string()))?; 276 | let loader = GraphLoader(loader); 277 | let import_map_url: Option = 278 | serde_wasm_bindgen::from_value(import_map_url) 279 | .map_err(|e| js_sys::Error::new(&e.to_string()))?; 280 | let (maybe_import_map, maybe_import_map_data) = if let Some(import_map_url) = 281 | import_map_url 282 | { 283 | let resp = deno_graph::source::Loader::load( 284 | &loader, 285 | &import_map_url, 286 | deno_graph::source::LoadOptions { 287 | in_dynamic_branch: false, 288 | was_dynamic_root: false, 289 | cache_setting: deno_graph::source::CacheSetting::Use, 290 | maybe_checksum: None, 291 | }, 292 | ) 293 | .await 294 | .map_err(|e| js_sys::Error::new(&e.to_string()))? 295 | .ok_or_else(|| { 296 | js_sys::Error::new(&format!("import map not found at '{import_map_url}'")) 297 | })?; 298 | match resp { 299 | deno_graph::source::LoadResponse::Module { 300 | specifier, content, .. 301 | } => { 302 | let import_map = import_map::parse_from_json_with_options( 303 | specifier.clone(), 304 | &String::from_utf8(content.to_vec()).unwrap(), 305 | import_map::ImportMapOptions { 306 | address_hook: None, 307 | // always do this for simplicity 308 | expand_imports: true, 309 | }, 310 | ) 311 | .unwrap(); 312 | (Some(import_map.import_map), Some((specifier, content))) 313 | } 314 | _ => unimplemented!(), 315 | } 316 | } else { 317 | (None, None) 318 | }; 319 | let resolver = GraphResolver(maybe_import_map); 320 | let analyzer = deno_graph::ast::CapturingModuleAnalyzer::default(); 321 | let mut graph = ModuleGraph::new(GraphKind::CodeOnly); 322 | graph 323 | .build( 324 | roots, 325 | Vec::new(), 326 | &loader, 327 | BuildOptions { 328 | resolver: Some(&resolver), 329 | module_analyzer: &analyzer, 330 | file_system: &sys_traits::impls::RealSys, 331 | ..Default::default() 332 | }, 333 | ) 334 | .await; 335 | graph 336 | .valid() 337 | .map_err(|e| js_sys::Error::new(&e.to_string()))?; 338 | let mut eszip = eszip::EszipV2::from_graph(eszip::FromGraphOptions { 339 | graph, 340 | module_kind_resolver: Default::default(), 341 | parser: analyzer.as_capturing_parser(), 342 | transpile_options: Default::default(), 343 | emit_options: Default::default(), 344 | relative_file_base: None, 345 | npm_packages: None, 346 | npm_snapshot: Default::default(), 347 | }) 348 | .map_err(|e| js_sys::Error::new(&e.to_string()))?; 349 | if let Some((import_map_specifier, import_map_content)) = 350 | maybe_import_map_data 351 | { 352 | eszip.add_import_map( 353 | ModuleKind::Json, 354 | import_map_specifier.to_string(), 355 | Arc::from(import_map_content), 356 | ) 357 | } 358 | Ok(Uint8Array::from(eszip.into_bytes().as_slice())) 359 | } 360 | 361 | // Taken from deno_graph 362 | // https://github.com/denoland/deno_graph/blob/main/src/js_graph.rs#L43 363 | pub struct GraphLoader(js_sys::Function); 364 | 365 | impl Loader for GraphLoader { 366 | fn get_cache_info(&self, _: &ModuleSpecifier) -> Option { 367 | None 368 | } 369 | 370 | fn load( 371 | &self, 372 | specifier: &ModuleSpecifier, 373 | options: LoadOptions, 374 | ) -> LoadFuture { 375 | #[derive(Serialize)] 376 | #[serde(rename_all = "camelCase")] 377 | struct JsLoadOptions { 378 | pub is_dynamic: bool, 379 | pub cache_setting: &'static str, 380 | pub checksum: Option, 381 | } 382 | 383 | if specifier.scheme() == "data" { 384 | Box::pin(std::future::ready(load_data_url(specifier).map_err( 385 | |err| { 386 | deno_graph::source::LoadError::Other(Arc::new(JsErrorBox::from_err( 387 | err, 388 | ))) 389 | }, 390 | ))) 391 | } else { 392 | let specifier = specifier.clone(); 393 | let result = self.0.call2( 394 | &JsValue::null(), 395 | &JsValue::from(specifier.to_string()), 396 | &serde_wasm_bindgen::to_value(&JsLoadOptions { 397 | is_dynamic: options.in_dynamic_branch, 398 | cache_setting: options.cache_setting.as_js_str(), 399 | checksum: options.maybe_checksum.map(|c| c.into_string()), 400 | }) 401 | .unwrap(), 402 | ); 403 | Box::pin(async move { 404 | let response = match result { 405 | Ok(result) => { 406 | wasm_bindgen_futures::JsFuture::from(js_sys::Promise::resolve( 407 | &result, 408 | )) 409 | .await 410 | } 411 | Err(err) => Err(err), 412 | }; 413 | response 414 | .map(|value| serde_wasm_bindgen::from_value(value).unwrap()) 415 | .map_err(|err| { 416 | let err_str = err 417 | .as_string() 418 | .unwrap_or_else(|| "an error occured during loading".to_string()); 419 | deno_graph::source::LoadError::Other(Arc::new(JsErrorBox::generic( 420 | err_str, 421 | ))) 422 | }) 423 | }) 424 | } 425 | } 426 | } 427 | 428 | #[derive(Debug)] 429 | pub struct GraphResolver(Option); 430 | 431 | impl Resolver for GraphResolver { 432 | fn resolve( 433 | &self, 434 | specifier: &str, 435 | referrer_range: &deno_graph::Range, 436 | _kind: deno_graph::source::ResolutionKind, 437 | ) -> Result { 438 | if let Some(import_map) = &self.0 { 439 | import_map 440 | .resolve(specifier, &referrer_range.specifier) 441 | .map_err(ResolveError::ImportMap) 442 | } else { 443 | Ok(deno_graph::resolve_import( 444 | specifier, 445 | &referrer_range.specifier, 446 | )?) 447 | } 448 | } 449 | } 450 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. 2 | 3 | #![deny(clippy::print_stderr)] 4 | #![deny(clippy::print_stdout)] 5 | #![deny(clippy::unused_async)] 6 | 7 | mod error; 8 | pub mod v1; 9 | pub mod v2; 10 | 11 | use std::sync::Arc; 12 | 13 | use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot; 14 | use futures::future::BoxFuture; 15 | use futures::future::LocalBoxFuture; 16 | use futures::io::AsyncBufReadExt; 17 | use futures::io::AsyncReadExt; 18 | use serde::Deserialize; 19 | use serde::Serialize; 20 | use v2::EszipV2Modules; 21 | use v2::EszipVersion; 22 | 23 | pub use crate::error::ParseError; 24 | pub use crate::v1::EszipV1; 25 | pub use crate::v2::EszipRelativeFileBaseUrl; 26 | pub use crate::v2::EszipV2; 27 | pub use crate::v2::FromGraphOptions; 28 | 29 | pub use deno_ast; 30 | pub use deno_graph; 31 | 32 | pub enum Eszip { 33 | V1(EszipV1), 34 | V2(EszipV2), 35 | } 36 | 37 | type EszipParserOutput = Result, ParseError>; 38 | 39 | /// This future needs to polled to parse the eszip file. 40 | type EszipParserFuture = BoxFuture<'static, EszipParserOutput>; 41 | /// This future needs to polled to parse the eszip file. 42 | type EszipParserLocalFuture = LocalBoxFuture<'static, EszipParserOutput>; 43 | 44 | impl Eszip { 45 | /// Parse a byte stream into an Eszip. This function completes when the header 46 | /// is fully received. This does not mean that the entire file is fully 47 | /// received or parsed yet. To finish parsing, the future returned by this 48 | /// function in the second tuple slot needs to be polled. 49 | pub async fn parse( 50 | reader: R, 51 | ) -> Result<(Eszip, EszipParserFuture), ParseError> { 52 | let mut reader = futures::io::BufReader::new(reader); 53 | let mut magic = [0; 8]; 54 | reader.read_exact(&mut magic).await?; 55 | if let Some(version) = EszipVersion::from_magic(&magic) { 56 | let (eszip, fut) = EszipV2::parse_with_version(version, reader).await?; 57 | Ok((Eszip::V2(eszip), Box::pin(fut))) 58 | } else { 59 | let mut buffer = Vec::new(); 60 | let mut reader_w_magic = magic.chain(&mut reader); 61 | reader_w_magic.read_to_end(&mut buffer).await?; 62 | let eszip = EszipV1::parse(&buffer)?; 63 | let fut = async move { Ok::<_, ParseError>(reader) }; 64 | Ok((Eszip::V1(eszip), Box::pin(fut))) 65 | } 66 | } 67 | 68 | /// Parse a byte stream into an Eszip. This function completes when the header 69 | /// is fully received. This does not mean that the entire file is fully 70 | /// received or parsed yet. To finish parsing, the future returned by this 71 | /// function in the second tuple slot needs to be polled. 72 | /// 73 | /// As opposed to [`Eszip::parse`], this method accepts `!Send` reader. The 74 | /// returned future does not implement `Send` either. 75 | pub async fn parse_local( 76 | reader: R, 77 | ) -> Result<(Eszip, EszipParserLocalFuture), ParseError> { 78 | let mut reader = futures::io::BufReader::new(reader); 79 | reader.fill_buf().await?; 80 | let buffer = reader.buffer(); 81 | if EszipV2::has_magic(buffer) { 82 | let (eszip, fut) = EszipV2::parse(reader).await?; 83 | Ok((Eszip::V2(eszip), Box::pin(fut))) 84 | } else { 85 | let mut buffer = Vec::new(); 86 | reader.read_to_end(&mut buffer).await?; 87 | let eszip = EszipV1::parse(&buffer)?; 88 | let fut = async move { Ok::<_, ParseError>(reader) }; 89 | Ok((Eszip::V1(eszip), Box::pin(fut))) 90 | } 91 | } 92 | 93 | /// Get the module metadata for a given module specifier. This function will 94 | /// follow redirects. The returned module has functions that can be used to 95 | /// obtain the module source and source map. The module returned from this 96 | /// function is guaranteed to be a valid module, which can be loaded into v8. 97 | /// 98 | /// Note that this function should be used to obtain a module; if you wish to 99 | /// get an import map, use [`get_import_map`](Self::get_import_map) instead. 100 | pub fn get_module(&self, specifier: &str) -> Option { 101 | match self { 102 | Eszip::V1(eszip) => eszip.get_module(specifier), 103 | Eszip::V2(eszip) => eszip.get_module(specifier), 104 | } 105 | } 106 | 107 | /// Get the import map for a given specifier. 108 | /// 109 | /// Note that this function should be used to obtain an import map; the returned 110 | /// "Module" is not necessarily a valid module that can be loaded into v8 (in 111 | /// other words, JSONC may be returned). If you wish to get a valid module, 112 | /// use [`get_module`](Self::get_module) instead. 113 | pub fn get_import_map(&self, specifier: &str) -> Option { 114 | match self { 115 | Eszip::V1(eszip) => eszip.get_import_map(specifier), 116 | Eszip::V2(eszip) => eszip.get_import_map(specifier), 117 | } 118 | } 119 | 120 | /// Takes the npm snapshot out of the eszip. 121 | pub fn take_npm_snapshot( 122 | &mut self, 123 | ) -> Option { 124 | match self { 125 | Eszip::V1(_) => None, 126 | Eszip::V2(eszip) => eszip.take_npm_snapshot(), 127 | } 128 | } 129 | } 130 | 131 | /// Get an iterator over all the modules (including an import map, if any) in 132 | /// this eszip archive. 133 | /// 134 | /// Note that the iterator will iterate over the specifiers' "snapshot" of the 135 | /// archive. If a new module is added to the archive after the iterator is 136 | /// created via `into_iter()`, that module will not be iterated over. 137 | impl IntoIterator for Eszip { 138 | type Item = (String, Module); 139 | type IntoIter = std::vec::IntoIter; 140 | 141 | fn into_iter(self) -> Self::IntoIter { 142 | match self { 143 | Eszip::V1(eszip) => eszip.into_iter(), 144 | Eszip::V2(eszip) => eszip.into_iter(), 145 | } 146 | } 147 | } 148 | 149 | pub struct Module { 150 | pub specifier: String, 151 | pub kind: ModuleKind, 152 | inner: ModuleInner, 153 | } 154 | 155 | pub enum ModuleInner { 156 | V1(EszipV1), 157 | V2(EszipV2Modules), 158 | } 159 | 160 | impl Module { 161 | /// Get source code of the module. 162 | pub async fn source(&self) -> Option> { 163 | match &self.inner { 164 | ModuleInner::V1(eszip_v1) => eszip_v1.get_module_source(&self.specifier), 165 | ModuleInner::V2(eszip_v2) => { 166 | eszip_v2.get_module_source(&self.specifier).await 167 | } 168 | } 169 | } 170 | 171 | /// Take source code of the module. This will remove the source code from memory and 172 | /// the subsequent calls to `take_source()` will return `None`. 173 | /// For V1, this will take the entire module and returns the source code. We don't need 174 | /// to preserve module metadata for V1. 175 | pub async fn take_source(&self) -> Option> { 176 | match &self.inner { 177 | ModuleInner::V1(eszip_v1) => eszip_v1.take(&self.specifier), 178 | ModuleInner::V2(eszip_v2) => { 179 | eszip_v2.take_module_source(&self.specifier).await 180 | } 181 | } 182 | } 183 | 184 | /// Get source map of the module. 185 | pub async fn source_map(&self) -> Option> { 186 | match &self.inner { 187 | ModuleInner::V1(_) => None, 188 | ModuleInner::V2(eszip) => { 189 | eszip.get_module_source_map(&self.specifier).await 190 | } 191 | } 192 | } 193 | 194 | /// Take source map of the module. This will remove the source map from memory and 195 | /// the subsequent calls to `take_source_map()` will return `None`. 196 | pub async fn take_source_map(&self) -> Option> { 197 | match &self.inner { 198 | ModuleInner::V1(_) => None, 199 | ModuleInner::V2(eszip) => { 200 | eszip.take_module_source_map(&self.specifier).await 201 | } 202 | } 203 | } 204 | } 205 | 206 | /// This is the kind of module that is being stored. This is the same enum as is 207 | /// present in [deno_core::ModuleType] except that this has additional variant 208 | /// `Jsonc` which is used when an import map is embedded in Deno's config file 209 | /// that can be JSONC. 210 | /// Note that a module of type `Jsonc` can be used only as an import map, not as 211 | /// a normal module. 212 | #[repr(u8)] 213 | #[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] 214 | #[serde(rename_all = "lowercase")] 215 | pub enum ModuleKind { 216 | JavaScript = 0, 217 | Json = 1, 218 | Jsonc = 2, 219 | OpaqueData = 3, 220 | Wasm = 4, 221 | } 222 | 223 | #[cfg(test)] 224 | mod tests { 225 | use super::*; 226 | use futures::StreamExt; 227 | use futures::TryStreamExt; 228 | use futures::io::AllowStdIo; 229 | use futures::stream; 230 | 231 | #[tokio::test] 232 | async fn parse_v1() { 233 | let file = std::fs::File::open("./src/testdata/basic.json").unwrap(); 234 | let (eszip, fut) = Eszip::parse(AllowStdIo::new(file)).await.unwrap(); 235 | fut.await.unwrap(); 236 | assert!(matches!(eszip, Eszip::V1(_))); 237 | eszip.get_module("https://gist.githubusercontent.com/lucacasonato/f3e21405322259ca4ed155722390fda2/raw/e25acb49b681e8e1da5a2a33744b7a36d538712d/hello.js").unwrap(); 238 | } 239 | 240 | #[cfg(feature = "sha256")] 241 | #[tokio::test] 242 | async fn parse_v2() { 243 | let file = std::fs::File::open("./src/testdata/redirect.eszip2").unwrap(); 244 | let (eszip, fut) = Eszip::parse(AllowStdIo::new(file)).await.unwrap(); 245 | fut.await.unwrap(); 246 | assert!(matches!(eszip, Eszip::V2(_))); 247 | eszip.get_module("file:///main.ts").unwrap(); 248 | } 249 | 250 | #[tokio::test] 251 | async fn take_source_v1() { 252 | let file = std::fs::File::open("./src/testdata/basic.json").unwrap(); 253 | let (eszip, fut) = Eszip::parse(AllowStdIo::new(file)).await.unwrap(); 254 | fut.await.unwrap(); 255 | assert!(matches!(eszip, Eszip::V1(_))); 256 | let specifier = "https://gist.githubusercontent.com/lucacasonato/f3e21405322259ca4ed155722390fda2/raw/e25acb49b681e8e1da5a2a33744b7a36d538712d/hello.js"; 257 | let module = eszip.get_module(specifier).unwrap(); 258 | assert_eq!(module.specifier, specifier); 259 | // We're taking the source from memory. 260 | let source = module.take_source().await.unwrap(); 261 | assert!(!source.is_empty()); 262 | // Source maps are not supported in v1 and should always return None. 263 | assert!(module.source_map().await.is_none()); 264 | // Module shouldn't be available anymore. 265 | assert!(eszip.get_module(specifier).is_none()); 266 | } 267 | 268 | #[cfg(feature = "sha256")] 269 | #[tokio::test] 270 | async fn take_source_v2() { 271 | let file = std::fs::File::open("./src/testdata/redirect.eszip2").unwrap(); 272 | let (eszip, fut) = Eszip::parse(AllowStdIo::new(file)).await.unwrap(); 273 | fut.await.unwrap(); 274 | assert!(matches!(eszip, Eszip::V2(_))); 275 | let specifier = "file:///main.ts"; 276 | let module = eszip.get_module(specifier).unwrap(); 277 | // We're taking the source from memory. 278 | let source = module.take_source().await.unwrap(); 279 | assert!(!source.is_empty()); 280 | let module = eszip.get_module(specifier).unwrap(); 281 | assert_eq!(module.specifier, specifier); 282 | // Source shouldn't be available anymore. 283 | assert!(module.source().await.is_none()); 284 | // We didn't take the source map, so it should still be available. 285 | assert!(module.source_map().await.is_some()); 286 | // Now we're taking the source map. 287 | let source_map = module.take_source_map().await.unwrap(); 288 | assert!(!source_map.is_empty()); 289 | // Source map shouldn't be available anymore. 290 | assert!(module.source_map().await.is_none()); 291 | } 292 | 293 | #[tokio::test] 294 | async fn test_eszip_v1_iterator() { 295 | let file = std::fs::File::open("./src/testdata/basic.json").unwrap(); 296 | let (eszip, fut) = Eszip::parse(AllowStdIo::new(file)).await.unwrap(); 297 | tokio::spawn(fut); 298 | assert!(matches!(eszip, Eszip::V1(_))); 299 | 300 | struct Expected { 301 | specifier: String, 302 | source: &'static str, 303 | kind: ModuleKind, 304 | } 305 | 306 | let expected = vec![ 307 | Expected { 308 | specifier: "https://gist.githubusercontent.com/lucacasonato/f3e21405322259ca4ed155722390fda2/raw/e25acb49b681e8e1da5a2a33744b7a36d538712d/hello.js".to_string(), 309 | source: "addEventListener(\"fetch\", (event)=>{\n event.respondWith(new Response(\"Hello World\", {\n headers: {\n \"content-type\": \"text/plain\"\n }\n }));\n});\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIjxodHRwczovL2dpc3QuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2x1Y2FjYXNvbmF0by9mM2UyMTQwNTMyMjI1OWNhNGVkMTU1NzIyMzkwZmRhMi9yYXcvZTI1YWNiNDliNjgxZThlMWRhNWEyYTMzNzQ0YjdhMzZkNTM4NzEyZC9oZWxsby5qcz4iXSwic291cmNlc0NvbnRlbnQiOlsiYWRkRXZlbnRMaXN0ZW5lcihcImZldGNoXCIsIChldmVudCkgPT4ge1xuICBldmVudC5yZXNwb25kV2l0aChuZXcgUmVzcG9uc2UoXCJIZWxsbyBXb3JsZFwiLCB7XG4gICAgaGVhZGVyczogeyBcImNvbnRlbnQtdHlwZVwiOiBcInRleHQvcGxhaW5cIiB9LFxuICB9KSk7XG59KTsiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQUEsRUFBQSxLQUFBLElBQUEsS0FBQTtBQUNBLFNBQUEsQ0FBQSxXQUFBLEtBQUEsUUFBQSxFQUFBLFdBQUE7QUFDQSxlQUFBO2FBQUEsWUFBQSxJQUFBLFVBQUEifQ==", 310 | kind: ModuleKind::JavaScript, 311 | }, 312 | ]; 313 | 314 | for (got, expected) in eszip.into_iter().zip(expected) { 315 | let (got_specifier, got_module) = got; 316 | 317 | assert_eq!(got_specifier, expected.specifier); 318 | assert_eq!(got_module.kind, expected.kind); 319 | assert_eq!( 320 | String::from_utf8_lossy(&got_module.source().await.unwrap()), 321 | expected.source 322 | ); 323 | } 324 | } 325 | 326 | #[cfg(feature = "sha256")] 327 | #[tokio::test] 328 | async fn test_eszip_v2_iterator() { 329 | let file = std::fs::File::open("./src/testdata/redirect.eszip2").unwrap(); 330 | let (eszip, fut) = Eszip::parse(AllowStdIo::new(file)).await.unwrap(); 331 | tokio::spawn(fut); 332 | assert!(matches!(eszip, Eszip::V2(_))); 333 | 334 | struct Expected { 335 | specifier: String, 336 | source: &'static str, 337 | kind: ModuleKind, 338 | } 339 | 340 | let expected = vec![ 341 | Expected { 342 | specifier: "file:///main.ts".to_string(), 343 | source: "export * as a from \"./a.ts\";\n", 344 | kind: ModuleKind::JavaScript, 345 | }, 346 | Expected { 347 | specifier: "file:///b.ts".to_string(), 348 | source: "export const b = \"b\";\n", 349 | kind: ModuleKind::JavaScript, 350 | }, 351 | Expected { 352 | specifier: "file:///a.ts".to_string(), 353 | source: "export const b = \"b\";\n", 354 | kind: ModuleKind::JavaScript, 355 | }, 356 | ]; 357 | 358 | for (got, expected) in eszip.into_iter().zip(expected) { 359 | let (got_specifier, got_module) = got; 360 | 361 | assert_eq!(got_specifier, expected.specifier); 362 | assert_eq!(got_module.kind, expected.kind); 363 | assert_eq!( 364 | String::from_utf8_lossy(&got_module.source().await.unwrap()), 365 | expected.source 366 | ); 367 | } 368 | } 369 | 370 | #[tokio::test] 371 | async fn parse_small_chunks_reader() { 372 | let bytes = std::fs::read("./src/testdata/redirect.eszip2") 373 | .unwrap() 374 | .chunks(2) 375 | .map(|chunk| chunk.to_vec()) 376 | .collect::>(); 377 | let reader = stream::iter(bytes) 378 | .map(std::io::Result::Ok) 379 | .into_async_read(); 380 | 381 | let (eszip, fut) = Eszip::parse(reader).await.unwrap(); 382 | fut.await.unwrap(); 383 | assert!(matches!(eszip, Eszip::V2(_))); 384 | } 385 | } 386 | -------------------------------------------------------------------------------- /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 = "addr2line" 7 | version = "0.24.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler2" 16 | version = "2.0.1" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 19 | 20 | [[package]] 21 | name = "ahash" 22 | version = "0.8.12" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" 25 | dependencies = [ 26 | "cfg-if", 27 | "once_cell", 28 | "version_check", 29 | "zerocopy", 30 | ] 31 | 32 | [[package]] 33 | name = "aho-corasick" 34 | version = "1.1.3" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 37 | dependencies = [ 38 | "memchr", 39 | ] 40 | 41 | [[package]] 42 | name = "allocator-api2" 43 | version = "0.2.21" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 46 | 47 | [[package]] 48 | name = "anes" 49 | version = "0.1.6" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" 52 | 53 | [[package]] 54 | name = "anstyle" 55 | version = "1.0.11" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" 58 | 59 | [[package]] 60 | name = "anyhow" 61 | version = "1.0.99" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" 64 | 65 | [[package]] 66 | name = "ascii" 67 | version = "1.1.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" 70 | 71 | [[package]] 72 | name = "ast_node" 73 | version = "5.0.0" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "2eb025ef00a6da925cf40870b9c8d008526b6004ece399cb0974209720f0b194" 76 | dependencies = [ 77 | "quote", 78 | "swc_macros_common", 79 | "syn", 80 | ] 81 | 82 | [[package]] 83 | name = "async-trait" 84 | version = "0.1.89" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" 87 | dependencies = [ 88 | "proc-macro2", 89 | "quote", 90 | "syn", 91 | ] 92 | 93 | [[package]] 94 | name = "autocfg" 95 | version = "1.5.0" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 98 | 99 | [[package]] 100 | name = "backtrace" 101 | version = "0.3.75" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" 104 | dependencies = [ 105 | "addr2line", 106 | "cfg-if", 107 | "libc", 108 | "miniz_oxide", 109 | "object", 110 | "rustc-demangle", 111 | "windows-targets 0.52.6", 112 | ] 113 | 114 | [[package]] 115 | name = "base64" 116 | version = "0.21.7" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 119 | 120 | [[package]] 121 | name = "base64" 122 | version = "0.22.1" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 125 | 126 | [[package]] 127 | name = "base64-simd" 128 | version = "0.8.0" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" 131 | dependencies = [ 132 | "outref", 133 | "vsimd", 134 | ] 135 | 136 | [[package]] 137 | name = "better_scoped_tls" 138 | version = "1.0.1" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "7cd228125315b132eed175bf47619ac79b945b26e56b848ba203ae4ea8603609" 141 | dependencies = [ 142 | "scoped-tls", 143 | ] 144 | 145 | [[package]] 146 | name = "bitflags" 147 | version = "1.3.2" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 150 | 151 | [[package]] 152 | name = "bitflags" 153 | version = "2.9.3" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" 156 | 157 | [[package]] 158 | name = "bitvec" 159 | version = "1.0.1" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 162 | dependencies = [ 163 | "funty", 164 | "radium", 165 | "tap", 166 | "wyz", 167 | ] 168 | 169 | [[package]] 170 | name = "block-buffer" 171 | version = "0.10.4" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 174 | dependencies = [ 175 | "generic-array", 176 | ] 177 | 178 | [[package]] 179 | name = "boxed_error" 180 | version = "0.2.3" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "17d4f95e880cfd28c4ca5a006cf7f6af52b4bcb7b5866f573b2faa126fb7affb" 183 | dependencies = [ 184 | "quote", 185 | "syn", 186 | ] 187 | 188 | [[package]] 189 | name = "bumpalo" 190 | version = "3.19.0" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" 193 | dependencies = [ 194 | "allocator-api2", 195 | ] 196 | 197 | [[package]] 198 | name = "bytes" 199 | version = "1.10.1" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 202 | 203 | [[package]] 204 | name = "bytes-str" 205 | version = "0.2.7" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "7c60b5ce37e0b883c37eb89f79a1e26fbe9c1081945d024eee93e8d91a7e18b3" 208 | dependencies = [ 209 | "bytes", 210 | "serde", 211 | ] 212 | 213 | [[package]] 214 | name = "capacity_builder" 215 | version = "0.5.0" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "8f2d24a6dcf0cd402a21b65d35340f3a49ff3475dc5fdac91d22d2733e6641c6" 218 | dependencies = [ 219 | "capacity_builder_macros", 220 | "ecow", 221 | "hipstr", 222 | "itoa", 223 | ] 224 | 225 | [[package]] 226 | name = "capacity_builder_macros" 227 | version = "0.3.0" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "3b4a6cae9efc04cc6cbb8faf338d2c497c165c83e74509cf4dbedea948bbf6e5" 230 | dependencies = [ 231 | "quote", 232 | "syn", 233 | ] 234 | 235 | [[package]] 236 | name = "cast" 237 | version = "0.3.0" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" 240 | 241 | [[package]] 242 | name = "castaway" 243 | version = "0.2.4" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" 246 | dependencies = [ 247 | "rustversion", 248 | ] 249 | 250 | [[package]] 251 | name = "cc" 252 | version = "1.2.34" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc" 255 | dependencies = [ 256 | "shlex", 257 | ] 258 | 259 | [[package]] 260 | name = "cfg-if" 261 | version = "1.0.3" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" 264 | 265 | [[package]] 266 | name = "chrono" 267 | version = "0.4.42" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" 270 | dependencies = [ 271 | "num-traits", 272 | "serde", 273 | ] 274 | 275 | [[package]] 276 | name = "ciborium" 277 | version = "0.2.2" 278 | source = "registry+https://github.com/rust-lang/crates.io-index" 279 | checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" 280 | dependencies = [ 281 | "ciborium-io", 282 | "ciborium-ll", 283 | "serde", 284 | ] 285 | 286 | [[package]] 287 | name = "ciborium-io" 288 | version = "0.2.2" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" 291 | 292 | [[package]] 293 | name = "ciborium-ll" 294 | version = "0.2.2" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" 297 | dependencies = [ 298 | "ciborium-io", 299 | "half", 300 | ] 301 | 302 | [[package]] 303 | name = "clap" 304 | version = "4.5.46" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57" 307 | dependencies = [ 308 | "clap_builder", 309 | ] 310 | 311 | [[package]] 312 | name = "clap_builder" 313 | version = "4.5.46" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41" 316 | dependencies = [ 317 | "anstyle", 318 | "clap_lex", 319 | ] 320 | 321 | [[package]] 322 | name = "clap_lex" 323 | version = "0.7.5" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" 326 | 327 | [[package]] 328 | name = "compact_str" 329 | version = "0.7.1" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" 332 | dependencies = [ 333 | "castaway", 334 | "cfg-if", 335 | "itoa", 336 | "ryu", 337 | "static_assertions", 338 | ] 339 | 340 | [[package]] 341 | name = "console" 342 | version = "0.15.11" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" 345 | dependencies = [ 346 | "encode_unicode", 347 | "libc", 348 | "once_cell", 349 | "windows-sys 0.59.0", 350 | ] 351 | 352 | [[package]] 353 | name = "console_error_panic_hook" 354 | version = "0.1.7" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" 357 | dependencies = [ 358 | "cfg-if", 359 | "wasm-bindgen", 360 | ] 361 | 362 | [[package]] 363 | name = "core-foundation" 364 | version = "0.9.4" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 367 | dependencies = [ 368 | "core-foundation-sys", 369 | "libc", 370 | ] 371 | 372 | [[package]] 373 | name = "core-foundation-sys" 374 | version = "0.8.7" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 377 | 378 | [[package]] 379 | name = "cpufeatures" 380 | version = "0.2.17" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" 383 | dependencies = [ 384 | "libc", 385 | ] 386 | 387 | [[package]] 388 | name = "criterion" 389 | version = "0.5.1" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" 392 | dependencies = [ 393 | "anes", 394 | "cast", 395 | "ciborium", 396 | "clap", 397 | "criterion-plot", 398 | "futures", 399 | "is-terminal", 400 | "itertools", 401 | "num-traits", 402 | "once_cell", 403 | "oorandom", 404 | "plotters", 405 | "rayon", 406 | "regex", 407 | "serde", 408 | "serde_derive", 409 | "serde_json", 410 | "tinytemplate", 411 | "tokio", 412 | "walkdir", 413 | ] 414 | 415 | [[package]] 416 | name = "criterion-plot" 417 | version = "0.5.0" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" 420 | dependencies = [ 421 | "cast", 422 | "itertools", 423 | ] 424 | 425 | [[package]] 426 | name = "crossbeam-deque" 427 | version = "0.8.6" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" 430 | dependencies = [ 431 | "crossbeam-epoch", 432 | "crossbeam-utils", 433 | ] 434 | 435 | [[package]] 436 | name = "crossbeam-epoch" 437 | version = "0.9.18" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 440 | dependencies = [ 441 | "crossbeam-utils", 442 | ] 443 | 444 | [[package]] 445 | name = "crossbeam-utils" 446 | version = "0.8.21" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" 449 | 450 | [[package]] 451 | name = "crunchy" 452 | version = "0.2.4" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" 455 | 456 | [[package]] 457 | name = "crypto-common" 458 | version = "0.1.6" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 461 | dependencies = [ 462 | "generic-array", 463 | "typenum", 464 | ] 465 | 466 | [[package]] 467 | name = "data-encoding" 468 | version = "2.9.0" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" 471 | 472 | [[package]] 473 | name = "data-url" 474 | version = "0.3.2" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" 477 | 478 | [[package]] 479 | name = "debugid" 480 | version = "0.8.0" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" 483 | dependencies = [ 484 | "serde", 485 | "uuid", 486 | ] 487 | 488 | [[package]] 489 | name = "deno_ast" 490 | version = "0.52.0" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | checksum = "30c2f6f65154faed61e45d6578566f9fab9d2a330c35c87366706883701cce51" 493 | dependencies = [ 494 | "base64 0.22.1", 495 | "capacity_builder", 496 | "deno_error", 497 | "deno_media_type", 498 | "deno_terminal", 499 | "dprint-swc-ext", 500 | "percent-encoding", 501 | "serde", 502 | "swc_atoms", 503 | "swc_common", 504 | "swc_config", 505 | "swc_config_macro", 506 | "swc_ecma_ast", 507 | "swc_ecma_codegen", 508 | "swc_ecma_codegen_macros", 509 | "swc_ecma_lexer", 510 | "swc_ecma_loader", 511 | "swc_ecma_parser", 512 | "swc_ecma_transforms_base", 513 | "swc_ecma_transforms_classes", 514 | "swc_ecma_transforms_macros", 515 | "swc_ecma_transforms_proposal", 516 | "swc_ecma_transforms_react", 517 | "swc_ecma_transforms_typescript", 518 | "swc_ecma_utils", 519 | "swc_ecma_visit", 520 | "swc_eq_ignore_macros", 521 | "swc_macros_common", 522 | "swc_sourcemap", 523 | "swc_visit", 524 | "text_lines", 525 | "thiserror", 526 | "unicode-width", 527 | "url", 528 | ] 529 | 530 | [[package]] 531 | name = "deno_error" 532 | version = "0.7.0" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "dde60bd153886964234c5012d3d9caf788287f28d81fb24a884436904101ef10" 535 | dependencies = [ 536 | "deno_error_macro", 537 | "libc", 538 | "serde", 539 | "serde_json", 540 | "url", 541 | ] 542 | 543 | [[package]] 544 | name = "deno_error_macro" 545 | version = "0.7.0" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "409f265785bd946d3006756955aaf40b0e4deb25752eae6a990afe54a31cfd83" 548 | dependencies = [ 549 | "proc-macro2", 550 | "quote", 551 | "syn", 552 | ] 553 | 554 | [[package]] 555 | name = "deno_graph" 556 | version = "0.105.0" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "7fd6d3843cfbbd8803b6ef81025af98519651880e6ffd50ee01bb7251afbd6f5" 559 | dependencies = [ 560 | "async-trait", 561 | "boxed_error", 562 | "capacity_builder", 563 | "chrono", 564 | "data-url", 565 | "deno_ast", 566 | "deno_error", 567 | "deno_media_type", 568 | "deno_path_util", 569 | "deno_semver", 570 | "deno_unsync", 571 | "futures", 572 | "import_map", 573 | "indexmap", 574 | "log", 575 | "monch", 576 | "once_cell", 577 | "parking_lot", 578 | "regex", 579 | "serde", 580 | "serde_json", 581 | "sha2", 582 | "sys_traits", 583 | "thiserror", 584 | "url", 585 | "wasm_dep_analyzer", 586 | ] 587 | 588 | [[package]] 589 | name = "deno_lockfile" 590 | version = "0.32.0" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "79df4fa29c2e423822bfef1ab5e83093b48481824d5ef7a61c1de1c32c7c302a" 593 | dependencies = [ 594 | "async-trait", 595 | "deno_semver", 596 | "serde", 597 | "serde_json", 598 | "thiserror", 599 | ] 600 | 601 | [[package]] 602 | name = "deno_media_type" 603 | version = "0.3.3" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "9fd0af4161f90b092feb363864a64d7c74e0efc13a15905d0d09df73bb72a123" 606 | dependencies = [ 607 | "data-url", 608 | "encoding_rs", 609 | "serde", 610 | "url", 611 | ] 612 | 613 | [[package]] 614 | name = "deno_npm" 615 | version = "0.42.0" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "ae246f5c39baf58dfbb8250068ec35223f4c4c19889bfad732d92a035bf74fe6" 618 | dependencies = [ 619 | "async-trait", 620 | "capacity_builder", 621 | "chrono", 622 | "deno_error", 623 | "deno_lockfile", 624 | "deno_semver", 625 | "futures", 626 | "indexmap", 627 | "log", 628 | "monch", 629 | "serde", 630 | "serde_json", 631 | "thiserror", 632 | "url", 633 | ] 634 | 635 | [[package]] 636 | name = "deno_path_util" 637 | version = "0.6.1" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "bfe02936964b2910719bd488841f6e884349360113c7abf6f4c6b28ca9cd7a19" 640 | dependencies = [ 641 | "deno_error", 642 | "percent-encoding", 643 | "sys_traits", 644 | "thiserror", 645 | "url", 646 | ] 647 | 648 | [[package]] 649 | name = "deno_semver" 650 | version = "0.9.0" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "2625b7107cc3f61a462886d5fa77c23e063c1fd15b90e3d5ee2646e9f6178d55" 653 | dependencies = [ 654 | "capacity_builder", 655 | "deno_error", 656 | "ecow", 657 | "hipstr", 658 | "monch", 659 | "once_cell", 660 | "serde", 661 | "thiserror", 662 | "url", 663 | ] 664 | 665 | [[package]] 666 | name = "deno_terminal" 667 | version = "0.2.2" 668 | source = "registry+https://github.com/rust-lang/crates.io-index" 669 | checksum = "23f71c27009e0141dedd315f1dfa3ebb0a6ca4acce7c080fac576ea415a465f6" 670 | dependencies = [ 671 | "once_cell", 672 | "termcolor", 673 | ] 674 | 675 | [[package]] 676 | name = "deno_unsync" 677 | version = "0.4.4" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "6742a724e8becb372a74c650a1aefb8924a5b8107f7d75b3848763ea24b27a87" 680 | dependencies = [ 681 | "futures-util", 682 | "parking_lot", 683 | "tokio", 684 | ] 685 | 686 | [[package]] 687 | name = "diff" 688 | version = "0.1.13" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" 691 | 692 | [[package]] 693 | name = "digest" 694 | version = "0.10.7" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 697 | dependencies = [ 698 | "block-buffer", 699 | "crypto-common", 700 | ] 701 | 702 | [[package]] 703 | name = "displaydoc" 704 | version = "0.2.5" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" 707 | dependencies = [ 708 | "proc-macro2", 709 | "quote", 710 | "syn", 711 | ] 712 | 713 | [[package]] 714 | name = "dprint-swc-ext" 715 | version = "0.26.0" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | checksum = "33175ddb7a6d418589cab2966bd14a710b3b1139459d3d5ca9edf783c4833f4c" 718 | dependencies = [ 719 | "num-bigint", 720 | "rustc-hash", 721 | "swc_atoms", 722 | "swc_common", 723 | "swc_ecma_ast", 724 | "swc_ecma_lexer", 725 | "swc_ecma_parser", 726 | "text_lines", 727 | ] 728 | 729 | [[package]] 730 | name = "ecow" 731 | version = "0.2.6" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "78e4f79b296fbaab6ce2e22d52cb4c7f010fe0ebe7a32e34fa25885fd797bd02" 734 | dependencies = [ 735 | "serde", 736 | ] 737 | 738 | [[package]] 739 | name = "either" 740 | version = "1.15.0" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 743 | 744 | [[package]] 745 | name = "encode_unicode" 746 | version = "1.0.0" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" 749 | 750 | [[package]] 751 | name = "encoding_rs" 752 | version = "0.8.35" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 755 | dependencies = [ 756 | "cfg-if", 757 | ] 758 | 759 | [[package]] 760 | name = "equivalent" 761 | version = "1.0.2" 762 | source = "registry+https://github.com/rust-lang/crates.io-index" 763 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 764 | 765 | [[package]] 766 | name = "errno" 767 | version = "0.3.13" 768 | source = "registry+https://github.com/rust-lang/crates.io-index" 769 | checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" 770 | dependencies = [ 771 | "libc", 772 | "windows-sys 0.59.0", 773 | ] 774 | 775 | [[package]] 776 | name = "eszip" 777 | version = "0.106.0" 778 | dependencies = [ 779 | "anyhow", 780 | "async-trait", 781 | "base64 0.21.7", 782 | "criterion", 783 | "deno_ast", 784 | "deno_error", 785 | "deno_graph", 786 | "deno_npm", 787 | "deno_semver", 788 | "futures", 789 | "hashlink", 790 | "import_map", 791 | "indexmap", 792 | "insta", 793 | "jsonc-parser", 794 | "pretty_assertions", 795 | "reqwest", 796 | "serde", 797 | "serde_json", 798 | "sha2", 799 | "thiserror", 800 | "tokio", 801 | "url", 802 | "xxhash-rust", 803 | ] 804 | 805 | [[package]] 806 | name = "eszip_wasm" 807 | version = "0.0.0" 808 | dependencies = [ 809 | "anyhow", 810 | "console_error_panic_hook", 811 | "deno_error", 812 | "deno_graph", 813 | "eszip", 814 | "futures", 815 | "getrandom 0.2.16", 816 | "import_map", 817 | "js-sys", 818 | "serde", 819 | "serde-wasm-bindgen", 820 | "sys_traits", 821 | "wasm-bindgen", 822 | "wasm-bindgen-futures", 823 | "web-sys", 824 | ] 825 | 826 | [[package]] 827 | name = "fastrand" 828 | version = "2.3.0" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 831 | 832 | [[package]] 833 | name = "fnv" 834 | version = "1.0.7" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 837 | 838 | [[package]] 839 | name = "foreign-types" 840 | version = "0.3.2" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 843 | dependencies = [ 844 | "foreign-types-shared", 845 | ] 846 | 847 | [[package]] 848 | name = "foreign-types-shared" 849 | version = "0.1.1" 850 | source = "registry+https://github.com/rust-lang/crates.io-index" 851 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 852 | 853 | [[package]] 854 | name = "form_urlencoded" 855 | version = "1.2.2" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" 858 | dependencies = [ 859 | "percent-encoding", 860 | ] 861 | 862 | [[package]] 863 | name = "from_variant" 864 | version = "3.0.0" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "e5ff35a391aef949120a0340d690269b3d9f63460a6106e99bd07b961f345ea9" 867 | dependencies = [ 868 | "swc_macros_common", 869 | "syn", 870 | ] 871 | 872 | [[package]] 873 | name = "funty" 874 | version = "2.0.0" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 877 | 878 | [[package]] 879 | name = "futures" 880 | version = "0.3.31" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" 883 | dependencies = [ 884 | "futures-channel", 885 | "futures-core", 886 | "futures-executor", 887 | "futures-io", 888 | "futures-sink", 889 | "futures-task", 890 | "futures-util", 891 | ] 892 | 893 | [[package]] 894 | name = "futures-channel" 895 | version = "0.3.31" 896 | source = "registry+https://github.com/rust-lang/crates.io-index" 897 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 898 | dependencies = [ 899 | "futures-core", 900 | "futures-sink", 901 | ] 902 | 903 | [[package]] 904 | name = "futures-core" 905 | version = "0.3.31" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 908 | 909 | [[package]] 910 | name = "futures-executor" 911 | version = "0.3.31" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" 914 | dependencies = [ 915 | "futures-core", 916 | "futures-task", 917 | "futures-util", 918 | ] 919 | 920 | [[package]] 921 | name = "futures-io" 922 | version = "0.3.31" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" 925 | 926 | [[package]] 927 | name = "futures-macro" 928 | version = "0.3.31" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" 931 | dependencies = [ 932 | "proc-macro2", 933 | "quote", 934 | "syn", 935 | ] 936 | 937 | [[package]] 938 | name = "futures-sink" 939 | version = "0.3.31" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 942 | 943 | [[package]] 944 | name = "futures-task" 945 | version = "0.3.31" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 948 | 949 | [[package]] 950 | name = "futures-util" 951 | version = "0.3.31" 952 | source = "registry+https://github.com/rust-lang/crates.io-index" 953 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 954 | dependencies = [ 955 | "futures-channel", 956 | "futures-core", 957 | "futures-io", 958 | "futures-macro", 959 | "futures-sink", 960 | "futures-task", 961 | "memchr", 962 | "pin-project-lite", 963 | "pin-utils", 964 | "slab", 965 | ] 966 | 967 | [[package]] 968 | name = "generic-array" 969 | version = "0.14.7" 970 | source = "registry+https://github.com/rust-lang/crates.io-index" 971 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 972 | dependencies = [ 973 | "typenum", 974 | "version_check", 975 | ] 976 | 977 | [[package]] 978 | name = "getrandom" 979 | version = "0.2.16" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" 982 | dependencies = [ 983 | "cfg-if", 984 | "js-sys", 985 | "libc", 986 | "wasi 0.11.1+wasi-snapshot-preview1", 987 | "wasm-bindgen", 988 | ] 989 | 990 | [[package]] 991 | name = "getrandom" 992 | version = "0.3.3" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" 995 | dependencies = [ 996 | "cfg-if", 997 | "libc", 998 | "r-efi", 999 | "wasi 0.14.2+wasi-0.2.4", 1000 | ] 1001 | 1002 | [[package]] 1003 | name = "gimli" 1004 | version = "0.31.1" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" 1007 | 1008 | [[package]] 1009 | name = "h2" 1010 | version = "0.3.27" 1011 | source = "registry+https://github.com/rust-lang/crates.io-index" 1012 | checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" 1013 | dependencies = [ 1014 | "bytes", 1015 | "fnv", 1016 | "futures-core", 1017 | "futures-sink", 1018 | "futures-util", 1019 | "http", 1020 | "indexmap", 1021 | "slab", 1022 | "tokio", 1023 | "tokio-util", 1024 | "tracing", 1025 | ] 1026 | 1027 | [[package]] 1028 | name = "half" 1029 | version = "2.6.0" 1030 | source = "registry+https://github.com/rust-lang/crates.io-index" 1031 | checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" 1032 | dependencies = [ 1033 | "cfg-if", 1034 | "crunchy", 1035 | ] 1036 | 1037 | [[package]] 1038 | name = "hashbrown" 1039 | version = "0.14.5" 1040 | source = "registry+https://github.com/rust-lang/crates.io-index" 1041 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 1042 | dependencies = [ 1043 | "ahash", 1044 | "allocator-api2", 1045 | ] 1046 | 1047 | [[package]] 1048 | name = "hashbrown" 1049 | version = "0.15.5" 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" 1051 | checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" 1052 | 1053 | [[package]] 1054 | name = "hashlink" 1055 | version = "0.8.4" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" 1058 | dependencies = [ 1059 | "hashbrown 0.14.5", 1060 | ] 1061 | 1062 | [[package]] 1063 | name = "heck" 1064 | version = "0.5.0" 1065 | source = "registry+https://github.com/rust-lang/crates.io-index" 1066 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 1067 | 1068 | [[package]] 1069 | name = "hermit-abi" 1070 | version = "0.5.2" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" 1073 | 1074 | [[package]] 1075 | name = "hipstr" 1076 | version = "0.6.0" 1077 | source = "registry+https://github.com/rust-lang/crates.io-index" 1078 | checksum = "97971ffc85d4c98de12e2608e992a43f5294ebb625fdb045b27c731b64c4c6d6" 1079 | dependencies = [ 1080 | "serde", 1081 | "serde_bytes", 1082 | "sptr", 1083 | ] 1084 | 1085 | [[package]] 1086 | name = "hstr" 1087 | version = "3.0.3" 1088 | source = "registry+https://github.com/rust-lang/crates.io-index" 1089 | checksum = "0c43c0a9e8fbdb3bb9dc8eee85e1e2ac81605418b4c83b6b7413cbf14d56ca5c" 1090 | dependencies = [ 1091 | "hashbrown 0.14.5", 1092 | "new_debug_unreachable", 1093 | "once_cell", 1094 | "rustc-hash", 1095 | "serde", 1096 | "triomphe", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "http" 1101 | version = "0.2.12" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" 1104 | dependencies = [ 1105 | "bytes", 1106 | "fnv", 1107 | "itoa", 1108 | ] 1109 | 1110 | [[package]] 1111 | name = "http-body" 1112 | version = "0.4.6" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" 1115 | dependencies = [ 1116 | "bytes", 1117 | "http", 1118 | "pin-project-lite", 1119 | ] 1120 | 1121 | [[package]] 1122 | name = "httparse" 1123 | version = "1.10.1" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 1126 | 1127 | [[package]] 1128 | name = "httpdate" 1129 | version = "1.0.3" 1130 | source = "registry+https://github.com/rust-lang/crates.io-index" 1131 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 1132 | 1133 | [[package]] 1134 | name = "hyper" 1135 | version = "0.14.32" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" 1138 | dependencies = [ 1139 | "bytes", 1140 | "futures-channel", 1141 | "futures-core", 1142 | "futures-util", 1143 | "h2", 1144 | "http", 1145 | "http-body", 1146 | "httparse", 1147 | "httpdate", 1148 | "itoa", 1149 | "pin-project-lite", 1150 | "socket2 0.5.10", 1151 | "tokio", 1152 | "tower-service", 1153 | "tracing", 1154 | "want", 1155 | ] 1156 | 1157 | [[package]] 1158 | name = "hyper-rustls" 1159 | version = "0.24.2" 1160 | source = "registry+https://github.com/rust-lang/crates.io-index" 1161 | checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" 1162 | dependencies = [ 1163 | "futures-util", 1164 | "http", 1165 | "hyper", 1166 | "rustls", 1167 | "tokio", 1168 | "tokio-rustls", 1169 | ] 1170 | 1171 | [[package]] 1172 | name = "hyper-tls" 1173 | version = "0.5.0" 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" 1175 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 1176 | dependencies = [ 1177 | "bytes", 1178 | "hyper", 1179 | "native-tls", 1180 | "tokio", 1181 | "tokio-native-tls", 1182 | ] 1183 | 1184 | [[package]] 1185 | name = "icu_collections" 1186 | version = "2.0.0" 1187 | source = "registry+https://github.com/rust-lang/crates.io-index" 1188 | checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" 1189 | dependencies = [ 1190 | "displaydoc", 1191 | "potential_utf", 1192 | "yoke", 1193 | "zerofrom", 1194 | "zerovec", 1195 | ] 1196 | 1197 | [[package]] 1198 | name = "icu_locale_core" 1199 | version = "2.0.0" 1200 | source = "registry+https://github.com/rust-lang/crates.io-index" 1201 | checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" 1202 | dependencies = [ 1203 | "displaydoc", 1204 | "litemap", 1205 | "tinystr", 1206 | "writeable", 1207 | "zerovec", 1208 | ] 1209 | 1210 | [[package]] 1211 | name = "icu_normalizer" 1212 | version = "2.0.0" 1213 | source = "registry+https://github.com/rust-lang/crates.io-index" 1214 | checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" 1215 | dependencies = [ 1216 | "displaydoc", 1217 | "icu_collections", 1218 | "icu_normalizer_data", 1219 | "icu_properties", 1220 | "icu_provider", 1221 | "smallvec", 1222 | "zerovec", 1223 | ] 1224 | 1225 | [[package]] 1226 | name = "icu_normalizer_data" 1227 | version = "2.0.0" 1228 | source = "registry+https://github.com/rust-lang/crates.io-index" 1229 | checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" 1230 | 1231 | [[package]] 1232 | name = "icu_properties" 1233 | version = "2.0.1" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" 1236 | dependencies = [ 1237 | "displaydoc", 1238 | "icu_collections", 1239 | "icu_locale_core", 1240 | "icu_properties_data", 1241 | "icu_provider", 1242 | "potential_utf", 1243 | "zerotrie", 1244 | "zerovec", 1245 | ] 1246 | 1247 | [[package]] 1248 | name = "icu_properties_data" 1249 | version = "2.0.1" 1250 | source = "registry+https://github.com/rust-lang/crates.io-index" 1251 | checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" 1252 | 1253 | [[package]] 1254 | name = "icu_provider" 1255 | version = "2.0.0" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" 1258 | dependencies = [ 1259 | "displaydoc", 1260 | "icu_locale_core", 1261 | "stable_deref_trait", 1262 | "tinystr", 1263 | "writeable", 1264 | "yoke", 1265 | "zerofrom", 1266 | "zerotrie", 1267 | "zerovec", 1268 | ] 1269 | 1270 | [[package]] 1271 | name = "idna" 1272 | version = "1.1.0" 1273 | source = "registry+https://github.com/rust-lang/crates.io-index" 1274 | checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" 1275 | dependencies = [ 1276 | "idna_adapter", 1277 | "smallvec", 1278 | "utf8_iter", 1279 | ] 1280 | 1281 | [[package]] 1282 | name = "idna_adapter" 1283 | version = "1.2.1" 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" 1285 | checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" 1286 | dependencies = [ 1287 | "icu_normalizer", 1288 | "icu_properties", 1289 | ] 1290 | 1291 | [[package]] 1292 | name = "if_chain" 1293 | version = "1.0.2" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" 1296 | 1297 | [[package]] 1298 | name = "import_map" 1299 | version = "0.24.0" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "f83a4958a41489355816028239fee373797435384d162f4908e7980c83c3bb1b" 1302 | dependencies = [ 1303 | "boxed_error", 1304 | "deno_error", 1305 | "indexmap", 1306 | "log", 1307 | "percent-encoding", 1308 | "serde", 1309 | "serde_json", 1310 | "thiserror", 1311 | "url", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "indexmap" 1316 | version = "2.11.0" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" 1319 | dependencies = [ 1320 | "equivalent", 1321 | "hashbrown 0.15.5", 1322 | "serde", 1323 | ] 1324 | 1325 | [[package]] 1326 | name = "insta" 1327 | version = "1.43.1" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" 1330 | dependencies = [ 1331 | "console", 1332 | "once_cell", 1333 | "similar", 1334 | ] 1335 | 1336 | [[package]] 1337 | name = "io-uring" 1338 | version = "0.7.10" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" 1341 | dependencies = [ 1342 | "bitflags 2.9.3", 1343 | "cfg-if", 1344 | "libc", 1345 | ] 1346 | 1347 | [[package]] 1348 | name = "ipnet" 1349 | version = "2.11.0" 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" 1351 | checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" 1352 | 1353 | [[package]] 1354 | name = "is-macro" 1355 | version = "0.3.7" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "1d57a3e447e24c22647738e4607f1df1e0ec6f72e16182c4cd199f647cdfb0e4" 1358 | dependencies = [ 1359 | "heck", 1360 | "proc-macro2", 1361 | "quote", 1362 | "syn", 1363 | ] 1364 | 1365 | [[package]] 1366 | name = "is-terminal" 1367 | version = "0.4.16" 1368 | source = "registry+https://github.com/rust-lang/crates.io-index" 1369 | checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" 1370 | dependencies = [ 1371 | "hermit-abi", 1372 | "libc", 1373 | "windows-sys 0.59.0", 1374 | ] 1375 | 1376 | [[package]] 1377 | name = "itertools" 1378 | version = "0.10.5" 1379 | source = "registry+https://github.com/rust-lang/crates.io-index" 1380 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 1381 | dependencies = [ 1382 | "either", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "itoa" 1387 | version = "1.0.15" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 1390 | 1391 | [[package]] 1392 | name = "js-sys" 1393 | version = "0.3.69" 1394 | source = "registry+https://github.com/rust-lang/crates.io-index" 1395 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 1396 | dependencies = [ 1397 | "wasm-bindgen", 1398 | ] 1399 | 1400 | [[package]] 1401 | name = "jsonc-parser" 1402 | version = "0.23.0" 1403 | source = "registry+https://github.com/rust-lang/crates.io-index" 1404 | checksum = "7725c320caac8c21d8228c1d055af27a995d371f78cc763073d3e068323641b5" 1405 | dependencies = [ 1406 | "serde_json", 1407 | ] 1408 | 1409 | [[package]] 1410 | name = "libc" 1411 | version = "0.2.175" 1412 | source = "registry+https://github.com/rust-lang/crates.io-index" 1413 | checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" 1414 | 1415 | [[package]] 1416 | name = "linux-raw-sys" 1417 | version = "0.9.4" 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" 1419 | checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" 1420 | 1421 | [[package]] 1422 | name = "litemap" 1423 | version = "0.8.0" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" 1426 | 1427 | [[package]] 1428 | name = "lock_api" 1429 | version = "0.4.13" 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" 1431 | checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" 1432 | dependencies = [ 1433 | "autocfg", 1434 | "scopeguard", 1435 | ] 1436 | 1437 | [[package]] 1438 | name = "log" 1439 | version = "0.4.27" 1440 | source = "registry+https://github.com/rust-lang/crates.io-index" 1441 | checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" 1442 | 1443 | [[package]] 1444 | name = "memchr" 1445 | version = "2.7.5" 1446 | source = "registry+https://github.com/rust-lang/crates.io-index" 1447 | checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" 1448 | 1449 | [[package]] 1450 | name = "mime" 1451 | version = "0.3.17" 1452 | source = "registry+https://github.com/rust-lang/crates.io-index" 1453 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 1454 | 1455 | [[package]] 1456 | name = "miniz_oxide" 1457 | version = "0.8.9" 1458 | source = "registry+https://github.com/rust-lang/crates.io-index" 1459 | checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" 1460 | dependencies = [ 1461 | "adler2", 1462 | ] 1463 | 1464 | [[package]] 1465 | name = "mio" 1466 | version = "1.0.4" 1467 | source = "registry+https://github.com/rust-lang/crates.io-index" 1468 | checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" 1469 | dependencies = [ 1470 | "libc", 1471 | "wasi 0.11.1+wasi-snapshot-preview1", 1472 | "windows-sys 0.59.0", 1473 | ] 1474 | 1475 | [[package]] 1476 | name = "monch" 1477 | version = "0.5.0" 1478 | source = "registry+https://github.com/rust-lang/crates.io-index" 1479 | checksum = "b52c1b33ff98142aecea13138bd399b68aa7ab5d9546c300988c345004001eea" 1480 | 1481 | [[package]] 1482 | name = "native-tls" 1483 | version = "0.2.14" 1484 | source = "registry+https://github.com/rust-lang/crates.io-index" 1485 | checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" 1486 | dependencies = [ 1487 | "libc", 1488 | "log", 1489 | "openssl", 1490 | "openssl-probe", 1491 | "openssl-sys", 1492 | "schannel", 1493 | "security-framework", 1494 | "security-framework-sys", 1495 | "tempfile", 1496 | ] 1497 | 1498 | [[package]] 1499 | name = "new_debug_unreachable" 1500 | version = "1.0.6" 1501 | source = "registry+https://github.com/rust-lang/crates.io-index" 1502 | checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" 1503 | 1504 | [[package]] 1505 | name = "num-bigint" 1506 | version = "0.4.6" 1507 | source = "registry+https://github.com/rust-lang/crates.io-index" 1508 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 1509 | dependencies = [ 1510 | "num-integer", 1511 | "num-traits", 1512 | "serde", 1513 | ] 1514 | 1515 | [[package]] 1516 | name = "num-integer" 1517 | version = "0.1.46" 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" 1519 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 1520 | dependencies = [ 1521 | "num-traits", 1522 | ] 1523 | 1524 | [[package]] 1525 | name = "num-traits" 1526 | version = "0.2.19" 1527 | source = "registry+https://github.com/rust-lang/crates.io-index" 1528 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 1529 | dependencies = [ 1530 | "autocfg", 1531 | ] 1532 | 1533 | [[package]] 1534 | name = "num_cpus" 1535 | version = "1.17.0" 1536 | source = "registry+https://github.com/rust-lang/crates.io-index" 1537 | checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" 1538 | dependencies = [ 1539 | "hermit-abi", 1540 | "libc", 1541 | ] 1542 | 1543 | [[package]] 1544 | name = "object" 1545 | version = "0.36.7" 1546 | source = "registry+https://github.com/rust-lang/crates.io-index" 1547 | checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" 1548 | dependencies = [ 1549 | "memchr", 1550 | ] 1551 | 1552 | [[package]] 1553 | name = "once_cell" 1554 | version = "1.21.3" 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" 1556 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 1557 | 1558 | [[package]] 1559 | name = "oorandom" 1560 | version = "11.1.5" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" 1563 | 1564 | [[package]] 1565 | name = "openssl" 1566 | version = "0.10.73" 1567 | source = "registry+https://github.com/rust-lang/crates.io-index" 1568 | checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" 1569 | dependencies = [ 1570 | "bitflags 2.9.3", 1571 | "cfg-if", 1572 | "foreign-types", 1573 | "libc", 1574 | "once_cell", 1575 | "openssl-macros", 1576 | "openssl-sys", 1577 | ] 1578 | 1579 | [[package]] 1580 | name = "openssl-macros" 1581 | version = "0.1.1" 1582 | source = "registry+https://github.com/rust-lang/crates.io-index" 1583 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 1584 | dependencies = [ 1585 | "proc-macro2", 1586 | "quote", 1587 | "syn", 1588 | ] 1589 | 1590 | [[package]] 1591 | name = "openssl-probe" 1592 | version = "0.1.6" 1593 | source = "registry+https://github.com/rust-lang/crates.io-index" 1594 | checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" 1595 | 1596 | [[package]] 1597 | name = "openssl-sys" 1598 | version = "0.9.109" 1599 | source = "registry+https://github.com/rust-lang/crates.io-index" 1600 | checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" 1601 | dependencies = [ 1602 | "cc", 1603 | "libc", 1604 | "pkg-config", 1605 | "vcpkg", 1606 | ] 1607 | 1608 | [[package]] 1609 | name = "outref" 1610 | version = "0.5.2" 1611 | source = "registry+https://github.com/rust-lang/crates.io-index" 1612 | checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" 1613 | 1614 | [[package]] 1615 | name = "par-core" 1616 | version = "2.0.0" 1617 | source = "registry+https://github.com/rust-lang/crates.io-index" 1618 | checksum = "e96cbd21255b7fb29a5d51ef38a779b517a91abd59e2756c039583f43ef4c90f" 1619 | dependencies = [ 1620 | "once_cell", 1621 | ] 1622 | 1623 | [[package]] 1624 | name = "parking_lot" 1625 | version = "0.12.4" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" 1628 | dependencies = [ 1629 | "lock_api", 1630 | "parking_lot_core", 1631 | ] 1632 | 1633 | [[package]] 1634 | name = "parking_lot_core" 1635 | version = "0.9.11" 1636 | source = "registry+https://github.com/rust-lang/crates.io-index" 1637 | checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" 1638 | dependencies = [ 1639 | "cfg-if", 1640 | "libc", 1641 | "redox_syscall", 1642 | "smallvec", 1643 | "windows-targets 0.52.6", 1644 | ] 1645 | 1646 | [[package]] 1647 | name = "pathdiff" 1648 | version = "0.2.3" 1649 | source = "registry+https://github.com/rust-lang/crates.io-index" 1650 | checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" 1651 | 1652 | [[package]] 1653 | name = "percent-encoding" 1654 | version = "2.3.2" 1655 | source = "registry+https://github.com/rust-lang/crates.io-index" 1656 | checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 1657 | 1658 | [[package]] 1659 | name = "phf" 1660 | version = "0.11.3" 1661 | source = "registry+https://github.com/rust-lang/crates.io-index" 1662 | checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" 1663 | dependencies = [ 1664 | "phf_macros", 1665 | "phf_shared", 1666 | ] 1667 | 1668 | [[package]] 1669 | name = "phf_generator" 1670 | version = "0.11.3" 1671 | source = "registry+https://github.com/rust-lang/crates.io-index" 1672 | checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" 1673 | dependencies = [ 1674 | "phf_shared", 1675 | "rand", 1676 | ] 1677 | 1678 | [[package]] 1679 | name = "phf_macros" 1680 | version = "0.11.3" 1681 | source = "registry+https://github.com/rust-lang/crates.io-index" 1682 | checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" 1683 | dependencies = [ 1684 | "phf_generator", 1685 | "phf_shared", 1686 | "proc-macro2", 1687 | "quote", 1688 | "syn", 1689 | ] 1690 | 1691 | [[package]] 1692 | name = "phf_shared" 1693 | version = "0.11.3" 1694 | source = "registry+https://github.com/rust-lang/crates.io-index" 1695 | checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" 1696 | dependencies = [ 1697 | "siphasher 1.0.1", 1698 | ] 1699 | 1700 | [[package]] 1701 | name = "pin-project-lite" 1702 | version = "0.2.16" 1703 | source = "registry+https://github.com/rust-lang/crates.io-index" 1704 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 1705 | 1706 | [[package]] 1707 | name = "pin-utils" 1708 | version = "0.1.0" 1709 | source = "registry+https://github.com/rust-lang/crates.io-index" 1710 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1711 | 1712 | [[package]] 1713 | name = "pkg-config" 1714 | version = "0.3.32" 1715 | source = "registry+https://github.com/rust-lang/crates.io-index" 1716 | checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" 1717 | 1718 | [[package]] 1719 | name = "plotters" 1720 | version = "0.3.7" 1721 | source = "registry+https://github.com/rust-lang/crates.io-index" 1722 | checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" 1723 | dependencies = [ 1724 | "num-traits", 1725 | "plotters-backend", 1726 | "plotters-svg", 1727 | "wasm-bindgen", 1728 | "web-sys", 1729 | ] 1730 | 1731 | [[package]] 1732 | name = "plotters-backend" 1733 | version = "0.3.7" 1734 | source = "registry+https://github.com/rust-lang/crates.io-index" 1735 | checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" 1736 | 1737 | [[package]] 1738 | name = "plotters-svg" 1739 | version = "0.3.7" 1740 | source = "registry+https://github.com/rust-lang/crates.io-index" 1741 | checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" 1742 | dependencies = [ 1743 | "plotters-backend", 1744 | ] 1745 | 1746 | [[package]] 1747 | name = "potential_utf" 1748 | version = "0.1.2" 1749 | source = "registry+https://github.com/rust-lang/crates.io-index" 1750 | checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" 1751 | dependencies = [ 1752 | "zerovec", 1753 | ] 1754 | 1755 | [[package]] 1756 | name = "pretty_assertions" 1757 | version = "1.4.1" 1758 | source = "registry+https://github.com/rust-lang/crates.io-index" 1759 | checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" 1760 | dependencies = [ 1761 | "diff", 1762 | "yansi", 1763 | ] 1764 | 1765 | [[package]] 1766 | name = "proc-macro2" 1767 | version = "1.0.101" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" 1770 | dependencies = [ 1771 | "unicode-ident", 1772 | ] 1773 | 1774 | [[package]] 1775 | name = "psm" 1776 | version = "0.1.26" 1777 | source = "registry+https://github.com/rust-lang/crates.io-index" 1778 | checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" 1779 | dependencies = [ 1780 | "cc", 1781 | ] 1782 | 1783 | [[package]] 1784 | name = "quote" 1785 | version = "1.0.40" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 1788 | dependencies = [ 1789 | "proc-macro2", 1790 | ] 1791 | 1792 | [[package]] 1793 | name = "r-efi" 1794 | version = "5.3.0" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" 1797 | 1798 | [[package]] 1799 | name = "radium" 1800 | version = "0.7.0" 1801 | source = "registry+https://github.com/rust-lang/crates.io-index" 1802 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 1803 | 1804 | [[package]] 1805 | name = "rand" 1806 | version = "0.8.5" 1807 | source = "registry+https://github.com/rust-lang/crates.io-index" 1808 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1809 | dependencies = [ 1810 | "rand_core", 1811 | ] 1812 | 1813 | [[package]] 1814 | name = "rand_core" 1815 | version = "0.6.4" 1816 | source = "registry+https://github.com/rust-lang/crates.io-index" 1817 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1818 | 1819 | [[package]] 1820 | name = "rayon" 1821 | version = "1.11.0" 1822 | source = "registry+https://github.com/rust-lang/crates.io-index" 1823 | checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" 1824 | dependencies = [ 1825 | "either", 1826 | "rayon-core", 1827 | ] 1828 | 1829 | [[package]] 1830 | name = "rayon-core" 1831 | version = "1.13.0" 1832 | source = "registry+https://github.com/rust-lang/crates.io-index" 1833 | checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" 1834 | dependencies = [ 1835 | "crossbeam-deque", 1836 | "crossbeam-utils", 1837 | ] 1838 | 1839 | [[package]] 1840 | name = "redox_syscall" 1841 | version = "0.5.17" 1842 | source = "registry+https://github.com/rust-lang/crates.io-index" 1843 | checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" 1844 | dependencies = [ 1845 | "bitflags 2.9.3", 1846 | ] 1847 | 1848 | [[package]] 1849 | name = "regex" 1850 | version = "1.11.2" 1851 | source = "registry+https://github.com/rust-lang/crates.io-index" 1852 | checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" 1853 | dependencies = [ 1854 | "aho-corasick", 1855 | "memchr", 1856 | "regex-automata", 1857 | "regex-syntax", 1858 | ] 1859 | 1860 | [[package]] 1861 | name = "regex-automata" 1862 | version = "0.4.10" 1863 | source = "registry+https://github.com/rust-lang/crates.io-index" 1864 | checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" 1865 | dependencies = [ 1866 | "aho-corasick", 1867 | "memchr", 1868 | "regex-syntax", 1869 | ] 1870 | 1871 | [[package]] 1872 | name = "regex-syntax" 1873 | version = "0.8.6" 1874 | source = "registry+https://github.com/rust-lang/crates.io-index" 1875 | checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" 1876 | 1877 | [[package]] 1878 | name = "reqwest" 1879 | version = "0.11.27" 1880 | source = "registry+https://github.com/rust-lang/crates.io-index" 1881 | checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" 1882 | dependencies = [ 1883 | "base64 0.21.7", 1884 | "bytes", 1885 | "encoding_rs", 1886 | "futures-core", 1887 | "futures-util", 1888 | "h2", 1889 | "http", 1890 | "http-body", 1891 | "hyper", 1892 | "hyper-rustls", 1893 | "hyper-tls", 1894 | "ipnet", 1895 | "js-sys", 1896 | "log", 1897 | "mime", 1898 | "native-tls", 1899 | "once_cell", 1900 | "percent-encoding", 1901 | "pin-project-lite", 1902 | "rustls", 1903 | "rustls-pemfile", 1904 | "serde", 1905 | "serde_json", 1906 | "serde_urlencoded", 1907 | "sync_wrapper", 1908 | "system-configuration", 1909 | "tokio", 1910 | "tokio-native-tls", 1911 | "tokio-rustls", 1912 | "tower-service", 1913 | "url", 1914 | "wasm-bindgen", 1915 | "wasm-bindgen-futures", 1916 | "web-sys", 1917 | "webpki-roots", 1918 | "winreg", 1919 | ] 1920 | 1921 | [[package]] 1922 | name = "ring" 1923 | version = "0.17.14" 1924 | source = "registry+https://github.com/rust-lang/crates.io-index" 1925 | checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" 1926 | dependencies = [ 1927 | "cc", 1928 | "cfg-if", 1929 | "getrandom 0.2.16", 1930 | "libc", 1931 | "untrusted", 1932 | "windows-sys 0.52.0", 1933 | ] 1934 | 1935 | [[package]] 1936 | name = "rustc-demangle" 1937 | version = "0.1.26" 1938 | source = "registry+https://github.com/rust-lang/crates.io-index" 1939 | checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" 1940 | 1941 | [[package]] 1942 | name = "rustc-hash" 1943 | version = "2.1.1" 1944 | source = "registry+https://github.com/rust-lang/crates.io-index" 1945 | checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" 1946 | 1947 | [[package]] 1948 | name = "rustix" 1949 | version = "1.0.8" 1950 | source = "registry+https://github.com/rust-lang/crates.io-index" 1951 | checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" 1952 | dependencies = [ 1953 | "bitflags 2.9.3", 1954 | "errno", 1955 | "libc", 1956 | "linux-raw-sys", 1957 | "windows-sys 0.59.0", 1958 | ] 1959 | 1960 | [[package]] 1961 | name = "rustls" 1962 | version = "0.21.12" 1963 | source = "registry+https://github.com/rust-lang/crates.io-index" 1964 | checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" 1965 | dependencies = [ 1966 | "log", 1967 | "ring", 1968 | "rustls-webpki", 1969 | "sct", 1970 | ] 1971 | 1972 | [[package]] 1973 | name = "rustls-pemfile" 1974 | version = "1.0.4" 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" 1976 | checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" 1977 | dependencies = [ 1978 | "base64 0.21.7", 1979 | ] 1980 | 1981 | [[package]] 1982 | name = "rustls-webpki" 1983 | version = "0.101.7" 1984 | source = "registry+https://github.com/rust-lang/crates.io-index" 1985 | checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" 1986 | dependencies = [ 1987 | "ring", 1988 | "untrusted", 1989 | ] 1990 | 1991 | [[package]] 1992 | name = "rustversion" 1993 | version = "1.0.22" 1994 | source = "registry+https://github.com/rust-lang/crates.io-index" 1995 | checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 1996 | 1997 | [[package]] 1998 | name = "ryu" 1999 | version = "1.0.20" 2000 | source = "registry+https://github.com/rust-lang/crates.io-index" 2001 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 2002 | 2003 | [[package]] 2004 | name = "ryu-js" 2005 | version = "1.0.2" 2006 | source = "registry+https://github.com/rust-lang/crates.io-index" 2007 | checksum = "dd29631678d6fb0903b69223673e122c32e9ae559d0960a38d574695ebc0ea15" 2008 | 2009 | [[package]] 2010 | name = "same-file" 2011 | version = "1.0.6" 2012 | source = "registry+https://github.com/rust-lang/crates.io-index" 2013 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 2014 | dependencies = [ 2015 | "winapi-util", 2016 | ] 2017 | 2018 | [[package]] 2019 | name = "schannel" 2020 | version = "0.1.27" 2021 | source = "registry+https://github.com/rust-lang/crates.io-index" 2022 | checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" 2023 | dependencies = [ 2024 | "windows-sys 0.59.0", 2025 | ] 2026 | 2027 | [[package]] 2028 | name = "scoped-tls" 2029 | version = "1.0.1" 2030 | source = "registry+https://github.com/rust-lang/crates.io-index" 2031 | checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" 2032 | 2033 | [[package]] 2034 | name = "scopeguard" 2035 | version = "1.2.0" 2036 | source = "registry+https://github.com/rust-lang/crates.io-index" 2037 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 2038 | 2039 | [[package]] 2040 | name = "sct" 2041 | version = "0.7.1" 2042 | source = "registry+https://github.com/rust-lang/crates.io-index" 2043 | checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" 2044 | dependencies = [ 2045 | "ring", 2046 | "untrusted", 2047 | ] 2048 | 2049 | [[package]] 2050 | name = "security-framework" 2051 | version = "2.11.1" 2052 | source = "registry+https://github.com/rust-lang/crates.io-index" 2053 | checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 2054 | dependencies = [ 2055 | "bitflags 2.9.3", 2056 | "core-foundation", 2057 | "core-foundation-sys", 2058 | "libc", 2059 | "security-framework-sys", 2060 | ] 2061 | 2062 | [[package]] 2063 | name = "security-framework-sys" 2064 | version = "2.14.0" 2065 | source = "registry+https://github.com/rust-lang/crates.io-index" 2066 | checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" 2067 | dependencies = [ 2068 | "core-foundation-sys", 2069 | "libc", 2070 | ] 2071 | 2072 | [[package]] 2073 | name = "seq-macro" 2074 | version = "0.3.6" 2075 | source = "registry+https://github.com/rust-lang/crates.io-index" 2076 | checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" 2077 | 2078 | [[package]] 2079 | name = "serde" 2080 | version = "1.0.228" 2081 | source = "registry+https://github.com/rust-lang/crates.io-index" 2082 | checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 2083 | dependencies = [ 2084 | "serde_core", 2085 | "serde_derive", 2086 | ] 2087 | 2088 | [[package]] 2089 | name = "serde-wasm-bindgen" 2090 | version = "0.5.0" 2091 | source = "registry+https://github.com/rust-lang/crates.io-index" 2092 | checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" 2093 | dependencies = [ 2094 | "js-sys", 2095 | "serde", 2096 | "wasm-bindgen", 2097 | ] 2098 | 2099 | [[package]] 2100 | name = "serde_bytes" 2101 | version = "0.11.17" 2102 | source = "registry+https://github.com/rust-lang/crates.io-index" 2103 | checksum = "8437fd221bde2d4ca316d61b90e337e9e702b3820b87d63caa9ba6c02bd06d96" 2104 | dependencies = [ 2105 | "serde", 2106 | ] 2107 | 2108 | [[package]] 2109 | name = "serde_core" 2110 | version = "1.0.228" 2111 | source = "registry+https://github.com/rust-lang/crates.io-index" 2112 | checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 2113 | dependencies = [ 2114 | "serde_derive", 2115 | ] 2116 | 2117 | [[package]] 2118 | name = "serde_derive" 2119 | version = "1.0.228" 2120 | source = "registry+https://github.com/rust-lang/crates.io-index" 2121 | checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 2122 | dependencies = [ 2123 | "proc-macro2", 2124 | "quote", 2125 | "syn", 2126 | ] 2127 | 2128 | [[package]] 2129 | name = "serde_json" 2130 | version = "1.0.143" 2131 | source = "registry+https://github.com/rust-lang/crates.io-index" 2132 | checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" 2133 | dependencies = [ 2134 | "indexmap", 2135 | "itoa", 2136 | "memchr", 2137 | "ryu", 2138 | "serde", 2139 | ] 2140 | 2141 | [[package]] 2142 | name = "serde_urlencoded" 2143 | version = "0.7.1" 2144 | source = "registry+https://github.com/rust-lang/crates.io-index" 2145 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 2146 | dependencies = [ 2147 | "form_urlencoded", 2148 | "itoa", 2149 | "ryu", 2150 | "serde", 2151 | ] 2152 | 2153 | [[package]] 2154 | name = "sha1" 2155 | version = "0.10.6" 2156 | source = "registry+https://github.com/rust-lang/crates.io-index" 2157 | checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 2158 | dependencies = [ 2159 | "cfg-if", 2160 | "cpufeatures", 2161 | "digest", 2162 | ] 2163 | 2164 | [[package]] 2165 | name = "sha2" 2166 | version = "0.10.9" 2167 | source = "registry+https://github.com/rust-lang/crates.io-index" 2168 | checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" 2169 | dependencies = [ 2170 | "cfg-if", 2171 | "cpufeatures", 2172 | "digest", 2173 | ] 2174 | 2175 | [[package]] 2176 | name = "shlex" 2177 | version = "1.3.0" 2178 | source = "registry+https://github.com/rust-lang/crates.io-index" 2179 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 2180 | 2181 | [[package]] 2182 | name = "similar" 2183 | version = "2.7.0" 2184 | source = "registry+https://github.com/rust-lang/crates.io-index" 2185 | checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" 2186 | 2187 | [[package]] 2188 | name = "siphasher" 2189 | version = "0.3.11" 2190 | source = "registry+https://github.com/rust-lang/crates.io-index" 2191 | checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" 2192 | 2193 | [[package]] 2194 | name = "siphasher" 2195 | version = "1.0.1" 2196 | source = "registry+https://github.com/rust-lang/crates.io-index" 2197 | checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" 2198 | 2199 | [[package]] 2200 | name = "slab" 2201 | version = "0.4.11" 2202 | source = "registry+https://github.com/rust-lang/crates.io-index" 2203 | checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" 2204 | 2205 | [[package]] 2206 | name = "smallvec" 2207 | version = "1.15.1" 2208 | source = "registry+https://github.com/rust-lang/crates.io-index" 2209 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 2210 | 2211 | [[package]] 2212 | name = "smartstring" 2213 | version = "1.0.1" 2214 | source = "registry+https://github.com/rust-lang/crates.io-index" 2215 | checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" 2216 | dependencies = [ 2217 | "autocfg", 2218 | "static_assertions", 2219 | "version_check", 2220 | ] 2221 | 2222 | [[package]] 2223 | name = "socket2" 2224 | version = "0.5.10" 2225 | source = "registry+https://github.com/rust-lang/crates.io-index" 2226 | checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" 2227 | dependencies = [ 2228 | "libc", 2229 | "windows-sys 0.52.0", 2230 | ] 2231 | 2232 | [[package]] 2233 | name = "socket2" 2234 | version = "0.6.0" 2235 | source = "registry+https://github.com/rust-lang/crates.io-index" 2236 | checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" 2237 | dependencies = [ 2238 | "libc", 2239 | "windows-sys 0.59.0", 2240 | ] 2241 | 2242 | [[package]] 2243 | name = "sptr" 2244 | version = "0.3.2" 2245 | source = "registry+https://github.com/rust-lang/crates.io-index" 2246 | checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" 2247 | 2248 | [[package]] 2249 | name = "stable_deref_trait" 2250 | version = "1.2.0" 2251 | source = "registry+https://github.com/rust-lang/crates.io-index" 2252 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" 2253 | 2254 | [[package]] 2255 | name = "stacker" 2256 | version = "0.1.21" 2257 | source = "registry+https://github.com/rust-lang/crates.io-index" 2258 | checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" 2259 | dependencies = [ 2260 | "cc", 2261 | "cfg-if", 2262 | "libc", 2263 | "psm", 2264 | "windows-sys 0.59.0", 2265 | ] 2266 | 2267 | [[package]] 2268 | name = "static_assertions" 2269 | version = "1.1.0" 2270 | source = "registry+https://github.com/rust-lang/crates.io-index" 2271 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 2272 | 2273 | [[package]] 2274 | name = "string_enum" 2275 | version = "1.0.2" 2276 | source = "registry+https://github.com/rust-lang/crates.io-index" 2277 | checksum = "ae36a4951ca7bd1cfd991c241584a9824a70f6aff1e7d4f693fb3f2465e4030e" 2278 | dependencies = [ 2279 | "quote", 2280 | "swc_macros_common", 2281 | "syn", 2282 | ] 2283 | 2284 | [[package]] 2285 | name = "swc_allocator" 2286 | version = "4.0.1" 2287 | source = "registry+https://github.com/rust-lang/crates.io-index" 2288 | checksum = "9d7eefd2c8b228a8c73056482b2ae4b3a1071fbe07638e3b55ceca8570cc48bb" 2289 | dependencies = [ 2290 | "allocator-api2", 2291 | "bumpalo", 2292 | "hashbrown 0.14.5", 2293 | "rustc-hash", 2294 | ] 2295 | 2296 | [[package]] 2297 | name = "swc_atoms" 2298 | version = "9.0.0" 2299 | source = "registry+https://github.com/rust-lang/crates.io-index" 2300 | checksum = "d4ccbe2ecad10ad7432100f878a107b1d972a8aee83ca53184d00c23a078bb8a" 2301 | dependencies = [ 2302 | "hstr", 2303 | "once_cell", 2304 | "serde", 2305 | ] 2306 | 2307 | [[package]] 2308 | name = "swc_common" 2309 | version = "17.0.1" 2310 | source = "registry+https://github.com/rust-lang/crates.io-index" 2311 | checksum = "259b675d633a26d24efe3802a9d88858c918e6e8f062d3222d3aa02d56a2cf4c" 2312 | dependencies = [ 2313 | "anyhow", 2314 | "ast_node", 2315 | "better_scoped_tls", 2316 | "bytes-str", 2317 | "either", 2318 | "from_variant", 2319 | "new_debug_unreachable", 2320 | "num-bigint", 2321 | "once_cell", 2322 | "rustc-hash", 2323 | "serde", 2324 | "siphasher 0.3.11", 2325 | "swc_atoms", 2326 | "swc_eq_ignore_macros", 2327 | "swc_sourcemap", 2328 | "swc_visit", 2329 | "tracing", 2330 | "unicode-width", 2331 | "url", 2332 | ] 2333 | 2334 | [[package]] 2335 | name = "swc_config" 2336 | version = "3.1.2" 2337 | source = "registry+https://github.com/rust-lang/crates.io-index" 2338 | checksum = "72e90b52ee734ded867104612218101722ad87ff4cf74fe30383bd244a533f97" 2339 | dependencies = [ 2340 | "anyhow", 2341 | "bytes-str", 2342 | "indexmap", 2343 | "serde", 2344 | "serde_json", 2345 | "swc_config_macro", 2346 | ] 2347 | 2348 | [[package]] 2349 | name = "swc_config_macro" 2350 | version = "1.0.1" 2351 | source = "registry+https://github.com/rust-lang/crates.io-index" 2352 | checksum = "7b416e8ce6de17dc5ea496e10c7012b35bbc0e3fef38d2e065eed936490db0b3" 2353 | dependencies = [ 2354 | "proc-macro2", 2355 | "quote", 2356 | "swc_macros_common", 2357 | "syn", 2358 | ] 2359 | 2360 | [[package]] 2361 | name = "swc_ecma_ast" 2362 | version = "18.0.0" 2363 | source = "registry+https://github.com/rust-lang/crates.io-index" 2364 | checksum = "a573a0c72850dec8d4d8085f152d5778af35a2520c3093b242d2d1d50776da7c" 2365 | dependencies = [ 2366 | "bitflags 2.9.3", 2367 | "is-macro", 2368 | "num-bigint", 2369 | "once_cell", 2370 | "phf", 2371 | "rustc-hash", 2372 | "serde", 2373 | "string_enum", 2374 | "swc_atoms", 2375 | "swc_common", 2376 | "swc_visit", 2377 | "unicode-id-start", 2378 | ] 2379 | 2380 | [[package]] 2381 | name = "swc_ecma_codegen" 2382 | version = "20.0.2" 2383 | source = "registry+https://github.com/rust-lang/crates.io-index" 2384 | checksum = "ff2a6ee1ec49dda8dedeac54e4147b4e8b3f278d9bb34ab28983257a393d34ed" 2385 | dependencies = [ 2386 | "ascii", 2387 | "compact_str", 2388 | "memchr", 2389 | "num-bigint", 2390 | "once_cell", 2391 | "regex", 2392 | "rustc-hash", 2393 | "ryu-js", 2394 | "serde", 2395 | "swc_allocator", 2396 | "swc_atoms", 2397 | "swc_common", 2398 | "swc_ecma_ast", 2399 | "swc_ecma_codegen_macros", 2400 | "swc_sourcemap", 2401 | "tracing", 2402 | ] 2403 | 2404 | [[package]] 2405 | name = "swc_ecma_codegen_macros" 2406 | version = "2.0.2" 2407 | source = "registry+https://github.com/rust-lang/crates.io-index" 2408 | checksum = "e276dc62c0a2625a560397827989c82a93fd545fcf6f7faec0935a82cc4ddbb8" 2409 | dependencies = [ 2410 | "proc-macro2", 2411 | "swc_macros_common", 2412 | "syn", 2413 | ] 2414 | 2415 | [[package]] 2416 | name = "swc_ecma_lexer" 2417 | version = "26.0.0" 2418 | source = "registry+https://github.com/rust-lang/crates.io-index" 2419 | checksum = "5e82f7747e052c6ff6e111fa4adeb14e33b46ee6e94fe5ef717601f651db48fc" 2420 | dependencies = [ 2421 | "bitflags 2.9.3", 2422 | "either", 2423 | "num-bigint", 2424 | "rustc-hash", 2425 | "seq-macro", 2426 | "serde", 2427 | "smallvec", 2428 | "smartstring", 2429 | "stacker", 2430 | "swc_atoms", 2431 | "swc_common", 2432 | "swc_ecma_ast", 2433 | "swc_ecma_parser", 2434 | "tracing", 2435 | ] 2436 | 2437 | [[package]] 2438 | name = "swc_ecma_loader" 2439 | version = "17.0.0" 2440 | source = "registry+https://github.com/rust-lang/crates.io-index" 2441 | checksum = "fbcababb48f0d46587a0a854b2c577eb3a56fa99687de558338021e93cd2c8f5" 2442 | dependencies = [ 2443 | "anyhow", 2444 | "pathdiff", 2445 | "rustc-hash", 2446 | "serde", 2447 | "swc_atoms", 2448 | "swc_common", 2449 | "tracing", 2450 | ] 2451 | 2452 | [[package]] 2453 | name = "swc_ecma_parser" 2454 | version = "27.0.7" 2455 | source = "registry+https://github.com/rust-lang/crates.io-index" 2456 | checksum = "7f1a51af1a92cd4904c073b293e491bbc0918400a45d58227b34c961dd6f52d7" 2457 | dependencies = [ 2458 | "bitflags 2.9.3", 2459 | "either", 2460 | "num-bigint", 2461 | "phf", 2462 | "rustc-hash", 2463 | "seq-macro", 2464 | "serde", 2465 | "smartstring", 2466 | "stacker", 2467 | "swc_atoms", 2468 | "swc_common", 2469 | "swc_ecma_ast", 2470 | "tracing", 2471 | ] 2472 | 2473 | [[package]] 2474 | name = "swc_ecma_transforms_base" 2475 | version = "30.0.1" 2476 | source = "registry+https://github.com/rust-lang/crates.io-index" 2477 | checksum = "250f6f165578ca4fee47bd57585c1b9597c94bf4ea6591df47f2b5fa5b1883fe" 2478 | dependencies = [ 2479 | "better_scoped_tls", 2480 | "indexmap", 2481 | "once_cell", 2482 | "par-core", 2483 | "phf", 2484 | "rustc-hash", 2485 | "serde", 2486 | "swc_atoms", 2487 | "swc_common", 2488 | "swc_ecma_ast", 2489 | "swc_ecma_parser", 2490 | "swc_ecma_utils", 2491 | "swc_ecma_visit", 2492 | "tracing", 2493 | ] 2494 | 2495 | [[package]] 2496 | name = "swc_ecma_transforms_classes" 2497 | version = "30.0.0" 2498 | source = "registry+https://github.com/rust-lang/crates.io-index" 2499 | checksum = "3d3ab35eff4a980e02d708798ae4c35bc017612292adbffe7b7b554df772fdf5" 2500 | dependencies = [ 2501 | "swc_common", 2502 | "swc_ecma_ast", 2503 | "swc_ecma_transforms_base", 2504 | "swc_ecma_utils", 2505 | "swc_ecma_visit", 2506 | ] 2507 | 2508 | [[package]] 2509 | name = "swc_ecma_transforms_macros" 2510 | version = "1.0.1" 2511 | source = "registry+https://github.com/rust-lang/crates.io-index" 2512 | checksum = "bc777288799bf6786e5200325a56e4fbabba590264a4a48a0c70b16ad0cf5cd8" 2513 | dependencies = [ 2514 | "proc-macro2", 2515 | "quote", 2516 | "swc_macros_common", 2517 | "syn", 2518 | ] 2519 | 2520 | [[package]] 2521 | name = "swc_ecma_transforms_proposal" 2522 | version = "30.0.0" 2523 | source = "registry+https://github.com/rust-lang/crates.io-index" 2524 | checksum = "c2d7748d4112c87ce1885260035e4a43cebfe7661a40174b7d77a0a04760a257" 2525 | dependencies = [ 2526 | "either", 2527 | "rustc-hash", 2528 | "serde", 2529 | "swc_atoms", 2530 | "swc_common", 2531 | "swc_ecma_ast", 2532 | "swc_ecma_transforms_base", 2533 | "swc_ecma_transforms_classes", 2534 | "swc_ecma_utils", 2535 | "swc_ecma_visit", 2536 | ] 2537 | 2538 | [[package]] 2539 | name = "swc_ecma_transforms_react" 2540 | version = "33.0.0" 2541 | source = "registry+https://github.com/rust-lang/crates.io-index" 2542 | checksum = "03de12e38e47ac1c96ac576f793ad37a9d7b16fbf4f2203881f89152f2498682" 2543 | dependencies = [ 2544 | "base64 0.22.1", 2545 | "bytes-str", 2546 | "indexmap", 2547 | "once_cell", 2548 | "rustc-hash", 2549 | "serde", 2550 | "sha1", 2551 | "string_enum", 2552 | "swc_atoms", 2553 | "swc_common", 2554 | "swc_config", 2555 | "swc_ecma_ast", 2556 | "swc_ecma_parser", 2557 | "swc_ecma_transforms_base", 2558 | "swc_ecma_utils", 2559 | "swc_ecma_visit", 2560 | ] 2561 | 2562 | [[package]] 2563 | name = "swc_ecma_transforms_typescript" 2564 | version = "33.0.0" 2565 | source = "registry+https://github.com/rust-lang/crates.io-index" 2566 | checksum = "4408800fdeb541fabf3659db622189a0aeb386f57b6103f9294ff19dfde4f7b0" 2567 | dependencies = [ 2568 | "bytes-str", 2569 | "rustc-hash", 2570 | "serde", 2571 | "swc_atoms", 2572 | "swc_common", 2573 | "swc_ecma_ast", 2574 | "swc_ecma_transforms_base", 2575 | "swc_ecma_transforms_react", 2576 | "swc_ecma_utils", 2577 | "swc_ecma_visit", 2578 | ] 2579 | 2580 | [[package]] 2581 | name = "swc_ecma_utils" 2582 | version = "24.0.0" 2583 | source = "registry+https://github.com/rust-lang/crates.io-index" 2584 | checksum = "0fb99e179988cabd473779a4452ab942bcb777176983ca3cbaf22a8f056a65b0" 2585 | dependencies = [ 2586 | "indexmap", 2587 | "num_cpus", 2588 | "once_cell", 2589 | "par-core", 2590 | "rustc-hash", 2591 | "ryu-js", 2592 | "swc_atoms", 2593 | "swc_common", 2594 | "swc_ecma_ast", 2595 | "swc_ecma_visit", 2596 | "tracing", 2597 | ] 2598 | 2599 | [[package]] 2600 | name = "swc_ecma_visit" 2601 | version = "18.0.1" 2602 | source = "registry+https://github.com/rust-lang/crates.io-index" 2603 | checksum = "a9611a72a4008d62608547a394e5d72a5245413104db096d95a52368a8cc1d63" 2604 | dependencies = [ 2605 | "new_debug_unreachable", 2606 | "num-bigint", 2607 | "swc_atoms", 2608 | "swc_common", 2609 | "swc_ecma_ast", 2610 | "swc_visit", 2611 | "tracing", 2612 | ] 2613 | 2614 | [[package]] 2615 | name = "swc_eq_ignore_macros" 2616 | version = "1.0.1" 2617 | source = "registry+https://github.com/rust-lang/crates.io-index" 2618 | checksum = "c16ce73424a6316e95e09065ba6a207eba7765496fed113702278b7711d4b632" 2619 | dependencies = [ 2620 | "proc-macro2", 2621 | "quote", 2622 | "syn", 2623 | ] 2624 | 2625 | [[package]] 2626 | name = "swc_macros_common" 2627 | version = "1.0.1" 2628 | source = "registry+https://github.com/rust-lang/crates.io-index" 2629 | checksum = "aae1efbaa74943dc5ad2a2fb16cbd78b77d7e4d63188f3c5b4df2b4dcd2faaae" 2630 | dependencies = [ 2631 | "proc-macro2", 2632 | "quote", 2633 | "syn", 2634 | ] 2635 | 2636 | [[package]] 2637 | name = "swc_sourcemap" 2638 | version = "9.3.4" 2639 | source = "registry+https://github.com/rust-lang/crates.io-index" 2640 | checksum = "de08ef00f816acdd1a58ee8a81c0e1a59eefef2093aefe5611f256fa6b64c4d7" 2641 | dependencies = [ 2642 | "base64-simd", 2643 | "bitvec", 2644 | "bytes-str", 2645 | "data-encoding", 2646 | "debugid", 2647 | "if_chain", 2648 | "rustc-hash", 2649 | "serde", 2650 | "serde_json", 2651 | "unicode-id-start", 2652 | "url", 2653 | ] 2654 | 2655 | [[package]] 2656 | name = "swc_visit" 2657 | version = "2.0.1" 2658 | source = "registry+https://github.com/rust-lang/crates.io-index" 2659 | checksum = "62fb71484b486c185e34d2172f0eabe7f4722742aad700f426a494bb2de232a2" 2660 | dependencies = [ 2661 | "either", 2662 | "new_debug_unreachable", 2663 | ] 2664 | 2665 | [[package]] 2666 | name = "syn" 2667 | version = "2.0.106" 2668 | source = "registry+https://github.com/rust-lang/crates.io-index" 2669 | checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" 2670 | dependencies = [ 2671 | "proc-macro2", 2672 | "quote", 2673 | "unicode-ident", 2674 | ] 2675 | 2676 | [[package]] 2677 | name = "sync_wrapper" 2678 | version = "0.1.2" 2679 | source = "registry+https://github.com/rust-lang/crates.io-index" 2680 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 2681 | 2682 | [[package]] 2683 | name = "synstructure" 2684 | version = "0.13.2" 2685 | source = "registry+https://github.com/rust-lang/crates.io-index" 2686 | checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" 2687 | dependencies = [ 2688 | "proc-macro2", 2689 | "quote", 2690 | "syn", 2691 | ] 2692 | 2693 | [[package]] 2694 | name = "sys_traits" 2695 | version = "0.1.17" 2696 | source = "registry+https://github.com/rust-lang/crates.io-index" 2697 | checksum = "4f74a2c95f72e36fa6bd04a40d15623a9904bab1cc2fa6c6135b09d774a65088" 2698 | dependencies = [ 2699 | "js-sys", 2700 | "sys_traits_macros", 2701 | "wasm-bindgen", 2702 | ] 2703 | 2704 | [[package]] 2705 | name = "sys_traits_macros" 2706 | version = "0.1.0" 2707 | source = "registry+https://github.com/rust-lang/crates.io-index" 2708 | checksum = "181f22127402abcf8ee5c83ccd5b408933fec36a6095cf82cda545634692657e" 2709 | dependencies = [ 2710 | "proc-macro2", 2711 | "quote", 2712 | "syn", 2713 | ] 2714 | 2715 | [[package]] 2716 | name = "system-configuration" 2717 | version = "0.5.1" 2718 | source = "registry+https://github.com/rust-lang/crates.io-index" 2719 | checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" 2720 | dependencies = [ 2721 | "bitflags 1.3.2", 2722 | "core-foundation", 2723 | "system-configuration-sys", 2724 | ] 2725 | 2726 | [[package]] 2727 | name = "system-configuration-sys" 2728 | version = "0.5.0" 2729 | source = "registry+https://github.com/rust-lang/crates.io-index" 2730 | checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" 2731 | dependencies = [ 2732 | "core-foundation-sys", 2733 | "libc", 2734 | ] 2735 | 2736 | [[package]] 2737 | name = "tap" 2738 | version = "1.0.1" 2739 | source = "registry+https://github.com/rust-lang/crates.io-index" 2740 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 2741 | 2742 | [[package]] 2743 | name = "tempfile" 2744 | version = "3.21.0" 2745 | source = "registry+https://github.com/rust-lang/crates.io-index" 2746 | checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" 2747 | dependencies = [ 2748 | "fastrand", 2749 | "getrandom 0.3.3", 2750 | "once_cell", 2751 | "rustix", 2752 | "windows-sys 0.59.0", 2753 | ] 2754 | 2755 | [[package]] 2756 | name = "termcolor" 2757 | version = "1.4.1" 2758 | source = "registry+https://github.com/rust-lang/crates.io-index" 2759 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" 2760 | dependencies = [ 2761 | "winapi-util", 2762 | ] 2763 | 2764 | [[package]] 2765 | name = "text_lines" 2766 | version = "0.6.0" 2767 | source = "registry+https://github.com/rust-lang/crates.io-index" 2768 | checksum = "7fd5828de7deaa782e1dd713006ae96b3bee32d3279b79eb67ecf8072c059bcf" 2769 | dependencies = [ 2770 | "serde", 2771 | ] 2772 | 2773 | [[package]] 2774 | name = "thiserror" 2775 | version = "2.0.16" 2776 | source = "registry+https://github.com/rust-lang/crates.io-index" 2777 | checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" 2778 | dependencies = [ 2779 | "thiserror-impl", 2780 | ] 2781 | 2782 | [[package]] 2783 | name = "thiserror-impl" 2784 | version = "2.0.16" 2785 | source = "registry+https://github.com/rust-lang/crates.io-index" 2786 | checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" 2787 | dependencies = [ 2788 | "proc-macro2", 2789 | "quote", 2790 | "syn", 2791 | ] 2792 | 2793 | [[package]] 2794 | name = "tinystr" 2795 | version = "0.8.1" 2796 | source = "registry+https://github.com/rust-lang/crates.io-index" 2797 | checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" 2798 | dependencies = [ 2799 | "displaydoc", 2800 | "zerovec", 2801 | ] 2802 | 2803 | [[package]] 2804 | name = "tinytemplate" 2805 | version = "1.2.1" 2806 | source = "registry+https://github.com/rust-lang/crates.io-index" 2807 | checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" 2808 | dependencies = [ 2809 | "serde", 2810 | "serde_json", 2811 | ] 2812 | 2813 | [[package]] 2814 | name = "tokio" 2815 | version = "1.47.1" 2816 | source = "registry+https://github.com/rust-lang/crates.io-index" 2817 | checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" 2818 | dependencies = [ 2819 | "backtrace", 2820 | "bytes", 2821 | "io-uring", 2822 | "libc", 2823 | "mio", 2824 | "pin-project-lite", 2825 | "slab", 2826 | "socket2 0.6.0", 2827 | "tokio-macros", 2828 | "windows-sys 0.59.0", 2829 | ] 2830 | 2831 | [[package]] 2832 | name = "tokio-macros" 2833 | version = "2.5.0" 2834 | source = "registry+https://github.com/rust-lang/crates.io-index" 2835 | checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" 2836 | dependencies = [ 2837 | "proc-macro2", 2838 | "quote", 2839 | "syn", 2840 | ] 2841 | 2842 | [[package]] 2843 | name = "tokio-native-tls" 2844 | version = "0.3.1" 2845 | source = "registry+https://github.com/rust-lang/crates.io-index" 2846 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 2847 | dependencies = [ 2848 | "native-tls", 2849 | "tokio", 2850 | ] 2851 | 2852 | [[package]] 2853 | name = "tokio-rustls" 2854 | version = "0.24.1" 2855 | source = "registry+https://github.com/rust-lang/crates.io-index" 2856 | checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" 2857 | dependencies = [ 2858 | "rustls", 2859 | "tokio", 2860 | ] 2861 | 2862 | [[package]] 2863 | name = "tokio-util" 2864 | version = "0.7.16" 2865 | source = "registry+https://github.com/rust-lang/crates.io-index" 2866 | checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" 2867 | dependencies = [ 2868 | "bytes", 2869 | "futures-core", 2870 | "futures-sink", 2871 | "pin-project-lite", 2872 | "tokio", 2873 | ] 2874 | 2875 | [[package]] 2876 | name = "tower-service" 2877 | version = "0.3.3" 2878 | source = "registry+https://github.com/rust-lang/crates.io-index" 2879 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 2880 | 2881 | [[package]] 2882 | name = "tracing" 2883 | version = "0.1.41" 2884 | source = "registry+https://github.com/rust-lang/crates.io-index" 2885 | checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" 2886 | dependencies = [ 2887 | "pin-project-lite", 2888 | "tracing-attributes", 2889 | "tracing-core", 2890 | ] 2891 | 2892 | [[package]] 2893 | name = "tracing-attributes" 2894 | version = "0.1.30" 2895 | source = "registry+https://github.com/rust-lang/crates.io-index" 2896 | checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" 2897 | dependencies = [ 2898 | "proc-macro2", 2899 | "quote", 2900 | "syn", 2901 | ] 2902 | 2903 | [[package]] 2904 | name = "tracing-core" 2905 | version = "0.1.34" 2906 | source = "registry+https://github.com/rust-lang/crates.io-index" 2907 | checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" 2908 | dependencies = [ 2909 | "once_cell", 2910 | ] 2911 | 2912 | [[package]] 2913 | name = "triomphe" 2914 | version = "0.1.14" 2915 | source = "registry+https://github.com/rust-lang/crates.io-index" 2916 | checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" 2917 | dependencies = [ 2918 | "serde", 2919 | "stable_deref_trait", 2920 | ] 2921 | 2922 | [[package]] 2923 | name = "try-lock" 2924 | version = "0.2.5" 2925 | source = "registry+https://github.com/rust-lang/crates.io-index" 2926 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 2927 | 2928 | [[package]] 2929 | name = "typenum" 2930 | version = "1.18.0" 2931 | source = "registry+https://github.com/rust-lang/crates.io-index" 2932 | checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" 2933 | 2934 | [[package]] 2935 | name = "unicode-id-start" 2936 | version = "1.3.1" 2937 | source = "registry+https://github.com/rust-lang/crates.io-index" 2938 | checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" 2939 | 2940 | [[package]] 2941 | name = "unicode-ident" 2942 | version = "1.0.18" 2943 | source = "registry+https://github.com/rust-lang/crates.io-index" 2944 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 2945 | 2946 | [[package]] 2947 | name = "unicode-width" 2948 | version = "0.2.1" 2949 | source = "registry+https://github.com/rust-lang/crates.io-index" 2950 | checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" 2951 | 2952 | [[package]] 2953 | name = "untrusted" 2954 | version = "0.9.0" 2955 | source = "registry+https://github.com/rust-lang/crates.io-index" 2956 | checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 2957 | 2958 | [[package]] 2959 | name = "url" 2960 | version = "2.5.7" 2961 | source = "registry+https://github.com/rust-lang/crates.io-index" 2962 | checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" 2963 | dependencies = [ 2964 | "form_urlencoded", 2965 | "idna", 2966 | "percent-encoding", 2967 | "serde", 2968 | ] 2969 | 2970 | [[package]] 2971 | name = "utf8_iter" 2972 | version = "1.0.4" 2973 | source = "registry+https://github.com/rust-lang/crates.io-index" 2974 | checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" 2975 | 2976 | [[package]] 2977 | name = "uuid" 2978 | version = "1.16.0" 2979 | source = "registry+https://github.com/rust-lang/crates.io-index" 2980 | checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" 2981 | 2982 | [[package]] 2983 | name = "vcpkg" 2984 | version = "0.2.15" 2985 | source = "registry+https://github.com/rust-lang/crates.io-index" 2986 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 2987 | 2988 | [[package]] 2989 | name = "version_check" 2990 | version = "0.9.5" 2991 | source = "registry+https://github.com/rust-lang/crates.io-index" 2992 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 2993 | 2994 | [[package]] 2995 | name = "vsimd" 2996 | version = "0.8.0" 2997 | source = "registry+https://github.com/rust-lang/crates.io-index" 2998 | checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" 2999 | 3000 | [[package]] 3001 | name = "walkdir" 3002 | version = "2.5.0" 3003 | source = "registry+https://github.com/rust-lang/crates.io-index" 3004 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 3005 | dependencies = [ 3006 | "same-file", 3007 | "winapi-util", 3008 | ] 3009 | 3010 | [[package]] 3011 | name = "want" 3012 | version = "0.3.1" 3013 | source = "registry+https://github.com/rust-lang/crates.io-index" 3014 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 3015 | dependencies = [ 3016 | "try-lock", 3017 | ] 3018 | 3019 | [[package]] 3020 | name = "wasi" 3021 | version = "0.11.1+wasi-snapshot-preview1" 3022 | source = "registry+https://github.com/rust-lang/crates.io-index" 3023 | checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 3024 | 3025 | [[package]] 3026 | name = "wasi" 3027 | version = "0.14.2+wasi-0.2.4" 3028 | source = "registry+https://github.com/rust-lang/crates.io-index" 3029 | checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 3030 | dependencies = [ 3031 | "wit-bindgen-rt", 3032 | ] 3033 | 3034 | [[package]] 3035 | name = "wasm-bindgen" 3036 | version = "0.2.92" 3037 | source = "registry+https://github.com/rust-lang/crates.io-index" 3038 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 3039 | dependencies = [ 3040 | "cfg-if", 3041 | "wasm-bindgen-macro", 3042 | ] 3043 | 3044 | [[package]] 3045 | name = "wasm-bindgen-backend" 3046 | version = "0.2.92" 3047 | source = "registry+https://github.com/rust-lang/crates.io-index" 3048 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 3049 | dependencies = [ 3050 | "bumpalo", 3051 | "log", 3052 | "once_cell", 3053 | "proc-macro2", 3054 | "quote", 3055 | "syn", 3056 | "wasm-bindgen-shared", 3057 | ] 3058 | 3059 | [[package]] 3060 | name = "wasm-bindgen-futures" 3061 | version = "0.4.42" 3062 | source = "registry+https://github.com/rust-lang/crates.io-index" 3063 | checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" 3064 | dependencies = [ 3065 | "cfg-if", 3066 | "js-sys", 3067 | "wasm-bindgen", 3068 | "web-sys", 3069 | ] 3070 | 3071 | [[package]] 3072 | name = "wasm-bindgen-macro" 3073 | version = "0.2.92" 3074 | source = "registry+https://github.com/rust-lang/crates.io-index" 3075 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 3076 | dependencies = [ 3077 | "quote", 3078 | "wasm-bindgen-macro-support", 3079 | ] 3080 | 3081 | [[package]] 3082 | name = "wasm-bindgen-macro-support" 3083 | version = "0.2.92" 3084 | source = "registry+https://github.com/rust-lang/crates.io-index" 3085 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 3086 | dependencies = [ 3087 | "proc-macro2", 3088 | "quote", 3089 | "syn", 3090 | "wasm-bindgen-backend", 3091 | "wasm-bindgen-shared", 3092 | ] 3093 | 3094 | [[package]] 3095 | name = "wasm-bindgen-shared" 3096 | version = "0.2.92" 3097 | source = "registry+https://github.com/rust-lang/crates.io-index" 3098 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 3099 | 3100 | [[package]] 3101 | name = "wasm_dep_analyzer" 3102 | version = "0.4.0" 3103 | source = "registry+https://github.com/rust-lang/crates.io-index" 3104 | checksum = "a10e6b67c951a84de7029487e0e0a496860dae49f6699edd279d5ff35b8fbf54" 3105 | dependencies = [ 3106 | "deno_error", 3107 | "thiserror", 3108 | ] 3109 | 3110 | [[package]] 3111 | name = "web-sys" 3112 | version = "0.3.69" 3113 | source = "registry+https://github.com/rust-lang/crates.io-index" 3114 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" 3115 | dependencies = [ 3116 | "js-sys", 3117 | "wasm-bindgen", 3118 | ] 3119 | 3120 | [[package]] 3121 | name = "webpki-roots" 3122 | version = "0.25.4" 3123 | source = "registry+https://github.com/rust-lang/crates.io-index" 3124 | checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" 3125 | 3126 | [[package]] 3127 | name = "winapi-util" 3128 | version = "0.1.10" 3129 | source = "registry+https://github.com/rust-lang/crates.io-index" 3130 | checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" 3131 | dependencies = [ 3132 | "windows-sys 0.59.0", 3133 | ] 3134 | 3135 | [[package]] 3136 | name = "windows-sys" 3137 | version = "0.48.0" 3138 | source = "registry+https://github.com/rust-lang/crates.io-index" 3139 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 3140 | dependencies = [ 3141 | "windows-targets 0.48.5", 3142 | ] 3143 | 3144 | [[package]] 3145 | name = "windows-sys" 3146 | version = "0.52.0" 3147 | source = "registry+https://github.com/rust-lang/crates.io-index" 3148 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 3149 | dependencies = [ 3150 | "windows-targets 0.52.6", 3151 | ] 3152 | 3153 | [[package]] 3154 | name = "windows-sys" 3155 | version = "0.59.0" 3156 | source = "registry+https://github.com/rust-lang/crates.io-index" 3157 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 3158 | dependencies = [ 3159 | "windows-targets 0.52.6", 3160 | ] 3161 | 3162 | [[package]] 3163 | name = "windows-targets" 3164 | version = "0.48.5" 3165 | source = "registry+https://github.com/rust-lang/crates.io-index" 3166 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 3167 | dependencies = [ 3168 | "windows_aarch64_gnullvm 0.48.5", 3169 | "windows_aarch64_msvc 0.48.5", 3170 | "windows_i686_gnu 0.48.5", 3171 | "windows_i686_msvc 0.48.5", 3172 | "windows_x86_64_gnu 0.48.5", 3173 | "windows_x86_64_gnullvm 0.48.5", 3174 | "windows_x86_64_msvc 0.48.5", 3175 | ] 3176 | 3177 | [[package]] 3178 | name = "windows-targets" 3179 | version = "0.52.6" 3180 | source = "registry+https://github.com/rust-lang/crates.io-index" 3181 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 3182 | dependencies = [ 3183 | "windows_aarch64_gnullvm 0.52.6", 3184 | "windows_aarch64_msvc 0.52.6", 3185 | "windows_i686_gnu 0.52.6", 3186 | "windows_i686_gnullvm", 3187 | "windows_i686_msvc 0.52.6", 3188 | "windows_x86_64_gnu 0.52.6", 3189 | "windows_x86_64_gnullvm 0.52.6", 3190 | "windows_x86_64_msvc 0.52.6", 3191 | ] 3192 | 3193 | [[package]] 3194 | name = "windows_aarch64_gnullvm" 3195 | version = "0.48.5" 3196 | source = "registry+https://github.com/rust-lang/crates.io-index" 3197 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 3198 | 3199 | [[package]] 3200 | name = "windows_aarch64_gnullvm" 3201 | version = "0.52.6" 3202 | source = "registry+https://github.com/rust-lang/crates.io-index" 3203 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 3204 | 3205 | [[package]] 3206 | name = "windows_aarch64_msvc" 3207 | version = "0.48.5" 3208 | source = "registry+https://github.com/rust-lang/crates.io-index" 3209 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 3210 | 3211 | [[package]] 3212 | name = "windows_aarch64_msvc" 3213 | version = "0.52.6" 3214 | source = "registry+https://github.com/rust-lang/crates.io-index" 3215 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 3216 | 3217 | [[package]] 3218 | name = "windows_i686_gnu" 3219 | version = "0.48.5" 3220 | source = "registry+https://github.com/rust-lang/crates.io-index" 3221 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 3222 | 3223 | [[package]] 3224 | name = "windows_i686_gnu" 3225 | version = "0.52.6" 3226 | source = "registry+https://github.com/rust-lang/crates.io-index" 3227 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 3228 | 3229 | [[package]] 3230 | name = "windows_i686_gnullvm" 3231 | version = "0.52.6" 3232 | source = "registry+https://github.com/rust-lang/crates.io-index" 3233 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 3234 | 3235 | [[package]] 3236 | name = "windows_i686_msvc" 3237 | version = "0.48.5" 3238 | source = "registry+https://github.com/rust-lang/crates.io-index" 3239 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 3240 | 3241 | [[package]] 3242 | name = "windows_i686_msvc" 3243 | version = "0.52.6" 3244 | source = "registry+https://github.com/rust-lang/crates.io-index" 3245 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 3246 | 3247 | [[package]] 3248 | name = "windows_x86_64_gnu" 3249 | version = "0.48.5" 3250 | source = "registry+https://github.com/rust-lang/crates.io-index" 3251 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 3252 | 3253 | [[package]] 3254 | name = "windows_x86_64_gnu" 3255 | version = "0.52.6" 3256 | source = "registry+https://github.com/rust-lang/crates.io-index" 3257 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 3258 | 3259 | [[package]] 3260 | name = "windows_x86_64_gnullvm" 3261 | version = "0.48.5" 3262 | source = "registry+https://github.com/rust-lang/crates.io-index" 3263 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 3264 | 3265 | [[package]] 3266 | name = "windows_x86_64_gnullvm" 3267 | version = "0.52.6" 3268 | source = "registry+https://github.com/rust-lang/crates.io-index" 3269 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 3270 | 3271 | [[package]] 3272 | name = "windows_x86_64_msvc" 3273 | version = "0.48.5" 3274 | source = "registry+https://github.com/rust-lang/crates.io-index" 3275 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 3276 | 3277 | [[package]] 3278 | name = "windows_x86_64_msvc" 3279 | version = "0.52.6" 3280 | source = "registry+https://github.com/rust-lang/crates.io-index" 3281 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 3282 | 3283 | [[package]] 3284 | name = "winreg" 3285 | version = "0.50.0" 3286 | source = "registry+https://github.com/rust-lang/crates.io-index" 3287 | checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" 3288 | dependencies = [ 3289 | "cfg-if", 3290 | "windows-sys 0.48.0", 3291 | ] 3292 | 3293 | [[package]] 3294 | name = "wit-bindgen-rt" 3295 | version = "0.39.0" 3296 | source = "registry+https://github.com/rust-lang/crates.io-index" 3297 | checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 3298 | dependencies = [ 3299 | "bitflags 2.9.3", 3300 | ] 3301 | 3302 | [[package]] 3303 | name = "writeable" 3304 | version = "0.6.1" 3305 | source = "registry+https://github.com/rust-lang/crates.io-index" 3306 | checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" 3307 | 3308 | [[package]] 3309 | name = "wyz" 3310 | version = "0.5.1" 3311 | source = "registry+https://github.com/rust-lang/crates.io-index" 3312 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 3313 | dependencies = [ 3314 | "tap", 3315 | ] 3316 | 3317 | [[package]] 3318 | name = "xxhash-rust" 3319 | version = "0.8.15" 3320 | source = "registry+https://github.com/rust-lang/crates.io-index" 3321 | checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" 3322 | 3323 | [[package]] 3324 | name = "yansi" 3325 | version = "1.0.1" 3326 | source = "registry+https://github.com/rust-lang/crates.io-index" 3327 | checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" 3328 | 3329 | [[package]] 3330 | name = "yoke" 3331 | version = "0.8.0" 3332 | source = "registry+https://github.com/rust-lang/crates.io-index" 3333 | checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" 3334 | dependencies = [ 3335 | "serde", 3336 | "stable_deref_trait", 3337 | "yoke-derive", 3338 | "zerofrom", 3339 | ] 3340 | 3341 | [[package]] 3342 | name = "yoke-derive" 3343 | version = "0.8.0" 3344 | source = "registry+https://github.com/rust-lang/crates.io-index" 3345 | checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" 3346 | dependencies = [ 3347 | "proc-macro2", 3348 | "quote", 3349 | "syn", 3350 | "synstructure", 3351 | ] 3352 | 3353 | [[package]] 3354 | name = "zerocopy" 3355 | version = "0.8.26" 3356 | source = "registry+https://github.com/rust-lang/crates.io-index" 3357 | checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" 3358 | dependencies = [ 3359 | "zerocopy-derive", 3360 | ] 3361 | 3362 | [[package]] 3363 | name = "zerocopy-derive" 3364 | version = "0.8.26" 3365 | source = "registry+https://github.com/rust-lang/crates.io-index" 3366 | checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" 3367 | dependencies = [ 3368 | "proc-macro2", 3369 | "quote", 3370 | "syn", 3371 | ] 3372 | 3373 | [[package]] 3374 | name = "zerofrom" 3375 | version = "0.1.6" 3376 | source = "registry+https://github.com/rust-lang/crates.io-index" 3377 | checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" 3378 | dependencies = [ 3379 | "zerofrom-derive", 3380 | ] 3381 | 3382 | [[package]] 3383 | name = "zerofrom-derive" 3384 | version = "0.1.6" 3385 | source = "registry+https://github.com/rust-lang/crates.io-index" 3386 | checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" 3387 | dependencies = [ 3388 | "proc-macro2", 3389 | "quote", 3390 | "syn", 3391 | "synstructure", 3392 | ] 3393 | 3394 | [[package]] 3395 | name = "zerotrie" 3396 | version = "0.2.2" 3397 | source = "registry+https://github.com/rust-lang/crates.io-index" 3398 | checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" 3399 | dependencies = [ 3400 | "displaydoc", 3401 | "yoke", 3402 | "zerofrom", 3403 | ] 3404 | 3405 | [[package]] 3406 | name = "zerovec" 3407 | version = "0.11.4" 3408 | source = "registry+https://github.com/rust-lang/crates.io-index" 3409 | checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" 3410 | dependencies = [ 3411 | "yoke", 3412 | "zerofrom", 3413 | "zerovec-derive", 3414 | ] 3415 | 3416 | [[package]] 3417 | name = "zerovec-derive" 3418 | version = "0.11.1" 3419 | source = "registry+https://github.com/rust-lang/crates.io-index" 3420 | checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" 3421 | dependencies = [ 3422 | "proc-macro2", 3423 | "quote", 3424 | "syn", 3425 | ] 3426 | --------------------------------------------------------------------------------