bun-workspaces 1.5.0 → 1.5.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/bin/cli.js +0 -0
- package/package.json +1 -5
- package/src/1108.mjs +30 -0
- package/src/{cli/commands/commandsConfig.mjs → 2392.mjs} +52 -11
- package/src/4427.mjs +9 -0
- package/src/5166.mjs +8 -0
- package/src/8126.mjs +4 -0
- package/src/8257.mjs +4 -0
- package/src/{config/util/configLocation.mjs → 8529.mjs} +11 -2
- package/src/ai/mcp/bwMcpServer.mjs +213 -9
- package/src/ai/mcp/core/index.mjs +3 -1
- package/src/ai/mcp/core/server.mjs +1 -3
- package/src/ai/mcp/core/transport.mjs +1 -2
- package/src/ai/mcp/core/types.mjs +0 -1
- package/src/ai/mcp/index.mjs +3 -1
- package/src/ai/mcp/resources.mjs +1 -2
- package/src/ai/mcp/tools.mjs +1 -5
- package/src/cli/commands/commandHandlerUtils.mjs +2 -6
- package/src/cli/commands/commands.mjs +1 -4
- package/src/cli/commands/handleSimpleCommands.mjs +4 -10
- package/src/cli/commands/index.mjs +11 -2
- package/src/cli/commands/mcp.mjs +1 -4
- package/src/cli/commands/runScript/handleRunScript.mjs +1 -9
- package/src/cli/commands/runScript/index.mjs +3 -1
- package/src/cli/commands/runScript/output/index.mjs +3 -1
- package/src/cli/commands/runScript/output/outputStyle.mjs +1 -3
- package/src/cli/commands/runScript/output/renderGroupedOutput.mjs +1 -6
- package/src/cli/commands/runScript/output/renderPlainOutput.mjs +1 -2
- package/src/cli/commands/runScript/output/sanitizeChunk.mjs +0 -1
- package/src/cli/createCli.mjs +2 -12
- package/src/cli/fatalErrorLogger.mjs +1 -2
- package/src/cli/globalOptions/globalOptions.mjs +2 -9
- package/src/cli/globalOptions/index.mjs +3 -2
- package/src/cli/index.d.ts +1025 -3
- package/src/cli/index.mjs +3 -1
- package/src/cli/middleware.mjs +1 -3
- package/src/config/index.mjs +3 -1
- package/src/config/public.d.ts +93 -10
- package/src/config/public.mjs +2 -6
- package/src/config/rootConfig/defineRootConfig.mjs +1 -2
- package/src/config/rootConfig/errors.mjs +1 -2
- package/src/config/rootConfig/index.mjs +2 -1
- package/src/config/rootConfig/loadRootConfig.mjs +1 -4
- package/src/config/rootConfig/rootConfig.mjs +1 -6
- package/src/config/rootConfig/rootConfigSchema.mjs +0 -1
- package/src/config/userEnvVars/index.mjs +3 -1
- package/src/config/userEnvVars/userEnvVars.mjs +3 -8
- package/src/config/util/ajvTypes.mjs +2 -1
- package/src/config/util/index.mjs +2 -1
- package/src/config/util/loadConfig.mjs +1 -6
- package/src/config/util/validateConfig.mjs +0 -1
- package/src/config/workspaceConfig/defineWorkspaceConfig.mjs +1 -2
- package/src/config/workspaceConfig/errors.mjs +1 -2
- package/src/config/workspaceConfig/index.mjs +2 -1
- package/src/config/workspaceConfig/loadWorkspaceConfig.mjs +2 -8
- package/src/config/workspaceConfig/workspaceConfig.mjs +1 -5
- package/src/config/workspaceConfig/workspaceConfigSchema.mjs +0 -1
- package/src/doctor/doctor.mjs +1 -5
- package/src/doctor/index.mjs +3 -1
- package/src/index.d.ts +458 -38
- package/src/index.mjs +4 -13
- package/src/internal/bun/bunLock.mjs +2 -4
- package/src/internal/bun/bunVersion.mjs +1 -3
- package/src/internal/bun/index.mjs +3 -1
- package/src/internal/bundledDeps/commander.mjs +3843 -0
- package/src/internal/bundledDeps/shellQuote.mjs +291 -0
- package/src/internal/core/error/error.mjs +0 -1
- package/src/internal/core/error/index.mjs +3 -1
- package/src/internal/core/index.mjs +3 -1
- package/src/internal/core/json/index.mjs +3 -1
- package/src/internal/core/json/json.mjs +3 -5
- package/src/internal/core/json/jsonc.mjs +0 -1
- package/src/internal/core/language/array/index.mjs +3 -1
- package/src/internal/core/language/array/optionalArray.mjs +0 -1
- package/src/internal/core/language/asyncIterable/asyncIterableQueue.mjs +0 -1
- package/src/internal/core/language/asyncIterable/index.mjs +3 -1
- package/src/internal/core/language/asyncIterable/mergeAsyncIterables.mjs +0 -1
- package/src/internal/core/language/events/typedEventTarget.mjs +0 -1
- package/src/internal/core/language/index.mjs +3 -1
- package/src/internal/core/language/regex/index.mjs +3 -1
- package/src/internal/core/language/regex/regex.mjs +0 -1
- package/src/internal/core/language/string/id.mjs +0 -1
- package/src/internal/core/language/string/index.mjs +3 -1
- package/src/internal/core/language/string/utf/eastAsianWidth.mjs +0 -1
- package/src/internal/core/language/string/utf/visibleLength.mjs +1 -2
- package/src/internal/core/language/types/index.mjs +3 -1
- package/src/internal/core/language/types/typeof.mjs +1 -3
- package/src/internal/core/language/types/types.mjs +3 -2
- package/src/internal/core/runtime/env.mjs +0 -1
- package/src/internal/core/runtime/index.mjs +3 -1
- package/src/internal/core/runtime/onExit.mjs +2 -3
- package/src/internal/core/runtime/os.mjs +1 -3
- package/src/internal/core/runtime/tempFile.mjs +1 -9
- package/src/internal/core/runtime/terminal.mjs +0 -1
- package/src/internal/generated/aiDocs/.gitkeep.mjs +1 -0
- package/src/internal/generated/aiDocs/docs.mjs +0 -1
- package/src/internal/logger/index.mjs +3 -1
- package/src/internal/logger/logger.mjs +4 -14
- package/src/internal/version.mjs +1 -2
- package/src/project/errors.mjs +1 -2
- package/src/project/implementations/fileSystemProject.mjs +3 -18
- package/src/project/implementations/memoryProject.mjs +1 -5
- package/src/project/implementations/projectBase.mjs +10 -19
- package/src/project/index.mjs +3 -1
- package/src/project/project.mjs +2 -1
- package/src/rslib-runtime.mjs +62 -0
- package/src/runScript/index.mjs +3 -1
- package/src/runScript/output/index.mjs +3 -1
- package/src/runScript/output/multiProcessOutput.mjs +1 -2
- package/src/runScript/output/outputStream.mjs +1 -1
- package/src/runScript/output/processOutput.mjs +1 -2
- package/src/runScript/parallel.mjs +4 -10
- package/src/runScript/recursion.mjs +1 -2
- package/src/runScript/runScript.mjs +1 -4
- package/src/runScript/runScripts.mjs +1 -6
- package/src/runScript/scriptCommand.mjs +1 -2
- package/src/runScript/scriptExecution.mjs +1 -3
- package/src/runScript/scriptRuntimeMetadata.mjs +38 -56
- package/src/runScript/scriptShellOption.mjs +5 -14
- package/src/runScript/subprocesses.mjs +4 -4
- package/src/workspaces/dependencyGraph/cycles.mjs +0 -1
- package/src/workspaces/dependencyGraph/index.mjs +3 -1
- package/src/workspaces/dependencyGraph/resolveDependencies.mjs +1 -2
- package/src/workspaces/dependencyGraph/validateDependencyRules.mjs +1 -3
- package/src/workspaces/errors.mjs +1 -2
- package/src/workspaces/findWorkspaces.mjs +1 -11
- package/src/workspaces/index.mjs +3 -1
- package/src/workspaces/packageJson.mjs +2 -7
- package/src/workspaces/workspace.mjs +2 -1
- package/src/workspaces/workspacePattern.mjs +4 -4
- package/src/ai/mcp/bwMcpServer.d.ts +0 -4
- package/src/ai/mcp/core/index.d.ts +0 -3
- package/src/ai/mcp/core/server.d.ts +0 -14
- package/src/ai/mcp/core/transport.d.ts +0 -12
- package/src/ai/mcp/core/types.d.ts +0 -104
- package/src/ai/mcp/index.d.ts +0 -2
- package/src/ai/mcp/resources.d.ts +0 -6
- package/src/ai/mcp/tools.d.ts +0 -6
- package/src/cli/commands/commandHandlerUtils.d.ts +0 -51
- package/src/cli/commands/commands.d.ts +0 -10
- package/src/cli/commands/commandsConfig.d.ts +0 -436
- package/src/cli/commands/handleSimpleCommands.d.ts +0 -21
- package/src/cli/commands/index.d.ts +0 -4
- package/src/cli/commands/mcp.d.ts +0 -3
- package/src/cli/commands/runScript/handleRunScript.d.ts +0 -3
- package/src/cli/commands/runScript/index.d.ts +0 -2
- package/src/cli/commands/runScript/output/index.d.ts +0 -1
- package/src/cli/commands/runScript/output/outputStyle.d.ts +0 -9
- package/src/cli/commands/runScript/output/renderGroupedOutput.d.ts +0 -75
- package/src/cli/commands/runScript/output/renderPlainOutput.d.ts +0 -24
- package/src/cli/commands/runScript/output/sanitizeChunk.d.ts +0 -4
- package/src/cli/createCli.d.ts +0 -26
- package/src/cli/fatalErrorLogger.d.ts +0 -1
- package/src/cli/globalOptions/globalOptions.d.ts +0 -43
- package/src/cli/globalOptions/globalOptionsConfig.d.ts +0 -52
- package/src/cli/globalOptions/globalOptionsConfig.mjs +0 -43
- package/src/cli/globalOptions/index.d.ts +0 -2
- package/src/cli/middleware.d.ts +0 -83
- package/src/config/index.d.ts +0 -3
- package/src/config/rootConfig/defineRootConfig.d.ts +0 -4
- package/src/config/rootConfig/errors.d.ts +0 -1
- package/src/config/rootConfig/index.d.ts +0 -5
- package/src/config/rootConfig/loadRootConfig.d.ts +0 -3
- package/src/config/rootConfig/rootConfig.d.ts +0 -25
- package/src/config/rootConfig/rootConfigLocation.d.ts +0 -2
- package/src/config/rootConfig/rootConfigLocation.mjs +0 -5
- package/src/config/rootConfig/rootConfigSchema.d.ts +0 -21
- package/src/config/userEnvVars/index.d.ts +0 -1
- package/src/config/userEnvVars/userEnvVars.d.ts +0 -13
- package/src/config/util/ajvTypes.d.ts +0 -10
- package/src/config/util/configLocation.d.ts +0 -18
- package/src/config/util/index.d.ts +0 -4
- package/src/config/util/loadConfig.d.ts +0 -18
- package/src/config/util/validateConfig.d.ts +0 -8
- package/src/config/workspaceConfig/defineWorkspaceConfig.d.ts +0 -7
- package/src/config/workspaceConfig/errors.d.ts +0 -1
- package/src/config/workspaceConfig/index.d.ts +0 -5
- package/src/config/workspaceConfig/loadWorkspaceConfig.d.ts +0 -3
- package/src/config/workspaceConfig/workspaceConfig.d.ts +0 -56
- package/src/config/workspaceConfig/workspaceConfigLocation.d.ts +0 -2
- package/src/config/workspaceConfig/workspaceConfigLocation.mjs +0 -5
- package/src/config/workspaceConfig/workspaceConfigSchema.d.ts +0 -56
- package/src/doctor/doctor.d.ts +0 -35
- package/src/doctor/index.d.ts +0 -1
- package/src/internal/bun/bunLock.d.ts +0 -20
- package/src/internal/bun/bunVersion.d.ts +0 -21
- package/src/internal/bun/index.d.ts +0 -2
- package/src/internal/core/error/error.d.ts +0 -13
- package/src/internal/core/error/index.d.ts +0 -1
- package/src/internal/core/index.d.ts +0 -4
- package/src/internal/core/json/index.d.ts +0 -2
- package/src/internal/core/json/json.d.ts +0 -49
- package/src/internal/core/json/jsonc.d.ts +0 -9
- package/src/internal/core/language/array/index.d.ts +0 -1
- package/src/internal/core/language/array/optionalArray.d.ts +0 -15
- package/src/internal/core/language/asyncIterable/asyncIterableQueue.d.ts +0 -16
- package/src/internal/core/language/asyncIterable/index.d.ts +0 -2
- package/src/internal/core/language/asyncIterable/mergeAsyncIterables.d.ts +0 -5
- package/src/internal/core/language/events/typedEventTarget.d.ts +0 -50
- package/src/internal/core/language/index.d.ts +0 -5
- package/src/internal/core/language/regex/index.d.ts +0 -1
- package/src/internal/core/language/regex/regex.d.ts +0 -3
- package/src/internal/core/language/string/id.d.ts +0 -1
- package/src/internal/core/language/string/index.d.ts +0 -1
- package/src/internal/core/language/string/utf/eastAsianWidth.d.ts +0 -16
- package/src/internal/core/language/string/utf/visibleLength.d.ts +0 -5
- package/src/internal/core/language/types/index.d.ts +0 -2
- package/src/internal/core/language/types/typeof.d.ts +0 -102
- package/src/internal/core/language/types/types.d.ts +0 -19
- package/src/internal/core/runtime/env.d.ts +0 -6
- package/src/internal/core/runtime/index.d.ts +0 -5
- package/src/internal/core/runtime/onExit.d.ts +0 -4
- package/src/internal/core/runtime/os.d.ts +0 -6
- package/src/internal/core/runtime/tempFile.d.ts +0 -20
- package/src/internal/core/runtime/terminal.d.ts +0 -1
- package/src/internal/docs/apiQuickstart.d.ts +0 -3
- package/src/internal/docs/apiQuickstart.mjs +0 -132
- package/src/internal/docs/cliQuickstart.d.ts +0 -2
- package/src/internal/docs/cliQuickstart.mjs +0 -86
- package/src/internal/docs/index.d.ts +0 -2
- package/src/internal/docs/index.mjs +0 -2
- package/src/internal/generated/aiDocs/docs.d.ts +0 -10
- package/src/internal/logger/index.d.ts +0 -1
- package/src/internal/logger/logger.d.ts +0 -45
- package/src/internal/version.d.ts +0 -1
- package/src/project/errors.d.ts +0 -5
- package/src/project/implementations/fileSystemProject.d.ts +0 -148
- package/src/project/implementations/memoryProject.d.ts +0 -41
- package/src/project/implementations/projectBase.d.ts +0 -37
- package/src/project/index.d.ts +0 -5
- package/src/project/project.d.ts +0 -79
- package/src/runScript/index.d.ts +0 -7
- package/src/runScript/output/index.d.ts +0 -3
- package/src/runScript/output/multiProcessOutput.d.ts +0 -14
- package/src/runScript/output/outputStream.d.ts +0 -1
- package/src/runScript/output/processOutput.d.ts +0 -33
- package/src/runScript/parallel.d.ts +0 -24
- package/src/runScript/recursion.d.ts +0 -4
- package/src/runScript/runScript.d.ts +0 -45
- package/src/runScript/runScripts.d.ts +0 -65
- package/src/runScript/scriptCommand.d.ts +0 -33
- package/src/runScript/scriptExecution.d.ts +0 -9
- package/src/runScript/scriptRuntimeMetadata.d.ts +0 -73
- package/src/runScript/scriptShellOption.d.ts +0 -8
- package/src/runScript/subprocesses.d.ts +0 -11
- package/src/workspaces/dependencyGraph/cycles.d.ts +0 -9
- package/src/workspaces/dependencyGraph/index.d.ts +0 -3
- package/src/workspaces/dependencyGraph/resolveDependencies.d.ts +0 -18
- package/src/workspaces/dependencyGraph/validateDependencyRules.d.ts +0 -7
- package/src/workspaces/errors.d.ts +0 -14
- package/src/workspaces/findWorkspaces.d.ts +0 -24
- package/src/workspaces/index.d.ts +0 -4
- package/src/workspaces/packageJson.d.ts +0 -31
- package/src/workspaces/workspace.d.ts +0 -21
- package/src/workspaces/workspacePattern.d.ts +0 -22
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export declare const WORKSPACE_CONFIG_JSON_SCHEMA: {
|
|
2
|
-
readonly type: "object";
|
|
3
|
-
readonly additionalProperties: false;
|
|
4
|
-
readonly properties: {
|
|
5
|
-
readonly alias: {
|
|
6
|
-
readonly type: readonly ["string", "array"];
|
|
7
|
-
readonly items: {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
};
|
|
10
|
-
readonly uniqueItems: true;
|
|
11
|
-
};
|
|
12
|
-
readonly tags: {
|
|
13
|
-
readonly type: "array";
|
|
14
|
-
readonly items: {
|
|
15
|
-
readonly type: "string";
|
|
16
|
-
};
|
|
17
|
-
readonly uniqueItems: true;
|
|
18
|
-
};
|
|
19
|
-
readonly scripts: {
|
|
20
|
-
readonly type: "object";
|
|
21
|
-
readonly additionalProperties: {
|
|
22
|
-
readonly type: "object";
|
|
23
|
-
readonly properties: {
|
|
24
|
-
readonly order: {
|
|
25
|
-
readonly type: "number";
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
readonly additionalProperties: false;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
readonly rules: {
|
|
32
|
-
readonly type: "object";
|
|
33
|
-
readonly additionalProperties: false;
|
|
34
|
-
readonly properties: {
|
|
35
|
-
readonly workspaceDependencies: {
|
|
36
|
-
readonly type: "object";
|
|
37
|
-
readonly properties: {
|
|
38
|
-
readonly allowPatterns: {
|
|
39
|
-
readonly type: "array";
|
|
40
|
-
readonly items: {
|
|
41
|
-
readonly type: "string";
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
readonly denyPatterns: {
|
|
45
|
-
readonly type: "array";
|
|
46
|
-
readonly items: {
|
|
47
|
-
readonly type: "string";
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
readonly additionalProperties: false;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
};
|
package/src/doctor/doctor.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Simplify } from "../internal/core";
|
|
2
|
-
declare const getBinaryInfo: () => {
|
|
3
|
-
binary: {
|
|
4
|
-
exec: string;
|
|
5
|
-
path: string | null;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
declare const getShellInfo: () => {
|
|
9
|
-
shell: {
|
|
10
|
-
binary: string | null;
|
|
11
|
-
terminal: string | null;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
declare const getSystemInfo: () => {
|
|
15
|
-
os: {
|
|
16
|
-
type: string;
|
|
17
|
-
platform: NodeJS.Platform;
|
|
18
|
-
arch: NodeJS.Architecture;
|
|
19
|
-
release: string;
|
|
20
|
-
version: string;
|
|
21
|
-
cpuCount: number;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
declare const getVersionInfo: () => {
|
|
25
|
-
version: string;
|
|
26
|
-
bunVersion: string;
|
|
27
|
-
};
|
|
28
|
-
export type DoctorInfo = Simplify<
|
|
29
|
-
ReturnType<typeof getVersionInfo> &
|
|
30
|
-
ReturnType<typeof getBinaryInfo> &
|
|
31
|
-
ReturnType<typeof getSystemInfo> &
|
|
32
|
-
ReturnType<typeof getShellInfo>
|
|
33
|
-
>;
|
|
34
|
-
export declare const getDoctorInfo: () => DoctorInfo;
|
|
35
|
-
export {};
|
package/src/doctor/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./doctor";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type BunWorkspacesError } from "../core";
|
|
2
|
-
export declare const BUN_LOCK_ERRORS: import("../core").DefinedErrors<
|
|
3
|
-
"BunLockNotFound" | "MalformedBunLock" | "UnsupportedBunLockVersion"
|
|
4
|
-
>;
|
|
5
|
-
export type RelevantBunLockWorkspace = {
|
|
6
|
-
name: string;
|
|
7
|
-
};
|
|
8
|
-
export type RelevantBunLock = {
|
|
9
|
-
lockfileVersion: number;
|
|
10
|
-
workspaces: Record<string, RelevantBunLockWorkspace>;
|
|
11
|
-
};
|
|
12
|
-
export declare const SUPPORTED_BUN_LOCK_VERSIONS: readonly [1];
|
|
13
|
-
export declare const parseBunLock: (
|
|
14
|
-
jsonString: string,
|
|
15
|
-
/** Only for error message */
|
|
16
|
-
bunLockPath?: string,
|
|
17
|
-
) => RelevantBunLock | BunWorkspacesError;
|
|
18
|
-
export declare const readBunLockfile: (
|
|
19
|
-
directory: string,
|
|
20
|
-
) => RelevantBunLock | BunWorkspacesError;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const LIBRARY_CONSUMER_BUN_VERSION: string;
|
|
2
|
-
export declare const BUILD_BUN_VERSION: string;
|
|
3
|
-
export declare const BUN_VERSION_ERRORS: import("../core").DefinedErrors<
|
|
4
|
-
"InvalidBunVersion" | "NotBunRuntime"
|
|
5
|
-
>;
|
|
6
|
-
export declare const getRequiredBunVersion: (isBuild?: boolean) => string;
|
|
7
|
-
/**
|
|
8
|
-
* Validates that the provided version satisfies the required Bun version
|
|
9
|
-
* specified in the root `package.json`.
|
|
10
|
-
*/
|
|
11
|
-
export declare const validateBunVersion: (
|
|
12
|
-
version: string,
|
|
13
|
-
isBuild?: boolean,
|
|
14
|
-
) => import("../core").BunWorkspacesError | null;
|
|
15
|
-
/**
|
|
16
|
-
* Validates that the Bun version of the current script satisfies the
|
|
17
|
-
* required Bun version specified in the root `package.json`.
|
|
18
|
-
*/
|
|
19
|
-
export declare const validateCurrentBunVersion: (
|
|
20
|
-
build?: boolean,
|
|
21
|
-
) => import("../core").BunWorkspacesError | null;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare class BunWorkspacesError extends Error {
|
|
2
|
-
name: string;
|
|
3
|
-
}
|
|
4
|
-
export type DefinedErrors<ErrorName extends string> = {
|
|
5
|
-
[name in ErrorName]: typeof BunWorkspacesError;
|
|
6
|
-
};
|
|
7
|
-
export declare function defineErrors<ErrorName extends string>(
|
|
8
|
-
parentError: typeof BunWorkspacesError,
|
|
9
|
-
...errorNames: ErrorName[]
|
|
10
|
-
): DefinedErrors<ErrorName>;
|
|
11
|
-
export declare function defineErrors<ErrorName extends string>(
|
|
12
|
-
...errorNames: ErrorName[]
|
|
13
|
-
): DefinedErrors<ErrorName>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./error";
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
type JSONPrimitiveMap = {
|
|
2
|
-
string: string;
|
|
3
|
-
number: number;
|
|
4
|
-
boolean: boolean;
|
|
5
|
-
null: null;
|
|
6
|
-
};
|
|
7
|
-
export type JSONPrimitiveName = keyof JSONPrimitiveMap;
|
|
8
|
-
export type JSONPrimitiveToName<P extends JSONPrimitive> = {
|
|
9
|
-
[key in keyof JSONPrimitiveMap]: P extends JSONPrimitiveMap[key]
|
|
10
|
-
? key
|
|
11
|
-
: never;
|
|
12
|
-
}[keyof JSONPrimitiveMap];
|
|
13
|
-
export type NameToJSONPrimitive<Name extends JSONPrimitiveName> =
|
|
14
|
-
JSONPrimitiveMap[Name];
|
|
15
|
-
export type JSONPrimitive<N extends JSONPrimitiveName = JSONPrimitiveName> =
|
|
16
|
-
NameToJSONPrimitive<N>;
|
|
17
|
-
export interface JSONObject {
|
|
18
|
-
[key: string]: JSONData;
|
|
19
|
-
}
|
|
20
|
-
export type JSONItem = JSONPrimitive | JSONObject;
|
|
21
|
-
export type JSONArrayItem =
|
|
22
|
-
| JSONItem
|
|
23
|
-
| JSONItem[]
|
|
24
|
-
| JSONItem[][]
|
|
25
|
-
| JSONItem[][][]
|
|
26
|
-
| JSONItem[][][][]
|
|
27
|
-
| JSONItem[][][][][]
|
|
28
|
-
| JSONItem[][][][][][]
|
|
29
|
-
| JSONItem[][][][][][][]
|
|
30
|
-
| JSONItem[][][][][][][][]
|
|
31
|
-
| JSONItem[][][][][][][][][]
|
|
32
|
-
| JSONItem[][][][][][][][][][]
|
|
33
|
-
| JSONItem[][][][][][][][][][][];
|
|
34
|
-
export type JSONArray<Item extends JSONArrayItem = JSONArrayItem> = Item[];
|
|
35
|
-
export type JSONArrayToItem<A extends JSONArray> = A extends (infer Item)[]
|
|
36
|
-
? Item
|
|
37
|
-
: never;
|
|
38
|
-
export type JSONData = JSONPrimitive | JSONObject | JSONArray;
|
|
39
|
-
export declare const isJSONPrimitive: (
|
|
40
|
-
value: unknown,
|
|
41
|
-
) => value is JSONPrimitive;
|
|
42
|
-
export declare const isJSONArray: <T extends JSONArray = JSONArray>(
|
|
43
|
-
value: unknown,
|
|
44
|
-
) => value is T;
|
|
45
|
-
export declare const isJSONObject: <T extends JSONObject = JSONObject>(
|
|
46
|
-
value: unknown,
|
|
47
|
-
) => value is T;
|
|
48
|
-
export declare const isJSON: (value: unknown) => value is JSONData;
|
|
49
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./optionalArray";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A value that may be its type T or an array of T.
|
|
3
|
-
*/
|
|
4
|
-
export type OptionalArray<
|
|
5
|
-
T = unknown,
|
|
6
|
-
IncludeReadonly extends boolean = false,
|
|
7
|
-
> = IncludeReadonly extends true ? T | T[] | readonly T[] : T | T[];
|
|
8
|
-
export type ResolvedOptionalArray<T extends OptionalArray> =
|
|
9
|
-
T extends (infer Item)[] ? Item[] : T[];
|
|
10
|
-
export type ResolvedOptionalArrayItem<T extends OptionalArray> =
|
|
11
|
-
T extends (infer Item)[] ? Item : T;
|
|
12
|
-
/** Resolve `OptionalArray<T>` to `T[]` */
|
|
13
|
-
export declare const resolveOptionalArray: <T extends OptionalArray>(
|
|
14
|
-
value: T,
|
|
15
|
-
) => ResolvedOptionalArray<T>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SimpleAsyncIterable } from "../types";
|
|
2
|
-
export type AsyncQueueItem<T> =
|
|
3
|
-
| {
|
|
4
|
-
type: "value";
|
|
5
|
-
value: T;
|
|
6
|
-
}
|
|
7
|
-
| {
|
|
8
|
-
type: "done";
|
|
9
|
-
};
|
|
10
|
-
export declare const createAsyncIterableQueue: <
|
|
11
|
-
T,
|
|
12
|
-
>() => SimpleAsyncIterable<T> & {
|
|
13
|
-
push: (value: T) => void;
|
|
14
|
-
close: () => void;
|
|
15
|
-
closed: Promise<void>;
|
|
16
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { SimpleAsyncIterable } from "../types";
|
|
2
|
-
/** Run multiple async iterables in parallel and yield the results in the order they are completed. */
|
|
3
|
-
export declare const mergeAsyncIterables: <T>(
|
|
4
|
-
iterables: SimpleAsyncIterable<T>[],
|
|
5
|
-
) => SimpleAsyncIterable<T>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export type TypedEvent<
|
|
2
|
-
TypeName extends string = string,
|
|
3
|
-
ExtraProperties extends object = object,
|
|
4
|
-
> = Event & {
|
|
5
|
-
type: TypeName;
|
|
6
|
-
} & ExtraProperties;
|
|
7
|
-
export declare const TypedEvent: {
|
|
8
|
-
prototype: TypedEvent;
|
|
9
|
-
new <TypeName extends string = string>(
|
|
10
|
-
type: TypeName,
|
|
11
|
-
options?: EventInit,
|
|
12
|
-
): TypedEvent<TypeName>;
|
|
13
|
-
};
|
|
14
|
-
type ExtraProperties<E> =
|
|
15
|
-
E extends TypedEvent<string, infer ExtraProperties>
|
|
16
|
-
? Omit<ExtraProperties, "type">
|
|
17
|
-
: undefined;
|
|
18
|
-
export declare const createTypedEventFactory: <
|
|
19
|
-
E extends TypedEvent = TypedEvent,
|
|
20
|
-
>(
|
|
21
|
-
type: E["type"],
|
|
22
|
-
) => (properties: ExtraProperties<E>, options?: EventInit) => E;
|
|
23
|
-
export type EventConfig = {
|
|
24
|
-
[key: string]: TypedEvent;
|
|
25
|
-
};
|
|
26
|
-
type EventFromName<
|
|
27
|
-
E extends keyof Config,
|
|
28
|
-
Config extends EventConfig,
|
|
29
|
-
> = Config[E];
|
|
30
|
-
export interface TypedEventTarget<Config extends EventConfig = EventConfig> {
|
|
31
|
-
addEventListener<EventName extends keyof Config>(
|
|
32
|
-
event: EventName,
|
|
33
|
-
listener: (event: EventFromName<EventName, Config>) => unknown,
|
|
34
|
-
): void;
|
|
35
|
-
removeEventListener<EventName extends keyof Config>(
|
|
36
|
-
event: EventName,
|
|
37
|
-
listener: (event: EventFromName<EventName, Config>) => unknown,
|
|
38
|
-
): void;
|
|
39
|
-
dispatchEvent<EventName extends keyof Config>(
|
|
40
|
-
event: EventFromName<EventName, Config>,
|
|
41
|
-
): boolean;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* An EventTarget with typing for specific events.
|
|
45
|
-
*/
|
|
46
|
-
export declare const TypedEventTarget: {
|
|
47
|
-
prototype: TypedEventTarget;
|
|
48
|
-
new <Config extends EventConfig = EventConfig>(): TypedEventTarget<Config>;
|
|
49
|
-
};
|
|
50
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./regex";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createShortId: (bytes?: number) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./id";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** A port of the package eastasianwidth */
|
|
2
|
-
export declare const eaw: {
|
|
3
|
-
/**
|
|
4
|
-
* F: Full width
|
|
5
|
-
* H: Half width
|
|
6
|
-
* W: Wide
|
|
7
|
-
* Na: Narrow
|
|
8
|
-
* A: Ambiguous
|
|
9
|
-
* N: Neutral
|
|
10
|
-
*/
|
|
11
|
-
eastAsianWidth: (character: string) => "F" | "H" | "W" | "Na" | "A" | "N";
|
|
12
|
-
characterLength: (character: string) => 1 | 2;
|
|
13
|
-
stringToArray: (s: string) => [] | RegExpMatchArray;
|
|
14
|
-
length: (string: string) => number;
|
|
15
|
-
slice: (text: string, start: number, end: number) => string;
|
|
16
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { type OptionalArray } from "../array/optionalArray";
|
|
2
|
-
import { type AnyFunction } from "./types";
|
|
3
|
-
export declare const InvalidJSTypeError: typeof import("../..").BunWorkspacesError;
|
|
4
|
-
export declare const InvalidJSNumberError: typeof import("../..").BunWorkspacesError;
|
|
5
|
-
export declare const VALIDATE_NUMBER_ERRORS: import("../..").DefinedErrors<
|
|
6
|
-
"NoNaN" | "NoNonFinite" | "NoInfinity" | "NoNegInfinity"
|
|
7
|
-
>;
|
|
8
|
-
export declare const VALIDATE_TYPEOF_ERRORS: import("../..").DefinedErrors<
|
|
9
|
-
"NoNull" | "InvalidType"
|
|
10
|
-
>;
|
|
11
|
-
interface JSTypeofToTypeMap {
|
|
12
|
-
string: string;
|
|
13
|
-
number: number;
|
|
14
|
-
boolean: boolean;
|
|
15
|
-
undefined: undefined;
|
|
16
|
-
bigint: bigint;
|
|
17
|
-
function: (...args: unknown[]) => unknown;
|
|
18
|
-
object: null | object;
|
|
19
|
-
symbol: symbol;
|
|
20
|
-
}
|
|
21
|
-
export type JSDataTypeofName = keyof JSTypeofToTypeMap;
|
|
22
|
-
export type TypeToJSTypeofName<T> = {
|
|
23
|
-
[K in keyof JSTypeofToTypeMap]: T extends AnyFunction
|
|
24
|
-
? "function"
|
|
25
|
-
: T extends JSTypeofToTypeMap[K]
|
|
26
|
-
? K
|
|
27
|
-
: never;
|
|
28
|
-
}[keyof JSTypeofToTypeMap];
|
|
29
|
-
export type JSTypeofNameToType<Name extends JSDataTypeofName> =
|
|
30
|
-
JSTypeofToTypeMap[Name];
|
|
31
|
-
export type TypeToJSTypeof<T> = JSTypeofNameToType<TypeToJSTypeofName<T>>;
|
|
32
|
-
export declare const isTypeof: <T, D extends JSDataTypeofName>(
|
|
33
|
-
value: T,
|
|
34
|
-
...types: D[]
|
|
35
|
-
) => value is Extract<T, JSTypeofNameToType<D>>;
|
|
36
|
-
export declare const isPlainObject: (value: unknown) => value is object;
|
|
37
|
-
export type ValidateNumberRules = {
|
|
38
|
-
noNaN?: boolean;
|
|
39
|
-
noNonFinite?: boolean;
|
|
40
|
-
noInfinity?: boolean;
|
|
41
|
-
noNegInfinity?: boolean;
|
|
42
|
-
};
|
|
43
|
-
export type ValidateJSTypeOptions = {
|
|
44
|
-
value: unknown;
|
|
45
|
-
typeofName: OptionalArray<JSDataTypeofName>;
|
|
46
|
-
/** For use in error message */
|
|
47
|
-
valueLabel?: string;
|
|
48
|
-
numberRules?: ValidateNumberRules;
|
|
49
|
-
optional?: boolean;
|
|
50
|
-
};
|
|
51
|
-
export type ValidateJSTypesTypeEntry = Omit<
|
|
52
|
-
ValidateJSTypeOptions,
|
|
53
|
-
"valueLabel"
|
|
54
|
-
> & {
|
|
55
|
-
array?: false;
|
|
56
|
-
};
|
|
57
|
-
export type ValidateJSTypesArrayEntry = Omit<
|
|
58
|
-
ValidateJSArrayOptions,
|
|
59
|
-
"valueLabel"
|
|
60
|
-
> & {
|
|
61
|
-
array: true;
|
|
62
|
-
};
|
|
63
|
-
export type ValidateJSTypesConfigEntry =
|
|
64
|
-
| ValidateJSTypesTypeEntry
|
|
65
|
-
| ValidateJSTypesArrayEntry;
|
|
66
|
-
export type ValidateJSTypesConfig = {
|
|
67
|
-
[valueLabel: string]: ValidateJSTypesConfigEntry;
|
|
68
|
-
};
|
|
69
|
-
export declare const validateNumber: (
|
|
70
|
-
value: number,
|
|
71
|
-
rules: ValidateNumberRules,
|
|
72
|
-
valueLabel?: string,
|
|
73
|
-
) => InstanceType<typeof InvalidJSNumberError> | null;
|
|
74
|
-
export declare const validateJSType: ({
|
|
75
|
-
value,
|
|
76
|
-
typeofName,
|
|
77
|
-
numberRules,
|
|
78
|
-
valueLabel,
|
|
79
|
-
optional,
|
|
80
|
-
}: ValidateJSTypeOptions) => InstanceType<typeof InvalidJSTypeError> | null;
|
|
81
|
-
export type ValidateJSArrayOptions = {
|
|
82
|
-
value: unknown;
|
|
83
|
-
/** For use in error messages */
|
|
84
|
-
valueLabel?: string;
|
|
85
|
-
optional?: boolean;
|
|
86
|
-
/** Options to validate each item in the array */
|
|
87
|
-
itemOptions?: Omit<ValidateJSTypeOptions, "value" | "valueLabel">;
|
|
88
|
-
};
|
|
89
|
-
export declare const validateJSArray: ({
|
|
90
|
-
value,
|
|
91
|
-
valueLabel,
|
|
92
|
-
optional,
|
|
93
|
-
itemOptions,
|
|
94
|
-
}: ValidateJSArrayOptions) => InstanceType<typeof InvalidJSTypeError> | null;
|
|
95
|
-
export type ValidateJSTypesOptions = {
|
|
96
|
-
throw?: boolean;
|
|
97
|
-
};
|
|
98
|
-
export declare const validateJSTypes: (
|
|
99
|
-
config: ValidateJSTypesConfig,
|
|
100
|
-
options?: ValidateJSTypesOptions,
|
|
101
|
-
) => InstanceType<typeof InvalidJSTypeError> | null;
|
|
102
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Does not change an object type, but remaps it for cleaner Intellisense only */
|
|
2
|
-
export type Simplify<T extends object> = {
|
|
3
|
-
[K in keyof T]: T[K];
|
|
4
|
-
};
|
|
5
|
-
/** A normal `AsyncIterable` that is only intended for `for await` style iteration */
|
|
6
|
-
export type SimpleAsyncIterable<T> = AsyncIterable<T, void, undefined>;
|
|
7
|
-
export type AnyFunction<Args extends unknown[] = any[], Return = any> = (
|
|
8
|
-
...args: Args
|
|
9
|
-
) => Return;
|
|
10
|
-
export type RequiredDeep<T> = T extends object
|
|
11
|
-
? Required<{
|
|
12
|
-
[K in keyof T]: RequiredDeep<T[K]>;
|
|
13
|
-
}>
|
|
14
|
-
: T;
|
|
15
|
-
export type PartialDeep<T> = T extends object
|
|
16
|
-
? Partial<{
|
|
17
|
-
[K in keyof T]: PartialDeep<T[K]>;
|
|
18
|
-
}>
|
|
19
|
-
: T;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type RuntimeMode = "development" | "production" | "test";
|
|
2
|
-
export declare const RUNTIME_MODE: RuntimeMode;
|
|
3
|
-
export declare const IS_INTERNAL_TEST: boolean;
|
|
4
|
-
export declare const IS_TEST: boolean;
|
|
5
|
-
export declare const IS_PRODUCTION: boolean;
|
|
6
|
-
export declare const IS_DEVELOPMENT: boolean;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const IS_WINDOWS: boolean;
|
|
2
|
-
export declare const IS_MACOS: boolean;
|
|
3
|
-
export declare const IS_LINUX: boolean;
|
|
4
|
-
export declare const IS_POSIX: boolean;
|
|
5
|
-
/** Expands a leading `~` or `~/` to the user's home directory */
|
|
6
|
-
export declare const expandHomePath: (filePath: string) => string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
export type CreateTempFileOptions = {
|
|
3
|
-
name: string;
|
|
4
|
-
content: string;
|
|
5
|
-
mode?: fs.Mode;
|
|
6
|
-
};
|
|
7
|
-
declare class TempDir {
|
|
8
|
-
readonly id: string;
|
|
9
|
-
readonly dir: string;
|
|
10
|
-
constructor();
|
|
11
|
-
initialize(clean?: boolean): void;
|
|
12
|
-
createFilePath(fileName: string): string;
|
|
13
|
-
createFile({ name, content, mode }: CreateTempFileOptions): {
|
|
14
|
-
filePath: string;
|
|
15
|
-
cleanup: () => void;
|
|
16
|
-
};
|
|
17
|
-
cleanup(): void;
|
|
18
|
-
}
|
|
19
|
-
export declare let DEFAULT_TEMP_DIR: TempDir;
|
|
20
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const IS_TTY: boolean;
|