@savvy-web/silk-effects 0.6.0 → 1.0.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.
Files changed (155) hide show
  1. package/README.md +48 -17
  2. package/_virtual/_rolldown/runtime.js +18 -0
  3. package/changesets/api/categories.js +247 -0
  4. package/changesets/api/changelog.js +134 -0
  5. package/changesets/api/dependency-table.js +163 -0
  6. package/changesets/api/linter.js +168 -0
  7. package/changesets/api/transformer.js +140 -0
  8. package/changesets/categories/index.js +299 -0
  9. package/changesets/categories/types.js +66 -0
  10. package/changesets/changelog/formatting.js +119 -0
  11. package/changesets/changelog/getDependencyReleaseLine.js +114 -0
  12. package/changesets/changelog/getReleaseLine.js +122 -0
  13. package/changesets/changelog/index.js +99 -0
  14. package/changesets/constants.js +43 -0
  15. package/changesets/errors.js +305 -0
  16. package/changesets/index.js +146 -0
  17. package/changesets/markdownlint/index.js +29 -0
  18. package/changesets/markdownlint/rules/content-structure.js +98 -0
  19. package/changesets/markdownlint/rules/dependency-table-format.js +170 -0
  20. package/changesets/markdownlint/rules/heading-hierarchy.js +61 -0
  21. package/changesets/markdownlint/rules/required-sections.js +54 -0
  22. package/changesets/markdownlint/rules/uncategorized-content.js +54 -0
  23. package/changesets/markdownlint/rules/utils.js +30 -0
  24. package/changesets/remark/plugins/aggregate-dependency-tables.js +47 -0
  25. package/changesets/remark/plugins/contributor-footnotes.js +123 -0
  26. package/changesets/remark/plugins/deduplicate-items.js +30 -0
  27. package/changesets/remark/plugins/issue-link-refs.js +58 -0
  28. package/changesets/remark/plugins/merge-sections.js +43 -0
  29. package/changesets/remark/plugins/normalize-format.js +47 -0
  30. package/changesets/remark/plugins/reorder-sections.js +34 -0
  31. package/changesets/remark/presets.js +119 -0
  32. package/changesets/remark/rules/content-structure.js +22 -0
  33. package/changesets/remark/rules/dependency-table-format.js +40 -0
  34. package/changesets/remark/rules/heading-hierarchy.js +19 -0
  35. package/changesets/remark/rules/required-sections.js +17 -0
  36. package/changesets/remark/rules/uncategorized-content.js +31 -0
  37. package/changesets/schemas/changeset.js +146 -0
  38. package/changesets/schemas/dependency-table.js +189 -0
  39. package/changesets/schemas/git.js +69 -0
  40. package/changesets/schemas/github.js +175 -0
  41. package/changesets/schemas/options.js +182 -0
  42. package/changesets/schemas/package-scope.js +128 -0
  43. package/changesets/schemas/primitives.js +72 -0
  44. package/changesets/schemas/version-files.js +151 -0
  45. package/changesets/services/branch-analyzer.js +278 -0
  46. package/changesets/services/changelog.js +50 -0
  47. package/changesets/services/config-inspector.js +390 -0
  48. package/changesets/services/github.js +178 -0
  49. package/changesets/services/markdown.js +106 -0
  50. package/changesets/services/workspace-snapshot.js +182 -0
  51. package/changesets/utils/commit-parser.js +80 -0
  52. package/changesets/utils/dep-diff.js +77 -0
  53. package/changesets/utils/dependency-table.js +347 -0
  54. package/changesets/utils/issue-refs.js +101 -0
  55. package/changesets/utils/jsonpath.js +175 -0
  56. package/changesets/utils/logger.js +50 -0
  57. package/changesets/utils/markdown-link.js +57 -0
  58. package/changesets/utils/publishability.js +39 -0
  59. package/changesets/utils/remark-pipeline.js +79 -0
  60. package/changesets/utils/section-parser.js +94 -0
  61. package/changesets/utils/strip-frontmatter.js +46 -0
  62. package/changesets/utils/version-blocks.js +108 -0
  63. package/changesets/utils/version-files.js +336 -0
  64. package/changesets/utils/worktree-snapshot.js +142 -0
  65. package/changesets/vendor/github-info.js +55 -0
  66. package/commitlint/config/factory.js +69 -0
  67. package/commitlint/config/plugins.js +227 -0
  68. package/commitlint/config/rules.js +155 -0
  69. package/commitlint/config/schema.js +46 -0
  70. package/commitlint/detection/dco.js +53 -0
  71. package/commitlint/detection/scopes.js +45 -0
  72. package/commitlint/formatter/format.js +85 -0
  73. package/commitlint/formatter/messages.js +79 -0
  74. package/commitlint/hook/diagnostics/branch.js +36 -0
  75. package/commitlint/hook/diagnostics/cache.js +37 -0
  76. package/commitlint/hook/diagnostics/commitlint-config.js +36 -0
  77. package/commitlint/hook/diagnostics/open-issues.js +56 -0
  78. package/commitlint/hook/diagnostics/package-manager.js +51 -0
  79. package/commitlint/hook/diagnostics/signing.js +107 -0
  80. package/commitlint/hook/envelope.js +46 -0
  81. package/commitlint/hook/output.js +45 -0
  82. package/commitlint/hook/parse-bash-command.js +105 -0
  83. package/commitlint/hook/rules/closes-trailer.js +31 -0
  84. package/commitlint/hook/rules/forbidden-content.js +32 -0
  85. package/commitlint/hook/rules/plan-leakage.js +36 -0
  86. package/commitlint/hook/rules/signing-flag-conflict.js +25 -0
  87. package/commitlint/hook/rules/soft-wrap.js +37 -0
  88. package/commitlint/hook/rules/types.js +14 -0
  89. package/commitlint/hook/rules/verbosity.js +31 -0
  90. package/commitlint/hook/silence-logger.js +39 -0
  91. package/commitlint/index.js +146 -0
  92. package/commitlint/prompt/config.js +91 -0
  93. package/commitlint/prompt/emojis.js +74 -0
  94. package/commitlint/prompt/prompter.js +135 -0
  95. package/commitlint/static.js +73 -0
  96. package/errors/BiomeSyncError.js +21 -0
  97. package/errors/ChangesetConfigError.js +20 -0
  98. package/errors/ConfigNotFoundError.js +21 -0
  99. package/errors/SectionParseError.js +16 -0
  100. package/errors/SectionValidationError.js +16 -0
  101. package/errors/SectionWriteError.js +16 -0
  102. package/errors/TagFormatError.js +20 -0
  103. package/errors/ToolNotFoundError.js +11 -0
  104. package/errors/ToolResolutionError.js +11 -0
  105. package/errors/ToolVersionMismatchError.js +11 -0
  106. package/errors/VersioningDetectionError.js +20 -0
  107. package/errors/WorkspaceAnalysisError.js +21 -0
  108. package/index.d.ts +9743 -8380
  109. package/index.js +36 -6657
  110. package/lint/Handler.js +39 -0
  111. package/lint/cli/sections.js +65 -0
  112. package/lint/cli/templates/markdownlint.gen.js +183 -0
  113. package/lint/config/Preset.js +152 -0
  114. package/lint/config/createConfig.js +89 -0
  115. package/lint/handlers/Biome.js +179 -0
  116. package/lint/handlers/Markdown.js +139 -0
  117. package/lint/handlers/PackageJson.js +130 -0
  118. package/lint/handlers/PnpmWorkspace.js +141 -0
  119. package/lint/handlers/ShellScripts.js +58 -0
  120. package/lint/handlers/TypeScript.js +134 -0
  121. package/lint/handlers/Yaml.js +167 -0
  122. package/lint/index.js +52 -0
  123. package/lint/utils/Command.js +285 -0
  124. package/lint/utils/Filter.js +100 -0
  125. package/lint/utils/Workspace.js +86 -0
  126. package/package.json +52 -63
  127. package/schemas/CommentStyle.js +16 -0
  128. package/schemas/ResolvedTool.js +63 -0
  129. package/schemas/SavvySections.js +113 -0
  130. package/schemas/SectionBlock.js +70 -0
  131. package/schemas/SectionDefinition.js +121 -0
  132. package/schemas/SectionResults.js +12 -0
  133. package/schemas/TagStrategySchemas.js +18 -0
  134. package/schemas/ToolDefinition.js +39 -0
  135. package/schemas/ToolResults.js +14 -0
  136. package/schemas/VersioningSchemas.js +95 -0
  137. package/schemas/WorkspaceAnalysisSchemas.js +190 -0
  138. package/services/BiomeSchemaSync.js +133 -0
  139. package/services/ChangesetConfig.js +78 -0
  140. package/services/ChangesetConfigReader.js +106 -0
  141. package/services/ConfigDiscovery.js +71 -0
  142. package/services/ManagedSection.js +288 -0
  143. package/services/SilkPublishability.js +193 -0
  144. package/services/SilkWorkspaceAnalyzer.js +213 -0
  145. package/services/TagStrategy.js +54 -0
  146. package/services/ToolDiscovery.js +229 -0
  147. package/services/VersioningStrategy.js +67 -0
  148. package/tsdoc-metadata.json +11 -11
  149. package/turbo/digest.js +127 -0
  150. package/turbo/errors.js +48 -0
  151. package/turbo/index.js +32 -0
  152. package/turbo/schemas/DryRun.js +57 -0
  153. package/turbo/schemas/results.js +61 -0
  154. package/turbo/services/TurboInspector.js +100 -0
  155. 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 };