ts-swc-transform 2.4.0 → 2.4.1

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.
@@ -20,9 +20,9 @@ function createMatcher(tsconfig) {
20
20
  var tsconfigPath = _pathposix.default.dirname((0, _unixify.default)(tsconfig.path));
21
21
  function matchFn(condition) {
22
22
  var pattern = (0, _unixify.default)(condition);
23
- if (!_pathposix.default.isAbsolute(pattern) && !pattern.startsWith('*')) pattern = _pathposix.default.join(tsconfigPath, pattern);
23
+ if (!_pathposix.default.isAbsolute(pattern) && pattern.indexOf('*') !== 0) pattern = _pathposix.default.join(tsconfigPath, pattern);
24
24
  return function match(filePath) {
25
- return filePath.startsWith(pattern) || (0, _minimatch.default)(filePath, pattern);
25
+ return filePath.indexOf(pattern) === 0 || (0, _minimatch.default)(filePath, pattern);
26
26
  };
27
27
  }
28
28
  var includes = (tsconfig.config.include || []).map(matchFn);
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/createMatcher.ts"],"sourcesContent":["import minimatch from 'minimatch';\nimport path from 'path-posix';\nimport unixify from 'unixify';\nimport type { Matcher, TSConfig } from './types.ts';\n\nexport default function createMatcher(tsconfig: TSConfig): Matcher {\n const tsconfigPath = path.dirname(unixify(tsconfig.path));\n\n function matchFn(condition) {\n let pattern = unixify(condition);\n if (!path.isAbsolute(pattern) && !pattern.startsWith('*')) pattern = path.join(tsconfigPath, pattern);\n\n return function match(filePath) {\n return filePath.startsWith(pattern) || minimatch(filePath, pattern);\n };\n }\n\n const includes = ((tsconfig.config.include as string[]) || []).map(matchFn);\n const excludes = ((tsconfig.config.exclude as string[]) || []).map(matchFn);\n\n return function matcher(filePath) {\n if (filePath.endsWith('.json')) return false;\n\n filePath = unixify(filePath);\n for (let i = 0; i < excludes.length; ++i) {\n if (excludes[i](filePath)) return false;\n }\n for (let j = 0; j < includes.length; ++j) {\n if (includes[j](filePath)) return true;\n }\n return !includes.length;\n };\n}\n"],"names":["createMatcher","tsconfig","tsconfigPath","path","dirname","unixify","matchFn","condition","pattern","isAbsolute","startsWith","join","match","filePath","minimatch","includes","config","include","map","excludes","exclude","matcher","endsWith","i","length","j"],"mappings":";;;;+BAKA;;;eAAwBA;;;gEALF;gEACL;8DACG;;;;;;AAGL,SAASA,cAAcC,QAAkB;IACtD,IAAMC,eAAeC,kBAAI,CAACC,OAAO,CAACC,IAAAA,gBAAO,EAACJ,SAASE,IAAI;IAEvD,SAASG,QAAQC,SAAS;QACxB,IAAIC,UAAUH,IAAAA,gBAAO,EAACE;QACtB,IAAI,CAACJ,kBAAI,CAACM,UAAU,CAACD,YAAY,CAACA,QAAQE,UAAU,CAAC,MAAMF,UAAUL,kBAAI,CAACQ,IAAI,CAACT,cAAcM;QAE7F,OAAO,SAASI,MAAMC,QAAQ;YAC5B,OAAOA,SAASH,UAAU,CAACF,YAAYM,IAAAA,kBAAS,EAACD,UAAUL;QAC7D;IACF;IAEA,IAAMO,WAAW,AAAC,CAAA,AAACd,SAASe,MAAM,CAACC,OAAO,IAAiB,EAAE,AAAD,EAAGC,GAAG,CAACZ;IACnE,IAAMa,WAAW,AAAC,CAAA,AAAClB,SAASe,MAAM,CAACI,OAAO,IAAiB,EAAE,AAAD,EAAGF,GAAG,CAACZ;IAEnE,OAAO,SAASe,QAAQR,QAAQ;QAC9B,IAAIA,SAASS,QAAQ,CAAC,UAAU,OAAO;QAEvCT,WAAWR,IAAAA,gBAAO,EAACQ;QACnB,IAAK,IAAIU,IAAI,GAAGA,IAAIJ,SAASK,MAAM,EAAE,EAAED,EAAG;YACxC,IAAIJ,QAAQ,CAACI,EAAE,CAACV,WAAW,OAAO;QACpC;QACA,IAAK,IAAIY,IAAI,GAAGA,IAAIV,SAASS,MAAM,EAAE,EAAEC,EAAG;YACxC,IAAIV,QAAQ,CAACU,EAAE,CAACZ,WAAW,OAAO;QACpC;QACA,OAAO,CAACE,SAASS,MAAM;IACzB;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/createMatcher.ts"],"sourcesContent":["import minimatch from 'minimatch';\nimport path from 'path-posix';\nimport unixify from 'unixify';\nimport type { Matcher, TSConfig } from './types.ts';\n\nexport default function createMatcher(tsconfig: TSConfig): Matcher {\n const tsconfigPath = path.dirname(unixify(tsconfig.path));\n\n function matchFn(condition) {\n let pattern = unixify(condition);\n if (!path.isAbsolute(pattern) && pattern.indexOf('*') !== 0) pattern = path.join(tsconfigPath, pattern);\n\n return function match(filePath) {\n return filePath.indexOf(pattern) === 0 || minimatch(filePath, pattern);\n };\n }\n\n const includes = ((tsconfig.config.include as string[]) || []).map(matchFn);\n const excludes = ((tsconfig.config.exclude as string[]) || []).map(matchFn);\n\n return function matcher(filePath) {\n if (filePath.endsWith('.json')) return false;\n\n filePath = unixify(filePath);\n for (let i = 0; i < excludes.length; ++i) {\n if (excludes[i](filePath)) return false;\n }\n for (let j = 0; j < includes.length; ++j) {\n if (includes[j](filePath)) return true;\n }\n return !includes.length;\n };\n}\n"],"names":["createMatcher","tsconfig","tsconfigPath","path","dirname","unixify","matchFn","condition","pattern","isAbsolute","indexOf","join","match","filePath","minimatch","includes","config","include","map","excludes","exclude","matcher","endsWith","i","length","j"],"mappings":";;;;+BAKA;;;eAAwBA;;;gEALF;gEACL;8DACG;;;;;;AAGL,SAASA,cAAcC,QAAkB;IACtD,IAAMC,eAAeC,kBAAI,CAACC,OAAO,CAACC,IAAAA,gBAAO,EAACJ,SAASE,IAAI;IAEvD,SAASG,QAAQC,SAAS;QACxB,IAAIC,UAAUH,IAAAA,gBAAO,EAACE;QACtB,IAAI,CAACJ,kBAAI,CAACM,UAAU,CAACD,YAAYA,QAAQE,OAAO,CAAC,SAAS,GAAGF,UAAUL,kBAAI,CAACQ,IAAI,CAACT,cAAcM;QAE/F,OAAO,SAASI,MAAMC,QAAQ;YAC5B,OAAOA,SAASH,OAAO,CAACF,aAAa,KAAKM,IAAAA,kBAAS,EAACD,UAAUL;QAChE;IACF;IAEA,IAAMO,WAAW,AAAC,CAAA,AAACd,SAASe,MAAM,CAACC,OAAO,IAAiB,EAAE,AAAD,EAAGC,GAAG,CAACZ;IACnE,IAAMa,WAAW,AAAC,CAAA,AAAClB,SAASe,MAAM,CAACI,OAAO,IAAiB,EAAE,AAAD,EAAGF,GAAG,CAACZ;IAEnE,OAAO,SAASe,QAAQR,QAAQ;QAC9B,IAAIA,SAASS,QAAQ,CAAC,UAAU,OAAO;QAEvCT,WAAWR,IAAAA,gBAAO,EAACQ;QACnB,IAAK,IAAIU,IAAI,GAAGA,IAAIJ,SAASK,MAAM,EAAE,EAAED,EAAG;YACxC,IAAIJ,QAAQ,CAACI,EAAE,CAACV,WAAW,OAAO;QACpC;QACA,IAAK,IAAIY,IAAI,GAAGA,IAAIV,SAASS,MAAM,EAAE,EAAEC,EAAG;YACxC,IAAIV,QAAQ,CAACU,EAAE,CAACZ,WAAW,OAAO;QACpC;QACA,OAAO,CAACE,SAASS,MAAM;IACzB;AACF"}
@@ -70,7 +70,7 @@ function getParentPath(context) {
70
70
  return context.parentURL ? _path.default.dirname(toPath(context.parentURL)) : process.cwd();
71
71
  }
72
72
  function toPath(specifier, context) {
73
- if (specifier.startsWith('file:')) return fileURLToPath(specifier);
73
+ if (specifier.indexOf('file:') === 0) return fileURLToPath(specifier);
74
74
  if ((0, _isabsolute.default)(specifier)) return specifier;
75
75
  if (specifier[0] === '.') {
76
76
  var parentPath = context ? getParentPath(context) : process.cwd();
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/toPath.ts"],"sourcesContent":["import isAbsolute from 'is-absolute';\nimport module from 'module';\nimport path from 'path';\nimport resolveCJS from 'resolve';\nimport url from 'url';\nimport { moduleRegEx } from './constants.ts';\nimport importMetaResolve from './lib/import-meta-resolve.ts';\nimport * as urlPolyfills from './lib/urlFileUrl.ts';\nimport type { Context } from './types.ts';\n\nconst useCJS = !module.createRequire;\nconst fileURLToPath = url.fileURLToPath || urlPolyfills.fileURLToPath;\nconst pathToFileURL = url.pathToFileURL || urlPolyfills.pathToFileURL;\n\nfunction getParentPath(context: Context): string {\n if (context.parentPath) return path.dirname(context.parentPath);\n return context.parentURL ? path.dirname(toPath(context.parentURL)) : process.cwd();\n}\n\nexport default function toPath(specifier: string, context?: Context): string {\n if (specifier.startsWith('file:')) return fileURLToPath(specifier);\n if (isAbsolute(specifier)) return specifier;\n if (specifier[0] === '.') {\n const parentPath = context ? getParentPath(context) : process.cwd();\n return path.join(parentPath, specifier);\n }\n if (moduleRegEx.test(specifier)) {\n const parentPath = context ? getParentPath(context) : process.cwd();\n if (!useCJS) {\n try {\n const entryURL = importMetaResolve(specifier, pathToFileURL(parentPath));\n if (entryURL) return fileURLToPath(entryURL);\n } catch (_) {\n /* it may fail due to commonjs edge cases */\n }\n }\n const entryPath = resolveCJS.sync(specifier, {\n basedir: parentPath,\n extensions: ['.js', '.json', '.node', '.mjs'],\n });\n if (entryPath) return entryPath;\n }\n\n return specifier;\n}\n"],"names":["toPath","useCJS","module","createRequire","fileURLToPath","url","urlPolyfills","pathToFileURL","getParentPath","context","parentPath","path","dirname","parentURL","process","cwd","specifier","startsWith","isAbsolute","join","moduleRegEx","test","entryURL","importMetaResolve","_","entryPath","resolveCJS","sync","basedir","extensions"],"mappings":";;;;+BAmBA;;;eAAwBA;;;iEAnBD;6DACJ;2DACF;8DACM;0DACP;2BACY;0EACE;oEACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG9B,IAAMC,SAAS,CAACC,eAAM,CAACC,aAAa;AACpC,IAAMC,gBAAgBC,YAAG,CAACD,aAAa,IAAIE,cAAaF,aAAa;AACrE,IAAMG,gBAAgBF,YAAG,CAACE,aAAa,IAAID,cAAaC,aAAa;AAErE,SAASC,cAAcC,OAAgB;IACrC,IAAIA,QAAQC,UAAU,EAAE,OAAOC,aAAI,CAACC,OAAO,CAACH,QAAQC,UAAU;IAC9D,OAAOD,QAAQI,SAAS,GAAGF,aAAI,CAACC,OAAO,CAACZ,OAAOS,QAAQI,SAAS,KAAKC,QAAQC,GAAG;AAClF;AAEe,SAASf,OAAOgB,SAAiB,EAAEP,OAAiB;IACjE,IAAIO,UAAUC,UAAU,CAAC,UAAU,OAAOb,cAAcY;IACxD,IAAIE,IAAAA,mBAAU,EAACF,YAAY,OAAOA;IAClC,IAAIA,SAAS,CAAC,EAAE,KAAK,KAAK;QACxB,IAAMN,aAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,OAAOJ,aAAI,CAACQ,IAAI,CAACT,YAAYM;IAC/B;IACA,IAAII,wBAAW,CAACC,IAAI,CAACL,YAAY;QAC/B,IAAMN,cAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,IAAI,CAACd,QAAQ;YACX,IAAI;gBACF,IAAMqB,WAAWC,IAAAA,4BAAiB,EAACP,WAAWT,cAAcG;gBAC5D,IAAIY,UAAU,OAAOlB,cAAckB;YACrC,EAAE,OAAOE,GAAG;YACV,0CAA0C,GAC5C;QACF;QACA,IAAMC,YAAYC,gBAAU,CAACC,IAAI,CAACX,WAAW;YAC3CY,SAASlB;YACTmB,YAAY;gBAAC;gBAAO;gBAAS;gBAAS;aAAO;QAC/C;QACA,IAAIJ,WAAW,OAAOA;IACxB;IAEA,OAAOT;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/toPath.ts"],"sourcesContent":["import isAbsolute from 'is-absolute';\nimport module from 'module';\nimport path from 'path';\nimport resolveCJS from 'resolve';\nimport url from 'url';\nimport { moduleRegEx } from './constants.ts';\nimport importMetaResolve from './lib/import-meta-resolve.ts';\nimport * as urlPolyfills from './lib/urlFileUrl.ts';\nimport type { Context } from './types.ts';\n\nconst useCJS = !module.createRequire;\nconst fileURLToPath = url.fileURLToPath || urlPolyfills.fileURLToPath;\nconst pathToFileURL = url.pathToFileURL || urlPolyfills.pathToFileURL;\n\nfunction getParentPath(context: Context): string {\n if (context.parentPath) return path.dirname(context.parentPath);\n return context.parentURL ? path.dirname(toPath(context.parentURL)) : process.cwd();\n}\n\nexport default function toPath(specifier: string, context?: Context): string {\n if (specifier.indexOf('file:') === 0) return fileURLToPath(specifier);\n if (isAbsolute(specifier)) return specifier;\n if (specifier[0] === '.') {\n const parentPath = context ? getParentPath(context) : process.cwd();\n return path.join(parentPath, specifier);\n }\n if (moduleRegEx.test(specifier)) {\n const parentPath = context ? getParentPath(context) : process.cwd();\n if (!useCJS) {\n try {\n const entryURL = importMetaResolve(specifier, pathToFileURL(parentPath));\n if (entryURL) return fileURLToPath(entryURL);\n } catch (_) {\n /* it may fail due to commonjs edge cases */\n }\n }\n const entryPath = resolveCJS.sync(specifier, {\n basedir: parentPath,\n extensions: ['.js', '.json', '.node', '.mjs'],\n });\n if (entryPath) return entryPath;\n }\n\n return specifier;\n}\n"],"names":["toPath","useCJS","module","createRequire","fileURLToPath","url","urlPolyfills","pathToFileURL","getParentPath","context","parentPath","path","dirname","parentURL","process","cwd","specifier","indexOf","isAbsolute","join","moduleRegEx","test","entryURL","importMetaResolve","_","entryPath","resolveCJS","sync","basedir","extensions"],"mappings":";;;;+BAmBA;;;eAAwBA;;;iEAnBD;6DACJ;2DACF;8DACM;0DACP;2BACY;0EACE;oEACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG9B,IAAMC,SAAS,CAACC,eAAM,CAACC,aAAa;AACpC,IAAMC,gBAAgBC,YAAG,CAACD,aAAa,IAAIE,cAAaF,aAAa;AACrE,IAAMG,gBAAgBF,YAAG,CAACE,aAAa,IAAID,cAAaC,aAAa;AAErE,SAASC,cAAcC,OAAgB;IACrC,IAAIA,QAAQC,UAAU,EAAE,OAAOC,aAAI,CAACC,OAAO,CAACH,QAAQC,UAAU;IAC9D,OAAOD,QAAQI,SAAS,GAAGF,aAAI,CAACC,OAAO,CAACZ,OAAOS,QAAQI,SAAS,KAAKC,QAAQC,GAAG;AAClF;AAEe,SAASf,OAAOgB,SAAiB,EAAEP,OAAiB;IACjE,IAAIO,UAAUC,OAAO,CAAC,aAAa,GAAG,OAAOb,cAAcY;IAC3D,IAAIE,IAAAA,mBAAU,EAACF,YAAY,OAAOA;IAClC,IAAIA,SAAS,CAAC,EAAE,KAAK,KAAK;QACxB,IAAMN,aAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,OAAOJ,aAAI,CAACQ,IAAI,CAACT,YAAYM;IAC/B;IACA,IAAII,wBAAW,CAACC,IAAI,CAACL,YAAY;QAC/B,IAAMN,cAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,IAAI,CAACd,QAAQ;YACX,IAAI;gBACF,IAAMqB,WAAWC,IAAAA,4BAAiB,EAACP,WAAWT,cAAcG;gBAC5D,IAAIY,UAAU,OAAOlB,cAAckB;YACrC,EAAE,OAAOE,GAAG;YACV,0CAA0C,GAC5C;QACF;QACA,IAAMC,YAAYC,gBAAU,CAACC,IAAI,CAACX,WAAW;YAC3CY,SAASlB;YACTmB,YAAY;gBAAC;gBAAO;gBAAS;gBAAS;aAAO;QAC/C;QACA,IAAIJ,WAAW,OAAOA;IACxB;IAEA,OAAOT;AACT"}
@@ -5,9 +5,9 @@ export default function createMatcher(tsconfig) {
5
5
  const tsconfigPath = path.dirname(unixify(tsconfig.path));
6
6
  function matchFn(condition) {
7
7
  let pattern = unixify(condition);
8
- if (!path.isAbsolute(pattern) && !pattern.startsWith('*')) pattern = path.join(tsconfigPath, pattern);
8
+ if (!path.isAbsolute(pattern) && pattern.indexOf('*') !== 0) pattern = path.join(tsconfigPath, pattern);
9
9
  return function match(filePath) {
10
- return filePath.startsWith(pattern) || minimatch(filePath, pattern);
10
+ return filePath.indexOf(pattern) === 0 || minimatch(filePath, pattern);
11
11
  };
12
12
  }
13
13
  const includes = (tsconfig.config.include || []).map(matchFn);
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/createMatcher.ts"],"sourcesContent":["import minimatch from 'minimatch';\nimport path from 'path-posix';\nimport unixify from 'unixify';\nimport type { Matcher, TSConfig } from './types.ts';\n\nexport default function createMatcher(tsconfig: TSConfig): Matcher {\n const tsconfigPath = path.dirname(unixify(tsconfig.path));\n\n function matchFn(condition) {\n let pattern = unixify(condition);\n if (!path.isAbsolute(pattern) && !pattern.startsWith('*')) pattern = path.join(tsconfigPath, pattern);\n\n return function match(filePath) {\n return filePath.startsWith(pattern) || minimatch(filePath, pattern);\n };\n }\n\n const includes = ((tsconfig.config.include as string[]) || []).map(matchFn);\n const excludes = ((tsconfig.config.exclude as string[]) || []).map(matchFn);\n\n return function matcher(filePath) {\n if (filePath.endsWith('.json')) return false;\n\n filePath = unixify(filePath);\n for (let i = 0; i < excludes.length; ++i) {\n if (excludes[i](filePath)) return false;\n }\n for (let j = 0; j < includes.length; ++j) {\n if (includes[j](filePath)) return true;\n }\n return !includes.length;\n };\n}\n"],"names":["minimatch","path","unixify","createMatcher","tsconfig","tsconfigPath","dirname","matchFn","condition","pattern","isAbsolute","startsWith","join","match","filePath","includes","config","include","map","excludes","exclude","matcher","endsWith","i","length","j"],"mappings":"AAAA,OAAOA,eAAe,YAAY;AAClC,OAAOC,UAAU,aAAa;AAC9B,OAAOC,aAAa,UAAU;AAG9B,eAAe,SAASC,cAAcC,QAAkB;IACtD,MAAMC,eAAeJ,KAAKK,OAAO,CAACJ,QAAQE,SAASH,IAAI;IAEvD,SAASM,QAAQC,SAAS;QACxB,IAAIC,UAAUP,QAAQM;QACtB,IAAI,CAACP,KAAKS,UAAU,CAACD,YAAY,CAACA,QAAQE,UAAU,CAAC,MAAMF,UAAUR,KAAKW,IAAI,CAACP,cAAcI;QAE7F,OAAO,SAASI,MAAMC,QAAQ;YAC5B,OAAOA,SAASH,UAAU,CAACF,YAAYT,UAAUc,UAAUL;QAC7D;IACF;IAEA,MAAMM,WAAW,AAAC,CAAA,AAACX,SAASY,MAAM,CAACC,OAAO,IAAiB,EAAE,AAAD,EAAGC,GAAG,CAACX;IACnE,MAAMY,WAAW,AAAC,CAAA,AAACf,SAASY,MAAM,CAACI,OAAO,IAAiB,EAAE,AAAD,EAAGF,GAAG,CAACX;IAEnE,OAAO,SAASc,QAAQP,QAAQ;QAC9B,IAAIA,SAASQ,QAAQ,CAAC,UAAU,OAAO;QAEvCR,WAAWZ,QAAQY;QACnB,IAAK,IAAIS,IAAI,GAAGA,IAAIJ,SAASK,MAAM,EAAE,EAAED,EAAG;YACxC,IAAIJ,QAAQ,CAACI,EAAE,CAACT,WAAW,OAAO;QACpC;QACA,IAAK,IAAIW,IAAI,GAAGA,IAAIV,SAASS,MAAM,EAAE,EAAEC,EAAG;YACxC,IAAIV,QAAQ,CAACU,EAAE,CAACX,WAAW,OAAO;QACpC;QACA,OAAO,CAACC,SAASS,MAAM;IACzB;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/createMatcher.ts"],"sourcesContent":["import minimatch from 'minimatch';\nimport path from 'path-posix';\nimport unixify from 'unixify';\nimport type { Matcher, TSConfig } from './types.ts';\n\nexport default function createMatcher(tsconfig: TSConfig): Matcher {\n const tsconfigPath = path.dirname(unixify(tsconfig.path));\n\n function matchFn(condition) {\n let pattern = unixify(condition);\n if (!path.isAbsolute(pattern) && pattern.indexOf('*') !== 0) pattern = path.join(tsconfigPath, pattern);\n\n return function match(filePath) {\n return filePath.indexOf(pattern) === 0 || minimatch(filePath, pattern);\n };\n }\n\n const includes = ((tsconfig.config.include as string[]) || []).map(matchFn);\n const excludes = ((tsconfig.config.exclude as string[]) || []).map(matchFn);\n\n return function matcher(filePath) {\n if (filePath.endsWith('.json')) return false;\n\n filePath = unixify(filePath);\n for (let i = 0; i < excludes.length; ++i) {\n if (excludes[i](filePath)) return false;\n }\n for (let j = 0; j < includes.length; ++j) {\n if (includes[j](filePath)) return true;\n }\n return !includes.length;\n };\n}\n"],"names":["minimatch","path","unixify","createMatcher","tsconfig","tsconfigPath","dirname","matchFn","condition","pattern","isAbsolute","indexOf","join","match","filePath","includes","config","include","map","excludes","exclude","matcher","endsWith","i","length","j"],"mappings":"AAAA,OAAOA,eAAe,YAAY;AAClC,OAAOC,UAAU,aAAa;AAC9B,OAAOC,aAAa,UAAU;AAG9B,eAAe,SAASC,cAAcC,QAAkB;IACtD,MAAMC,eAAeJ,KAAKK,OAAO,CAACJ,QAAQE,SAASH,IAAI;IAEvD,SAASM,QAAQC,SAAS;QACxB,IAAIC,UAAUP,QAAQM;QACtB,IAAI,CAACP,KAAKS,UAAU,CAACD,YAAYA,QAAQE,OAAO,CAAC,SAAS,GAAGF,UAAUR,KAAKW,IAAI,CAACP,cAAcI;QAE/F,OAAO,SAASI,MAAMC,QAAQ;YAC5B,OAAOA,SAASH,OAAO,CAACF,aAAa,KAAKT,UAAUc,UAAUL;QAChE;IACF;IAEA,MAAMM,WAAW,AAAC,CAAA,AAACX,SAASY,MAAM,CAACC,OAAO,IAAiB,EAAE,AAAD,EAAGC,GAAG,CAACX;IACnE,MAAMY,WAAW,AAAC,CAAA,AAACf,SAASY,MAAM,CAACI,OAAO,IAAiB,EAAE,AAAD,EAAGF,GAAG,CAACX;IAEnE,OAAO,SAASc,QAAQP,QAAQ;QAC9B,IAAIA,SAASQ,QAAQ,CAAC,UAAU,OAAO;QAEvCR,WAAWZ,QAAQY;QACnB,IAAK,IAAIS,IAAI,GAAGA,IAAIJ,SAASK,MAAM,EAAE,EAAED,EAAG;YACxC,IAAIJ,QAAQ,CAACI,EAAE,CAACT,WAAW,OAAO;QACpC;QACA,IAAK,IAAIW,IAAI,GAAGA,IAAIV,SAASS,MAAM,EAAE,EAAEC,EAAG;YACxC,IAAIV,QAAQ,CAACU,EAAE,CAACX,WAAW,OAAO;QACpC;QACA,OAAO,CAACC,SAASS,MAAM;IACzB;AACF"}
@@ -14,7 +14,7 @@ function getParentPath(context) {
14
14
  return context.parentURL ? path.dirname(toPath(context.parentURL)) : process.cwd();
15
15
  }
16
16
  export default function toPath(specifier, context) {
17
- if (specifier.startsWith('file:')) return fileURLToPath(specifier);
17
+ if (specifier.indexOf('file:') === 0) return fileURLToPath(specifier);
18
18
  if (isAbsolute(specifier)) return specifier;
19
19
  if (specifier[0] === '.') {
20
20
  const parentPath = context ? getParentPath(context) : process.cwd();
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/toPath.ts"],"sourcesContent":["import isAbsolute from 'is-absolute';\nimport module from 'module';\nimport path from 'path';\nimport resolveCJS from 'resolve';\nimport url from 'url';\nimport { moduleRegEx } from './constants.ts';\nimport importMetaResolve from './lib/import-meta-resolve.ts';\nimport * as urlPolyfills from './lib/urlFileUrl.ts';\nimport type { Context } from './types.ts';\n\nconst useCJS = !module.createRequire;\nconst fileURLToPath = url.fileURLToPath || urlPolyfills.fileURLToPath;\nconst pathToFileURL = url.pathToFileURL || urlPolyfills.pathToFileURL;\n\nfunction getParentPath(context: Context): string {\n if (context.parentPath) return path.dirname(context.parentPath);\n return context.parentURL ? path.dirname(toPath(context.parentURL)) : process.cwd();\n}\n\nexport default function toPath(specifier: string, context?: Context): string {\n if (specifier.startsWith('file:')) return fileURLToPath(specifier);\n if (isAbsolute(specifier)) return specifier;\n if (specifier[0] === '.') {\n const parentPath = context ? getParentPath(context) : process.cwd();\n return path.join(parentPath, specifier);\n }\n if (moduleRegEx.test(specifier)) {\n const parentPath = context ? getParentPath(context) : process.cwd();\n if (!useCJS) {\n try {\n const entryURL = importMetaResolve(specifier, pathToFileURL(parentPath));\n if (entryURL) return fileURLToPath(entryURL);\n } catch (_) {\n /* it may fail due to commonjs edge cases */\n }\n }\n const entryPath = resolveCJS.sync(specifier, {\n basedir: parentPath,\n extensions: ['.js', '.json', '.node', '.mjs'],\n });\n if (entryPath) return entryPath;\n }\n\n return specifier;\n}\n"],"names":["isAbsolute","module","path","resolveCJS","url","moduleRegEx","importMetaResolve","urlPolyfills","useCJS","createRequire","fileURLToPath","pathToFileURL","getParentPath","context","parentPath","dirname","parentURL","toPath","process","cwd","specifier","startsWith","join","test","entryURL","_","entryPath","sync","basedir","extensions"],"mappings":"AAAA,OAAOA,gBAAgB,cAAc;AACrC,OAAOC,YAAY,SAAS;AAC5B,OAAOC,UAAU,OAAO;AACxB,OAAOC,gBAAgB,UAAU;AACjC,OAAOC,SAAS,MAAM;AACtB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,OAAOC,uBAAuB,+BAA+B;AAC7D,YAAYC,kBAAkB,sBAAsB;AAGpD,MAAMC,SAAS,CAACP,OAAOQ,aAAa;AACpC,MAAMC,gBAAgBN,IAAIM,aAAa,IAAIH,aAAaG,aAAa;AACrE,MAAMC,gBAAgBP,IAAIO,aAAa,IAAIJ,aAAaI,aAAa;AAErE,SAASC,cAAcC,OAAgB;IACrC,IAAIA,QAAQC,UAAU,EAAE,OAAOZ,KAAKa,OAAO,CAACF,QAAQC,UAAU;IAC9D,OAAOD,QAAQG,SAAS,GAAGd,KAAKa,OAAO,CAACE,OAAOJ,QAAQG,SAAS,KAAKE,QAAQC,GAAG;AAClF;AAEA,eAAe,SAASF,OAAOG,SAAiB,EAAEP,OAAiB;IACjE,IAAIO,UAAUC,UAAU,CAAC,UAAU,OAAOX,cAAcU;IACxD,IAAIpB,WAAWoB,YAAY,OAAOA;IAClC,IAAIA,SAAS,CAAC,EAAE,KAAK,KAAK;QACxB,MAAMN,aAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,OAAOjB,KAAKoB,IAAI,CAACR,YAAYM;IAC/B;IACA,IAAIf,YAAYkB,IAAI,CAACH,YAAY;QAC/B,MAAMN,aAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,IAAI,CAACX,QAAQ;YACX,IAAI;gBACF,MAAMgB,WAAWlB,kBAAkBc,WAAWT,cAAcG;gBAC5D,IAAIU,UAAU,OAAOd,cAAcc;YACrC,EAAE,OAAOC,GAAG;YACV,0CAA0C,GAC5C;QACF;QACA,MAAMC,YAAYvB,WAAWwB,IAAI,CAACP,WAAW;YAC3CQ,SAASd;YACTe,YAAY;gBAAC;gBAAO;gBAAS;gBAAS;aAAO;QAC/C;QACA,IAAIH,WAAW,OAAOA;IACxB;IAEA,OAAON;AACT"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/typescript/ts-swc-transform/src/toPath.ts"],"sourcesContent":["import isAbsolute from 'is-absolute';\nimport module from 'module';\nimport path from 'path';\nimport resolveCJS from 'resolve';\nimport url from 'url';\nimport { moduleRegEx } from './constants.ts';\nimport importMetaResolve from './lib/import-meta-resolve.ts';\nimport * as urlPolyfills from './lib/urlFileUrl.ts';\nimport type { Context } from './types.ts';\n\nconst useCJS = !module.createRequire;\nconst fileURLToPath = url.fileURLToPath || urlPolyfills.fileURLToPath;\nconst pathToFileURL = url.pathToFileURL || urlPolyfills.pathToFileURL;\n\nfunction getParentPath(context: Context): string {\n if (context.parentPath) return path.dirname(context.parentPath);\n return context.parentURL ? path.dirname(toPath(context.parentURL)) : process.cwd();\n}\n\nexport default function toPath(specifier: string, context?: Context): string {\n if (specifier.indexOf('file:') === 0) return fileURLToPath(specifier);\n if (isAbsolute(specifier)) return specifier;\n if (specifier[0] === '.') {\n const parentPath = context ? getParentPath(context) : process.cwd();\n return path.join(parentPath, specifier);\n }\n if (moduleRegEx.test(specifier)) {\n const parentPath = context ? getParentPath(context) : process.cwd();\n if (!useCJS) {\n try {\n const entryURL = importMetaResolve(specifier, pathToFileURL(parentPath));\n if (entryURL) return fileURLToPath(entryURL);\n } catch (_) {\n /* it may fail due to commonjs edge cases */\n }\n }\n const entryPath = resolveCJS.sync(specifier, {\n basedir: parentPath,\n extensions: ['.js', '.json', '.node', '.mjs'],\n });\n if (entryPath) return entryPath;\n }\n\n return specifier;\n}\n"],"names":["isAbsolute","module","path","resolveCJS","url","moduleRegEx","importMetaResolve","urlPolyfills","useCJS","createRequire","fileURLToPath","pathToFileURL","getParentPath","context","parentPath","dirname","parentURL","toPath","process","cwd","specifier","indexOf","join","test","entryURL","_","entryPath","sync","basedir","extensions"],"mappings":"AAAA,OAAOA,gBAAgB,cAAc;AACrC,OAAOC,YAAY,SAAS;AAC5B,OAAOC,UAAU,OAAO;AACxB,OAAOC,gBAAgB,UAAU;AACjC,OAAOC,SAAS,MAAM;AACtB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,OAAOC,uBAAuB,+BAA+B;AAC7D,YAAYC,kBAAkB,sBAAsB;AAGpD,MAAMC,SAAS,CAACP,OAAOQ,aAAa;AACpC,MAAMC,gBAAgBN,IAAIM,aAAa,IAAIH,aAAaG,aAAa;AACrE,MAAMC,gBAAgBP,IAAIO,aAAa,IAAIJ,aAAaI,aAAa;AAErE,SAASC,cAAcC,OAAgB;IACrC,IAAIA,QAAQC,UAAU,EAAE,OAAOZ,KAAKa,OAAO,CAACF,QAAQC,UAAU;IAC9D,OAAOD,QAAQG,SAAS,GAAGd,KAAKa,OAAO,CAACE,OAAOJ,QAAQG,SAAS,KAAKE,QAAQC,GAAG;AAClF;AAEA,eAAe,SAASF,OAAOG,SAAiB,EAAEP,OAAiB;IACjE,IAAIO,UAAUC,OAAO,CAAC,aAAa,GAAG,OAAOX,cAAcU;IAC3D,IAAIpB,WAAWoB,YAAY,OAAOA;IAClC,IAAIA,SAAS,CAAC,EAAE,KAAK,KAAK;QACxB,MAAMN,aAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,OAAOjB,KAAKoB,IAAI,CAACR,YAAYM;IAC/B;IACA,IAAIf,YAAYkB,IAAI,CAACH,YAAY;QAC/B,MAAMN,aAAaD,UAAUD,cAAcC,WAAWK,QAAQC,GAAG;QACjE,IAAI,CAACX,QAAQ;YACX,IAAI;gBACF,MAAMgB,WAAWlB,kBAAkBc,WAAWT,cAAcG;gBAC5D,IAAIU,UAAU,OAAOd,cAAcc;YACrC,EAAE,OAAOC,GAAG;YACV,0CAA0C,GAC5C;QACF;QACA,MAAMC,YAAYvB,WAAWwB,IAAI,CAACP,WAAW;YAC3CQ,SAASd;YACTe,YAAY;gBAAC;gBAAO;gBAAS;gBAAS;aAAO;QAC/C;QACA,IAAIH,WAAW,OAAOA;IACxB;IAEA,OAAON;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-swc-transform",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Typescript transformers for swc. Supports Node >= 0.8",
5
5
  "keywords": [
6
6
  "matcher",
@@ -47,7 +47,7 @@
47
47
  "core-js-pure": "*",
48
48
  "exit": "^0.1.2",
49
49
  "fs-iterator": "^6.0.5",
50
- "install-optional": "^0.1.76",
50
+ "install-optional": "^0.1.77",
51
51
  "is-absolute": "^1.0.0",
52
52
  "lodash.find": "^4.6.0",
53
53
  "minimatch": "^3.1.2",
@@ -55,7 +55,7 @@
55
55
  "node-version-call": "^1.8.5",
56
56
  "path-posix": "^1.0.0",
57
57
  "queue-cb": "^1.5.5",
58
- "read-tsconfig-sync": "^0.1.0",
58
+ "read-tsconfig-sync": "^0.1.1",
59
59
  "resolve": "^1.22.10",
60
60
  "rimraf2": "^2.8.2",
61
61
  "ts-node": "*",
@@ -65,6 +65,7 @@
65
65
  "devDependencies": {
66
66
  "@types/mocha": "*",
67
67
  "@types/node": "*",
68
+ "core-js": "^3.43.0",
68
69
  "cr": "*",
69
70
  "cross-spawn-cb": "*",
70
71
  "pinkie-promise": "*",