@tapjs/processinfo 3.1.2 → 3.1.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../src/line-lengths.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,eAAe,aAAc,MAAM,YAAY,MAAM,GAAG,MAAM,SAgB1E,CAAA;AAED,eAAO,MAAM,cAAc,aAAc,MAAM,yBAG9C,CAAA"}
1
+ {"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../src/line-lengths.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,eAAe,aAChB,MAAM,YACN,MAAM,GAAG,MAAM,SAiB1B,CAAA;AAED,eAAO,MAAM,cAAc,aAAc,MAAM,yBAG9C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"line-lengths.js","sourceRoot":"","sources":["../../src/line-lengths.ts"],"names":[],"mappings":";AAAA,wEAAwE;;;AAExE,6BAAmC;AAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;AAC9D,MAAM,CAAC,GAAG,MAET,CAAA;AACD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAoB,CAAA;AACpD,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;AAEf,MAAM,gBAAgB,GAAG,uBAAuB,CAAA;AACzC,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAE,OAAyB,EAAE,EAAE;IAC7E,IAAI,OAAO,KAAK,SAAS;QAAE,OAAM;IACjC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAC1D,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,IAAA,mBAAa,EAAC,QAAQ,CAAC,CAAA;IACtE,mCAAmC;IACnC,sEAAsE;IACtE,uDAAuD;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAA;IAChD,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAM;IACtE,MAAM,EAAE,GAAG,OAAO;SACf,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,KAAK,CAAC,kBAAkB,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACrB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAEvB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzB,CAAC,CAAA;AAhBY,QAAA,eAAe,mBAgB3B;AAEM,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,IAAA,mBAAa,EAAC,QAAQ,CAAC,CAAA;IACtE,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC5B,CAAC,CAAA;AAHY,QAAA,cAAc,kBAG1B","sourcesContent":["// TODO: Refactor once https://github.com/nodejs/node/issues/48460 fixed\n\nimport { fileURLToPath } from 'url'\n\nconst kLLC = Symbol.for('@tapjs/processinfo lineLength cache')\nconst g = global as {\n [kLLC]?: Map<string, number[]>\n}\nconst cache = g[kLLC] || new Map<string, number[]>()\ng[kLLC] = cache\n\nconst sourceMapComment = '//# sourceMappingURL='\nexport const saveLineLengths = (filename: string, content?: string | Buffer) => {\n if (content === undefined) return\n if (typeof content === 'object') content = String(content)\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n // no need if it's not sourcemapped\n // don't cache an empty array, though, because ts-node files will show\n // up first as source, and then as their built content.\n const last = content.trimEnd().split('\\n').pop()\n if (cache.has(filename) || !last?.startsWith(sourceMapComment)) return\n const ll = content\n .replace(/[\\n\\u2028\\u2029]$/, '')\n .split(/\\n|\\u2028|\\u2029/)\n .map(l => l.length)\n cache.set(filename, ll)\n\n cache.set(filename, ll)\n}\n\nexport const getLineLengths = (filename: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n return cache.get(filename)\n}\n"]}
1
+ {"version":3,"file":"line-lengths.js","sourceRoot":"","sources":["../../src/line-lengths.ts"],"names":[],"mappings":";AAAA,wEAAwE;;;AAExE,6BAAmC;AAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;AAC9D,MAAM,CAAC,GAAG,MAET,CAAA;AACD,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAoB,CAAA;AACpD,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;AAEf,MAAM,gBAAgB,GAAG,uBAAuB,CAAA;AACzC,MAAM,eAAe,GAAG,CAC7B,QAAgB,EAChB,OAAyB,EACzB,EAAE;IACF,IAAI,OAAO,KAAK,SAAS;QAAE,OAAM;IACjC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAC1D,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,IAAA,mBAAa,EAAC,QAAQ,CAAC,CAAA;IACtE,mCAAmC;IACnC,sEAAsE;IACtE,uDAAuD;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAA;IAChD,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAAE,OAAM;IACtE,MAAM,EAAE,GAAG,OAAO;SACf,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,KAAK,CAAC,kBAAkB,CAAC;SACzB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACrB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAEvB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzB,CAAC,CAAA;AAnBY,QAAA,eAAe,mBAmB3B;AAEM,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,IAAA,mBAAa,EAAC,QAAQ,CAAC,CAAA;IACtE,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC5B,CAAC,CAAA;AAHY,QAAA,cAAc,kBAG1B","sourcesContent":["// TODO: Refactor once https://github.com/nodejs/node/issues/48460 fixed\n\nimport { fileURLToPath } from 'url'\n\nconst kLLC = Symbol.for('@tapjs/processinfo lineLength cache')\nconst g = global as {\n [kLLC]?: Map<string, number[]>\n}\nconst cache = g[kLLC] || new Map<string, number[]>()\ng[kLLC] = cache\n\nconst sourceMapComment = '//# sourceMappingURL='\nexport const saveLineLengths = (\n filename: string,\n content?: string | Buffer\n) => {\n if (content === undefined) return\n if (typeof content === 'object') content = String(content)\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n // no need if it's not sourcemapped\n // don't cache an empty array, though, because ts-node files will show\n // up first as source, and then as their built content.\n const last = content.trimEnd().split('\\n').pop()\n if (cache.has(filename) || !last?.startsWith(sourceMapComment)) return\n const ll = content\n .replace(/[\\n\\u2028\\u2029]$/, '')\n .split(/\\n|\\u2028|\\u2029/)\n .map(l => l.length)\n cache.set(filename, ll)\n\n cache.set(filename, ll)\n}\n\nexport const getLineLengths = (filename: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n return cache.get(filename)\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"node-options-env.d.ts","sourceRoot":"","sources":["../../src/node-options-env.ts"],"names":[],"mappings":";;;;AAoGA,eAAO,MAAM,cAAc,QACpB,OAAO,UAAU,WAIvB,CAAA"}
1
+ {"version":3,"file":"node-options-env.d.ts","sourceRoot":"","sources":["../../src/node-options-env.ts"],"names":[],"mappings":";;;;AAiGA,eAAO,MAAM,cAAc,QAAS,OAAO,UAAU,WAGpD,CAAA"}
@@ -61,8 +61,7 @@ const addLoader = (args) => {
61
61
  }
62
62
  if (!eq)
63
63
  i++;
64
- if (doNotWantKeys.includes(k) &&
65
- ((0, loader_paths_js_1.importMatch)(v) || (0, loader_paths_js_1.legacyMatch)(v))) {
64
+ if (doNotWantKeys.includes(k) && ((0, loader_paths_js_1.importMatch)(v) || (0, loader_paths_js_1.legacyMatch)(v))) {
66
65
  // it's ours, but not how we want it, omit
67
66
  continue;
68
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"node-options-env.js","sourceRoot":"","sources":["../../src/node-options-env.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA6D;AAC7D,uDAK0B;AAC1B,uEAA6D;AAE7D,8DAAgC;AAEhC,MAAM,WAAW,GAAG,CAClB,IAAc,EACd,CAAS,EAC8B,EAAE;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,qBAAqB;IACrB,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3D,oBAAoB;IACpB,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACrB,MAAM,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAA0B,CAAA;QAC5D,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAA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,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAA;IAC/C,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,uBAAuB,GAAG,CAAC,IAAuB,EAAE,EAAE,CAC1D,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IAC9B,IAAI,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC/C,CAAC,CAAC,IAAI;IACN,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAE3B,MAAM,cAAc,GAAG,CAC5B,GAAsB,EACtB,EAAE;IACF,MAAM,EAAE,GAAG,IAAA,2CAAiB,EAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9C,OAAO,IAAA,2CAAiB,EAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAA;AACzC,CAAC,CAAA;AALY,QAAA,cAAc,kBAK1B","sourcesContent":["import { argvToNodeOptions } from './argv-to-node-options.js'\nimport {\n legacyLoader,\n legacyMatch,\n importLoader,\n importMatch,\n} from './loader-paths.js'\nimport { nodeOptionsToArgv } from './node-options-to-argv.js'\n\nimport Module from 'node:module'\n\nconst getKeyValue = (\n args: string[],\n i: number\n): [boolean, string, string | undefined] => {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (arg.includes('=')) {\n const [k, ...rest] = arg.split('=') as [string, ...string[]]\n return [true, k, rest.join('=')]\n } else if (i < args.length - 1) {\n return [false, arg, args[i + 1]]\n } else {\n return [false, arg, undefined]\n }\n}\n\nconst useImport = !!(Module as { register?: (...a: any[]) => any })\n .register\n\nconst addLoader = (args: string[]) => {\n const addKey = useImport ? '--import' : '--loader'\n const addValue = useImport ? importLoader : legacyLoader\n const doNotWantKeys = [\n '--experimental-loader',\n useImport ? '--loader' : '--import',\n ]\n const test = useImport ? importMatch : legacyMatch\n\n const added: string[] = []\n\n let doubledash = false\n let found = false\n for (let i = 0; i < args.length; i++) {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (!arg.startsWith('--') || doubledash) {\n added.push(arg)\n continue\n }\n if (arg === '--') {\n added.push(arg)\n doubledash = true\n continue\n }\n\n const [eq, k, v] = getKeyValue(args, i)\n if (!v) {\n // wasn't a key-value pair\n added.push(arg)\n continue\n }\n if (!eq) i++\n if (\n doNotWantKeys.includes(k) &&\n (importMatch(v) || legacyMatch(v))\n ) {\n // it's ours, but not how we want it, omit\n continue\n }\n\n if (k === addKey && test(v)) {\n // already present, don't let it be set multiple times.\n if (found) continue\n found = true\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n } else {\n // not ours\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n continue\n }\n }\n if (!found) added.push(`${addKey}=${addValue}`)\n return !useImport ? addIgnoreLoadersWarning(added) : added\n}\n\nconst addIgnoreLoadersWarning = (args: readonly string[]) =>\n args.includes('--no-warnings') ||\n args.includes('--no-warnings=ExperimentalLoader')\n ? args\n : args.concat('--no-warnings')\n\nexport const nodeOptionsEnv = (\n env: NodeJS.ProcessEnv,\n) => {\n const no = nodeOptionsToArgv(env.NODE_OPTIONS)\n return argvToNodeOptions(addLoader(no))\n}\n"]}
1
+ {"version":3,"file":"node-options-env.js","sourceRoot":"","sources":["../../src/node-options-env.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA6D;AAC7D,uDAK0B;AAC1B,uEAA6D;AAE7D,8DAAgC;AAEhC,MAAM,WAAW,GAAG,CAClB,IAAc,EACd,CAAS,EAC8B,EAAE;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,qBAAqB;IACrB,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC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AAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACf,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACpB,IAAI,CAAC,EAAE,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACrD,SAAQ;SACT;KACF;IACD,IAAI,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAA;IAC/C,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,uBAAuB,GAAG,CAAC,IAAuB,EAAE,EAAE,CAC1D,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IAC9B,IAAI,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC/C,CAAC,CAAC,IAAI;IACN,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAE3B,MAAM,cAAc,GAAG,CAAC,GAAsB,EAAE,EAAE;IACvD,MAAM,EAAE,GAAG,IAAA,2CAAiB,EAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9C,OAAO,IAAA,2CAAiB,EAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAA;AACzC,CAAC,CAAA;AAHY,QAAA,cAAc,kBAG1B","sourcesContent":["import { argvToNodeOptions } from './argv-to-node-options.js'\nimport {\n legacyLoader,\n legacyMatch,\n importLoader,\n importMatch,\n} from './loader-paths.js'\nimport { nodeOptionsToArgv } from './node-options-to-argv.js'\n\nimport Module from 'node:module'\n\nconst getKeyValue = (\n args: string[],\n i: number\n): [boolean, string, string | undefined] => {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (arg.includes('=')) {\n const [k, ...rest] = arg.split('=') as [string, ...string[]]\n return [true, k, rest.join('=')]\n } else if (i < args.length - 1) {\n return [false, arg, args[i + 1]]\n } else {\n return [false, arg, undefined]\n }\n}\n\nconst useImport = !!(Module as { register?: (...a: any[]) => any })\n .register\n\nconst addLoader = (args: string[]) => {\n const addKey = useImport ? '--import' : '--loader'\n const addValue = useImport ? importLoader : legacyLoader\n const doNotWantKeys = [\n '--experimental-loader',\n useImport ? '--loader' : '--import',\n ]\n const test = useImport ? importMatch : legacyMatch\n\n const added: string[] = []\n\n let doubledash = false\n let found = false\n for (let i = 0; i < args.length; i++) {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (!arg.startsWith('--') || doubledash) {\n added.push(arg)\n continue\n }\n if (arg === '--') {\n added.push(arg)\n doubledash = true\n continue\n }\n\n const [eq, k, v] = getKeyValue(args, i)\n if (!v) {\n // wasn't a key-value pair\n added.push(arg)\n continue\n }\n if (!eq) i++\n if (doNotWantKeys.includes(k) && (importMatch(v) || legacyMatch(v))) {\n // it's ours, but not how we want it, omit\n continue\n }\n\n if (k === addKey && test(v)) {\n // already present, don't let it be set multiple times.\n if (found) continue\n found = true\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n } else {\n // not ours\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n continue\n }\n }\n if (!found) added.push(`${addKey}=${addValue}`)\n return !useImport ? addIgnoreLoadersWarning(added) : added\n}\n\nconst addIgnoreLoadersWarning = (args: readonly string[]) =>\n args.includes('--no-warnings') ||\n args.includes('--no-warnings=ExperimentalLoader')\n ? args\n : args.concat('--no-warnings')\n\nexport const nodeOptionsEnv = (env: NodeJS.ProcessEnv) => {\n const no = nodeOptionsToArgv(env.NODE_OPTIONS)\n return argvToNodeOptions(addLoader(no))\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"set-sources.js","sourceRoot":"","sources":["../../src/set-sources.ts"],"names":[],"mappings":";;;AAAA,uEAA6D;AAC7D,+DAAsD;AACtD,qDAA0C;AAE1C,kEAAkE;AAClE,yDAAyD;AACzD,sEAAsE;AAC/D,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,EAAE,GAAG,IAAA,2CAAiB,EAAC,IAAI,CAAC,CAAA;IAClC,IAAI,CAAC,EAAE;QAAE,OAAM;IACf,MAAM,EAAE,GAAG,IAAA,oCAAc,GAAE,CAAA;IAC3B,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAChC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,0BAAS,EAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACpD,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,CAAC,CAAA;AAPY,QAAA,UAAU,cAOtB","sourcesContent":["import { findSourceMapSafe } from './find-source-map-safe.js'\nimport { getProcessInfo } from './get-process-info.js'\nimport {urlToPath} from './url-to-path.js'\n\n// set the processInfo.sources for a given file, but don't clobber\n// if called multiple times, or create duplicate entries.\n// Should only be called *after* the file in question has been loaded.\nexport const setSources = (file: string) => {\n const sm = findSourceMapSafe(file)\n if (!sm) return\n const pi = getProcessInfo()\n const s = pi.sources[file] || []\n s.push(...sm.payload.sources.map(s => urlToPath(s)))\n pi.sources[file] = [...new Set(s)]\n}\n"]}
1
+ {"version":3,"file":"set-sources.js","sourceRoot":"","sources":["../../src/set-sources.ts"],"names":[],"mappings":";;;AAAA,uEAA6D;AAC7D,+DAAsD;AACtD,qDAA4C;AAE5C,kEAAkE;AAClE,yDAAyD;AACzD,sEAAsE;AAC/D,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,EAAE,GAAG,IAAA,2CAAiB,EAAC,IAAI,CAAC,CAAA;IAClC,IAAI,CAAC,EAAE;QAAE,OAAM;IACf,MAAM,EAAE,GAAG,IAAA,oCAAc,GAAE,CAAA;IAC3B,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAChC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,0BAAS,EAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACpD,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,CAAC,CAAA;AAPY,QAAA,UAAU,cAOtB","sourcesContent":["import { findSourceMapSafe } from './find-source-map-safe.js'\nimport { getProcessInfo } from './get-process-info.js'\nimport { urlToPath } from './url-to-path.js'\n\n// set the processInfo.sources for a given file, but don't clobber\n// if called multiple times, or create duplicate entries.\n// Should only be called *after* the file in question has been loaded.\nexport const setSources = (file: string) => {\n const sm = findSourceMapSafe(file)\n if (!sm) return\n const pi = getProcessInfo()\n const s = pi.sources[file] || []\n s.push(...sm.payload.sources.map(s => urlToPath(s)))\n pi.sources[file] = [...new Set(s)]\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../src/line-lengths.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,eAAe,aAAc,MAAM,YAAY,MAAM,GAAG,MAAM,SAgB1E,CAAA;AAED,eAAO,MAAM,cAAc,aAAc,MAAM,yBAG9C,CAAA"}
1
+ {"version":3,"file":"line-lengths.d.ts","sourceRoot":"","sources":["../../src/line-lengths.ts"],"names":[],"mappings":";AAYA,eAAO,MAAM,eAAe,aAChB,MAAM,YACN,MAAM,GAAG,MAAM,SAiB1B,CAAA;AAED,eAAO,MAAM,cAAc,aAAc,MAAM,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,CAAA;IAEvB,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;AACzB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA;IACtE,OAAO,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC5B,CAAC,CAAA","sourcesContent":["// TODO: Refactor once https://github.com/nodejs/node/issues/48460 fixed\n\nimport { fileURLToPath } from 'url'\n\nconst kLLC = Symbol.for('@tapjs/processinfo lineLength cache')\nconst g = global as {\n [kLLC]?: Map<string, number[]>\n}\nconst cache = g[kLLC] || new Map<string, number[]>()\ng[kLLC] = cache\n\nconst sourceMapComment = '//# sourceMappingURL='\nexport const saveLineLengths = (filename: string, content?: string | Buffer) => {\n if (content === undefined) return\n if (typeof content === 'object') content = String(content)\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n // no need if it's not sourcemapped\n // don't cache an empty array, though, because ts-node files will show\n // up first as source, and then as their built content.\n const last = content.trimEnd().split('\\n').pop()\n if (cache.has(filename) || !last?.startsWith(sourceMapComment)) return\n const ll = content\n .replace(/[\\n\\u2028\\u2029]$/, '')\n .split(/\\n|\\u2028|\\u2029/)\n .map(l => l.length)\n cache.set(filename, ll)\n\n cache.set(filename, ll)\n}\n\nexport const getLineLengths = (filename: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n return cache.get(filename)\n}\n"]}
1
+ {"version":3,"file":"line-lengths.js","sourceRoot":"","sources":["../../src/line-lengths.ts"],"names":[],"mappings":"AAAA,wEAAwE;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAA;AAC9D,MAAM,CAAC,GAAG,MAET,CAA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C,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC5B,CAAC,CAAA","sourcesContent":["// TODO: Refactor once https://github.com/nodejs/node/issues/48460 fixed\n\nimport { fileURLToPath } from 'url'\n\nconst kLLC = Symbol.for('@tapjs/processinfo lineLength cache')\nconst g = global as {\n [kLLC]?: Map<string, number[]>\n}\nconst cache = g[kLLC] || new Map<string, number[]>()\ng[kLLC] = cache\n\nconst sourceMapComment = '//# sourceMappingURL='\nexport const saveLineLengths = (\n filename: string,\n content?: string | Buffer\n) => {\n if (content === undefined) return\n if (typeof content === 'object') content = String(content)\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n // no need if it's not sourcemapped\n // don't cache an empty array, though, because ts-node files will show\n // up first as source, and then as their built content.\n const last = content.trimEnd().split('\\n').pop()\n if (cache.has(filename) || !last?.startsWith(sourceMapComment)) return\n const ll = content\n .replace(/[\\n\\u2028\\u2029]$/, '')\n .split(/\\n|\\u2028|\\u2029/)\n .map(l => l.length)\n cache.set(filename, ll)\n\n cache.set(filename, ll)\n}\n\nexport const getLineLengths = (filename: string) => {\n if (filename.startsWith('file://')) filename = fileURLToPath(filename)\n return cache.get(filename)\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"node-options-env.d.ts","sourceRoot":"","sources":["../../src/node-options-env.ts"],"names":[],"mappings":";;;;AAoGA,eAAO,MAAM,cAAc,QACpB,OAAO,UAAU,WAIvB,CAAA"}
1
+ {"version":3,"file":"node-options-env.d.ts","sourceRoot":"","sources":["../../src/node-options-env.ts"],"names":[],"mappings":";;;;AAiGA,eAAO,MAAM,cAAc,QAAS,OAAO,UAAU,WAGpD,CAAA"}
@@ -55,8 +55,7 @@ const addLoader = (args) => {
55
55
  }
56
56
  if (!eq)
57
57
  i++;
58
- if (doNotWantKeys.includes(k) &&
59
- (importMatch(v) || legacyMatch(v))) {
58
+ if (doNotWantKeys.includes(k) && (importMatch(v) || legacyMatch(v))) {
60
59
  // it's ours, but not how we want it, omit
61
60
  continue;
62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EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9C,OAAO,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAA;AACzC,CAAC,CAAA","sourcesContent":["import { argvToNodeOptions } from './argv-to-node-options.js'\nimport {\n legacyLoader,\n legacyMatch,\n importLoader,\n importMatch,\n} from './loader-paths.js'\nimport { nodeOptionsToArgv } from './node-options-to-argv.js'\n\nimport Module from 'node:module'\n\nconst getKeyValue = (\n args: string[],\n i: number\n): [boolean, string, string | undefined] => {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (arg.includes('=')) {\n const [k, ...rest] = arg.split('=') as [string, ...string[]]\n return [true, k, rest.join('=')]\n } else if (i < args.length - 1) {\n return [false, arg, args[i + 1]]\n } else {\n return [false, arg, undefined]\n }\n}\n\nconst useImport = !!(Module as { register?: (...a: any[]) => any })\n .register\n\nconst addLoader = (args: string[]) => {\n const addKey = useImport ? '--import' : '--loader'\n const addValue = useImport ? importLoader : legacyLoader\n const doNotWantKeys = [\n '--experimental-loader',\n useImport ? '--loader' : '--import',\n ]\n const test = useImport ? importMatch : legacyMatch\n\n const added: string[] = []\n\n let doubledash = false\n let found = false\n for (let i = 0; i < args.length; i++) {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (!arg.startsWith('--') || doubledash) {\n added.push(arg)\n continue\n }\n if (arg === '--') {\n added.push(arg)\n doubledash = true\n continue\n }\n\n const [eq, k, v] = getKeyValue(args, i)\n if (!v) {\n // wasn't a key-value pair\n added.push(arg)\n continue\n }\n if (!eq) i++\n if (\n doNotWantKeys.includes(k) &&\n (importMatch(v) || legacyMatch(v))\n ) {\n // it's ours, but not how we want it, omit\n continue\n }\n\n if (k === addKey && test(v)) {\n // already present, don't let it be set multiple times.\n if (found) continue\n found = true\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n } else {\n // not ours\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n continue\n }\n }\n if (!found) added.push(`${addKey}=${addValue}`)\n return !useImport ? addIgnoreLoadersWarning(added) : added\n}\n\nconst addIgnoreLoadersWarning = (args: readonly string[]) =>\n args.includes('--no-warnings') ||\n args.includes('--no-warnings=ExperimentalLoader')\n ? args\n : args.concat('--no-warnings')\n\nexport const nodeOptionsEnv = (\n env: NodeJS.ProcessEnv,\n) => {\n const no = nodeOptionsToArgv(env.NODE_OPTIONS)\n return argvToNodeOptions(addLoader(no))\n}\n"]}
1
+ {"version":3,"file":"node-options-env.js","sourceRoot":"","sources":["../../src/node-options-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,MAAM,WAAW,GAAG,CAClB,IAAc,EACd,CAAS,EAC8B,EAAE;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,qBAAqB;IACrB,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3D,oBAAoB;IACpB,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACrB,MAAM,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAA0B,CAAA;QAC5D,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;KACjC;SAAM,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,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,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,uBAAuB,GAAG,CAAC,IAAuB,EAAE,EAAE,CAC1D,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IAC9B,IAAI,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC/C,CAAC,CAAC,IAAI;IACN,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAsB,EAAE,EAAE;IACvD,MAAM,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9C,OAAO,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAA;AACzC,CAAC,CAAA","sourcesContent":["import { argvToNodeOptions } from './argv-to-node-options.js'\nimport {\n legacyLoader,\n legacyMatch,\n importLoader,\n importMatch,\n} from './loader-paths.js'\nimport { nodeOptionsToArgv } from './node-options-to-argv.js'\n\nimport Module from 'node:module'\n\nconst getKeyValue = (\n args: string[],\n i: number\n): [boolean, string, string | undefined] => {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (arg.includes('=')) {\n const [k, ...rest] = arg.split('=') as [string, ...string[]]\n return [true, k, rest.join('=')]\n } else if (i < args.length - 1) {\n return [false, arg, args[i + 1]]\n } else {\n return [false, arg, undefined]\n }\n}\n\nconst useImport = !!(Module as { register?: (...a: any[]) => any })\n .register\n\nconst addLoader = (args: string[]) => {\n const addKey = useImport ? '--import' : '--loader'\n const addValue = useImport ? importLoader : legacyLoader\n const doNotWantKeys = [\n '--experimental-loader',\n useImport ? '--loader' : '--import',\n ]\n const test = useImport ? importMatch : legacyMatch\n\n const added: string[] = []\n\n let doubledash = false\n let found = false\n for (let i = 0; i < args.length; i++) {\n const arg = args[i]\n /* c8 ignore start */\n if (typeof arg !== 'string') throw new Error('invalid arg')\n /* c8 ignore stop */\n if (!arg.startsWith('--') || doubledash) {\n added.push(arg)\n continue\n }\n if (arg === '--') {\n added.push(arg)\n doubledash = true\n continue\n }\n\n const [eq, k, v] = getKeyValue(args, i)\n if (!v) {\n // wasn't a key-value pair\n added.push(arg)\n continue\n }\n if (!eq) i++\n if (doNotWantKeys.includes(k) && (importMatch(v) || legacyMatch(v))) {\n // it's ours, but not how we want it, omit\n continue\n }\n\n if (k === addKey && test(v)) {\n // already present, don't let it be set multiple times.\n if (found) continue\n found = true\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n } else {\n // not ours\n added.push(arg)\n const next = args[i]\n if (!eq && typeof next === 'string') added.push(next)\n continue\n }\n }\n if (!found) added.push(`${addKey}=${addValue}`)\n return !useImport ? addIgnoreLoadersWarning(added) : added\n}\n\nconst addIgnoreLoadersWarning = (args: readonly string[]) =>\n args.includes('--no-warnings') ||\n args.includes('--no-warnings=ExperimentalLoader')\n ? args\n : args.concat('--no-warnings')\n\nexport const nodeOptionsEnv = (env: NodeJS.ProcessEnv) => {\n const no = nodeOptionsToArgv(env.NODE_OPTIONS)\n return argvToNodeOptions(addLoader(no))\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"set-sources.js","sourceRoot":"","sources":["../../src/set-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAA;AAE1C,kEAAkE;AAClE,yDAAyD;AACzD,sEAAsE;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAClC,IAAI,CAAC,EAAE;QAAE,OAAM;IACf,MAAM,EAAE,GAAG,cAAc,EAAE,CAAA;IAC3B,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAChC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACpD,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,CAAC,CAAA","sourcesContent":["import { findSourceMapSafe } from './find-source-map-safe.js'\nimport { getProcessInfo } from './get-process-info.js'\nimport {urlToPath} from './url-to-path.js'\n\n// set the processInfo.sources for a given file, but don't clobber\n// if called multiple times, or create duplicate entries.\n// Should only be called *after* the file in question has been loaded.\nexport const setSources = (file: string) => {\n const sm = findSourceMapSafe(file)\n if (!sm) return\n const pi = getProcessInfo()\n const s = pi.sources[file] || []\n s.push(...sm.payload.sources.map(s => urlToPath(s)))\n pi.sources[file] = [...new Set(s)]\n}\n"]}
1
+ {"version":3,"file":"set-sources.js","sourceRoot":"","sources":["../../src/set-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,kEAAkE;AAClE,yDAAyD;AACzD,sEAAsE;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAClC,IAAI,CAAC,EAAE;QAAE,OAAM;IACf,MAAM,EAAE,GAAG,cAAc,EAAE,CAAA;IAC3B,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAChC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACpD,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AACpC,CAAC,CAAA","sourcesContent":["import { findSourceMapSafe } from './find-source-map-safe.js'\nimport { getProcessInfo } from './get-process-info.js'\nimport { urlToPath } from './url-to-path.js'\n\n// set the processInfo.sources for a given file, but don't clobber\n// if called multiple times, or create duplicate entries.\n// Should only be called *after* the file in question has been loaded.\nexport const setSources = (file: string) => {\n const sm = findSourceMapSafe(file)\n if (!sm) return\n const pi = getProcessInfo()\n const s = pi.sources[file] || []\n s.push(...sm.payload.sources.map(s => urlToPath(s)))\n pi.sources[file] = [...new Set(s)]\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapjs/processinfo",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -11,7 +11,7 @@
11
11
  "main": true,
12
12
  "exports": {
13
13
  ".": "./src/index.ts",
14
- "./loader": "./src/loader.mts",
14
+ "./loader": "./src/loader-legacy.mts",
15
15
  "./import": "./src/import.mts"
16
16
  }
17
17
  },
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "./loader": {
30
30
  "import": {
31
- "types": "./dist/esm/loader.d.mts",
32
- "default": "./dist/esm/loader.mjs"
31
+ "types": "./dist/esm/loader-legacy.d.mts",
32
+ "default": "./dist/esm/loader-legacy.mjs"
33
33
  }
34
34
  },
35
35
  "./import": {