@savvy-web/silk-effects 0.6.1 → 1.0.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/README.md +48 -17
- package/_virtual/_rolldown/runtime.js +18 -0
- package/changesets/api/categories.js +247 -0
- package/changesets/api/changelog.js +134 -0
- package/changesets/api/dependency-table.js +163 -0
- package/changesets/api/linter.js +168 -0
- package/changesets/api/transformer.js +140 -0
- package/changesets/categories/index.js +299 -0
- package/changesets/categories/types.js +66 -0
- package/changesets/changelog/formatting.js +119 -0
- package/changesets/changelog/getDependencyReleaseLine.js +114 -0
- package/changesets/changelog/getReleaseLine.js +122 -0
- package/changesets/changelog/index.js +99 -0
- package/changesets/constants.js +43 -0
- package/changesets/errors.js +305 -0
- package/changesets/index.js +146 -0
- package/changesets/markdownlint/index.js +29 -0
- package/changesets/markdownlint/rules/content-structure.js +98 -0
- package/changesets/markdownlint/rules/dependency-table-format.js +170 -0
- package/changesets/markdownlint/rules/heading-hierarchy.js +61 -0
- package/changesets/markdownlint/rules/required-sections.js +54 -0
- package/changesets/markdownlint/rules/uncategorized-content.js +54 -0
- package/changesets/markdownlint/rules/utils.js +30 -0
- package/changesets/remark/plugins/aggregate-dependency-tables.js +47 -0
- package/changesets/remark/plugins/contributor-footnotes.js +123 -0
- package/changesets/remark/plugins/deduplicate-items.js +30 -0
- package/changesets/remark/plugins/issue-link-refs.js +58 -0
- package/changesets/remark/plugins/merge-sections.js +43 -0
- package/changesets/remark/plugins/normalize-format.js +47 -0
- package/changesets/remark/plugins/reorder-sections.js +34 -0
- package/changesets/remark/presets.js +119 -0
- package/changesets/remark/rules/content-structure.js +22 -0
- package/changesets/remark/rules/dependency-table-format.js +40 -0
- package/changesets/remark/rules/heading-hierarchy.js +19 -0
- package/changesets/remark/rules/required-sections.js +17 -0
- package/changesets/remark/rules/uncategorized-content.js +31 -0
- package/changesets/schemas/changeset.js +146 -0
- package/changesets/schemas/dependency-table.js +189 -0
- package/changesets/schemas/git.js +69 -0
- package/changesets/schemas/github.js +175 -0
- package/changesets/schemas/options.js +182 -0
- package/changesets/schemas/package-scope.js +128 -0
- package/changesets/schemas/primitives.js +72 -0
- package/changesets/schemas/version-files.js +151 -0
- package/changesets/services/branch-analyzer.js +278 -0
- package/changesets/services/changelog.js +50 -0
- package/changesets/services/config-inspector.js +390 -0
- package/changesets/services/github.js +178 -0
- package/changesets/services/markdown.js +106 -0
- package/changesets/services/workspace-snapshot.js +182 -0
- package/changesets/utils/commit-parser.js +80 -0
- package/changesets/utils/dep-diff.js +77 -0
- package/changesets/utils/dependency-table.js +347 -0
- package/changesets/utils/issue-refs.js +101 -0
- package/changesets/utils/jsonpath.js +175 -0
- package/changesets/utils/logger.js +50 -0
- package/changesets/utils/markdown-link.js +57 -0
- package/changesets/utils/publishability.js +39 -0
- package/changesets/utils/remark-pipeline.js +79 -0
- package/changesets/utils/section-parser.js +94 -0
- package/changesets/utils/strip-frontmatter.js +46 -0
- package/changesets/utils/version-blocks.js +108 -0
- package/changesets/utils/version-files.js +336 -0
- package/changesets/utils/worktree-snapshot.js +142 -0
- package/changesets/vendor/github-info.js +55 -0
- package/commitlint/config/factory.js +69 -0
- package/commitlint/config/plugins.js +227 -0
- package/commitlint/config/rules.js +155 -0
- package/commitlint/config/schema.js +46 -0
- package/commitlint/detection/dco.js +53 -0
- package/commitlint/detection/scopes.js +45 -0
- package/commitlint/formatter/format.js +85 -0
- package/commitlint/formatter/messages.js +79 -0
- package/commitlint/hook/diagnostics/branch.js +36 -0
- package/commitlint/hook/diagnostics/cache.js +37 -0
- package/commitlint/hook/diagnostics/commitlint-config.js +36 -0
- package/commitlint/hook/diagnostics/open-issues.js +56 -0
- package/commitlint/hook/diagnostics/package-manager.js +51 -0
- package/commitlint/hook/diagnostics/signing.js +107 -0
- package/commitlint/hook/envelope.js +46 -0
- package/commitlint/hook/output.js +45 -0
- package/commitlint/hook/parse-bash-command.js +105 -0
- package/commitlint/hook/rules/closes-trailer.js +31 -0
- package/commitlint/hook/rules/forbidden-content.js +32 -0
- package/commitlint/hook/rules/plan-leakage.js +36 -0
- package/commitlint/hook/rules/signing-flag-conflict.js +25 -0
- package/commitlint/hook/rules/soft-wrap.js +37 -0
- package/commitlint/hook/rules/types.js +14 -0
- package/commitlint/hook/rules/verbosity.js +31 -0
- package/commitlint/hook/silence-logger.js +39 -0
- package/commitlint/index.js +146 -0
- package/commitlint/prompt/config.js +91 -0
- package/commitlint/prompt/emojis.js +74 -0
- package/commitlint/prompt/prompter.js +135 -0
- package/commitlint/static.js +73 -0
- package/errors/BiomeSyncError.js +21 -0
- package/errors/ChangesetConfigError.js +20 -0
- package/errors/ConfigNotFoundError.js +21 -0
- package/errors/SectionParseError.js +16 -0
- package/errors/SectionValidationError.js +16 -0
- package/errors/SectionWriteError.js +16 -0
- package/errors/TagFormatError.js +20 -0
- package/errors/ToolNotFoundError.js +11 -0
- package/errors/ToolResolutionError.js +11 -0
- package/errors/ToolVersionMismatchError.js +11 -0
- package/errors/VersioningDetectionError.js +20 -0
- package/errors/WorkspaceAnalysisError.js +21 -0
- package/index.d.ts +9743 -8380
- package/index.js +36 -6657
- package/lint/Handler.js +39 -0
- package/lint/cli/sections.js +65 -0
- package/lint/cli/templates/markdownlint.gen.js +183 -0
- package/lint/config/Preset.js +152 -0
- package/lint/config/createConfig.js +89 -0
- package/lint/handlers/Biome.js +179 -0
- package/lint/handlers/Markdown.js +139 -0
- package/lint/handlers/PackageJson.js +130 -0
- package/lint/handlers/PnpmWorkspace.js +141 -0
- package/lint/handlers/ShellScripts.js +58 -0
- package/lint/handlers/TypeScript.js +134 -0
- package/lint/handlers/Yaml.js +167 -0
- package/lint/index.js +52 -0
- package/lint/utils/Command.js +285 -0
- package/lint/utils/Filter.js +100 -0
- package/lint/utils/Workspace.js +86 -0
- package/package.json +52 -63
- package/schemas/CommentStyle.js +16 -0
- package/schemas/ResolvedTool.js +63 -0
- package/schemas/SavvySections.js +113 -0
- package/schemas/SectionBlock.js +70 -0
- package/schemas/SectionDefinition.js +121 -0
- package/schemas/SectionResults.js +12 -0
- package/schemas/TagStrategySchemas.js +18 -0
- package/schemas/ToolDefinition.js +39 -0
- package/schemas/ToolResults.js +14 -0
- package/schemas/VersioningSchemas.js +95 -0
- package/schemas/WorkspaceAnalysisSchemas.js +190 -0
- package/services/BiomeSchemaSync.js +133 -0
- package/services/ChangesetConfig.js +78 -0
- package/services/ChangesetConfigReader.js +106 -0
- package/services/ConfigDiscovery.js +71 -0
- package/services/ManagedSection.js +288 -0
- package/services/SilkPublishability.js +193 -0
- package/services/SilkWorkspaceAnalyzer.js +213 -0
- package/services/TagStrategy.js +54 -0
- package/services/ToolDiscovery.js +229 -0
- package/services/VersioningStrategy.js +67 -0
- package/tsdoc-metadata.json +11 -11
- package/turbo/digest.js +127 -0
- package/turbo/errors.js +48 -0
- package/turbo/index.js +32 -0
- package/turbo/schemas/DryRun.js +57 -0
- package/turbo/schemas/results.js +61 -0
- package/turbo/services/TurboInspector.js +100 -0
- package/utils/ToolCommand.js +40 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { COMMIT_TYPES, COMMIT_TYPE_DEFINITIONS, DCO_SIGNOFF_TEXT, TDD_SCOPE_PATTERN, TDD_STATES } from "./config/rules.js";
|
|
2
|
+
import { silkPlugin } from "./config/plugins.js";
|
|
3
|
+
|
|
4
|
+
//#region src/commitlint/static.ts
|
|
5
|
+
/**
|
|
6
|
+
* Static commitlint configuration (no auto-detection).
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Use this export when you don't need auto-detection features
|
|
10
|
+
* and want a simple, static configuration. This is useful for:
|
|
11
|
+
* - Projects that don't use workspaces
|
|
12
|
+
* - CI environments where detection overhead is unwanted
|
|
13
|
+
* - Cases where you want deterministic, unchanging configuration
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // commitlint.config.ts
|
|
18
|
+
* export { default } from "@savvy-web/commitlint/static";
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // With overrides
|
|
24
|
+
* import config from "@savvy-web/commitlint/static";
|
|
25
|
+
*
|
|
26
|
+
* export default {
|
|
27
|
+
* ...config,
|
|
28
|
+
* rules: {
|
|
29
|
+
* ...config.rules,
|
|
30
|
+
* "scope-enum": [2, "always", ["api", "cli", "core"]],
|
|
31
|
+
* },
|
|
32
|
+
* };
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Static commitlint configuration.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* This configuration includes:
|
|
40
|
+
* - Extended type enum with `ai` and `release` types
|
|
41
|
+
* - Body max line length of 300 characters
|
|
42
|
+
* - DCO signoff requirement
|
|
43
|
+
* - Multiple scope support enabled
|
|
44
|
+
* - Subject case rule disabled (allows AI-capitalized subjects)
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
const staticConfig = {
|
|
49
|
+
extends: ["@commitlint/config-conventional"],
|
|
50
|
+
plugins: [silkPlugin],
|
|
51
|
+
rules: {
|
|
52
|
+
"body-max-line-length": [
|
|
53
|
+
2,
|
|
54
|
+
"always",
|
|
55
|
+
300
|
|
56
|
+
],
|
|
57
|
+
"type-enum": [
|
|
58
|
+
2,
|
|
59
|
+
"always",
|
|
60
|
+
[...COMMIT_TYPES]
|
|
61
|
+
],
|
|
62
|
+
"silk/signed-off-by": [2, "always"],
|
|
63
|
+
"silk/tdd-scope": [2, "always"],
|
|
64
|
+
"subject-case": [0]
|
|
65
|
+
},
|
|
66
|
+
prompt: { settings: {
|
|
67
|
+
enableMultipleScopes: true,
|
|
68
|
+
scopeEnumSeparator: ","
|
|
69
|
+
} }
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { staticConfig as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/BiomeSyncError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when a Biome config file cannot be read or its `$schema` URL cannot be updated.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Returned by {@link BiomeSchemaSync.sync} and {@link BiomeSchemaSync.check} when
|
|
9
|
+
* a `biome.json` or `biome.jsonc` file exists but cannot be read, contains invalid JSON,
|
|
10
|
+
* or cannot be written back to disk.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
*/
|
|
14
|
+
var BiomeSyncError = class extends Data.TaggedError("BiomeSyncError") {
|
|
15
|
+
get message() {
|
|
16
|
+
return `Failed to sync biome schema in ${this.path}: ${this.reason}`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { BiomeSyncError };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/ChangesetConfigError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when the `.changeset/config.json` file cannot be read or decoded.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Returned by {@link ChangesetConfigReader.read} when the file is missing,
|
|
9
|
+
* contains invalid JSON, or fails Effect Schema validation.
|
|
10
|
+
*
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
*/
|
|
13
|
+
var ChangesetConfigError = class extends Data.TaggedError("ChangesetConfigError") {
|
|
14
|
+
get message() {
|
|
15
|
+
return `Failed to read changeset config at ${this.path}: ${this.reason}`;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ChangesetConfigError };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/ConfigNotFoundError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when a config file cannot be located in any of the expected locations.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Returned by consumers that require a config file to exist. {@link ConfigDiscovery.find}
|
|
9
|
+
* itself returns `null` instead of failing — callers that need a hard failure should
|
|
10
|
+
* map `null` to this error.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
*/
|
|
14
|
+
var ConfigNotFoundError = class extends Data.TaggedError("ConfigNotFoundError") {
|
|
15
|
+
get message() {
|
|
16
|
+
return `Config '${this.name}' not found. Searched: ${this.searchedPaths.join(", ")}`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ConfigNotFoundError };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/SectionParseError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when a managed section cannot be parsed from a file.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.2.0
|
|
8
|
+
*/
|
|
9
|
+
var SectionParseError = class extends Data.TaggedError("SectionParseError") {
|
|
10
|
+
get message() {
|
|
11
|
+
return `Failed to parse section in ${this.path}: ${this.reason}`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { SectionParseError };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/SectionValidationError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when a {@link SectionBlock} fails validation at creation time.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.2.0
|
|
8
|
+
*/
|
|
9
|
+
var SectionValidationError = class extends Data.TaggedError("SectionValidationError") {
|
|
10
|
+
get message() {
|
|
11
|
+
return `Section validation failed for ${this.toolName}: ${this.reason}`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { SectionValidationError };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/SectionWriteError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when a managed section cannot be written to a file.
|
|
6
|
+
*
|
|
7
|
+
* @since 0.2.0
|
|
8
|
+
*/
|
|
9
|
+
var SectionWriteError = class extends Data.TaggedError("SectionWriteError") {
|
|
10
|
+
get message() {
|
|
11
|
+
return `Failed to write section to ${this.path}: ${this.reason}`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { SectionWriteError };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/TagFormatError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when a git tag string cannot be formatted for the given package name and version.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Returned by {@link TagStrategy.formatTag} when the `version` argument is an empty string
|
|
9
|
+
* or another invariant prevents tag construction.
|
|
10
|
+
*
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
*/
|
|
13
|
+
var TagFormatError = class extends Data.TaggedError("TagFormatError") {
|
|
14
|
+
get message() {
|
|
15
|
+
return `Failed to format tag for ${this.name}@${this.version}: ${this.reason}`;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { TagFormatError };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/ToolNotFoundError.ts
|
|
4
|
+
var ToolNotFoundError = class extends Data.TaggedError("ToolNotFoundError") {
|
|
5
|
+
get message() {
|
|
6
|
+
return `Tool not found: ${this.name} — ${this.reason}`;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ToolNotFoundError };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/ToolResolutionError.ts
|
|
4
|
+
var ToolResolutionError = class extends Data.TaggedError("ToolResolutionError") {
|
|
5
|
+
get message() {
|
|
6
|
+
return `Tool resolution failed: ${this.name} — ${this.reason}`;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ToolResolutionError };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/ToolVersionMismatchError.ts
|
|
4
|
+
var ToolVersionMismatchError = class extends Data.TaggedError("ToolVersionMismatchError") {
|
|
5
|
+
get message() {
|
|
6
|
+
return `Tool version mismatch: ${this.name} — global ${this.globalVersion} vs local ${this.localVersion}`;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ToolVersionMismatchError };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/VersioningDetectionError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when the versioning strategy cannot be determined from the workspace state.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Returned by {@link VersioningStrategy.detect} when an unexpected condition
|
|
9
|
+
* prevents strategy classification.
|
|
10
|
+
*
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
*/
|
|
13
|
+
var VersioningDetectionError = class extends Data.TaggedError("VersioningDetectionError") {
|
|
14
|
+
get message() {
|
|
15
|
+
return `Failed to detect versioning strategy: ${this.reason}`;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { VersioningDetectionError };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Data } from "effect";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/WorkspaceAnalysisError.ts
|
|
4
|
+
/**
|
|
5
|
+
* Raised when workspace analysis fails for a given root directory.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Returned by {@link SilkWorkspaceAnalyzer.analyze} when the analysis pipeline
|
|
9
|
+
* encounters an unrecoverable error — e.g. workspace discovery failure,
|
|
10
|
+
* package manager detection failure, or publishability detection errors.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.2.0
|
|
13
|
+
*/
|
|
14
|
+
var WorkspaceAnalysisError = class extends Data.TaggedError("WorkspaceAnalysisError") {
|
|
15
|
+
get message() {
|
|
16
|
+
return `Workspace analysis failed at ${this.root}: ${this.reason}`;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { WorkspaceAnalysisError };
|