@savvy-web/silk-effects 0.1.0 → 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 CHANGED
@@ -11,6 +11,8 @@ Shared [Effect](https://effect.website/) library providing Silk Suite convention
11
11
  - Detect versioning strategy (single, fixed-group, independent) from changeset config
12
12
  - Format git tags consistently based on workspace structure
13
13
  - Manage tool-owned sections inside user-editable files without clobbering user content
14
+ - Define reusable section identities with typed content factories (`SectionDefinition`)
15
+ - Discover and resolve CLI tools globally or locally with version enforcement and caching
14
16
  - Discover config files using a priority-based search convention
15
17
  - Keep Biome `$schema` URLs in sync across config files
16
18
 
@@ -24,9 +26,11 @@ pnpm add @savvy-web/silk-effects effect @effect/platform @effect/platform-node
24
26
 
25
27
  ## Quick Start
26
28
 
29
+ All exports come from the package root:
30
+
27
31
  ```typescript
28
32
  import { Effect } from "effect";
29
- import { TargetResolver, TargetResolverLive } from "@savvy-web/silk-effects/publish";
33
+ import { TargetResolver, TargetResolverLive } from "@savvy-web/silk-effects";
30
34
 
31
35
  const targets = await Effect.runPromise(
32
36
  Effect.gen(function* () {
@@ -36,16 +40,24 @@ const targets = await Effect.runPromise(
36
40
  );
37
41
  ```
38
42
 
39
- Modules that access the filesystem require a platform layer:
43
+ Services that access the filesystem require a platform layer:
40
44
 
41
45
  ```typescript
46
+ import { Effect } from "effect";
42
47
  import { NodeContext } from "@effect/platform-node";
43
- import { ManagedSection, ManagedSectionLive } from "@savvy-web/silk-effects/hooks";
48
+ import {
49
+ ManagedSection,
50
+ ManagedSectionLive,
51
+ SectionDefinition,
52
+ } from "@savvy-web/silk-effects";
53
+
54
+ const def = SectionDefinition.make({ toolName: "MY-TOOL" });
55
+ const block = def.block("\nnpx lint-staged\n");
44
56
 
45
57
  await Effect.runPromise(
46
58
  Effect.gen(function* () {
47
- const section = yield* ManagedSection;
48
- yield* section.write(".husky/pre-commit", "silk", "\nnpx lint-staged\n");
59
+ const ms = yield* ManagedSection;
60
+ yield* ms.sync(".husky/pre-commit", block);
49
61
  }).pipe(
50
62
  Effect.provide(ManagedSectionLive),
51
63
  Effect.provide(NodeContext.layer),
@@ -53,18 +65,19 @@ await Effect.runPromise(
53
65
  );
54
66
  ```
55
67
 
56
- ## Modules
57
-
58
- Each module has its own entry point -- import only what you need:
59
-
60
- | Module | Entry Point | Platform Layer | Docs |
61
- | ------ | ----------- | -------------- | ---- |
62
- | Publish | `@savvy-web/silk-effects/publish` | No | [docs/publish.md](./docs/publish.md) |
63
- | Versioning | `@savvy-web/silk-effects/versioning` | Yes | [docs/versioning.md](./docs/versioning.md) |
64
- | Tags | `@savvy-web/silk-effects/tags` | No | [docs/tags.md](./docs/tags.md) |
65
- | Hooks | `@savvy-web/silk-effects/hooks` | Yes | [docs/hooks.md](./docs/hooks.md) |
66
- | Config | `@savvy-web/silk-effects/config` | Yes | [docs/config.md](./docs/config.md) |
67
- | Biome | `@savvy-web/silk-effects/biome` | Yes | [docs/biome.md](./docs/biome.md) |
68
+ ## Services
69
+
70
+ | Service | Platform Layer | Description |
71
+ | ------- | -------------- | ----------- |
72
+ | `TargetResolver` | No | Resolve publish targets from shorthand strings or objects |
73
+ | `SilkPublishabilityPlugin` | No | Detect publishable packages from `package.json` |
74
+ | `TagStrategy` | No | Determine and format git tags by versioning strategy |
75
+ | `VersioningStrategy` | Yes (FileSystem) | Detect versioning strategy from changeset config |
76
+ | `ChangesetConfigReader` | Yes (FileSystem) | Read and parse changeset configuration |
77
+ | `ManagedSection` | Yes (FileSystem) | Read/write/sync/check tool-owned sections in user files |
78
+ | `ConfigDiscovery` | Yes (FileSystem) | Locate config files by priority-based search |
79
+ | `BiomeSchemaSync` | Yes (FileSystem) | Keep Biome `$schema` URLs in sync across config files |
80
+ | `ToolDiscovery` | Yes (CommandExecutor) | Locate CLI tools globally or locally, with caching |
68
81
 
69
82
  ## Documentation
70
83