@swc-node/core
Advanced tools
Comparing version 0.6.1 to 0.7.0
@@ -6,2 +6,8 @@ # Change Log | ||
# [0.7.0](https://github.com/Brooooooklyn/swc-node/compare/@swc-node/core@0.6.1...@swc-node/core@0.7.0) (2020-09-04) | ||
### Features | ||
- **core:** upgrade to napi@0.5 ([bf5f2c4](https://github.com/Brooooooklyn/swc-node/commit/bf5f2c4b9efc074e0b1ff62f8d7ee2b1c578228f)) | ||
## [0.6.1](https://github.com/Brooooooklyn/swc-node/compare/@swc-node/core@0.6.0...@swc-node/core@0.6.1) (2020-09-01) | ||
@@ -8,0 +14,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SWC_VERSION = exports.transform = exports.transformJest = exports.transformSync = void 0; | ||
const os_1 = require("os"); | ||
const path_1 = require("path"); | ||
const helper_1 = require("@node-rs/helper"); | ||
let bindings; | ||
let linuxError = null; | ||
try { | ||
bindings = helper_1.loadBinding(path_1.join(require.resolve('@swc-node/core'), '..', '..'), 'swc'); | ||
} | ||
catch (e) { | ||
const platformName = os_1.platform(); | ||
try { | ||
bindings = require(`@swc-node/core-${platformName}`); | ||
} | ||
catch (e) { | ||
if (platformName !== 'linux') { | ||
throw new TypeError('Not compatible with your platform. Error message: ' + e.message); | ||
} | ||
else { | ||
linuxError = e; | ||
} | ||
} | ||
} | ||
if (!bindings) { | ||
try { | ||
require.resolve('@swc-node/core-linux-musl'); | ||
} | ||
catch (e) { | ||
throw new TypeError(`Could not load @swc-node/core-linux-musl, You may need add @swc-node/core-linux-musl to optionalDependencies of your project`); | ||
} | ||
try { | ||
bindings = require('@swc-node/core-linux-musl'); | ||
} | ||
catch (e) { | ||
throw new TypeError(`Linux glibc version load error: ${linuxError.message}; Linux musl version load error: Error message: ${e.message}`); | ||
} | ||
} | ||
const bindings = helper_1.loadBinding(path_1.join(require.resolve('@swc-node/core'), '..', '..'), 'swc', '@swc-node/core'); | ||
function transformOption(path, options) { | ||
var _a, _b; | ||
const opts = options == null ? {} : options; | ||
return Buffer.from(JSON.stringify({ | ||
return JSON.stringify({ | ||
filename: path, | ||
@@ -64,3 +31,3 @@ jsc: { | ||
swcrc: false, | ||
})); | ||
}); | ||
} | ||
@@ -67,0 +34,0 @@ function transformSync(source, path, options) { |
{ | ||
"name": "@swc-node/core", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"description": "Faster swc nodejs binding", | ||
@@ -37,2 +37,8 @@ "keywords": [ | ||
], | ||
"napi": { | ||
"name": "swc", | ||
"musl": [ | ||
"linux" | ||
] | ||
}, | ||
"engines": { | ||
@@ -53,14 +59,14 @@ "node": ">= 8.9" | ||
"scripts": { | ||
"prepublishOnly": "node -r @swc-node/register ./publish.ts", | ||
"version": "node -r @swc-node/register ./version.ts" | ||
"prepublishOnly": "napi prepublish", | ||
"version": "napi version" | ||
}, | ||
"dependencies": { | ||
"@node-rs/helper": "^0.3.1" | ||
"@node-rs/helper": "^0.4.0" | ||
}, | ||
"gitHead": "e7161ff24de4ba63f068244e4a4a20df22f135ff", | ||
"gitHead": "4bbe7f4a86ca5b0fe005415162c156cf4c0a8c4d", | ||
"optionalDependencies": { | ||
"@swc-node/core-darwin": "^0.6.1", | ||
"@swc-node/core-linux": "^0.6.1", | ||
"@swc-node/core-win32": "^0.6.1" | ||
"@swc-node/core-darwin": "^0.7.0", | ||
"@swc-node/core-linux": "^0.7.0", | ||
"@swc-node/core-win32": "^0.7.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
173156
0
58
+ Added@node-rs/helper@0.4.0(transitive)
+ Added@swc-node/core-darwin@0.7.6(transitive)
+ Added@swc-node/core-linux@0.7.6(transitive)
+ Added@swc-node/core-win32@0.7.6(transitive)
- Removed@node-rs/helper@0.3.1(transitive)
- Removed@swc-node/core-darwin@0.6.1(transitive)
- Removed@swc-node/core-linux@0.6.1(transitive)
- Removed@swc-node/core-win32@0.6.1(transitive)
Updated@node-rs/helper@^0.4.0