@savvy-web/cli 1.6.1 → 2.0.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/cli/index.js +62 -88
- package/commands/changeset/commands/check.js +2 -2
- package/commands/changeset/commands/config-validate.js +2 -2
- package/commands/changeset/commands/deps-detect.js +12 -18
- package/commands/changeset/commands/deps-regen.js +12 -18
- package/commands/changeset/commands/init.js +39 -40
- package/commands/changeset/commands/lint.js +3 -3
- package/commands/changeset/commands/transform.js +4 -4
- package/commands/changeset/commands/validate-file.js +3 -3
- package/commands/changeset/commands/version.js +2 -2
- package/commands/changeset/index.js +7 -4
- package/commands/check.js +12 -12
- package/commands/clean.js +9 -9
- package/commands/commit/check.js +5 -6
- package/commands/commit/hook.js +1 -1
- package/commands/commit/hooks/post-commit-verify.js +26 -46
- package/commands/commit/hooks/pre-commit-message.js +1 -1
- package/commands/commit/hooks/session-start.js +1 -1
- package/commands/commit/index.js +1 -1
- package/commands/commit/init.js +1 -2
- package/commands/init.js +6 -6
- package/commands/lint/check.js +15 -13
- package/commands/lint/fmt.js +12 -14
- package/commands/lint/index.js +1 -1
- package/commands/lint/init.js +7 -8
- package/commands/repos/commands/add.js +7 -7
- package/commands/repos/commands/note.js +19 -20
- package/commands/repos/commands/pin.js +4 -4
- package/commands/repos/commands/status.js +3 -3
- package/commands/repos/commands/sync.js +2 -2
- package/commands/repos/index.js +7 -4
- package/index.d.ts +62 -38
- package/package.json +10 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Command, Options } from "@effect/cli";
|
|
2
1
|
import { Repos } from "@savvy-web/silk-effects";
|
|
3
2
|
import { Effect } from "effect";
|
|
3
|
+
import { Command, Flag } from "effect/unstable/cli";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/repos/commands/sync.ts
|
|
6
6
|
/**
|
|
@@ -24,7 +24,7 @@ import { Effect } from "effect";
|
|
|
24
24
|
* @internal
|
|
25
25
|
*/
|
|
26
26
|
/* v8 ignore start -- CLI option definitions */
|
|
27
|
-
const cwdOption =
|
|
27
|
+
const cwdOption = Flag.directory("cwd").pipe(Flag.withDescription("Repo root to sync"), Flag.withDefault("."));
|
|
28
28
|
/* v8 ignore stop */
|
|
29
29
|
/**
|
|
30
30
|
* Sync handler; exported for tests.
|
package/commands/repos/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { noteCommand, runReposNote } from "./commands/note.js";
|
|
|
3
3
|
import { pinCommand, runReposPin } from "./commands/pin.js";
|
|
4
4
|
import { runReposStatus, statusCommand } from "./commands/status.js";
|
|
5
5
|
import { runReposSync, syncCommand } from "./commands/sync.js";
|
|
6
|
-
import { Command } from "
|
|
6
|
+
import { Command } from "effect/unstable/cli";
|
|
7
7
|
|
|
8
8
|
//#region src/commands/repos/index.ts
|
|
9
9
|
/* v8 ignore start -- CLI registration; each command tested via exported handler */
|
|
@@ -18,9 +18,12 @@ const _reposCommand = Command.make("repos").pipe(Command.withSubcommands([
|
|
|
18
18
|
* The `savvy repos` command group.
|
|
19
19
|
*
|
|
20
20
|
* @remarks
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Annotated with the exact five-parameter `Command.Command` instantiation
|
|
22
|
+
* (verified against the inferred type): the bare inferred type additionally
|
|
23
|
+
* prints the structural `subcommands` tree, whose inline command types
|
|
24
|
+
* reference effect's non-exported `Inspectable` module (TS4023). The
|
|
25
|
+
* annotation preserves the exact Error/Requirements channels, so the root
|
|
26
|
+
* layer graph stays compiler-validated.
|
|
24
27
|
*/
|
|
25
28
|
const reposCommand = _reposCommand;
|
|
26
29
|
|
package/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Effect } from "effect";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { JsoncParseError } from "jsonc
|
|
1
|
+
import { BiomeSchemaSync, Changesets, ConfigDiscovery, ManagedSection, Repos, SectionParseError, SectionWriteError, ToolDiscovery, VersioningStrategy } from "@savvy-web/silk-effects";
|
|
2
|
+
import { Cause, Effect, FileSystem } from "effect";
|
|
3
|
+
import { Command } from "effect/unstable/cli";
|
|
4
|
+
import { Git } from "@effected/git";
|
|
5
|
+
import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
|
|
6
|
+
import { PlatformError } from "effect/PlatformError";
|
|
7
|
+
import { JsoncParseError } from "@effected/jsonc";
|
|
8
8
|
//#region src/cli/index.d.ts
|
|
9
9
|
/**
|
|
10
|
-
* Root `savvy` CLI entry point using
|
|
10
|
+
* Root `savvy` CLI entry point using `effect/unstable/cli`.
|
|
11
11
|
*
|
|
12
12
|
* @remarks
|
|
13
13
|
* Assembles the five Phase-B command pieces — the `init` and `check` top-level
|
|
@@ -15,23 +15,30 @@ import { JsoncParseError } from "jsonc-effect";
|
|
|
15
15
|
* single `savvy` root command, then provides the merged runtime Layer stack
|
|
16
16
|
* that satisfies every command's service requirements.
|
|
17
17
|
*
|
|
18
|
-
* The layer stack
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* -
|
|
25
|
-
* `
|
|
26
|
-
*
|
|
18
|
+
* The layer stack wires the silk-effects Lives over their v4 requirement
|
|
19
|
+
* channels:
|
|
20
|
+
*
|
|
21
|
+
* - `NodeServices.layer` — `FileSystem`, `Path`, `ChildProcessSpawner`, `Stdio`,
|
|
22
|
+
* and `Terminal`, consumed by every config reader, workspace service, git
|
|
23
|
+
* layer, and the CLI framework itself.
|
|
24
|
+
* - `Git.layer` (from `@effected/git`) — the typed git service backing
|
|
25
|
+
* `BranchAnalyzer`, `ReposManager`, the commit hooks
|
|
26
|
+
* (`readBranchInfo` / `readSigningDiagnostic`), and `detectGitHubRepo`.
|
|
27
|
+
* - Workspace services from `@effected/workspaces` — `WorkspaceRoot.layer`,
|
|
28
|
+
* `PackageManagerDetector.layer`, and a single root-bound
|
|
29
|
+
* `WorkspaceDiscovery.layer()` (the kit resolves the root through
|
|
30
|
+
* `WorkspaceRoot` from `process.cwd()` lazily on first use, so the CLI's
|
|
31
|
+
* startup cwd is the discovery root).
|
|
27
32
|
* - Flat silk-effects services — `ChangesetConfigReaderLive`,
|
|
28
33
|
* `SilkPublishabilityDetectorLive`, `ManagedSectionLive`, `BiomeSchemaSyncLive`,
|
|
29
|
-
* `ConfigDiscoveryLive`, `ToolDiscoveryLive`, and `VersioningStrategyLive
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* `
|
|
33
|
-
*
|
|
34
|
-
*
|
|
34
|
+
* `ConfigDiscoveryLive`, `ToolDiscoveryLive`, and `VersioningStrategyLive`.
|
|
35
|
+
* - Changesets-namespace services — `Changesets.ConfigInspectorLive`,
|
|
36
|
+
* `Changesets.ReleasePlannerLive`, and `Changesets.BranchAnalyzerLive`
|
|
37
|
+
* sharing a single `ConfigInspector` via `provideMerge`. `DepsRegen` is NOT
|
|
38
|
+
* part of AppLive: its graph is root-bound at layer build, so the deps
|
|
39
|
+
* commands compose `Changesets.makeDepsRegenDefault({ cwd })` per invocation
|
|
40
|
+
* against their parsed `--cwd` (platform services flow up to
|
|
41
|
+
* `NodeServices.layer` here).
|
|
35
42
|
*
|
|
36
43
|
* The CLI version is injected at build time via `process.env.__PACKAGE_VERSION__`.
|
|
37
44
|
*
|
|
@@ -41,8 +48,11 @@ import { JsoncParseError } from "jsonc-effect";
|
|
|
41
48
|
* Bootstrap and run the `savvy` CLI application.
|
|
42
49
|
*
|
|
43
50
|
* @remarks
|
|
44
|
-
*
|
|
45
|
-
* stack
|
|
51
|
+
* `Command.run` returns an Effect reading `process.argv` from the Stdio
|
|
52
|
+
* service; the merged layer stack is provided and execution handed to
|
|
53
|
+
* `NodeRuntime.runMain`, whose default reporting covers defects (the v3
|
|
54
|
+
* `Cause.defects` wrapper is gone). No type casts: the layer graph is
|
|
55
|
+
* validated by the compiler.
|
|
46
56
|
*
|
|
47
57
|
* @internal
|
|
48
58
|
*/
|
|
@@ -79,18 +89,21 @@ declare function runChangesetInit(opts: {
|
|
|
79
89
|
quiet: boolean;
|
|
80
90
|
skipMarkdownlint: boolean;
|
|
81
91
|
check: boolean;
|
|
82
|
-
}): Effect.Effect<void, never, WorkspaceRoot>;
|
|
92
|
+
}): Effect.Effect<void, never, WorkspaceRoot | Git>;
|
|
83
93
|
//#endregion
|
|
84
94
|
//#region src/commands/changeset/index.d.ts
|
|
85
95
|
/**
|
|
86
96
|
* The `savvy changeset` command group for use in Task B7 root assembly.
|
|
87
97
|
*
|
|
88
98
|
* @remarks
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
99
|
+
* Annotated with the exact five-parameter `Command.Command` instantiation
|
|
100
|
+
* (verified against the inferred type): the bare inferred type additionally
|
|
101
|
+
* prints the structural `subcommands` tree, whose inline command types
|
|
102
|
+
* reference effect's non-exported `Inspectable` module (TS4023). The
|
|
103
|
+
* annotation preserves the exact Error/Requirements channels, so the root
|
|
104
|
+
* layer graph stays compiler-validated.
|
|
92
105
|
*/
|
|
93
|
-
declare const changesetCommand: Command.Command<"changeset",
|
|
106
|
+
declare const changesetCommand: Command.Command<"changeset", Record<string, never>, Record<string, never>, Changesets.ConfigurationError | Error | Changesets.ReleasePlanError | Cause.UnknownError | Changesets.DepsRegenPlanError, never>;
|
|
94
107
|
//#endregion
|
|
95
108
|
//#region src/commands/check.d.ts
|
|
96
109
|
/**
|
|
@@ -118,7 +131,10 @@ declare function runCheck<EChangeset, RChangeset, ECommit, RCommit, ELint, RLint
|
|
|
118
131
|
* errors from Effect's internal types. Task B7 should use this via
|
|
119
132
|
* `Command.withSubcommands([checkCommand as never])` or re-infer the type.
|
|
120
133
|
*/
|
|
121
|
-
declare const checkCommand: Command.Command<"check",
|
|
134
|
+
declare const checkCommand: Command.Command<"check", {
|
|
135
|
+
readonly changesetDir: string;
|
|
136
|
+
readonly quiet: boolean;
|
|
137
|
+
}, {}, Error | import("@effected/jsonc").JsoncParseError | import("effect/PlatformError").PlatformError | import("@savvy-web/silk-effects").SectionParseError, import("@savvy-web/silk-effects").ConfigDiscovery | import("effect/FileSystem").FileSystem | import("@savvy-web/silk-effects").ManagedSection | import("@savvy-web/silk-effects").ToolDiscovery | import("@savvy-web/silk-effects").VersioningStrategy | import("@effected/workspaces").WorkspaceDiscovery>;
|
|
122
138
|
//#endregion
|
|
123
139
|
//#region src/commands/commit/check.d.ts
|
|
124
140
|
/**
|
|
@@ -159,7 +175,7 @@ declare function runCommitInit(opts: {
|
|
|
159
175
|
* errors from Effect's internal types. Task B7 should import and use this directly
|
|
160
176
|
* as `Command.withSubcommands([commitCommand])` — the cast is for declaration emit only.
|
|
161
177
|
*/
|
|
162
|
-
declare const commitCommand: Command.Command<"commit",
|
|
178
|
+
declare const commitCommand: Command.Command<"commit", {}, {}, never, never>;
|
|
163
179
|
//#endregion
|
|
164
180
|
//#region src/commands/init.d.ts
|
|
165
181
|
/**
|
|
@@ -185,7 +201,12 @@ declare function runInit<EChangeset, RChangeset, ECommit, RCommit, ELint, RLint>
|
|
|
185
201
|
* errors from Effect's internal types. Task B7 should use this via
|
|
186
202
|
* `Command.withSubcommands([initCommand as never])` or re-infer the type.
|
|
187
203
|
*/
|
|
188
|
-
declare const initCommand: Command.Command<"init",
|
|
204
|
+
declare const initCommand: Command.Command<"init", {
|
|
205
|
+
readonly force: boolean;
|
|
206
|
+
readonly commitConfig: string;
|
|
207
|
+
readonly lintConfig: string;
|
|
208
|
+
readonly lintPreset: "minimal" | "silk" | "standard";
|
|
209
|
+
}, {}, Error | import("effect/PlatformError").PlatformError | import("@savvy-web/silk-effects").SectionWriteError, import("@savvy-web/silk-effects").BiomeSchemaSync | import("effect/FileSystem").FileSystem | import("@effected/git").Git | import("@savvy-web/silk-effects").ManagedSection | import("@effected/workspaces").WorkspaceRoot>;
|
|
189
210
|
//#endregion
|
|
190
211
|
//#region src/commands/lint/check.d.ts
|
|
191
212
|
/**
|
|
@@ -230,7 +251,7 @@ declare function runLintInit(opts: {
|
|
|
230
251
|
* errors from Effect's internal types. Task B7 should import and use this directly
|
|
231
252
|
* as `Command.withSubcommands([lintCommand])` — the cast is for declaration emit only.
|
|
232
253
|
*/
|
|
233
|
-
declare const lintCommand: Command.Command<"lint",
|
|
254
|
+
declare const lintCommand: Command.Command<"lint", {}, {}, import("@effected/yaml").YamlParseError | import("@effected/yaml").YamlStringifyError, never>;
|
|
234
255
|
//#endregion
|
|
235
256
|
//#region src/commands/repos/commands/status.d.ts
|
|
236
257
|
/**
|
|
@@ -253,11 +274,14 @@ declare const runReposSync: (cwd: string) => Effect.Effect<void, never, Repos.Re
|
|
|
253
274
|
* The `savvy repos` command group.
|
|
254
275
|
*
|
|
255
276
|
* @remarks
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
277
|
+
* Annotated with the exact five-parameter `Command.Command` instantiation
|
|
278
|
+
* (verified against the inferred type): the bare inferred type additionally
|
|
279
|
+
* prints the structural `subcommands` tree, whose inline command types
|
|
280
|
+
* reference effect's non-exported `Inspectable` module (TS4023). The
|
|
281
|
+
* annotation preserves the exact Error/Requirements channels, so the root
|
|
282
|
+
* layer graph stays compiler-validated.
|
|
259
283
|
*/
|
|
260
|
-
declare const reposCommand: Command.Command<"repos",
|
|
284
|
+
declare const reposCommand: Command.Command<"repos", Record<string, never>, Record<string, never>, Repos.GitSubmoduleError, never>;
|
|
261
285
|
//#endregion
|
|
262
286
|
export { changesetCommand, checkCommand, commitCommand, initCommand, lintCommand, reposCommand, runChangesetCheck, runChangesetInit, runCheck, runCli, runCommitCheck, runCommitInit, runInit, runLintCheck, runLintInit, runReposStatus, runReposSync };
|
|
263
287
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The savvy CLI — unified commit, changeset, and lint commands for the Silk Suite",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/cli",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./index.d.ts",
|
|
25
|
-
"import": "./index.js"
|
|
25
|
+
"import": "./index.js",
|
|
26
|
+
"default": "./index.js"
|
|
26
27
|
},
|
|
27
28
|
"./package.json": "./package.json"
|
|
28
29
|
},
|
|
@@ -30,21 +31,12 @@
|
|
|
30
31
|
"savvy": "bin/savvy.js"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@effect/
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"@effect/rpc": "^0.75.1",
|
|
41
|
-
"@effect/sql": "^0.51.1",
|
|
42
|
-
"@effect/typeclass": "^0.40.0",
|
|
43
|
-
"@effect/workflow": "^0.18.2",
|
|
44
|
-
"@savvy-web/silk-effects": "3.3.1",
|
|
45
|
-
"effect": "^3.21.4",
|
|
46
|
-
"jsonc-effect": "^0.3.1",
|
|
47
|
-
"workspaces-effect": "^2.1.0",
|
|
48
|
-
"yaml": "^2.9.0"
|
|
34
|
+
"@effect/platform-node": "4.0.0-beta.98",
|
|
35
|
+
"@effected/git": "^0.3.0",
|
|
36
|
+
"@effected/jsonc": "^0.2.0",
|
|
37
|
+
"@effected/workspaces": "^0.3.0",
|
|
38
|
+
"@effected/yaml": "^0.2.0",
|
|
39
|
+
"@savvy-web/silk-effects": "4.0.0",
|
|
40
|
+
"effect": "4.0.0-beta.98"
|
|
49
41
|
}
|
|
50
42
|
}
|