@standards-kit/conform 0.1.0 → 0.1.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.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +143 -0
  3. package/dist/{chunk-P7TIZJ4C.js → chunk-DXIYZR62.js} +2 -2
  4. package/dist/chunk-DXIYZR62.js.map +1 -0
  5. package/dist/{chunk-KHO6NIAI.js → chunk-PZ2NVKI7.js} +7 -7
  6. package/dist/chunk-PZ2NVKI7.js.map +1 -0
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +14 -14
  9. package/dist/cli.js.map +1 -1
  10. package/dist/code/index.d.ts +11 -0
  11. package/dist/code/tools/base.d.ts +51 -0
  12. package/dist/code/tools/comment-utils.d.ts +17 -0
  13. package/dist/code/tools/coverage-run.d.ts +37 -0
  14. package/dist/code/tools/disable-comments.d.ts +42 -0
  15. package/dist/code/tools/eslint.d.ts +99 -0
  16. package/dist/code/tools/gitleaks.d.ts +42 -0
  17. package/dist/code/tools/index.d.ts +13 -0
  18. package/dist/code/tools/knip.d.ts +20 -0
  19. package/dist/code/tools/naming.d.ts +64 -0
  20. package/dist/code/tools/pipaudit.d.ts +24 -0
  21. package/dist/code/tools/pnpmaudit.d.ts +36 -0
  22. package/dist/code/tools/ruff.d.ts +46 -0
  23. package/dist/code/tools/tsc.d.ts +57 -0
  24. package/dist/code/tools/ty.d.ts +34 -0
  25. package/dist/code/tools/vulture.d.ts +32 -0
  26. package/dist/core/index.d.ts +7 -0
  27. package/dist/core/loader.d.ts +42 -0
  28. package/dist/core/registry.d.ts +17 -0
  29. package/dist/core/schema.d.ts +1829 -0
  30. package/dist/core/types.d.ts +95 -0
  31. package/dist/{src-KZRTG3EU.js → core-KB2W6SE2.js} +3 -3
  32. package/dist/dependencies/index.d.ts +13 -0
  33. package/dist/dependencies/mappings.d.ts +17 -0
  34. package/dist/dependencies/output.d.ts +12 -0
  35. package/dist/dependencies/types.d.ts +34 -0
  36. package/dist/index.d.ts +21 -0
  37. package/dist/index.js +9 -5
  38. package/dist/index.js.map +1 -1
  39. package/dist/infra/arn.d.ts +16 -0
  40. package/dist/infra/checkers/cloudwatch.d.ts +8 -0
  41. package/dist/infra/checkers/dynamodb.d.ts +8 -0
  42. package/dist/infra/checkers/ec2.d.ts +13 -0
  43. package/dist/infra/checkers/ecs.d.ts +13 -0
  44. package/dist/infra/checkers/elasticache.d.ts +13 -0
  45. package/dist/infra/checkers/elb.d.ts +13 -0
  46. package/dist/infra/checkers/gcp/artifactregistry.d.ts +5 -0
  47. package/dist/infra/checkers/gcp/cloudrun.d.ts +5 -0
  48. package/dist/infra/checkers/gcp/iam.d.ts +5 -0
  49. package/dist/infra/checkers/gcp/index.d.ts +17 -0
  50. package/dist/infra/checkers/gcp/secretmanager.d.ts +5 -0
  51. package/dist/infra/checkers/iam.d.ts +8 -0
  52. package/dist/infra/checkers/index.d.ts +26 -0
  53. package/dist/infra/checkers/lambda.d.ts +8 -0
  54. package/dist/infra/checkers/rds.d.ts +13 -0
  55. package/dist/infra/checkers/s3.d.ts +8 -0
  56. package/dist/infra/checkers/secretsmanager.d.ts +8 -0
  57. package/dist/infra/checkers/sns.d.ts +8 -0
  58. package/dist/infra/checkers/sqs.d.ts +8 -0
  59. package/dist/infra/checkers/types.d.ts +28 -0
  60. package/dist/infra/gcp.d.ts +18 -0
  61. package/dist/infra/generate.d.ts +74 -0
  62. package/dist/infra/index.d.ts +59 -0
  63. package/dist/infra/manifest.d.ts +58 -0
  64. package/dist/infra/output.d.ts +8 -0
  65. package/dist/infra/scan.d.ts +25 -0
  66. package/dist/infra/schemas.d.ts +806 -0
  67. package/dist/infra/types.d.ts +8 -0
  68. package/dist/{infra-UXM5XQX3.js → infra-ZQRXX7AW.js} +3 -3
  69. package/dist/infra-ZQRXX7AW.js.map +1 -0
  70. package/dist/mcp/index.d.ts +7 -0
  71. package/dist/mcp/server.d.ts +18 -0
  72. package/dist/mcp/standards/fetcher.d.ts +29 -0
  73. package/dist/mcp/standards/index.d.ts +4 -0
  74. package/dist/mcp/standards/matcher.d.ts +22 -0
  75. package/dist/mcp/standards/parser.d.ts +46 -0
  76. package/dist/mcp/standards/types.d.ts +32 -0
  77. package/dist/mcp/tools/get-guideline.d.ts +26 -0
  78. package/dist/mcp/tools/get-ruleset.d.ts +26 -0
  79. package/dist/mcp/tools/get-standards.d.ts +27 -0
  80. package/dist/mcp/tools/index.d.ts +4 -0
  81. package/dist/mcp/tools/list-guidelines.d.ts +25 -0
  82. package/dist/{mcp-O5O7XVFG.js → mcp-WXYRFNEV.js} +3 -3
  83. package/dist/mcp-WXYRFNEV.js.map +1 -0
  84. package/dist/output/index.d.ts +14 -0
  85. package/dist/process/commands/check-branch.d.ts +13 -0
  86. package/dist/process/commands/check-commit.d.ts +14 -0
  87. package/dist/process/commands/index.d.ts +2 -0
  88. package/dist/process/index.d.ts +11 -0
  89. package/dist/process/scan/index.d.ts +5 -0
  90. package/dist/process/scan/remote-fetcher.d.ts +18 -0
  91. package/dist/process/scan/scanner.d.ts +6 -0
  92. package/dist/process/scan/types.d.ts +57 -0
  93. package/dist/process/scan/validators.d.ts +37 -0
  94. package/dist/process/sync/applier.d.ts +10 -0
  95. package/dist/process/sync/differ.d.ts +7 -0
  96. package/dist/process/sync/fetcher.d.ts +14 -0
  97. package/dist/process/sync/index.d.ts +9 -0
  98. package/dist/process/sync/types.d.ts +131 -0
  99. package/dist/process/sync/validator.d.ts +22 -0
  100. package/dist/process/tools/backups.d.ts +32 -0
  101. package/dist/process/tools/base.d.ts +52 -0
  102. package/dist/process/tools/branches.d.ts +41 -0
  103. package/dist/process/tools/changesets.d.ts +53 -0
  104. package/dist/process/tools/ci.d.ts +57 -0
  105. package/dist/process/tools/codeowners.d.ts +68 -0
  106. package/dist/process/tools/commits.d.ts +39 -0
  107. package/dist/process/tools/coverage.d.ts +57 -0
  108. package/dist/process/tools/docs-helpers.d.ts +44 -0
  109. package/dist/process/tools/docs.d.ts +38 -0
  110. package/dist/process/tools/forbidden-files.d.ts +40 -0
  111. package/dist/process/tools/hooks.d.ts +39 -0
  112. package/dist/process/tools/index.d.ts +14 -0
  113. package/dist/process/tools/pr.d.ts +59 -0
  114. package/dist/process/tools/repo.d.ts +65 -0
  115. package/dist/process/tools/tickets.d.ts +42 -0
  116. package/dist/projects/detector.d.ts +16 -0
  117. package/dist/projects/index.d.ts +4 -0
  118. package/dist/projects/templates.d.ts +15 -0
  119. package/dist/projects/tier-loader.d.ts +14 -0
  120. package/dist/projects/types.d.ts +76 -0
  121. package/dist/{registry-V65CC7IN.js → registry-7CDIMOLZ.js} +2 -2
  122. package/dist/{scan-EELS42BP.js → scan-IKEHLZXV.js} +4 -4
  123. package/dist/{scan-EELS42BP.js.map → scan-IKEHLZXV.js.map} +1 -1
  124. package/dist/{sync-RLYBGYNY.js → sync-XV6XBLVZ.js} +3 -3
  125. package/dist/{sync-RLYBGYNY.js.map → sync-XV6XBLVZ.js.map} +1 -1
  126. package/dist/validate/guidelines.d.ts +18 -0
  127. package/dist/validate/index.d.ts +5 -0
  128. package/dist/validate/tier.d.ts +14 -0
  129. package/dist/validate/types.d.ts +56 -0
  130. package/dist/{validate-AABLVQJS.js → validate-DKEJICCK.js} +3 -3
  131. package/dist/validate-DKEJICCK.js.map +1 -0
  132. package/package.json +26 -19
  133. package/dist/chunk-KHO6NIAI.js.map +0 -1
  134. package/dist/chunk-P7TIZJ4C.js.map +0 -1
  135. package/dist/infra-UXM5XQX3.js.map +0 -1
  136. package/dist/mcp-O5O7XVFG.js.map +0 -1
  137. package/dist/validate-AABLVQJS.js.map +0 -1
  138. /package/dist/{registry-V65CC7IN.js.map → core-KB2W6SE2.js.map} +0 -0
  139. /package/dist/{src-KZRTG3EU.js.map → registry-7CDIMOLZ.js.map} +0 -0
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Shared types for standards-kit
3
+ */
4
+ /** Severity levels for violations */
5
+ export type Severity = "error" | "warning";
6
+ /** Status for domain results */
7
+ export type DomainStatus = "pass" | "fail" | "skip";
8
+ /** A single violation found by a check */
9
+ export interface Violation {
10
+ rule: string;
11
+ tool: string;
12
+ file?: string;
13
+ line?: number;
14
+ column?: number;
15
+ message: string;
16
+ code?: string;
17
+ severity: Severity;
18
+ }
19
+ /** Result of running a single check */
20
+ export interface CheckResult {
21
+ name: string;
22
+ rule: string;
23
+ passed: boolean;
24
+ violations: Violation[];
25
+ skipped: boolean;
26
+ skipReason?: string;
27
+ duration?: number;
28
+ }
29
+ /** Result of running all checks in a domain */
30
+ export interface DomainResult {
31
+ domain: string;
32
+ status: DomainStatus;
33
+ checks: CheckResult[];
34
+ violationCount: number;
35
+ }
36
+ /** Full result of conform check or conform audit */
37
+ export interface FullResult {
38
+ version: string;
39
+ configPath: string;
40
+ domains: Record<string, DomainResult>;
41
+ summary: {
42
+ totalViolations: number;
43
+ exitCode: number;
44
+ };
45
+ }
46
+ /** Interface for tool runners (ESLint, Ruff, tsc, etc.) */
47
+ export interface IToolRunner {
48
+ /** Display name of the tool */
49
+ readonly name: string;
50
+ /** Rule category (e.g., "code.linting") */
51
+ readonly rule: string;
52
+ /** Tool identifier for violations */
53
+ readonly toolId: string;
54
+ /** Config file patterns to look for */
55
+ readonly configFiles: string[];
56
+ /** Run the tool and return check results */
57
+ run(projectRoot: string): Promise<CheckResult>;
58
+ /** Audit that config exists without running the tool */
59
+ audit(projectRoot: string): Promise<CheckResult>;
60
+ }
61
+ /** Options for creating a violation */
62
+ export interface ViolationOptions {
63
+ rule: string;
64
+ tool: string;
65
+ message: string;
66
+ severity: Severity;
67
+ file?: string;
68
+ line?: number;
69
+ column?: number;
70
+ code?: string;
71
+ }
72
+ /** Builder for creating Violation objects */
73
+ export declare const ViolationBuilder: {
74
+ create(options: ViolationOptions): Violation;
75
+ error(rule: string, tool: string, message: string, code?: string): Violation;
76
+ warning(rule: string, tool: string, message: string, code?: string): Violation;
77
+ };
78
+ /** Builder for creating CheckResult objects */
79
+ export declare const CheckResultBuilder: {
80
+ pass(name: string, rule: string, duration?: number): CheckResult;
81
+ fail(name: string, rule: string, violations: Violation[], duration?: number): CheckResult;
82
+ skip(name: string, rule: string, reason: string, duration?: number): CheckResult;
83
+ fromViolations(name: string, rule: string, violations: Violation[], duration?: number): CheckResult;
84
+ };
85
+ /** Builder for creating DomainResult objects */
86
+ export declare const DomainResultBuilder: {
87
+ fromChecks(domain: string, checks: CheckResult[]): DomainResult;
88
+ };
89
+ export declare const ExitCode: {
90
+ readonly SUCCESS: 0;
91
+ readonly VIOLATIONS_FOUND: 1;
92
+ readonly CONFIG_ERROR: 2;
93
+ readonly RUNTIME_ERROR: 3;
94
+ };
95
+ export type ExitCodeType = (typeof ExitCode)[keyof typeof ExitCode];
@@ -3,7 +3,7 @@ import {
3
3
  DomainResultBuilder,
4
4
  ExitCode,
5
5
  ViolationBuilder
6
- } from "./chunk-P7TIZJ4C.js";
6
+ } from "./chunk-DXIYZR62.js";
7
7
  import {
8
8
  CONFIG_FILE_NAME,
9
9
  ConfigError,
@@ -20,7 +20,7 @@ import {
20
20
  mergeConfigs,
21
21
  parseRegistryUrl,
22
22
  resolveExtends
23
- } from "./chunk-KHO6NIAI.js";
23
+ } from "./chunk-PZ2NVKI7.js";
24
24
  export {
25
25
  CONFIG_FILE_NAME,
26
26
  CheckResultBuilder,
@@ -42,4 +42,4 @@ export {
42
42
  parseRegistryUrl,
43
43
  resolveExtends
44
44
  };
45
- //# sourceMappingURL=src-KZRTG3EU.js.map
45
+ //# sourceMappingURL=core-KB2W6SE2.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Core implementation of the conform dependencies command
3
+ */
4
+ import type { DependenciesOptions, DependenciesResult } from "./types.js";
5
+ export type { DependenciesOptions, DependenciesResult } from "./types.js";
6
+ /**
7
+ * Get all dependencies for a project
8
+ */
9
+ export declare function getDependencies(options?: Partial<DependenciesOptions>): Promise<DependenciesResult>;
10
+ /**
11
+ * Run the dependencies command (CLI entry point)
12
+ */
13
+ export declare function runDependencies(options: DependenciesOptions): Promise<void>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Built-in dependency mappings for tools
3
+ *
4
+ * Maps tool IDs to their known configuration file patterns.
5
+ * These patterns may include globs that need to be expanded.
6
+ */
7
+ import type { ToolDependencyMapping } from "./types.js";
8
+ /**
9
+ * Built-in dependency mappings for all supported tools.
10
+ * Keys match the toolId used in standards.toml config paths.
11
+ */
12
+ export declare const BUILTIN_MAPPINGS: Record<string, ToolDependencyMapping>;
13
+ /**
14
+ * Files that are always tracked regardless of which tools are enabled.
15
+ * These patterns may include globs.
16
+ */
17
+ export declare const ALWAYS_TRACKED: string[];
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Output formatters for the conform dependencies command
3
+ */
4
+ import type { DependenciesResult } from "./types.js";
5
+ /**
6
+ * Format dependencies result as human-readable text
7
+ */
8
+ export declare function formatDependenciesText(result: DependenciesResult): string;
9
+ /**
10
+ * Format dependencies result as JSON
11
+ */
12
+ export declare function formatDependenciesJson(result: DependenciesResult): string;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Types for the conform dependencies command
3
+ */
4
+ /** Options for the dependencies command */
5
+ export interface DependenciesOptions {
6
+ /** Path to standards.toml config file */
7
+ config?: string;
8
+ /** Output format */
9
+ format: "text" | "json";
10
+ /** Filter to specific check (e.g., "eslint") */
11
+ check?: string;
12
+ /** Monorepo project path filter */
13
+ project?: string;
14
+ }
15
+ /** Result of dependency collection */
16
+ export interface DependenciesResult {
17
+ /** Project path (relative, or "." for root) */
18
+ project: string;
19
+ /** Path to standards.toml */
20
+ checkTomlPath: string;
21
+ /** Map of tool ID to its dependency files (only existing files) */
22
+ dependencies: Record<string, string[]>;
23
+ /** Files that are always tracked (only existing files) */
24
+ alwaysTracked: string[];
25
+ /** Flattened list of all dependency files (deduplicated and sorted) */
26
+ allFiles: string[];
27
+ }
28
+ /** Tool dependency mapping configuration */
29
+ export interface ToolDependencyMapping {
30
+ /** Tool identifier */
31
+ toolId: string;
32
+ /** Config file patterns (may include globs) */
33
+ configFiles: string[];
34
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @standards-kit/conform - In-repo standards enforcement
3
+ */
4
+ export type { CheckResult, DomainResult, DomainStatus, ExitCodeType, FullResult, IToolRunner, Severity, Violation, ViolationOptions, } from "./core/index.js";
5
+ export { CheckResultBuilder, DomainResultBuilder, ExitCode, ViolationBuilder, } from "./core/index.js";
6
+ export { type Config, ConfigError, configSchema, defaultConfig, findConfigFile, getProjectRoot, loadConfig, } from "./core/index.js";
7
+ export { auditCodeConfig, BaseToolRunner, ESLintRunner, KnipRunner, NamingRunner, RuffRunner, runCodeChecks, TscRunner, TyRunner, VultureRunner, } from "./code/index.js";
8
+ export { auditProcessConfig, BaseProcessToolRunner, HooksRunner, runProcessChecks, } from "./process/index.js";
9
+ export { type RemoteRepoInfo, type ScanOptions, scanRepository, type ScanResult, validateProcess, type ValidateProcessOptions, type ValidateProcessResult, } from "./process/scan/index.js";
10
+ export { formatJson, formatOutput, formatText, type OutputFormat } from "./output/index.js";
11
+ export { type DependenciesOptions, type DependenciesResult, getDependencies, } from "./dependencies/index.js";
12
+ export { formatTierResultJson, formatTierResultText, type RepoMetadata, type Tier, type TierSourceDetail, VALID_TIERS, type ValidateTierOptions, type ValidateTierResult, validateTierRuleset, } from "./validate/index.js";
13
+ export { createServer as createMcpServer, startServer as startMcpServer, type Guideline, type GuidelineFrontmatter, type GuidelineListItem, type Ruleset, } from "./mcp/index.js";
14
+ export type { AccountId, AccountScanResult, Arn, CloudProvider, GcpResourcePath, InfraScanResult, InfraScanSummary, LegacyManifest, Manifest, ManifestAccount, MultiAccountManifest, ParsedArn, ParsedGcpResource, PulumiResource, PulumiStackExport, ResourceCheckResult, ResourceIdentifier, ScanInfraOptions, GenerateManifestOptions, } from "./infra/index.js";
15
+ export { ArnSchema, AccountIdSchema, AccountKeySchema, CloudProviderSchema, GcpResourcePathSchema, InfraScanResultSchema, InfraScanSummarySchema, LegacyManifestSchema, ManifestAccountSchema, ManifestSchema, MultiAccountManifestSchema, ParsedArnSchema, ParsedGcpResourceSchema, PulumiResourceSchema, PulumiStackExportSchema, ResourceCheckResultSchema, ResourceIdentifierSchema, } from "./infra/index.js";
16
+ export { isValidArnFormat, isValidGcpResourcePath, isValidAccountKey, isMultiAccountManifestSchema, isLegacyManifestSchema, validateArn, validateGcpResourcePath, validateAccountKey, validateManifest, validateMultiAccountManifest, validateLegacyManifest, validateStackExport, } from "./infra/index.js";
17
+ export { ManifestError, isMultiAccountManifest, isLegacyManifest, parseAccountKey, formatAccountKey, normalizeManifest, detectAccountFromResource, getAllResources, } from "./infra/index.js";
18
+ export { parseArn, isValidArn, parseGcpResource, isValidGcpResource, } from "./infra/index.js";
19
+ export { SUPPORTED_SERVICES, isSupportedService, SUPPORTED_GCP_SERVICES, isSupportedGcpService, } from "./infra/index.js";
20
+ export { DEFAULT_MANIFEST_NAME, generateManifestFromStdin, generateManifestFromFile, generateMultiAccountFromStdin, generateMultiAccountFromFile, generateWithMerge, mergeIntoManifest, parseStackExport, parseStackExportMultiAccount, readExistingManifest, writeManifest, } from "./infra/index.js";
21
+ export { scanInfra } from "./infra/index.js";
package/dist/index.js CHANGED
@@ -14,8 +14,9 @@ import {
14
14
  import {
15
15
  CheckResultBuilder,
16
16
  DomainResultBuilder,
17
- ExitCode
18
- } from "./chunk-P7TIZJ4C.js";
17
+ ExitCode,
18
+ ViolationBuilder
19
+ } from "./chunk-DXIYZR62.js";
19
20
  import {
20
21
  ConfigError,
21
22
  DEFAULT_FORBIDDEN_FILES_IGNORE,
@@ -25,7 +26,7 @@ import {
25
26
  getProjectRoot,
26
27
  loadConfig,
27
28
  loadConfigAsync
28
- } from "./chunk-KHO6NIAI.js";
29
+ } from "./chunk-PZ2NVKI7.js";
29
30
  import {
30
31
  AccountIdSchema,
31
32
  AccountKeySchema,
@@ -6656,7 +6657,7 @@ async function scanRepository(repo, config) {
6656
6657
  return aggregateResults(repoInfo, [rulesetsResult, filesResult]);
6657
6658
  }
6658
6659
  async function validateProcess(options) {
6659
- const { loadConfigAsync: loadConfigAsync2 } = await import("./src-KZRTG3EU.js");
6660
+ const { loadConfigAsync: loadConfigAsync2 } = await import("./core-KB2W6SE2.js");
6660
6661
  const { config } = await loadConfigAsync2(options.config);
6661
6662
  const result = await scanRepository(options.repo, config);
6662
6663
  const fs22 = await import("fs");
@@ -6692,7 +6693,7 @@ function formatJson(result) {
6692
6693
  }
6693
6694
  function formatText(result) {
6694
6695
  const lines = [];
6695
- lines.push(`check-my-toolkit v${result.version}`);
6696
+ lines.push(`conform v${result.version}`);
6696
6697
  lines.push(`Config: ${result.configPath}`);
6697
6698
  lines.push("");
6698
6699
  for (const [domainName, domain] of Object.entries(result.domains)) {
@@ -7891,9 +7892,11 @@ export {
7891
7892
  ArnSchema,
7892
7893
  BaseProcessToolRunner,
7893
7894
  BaseToolRunner,
7895
+ CheckResultBuilder,
7894
7896
  CloudProviderSchema,
7895
7897
  ConfigError,
7896
7898
  DEFAULT_MANIFEST_NAME,
7899
+ DomainResultBuilder,
7897
7900
  ESLintRunner,
7898
7901
  ExitCode,
7899
7902
  GcpResourcePathSchema,
@@ -7919,6 +7922,7 @@ export {
7919
7922
  TscRunner,
7920
7923
  TyRunner,
7921
7924
  VALID_TIERS,
7925
+ ViolationBuilder,
7922
7926
  VultureRunner,
7923
7927
  auditCodeConfig,
7924
7928
  auditProcessConfig,