@idlebox/node 1.4.0 → 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.
- package/lib/cjs/child_process/execa.cjs +2 -2
- package/lib/cjs/child_process/execa.cjs.map +1 -1
- package/lib/cjs/child_process/lateError.cjs +5 -5
- package/lib/cjs/child_process/lateError.cjs.map +1 -1
- package/lib/cjs/child_process/respawn.cjs +5 -5
- package/lib/cjs/child_process/respawn.cjs.map +1 -1
- package/lib/cjs/environment/findBinary.cjs +4 -4
- package/lib/cjs/environment/findBinary.cjs.map +1 -1
- package/lib/cjs/environment/npmConfig.cjs +2 -2
- package/lib/cjs/environment/npmConfig.cjs.map +1 -1
- package/lib/cjs/environment/pathEnvironment.cjs +3 -3
- package/lib/cjs/environment/pathEnvironment.cjs.map +1 -1
- package/lib/cjs/error/nodejs-error-code.generated.cjs +268 -217
- package/lib/cjs/error/nodejs-error-code.generated.cjs.map +1 -1
- package/lib/cjs/error/types.cjs +6 -6
- package/lib/cjs/error/types.cjs.map +1 -1
- package/lib/cjs/fs/commandExists.cjs +3 -3
- package/lib/cjs/fs/commandExists.cjs.map +1 -1
- package/lib/cjs/fs/exists.cjs +3 -3
- package/lib/cjs/fs/exists.cjs.map +1 -1
- package/lib/cjs/fs/tempFolder.cjs +2 -2
- package/lib/cjs/fs/tempFolder.cjs.map +1 -1
- package/lib/cjs/fs/weiteChanged.cjs +3 -3
- package/lib/cjs/fs/weiteChanged.cjs.map +1 -1
- package/lib/cjs/path-resolve/findPackageRoot.cjs +2 -2
- package/lib/cjs/path-resolve/findPackageRoot.cjs.map +1 -1
- package/lib/cjs/path-resolve/findUp.cjs +5 -5
- package/lib/cjs/path-resolve/findUp.cjs.map +1 -1
- package/lib/cjs/stream/collectingStream.cjs +3 -3
- package/lib/cjs/stream/collectingStream.cjs.map +1 -1
- package/lib/cjs/stream/streamPromise.cjs +5 -4
- package/lib/cjs/stream/streamPromise.cjs.map +1 -1
- package/lib/esm/__virtual_tsconfig.tsbuildinfo +1 -1
- package/lib/esm/child_process/execa.js +1 -1
- package/lib/esm/child_process/execa.js.map +1 -1
- package/lib/esm/child_process/lateError.js +2 -2
- package/lib/esm/child_process/lateError.js.map +1 -1
- package/lib/esm/child_process/respawn.js +3 -3
- package/lib/esm/child_process/respawn.js.map +1 -1
- package/lib/esm/environment/findBinary.js +2 -2
- package/lib/esm/environment/findBinary.js.map +1 -1
- package/lib/esm/environment/npmConfig.js +1 -1
- package/lib/esm/environment/npmConfig.js.map +1 -1
- package/lib/esm/environment/pathEnvironment.js +1 -1
- package/lib/esm/environment/pathEnvironment.js.map +1 -1
- package/lib/esm/error/nodejs-error-code.generated.d.ts +269 -218
- package/lib/esm/error/nodejs-error-code.generated.d.ts.map +1 -1
- package/lib/esm/error/nodejs-error-code.generated.js +268 -217
- package/lib/esm/error/nodejs-error-code.generated.js.map +1 -1
- package/lib/esm/error/types.d.ts +2 -2
- package/lib/esm/error/types.d.ts.map +1 -1
- package/lib/esm/error/types.js +2 -2
- package/lib/esm/error/types.js.map +1 -1
- package/lib/esm/fs/commandExists.js +1 -1
- package/lib/esm/fs/commandExists.js.map +1 -1
- package/lib/esm/fs/exists.js +1 -1
- package/lib/esm/fs/exists.js.map +1 -1
- package/lib/esm/fs/tempFolder.js +1 -1
- package/lib/esm/fs/tempFolder.js.map +1 -1
- package/lib/esm/fs/weiteChanged.js +1 -1
- package/lib/esm/fs/weiteChanged.js.map +1 -1
- package/lib/esm/path-resolve/findPackageRoot.js +1 -1
- package/lib/esm/path-resolve/findPackageRoot.js.map +1 -1
- package/lib/esm/path-resolve/findUp.js +1 -1
- package/lib/esm/path-resolve/findUp.js.map +1 -1
- package/lib/esm/stream/collectingStream.d.ts +1 -1
- package/lib/esm/stream/collectingStream.js +1 -1
- package/lib/esm/stream/collectingStream.js.map +1 -1
- package/lib/esm/stream/streamPromise.d.ts.map +1 -1
- package/lib/esm/stream/streamPromise.js +5 -4
- package/lib/esm/stream/streamPromise.js.map +1 -1
- package/package.json +4 -4
- package/src/child_process/execa.ts +1 -1
- package/src/child_process/lateError.ts +2 -2
- package/src/child_process/respawn.ts +3 -3
- package/src/environment/findBinary.ts +2 -2
- package/src/environment/npmConfig.ts +1 -1
- package/src/environment/pathEnvironment.ts +1 -1
- package/src/error/cache.generated.json +467 -323
- package/src/error/nodejs-error-code.generated.ts +268 -218
- package/src/error/nodejs-error-code.generator.ts +1 -1
- package/src/error/types.ts +2 -2
- package/src/fs/commandExists.ts +1 -1
- package/src/fs/exists.ts +1 -1
- package/src/fs/tempFolder.ts +1 -1
- package/src/fs/weiteChanged.ts +1 -1
- package/src/path-resolve/findPackageRoot.ts +1 -1
- package/src/path-resolve/findUp.ts +1 -1
- package/src/stream/collectingStream.ts +1 -1
- 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';
|
package/src/error/types.ts
CHANGED
|
@@ -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
|
|
package/src/fs/commandExists.ts
CHANGED
|
@@ -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) {
|
package/src/fs/tempFolder.ts
CHANGED
|
@@ -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>();
|
package/src/fs/weiteChanged.ts
CHANGED
|
@@ -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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
}
|