@tapjs/processinfo 2.2.0 → 2.2.2

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,3 +1,3 @@
1
1
  export declare const defaultExclude: RegExp;
2
- export declare const getExclude: (k: string) => RegExp;
2
+ export declare const getExclude: (k: string, useDefault?: boolean) => RegExp;
3
3
  //# sourceMappingURL=get-exclude.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-exclude.d.ts","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QACuG,CAAA;AAYlI,eAAO,MAAM,UAAU,MAAO,MAAM,WAKnC,CAAA"}
1
+ {"version":3,"file":"get-exclude.d.ts","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QACuG,CAAA;AAYlI,eAAO,MAAM,UAAU,MAAO,MAAM,iCAKnC,CAAA"}
@@ -13,9 +13,9 @@ const parseExclude = (src) => {
13
13
  catch (e) { }
14
14
  }
15
15
  };
16
- const getExclude = (k) => {
16
+ const getExclude = (k, useDefault = true) => {
17
17
  const src = process.env[k];
18
- const exclude = parseExclude(src) || exports.defaultExclude;
18
+ const exclude = parseExclude(src) || (useDefault ? exports.defaultExclude : /$./);
19
19
  process.env[k] = String(exclude);
20
20
  return exclude;
21
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-exclude.js","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GACzB,gIAAgI,CAAA;AAElI,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAsB,EAAE;IACnE,IAAI,CAAC,GAAG;QAAE,OAAM;IAChB,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAC9C,IAAI,MAAM,EAAE;QACV,IAAI;YACF,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;AACH,CAAC,CAAA;AAEM,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,EAAE;IACtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,sBAAc,CAAA;IACnD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AALY,QAAA,UAAU,cAKtB","sourcesContent":["export const defaultExclude =\n /(^|[\\\\\\/])(node_modules|\\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\\\\\\/]+\\.test\\.([cm]?[jt]s|[jt]sx?)|__tests?__)([\\\\\\/]|$)/i\n\nconst parseExclude = (src: string | undefined): RegExp | undefined => {\n if (!src) return\n const parsed = src.match(/^\\/(.*)\\/([a-z]*)$/)\n if (parsed) {\n try {\n return new RegExp(parsed[1], parsed[2])\n } catch (e) {}\n }\n}\n\nexport const getExclude = (k: string) => {\n const src = process.env[k]\n const exclude = parseExclude(src) || defaultExclude\n process.env[k] = String(exclude)\n return exclude\n}\n"]}
1
+ {"version":3,"file":"get-exclude.js","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GACzB,gIAAgI,CAAA;AAElI,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAsB,EAAE;IACnE,IAAI,CAAC,GAAG;QAAE,OAAM;IAChB,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAC9C,IAAI,MAAM,EAAE;QACV,IAAI;YACF,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;AACH,CAAC,CAAA;AAEM,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,sBAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACzE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AALY,QAAA,UAAU,cAKtB","sourcesContent":["export const defaultExclude =\n /(^|[\\\\\\/])(node_modules|\\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\\\\\\/]+\\.test\\.([cm]?[jt]s|[jt]sx?)|__tests?__)([\\\\\\/]|$)/i\n\nconst parseExclude = (src: string | undefined): RegExp | undefined => {\n if (!src) return\n const parsed = src.match(/^\\/(.*)\\/([a-z]*)$/)\n if (parsed) {\n try {\n return new RegExp(parsed[1], parsed[2])\n } catch (e) {}\n }\n}\n\nexport const getExclude = (k: string, useDefault = true) => {\n const src = process.env[k]\n const exclude = parseExclude(src) || (useDefault ? defaultExclude : /$./)\n process.env[k] = String(exclude)\n return exclude\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"register-cjs.d.ts","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,YAWpB,CAAA"}
1
+ {"version":3,"file":"register-cjs.d.ts","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,YAYpB,CAAA"}
@@ -11,7 +11,8 @@ const register = () => {
11
11
  if (g[kRegisterCJS])
12
12
  return;
13
13
  g[kRegisterCJS] = true;
14
- const exclude = (0, get_exclude_js_1.getExclude)('_TAPJS_PROCESSINFO_EXCLUDE_');
14
+ // by default we include everything in processInfo.files
15
+ const exclude = (0, get_exclude_js_1.getExclude)('_TAPJS_PROCESSINFO_EXCLUDE_', false);
15
16
  (0, pirates_1.addHook)((code, filename) => {
16
17
  (0, get_process_info_js_1.getProcessInfo)().files.push(filename);
17
18
  return code;
@@ -1 +1 @@
1
- {"version":3,"file":"register-cjs.js","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAC3D,qCAAiC;AACjC,qDAA6C;AAC7C,+DAAsD;AAEtD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;AACjE,MAAM,CAAC,GAAG,MAET,CAAA;AAEM,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,CAAC,YAAY,CAAC;QAAE,OAAM;IAC3B,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;IACtB,MAAM,OAAO,GAAG,IAAA,2BAAU,EAAC,6BAA6B,CAAC,CAAA;IACzD,IAAA,iBAAO,EACL,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;QACjB,IAAA,oCAAc,GAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrC,OAAO,IAAI,CAAA;IACb,CAAC,EACD,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CACxE,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["// commonjs style loader hook, modifying require.extensions\nimport { addHook } from 'pirates'\nimport { getExclude } from './get-exclude.js'\nimport { getProcessInfo } from './get-process-info.js'\n\nconst kRegisterCJS = Symbol.for('@tapjs/processinfo.registerCJS')\nconst g = global as typeof globalThis & {\n [kRegisterCJS]?: boolean\n}\n\nexport const register = () => {\n if (g[kRegisterCJS]) return\n g[kRegisterCJS] = true\n const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_')\n addHook(\n (code, filename) => {\n getProcessInfo().files.push(filename)\n return code\n },\n { exts: ['.js', '.cjs'], matcher: filename => !exclude.test(filename) }\n )\n}\n"]}
1
+ {"version":3,"file":"register-cjs.js","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAC3D,qCAAiC;AACjC,qDAA6C;AAC7C,+DAAsD;AAEtD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;AACjE,MAAM,CAAC,GAAG,MAET,CAAA;AAEM,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,CAAC,YAAY,CAAC;QAAE,OAAM;IAC3B,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;IACtB,wDAAwD;IACxD,MAAM,OAAO,GAAG,IAAA,2BAAU,EAAC,6BAA6B,EAAE,KAAK,CAAC,CAAA;IAChE,IAAA,iBAAO,EACL,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;QACjB,IAAA,oCAAc,GAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrC,OAAO,IAAI,CAAA;IACb,CAAC,EACD,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CACxE,CAAA;AACH,CAAC,CAAA;AAZY,QAAA,QAAQ,YAYpB","sourcesContent":["// commonjs style loader hook, modifying require.extensions\nimport { addHook } from 'pirates'\nimport { getExclude } from './get-exclude.js'\nimport { getProcessInfo } from './get-process-info.js'\n\nconst kRegisterCJS = Symbol.for('@tapjs/processinfo.registerCJS')\nconst g = global as typeof globalThis & {\n [kRegisterCJS]?: boolean\n}\n\nexport const register = () => {\n if (g[kRegisterCJS]) return\n g[kRegisterCJS] = true\n // by default we include everything in processInfo.files\n const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_', false)\n addHook(\n (code, filename) => {\n getProcessInfo().files.push(filename)\n return code\n },\n { exts: ['.js', '.cjs'], matcher: filename => !exclude.test(filename) }\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"register-env.d.ts","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,QAAQ,YAMpB,CAAA"}
1
+ {"version":3,"file":"register-env.d.ts","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,QAAQ,YAKpB,CAAA"}
@@ -11,14 +11,14 @@ const { hasOwnProperty } = Object.prototype;
11
11
  const getEnvs = (env) => {
12
12
  // load it here so that it isn't cached before the loader attaches
13
13
  // in self-test scenario.
14
- return Object.fromEntries(Object.entries(process.env)
15
- .filter(([k]) => !hasOwnProperty.call(env, k) && envRE.test(k))
16
- .concat([['NODE_OPTIONS', (0, node_options_env_js_1.nodeOptionsEnv)(env, process.execArgv)]]));
14
+ const e = env || process.env;
15
+ return Object.fromEntries(Object.entries(e)
16
+ .filter(([k]) => !hasOwnProperty.call(env || {}, k) && envRE.test(k))
17
+ .concat([['NODE_OPTIONS', (0, node_options_env_js_1.nodeOptionsEnv)(e, process.execArgv)]]));
17
18
  };
18
19
  const register = () => {
19
20
  process_on_spawn_1.default.addListener(obj => {
20
- const env = obj.env || {};
21
- obj.env = Object.assign(env, getEnvs(env));
21
+ obj.env = Object.assign(obj.env || {}, getEnvs(obj.env));
22
22
  return obj;
23
23
  });
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"register-env.js","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":";;;;;;AAAA,wEAA6C;AAC7C,+DAAsD;AAEtD,MAAM,KAAK,GAAG,sBAAsB,CAAA;AACpC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AAE3C,MAAM,OAAO,GAAG,CAAC,GAAsB,EAAE,EAAE;IACzC,kEAAkE;IAClE,yBAAyB;IACzB,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;SACxB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC9D,MAAM,CAAC,CAAC,CAAC,cAAc,EAAE,IAAA,oCAAc,EAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACrE,CAAA;AACH,CAAC,CAAA;AAEM,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,0BAAc,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,CAAA;QACzB,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AANY,QAAA,QAAQ,YAMpB","sourcesContent":["import processOnSpawn from 'process-on-spawn'\nimport { nodeOptionsEnv } from './node-options-env.js'\n\nconst envRE = /^_TAPJS_PROCESSINFO_/\nconst { hasOwnProperty } = Object.prototype\n\nconst getEnvs = (env: NodeJS.ProcessEnv) => {\n // load it here so that it isn't cached before the loader attaches\n // in self-test scenario.\n return Object.fromEntries(\n Object.entries(process.env)\n .filter(([k]) => !hasOwnProperty.call(env, k) && envRE.test(k))\n .concat([['NODE_OPTIONS', nodeOptionsEnv(env, process.execArgv)]])\n )\n}\n\nexport const register = () => {\n processOnSpawn.addListener(obj => {\n const env = obj.env || {}\n obj.env = Object.assign(env, getEnvs(env))\n return obj\n })\n}\n"]}
1
+ {"version":3,"file":"register-env.js","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":";;;;;;AAAA,wEAA6C;AAC7C,+DAAsD;AAEtD,MAAM,KAAK,GAAG,sBAAsB,CAAA;AACpC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AAE3C,MAAM,OAAO,GAAG,CAAC,GAAuB,EAAE,EAAE;IAC1C,kEAAkE;IAClE,yBAAyB;IACzB,MAAM,CAAC,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAA;IAC5B,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;SACd,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpE,MAAM,CAAC,CAAC,CAAC,cAAc,EAAE,IAAA,oCAAc,EAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACnE,CAAA;AACH,CAAC,CAAA;AAEM,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,0BAAc,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAC/B,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACxD,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AALY,QAAA,QAAQ,YAKpB","sourcesContent":["import processOnSpawn from 'process-on-spawn'\nimport { nodeOptionsEnv } from './node-options-env.js'\n\nconst envRE = /^_TAPJS_PROCESSINFO_/\nconst { hasOwnProperty } = Object.prototype\n\nconst getEnvs = (env?: NodeJS.ProcessEnv) => {\n // load it here so that it isn't cached before the loader attaches\n // in self-test scenario.\n const e = env || process.env\n return Object.fromEntries(\n Object.entries(e)\n .filter(([k]) => !hasOwnProperty.call(env || {}, k) && envRE.test(k))\n .concat([['NODE_OPTIONS', nodeOptionsEnv(e, process.execArgv)]])\n )\n}\n\nexport const register = () => {\n processOnSpawn.addListener(obj => {\n obj.env = Object.assign(obj.env || {}, getEnvs(obj.env))\n return obj\n })\n}\n"]}
package/dist/mjs/esm.mjs CHANGED
@@ -30,7 +30,7 @@ if (typeof port !== 'undefined') {
30
30
  }
31
31
  `;
32
32
  };
33
- const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_');
33
+ const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_', false);
34
34
  export const load = async (url, context, nextLoad) => {
35
35
  if (/^file:/.test(url)) {
36
36
  const filename = fileURLToPath(url);
@@ -1 +1 @@
1
- {"version":3,"file":"esm.mjs","sourceRoot":"","sources":["../../lib/esm.mts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,sEAAsE;AACtE,mCAAmC;AACnC,cAAc,YAAY,CAAA;AAa1B,IAAI,IAAI,GAAuB,SAAS,CAAA;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAA0B,EAAE,EAAE;IAC1D,2DAA2D;IAC3D,sCAAsC;IACtC,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IAC9B,IAAI,GAAG,IAAI,CAAA;IACX,OAAO;;;;kCAIyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;;;;;;;;;;;CAWrD,CAAA;AACD,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAA;AACzD,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EACvB,GAAW,EACX,OAAY,EACZ,QAAkB,EAClB,EAAE;IACF,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACtB,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC3B,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;aAC3B;iBAAM;gBACL,0CAA0C;gBAC1C,cAAc,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACtC;SACF;KACF;IACD,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;AAC/B,CAAC,CAAA","sourcesContent":["// usage: node '--loader=@tapjs/processinfo/esm' foo.mjs\nimport { fileURLToPath } from 'url'\nimport type { Serializable } from 'worker_threads'\nimport { getExclude } from './get-exclude.js'\nimport { getProcessInfo } from './get-process-info.js'\nimport { resolve } from './require-resolve.js'\n\n// copy main module so that we can --loader=@tapjs/processinfo and use\n// this as the entry point as well.\nexport * from './index.js'\n\n// on Node v20, loaders are executed in a separate isolated environment\n// As a result, to register coverage and track files, we need to act in\n// the globalPreload function. The load() method posts a message with the\n// filename being loaded, because any registrations that happen in the\n// loader thread will not have any effect.\n// The check for the 'port' being undefined is to allow for support back to\n// 16.12, which had a globalPreload method, but did not have a sendMessage\n// port in that environment.\ntype GPPort = {\n postMessage: (x: Serializable) => any\n}\nlet PORT: undefined | GPPort = undefined\nexport const globalPreload = (context: { port?: GPPort }) => {\n // this will be something like path/to/dist/mjs/lib/esm.mjs\n // but we need path/to/dist/cjs/cjs.js\n const base = resolve('../cjs/cjs.js')\n const { port } = context || {}\n PORT = port\n return `\nif (typeof port !== 'undefined') {\n const { createRequire, findSourceMap } = getBuiltin('module')\n const { fileURLToPath } = getBuiltin('url')\n const require = createRequire(${JSON.stringify(base)})\n const { getProcessInfo } = require('./get-process-info.js')\n // must be called eagerly here.\n // this does all the registration as well.\n const processInfo = getProcessInfo()\n port.onmessage = (e) => {\n const filename = e.data\n processInfo.files.push(filename)\n }\n port.unref()\n}\n`\n}\n\nconst exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_')\nexport const load = async (\n url: string,\n context: any,\n nextLoad: Function\n) => {\n if (/^file:/.test(url)) {\n const filename = fileURLToPath(url)\n if (!exclude.test(filename)) {\n if (PORT) {\n PORT.postMessage(filename)\n } else {\n // call lazily so we don't double-register\n getProcessInfo().files.push(filename)\n }\n }\n }\n return nextLoad(url, context)\n}\n"]}
1
+ {"version":3,"file":"esm.mjs","sourceRoot":"","sources":["../../lib/esm.mts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,sEAAsE;AACtE,mCAAmC;AACnC,cAAc,YAAY,CAAA;AAa1B,IAAI,IAAI,GAAuB,SAAS,CAAA;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAA0B,EAAE,EAAE;IAC1D,2DAA2D;IAC3D,sCAAsC;IACtC,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IAC9B,IAAI,GAAG,IAAI,CAAA;IACX,OAAO;;;;kCAIyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;;;;;;;;;;;CAWrD,CAAA;AACD,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAA;AAChE,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EACvB,GAAW,EACX,OAAY,EACZ,QAAkB,EAClB,EAAE;IACF,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACtB,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC3B,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;aAC3B;iBAAM;gBACL,0CAA0C;gBAC1C,cAAc,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACtC;SACF;KACF;IACD,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;AAC/B,CAAC,CAAA","sourcesContent":["// usage: node '--loader=@tapjs/processinfo/esm' foo.mjs\nimport { fileURLToPath } from 'url'\nimport type { Serializable } from 'worker_threads'\nimport { getExclude } from './get-exclude.js'\nimport { getProcessInfo } from './get-process-info.js'\nimport { resolve } from './require-resolve.js'\n\n// copy main module so that we can --loader=@tapjs/processinfo and use\n// this as the entry point as well.\nexport * from './index.js'\n\n// on Node v20, loaders are executed in a separate isolated environment\n// As a result, to register coverage and track files, we need to act in\n// the globalPreload function. The load() method posts a message with the\n// filename being loaded, because any registrations that happen in the\n// loader thread will not have any effect.\n// The check for the 'port' being undefined is to allow for support back to\n// 16.12, which had a globalPreload method, but did not have a sendMessage\n// port in that environment.\ntype GPPort = {\n postMessage: (x: Serializable) => any\n}\nlet PORT: undefined | GPPort = undefined\nexport const globalPreload = (context: { port?: GPPort }) => {\n // this will be something like path/to/dist/mjs/lib/esm.mjs\n // but we need path/to/dist/cjs/cjs.js\n const base = resolve('../cjs/cjs.js')\n const { port } = context || {}\n PORT = port\n return `\nif (typeof port !== 'undefined') {\n const { createRequire, findSourceMap } = getBuiltin('module')\n const { fileURLToPath } = getBuiltin('url')\n const require = createRequire(${JSON.stringify(base)})\n const { getProcessInfo } = require('./get-process-info.js')\n // must be called eagerly here.\n // this does all the registration as well.\n const processInfo = getProcessInfo()\n port.onmessage = (e) => {\n const filename = e.data\n processInfo.files.push(filename)\n }\n port.unref()\n}\n`\n}\n\nconst exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_', false)\nexport const load = async (\n url: string,\n context: any,\n nextLoad: Function\n) => {\n if (/^file:/.test(url)) {\n const filename = fileURLToPath(url)\n if (!exclude.test(filename)) {\n if (PORT) {\n PORT.postMessage(filename)\n } else {\n // call lazily so we don't double-register\n getProcessInfo().files.push(filename)\n }\n }\n }\n return nextLoad(url, context)\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  export declare const defaultExclude: RegExp;
2
- export declare const getExclude: (k: string) => RegExp;
2
+ export declare const getExclude: (k: string, useDefault?: boolean) => RegExp;
3
3
  //# sourceMappingURL=get-exclude.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-exclude.d.ts","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QACuG,CAAA;AAYlI,eAAO,MAAM,UAAU,MAAO,MAAM,WAKnC,CAAA"}
1
+ {"version":3,"file":"get-exclude.d.ts","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QACuG,CAAA;AAYlI,eAAO,MAAM,UAAU,MAAO,MAAM,iCAKnC,CAAA"}
@@ -10,9 +10,9 @@ const parseExclude = (src) => {
10
10
  catch (e) { }
11
11
  }
12
12
  };
13
- export const getExclude = (k) => {
13
+ export const getExclude = (k, useDefault = true) => {
14
14
  const src = process.env[k];
15
- const exclude = parseExclude(src) || defaultExclude;
15
+ const exclude = parseExclude(src) || (useDefault ? defaultExclude : /$./);
16
16
  process.env[k] = String(exclude);
17
17
  return exclude;
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-exclude.js","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GACzB,gIAAgI,CAAA;AAElI,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAsB,EAAE;IACnE,IAAI,CAAC,GAAG;QAAE,OAAM;IAChB,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAC9C,IAAI,MAAM,EAAE;QACV,IAAI;YACF,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,EAAE;IACtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,cAAc,CAAA;IACnD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["export const defaultExclude =\n /(^|[\\\\\\/])(node_modules|\\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\\\\\\/]+\\.test\\.([cm]?[jt]s|[jt]sx?)|__tests?__)([\\\\\\/]|$)/i\n\nconst parseExclude = (src: string | undefined): RegExp | undefined => {\n if (!src) return\n const parsed = src.match(/^\\/(.*)\\/([a-z]*)$/)\n if (parsed) {\n try {\n return new RegExp(parsed[1], parsed[2])\n } catch (e) {}\n }\n}\n\nexport const getExclude = (k: string) => {\n const src = process.env[k]\n const exclude = parseExclude(src) || defaultExclude\n process.env[k] = String(exclude)\n return exclude\n}\n"]}
1
+ {"version":3,"file":"get-exclude.js","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GACzB,gIAAgI,CAAA;AAElI,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAsB,EAAE;IACnE,IAAI,CAAC,GAAG;QAAE,OAAM;IAChB,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAC9C,IAAI,MAAM,EAAE;QACV,IAAI;YACF,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACzE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["export const defaultExclude =\n /(^|[\\\\\\/])(node_modules|\\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\\\\\\/]+\\.test\\.([cm]?[jt]s|[jt]sx?)|__tests?__)([\\\\\\/]|$)/i\n\nconst parseExclude = (src: string | undefined): RegExp | undefined => {\n if (!src) return\n const parsed = src.match(/^\\/(.*)\\/([a-z]*)$/)\n if (parsed) {\n try {\n return new RegExp(parsed[1], parsed[2])\n } catch (e) {}\n }\n}\n\nexport const getExclude = (k: string, useDefault = true) => {\n const src = process.env[k]\n const exclude = parseExclude(src) || (useDefault ? defaultExclude : /$./)\n process.env[k] = String(exclude)\n return exclude\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"register-cjs.d.ts","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,YAWpB,CAAA"}
1
+ {"version":3,"file":"register-cjs.d.ts","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,QAAQ,YAYpB,CAAA"}
@@ -8,7 +8,8 @@ export const register = () => {
8
8
  if (g[kRegisterCJS])
9
9
  return;
10
10
  g[kRegisterCJS] = true;
11
- const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_');
11
+ // by default we include everything in processInfo.files
12
+ const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_', false);
12
13
  addHook((code, filename) => {
13
14
  getProcessInfo().files.push(filename);
14
15
  return code;
@@ -1 +1 @@
1
- {"version":3,"file":"register-cjs.js","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;AACjE,MAAM,CAAC,GAAG,MAET,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,CAAC,YAAY,CAAC;QAAE,OAAM;IAC3B,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;IACtB,MAAM,OAAO,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAA;IACzD,OAAO,CACL,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;QACjB,cAAc,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrC,OAAO,IAAI,CAAA;IACb,CAAC,EACD,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CACxE,CAAA;AACH,CAAC,CAAA","sourcesContent":["// commonjs style loader hook, modifying require.extensions\nimport { addHook } from 'pirates'\nimport { getExclude } from './get-exclude.js'\nimport { getProcessInfo } from './get-process-info.js'\n\nconst kRegisterCJS = Symbol.for('@tapjs/processinfo.registerCJS')\nconst g = global as typeof globalThis & {\n [kRegisterCJS]?: boolean\n}\n\nexport const register = () => {\n if (g[kRegisterCJS]) return\n g[kRegisterCJS] = true\n const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_')\n addHook(\n (code, filename) => {\n getProcessInfo().files.push(filename)\n return code\n },\n { exts: ['.js', '.cjs'], matcher: filename => !exclude.test(filename) }\n )\n}\n"]}
1
+ {"version":3,"file":"register-cjs.js","sourceRoot":"","sources":["../../lib/register-cjs.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;AACjE,MAAM,CAAC,GAAG,MAET,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,CAAC,YAAY,CAAC;QAAE,OAAM;IAC3B,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;IACtB,wDAAwD;IACxD,MAAM,OAAO,GAAG,UAAU,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAA;IAChE,OAAO,CACL,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;QACjB,cAAc,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrC,OAAO,IAAI,CAAA;IACb,CAAC,EACD,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CACxE,CAAA;AACH,CAAC,CAAA","sourcesContent":["// commonjs style loader hook, modifying require.extensions\nimport { addHook } from 'pirates'\nimport { getExclude } from './get-exclude.js'\nimport { getProcessInfo } from './get-process-info.js'\n\nconst kRegisterCJS = Symbol.for('@tapjs/processinfo.registerCJS')\nconst g = global as typeof globalThis & {\n [kRegisterCJS]?: boolean\n}\n\nexport const register = () => {\n if (g[kRegisterCJS]) return\n g[kRegisterCJS] = true\n // by default we include everything in processInfo.files\n const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_', false)\n addHook(\n (code, filename) => {\n getProcessInfo().files.push(filename)\n return code\n },\n { exts: ['.js', '.cjs'], matcher: filename => !exclude.test(filename) }\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"register-env.d.ts","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,QAAQ,YAMpB,CAAA"}
1
+ {"version":3,"file":"register-env.d.ts","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,QAAQ,YAKpB,CAAA"}
@@ -5,14 +5,14 @@ const { hasOwnProperty } = Object.prototype;
5
5
  const getEnvs = (env) => {
6
6
  // load it here so that it isn't cached before the loader attaches
7
7
  // in self-test scenario.
8
- return Object.fromEntries(Object.entries(process.env)
9
- .filter(([k]) => !hasOwnProperty.call(env, k) && envRE.test(k))
10
- .concat([['NODE_OPTIONS', nodeOptionsEnv(env, process.execArgv)]]));
8
+ const e = env || process.env;
9
+ return Object.fromEntries(Object.entries(e)
10
+ .filter(([k]) => !hasOwnProperty.call(env || {}, k) && envRE.test(k))
11
+ .concat([['NODE_OPTIONS', nodeOptionsEnv(e, process.execArgv)]]));
11
12
  };
12
13
  export const register = () => {
13
14
  processOnSpawn.addListener(obj => {
14
- const env = obj.env || {};
15
- obj.env = Object.assign(env, getEnvs(env));
15
+ obj.env = Object.assign(obj.env || {}, getEnvs(obj.env));
16
16
  return obj;
17
17
  });
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"register-env.js","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,KAAK,GAAG,sBAAsB,CAAA;AACpC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AAE3C,MAAM,OAAO,GAAG,CAAC,GAAsB,EAAE,EAAE;IACzC,kEAAkE;IAClE,yBAAyB;IACzB,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;SACxB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC9D,MAAM,CAAC,CAAC,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACrE,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,CAAA;QACzB,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import processOnSpawn from 'process-on-spawn'\nimport { nodeOptionsEnv } from './node-options-env.js'\n\nconst envRE = /^_TAPJS_PROCESSINFO_/\nconst { hasOwnProperty } = Object.prototype\n\nconst getEnvs = (env: NodeJS.ProcessEnv) => {\n // load it here so that it isn't cached before the loader attaches\n // in self-test scenario.\n return Object.fromEntries(\n Object.entries(process.env)\n .filter(([k]) => !hasOwnProperty.call(env, k) && envRE.test(k))\n .concat([['NODE_OPTIONS', nodeOptionsEnv(env, process.execArgv)]])\n )\n}\n\nexport const register = () => {\n processOnSpawn.addListener(obj => {\n const env = obj.env || {}\n obj.env = Object.assign(env, getEnvs(env))\n return obj\n })\n}\n"]}
1
+ {"version":3,"file":"register-env.js","sourceRoot":"","sources":["../../lib/register-env.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,KAAK,GAAG,sBAAsB,CAAA;AACpC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS,CAAA;AAE3C,MAAM,OAAO,GAAG,CAAC,GAAuB,EAAE,EAAE;IAC1C,kEAAkE;IAClE,yBAAyB;IACzB,MAAM,CAAC,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAA;IAC5B,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;SACd,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpE,MAAM,CAAC,CAAC,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACnE,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAC/B,GAAG,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACxD,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import processOnSpawn from 'process-on-spawn'\nimport { nodeOptionsEnv } from './node-options-env.js'\n\nconst envRE = /^_TAPJS_PROCESSINFO_/\nconst { hasOwnProperty } = Object.prototype\n\nconst getEnvs = (env?: NodeJS.ProcessEnv) => {\n // load it here so that it isn't cached before the loader attaches\n // in self-test scenario.\n const e = env || process.env\n return Object.fromEntries(\n Object.entries(e)\n .filter(([k]) => !hasOwnProperty.call(env || {}, k) && envRE.test(k))\n .concat([['NODE_OPTIONS', nodeOptionsEnv(e, process.execArgv)]])\n )\n}\n\nexport const register = () => {\n processOnSpawn.addListener(obj => {\n obj.env = Object.assign(obj.env || {}, getEnvs(obj.env))\n return obj\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapjs/processinfo",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "types": "./dist/cjs/index.d.ts",
6
6
  "module": "./dist/mjs/esm.mjs",
@@ -84,6 +84,7 @@
84
84
  "prettier": "^2.6.2",
85
85
  "tap": "^16.3.0",
86
86
  "ts-node": "^10.9.1",
87
+ "typedoc": "^0.24.8",
87
88
  "typescript": "^5.0.4"
88
89
  },
89
90
  "repository": "https://github.com/tapjs/processinfo"