ts-swc-transform 1.9.7 → 1.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -94,7 +94,7 @@ function transformDirectoryWorker(src, dest, type, options, callback) {
|
|
|
94
94
|
});
|
|
95
95
|
var queue = new _queuecb.default();
|
|
96
96
|
entries.forEach(function(entry) {
|
|
97
|
-
|
|
97
|
+
queue.defer(function(cb) {
|
|
98
98
|
return (0, _transformFile.default)(entry.fullPath, _path.default.dirname(_path.default.join(dest, entry.path)), type, options, function(err, to) {
|
|
99
99
|
if (err) return cb(err);
|
|
100
100
|
results.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/workers/transformDirectory.ts"],"sourcesContent":["import path from 'path';\nimport Iterator from 'fs-iterator';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport { SKIPS, typeFileRegEx } from '../constants.js';\nimport createMatcher from '../createMatcher.js';\nimport transformFile from './transformFile.js';\n\nexport default function transformDirectoryWorker(src, dest, type, options, callback) {\n const tsconfig = options.tsconfig;\n const matcher = createMatcher(tsconfig);\n\n rimraf2(dest, { disableGlob: true }, () => {\n const entries = [];\n const iterator = new Iterator(src);\n iterator.forEach(\n (entry) => {\n if (!entry.stats.isFile()) return;\n if (!matcher(entry.fullPath)) return;\n if (typeFileRegEx.test(entry.basename)) return;\n if (SKIPS.indexOf(entry.basename) >= 0) return;\n entries.push(entry);\n },\n (err) => {\n if (err) return callback(err);\n const results = [];\n options = { ...options, tsconfig };\n\n const queue = new Queue();\n entries.forEach((entry)
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/workers/transformDirectory.ts"],"sourcesContent":["import path from 'path';\nimport Iterator from 'fs-iterator';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport { SKIPS, typeFileRegEx } from '../constants.js';\nimport createMatcher from '../createMatcher.js';\nimport transformFile from './transformFile.js';\n\nexport default function transformDirectoryWorker(src, dest, type, options, callback) {\n const tsconfig = options.tsconfig;\n const matcher = createMatcher(tsconfig);\n\n rimraf2(dest, { disableGlob: true }, () => {\n const entries = [];\n const iterator = new Iterator(src);\n iterator.forEach(\n (entry) => {\n if (!entry.stats.isFile()) return;\n if (!matcher(entry.fullPath)) return;\n if (typeFileRegEx.test(entry.basename)) return;\n if (SKIPS.indexOf(entry.basename) >= 0) return;\n entries.push(entry);\n },\n (err) => {\n if (err) return callback(err);\n const results = [];\n options = { ...options, tsconfig };\n\n const queue = new Queue();\n entries.forEach((entry) => {\n queue.defer((cb) =>\n transformFile(entry.fullPath, path.dirname(path.join(dest, entry.path)), type, options, (err, to) => {\n if (err) return cb(err);\n results.push({ from: entry, to: path.join(path.relative(src, path.dirname(entry.fullPath)), to) });\n if (options.sourceMaps) results.push({ from: entry, to: `${path.join(path.relative(src, path.dirname(entry.fullPath)), to)}.map` });\n cb();\n })\n );\n });\n queue.await((err) => (err ? callback(err) : callback(null, results)));\n }\n );\n });\n}\n"],"names":["transformDirectoryWorker","src","dest","type","options","callback","tsconfig","matcher","createMatcher","rimraf2","disableGlob","entries","iterator","Iterator","forEach","entry","stats","isFile","fullPath","typeFileRegEx","test","basename","SKIPS","indexOf","push","err","results","queue","Queue","defer","cb","transformFile","path","dirname","join","to","from","relative","sourceMaps","await"],"mappings":";;;;+BASA;;;eAAwBA;;;2DATP;iEACI;8DACH;8DACE;yBAEiB;oEACX;oEACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEX,SAASA,yBAAyBC,GAAG,EAAEC,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACjF,IAAMC,WAAWF,QAAQE,QAAQ;IACjC,IAAMC,UAAUC,IAAAA,sBAAa,EAACF;IAE9BG,IAAAA,gBAAO,EAACP,MAAM;QAAEQ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ACd;uBAASA,MAAMpB,SAASoB,OAAOpB,SAAS,MAAMqB;;QAC7D;IAEJ;AACF"}
|
|
@@ -27,7 +27,8 @@ export default function transformDirectoryWorker(src, dest, type, options, callb
|
|
|
27
27
|
tsconfig
|
|
28
28
|
};
|
|
29
29
|
const queue = new Queue();
|
|
30
|
-
entries.forEach((entry)=>
|
|
30
|
+
entries.forEach((entry)=>{
|
|
31
|
+
queue.defer((cb)=>transformFile(entry.fullPath, path.dirname(path.join(dest, entry.path)), type, options, (err, to)=>{
|
|
31
32
|
if (err) return cb(err);
|
|
32
33
|
results.push({
|
|
33
34
|
from: entry,
|
|
@@ -38,7 +39,8 @@ export default function transformDirectoryWorker(src, dest, type, options, callb
|
|
|
38
39
|
to: `${path.join(path.relative(src, path.dirname(entry.fullPath)), to)}.map`
|
|
39
40
|
});
|
|
40
41
|
cb();
|
|
41
|
-
}))
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
42
44
|
queue.await((err)=>err ? callback(err) : callback(null, results));
|
|
43
45
|
});
|
|
44
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/workers/transformDirectory.ts"],"sourcesContent":["import path from 'path';\nimport Iterator from 'fs-iterator';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport { SKIPS, typeFileRegEx } from '../constants.js';\nimport createMatcher from '../createMatcher.js';\nimport transformFile from './transformFile.js';\n\nexport default function transformDirectoryWorker(src, dest, type, options, callback) {\n const tsconfig = options.tsconfig;\n const matcher = createMatcher(tsconfig);\n\n rimraf2(dest, { disableGlob: true }, () => {\n const entries = [];\n const iterator = new Iterator(src);\n iterator.forEach(\n (entry) => {\n if (!entry.stats.isFile()) return;\n if (!matcher(entry.fullPath)) return;\n if (typeFileRegEx.test(entry.basename)) return;\n if (SKIPS.indexOf(entry.basename) >= 0) return;\n entries.push(entry);\n },\n (err) => {\n if (err) return callback(err);\n const results = [];\n options = { ...options, tsconfig };\n\n const queue = new Queue();\n entries.forEach((entry)
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/workers/transformDirectory.ts"],"sourcesContent":["import path from 'path';\nimport Iterator from 'fs-iterator';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport { SKIPS, typeFileRegEx } from '../constants.js';\nimport createMatcher from '../createMatcher.js';\nimport transformFile from './transformFile.js';\n\nexport default function transformDirectoryWorker(src, dest, type, options, callback) {\n const tsconfig = options.tsconfig;\n const matcher = createMatcher(tsconfig);\n\n rimraf2(dest, { disableGlob: true }, () => {\n const entries = [];\n const iterator = new Iterator(src);\n iterator.forEach(\n (entry) => {\n if (!entry.stats.isFile()) return;\n if (!matcher(entry.fullPath)) return;\n if (typeFileRegEx.test(entry.basename)) return;\n if (SKIPS.indexOf(entry.basename) >= 0) return;\n entries.push(entry);\n },\n (err) => {\n if (err) return callback(err);\n const results = [];\n options = { ...options, tsconfig };\n\n const queue = new Queue();\n entries.forEach((entry) => {\n queue.defer((cb) =>\n transformFile(entry.fullPath, path.dirname(path.join(dest, entry.path)), type, options, (err, to) => {\n if (err) return cb(err);\n results.push({ from: entry, to: path.join(path.relative(src, path.dirname(entry.fullPath)), to) });\n if (options.sourceMaps) results.push({ from: entry, to: `${path.join(path.relative(src, path.dirname(entry.fullPath)), to)}.map` });\n cb();\n })\n );\n });\n queue.await((err) => (err ? callback(err) : callback(null, results)));\n }\n );\n });\n}\n"],"names":["path","Iterator","Queue","rimraf2","SKIPS","typeFileRegEx","createMatcher","transformFile","transformDirectoryWorker","src","dest","type","options","callback","tsconfig","matcher","disableGlob","entries","iterator","forEach","entry","stats","isFile","fullPath","test","basename","indexOf","push","err","results","queue","defer","cb","dirname","join","to","from","relative","sourceMaps","await"],"mappings":"AAAA,OAAOA,UAAU,OAAO;AACxB,OAAOC,cAAc,cAAc;AACnC,OAAOC,WAAW,WAAW;AAC7B,OAAOC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UAAU,EAAET,QAAQF,IAAI,CAAC;4BAAES,MAAMhB;4BAAOe,IAAI,GAAGnC,KAAKkC,IAAI,CAAClC,KAAKqC,QAAQ,CAAC5B,KAAKT,KAAKiC,OAAO,CAACb,MAAMG,QAAQ,IAAIY,IAAI,IAAI,CAAC;wBAAC;wBACjIH;oBACF;YAEJ;YACAF,MAAMS,KAAK,CAAC,CAACX,MAASA,MAAMf,SAASe,OAAOf,SAAS,MAAMgB;QAC7D;IAEJ;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-swc-transform",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.9",
|
|
4
4
|
"description": "Typescript transformers for swc. Supports Node >= 0.8",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"matcher",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@swc/core": "*",
|
|
53
|
-
"cross-spawn-cb": "^1.5.
|
|
53
|
+
"cross-spawn-cb": "^1.5.8",
|
|
54
54
|
"exit": "^0.1.2",
|
|
55
55
|
"fs-iterator": "^5.2.1",
|
|
56
56
|
"get-tsconfig-compat": "^2.0.3",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"lazy-cache": "^2.0.2",
|
|
60
60
|
"minimatch": "^3.1.2",
|
|
61
61
|
"mkdirp-classic": "^0.5.3",
|
|
62
|
-
"node-version-call": "^1.4.
|
|
62
|
+
"node-version-call": "^1.4.2",
|
|
63
63
|
"path-posix": "^1.0.0",
|
|
64
64
|
"queue-cb": "^1.4.4",
|
|
65
65
|
"resolve": "^1.22.10",
|