@revealui/cli 0.0.1-pre.1

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 (53) hide show
  1. package/LICENSE +202 -0
  2. package/dist/commands/add.d.ts +28 -0
  3. package/dist/commands/add.d.ts.map +1 -0
  4. package/dist/commands/add.js +115 -0
  5. package/dist/commands/check.d.ts +7 -0
  6. package/dist/commands/check.d.ts.map +1 -0
  7. package/dist/commands/check.js +34 -0
  8. package/dist/commands/doctor/checks/build.d.ts +10 -0
  9. package/dist/commands/doctor/checks/build.d.ts.map +1 -0
  10. package/dist/commands/doctor/checks/build.js +74 -0
  11. package/dist/commands/doctor/checks/config.d.ts +14 -0
  12. package/dist/commands/doctor/checks/config.d.ts.map +1 -0
  13. package/dist/commands/doctor/checks/config.js +116 -0
  14. package/dist/commands/doctor/checks/dependencies.d.ts +14 -0
  15. package/dist/commands/doctor/checks/dependencies.d.ts.map +1 -0
  16. package/dist/commands/doctor/checks/dependencies.js +126 -0
  17. package/dist/commands/doctor/checks/practices.d.ts +14 -0
  18. package/dist/commands/doctor/checks/practices.d.ts.map +1 -0
  19. package/dist/commands/doctor/checks/practices.js +142 -0
  20. package/dist/commands/doctor/checks/structure.d.ts +14 -0
  21. package/dist/commands/doctor/checks/structure.d.ts.map +1 -0
  22. package/dist/commands/doctor/checks/structure.js +107 -0
  23. package/dist/commands/doctor/fixes/index.d.ts +26 -0
  24. package/dist/commands/doctor/fixes/index.d.ts.map +1 -0
  25. package/dist/commands/doctor/fixes/index.js +108 -0
  26. package/dist/commands/doctor/index.d.ts +11 -0
  27. package/dist/commands/doctor/index.d.ts.map +1 -0
  28. package/dist/commands/doctor/index.js +37 -0
  29. package/dist/commands/doctor/print.d.ts +6 -0
  30. package/dist/commands/doctor/print.d.ts.map +1 -0
  31. package/dist/commands/doctor/print.js +31 -0
  32. package/dist/commands/doctor/types.d.ts +16 -0
  33. package/dist/commands/doctor/types.d.ts.map +1 -0
  34. package/dist/commands/doctor/types.js +1 -0
  35. package/dist/commands/fix.d.ts +5 -0
  36. package/dist/commands/fix.d.ts.map +1 -0
  37. package/dist/commands/fix.js +129 -0
  38. package/dist/commands/init.d.ts +35 -0
  39. package/dist/commands/init.d.ts.map +1 -0
  40. package/dist/commands/init.js +104 -0
  41. package/dist/commands/upgrade.d.ts +9 -0
  42. package/dist/commands/upgrade.d.ts.map +1 -0
  43. package/dist/commands/upgrade.js +85 -0
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +128 -0
  47. package/dist/onLoad.d.ts +3 -0
  48. package/dist/onLoad.d.ts.map +1 -0
  49. package/dist/onLoad.js +5 -0
  50. package/dist/utils.d.ts +3 -0
  51. package/dist/utils.d.ts.map +1 -0
  52. package/dist/utils.js +6 -0
  53. package/package.json +58 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (which shall not include Communications that are clearly marked or
39
+ otherwise designated in writing by the copyright owner as "Not a Work").
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is clearly marked or otherwise designated
61
+ in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "page" as the copyright notice for easier identification within
188
+ third-party archives.
189
+
190
+ Copyright 2025 RevealUI Team
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
201
+ implied. See the License for the specific language governing
202
+ permissions and limitations under the License.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * reveal add <plugin> command
3
+ * Install and configure RevealUI plugins
4
+ */
5
+ /**
6
+ * Options for adding a plugin
7
+ */
8
+ export interface AddPluginOptions {
9
+ /** Name of the plugin to add */
10
+ pluginName: string;
11
+ /** Plugin-specific options */
12
+ options?: Record<string, unknown>;
13
+ }
14
+ /**
15
+ * Adds a plugin to the project
16
+ * Installs the plugin package and updates reveal.config.ts
17
+ *
18
+ * @param options - Plugin addition options
19
+ * @example
20
+ * ```ts
21
+ * await addPlugin({
22
+ * pluginName: 'react',
23
+ * options: {},
24
+ * })
25
+ * ```
26
+ */
27
+ export declare function addPlugin(options: AddPluginOptions): Promise<void>;
28
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AA8BD;;;;;;;;;;;;GAYG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA6Ff"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * reveal add <plugin> command
3
+ * Install and configure RevealUI plugins
4
+ */
5
+ import { execSync } from "node:child_process";
6
+ import fs from "node:fs/promises";
7
+ import path from "node:path";
8
+ import pc from "@brillout/picocolors";
9
+ /**
10
+ * Available plugins
11
+ */
12
+ const AVAILABLE_PLUGINS = {
13
+ react: {
14
+ package: "reveal",
15
+ importPath: "reveal/plugins/react",
16
+ config: () => "react()",
17
+ },
18
+ payload: {
19
+ package: "reveal",
20
+ importPath: "reveal/plugins/payload",
21
+ config: () => "payload()",
22
+ },
23
+ vercel: {
24
+ package: "reveal",
25
+ importPath: "reveal/plugins/vercel",
26
+ config: () => "vercel()",
27
+ },
28
+ };
29
+ /**
30
+ * Adds a plugin to the project
31
+ * Installs the plugin package and updates reveal.config.ts
32
+ *
33
+ * @param options - Plugin addition options
34
+ * @example
35
+ * ```ts
36
+ * await addPlugin({
37
+ * pluginName: 'react',
38
+ * options: {},
39
+ * })
40
+ * ```
41
+ */
42
+ export async function addPlugin(options) {
43
+ const { pluginName, options: pluginOptions = {} } = options;
44
+ if (!AVAILABLE_PLUGINS[pluginName]) {
45
+ throw new Error(`Unknown plugin: ${pluginName}. Available plugins: ${Object.keys(AVAILABLE_PLUGINS).join(", ")}`);
46
+ }
47
+ const plugin = AVAILABLE_PLUGINS[pluginName];
48
+ console.log(pc.cyan(`Adding plugin: ${pluginName}...`));
49
+ // Install package if needed (for future external plugins)
50
+ if (plugin.package !== "reveal") {
51
+ try {
52
+ execSync(`pnpm add ${plugin.package}`, { stdio: "inherit" });
53
+ }
54
+ catch (error) {
55
+ console.warn(pc.yellow(`Failed to install ${plugin.package}, continuing anyway...`));
56
+ }
57
+ }
58
+ // Update reveal.config.ts
59
+ const configPath = path.join(process.cwd(), "reveal.config.ts");
60
+ try {
61
+ let configContent = await fs.readFile(configPath, "utf-8");
62
+ // Check if plugin is already added
63
+ if (configContent.includes(plugin.importPath)) {
64
+ console.log(pc.yellow(`Plugin ${pluginName} is already configured`));
65
+ return;
66
+ }
67
+ // Add import
68
+ const importLine = `import ${pluginName} from "${plugin.importPath}";`;
69
+ if (!configContent.includes(importLine)) {
70
+ // Find the last import statement
71
+ const importMatch = configContent.match(/^import .+ from .+;$/gm);
72
+ if (importMatch && importMatch.length > 0) {
73
+ const lastImport = importMatch[importMatch.length - 1];
74
+ if (lastImport) {
75
+ const lastImportIndex = configContent.lastIndexOf(lastImport);
76
+ const insertIndex = lastImportIndex + lastImport.length;
77
+ configContent =
78
+ configContent.slice(0, insertIndex) +
79
+ "\n" +
80
+ importLine +
81
+ configContent.slice(insertIndex);
82
+ }
83
+ }
84
+ else {
85
+ // No imports, add at the top
86
+ configContent = importLine + "\n" + configContent;
87
+ }
88
+ }
89
+ // Add to plugins array
90
+ const pluginConfig = plugin.config
91
+ ? plugin.config(pluginOptions)
92
+ : `${pluginName}()`;
93
+ // Find plugins array and add plugin
94
+ const pluginsMatch = configContent.match(/plugins:\s*\[([^\]]*)\]/);
95
+ if (pluginsMatch && pluginsMatch[1] !== undefined) {
96
+ const pluginsContent = pluginsMatch[1];
97
+ const newPluginsContent = pluginsContent.trim() === ""
98
+ ? pluginConfig
99
+ : `${pluginsContent.trim()},\n ${pluginConfig}`;
100
+ configContent = configContent.replace(/plugins:\s*\[([^\]]*)\]/, `plugins: [\n ${newPluginsContent}\n ]`);
101
+ }
102
+ else {
103
+ // No plugins array, add it
104
+ configContent = configContent.replace(/defineConfig\(\{/, `defineConfig({\n plugins: [\n ${pluginConfig}\n ],`);
105
+ }
106
+ await fs.writeFile(configPath, configContent, "utf-8");
107
+ console.log(pc.green(`✓ Plugin ${pluginName} added successfully!`));
108
+ }
109
+ catch (error) {
110
+ if (error.code === "ENOENT") {
111
+ throw new Error("reveal.config.ts not found. Run 'reveal init' first to create a project.");
112
+ }
113
+ throw error;
114
+ }
115
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Quick health check command (lightweight version of doctor)
3
+ * Returns exit code 0 if all critical checks pass, 1 otherwise
4
+ * Designed for CI/CD integration
5
+ */
6
+ export declare function runCheck(): Promise<number>;
7
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAuBhD"}
@@ -0,0 +1,34 @@
1
+ import { runDiagnostics } from "./doctor/index.js";
2
+ /**
3
+ * Quick health check command (lightweight version of doctor)
4
+ * Returns exit code 0 if all critical checks pass, 1 otherwise
5
+ * Designed for CI/CD integration
6
+ */
7
+ export async function runCheck() {
8
+ const results = await runDiagnostics();
9
+ // Filter to only critical failures
10
+ const criticalFailures = results.filter((r) => r.status === "fail" && isCriticalCheck(r.check));
11
+ if (criticalFailures.length === 0) {
12
+ // All critical checks passed
13
+ return 0;
14
+ }
15
+ // At least one critical check failed
16
+ console.error(`\n✗ ${criticalFailures.length} critical check(s) failed:\n`);
17
+ for (const result of criticalFailures) {
18
+ console.error(` ✗ ${result.check}: ${result.message}`);
19
+ }
20
+ console.error();
21
+ return 1;
22
+ }
23
+ /**
24
+ * Determine if a check is critical (blocks development/deployment)
25
+ */
26
+ function isCriticalCheck(check) {
27
+ const criticalChecks = [
28
+ "reveal.config.ts exists",
29
+ "reveal package installed",
30
+ "package.json exists",
31
+ "required dependencies",
32
+ ];
33
+ return criticalChecks.some((critical) => check.includes(critical));
34
+ }
@@ -0,0 +1,10 @@
1
+ import type { DiagnosticResult } from "../types.js";
2
+ /**
3
+ * Check TypeScript compilation
4
+ */
5
+ export declare function checkTypeScriptCompilation(cwd: string): Promise<DiagnosticResult[]>;
6
+ /**
7
+ * Check if build process works
8
+ */
9
+ export declare function checkBuildProcess(cwd: string): Promise<DiagnosticResult[]>;
10
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/commands/doctor/checks/build.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAkC7B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAgC7B"}
@@ -0,0 +1,74 @@
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
+ }
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,116 @@
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
+ }
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}