@effected/schemastore 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +14 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -240,15 +240,26 @@ const targets = [
240
240
  }),
241
241
  ];
242
242
 
243
- const program = SchemaPipeline.run(targets).pipe(
244
- Effect.provide(Layer.mergeAll(SchemaFile.layer, SchemaValidator.layer)),
245
- Effect.provide(NodeServices.layer),
243
+ // One named layer, composed once, provided at the boundary.
244
+ const AppLayer = Layer.mergeAll(SchemaFile.layer, SchemaValidator.layer).pipe(
245
+ Layer.provide(NodeServices.layer),
246
246
  );
247
247
 
248
+ const program = SchemaPipeline.run(targets).pipe(Effect.provide(AppLayer));
249
+
248
250
  Effect.runPromise(program).then(console.log);
249
251
  // => [{ $id, path, outcome: "written", change: "created", findings: [] }]
250
252
  ```
251
253
 
254
+ `NodeServices` is composed **into** the layer with `Layer.provide` rather than
255
+ stacked onto the program with a second `Effect.provide`. Both run correctly
256
+ here — `SchemaFile` holds no state, so nothing observes the difference — but
257
+ the composed form is the shape to copy. Stacking `Effect.provide` calls at the
258
+ call site is how a layer ends up built more than once, and the first stateful
259
+ service you add is where that starts to matter. Binding the composition to a
260
+ named `const` also makes it reusable: a drift test and the generator that
261
+ provide the same value cannot disagree about what the layer contains.
262
+
252
263
  A target names its schema, its `$id` and where the file goes. `name` is optional and only catalog naming reads it, so a file-only target like the one above does not repeat its path's basename; supply it when you also pass a `version`, since versioned naming is `<name>-<version>.json`.
253
264
 
254
265
  Both gates' findings normalize into one `PipelineFinding` shape, so a single predicate judges them. Gating is **policy, not mechanism**: `blocking` defaults to `severity === "warning"`, which is what `UnresolvedRef`, `UnknownKeyword` and `DepthExceeded` are. Replace the predicate rather than the loop when you disagree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/schemastore",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "description": "Build, validate, version and publish SchemaStore-shaped Draft-07 JSON Schema documents from Effect Schema sources: document assembly, ajv strict-mode validation, structural lints, catalog entries, canonical JSON and a content-comparing emit pipeline.",
6
6
  "keywords": [
@@ -38,7 +38,7 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "dependencies": {
41
- "@effected/semver": "^0.3.1",
41
+ "@effected/semver": "^0.3.2",
42
42
  "ajv": "^8.20.0"
43
43
  },
44
44
  "peerDependencies": {