@swc-node/register
Advanced tools
Comparing version 1.10.0 to 1.10.1
@@ -29,3 +29,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.tsCompilerOptionsToSwcConfig = exports.readDefaultTsConfig = void 0; | ||
exports.readDefaultTsConfig = readDefaultTsConfig; | ||
exports.tsCompilerOptionsToSwcConfig = tsCompilerOptionsToSwcConfig; | ||
const fs_1 = require("fs"); | ||
@@ -75,3 +76,2 @@ const path_1 = require("path"); | ||
} | ||
exports.readDefaultTsConfig = readDefaultTsConfig; | ||
function toTsTarget(target) { | ||
@@ -141,3 +141,4 @@ switch (target) { | ||
jsx: isJsx, | ||
sourcemap: options.sourceMap && options.inlineSourceMap ? 'inline' : Boolean(options.sourceMap), | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
sourcemap: options.sourceMap || options.inlineSourceMap ? 'inline' : Boolean(options.sourceMap), | ||
experimentalDecorators: (_c = options.experimentalDecorators) !== null && _c !== void 0 ? _c : false, | ||
@@ -174,3 +175,2 @@ emitDecoratorMetadata: (_d = options.emitDecoratorMetadata) !== null && _d !== void 0 ? _d : false, | ||
} | ||
exports.tsCompilerOptionsToSwcConfig = tsCompilerOptionsToSwcConfig; | ||
//# sourceMappingURL=read-default-tsconfig.js.map |
import * as ts from 'typescript'; | ||
export declare const AVAILABLE_TS_EXTENSION_PATTERN: RegExp; | ||
export declare const AVAILABLE_EXTENSION_PATTERN: RegExp; | ||
export declare function compile(sourcecode: string, filename: string, options: ts.CompilerOptions & { | ||
export declare function compile(sourcecode: string | undefined, filename: string, options: ts.CompilerOptions & { | ||
fallbackToTs?: (filename: string) => boolean; | ||
}): string; | ||
export declare function compile(sourcecode: string, filename: string, options: ts.CompilerOptions & { | ||
export declare function compile(sourcecode: string | undefined, filename: string, options: ts.CompilerOptions & { | ||
fallbackToTs?: (filename: string) => boolean; | ||
}, async: false): string; | ||
export declare function compile(sourcecode: string, filename: string, options: ts.CompilerOptions & { | ||
export declare function compile(sourcecode: string | undefined, filename: string, options: ts.CompilerOptions & { | ||
fallbackToTs?: (filename: string) => boolean; | ||
}, async: true): Promise<string>; | ||
export declare function compile(sourcecode: string, filename: string, options: ts.CompilerOptions & { | ||
export declare function compile(sourcecode: string | undefined, filename: string, options: ts.CompilerOptions & { | ||
fallbackToTs?: (filename: string) => boolean; | ||
}, async: boolean): string | Promise<string>; | ||
export declare function register(options?: Partial<ts.CompilerOptions>, hookOpts?: {}): () => void; |
@@ -26,3 +26,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.register = exports.compile = exports.AVAILABLE_EXTENSION_PATTERN = exports.AVAILABLE_TS_EXTENSION_PATTERN = void 0; | ||
exports.AVAILABLE_EXTENSION_PATTERN = exports.AVAILABLE_TS_EXTENSION_PATTERN = void 0; | ||
exports.compile = compile; | ||
exports.register = register; | ||
const core_1 = require("@swc-node/core"); | ||
@@ -57,3 +59,4 @@ const sourcemap_support_1 = require("@swc-node/sourcemap-support"); | ||
function compile(sourcecode, filename, options, async = false) { | ||
if ((filename.includes('node_modules') && !exports.AVAILABLE_TS_EXTENSION_PATTERN.test(filename)) || | ||
if (typeof sourcecode === 'undefined' || | ||
(filename.includes('node_modules') && !exports.AVAILABLE_TS_EXTENSION_PATTERN.test(filename)) || | ||
!exports.AVAILABLE_EXTENSION_PATTERN.test(filename)) { | ||
@@ -92,3 +95,2 @@ return sourcecode; | ||
} | ||
exports.compile = compile; | ||
function register(options = {}, hookOpts = {}) { | ||
@@ -105,3 +107,2 @@ if (!process.env.SWCRC) { | ||
} | ||
exports.register = register; | ||
//# sourceMappingURL=register.js.map |
{ | ||
"name": "@swc-node/register", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "SWC node register", | ||
@@ -43,8 +43,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@swc-node/core": "^1.13.1", | ||
"@swc-node/sourcemap-support": "^0.5.0", | ||
"@swc-node/core": "^1.13.2", | ||
"@swc-node/sourcemap-support": "^0.5.1", | ||
"colorette": "^2.0.20", | ||
"debug": "^4.3.4", | ||
"debug": "^4.3.5", | ||
"oxc-resolver": "^1.9.2", | ||
"pirates": "^4.0.6", | ||
"tslib": "^2.6.2" | ||
"tslib": "^2.6.3" | ||
}, | ||
@@ -56,8 +57,8 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@swc/core": "^1.4.17", | ||
"@swc/core": "^1.6.6", | ||
"@swc/helpers": "^0.5.11", | ||
"@types/debug": "^4.1.12", | ||
"lodash": "^4.17.21", | ||
"sinon": "^17.0.1", | ||
"typescript": "^5.4.5" | ||
"sinon": "^18.0.0", | ||
"typescript": "^5.5.3" | ||
}, | ||
@@ -85,3 +86,3 @@ "funding": { | ||
}, | ||
"gitHead": "9644be5577f77aa53f974636fac4bc38f77148ce" | ||
"gitHead": "3586b0ad22fe69514707103540edfd7e16894ba7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
116287
733
9
12
+ Addedoxc-resolver@^1.9.2
+ Added@emnapi/core@1.2.0(transitive)
+ Added@emnapi/runtime@1.2.0(transitive)
+ Added@emnapi/wasi-threads@1.0.1(transitive)
+ Added@napi-rs/wasm-runtime@0.2.4(transitive)
+ Added@oxc-resolver/binding-darwin-arm64@1.11.0(transitive)
+ Added@oxc-resolver/binding-darwin-x64@1.11.0(transitive)
+ Added@oxc-resolver/binding-freebsd-x64@1.11.0(transitive)
+ Added@oxc-resolver/binding-linux-arm-gnueabihf@1.11.0(transitive)
+ Added@oxc-resolver/binding-linux-arm64-gnu@1.11.0(transitive)
+ Added@oxc-resolver/binding-linux-arm64-musl@1.11.0(transitive)
+ Added@oxc-resolver/binding-linux-x64-gnu@1.11.0(transitive)
+ Added@oxc-resolver/binding-linux-x64-musl@1.11.0(transitive)
+ Added@oxc-resolver/binding-wasm32-wasi@1.11.0(transitive)
+ Added@oxc-resolver/binding-win32-arm64-msvc@1.11.0(transitive)
+ Added@oxc-resolver/binding-win32-x64-msvc@1.11.0(transitive)
+ Added@tybys/wasm-util@0.9.0(transitive)
+ Addedoxc-resolver@1.11.0(transitive)
Updated@swc-node/core@^1.13.2
Updateddebug@^4.3.5
Updatedtslib@^2.6.3