@tapjs/processinfo 2.2.1 → 2.2.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":"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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"esm.d.mts","sourceRoot":"","sources":["../../lib/esm.mts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAOlD,cAAc,YAAY,CAAA;AAU1B,KAAK,MAAM,GAAG;IACZ,WAAW,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,GAAG,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,aAAa,YAAa;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,WAsBvD,CAAA;AAGD,eAAO,MAAM,IAAI,QACV,MAAM,WACF,GAAG,YACF,QAAQ,iBAcnB,CAAA"}
1
+ {"version":3,"file":"esm.d.mts","sourceRoot":"","sources":["../../lib/esm.mts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAOlD,cAAc,YAAY,CAAA;AAU1B,KAAK,MAAM,GAAG;IACZ,WAAW,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,GAAG,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,aAAa,YAAa;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,WAsBvD,CAAA;AAGD,eAAO,MAAM,IAAI,QACV,MAAM,WACF,GAAG,YACF,QAAQ,iBAyBnB,CAAA"}
package/dist/mjs/esm.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  // usage: node '--loader=@tapjs/processinfo/esm' foo.mjs
2
+ import { parse } from 'path';
2
3
  import { fileURLToPath } from 'url';
3
4
  import { getExclude } from './get-exclude.js';
4
5
  import { getProcessInfo } from './get-process-info.js';
@@ -43,6 +44,17 @@ export const load = async (url, context, nextLoad) => {
43
44
  getProcessInfo().files.push(filename);
44
45
  }
45
46
  }
47
+ const { ext } = parse(filename);
48
+ // Package bins will sometimes have an extensionless bin script
49
+ // instead of just naming their extensioned file and letting npm
50
+ // symlink it for them. Don't blow up when this happens, just tell
51
+ // node that it's commonjs.
52
+ if (!ext) {
53
+ return {
54
+ format: 'commonjs',
55
+ shortCircuit: true,
56
+ };
57
+ }
46
58
  }
47
59
  return nextLoad(url, context);
48
60
  };
@@ -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,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
+ {"version":3,"file":"esm.mjs","sourceRoot":"","sources":["../../lib/esm.mts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC5B,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;QACD,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;QAC/B,+DAA+D;QAC/D,gEAAgE;QAChE,kEAAkE;QAClE,2BAA2B;QAC3B,IAAI,CAAC,GAAG,EAAE;YACR,OAAO;gBACL,MAAM,EAAE,UAAU;gBAClB,YAAY,EAAE,IAAI;aACnB,CAAA;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 { parse } from 'path'\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 const { ext } = parse(filename)\n // Package bins will sometimes have an extensionless bin script\n // instead of just naming their extensioned file and letting npm\n // symlink it for them. Don't blow up when this happens, just tell\n // node that it's commonjs.\n if (!ext) {\n return {\n format: 'commonjs',\n shortCircuit: true,\n }\n }\n }\n return nextLoad(url, context)\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.1",
3
+ "version": "2.2.3",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "types": "./dist/cjs/index.d.ts",
6
6
  "module": "./dist/mjs/esm.mjs",