@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 +30 -17
- package/index.d.ts +902 -162
- package/index.js +1020 -6
- package/package.json +3 -39
- package/biome.d.ts +0 -135
- package/biome.js +0 -84
- package/config.d.ts +0 -147
- package/config.js +0 -38
- package/hooks.d.ts +0 -197
- package/hooks.js +0 -96
- package/publish.d.ts +0 -260
- package/publish.js +0 -124
- package/tags.d.ts +0 -122
- package/tags.js +0 -25
- package/versioning.d.ts +0 -234
- package/versioning.js +0 -115
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
|
|
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
|
-
|
|
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 {
|
|
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
|
|
48
|
-
yield*
|
|
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
|
-
##
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
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
|
|