@swc-node/core
Advanced tools
Comparing version 0.7.6 to 1.0.0
export interface Options { | ||
target?: 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020'; | ||
target?: 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019'; | ||
module?: 'commonjs' | 'umd' | 'amd' | 'es6'; | ||
@@ -11,5 +11,4 @@ sourcemap?: boolean | 'inline'; | ||
} | ||
export declare function transformSync(source: string, path: string, options?: Options): any; | ||
export declare function transformJest(source: string, path: string, options?: Options): any; | ||
export declare function transform(source: string, path: string, options?: Options): any; | ||
export declare const SWC_VERSION = "4d5a0da"; | ||
export declare function transformSync(source: string, path: string, options?: Options): import("@swc/core").Output; | ||
export declare function transformJest(source: string, path: string, options?: Options): import("@swc/core").Output; | ||
export declare function transform(source: string, path: string, options?: Options): Promise<import("@swc/core").Output>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SWC_VERSION = exports.transform = exports.transformJest = exports.transformSync = void 0; | ||
const path_1 = require("path"); | ||
const helper_1 = require("@node-rs/helper"); | ||
const bindings = helper_1.loadBinding(path_1.join(require.resolve('@swc-node/core'), '..', '..'), 'swc', '@swc-node/core'); | ||
function transformOption(path, options) { | ||
var _a, _b, _c; | ||
exports.transform = exports.transformJest = exports.transformSync = void 0; | ||
const core_1 = require("@swc/core"); | ||
function transformOption(path, options, jest = false) { | ||
var _a, _b; | ||
const opts = options == null ? {} : options; | ||
opts.esModuleInterop = (_a = opts.esModuleInterop) !== null && _a !== void 0 ? _a : true; | ||
return JSON.stringify({ | ||
return { | ||
filename: path, | ||
@@ -24,7 +22,11 @@ jsc: { | ||
decoratorMetadata: Boolean(opts.emitDecoratorMetadata), | ||
hidden: { | ||
jest, | ||
}, | ||
}, | ||
}, | ||
minify: false, | ||
isModule: true, | ||
module: { | ||
type: (_c = opts.module) !== null && _c !== void 0 ? _c : 'commonjs', | ||
type: 'commonjs', | ||
noInterop: !opts.esModuleInterop, | ||
@@ -34,17 +36,16 @@ }, | ||
swcrc: false, | ||
}); | ||
}; | ||
} | ||
function transformSync(source, path, options) { | ||
return bindings.transformSync(source, path, transformOption(path, options)); | ||
return core_1.transformSync(source, transformOption(path, options)); | ||
} | ||
exports.transformSync = transformSync; | ||
function transformJest(source, path, options) { | ||
return bindings.transformJest(source, path, transformOption(path, options)); | ||
return core_1.transformSync(source, transformOption(path, options, true)); | ||
} | ||
exports.transformJest = transformJest; | ||
function transform(source, path, options) { | ||
return bindings.transform(source, path, transformOption(path, options)); | ||
return core_1.transform(source, transformOption(path, options)); | ||
} | ||
exports.transform = transform; | ||
exports.SWC_VERSION = '4d5a0da'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@swc-node/core", | ||
"version": "0.7.6", | ||
"version": "1.0.0", | ||
"description": "Faster swc nodejs binding", | ||
@@ -37,8 +37,2 @@ "keywords": [ | ||
], | ||
"napi": { | ||
"name": "swc", | ||
"musl": [ | ||
"linux" | ||
] | ||
}, | ||
"engines": { | ||
@@ -58,15 +52,6 @@ "node": ">= 8.9" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "napi prepublish", | ||
"version": "napi version" | ||
}, | ||
"dependencies": { | ||
"@node-rs/helper": "^0.4.0" | ||
"@swc/core": "^1.2.34" | ||
}, | ||
"gitHead": "318f7dfefadc8b3b9143bc5ee22211863ee46bc0", | ||
"optionalDependencies": { | ||
"@swc-node/core-darwin": "^0.7.6", | ||
"@swc-node/core-linux": "^0.7.6", | ||
"@swc-node/core-win32": "^0.7.6" | ||
} | ||
} | ||
"gitHead": "79c77f87bbab8b96f1306679cbb5c49368f94777" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
0
14112
7
+ Added@swc/core@^1.2.34
+ Added@swc/core@1.9.1(transitive)
+ Added@swc/core-darwin-arm64@1.9.1(transitive)
+ Added@swc/core-darwin-x64@1.9.1(transitive)
+ Added@swc/core-linux-arm-gnueabihf@1.9.1(transitive)
+ Added@swc/core-linux-arm64-gnu@1.9.1(transitive)
+ Added@swc/core-linux-arm64-musl@1.9.1(transitive)
+ Added@swc/core-linux-x64-gnu@1.9.1(transitive)
+ Added@swc/core-linux-x64-musl@1.9.1(transitive)
+ Added@swc/core-win32-ia32-msvc@1.9.1(transitive)
+ Added@swc/core-win32-x64-msvc@1.9.1(transitive)
+ Added@swc/counter@0.1.3(transitive)
+ Added@swc/types@0.1.14(transitive)
- Removed@node-rs/helper@^0.4.0
- Removed@node-rs/helper@0.4.0(transitive)
- Removed@swc-node/core-darwin@0.7.6(transitive)
- Removed@swc-node/core-linux@0.7.6(transitive)
- Removed@swc-node/core-win32@0.7.6(transitive)
- Removedtslib@2.8.1(transitive)