@procedures/lib 0.0.0-stage → 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/CHANGELOG.md +30 -0
- package/LICENSE +21 -0
- package/README.md +119 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/cli-flags.d.ts +27 -0
- package/dist/cli-flags.d.ts.map +1 -0
- package/dist/cli-flags.js +33 -0
- package/dist/cli-flags.js.map +1 -0
- package/dist/dag/builder.d.ts +18 -0
- package/dist/dag/builder.d.ts.map +1 -0
- package/dist/dag/builder.js +35 -0
- package/dist/dag/builder.js.map +1 -0
- package/dist/dag/index.d.ts +12 -0
- package/dist/dag/index.d.ts.map +1 -0
- package/dist/dag/index.js +12 -0
- package/dist/dag/index.js.map +1 -0
- package/dist/git/index.d.ts +5 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +5 -0
- package/dist/git/index.js.map +1 -0
- package/dist/git/ref-parser.d.ts +34 -0
- package/dist/git/ref-parser.d.ts.map +1 -0
- package/dist/git/ref-parser.js +70 -0
- package/dist/git/ref-parser.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +22 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +180 -0
- package/dist/module.js.map +1 -0
- package/dist/procedures/core/catch.d.ts +33 -0
- package/dist/procedures/core/catch.d.ts.map +1 -0
- package/dist/procedures/core/catch.js +118 -0
- package/dist/procedures/core/catch.js.map +1 -0
- package/dist/procedures/core/index.d.ts +9 -0
- package/dist/procedures/core/index.d.ts.map +1 -0
- package/dist/procedures/core/index.js +8 -0
- package/dist/procedures/core/index.js.map +1 -0
- package/dist/procedures/dag/index.d.ts +5 -0
- package/dist/procedures/dag/index.d.ts.map +1 -0
- package/dist/procedures/dag/index.js +5 -0
- package/dist/procedures/dag/index.js.map +1 -0
- package/dist/procedures/dag/traverse.d.ts +54 -0
- package/dist/procedures/dag/traverse.d.ts.map +1 -0
- package/dist/procedures/dag/traverse.js +252 -0
- package/dist/procedures/dag/traverse.js.map +1 -0
- package/dist/procedures/ecosystem/index.d.ts +7 -0
- package/dist/procedures/ecosystem/index.d.ts.map +1 -0
- package/dist/procedures/ecosystem/index.js +6 -0
- package/dist/procedures/ecosystem/index.js.map +1 -0
- package/dist/procedures/ecosystem/procedures.d.ts +63 -0
- package/dist/procedures/ecosystem/procedures.d.ts.map +1 -0
- package/dist/procedures/ecosystem/procedures.js +215 -0
- package/dist/procedures/ecosystem/procedures.js.map +1 -0
- package/dist/procedures/lib/audit.d.ts +29 -0
- package/dist/procedures/lib/audit.d.ts.map +1 -0
- package/dist/procedures/lib/audit.js +236 -0
- package/dist/procedures/lib/audit.js.map +1 -0
- package/dist/procedures/lib/index.d.ts +8 -0
- package/dist/procedures/lib/index.d.ts.map +1 -0
- package/dist/procedures/lib/index.js +8 -0
- package/dist/procedures/lib/index.js.map +1 -0
- package/dist/procedures/lib/new.d.ts +20 -0
- package/dist/procedures/lib/new.d.ts.map +1 -0
- package/dist/procedures/lib/new.js +205 -0
- package/dist/procedures/lib/new.js.map +1 -0
- package/dist/procedures/lib/rename.d.ts +28 -0
- package/dist/procedures/lib/rename.d.ts.map +1 -0
- package/dist/procedures/lib/rename.js +267 -0
- package/dist/procedures/lib/rename.js.map +1 -0
- package/dist/procedures/lib/scan.d.ts +14 -0
- package/dist/procedures/lib/scan.d.ts.map +1 -0
- package/dist/procedures/lib/scan.js +102 -0
- package/dist/procedures/lib/scan.js.map +1 -0
- package/dist/register.d.ts +7 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +9 -0
- package/dist/register.js.map +1 -0
- package/dist/scoped-input.d.ts +17 -0
- package/dist/scoped-input.d.ts.map +1 -0
- package/dist/scoped-input.js +23 -0
- package/dist/scoped-input.js.map +1 -0
- package/dist/types.d.ts +248 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +231 -0
- package/dist/types.js.map +1 -0
- package/dist/workspace.d.ts +46 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +98 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +87 -3
- package/src/cli-flags.ts +49 -0
- package/src/dag/builder.ts +44 -0
- package/src/dag/index.ts +23 -0
- package/src/git/index.ts +11 -0
- package/src/git/ref-parser.ts +83 -0
- package/src/index.ts +56 -0
- package/src/module.ts +232 -0
- package/src/procedures/core/catch.ts +142 -0
- package/src/procedures/core/index.ts +9 -0
- package/src/procedures/dag/index.ts +5 -0
- package/src/procedures/dag/traverse.ts +281 -0
- package/src/procedures/ecosystem/index.ts +12 -0
- package/src/procedures/ecosystem/procedures.ts +317 -0
- package/src/procedures/lib/audit.ts +307 -0
- package/src/procedures/lib/index.ts +8 -0
- package/src/procedures/lib/new.ts +253 -0
- package/src/procedures/lib/rename.ts +355 -0
- package/src/procedures/lib/scan.ts +143 -0
- package/src/register.ts +11 -0
- package/src/types.ts +526 -0
- package/src/workspace.ts +110 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing this file registers the procedures of @procedures/lib, and of the modules that it
|
|
3
|
+
* requires, in the global registry: `import "@procedures/lib/register"`. The package root and the
|
|
4
|
+
* `./module` entry register nothing (ARCHITECTURE-PROPOSALS-2026-10, P9).
|
|
5
|
+
*/
|
|
6
|
+
export * from "./module.js";
|
|
7
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,aAAa,CAAC"}
|
package/dist/register.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Importing this file registers the procedures of @procedures/lib, and of the modules that it
|
|
3
|
+
* requires, in the global registry: `import "@procedures/lib/register"`. The package root and the
|
|
4
|
+
* `./module` entry register nothing (ARCHITECTURE-PROPOSALS-2026-10, P9).
|
|
5
|
+
*/
|
|
6
|
+
import { registerLibProcedures } from "./module.js";
|
|
7
|
+
export * from "./module.js";
|
|
8
|
+
registerLibProcedures();
|
|
9
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,cAAc,aAAa,CAAC;AAE5B,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An input schema for a runner: a procedure that takes its input raw and runs the procedure
|
|
3
|
+
* refs in it (`core.catch`, `dag.traverse`).
|
|
4
|
+
*
|
|
5
|
+
* The caller gives a raw input with its scope (`withScope()`), so the runner can resolve the
|
|
6
|
+
* `$ref` names of an outer chain. The scope is a hidden property, and a Zod parse makes a new
|
|
7
|
+
* object without it. This schema validates with Zod, then puts the scope of the input on the
|
|
8
|
+
* result. (The general fix is in the core: `invokeProcedure` could keep the scope across the
|
|
9
|
+
* validation of every procedure.)
|
|
10
|
+
*/
|
|
11
|
+
import { type ZodLikeSchema } from "@mark1russell7/client";
|
|
12
|
+
export declare function scopedInput<T>(schema: {
|
|
13
|
+
parse: (data: unknown) => T;
|
|
14
|
+
_def?: unknown;
|
|
15
|
+
shape?: unknown;
|
|
16
|
+
}): ZodLikeSchema<T>;
|
|
17
|
+
//# sourceMappingURL=scoped-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-input.d.ts","sourceRoot":"","sources":["../src/scoped-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3F,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE;IAAE,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAQzH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An input schema for a runner: a procedure that takes its input raw and runs the procedure
|
|
3
|
+
* refs in it (`core.catch`, `dag.traverse`).
|
|
4
|
+
*
|
|
5
|
+
* The caller gives a raw input with its scope (`withScope()`), so the runner can resolve the
|
|
6
|
+
* `$ref` names of an outer chain. The scope is a hidden property, and a Zod parse makes a new
|
|
7
|
+
* object without it. This schema validates with Zod, then puts the scope of the input on the
|
|
8
|
+
* result. (The general fix is in the core: `invokeProcedure` could keep the scope across the
|
|
9
|
+
* validation of every procedure.)
|
|
10
|
+
*/
|
|
11
|
+
import { scopeOf, withScope, zodAdapter } from "@mark1russell7/client";
|
|
12
|
+
export function scopedInput(schema) {
|
|
13
|
+
const scoped = {
|
|
14
|
+
parse: (data) => withScope(schema.parse(data), scopeOf(data)),
|
|
15
|
+
};
|
|
16
|
+
// zodAdapter shows _def and shape, so the CLI help and the MCP schema still see the fields
|
|
17
|
+
if (schema._def !== undefined)
|
|
18
|
+
scoped._def = schema._def;
|
|
19
|
+
if (schema.shape !== undefined)
|
|
20
|
+
scoped.shape = schema.shape;
|
|
21
|
+
return zodAdapter(scoped);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=scoped-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-input.js","sourceRoot":"","sources":["../src/scoped-input.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAsB,MAAM,uBAAuB,CAAC;AAE3F,MAAM,UAAU,WAAW,CAAI,MAAwE;IACrG,MAAM,MAAM,GAAqE;QAC/E,KAAK,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;KACvE,CAAC;IACF,2FAA2F;IAC3F,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACzD,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC5D,OAAO,UAAU,CAAI,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for client-lib procedures
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import type { DAGNode as DagBaseNode, DependencyDAG as DagDependencyDAG, DAGExecutionOptions as DagExecutionOptions, NodeResult as DagNodeResult, DAGResult as DagResult } from "@procedures/dag";
|
|
6
|
+
export declare const LibScanInputSchema: z.ZodObject<{
|
|
7
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}>;
|
|
9
|
+
export type LibScanInput = z.infer<typeof LibScanInputSchema>;
|
|
10
|
+
export interface PackageInfo {
|
|
11
|
+
/** Package name from package.json */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Absolute path to the package folder */
|
|
14
|
+
repoPath: string;
|
|
15
|
+
/** Git remote URL of the workspace repository, if available */
|
|
16
|
+
gitRemote?: string | undefined;
|
|
17
|
+
/** Current branch of the workspace repository */
|
|
18
|
+
currentBranch?: string | undefined;
|
|
19
|
+
/** The ecosystem dependencies (@procedures/* and @mark1russell7/*): workspace links and github: references */
|
|
20
|
+
mark1russell7Deps: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface LibScanOutput {
|
|
23
|
+
/** Map of package name to package info */
|
|
24
|
+
packages: Record<string, PackageInfo>;
|
|
25
|
+
/** Warnings for any issues found */
|
|
26
|
+
warnings: Array<{
|
|
27
|
+
path: string;
|
|
28
|
+
issue: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export interface DAGNode extends DagBaseNode {
|
|
32
|
+
/** Package name (e.g., "@mark1russell7/logger"). Mirrors `id`. */
|
|
33
|
+
name: string;
|
|
34
|
+
/** Path to the repo */
|
|
35
|
+
repoPath: string;
|
|
36
|
+
/** Git ref from package.json (e.g., "github:mark1russell7/logger#main") */
|
|
37
|
+
gitRef: string;
|
|
38
|
+
/** Required branch from git ref */
|
|
39
|
+
requiredBranch: string;
|
|
40
|
+
}
|
|
41
|
+
export type DependencyDAG = DagDependencyDAG<DAGNode>;
|
|
42
|
+
export type DAGExecutionOptions = DagExecutionOptions<DAGNode>;
|
|
43
|
+
export type NodeResult = DagNodeResult<DAGNode>;
|
|
44
|
+
export type DAGResult = DagResult<DAGNode>;
|
|
45
|
+
export interface GitRef {
|
|
46
|
+
/** Full ref string (e.g., "github:mark1russell7/logger#main") */
|
|
47
|
+
raw: string;
|
|
48
|
+
/** Host (github, gitlab, etc.) */
|
|
49
|
+
host: string;
|
|
50
|
+
/** Owner/org */
|
|
51
|
+
owner: string;
|
|
52
|
+
/** Repo name */
|
|
53
|
+
repo: string;
|
|
54
|
+
/** Branch or tag */
|
|
55
|
+
ref: string;
|
|
56
|
+
}
|
|
57
|
+
export interface GitStatus {
|
|
58
|
+
/** Whether the repo has uncommitted changes */
|
|
59
|
+
hasUncommittedChanges: boolean;
|
|
60
|
+
/** Whether there are staged changes */
|
|
61
|
+
hasStagedChanges: boolean;
|
|
62
|
+
/** Current branch */
|
|
63
|
+
currentBranch: string;
|
|
64
|
+
/** Whether the repo is clean */
|
|
65
|
+
isClean: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare const LibRenameInputSchema: z.ZodObject<{
|
|
68
|
+
oldName: z.ZodString;
|
|
69
|
+
newName: z.ZodString;
|
|
70
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
71
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
}>;
|
|
73
|
+
export type LibRenameInput = z.infer<typeof LibRenameInputSchema>;
|
|
74
|
+
export interface RenameChange {
|
|
75
|
+
/** Type of change */
|
|
76
|
+
type: "package-name" | "dependency" | "import" | "dynamic-import";
|
|
77
|
+
/** File that was changed */
|
|
78
|
+
file: string;
|
|
79
|
+
/** Field name (for dependency changes) */
|
|
80
|
+
field?: string | undefined;
|
|
81
|
+
/** Line number (for imports) */
|
|
82
|
+
line?: number | undefined;
|
|
83
|
+
/** Old value */
|
|
84
|
+
oldValue: string;
|
|
85
|
+
/** New value */
|
|
86
|
+
newValue: string;
|
|
87
|
+
}
|
|
88
|
+
export interface LibRenameOutput {
|
|
89
|
+
/** Whether all changes succeeded */
|
|
90
|
+
success: boolean;
|
|
91
|
+
/** List of changes made (or would be made if dryRun) */
|
|
92
|
+
changes: RenameChange[];
|
|
93
|
+
/** Any errors encountered */
|
|
94
|
+
errors: string[];
|
|
95
|
+
/** Summary counts */
|
|
96
|
+
summary: {
|
|
97
|
+
packageNames: number;
|
|
98
|
+
dependencies: number;
|
|
99
|
+
imports: number;
|
|
100
|
+
total: number;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export declare const LibNewInputSchema: z.ZodObject<{
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
preset: z.ZodDefault<z.ZodString>;
|
|
106
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
107
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
108
|
+
}>;
|
|
109
|
+
export type LibNewInput = z.infer<typeof LibNewInputSchema>;
|
|
110
|
+
export interface LibNewOutput {
|
|
111
|
+
/** Whether creation succeeded */
|
|
112
|
+
success: boolean;
|
|
113
|
+
/** Full package name (@procedures/...) */
|
|
114
|
+
packageName: string;
|
|
115
|
+
/** Path to created package */
|
|
116
|
+
packagePath: string;
|
|
117
|
+
/** Files created */
|
|
118
|
+
created: string[];
|
|
119
|
+
/** Operations performed */
|
|
120
|
+
operations: string[];
|
|
121
|
+
/** Any errors encountered */
|
|
122
|
+
errors: string[];
|
|
123
|
+
}
|
|
124
|
+
export declare const LibAuditInputSchema: z.ZodObject<{
|
|
125
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
126
|
+
fix: z.ZodDefault<z.ZodBoolean>;
|
|
127
|
+
}>;
|
|
128
|
+
export type LibAuditInput = z.infer<typeof LibAuditInputSchema>;
|
|
129
|
+
export interface PnpmIssue {
|
|
130
|
+
/** Type of pnpm issue */
|
|
131
|
+
type: "npm-lockfile" | "package-lockfile" | "ignored-pnpm-field" | "not-workspace-link";
|
|
132
|
+
/** Description of the issue */
|
|
133
|
+
message: string;
|
|
134
|
+
/** The dependency the issue is about, if any */
|
|
135
|
+
package?: string | undefined;
|
|
136
|
+
}
|
|
137
|
+
export interface PackageAuditResult {
|
|
138
|
+
/** Package name */
|
|
139
|
+
name: string;
|
|
140
|
+
/** Package path */
|
|
141
|
+
path: string;
|
|
142
|
+
/** Whether package passes audit */
|
|
143
|
+
valid: boolean;
|
|
144
|
+
/** Missing required files */
|
|
145
|
+
missingFiles: string[];
|
|
146
|
+
/** Missing required directories */
|
|
147
|
+
missingDirs: string[];
|
|
148
|
+
/** pnpm configuration issues */
|
|
149
|
+
pnpmIssues: PnpmIssue[];
|
|
150
|
+
/** Files that were fixed (if fix=true) */
|
|
151
|
+
fixedFiles?: string[] | undefined;
|
|
152
|
+
/** Dirs that were fixed (if fix=true) */
|
|
153
|
+
fixedDirs?: string[] | undefined;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* A procedure flag that hides a global flag of `mark` after the command path. It is not an
|
|
157
|
+
* error: the user gives the global flag before the command.
|
|
158
|
+
*/
|
|
159
|
+
export interface FlagNotice {
|
|
160
|
+
/** The procedure path, for example "docker compose down" */
|
|
161
|
+
procedure: string;
|
|
162
|
+
/** The flag of the procedure, for example "-v" */
|
|
163
|
+
flag: string;
|
|
164
|
+
/** The global flag that it hides, for example "-v (--version)" */
|
|
165
|
+
global: string;
|
|
166
|
+
}
|
|
167
|
+
export interface LibAuditOutput {
|
|
168
|
+
/** Overall success (all packages valid) */
|
|
169
|
+
success: boolean;
|
|
170
|
+
/** Procedure flags that hide a global flag of mark after the command path (information only) */
|
|
171
|
+
flagNotices: FlagNotice[];
|
|
172
|
+
/** Project template used for validation */
|
|
173
|
+
template: {
|
|
174
|
+
files: string[];
|
|
175
|
+
dirs: string[];
|
|
176
|
+
};
|
|
177
|
+
/** Results per package */
|
|
178
|
+
results: PackageAuditResult[];
|
|
179
|
+
/** Summary counts */
|
|
180
|
+
summary: {
|
|
181
|
+
total: number;
|
|
182
|
+
valid: number;
|
|
183
|
+
invalid: number;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Schema for $proc references with $when control.
|
|
188
|
+
*/
|
|
189
|
+
declare const ProcRefSchema: z.ZodObject<{
|
|
190
|
+
$proc: z.ZodArray<z.ZodString>;
|
|
191
|
+
input: z.ZodOptional<z.ZodUnknown>;
|
|
192
|
+
$when: z.ZodOptional<z.ZodString>;
|
|
193
|
+
$name: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}>;
|
|
195
|
+
export declare const DagTraverseInputSchema: z.ZodObject<{
|
|
196
|
+
visit: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, typeof ProcRefSchema]>;
|
|
197
|
+
filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
198
|
+
root: z.ZodOptional<z.ZodString>;
|
|
199
|
+
rootPath: z.ZodOptional<z.ZodString>;
|
|
200
|
+
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
201
|
+
serialize: z.ZodDefault<z.ZodEnum<{
|
|
202
|
+
auto: "auto";
|
|
203
|
+
repository: "repository";
|
|
204
|
+
none: "none";
|
|
205
|
+
}>>;
|
|
206
|
+
continueOnError: z.ZodDefault<z.ZodBoolean>;
|
|
207
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
208
|
+
}>;
|
|
209
|
+
export type DagTraverseInput = z.infer<typeof DagTraverseInputSchema>;
|
|
210
|
+
export interface TraverseNodeResult {
|
|
211
|
+
name: string;
|
|
212
|
+
path: string;
|
|
213
|
+
success: boolean;
|
|
214
|
+
duration: number;
|
|
215
|
+
error?: string | undefined;
|
|
216
|
+
output?: unknown | undefined;
|
|
217
|
+
}
|
|
218
|
+
export interface DagTraverseOutput {
|
|
219
|
+
success: boolean;
|
|
220
|
+
results: TraverseNodeResult[];
|
|
221
|
+
totalDuration: number;
|
|
222
|
+
visited: number;
|
|
223
|
+
failed: number;
|
|
224
|
+
}
|
|
225
|
+
export declare const CoreCatchInputSchema: z.ZodObject<{
|
|
226
|
+
try: z.ZodUnknown;
|
|
227
|
+
handler: z.ZodOptional<z.ZodUnknown>;
|
|
228
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
229
|
+
}>;
|
|
230
|
+
export type CoreCatchInput = z.infer<typeof CoreCatchInputSchema>;
|
|
231
|
+
export interface CoreCatchOutput {
|
|
232
|
+
/** Whether the try succeeded */
|
|
233
|
+
success: boolean;
|
|
234
|
+
/** Result from try (if success) or handler decision */
|
|
235
|
+
result?: unknown | undefined;
|
|
236
|
+
/** Error message if failed */
|
|
237
|
+
error?: string | undefined;
|
|
238
|
+
/** Whether execution should continue (from handler) */
|
|
239
|
+
continue: boolean;
|
|
240
|
+
}
|
|
241
|
+
export declare const LibScanOutputSchema: z.ZodType<LibScanOutput>;
|
|
242
|
+
export declare const LibRenameOutputSchema: z.ZodType<LibRenameOutput>;
|
|
243
|
+
export declare const LibNewOutputSchema: z.ZodType<LibNewOutput>;
|
|
244
|
+
export declare const LibAuditOutputSchema: z.ZodType<LibAuditOutput>;
|
|
245
|
+
export declare const DagTraverseOutputSchema: z.ZodType<DagTraverseOutput>;
|
|
246
|
+
export declare const CoreCatchOutputSchema: z.ZodType<CoreCatchOutput>;
|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OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACrC,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;CACjC,CAmBC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,uDAAuD;IACvD,QAAQ,EAAE,OAAO,CAAC;CACnB;AASD,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAgBvD,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAuB3D,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAOrD,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAgDzD,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAiB/D,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAK3D,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for client-lib procedures
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// lib.scan Types
|
|
7
|
+
// =============================================================================
|
|
8
|
+
export const LibScanInputSchema = z.object({
|
|
9
|
+
/** Workspace root (defaults to the pnpm workspace that contains client-lib) */
|
|
10
|
+
rootPath: z.string().optional().describe("Workspace root (defaults to the pnpm workspace that contains client-lib)"),
|
|
11
|
+
});
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// lib.rename Types
|
|
14
|
+
// =============================================================================
|
|
15
|
+
export const LibRenameInputSchema = z.object({
|
|
16
|
+
/** Current package name to rename from */
|
|
17
|
+
oldName: z.string().describe("Current package name to rename from"),
|
|
18
|
+
/** New package name to rename to */
|
|
19
|
+
newName: z.string().describe("New package name to rename to"),
|
|
20
|
+
/** Workspace root (defaults to the pnpm workspace that contains client-lib) */
|
|
21
|
+
rootPath: z.string().optional().describe("Workspace root (defaults to the pnpm workspace that contains client-lib)"),
|
|
22
|
+
/** Preview changes without applying (default: false) */
|
|
23
|
+
dryRun: z.boolean().default(false).describe("Preview changes without applying (default: false)"),
|
|
24
|
+
});
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// lib.new Types
|
|
27
|
+
// =============================================================================
|
|
28
|
+
export const LibNewInputSchema = z.object({
|
|
29
|
+
/** Package name (without the @procedures/ scope) */
|
|
30
|
+
name: z.string().regex(/^[a-z][a-z0-9-]*$/, "Name must be lowercase alphanumeric with hyphens").describe("Package name (without the @procedures/ scope)"),
|
|
31
|
+
/** Feature preset to use */
|
|
32
|
+
preset: z.string().regex(/^[a-z][a-z0-9-]*$/, "Preset must be lowercase alphanumeric with hyphens").default("lib").describe("Feature preset to use"),
|
|
33
|
+
/** Workspace root (defaults to the pnpm workspace that contains client-lib) */
|
|
34
|
+
rootPath: z.string().optional().describe("Workspace root (defaults to the pnpm workspace that contains client-lib)"),
|
|
35
|
+
/** Preview changes without creating */
|
|
36
|
+
dryRun: z.boolean().default(false).describe("Preview changes without creating"),
|
|
37
|
+
});
|
|
38
|
+
// =============================================================================
|
|
39
|
+
// lib.audit Types
|
|
40
|
+
// =============================================================================
|
|
41
|
+
export const LibAuditInputSchema = z.object({
|
|
42
|
+
/** Workspace root (defaults to the pnpm workspace that contains client-lib) */
|
|
43
|
+
rootPath: z.string().optional().describe("Workspace root (defaults to the pnpm workspace that contains client-lib)"),
|
|
44
|
+
/** Attempt to fix issues (create missing files/dirs) */
|
|
45
|
+
fix: z.boolean().default(false).describe("Attempt to fix issues (create missing files/dirs)"),
|
|
46
|
+
});
|
|
47
|
+
// =============================================================================
|
|
48
|
+
// dag.traverse Types
|
|
49
|
+
// =============================================================================
|
|
50
|
+
/**
|
|
51
|
+
* Schema for $proc references with $when control.
|
|
52
|
+
*/
|
|
53
|
+
const ProcRefSchema = z.object({
|
|
54
|
+
$proc: z.array(z.string()),
|
|
55
|
+
input: z.unknown().optional(),
|
|
56
|
+
$when: z.string().optional(),
|
|
57
|
+
$name: z.string().optional(),
|
|
58
|
+
});
|
|
59
|
+
export const DagTraverseInputSchema = z.object({
|
|
60
|
+
/**
|
|
61
|
+
* Procedure to execute for each node.
|
|
62
|
+
* - Array: procedure path, e.g., ["git", "add"]
|
|
63
|
+
* - $proc with $when: "$never" or "$parent": deferred, executed per-node
|
|
64
|
+
*
|
|
65
|
+
* Example:
|
|
66
|
+
* ```json
|
|
67
|
+
* { "$proc": ["git", "add"], "input": { "all": true }, "$when": "$parent" }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
visit: z.union([
|
|
71
|
+
z.array(z.string()),
|
|
72
|
+
ProcRefSchema,
|
|
73
|
+
]).describe("Procedure to execute for each node. - Array: procedure path, e.g., [\"git\", \"add\"] - $proc with $when: \"$never\" or \"$parent\": deferred, executed per-node Example: ```json { \"$proc\": [\"git\", \"add\"], \"input\": { \"all\": true }, \"$when\": \"$parent\" } ```"),
|
|
74
|
+
/** Filter to specific package names */
|
|
75
|
+
filter: z.array(z.string()).optional().describe("Filter to specific package names"),
|
|
76
|
+
/** Start from specific root package */
|
|
77
|
+
root: z.string().optional().describe("Start from specific root package"),
|
|
78
|
+
/** Workspace root (defaults to the pnpm workspace that contains client-lib) */
|
|
79
|
+
rootPath: z.string().optional().describe("Workspace root (defaults to the pnpm workspace that contains client-lib)"),
|
|
80
|
+
/** Max parallel operations (default: 4) */
|
|
81
|
+
concurrency: z.number().default(4).describe("Max parallel operations (default: 4)"),
|
|
82
|
+
/**
|
|
83
|
+
* When the visits of nodes in one git repository run one at a time (default: "auto").
|
|
84
|
+
* - "auto": when the visit calls a `git` procedure (git locks the index of the repository)
|
|
85
|
+
* - "repository": always
|
|
86
|
+
* - "none": never
|
|
87
|
+
*/
|
|
88
|
+
serialize: z.enum(["auto", "repository", "none"]).default("auto").describe("When the visits of nodes in one git repository run one at a time (default: \"auto\"). - \"auto\": when the visit calls a `git` procedure (git locks the index of the repository) - \"repository\": always - \"none\": never"),
|
|
89
|
+
/** Continue on error (default: false) */
|
|
90
|
+
continueOnError: z.boolean().default(false).describe("Continue on error (default: false)"),
|
|
91
|
+
/** Preview without executing (default: false) */
|
|
92
|
+
dryRun: z.boolean().default(false).describe("Preview without executing (default: false)"),
|
|
93
|
+
});
|
|
94
|
+
// =============================================================================
|
|
95
|
+
// core.catch Types
|
|
96
|
+
// =============================================================================
|
|
97
|
+
export const CoreCatchInputSchema = z.object({
|
|
98
|
+
/**
|
|
99
|
+
* Procedure ref to try executing.
|
|
100
|
+
* Should use $when: "catch" so it's not auto-executed during hydration.
|
|
101
|
+
*
|
|
102
|
+
* Example:
|
|
103
|
+
* ```json
|
|
104
|
+
* { "$proc": ["git", "commit"], "input": { "message": "auto" }, "$when": "catch" }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
try: z.unknown().describe("Procedure ref to try executing. Should use $when: \"catch\" so it's not auto-executed during hydration. Example: ```json { \"$proc\": [\"git\", \"commit\"], \"input\": { \"message\": \"auto\" }, \"$when\": \"catch\" } ```"),
|
|
108
|
+
/**
|
|
109
|
+
* Handler procedure ref called on error.
|
|
110
|
+
* Receives StepResultInfo (success, error, proc) merged with its input.
|
|
111
|
+
* Should return ContinueDecision { continue: boolean }.
|
|
112
|
+
*/
|
|
113
|
+
handler: z.unknown().optional().describe("Handler procedure ref called on error. Receives StepResultInfo (success, error, proc) merged with its input. Should return ContinueDecision { continue: boolean }."),
|
|
114
|
+
/** Working directory for procedure execution */
|
|
115
|
+
cwd: z.string().optional().describe("Working directory for procedure execution"),
|
|
116
|
+
});
|
|
117
|
+
// =============================================================================
|
|
118
|
+
// Output schemas (roadmap 2.1)
|
|
119
|
+
// =============================================================================
|
|
120
|
+
// Loose objects: a field that a schema does not name stays in the result (a strict schema would
|
|
121
|
+
// remove it when the output is validated).
|
|
122
|
+
export const LibScanOutputSchema = z.looseObject({
|
|
123
|
+
packages: z
|
|
124
|
+
.record(z.string(), z.looseObject({
|
|
125
|
+
name: z.string().describe("The package name"),
|
|
126
|
+
repoPath: z.string().describe("The absolute path of the package folder"),
|
|
127
|
+
gitRemote: z.string().optional().describe("The git remote URL of the workspace repository"),
|
|
128
|
+
currentBranch: z.string().optional().describe("The current branch of the workspace repository"),
|
|
129
|
+
mark1russell7Deps: z.array(z.string()).describe("The ecosystem dependencies of the package (@procedures/* and @mark1russell7/*)"),
|
|
130
|
+
}))
|
|
131
|
+
.describe("The workspace packages, by name"),
|
|
132
|
+
warnings: z
|
|
133
|
+
.array(z.looseObject({ path: z.string().describe("The folder"), issue: z.string().describe("The problem") }))
|
|
134
|
+
.describe("The problems that the scan found"),
|
|
135
|
+
});
|
|
136
|
+
export const LibRenameOutputSchema = z.looseObject({
|
|
137
|
+
success: z.boolean().describe("True when every change succeeded"),
|
|
138
|
+
changes: z
|
|
139
|
+
.array(z.looseObject({
|
|
140
|
+
type: z.enum(["package-name", "dependency", "import", "dynamic-import"]).describe("The kind of change"),
|
|
141
|
+
file: z.string().describe("The file that changes"),
|
|
142
|
+
field: z.string().optional().describe("The dependency field, for a dependency change"),
|
|
143
|
+
line: z.number().optional().describe("The line, for an import change"),
|
|
144
|
+
oldValue: z.string().describe("The old text"),
|
|
145
|
+
newValue: z.string().describe("The new text"),
|
|
146
|
+
}))
|
|
147
|
+
.describe("The changes that the call made, or would make with dryRun"),
|
|
148
|
+
errors: z.array(z.string()).describe("The errors"),
|
|
149
|
+
summary: z
|
|
150
|
+
.looseObject({
|
|
151
|
+
packageNames: z.number().describe("The number of package name changes"),
|
|
152
|
+
dependencies: z.number().describe("The number of dependency changes"),
|
|
153
|
+
imports: z.number().describe("The number of import changes"),
|
|
154
|
+
total: z.number().describe("The number of changes"),
|
|
155
|
+
})
|
|
156
|
+
.describe("The counts"),
|
|
157
|
+
});
|
|
158
|
+
export const LibNewOutputSchema = z.looseObject({
|
|
159
|
+
success: z.boolean().describe("True when the package was made"),
|
|
160
|
+
packageName: z.string().describe("The full package name (@procedures/...)"),
|
|
161
|
+
packagePath: z.string().describe("The folder of the new package"),
|
|
162
|
+
created: z.array(z.string()).describe("The files that the call made"),
|
|
163
|
+
operations: z.array(z.string()).describe("The steps that the call ran"),
|
|
164
|
+
errors: z.array(z.string()).describe("The errors"),
|
|
165
|
+
});
|
|
166
|
+
export const LibAuditOutputSchema = z.looseObject({
|
|
167
|
+
success: z.boolean().describe("True when every package passes the audit"),
|
|
168
|
+
flagNotices: z
|
|
169
|
+
.array(z.looseObject({
|
|
170
|
+
procedure: z.string().describe('The procedure path, for example "docker compose down"'),
|
|
171
|
+
flag: z.string().describe('The flag of the procedure, for example "-v"'),
|
|
172
|
+
global: z.string().describe('The global flag of mark that it hides, for example "-v (--version)"'),
|
|
173
|
+
}))
|
|
174
|
+
.describe("Procedure flags that hide a global flag of mark after the command path (information only)"),
|
|
175
|
+
template: z
|
|
176
|
+
.looseObject({
|
|
177
|
+
files: z.array(z.string()).describe("The files that each package needs"),
|
|
178
|
+
dirs: z.array(z.string()).describe("The folders that each package needs"),
|
|
179
|
+
})
|
|
180
|
+
.describe("The template of the audit"),
|
|
181
|
+
results: z
|
|
182
|
+
.array(z.looseObject({
|
|
183
|
+
name: z.string().describe("The package name"),
|
|
184
|
+
path: z.string().describe("The package folder"),
|
|
185
|
+
valid: z.boolean().describe("True when the package passes"),
|
|
186
|
+
missingFiles: z.array(z.string()).describe("The required files that are missing"),
|
|
187
|
+
missingDirs: z.array(z.string()).describe("The required folders that are missing"),
|
|
188
|
+
pnpmIssues: z
|
|
189
|
+
.array(z.looseObject({
|
|
190
|
+
type: z
|
|
191
|
+
.enum(["npm-lockfile", "package-lockfile", "ignored-pnpm-field", "not-workspace-link"])
|
|
192
|
+
.describe("The kind of pnpm problem"),
|
|
193
|
+
message: z.string().describe("The problem"),
|
|
194
|
+
package: z.string().optional().describe("The dependency that the problem is about"),
|
|
195
|
+
}))
|
|
196
|
+
.describe("The pnpm configuration problems"),
|
|
197
|
+
fixedFiles: z.array(z.string()).optional().describe("The files that fix made"),
|
|
198
|
+
fixedDirs: z.array(z.string()).optional().describe("The folders that fix made"),
|
|
199
|
+
}))
|
|
200
|
+
.describe("The result of each package"),
|
|
201
|
+
summary: z
|
|
202
|
+
.looseObject({
|
|
203
|
+
total: z.number().describe("The number of packages"),
|
|
204
|
+
valid: z.number().describe("The number of packages that pass"),
|
|
205
|
+
invalid: z.number().describe("The number of packages that fail"),
|
|
206
|
+
})
|
|
207
|
+
.describe("The counts"),
|
|
208
|
+
});
|
|
209
|
+
export const DagTraverseOutputSchema = z.looseObject({
|
|
210
|
+
success: z.boolean().describe("True when every visit succeeded"),
|
|
211
|
+
results: z
|
|
212
|
+
.array(z.looseObject({
|
|
213
|
+
name: z.string().describe("The package name of the node"),
|
|
214
|
+
path: z.string().describe("The folder of the node"),
|
|
215
|
+
success: z.boolean().describe("True when the visit succeeded"),
|
|
216
|
+
duration: z.number().describe("The time of the visit, in milliseconds"),
|
|
217
|
+
error: z.string().optional().describe("The error of a failed visit"),
|
|
218
|
+
output: z.unknown().optional().describe("The result of the visit"),
|
|
219
|
+
}))
|
|
220
|
+
.describe("The result of each visited node"),
|
|
221
|
+
totalDuration: z.number().describe("The time of the traversal, in milliseconds"),
|
|
222
|
+
visited: z.number().describe("The number of visited nodes"),
|
|
223
|
+
failed: z.number().describe("The number of failed visits"),
|
|
224
|
+
});
|
|
225
|
+
export const CoreCatchOutputSchema = z.looseObject({
|
|
226
|
+
success: z.boolean().describe("True when the try operand succeeded"),
|
|
227
|
+
result: z.unknown().optional().describe("The result of try, or the decision of the handler"),
|
|
228
|
+
error: z.string().optional().describe("The error of try, when it failed"),
|
|
229
|
+
continue: z.boolean().describe("True when the caller can continue"),
|
|
230
|
+
});
|
|
231
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAE1B,CAAC,CAAC,MAAM,CAAC;IACZ,+EAA+E;IAC/E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0EAA0E,CAAC;CACrH,CAAC,CAAC;AA8EH,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAK5B,CAAC,CAAC,MAAM,CAAC;IACZ,0CAA0C;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACnE,oCAAoC;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC7D,+EAA+E;IAC/E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0EAA0E,CAAC;IACpH,wDAAwD;IACxD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,mDAAmD,CAAC;CACjG,CAAC,CAAC;AAmCH,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF,MAAM,CAAC,MAA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ACnD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC9D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QACvE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACpE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KACnE,CAAC,CACH;SACA,QAAQ,CAAC,iCAAiC,CAAC;IAC9C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAChF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC3D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;CAC3D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAA+B,CAAC,CAAC,WAAW,CAAC;IAC7E,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACpE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;IAC5F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACzE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CACpE,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace helpers
|
|
3
|
+
*
|
|
4
|
+
* The client packages live in one pnpm workspace (the client monorepo). These helpers
|
|
5
|
+
* find the workspace root and decide which dependencies link two ecosystem packages,
|
|
6
|
+
* so the lib.* procedures work on the monorepo instead of one git repository per package.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Expand a leading `~/` to the home directory
|
|
10
|
+
*/
|
|
11
|
+
export declare function expandHome(p: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Find the nearest folder at or above `start` that holds pnpm-workspace.yaml
|
|
14
|
+
*/
|
|
15
|
+
export declare function findWorkspaceRoot(start: string): string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the workspace root for a procedure call: the explicit `rootPath` if given,
|
|
18
|
+
* else the workspace that contains this package.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveWorkspaceRoot(rootPath?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* The folder that holds the workspace packages
|
|
23
|
+
*/
|
|
24
|
+
export declare function packagesDir(root: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Return true if a dependency spec links to another ecosystem package:
|
|
27
|
+
* a workspace link (`workspace:*`) or a `github:mark1russell7/...` reference.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isEcosystemDependencySpec(spec: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The npm scopes of the ecosystem: `@procedures` for the packages of this workspace, and
|
|
32
|
+
* `@mark1russell7` for the general packages (cue, splay, docker-sqlite and the others).
|
|
33
|
+
*/
|
|
34
|
+
export declare const ECOSYSTEM_SCOPES: readonly string[];
|
|
35
|
+
/** True for the name of a package of the ecosystem scopes. */
|
|
36
|
+
export declare function isEcosystemPackageName(name: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Collect the names of the ecosystem packages (`@procedures/*` and `@mark1russell7/*`) that a
|
|
39
|
+
* package.json depends on (dependencies, devDependencies and peerDependencies), without duplicates.
|
|
40
|
+
*/
|
|
41
|
+
export declare function extractEcosystemDeps(pkg: {
|
|
42
|
+
dependencies?: Record<string, string> | undefined;
|
|
43
|
+
devDependencies?: Record<string, string> | undefined;
|
|
44
|
+
peerDependencies?: Record<string, string> | undefined;
|
|
45
|
+
}): string[];
|
|
46
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY9D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAe9D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAwC,CAAC;AAEvF,8DAA8D;AAC9D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACvD,GAAG,MAAM,EAAE,CAUX"}
|