@savvy-web/cli 1.3.1 → 1.3.3
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 +1 -1
- package/commands/changeset/commands/config-validate.js +1 -1
- package/commands/changeset/commands/deps-detect.js +1 -1
- package/commands/changeset/commands/deps-regen.js +1 -1
- package/commands/changeset/commands/init.js +1 -1
- package/commands/changeset/commands/lint.js +1 -1
- package/commands/changeset/commands/transform.js +1 -1
- package/commands/changeset/commands/validate-file.js +1 -1
- package/commands/changeset/commands/version.js +1 -1
- package/commands/changeset/index.js +1 -1
- package/commands/clean.js +1 -1
- package/commands/commit/hooks/post-commit-verify.js +1 -1
- package/commands/commit/hooks/pre-commit-message.js +1 -1
- package/commands/commit/index.js +1 -1
- package/commands/lint/biome-version.js +25 -0
- package/commands/lint/check.js +3 -7
- package/commands/lint/index.js +1 -1
- package/commands/lint/init.js +3 -4
- package/package.json +1 -1
package/cli/index.js
CHANGED
|
@@ -57,7 +57,7 @@ const rootCommand = Command.make("savvy").pipe(Command.withSubcommands([
|
|
|
57
57
|
]));
|
|
58
58
|
const cli = Command.run(rootCommand, {
|
|
59
59
|
name: "savvy",
|
|
60
|
-
version: "1.3.
|
|
60
|
+
version: "1.3.3"
|
|
61
61
|
});
|
|
62
62
|
/**
|
|
63
63
|
* Shared base layer: workspace services, the changeset config reader, and the
|
|
@@ -60,4 +60,4 @@ function runConfigValidate(dir) {
|
|
|
60
60
|
const configValidateCommand = Command.make("validate", { dir: dirArg }, ({ dir }) => runConfigValidate(dir)).pipe(Command.withDescription("Validate .changeset/config.json without rendering it"));
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
|
-
export { configValidateCommand };
|
|
63
|
+
export { configValidateCommand, runConfigValidate };
|
|
@@ -100,4 +100,4 @@ const depsDetectCommand = Command.make("detect", {
|
|
|
100
100
|
}, ({ from, to, cwd, package: pkg, json, markdown }) => runDepsDetect(cwd, from, to, pkg, json, markdown)).pipe(Command.withDescription("Compute the dependency diff between two refs"));
|
|
101
101
|
|
|
102
102
|
//#endregion
|
|
103
|
-
export { depsDetectCommand };
|
|
103
|
+
export { depsDetectCommand, renderMarkdownBlocks, runDepsDetect };
|
|
@@ -274,4 +274,4 @@ const depsRegenCommand = Command.make("regen", {
|
|
|
274
274
|
}, ({ cwd, base, package: pkg, dryRun, json }) => runDepsRegen(cwd, base, pkg, dryRun, json)).pipe(Command.withDescription("Delete pure dependency changesets and regenerate them from the current diff"));
|
|
275
275
|
|
|
276
276
|
//#endregion
|
|
277
|
-
export { depsRegenCommand };
|
|
277
|
+
export { depsRegenCommand, isPureDependencyChangeset, runDepsRegen };
|
|
@@ -615,4 +615,4 @@ function runChangesetInit(opts) {
|
|
|
615
615
|
}
|
|
616
616
|
|
|
617
617
|
//#endregion
|
|
618
|
-
export { runChangesetInit };
|
|
618
|
+
export { InitError, InitErrorBase, checkBaseMarkdownlint, checkChangesetDir, checkChangesetMarkdownlint, checkConfig, detectGitHubRepo, detectLegacyVersionFiles, ensureChangesetDir, findMarkdownlintConfig, handleBaseMarkdownlint, handleChangesetMarkdownlint, handleConfig, legacyVersionFilesWarning, resolveWorkspaceRoot, runChangesetInit, warnIfLegacyVersionFiles };
|
|
@@ -85,4 +85,4 @@ const transformCommand = Command.make("transform", {
|
|
|
85
85
|
}, ({ file, dryRun, check }) => runTransform(file, dryRun, check)).pipe(Command.withDescription("Post-process CHANGELOG.md"));
|
|
86
86
|
|
|
87
87
|
//#endregion
|
|
88
|
-
export { transformCommand };
|
|
88
|
+
export { runTransform, transformCommand };
|
|
@@ -49,4 +49,4 @@ function runValidateFile(filePath) {
|
|
|
49
49
|
const validateFileCommand = Command.make("validate-file", { file: fileArg }, ({ file }) => runValidateFile(file)).pipe(Command.withDescription("Validate a single changeset file"));
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
|
-
export { validateFileCommand };
|
|
52
|
+
export { runValidateFile, validateFileCommand };
|
|
@@ -42,4 +42,4 @@ function runVersion(dryRun) {
|
|
|
42
42
|
const versionCommand = Command.make("version", { dryRun: dryRunOption }, ({ dryRun }) => runVersion(dryRun)).pipe(Command.withDescription("Apply pending changesets: bump versions and transform CHANGELOGs"));
|
|
43
43
|
|
|
44
44
|
//#endregion
|
|
45
|
-
export { versionCommand };
|
|
45
|
+
export { runVersion, versionCommand };
|
package/commands/clean.js
CHANGED
|
@@ -118,4 +118,4 @@ const postCommitVerifyCommand = Command.make("post-commit-verify", {}, () => Eff
|
|
|
118
118
|
}).pipe(Effect.provide(Commitlint.HookSilencer))).pipe(Command.withDescription("Verify the most recent commit (commitlint replay + signature + closes trailer)"));
|
|
119
119
|
|
|
120
120
|
//#endregion
|
|
121
|
-
export { postCommitVerifyCommand };
|
|
121
|
+
export { buildCommitlintInvocation, buildPostCommitAdvice, postCommitVerifyCommand };
|
package/commands/commit/index.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/commands/lint/biome-version.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pinned Biome version targeted by the lint schema-sync commands.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The Biome release whose JSON schema URL `savvy lint`/`savvy check` write into and
|
|
9
|
+
* validate against the repo's `biome.json`/`biome.jsonc` files.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Hardcoded on purpose. `@biomejs/biome` is an optional peer dependency of
|
|
13
|
+
* `@savvy-web/silk`, so there is no reliable runtime source for the consumer's
|
|
14
|
+
* installed Biome version, and the `$schema` URL must point at a concrete release.
|
|
15
|
+
*
|
|
16
|
+
* Keep this in lockstep with the `@biomejs/biome` peer-dependency range in
|
|
17
|
+
* `packages/silk/package.json` whenever Biome is upgraded — bump this to the exact
|
|
18
|
+
* release and the peer range to its minor line.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
const BIOME_VERSION = "2.5.1";
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { BIOME_VERSION };
|
package/commands/lint/check.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BIOME_VERSION } from "./biome-version.js";
|
|
1
2
|
import { CheckResult, ConfigDiscovery, Lint, ManagedSection, SavvyBaseSection, SavvyHooksSection, ToolDefinition, ToolDiscovery, savvyBasePreamble, savvyHooksHygiene } from "@savvy-web/silk-effects";
|
|
2
3
|
import { Effect } from "effect";
|
|
3
4
|
import { parse } from "jsonc-effect";
|
|
@@ -95,7 +96,7 @@ function checkMarkdownlintConfig(content) {
|
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
/**
|
|
98
|
-
* Check biome config `$schema` URLs against the
|
|
99
|
+
* Check biome config `$schema` URLs against the pinned {@link BIOME_VERSION}.
|
|
99
100
|
*
|
|
100
101
|
* @remarks
|
|
101
102
|
* Uses `Lint.Biome.findAllConfigs()` for workspace-aware discovery, then validates
|
|
@@ -105,15 +106,10 @@ function checkMarkdownlintConfig(content) {
|
|
|
105
106
|
*/
|
|
106
107
|
function checkBiomeSchemas() {
|
|
107
108
|
return Effect.gen(function* () {
|
|
108
|
-
const version = process.env.__BIOME_PEER_VERSION__;
|
|
109
109
|
const statuses = [];
|
|
110
|
-
if (!version) return {
|
|
111
|
-
statuses,
|
|
112
|
-
warnings: []
|
|
113
|
-
};
|
|
114
110
|
const fs = yield* FileSystem.FileSystem;
|
|
115
111
|
const warnings = [];
|
|
116
|
-
const expectedSchema = `https://biomejs.dev/schemas/${
|
|
112
|
+
const expectedSchema = `https://biomejs.dev/schemas/${BIOME_VERSION}/schema.json`;
|
|
117
113
|
const configPaths = Lint.Biome.findAllConfigs();
|
|
118
114
|
for (const configPath of configPaths) if ((yield* parse(yield* fs.readFileString(configPath))).$schema === expectedSchema) statuses.push({
|
|
119
115
|
path: configPath,
|
package/commands/lint/index.js
CHANGED
package/commands/lint/init.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BIOME_VERSION } from "./biome-version.js";
|
|
1
2
|
import { BiomeSchemaSync, Lint, ManagedSection, SavvyBaseSection, SavvyHooksSection, savvyBasePreamble, savvyHooksHygiene } from "@savvy-web/silk-effects";
|
|
2
3
|
import { Effect } from "effect";
|
|
3
4
|
import { dirname } from "node:path";
|
|
@@ -115,15 +116,13 @@ function writeMarkdownlintConfig(fs, preset, force) {
|
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
|
-
* Find and sync biome config `$schema` URLs to match the
|
|
119
|
+
* Find and sync biome config `$schema` URLs to match the pinned {@link BIOME_VERSION}.
|
|
119
120
|
*
|
|
120
121
|
* @returns Effect that syncs biome schemas and logs results
|
|
121
122
|
*/
|
|
122
123
|
function syncBiomeSchemas() {
|
|
123
124
|
return Effect.gen(function* () {
|
|
124
|
-
const
|
|
125
|
-
if (!version) return;
|
|
126
|
-
const result = yield* (yield* BiomeSchemaSync).sync(version);
|
|
125
|
+
const result = yield* (yield* BiomeSchemaSync).sync(BIOME_VERSION);
|
|
127
126
|
for (const configPath of result.current) yield* Effect.log(`${CHECK_MARK} ${configPath}: biome $schema up-to-date`);
|
|
128
127
|
for (const configPath of result.updated) yield* Effect.log(`${CHECK_MARK} Updated $schema in ${configPath}`);
|
|
129
128
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
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",
|