@savvy-web/cli 2.1.12 → 2.1.15

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 CHANGED
@@ -10,7 +10,7 @@ import { ToolDiscovery } from "@effected/commands";
10
10
  import { Git } from "@effected/git";
11
11
  import { ManagedSection } from "@effected/templates";
12
12
  import { PackageManagerDetector, WorkspaceDiscovery, WorkspaceRoot, Workspaces } from "@effected/workspaces";
13
- import { BiomeSchemaSyncLive, ChangesetConfigReaderLive, Changesets, ConfigDiscoveryLive, Repos, SilkPublishabilityDetectorLive } from "@savvy-web/silk-effects";
13
+ import { BiomeSchemaSync, ChangesetConfigReader, Changesets, ConfigDiscovery, Repos, SilkPublishability } from "@savvy-web/silk-effects";
14
14
  import { Effect, Layer } from "effect";
15
15
  import { Command } from "effect/unstable/cli";
16
16
 
@@ -24,8 +24,8 @@ import { Command } from "effect/unstable/cli";
24
24
  * single `savvy` root command, then provides the merged runtime Layer stack
25
25
  * that satisfies every command's service requirements.
26
26
  *
27
- * The layer stack wires the silk-effects Lives over their v4 requirement
28
- * channels:
27
+ * The layer stack wires the silk-effects service layers over their v4
28
+ * requirement channels:
29
29
  *
30
30
  * - `NodeServices.layer` — `FileSystem`, `Path`, `ChildProcessSpawner`, `Stdio`,
31
31
  * and `Terminal`, consumed by every config reader, workspace service, git
@@ -38,17 +38,17 @@ import { Command } from "effect/unstable/cli";
38
38
  * `WorkspaceDiscovery.layer()` (the kit resolves the root through
39
39
  * `WorkspaceRoot` from `process.cwd()` lazily on first use, so the CLI's
40
40
  * startup cwd is the discovery root).
41
- * - Flat silk-effects services — `ChangesetConfigReaderLive`,
42
- * `SilkPublishabilityDetectorLive`, `ManagedSection.layer` (from
43
- * `@effected/templates`), `BiomeSchemaSyncLive`,
44
- * and `ConfigDiscoveryLive`. Tool resolution is the kit's
41
+ * - Flat silk-effects services — `ChangesetConfigReader.layer`,
42
+ * `SilkPublishability.layer`, `ManagedSection.layer` (from
43
+ * `@effected/templates`), `BiomeSchemaSync.layer`,
44
+ * and `ConfigDiscovery.layer`. Tool resolution is the kit's
45
45
  * `ToolDiscovery.layer` over `ChildProcessSpawner` plus a `LocalExec`, which
46
46
  * `Workspaces.localExecLayer()` supplies from the detected package manager.
47
47
  * Versioning classification
48
48
  * is a pure `@effected/workspaces` value operation over `WorkspaceDiscovery`
49
49
  * and the silk `PublishabilityDetector`, so it needs no layer of its own.
50
- * - Changesets-namespace services — `Changesets.ConfigInspectorLive`,
51
- * `Changesets.ReleasePlannerLive`, and `Changesets.BranchAnalyzerLive`
50
+ * - Changesets-namespace services — `Changesets.ConfigInspector.layer`,
51
+ * `Changesets.ReleasePlanner.layer`, and `Changesets.BranchAnalyzer.layer`
52
52
  * sharing a single `ConfigInspector` via `provideMerge`. `DepsRegen` is NOT
53
53
  * part of AppLive: its graph is root-bound at layer build, so the deps
54
54
  * commands compose `Changesets.makeDepsRegenDefault({ cwd })` per invocation
@@ -76,7 +76,7 @@ const rootCommand = Command.make("savvy").pipe(Command.withSubcommands([
76
76
  * CLI application: reads argv from the Stdio service provided by NodeServices.
77
77
  * (v4's `Command.run` takes only `version` — the name comes from the root command.)
78
78
  */
79
- const cli = Command.run(rootCommand, { version: "2.1.12" });
79
+ const cli = Command.run(rootCommand, { version: "2.1.15" });
80
80
  /**
81
81
  * Shared workspace services from `@effected/workspaces`, wired as a
82
82
  * self-contained unit and built ONCE (layers memoize by reference).
@@ -100,22 +100,22 @@ const GitLive = Git.layer;
100
100
  * (`WorkspaceLive`, `ChangesetConfigReader`, `GitLive`) that `AppLive`'s
101
101
  * upper services build upon.
102
102
  */
103
- const BaseLive = Layer.mergeAll(WorkspaceLive, GitLive, ChangesetConfigReaderLive, ManagedSection.layer, BiomeSchemaSyncLive, ConfigDiscoveryLive, SilkPublishabilityDetectorLive);
103
+ const BaseLive = Layer.mergeAll(WorkspaceLive, GitLive, ChangesetConfigReader.layer, ManagedSection.layer, BiomeSchemaSync.layer, ConfigDiscovery.layer, SilkPublishability.layer);
104
104
  /**
105
- * `ConfigInspectorLive` is built once via {@link Layer.provideMerge}: the merge
106
- * feeds that single `ConfigInspector` instance into `ReleasePlannerLive` and
107
- * `BranchAnalyzerLive` AND re-exposes it for the surviving `config validate`
105
+ * `ConfigInspector.layer` is built once via {@link Layer.provideMerge}: the merge
106
+ * feeds that single `ConfigInspector` instance into `ReleasePlanner.layer` and
107
+ * `BranchAnalyzer.layer` AND re-exposes it for the surviving `config validate`
108
108
  * handler that yields it directly, so it is never constructed twice per run.
109
- * `BranchAnalyzerLive`'s v4 requirements are `ConfigInspector |
109
+ * `BranchAnalyzer.layer`'s v4 requirements are `ConfigInspector |
110
110
  * ChildProcessSpawner` (the spawner flows up to `NodeServices.layer`).
111
111
  */
112
- const InspectorAndAnalyzerLive = Changesets.BranchAnalyzerLive.pipe(Layer.provideMerge(Changesets.ReleasePlannerLive), Layer.provideMerge(Changesets.ConfigInspectorLive));
112
+ const InspectorAndAnalyzerLive = Changesets.BranchAnalyzer.layer.pipe(Layer.provideMerge(Changesets.ReleasePlanner.layer), Layer.provideMerge(Changesets.ConfigInspector.layer));
113
113
  /**
114
- * `Repos.ReposManager`, provided its `Repos.ReposConfigStoreLive` dependency
114
+ * `Repos.ReposManager`, provided its `Repos.ReposConfigStore.layer` dependency
115
115
  * and the shared `Git` service. Platform requirements (`FileSystem`, `Path`)
116
116
  * flow up to `NodeServices.layer`.
117
117
  */
118
- const ReposGroupLive = Repos.ReposManagerLive.pipe(Layer.provide(Repos.ReposConfigStoreLive), Layer.provide(GitLive));
118
+ const ReposGroupLive = Repos.ReposManager.layer.pipe(Layer.provide(Repos.ReposConfigStore.layer), Layer.provide(GitLive));
119
119
  /**
120
120
  * `ToolDiscovery` from `@effected/commands`, wired to this workspace. Its
121
121
  * `LocalExec` contract — the argv prefix that runs a project-local binary — is
@@ -420,7 +420,8 @@ function handleChangesetMarkdownlint(changesetDir, root, force) {
420
420
  * @internal
421
421
  */
422
422
  function checkChangesetDir(root) {
423
- if (!existsSync(join(root, ".changeset"))) return [{
423
+ const dir = join(root, ".changeset");
424
+ if (!existsSync(dir)) return [{
424
425
  file: ".changeset/",
425
426
  message: "directory does not exist"
426
427
  }];
@@ -47,7 +47,8 @@ const { ConfigInspector } = Changesets;
47
47
  function requireValidConfig(cwd) {
48
48
  return Effect.gen(function* () {
49
49
  const projectDir = resolve(cwd);
50
- if (!existsSync(join(projectDir, ".changeset", "config.json"))) return;
50
+ const configPath = join(projectDir, ".changeset", "config.json");
51
+ if (!existsSync(configPath)) return;
51
52
  yield* (yield* ConfigInspector).inspect(projectDir).pipe(Effect.catchTag("ConfigurationError", (err) => {
52
53
  process.exitCode = 1;
53
54
  return Effect.fail(err);
@@ -35,7 +35,9 @@ const getRepoRoot = Effect.gen(function* () {
35
35
  });
36
36
  function runCommitlintLast(root) {
37
37
  return (async () => {
38
- const { command, args } = buildCommitlintInvocation(await Commitlint.detectPackageManager(root), await Commitlint.readCommitlintConfigPath(root), ["--last"]);
38
+ const pm = await Commitlint.detectPackageManager(root);
39
+ const configPath = await Commitlint.readCommitlintConfigPath(root);
40
+ const { command, args } = buildCommitlintInvocation(pm, configPath, ["--last"]);
39
41
  try {
40
42
  await execFileP(command, args, { cwd: root });
41
43
  return false;
@@ -36,7 +36,9 @@ const getRepoRoot = Effect.gen(function* () {
36
36
  */
37
37
  function runCommitlintEdit(root, file) {
38
38
  return (async () => {
39
- const { command, args } = buildCommitlintInvocation(await Commitlint.detectPackageManager(root), await Commitlint.readCommitlintConfigPath(root), ["--edit", file]);
39
+ const pm = await Commitlint.detectPackageManager(root);
40
+ const configPath = await Commitlint.readCommitlintConfigPath(root);
41
+ const { command, args } = buildCommitlintInvocation(pm, configPath, ["--edit", file]);
40
42
  try {
41
43
  const { stdout, stderr } = await execFileP(command, args, { cwd: root });
42
44
  return {
@@ -32,7 +32,8 @@ const pnpmWorkspaceCommand = Command.make("pnpm-workspace", {}, () => Effect.gen
32
32
  const content = readFileSync(filepath, "utf-8");
33
33
  const parsed = yield* Yaml.parse(content);
34
34
  const sorted = Lint.PnpmWorkspace.sortContent(parsed);
35
- writeFileSync(filepath, yield* Effect.promise(() => Lint.PnpmWorkspace.formatContent(sorted)), "utf-8");
35
+ const formatted = yield* Effect.promise(() => Lint.PnpmWorkspace.formatContent(sorted));
36
+ writeFileSync(filepath, formatted, "utf-8");
36
37
  }));
37
38
  /** Format YAML files with Prettier. */
38
39
  const yamlCommand = Command.make("yaml", { files: filesArg }, ({ files }) => Effect.gen(function* () {
package/index.d.ts CHANGED
@@ -18,8 +18,8 @@ import { JsoncParseError } from "@effected/jsonc";
18
18
  * single `savvy` root command, then provides the merged runtime Layer stack
19
19
  * that satisfies every command's service requirements.
20
20
  *
21
- * The layer stack wires the silk-effects Lives over their v4 requirement
22
- * channels:
21
+ * The layer stack wires the silk-effects service layers over their v4
22
+ * requirement channels:
23
23
  *
24
24
  * - `NodeServices.layer` — `FileSystem`, `Path`, `ChildProcessSpawner`, `Stdio`,
25
25
  * and `Terminal`, consumed by every config reader, workspace service, git
@@ -32,17 +32,17 @@ import { JsoncParseError } from "@effected/jsonc";
32
32
  * `WorkspaceDiscovery.layer()` (the kit resolves the root through
33
33
  * `WorkspaceRoot` from `process.cwd()` lazily on first use, so the CLI's
34
34
  * startup cwd is the discovery root).
35
- * - Flat silk-effects services — `ChangesetConfigReaderLive`,
36
- * `SilkPublishabilityDetectorLive`, `ManagedSection.layer` (from
37
- * `@effected/templates`), `BiomeSchemaSyncLive`,
38
- * and `ConfigDiscoveryLive`. Tool resolution is the kit's
35
+ * - Flat silk-effects services — `ChangesetConfigReader.layer`,
36
+ * `SilkPublishability.layer`, `ManagedSection.layer` (from
37
+ * `@effected/templates`), `BiomeSchemaSync.layer`,
38
+ * and `ConfigDiscovery.layer`. Tool resolution is the kit's
39
39
  * `ToolDiscovery.layer` over `ChildProcessSpawner` plus a `LocalExec`, which
40
40
  * `Workspaces.localExecLayer()` supplies from the detected package manager.
41
41
  * Versioning classification
42
42
  * is a pure `@effected/workspaces` value operation over `WorkspaceDiscovery`
43
43
  * and the silk `PublishabilityDetector`, so it needs no layer of its own.
44
- * - Changesets-namespace services — `Changesets.ConfigInspectorLive`,
45
- * `Changesets.ReleasePlannerLive`, and `Changesets.BranchAnalyzerLive`
44
+ * - Changesets-namespace services — `Changesets.ConfigInspector.layer`,
45
+ * `Changesets.ReleasePlanner.layer`, and `Changesets.BranchAnalyzer.layer`
46
46
  * sharing a single `ConfigInspector` via `provideMerge`. `DepsRegen` is NOT
47
47
  * part of AppLive: its graph is root-bound at layer build, so the deps
48
48
  * commands compose `Changesets.makeDepsRegenDefault({ cwd })` per invocation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/cli",
3
- "version": "2.1.12",
3
+ "version": "2.1.15",
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",
@@ -32,13 +32,13 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@effect/platform-node": "4.0.0-beta.101",
35
- "@effected/commands": "^0.1.0",
35
+ "@effected/commands": "^0.2.0",
36
36
  "@effected/git": "^0.5.1",
37
37
  "@effected/jsonc": "^0.5.1",
38
38
  "@effected/templates": "^0.1.0",
39
- "@effected/workspaces": "^0.9.0",
39
+ "@effected/workspaces": "^0.9.3",
40
40
  "@effected/yaml": "^0.6.0",
41
- "@savvy-web/silk-effects": "5.1.1",
41
+ "@savvy-web/silk-effects": "5.2.0",
42
42
  "effect": "4.0.0-beta.101"
43
43
  }
44
44
  }