@lo1/cli 0.2.0
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/README.md +46 -0
- package/dist/cli/commands/down.d.ts +3 -0
- package/dist/cli/commands/down.d.ts.map +1 -0
- package/dist/cli/commands/hosts.d.ts +3 -0
- package/dist/cli/commands/hosts.d.ts.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/logs.d.ts +3 -0
- package/dist/cli/commands/logs.d.ts.map +1 -0
- package/dist/cli/commands/status.d.ts +27 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/tls-setup.d.ts +10 -0
- package/dist/cli/commands/tls-setup.d.ts.map +1 -0
- package/dist/cli/commands/up.d.ts +3 -0
- package/dist/cli/commands/up.d.ts.map +1 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/compose/generate.d.ts +36 -0
- package/dist/compose/generate.d.ts.map +1 -0
- package/dist/config/loader.d.ts +8 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/dag/index.d.ts +12 -0
- package/dist/dag/index.d.ts.map +1 -0
- package/dist/debug.d.ts +3 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/discovery/registry.d.ts +19 -0
- package/dist/discovery/registry.d.ts.map +1 -0
- package/dist/errors.d.ts +7 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/hooks/executor.d.ts +27 -0
- package/dist/hooks/executor.d.ts.map +1 -0
- package/dist/hosts/index.d.ts +11 -0
- package/dist/hosts/index.d.ts.map +1 -0
- package/dist/lo1.js +12110 -0
- package/dist/logs/writer.d.ts +4 -0
- package/dist/logs/writer.d.ts.map +1 -0
- package/dist/orchestrator/filter.d.ts +7 -0
- package/dist/orchestrator/filter.d.ts.map +1 -0
- package/dist/orchestrator/service.d.ts +43 -0
- package/dist/orchestrator/service.d.ts.map +1 -0
- package/dist/orchestrator/start.d.ts +7 -0
- package/dist/orchestrator/start.d.ts.map +1 -0
- package/dist/orchestrator/state.d.ts +5 -0
- package/dist/orchestrator/state.d.ts.map +1 -0
- package/dist/orchestrator/stop.d.ts +19 -0
- package/dist/orchestrator/stop.d.ts.map +1 -0
- package/dist/orchestrator/types.d.ts +105 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/output/format.d.ts +4 -0
- package/dist/output/format.d.ts.map +1 -0
- package/dist/output/line-buffer.d.ts +7 -0
- package/dist/output/line-buffer.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +13 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/proxy/caddyfile.d.ts +8 -0
- package/dist/proxy/caddyfile.d.ts.map +1 -0
- package/dist/proxy/domains.d.ts +7 -0
- package/dist/proxy/domains.d.ts.map +1 -0
- package/dist/readiness/probe.d.ts +19 -0
- package/dist/readiness/probe.d.ts.map +1 -0
- package/dist/repos/init.d.ts +24 -0
- package/dist/repos/init.d.ts.map +1 -0
- package/dist/runner/compose.d.ts +76 -0
- package/dist/runner/compose.d.ts.map +1 -0
- package/dist/runner/container.d.ts +33 -0
- package/dist/runner/container.d.ts.map +1 -0
- package/dist/runner/process.d.ts +32 -0
- package/dist/runner/process.d.ts.map +1 -0
- package/dist/tls/setup.d.ts +25 -0
- package/dist/tls/setup.d.ts.map +1 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @lo1/cli
|
|
2
|
+
|
|
3
|
+
CLI for [lo1](../../README.md) — multi-service local development environment.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun install -g @lo1/cli # Bun
|
|
9
|
+
npm install -g @lo1/cli # npm
|
|
10
|
+
yarn global add @lo1/cli # Yarn
|
|
11
|
+
pnpm add -g @lo1/cli # pnpm
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
| Command | Description |
|
|
17
|
+
|---|---|
|
|
18
|
+
| `lo1 init` | Initialize workspace — clone repositories defined in `lo1.yaml` |
|
|
19
|
+
| `lo1 up` | Start all services and infrastructure |
|
|
20
|
+
| `lo1 down` | Stop all services and infrastructure |
|
|
21
|
+
| `lo1 status` | Show status of all services |
|
|
22
|
+
| `lo1 hosts` | Manage `/etc/hosts` entries for local domains |
|
|
23
|
+
| `lo1 tls-setup` | Generate locally-trusted TLS certificates via mkcert |
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Initialize workspace (clone repos, set up infra)
|
|
29
|
+
lo1 init
|
|
30
|
+
|
|
31
|
+
# Start everything
|
|
32
|
+
lo1 up
|
|
33
|
+
|
|
34
|
+
# Start specific services
|
|
35
|
+
lo1 up api frontend
|
|
36
|
+
|
|
37
|
+
# Check status
|
|
38
|
+
lo1 status
|
|
39
|
+
|
|
40
|
+
# Stop everything
|
|
41
|
+
lo1 down
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
The CLI reads `lo1.yaml` from the current directory. See the [@lo1/sdk README](../sdk/README.md) for schema details.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/down.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,WAAW,SAepB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/hosts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,YAAY,SA4BrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,WAAW,SAgCpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDpC,eAAO,MAAM,WAAW,SA4CpB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { composePs } from "../../runner/compose";
|
|
3
|
+
import type { WorkspaceState } from "../../orchestrator/types";
|
|
4
|
+
import type { WorkspaceConfig } from "@lo1/sdk";
|
|
5
|
+
export type StatusDeps = {
|
|
6
|
+
readState: (workspaceDir: string) => Promise<WorkspaceState | null>;
|
|
7
|
+
composePs: typeof composePs;
|
|
8
|
+
loadConfig: (configPath?: string) => Promise<WorkspaceConfig>;
|
|
9
|
+
};
|
|
10
|
+
export type StatusServiceEntry = {
|
|
11
|
+
name: string;
|
|
12
|
+
state: string;
|
|
13
|
+
mode: string;
|
|
14
|
+
port?: number;
|
|
15
|
+
hostPort?: number;
|
|
16
|
+
};
|
|
17
|
+
export type StatusResult = {
|
|
18
|
+
workspace: string;
|
|
19
|
+
services: StatusServiceEntry[];
|
|
20
|
+
infrastructure: {
|
|
21
|
+
state: string;
|
|
22
|
+
services: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare function getWorkspaceStatus(workspaceDir: string, deps: StatusDeps): Promise<StatusResult | null>;
|
|
26
|
+
export declare const statusCommand: Command;
|
|
27
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,SAAS,EAA6B,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,UAAU,GAAG;IACvB,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACpE,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,cAAc,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH,CAAC;AAgBF,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAyC9B;AAQD,eAAO,MAAM,aAAa,SAyCtB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import type { WorkspaceState } from "../../orchestrator/types";
|
|
3
|
+
export type TlsSetupDeps = {
|
|
4
|
+
readState: (workspaceDir: string) => Promise<WorkspaceState | null>;
|
|
5
|
+
trustCaddyCa: (containerName: string, workspaceDir: string) => Promise<void>;
|
|
6
|
+
removeHashFile: (hashPath: string) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
export declare function runTlsSetup(workspaceDir: string, overrides?: Partial<TlsSetupDeps>): Promise<void>;
|
|
9
|
+
export declare const tlsSetupCommand: Command;
|
|
10
|
+
//# sourceMappingURL=tls-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tls-setup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/tls-setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACpE,YAAY,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrD,CAAC;AAgBF,wBAAsB,WAAW,CAC/B,YAAY,EAAE,MAAM,EACpB,SAAS,GAAE,OAAO,CAAC,YAAY,CAAM,GACpC,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,eAAO,MAAM,eAAe,SAMxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"up.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6HpC,eAAO,MAAM,SAAS,SA8ElB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,eAAO,MAAM,OAAO,SAAgB,CAAC;AAgBrC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CASxE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { WorkspaceConfig, ComposeContribution } from "@lo1/sdk";
|
|
2
|
+
import { Lo1Error } from "../errors";
|
|
3
|
+
export declare function projectId(workspaceName: string): string;
|
|
4
|
+
export declare function networkId(workspaceName: string): string;
|
|
5
|
+
export declare function proxyServiceId(workspaceName: string): string;
|
|
6
|
+
export declare class ComposeError extends Lo1Error {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
export type ComposeResult = {
|
|
10
|
+
yaml: string;
|
|
11
|
+
fileArgs: string[];
|
|
12
|
+
projectName: string;
|
|
13
|
+
pluginEnvVars: Record<string, string>;
|
|
14
|
+
infraServices: string[];
|
|
15
|
+
appServices: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare function generateCompose(config: WorkspaceConfig, contributions?: ComposeContribution[]): ComposeResult;
|
|
18
|
+
/** Returns the extraCompose file path from either the string or object form. */
|
|
19
|
+
export declare function extraComposeFile(config: WorkspaceConfig): string | undefined;
|
|
20
|
+
/** Returns the initTaskServices declared in the extraCompose object form, or []. */
|
|
21
|
+
export declare function extraComposeInitTasks(config: WorkspaceConfig): string[];
|
|
22
|
+
/**
|
|
23
|
+
* Reads per-service compose files, resolves all relative paths to absolute
|
|
24
|
+
* based on each service's directory, and writes resolved copies to .lo1/.
|
|
25
|
+
* This ensures Docker Compose path resolution works correctly regardless
|
|
26
|
+
* of the project directory.
|
|
27
|
+
*/
|
|
28
|
+
export declare function preprocessServiceComposeFiles(config: WorkspaceConfig, workspaceDir?: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Reads an extraCompose YAML file and returns the service names defined in it.
|
|
31
|
+
* These are infrastructure-level services (databases, caches, init containers)
|
|
32
|
+
* that need to be started alongside plugin contributions.
|
|
33
|
+
*/
|
|
34
|
+
export declare function discoverExtraComposeServices(extraComposePath: string, workspaceDir?: string): Promise<string[]>;
|
|
35
|
+
export declare function writeComposeFile(yaml: string, workspaceDir?: string): Promise<string>;
|
|
36
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/compose/generate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAqB,MAAM,UAAU,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,qBAAa,YAAa,SAAQ,QAAQ;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAgBF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe,EACvB,aAAa,CAAC,EAAE,mBAAmB,EAAE,GACpC,aAAa,CAkCf;AAsFD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAG5E;AAED,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,EAAE,CAGvE;AAwED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,eAAe,EACvB,YAAY,SAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAChD,gBAAgB,EAAE,MAAM,EACxB,YAAY,SAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAKnB;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,SAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOxF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type WorkspaceConfig } from "@lo1/sdk";
|
|
2
|
+
import { Lo1Error } from "../errors";
|
|
3
|
+
export declare class ConfigError extends Lo1Error {
|
|
4
|
+
readonly cause?: unknown | undefined;
|
|
5
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
6
|
+
}
|
|
7
|
+
export declare function loadWorkspaceConfig(configPath?: string): Promise<WorkspaceConfig>;
|
|
8
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,qBAAa,WAAY,SAAQ,QAAQ;aAGrB,KAAK,CAAC,EAAE,OAAO;gBAD/B,OAAO,EAAE,MAAM,EACC,KAAK,CAAC,EAAE,OAAO,YAAA;CAKlC;AAWD,wBAAsB,mBAAmB,CAAC,UAAU,SAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CA8B3F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WorkspaceConfig } from "@lo1/sdk";
|
|
2
|
+
import { Lo1Error } from "../errors";
|
|
3
|
+
export type ExecutionLayer = string[];
|
|
4
|
+
export type DagResult = {
|
|
5
|
+
layers: ExecutionLayer[];
|
|
6
|
+
serviceCount: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class DagError extends Lo1Error {
|
|
9
|
+
constructor(message: string, code: string, details?: Record<string, unknown>);
|
|
10
|
+
}
|
|
11
|
+
export declare function buildDag(config: WorkspaceConfig): DagResult;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dag/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,MAAM,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qBAAa,QAAS,SAAQ,QAAQ;gBACxB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAI7E;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAgF3D"}
|
package/dist/debug.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,wBAEtC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WorkspaceConfig, ServiceConfig } from "@lo1/sdk";
|
|
2
|
+
export type ServiceEndpoint = {
|
|
3
|
+
name: string;
|
|
4
|
+
port: number;
|
|
5
|
+
hostPort: number;
|
|
6
|
+
internalUrl: string;
|
|
7
|
+
externalUrl: string;
|
|
8
|
+
proxyUrl: string;
|
|
9
|
+
mode: "dev" | "container" | "skip";
|
|
10
|
+
};
|
|
11
|
+
export type EndpointRegistry = {
|
|
12
|
+
endpoints: Map<string, ServiceEndpoint>;
|
|
13
|
+
};
|
|
14
|
+
export declare function toEnvKey(name: string): string;
|
|
15
|
+
export declare function buildEndpointRegistry(config: WorkspaceConfig): EndpointRegistry;
|
|
16
|
+
export declare function buildDiscoveryEnvVars(registry: EndpointRegistry, consumerMode: "container" | "host"): Record<string, string>;
|
|
17
|
+
export declare function translatePluginEnvVars(pluginEnvVars: Record<string, string>, registry: EndpointRegistry): Record<string, string>;
|
|
18
|
+
export declare function buildServiceEnv(serviceName: string, serviceConfig: ServiceConfig, config: WorkspaceConfig, registry: EndpointRegistry, pluginEnvVars: Record<string, string>, consumerMode: "container" | "host"): Record<string, string>;
|
|
19
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/discovery/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK/D,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,KAAK,GAAG,WAAW,GAAG,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACzC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,CAyB/E;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,gBAAgB,EAC1B,YAAY,EAAE,WAAW,GAAG,MAAM,GACjC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxB;AAED,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,QAAQ,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYxB;AAED,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,YAAY,EAAE,WAAW,GAAG,MAAM,GACjC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBxB"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare class Lo1Error extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
4
|
+
constructor(message: string, code: string, details?: Record<string, unknown> | undefined);
|
|
5
|
+
toJSON(): Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;aAGf,IAAI,EAAE,MAAM;aACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFjD,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;IAMnD,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAOlC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
import { Lo1Error } from "../errors";
|
|
3
|
+
export declare class HookError extends Lo1Error {
|
|
4
|
+
readonly hookName: string;
|
|
5
|
+
readonly exitCode: number | null;
|
|
6
|
+
constructor(message: string, hookName: string, exitCode: number | null);
|
|
7
|
+
}
|
|
8
|
+
export type HookOutput = {
|
|
9
|
+
stream: "stdout" | "stderr";
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
export type HookResult = {
|
|
13
|
+
exitCode: number;
|
|
14
|
+
hookName: string;
|
|
15
|
+
};
|
|
16
|
+
export type SpawnFn = (cmd: string, args: string[], options: {
|
|
17
|
+
cwd: string;
|
|
18
|
+
env: Record<string, string>;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}) => ChildProcess;
|
|
21
|
+
export declare function executeHook(hookName: string, command: string, options: {
|
|
22
|
+
cwd: string;
|
|
23
|
+
env: Record<string, string>;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
onOutput?: (output: HookOutput) => void;
|
|
26
|
+
}, spawnFn?: SpawnFn): Promise<HookResult>;
|
|
27
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/hooks/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,qBAAa,SAAU,SAAQ,QAAQ;aAGnB,QAAQ,EAAE,MAAM;aAChB,QAAQ,EAAE,MAAM,GAAG,IAAI;gBAFvC,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI;CAK1C;AAED,MAAM,MAAM,UAAU,GAAG;IAAE,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACvE,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,OAAO,GAAG,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,KACxE,YAAY,CAAC;AAsBlB,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IACP,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACzC,EACD,OAAO,GAAE,OAAsB,GAC9B,OAAO,CAAC,UAAU,CAAC,CAyCrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Lo1Error } from "../errors";
|
|
2
|
+
export declare class HostsError extends Lo1Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function getHostsFilePath(): string;
|
|
6
|
+
export declare function generateHostsBlock(domains: string[]): string;
|
|
7
|
+
export declare function replaceHostsBlock(currentContent: string, block: string): string;
|
|
8
|
+
export declare function removeHostsBlock(currentContent: string): string;
|
|
9
|
+
export declare function applyHosts(block: string): Promise<void>;
|
|
10
|
+
export declare function removeHosts(): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hosts/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,qBAAa,UAAW,SAAQ,QAAQ;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAKD,wBAAgB,gBAAgB,IAAI,MAAM,CAKzC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAM5D;AAED,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAY/E;AAED,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAS/D;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7D;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAGjD"}
|