@decohere/core 0.0.1-dev.117 → 0.0.1-dev.119

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 (125) hide show
  1. package/commonjs/src/caching/cache-manager.js +3 -3
  2. package/commonjs/src/caching/index.js +1 -1
  3. package/commonjs/src/caching/map-cache.js +39 -0
  4. package/commonjs/src/io/io.js +0 -3
  5. package/es6/src/caching/cache-manager.js +3 -3
  6. package/es6/src/caching/index.js +1 -1
  7. package/es6/src/caching/map-cache.js +35 -0
  8. package/es6/src/caching/memoize.decorator.js +1 -1
  9. package/es6/src/io/io.js +0 -3
  10. package/package.json +6 -40
  11. package/types/src/caching/index.d.ts +1 -1
  12. package/types/src/caching/map-cache.d.ts +23 -0
  13. package/types/src/caching/memoize.decorator.d.ts +1 -1
  14. package/types/src/io/io.d.ts +0 -3
  15. package/commonjs/src/caching/node-cache-memoize.adapter.js +0 -49
  16. package/commonjs/src/cli/action.js +0 -65
  17. package/commonjs/src/cli/command.js +0 -127
  18. package/commonjs/src/cli/index.js +0 -61
  19. package/commonjs/src/cli/module.type.js +0 -18
  20. package/commonjs/src/cli/options.js +0 -115
  21. package/commonjs/src/diagnostics/index.js +0 -22
  22. package/commonjs/src/diagnostics/trace.js +0 -86
  23. package/commonjs/src/interop/docker/docker.js +0 -54
  24. package/commonjs/src/interop/errors/interop.error.js +0 -12
  25. package/commonjs/src/interop/git/git.js +0 -134
  26. package/commonjs/src/interop/git/git.types.js +0 -4
  27. package/commonjs/src/interop/index.js +0 -97
  28. package/commonjs/src/interop/node/index.js +0 -18
  29. package/commonjs/src/interop/node/node.js +0 -45
  30. package/commonjs/src/interop/npm/npm.js +0 -231
  31. package/commonjs/src/interop/npm/npm.types.js +0 -16
  32. package/commonjs/src/interop/pnpm/pnpm.js +0 -34
  33. package/commonjs/src/interop/pnpm/pnpm.types.js +0 -4
  34. package/commonjs/src/interop/shell/shell.argv.js +0 -45
  35. package/commonjs/src/interop/shell/shell.js +0 -105
  36. package/commonjs/src/interop/shell/shell.types.js +0 -4
  37. package/commonjs/src/interop/types/detect-package-manager.js +0 -71
  38. package/commonjs/src/interop/types/package-manager.js +0 -4
  39. package/commonjs/src/interop/yarn/yarn.js +0 -34
  40. package/commonjs/src/interop/yarn/yarn.types.js +0 -4
  41. package/commonjs/src/io/find-directories.js +0 -21
  42. package/commonjs/src/io/find-file.js +0 -45
  43. package/commonjs/src/io/watch.js +0 -261
  44. package/commonjs/src/semver/index.js +0 -18
  45. package/commonjs/src/semver/semver.js +0 -92
  46. package/commonjs/src/testing/flush-promises.js +0 -16
  47. package/commonjs/src/testing/glob-with-memfs.js +0 -22
  48. package/commonjs/src/testing/index.js +0 -22
  49. package/commonjs/src/testing/memfs.js +0 -52
  50. package/commonjs/src/testing/mock-logger.js +0 -36
  51. package/commonjs/src/testing/spy-on-constructor.js +0 -27
  52. package/es6/src/caching/node-cache-memoize.adapter.js +0 -37
  53. package/es6/src/cli/action.js +0 -47
  54. package/es6/src/cli/command.js +0 -106
  55. package/es6/src/cli/index.js +0 -4
  56. package/es6/src/cli/module.type.js +0 -11
  57. package/es6/src/cli/options.js +0 -76
  58. package/es6/src/diagnostics/index.js +0 -1
  59. package/es6/src/diagnostics/trace.js +0 -68
  60. package/es6/src/interop/docker/docker.js +0 -44
  61. package/es6/src/interop/errors/interop.error.js +0 -2
  62. package/es6/src/interop/git/git.js +0 -124
  63. package/es6/src/interop/git/git.types.js +0 -1
  64. package/es6/src/interop/index.js +0 -21
  65. package/es6/src/interop/node/index.js +0 -1
  66. package/es6/src/interop/node/node.js +0 -35
  67. package/es6/src/interop/npm/npm.js +0 -180
  68. package/es6/src/interop/npm/npm.types.js +0 -6
  69. package/es6/src/interop/pnpm/pnpm.js +0 -24
  70. package/es6/src/interop/pnpm/pnpm.types.js +0 -1
  71. package/es6/src/interop/shell/shell.argv.js +0 -35
  72. package/es6/src/interop/shell/shell.js +0 -95
  73. package/es6/src/interop/shell/shell.types.js +0 -1
  74. package/es6/src/interop/types/detect-package-manager.js +0 -50
  75. package/es6/src/interop/types/package-manager.js +0 -1
  76. package/es6/src/interop/yarn/yarn.js +0 -24
  77. package/es6/src/interop/yarn/yarn.types.js +0 -1
  78. package/es6/src/io/find-directories.js +0 -11
  79. package/es6/src/io/find-file.js +0 -27
  80. package/es6/src/io/watch.js +0 -238
  81. package/es6/src/semver/index.js +0 -1
  82. package/es6/src/semver/semver.js +0 -71
  83. package/es6/src/testing/flush-promises.js +0 -6
  84. package/es6/src/testing/glob-with-memfs.js +0 -20
  85. package/es6/src/testing/index.js +0 -5
  86. package/es6/src/testing/memfs.js +0 -25
  87. package/es6/src/testing/mock-logger.js +0 -26
  88. package/es6/src/testing/spy-on-constructor.js +0 -31
  89. package/types/src/caching/node-cache-memoize.adapter.d.ts +0 -22
  90. package/types/src/cli/action.d.ts +0 -36
  91. package/types/src/cli/command.d.ts +0 -34
  92. package/types/src/cli/index.d.ts +0 -7
  93. package/types/src/cli/module.type.d.ts +0 -36
  94. package/types/src/cli/options.d.ts +0 -28
  95. package/types/src/diagnostics/index.d.ts +0 -1
  96. package/types/src/diagnostics/trace.d.ts +0 -10
  97. package/types/src/interop/docker/docker.d.ts +0 -19
  98. package/types/src/interop/errors/interop.error.d.ts +0 -2
  99. package/types/src/interop/git/git.d.ts +0 -16
  100. package/types/src/interop/git/git.types.d.ts +0 -14
  101. package/types/src/interop/index.d.ts +0 -14
  102. package/types/src/interop/node/index.d.ts +0 -1
  103. package/types/src/interop/node/node.d.ts +0 -5
  104. package/types/src/interop/npm/npm.d.ts +0 -29
  105. package/types/src/interop/npm/npm.types.d.ts +0 -24
  106. package/types/src/interop/pnpm/pnpm.d.ts +0 -9
  107. package/types/src/interop/pnpm/pnpm.types.d.ts +0 -3
  108. package/types/src/interop/shell/shell.argv.d.ts +0 -5
  109. package/types/src/interop/shell/shell.d.ts +0 -6
  110. package/types/src/interop/shell/shell.types.d.ts +0 -9
  111. package/types/src/interop/types/detect-package-manager.d.ts +0 -4
  112. package/types/src/interop/types/package-manager.d.ts +0 -10
  113. package/types/src/interop/yarn/yarn.d.ts +0 -9
  114. package/types/src/interop/yarn/yarn.types.d.ts +0 -3
  115. package/types/src/io/find-directories.d.ts +0 -2
  116. package/types/src/io/find-file.d.ts +0 -9
  117. package/types/src/io/watch.d.ts +0 -16
  118. package/types/src/semver/index.d.ts +0 -1
  119. package/types/src/semver/semver.d.ts +0 -18
  120. package/types/src/testing/flush-promises.d.ts +0 -1
  121. package/types/src/testing/glob-with-memfs.d.ts +0 -3
  122. package/types/src/testing/index.d.ts +0 -5
  123. package/types/src/testing/memfs.d.ts +0 -5
  124. package/types/src/testing/mock-logger.d.ts +0 -13
  125. package/types/src/testing/spy-on-constructor.d.ts +0 -21
@@ -1,26 +0,0 @@
1
- import { vi } from "vitest";
2
- const DefaultLogLevels = {
3
- fatal: 60,
4
- error: 50,
5
- warn: 40,
6
- info: 30,
7
- debug: 20,
8
- trace: 10
9
- };
10
- export function createMockLogger() {
11
- return {
12
- error: vi.fn(),
13
- info: vi.fn(),
14
- warn: vi.fn(),
15
- debug: vi.fn(),
16
- trace: vi.fn(),
17
- fatal: vi.fn(),
18
- isLevelEnabled: vi.fn().mockReturnValue(true),
19
- get currentLevel () {
20
- return "info";
21
- },
22
- get logLevels () {
23
- return DefaultLogLevels;
24
- }
25
- };
26
- }
@@ -1,31 +0,0 @@
1
- import { vi } from "vitest";
2
- /**
3
- * Creates a Proxy around a class constructor that intercepts `new` calls,
4
- * records arguments via a spy, and delegates to the real constructor.
5
- *
6
- * Use this to assert what was injected into a class by a DI container
7
- * (e.g. Container) without changing actual behavior.
8
- *
9
- * The proxy copies all `reflect-metadata` entries from the original class
10
- * so that DI metadata (`design:paramtypes`) remains intact.
11
- *
12
- * @example
13
- * const { spy, Proxy: SpiedService } = spyOnConstructor(MyService);
14
- * // use SpiedService in place of MyService when wiring the container
15
- * expect(spy).toHaveBeenCalledWith(expect.any(ExpectedDependency));
16
- */ export function spyOnConstructor(Target) {
17
- const spy = vi.fn();
18
- const ProxiedTarget = new Proxy(Target, {
19
- construct (Ctor, args) {
20
- spy(...args);
21
- return Reflect.construct(Ctor, args);
22
- }
23
- });
24
- for (const key of Reflect.getMetadataKeys(Target)){
25
- Reflect.defineMetadata(key, Reflect.getMetadata(key, Target), ProxiedTarget);
26
- }
27
- return {
28
- spy,
29
- Proxy: ProxiedTarget
30
- };
31
- }
@@ -1,22 +0,0 @@
1
- import NodeCache from "@cacheable/node-cache";
2
- import type { ICache } from "./cache.js";
3
- type NodeCacheMemoizeOptions = {
4
- enableMemoization: boolean;
5
- };
6
- /**
7
- * NodeCache adapter configured for memoization (useClones: false)
8
- * This allows storing object references instead of clones for true memoization
9
- */
10
- export declare class NodeCacheAdapter implements ICache {
11
- static create(options?: NodeCacheMemoizeOptions): NodeCacheAdapter;
12
- readonly supportsMemoization: true;
13
- private cache;
14
- constructor(inst?: NodeCache<unknown>);
15
- get isMemoize(): boolean;
16
- get(key: string): unknown;
17
- set(key: string, value: unknown): void;
18
- has(key: string): boolean;
19
- del(key: string): void;
20
- flushAll(): void;
21
- }
22
- export {};
@@ -1,36 +0,0 @@
1
- import type { Constructable } from "../reflection/index.js";
2
- import type { UnionToIntersection } from "../system/type.utils.js";
3
- export declare const ActionMap: unique symbol;
4
- export type ActionClassMap = Record<string, Constructable<Action>>;
5
- export interface ResultStatus {
6
- succeeded: boolean;
7
- error?: string;
8
- }
9
- export interface Result {
10
- readonly name: string;
11
- readonly succeeded: boolean;
12
- readonly skipped: boolean;
13
- readonly message: string;
14
- }
15
- export declare class ActionResponse<TData = unknown> implements Result {
16
- static Success<TData>(name: string, data?: TData[]): ActionResponse<TData>;
17
- static Skipped(name: string): ActionResponse<unknown>;
18
- static Blocking(name: string): ActionResponse<unknown>;
19
- static Error<TData = unknown>(name: string, message: string): ActionResponse<TData>;
20
- static Error<TData extends ResultStatus>(name: string, data: TData[]): ActionResponse<TData>;
21
- constructor(data: Partial<ActionResponse<TData>>);
22
- readonly name: string;
23
- readonly succeeded: boolean;
24
- readonly skipped: boolean;
25
- readonly blocking: boolean;
26
- readonly message: string;
27
- readonly data: TData[];
28
- }
29
- export interface Action<T extends object = object> {
30
- run(options: T): Promise<ActionResponse>;
31
- }
32
- export type Actions = Record<string, Action>;
33
- export type ActionOptions<A extends Action> = A extends Action<infer T> ? T : never;
34
- export type MergeOptions<TActions extends Record<string, Action>> = UnionToIntersection<{
35
- [K in keyof TActions]: ActionOptions<TActions[K]>;
36
- }[keyof TActions]>;
@@ -1,34 +0,0 @@
1
- import { Command as CommanderType, type OptionValues } from "commander";
2
- import type { Constructable } from "../reflection/index.js";
3
- import type { ActionResponse, Actions } from "./action.js";
4
- export type CommandType = Constructable<DecohereCommand>;
5
- export type CommandHandler = (opts: OptionValues, cmd: DecohereCommand) => Promise<void>;
6
- export type CommandResponse<TActions extends Actions = Actions> = {
7
- [ActionName in keyof TActions]?: ActionResponse;
8
- };
9
- export declare const CommandResponse: {
10
- success<T extends Actions>(_ctx: unknown, responses: CommandResponse<T>): CommandResponse<T>;
11
- help<T extends Actions = Actions>(): CommandResponse<T>;
12
- fromAction(name: string, response: ActionResponse): CommandResponse;
13
- };
14
- /** Thrown when a command execution fails due to action errors. */
15
- export declare class CommandError extends Error {
16
- }
17
- export declare class DecohereCommand<TActions extends Actions = Actions> extends CommanderType {
18
- get actions(): readonly Constructable<import("./action.js").Action>[];
19
- constructor(name?: string | Constructable | Record<string, CommandType>, handler?: CommandHandler);
20
- /**
21
- * Whether the command, with these options, runs until it is stopped (`flux serve`,
22
- * `forge build --watch`). The CLI then listens for SIGINT and SIGTERM from the moment it
23
- * starts, so a stop during start-up still shuts down cleanly; other commands keep Node's
24
- * default, where Ctrl+C ends them at once.
25
- */
26
- runsUntilStopped(_options: OptionValues): boolean;
27
- run(actions: TActions, options: OptionValues): Promise<CommandResponse<TActions>>;
28
- registerSubcommand(command: CommandType, onAction?: CommandHandler): void;
29
- registerSubcommand(commands: Record<string, DecohereCommand | CommandType>, onAction?: CommandHandler): void;
30
- protected runActions(actions: TActions, options: OptionValues): Promise<CommandResponse<TActions>>;
31
- protected getSelectedActions(actions: TActions): Array<[keyof TActions, TActions[keyof TActions]]>;
32
- protected throwOnErrors(responses: CommandResponse<TActions>): void;
33
- private parseCommandName;
34
- }
@@ -1,7 +0,0 @@
1
- export type { Action, ActionClassMap, ActionOptions, Actions, MergeOptions, Result, ResultStatus, } from "./action.js";
2
- export { ActionMap, ActionResponse } from "./action.js";
3
- export type { CommandHandler, CommandType } from "./command.js";
4
- export { CommandError, CommandResponse, DecohereCommand } from "./command.js";
5
- export type { ApplicationModule, CommandMap as CommandClassMap, ModuleConfig, WorkspaceFactoryOptions, } from "./module.type.js";
6
- export { ModuleManifest } from "./module.type.js";
7
- export { ConfigFileOption, ConfigurationOption, DryRunOption, EnvFileIfExistsOption, EnvFileOption, LogLevelOption, NoBuildOptions, NoCleanOptions, ProjectOption, } from "./options.js";
@@ -1,36 +0,0 @@
1
- import type { ContainerBuilder } from "../composition/index.js";
2
- import type { ActionClassMap } from "./action.js";
3
- import type { CommandType, DecohereCommand } from "./command.js";
4
- export type CommandMap = Record<string, CommandType>;
5
- export type WorkspaceFactoryOptions = {
6
- configFile?: string;
7
- rootDir?: string;
8
- };
9
- export interface ApplicationModule {
10
- id: string;
11
- dispose?(): void;
12
- asyncDispose?(): Promise<void>;
13
- command: DecohereCommand;
14
- }
15
- export type ModuleConfig = {
16
- actions?: ActionClassMap;
17
- commands?: CommandMap;
18
- };
19
- /**
20
- * Simple declaration interface for a CLI module.
21
- * Extend this and implement the four abstract members.
22
- */
23
- export declare abstract class ModuleManifest {
24
- /** Unique module identifier, used as the root command name. */
25
- abstract readonly id: string;
26
- /** Sub-command classes this module contributes. */
27
- readonly commands: CommandMap;
28
- /** Action classes this module contributes. */
29
- readonly actions: ActionClassMap;
30
- /** The root command class for this module. */
31
- abstract readonly command: CommandType;
32
- /** Register infrastructure services into the DI container. */
33
- registerServices(_builder: ContainerBuilder): void;
34
- /** Lazily create a workspace instance. Return null if this module does not use a workspace. */
35
- createWorkspace(_options: WorkspaceFactoryOptions): Promise<object | null>;
36
- }
@@ -1,28 +0,0 @@
1
- import { Option } from "commander";
2
- export declare class ConfigurationOption extends Option {
3
- constructor(defaultValue: string);
4
- }
5
- export declare class ConfigFileOption extends Option {
6
- constructor(defaultValue?: string);
7
- }
8
- export declare class LogLevelOption extends Option {
9
- constructor();
10
- }
11
- export declare class EnvFileOption extends Option {
12
- constructor();
13
- }
14
- export declare class EnvFileIfExistsOption extends Option {
15
- constructor();
16
- }
17
- export declare class NoCleanOptions extends Option {
18
- constructor(defaultValue: boolean);
19
- }
20
- export declare class NoBuildOptions extends Option {
21
- constructor(defaultValue: boolean);
22
- }
23
- export declare class DryRunOption extends Option {
24
- constructor(description: string, defaultValue?: boolean);
25
- }
26
- export declare class ProjectOption extends Option {
27
- constructor();
28
- }
@@ -1 +0,0 @@
1
- export { Trace, timed, trace } from "./trace.js";
@@ -1,10 +0,0 @@
1
- export declare function trace(target: object, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
2
- /**
3
- * Always-on method timing. Logs duration at `info` regardless of `FORGE_TRACE`.
4
- * Use this to time a specific method without raising the process log level.
5
- */
6
- export declare function timed(target: object, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
7
- export declare function Trace(constructor: {
8
- name: string;
9
- prototype: object;
10
- }): void;
@@ -1,19 +0,0 @@
1
- import { Shell } from "../shell/shell.js";
2
- export type DockerBuildOptions = {
3
- cwd?: string;
4
- dockerfile?: string;
5
- tags?: string[];
6
- buildArgs?: Record<string, string>;
7
- secrets?: Record<string, string>;
8
- noCache?: boolean;
9
- pull?: boolean;
10
- };
11
- export type DockerPushOptions = {
12
- cwd?: string;
13
- };
14
- export declare class Docker extends Shell {
15
- readonly name: "docker";
16
- protected program: string;
17
- build(contextDir: string, options?: DockerBuildOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
18
- push(tag: string, options?: DockerPushOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
19
- }
@@ -1,2 +0,0 @@
1
- export declare class InteropError extends Error {
2
- }
@@ -1,16 +0,0 @@
1
- import { Shell } from "../shell/shell.js";
2
- import type { ShellResponse } from "../shell/shell.types.js";
3
- import type { CommitOptions, GitOptions, PushOptions, StageOptions } from "./git.types.js";
4
- export declare class Git extends Shell {
5
- protected program: string;
6
- getModifiedFiles(options?: GitOptions): Promise<string[]>;
7
- getBranchName(options?: GitOptions): Promise<string>;
8
- tag(tag: string, options?: GitOptions): Promise<ShellResponse>;
9
- pushTag(tag: string, options?: GitOptions & {
10
- remote?: string;
11
- }): Promise<ShellResponse>;
12
- commit(message: string, options: CommitOptions): Promise<ShellResponse>;
13
- push(branch: string, options?: PushOptions): Promise<ShellResponse>;
14
- pull(branch: string, options?: GitOptions): Promise<ShellResponse>;
15
- stage(options: StageOptions): Promise<void>;
16
- }
@@ -1,14 +0,0 @@
1
- export type GitOptions = {
2
- cwd?: string;
3
- };
4
- export type CommitOptions = {
5
- files?: string[];
6
- all?: boolean;
7
- } & GitOptions;
8
- export type PushOptions = {
9
- setUpstream: string;
10
- } & GitOptions;
11
- export type StageOptions = {
12
- files?: string[];
13
- all?: string;
14
- };
@@ -1,14 +0,0 @@
1
- export * from "./docker/docker.js";
2
- export * from "./git/git.js";
3
- export * as git from "./git/git.types.js";
4
- export * from "./node/node.js";
5
- export * from "./npm/npm.js";
6
- export * as npm from "./npm/npm.types.js";
7
- export * from "./pnpm/pnpm.js";
8
- export * as pnpm from "./pnpm/pnpm.types.js";
9
- export * from "./shell/shell.js";
10
- export * as shell from "./shell/shell.types.js";
11
- export * from "./types/detect-package-manager.js";
12
- export * from "./types/package-manager.js";
13
- export * from "./yarn/yarn.js";
14
- export * as yarn from "./yarn/yarn.types.js";
@@ -1 +0,0 @@
1
- export * from "./node.js";
@@ -1,5 +0,0 @@
1
- import { Shell } from "../shell/shell.js";
2
- export declare class Node extends Shell {
3
- protected program: string;
4
- runScript(script: string, ...args: string[]): Promise<unknown>;
5
- }
@@ -1,29 +0,0 @@
1
- import { Shell } from "../shell/shell.js";
2
- import type { PackageManager } from "../types/package-manager.js";
3
- import type { NpmOptions, PublishOptions, VersionOptions, VersionType } from "./npm.types.js";
4
- export declare class Npm extends Shell implements PackageManager {
5
- readonly name: "npm";
6
- protected program: string;
7
- publish(directory: string, options?: PublishOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
8
- /**
9
- * @description Runs in the directory of the package
10
- * @param options
11
- * @returns
12
- */
13
- version(versionType: VersionType, options: VersionOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
14
- link(directory: string, options?: NpmOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
15
- install(options?: NpmOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
16
- /**
17
- * Install only `dependencies` as real folders: `--omit=dev` skips devDependencies and
18
- * `--no-bin-links` skips the `.bin` symlinks, so the result holds no symlinks at all.
19
- */
20
- installProduction(options?: NpmOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
21
- syncLockFile(options?: NpmOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
22
- /**
23
- * True when package@version exists on the registry.
24
- * Uses ambient npm config (cwd `.npmrc`); do not pass tokens on argv.
25
- */
26
- private isPublished;
27
- private createTempUserConfig;
28
- private removeTempUserConfig;
29
- }
@@ -1,24 +0,0 @@
1
- export type NpmOptions = {
2
- cwd?: string;
3
- };
4
- export type PublishOptions = {
5
- dryRun?: boolean;
6
- skipIfPublished?: boolean;
7
- authToken?: string;
8
- otp?: string;
9
- provenance?: boolean;
10
- /** @deprecated use channel */
11
- versionType?: VersionType;
12
- channel?: string;
13
- } & NpmOptions;
14
- export type VersionType = "major" | "minor" | "patch" | "prerelease";
15
- export declare const VersionTypes: {
16
- major: "major";
17
- minor: "minor";
18
- patch: "patch";
19
- prerelease: "prerelease";
20
- };
21
- export type VersionOptions = {
22
- preid?: string;
23
- noTag?: boolean;
24
- } & NpmOptions;
@@ -1,9 +0,0 @@
1
- import { Shell } from "../shell/shell.js";
2
- import type { PackageManager } from "../types/package-manager.js";
3
- import type { PnpmOptions } from "./pnpm.types.js";
4
- export declare class Pnpm extends Shell implements PackageManager {
5
- readonly name: "pnpm";
6
- protected program: string;
7
- install(options?: PnpmOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
8
- syncLockFile(options?: PnpmOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
9
- }
@@ -1,3 +0,0 @@
1
- export type PnpmOptions = {
2
- cwd?: string;
3
- };
@@ -1,5 +0,0 @@
1
- declare function fields(args: string[]): Record<string, string | boolean | string[]>;
2
- export declare const shellArgv: {
3
- fields: typeof fields;
4
- };
5
- export {};
@@ -1,6 +0,0 @@
1
- import type { ShellOptions, ShellResponse } from "./shell.types.js";
2
- export declare abstract class Shell {
3
- protected abstract program: string;
4
- protected run(options: ShellOptions, ...args: string[]): Promise<ShellResponse>;
5
- private parseStream;
6
- }
@@ -1,9 +0,0 @@
1
- export type ShellResponse = {
2
- message: string;
3
- data: string[];
4
- };
5
- export interface ShellOptions {
6
- cwd?: string;
7
- /** Spawn env. Defaults to `process.env`. Not written to logs. */
8
- env?: NodeJS.ProcessEnv;
9
- }
@@ -1,4 +0,0 @@
1
- import type { PackageManager } from "./package-manager.js";
2
- export declare function detectPackageManager(cwd: string): PackageManager | undefined;
3
- export declare function packageManagerFromString(name: string): PackageManager;
4
- export declare function promptForPackageManager(): Promise<PackageManager>;
@@ -1,10 +0,0 @@
1
- import type { ShellResponse } from "../shell/shell.types.js";
2
- export interface PackageManager {
3
- readonly name: "npm" | "pnpm" | "yarn";
4
- install(options?: {
5
- cwd?: string;
6
- }): Promise<ShellResponse>;
7
- syncLockFile(options?: {
8
- cwd?: string;
9
- }): Promise<ShellResponse>;
10
- }
@@ -1,9 +0,0 @@
1
- import { Shell } from "../shell/shell.js";
2
- import type { PackageManager } from "../types/package-manager.js";
3
- import type { YarnOptions } from "./yarn.types.js";
4
- export declare class Yarn extends Shell implements PackageManager {
5
- readonly name: "yarn";
6
- protected program: string;
7
- install(options?: YarnOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
8
- syncLockFile(options?: YarnOptions): Promise<import("../shell/shell.types.js").ShellResponse>;
9
- }
@@ -1,3 +0,0 @@
1
- export type YarnOptions = {
2
- cwd?: string;
3
- };
@@ -1,2 +0,0 @@
1
- import type { Directory } from "./types/directory.type.js";
2
- export declare function findDirectories(...pattern: string[]): Promise<Directory[]>;
@@ -1,9 +0,0 @@
1
- import { FileEx } from "./types/file.js";
2
- export type FindFileOptions = {
3
- cwd: string;
4
- ignore?: string | string[];
5
- };
6
- export declare function findFile(pattern: string): Promise<{
7
- relativePath: string;
8
- }>;
9
- export declare function findFiles(patterns: string[], options?: FindFileOptions): Promise<FileEx[]>;
@@ -1,16 +0,0 @@
1
- import { type Watcher } from "./types/file.js";
2
- export type WatchOptions = {
3
- include?: string[];
4
- ignore?: string[];
5
- cwd?: string;
6
- ignoreInitial?: boolean;
7
- };
8
- export type WatchEventName = "add" | "change" | "addDir" | "unlink" | "unlinkDir";
9
- export declare const WatchEvents: {
10
- add: "add";
11
- change: "change";
12
- addDir: "addDir";
13
- unlink: "unlink";
14
- unlinkDir: "unlinkDir";
15
- };
16
- export declare function watch(directory: string, options?: WatchOptions): Watcher;
@@ -1 +0,0 @@
1
- export * from "./semver.js";
@@ -1,18 +0,0 @@
1
- export type VersionType = "major" | "minor" | "patch" | "prerelease";
2
- export declare const VersionTypes: {
3
- major: "major";
4
- minor: "minor";
5
- patch: "patch";
6
- prerelease: "prerelease";
7
- };
8
- export declare class SemverError extends Error {
9
- constructor(message: string);
10
- }
11
- export declare class Semver {
12
- private version;
13
- constructor(version: string);
14
- increment(versionType: VersionType, preid?: string): Semver;
15
- toString(): string;
16
- private ensureValid;
17
- private parse;
18
- }
@@ -1 +0,0 @@
1
- export declare function flushPromises(): Promise<unknown>;
@@ -1,3 +0,0 @@
1
- export declare function withMemfsFsForGlob<TGlobModule extends {
2
- glob: (...args: unknown[]) => unknown;
3
- }>(actual: TGlobModule): TGlobModule;
@@ -1,5 +0,0 @@
1
- export * from "./flush-promises.js";
2
- export * from "./glob-with-memfs.js";
3
- export * from "./memfs.js";
4
- export * from "./mock-logger.js";
5
- export * from "./spy-on-constructor.js";
@@ -1,5 +0,0 @@
1
- export declare function resetMemfs(): void;
2
- export declare function seedMemfs(files: Record<string, string>): void;
3
- export declare function createTestFile(filePath: string, content: string | Buffer): void;
4
- export declare function readFile(filePath: string): Promise<string>;
5
- export declare function fileExists(filePath: string): boolean;
@@ -1,13 +0,0 @@
1
- export type LoggerMethod = (msg: string | number | object, ...args: unknown[]) => void;
2
- export type TestLogger = {
3
- fatal: LoggerMethod;
4
- error: LoggerMethod;
5
- warn: LoggerMethod;
6
- info: LoggerMethod;
7
- debug: LoggerMethod;
8
- trace: LoggerMethod;
9
- isLevelEnabled(level: string): boolean;
10
- readonly currentLevel: string;
11
- readonly logLevels: Record<string, number>;
12
- };
13
- export declare function createMockLogger(): TestLogger;
@@ -1,21 +0,0 @@
1
- import { vi } from "vitest";
2
- import type { Constructable } from "../reflection/index.js";
3
- /**
4
- * Creates a Proxy around a class constructor that intercepts `new` calls,
5
- * records arguments via a spy, and delegates to the real constructor.
6
- *
7
- * Use this to assert what was injected into a class by a DI container
8
- * (e.g. Container) without changing actual behavior.
9
- *
10
- * The proxy copies all `reflect-metadata` entries from the original class
11
- * so that DI metadata (`design:paramtypes`) remains intact.
12
- *
13
- * @example
14
- * const { spy, Proxy: SpiedService } = spyOnConstructor(MyService);
15
- * // use SpiedService in place of MyService when wiring the container
16
- * expect(spy).toHaveBeenCalledWith(expect.any(ExpectedDependency));
17
- */
18
- export declare function spyOnConstructor<T extends Constructable>(Target: T): {
19
- spy: ReturnType<typeof vi.fn>;
20
- Proxy: T;
21
- };