├── packages └── jest │ ├── README.md │ ├── src │ ├── index.ts │ ├── factory.ts │ ├── merge.ts │ └── options.ts │ ├── package.json │ └── tsconfig.json ├── rust-toolchain.toml ├── .yarnrc.yml ├── napi └── transform │ ├── build.rs │ ├── options.d.ts │ ├── __tests__ │ └── index.spec.ts │ ├── npm │ ├── darwin-x64 │ │ ├── README.md │ │ └── package.json │ ├── darwin-arm64 │ │ ├── README.md │ │ └── package.json │ ├── freebsd-x64 │ │ ├── README.md │ │ └── package.json │ ├── android-arm64 │ │ ├── README.md │ │ └── package.json │ ├── linux-x64-gnu │ │ ├── README.md │ │ └── package.json │ ├── win32-ia32-msvc │ │ ├── README.md │ │ └── package.json │ ├── win32-x64-msvc │ │ ├── README.md │ │ └── package.json │ ├── android-arm-eabi │ │ ├── README.md │ │ └── package.json │ ├── darwin-universal │ │ ├── README.md │ │ └── package.json │ ├── linux-arm64-gnu │ │ ├── README.md │ │ └── package.json │ ├── linux-x64-musl │ │ ├── README.md │ │ └── package.json │ ├── win32-arm64-msvc │ │ ├── README.md │ │ └── package.json │ ├── linux-arm64-musl │ │ ├── README.md │ │ └── package.json │ ├── linux-riscv64-gnu │ │ ├── README.md │ │ └── package.json │ ├── linux-arm-gnueabihf │ │ ├── README.md │ │ └── package.json │ └── linux-arm-musleabihf │ │ ├── README.md │ │ └── package.json │ ├── tsconfig.json │ ├── .npmignore │ ├── .cargo │ └── config.toml │ ├── bin │ └── typegen-hack.js │ ├── Cargo.toml │ ├── package.json │ ├── index.d.ts │ ├── .gitignore │ ├── src │ ├── options.rs │ └── lib.rs │ ├── jest.config.js │ └── index.js ├── .github ├── renovate.json └── workflows │ ├── ci-js.yml │ ├── ci.yml │ └── ci-rs.yml ├── README.md ├── .taplo.toml ├── .prettierrc ├── .gitignore ├── Cargo.toml ├── package.json └── Cargo.lock /packages/jest/README.md: -------------------------------------------------------------------------------- 1 | # oxc-jest 2 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "1.91.1" 3 | profile = "default" 4 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-4.11.0.cjs 4 | -------------------------------------------------------------------------------- /napi/transform/build.rs: -------------------------------------------------------------------------------- 1 | extern crate napi_build; 2 | 3 | fn main() { 4 | napi_build::setup(); 5 | } 6 | -------------------------------------------------------------------------------- /napi/transform/options.d.ts: -------------------------------------------------------------------------------- 1 | export const enum CompressOption { 2 | None = 0, 3 | Whitespace = 1, 4 | Fold = 2, 5 | } 6 | -------------------------------------------------------------------------------- /napi/transform/__tests__/index.spec.ts: -------------------------------------------------------------------------------- 1 | const sum = (a, b) => a + b 2 | 3 | test('sum', (t) => { 4 | expect(sum(1, 2)).toBe(3) 5 | }) 6 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["github>Boshen/renovate"] 4 | } 5 | -------------------------------------------------------------------------------- /napi/transform/npm/darwin-x64/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-darwin-x64` 2 | 3 | This is the **x86_64-apple-darwin** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/darwin-arm64/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-darwin-arm64` 2 | 3 | This is the **aarch64-apple-darwin** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/freebsd-x64/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-freebsd-x64` 2 | 3 | This is the **x86_64-unknown-freebsd** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/android-arm64/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-android-arm64` 2 | 3 | This is the **aarch64-linux-android** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-x64-gnu/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-linux-x64-gnu` 2 | 3 | This is the **x86_64-unknown-linux-gnu** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/win32-ia32-msvc/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-win32-ia32-msvc` 2 | 3 | This is the **i686-pc-windows-msvc** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/win32-x64-msvc/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-win32-x64-msvc` 2 | 3 | This is the **x86_64-pc-windows-msvc** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # oxc-jest 2 | 3 | A Jest transformer for transpiling JavaScript and TypeScript with Oxc. 4 | 5 | > 🚧 This package is still actively under construction. 6 | -------------------------------------------------------------------------------- /napi/transform/npm/android-arm-eabi/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-android-arm-eabi` 2 | 3 | This is the **armv7-linux-androideabi** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/darwin-universal/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-darwin-universal` 2 | 3 | This is the **universal-apple-darwin** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm64-gnu/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-linux-arm64-gnu` 2 | 3 | This is the **aarch64-unknown-linux-gnu** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-x64-musl/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-linux-x64-musl` 2 | 3 | This is the **x86_64-unknown-linux-musl** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/win32-arm64-msvc/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-win32-arm64-msvc` 2 | 3 | This is the **aarch64-pc-windows-msvc** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm64-musl/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-linux-arm64-musl` 2 | 3 | This is the **aarch64-unknown-linux-musl** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-riscv64-gnu/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-linux-riscv64-gnu` 2 | 3 | This is the **riscv64gc-unknown-linux-gnu** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /.taplo.toml: -------------------------------------------------------------------------------- 1 | include = ["*.toml", "napi/*/*.toml"] 2 | 3 | [formatting] 4 | align_entries = true 5 | column_width = 120 6 | align_comments = false 7 | reorder_arrays = true 8 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "arrowParens": "avoid", 4 | "printWidth": 100, 5 | "semi": false, 6 | "singleQuote": true, 7 | "trailingComma": "es5" 8 | } 9 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm-gnueabihf/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-linux-arm-gnueabihf` 2 | 3 | This is the **armv7-unknown-linux-gnueabihf** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm-musleabihf/README.md: -------------------------------------------------------------------------------- 1 | # `@oxc-jest/transform-linux-arm-musleabihf` 2 | 3 | This is the **armv7-unknown-linux-musleabihf** binary for `@oxc-jest/transform` 4 | -------------------------------------------------------------------------------- /napi/transform/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noEmit": true, 4 | "rootDir": ".", 5 | "strict": true, 6 | "allowJs": true, 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/jest/src/index.ts: -------------------------------------------------------------------------------- 1 | import type { Options } from './options' 2 | import { createTransformer } from './factory' 3 | 4 | export { Options } 5 | export default { createTransformer } 6 | -------------------------------------------------------------------------------- /napi/transform/.npmignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | .cargo 4 | .github 5 | npm 6 | .eslintrc 7 | .prettierignore 8 | rustfmt.toml 9 | yarn.lock 10 | *.node 11 | .yarn 12 | __test__ 13 | renovate.json 14 | -------------------------------------------------------------------------------- /napi/transform/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.aarch64-unknown-linux-musl] 2 | linker = "aarch64-linux-musl-gcc" 3 | rustflags = ["-C", "target-feature=-crt-static"] 4 | [target.x86_64-pc-windows-msvc] 5 | rustflags = ["-C", "target-feature=+crt-static"] -------------------------------------------------------------------------------- /napi/transform/npm/darwin-universal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-darwin-universal", 3 | "version": "0.0.0", 4 | "os": [ 5 | "darwin" 6 | ], 7 | "main": "transform.darwin-universal.node", 8 | "files": [ 9 | "transform.darwin-universal.node" 10 | ], 11 | "license": "MIT", 12 | "engines": { 13 | "node": ">= 10" 14 | } 15 | } -------------------------------------------------------------------------------- /napi/transform/npm/darwin-x64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-darwin-x64", 3 | "version": "0.0.0", 4 | "os": [ 5 | "darwin" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "transform.darwin-x64.node", 11 | "files": [ 12 | "transform.darwin-x64.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/freebsd-x64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-freebsd-x64", 3 | "version": "0.0.0", 4 | "os": [ 5 | "freebsd" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "transform.freebsd-x64.node", 11 | "files": [ 12 | "transform.freebsd-x64.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/darwin-arm64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-darwin-arm64", 3 | "version": "0.0.0", 4 | "os": [ 5 | "darwin" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "transform.darwin-arm64.node", 11 | "files": [ 12 | "transform.darwin-arm64.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/android-arm64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-android-arm64", 3 | "version": "0.0.0", 4 | "os": [ 5 | "android" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "transform.android-arm64.node", 11 | "files": [ 12 | "transform.android-arm64.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/win32-x64-msvc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-win32-x64-msvc", 3 | "version": "0.0.0", 4 | "os": [ 5 | "win32" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "transform.win32-x64-msvc.node", 11 | "files": [ 12 | "transform.win32-x64-msvc.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/win32-ia32-msvc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-win32-ia32-msvc", 3 | "version": "0.0.0", 4 | "os": [ 5 | "win32" 6 | ], 7 | "cpu": [ 8 | "ia32" 9 | ], 10 | "main": "transform.win32-ia32-msvc.node", 11 | "files": [ 12 | "transform.win32-ia32-msvc.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/android-arm-eabi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-android-arm-eabi", 3 | "version": "0.0.0", 4 | "os": [ 5 | "android" 6 | ], 7 | "cpu": [ 8 | "arm" 9 | ], 10 | "main": "transform.android-arm-eabi.node", 11 | "files": [ 12 | "transform.android-arm-eabi.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/win32-arm64-msvc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-win32-arm64-msvc", 3 | "version": "0.0.0", 4 | "os": [ 5 | "win32" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "transform.win32-arm64-msvc.node", 11 | "files": [ 12 | "transform.win32-arm64-msvc.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm-gnueabihf/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-linux-arm-gnueabihf", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "arm" 9 | ], 10 | "main": "transform.linux-arm-gnueabihf.node", 11 | "files": [ 12 | "transform.linux-arm-gnueabihf.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm-musleabihf/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-linux-arm-musleabihf", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "arm" 9 | ], 10 | "main": "transform.linux-arm-musleabihf.node", 11 | "files": [ 12 | "transform.linux-arm-musleabihf.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } -------------------------------------------------------------------------------- /napi/transform/npm/linux-x64-gnu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-linux-x64-gnu", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "transform.linux-x64-gnu.node", 11 | "files": [ 12 | "transform.linux-x64-gnu.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "glibc" 20 | ] 21 | } -------------------------------------------------------------------------------- /napi/transform/npm/linux-x64-musl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-linux-x64-musl", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "transform.linux-x64-musl.node", 11 | "files": [ 12 | "transform.linux-x64-musl.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "musl" 20 | ] 21 | } -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm64-gnu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-linux-arm64-gnu", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "transform.linux-arm64-gnu.node", 11 | "files": [ 12 | "transform.linux-arm64-gnu.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "glibc" 20 | ] 21 | } -------------------------------------------------------------------------------- /napi/transform/npm/linux-arm64-musl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-linux-arm64-musl", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "transform.linux-arm64-musl.node", 11 | "files": [ 12 | "transform.linux-arm64-musl.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "musl" 20 | ] 21 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Artifacts 2 | target 3 | **/*.node 4 | **/dist 5 | 6 | # Generated packages 7 | npm/* 8 | 9 | # Yarn berry without zero-installs 10 | .yarn/* 11 | !.yarn/patches 12 | !.yarn/releases 13 | !.yarn/plugins 14 | !.yarn/sdks 15 | !.yarn/versions 16 | .pnp.* 17 | **/node_modules 18 | **/yarn-error.log 19 | 20 | # Editor files 21 | *.swp 22 | *.swo 23 | .idea 24 | 25 | # Misc 26 | .DS_Store 27 | 28 | # Temporary files 29 | tmp/ 30 | *.tmp 31 | -------------------------------------------------------------------------------- /napi/transform/npm/linux-riscv64-gnu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform-linux-riscv64-gnu", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "riscv64" 9 | ], 10 | "main": "transform.linux-riscv64-gnu.node", 11 | "files": [ 12 | "transform.linux-riscv64-gnu.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "glibc" 20 | ] 21 | } -------------------------------------------------------------------------------- /napi/transform/bin/typegen-hack.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | // @ts-check 3 | const path = require('path') 4 | const fs = require('fs') 5 | const assert = require('assert') 6 | 7 | const TYPEDEF_PATH = path.resolve(__dirname, '..', 'index.d.ts') 8 | const INJECT_HEADER = ` 9 | import type { CompressOption } from './options' 10 | 11 | ` 12 | 13 | const INJECT_FOOTER = ` 14 | export type { CompressOption } 15 | ` 16 | 17 | 18 | const typeDefs = fs.readFileSync(TYPEDEF_PATH, 'utf8') 19 | 20 | const startOfCode = typeDefs.indexOf('export') 21 | assert(startOfCode !== -1) 22 | 23 | const modified = typeDefs.slice(0, startOfCode) + 24 | INJECT_HEADER + 25 | typeDefs.slice(startOfCode) + 26 | INJECT_FOOTER 27 | 28 | fs.writeFileSync(TYPEDEF_PATH, modified) 29 | console.log('done') 30 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = ["napi/*"] 4 | 5 | [workspace.package] 6 | authors = ["Don Isaac"] 7 | categories = ["compilers", "development-tools", "web-programming"] 8 | edition = "2021" 9 | keywords = ["JavaScript", "Jest", "Oxc", "TypeScript", "transpiler"] 10 | license = "MIT" 11 | rust-version = "1.77" 12 | 13 | [workspace.dependencies] 14 | oxc_allocator = { version = "0.96.0" } 15 | oxc_codegen = { version = "0.96.0" } 16 | oxc_parser = { version = "0.96.0" } 17 | oxc_sourcemap = { version = "6.0.0" } 18 | oxc_span = { version = "0.96.0" } 19 | oxc_syntax = { version = "0.96.0" } 20 | oxc_transformer = { version = "0.96.0" } 21 | oxc_semantic = { version = "0.96.0" } 22 | 23 | itertools = { version = "0.14.0" } 24 | tokio = { version = "1.38.0", features = ["rt-multi-thread"] } 25 | wasm-bindgen = { version = "0.2.92" } 26 | -------------------------------------------------------------------------------- /packages/jest/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oxc-jest", 3 | "version": "0.0.0", 4 | "description": "A Jest transformer for transpiling JavaScript and TypeScript with Oxc", 5 | "authors": [ 6 | "Don Isaac", 7 | "Boshen", 8 | "Oxc Contributors" 9 | ], 10 | "repository": { 11 | "url": "https://github.com/oxc-project/oxc-jest", 12 | "directory": "packages/jest" 13 | }, 14 | "license": "MIT", 15 | "private": true, 16 | "packageManager": "yarn@4.11.0", 17 | "engines": { 18 | "node": ">=18.0.0" 19 | }, 20 | "main": "dist/index.js", 21 | "types": "dist/index.d.ts", 22 | "scripts": { 23 | "build": "tsc", 24 | "build:debug": "tsc", 25 | "clean": "rm -rf dist || true" 26 | }, 27 | "dependencies": { 28 | "@jest/create-cache-key-function": "^30.0.0", 29 | "@oxc-jest/transform": "*", 30 | "jsonc-parser": "^3.3.1", 31 | "zod": "^4.0.0" 32 | }, 33 | "devDependencies": { 34 | "@jest/transform": "^30.0.0", 35 | "@types/node": "^24.0.0", 36 | "oxlint": "^1.0.0", 37 | "type-fest": "^5.0.0", 38 | "typescript": "^5.5.2" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/monorepo", 3 | "version": "0.0.0", 4 | "description": "A Jest transformer for transpiling JavaScript and TypeScript with Oxc", 5 | "authors": [ 6 | "Don Isaac", 7 | "Boshen", 8 | "Oxc Contributors" 9 | ], 10 | "repository": { 11 | "url": "https://github.com/oxc-project/oxc-jest" 12 | }, 13 | "license": "MIT", 14 | "private": true, 15 | "type": "module", 16 | "packageManager": "yarn@4.11.0", 17 | "workspaces": [ 18 | "napi/*", 19 | "packages/*" 20 | ], 21 | "scripts": { 22 | "build": "yarn workspaces foreach -Apt run build", 23 | "build:debug": "yarn workspaces foreach -Apt run 'build:debug'", 24 | "lint": "oxlint --jest-plugin -D correctness -W suspicious -D no-await-in-loop -D no-accumulating-spread -D no-var-requires -D no-var -D throw-new-error", 25 | "clean": "yarn clean:js && cargo clean", 26 | "clean:js": "yarn workspaces foreach -A run clean" 27 | }, 28 | "devDependencies": { 29 | "oxlint": "^1.0.0", 30 | "typescript": "^5.5.2" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /napi/transform/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "oxc-jest_transform" 3 | version = "0.0.0" 4 | authors.workspace = true 5 | categories.workspace = true 6 | license.workspace = true 7 | keywords.workspace = true 8 | rust-version.workspace = true 9 | edition.workspace = true 10 | publish = false 11 | 12 | [lib] 13 | crate-type = ["cdylib"] 14 | 15 | [dependencies] 16 | oxc_allocator = { workspace = true } 17 | oxc_codegen = { workspace = true } 18 | oxc_parser = { workspace = true } 19 | oxc_sourcemap = { workspace = true } 20 | oxc_span = { workspace = true } 21 | oxc_syntax = { workspace = true } 22 | oxc_transformer = { workspace = true } 23 | oxc_semantic = { workspace = true } 24 | 25 | itertools = { workspace = true } 26 | tokio = { workspace = true } 27 | 28 | # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix 29 | napi = { version = "2.16.8", default-features = false, features = ["async", "napi4"] } 30 | napi-derive = "2.16.10" 31 | 32 | [build-dependencies] 33 | napi-build = "2.1.3" 34 | 35 | [profile.release] 36 | lto = true 37 | strip = "symbols" 38 | -------------------------------------------------------------------------------- /.github/workflows/ci-js.yml: -------------------------------------------------------------------------------- 1 | name: CI (Node) 2 | on: 3 | push: 4 | branches: [main] 5 | paths-ignore: 6 | - '**/*.md' 7 | - '**/*.yml' 8 | - '**/*.rs' 9 | - '**/Cargo.toml' 10 | - 'Cargo.lock' 11 | - 'rust-toolchain.toml' 12 | - '.taplo.toml' 13 | - '!.github/workflows/ci-js.yml' 14 | pull_request: 15 | branches: [main] 16 | types: [opened, synchronize] 17 | paths-ignore: 18 | - '**/*.md' 19 | - '**/*.yml' 20 | - '**/*.rs' 21 | - '**/Cargo.toml' 22 | - 'Cargo.lock' 23 | - 'rust-toolchain.toml' 24 | - '.taplo.toml' 25 | - '!.github/workflows/ci-js.yml' 26 | env: 27 | NODE_VERSION: 22 28 | jobs: 29 | lint-and-check: 30 | name: Lint and Check 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1 34 | - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 35 | with: 36 | node-version: ${{ env.NODE_VERSION }} 37 | cache: 'yarn' 38 | 39 | - run: yarn --no-immutable 40 | - run: yarn lint --format github 41 | - run: yarn typecheck 42 | working-directory: napi/transform 43 | -------------------------------------------------------------------------------- /napi/transform/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@oxc-jest/transform", 3 | "version": "0.0.0", 4 | "main": "index.js", 5 | "types": "index.d.ts", 6 | "napi": { 7 | "name": "transform", 8 | "triples": { 9 | "additional": [ 10 | "aarch64-apple-darwin", 11 | "aarch64-linux-android", 12 | "aarch64-unknown-linux-gnu", 13 | "aarch64-unknown-linux-musl", 14 | "aarch64-pc-windows-msvc", 15 | "armv7-unknown-linux-gnueabihf", 16 | "armv7-unknown-linux-musleabihf", 17 | "x86_64-unknown-linux-musl", 18 | "x86_64-unknown-freebsd", 19 | "i686-pc-windows-msvc", 20 | "armv7-linux-androideabi", 21 | "universal-apple-darwin", 22 | "riscv64gc-unknown-linux-gnu" 23 | ] 24 | } 25 | }, 26 | "license": "MIT", 27 | "devDependencies": { 28 | "@napi-rs/cli": "^3.0.0", 29 | "jest": "^30.0.0", 30 | "@types/jest": "^30.0.0" 31 | }, 32 | "engines": { 33 | "node": ">= 10" 34 | }, 35 | "scripts": { 36 | "artifacts": "napi artifacts", 37 | "build": "napi build --platform --release && yarn postbuild", 38 | "build:debug": "napi build --platform && yarn postbuild", 39 | "postbuild": "node bin/typegen-hack.js", 40 | "prepublishOnly": "napi prepublish -t npm", 41 | "test": "NODE_OPTIONS='--experimental-vm-modules' jest", 42 | "universal": "napi universal", 43 | "version": "napi version", 44 | "typecheck": "tsc", 45 | "clean": "rm *.node || true" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/jest/src/factory.ts: -------------------------------------------------------------------------------- 1 | import { Transformer, TransformerCreator } from '@jest/transform' 2 | import { transform, transformAsync } from '@oxc-jest/transform' 3 | 4 | import { Options, Config, createTransformConfig } from './options' 5 | import createCacheKey from '@jest/create-cache-key-function' 6 | 7 | /** 8 | * @note this must be exactly named `createTransformer` to be picked up by Jest. 9 | */ 10 | export const createTransformer: TransformerCreator< 11 | Transformer, 12 | Options 13 | > = async options => { 14 | const config: Config = await createTransformConfig(options) 15 | const getCacheKey = createCacheKey( 16 | // files that affect computed cache key 17 | ['package.json', 'tsconfig.json'], 18 | // values that affect computed cache key 19 | [JSON.stringify(config)] 20 | ) 21 | 22 | return { 23 | canInstrument: false, 24 | getCacheKey: getCacheKey as Transformer['getCacheKey'], 25 | process(sourceText, sourcePath, _jestOptions) { 26 | const { sourceText: code, sourceMap: _map } = transform(sourcePath, sourceText) 27 | return { code, map: undefined } 28 | }, 29 | async processAsync(sourceText, sourcePath, _jestOptions) { 30 | const { sourceText: code, sourceMap: _map } = await transformAsync( 31 | sourcePath, 32 | sourceText, 33 | config 34 | ) 35 | return { code, map: undefined } 36 | }, 37 | } satisfies Transformer 38 | } 39 | -------------------------------------------------------------------------------- /packages/jest/src/merge.ts: -------------------------------------------------------------------------------- 1 | const isObject = (val: unknown): val is object => typeof val === 'object' && val !== null 2 | 3 | type AnyRecord = Record 4 | type DeepMerge = { 5 | [K in keyof (T & U)]: K extends keyof U 6 | ? U[K] extends AnyRecord 7 | ? T[K] extends AnyRecord 8 | ? DeepMerge 9 | : U[K] 10 | : U[K] 11 | : K extends keyof T 12 | ? T[K] 13 | : never 14 | } 15 | 16 | /** 17 | * merge properties from the `right` object into the `left` object. Nullish keys 18 | * are skipped. 19 | */ 20 | export function deepMergeLeftMut( 21 | left: T, 22 | right: U 23 | ): DeepMerge { 24 | for (const key in right) { 25 | const a = key in left ? left[key as keyof T] : undefined 26 | const b = right[key] 27 | if (right[key] == null) continue 28 | else if (isObject(a) && isObject(b)) { 29 | left[key as keyof T] = deepMergeLeftMut(a as AnyRecord, b as AnyRecord) as any 30 | } else { 31 | left[key as keyof T] = b as any 32 | } 33 | } 34 | 35 | return left as DeepMerge 36 | } 37 | 38 | export function merge(arr: T[]): T 39 | export function merge(arr: [T, U]): DeepMerge 40 | export function merge( 41 | arr: [T, U, V] 42 | ): DeepMerge, V> 43 | export function merge(arr: AnyRecord[]) { 44 | return arr.reduce(deepMergeLeftMut, {} as AnyRecord) 45 | } 46 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | paths-ignore: 7 | - '**/*.md' 8 | - '**/*.yml' 9 | - '!.github/workflows/ci.yml' 10 | pull_request: 11 | branches: [main] 12 | types: [opened, synchronize] 13 | paths-ignore: 14 | - '**/*.md' 15 | - '**/*.yml' 16 | - '!.github/workflows/ci.yml' 17 | 18 | env: 19 | NODE_VERSION: 22 20 | 21 | jobs: 22 | build: 23 | name: Build 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1 27 | - uses: Boshen/setup-rust@main 28 | with: 29 | # warm cache factory for all other CI jobs 30 | # cache `target` directory to avoid download crates 31 | save-cache: ${{ github.ref_name == 'main' }} 32 | cache-key: warm 33 | - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 34 | with: 35 | node-version: ${{ env.NODE_VERSION }} 36 | cache: 'yarn' 37 | - run: yarn --no-immutable 38 | - run: cargo check 39 | # gets done by yarn build, but `yarn workspaces run` suppresses 40 | # output and this is a good way to check for errors. Cached results 41 | # will be used in following step. 42 | - run: yarn napi build 43 | working-directory: napi/transform 44 | - run: yarn build:debug 45 | # FIXME: yarn.lock always changes 46 | # - run: git diff --exit-code 47 | -------------------------------------------------------------------------------- /napi/transform/index.d.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | 4 | /* auto-generated by NAPI-RS */ 5 | 6 | 7 | import type { CompressOption } from './options' 8 | 9 | export interface TransformOptions { 10 | react: ReactOptions 11 | codegen: MinifyOptions 12 | } 13 | export interface MinifyOptions { 14 | compress: CompressOption | boolean 15 | sourceMap: boolean 16 | } 17 | export interface ReactOptions { 18 | jsxPlugin: boolean 19 | runtime: ReactJsxRuntime 20 | } 21 | export const enum ReactJsxRuntime { 22 | Classic = 0, 23 | Automatic = 1 24 | } 25 | /** 26 | * should match 27 | * [`EncodedSourceMap`](https://github.com/jridgewell/trace-mapping/blob/5a658b10d9b6dea9c614ff545ca9c4df895fee9e/src/types.ts#L14) 28 | * from `@jridgewell/trace-mapping`, since this is what Jest expects. 29 | * ```ts 30 | * export interface SourceMapV3 { 31 | * file?: string | null; 32 | * names: string[]; 33 | * sourceRoot?: string; 34 | * sources: (string | null)[]; 35 | * sourcesContent?: (string | null)[]; 36 | * version: 3; 37 | * ignoreList?: number[]; 38 | * } 39 | * 40 | * export interface EncodedSourceMap extends SourceMapV3 { 41 | * mappings: string; 42 | * } 43 | * ``` 44 | */ 45 | export interface SourceMap { 46 | file?: string 47 | names: Array 48 | sourceRoot?: string 49 | sources: (string | null)[] 50 | sourcesContent?: (string | null)[] 51 | version: number 52 | ignoreList?: Array 53 | mappings: string 54 | } 55 | export interface TransformResult { 56 | sourceText: string 57 | sourceMap?: SourceMap 58 | } 59 | export declare function transform(filename: string, sourceText: string, options?: TransformOptions | undefined | null): TransformResult 60 | export declare function transformAsync(filename: string, sourceText: string, options?: TransformOptions | undefined | null): Promise 61 | 62 | export type { CompressOption } 63 | -------------------------------------------------------------------------------- /.github/workflows/ci-rs.yml: -------------------------------------------------------------------------------- 1 | name: CI (Rust) 2 | on: 3 | push: 4 | branches: [main] 5 | paths-ignore: 6 | - '**/*.md' 7 | - '**/*.yml' 8 | - '**/*.ts' 9 | - '**/*.js' 10 | - '**/*.d.ts' 11 | - '**/package.json' 12 | - '**/tsconfig.json' 13 | - '**/.prettierrc.json' 14 | - 'yarn.lock' 15 | - '!.github/workflows/ci-rs.yml' 16 | pull_request: 17 | branches: [main] 18 | types: [opened, synchronize] 19 | paths-ignore: 20 | - '**/*.md' 21 | - '**/*.yml' 22 | - '**/*.ts' 23 | - '**/*.js' 24 | - '**/*.d.ts' 25 | - '**/package.json' 26 | - '**/tsconfig.json' 27 | - '**/.prettierrc.json' 28 | - 'yarn.lock' 29 | - '!.github/workflows/ci-rs.yml' 30 | jobs: 31 | check: 32 | name: Check 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1 36 | - uses: Boshen/setup-rust@main 37 | with: 38 | # warm cache factory for all other CI jobs 39 | # cache `target` directory to avoid download crates 40 | save-cache: ${{ github.ref_name == 'main' }} 41 | cache-key: warm 42 | - run: cargo check 43 | fmt: 44 | name: Format 45 | runs-on: ubuntu-latest 46 | steps: 47 | - uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1 48 | - uses: Boshen/setup-rust@main 49 | with: 50 | components: rustfmt 51 | tools: taplo-cli 52 | restore-cache: false 53 | - run: cargo fmt --all -- --check 54 | - run: taplo lint 55 | 56 | clippy: 57 | name: Clippy 58 | runs-on: ubuntu-latest 59 | steps: 60 | - uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1 61 | - uses: Boshen/setup-rust@main 62 | with: 63 | components: clippy 64 | restore-cache: false 65 | - run: cargo clippy --no-deps -- -D warnings 66 | -------------------------------------------------------------------------------- /napi/transform/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/node 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=node 3 | 4 | ### Node ### 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | node_modules/ 46 | jspm_packages/ 47 | 48 | # TypeScript v1 declaration files 49 | typings/ 50 | 51 | # TypeScript cache 52 | *.tsbuildinfo 53 | 54 | # Optional npm cache directory 55 | .npm 56 | 57 | # Optional eslint cache 58 | .eslintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variables file 76 | .env 77 | .env.test 78 | 79 | # parcel-bundler cache (https://parceljs.org/) 80 | .cache 81 | 82 | # Next.js build output 83 | .next 84 | 85 | # Nuxt.js build / generate output 86 | .nuxt 87 | dist 88 | 89 | # Gatsby files 90 | .cache/ 91 | # Comment in the public line in if your project uses Gatsby and not Next.js 92 | # https://nextjs.org/blog/next-9-1#public-directory-support 93 | # public 94 | 95 | # vuepress build output 96 | .vuepress/dist 97 | 98 | # Serverless directories 99 | .serverless/ 100 | 101 | # FuseBox cache 102 | .fusebox/ 103 | 104 | # DynamoDB Local files 105 | .dynamodb/ 106 | 107 | # TernJS port file 108 | .tern-port 109 | 110 | # Stores VSCode versions used for testing VSCode extensions 111 | .vscode-test 112 | 113 | # End of https://www.toptal.com/developers/gitignore/api/node 114 | 115 | # Created by https://www.toptal.com/developers/gitignore/api/macos 116 | # Edit at https://www.toptal.com/developers/gitignore?templates=macos 117 | 118 | ### macOS ### 119 | # General 120 | .DS_Store 121 | .AppleDouble 122 | .LSOverride 123 | 124 | # Icon must end with two 125 | Icon 126 | 127 | 128 | # Thumbnails 129 | ._* 130 | 131 | # Files that might appear in the root of a volume 132 | .DocumentRevisions-V100 133 | .fseventsd 134 | .Spotlight-V100 135 | .TemporaryItems 136 | .Trashes 137 | .VolumeIcon.icns 138 | .com.apple.timemachine.donotpresent 139 | 140 | # Directories potentially created on remote AFP share 141 | .AppleDB 142 | .AppleDesktop 143 | Network Trash Folder 144 | Temporary Items 145 | .apdisk 146 | 147 | ### macOS Patch ### 148 | # iCloud generated files 149 | *.icloud 150 | 151 | # End of https://www.toptal.com/developers/gitignore/api/macos 152 | 153 | # Created by https://www.toptal.com/developers/gitignore/api/windows 154 | # Edit at https://www.toptal.com/developers/gitignore?templates=windows 155 | 156 | ### Windows ### 157 | # Windows thumbnail cache files 158 | Thumbs.db 159 | Thumbs.db:encryptable 160 | ehthumbs.db 161 | ehthumbs_vista.db 162 | 163 | # Dump file 164 | *.stackdump 165 | 166 | # Folder config file 167 | [Dd]esktop.ini 168 | 169 | # Recycle Bin used on file shares 170 | $RECYCLE.BIN/ 171 | 172 | # Windows Installer files 173 | *.cab 174 | *.msi 175 | *.msix 176 | *.msm 177 | *.msp 178 | 179 | # Windows shortcuts 180 | *.lnk 181 | 182 | # End of https://www.toptal.com/developers/gitignore/api/windows 183 | 184 | #Added by cargo 185 | 186 | /target 187 | Cargo.lock 188 | 189 | .pnp.* 190 | .yarn/* 191 | !.yarn/patches 192 | !.yarn/plugins 193 | !.yarn/releases 194 | !.yarn/sdks 195 | !.yarn/versions 196 | 197 | *.node 198 | -------------------------------------------------------------------------------- /packages/jest/src/options.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod' 2 | import { promises as fs } from 'node:fs' 3 | import { parse } from 'jsonc-parser' 4 | import type { PackageJson, TsConfigJson } from 'type-fest' 5 | import { merge } from './merge' 6 | import { ReactJsxRuntime } from '@oxc-jest/transform' 7 | 8 | const OptionsSchema = z.object({ 9 | react: z 10 | .object({ 11 | jsxPlugin: z.boolean().default(false), 12 | runtime: z 13 | .enum(['automatic', 'classic']) 14 | .default('automatic') 15 | .optional() 16 | .transform((runtime, ctx) => { 17 | switch (runtime) { 18 | case 'automatic': 19 | return 1 as ReactJsxRuntime.Automatic 20 | case 'classic': 21 | return 0 as ReactJsxRuntime.Classic 22 | default: 23 | ctx.addIssue({ 24 | code: 'invalid_enum_value', 25 | message: 'Invalid JSX runtime', 26 | received: runtime as any, 27 | options: ['automatic', 'classic'], 28 | }) 29 | return 1 as ReactJsxRuntime.Automatic 30 | } 31 | }), 32 | }) 33 | .optional() 34 | .default({ runtime: 'automatic', jsxPlugin: false }), 35 | 36 | codegen: z 37 | .object({ 38 | compress: z 39 | .union([ 40 | z.boolean(), 41 | z.enum(['none', 'whitespace', 'fold']).transform(compress => { 42 | switch (compress) { 43 | case 'none': 44 | return 0 45 | case 'whitespace': 46 | return 1 47 | case 'fold': 48 | return 2 49 | default: 50 | return 0 51 | } 52 | }), 53 | ]) 54 | .default('none'), 55 | sourceMap: z.boolean().default(true), 56 | }) 57 | .default({}), 58 | }) 59 | 60 | /** 61 | * Resolved configuration after merging with defaults 62 | */ 63 | export type Config = z.infer 64 | export type Options = z.input 65 | 66 | export const createTransformConfig = async (options?: Options): Promise => { 67 | // TODO: make these paths configurable 68 | const [packageJsonPromise, tsConfigPromise] = await Promise.allSettled([ 69 | fs.readFile('package.json', 'utf8').then(JSON.parse).then(packageJsonOptions), 70 | fs.readFile('tsconfig.json', 'utf8').then(parse).then(tsConfigOptions), 71 | ]) 72 | 73 | const packageJson = 'value' in packageJsonPromise ? packageJsonPromise.value : undefined 74 | const tsConfig = 'value' in tsConfigPromise ? tsConfigPromise.value : undefined 75 | 76 | const resolvedOptions: Partial = merge( 77 | [packageJson, tsConfig, options].filter((x: T | undefined): x is T => !!x) 78 | ) 79 | 80 | return OptionsSchema.parse(resolvedOptions) 81 | } 82 | 83 | // NOTE: we're telling TypeScript that `tsConfig` a certain contract, but we 84 | // can't actually guarantee this, so we need to be defensive here 85 | 86 | const packageJsonOptions = (packageJson: PackageJson): Partial => { 87 | if (!packageJson || typeof packageJson !== 'object') return {} 88 | 89 | return {} 90 | } 91 | const tsConfigOptions = (tsConfig: TsConfigJson): Partial => { 92 | if (!tsConfig?.compilerOptions || typeof tsConfig.compilerOptions !== 'object') { 93 | return {} 94 | } 95 | 96 | const { jsx } = tsConfig.compilerOptions 97 | 98 | return { 99 | react: { 100 | jsxPlugin: jsx != null && jsx !== 'preserve', 101 | runtime: jsx == 'react' ? 'classic' : 'automatic', 102 | }, 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /napi/transform/src/options.rs: -------------------------------------------------------------------------------- 1 | use napi::{bindgen_prelude::*, ValueType}; 2 | use oxc_transformer::{JsxOptions, JsxRuntime, TransformOptions}; 3 | 4 | #[napi(object, js_name = "TransformOptions")] 5 | #[derive(Debug, Default, Clone)] 6 | pub struct JsTransformOptions { 7 | #[napi(ts_type = "ReactOptions")] 8 | pub react: JsReactOptions, 9 | #[napi(ts_type = "MinifyOptions")] 10 | pub codegen: JsCodegenOptions, 11 | } 12 | 13 | impl From for TransformOptions { 14 | fn from(options: JsTransformOptions) -> Self { 15 | Self { 16 | jsx: options.react.into(), 17 | ..Default::default() 18 | } 19 | } 20 | } 21 | 22 | // ============================================================================= 23 | 24 | #[napi(object, js_name = "MinifyOptions")] 25 | #[derive(Debug, Clone)] 26 | pub struct JsCodegenOptions { 27 | #[napi(ts_type = "CompressOption | boolean")] 28 | pub compress: CompressOption, 29 | pub source_map: bool, 30 | } 31 | 32 | impl Default for JsCodegenOptions { 33 | fn default() -> Self { 34 | Self { 35 | compress: Default::default(), 36 | source_map: true, 37 | } 38 | } 39 | } 40 | 41 | // #[napi] 42 | #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] 43 | pub enum CompressOption { 44 | #[default] 45 | None, 46 | Whitespace, 47 | Fold, 48 | } 49 | 50 | impl CompressOption { 51 | pub const fn is_none(self) -> bool { 52 | matches!(self, Self::None) 53 | } 54 | pub const fn is_some(self) -> bool { 55 | matches!(self, Self::Whitespace | Self::Fold) 56 | } 57 | } 58 | 59 | impl From for CompressOption { 60 | fn from(value: bool) -> Self { 61 | if value { 62 | Self::Whitespace 63 | } else { 64 | Self::None 65 | } 66 | } 67 | } 68 | impl TryFrom for CompressOption { 69 | type Error = napi::Error; 70 | fn try_from(value: i32) -> Result { 71 | match value { 72 | 0 => Ok(Self::None), 73 | 1 => Ok(Self::Whitespace), 74 | 2 => Ok(Self::Fold), 75 | n => Err(napi::Error::new( 76 | napi::Status::InvalidArg, 77 | format!("Invalid CompressOption value `{n}`: must be 0, 1, or 2."), 78 | )), 79 | } 80 | } 81 | } 82 | 83 | impl TypeName for CompressOption { 84 | fn type_name() -> &'static str { 85 | "CompressOption" 86 | } 87 | fn value_type() -> napi::ValueType { 88 | napi::ValueType::Object 89 | } 90 | } 91 | 92 | impl FromNapiValue for CompressOption { 93 | unsafe fn from_napi_value( 94 | env: napi::sys::napi_env, 95 | napi_val: napi::sys::napi_value, 96 | ) -> napi::Result { 97 | match type_of!(env, napi_val) { 98 | Ok(ValueType::Undefined | ValueType::Null) => Ok(Self::None), 99 | Ok(ValueType::Boolean) => { 100 | bool::from_napi_value(env, napi_val).map(CompressOption::from) 101 | } 102 | Ok(ValueType::Number) => { 103 | i32::from_napi_value(env, napi_val).and_then(CompressOption::try_from) 104 | } 105 | Ok(_) => todo!(), 106 | Err(e) => Err(e), 107 | } 108 | } 109 | } 110 | 111 | impl ToNapiValue for CompressOption { 112 | unsafe fn to_napi_value( 113 | env: napi::sys::napi_env, 114 | val: Self, 115 | ) -> napi::Result { 116 | let val = match val { 117 | CompressOption::None => 0, 118 | CompressOption::Whitespace => 1, 119 | CompressOption::Fold => 2, 120 | }; 121 | napi::bindgen_prelude::ToNapiValue::to_napi_value(env, val) 122 | } 123 | } 124 | 125 | // ============================================================================= 126 | 127 | #[napi(object, js_name = "ReactOptions")] 128 | #[derive(Debug, Default, Clone)] 129 | pub struct JsReactOptions { 130 | pub jsx_plugin: bool, 131 | 132 | #[napi(ts_type = "ReactJsxRuntime")] 133 | pub runtime: JsReactJsxRuntime, 134 | } 135 | 136 | impl From for JsxOptions { 137 | fn from(options: JsReactOptions) -> Self { 138 | Self { 139 | runtime: options.runtime.into(), 140 | jsx_plugin: options.jsx_plugin, 141 | ..Default::default() 142 | } 143 | } 144 | } 145 | 146 | #[napi(js_name = "ReactJsxRuntime")] 147 | #[derive(Debug, Default, PartialEq, Eq)] 148 | pub enum JsReactJsxRuntime { 149 | Classic, 150 | #[default] 151 | Automatic, 152 | } 153 | impl From for JsxRuntime { 154 | fn from(runtime: JsReactJsxRuntime) -> Self { 155 | match runtime { 156 | JsReactJsxRuntime::Classic => JsxRuntime::Classic, 157 | JsReactJsxRuntime::Automatic => JsxRuntime::Automatic, 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /napi/transform/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![deny(clippy::all)] 2 | 3 | #[macro_use] 4 | extern crate napi_derive; 5 | 6 | mod options; 7 | 8 | use std::path::Path; 9 | 10 | use napi::{Error, Status}; 11 | use oxc_allocator::Allocator; 12 | use oxc_codegen::{CodeGenerator, CodegenOptions, CodegenReturn}; 13 | use oxc_parser::Parser; 14 | use oxc_semantic::SemanticBuilder; 15 | use oxc_sourcemap::SourceMap as OxcSourceMap; 16 | use oxc_span::SourceType; 17 | use oxc_transformer::Transformer; 18 | 19 | use itertools::Itertools; 20 | 21 | use options::*; 22 | 23 | /// should match 24 | /// [`EncodedSourceMap`](https://github.com/jridgewell/trace-mapping/blob/5a658b10d9b6dea9c614ff545ca9c4df895fee9e/src/types.ts#L14) 25 | /// from `@jridgewell/trace-mapping`, since this is what Jest expects. 26 | /// ```ts 27 | /// export interface SourceMapV3 { 28 | /// file?: string | null; 29 | /// names: string[]; 30 | /// sourceRoot?: string; 31 | /// sources: (string | null)[]; 32 | /// sourcesContent?: (string | null)[]; 33 | /// version: 3; 34 | /// ignoreList?: number[]; 35 | /// } 36 | /// 37 | /// export interface EncodedSourceMap extends SourceMapV3 { 38 | /// mappings: string; 39 | /// } 40 | /// ``` 41 | #[napi(object)] 42 | #[derive(Debug, Clone)] 43 | pub struct SourceMap { 44 | pub file: Option, 45 | pub names: Vec, 46 | pub source_root: Option, 47 | #[napi(ts_type = "(string | null)[]")] 48 | pub sources: Vec>, 49 | #[napi(ts_type = "(string | null)[]")] 50 | pub sources_content: Option>>, 51 | pub version: u32, 52 | pub ignore_list: Option>, 53 | pub mappings: String, 54 | } 55 | 56 | impl TryFrom for SourceMap { 57 | type Error = napi::Error; 58 | fn try_from(sourcemap: OxcSourceMap) -> Result { 59 | let mappings = sourcemap.to_json_string(); 60 | // TODO: do not clone once fields are exposed from oxc_sourcemap 61 | Ok(Self { 62 | file: sourcemap.get_file().map(ToString::to_string), 63 | names: sourcemap.get_names().map(Into::into).collect(), 64 | source_root: sourcemap.get_source_root().map(ToString::to_string), 65 | sources: sourcemap.get_sources().map(|s| Some(s.into())).collect(), 66 | sources_content: sourcemap 67 | .get_source_contents() 68 | .map(|sources_content| sources_content.map(|s| Some(s.into())).collect()), 69 | version: 3, 70 | ignore_list: None, // TODO: not exposed, 71 | mappings, 72 | }) 73 | } 74 | } 75 | 76 | #[derive(Debug, Clone)] 77 | #[napi(object)] 78 | pub struct TransformResult { 79 | pub source_text: String, 80 | pub source_map: Option, 81 | } 82 | #[napi] 83 | pub fn transform( 84 | filename: String, 85 | source_text: String, 86 | // TODO 87 | options: Option, 88 | ) -> Result { 89 | let options = options.unwrap_or_default(); 90 | let source_type = 91 | SourceType::from_path(&filename).map_err(|err| Error::new(Status::InvalidArg, err))?; 92 | let allocator = Allocator::default(); 93 | let parser_ret = Parser::new(&allocator, &source_text, source_type).parse(); 94 | 95 | let errors = parser_ret.errors; 96 | let mut program = parser_ret.program; 97 | 98 | if !errors.is_empty() { 99 | let errors = errors 100 | .into_iter() 101 | // use Display::fmt for pretty printing 102 | .map(|error| format!("{error}")) 103 | .join("\n\n"); 104 | let message = format!("Failed to parse {filename}:\n\n{errors}"); 105 | return Err(Error::new(Status::GenericFailure, message)); 106 | } 107 | 108 | let (symbols, scopes) = SemanticBuilder::new() 109 | .build(&program) 110 | .semantic 111 | .into_symbol_table_and_scope_tree(); 112 | let path = Path::new(&filename); 113 | let transform_options = options.clone().into(); 114 | let ret = Transformer::new(&allocator, path, transform_options).build_with_symbols_and_scopes( 115 | symbols, 116 | scopes, 117 | &mut program, 118 | ); 119 | 120 | if !ret.errors.is_empty() { 121 | return Err(Error::from_reason(format!("{}", ret.errors[0]))); 122 | } 123 | 124 | // TODO: source maps before transforming 125 | let CodegenReturn { code, map } = CodeGenerator::new() 126 | .with_options(CodegenOptions { 127 | source_map_path: Some(path.to_path_buf()), 128 | ..CodegenOptions::default() 129 | }) 130 | .build(&program); 131 | 132 | let _source_map = map.map(SourceMap::try_from).transpose()?; 133 | Ok(TransformResult { 134 | source_text: code, 135 | // source_map: source_map.map(SourceMap::from), 136 | source_map: None, 137 | }) 138 | } 139 | 140 | #[napi] 141 | pub async fn transform_async( 142 | filename: String, 143 | source_text: String, 144 | // TODO 145 | options: Option, 146 | ) -> Result { 147 | tokio::spawn(async move { transform(filename, source_text, options) }) 148 | .await 149 | .map_err(|e| Error::from_reason(e.to_string()))? 150 | } 151 | -------------------------------------------------------------------------------- /napi/transform/jest.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * For a detailed explanation regarding each configuration property, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | /** @type {import('jest').Config} */ 7 | const config = { 8 | // All imported modules in your tests should be mocked automatically 9 | // automock: false, 10 | 11 | // Stop running tests after `n` failures 12 | // bail: 0, 13 | 14 | // The directory where Jest should store its cached dependency information 15 | // cacheDirectory: "/private/var/folders/jv/1jqrnpqx03s7yj76s5m7q7_r0000gn/T/jest_dx", 16 | 17 | // Automatically clear mock calls, instances, contexts and results before every test 18 | clearMocks: true, 19 | 20 | // Indicates whether the coverage information should be collected while executing the test 21 | // collectCoverage: false, 22 | 23 | // An array of glob patterns indicating a set of files for which coverage information should be collected 24 | // collectCoverageFrom: undefined, 25 | 26 | // The directory where Jest should output its coverage files 27 | // coverageDirectory: undefined, 28 | 29 | // An array of regexp pattern strings used to skip coverage collection 30 | // coveragePathIgnorePatterns: [ 31 | // "/node_modules/" 32 | // ], 33 | 34 | // Indicates which provider should be used to instrument code for coverage 35 | coverageProvider: "v8", 36 | 37 | // A list of reporter names that Jest uses when writing coverage reports 38 | // coverageReporters: [ 39 | // "json", 40 | // "text", 41 | // "lcov", 42 | // "clover" 43 | // ], 44 | 45 | // An object that configures minimum threshold enforcement for coverage results 46 | // coverageThreshold: undefined, 47 | 48 | // A path to a custom dependency extractor 49 | // dependencyExtractor: undefined, 50 | 51 | // Make calling deprecated APIs throw helpful error messages 52 | // errorOnDeprecated: false, 53 | 54 | // The default configuration for fake timers 55 | // fakeTimers: { 56 | // "enableGlobally": false 57 | // }, 58 | 59 | // Force coverage collection from ignored files using an array of glob patterns 60 | // forceCoverageMatch: [], 61 | 62 | // A path to a module which exports an async function that is triggered once before all test suites 63 | // globalSetup: undefined, 64 | 65 | // A path to a module which exports an async function that is triggered once after all test suites 66 | // globalTeardown: undefined, 67 | 68 | // A set of global variables that need to be available in all test environments 69 | // globals: {}, 70 | 71 | // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. 72 | // maxWorkers: "50%", 73 | 74 | // An array of directory names to be searched recursively up from the requiring module's location 75 | // moduleDirectories: [ 76 | // "node_modules" 77 | // ], 78 | 79 | // An array of file extensions your modules use 80 | // moduleFileExtensions: [ 81 | // "js", 82 | // "mjs", 83 | // "cjs", 84 | // "jsx", 85 | // "ts", 86 | // "tsx", 87 | // "json", 88 | // "node" 89 | // ], 90 | 91 | // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module 92 | // moduleNameMapper: {}, 93 | 94 | // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader 95 | // modulePathIgnorePatterns: [], 96 | 97 | // Activates notifications for test results 98 | // notify: false, 99 | 100 | // An enum that specifies notification mode. Requires { notify: true } 101 | // notifyMode: "failure-change", 102 | 103 | // A preset that is used as a base for Jest's configuration 104 | // preset: undefined, 105 | 106 | // Run tests from one or more projects 107 | // projects: undefined, 108 | 109 | // Use this configuration option to add custom reporters to Jest 110 | // reporters: undefined, 111 | 112 | // Automatically reset mock state before every test 113 | // resetMocks: false, 114 | 115 | // Reset the module registry before running each individual test 116 | // resetModules: false, 117 | 118 | // A path to a custom resolver 119 | // resolver: undefined, 120 | 121 | // Automatically restore mock state and implementation before every test 122 | // restoreMocks: false, 123 | 124 | // The root directory that Jest should scan for tests and modules within 125 | // rootDir: undefined, 126 | 127 | // A list of paths to directories that Jest should use to search for files in 128 | // roots: [ 129 | // "" 130 | // ], 131 | 132 | // Allows you to use a custom runner instead of Jest's default test runner 133 | // runner: "jest-runner", 134 | 135 | // The paths to modules that run some code to configure or set up the testing environment before each test 136 | // setupFiles: [], 137 | 138 | // A list of paths to modules that run some code to configure or set up the testing framework before each test 139 | // setupFilesAfterEnv: [], 140 | 141 | // The number of seconds after which a test is considered as slow and reported as such in the results. 142 | // slowTestThreshold: 5, 143 | 144 | // A list of paths to snapshot serializer modules Jest should use for snapshot testing 145 | // snapshotSerializers: [], 146 | 147 | // The test environment that will be used for testing 148 | // testEnvironment: "jest-environment-node", 149 | 150 | // Options that will be passed to the testEnvironment 151 | // testEnvironmentOptions: {}, 152 | 153 | // Adds a location field to test results 154 | // testLocationInResults: false, 155 | 156 | // The glob patterns Jest uses to detect test files 157 | testMatch: [ 158 | "**/__tests__/**/*.[mjt]s?(x)", 159 | "**/?(*.)+(spec|test).[mtj]s?(x)" 160 | ], 161 | 162 | // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped 163 | // testPathIgnorePatterns: [ 164 | // "/node_modules/" 165 | // ], 166 | 167 | // The regexp pattern or array of patterns that Jest uses to detect test files 168 | // testRegex: [], 169 | 170 | // This option allows the use of a custom results processor 171 | // testResultsProcessor: undefined, 172 | 173 | // This option allows use of a custom test runner 174 | // testRunner: "jest-circus/runner", 175 | 176 | // A map from regular expressions to paths to transformers 177 | transform: { 178 | '\\.[tjcm]sx?$': 'oxc-jest' 179 | }, 180 | 181 | // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation 182 | // transformIgnorePatterns: [ 183 | // "/node_modules/", 184 | // "\\.pnp\\.[^\\/]+$" 185 | // ], 186 | 187 | // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them 188 | // unmockedModulePathPatterns: undefined, 189 | 190 | // Indicates whether each individual test should be reported during the run 191 | // verbose: undefined, 192 | 193 | // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode 194 | // watchPathIgnorePatterns: [], 195 | 196 | // Whether to use watchman for file crawling 197 | // watchman: true, 198 | }; 199 | 200 | module.exports = config; 201 | -------------------------------------------------------------------------------- /napi/transform/index.js: -------------------------------------------------------------------------------- 1 | /* tslint:disable */ 2 | /* eslint-disable */ 3 | /* prettier-ignore */ 4 | 5 | /* auto-generated by NAPI-RS */ 6 | 7 | const { existsSync, readFileSync } = require('fs') 8 | const { join } = require('path') 9 | 10 | const { platform, arch } = process 11 | 12 | let nativeBinding = null 13 | let localFileExisted = false 14 | let loadError = null 15 | 16 | function isMusl() { 17 | // For Node 10 18 | if (!process.report || typeof process.report.getReport !== 'function') { 19 | try { 20 | const lddPath = require('child_process').execSync('which ldd').toString().trim() 21 | return readFileSync(lddPath, 'utf8').includes('musl') 22 | } catch (e) { 23 | return true 24 | } 25 | } else { 26 | const { glibcVersionRuntime } = process.report.getReport().header 27 | return !glibcVersionRuntime 28 | } 29 | } 30 | 31 | switch (platform) { 32 | case 'android': 33 | switch (arch) { 34 | case 'arm64': 35 | localFileExisted = existsSync(join(__dirname, 'transform.android-arm64.node')) 36 | try { 37 | if (localFileExisted) { 38 | nativeBinding = require('./transform.android-arm64.node') 39 | } else { 40 | nativeBinding = require('@oxc-jest/transform-android-arm64') 41 | } 42 | } catch (e) { 43 | loadError = e 44 | } 45 | break 46 | case 'arm': 47 | localFileExisted = existsSync(join(__dirname, 'transform.android-arm-eabi.node')) 48 | try { 49 | if (localFileExisted) { 50 | nativeBinding = require('./transform.android-arm-eabi.node') 51 | } else { 52 | nativeBinding = require('@oxc-jest/transform-android-arm-eabi') 53 | } 54 | } catch (e) { 55 | loadError = e 56 | } 57 | break 58 | default: 59 | throw new Error(`Unsupported architecture on Android ${arch}`) 60 | } 61 | break 62 | case 'win32': 63 | switch (arch) { 64 | case 'x64': 65 | localFileExisted = existsSync( 66 | join(__dirname, 'transform.win32-x64-msvc.node') 67 | ) 68 | try { 69 | if (localFileExisted) { 70 | nativeBinding = require('./transform.win32-x64-msvc.node') 71 | } else { 72 | nativeBinding = require('@oxc-jest/transform-win32-x64-msvc') 73 | } 74 | } catch (e) { 75 | loadError = e 76 | } 77 | break 78 | case 'ia32': 79 | localFileExisted = existsSync( 80 | join(__dirname, 'transform.win32-ia32-msvc.node') 81 | ) 82 | try { 83 | if (localFileExisted) { 84 | nativeBinding = require('./transform.win32-ia32-msvc.node') 85 | } else { 86 | nativeBinding = require('@oxc-jest/transform-win32-ia32-msvc') 87 | } 88 | } catch (e) { 89 | loadError = e 90 | } 91 | break 92 | case 'arm64': 93 | localFileExisted = existsSync( 94 | join(__dirname, 'transform.win32-arm64-msvc.node') 95 | ) 96 | try { 97 | if (localFileExisted) { 98 | nativeBinding = require('./transform.win32-arm64-msvc.node') 99 | } else { 100 | nativeBinding = require('@oxc-jest/transform-win32-arm64-msvc') 101 | } 102 | } catch (e) { 103 | loadError = e 104 | } 105 | break 106 | default: 107 | throw new Error(`Unsupported architecture on Windows: ${arch}`) 108 | } 109 | break 110 | case 'darwin': 111 | localFileExisted = existsSync(join(__dirname, 'transform.darwin-universal.node')) 112 | try { 113 | if (localFileExisted) { 114 | nativeBinding = require('./transform.darwin-universal.node') 115 | } else { 116 | nativeBinding = require('@oxc-jest/transform-darwin-universal') 117 | } 118 | break 119 | } catch {} 120 | switch (arch) { 121 | case 'x64': 122 | localFileExisted = existsSync(join(__dirname, 'transform.darwin-x64.node')) 123 | try { 124 | if (localFileExisted) { 125 | nativeBinding = require('./transform.darwin-x64.node') 126 | } else { 127 | nativeBinding = require('@oxc-jest/transform-darwin-x64') 128 | } 129 | } catch (e) { 130 | loadError = e 131 | } 132 | break 133 | case 'arm64': 134 | localFileExisted = existsSync( 135 | join(__dirname, 'transform.darwin-arm64.node') 136 | ) 137 | try { 138 | if (localFileExisted) { 139 | nativeBinding = require('./transform.darwin-arm64.node') 140 | } else { 141 | nativeBinding = require('@oxc-jest/transform-darwin-arm64') 142 | } 143 | } catch (e) { 144 | loadError = e 145 | } 146 | break 147 | default: 148 | throw new Error(`Unsupported architecture on macOS: ${arch}`) 149 | } 150 | break 151 | case 'freebsd': 152 | if (arch !== 'x64') { 153 | throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) 154 | } 155 | localFileExisted = existsSync(join(__dirname, 'transform.freebsd-x64.node')) 156 | try { 157 | if (localFileExisted) { 158 | nativeBinding = require('./transform.freebsd-x64.node') 159 | } else { 160 | nativeBinding = require('@oxc-jest/transform-freebsd-x64') 161 | } 162 | } catch (e) { 163 | loadError = e 164 | } 165 | break 166 | case 'linux': 167 | switch (arch) { 168 | case 'x64': 169 | if (isMusl()) { 170 | localFileExisted = existsSync( 171 | join(__dirname, 'transform.linux-x64-musl.node') 172 | ) 173 | try { 174 | if (localFileExisted) { 175 | nativeBinding = require('./transform.linux-x64-musl.node') 176 | } else { 177 | nativeBinding = require('@oxc-jest/transform-linux-x64-musl') 178 | } 179 | } catch (e) { 180 | loadError = e 181 | } 182 | } else { 183 | localFileExisted = existsSync( 184 | join(__dirname, 'transform.linux-x64-gnu.node') 185 | ) 186 | try { 187 | if (localFileExisted) { 188 | nativeBinding = require('./transform.linux-x64-gnu.node') 189 | } else { 190 | nativeBinding = require('@oxc-jest/transform-linux-x64-gnu') 191 | } 192 | } catch (e) { 193 | loadError = e 194 | } 195 | } 196 | break 197 | case 'arm64': 198 | if (isMusl()) { 199 | localFileExisted = existsSync( 200 | join(__dirname, 'transform.linux-arm64-musl.node') 201 | ) 202 | try { 203 | if (localFileExisted) { 204 | nativeBinding = require('./transform.linux-arm64-musl.node') 205 | } else { 206 | nativeBinding = require('@oxc-jest/transform-linux-arm64-musl') 207 | } 208 | } catch (e) { 209 | loadError = e 210 | } 211 | } else { 212 | localFileExisted = existsSync( 213 | join(__dirname, 'transform.linux-arm64-gnu.node') 214 | ) 215 | try { 216 | if (localFileExisted) { 217 | nativeBinding = require('./transform.linux-arm64-gnu.node') 218 | } else { 219 | nativeBinding = require('@oxc-jest/transform-linux-arm64-gnu') 220 | } 221 | } catch (e) { 222 | loadError = e 223 | } 224 | } 225 | break 226 | case 'arm': 227 | if (isMusl()) { 228 | localFileExisted = existsSync( 229 | join(__dirname, 'transform.linux-arm-musleabihf.node') 230 | ) 231 | try { 232 | if (localFileExisted) { 233 | nativeBinding = require('./transform.linux-arm-musleabihf.node') 234 | } else { 235 | nativeBinding = require('@oxc-jest/transform-linux-arm-musleabihf') 236 | } 237 | } catch (e) { 238 | loadError = e 239 | } 240 | } else { 241 | localFileExisted = existsSync( 242 | join(__dirname, 'transform.linux-arm-gnueabihf.node') 243 | ) 244 | try { 245 | if (localFileExisted) { 246 | nativeBinding = require('./transform.linux-arm-gnueabihf.node') 247 | } else { 248 | nativeBinding = require('@oxc-jest/transform-linux-arm-gnueabihf') 249 | } 250 | } catch (e) { 251 | loadError = e 252 | } 253 | } 254 | break 255 | case 'riscv64': 256 | if (isMusl()) { 257 | localFileExisted = existsSync( 258 | join(__dirname, 'transform.linux-riscv64-musl.node') 259 | ) 260 | try { 261 | if (localFileExisted) { 262 | nativeBinding = require('./transform.linux-riscv64-musl.node') 263 | } else { 264 | nativeBinding = require('@oxc-jest/transform-linux-riscv64-musl') 265 | } 266 | } catch (e) { 267 | loadError = e 268 | } 269 | } else { 270 | localFileExisted = existsSync( 271 | join(__dirname, 'transform.linux-riscv64-gnu.node') 272 | ) 273 | try { 274 | if (localFileExisted) { 275 | nativeBinding = require('./transform.linux-riscv64-gnu.node') 276 | } else { 277 | nativeBinding = require('@oxc-jest/transform-linux-riscv64-gnu') 278 | } 279 | } catch (e) { 280 | loadError = e 281 | } 282 | } 283 | break 284 | case 's390x': 285 | localFileExisted = existsSync( 286 | join(__dirname, 'transform.linux-s390x-gnu.node') 287 | ) 288 | try { 289 | if (localFileExisted) { 290 | nativeBinding = require('./transform.linux-s390x-gnu.node') 291 | } else { 292 | nativeBinding = require('@oxc-jest/transform-linux-s390x-gnu') 293 | } 294 | } catch (e) { 295 | loadError = e 296 | } 297 | break 298 | default: 299 | throw new Error(`Unsupported architecture on Linux: ${arch}`) 300 | } 301 | break 302 | default: 303 | throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) 304 | } 305 | 306 | if (!nativeBinding) { 307 | if (loadError) { 308 | throw loadError 309 | } 310 | throw new Error(`Failed to load native binding`) 311 | } 312 | 313 | const { ReactJsxRuntime, transform, transformAsync } = nativeBinding 314 | 315 | module.exports.ReactJsxRuntime = ReactJsxRuntime 316 | module.exports.transform = transform 317 | module.exports.transformAsync = transformAsync 318 | -------------------------------------------------------------------------------- /packages/jest/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | "rootDir": "./src", /* Specify the root folder within your source files. */ 30 | // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ 39 | // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ 40 | // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ 41 | // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ 42 | // "resolveJsonModule": true, /* Enable importing .json files. */ 43 | // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 44 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 45 | 46 | /* JavaScript Support */ 47 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 48 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 49 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 50 | 51 | /* Emit */ 52 | "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 53 | "declarationMap": true, /* Create sourcemaps for d.ts files. */ 54 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 55 | "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 56 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 57 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 58 | "outDir": "./dist", /* Specify an output folder for all emitted files. */ 59 | // "removeComments": true, /* Disable emitting comments. */ 60 | // "noEmit": true, /* Disable emitting files from a compilation. */ 61 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 62 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 63 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 64 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 65 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 66 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 67 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 68 | "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 69 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 70 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 71 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 72 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 73 | 74 | /* Interop Constraints */ 75 | "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 76 | // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ 77 | // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ 78 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 79 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 80 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 81 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 82 | 83 | /* Type Checking */ 84 | "strict": true, /* Enable all strict type-checking options. */ 85 | "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 86 | "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 87 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 88 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 89 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 90 | "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 91 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 92 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 93 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 94 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 95 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 96 | "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 97 | "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 98 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 99 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 100 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 101 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 102 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 103 | 104 | /* Completeness */ 105 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 106 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "adler2" 7 | version = "2.0.1" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" 10 | 11 | [[package]] 12 | name = "aho-corasick" 13 | version = "1.1.4" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" 16 | dependencies = [ 17 | "memchr", 18 | ] 19 | 20 | [[package]] 21 | name = "allocator-api2" 22 | version = "0.2.21" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" 25 | 26 | [[package]] 27 | name = "autocfg" 28 | version = "1.5.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 31 | 32 | [[package]] 33 | name = "base64" 34 | version = "0.22.1" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 37 | 38 | [[package]] 39 | name = "base64-simd" 40 | version = "0.8.0" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" 43 | dependencies = [ 44 | "outref", 45 | "vsimd", 46 | ] 47 | 48 | [[package]] 49 | name = "bincode" 50 | version = "2.0.1" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" 53 | dependencies = [ 54 | "bincode_derive", 55 | "serde", 56 | "unty", 57 | ] 58 | 59 | [[package]] 60 | name = "bincode_derive" 61 | version = "2.0.1" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" 64 | dependencies = [ 65 | "virtue", 66 | ] 67 | 68 | [[package]] 69 | name = "bitflags" 70 | version = "2.10.0" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" 73 | 74 | [[package]] 75 | name = "block-buffer" 76 | version = "0.10.4" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 79 | dependencies = [ 80 | "generic-array", 81 | ] 82 | 83 | [[package]] 84 | name = "bumpalo" 85 | version = "3.19.0" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" 88 | dependencies = [ 89 | "allocator-api2", 90 | ] 91 | 92 | [[package]] 93 | name = "castaway" 94 | version = "0.2.4" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" 97 | dependencies = [ 98 | "rustversion", 99 | ] 100 | 101 | [[package]] 102 | name = "cfg-if" 103 | version = "1.0.4" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 106 | 107 | [[package]] 108 | name = "compact_str" 109 | version = "0.9.0" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a" 112 | dependencies = [ 113 | "castaway", 114 | "cfg-if", 115 | "itoa", 116 | "rustversion", 117 | "ryu", 118 | "static_assertions", 119 | ] 120 | 121 | [[package]] 122 | name = "convert_case" 123 | version = "0.6.0" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" 126 | dependencies = [ 127 | "unicode-segmentation", 128 | ] 129 | 130 | [[package]] 131 | name = "cow-utils" 132 | version = "0.1.3" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "417bef24afe1460300965a25ff4a24b8b45ad011948302ec221e8a0a81eb2c79" 135 | 136 | [[package]] 137 | name = "cpufeatures" 138 | version = "0.2.17" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" 141 | dependencies = [ 142 | "libc", 143 | ] 144 | 145 | [[package]] 146 | name = "crc32fast" 147 | version = "1.5.0" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" 150 | dependencies = [ 151 | "cfg-if", 152 | ] 153 | 154 | [[package]] 155 | name = "crypto-common" 156 | version = "0.1.6" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 159 | dependencies = [ 160 | "generic-array", 161 | "typenum", 162 | ] 163 | 164 | [[package]] 165 | name = "ctor" 166 | version = "0.2.9" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" 169 | dependencies = [ 170 | "quote", 171 | "syn", 172 | ] 173 | 174 | [[package]] 175 | name = "deranged" 176 | version = "0.5.5" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" 179 | dependencies = [ 180 | "powerfmt", 181 | ] 182 | 183 | [[package]] 184 | name = "digest" 185 | version = "0.10.7" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 188 | dependencies = [ 189 | "block-buffer", 190 | "crypto-common", 191 | ] 192 | 193 | [[package]] 194 | name = "dragonbox_ecma" 195 | version = "0.0.5" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "d742b56656e8b14d63e7ea9806597b1849ae25412584c8adf78c0f67bd985e66" 198 | 199 | [[package]] 200 | name = "either" 201 | version = "1.15.0" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 204 | 205 | [[package]] 206 | name = "equivalent" 207 | version = "1.0.2" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 210 | 211 | [[package]] 212 | name = "fastrand" 213 | version = "2.3.0" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" 216 | 217 | [[package]] 218 | name = "flate2" 219 | version = "1.1.5" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" 222 | dependencies = [ 223 | "crc32fast", 224 | "miniz_oxide", 225 | ] 226 | 227 | [[package]] 228 | name = "generic-array" 229 | version = "0.14.9" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" 232 | dependencies = [ 233 | "typenum", 234 | "version_check", 235 | ] 236 | 237 | [[package]] 238 | name = "hashbrown" 239 | version = "0.16.0" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" 242 | dependencies = [ 243 | "allocator-api2", 244 | ] 245 | 246 | [[package]] 247 | name = "indexmap" 248 | version = "2.12.0" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" 251 | dependencies = [ 252 | "equivalent", 253 | "hashbrown", 254 | ] 255 | 256 | [[package]] 257 | name = "itertools" 258 | version = "0.14.0" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" 261 | dependencies = [ 262 | "either", 263 | ] 264 | 265 | [[package]] 266 | name = "itoa" 267 | version = "1.0.15" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 270 | 271 | [[package]] 272 | name = "json-escape-simd" 273 | version = "3.0.1" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "a3c2a6c0b4b5637c41719973ef40c6a1cf564f9db6958350de6193fbee9c23f5" 276 | 277 | [[package]] 278 | name = "libc" 279 | version = "0.2.177" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" 282 | 283 | [[package]] 284 | name = "libloading" 285 | version = "0.8.9" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" 288 | dependencies = [ 289 | "cfg-if", 290 | "windows-link", 291 | ] 292 | 293 | [[package]] 294 | name = "memchr" 295 | version = "2.7.6" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" 298 | 299 | [[package]] 300 | name = "miniz_oxide" 301 | version = "0.8.9" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" 304 | dependencies = [ 305 | "adler2", 306 | "simd-adler32", 307 | ] 308 | 309 | [[package]] 310 | name = "napi" 311 | version = "2.16.17" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "55740c4ae1d8696773c78fdafd5d0e5fe9bc9f1b071c7ba493ba5c413a9184f3" 314 | dependencies = [ 315 | "bitflags", 316 | "ctor", 317 | "napi-derive", 318 | "napi-sys", 319 | "once_cell", 320 | "tokio", 321 | ] 322 | 323 | [[package]] 324 | name = "napi-build" 325 | version = "2.3.0" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "68064c4cf827376751236ee6785e0e38a6461f83a7a7f227c89f6256f3e96cc2" 328 | 329 | [[package]] 330 | name = "napi-derive" 331 | version = "2.16.13" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "7cbe2585d8ac223f7d34f13701434b9d5f4eb9c332cccce8dee57ea18ab8ab0c" 334 | dependencies = [ 335 | "cfg-if", 336 | "convert_case", 337 | "napi-derive-backend", 338 | "proc-macro2", 339 | "quote", 340 | "syn", 341 | ] 342 | 343 | [[package]] 344 | name = "napi-derive-backend" 345 | version = "1.0.75" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "1639aaa9eeb76e91c6ae66da8ce3e89e921cd3885e99ec85f4abacae72fc91bf" 348 | dependencies = [ 349 | "convert_case", 350 | "once_cell", 351 | "proc-macro2", 352 | "quote", 353 | "regex", 354 | "semver", 355 | "syn", 356 | ] 357 | 358 | [[package]] 359 | name = "napi-sys" 360 | version = "2.4.0" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" 363 | dependencies = [ 364 | "libloading", 365 | ] 366 | 367 | [[package]] 368 | name = "nom" 369 | version = "8.0.0" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" 372 | dependencies = [ 373 | "memchr", 374 | ] 375 | 376 | [[package]] 377 | name = "nonmax" 378 | version = "0.5.5" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" 381 | 382 | [[package]] 383 | name = "num-bigint" 384 | version = "0.4.6" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 387 | dependencies = [ 388 | "num-integer", 389 | "num-traits", 390 | ] 391 | 392 | [[package]] 393 | name = "num-conv" 394 | version = "0.1.0" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 397 | 398 | [[package]] 399 | name = "num-integer" 400 | version = "0.1.46" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 403 | dependencies = [ 404 | "num-traits", 405 | ] 406 | 407 | [[package]] 408 | name = "num-traits" 409 | version = "0.2.19" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 412 | dependencies = [ 413 | "autocfg", 414 | ] 415 | 416 | [[package]] 417 | name = "once_cell" 418 | version = "1.21.3" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" 421 | 422 | [[package]] 423 | name = "outref" 424 | version = "0.5.2" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" 427 | 428 | [[package]] 429 | name = "owo-colors" 430 | version = "4.2.3" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" 433 | 434 | [[package]] 435 | name = "oxc-browserslist" 436 | version = "2.1.2" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "7612127f5fa1ef0f3e98905ddfc10a7fa1df98944b75d774bb3cb4b530663616" 439 | dependencies = [ 440 | "bincode", 441 | "flate2", 442 | "nom", 443 | "rustc-hash", 444 | "serde", 445 | "serde_json", 446 | "thiserror", 447 | "time", 448 | ] 449 | 450 | [[package]] 451 | name = "oxc-jest_transform" 452 | version = "0.0.0" 453 | dependencies = [ 454 | "itertools", 455 | "napi", 456 | "napi-build", 457 | "napi-derive", 458 | "oxc_allocator", 459 | "oxc_codegen", 460 | "oxc_parser", 461 | "oxc_semantic", 462 | "oxc_sourcemap", 463 | "oxc_span", 464 | "oxc_syntax", 465 | "oxc_transformer", 466 | "tokio", 467 | ] 468 | 469 | [[package]] 470 | name = "oxc-miette" 471 | version = "2.6.0" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "f02105a875f3751a0b44b4c822b01177728dd9049ae6fb419e9b04887d730ed1" 474 | dependencies = [ 475 | "cfg-if", 476 | "owo-colors", 477 | "oxc-miette-derive", 478 | "textwrap", 479 | "thiserror", 480 | "unicode-segmentation", 481 | "unicode-width", 482 | ] 483 | 484 | [[package]] 485 | name = "oxc-miette-derive" 486 | version = "2.6.0" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "003b4612827f6501183873fb0735da92157e3c7daa71c40921c7d2758fec2229" 489 | dependencies = [ 490 | "proc-macro2", 491 | "quote", 492 | "syn", 493 | ] 494 | 495 | [[package]] 496 | name = "oxc_allocator" 497 | version = "0.96.0" 498 | source = "registry+https://github.com/rust-lang/crates.io-index" 499 | checksum = "71ef2dba21be1ce515378b2b7143eaa2a912f9e6ffe162ae20639d56f53d60e3" 500 | dependencies = [ 501 | "allocator-api2", 502 | "bumpalo", 503 | "hashbrown", 504 | "oxc_data_structures", 505 | "rustc-hash", 506 | ] 507 | 508 | [[package]] 509 | name = "oxc_ast" 510 | version = "0.96.0" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "2fad9195311a1961bb6ef1de0ce6a52147bccea50b5a40423b7b44e8448ed4fc" 513 | dependencies = [ 514 | "bitflags", 515 | "oxc_allocator", 516 | "oxc_ast_macros", 517 | "oxc_data_structures", 518 | "oxc_diagnostics", 519 | "oxc_estree", 520 | "oxc_regular_expression", 521 | "oxc_span", 522 | "oxc_syntax", 523 | ] 524 | 525 | [[package]] 526 | name = "oxc_ast_macros" 527 | version = "0.96.0" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "7f03da6fac191c0817a32ae1a7dde27fd27d98732c61fcaeb55a99a4d543ba49" 530 | dependencies = [ 531 | "phf", 532 | "proc-macro2", 533 | "quote", 534 | "syn", 535 | ] 536 | 537 | [[package]] 538 | name = "oxc_ast_visit" 539 | version = "0.96.0" 540 | source = "registry+https://github.com/rust-lang/crates.io-index" 541 | checksum = "b42fcdb162d247a0e9c1aa985b388f000eba19fb1ee1845b2ec0ddc595f95131" 542 | dependencies = [ 543 | "oxc_allocator", 544 | "oxc_ast", 545 | "oxc_span", 546 | "oxc_syntax", 547 | ] 548 | 549 | [[package]] 550 | name = "oxc_codegen" 551 | version = "0.96.0" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "46c9a53ca79c87846e4f2b4f3df514b0b2bf910a1ba76a9e8cb742570b8b47ce" 554 | dependencies = [ 555 | "bitflags", 556 | "cow-utils", 557 | "dragonbox_ecma", 558 | "itoa", 559 | "oxc_allocator", 560 | "oxc_ast", 561 | "oxc_data_structures", 562 | "oxc_index", 563 | "oxc_semantic", 564 | "oxc_sourcemap", 565 | "oxc_span", 566 | "oxc_syntax", 567 | "rustc-hash", 568 | ] 569 | 570 | [[package]] 571 | name = "oxc_compat" 572 | version = "0.96.0" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "271a875e3e9e1f6d259c99e0557fcc83d96b025ddfca40e215d6bbb58bae9d45" 575 | dependencies = [ 576 | "cow-utils", 577 | "oxc-browserslist", 578 | "oxc_syntax", 579 | "rustc-hash", 580 | "serde", 581 | ] 582 | 583 | [[package]] 584 | name = "oxc_data_structures" 585 | version = "0.96.0" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "c5f5171d7b8bc907a1b29e557d14f8478509a2154272d56db9ee8aed6bfe8dec" 588 | dependencies = [ 589 | "ropey", 590 | ] 591 | 592 | [[package]] 593 | name = "oxc_diagnostics" 594 | version = "0.96.0" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "8ef2bf6a713fd27bc65812d695bdfde3f8fcef735f00b861258518346642721b" 597 | dependencies = [ 598 | "cow-utils", 599 | "oxc-miette", 600 | "percent-encoding", 601 | ] 602 | 603 | [[package]] 604 | name = "oxc_ecmascript" 605 | version = "0.96.0" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "f908100cb2759dd2f42ca33d95ea158b8d78e2591b577757729fc9a4a4c63bc3" 608 | dependencies = [ 609 | "cow-utils", 610 | "num-bigint", 611 | "num-traits", 612 | "oxc_allocator", 613 | "oxc_ast", 614 | "oxc_span", 615 | "oxc_syntax", 616 | ] 617 | 618 | [[package]] 619 | name = "oxc_estree" 620 | version = "0.96.0" 621 | source = "registry+https://github.com/rust-lang/crates.io-index" 622 | checksum = "5644d3399116ff3f0cfb81f9a790c4b8173b504ed52274ecc757b57f30098ad1" 623 | 624 | [[package]] 625 | name = "oxc_index" 626 | version = "4.1.0" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "eb3e6120999627ec9703025eab7c9f410ebb7e95557632a8902ca48210416c2b" 629 | dependencies = [ 630 | "nonmax", 631 | "serde", 632 | ] 633 | 634 | [[package]] 635 | name = "oxc_parser" 636 | version = "0.96.0" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "e080498b7a4456a63111f9c65b4dd1b98147955347854b809b6ad4cc5d6a0c0a" 639 | dependencies = [ 640 | "bitflags", 641 | "cow-utils", 642 | "memchr", 643 | "num-bigint", 644 | "num-traits", 645 | "oxc_allocator", 646 | "oxc_ast", 647 | "oxc_data_structures", 648 | "oxc_diagnostics", 649 | "oxc_ecmascript", 650 | "oxc_regular_expression", 651 | "oxc_span", 652 | "oxc_syntax", 653 | "rustc-hash", 654 | "seq-macro", 655 | ] 656 | 657 | [[package]] 658 | name = "oxc_regular_expression" 659 | version = "0.96.0" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "cb87ab0b072e1e97d8101cb1678204bc3873d84f13255ae5aa088f1b85f7a8e1" 662 | dependencies = [ 663 | "bitflags", 664 | "oxc_allocator", 665 | "oxc_ast_macros", 666 | "oxc_diagnostics", 667 | "oxc_span", 668 | "phf", 669 | "rustc-hash", 670 | "unicode-id-start", 671 | ] 672 | 673 | [[package]] 674 | name = "oxc_semantic" 675 | version = "0.96.0" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "c56958658ca1f9f5f050dc4317821255d2ca132763b6fbee9227e45ef79ed173" 678 | dependencies = [ 679 | "itertools", 680 | "oxc_allocator", 681 | "oxc_ast", 682 | "oxc_ast_visit", 683 | "oxc_data_structures", 684 | "oxc_diagnostics", 685 | "oxc_ecmascript", 686 | "oxc_index", 687 | "oxc_span", 688 | "oxc_syntax", 689 | "phf", 690 | "rustc-hash", 691 | "self_cell", 692 | ] 693 | 694 | [[package]] 695 | name = "oxc_sourcemap" 696 | version = "6.0.1" 697 | source = "registry+https://github.com/rust-lang/crates.io-index" 698 | checksum = "36801dbbd025f2fa133367494e38eef75a53d334ae6746ba0c889fc4e76fa3a3" 699 | dependencies = [ 700 | "base64-simd", 701 | "json-escape-simd", 702 | "rustc-hash", 703 | "serde", 704 | "serde_json", 705 | ] 706 | 707 | [[package]] 708 | name = "oxc_span" 709 | version = "0.96.0" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "41422232cfd9915d31dbb76ba2e5ae212884cad232e37203bdcb15bd1466951d" 712 | dependencies = [ 713 | "compact_str", 714 | "oxc-miette", 715 | "oxc_allocator", 716 | "oxc_ast_macros", 717 | "oxc_estree", 718 | ] 719 | 720 | [[package]] 721 | name = "oxc_syntax" 722 | version = "0.96.0" 723 | source = "registry+https://github.com/rust-lang/crates.io-index" 724 | checksum = "9ea81736f2343df141c7d8de78a91d155be4f712dfa6cd1bdd9a8b4f0676f01f" 725 | dependencies = [ 726 | "bitflags", 727 | "cow-utils", 728 | "dragonbox_ecma", 729 | "nonmax", 730 | "oxc_allocator", 731 | "oxc_ast_macros", 732 | "oxc_data_structures", 733 | "oxc_estree", 734 | "oxc_index", 735 | "oxc_span", 736 | "phf", 737 | "unicode-id-start", 738 | ] 739 | 740 | [[package]] 741 | name = "oxc_transformer" 742 | version = "0.96.0" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | checksum = "1f6aee257a9750a3beeb8124f1fffcc3a5c2623ac2e36e851fbab8da339e9263" 745 | dependencies = [ 746 | "base64", 747 | "compact_str", 748 | "indexmap", 749 | "itoa", 750 | "memchr", 751 | "oxc_allocator", 752 | "oxc_ast", 753 | "oxc_ast_visit", 754 | "oxc_compat", 755 | "oxc_data_structures", 756 | "oxc_diagnostics", 757 | "oxc_ecmascript", 758 | "oxc_parser", 759 | "oxc_regular_expression", 760 | "oxc_semantic", 761 | "oxc_span", 762 | "oxc_syntax", 763 | "oxc_traverse", 764 | "rustc-hash", 765 | "serde", 766 | "serde_json", 767 | "sha1", 768 | ] 769 | 770 | [[package]] 771 | name = "oxc_traverse" 772 | version = "0.96.0" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "bdcbcda1412b43a921856314e2984cb9282f0d23c1439ae21bd5879110e01681" 775 | dependencies = [ 776 | "itoa", 777 | "oxc_allocator", 778 | "oxc_ast", 779 | "oxc_ast_visit", 780 | "oxc_data_structures", 781 | "oxc_ecmascript", 782 | "oxc_semantic", 783 | "oxc_span", 784 | "oxc_syntax", 785 | "rustc-hash", 786 | ] 787 | 788 | [[package]] 789 | name = "percent-encoding" 790 | version = "2.3.2" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 793 | 794 | [[package]] 795 | name = "phf" 796 | version = "0.13.1" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" 799 | dependencies = [ 800 | "phf_macros", 801 | "phf_shared", 802 | "serde", 803 | ] 804 | 805 | [[package]] 806 | name = "phf_generator" 807 | version = "0.13.1" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" 810 | dependencies = [ 811 | "fastrand", 812 | "phf_shared", 813 | ] 814 | 815 | [[package]] 816 | name = "phf_macros" 817 | version = "0.13.1" 818 | source = "registry+https://github.com/rust-lang/crates.io-index" 819 | checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" 820 | dependencies = [ 821 | "phf_generator", 822 | "phf_shared", 823 | "proc-macro2", 824 | "quote", 825 | "syn", 826 | ] 827 | 828 | [[package]] 829 | name = "phf_shared" 830 | version = "0.13.1" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" 833 | dependencies = [ 834 | "siphasher", 835 | ] 836 | 837 | [[package]] 838 | name = "pin-project-lite" 839 | version = "0.2.16" 840 | source = "registry+https://github.com/rust-lang/crates.io-index" 841 | checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" 842 | 843 | [[package]] 844 | name = "powerfmt" 845 | version = "0.2.0" 846 | source = "registry+https://github.com/rust-lang/crates.io-index" 847 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 848 | 849 | [[package]] 850 | name = "proc-macro2" 851 | version = "1.0.103" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" 854 | dependencies = [ 855 | "unicode-ident", 856 | ] 857 | 858 | [[package]] 859 | name = "quote" 860 | version = "1.0.42" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" 863 | dependencies = [ 864 | "proc-macro2", 865 | ] 866 | 867 | [[package]] 868 | name = "regex" 869 | version = "1.12.2" 870 | source = "registry+https://github.com/rust-lang/crates.io-index" 871 | checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" 872 | dependencies = [ 873 | "aho-corasick", 874 | "memchr", 875 | "regex-automata", 876 | "regex-syntax", 877 | ] 878 | 879 | [[package]] 880 | name = "regex-automata" 881 | version = "0.4.13" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" 884 | dependencies = [ 885 | "aho-corasick", 886 | "memchr", 887 | "regex-syntax", 888 | ] 889 | 890 | [[package]] 891 | name = "regex-syntax" 892 | version = "0.8.8" 893 | source = "registry+https://github.com/rust-lang/crates.io-index" 894 | checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" 895 | 896 | [[package]] 897 | name = "ropey" 898 | version = "1.6.1" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" 901 | dependencies = [ 902 | "smallvec", 903 | "str_indices", 904 | ] 905 | 906 | [[package]] 907 | name = "rustc-hash" 908 | version = "2.1.1" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" 911 | 912 | [[package]] 913 | name = "rustversion" 914 | version = "1.0.22" 915 | source = "registry+https://github.com/rust-lang/crates.io-index" 916 | checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 917 | 918 | [[package]] 919 | name = "ryu" 920 | version = "1.0.20" 921 | source = "registry+https://github.com/rust-lang/crates.io-index" 922 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 923 | 924 | [[package]] 925 | name = "self_cell" 926 | version = "1.2.1" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "16c2f82143577edb4921b71ede051dac62ca3c16084e918bf7b40c96ae10eb33" 929 | 930 | [[package]] 931 | name = "semver" 932 | version = "1.0.27" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" 935 | 936 | [[package]] 937 | name = "seq-macro" 938 | version = "0.3.6" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" 941 | 942 | [[package]] 943 | name = "serde" 944 | version = "1.0.228" 945 | source = "registry+https://github.com/rust-lang/crates.io-index" 946 | checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 947 | dependencies = [ 948 | "serde_core", 949 | "serde_derive", 950 | ] 951 | 952 | [[package]] 953 | name = "serde_core" 954 | version = "1.0.228" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 957 | dependencies = [ 958 | "serde_derive", 959 | ] 960 | 961 | [[package]] 962 | name = "serde_derive" 963 | version = "1.0.228" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 966 | dependencies = [ 967 | "proc-macro2", 968 | "quote", 969 | "syn", 970 | ] 971 | 972 | [[package]] 973 | name = "serde_json" 974 | version = "1.0.145" 975 | source = "registry+https://github.com/rust-lang/crates.io-index" 976 | checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" 977 | dependencies = [ 978 | "itoa", 979 | "memchr", 980 | "ryu", 981 | "serde", 982 | "serde_core", 983 | ] 984 | 985 | [[package]] 986 | name = "sha1" 987 | version = "0.10.6" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 990 | dependencies = [ 991 | "cfg-if", 992 | "cpufeatures", 993 | "digest", 994 | ] 995 | 996 | [[package]] 997 | name = "simd-adler32" 998 | version = "0.3.7" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" 1001 | 1002 | [[package]] 1003 | name = "siphasher" 1004 | version = "1.0.1" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" 1007 | 1008 | [[package]] 1009 | name = "smallvec" 1010 | version = "1.15.1" 1011 | source = "registry+https://github.com/rust-lang/crates.io-index" 1012 | checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 1013 | 1014 | [[package]] 1015 | name = "smawk" 1016 | version = "0.3.2" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" 1019 | 1020 | [[package]] 1021 | name = "static_assertions" 1022 | version = "1.1.0" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1025 | 1026 | [[package]] 1027 | name = "str_indices" 1028 | version = "0.4.4" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" 1031 | 1032 | [[package]] 1033 | name = "syn" 1034 | version = "2.0.109" 1035 | source = "registry+https://github.com/rust-lang/crates.io-index" 1036 | checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f" 1037 | dependencies = [ 1038 | "proc-macro2", 1039 | "quote", 1040 | "unicode-ident", 1041 | ] 1042 | 1043 | [[package]] 1044 | name = "textwrap" 1045 | version = "0.16.2" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" 1048 | dependencies = [ 1049 | "smawk", 1050 | "unicode-linebreak", 1051 | "unicode-width", 1052 | ] 1053 | 1054 | [[package]] 1055 | name = "thiserror" 1056 | version = "2.0.17" 1057 | source = "registry+https://github.com/rust-lang/crates.io-index" 1058 | checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" 1059 | dependencies = [ 1060 | "thiserror-impl", 1061 | ] 1062 | 1063 | [[package]] 1064 | name = "thiserror-impl" 1065 | version = "2.0.17" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" 1068 | dependencies = [ 1069 | "proc-macro2", 1070 | "quote", 1071 | "syn", 1072 | ] 1073 | 1074 | [[package]] 1075 | name = "time" 1076 | version = "0.3.44" 1077 | source = "registry+https://github.com/rust-lang/crates.io-index" 1078 | checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" 1079 | dependencies = [ 1080 | "deranged", 1081 | "num-conv", 1082 | "powerfmt", 1083 | "serde", 1084 | "time-core", 1085 | ] 1086 | 1087 | [[package]] 1088 | name = "time-core" 1089 | version = "0.1.6" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" 1092 | 1093 | [[package]] 1094 | name = "tokio" 1095 | version = "1.48.0" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" 1098 | dependencies = [ 1099 | "pin-project-lite", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "typenum" 1104 | version = "1.19.0" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" 1107 | 1108 | [[package]] 1109 | name = "unicode-id-start" 1110 | version = "1.4.0" 1111 | source = "registry+https://github.com/rust-lang/crates.io-index" 1112 | checksum = "81b79ad29b5e19de4260020f8919b443b2ef0277d242ce532ec7b7a2cc8b6007" 1113 | 1114 | [[package]] 1115 | name = "unicode-ident" 1116 | version = "1.0.22" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 1119 | 1120 | [[package]] 1121 | name = "unicode-linebreak" 1122 | version = "0.1.5" 1123 | source = "registry+https://github.com/rust-lang/crates.io-index" 1124 | checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" 1125 | 1126 | [[package]] 1127 | name = "unicode-segmentation" 1128 | version = "1.12.0" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" 1131 | 1132 | [[package]] 1133 | name = "unicode-width" 1134 | version = "0.2.2" 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" 1136 | checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" 1137 | 1138 | [[package]] 1139 | name = "unty" 1140 | version = "0.0.4" 1141 | source = "registry+https://github.com/rust-lang/crates.io-index" 1142 | checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" 1143 | 1144 | [[package]] 1145 | name = "version_check" 1146 | version = "0.9.5" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 1149 | 1150 | [[package]] 1151 | name = "virtue" 1152 | version = "0.0.18" 1153 | source = "registry+https://github.com/rust-lang/crates.io-index" 1154 | checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" 1155 | 1156 | [[package]] 1157 | name = "vsimd" 1158 | version = "0.8.0" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" 1161 | 1162 | [[package]] 1163 | name = "windows-link" 1164 | version = "0.2.1" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 1167 | --------------------------------------------------------------------------------