prereq-cli 0.1.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.
@@ -0,0 +1,2 @@
1
+ import type { PrereqConfig } from './types';
2
+ export declare function defineConfig(config: PrereqConfig): PrereqConfig;
package/dist/config.js ADDED
@@ -0,0 +1,7 @@
1
+ // src/config.ts
2
+ function defineConfig(config) {
3
+ return config;
4
+ }
5
+ export {
6
+ defineConfig
7
+ };
package/dist/help.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare function printMainHelp(useColor: boolean): void;
2
+ export declare function printCheckHelp(useColor: boolean): void;
3
+ export declare function printValidateHelp(useColor: boolean): void;
4
+ export declare function printInitHelp(useColor: boolean): void;
5
+ export declare function printExamplesHelp(useColor: boolean): void;
@@ -0,0 +1,2 @@
1
+ export { defineConfig } from './config';
2
+ export type { AuditReport, AuditSummary, DetectConfig, DocsConfig, InstallConfig, Platform, PrereqConfig, PrereqResult, PrereqStatus, PrerequisiteConfig, Tier, VersionConfig, } from './types';
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // src/config.ts
2
+ function defineConfig(config) {
3
+ return config;
4
+ }
5
+ export {
6
+ defineConfig
7
+ };
package/dist/init.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ type InitOptions = {
2
+ cwd: string;
3
+ target?: string;
4
+ format?: 'ts' | 'json';
5
+ force?: boolean;
6
+ };
7
+ export declare function initConfig(options: InitOptions): {
8
+ filePath: string;
9
+ created: boolean;
10
+ format: 'ts' | 'json';
11
+ };
12
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { NormalizedConfig } from './types';
2
+ export declare function resolveConfigPath(cwd: string, explicitPath?: string): string;
3
+ export declare function loadConfig(cwd: string, explicitPath?: string): Promise<{
4
+ config: NormalizedConfig;
5
+ configPath: string;
6
+ }>;
@@ -0,0 +1,3 @@
1
+ import type { AuditReport } from './types';
2
+ export declare function printPretty(report: AuditReport, useColor: boolean, verbose?: boolean): void;
3
+ export declare function printJson(report: AuditReport): void;
@@ -0,0 +1,2 @@
1
+ import type { NormalizedConfig } from './types';
2
+ export declare function normalizeConfig(rawConfig: unknown): NormalizedConfig;
@@ -0,0 +1,96 @@
1
+ export type Tier = 'required' | 'recommended' | 'optional';
2
+ export type Platform = 'darwin' | 'linux' | 'win32';
3
+ export type DocsConfig = string | {
4
+ install: string;
5
+ configure?: string;
6
+ };
7
+ export type InstallConfig = string | string[] | Partial<Record<Platform, string | string[]>>;
8
+ export type DetectConfig = {
9
+ binaries?: string[];
10
+ commands?: string[];
11
+ paths?: string[];
12
+ };
13
+ export type VersionConfig = {
14
+ command: string;
15
+ range: string;
16
+ };
17
+ export type PrerequisiteConfig = {
18
+ id: string;
19
+ name?: string;
20
+ description?: string;
21
+ tier?: Tier;
22
+ detect: DetectConfig;
23
+ version?: VersionConfig;
24
+ docs?: DocsConfig;
25
+ help?: string;
26
+ install?: InstallConfig;
27
+ };
28
+ export type PrereqConfig = {
29
+ $schema?: string;
30
+ version?: 1;
31
+ projectName?: string;
32
+ prerequisites: PrerequisiteConfig[];
33
+ };
34
+ export type NormalizedPrerequisite = {
35
+ id: string;
36
+ name: string;
37
+ description?: string;
38
+ tier: Tier;
39
+ detect: {
40
+ binaries: string[];
41
+ commands: string[];
42
+ paths: string[];
43
+ };
44
+ version?: VersionConfig;
45
+ docs?: {
46
+ install: string;
47
+ configure?: string;
48
+ };
49
+ help?: string;
50
+ installByPlatform: Partial<Record<Platform, string[]>>;
51
+ };
52
+ export type NormalizedConfig = {
53
+ projectName: string;
54
+ prerequisites: NormalizedPrerequisite[];
55
+ };
56
+ export type PrereqStatus = 'ok' | 'missing' | 'outdated' | 'version_unknown';
57
+ export type PrereqResult = {
58
+ id: string;
59
+ name: string;
60
+ tier: Tier;
61
+ status: PrereqStatus;
62
+ detectedBy?: string;
63
+ available: boolean;
64
+ versionOutput?: string;
65
+ detectedVersion?: string;
66
+ expectedRange?: string;
67
+ reason?: string;
68
+ installHint?: string;
69
+ docsInstall?: string;
70
+ help?: string;
71
+ };
72
+ export type AuditSummary = {
73
+ total: number;
74
+ ok: number;
75
+ missing: number;
76
+ outdated: number;
77
+ versionUnknown: number;
78
+ requiredMissing: number;
79
+ requiredOutdated: number;
80
+ requiredVersionUnknown: number;
81
+ };
82
+ export type AuditReport = {
83
+ projectName: string;
84
+ configPath: string;
85
+ platform: Platform;
86
+ summary: AuditSummary;
87
+ results: PrereqResult[];
88
+ };
89
+ export type RunOptions = {
90
+ cwd: string;
91
+ configPath?: string;
92
+ requiredOnly: boolean;
93
+ strict: boolean;
94
+ timeoutMs: number;
95
+ concurrency: number;
96
+ };
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "prereq-cli",
3
+ "version": "0.1.0",
4
+ "description": "Colorful prerequisite auditor for large codebases",
5
+ "keywords": [
6
+ "audit",
7
+ "cli",
8
+ "developer-tools",
9
+ "onboarding",
10
+ "prerequisites"
11
+ ],
12
+ "license": "MIT",
13
+ "bin": {
14
+ "prereq": "dist/cli.js"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "type": "module",
22
+ "main": "./dist/index.js",
23
+ "types": "./dist/index.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ },
29
+ "./config": {
30
+ "types": "./dist/config.d.ts",
31
+ "import": "./dist/config.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "scripts": {
39
+ "prereq": "bun run src/cli.ts",
40
+ "build": "bun run scripts/build.ts",
41
+ "dev": "bun run src/cli.ts",
42
+ "format": "bun run format:check",
43
+ "format:check": "oxfmt --check .",
44
+ "format:fix": "oxfmt --write .",
45
+ "lint": "oxlint .",
46
+ "lint:fix": "oxlint --fix .",
47
+ "fix": "bun run format:fix && bun run lint:fix",
48
+ "typecheck": "tsgo --noEmit -p tsconfig.json",
49
+ "test": "bun run build && bun test ./test/e2e.test.ts",
50
+ "test:e2e": "bun run build && bun test ./test/e2e.test.ts",
51
+ "check": "bun run format:check && bun run lint && bun run typecheck && bun run test",
52
+ "pack:dry-run": "bun run check && bunx npm pack --dry-run",
53
+ "publish:dry-run": "bun run check && bunx npm publish --dry-run --access public",
54
+ "publish:public": "bun run check && bunx npm publish --access public"
55
+ },
56
+ "dependencies": {
57
+ "cac": "^7.0.0",
58
+ "jiti": "^2.6.1",
59
+ "picocolors": "^1.1.1",
60
+ "semver": "^7.7.4"
61
+ },
62
+ "devDependencies": {
63
+ "@types/bun": "^1.3.10",
64
+ "@types/node": "^25.3.3",
65
+ "@types/semver": "^7.7.1",
66
+ "@typescript/native-preview": "^7.0.0-dev.20260303.1",
67
+ "oxfmt": "^0.36.0",
68
+ "oxlint": "^1.51.0"
69
+ },
70
+ "engines": {
71
+ "node": ">=18"
72
+ },
73
+ "packageManager": "bun@1.3.10"
74
+ }