mirror of
https://github.com/swc-project/swc.git
synced 2025-01-08 23:10:13 +03:00
Upgrade to napi@1 (#1244)
node-swc: - Support apple silicon. - Support linux aarch64. - Support linux armv7. - Support android aarch64. - Support yarn pnp.
This commit is contained in:
parent
254efc4d54
commit
0c45a31f31
@ -2,7 +2,6 @@
|
||||
[build]
|
||||
rustflags = [
|
||||
"--cfg", "procmacro2_semver_exempt",
|
||||
"-Z", "thinlto=no",
|
||||
"-C", "target-feature=+sse2",
|
||||
]
|
||||
|
||||
@ -10,6 +9,28 @@ rustdocflags = [
|
||||
"--cfg", "procmacro2_semver_exempt",
|
||||
]
|
||||
|
||||
[target.aarch64-apple-darwin]
|
||||
rustflags = [
|
||||
"--cfg", "procmacro2_semver_exempt",
|
||||
]
|
||||
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
rustflags = [
|
||||
"--cfg", "procmacro2_semver_exempt",
|
||||
]
|
||||
linker = "aarch64-linux-gnu-gcc"
|
||||
|
||||
[target.armv7-unknown-linux-gnueabihf]
|
||||
rustflags = [
|
||||
"--cfg", "procmacro2_semver_exempt",
|
||||
]
|
||||
linker = "arm-linux-gnueabihf-gcc"
|
||||
|
||||
[target.aarch64-linux-android]
|
||||
rustflags = [
|
||||
"--cfg", "procmacro2_semver_exempt",
|
||||
]
|
||||
|
||||
[target.wasm32-unknown-unknown]
|
||||
rustflags = [
|
||||
"--cfg", "procmacro2_semver_exempt",
|
||||
|
10
.github/workflows/cargo.yml
vendored
10
.github/workflows/cargo.yml
vendored
@ -52,16 +52,6 @@ jobs:
|
||||
npm i browserslist regenerator-runtime sourcemap-validator progress
|
||||
npm i -g jest
|
||||
|
||||
- name: Install llvm
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: choco install -y llvm
|
||||
|
||||
- name: Set llvm path
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: allenevans/set-env@v1.0.0
|
||||
with:
|
||||
LIBCLANG_PATH: 'C:\\Program Files\\LLVM\\bin'
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
|
255
.github/workflows/publish-node.yml
vendored
255
.github/workflows/publish-node.yml
vendored
@ -24,42 +24,12 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/
|
||||
**/target/
|
||||
key: ${{ runner.os }}-publish-integration
|
||||
|
||||
- name: Set platform name
|
||||
run: |
|
||||
export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())")
|
||||
echo "PLATFORM_NAME=$NODE_PLATFORM_NAME" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Install llvm
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: choco install -y llvm
|
||||
|
||||
- name: Set llvm path
|
||||
if: matrix.os == 'windows-latest'
|
||||
uses: allenevans/set-env@v2.0.0
|
||||
with:
|
||||
LIBCLANG_PATH: 'C:\\Program Files\\LLVM\\bin'
|
||||
node-version: 14
|
||||
|
||||
- name: Install node dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Build
|
||||
if: matrix.os != 'macos-latest'
|
||||
shell: bash
|
||||
run: npm run build
|
||||
|
||||
- name: Build
|
||||
if: matrix.os == 'macos-latest'
|
||||
shell: bash
|
||||
run: npm run build
|
||||
env:
|
||||
@ -69,17 +39,13 @@ jobs:
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bindings
|
||||
path: swc.${{ env.PLATFORM_NAME }}.node
|
||||
|
||||
- name: List packages
|
||||
run: ls -R ./scripts/npm/
|
||||
shell: bash
|
||||
path: swc.*.node
|
||||
|
||||
- name: Test bindings
|
||||
run: npm test
|
||||
|
||||
build_musl:
|
||||
name: stable - linux-musl - node@12
|
||||
build-linux-musl:
|
||||
name: stable - linux-musl - node@10
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@ -93,45 +59,218 @@ jobs:
|
||||
DOCKER_USERNAME: ${{ github.actor }}
|
||||
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
target/
|
||||
key: linux-musl-publish-integration
|
||||
|
||||
- name: Pull docker image
|
||||
run: |
|
||||
docker pull docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts
|
||||
docker tag docker.pkg.github.com/napi-rs/napi-rs/rust-nodejs-alpine:lts builder
|
||||
docker pull docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:10-alpine
|
||||
docker tag docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:10-alpine builder
|
||||
- name: "Install dependencies"
|
||||
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org
|
||||
run: npm i
|
||||
|
||||
- name: "Build"
|
||||
run: |
|
||||
docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/node-rs -w /node-rs builder sh -c "cargo build -p node --release"
|
||||
docker run --rm -v $(pwd)/.cargo:/root/.cargo -v $(pwd):/node-rs -w /node-rs builder sh -c "./node_modules/.bin/napi build --platform --cargo-name node --musl --release -c ./package.json ./scripts/npm"
|
||||
|
||||
- name: List packages
|
||||
run: ls -R ./scripts/npm/
|
||||
shell: bash
|
||||
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/swc -w /swc builder sh -c "./node_modules/.bin/napi build --platform --cargo-name node --release -c ./package.json --cargo-flags='-p node'"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bindings
|
||||
path: scripts/npm/swc.linux-musl.node
|
||||
publish:
|
||||
name: npm
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
- build_musl
|
||||
path: swc.*.node
|
||||
|
||||
build-apple-silicon:
|
||||
name: nightly - aarch64-apple-darwin - node@14
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
node-version: 14
|
||||
|
||||
- name: Install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Install aarch64 toolchain
|
||||
run: rustup target add aarch64-apple-darwin
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
target/
|
||||
key: aarch64-apple-darwin-publish-integration
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Cross build aarch64
|
||||
run: yarn build --target aarch64-apple-darwin
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bindings
|
||||
path: swc.*.node
|
||||
|
||||
build-linux-aarch64:
|
||||
name: stable - aarch64-unknown-linux-gnu - node@14
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Install aarch64 toolchain
|
||||
run: rustup target add aarch64-unknown-linux-gnu
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
target/
|
||||
key: aarch64-linux-gnu-publish-integration
|
||||
|
||||
|
||||
- name: Install cross compile toolchain
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Cross build aarch64
|
||||
run: yarn build --target aarch64-unknown-linux-gnu
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bindings
|
||||
path: swc.*.node
|
||||
|
||||
build-linux-arm7:
|
||||
name: stable - arm7-unknown-linux-gnu - node@14
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
|
||||
- name: Install aarch64 toolchain
|
||||
run: rustup target add armv7-unknown-linux-gnueabihf
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
target/
|
||||
key: arm7-linux-gnu-publish-integration
|
||||
|
||||
- name: Install cross compile toolchain
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-arm-linux-gnueabihf -y
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Cross build aarch64
|
||||
run: yarn build --target armv7-unknown-linux-gnueabihf
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bindings
|
||||
path: swc.*.node
|
||||
|
||||
build-android-aarch64:
|
||||
name: Build - Android - aarch64
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Install aarch64 toolchain
|
||||
run: rustup target add aarch64-linux-android
|
||||
|
||||
- name: Install node dependencies
|
||||
run: npm i
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang"
|
||||
yarn build --target aarch64-linux-android
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: bindings
|
||||
path: swc.*.node
|
||||
|
||||
publish:
|
||||
name: npm
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
- build-linux-musl
|
||||
- build-linux-arm7
|
||||
- build-linux-aarch64
|
||||
- build-apple-silicon
|
||||
- build-android-aarch64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Set release name
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
# Do not cache node_modules, or yarn workspace links broken
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
|
||||
@ -148,6 +287,10 @@ jobs:
|
||||
shell: bash
|
||||
run: npm run artifacts
|
||||
|
||||
- name: List npm
|
||||
run: ls -R ./scripts/npm
|
||||
shell: bash
|
||||
|
||||
- name: Publish
|
||||
run: |
|
||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
||||
|
@ -1,4 +1,3 @@
|
||||
format_strings = true
|
||||
required_version = "1.4.20"
|
||||
use_field_init_shorthand = true
|
||||
wrap_comments = true
|
||||
|
@ -12,14 +12,14 @@ version = "0.1.0"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[build-dependencies]
|
||||
napi-build = "0.2.1"
|
||||
napi-build = {version = "1.0"}
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
backtrace = "0.3"
|
||||
fxhash = "0.2"
|
||||
napi = {version = "0.5.0", features = ["serde-json"]}
|
||||
napi-derive = "0.5.0"
|
||||
napi = {version = "1.0", features = ["serde-json"]}
|
||||
napi-derive = {version = "1.0"}
|
||||
path-clean = "0.1"
|
||||
serde = {version = "1", features = ["derive"]}
|
||||
serde_json = "1"
|
||||
@ -31,7 +31,7 @@ swc_common = {path = "../common", features = ["tty-emitter", "sourcemap"]}
|
||||
swc_ecma_ast = {path = "../ecmascript/ast"}
|
||||
swc_ecma_parser = {path = "../ecmascript/parser"}
|
||||
|
||||
[target.'cfg(all(unix, not(target_env = "musl")))'.dependencies]
|
||||
[target.'cfg(all(unix, not(target_env = "musl"), not(target_arch = "aarch64")))'.dependencies]
|
||||
jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]}
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
|
@ -168,7 +168,7 @@ impl Task for BundleTask {
|
||||
))
|
||||
}
|
||||
|
||||
fn resolve(&self, env: &mut Env, output: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
fn resolve(self, env: Env, output: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
env.to_js_value(&output)?.coerce_to_object()
|
||||
}
|
||||
}
|
||||
@ -191,14 +191,16 @@ pub(crate) fn bundle(cx: CallContext) -> napi::Result<JsObject> {
|
||||
}),
|
||||
));
|
||||
|
||||
cx.env.spawn(BundleTask {
|
||||
swc: c.clone(),
|
||||
config: ConfigItem {
|
||||
loader,
|
||||
resolver: Box::new(NodeResolver::new()) as Box<_>,
|
||||
static_items,
|
||||
},
|
||||
})
|
||||
cx.env
|
||||
.spawn(BundleTask {
|
||||
swc: c.clone(),
|
||||
config: ConfigItem {
|
||||
loader,
|
||||
resolver: Box::new(NodeResolver::new()) as Box<_>,
|
||||
static_items,
|
||||
},
|
||||
})
|
||||
.map(|t| t.promise_object())
|
||||
}
|
||||
|
||||
struct Hook;
|
||||
|
@ -1,11 +1,9 @@
|
||||
#![recursion_limit = "2048"]
|
||||
|
||||
#[macro_use]
|
||||
extern crate napi;
|
||||
#[macro_use]
|
||||
extern crate napi_derive;
|
||||
|
||||
#[cfg(all(unix, not(target_env = "musl")))]
|
||||
#[cfg(all(unix, not(target_env = "musl"), not(target_arch = "aarch64")))]
|
||||
#[global_allocator]
|
||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||
|
||||
@ -14,7 +12,7 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
use backtrace::Backtrace;
|
||||
use napi::{CallContext, Env, JsFunction, JsObject, JsUndefined, Module};
|
||||
use napi::{CallContext, Env, JsFunction, JsObject, JsUndefined};
|
||||
use std::{env, panic::set_hook, sync::Arc};
|
||||
use swc::{Compiler, TransformOutput};
|
||||
use swc_common::{
|
||||
@ -30,10 +28,6 @@ mod print;
|
||||
mod transform;
|
||||
mod util;
|
||||
|
||||
// #[cfg(all(unix, not(target_env = "musl")))]
|
||||
// #[global_allocator]
|
||||
// static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||
|
||||
static COMPILER: Lazy<Arc<Compiler>> = Lazy::new(|| {
|
||||
let cm = Arc::new(SourceMap::new(FilePathMapping::empty()));
|
||||
let handler = Arc::new(Handler::with_tty_emitter(
|
||||
@ -46,9 +40,8 @@ static COMPILER: Lazy<Arc<Compiler>> = Lazy::new(|| {
|
||||
Arc::new(Compiler::new(cm.clone(), handler))
|
||||
});
|
||||
|
||||
register_module!(swc, init);
|
||||
|
||||
fn init(m: &mut Module) -> napi::Result<()> {
|
||||
#[module_exports]
|
||||
fn init(mut exports: JsObject) -> napi::Result<()> {
|
||||
if cfg!(debug_assertions) || env::var("SWC_DEBUG").unwrap_or_else(|_| String::new()) == "1" {
|
||||
set_hook(Box::new(|_panic_info| {
|
||||
let backtrace = Backtrace::new();
|
||||
@ -56,22 +49,22 @@ fn init(m: &mut Module) -> napi::Result<()> {
|
||||
}));
|
||||
}
|
||||
|
||||
m.create_named_method("define", define_compiler_class)?;
|
||||
exports.create_named_method("define", define_compiler_class)?;
|
||||
|
||||
m.create_named_method("transform", transform::transform)?;
|
||||
m.create_named_method("transformSync", transform::transform_sync)?;
|
||||
m.create_named_method("transformFile", transform::transform_file)?;
|
||||
m.create_named_method("transformFileSync", transform::transform_file_sync)?;
|
||||
exports.create_named_method("transform", transform::transform)?;
|
||||
exports.create_named_method("transformSync", transform::transform_sync)?;
|
||||
exports.create_named_method("transformFile", transform::transform_file)?;
|
||||
exports.create_named_method("transformFileSync", transform::transform_file_sync)?;
|
||||
|
||||
m.create_named_method("parse", parse::parse)?;
|
||||
m.create_named_method("parseSync", parse::parse_sync)?;
|
||||
m.create_named_method("parseFile", parse::parse_file)?;
|
||||
m.create_named_method("parseFileSync", parse::parse_file_sync)?;
|
||||
exports.create_named_method("parse", parse::parse)?;
|
||||
exports.create_named_method("parseSync", parse::parse_sync)?;
|
||||
exports.create_named_method("parseFile", parse::parse_file)?;
|
||||
exports.create_named_method("parseFileSync", parse::parse_file_sync)?;
|
||||
|
||||
m.create_named_method("print", print::print)?;
|
||||
m.create_named_method("printSync", print::print_sync)?;
|
||||
exports.create_named_method("print", print::print)?;
|
||||
exports.create_named_method("printSync", print::print_sync)?;
|
||||
|
||||
m.create_named_method("bundle", bundle::bundle)?;
|
||||
exports.create_named_method("bundle", bundle::bundle)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@ -87,7 +80,7 @@ fn define_compiler_class(ctx: CallContext) -> napi::Result<JsFunction> {
|
||||
}
|
||||
|
||||
#[js_function]
|
||||
fn construct_compiler(ctx: CallContext<JsObject>) -> napi::Result<JsUndefined> {
|
||||
fn construct_compiler(ctx: CallContext) -> napi::Result<JsUndefined> {
|
||||
// TODO: Assign swc::Compiler
|
||||
ctx.env.get_undefined()
|
||||
}
|
||||
|
@ -52,8 +52,8 @@ impl Task for ParseTask {
|
||||
Ok(program)
|
||||
}
|
||||
|
||||
fn resolve(&self, env: &mut Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_parse(env, result, &self.c)
|
||||
fn resolve(self, env: Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_parse(&env, result, &self.c)
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,25 +82,27 @@ impl Task for ParseFileTask {
|
||||
})
|
||||
}
|
||||
|
||||
fn resolve(&self, env: &mut Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_parse(env, result, &self.c)
|
||||
fn resolve(self, env: Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_parse(&env, result, &self.c)
|
||||
}
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
pub fn parse(ctx: CallContext) -> napi::Result<JsObject> {
|
||||
let c = get_compiler(&ctx);
|
||||
let src = ctx.get::<JsString>(0)?;
|
||||
let src = ctx.get::<JsString>(0)?.into_utf8()?;
|
||||
let options: ParseOptions = ctx.get_deserialized(1)?;
|
||||
|
||||
let fm =
|
||||
c.cm.new_source_file(FileName::Anon, src.as_str()?.to_string());
|
||||
|
||||
ctx.env.spawn(ParseTask {
|
||||
c: c.clone(),
|
||||
fm,
|
||||
options,
|
||||
})
|
||||
ctx.env
|
||||
.spawn(ParseTask {
|
||||
c: c.clone(),
|
||||
fm,
|
||||
options,
|
||||
})
|
||||
.map(|t| t.promise_object())
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
@ -108,7 +110,7 @@ pub fn parse_sync(cx: CallContext) -> napi::Result<JsString> {
|
||||
let c = get_compiler(&cx);
|
||||
|
||||
c.run(|| {
|
||||
let src = cx.get::<JsString>(0)?.as_str()?.to_string();
|
||||
let src = cx.get::<JsString>(0)?.into_utf8()?.as_str()?.to_owned();
|
||||
let options: ParseOptions = cx.get_deserialized(1)?;
|
||||
|
||||
let program = {
|
||||
@ -130,7 +132,7 @@ pub fn parse_sync(cx: CallContext) -> napi::Result<JsString> {
|
||||
#[js_function(2)]
|
||||
pub fn parse_file_sync(cx: CallContext) -> napi::Result<JsString> {
|
||||
let c = get_compiler(&cx);
|
||||
let path = cx.get::<JsString>(0)?;
|
||||
let path = cx.get::<JsString>(0)?.into_utf8()?;
|
||||
let options: ParseOptions = cx.get_deserialized(1)?;
|
||||
|
||||
let program = {
|
||||
@ -154,8 +156,10 @@ pub fn parse_file_sync(cx: CallContext) -> napi::Result<JsString> {
|
||||
#[js_function(2)]
|
||||
pub fn parse_file(cx: CallContext) -> napi::Result<JsObject> {
|
||||
let c = get_compiler(&cx);
|
||||
let path = PathBuf::from(cx.get::<JsString>(0)?.as_str()?);
|
||||
let path = PathBuf::from(cx.get::<JsString>(0)?.into_utf8()?.as_str()?);
|
||||
let options: ParseOptions = cx.get_deserialized(1)?;
|
||||
|
||||
cx.env.spawn(ParseFileTask { c, path, options })
|
||||
cx.env
|
||||
.spawn(ParseFileTask { c, path, options })
|
||||
.map(|t| t.promise_object())
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::{
|
||||
complete_output, get_compiler,
|
||||
util::{CtxtExt, MapErr},
|
||||
};
|
||||
use napi::{CallContext, Env, JsObject, JsString, Task};
|
||||
use napi::{CallContext, Env, Error, JsObject, JsString, Status, Task};
|
||||
use std::sync::Arc;
|
||||
use swc::{
|
||||
config::{Options, SourceMapsConfig},
|
||||
@ -48,32 +48,38 @@ impl Task for PrintTask {
|
||||
.convert_err()
|
||||
}
|
||||
|
||||
fn resolve(&self, env: &mut Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_output(env, result)
|
||||
fn resolve(self, env: Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_output(&env, result)
|
||||
}
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
pub fn print(cx: CallContext) -> napi::Result<JsObject> {
|
||||
let c = get_compiler(&cx);
|
||||
let program = cx.get::<JsString>(0)?;
|
||||
let program: Program =
|
||||
serde_json::from_str(program.as_str()?).expect("failed to deserialize Program");
|
||||
let program = cx.get::<JsString>(0)?.into_utf8()?;
|
||||
let program: Program = serde_json::from_str(program.as_str()?).map_err(|e| {
|
||||
Error::new(
|
||||
Status::InvalidArg,
|
||||
format!("failed to deserialize Program {}", e),
|
||||
)
|
||||
})?;
|
||||
|
||||
let options: Options = cx.get_deserialized(1)?;
|
||||
|
||||
cx.env.spawn(PrintTask {
|
||||
c: c.clone(),
|
||||
program,
|
||||
options,
|
||||
})
|
||||
cx.env
|
||||
.spawn(PrintTask {
|
||||
c: c.clone(),
|
||||
program,
|
||||
options,
|
||||
})
|
||||
.map(|t| t.promise_object())
|
||||
}
|
||||
|
||||
#[js_function(2)]
|
||||
pub fn print_sync(cx: CallContext) -> napi::Result<JsObject> {
|
||||
let c = get_compiler(&cx);
|
||||
|
||||
let program = cx.get::<JsString>(0)?;
|
||||
let program = cx.get::<JsString>(0)?.into_utf8()?;
|
||||
let program: Program =
|
||||
serde_json::from_str(&program.as_str()?).expect("failed to deserialize Program");
|
||||
|
||||
|
@ -54,8 +54,8 @@ impl Task for TransformTask {
|
||||
.convert_err()
|
||||
}
|
||||
|
||||
fn resolve(&self, env: &mut Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_output(env, result)
|
||||
fn resolve(self, env: Env, result: Self::Output) -> napi::Result<Self::JsValue> {
|
||||
complete_output(&env, result)
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,13 +66,13 @@ where
|
||||
{
|
||||
let c = get_compiler(&cx);
|
||||
|
||||
let s = cx.get::<JsString>(0)?.as_str()?.to_string();
|
||||
let s = cx.get::<JsString>(0)?.into_utf8()?.as_str()?.to_owned();
|
||||
let is_module = cx.get::<JsBoolean>(1)?;
|
||||
let options: Options = cx.get_deserialized(2)?;
|
||||
|
||||
let task = op(&c, s, is_module.get_value()?, options);
|
||||
|
||||
cx.env.spawn(task)
|
||||
cx.env.spawn(task).map(|t| t.promise_object())
|
||||
}
|
||||
|
||||
pub fn exec_transform<F>(cx: CallContext, op: F) -> napi::Result<JsObject>
|
||||
@ -81,7 +81,7 @@ where
|
||||
{
|
||||
let c = get_compiler(&cx);
|
||||
|
||||
let s = cx.get::<JsString>(0)?;
|
||||
let s = cx.get::<JsString>(0)?.into_utf8()?;
|
||||
let is_module = cx.get::<JsBoolean>(1)?;
|
||||
let options: Options = cx.get_deserialized(2)?;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
use anyhow::Context;
|
||||
use napi::{CallContext, JsBuffer, NapiValue, Status};
|
||||
use napi::{CallContext, JsBuffer, Status};
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
pub trait MapErr<T>: Into<Result<T, anyhow::Error>> {
|
||||
@ -18,15 +18,12 @@ pub trait CtxtExt {
|
||||
T: DeserializeOwned;
|
||||
}
|
||||
|
||||
impl<V> CtxtExt for CallContext<'_, V>
|
||||
where
|
||||
V: NapiValue,
|
||||
{
|
||||
impl CtxtExt for CallContext<'_> {
|
||||
fn get_deserialized<T>(&self, index: usize) -> napi::Result<T>
|
||||
where
|
||||
T: DeserializeOwned,
|
||||
{
|
||||
let buffer = self.get::<JsBuffer>(index)?;
|
||||
let buffer = self.get::<JsBuffer>(index)?.into_value()?;
|
||||
let v = serde_json::from_slice(&buffer)
|
||||
.with_context(|| format!("Argument at `{}` is not JsBuffer", index))
|
||||
.convert_err()?;
|
||||
|
45
package.json
45
package.json
@ -16,7 +16,7 @@
|
||||
"tsc"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=8.9.0"
|
||||
"node": ">=10"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -25,29 +25,32 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
},
|
||||
"os": [
|
||||
"darwin",
|
||||
"linux",
|
||||
"win32"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"napi": {
|
||||
"name": "swc",
|
||||
"musl": [
|
||||
"linux"
|
||||
]
|
||||
"triples": {
|
||||
"defaults": true,
|
||||
"additional": [
|
||||
"x86_64-unknown-linux-musl",
|
||||
"aarch64-unknown-linux-gnu",
|
||||
"armv7-unknown-linux-gnueabihf",
|
||||
"aarch64-apple-darwin",
|
||||
"aarch64-linux-android"
|
||||
]
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@node-rs/helper": "^0.4.0"
|
||||
"@node-rs/helper": "^1.0.0"
|
||||
},
|
||||
"types": "./lib/index.d.ts",
|
||||
"scripts": {
|
||||
"artifacts": "napi artifacts",
|
||||
"artifacts": "napi artifacts --dist scripts/npm",
|
||||
"prepublishOnly": "tsc -d && napi prepublish -p scripts/npm --tagstyle npm",
|
||||
"build": "tsc -d && cargo build -p node --release && napi build --platform --release --cargo-name node",
|
||||
"build:dev": "tsc -d && cargo build -p node && napi build --platform --cargo-name node",
|
||||
"build": "tsc -d && napi build --platform --release --cargo-name node --cargo-flags=\"-p node\"",
|
||||
"build:dev": "tsc -d && napi build --platform --cargo-name node --cargo-flags=\"-p node\"",
|
||||
"test": "jest node-swc/__tests__",
|
||||
"version": "napi version -p scripts/npm"
|
||||
},
|
||||
@ -59,6 +62,7 @@
|
||||
"@babel/preset-env": "^7.2.3",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/preset-typescript": "^7.1.0",
|
||||
"@napi-rs/cli": "^1.0.0-alpha.11",
|
||||
"@swc/helpers": "^0.2.2",
|
||||
"@types/browserslist": "^4.4.0",
|
||||
"@types/jest": "^25.2.3",
|
||||
@ -67,7 +71,6 @@
|
||||
"browserslist": "^4.12.0",
|
||||
"jest": "^23.6.0",
|
||||
"lodash": "^4.17.11",
|
||||
"napi-rs": "^0.3.1",
|
||||
"progress": "^2.0.3",
|
||||
"source-map": "^0.7.3",
|
||||
"sourcemap-validator": "^1.1.1",
|
||||
@ -76,11 +79,5 @@
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/swc"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@swc/core-darwin": "^1.2.23",
|
||||
"@swc/core-linux": "^1.2.23",
|
||||
"@swc/core-linux-musl": "^0.1.0",
|
||||
"@swc/core-win32": "^1.2.23"
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
nightly-2020-08-29
|
||||
nightly-2020-11-24
|
||||
|
3
scripts/npm/android-arm64/README.md
Normal file
3
scripts/npm/android-arm64/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-android-arm64`
|
||||
|
||||
This is the **aarch64-linux-android** binary for `@swc/core`
|
41
scripts/npm/android-arm64/package.json
Normal file
41
scripts/npm/android-arm64/package.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@swc/core-android-arm64",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"main": "swc.android-arm64.node",
|
||||
"files": [
|
||||
"swc.android-arm64.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
"swc",
|
||||
"spack",
|
||||
"babel",
|
||||
"typescript",
|
||||
"rust",
|
||||
"webpack",
|
||||
"tsc"
|
||||
],
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/swc-project/swc.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
3
scripts/npm/darwin-arm64/README.md
Normal file
3
scripts/npm/darwin-arm64/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-darwin-arm64`
|
||||
|
||||
This is the **aarch64-apple-darwin** binary for `@swc/core`
|
41
scripts/npm/darwin-arm64/package.json
Normal file
41
scripts/npm/darwin-arm64/package.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@swc/core-darwin-arm64",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"main": "swc.darwin-arm64.node",
|
||||
"files": [
|
||||
"swc.darwin-arm64.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
"swc",
|
||||
"spack",
|
||||
"babel",
|
||||
"typescript",
|
||||
"rust",
|
||||
"webpack",
|
||||
"tsc"
|
||||
],
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/swc-project/swc.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
3
scripts/npm/darwin-x64/README.md
Normal file
3
scripts/npm/darwin-x64/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-darwin-x64`
|
||||
|
||||
This is the **x86_64-apple-darwin** binary for `@swc/core`
|
@ -1,12 +1,15 @@
|
||||
{
|
||||
"name": "@swc/core-darwin",
|
||||
"version": "1.2.23",
|
||||
"name": "@swc/core-darwin-x64",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"main": "swc.darwin.node",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"main": "swc.darwin-x64.node",
|
||||
"files": [
|
||||
"swc.darwin.node"
|
||||
"swc.darwin-x64.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
@ -21,11 +24,12 @@
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=8.9.0"
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -34,4 +38,4 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
`#@swc/core-darwin`
|
||||
|
||||
this is the **darwin** 64-bit binary for `@swc/core`
|
3
scripts/npm/linux-arm-gnueabihf/README.md
Normal file
3
scripts/npm/linux-arm-gnueabihf/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-linux-arm-gnueabihf`
|
||||
|
||||
This is the **armv7-unknown-linux-gnueabihf** binary for `@swc/core`
|
41
scripts/npm/linux-arm-gnueabihf/package.json
Normal file
41
scripts/npm/linux-arm-gnueabihf/package.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@swc/core-linux-arm-gnueabihf",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"main": "swc.linux-arm-gnueabihf.node",
|
||||
"files": [
|
||||
"swc.linux-arm-gnueabihf.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
"swc",
|
||||
"spack",
|
||||
"babel",
|
||||
"typescript",
|
||||
"rust",
|
||||
"webpack",
|
||||
"tsc"
|
||||
],
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/swc-project/swc.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
3
scripts/npm/linux-arm64-gnu/README.md
Normal file
3
scripts/npm/linux-arm64-gnu/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-linux-arm64-gnu`
|
||||
|
||||
This is the **aarch64-unknown-linux-gnu** binary for `@swc/core`
|
41
scripts/npm/linux-arm64-gnu/package.json
Normal file
41
scripts/npm/linux-arm64-gnu/package.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@swc/core-linux-arm64-gnu",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"main": "swc.linux-arm64-gnu.node",
|
||||
"files": [
|
||||
"swc.linux-arm64-gnu.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
"swc",
|
||||
"spack",
|
||||
"babel",
|
||||
"typescript",
|
||||
"rust",
|
||||
"webpack",
|
||||
"tsc"
|
||||
],
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/swc-project/swc.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
`#@swc/core-linux-musl`
|
||||
|
||||
this is the **linux** 64-bit musl binary for `@swc/core`
|
3
scripts/npm/linux-x64-gnu/README.md
Normal file
3
scripts/npm/linux-x64-gnu/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-linux-x64-gnu`
|
||||
|
||||
This is the **x86_64-unknown-linux-gnu** binary for `@swc/core`
|
@ -1,12 +1,15 @@
|
||||
{
|
||||
"name": "@swc/core-linux",
|
||||
"version": "1.2.23",
|
||||
"name": "@swc/core-linux-x64-gnu",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"main": "swc.linux.node",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"main": "swc.linux-x64-gnu.node",
|
||||
"files": [
|
||||
"swc.linux.node"
|
||||
"swc.linux-x64-gnu.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
@ -21,11 +24,12 @@
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=8.9.0"
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -34,4 +38,4 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
||||
}
|
3
scripts/npm/linux-x64-musl/README.md
Normal file
3
scripts/npm/linux-x64-musl/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-linux-x64-musl`
|
||||
|
||||
This is the **x86_64-unknown-linux-musl** binary for `@swc/core`
|
@ -1,12 +1,15 @@
|
||||
{
|
||||
"name": "@swc/core-linux-musl",
|
||||
"version": "1.2.23",
|
||||
"name": "@swc/core-linux-x64-musl",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"main": "swc.linux-musl.node",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"main": "swc.linux-x64-musl.node",
|
||||
"files": [
|
||||
"swc.linux.node"
|
||||
"swc.linux-x64-musl.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
@ -21,11 +24,12 @@
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=8.9.0"
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -34,4 +38,4 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
`#@swc/core-linux`
|
||||
|
||||
this is the **linux** 64-bit binary for `@swc/core`
|
3
scripts/npm/win32-x64-msvc/README.md
Normal file
3
scripts/npm/win32-x64-msvc/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# `@swc/core-win32-x64-msvc`
|
||||
|
||||
This is the **x86_64-pc-windows-msvc** binary for `@swc/core`
|
@ -1,12 +1,15 @@
|
||||
{
|
||||
"name": "@swc/core-win32",
|
||||
"version": "1.2.23",
|
||||
"name": "@swc/core-win32-x64-msvc",
|
||||
"version": "1.2.40",
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"main": "swc.win32.node",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"main": "swc.win32-x64-msvc.node",
|
||||
"files": [
|
||||
"swc.win32.node"
|
||||
"swc.win32-x64-msvc.node"
|
||||
],
|
||||
"description": "Super-fast alternative for babel",
|
||||
"keywords": [
|
||||
@ -21,11 +24,12 @@
|
||||
"author": "강동윤 <kdy1997.dev@gmail.com>",
|
||||
"homepage": "https://swc.rs",
|
||||
"license": "MIT",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=8.9.0"
|
||||
"node": ">=10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/",
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -34,4 +38,4 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/swc-project/swc/issues"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
`#@swc/core-win32`
|
||||
|
||||
this is the **win32** 64-bit binary for `@swc/core`
|
Loading…
Reference in New Issue
Block a user