Comparing version 0.1.57 to 0.1.58
@@ -130,3 +130,3 @@ "use strict"; | ||
}); | ||
describe("slitCompilableAndCopyable", ()=>{ | ||
describe("splitCompilableAndCopyable", ()=>{ | ||
const extensions = [ | ||
@@ -140,3 +140,3 @@ ".ts" | ||
]; | ||
const [compilable, copyable] = (0, _sources).slitCompilableAndCopyable(files, extensions, true); | ||
const [compilable, copyable] = (0, _sources).splitCompilableAndCopyable(files, extensions, true); | ||
expect(compilable).toEqual([ | ||
@@ -154,3 +154,3 @@ "test.ts" | ||
]; | ||
const [compilable, copyable] = (0, _sources).slitCompilableAndCopyable(files, extensions, false); | ||
const [compilable, copyable] = (0, _sources).splitCompilableAndCopyable(files, extensions, false); | ||
expect(compilable).toEqual([ | ||
@@ -157,0 +157,0 @@ "test.ts" |
@@ -87,3 +87,3 @@ "use strict"; | ||
const sourceFiles = await (0, _sources).globSources(filenames, includeDotfiles); | ||
const [compilable, copyable] = (0, _sources).slitCompilableAndCopyable(sourceFiles, extensions, copyFiles); | ||
const [compilable, copyable] = (0, _sources).splitCompilableAndCopyable(sourceFiles, extensions, copyFiles); | ||
if (sync) { | ||
@@ -189,2 +189,7 @@ for (const filename of compilable){ | ||
await unlink(getDest(filename, outDir, ".js")); | ||
const sourcemapPath = getDest(filename, outDir, ".js.map"); | ||
const sourcemapExists = await (0, _util).exists(sourcemapPath); | ||
if (sourcemapExists) { | ||
await unlink(sourcemapPath); | ||
} | ||
} else if (copyFiles) { | ||
@@ -191,0 +196,0 @@ await unlink(getDest(filename, outDir)); |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.isCompilableExtension = isCompilableExtension; | ||
exports.slitCompilableAndCopyable = slitCompilableAndCopyable; | ||
exports.splitCompilableAndCopyable = splitCompilableAndCopyable; | ||
exports.requireChokidar = requireChokidar; | ||
@@ -72,3 +72,3 @@ exports.watchSources = watchSources; | ||
} | ||
function slitCompilableAndCopyable(files, allowedExtension, copyFiles) { | ||
function splitCompilableAndCopyable(files, allowedExtension, copyFiles) { | ||
const compilable = []; | ||
@@ -75,0 +75,0 @@ const copyable = []; |
@@ -5,2 +5,3 @@ "use strict"; | ||
}); | ||
exports.exists = exists; | ||
exports.transform = transform; | ||
@@ -40,2 +41,11 @@ exports.compile = compile; | ||
} | ||
async function exists(path) { | ||
let pathExists = true; | ||
try { | ||
await _fs.promises.access(path); | ||
} catch (err) { | ||
pathExists = false; | ||
} | ||
return pathExists; | ||
} | ||
async function transform(filename, code, opts, sync, outputPath) { | ||
@@ -42,0 +52,0 @@ opts = { |
{ | ||
"name": "@swc/cli", | ||
"version": "0.1.57", | ||
"version": "0.1.58", | ||
"description": "CLI for the swc project", | ||
"main": "lib/swc/index.js", | ||
"scripts": { | ||
"postinstall": "echo \"Beta version of @swc/cli is now available via 'swcx' command. This'll be a default command for @swc/cli@1. Please give it a try and let us know if there are problems!\"", | ||
"prepublishOnly": "yarn build && yarn test && yarn types", | ||
@@ -45,7 +46,10 @@ "types": "tsc", | ||
"swc": "./bin/swc.js", | ||
"swcx": "./bin/swcx.js", | ||
"spack": "./bin/spack.js" | ||
}, | ||
"dependencies": { | ||
"bin-wrapper": "^4.1.0", | ||
"commander": "^7.1.0", | ||
"fast-glob": "^3.2.5", | ||
"semver": "^7.3.8", | ||
"slash": "3.0.0", | ||
@@ -60,2 +64,3 @@ "source-map": "^0.7.3" | ||
"@types/node": "^12.19.16", | ||
"@types/semver": "^7.3.13", | ||
"chokidar": "^3.5.1", | ||
@@ -62,0 +67,0 @@ "deepmerge": "^4.2.2", |
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
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
195326
35
1860
8
14
1
12
1
+ Addedbin-wrapper@^4.1.0
+ Addedsemver@^7.3.8
+ Added@sindresorhus/is@0.7.0(transitive)
+ Addedarch@2.2.0(transitive)
+ Addedarchive-type@4.0.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbin-check@4.1.0(transitive)
+ Addedbin-version@3.1.0(transitive)
+ Addedbin-version-check@4.0.0(transitive)
+ Addedbin-wrapper@4.1.0(transitive)
+ Addedbl@1.2.3(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedbuffer-alloc@1.2.0(transitive)
+ Addedbuffer-alloc-unsafe@1.1.0(transitive)
+ Addedbuffer-crc32@0.2.13(transitive)
+ Addedbuffer-fill@1.0.0(transitive)
+ Addedcacheable-request@2.1.4(transitive)
+ Addedcaw@2.0.1(transitive)
+ Addedclone-response@1.0.2(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedconfig-chain@1.1.13(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcross-spawn@5.1.06.0.5(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddecompress@4.2.1(transitive)
+ Addeddecompress-response@3.3.0(transitive)
+ Addeddecompress-tar@4.1.1(transitive)
+ Addeddecompress-tarbz2@4.1.1(transitive)
+ Addeddecompress-targz@4.1.1(transitive)
+ Addeddecompress-unzip@4.0.1(transitive)
+ Addeddownload@7.1.0(transitive)
+ Addedduplexer3@0.1.5(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedexeca@0.7.01.0.0(transitive)
+ Addedexecutable@4.1.1(transitive)
+ Addedext-list@2.2.2(transitive)
+ Addedext-name@5.0.0(transitive)
+ Addedfd-slicer@1.1.0(transitive)
+ Addedfile-type@3.9.04.4.05.2.06.2.08.1.0(transitive)
+ Addedfilename-reserved-regex@2.0.0(transitive)
+ Addedfilenamify@2.1.0(transitive)
+ Addedfind-versions@3.2.0(transitive)
+ Addedfrom2@2.3.0(transitive)
+ Addedfs-constants@1.0.0(transitive)
+ Addedget-proxy@2.1.0(transitive)
+ Addedget-stream@2.3.13.0.04.1.0(transitive)
+ Addedgot@8.3.2(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-symbol-support-x@1.4.2(transitive)
+ Addedhas-to-string-tag-x@1.4.1(transitive)
+ Addedhttp-cache-semantics@3.8.1(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedimport-lazy@3.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedini@1.3.8(transitive)
+ Addedinto-stream@3.1.0(transitive)
+ Addedis-natural-number@4.0.1(transitive)
+ Addedis-object@1.0.2(transitive)
+ Addedis-plain-obj@1.1.0(transitive)
+ Addedis-retry-allowed@1.2.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisurl@1.0.0(transitive)
+ Addedjson-buffer@3.0.0(transitive)
+ Addedkeyv@3.0.0(transitive)
+ Addedlowercase-keys@1.0.01.0.1(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmake-dir@1.3.0(transitive)
+ Addedmime-db@1.53.0(transitive)
+ Addedmimic-response@1.0.1(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addednormalize-url@2.0.1(transitive)
+ Addednpm-conf@1.1.3(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-filter-obj@2.0.0(transitive)
+ Addedp-cancelable@0.4.1(transitive)
+ Addedp-event@2.3.1(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-is-promise@1.1.0(transitive)
+ Addedp-timeout@2.0.1(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpend@1.2.0(transitive)
+ Addedpify@2.3.03.0.04.0.1(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedprepend-http@2.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedproto-list@1.2.4(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedquery-string@5.1.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedresponselike@1.0.2(transitive)
+ Addedsafe-buffer@5.1.25.2.1(transitive)
+ Addedseek-bzip@1.0.6(transitive)
+ Addedsemver@5.7.27.6.3(transitive)
+ Addedsemver-regex@2.0.0(transitive)
+ Addedsemver-truncate@1.1.2(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsort-keys@1.1.22.0.0(transitive)
+ Addedsort-keys-length@1.0.1(transitive)
+ Addedstrict-uri-encode@1.1.0(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-dirs@2.1.0(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedstrip-outer@1.0.1(transitive)
+ Addedtar-stream@1.6.2(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtimed-out@4.0.1(transitive)
+ Addedto-buffer@1.1.1(transitive)
+ Addedtrim-repeated@1.0.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedunbzip2-stream@1.4.3(transitive)
+ Addedurl-parse-lax@3.0.0(transitive)
+ Addedurl-to-options@1.0.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedxtend@4.0.2(transitive)
+ Addedyallist@2.1.2(transitive)
+ Addedyauzl@2.10.0(transitive)