@savvy-web/cli 0.1.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/841.js +2232 -0
- package/bin/savvy.js +3 -0
- package/index.d.ts +244 -0
- package/index.js +1 -0
- package/package.json +52 -0
- package/tsdoc-metadata.json +11 -0
package/bin/savvy.js
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@savvy-web/cli` — the `savvy` CLI for the Silk Suite.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This entry point re-exports the `changeset`, `commit`, and `lint` command groups,
|
|
6
|
+
* their named handlers, and `runCli` — the assembled root `savvy` command with its
|
|
7
|
+
* merged runtime layer stack.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { BiomeSchemaSync } from '@savvy-web/silk-effects';
|
|
13
|
+
import { Command } from '@effect/cli';
|
|
14
|
+
import { ConfigDiscovery } from '@savvy-web/silk-effects';
|
|
15
|
+
import { Effect } from 'effect';
|
|
16
|
+
import { FileSystem } from '@effect/platform';
|
|
17
|
+
import type { JsoncParseError } from 'jsonc-effect';
|
|
18
|
+
import { ManagedSection } from '@savvy-web/silk-effects';
|
|
19
|
+
import type { PlatformError } from '@effect/platform/Error';
|
|
20
|
+
import type { SectionParseError } from '@savvy-web/silk-effects';
|
|
21
|
+
import type { SectionWriteError } from '@savvy-web/silk-effects';
|
|
22
|
+
import { ToolDiscovery } from '@savvy-web/silk-effects';
|
|
23
|
+
import { VersioningStrategy } from '@savvy-web/silk-effects';
|
|
24
|
+
import { WorkspaceDiscovery } from 'workspaces-effect';
|
|
25
|
+
import { WorkspaceRoot } from 'workspaces-effect';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The `savvy changeset` command group for use in Task B7 root assembly.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Typed as `unknown` at the export boundary to avoid TypeScript declaration-emit
|
|
32
|
+
* errors from Effect's internal types. Task B7 should import and use this via
|
|
33
|
+
* `Command.withSubcommands([changesetCommand as never])` or re-infer the type.
|
|
34
|
+
*/
|
|
35
|
+
export declare const changesetCommand: Command.Command<"changeset", any, any, any>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The `savvy check` command for use in the Task B7 root assembly.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Typed with `any` at the export boundary to avoid TypeScript declaration-emit
|
|
42
|
+
* errors from Effect's internal types. Task B7 should use this via
|
|
43
|
+
* `Command.withSubcommands([checkCommand as never])` or re-infer the type.
|
|
44
|
+
*/
|
|
45
|
+
export declare const checkCommand: Command.Command<"check", any, any, any>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The `savvy commit` command group for use in Task B7 root assembly.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* Typed as `unknown` at the export boundary to avoid TypeScript declaration-emit
|
|
52
|
+
* errors from Effect's internal types. Task B7 should import and use this directly
|
|
53
|
+
* as `Command.withSubcommands([commitCommand])` — the cast is for declaration emit only.
|
|
54
|
+
*/
|
|
55
|
+
export declare const commitCommand: Command.Command<"commit", any, any, any>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The `savvy init` command for use in the Task B7 root assembly.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Typed with `any` at the export boundary to avoid TypeScript declaration-emit
|
|
62
|
+
* errors from Effect's internal types. Task B7 should use this via
|
|
63
|
+
* `Command.withSubcommands([initCommand as never])` or re-infer the type.
|
|
64
|
+
*/
|
|
65
|
+
export declare const initCommand: Command.Command<"init", any, any, any>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The `savvy lint` command group for use in Task B7 root assembly.
|
|
69
|
+
*
|
|
70
|
+
* @remarks
|
|
71
|
+
* Typed as `unknown` at the export boundary to avoid TypeScript declaration-emit
|
|
72
|
+
* errors from Effect's internal types. Task B7 should import and use this directly
|
|
73
|
+
* as `Command.withSubcommands([lintCommand])` — the cast is for declaration emit only.
|
|
74
|
+
*/
|
|
75
|
+
export declare const lintCommand: Command.Command<"lint", any, any, any>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Run the check validation pipeline on all changeset files in `dir`.
|
|
79
|
+
*
|
|
80
|
+
* Groups lint messages by file and logs a human-readable summary. Sets
|
|
81
|
+
* `process.exitCode = 1` when one or more errors are found.
|
|
82
|
+
*
|
|
83
|
+
* @param dir - Path to the changeset directory (resolved relative to cwd)
|
|
84
|
+
* @returns An Effect that performs validation and logs results
|
|
85
|
+
*
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
export declare function runChangesetCheck(dir: string): Effect.Effect<void, Error>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Run the full init pipeline.
|
|
92
|
+
*
|
|
93
|
+
* Exported so Task B5's unified `savvy init` orchestrator can invoke the
|
|
94
|
+
* changeset init step directly without going through the CLI command layer.
|
|
95
|
+
*
|
|
96
|
+
* @param opts - The same options the CLI command receives
|
|
97
|
+
* @returns An Effect that performs initialization
|
|
98
|
+
*
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
export declare function runChangesetInit(opts: {
|
|
102
|
+
force: boolean;
|
|
103
|
+
quiet: boolean;
|
|
104
|
+
skipMarkdownlint: boolean;
|
|
105
|
+
check: boolean;
|
|
106
|
+
}): Effect.Effect<void, never, WorkspaceRoot>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Run all three check step Effects without short-circuiting.
|
|
110
|
+
*
|
|
111
|
+
* All three checks always run, sequentially (concurrency 1) so per-tool
|
|
112
|
+
* output stays grouped. If any fail, the combined Effect fails with all
|
|
113
|
+
* accumulated errors. Uses `Effect.all` with `{ concurrency: 1, mode: "validate" }`
|
|
114
|
+
* to collect every failure rather than stopping at the first.
|
|
115
|
+
*
|
|
116
|
+
* @param steps - The three step Effects to run. Injected for testability.
|
|
117
|
+
* @returns An Effect that resolves to `void` on success, or fails with the
|
|
118
|
+
* union of all failing steps' errors.
|
|
119
|
+
*/
|
|
120
|
+
export declare function runCheck<EChangeset, RChangeset, ECommit, RCommit, ELint, RLint>(steps: {
|
|
121
|
+
changeset: Effect.Effect<unknown, EChangeset, RChangeset>;
|
|
122
|
+
commit: Effect.Effect<unknown, ECommit, RCommit>;
|
|
123
|
+
lint: Effect.Effect<unknown, ELint, RLint>;
|
|
124
|
+
}): Effect.Effect<void, EChangeset | ECommit | ELint, RChangeset | RCommit | RLint>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Root `savvy` CLI entry point using `@effect/cli`.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* Assembles the five Phase-B command pieces — the `init` and `check` top-level
|
|
131
|
+
* orchestrators plus the `changeset`, `commit`, and `lint` groups — under a
|
|
132
|
+
* single `savvy` root command, then provides the merged runtime Layer stack
|
|
133
|
+
* that satisfies every command's service requirements.
|
|
134
|
+
*
|
|
135
|
+
* The layer stack is the union of the three standalone CLIs' stacks
|
|
136
|
+
* (`@savvy-web/changesets`, `@savvy-web/commitlint`, `@savvy-web/lint-staged`),
|
|
137
|
+
* with each service's transitive dependencies wired:
|
|
138
|
+
*
|
|
139
|
+
* - `NodeContext.layer` — `FileSystem`, `Path`, and `CommandExecutor`, consumed
|
|
140
|
+
* by every config reader, workspace service, and tool-discovery layer.
|
|
141
|
+
* - Workspace services — `WorkspaceRootLive`, `PackageManagerDetectorLive`, and
|
|
142
|
+
* `WorkspaceDiscoveryLive` (provided `WorkspaceRootLive`), the minimal hand-wired
|
|
143
|
+
* trio shared by the three source CLIs.
|
|
144
|
+
* - Flat silk-effects services — `ChangesetConfigReaderLive`,
|
|
145
|
+
* `SilkPublishabilityDetectorLive`, `ManagedSectionLive`, `BiomeSchemaSyncLive`,
|
|
146
|
+
* `ConfigDiscoveryLive`, `ToolDiscoveryLive`, and `VersioningStrategyLive`
|
|
147
|
+
* (provided `ChangesetConfigReaderLive`).
|
|
148
|
+
* - Changesets-namespace services — `Changesets.ConfigInspectorLive` (provided
|
|
149
|
+
* `ChangesetConfigReaderLive`), `Changesets.WorkspaceSnapshotReaderLive`, and
|
|
150
|
+
* `Changesets.BranchAnalyzerLive`, which shares the single `ConfigInspectorLive`
|
|
151
|
+
* instance built once via `provideMerge`.
|
|
152
|
+
*
|
|
153
|
+
* The CLI version is injected at build time via `__PACKAGE_VERSION__`.
|
|
154
|
+
*
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
/**
|
|
158
|
+
* Bootstrap and run the `savvy` CLI application.
|
|
159
|
+
*
|
|
160
|
+
* @remarks
|
|
161
|
+
* Builds an Effect from the parsed `process.argv`, provides the merged layer
|
|
162
|
+
* stack, and hands execution to `NodeRuntime.runMain`.
|
|
163
|
+
*
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
export declare function runCli(): void;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Run the check validation pipeline.
|
|
170
|
+
*
|
|
171
|
+
* Exported so Task B6's unified `savvy check` orchestrator can invoke the
|
|
172
|
+
* commitlint check step directly without going through the CLI command layer.
|
|
173
|
+
*
|
|
174
|
+
* @returns An Effect that performs validation and logs results
|
|
175
|
+
*
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
export declare function runCommitCheck(): Effect.Effect<void, SectionParseError | PlatformError, ManagedSection | FileSystem.FileSystem | VersioningStrategy | WorkspaceDiscovery>;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Run the full init pipeline.
|
|
182
|
+
*
|
|
183
|
+
* Exported so Task B5's unified `savvy init` orchestrator can invoke the
|
|
184
|
+
* commitlint init step directly without going through the CLI command layer.
|
|
185
|
+
*
|
|
186
|
+
* @param opts - The same options the CLI command receives
|
|
187
|
+
* @returns An Effect that performs initialization
|
|
188
|
+
*
|
|
189
|
+
* @internal
|
|
190
|
+
*/
|
|
191
|
+
export declare function runCommitInit(opts: {
|
|
192
|
+
force: boolean;
|
|
193
|
+
config: string;
|
|
194
|
+
}): Effect.Effect<void, Error | SectionWriteError | PlatformError, ManagedSection | FileSystem.FileSystem>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Run the three init step Effects in order: changeset → commit → lint.
|
|
198
|
+
*
|
|
199
|
+
* Monadic sequencing via `Effect.gen` short-circuits on the first failure —
|
|
200
|
+
* if changeset fails, neither commit nor lint will run.
|
|
201
|
+
*
|
|
202
|
+
* @param steps - The three step Effects to sequence. Injected for testability.
|
|
203
|
+
* @returns An Effect that resolves to `void` on success, or fails with the
|
|
204
|
+
* error of the first failing step.
|
|
205
|
+
*/
|
|
206
|
+
export declare function runInit<EChangeset, RChangeset, ECommit, RCommit, ELint, RLint>(steps: {
|
|
207
|
+
changeset: Effect.Effect<unknown, EChangeset, RChangeset>;
|
|
208
|
+
commit: Effect.Effect<unknown, ECommit, RCommit>;
|
|
209
|
+
lint: Effect.Effect<unknown, ELint, RLint>;
|
|
210
|
+
}): Effect.Effect<void, EChangeset | ECommit | ELint, RChangeset | RCommit | RLint>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Run the lint check validation pipeline.
|
|
214
|
+
*
|
|
215
|
+
* Exported so Task B6's unified `savvy check` orchestrator can invoke the
|
|
216
|
+
* lint check step directly without going through the CLI command layer.
|
|
217
|
+
*
|
|
218
|
+
* @param opts - Options for the check command
|
|
219
|
+
* @returns An Effect that performs validation and logs results
|
|
220
|
+
*
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
export declare function runLintCheck(opts: {
|
|
224
|
+
quiet: boolean;
|
|
225
|
+
}): Effect.Effect<void, JsoncParseError | SectionParseError | PlatformError, ManagedSection | FileSystem.FileSystem | ToolDiscovery | ConfigDiscovery>;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Run the full lint init pipeline.
|
|
229
|
+
*
|
|
230
|
+
* Exported so Task B5's unified `savvy init` orchestrator can invoke the
|
|
231
|
+
* lint-staged init step directly without going through the CLI command layer.
|
|
232
|
+
*
|
|
233
|
+
* @param opts - The same options the CLI command receives
|
|
234
|
+
* @returns An Effect that performs initialization
|
|
235
|
+
*
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
238
|
+
export declare function runLintInit(opts: {
|
|
239
|
+
force: boolean;
|
|
240
|
+
config: string;
|
|
241
|
+
preset: "minimal" | "standard" | "silk";
|
|
242
|
+
}): Effect.Effect<void, Error | SectionWriteError | PlatformError, ManagedSection | FileSystem.FileSystem | BiomeSchemaSync>;
|
|
243
|
+
|
|
244
|
+
export { }
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { changesetCommand, checkCommand, commitCommand, initCommand, lintCommand, runChangesetCheck, runChangesetInit, runCheck, runCli, runCommitCheck, runCommitInit, runInit, runLintCheck, runLintInit } from "./841.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@savvy-web/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "The savvy CLI — unified commit, changeset, and lint commands for the Silk Suite",
|
|
6
|
+
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/cli",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/savvy-web/systems/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/savvy-web/systems.git",
|
|
13
|
+
"directory": "packages/cli"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "C. Spencer Beggs",
|
|
18
|
+
"email": "spencer@savvyweb.systems",
|
|
19
|
+
"url": "https://savvyweb.systems"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./index.d.ts",
|
|
25
|
+
"import": "./index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"bin": {
|
|
29
|
+
"savvy": "bin/savvy.js"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@effect/cli": "^0.75.1",
|
|
33
|
+
"@effect/platform": "^0.96.1",
|
|
34
|
+
"@effect/platform-node": "^0.106.0",
|
|
35
|
+
"@savvy-web/silk-effects": "0.6.0",
|
|
36
|
+
"effect": "^3.21.2",
|
|
37
|
+
"jsonc-effect": "^0.2.1",
|
|
38
|
+
"workspaces-effect": "^1.1.0",
|
|
39
|
+
"yaml": "^2.9.0"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"!cli.api.json",
|
|
43
|
+
"!tsconfig.json",
|
|
44
|
+
"!tsdoc.json",
|
|
45
|
+
"841.js",
|
|
46
|
+
"bin/savvy.js",
|
|
47
|
+
"index.d.ts",
|
|
48
|
+
"index.js",
|
|
49
|
+
"package.json",
|
|
50
|
+
"tsdoc-metadata.json"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.58.7"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|