@idlebox/node 1.4.1 → 1.4.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.
Files changed (90) hide show
  1. package/lib/cjs/child_process/execa.cjs +2 -2
  2. package/lib/cjs/child_process/execa.cjs.map +1 -1
  3. package/lib/cjs/child_process/lateError.cjs +5 -5
  4. package/lib/cjs/child_process/lateError.cjs.map +1 -1
  5. package/lib/cjs/child_process/respawn.cjs +4 -4
  6. package/lib/cjs/child_process/respawn.cjs.map +1 -1
  7. package/lib/cjs/environment/findBinary.cjs +4 -4
  8. package/lib/cjs/environment/findBinary.cjs.map +1 -1
  9. package/lib/cjs/environment/npmConfig.cjs +2 -2
  10. package/lib/cjs/environment/npmConfig.cjs.map +1 -1
  11. package/lib/cjs/environment/pathEnvironment.cjs +3 -3
  12. package/lib/cjs/environment/pathEnvironment.cjs.map +1 -1
  13. package/lib/cjs/error/nodejs-error-code.generated.cjs +268 -217
  14. package/lib/cjs/error/nodejs-error-code.generated.cjs.map +1 -1
  15. package/lib/cjs/error/types.cjs +6 -6
  16. package/lib/cjs/error/types.cjs.map +1 -1
  17. package/lib/cjs/fs/commandExists.cjs +3 -3
  18. package/lib/cjs/fs/commandExists.cjs.map +1 -1
  19. package/lib/cjs/fs/exists.cjs +3 -3
  20. package/lib/cjs/fs/exists.cjs.map +1 -1
  21. package/lib/cjs/fs/tempFolder.cjs +2 -2
  22. package/lib/cjs/fs/tempFolder.cjs.map +1 -1
  23. package/lib/cjs/fs/weiteChanged.cjs +3 -3
  24. package/lib/cjs/fs/weiteChanged.cjs.map +1 -1
  25. package/lib/cjs/path-resolve/findPackageRoot.cjs +2 -2
  26. package/lib/cjs/path-resolve/findPackageRoot.cjs.map +1 -1
  27. package/lib/cjs/path-resolve/findUp.cjs +5 -5
  28. package/lib/cjs/path-resolve/findUp.cjs.map +1 -1
  29. package/lib/cjs/stream/collectingStream.cjs +3 -3
  30. package/lib/cjs/stream/collectingStream.cjs.map +1 -1
  31. package/lib/cjs/stream/streamPromise.cjs +5 -4
  32. package/lib/cjs/stream/streamPromise.cjs.map +1 -1
  33. package/lib/esm/__virtual_tsconfig.tsbuildinfo +1 -1
  34. package/lib/esm/child_process/execa.js +1 -1
  35. package/lib/esm/child_process/execa.js.map +1 -1
  36. package/lib/esm/child_process/lateError.js +2 -2
  37. package/lib/esm/child_process/lateError.js.map +1 -1
  38. package/lib/esm/child_process/respawn.js +2 -2
  39. package/lib/esm/child_process/respawn.js.map +1 -1
  40. package/lib/esm/environment/findBinary.js +2 -2
  41. package/lib/esm/environment/findBinary.js.map +1 -1
  42. package/lib/esm/environment/npmConfig.js +1 -1
  43. package/lib/esm/environment/npmConfig.js.map +1 -1
  44. package/lib/esm/environment/pathEnvironment.js +1 -1
  45. package/lib/esm/environment/pathEnvironment.js.map +1 -1
  46. package/lib/esm/error/nodejs-error-code.generated.d.ts +269 -218
  47. package/lib/esm/error/nodejs-error-code.generated.d.ts.map +1 -1
  48. package/lib/esm/error/nodejs-error-code.generated.js +268 -217
  49. package/lib/esm/error/nodejs-error-code.generated.js.map +1 -1
  50. package/lib/esm/error/types.d.ts +2 -2
  51. package/lib/esm/error/types.d.ts.map +1 -1
  52. package/lib/esm/error/types.js +2 -2
  53. package/lib/esm/error/types.js.map +1 -1
  54. package/lib/esm/fs/commandExists.js +1 -1
  55. package/lib/esm/fs/commandExists.js.map +1 -1
  56. package/lib/esm/fs/exists.js +1 -1
  57. package/lib/esm/fs/exists.js.map +1 -1
  58. package/lib/esm/fs/tempFolder.js +1 -1
  59. package/lib/esm/fs/tempFolder.js.map +1 -1
  60. package/lib/esm/fs/weiteChanged.js +1 -1
  61. package/lib/esm/fs/weiteChanged.js.map +1 -1
  62. package/lib/esm/path-resolve/findPackageRoot.js +1 -1
  63. package/lib/esm/path-resolve/findPackageRoot.js.map +1 -1
  64. package/lib/esm/path-resolve/findUp.js +1 -1
  65. package/lib/esm/path-resolve/findUp.js.map +1 -1
  66. package/lib/esm/stream/collectingStream.d.ts +1 -1
  67. package/lib/esm/stream/collectingStream.js +1 -1
  68. package/lib/esm/stream/collectingStream.js.map +1 -1
  69. package/lib/esm/stream/streamPromise.d.ts.map +1 -1
  70. package/lib/esm/stream/streamPromise.js +5 -4
  71. package/lib/esm/stream/streamPromise.js.map +1 -1
  72. package/package.json +6 -6
  73. package/src/child_process/execa.ts +1 -1
  74. package/src/child_process/lateError.ts +2 -2
  75. package/src/child_process/respawn.ts +2 -2
  76. package/src/environment/findBinary.ts +2 -2
  77. package/src/environment/npmConfig.ts +1 -1
  78. package/src/environment/pathEnvironment.ts +1 -1
  79. package/src/error/cache.generated.json +467 -323
  80. package/src/error/nodejs-error-code.generated.ts +268 -218
  81. package/src/error/nodejs-error-code.generator.ts +1 -1
  82. package/src/error/types.ts +2 -2
  83. package/src/fs/commandExists.ts +1 -1
  84. package/src/fs/exists.ts +1 -1
  85. package/src/fs/tempFolder.ts +1 -1
  86. package/src/fs/weiteChanged.ts +1 -1
  87. package/src/path-resolve/findPackageRoot.ts +1 -1
  88. package/src/path-resolve/findUp.ts +1 -1
  89. package/src/stream/collectingStream.ts +1 -1
  90. package/src/stream/streamPromise.ts +5 -4
@@ -2,7 +2,7 @@ import * as assert from 'assert';
2
2
  import { existsSync } from 'fs';
3
3
  import { readFile, writeFile } from 'fs/promises';
4
4
  import { resolve } from 'path';
5
- import type API_JSON from './cache.generated.json';
5
+ import type API_JSON from './cache.generated.json.js';
6
6
 
7
7
  const temp = resolve(__dirname, 'cache.generated.json');
8
8
  const API_SOURCE = 'https://nodejs.org/api/errors.json';
@@ -1,5 +1,5 @@
1
- import { LinuxError } from './linux';
2
- import { NodeError } from './nodejs-error-code.generated';
1
+ import { LinuxError } from './linux.js';
2
+ import { NodeError } from './nodejs-error-code.generated.js';
3
3
 
4
4
  type NodeException<T extends string = any> = NodeJS.ErrnoException & { code: T };
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { isWindows } from '@idlebox/common';
2
2
  import { access, constants, accessSync } from 'fs';
3
- import { PathEnvironment } from '../environment/pathEnvironment';
3
+ import { PathEnvironment } from '../environment/pathEnvironment.js';
4
4
 
5
5
  const windowsExecExtensions = ['.exe', '.bat', '.cmd', '.com', '.ps1'];
6
6
 
package/src/fs/exists.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ObjectEncodingOptions } from 'fs';
2
2
  import { access, readFile } from 'fs/promises';
3
- import { isNotExistsError } from '../error/types';
3
+ import { isNotExistsError } from '../error/types.js';
4
4
  export { existsSync } from 'fs';
5
5
 
6
6
  export async function exists(path: string) {
@@ -1,7 +1,7 @@
1
1
  import { mkdirSync, readdirSync, rmdirSync, statSync, unlinkSync } from 'fs';
2
2
  import { resolve } from 'path';
3
3
  import { IDisposable } from '@idlebox/common';
4
- import { existsSync } from './exists';
4
+ import { existsSync } from './exists.js';
5
5
 
6
6
  let registered = false;
7
7
  const tempFolders = new Set<string>();
@@ -1,6 +1,6 @@
1
1
  import { readFile as readFileAsync, readFileSync, writeFile as writeFileAsync, writeFileSync } from 'fs';
2
2
  import { promisify } from 'util';
3
- import { exists, existsSync } from './exists';
3
+ import { exists, existsSync } from './exists.js';
4
4
 
5
5
  const readFile = promisify(readFileAsync);
6
6
  const writeFile = promisify(writeFileAsync);
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'module';
2
2
  import { dirname } from 'path';
3
- import { findUpUntilSync } from './findUp';
3
+ import { findUpUntilSync } from './findUp.js';
4
4
 
5
5
  export function findPackageRoot(packageName: string, require = createRequire(process.cwd())) {
6
6
  try {
@@ -1,5 +1,5 @@
1
1
  import { dirname, resolve } from 'path';
2
- import { exists, existsSync } from '../fs/exists';
2
+ import { exists, existsSync } from '../fs/exists.js';
3
3
 
4
4
  export async function findUpUntil(from: string, file: string): Promise<string | null> {
5
5
  for (let _from = resolve(from); _from !== '/'; _from = dirname(_from)) {
@@ -1,5 +1,5 @@
1
1
  import { Writable } from 'stream';
2
- import { streamPromise } from './streamPromise';
2
+ import { streamPromise } from './streamPromise.js';
3
3
 
4
4
  export function streamToBuffer(stream: NodeJS.ReadableStream, raw: false): Promise<string>;
5
5
  export function streamToBuffer(stream: NodeJS.ReadableStream, raw: true): Promise<Buffer>;
@@ -7,10 +7,11 @@ export function streamPromise(stream: NodeJS.ReadableStream | NodeJS.WritableStr
7
7
  return Promise.resolve();
8
8
  } else {
9
9
  return new Promise((resolve, reject) => {
10
- stream.once('end', () => resolve());
11
- stream.once('finish', () => resolve());
12
- stream.once('close', () => resolve());
13
- stream.once('error', reject);
10
+ const r = stream as NodeJS.EventEmitter;
11
+ r.once('end', () => resolve());
12
+ r.once('finish', () => resolve());
13
+ r.once('close', () => resolve());
14
+ r.once('error', reject);
14
15
  });
15
16
  }
16
17
  }