@revealui/cli 0.0.1-pre.1 → 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.
Files changed (68) hide show
  1. package/LICENSE +22 -202
  2. package/README.md +86 -0
  3. package/bin/create-revealui.js +6 -0
  4. package/dist/cli.d.ts +14 -0
  5. package/dist/cli.js +1075 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/index.d.ts +11 -2
  8. package/dist/index.js +1071 -123
  9. package/dist/index.js.map +1 -0
  10. package/package.json +42 -44
  11. package/templates/minimal/.env.example +36 -0
  12. package/templates/minimal/_gitignore +26 -0
  13. package/templates/minimal/next.config.mjs +10 -0
  14. package/templates/minimal/package.json +34 -0
  15. package/templates/minimal/revealui.config.ts +18 -0
  16. package/templates/minimal/src/app/globals.css +15 -0
  17. package/templates/minimal/src/app/layout.tsx +15 -0
  18. package/templates/minimal/src/app/page.tsx +20 -0
  19. package/templates/minimal/tsconfig.json +11 -0
  20. package/dist/commands/add.d.ts +0 -28
  21. package/dist/commands/add.d.ts.map +0 -1
  22. package/dist/commands/add.js +0 -115
  23. package/dist/commands/check.d.ts +0 -7
  24. package/dist/commands/check.d.ts.map +0 -1
  25. package/dist/commands/check.js +0 -34
  26. package/dist/commands/doctor/checks/build.d.ts +0 -10
  27. package/dist/commands/doctor/checks/build.d.ts.map +0 -1
  28. package/dist/commands/doctor/checks/build.js +0 -74
  29. package/dist/commands/doctor/checks/config.d.ts +0 -14
  30. package/dist/commands/doctor/checks/config.d.ts.map +0 -1
  31. package/dist/commands/doctor/checks/config.js +0 -116
  32. package/dist/commands/doctor/checks/dependencies.d.ts +0 -14
  33. package/dist/commands/doctor/checks/dependencies.d.ts.map +0 -1
  34. package/dist/commands/doctor/checks/dependencies.js +0 -126
  35. package/dist/commands/doctor/checks/practices.d.ts +0 -14
  36. package/dist/commands/doctor/checks/practices.d.ts.map +0 -1
  37. package/dist/commands/doctor/checks/practices.js +0 -142
  38. package/dist/commands/doctor/checks/structure.d.ts +0 -14
  39. package/dist/commands/doctor/checks/structure.d.ts.map +0 -1
  40. package/dist/commands/doctor/checks/structure.js +0 -107
  41. package/dist/commands/doctor/fixes/index.d.ts +0 -26
  42. package/dist/commands/doctor/fixes/index.d.ts.map +0 -1
  43. package/dist/commands/doctor/fixes/index.js +0 -108
  44. package/dist/commands/doctor/index.d.ts +0 -11
  45. package/dist/commands/doctor/index.d.ts.map +0 -1
  46. package/dist/commands/doctor/index.js +0 -37
  47. package/dist/commands/doctor/print.d.ts +0 -6
  48. package/dist/commands/doctor/print.d.ts.map +0 -1
  49. package/dist/commands/doctor/print.js +0 -31
  50. package/dist/commands/doctor/types.d.ts +0 -16
  51. package/dist/commands/doctor/types.d.ts.map +0 -1
  52. package/dist/commands/doctor/types.js +0 -1
  53. package/dist/commands/fix.d.ts +0 -5
  54. package/dist/commands/fix.d.ts.map +0 -1
  55. package/dist/commands/fix.js +0 -129
  56. package/dist/commands/init.d.ts +0 -35
  57. package/dist/commands/init.d.ts.map +0 -1
  58. package/dist/commands/init.js +0 -104
  59. package/dist/commands/upgrade.d.ts +0 -9
  60. package/dist/commands/upgrade.d.ts.map +0 -1
  61. package/dist/commands/upgrade.js +0 -85
  62. package/dist/index.d.ts.map +0 -1
  63. package/dist/onLoad.d.ts +0 -3
  64. package/dist/onLoad.d.ts.map +0 -1
  65. package/dist/onLoad.js +0 -5
  66. package/dist/utils.d.ts +0 -3
  67. package/dist/utils.d.ts.map +0 -1
  68. package/dist/utils.js +0 -6
@@ -1,74 +0,0 @@
1
- import { execSync } from "child_process";
2
- /**
3
- * Check TypeScript compilation
4
- */
5
- export async function checkTypeScriptCompilation(cwd) {
6
- const results = [];
7
- try {
8
- execSync("pnpm typecheck 2>&1", {
9
- cwd,
10
- stdio: "pipe",
11
- timeout: 30000,
12
- });
13
- results.push({
14
- check: "TypeScript compilation",
15
- status: "pass",
16
- message: "TypeScript compiles without errors",
17
- });
18
- }
19
- catch (error) {
20
- const errorOutput = error instanceof Error ? error.message : String(error);
21
- if (errorOutput.includes("command not found") || errorOutput.includes("Missing script")) {
22
- results.push({
23
- check: "TypeScript compilation",
24
- status: "warn",
25
- message: "TypeScript check script not found",
26
- suggestion: "Add 'typecheck' script to package.json",
27
- });
28
- }
29
- else {
30
- results.push({
31
- check: "TypeScript compilation",
32
- status: "fail",
33
- message: "TypeScript compilation errors found",
34
- suggestion: "Run 'pnpm typecheck' to see detailed errors",
35
- });
36
- }
37
- }
38
- return results;
39
- }
40
- /**
41
- * Check if build process works
42
- */
43
- export async function checkBuildProcess(cwd) {
44
- const results = [];
45
- // Just check if build script exists, don't actually run it
46
- try {
47
- const { readFileSync } = await import("fs");
48
- const packageJsonPath = `${cwd}/package.json`;
49
- const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
50
- if (packageJson.scripts?.build) {
51
- results.push({
52
- check: "build script",
53
- status: "pass",
54
- message: "Build script found in package.json",
55
- });
56
- }
57
- else {
58
- results.push({
59
- check: "build script",
60
- status: "warn",
61
- message: "Build script not found",
62
- suggestion: "Add 'build' script to package.json",
63
- });
64
- }
65
- }
66
- catch {
67
- results.push({
68
- check: "build script",
69
- status: "warn",
70
- message: "Could not check build script",
71
- });
72
- }
73
- return results;
74
- }
@@ -1,14 +0,0 @@
1
- import type { DiagnosticResult } from "../types.js";
2
- /**
3
- * Check reveal.config.ts exists and is valid
4
- */
5
- export declare function checkRevealConfig(cwd: string): Promise<DiagnosticResult[]>;
6
- /**
7
- * Check TypeScript configuration
8
- */
9
- export declare function checkTypeScriptConfig(cwd: string): Promise<DiagnosticResult[]>;
10
- /**
11
- * Check environment variables
12
- */
13
- export declare function checkEnvironmentVariables(cwd: string): Promise<DiagnosticResult[]>;
14
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/checks/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAiC7B;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAgC7B;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAwC7B"}
@@ -1,116 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- /**
4
- * Check reveal.config.ts exists and is valid
5
- */
6
- export async function checkRevealConfig(cwd) {
7
- const results = [];
8
- const configPath = path.join(cwd, "reveal.config.ts");
9
- try {
10
- await fs.access(configPath);
11
- const content = await fs.readFile(configPath, "utf-8");
12
- // Basic syntax check (look for export default)
13
- if (content.includes("export default")) {
14
- results.push({
15
- check: "reveal.config.ts exists",
16
- status: "pass",
17
- message: "Configuration file found and appears valid",
18
- });
19
- }
20
- else {
21
- results.push({
22
- check: "reveal.config.ts exists",
23
- status: "warn",
24
- message: "Configuration file found but may be invalid",
25
- suggestion: "Ensure 'export default defineConfig({...})' is present",
26
- });
27
- }
28
- }
29
- catch {
30
- results.push({
31
- check: "reveal.config.ts exists",
32
- status: "fail",
33
- message: "Configuration file not found",
34
- suggestion: "Run 'reveal init' to create a configuration file",
35
- });
36
- }
37
- return results;
38
- }
39
- /**
40
- * Check TypeScript configuration
41
- */
42
- export async function checkTypeScriptConfig(cwd) {
43
- const results = [];
44
- const tsconfigPath = path.join(cwd, "tsconfig.json");
45
- try {
46
- await fs.access(tsconfigPath);
47
- const tsconfig = JSON.parse(await fs.readFile(tsconfigPath, "utf-8"));
48
- if (tsconfig.compilerOptions?.strict) {
49
- results.push({
50
- check: "TypeScript configuration",
51
- status: "pass",
52
- message: "tsconfig.json found with strict mode enabled",
53
- });
54
- }
55
- else {
56
- results.push({
57
- check: "TypeScript configuration",
58
- status: "warn",
59
- message: "tsconfig.json found but strict mode is disabled",
60
- suggestion: "Enable 'strict: true' in compilerOptions for better type safety",
61
- });
62
- }
63
- }
64
- catch {
65
- results.push({
66
- check: "TypeScript configuration",
67
- status: "warn",
68
- message: "tsconfig.json not found",
69
- suggestion: "Consider adding TypeScript for better type safety",
70
- });
71
- }
72
- return results;
73
- }
74
- /**
75
- * Check environment variables
76
- */
77
- export async function checkEnvironmentVariables(cwd) {
78
- const results = [];
79
- const envTemplatePath = path.join(cwd, ".env.template");
80
- const envLocalPath = path.join(cwd, ".env.local");
81
- // Check for .env.template
82
- try {
83
- await fs.access(envTemplatePath);
84
- results.push({
85
- check: "Environment template",
86
- status: "pass",
87
- message: ".env.template found",
88
- });
89
- }
90
- catch {
91
- results.push({
92
- check: "Environment template",
93
- status: "warn",
94
- message: ".env.template not found",
95
- suggestion: "Create .env.template to document required environment variables",
96
- });
97
- }
98
- // Check if .env.local exists (user should have this)
99
- try {
100
- await fs.access(envLocalPath);
101
- results.push({
102
- check: "Environment configuration",
103
- status: "pass",
104
- message: ".env.local found",
105
- });
106
- }
107
- catch {
108
- results.push({
109
- check: "Environment configuration",
110
- status: "warn",
111
- message: ".env.local not found",
112
- suggestion: "Create .env.local from .env.template and fill in your values",
113
- });
114
- }
115
- return results;
116
- }
@@ -1,14 +0,0 @@
1
- import type { DiagnosticResult } from "../types.js";
2
- /**
3
- * Check package.json exists and has reveal package
4
- */
5
- export declare function checkRevealPackage(cwd: string): Promise<DiagnosticResult[]>;
6
- /**
7
- * Check required dependencies
8
- */
9
- export declare function checkRequiredDependencies(cwd: string): Promise<DiagnosticResult[]>;
10
- /**
11
- * Check for outdated packages
12
- */
13
- export declare function checkOutdatedPackages(cwd: string): Promise<DiagnosticResult[]>;
14
- //# sourceMappingURL=dependencies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/checks/dependencies.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAkC7B;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8C7B;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAuC7B"}
@@ -1,126 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- /**
4
- * Check package.json exists and has reveal package
5
- */
6
- export async function checkRevealPackage(cwd) {
7
- const results = [];
8
- const packageJsonPath = path.join(cwd, "package.json");
9
- try {
10
- const content = await fs.readFile(packageJsonPath, "utf-8");
11
- const packageJson = JSON.parse(content);
12
- if (packageJson.dependencies?.reveal || packageJson.devDependencies?.reveal) {
13
- const version = packageJson.dependencies?.reveal || packageJson.devDependencies?.reveal;
14
- results.push({
15
- check: "reveal package installed",
16
- status: "pass",
17
- message: `RevealUI package is installed (${version})`,
18
- });
19
- }
20
- else {
21
- results.push({
22
- check: "reveal package installed",
23
- status: "fail",
24
- message: "RevealUI package not found in dependencies",
25
- suggestion: "Run 'pnpm add reveal' to install",
26
- });
27
- }
28
- }
29
- catch {
30
- results.push({
31
- check: "package.json exists",
32
- status: "fail",
33
- message: "package.json not found",
34
- suggestion: "Initialize a Node.js project first",
35
- });
36
- }
37
- return results;
38
- }
39
- /**
40
- * Check required dependencies
41
- */
42
- export async function checkRequiredDependencies(cwd) {
43
- const results = [];
44
- const packageJsonPath = path.join(cwd, "package.json");
45
- try {
46
- const content = await fs.readFile(packageJsonPath, "utf-8");
47
- const packageJson = JSON.parse(content);
48
- const deps = {
49
- ...packageJson.dependencies,
50
- ...packageJson.devDependencies,
51
- };
52
- // Check for React 19
53
- const requiredDeps = ["react", "react-dom"];
54
- const missingDeps = requiredDeps.filter((dep) => !deps[dep]);
55
- if (missingDeps.length === 0) {
56
- const reactVersion = deps.react;
57
- if (reactVersion?.includes("19")) {
58
- results.push({
59
- check: "required dependencies",
60
- status: "pass",
61
- message: `All required dependencies installed (React ${reactVersion})`,
62
- });
63
- }
64
- else {
65
- results.push({
66
- check: "React version",
67
- status: "warn",
68
- message: `React ${reactVersion} detected, React 19 recommended`,
69
- suggestion: "Update to React 19: 'pnpm add react@^19.2.0 react-dom@^19.2.0'",
70
- });
71
- }
72
- }
73
- else {
74
- results.push({
75
- check: "required dependencies",
76
- status: "fail",
77
- message: `Missing dependencies: ${missingDeps.join(", ")}`,
78
- suggestion: `Run 'pnpm add ${missingDeps.join(" ")}'`,
79
- });
80
- }
81
- }
82
- catch {
83
- // package.json check handled elsewhere
84
- }
85
- return results;
86
- }
87
- /**
88
- * Check for outdated packages
89
- */
90
- export async function checkOutdatedPackages(cwd) {
91
- const results = [];
92
- const packageJsonPath = path.join(cwd, "package.json");
93
- try {
94
- const content = await fs.readFile(packageJsonPath, "utf-8");
95
- const packageJson = JSON.parse(content);
96
- // Check for common outdated patterns
97
- const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
98
- const outdated = [];
99
- // Check for specific packages that should be updated
100
- if (deps.react && !deps.react.includes("19")) {
101
- outdated.push("react");
102
- }
103
- if (deps["react-dom"] && !deps["react-dom"].includes("19")) {
104
- outdated.push("react-dom");
105
- }
106
- if (outdated.length > 0) {
107
- results.push({
108
- check: "package versions",
109
- status: "warn",
110
- message: `Some packages may be outdated: ${outdated.join(", ")}`,
111
- suggestion: "Run 'pnpm outdated' to check for updates",
112
- });
113
- }
114
- else {
115
- results.push({
116
- check: "package versions",
117
- status: "pass",
118
- message: "Package versions appear up to date",
119
- });
120
- }
121
- }
122
- catch {
123
- // package.json check handled elsewhere
124
- }
125
- return results;
126
- }
@@ -1,14 +0,0 @@
1
- import type { DiagnosticResult } from "../types.js";
2
- /**
3
- * Check .gitignore is properly configured
4
- */
5
- export declare function checkGitignore(cwd: string): Promise<DiagnosticResult[]>;
6
- /**
7
- * Check environment files are not committed
8
- */
9
- export declare function checkEnvFilesNotCommitted(cwd: string): Promise<DiagnosticResult[]>;
10
- /**
11
- * Check security best practices
12
- */
13
- export declare function checkSecurityPractices(cwd: string): Promise<DiagnosticResult[]>;
14
- //# sourceMappingURL=practices.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"practices.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/checks/practices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAoC7E;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAyC7B;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAwD7B"}
@@ -1,142 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- /**
4
- * Check .gitignore is properly configured
5
- */
6
- export async function checkGitignore(cwd) {
7
- const results = [];
8
- const gitignorePath = path.join(cwd, ".gitignore");
9
- try {
10
- const content = await fs.readFile(gitignorePath, "utf-8");
11
- const requiredPatterns = ["node_modules", ".env"];
12
- const missingPatterns = requiredPatterns.filter((pattern) => !content.includes(pattern));
13
- if (missingPatterns.length === 0) {
14
- results.push({
15
- check: ".gitignore configuration",
16
- status: "pass",
17
- message: ".gitignore properly configured",
18
- });
19
- }
20
- else {
21
- results.push({
22
- check: ".gitignore configuration",
23
- status: "warn",
24
- message: `.gitignore missing patterns: ${missingPatterns.join(", ")}`,
25
- suggestion: `Add ${missingPatterns.join(", ")} to .gitignore`,
26
- });
27
- }
28
- }
29
- catch {
30
- results.push({
31
- check: ".gitignore configuration",
32
- status: "warn",
33
- message: ".gitignore not found",
34
- suggestion: "Create .gitignore to prevent committing sensitive files",
35
- });
36
- }
37
- return results;
38
- }
39
- /**
40
- * Check environment files are not committed
41
- */
42
- export async function checkEnvFilesNotCommitted(cwd) {
43
- const results = [];
44
- const envFiles = [".env", ".env.local", ".env.development.local"];
45
- for (const envFile of envFiles) {
46
- try {
47
- const envPath = path.join(cwd, envFile);
48
- await fs.access(envPath);
49
- // Check if .gitignore mentions it
50
- try {
51
- const gitignorePath = path.join(cwd, ".gitignore");
52
- const gitignoreContent = await fs.readFile(gitignorePath, "utf-8");
53
- if (gitignoreContent.includes(envFile) || gitignoreContent.includes(".env*")) {
54
- results.push({
55
- check: `Environment file: ${envFile}`,
56
- status: "pass",
57
- message: `${envFile} exists and is gitignored`,
58
- });
59
- }
60
- else {
61
- results.push({
62
- check: `Environment file: ${envFile}`,
63
- status: "warn",
64
- message: `${envFile} exists but may not be gitignored`,
65
- suggestion: `Add ${envFile} to .gitignore`,
66
- });
67
- }
68
- }
69
- catch {
70
- results.push({
71
- check: `Environment file: ${envFile}`,
72
- status: "warn",
73
- message: `${envFile} exists but .gitignore not found`,
74
- suggestion: "Create .gitignore and add .env* patterns",
75
- });
76
- }
77
- }
78
- catch {
79
- // File doesn't exist, which is fine
80
- }
81
- }
82
- return results;
83
- }
84
- /**
85
- * Check security best practices
86
- */
87
- export async function checkSecurityPractices(cwd) {
88
- const results = [];
89
- // Check for hardcoded secrets in code (basic check)
90
- try {
91
- const { readdir, readFile } = await import("fs/promises");
92
- const srcPath = path.join(cwd, "src");
93
- try {
94
- const files = await readdir(srcPath, { recursive: true });
95
- const suspiciousPatterns = [
96
- /password\s*=\s*["'][^"']+["']/i,
97
- /api[_-]?key\s*=\s*["'][^"']+["']/i,
98
- /secret\s*=\s*["'][^"']+["']/i,
99
- ];
100
- let foundIssues = false;
101
- for (const file of files) {
102
- if (typeof file === "string" && (file.endsWith(".ts") || file.endsWith(".tsx") || file.endsWith(".js"))) {
103
- const filePath = path.join(srcPath, file);
104
- try {
105
- const content = await readFile(filePath, "utf-8");
106
- for (const pattern of suspiciousPatterns) {
107
- if (pattern.test(content) && !content.includes("process.env")) {
108
- foundIssues = true;
109
- break;
110
- }
111
- }
112
- }
113
- catch {
114
- // Skip files we can't read
115
- }
116
- }
117
- }
118
- if (!foundIssues) {
119
- results.push({
120
- check: "Security: hardcoded secrets",
121
- status: "pass",
122
- message: "No obvious hardcoded secrets detected",
123
- });
124
- }
125
- else {
126
- results.push({
127
- check: "Security: hardcoded secrets",
128
- status: "warn",
129
- message: "Potential hardcoded secrets detected",
130
- suggestion: "Use environment variables instead of hardcoding secrets",
131
- });
132
- }
133
- }
134
- catch {
135
- // src directory might not exist
136
- }
137
- }
138
- catch {
139
- // Could not check
140
- }
141
- return results;
142
- }
@@ -1,14 +0,0 @@
1
- import type { DiagnosticResult } from "../types.js";
2
- /**
3
- * Check pages directory exists with content
4
- */
5
- export declare function checkPagesDirectory(cwd: string): Promise<DiagnosticResult[]>;
6
- /**
7
- * Check components directory structure
8
- */
9
- export declare function checkComponentsDirectory(cwd: string): Promise<DiagnosticResult[]>;
10
- /**
11
- * Check public assets directory
12
- */
13
- export declare function checkPublicDirectory(cwd: string): Promise<DiagnosticResult[]>;
14
- //# sourceMappingURL=structure.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/checks/structure.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAgD7B;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAiC7B;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAqB7B"}
@@ -1,107 +0,0 @@
1
- import fs from "node:fs/promises";
2
- import path from "node:path";
3
- /**
4
- * Check pages directory exists with content
5
- */
6
- export async function checkPagesDirectory(cwd) {
7
- const results = [];
8
- const pagesDirs = [
9
- path.join(cwd, "src/pages"),
10
- path.join(cwd, "src/app"),
11
- path.join(cwd, "pages"),
12
- ];
13
- let pagesFound = false;
14
- for (const pagesDir of pagesDirs) {
15
- try {
16
- await fs.access(pagesDir);
17
- const files = await fs.readdir(pagesDir, { withFileTypes: true });
18
- const hasFiles = files.some((file) => {
19
- const name = file.name.toLowerCase();
20
- return (name.includes("page") ||
21
- name.includes("index") ||
22
- name.includes(".tsx") ||
23
- name.includes(".jsx"));
24
- });
25
- if (hasFiles) {
26
- pagesFound = true;
27
- results.push({
28
- check: "pages directory",
29
- status: "pass",
30
- message: `Pages directory found at ${path.relative(cwd, pagesDir)} with content`,
31
- });
32
- break;
33
- }
34
- }
35
- catch {
36
- // Continue to next directory
37
- }
38
- }
39
- if (!pagesFound) {
40
- results.push({
41
- check: "pages directory",
42
- status: "fail",
43
- message: "No pages directory found or empty",
44
- suggestion: "Create src/pages/ or src/app/ directory and add at least one page",
45
- });
46
- }
47
- return results;
48
- }
49
- /**
50
- * Check components directory structure
51
- */
52
- export async function checkComponentsDirectory(cwd) {
53
- const results = [];
54
- const componentsDirs = [
55
- path.join(cwd, "src/components"),
56
- path.join(cwd, "components"),
57
- ];
58
- let componentsFound = false;
59
- for (const compDir of componentsDirs) {
60
- try {
61
- await fs.access(compDir);
62
- componentsFound = true;
63
- results.push({
64
- check: "components directory",
65
- status: "pass",
66
- message: `Components directory found at ${path.relative(cwd, compDir)}`,
67
- });
68
- break;
69
- }
70
- catch {
71
- // Continue
72
- }
73
- }
74
- if (!componentsFound) {
75
- results.push({
76
- check: "components directory",
77
- status: "warn",
78
- message: "Components directory not found",
79
- suggestion: "Consider creating src/components/ for reusable components",
80
- });
81
- }
82
- return results;
83
- }
84
- /**
85
- * Check public assets directory
86
- */
87
- export async function checkPublicDirectory(cwd) {
88
- const results = [];
89
- const publicDir = path.join(cwd, "public");
90
- try {
91
- await fs.access(publicDir);
92
- results.push({
93
- check: "public directory",
94
- status: "pass",
95
- message: "Public directory found",
96
- });
97
- }
98
- catch {
99
- results.push({
100
- check: "public directory",
101
- status: "warn",
102
- message: "Public directory not found",
103
- suggestion: "Create public/ directory for static assets",
104
- });
105
- }
106
- return results;
107
- }
@@ -1,26 +0,0 @@
1
- import type { DiagnosticResult } from "../types.js";
2
- /**
3
- * Apply automatic fixes for diagnostic issues
4
- */
5
- export declare function applyFixes(results: DiagnosticResult[]): Promise<void>;
6
- /**
7
- * Create missing reveal.config.ts
8
- */
9
- export declare function fixMissingRevealConfig(cwd: string): Promise<void>;
10
- /**
11
- * Add missing dependencies
12
- */
13
- export declare function fixMissingDependencies(cwd: string, dependencies: string[]): Promise<void>;
14
- /**
15
- * Create missing directories
16
- */
17
- export declare function fixMissingDirectories(cwd: string, dirs: string[]): Promise<void>;
18
- /**
19
- * Add patterns to .gitignore
20
- */
21
- export declare function fixGitignore(cwd: string, patterns: string[]): Promise<void>;
22
- /**
23
- * Create .env.template
24
- */
25
- export declare function fixMissingEnvTemplate(cwd: string): Promise<void>;
26
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/fixes/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B3E;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBvE;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC3C,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAC1C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,GACZ,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;GAEG;AACH,wBAAsB,YAAY,CACjC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,IAAI,CAAC,CAiBf;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBtE"}