@standards-kit/conform 0.1.0 → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/dist/{chunk-P7TIZJ4C.js → chunk-DXIYZR62.js} +2 -2
- package/dist/chunk-DXIYZR62.js.map +1 -0
- package/dist/{chunk-RXA4FO7L.js → chunk-NADY2H35.js} +12 -8
- package/dist/chunk-NADY2H35.js.map +1 -0
- package/dist/chunk-O745CMWG.js +29 -0
- package/dist/chunk-O745CMWG.js.map +1 -0
- package/dist/chunk-RHM53NLG.js +49 -0
- package/dist/chunk-RHM53NLG.js.map +1 -0
- package/dist/{chunk-KHO6NIAI.js → chunk-YGDEM6K5.js} +24 -10
- package/dist/chunk-YGDEM6K5.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +49 -38
- package/dist/cli.js.map +1 -1
- package/dist/{cloudwatch-KSZ4A256.js → cloudwatch-3LTDYG6G.js} +6 -10
- package/dist/cloudwatch-3LTDYG6G.js.map +1 -0
- package/dist/code/index.d.ts +11 -0
- package/dist/code/tools/base.d.ts +51 -0
- package/dist/code/tools/comment-utils.d.ts +17 -0
- package/dist/code/tools/coverage-run.d.ts +37 -0
- package/dist/code/tools/disable-comments.d.ts +42 -0
- package/dist/code/tools/eslint.d.ts +99 -0
- package/dist/code/tools/gitleaks.d.ts +42 -0
- package/dist/code/tools/index.d.ts +13 -0
- package/dist/code/tools/knip.d.ts +20 -0
- package/dist/code/tools/naming.d.ts +64 -0
- package/dist/code/tools/pipaudit.d.ts +24 -0
- package/dist/code/tools/pnpmaudit.d.ts +36 -0
- package/dist/code/tools/ruff.d.ts +46 -0
- package/dist/code/tools/tsc.d.ts +57 -0
- package/dist/code/tools/ty.d.ts +34 -0
- package/dist/code/tools/vulture.d.ts +32 -0
- package/dist/constants.d.ts +69 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/loader.d.ts +42 -0
- package/dist/core/registry.d.ts +17 -0
- package/dist/core/schema.d.ts +1857 -0
- package/dist/core/types.d.ts +95 -0
- package/dist/{src-KZRTG3EU.js → core-QRFGIQ42.js} +4 -3
- package/dist/dependencies/index.d.ts +13 -0
- package/dist/dependencies/mappings.d.ts +17 -0
- package/dist/dependencies/output.d.ts +12 -0
- package/dist/dependencies/types.d.ts +34 -0
- package/dist/{dynamodb-5KVESCVJ.js → dynamodb-HQH3IMAI.js} +6 -10
- package/dist/dynamodb-HQH3IMAI.js.map +1 -0
- package/dist/{ec2-HKPE6GZV.js → ec2-AEPT735A.js} +6 -10
- package/dist/ec2-AEPT735A.js.map +1 -0
- package/dist/{ecs-OS3NJZTA.js → ecs-UHKCH5A7.js} +6 -10
- package/dist/ecs-UHKCH5A7.js.map +1 -0
- package/dist/{elasticache-7TCRHYYM.js → elasticache-5Y6K7GKJ.js} +6 -10
- package/dist/elasticache-5Y6K7GKJ.js.map +1 -0
- package/dist/{elb-PEDLXW5R.js → elb-CN6ELVM5.js} +6 -10
- package/dist/elb-CN6ELVM5.js.map +1 -0
- package/dist/{iam-7H5HFWVQ.js → iam-YXMHK2MV.js} +6 -2
- package/dist/iam-YXMHK2MV.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +99 -121
- package/dist/index.js.map +1 -1
- package/dist/infra/arn.d.ts +16 -0
- package/dist/infra/checkers/client-factory.d.ts +45 -0
- package/dist/infra/checkers/cloudwatch.d.ts +8 -0
- package/dist/infra/checkers/dynamodb.d.ts +8 -0
- package/dist/infra/checkers/ec2.d.ts +13 -0
- package/dist/infra/checkers/ecs.d.ts +13 -0
- package/dist/infra/checkers/elasticache.d.ts +13 -0
- package/dist/infra/checkers/elb.d.ts +13 -0
- package/dist/infra/checkers/gcp/artifactregistry.d.ts +5 -0
- package/dist/infra/checkers/gcp/cloudrun.d.ts +5 -0
- package/dist/infra/checkers/gcp/iam.d.ts +5 -0
- package/dist/infra/checkers/gcp/index.d.ts +17 -0
- package/dist/infra/checkers/gcp/secretmanager.d.ts +5 -0
- package/dist/infra/checkers/iam.d.ts +8 -0
- package/dist/infra/checkers/index.d.ts +26 -0
- package/dist/infra/checkers/lambda.d.ts +8 -0
- package/dist/infra/checkers/rds.d.ts +13 -0
- package/dist/infra/checkers/s3.d.ts +8 -0
- package/dist/infra/checkers/secretsmanager.d.ts +8 -0
- package/dist/infra/checkers/sns.d.ts +8 -0
- package/dist/infra/checkers/sqs.d.ts +8 -0
- package/dist/infra/checkers/types.d.ts +28 -0
- package/dist/infra/gcp.d.ts +18 -0
- package/dist/infra/generate.d.ts +74 -0
- package/dist/infra/index.d.ts +59 -0
- package/dist/infra/manifest.d.ts +58 -0
- package/dist/infra/output.d.ts +8 -0
- package/dist/infra/scan.d.ts +25 -0
- package/dist/infra/schemas.d.ts +806 -0
- package/dist/infra/types.d.ts +8 -0
- package/dist/{infra-UXM5XQX3.js → infra-TO54IUSC.js} +21 -19
- package/dist/infra-TO54IUSC.js.map +1 -0
- package/dist/{lambda-NFB5UILT.js → lambda-YTJOCYV5.js} +6 -10
- package/dist/lambda-YTJOCYV5.js.map +1 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/server.d.ts +18 -0
- package/dist/mcp/standards/fetcher.d.ts +29 -0
- package/dist/mcp/standards/index.d.ts +4 -0
- package/dist/mcp/standards/matcher.d.ts +22 -0
- package/dist/mcp/standards/parser.d.ts +46 -0
- package/dist/mcp/standards/types.d.ts +32 -0
- package/dist/mcp/tools/get-guideline.d.ts +26 -0
- package/dist/mcp/tools/get-ruleset.d.ts +26 -0
- package/dist/mcp/tools/get-standards.d.ts +27 -0
- package/dist/mcp/tools/index.d.ts +4 -0
- package/dist/mcp/tools/list-guidelines.d.ts +25 -0
- package/dist/{mcp-O5O7XVFG.js → mcp-73FZXT3P.js} +5 -4
- package/dist/mcp-73FZXT3P.js.map +1 -0
- package/dist/output/index.d.ts +14 -0
- package/dist/process/commands/check-branch.d.ts +13 -0
- package/dist/process/commands/check-commit.d.ts +14 -0
- package/dist/process/commands/index.d.ts +2 -0
- package/dist/process/index.d.ts +11 -0
- package/dist/process/scan/index.d.ts +5 -0
- package/dist/process/scan/remote-fetcher.d.ts +18 -0
- package/dist/process/scan/scanner.d.ts +6 -0
- package/dist/process/scan/types.d.ts +57 -0
- package/dist/process/scan/validators.d.ts +37 -0
- package/dist/process/sync/applier.d.ts +10 -0
- package/dist/process/sync/differ.d.ts +7 -0
- package/dist/process/sync/fetcher.d.ts +14 -0
- package/dist/process/sync/index.d.ts +9 -0
- package/dist/process/sync/types.d.ts +131 -0
- package/dist/process/sync/validator.d.ts +22 -0
- package/dist/process/tools/backups.d.ts +32 -0
- package/dist/process/tools/base.d.ts +52 -0
- package/dist/process/tools/branches.d.ts +41 -0
- package/dist/process/tools/changesets.d.ts +53 -0
- package/dist/process/tools/ci.d.ts +57 -0
- package/dist/process/tools/codeowners.d.ts +68 -0
- package/dist/process/tools/commits.d.ts +39 -0
- package/dist/process/tools/coverage.d.ts +57 -0
- package/dist/process/tools/docs-helpers.d.ts +44 -0
- package/dist/process/tools/docs.d.ts +38 -0
- package/dist/process/tools/forbidden-files.d.ts +40 -0
- package/dist/process/tools/hooks.d.ts +39 -0
- package/dist/process/tools/index.d.ts +14 -0
- package/dist/process/tools/pr.d.ts +59 -0
- package/dist/process/tools/repo.d.ts +65 -0
- package/dist/process/tools/tickets.d.ts +42 -0
- package/dist/projects/detector.d.ts +16 -0
- package/dist/projects/index.d.ts +4 -0
- package/dist/projects/templates.d.ts +15 -0
- package/dist/projects/tier-loader.d.ts +21 -0
- package/dist/projects/types.d.ts +76 -0
- package/dist/{rds-KLG5O5SI.js → rds-GZ5RVPIU.js} +6 -10
- package/dist/rds-GZ5RVPIU.js.map +1 -0
- package/dist/{registry-V65CC7IN.js → registry-JRCQAIHR.js} +3 -2
- package/dist/{s3-2DH7PRVR.js → s3-53UELUWT.js} +16 -12
- package/dist/s3-53UELUWT.js.map +1 -0
- package/dist/s3-S4GXNR7H.js +53 -0
- package/dist/s3-S4GXNR7H.js.map +1 -0
- package/dist/{scan-EELS42BP.js → scan-RHQWHASY.js} +5 -4
- package/dist/{scan-EELS42BP.js.map → scan-RHQWHASY.js.map} +1 -1
- package/dist/{secretsmanager-MOOIHLAO.js → secretsmanager-FJKTPIXI.js} +6 -10
- package/dist/secretsmanager-FJKTPIXI.js.map +1 -0
- package/dist/{sns-Y36LVTWA.js → sns-RV64OMK2.js} +6 -10
- package/dist/sns-RV64OMK2.js.map +1 -0
- package/dist/{sqs-RRS3GRHK.js → sqs-MHBW6UFC.js} +6 -10
- package/dist/sqs-MHBW6UFC.js.map +1 -0
- package/dist/{standards-RXK5G4IG.js → standards-XAZKTKYJ.js} +3 -2
- package/dist/{sync-RLYBGYNY.js → sync-P3UZECLW.js} +4 -3
- package/dist/{sync-RLYBGYNY.js.map → sync-P3UZECLW.js.map} +1 -1
- package/dist/validate/guidelines.d.ts +18 -0
- package/dist/validate/index.d.ts +5 -0
- package/dist/validate/tier.d.ts +17 -0
- package/dist/validate/types.d.ts +50 -0
- package/dist/{validate-AABLVQJS.js → validate-J5E336GX.js} +53 -84
- package/dist/validate-J5E336GX.js.map +1 -0
- package/package.json +22 -25
- package/dist/chunk-KHO6NIAI.js.map +0 -1
- package/dist/chunk-P7TIZJ4C.js.map +0 -1
- package/dist/chunk-RXA4FO7L.js.map +0 -1
- package/dist/cloudwatch-KSZ4A256.js.map +0 -1
- package/dist/dynamodb-5KVESCVJ.js.map +0 -1
- package/dist/ec2-HKPE6GZV.js.map +0 -1
- package/dist/ecs-OS3NJZTA.js.map +0 -1
- package/dist/elasticache-7TCRHYYM.js.map +0 -1
- package/dist/elb-PEDLXW5R.js.map +0 -1
- package/dist/iam-7H5HFWVQ.js.map +0 -1
- package/dist/infra-UXM5XQX3.js.map +0 -1
- package/dist/lambda-NFB5UILT.js.map +0 -1
- package/dist/mcp-O5O7XVFG.js.map +0 -1
- package/dist/rds-KLG5O5SI.js.map +0 -1
- package/dist/s3-2DH7PRVR.js.map +0 -1
- package/dist/secretsmanager-MOOIHLAO.js.map +0 -1
- package/dist/sns-Y36LVTWA.js.map +0 -1
- package/dist/sqs-RRS3GRHK.js.map +0 -1
- package/dist/validate-AABLVQJS.js.map +0 -1
- /package/dist/{registry-V65CC7IN.js.map → core-QRFGIQ42.js.map} +0 -0
- /package/dist/{src-KZRTG3EU.js.map → registry-JRCQAIHR.js.map} +0 -0
- /package/dist/{standards-RXK5G4IG.js.map → standards-XAZKTKYJ.js.map} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized constants for the conform package.
|
|
3
|
+
* Consolidates all hardcoded values for easier maintenance and configuration.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Timeout values in milliseconds
|
|
7
|
+
*/
|
|
8
|
+
export declare const TIMEOUTS: {
|
|
9
|
+
/** Git clone/pull operation timeout (30 seconds) */
|
|
10
|
+
readonly git: 30000;
|
|
11
|
+
/** Standard code tool execution timeout (5 minutes) */
|
|
12
|
+
readonly codeTool: number;
|
|
13
|
+
/** Extended timeout for longer operations like coverage runs (10 minutes) */
|
|
14
|
+
readonly codeToolExtended: number;
|
|
15
|
+
/** Quick operation timeout for version checks, etc (30 seconds) */
|
|
16
|
+
readonly quick: 30000;
|
|
17
|
+
/** Gitleaks version check timeout (10 seconds) */
|
|
18
|
+
readonly versionCheck: 10000;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* AWS configuration defaults
|
|
22
|
+
*/
|
|
23
|
+
export declare const AWS_DEFAULTS: {
|
|
24
|
+
/** Default region for global AWS services (IAM, S3 global operations) */
|
|
25
|
+
readonly globalRegion: "us-east-1";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* GitHub API configuration
|
|
29
|
+
*/
|
|
30
|
+
export declare const GITHUB_API: {
|
|
31
|
+
/** Base URL for GitHub API (can be overridden via GITHUB_API_URL env var for GitHub Enterprise) */
|
|
32
|
+
readonly baseUrl: string;
|
|
33
|
+
/** Number of items per page for pagination */
|
|
34
|
+
readonly perPage: 100;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Standards repository defaults
|
|
38
|
+
*/
|
|
39
|
+
export declare const STANDARDS_REPO: {
|
|
40
|
+
/** Default owner for standards repository (can be overridden via STANDARDS_REPO_OWNER env var) */
|
|
41
|
+
readonly owner: string;
|
|
42
|
+
/** Default repository name (can be overridden via STANDARDS_REPO_NAME env var) */
|
|
43
|
+
readonly repo: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Cache directory configuration
|
|
47
|
+
*/
|
|
48
|
+
export declare const CACHE: {
|
|
49
|
+
/** Base directory name for standards cache (can be overridden via CM_STANDARDS_CACHE_DIR env var) */
|
|
50
|
+
readonly standardsCacheDir: string;
|
|
51
|
+
/** Base directory name for registry cache */
|
|
52
|
+
readonly registryCacheDir: "conform-registry-cache";
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Concurrency limits
|
|
56
|
+
*/
|
|
57
|
+
export declare const CONCURRENCY: {
|
|
58
|
+
/** Default concurrency for infrastructure resource checks */
|
|
59
|
+
readonly infraScan: 10;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Default threshold values
|
|
63
|
+
*/
|
|
64
|
+
export declare const DEFAULTS: {
|
|
65
|
+
/** Default backup max age in hours */
|
|
66
|
+
readonly backupMaxAgeHours: 24;
|
|
67
|
+
/** Default code coverage minimum threshold */
|
|
68
|
+
readonly coverageMinThreshold: 80;
|
|
69
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { Severity, DomainStatus, Violation, CheckResult, DomainResult, FullResult, IToolRunner, ViolationOptions, ExitCodeType, } from "./types.js";
|
|
2
|
+
export { ViolationBuilder, CheckResultBuilder, DomainResultBuilder, ExitCode, } from "./types.js";
|
|
3
|
+
export type { Config } from "./schema.js";
|
|
4
|
+
export { configSchema, defaultConfig, DEFAULT_FORBIDDEN_FILES_IGNORE } from "./schema.js";
|
|
5
|
+
export { CONFIG_FILE_NAME, ConfigError, findConfigFile, loadConfig, loadConfigAsync, loadConfigWithOverrides, getProjectRoot, } from "./loader.js";
|
|
6
|
+
export type { ConfigOverride } from "./loader.js";
|
|
7
|
+
export { parseRegistryUrl, fetchRegistry, loadRuleset, mergeConfigs, resolveExtends, } from "./registry.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Config } from "./schema.js";
|
|
2
|
+
/** Config file name */
|
|
3
|
+
export declare const CONFIG_FILE_NAME = "standards.toml";
|
|
4
|
+
interface LoadConfigResult {
|
|
5
|
+
config: Config;
|
|
6
|
+
configPath: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class ConfigError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Find standards.toml by walking up the directory tree
|
|
13
|
+
*/
|
|
14
|
+
export declare function findConfigFile(startDir?: string): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Load and parse standards.toml configuration (sync version without extends resolution)
|
|
17
|
+
* Use loadConfigAsync for full extends support
|
|
18
|
+
*/
|
|
19
|
+
export declare function loadConfig(configPath?: string): LoadConfigResult;
|
|
20
|
+
/**
|
|
21
|
+
* Load and parse standards.toml configuration with extends resolution
|
|
22
|
+
*/
|
|
23
|
+
export declare function loadConfigAsync(configPath?: string): Promise<LoadConfigResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Get the project root directory (where standards.toml is located)
|
|
26
|
+
*/
|
|
27
|
+
export declare function getProjectRoot(configPath: string): string;
|
|
28
|
+
/** Information about a config override */
|
|
29
|
+
export interface ConfigOverride {
|
|
30
|
+
section: string;
|
|
31
|
+
key: string;
|
|
32
|
+
registryValue: string;
|
|
33
|
+
projectValue: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Load config and detect any overrides from registry
|
|
37
|
+
* Returns both the merged config and information about overrides
|
|
38
|
+
*/
|
|
39
|
+
export declare function loadConfigWithOverrides(configPath?: string): Promise<LoadConfigResult & {
|
|
40
|
+
overrides: ConfigOverride[];
|
|
41
|
+
}>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Config } from "./schema.js";
|
|
2
|
+
/** Authentication method for private registries */
|
|
3
|
+
type AuthMethod = "token" | "ssh" | "none";
|
|
4
|
+
interface RegistryLocation {
|
|
5
|
+
type: "github" | "local";
|
|
6
|
+
owner?: string;
|
|
7
|
+
repo?: string;
|
|
8
|
+
ref?: string;
|
|
9
|
+
path: string;
|
|
10
|
+
auth?: AuthMethod;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseRegistryUrl(url: string, configDir?: string): RegistryLocation;
|
|
13
|
+
export declare function fetchRegistry(location: RegistryLocation): Promise<string>;
|
|
14
|
+
export declare function loadRuleset(registryDir: string, rulesetName: string): Config;
|
|
15
|
+
export declare function mergeConfigs(base: Config, override: Config): Config;
|
|
16
|
+
export declare function resolveExtends(config: Config, configDir: string): Promise<Config>;
|
|
17
|
+
export {};
|