@effected/schemastore-cli 0.9.0 → 0.9.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.
- package/cli/execute.js +3 -4
- package/main.js +1 -1
- package/package.json +3 -3
package/cli/execute.js
CHANGED
|
@@ -40,7 +40,6 @@ var StaleError = class extends Schema.TaggedError()("StaleError", { count: Schem
|
|
|
40
40
|
return `${this.count} document(s) are stale; run \`schemastore build\` and commit the result.`;
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
const reported = (error, exitCode) => CliRuntime.reported(error, exitCode);
|
|
44
43
|
const effectiveDrift = (configured, input) => {
|
|
45
44
|
return {
|
|
46
45
|
policy: input.force ? "allow" : Option.getOrElse(input.drift, () => configured.policy),
|
|
@@ -86,15 +85,15 @@ const execute = Effect.fn("schemastore.execute")(function* (mode, input, deps) {
|
|
|
86
85
|
yield* StepSummary.append(Report.markdown(report));
|
|
87
86
|
if (report.gateFailed) {
|
|
88
87
|
const count = report.schemas.filter((schema) => schema.outcome === "gate-failed").length;
|
|
89
|
-
return yield* Effect.fail(reported(new GateError({ count }), 1));
|
|
88
|
+
return yield* Effect.fail(CliRuntime.reported(new GateError({ count }), 1));
|
|
90
89
|
}
|
|
91
90
|
if (report.drifted && drift.onDrift === "error") {
|
|
92
91
|
const count = report.schemas.filter((schema) => schema.verdict === "drift").length;
|
|
93
|
-
return yield* Effect.fail(reported(new DriftError({ count }), 1));
|
|
92
|
+
return yield* Effect.fail(CliRuntime.reported(new DriftError({ count }), 1));
|
|
94
93
|
}
|
|
95
94
|
if (mode === "check") {
|
|
96
95
|
const count = report.schemas.filter((schema) => schema.outcome === "would-write").length + report.catalog.filter((entry) => entry.outcome === "would-write").length;
|
|
97
|
-
if (count > 0) return yield* Effect.fail(reported(new StaleError({ count }), 1));
|
|
96
|
+
if (count > 0) return yield* Effect.fail(CliRuntime.reported(new StaleError({ count }), 1));
|
|
98
97
|
}
|
|
99
98
|
});
|
|
100
99
|
|
package/main.js
CHANGED
|
@@ -15,7 +15,7 @@ const render = (error) => CliError.isCliError(error) && error._tag === "ShowHelp
|
|
|
15
15
|
const main = () => {
|
|
16
16
|
const run = program(process.argv.slice(2), {
|
|
17
17
|
cwd: process.cwd(),
|
|
18
|
-
version: "0.9.
|
|
18
|
+
version: "0.9.1"
|
|
19
19
|
}).pipe(Effect.provide(NodeServices.layer), CliRuntime.reportFailures({
|
|
20
20
|
exitCode: 3,
|
|
21
21
|
render
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/schemastore-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The schemastore command: build and check SchemaStore-shaped JSON Schema documents from a schemastore.config.ts, with a per-schema published flag and a drift policy.",
|
|
6
6
|
"keywords": [
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@effect/platform-node": "4.0.0-rc.115",
|
|
39
|
-
"@effected/cli": "^0.
|
|
39
|
+
"@effected/cli": "^0.5.0",
|
|
40
40
|
"jiti": "^2.6.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@effected/schemastore": "0.9.
|
|
43
|
+
"@effected/schemastore": "0.9.1",
|
|
44
44
|
"effect": "4.0.0-rc.115"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|