@object-ui/cli 16.1.0 → 17.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/CHANGELOG.md +204 -0
- package/dist/cli.js +61 -7
- package/dist/cli.js.map +1 -1
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,209 @@
|
|
|
1
1
|
# @object-ui/cli
|
|
2
2
|
|
|
3
|
+
## 17.2.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [4ae0ac4]
|
|
8
|
+
- Updated dependencies [696e3c1]
|
|
9
|
+
- Updated dependencies [a889e31]
|
|
10
|
+
- Updated dependencies [09d30a4]
|
|
11
|
+
- Updated dependencies [4bf612c]
|
|
12
|
+
- Updated dependencies [cb82705]
|
|
13
|
+
- Updated dependencies [f572849]
|
|
14
|
+
- Updated dependencies [f6e8d78]
|
|
15
|
+
- Updated dependencies [ea96284]
|
|
16
|
+
- Updated dependencies [a8ad6c0]
|
|
17
|
+
- Updated dependencies [444457c]
|
|
18
|
+
- Updated dependencies [022e4c3]
|
|
19
|
+
- Updated dependencies [009e25d]
|
|
20
|
+
- Updated dependencies [726b89c]
|
|
21
|
+
- @object-ui/types@17.2.0
|
|
22
|
+
- @object-ui/components@17.2.0
|
|
23
|
+
- @object-ui/react@17.2.0
|
|
24
|
+
|
|
25
|
+
## 17.1.0
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- c735bf7: fix(form): a spec-vocabulary field no longer crashes the standalone form, and every surface now says which vocabulary you meant — #3090
|
|
30
|
+
|
|
31
|
+
Writing the regression test against the unfixed renderer proved the failure
|
|
32
|
+
was worse than the assumed silent drop: a `{ field: 'x' }` entry (spec
|
|
33
|
+
form-VIEW vocabulary) slipped past the `f?.name` guards into a
|
|
34
|
+
react-hook-form Controller with `name === undefined` and crashed the whole
|
|
35
|
+
standalone form on `name.split('.')`, with nothing naming the culprit entry.
|
|
36
|
+
The renderer now partitions such entries out — the rest of the form renders —
|
|
37
|
+
and surfaces them with an inline alert plus a console.error whose text is the
|
|
38
|
+
fix instruction (rename to `name`, or use an object-bound form whose sections
|
|
39
|
+
accept the spec shape).
|
|
40
|
+
|
|
41
|
+
`objectui validate` grows the same boundary awareness: on failure, a
|
|
42
|
+
`{ field: … }` entry in a standalone form gets a "likely cause" hint naming
|
|
43
|
+
the real fix instead of the bare `invalid_union` — the previous message read
|
|
44
|
+
as "bolt a `name` on", which converts spec metadata wrongly. On success,
|
|
45
|
+
mixed-vocabulary entries (`name` + string `field`) get a warning: they
|
|
46
|
+
validate, but the spec key is dead weight the renderer ignores.
|
|
47
|
+
|
|
48
|
+
`normalizeSectionField` warns (once per site) when an authored section field
|
|
49
|
+
mixes both identity keys — the spec branch derives the runtime name from
|
|
50
|
+
`field`, so an authored `name` was silently overwritten.
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [fc0272a]
|
|
53
|
+
- Updated dependencies [9e7349e]
|
|
54
|
+
- Updated dependencies [8864971]
|
|
55
|
+
- Updated dependencies [c785740]
|
|
56
|
+
- Updated dependencies [b41f401]
|
|
57
|
+
- Updated dependencies [19e9fa0]
|
|
58
|
+
- Updated dependencies [9eb932b]
|
|
59
|
+
- Updated dependencies [38ca8be]
|
|
60
|
+
- Updated dependencies [68ef584]
|
|
61
|
+
- Updated dependencies [4952edf]
|
|
62
|
+
- Updated dependencies [7f0252e]
|
|
63
|
+
- Updated dependencies [c769d3d]
|
|
64
|
+
- Updated dependencies [7639a61]
|
|
65
|
+
- Updated dependencies [94e63ef]
|
|
66
|
+
- Updated dependencies [c735bf7]
|
|
67
|
+
- Updated dependencies [02aef0c]
|
|
68
|
+
- Updated dependencies [c4db402]
|
|
69
|
+
- Updated dependencies [5319bf1]
|
|
70
|
+
- Updated dependencies [49e5671]
|
|
71
|
+
- Updated dependencies [9a04d25]
|
|
72
|
+
- Updated dependencies [b5b97e2]
|
|
73
|
+
- Updated dependencies [f59f2c1]
|
|
74
|
+
- Updated dependencies [07de839]
|
|
75
|
+
- Updated dependencies [2a40b5e]
|
|
76
|
+
- Updated dependencies [df613fa]
|
|
77
|
+
- Updated dependencies [4874117]
|
|
78
|
+
- Updated dependencies [ce08d55]
|
|
79
|
+
- Updated dependencies [eb4b740]
|
|
80
|
+
- Updated dependencies [5b084eb]
|
|
81
|
+
- Updated dependencies [aa1240a]
|
|
82
|
+
- Updated dependencies [2374a49]
|
|
83
|
+
- Updated dependencies [2d5d594]
|
|
84
|
+
- Updated dependencies [ea7f477]
|
|
85
|
+
- Updated dependencies [379728f]
|
|
86
|
+
- Updated dependencies [7f23cd0]
|
|
87
|
+
- Updated dependencies [0ded602]
|
|
88
|
+
- Updated dependencies [24e0e0a]
|
|
89
|
+
- Updated dependencies [3a6cf24]
|
|
90
|
+
- Updated dependencies [aa35561]
|
|
91
|
+
- Updated dependencies [03bd53b]
|
|
92
|
+
- Updated dependencies [3c1f321]
|
|
93
|
+
- Updated dependencies [a045a32]
|
|
94
|
+
- Updated dependencies [912496d]
|
|
95
|
+
- Updated dependencies [80edbd4]
|
|
96
|
+
- Updated dependencies [9867281]
|
|
97
|
+
- @object-ui/components@17.1.0
|
|
98
|
+
- @object-ui/react@17.1.0
|
|
99
|
+
- @object-ui/types@17.1.0
|
|
100
|
+
|
|
101
|
+
## 17.0.0
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- dc7a798: fix(plugin-grid,plugin-form,plugin-designer,cli,vscode-extension): type-check the last five unchecked packages, and fix the two runtime bugs that hid there (#2919)
|
|
106
|
+
|
|
107
|
+
Closes the remaining `DEBT` entries from the #2911 sweep. Each package gains
|
|
108
|
+
`"type-check": "tsc --noEmit"` and loses its entry in
|
|
109
|
+
`scripts/check-type-check-coverage.mjs`; coverage goes 36 -> 41 of 45 and
|
|
110
|
+
outstanding errors 25 -> 5 (only #2916 `plugin-view` and #2918 `layout` remain).
|
|
111
|
+
|
|
112
|
+
**Two of these were real bugs, not just type noise.**
|
|
113
|
+
|
|
114
|
+
`@object-ui/cli` — `objectui validate` could never report a validation failure.
|
|
115
|
+
`ZodError.errors` was removed in Zod 4 (the repo is on 4.4.3), so `.errors` read
|
|
116
|
+
`undefined` and `.forEach` threw a `TypeError` that the enclosing `catch`
|
|
117
|
+
reported as `✗ Error reading or parsing schema file: Cannot read properties of
|
|
118
|
+
undefined` — swallowing the very errors the command exists to print. Now reads
|
|
119
|
+
`.issues`. Verified against the built CLI: an invalid schema now prints
|
|
120
|
+
`1. Invalid input / Code: invalid_union` and exits 1.
|
|
121
|
+
|
|
122
|
+
`@object-ui/plugin-grid` — grouping a grid by a boolean column showed the raw
|
|
123
|
+
i18n key. `t('grid.booleanTrue', 'Yes')` asked for a key present in neither
|
|
124
|
+
`GRID_DEFAULT_TRANSLATIONS` nor any locale bundle, and passed the English
|
|
125
|
+
fallback as a bare second argument — which `createSafeTranslation`'s no-provider
|
|
126
|
+
translator reads as an _options object_, so the fallback never applied and the
|
|
127
|
+
header rendered the literal `grid.booleanTrue`. Switched to the `grid.yes` /
|
|
128
|
+
`grid.no` keys the boolean cell renderer (`ObjectGrid.tsx`) and
|
|
129
|
+
`BulkActionDialog` already use, with the fallback passed as `defaultValue`.
|
|
130
|
+
Covered by a new regression test, confirmed to fail against the old code.
|
|
131
|
+
|
|
132
|
+
The rest are type-only corrections that preserve runtime behaviour exactly:
|
|
133
|
+
|
|
134
|
+
- **plugin-grid** `importParsers.ts` — `scorePair`'s `score`/`reason` moved into
|
|
135
|
+
one `best` record. They were captured `let`s mutated only inside the `bump`
|
|
136
|
+
closure, which TypeScript's control-flow analysis does not track, so it still
|
|
137
|
+
believed `reason` was `'none'` at the type gate and flagged the comparisons as
|
|
138
|
+
non-overlapping (TS2367). The gate — which stops a text column being mapped
|
|
139
|
+
onto a number field — is unchanged; its two dedicated tests still pass.
|
|
140
|
+
- **plugin-form** — `SectionFieldsContext.fieldLabel` now requires `fallback`,
|
|
141
|
+
matching the `useSafeFieldLabel` producer in `@object-ui/i18n` (an omitted
|
|
142
|
+
fallback could not satisfy the `=> string` return, and all four call sites
|
|
143
|
+
already pass one). This one signature cleared six errors.
|
|
144
|
+
`MasterDetailFormSchema.recordId` widens to `string | number`, matching
|
|
145
|
+
`ObjectFormSchema` and the five envelopes that forward straight into it;
|
|
146
|
+
it is narrowed with `String()` only at the batch-transaction boundary, whose
|
|
147
|
+
`BatchTransactionOperation.id` is a string by protocol (the `isEdit` guard
|
|
148
|
+
already proves it non-null there). `deriveMasterDetail`'s column sort gets an
|
|
149
|
+
explicit `fillPriority` helper — `GridColumn.type` is optional, and a column
|
|
150
|
+
without one keeps sorting at priority 5 exactly as the old
|
|
151
|
+
`TYPE_FILL_PRIORITY[undefined] ?? 5` lookup put it.
|
|
152
|
+
- **plugin-designer** — unused `index` parameter prefixed `_`, matching the
|
|
153
|
+
`_entry` beside it.
|
|
154
|
+
- **cli** — a stale `@ts-expect-error` removed; `viteConfig` is typed `any`, so
|
|
155
|
+
the line it guarded had stopped erroring.
|
|
156
|
+
- **vscode-extension** (`object-ui`) — migrated off `moduleResolution: "node"`,
|
|
157
|
+
which is deprecated and stops working in TypeScript 7, to `node16` paired with
|
|
158
|
+
`module: "node16"` (the package has no `"type": "module"`, so node16 resolves
|
|
159
|
+
it as the CommonJS that tsup emits, and it gains the `exports`-map awareness
|
|
160
|
+
node10 lacks). Its error count was under-reported as 1: that TS5107 config
|
|
161
|
+
error masked four more. The package uses `console`/`Buffer` but sets
|
|
162
|
+
`lib: ["ES2020"]` with no DOM and never declared `@types/node` — added, with an
|
|
163
|
+
explicit `types: ["node", "vscode"]`.
|
|
164
|
+
|
|
165
|
+
Also: `plugin-grid`, `plugin-form` and `plugin-designer` gain the `baseUrl` +
|
|
166
|
+
`paths` override their type-checked plugin peers already carry, and `cli` an
|
|
167
|
+
empty `paths`. Without it the inherited root `paths` point `@object-ui/*` at
|
|
168
|
+
sibling `src/`, which is outside each project's `rootDir` and produces the ~104
|
|
169
|
+
spurious TS6059 errors noted in #2915; workspace deps instead resolve through
|
|
170
|
+
node_modules to built `.d.ts`, which `type-check`'s `dependsOn: ["^build"]`
|
|
171
|
+
guarantees exist.
|
|
172
|
+
|
|
173
|
+
Verified the gate genuinely covers all five rather than trusting the green:
|
|
174
|
+
injecting a type error into each package makes `pnpm type-check --filter <pkg>`
|
|
175
|
+
fail, which was impossible before this change.
|
|
176
|
+
|
|
177
|
+
- Updated dependencies [7b21891]
|
|
178
|
+
- Updated dependencies [952b978]
|
|
179
|
+
- Updated dependencies [de5e40c]
|
|
180
|
+
- Updated dependencies [1767124]
|
|
181
|
+
- Updated dependencies [8ecf5a6]
|
|
182
|
+
- Updated dependencies [7b35e4b]
|
|
183
|
+
- Updated dependencies [8fb1295]
|
|
184
|
+
- Updated dependencies [dfd3705]
|
|
185
|
+
- Updated dependencies [c77108c]
|
|
186
|
+
- Updated dependencies [c19ac11]
|
|
187
|
+
- Updated dependencies [6dee2cb]
|
|
188
|
+
- Updated dependencies [c7cff19]
|
|
189
|
+
- Updated dependencies [cd09a7b]
|
|
190
|
+
- Updated dependencies [f1abf0e]
|
|
191
|
+
- Updated dependencies [f05b84e]
|
|
192
|
+
- Updated dependencies [2f947e4]
|
|
193
|
+
- Updated dependencies [7d46648]
|
|
194
|
+
- Updated dependencies [9b53d72]
|
|
195
|
+
- Updated dependencies [662bdf9]
|
|
196
|
+
- Updated dependencies [059a052]
|
|
197
|
+
- Updated dependencies [53642d4]
|
|
198
|
+
- Updated dependencies [8aae006]
|
|
199
|
+
- Updated dependencies [c6cfdf1]
|
|
200
|
+
- Updated dependencies [d147a13]
|
|
201
|
+
- Updated dependencies [c6aaed8]
|
|
202
|
+
- Updated dependencies [dc334da]
|
|
203
|
+
- @object-ui/components@17.0.0
|
|
204
|
+
- @object-ui/react@17.0.0
|
|
205
|
+
- @object-ui/types@17.0.0
|
|
206
|
+
|
|
3
207
|
## 16.1.0
|
|
4
208
|
|
|
5
209
|
### Patch Changes
|
package/dist/cli.js
CHANGED
|
@@ -721,6 +721,37 @@ import { readFileSync as readFileSync3, existsSync as existsSync9 } from "fs";
|
|
|
721
721
|
import { resolve as resolve5 } from "path";
|
|
722
722
|
import { load as loadYaml } from "js-yaml";
|
|
723
723
|
import { safeValidateSchema } from "@object-ui/types/zod";
|
|
724
|
+
|
|
725
|
+
// src/utils/spec-vocabulary-hint.ts
|
|
726
|
+
function findSpecVocabularyFormFields(node, path = "") {
|
|
727
|
+
if (Array.isArray(node)) {
|
|
728
|
+
return node.flatMap((child, i) => findSpecVocabularyFormFields(child, `${path}[${i}]`));
|
|
729
|
+
}
|
|
730
|
+
if (node === null || typeof node !== "object") return [];
|
|
731
|
+
const record = node;
|
|
732
|
+
const findings = [];
|
|
733
|
+
if (record.type === "form" && Array.isArray(record.fields)) {
|
|
734
|
+
record.fields.forEach((f, i) => {
|
|
735
|
+
if (f && typeof f === "object" && typeof f.field === "string") {
|
|
736
|
+
const name = f.name;
|
|
737
|
+
findings.push({
|
|
738
|
+
path: `${path ? `${path}.` : ""}fields[${i}]`,
|
|
739
|
+
field: f.field,
|
|
740
|
+
...typeof name === "string" ? { mixedName: name } : {}
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
for (const [key, value] of Object.entries(record)) {
|
|
746
|
+
if (record.type === "form" && key === "fields") continue;
|
|
747
|
+
findings.push(
|
|
748
|
+
...findSpecVocabularyFormFields(value, path ? `${path}.${key}` : key)
|
|
749
|
+
);
|
|
750
|
+
}
|
|
751
|
+
return findings;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
// src/commands/validate.ts
|
|
724
755
|
async function validate(schemaPath) {
|
|
725
756
|
console.log(chalk11.blue("\u{1F50D} ObjectUI Schema Validator\n"));
|
|
726
757
|
const resolvedPath = resolve5(process.cwd(), schemaPath);
|
|
@@ -762,22 +793,45 @@ async function validate(schemaPath) {
|
|
|
762
793
|
if (data.children && Array.isArray(data.children)) {
|
|
763
794
|
console.log(chalk11.gray(" Children:"), data.children.length);
|
|
764
795
|
}
|
|
796
|
+
const mixed = findSpecVocabularyFormFields(schema).filter((f) => f.mixedName);
|
|
797
|
+
if (mixed.length > 0) {
|
|
798
|
+
console.log(chalk11.yellow("\nWarnings:"));
|
|
799
|
+
for (const m of mixed) {
|
|
800
|
+
console.log(chalk11.yellow(
|
|
801
|
+
` ${m.path}: '${m.mixedName}' also carries { field: '${m.field}' } \u2014 mixed form-field vocabularies. The renderer ignores \`field\` here; drop one of the two.`
|
|
802
|
+
));
|
|
803
|
+
}
|
|
804
|
+
}
|
|
765
805
|
console.log("");
|
|
766
806
|
process.exit(0);
|
|
767
807
|
} else {
|
|
768
808
|
console.error(chalk11.red("\u2717 Schema validation failed!\n"));
|
|
769
809
|
console.error(chalk11.bold("Validation Errors:"));
|
|
770
|
-
|
|
771
|
-
errors.forEach((error, index) => {
|
|
810
|
+
result.error.issues.forEach((issue, index) => {
|
|
772
811
|
console.error(chalk11.red(`
|
|
773
|
-
${index + 1}. ${
|
|
774
|
-
if (
|
|
775
|
-
console.error(chalk11.gray(` Path: ${
|
|
812
|
+
${index + 1}. ${issue.message}`));
|
|
813
|
+
if (issue.path && issue.path.length > 0) {
|
|
814
|
+
console.error(chalk11.gray(` Path: ${issue.path.join(" \u2192 ")}`));
|
|
776
815
|
}
|
|
777
|
-
if (
|
|
778
|
-
console.error(chalk11.gray(` Code: ${
|
|
816
|
+
if (issue.code) {
|
|
817
|
+
console.error(chalk11.gray(` Code: ${issue.code}`));
|
|
779
818
|
}
|
|
780
819
|
});
|
|
820
|
+
const specShaped = findSpecVocabularyFormFields(schema).filter((f) => !f.mixedName);
|
|
821
|
+
if (specShaped.length > 0) {
|
|
822
|
+
console.error(chalk11.bold("\nLikely cause \u2014 spec form-view vocabulary in a standalone form:"));
|
|
823
|
+
for (const s of specShaped) {
|
|
824
|
+
console.error(chalk11.yellow(
|
|
825
|
+
` ${s.path}: { field: '${s.field}' } is the spec form-VIEW shape (an object-field reference).`
|
|
826
|
+
));
|
|
827
|
+
}
|
|
828
|
+
console.error(chalk11.yellow(
|
|
829
|
+
` A standalone \`type: 'form'\` component uses { name: \u2026 } (the form data path).
|
|
830
|
+
Fix: author the field with \`name\` and its own type/label \u2014 or, to reference object fields
|
|
831
|
+
with the spec shape, use an object-bound form (\`type: 'object-form'\` with objectName +
|
|
832
|
+
sections), whose section fields are translated by the renderer.`
|
|
833
|
+
));
|
|
834
|
+
}
|
|
781
835
|
console.error("");
|
|
782
836
|
process.exit(1);
|
|
783
837
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts","../src/commands/dev.ts","../src/commands/build.ts","../src/commands/start.ts","../src/commands/lint.ts","../src/commands/test.ts","../src/commands/generate.ts","../src/commands/doctor.ts","../src/commands/add.ts","../src/commands/studio.ts","../src/commands/check.ts","../src/commands/validate.ts","../src/commands/create-plugin.ts","../src/commands/analyze.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { serve } from './commands/serve.js';\nimport { init } from './commands/init.js';\nimport { dev } from './commands/dev.js';\nimport { buildApp } from './commands/build.js';\nimport { start } from './commands/start.js';\nimport { lint } from './commands/lint.js';\nimport { test } from './commands/test.js';\nimport { generate } from './commands/generate.js';\nimport { doctor } from './commands/doctor.js';\nimport { add } from './commands/add.js';\nimport { studio } from './commands/studio.js';\nimport { check } from './commands/check.js';\nimport { validate } from './commands/validate.js';\nimport { createPlugin } from './commands/create-plugin.js';\nimport { analyze } from './commands/analyze.js';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Read package.json for version\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('objectui')\n .description('CLI tool for Object UI - Build applications from JSON schemas')\n .version(packageJson.version);\n\nprogram\n .command('serve')\n .description('Start a development server with your JSON/YAML schema')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .action(async (schema, options) => {\n try {\n await serve(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('dev')\n .description('Start development server (alias for serve)')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await dev(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('build')\n .description('Build application for production')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-o, --out-dir <dir>', 'Output directory', 'dist')\n .option('--clean', 'Clean output directory before build', false)\n .action(async (schema, options) => {\n try {\n await buildApp(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('start')\n .description('Start production server')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', '0.0.0.0')\n .option('-d, --dir <dir>', 'Directory to serve', 'dist')\n .action(async (options) => {\n try {\n await start(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('init')\n .description('Initialize a new Object UI application with sample schema')\n .argument('[name]', 'Application name', 'my-app')\n .option('-t, --template <template>', 'Template to use (dashboard, form, simple)', 'dashboard')\n .action(async (name, options) => {\n try {\n await init(name, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('lint')\n .description('Lint the generated application code')\n .option('--fix', 'Automatically fix linting issues')\n .action(async (options) => {\n try {\n await lint(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('test')\n .description('Run tests for the application')\n .option('-w, --watch', 'Run tests in watch mode')\n .option('-c, --coverage', 'Generate test coverage report')\n .option('--ui', 'Run tests with Vitest UI')\n .action(async (options) => {\n try {\n await test(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .alias('g')\n .description('Generate new resources (objects, pages, plugins)')\n .argument('<type>', 'Type of resource to generate (resource/object, page, plugin)')\n .argument('<name>', 'Name of the resource')\n .option('--from <source>', 'Generate schema from external source (openapi.yaml, prisma.schema)')\n .option('--output <dir>', 'Output directory for generated schemas', 'schemas/')\n .action(async (type, name, options) => {\n try {\n // Handle schema generation from external sources\n if (options.from) {\n console.log(chalk.yellow('\\n⚠ Schema generation from external sources (OpenAPI/Prisma) is not yet implemented.'));\n console.log(chalk.gray('This feature will be available in a future release.\\n'));\n process.exit(0);\n }\n \n await generate(type, name);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('doctor')\n .description('Diagnose and fix common issues')\n .action(async () => {\n try {\n await doctor();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('add')\n .description('Add a new component renderer to your project')\n .argument('<component>', 'Component name (e.g. Input, Grid)')\n .action(async (component) => {\n try {\n await add(component);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('studio')\n .description('Start the visual designer')\n .action(async () => {\n try {\n await studio();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('check')\n .description('Validate schema files')\n .action(async () => {\n try {\n await check();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate a schema file against ObjectUI specifications')\n .argument('[schema]', 'Path to schema file (JSON or YAML)', 'app.json')\n .action(async (schema) => {\n try {\n await validate(schema);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('create')\n .description('Create new resources')\n .argument('<type>', 'Type of resource to create (plugin)')\n .argument('<name>', 'Name of the resource')\n .action(async (type, name) => {\n try {\n if (type === 'plugin') {\n await createPlugin(name);\n } else {\n console.error(chalk.red(`Unknown resource type: ${type}`));\n console.log(chalk.gray('Available types: plugin'));\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('analyze')\n .description('Analyze application performance')\n .option('--bundle-size', 'Analyze bundle size')\n .option('--render-performance', 'Analyze render performance')\n .action(async (options) => {\n try {\n await analyze(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\n\nprogram.parse();\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { createServer } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, unlinkSync, statSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createRequire } from 'module';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface DevOptions {\n port: string;\n host: string;\n open?: boolean;\n}\n\nexport async function dev(schemaPath: string, options: DevOptions) {\n const cwd = process.cwd();\n \n // Resolve the actual project root and schema file\n let _projectRoot = cwd;\n const targetSchemaPath = schemaPath;\n let hasPagesDir = false;\n let pagesDir = '';\n let appConfig: unknown = null;\n\n // 1. Determine Project Root & Mode\n const absoluteSchemaPath = resolve(cwd, schemaPath);\n \n if (existsSync(absoluteSchemaPath) && statSync(absoluteSchemaPath).isFile()) {\n // If input is a file (e.g. examples/showcase/app.json)\n const fileDir = dirname(absoluteSchemaPath);\n const potentialPagesDir = join(fileDir, 'pages');\n\n if (existsSync(potentialPagesDir)) {\n console.log(chalk.blue(`📂 Detected project structure at ${fileDir}`));\n _projectRoot = fileDir;\n hasPagesDir = true;\n pagesDir = potentialPagesDir;\n \n // Try to load app.json as config\n try {\n appConfig = parseSchemaFile(absoluteSchemaPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app config');\n }\n }\n } \n \n // Fallback: Check detect pages dir in current cwd if not found above\n if (!hasPagesDir) {\n const localPagesDir = join(cwd, 'pages');\n if (existsSync(localPagesDir)) {\n hasPagesDir = true;\n pagesDir = localPagesDir;\n // Try to find and load app.json in cwd\n const appJsonPath = join(cwd, 'app.json');\n if (existsSync(appJsonPath)) {\n try {\n appConfig = parseSchemaFile(appJsonPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app.json config');\n }\n }\n }\n }\n\n const require = createRequire(join(cwd, 'package.json'));\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue(`📁 Using file-system routing from ${pagesDir}`));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error(`No schema files found in ${pagesDir}`);\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n routes.forEach(route => {\n console.log(chalk.dim(` ${route.path} → ${route.filePath.replace(cwd, '.')}`));\n });\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n // ... (rest of the logic)\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n try {\n schema = parseSchemaFile(fullSchemaPath);\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Invalid schema file: ${error instanceof Error ? error.message : error}`);\n }\n }\n\n // Create temporary app directory (always in cwd to keep node_modules access)\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes, appConfig);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n\n // Install dependencies\n const isMonorepo = existsSync(join(cwd, 'pnpm-workspace.yaml'));\n \n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - using root node_modules'));\n } else {\n console.log(chalk.blue('📦 Installing dependencies...'));\n console.log(chalk.dim(' This may take a moment on first run...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'inherit',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n }\n\n console.log(chalk.green('✓ Schema loaded successfully'));\n console.log(chalk.blue('🚀 Starting development server...\\n'));\n\n // Create Vite config\n const viteConfig: any = {\n root: tmpDir,\n server: {\n port: parseInt(options.port),\n host: options.host,\n open: options.open !== false,\n fs: {\n // Allow serving files from workspace root\n allow: [cwd],\n }\n },\n resolve: {\n alias: {}\n },\n plugins: [react()],\n };\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n \n // Remove postcss.config.js to prevent interference with programmatic config\n const postcssPath = join(tmpDir, 'postcss.config.js');\n if (existsSync(postcssPath)) {\n unlinkSync(postcssPath);\n }\n\n // Add aliases for workspace packages\n viteConfig.resolve.alias = {\n '@object-ui/react': join(cwd, 'packages/react/src/index.ts'),\n '@object-ui/components': join(cwd, 'packages/components/src/index.ts'),\n '@object-ui/core': join(cwd, 'packages/core/src/index.ts'),\n '@object-ui/types': join(cwd, 'packages/types/src/index.ts'),\n '@object-ui/plugin-charts': join(cwd, 'packages/plugin-charts/src/index.tsx'),\n '@object-ui/plugin-editor': join(cwd, 'packages/plugin-editor/src/index.tsx'),\n '@object-ui/plugin-kanban': join(cwd, 'packages/plugin-kanban/src/index.tsx'),\n '@object-ui/plugin-markdown': join(cwd, 'packages/plugin-markdown/src/index.tsx'),\n '@object-ui/plugin-form': join(cwd, 'packages/plugin-form/src/index.tsx'),\n '@object-ui/plugin-grid': join(cwd, 'packages/plugin-grid/src/index.tsx'),\n '@object-ui/plugin-view': join(cwd, 'packages/plugin-view/src/index.tsx'),\n };\n\n // Fix: Resolve lucide-react from components package to avoid \"dependency not found\" in temp app\n try {\n // Trying to find lucide-react in the components' node_modules or hoist\n // checking specifically in packages/components context\n const lucidePath = require.resolve('lucide-react', { paths: [join(cwd, 'packages/components')] });\n // We might get the cjs entry, but for aliasing usually fine. \n // Better yet, if we can find the package root, but require.resolve gives file.\n // Let's just use what require.resolve gives.\n // @ts-expect-error - lucidePath is dynamically resolved\n viteConfig.resolve.alias['lucide-react'] = lucidePath;\n } catch (e) {\n console.warn('⚠️ Could not resolve lucide-react automatically:', e);\n }\n \n // Debug aliases\n // console.log('Aliases:', viteConfig.resolve.alias);\n\n // Configure PostCSS programmatically reusing root dependencies\n try {\n const tailwindcss = require('tailwindcss');\n const autoprefixer = require('autoprefixer');\n \n viteConfig.css = {\n postcss: {\n plugins: [\n tailwindcss(join(tmpDir, 'tailwind.config.js')),\n autoprefixer(),\n ],\n },\n };\n } catch (_e) {\n console.warn(chalk.yellow('⚠️ Failed to load PostCSS plugins from root node_modules. Styles might not work correctly.'));\n }\n }\n\n // Create Vite server\n const server = await createServer(viteConfig);\n\n await server.listen();\n\n const { port, host } = server.config.server;\n const protocol = server.config.server.https ? 'https' : 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log();\n console.log(chalk.green('✓ Development server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { build as viteBuild } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, cpSync, rmSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface BuildOptions {\n outDir?: string;\n clean?: boolean;\n}\n\nexport async function buildApp(schemaPath: string, options: BuildOptions) {\n const cwd = process.cwd();\n const outDir = options.outDir || 'dist';\n const outputPath = resolve(cwd, outDir);\n \n console.log(chalk.blue('🔨 Building application for production...'));\n console.log();\n \n // Check if pages directory exists for file-system routing\n const pagesDir = join(cwd, 'pages');\n const hasPagesDir = existsSync(pagesDir);\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue('📁 Using file-system routing'));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error('No schema files found in pages/ directory');\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n\n // Check if schema file exists\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n\n // Read and validate schema\n try {\n schema = parseSchemaFile(fullSchemaPath);\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Invalid schema file: ${error instanceof Error ? error.message : error}`);\n }\n }\n\n // Create temporary app directory\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n // Install dependencies\n console.log(chalk.blue('📦 Installing dependencies...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'pipe',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n\n console.log(chalk.blue('⚙️ Building with Vite...'));\n console.log();\n\n // Clean output directory if requested\n if (options.clean && existsSync(outputPath)) {\n console.log(chalk.dim(` Cleaning ${outDir}/ directory...`));\n rmSync(outputPath, { recursive: true, force: true });\n }\n\n // Build with Vite\n try {\n await viteBuild({\n root: tmpDir,\n build: {\n outDir: join(tmpDir, 'dist'),\n emptyOutDir: true,\n reportCompressedSize: true,\n },\n plugins: [react()],\n logLevel: 'info',\n });\n\n // Copy built files to output directory\n mkdirSync(outputPath, { recursive: true });\n cpSync(join(tmpDir, 'dist'), outputPath, { recursive: true });\n\n console.log();\n console.log(chalk.green('✓ Build completed successfully!'));\n console.log();\n console.log(chalk.bold(' Output: ') + chalk.cyan(outDir + '/'));\n console.log();\n console.log(chalk.dim(' To serve the production build, run:'));\n console.log(chalk.cyan(` objectui start --dir ${outDir}`));\n console.log();\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Build failed: ${error instanceof Error ? error.message : error}`);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport express from 'express';\nimport rateLimit from 'express-rate-limit';\nimport { existsSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\n\ninterface StartOptions {\n port: string;\n host: string;\n dir?: string;\n}\n\nexport async function start(options: StartOptions) {\n const cwd = process.cwd();\n const distDir = options.dir || 'dist';\n const distPath = resolve(cwd, distDir);\n\n // Check if dist directory exists\n if (!existsSync(distPath)) {\n throw new Error(\n `Build directory not found: ${distDir}\\n` +\n `Run 'objectui build' first to create a production build.`\n );\n }\n\n // Check if index.html exists\n const indexPath = join(distPath, 'index.html');\n if (!existsSync(indexPath)) {\n throw new Error(\n `index.html not found in ${distDir}/\\n` +\n `Make sure you have a valid production build.`\n );\n }\n\n console.log(chalk.blue('🚀 Starting production server...\\n'));\n\n const app = express();\n const port = parseInt(options.port);\n const host = options.host;\n\n // Configure rate limiting to prevent abuse\n const limiter = rateLimit({\n windowMs: 15 * 60 * 1000, // 15 minutes\n max: 1000, // Limit each IP to 1000 requests per windowMs\n message: 'Too many requests from this IP, please try again later.',\n standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers\n legacyHeaders: false, // Disable the `X-RateLimit-*` headers\n });\n\n // Apply rate limiting to all routes\n app.use(limiter);\n\n // Serve static files from dist directory\n app.use(express.static(distPath));\n\n // SPA fallback - serve index.html for all routes\n app.get('*', (_req, res) => {\n res.sendFile(indexPath);\n });\n\n // Start server\n app.listen(port, host, () => {\n const protocol = 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log(chalk.green('✓ Production server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log(chalk.bold(' Serving: ') + chalk.dim(distDir + '/'));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n });\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface LintOptions {\n fix?: boolean;\n}\n\nexport async function lint(options: LintOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🔍 Running linter...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n const fixFlag = options.fix ? '--fix' : '';\n const command = `npx eslint \"src/**/*.{js,jsx,ts,tsx}\" ${fixFlag}`.trim();\n \n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n console.log();\n console.log(chalk.green('✓ Linting completed successfully!'));\n console.log();\n } catch {\n // ESLint returns non-zero exit code when there are linting errors\n console.log();\n console.log(chalk.yellow('⚠ Linting found issues.'));\n if (!options.fix) {\n console.log(chalk.dim(' Run \\'objectui lint --fix\\' to automatically fix some issues.'));\n }\n console.log();\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface TestOptions {\n watch?: boolean;\n coverage?: boolean;\n ui?: boolean;\n}\n\nexport async function test(options: TestOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🧪 Running tests...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n let command = 'npx vitest';\n \n if (options.watch) {\n command += ' --watch';\n } else if (options.ui) {\n command += ' --ui';\n } else {\n command += ' run';\n }\n\n if (options.coverage) {\n command += ' --coverage';\n }\n\n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n if (!options.watch && !options.ui) {\n console.log();\n console.log(chalk.green('✓ Tests completed successfully!'));\n console.log();\n }\n } catch {\n // Vitest returns non-zero exit code when tests fail\n console.log();\n console.log(chalk.red('✗ Some tests failed.'));\n console.log();\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function generate(type: string, name: string) {\n const cwd = process.cwd();\n\n switch (type) {\n case 'resource':\n case 'object':\n generateResource(cwd, name);\n break;\n case 'page':\n generatePage(cwd, name);\n break;\n case 'plugin':\n generatePlugin(cwd, name);\n break;\n default:\n console.log(chalk.red(`Unknown type: ${type}`));\n console.log(`Available types: resource, page, plugin`);\n process.exit(1);\n }\n}\n\nfunction generateResource(cwd: string, name: string) {\n const dir = join(cwd, 'objects');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Object ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n name: name,\n fields: {\n name: { type: 'text', label: 'Name', required: true }\n }\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated resource schema: ${filePath}`));\n}\n\nfunction generatePage(cwd: string, name: string) {\n const dir = join(cwd, 'pages');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Page ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n type: \"page\",\n title: name,\n body: [\n {\n type: \"markdown\",\n content: `# Welcome to ${name}`\n }\n ]\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated page schema: ${filePath}`));\n}\n\nfunction generatePlugin(cwd: string, name: string) {\n const dir = join(cwd, 'plugins', name);\n if (existsSync(dir)) {\n console.log(chalk.yellow(`Plugin ${name} already exists`));\n return;\n }\n mkdirSync(dir, { recursive: true });\n\n const content = `\nexport const ${name}Plugin = {\n name: '${name}',\n install(app) {\n console.log('${name} plugin installed');\n }\n};\n`;\n\n writeFileSync(join(dir, 'index.ts'), content.trim());\n console.log(chalk.green(`✓ Generated plugin: ${dir}`));\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function doctor() {\n console.log(chalk.bold('Object UI Doctor'));\n console.log('Diagnosis in progress...\\n');\n \n const cwd = process.cwd();\n let issues = 0;\n\n // 1. Check package.json\n const pkgPath = join(cwd, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n \n // Check React version\n const reactVer = pkg.dependencies?.react || pkg.devDependencies?.react;\n if (reactVer) {\n console.log(chalk.green('✓ React installed'));\n } else {\n console.log(chalk.yellow('⚠️ React not found in dependencies'));\n issues++;\n }\n\n // Check Tailwind\n const tailwindVer = pkg.dependencies?.tailwindcss || pkg.devDependencies?.tailwindcss;\n if (tailwindVer) {\n console.log(chalk.green('✓ Tailwind CSS installed'));\n } else {\n console.log(chalk.yellow('⚠️ Tailwind CSS not found'));\n issues++;\n }\n } catch (e) {\n console.log(chalk.red('x Failed to read package.json'));\n issues++;\n }\n } else {\n console.log(chalk.red('x package.json not found'));\n issues++;\n }\n\n // 2. Check tailwind.config.js\n const tailwindConfigPath = join(cwd, 'tailwind.config.js');\n const tailwindTsPath = join(cwd, 'tailwind.config.ts');\n if (existsSync(tailwindConfigPath) || existsSync(tailwindTsPath)) {\n const configFile = existsSync(tailwindConfigPath) ? 'tailwind.config.js' : 'tailwind.config.ts';\n const configPath = existsSync(tailwindConfigPath) ? tailwindConfigPath : tailwindTsPath;\n console.log(chalk.green(`✓ ${configFile} found`));\n // Check content configuration\n try {\n const configContent = readFileSync(configPath, 'utf-8');\n if (configContent.includes('content') && (configContent.includes('./src') || configContent.includes('./app') || configContent.includes('./pages'))) {\n console.log(chalk.green('✓ Tailwind content paths configured'));\n } else {\n console.log(chalk.yellow('⚠️ Tailwind content paths may not be configured. Ensure your content array includes source directories.'));\n issues++;\n }\n } catch (_e) {\n // File exists but can't be read - not critical\n }\n } else {\n console.log(chalk.yellow('⚠️ tailwind.config.js not found'));\n issues++;\n }\n\n // 3. Check TypeScript version\n const tsConfigPath = join(cwd, 'tsconfig.json');\n if (existsSync(tsConfigPath)) {\n console.log(chalk.green('✓ tsconfig.json found'));\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const tsVer = pkg.devDependencies?.typescript || pkg.dependencies?.typescript;\n if (tsVer) {\n const majorVer = parseInt(tsVer.replace(/[^0-9.]/g, '').split('.')[0], 10);\n if (majorVer >= 5) {\n console.log(chalk.green(`✓ TypeScript ${tsVer} (5.0+ required)`));\n } else {\n console.log(chalk.yellow(`⚠️ TypeScript ${tsVer} detected — version 5.0+ recommended`));\n issues++;\n }\n }\n } catch (_e) {\n // Already checked package.json above\n }\n } else {\n console.log(chalk.yellow('⚠️ tsconfig.json not found'));\n issues++;\n }\n\n // 4. Check peer dependencies\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };\n \n // Check for common peer dependency issues\n if (allDeps['@object-ui/react'] && !allDeps['react']) {\n console.log(chalk.yellow('⚠️ @object-ui/react requires react as a peer dependency'));\n issues++;\n }\n if (allDeps['@object-ui/components'] && !allDeps['tailwindcss']) {\n console.log(chalk.yellow('⚠️ @object-ui/components requires tailwindcss as a peer dependency'));\n issues++;\n }\n } catch (_e) {\n // Already handled\n }\n }\n\n // Summary\n console.log('\\nResult:');\n if (issues === 0) {\n console.log(chalk.green('Everything looks good! ✨'));\n } else {\n console.log(chalk.yellow(`Found ${issues} issue(s).`));\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function add(component: string) {\n console.log(chalk.bold(`Object UI Add: ${component}`));\n console.log(chalk.yellow('Feature not implemented yet.'));\n console.log(`This command will download the source code for ${component}Renderer to your project.`);\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nexport async function studio() {\n console.log(chalk.bold('\\n🎨 Starting ObjectUI Studio...\\n'));\n\n const cwd = process.cwd();\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n\n // Resolve the console app directory\n // 1. Check monorepo structure (apps/console)\n // 2. Check relative path (../../apps/console from packages/cli)\n const candidates = [\n join(cwd, 'apps/console'),\n resolve(__dirname, '../../apps/console'),\n resolve(__dirname, '../../../apps/console'),\n ];\n\n let consolePath: string | null = null;\n for (const candidate of candidates) {\n if (existsSync(join(candidate, 'package.json'))) {\n consolePath = candidate;\n break;\n }\n }\n\n if (!consolePath) {\n console.log(chalk.yellow('⚠ Console app not found in workspace.'));\n console.log(chalk.dim(' Hint: Run this command from the monorepo root.'));\n console.log(chalk.dim(' Expected: apps/console/package.json\\n'));\n process.exit(1);\n }\n\n console.log(chalk.dim(` Console: ${consolePath}`));\n console.log(chalk.dim(' Mode: MSW (in-browser mock server)\\n'));\n\n // Delegate to the console's dev script which starts Vite + MSW\n const child = spawn('pnpm', ['run', 'dev'], {\n cwd: consolePath,\n stdio: 'inherit',\n env: { ...process.env, NODE_ENV: 'development' },\n shell: true,\n });\n\n child.on('error', (err) => {\n console.error(chalk.red(`\\n ✗ Failed to start studio: ${err.message}`));\n process.exit(1);\n });\n\n child.on('exit', (code) => process.exit(code ?? 0));\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { globSync } from 'glob';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function check() {\n console.log(chalk.bold('Object UI Schema Check'));\n const cwd = process.cwd();\n \n // 1. Find all JSON/YAML files\n const files = globSync('**/*.{json,yaml,yml}', { \n cwd, \n ignore: ['node_modules/**', 'dist/**', '.git/**'] \n });\n \n console.log(`Analyzing ${files.length} files...`);\n \n let errors = 0;\n \n for (const file of files) {\n try {\n // Basic JSON parsing check\n if (file.endsWith('.json')) {\n const content = JSON.parse(readFileSync(join(cwd, file), 'utf-8'));\n // Schema validation: check for ObjectUI schema patterns\n if (content && typeof content === 'object' && content.type) {\n const knownTypes = [\n 'page', 'form', 'grid', 'crud', 'kanban', 'calendar', 'dashboard',\n 'chart', 'detail', 'list', 'timeline', 'gantt', 'map', 'gallery',\n 'object-view', 'detail-view', 'object-chart',\n ];\n if (typeof content.type === 'string' && !knownTypes.includes(content.type)) {\n console.log(chalk.yellow(`⚠️ Unknown schema type \"${content.type}\" in ${file}`));\n }\n }\n }\n } catch (e) {\n console.log(chalk.red(`x Invalid JSON in ${file}: ${(e as Error).message}`));\n errors++;\n }\n }\n \n if (errors === 0) {\n console.log(chalk.green('✓ All checks passed'));\n } else {\n console.log(chalk.red(`Found ${errors} errors`));\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { readFileSync, existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { load as loadYaml } from 'js-yaml';\nimport { safeValidateSchema } from '@object-ui/types/zod';\n\n/**\n * Validate a schema file\n * \n * @param schemaPath - Path to the schema file (JSON or YAML)\n */\nexport async function validate(schemaPath: string) {\n console.log(chalk.blue('🔍 ObjectUI Schema Validator\\n'));\n\n // Resolve the schema path\n const resolvedPath = resolve(process.cwd(), schemaPath);\n\n // Check if file exists\n if (!existsSync(resolvedPath)) {\n console.error(chalk.red(`✗ Error: Schema file not found: ${schemaPath}`));\n process.exit(1);\n }\n\n try {\n // Read the file\n const fileContent = readFileSync(resolvedPath, 'utf-8');\n let schema: unknown;\n\n // Parse based on file extension\n if (schemaPath.endsWith('.yaml') || schemaPath.endsWith('.yml')) {\n console.log(chalk.gray(`Reading YAML schema from: ${schemaPath}`));\n schema = loadYaml(fileContent);\n } else if (schemaPath.endsWith('.json')) {\n console.log(chalk.gray(`Reading JSON schema from: ${schemaPath}`));\n schema = JSON.parse(fileContent);\n } else {\n // Try JSON first, then YAML\n try {\n schema = JSON.parse(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as JSON)`));\n } catch {\n schema = loadYaml(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as YAML)`));\n }\n }\n\n // Validate the schema\n console.log(chalk.gray('Validating schema...\\n'));\n const result = safeValidateSchema(schema);\n\n if (result.success) {\n console.log(chalk.green('✓ Schema is valid!\\n'));\n \n // Show some info about the schema\n const data = result.data;\n console.log(chalk.bold('Schema Information:'));\n console.log(chalk.gray(' Type:'), data.type || 'unknown');\n \n if (data.id) {\n console.log(chalk.gray(' ID:'), data.id);\n }\n \n if (data.label || data.title) {\n console.log(chalk.gray(' Label:'), data.label || data.title);\n }\n \n // Count children if present\n if (data.children && Array.isArray(data.children)) {\n console.log(chalk.gray(' Children:'), data.children.length);\n }\n \n console.log('');\n process.exit(0);\n } else {\n console.error(chalk.red('✗ Schema validation failed!\\n'));\n console.error(chalk.bold('Validation Errors:'));\n \n // Format Zod errors nicely\n const errors = result.error.errors;\n errors.forEach((error, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${error.message}`));\n if (error.path && error.path.length > 0) {\n console.error(chalk.gray(` Path: ${error.path.join(' → ')}`));\n }\n if (error.code) {\n console.error(chalk.gray(` Code: ${error.code}`));\n }\n });\n \n console.error('');\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('\\n✗ Error reading or parsing schema file:'));\n console.error(chalk.red((error as Error).message));\n console.error('');\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Create a new plugin using the @object-ui/create-plugin package\n * \n * @param pluginName - Name of the plugin to create\n */\nexport async function createPlugin(pluginName: string) {\n console.log(chalk.blue('🚀 Creating ObjectUI plugin...\\n'));\n\n // Resolve the create-plugin script path\n const createPluginScript = resolve(\n __dirname,\n '../../../create-plugin/dist/index.js'\n );\n\n return new Promise<void>((resolve, reject) => {\n // Spawn the create-plugin command\n const child = spawn('node', [createPluginScript, pluginName], {\n stdio: 'inherit',\n shell: true,\n });\n\n child.on('error', (error) => {\n console.error(chalk.red('Failed to create plugin:'), error);\n reject(error);\n });\n\n child.on('exit', (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`create-plugin exited with code ${code}`));\n }\n });\n });\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, statSync, readdirSync } from 'fs';\nimport { resolve, join, extname } from 'path';\n\ninterface AnalyzeOptions {\n bundleSize?: boolean;\n renderPerformance?: boolean;\n}\n\n/**\n * Analyze bundle size by scanning dist directory\n */\nasync function analyzeBundleSize() {\n console.log(chalk.bold('\\n📦 Bundle Size Analysis\\n'));\n\n const distDir = resolve(process.cwd(), 'dist');\n \n if (!existsSync(distDir)) {\n console.log(chalk.yellow('⚠ No dist directory found. Run build first.'));\n return;\n }\n\n const files: Array<{ path: string; size: number }> = [];\n \n function scanDirectory(dir: string) {\n const items = readdirSync(dir);\n \n for (const item of items) {\n const fullPath = join(dir, item);\n const stat = statSync(fullPath);\n \n if (stat.isDirectory()) {\n scanDirectory(fullPath);\n } else {\n files.push({\n path: fullPath.replace(distDir + '/', ''),\n size: stat.size,\n });\n }\n }\n }\n \n scanDirectory(distDir);\n \n // Sort by size (largest first)\n files.sort((a, b) => b.size - a.size);\n \n // Calculate totals\n const totalSize = files.reduce((sum, file) => sum + file.size, 0);\n const jsFiles = files.filter(f => extname(f.path) === '.js');\n const cssFiles = files.filter(f => extname(f.path) === '.css');\n \n const jsSize = jsFiles.reduce((sum, file) => sum + file.size, 0);\n const cssSize = cssFiles.reduce((sum, file) => sum + file.size, 0);\n \n console.log(chalk.bold('Summary:'));\n console.log(chalk.gray(' Total Size:'), formatBytes(totalSize));\n console.log(chalk.gray(' JavaScript:'), formatBytes(jsSize), chalk.dim(`(${jsFiles.length} files)`));\n console.log(chalk.gray(' CSS: '), formatBytes(cssSize), chalk.dim(`(${cssFiles.length} files)`));\n console.log(chalk.gray(' Other: '), formatBytes(totalSize - jsSize - cssSize));\n \n console.log(chalk.bold('\\nLargest Files:'));\n files.slice(0, 10).forEach((file) => {\n const sizeStr = formatBytes(file.size).padStart(10);\n console.log(chalk.gray(` ${sizeStr}`), file.path);\n });\n \n // Bundle size recommendations\n console.log(chalk.bold('\\n💡 Recommendations:'));\n \n if (totalSize > 1024 * 1024) {\n console.log(chalk.yellow(' ⚠ Total bundle size is large (> 1MB)'));\n console.log(chalk.gray(' Consider code splitting or lazy loading'));\n }\n \n if (jsSize > 500 * 1024) {\n console.log(chalk.yellow(' ⚠ JavaScript bundle is large (> 500KB)'));\n console.log(chalk.gray(' Consider:'));\n console.log(chalk.gray(' - Tree shaking unused code'));\n console.log(chalk.gray(' - Lazy loading components'));\n console.log(chalk.gray(' - Using dynamic imports'));\n }\n \n if (files.length > 100) {\n console.log(chalk.yellow(` ⚠ Large number of files (${files.length})`));\n console.log(chalk.gray(' Consider bundling or combining files'));\n }\n \n console.log('');\n}\n\n/**\n * Analyze render performance (placeholder for now)\n */\nasync function analyzeRenderPerformance() {\n console.log(chalk.bold('\\n⚡ Render Performance Analysis\\n'));\n \n console.log(chalk.gray('Performance analysis features:'));\n console.log(chalk.gray(' ✓ Expression caching enabled'));\n console.log(chalk.gray(' ✓ Component memoization available'));\n console.log(chalk.gray(' ✓ Virtual scrolling support for large lists'));\n \n console.log(chalk.bold('\\n💡 Performance Tips:'));\n console.log(chalk.gray(' • Use virtual scrolling for lists > 100 items'));\n console.log(chalk.gray(' • Cache frequently evaluated expressions'));\n console.log(chalk.gray(' • Use React.memo for expensive components'));\n console.log(chalk.gray(' • Implement pagination for large datasets'));\n console.log(chalk.gray(' • Use code splitting for large apps'));\n \n console.log('');\n}\n\n/**\n * Format bytes to human-readable string\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n \n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n \n return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;\n}\n\n/**\n * Analyze application performance\n * \n * @param options - Analysis options\n */\nexport async function analyze(options: AnalyzeOptions = {}) {\n console.log(chalk.blue('🔍 ObjectUI Performance Analyzer\\n'));\n\n const runAll = !options.bundleSize && !options.renderPerformance;\n \n if (options.bundleSize || runAll) {\n await analyzeBundleSize();\n }\n \n if (options.renderPerformance || runAll) {\n await analyzeRenderPerformance();\n }\n \n console.log(chalk.green('✓ Analysis complete!\\n'));\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,YAAY,WAAW,YAAY,gBAAgB;AAC5D,SAAS,MAAM,SAAS,eAAe;AACvC,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAS9B,eA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B;AAAA,EACF,SAAS,OAAO;AACd,YAAQ,MAAMA,QAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,SAAS,EACjB,YAAY,iCAAiC,EAC7C,OAAO,iBAAiB,qBAAqB,EAC7C,OAAO,wBAAwB,4BAA4B,EAC3D,OAAO,OAAO,YAAY;AACzB,MAAI;AACF,UAAM,QAAQ,OAAO;AAAA,EACvB,SAAS,OAAO;AACd,YAAQ,MAAMA,QAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QAAQ,MAAM;","names":["chalk","require","react","existsSync","mkdirSync","join","resolve","chalk","execSync","resolve","chalk","join","existsSync","mkdirSync","execSync","react","existsSync","join","resolve","chalk","execSync","existsSync","join","chalk","execSync","existsSync","join","chalk","chalk","existsSync","mkdirSync","join","chalk","existsSync","join","chalk","chalk","existsSync","join","resolve","dirname","__filename","__dirname","chalk","readFileSync","join","chalk","readFileSync","existsSync","resolve","chalk","spawn","resolve","dirname","fileURLToPath","chalk","existsSync","statSync","resolve","join","readFileSync","fileURLToPath","dirname","join","__filename","__dirname","chalk"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/commands/dev.ts","../src/commands/build.ts","../src/commands/start.ts","../src/commands/lint.ts","../src/commands/test.ts","../src/commands/generate.ts","../src/commands/doctor.ts","../src/commands/add.ts","../src/commands/studio.ts","../src/commands/check.ts","../src/commands/validate.ts","../src/utils/spec-vocabulary-hint.ts","../src/commands/create-plugin.ts","../src/commands/analyze.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { serve } from './commands/serve.js';\nimport { init } from './commands/init.js';\nimport { dev } from './commands/dev.js';\nimport { buildApp } from './commands/build.js';\nimport { start } from './commands/start.js';\nimport { lint } from './commands/lint.js';\nimport { test } from './commands/test.js';\nimport { generate } from './commands/generate.js';\nimport { doctor } from './commands/doctor.js';\nimport { add } from './commands/add.js';\nimport { studio } from './commands/studio.js';\nimport { check } from './commands/check.js';\nimport { validate } from './commands/validate.js';\nimport { createPlugin } from './commands/create-plugin.js';\nimport { analyze } from './commands/analyze.js';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Read package.json for version\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('objectui')\n .description('CLI tool for Object UI - Build applications from JSON schemas')\n .version(packageJson.version);\n\nprogram\n .command('serve')\n .description('Start a development server with your JSON/YAML schema')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .action(async (schema, options) => {\n try {\n await serve(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('dev')\n .description('Start development server (alias for serve)')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await dev(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('build')\n .description('Build application for production')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-o, --out-dir <dir>', 'Output directory', 'dist')\n .option('--clean', 'Clean output directory before build', false)\n .action(async (schema, options) => {\n try {\n await buildApp(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('start')\n .description('Start production server')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', '0.0.0.0')\n .option('-d, --dir <dir>', 'Directory to serve', 'dist')\n .action(async (options) => {\n try {\n await start(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('init')\n .description('Initialize a new Object UI application with sample schema')\n .argument('[name]', 'Application name', 'my-app')\n .option('-t, --template <template>', 'Template to use (dashboard, form, simple)', 'dashboard')\n .action(async (name, options) => {\n try {\n await init(name, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('lint')\n .description('Lint the generated application code')\n .option('--fix', 'Automatically fix linting issues')\n .action(async (options) => {\n try {\n await lint(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('test')\n .description('Run tests for the application')\n .option('-w, --watch', 'Run tests in watch mode')\n .option('-c, --coverage', 'Generate test coverage report')\n .option('--ui', 'Run tests with Vitest UI')\n .action(async (options) => {\n try {\n await test(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .alias('g')\n .description('Generate new resources (objects, pages, plugins)')\n .argument('<type>', 'Type of resource to generate (resource/object, page, plugin)')\n .argument('<name>', 'Name of the resource')\n .option('--from <source>', 'Generate schema from external source (openapi.yaml, prisma.schema)')\n .option('--output <dir>', 'Output directory for generated schemas', 'schemas/')\n .action(async (type, name, options) => {\n try {\n // Handle schema generation from external sources\n if (options.from) {\n console.log(chalk.yellow('\\n⚠ Schema generation from external sources (OpenAPI/Prisma) is not yet implemented.'));\n console.log(chalk.gray('This feature will be available in a future release.\\n'));\n process.exit(0);\n }\n \n await generate(type, name);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('doctor')\n .description('Diagnose and fix common issues')\n .action(async () => {\n try {\n await doctor();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('add')\n .description('Add a new component renderer to your project')\n .argument('<component>', 'Component name (e.g. Input, Grid)')\n .action(async (component) => {\n try {\n await add(component);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('studio')\n .description('Start the visual designer')\n .action(async () => {\n try {\n await studio();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('check')\n .description('Validate schema files')\n .action(async () => {\n try {\n await check();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate a schema file against ObjectUI specifications')\n .argument('[schema]', 'Path to schema file (JSON or YAML)', 'app.json')\n .action(async (schema) => {\n try {\n await validate(schema);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('create')\n .description('Create new resources')\n .argument('<type>', 'Type of resource to create (plugin)')\n .argument('<name>', 'Name of the resource')\n .action(async (type, name) => {\n try {\n if (type === 'plugin') {\n await createPlugin(name);\n } else {\n console.error(chalk.red(`Unknown resource type: ${type}`));\n console.log(chalk.gray('Available types: plugin'));\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('analyze')\n .description('Analyze application performance')\n .option('--bundle-size', 'Analyze bundle size')\n .option('--render-performance', 'Analyze render performance')\n .action(async (options) => {\n try {\n await analyze(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\n\nprogram.parse();\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { createServer } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, unlinkSync, statSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createRequire } from 'module';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface DevOptions {\n port: string;\n host: string;\n open?: boolean;\n}\n\nexport async function dev(schemaPath: string, options: DevOptions) {\n const cwd = process.cwd();\n \n // Resolve the actual project root and schema file\n let _projectRoot = cwd;\n const targetSchemaPath = schemaPath;\n let hasPagesDir = false;\n let pagesDir = '';\n let appConfig: unknown = null;\n\n // 1. Determine Project Root & Mode\n const absoluteSchemaPath = resolve(cwd, schemaPath);\n \n if (existsSync(absoluteSchemaPath) && statSync(absoluteSchemaPath).isFile()) {\n // If input is a file (e.g. examples/showcase/app.json)\n const fileDir = dirname(absoluteSchemaPath);\n const potentialPagesDir = join(fileDir, 'pages');\n\n if (existsSync(potentialPagesDir)) {\n console.log(chalk.blue(`📂 Detected project structure at ${fileDir}`));\n _projectRoot = fileDir;\n hasPagesDir = true;\n pagesDir = potentialPagesDir;\n \n // Try to load app.json as config\n try {\n appConfig = parseSchemaFile(absoluteSchemaPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app config');\n }\n }\n } \n \n // Fallback: Check detect pages dir in current cwd if not found above\n if (!hasPagesDir) {\n const localPagesDir = join(cwd, 'pages');\n if (existsSync(localPagesDir)) {\n hasPagesDir = true;\n pagesDir = localPagesDir;\n // Try to find and load app.json in cwd\n const appJsonPath = join(cwd, 'app.json');\n if (existsSync(appJsonPath)) {\n try {\n appConfig = parseSchemaFile(appJsonPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app.json config');\n }\n }\n }\n }\n\n const require = createRequire(join(cwd, 'package.json'));\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue(`📁 Using file-system routing from ${pagesDir}`));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error(`No schema files found in ${pagesDir}`);\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n routes.forEach(route => {\n console.log(chalk.dim(` ${route.path} → ${route.filePath.replace(cwd, '.')}`));\n });\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n // ... (rest of the logic)\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n try {\n schema = parseSchemaFile(fullSchemaPath);\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Invalid schema file: ${error instanceof Error ? error.message : error}`);\n }\n }\n\n // Create temporary app directory (always in cwd to keep node_modules access)\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes, appConfig);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n\n // Install dependencies\n const isMonorepo = existsSync(join(cwd, 'pnpm-workspace.yaml'));\n \n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - using root node_modules'));\n } else {\n console.log(chalk.blue('📦 Installing dependencies...'));\n console.log(chalk.dim(' This may take a moment on first run...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'inherit',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n }\n\n console.log(chalk.green('✓ Schema loaded successfully'));\n console.log(chalk.blue('🚀 Starting development server...\\n'));\n\n // Create Vite config\n const viteConfig: any = {\n root: tmpDir,\n server: {\n port: parseInt(options.port),\n host: options.host,\n open: options.open !== false,\n fs: {\n // Allow serving files from workspace root\n allow: [cwd],\n }\n },\n resolve: {\n alias: {}\n },\n plugins: [react()],\n };\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n \n // Remove postcss.config.js to prevent interference with programmatic config\n const postcssPath = join(tmpDir, 'postcss.config.js');\n if (existsSync(postcssPath)) {\n unlinkSync(postcssPath);\n }\n\n // Add aliases for workspace packages\n viteConfig.resolve.alias = {\n '@object-ui/react': join(cwd, 'packages/react/src/index.ts'),\n '@object-ui/components': join(cwd, 'packages/components/src/index.ts'),\n '@object-ui/core': join(cwd, 'packages/core/src/index.ts'),\n '@object-ui/types': join(cwd, 'packages/types/src/index.ts'),\n '@object-ui/plugin-charts': join(cwd, 'packages/plugin-charts/src/index.tsx'),\n '@object-ui/plugin-editor': join(cwd, 'packages/plugin-editor/src/index.tsx'),\n '@object-ui/plugin-kanban': join(cwd, 'packages/plugin-kanban/src/index.tsx'),\n '@object-ui/plugin-markdown': join(cwd, 'packages/plugin-markdown/src/index.tsx'),\n '@object-ui/plugin-form': join(cwd, 'packages/plugin-form/src/index.tsx'),\n '@object-ui/plugin-grid': join(cwd, 'packages/plugin-grid/src/index.tsx'),\n '@object-ui/plugin-view': join(cwd, 'packages/plugin-view/src/index.tsx'),\n };\n\n // Fix: Resolve lucide-react from components package to avoid \"dependency not found\" in temp app\n try {\n // Trying to find lucide-react in the components' node_modules or hoist\n // checking specifically in packages/components context\n const lucidePath = require.resolve('lucide-react', { paths: [join(cwd, 'packages/components')] });\n // We might get the cjs entry, but for aliasing usually fine. \n // Better yet, if we can find the package root, but require.resolve gives file.\n // Let's just use what require.resolve gives.\n viteConfig.resolve.alias['lucide-react'] = lucidePath;\n } catch (e) {\n console.warn('⚠️ Could not resolve lucide-react automatically:', e);\n }\n \n // Debug aliases\n // console.log('Aliases:', viteConfig.resolve.alias);\n\n // Configure PostCSS programmatically reusing root dependencies\n try {\n const tailwindcss = require('tailwindcss');\n const autoprefixer = require('autoprefixer');\n \n viteConfig.css = {\n postcss: {\n plugins: [\n tailwindcss(join(tmpDir, 'tailwind.config.js')),\n autoprefixer(),\n ],\n },\n };\n } catch (_e) {\n console.warn(chalk.yellow('⚠️ Failed to load PostCSS plugins from root node_modules. Styles might not work correctly.'));\n }\n }\n\n // Create Vite server\n const server = await createServer(viteConfig);\n\n await server.listen();\n\n const { port, host } = server.config.server;\n const protocol = server.config.server.https ? 'https' : 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log();\n console.log(chalk.green('✓ Development server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { build as viteBuild } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, cpSync, rmSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface BuildOptions {\n outDir?: string;\n clean?: boolean;\n}\n\nexport async function buildApp(schemaPath: string, options: BuildOptions) {\n const cwd = process.cwd();\n const outDir = options.outDir || 'dist';\n const outputPath = resolve(cwd, outDir);\n \n console.log(chalk.blue('🔨 Building application for production...'));\n console.log();\n \n // Check if pages directory exists for file-system routing\n const pagesDir = join(cwd, 'pages');\n const hasPagesDir = existsSync(pagesDir);\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue('📁 Using file-system routing'));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error('No schema files found in pages/ directory');\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n\n // Check if schema file exists\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n\n // Read and validate schema\n try {\n schema = parseSchemaFile(fullSchemaPath);\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Invalid schema file: ${error instanceof Error ? error.message : error}`);\n }\n }\n\n // Create temporary app directory\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n // Install dependencies\n console.log(chalk.blue('📦 Installing dependencies...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'pipe',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n\n console.log(chalk.blue('⚙️ Building with Vite...'));\n console.log();\n\n // Clean output directory if requested\n if (options.clean && existsSync(outputPath)) {\n console.log(chalk.dim(` Cleaning ${outDir}/ directory...`));\n rmSync(outputPath, { recursive: true, force: true });\n }\n\n // Build with Vite\n try {\n await viteBuild({\n root: tmpDir,\n build: {\n outDir: join(tmpDir, 'dist'),\n emptyOutDir: true,\n reportCompressedSize: true,\n },\n plugins: [react()],\n logLevel: 'info',\n });\n\n // Copy built files to output directory\n mkdirSync(outputPath, { recursive: true });\n cpSync(join(tmpDir, 'dist'), outputPath, { recursive: true });\n\n console.log();\n console.log(chalk.green('✓ Build completed successfully!'));\n console.log();\n console.log(chalk.bold(' Output: ') + chalk.cyan(outDir + '/'));\n console.log();\n console.log(chalk.dim(' To serve the production build, run:'));\n console.log(chalk.cyan(` objectui start --dir ${outDir}`));\n console.log();\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Build failed: ${error instanceof Error ? error.message : error}`);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport express from 'express';\nimport rateLimit from 'express-rate-limit';\nimport { existsSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\n\ninterface StartOptions {\n port: string;\n host: string;\n dir?: string;\n}\n\nexport async function start(options: StartOptions) {\n const cwd = process.cwd();\n const distDir = options.dir || 'dist';\n const distPath = resolve(cwd, distDir);\n\n // Check if dist directory exists\n if (!existsSync(distPath)) {\n throw new Error(\n `Build directory not found: ${distDir}\\n` +\n `Run 'objectui build' first to create a production build.`\n );\n }\n\n // Check if index.html exists\n const indexPath = join(distPath, 'index.html');\n if (!existsSync(indexPath)) {\n throw new Error(\n `index.html not found in ${distDir}/\\n` +\n `Make sure you have a valid production build.`\n );\n }\n\n console.log(chalk.blue('🚀 Starting production server...\\n'));\n\n const app = express();\n const port = parseInt(options.port);\n const host = options.host;\n\n // Configure rate limiting to prevent abuse\n const limiter = rateLimit({\n windowMs: 15 * 60 * 1000, // 15 minutes\n max: 1000, // Limit each IP to 1000 requests per windowMs\n message: 'Too many requests from this IP, please try again later.',\n standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers\n legacyHeaders: false, // Disable the `X-RateLimit-*` headers\n });\n\n // Apply rate limiting to all routes\n app.use(limiter);\n\n // Serve static files from dist directory\n app.use(express.static(distPath));\n\n // SPA fallback - serve index.html for all routes\n app.get('*', (_req, res) => {\n res.sendFile(indexPath);\n });\n\n // Start server\n app.listen(port, host, () => {\n const protocol = 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log(chalk.green('✓ Production server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log(chalk.bold(' Serving: ') + chalk.dim(distDir + '/'));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n });\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface LintOptions {\n fix?: boolean;\n}\n\nexport async function lint(options: LintOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🔍 Running linter...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n const fixFlag = options.fix ? '--fix' : '';\n const command = `npx eslint \"src/**/*.{js,jsx,ts,tsx}\" ${fixFlag}`.trim();\n \n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n console.log();\n console.log(chalk.green('✓ Linting completed successfully!'));\n console.log();\n } catch {\n // ESLint returns non-zero exit code when there are linting errors\n console.log();\n console.log(chalk.yellow('⚠ Linting found issues.'));\n if (!options.fix) {\n console.log(chalk.dim(' Run \\'objectui lint --fix\\' to automatically fix some issues.'));\n }\n console.log();\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface TestOptions {\n watch?: boolean;\n coverage?: boolean;\n ui?: boolean;\n}\n\nexport async function test(options: TestOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🧪 Running tests...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n let command = 'npx vitest';\n \n if (options.watch) {\n command += ' --watch';\n } else if (options.ui) {\n command += ' --ui';\n } else {\n command += ' run';\n }\n\n if (options.coverage) {\n command += ' --coverage';\n }\n\n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n if (!options.watch && !options.ui) {\n console.log();\n console.log(chalk.green('✓ Tests completed successfully!'));\n console.log();\n }\n } catch {\n // Vitest returns non-zero exit code when tests fail\n console.log();\n console.log(chalk.red('✗ Some tests failed.'));\n console.log();\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function generate(type: string, name: string) {\n const cwd = process.cwd();\n\n switch (type) {\n case 'resource':\n case 'object':\n generateResource(cwd, name);\n break;\n case 'page':\n generatePage(cwd, name);\n break;\n case 'plugin':\n generatePlugin(cwd, name);\n break;\n default:\n console.log(chalk.red(`Unknown type: ${type}`));\n console.log(`Available types: resource, page, plugin`);\n process.exit(1);\n }\n}\n\nfunction generateResource(cwd: string, name: string) {\n const dir = join(cwd, 'objects');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Object ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n name: name,\n fields: {\n name: { type: 'text', label: 'Name', required: true }\n }\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated resource schema: ${filePath}`));\n}\n\nfunction generatePage(cwd: string, name: string) {\n const dir = join(cwd, 'pages');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Page ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n type: \"page\",\n title: name,\n body: [\n {\n type: \"markdown\",\n content: `# Welcome to ${name}`\n }\n ]\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated page schema: ${filePath}`));\n}\n\nfunction generatePlugin(cwd: string, name: string) {\n const dir = join(cwd, 'plugins', name);\n if (existsSync(dir)) {\n console.log(chalk.yellow(`Plugin ${name} already exists`));\n return;\n }\n mkdirSync(dir, { recursive: true });\n\n const content = `\nexport const ${name}Plugin = {\n name: '${name}',\n install(app) {\n console.log('${name} plugin installed');\n }\n};\n`;\n\n writeFileSync(join(dir, 'index.ts'), content.trim());\n console.log(chalk.green(`✓ Generated plugin: ${dir}`));\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function doctor() {\n console.log(chalk.bold('Object UI Doctor'));\n console.log('Diagnosis in progress...\\n');\n \n const cwd = process.cwd();\n let issues = 0;\n\n // 1. Check package.json\n const pkgPath = join(cwd, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n \n // Check React version\n const reactVer = pkg.dependencies?.react || pkg.devDependencies?.react;\n if (reactVer) {\n console.log(chalk.green('✓ React installed'));\n } else {\n console.log(chalk.yellow('⚠️ React not found in dependencies'));\n issues++;\n }\n\n // Check Tailwind\n const tailwindVer = pkg.dependencies?.tailwindcss || pkg.devDependencies?.tailwindcss;\n if (tailwindVer) {\n console.log(chalk.green('✓ Tailwind CSS installed'));\n } else {\n console.log(chalk.yellow('⚠️ Tailwind CSS not found'));\n issues++;\n }\n } catch (e) {\n console.log(chalk.red('x Failed to read package.json'));\n issues++;\n }\n } else {\n console.log(chalk.red('x package.json not found'));\n issues++;\n }\n\n // 2. Check tailwind.config.js\n const tailwindConfigPath = join(cwd, 'tailwind.config.js');\n const tailwindTsPath = join(cwd, 'tailwind.config.ts');\n if (existsSync(tailwindConfigPath) || existsSync(tailwindTsPath)) {\n const configFile = existsSync(tailwindConfigPath) ? 'tailwind.config.js' : 'tailwind.config.ts';\n const configPath = existsSync(tailwindConfigPath) ? tailwindConfigPath : tailwindTsPath;\n console.log(chalk.green(`✓ ${configFile} found`));\n // Check content configuration\n try {\n const configContent = readFileSync(configPath, 'utf-8');\n if (configContent.includes('content') && (configContent.includes('./src') || configContent.includes('./app') || configContent.includes('./pages'))) {\n console.log(chalk.green('✓ Tailwind content paths configured'));\n } else {\n console.log(chalk.yellow('⚠️ Tailwind content paths may not be configured. Ensure your content array includes source directories.'));\n issues++;\n }\n } catch (_e) {\n // File exists but can't be read - not critical\n }\n } else {\n console.log(chalk.yellow('⚠️ tailwind.config.js not found'));\n issues++;\n }\n\n // 3. Check TypeScript version\n const tsConfigPath = join(cwd, 'tsconfig.json');\n if (existsSync(tsConfigPath)) {\n console.log(chalk.green('✓ tsconfig.json found'));\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const tsVer = pkg.devDependencies?.typescript || pkg.dependencies?.typescript;\n if (tsVer) {\n const majorVer = parseInt(tsVer.replace(/[^0-9.]/g, '').split('.')[0], 10);\n if (majorVer >= 5) {\n console.log(chalk.green(`✓ TypeScript ${tsVer} (5.0+ required)`));\n } else {\n console.log(chalk.yellow(`⚠️ TypeScript ${tsVer} detected — version 5.0+ recommended`));\n issues++;\n }\n }\n } catch (_e) {\n // Already checked package.json above\n }\n } else {\n console.log(chalk.yellow('⚠️ tsconfig.json not found'));\n issues++;\n }\n\n // 4. Check peer dependencies\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };\n \n // Check for common peer dependency issues\n if (allDeps['@object-ui/react'] && !allDeps['react']) {\n console.log(chalk.yellow('⚠️ @object-ui/react requires react as a peer dependency'));\n issues++;\n }\n if (allDeps['@object-ui/components'] && !allDeps['tailwindcss']) {\n console.log(chalk.yellow('⚠️ @object-ui/components requires tailwindcss as a peer dependency'));\n issues++;\n }\n } catch (_e) {\n // Already handled\n }\n }\n\n // Summary\n console.log('\\nResult:');\n if (issues === 0) {\n console.log(chalk.green('Everything looks good! ✨'));\n } else {\n console.log(chalk.yellow(`Found ${issues} issue(s).`));\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function add(component: string) {\n console.log(chalk.bold(`Object UI Add: ${component}`));\n console.log(chalk.yellow('Feature not implemented yet.'));\n console.log(`This command will download the source code for ${component}Renderer to your project.`);\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nexport async function studio() {\n console.log(chalk.bold('\\n🎨 Starting ObjectUI Studio...\\n'));\n\n const cwd = process.cwd();\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n\n // Resolve the console app directory\n // 1. Check monorepo structure (apps/console)\n // 2. Check relative path (../../apps/console from packages/cli)\n const candidates = [\n join(cwd, 'apps/console'),\n resolve(__dirname, '../../apps/console'),\n resolve(__dirname, '../../../apps/console'),\n ];\n\n let consolePath: string | null = null;\n for (const candidate of candidates) {\n if (existsSync(join(candidate, 'package.json'))) {\n consolePath = candidate;\n break;\n }\n }\n\n if (!consolePath) {\n console.log(chalk.yellow('⚠ Console app not found in workspace.'));\n console.log(chalk.dim(' Hint: Run this command from the monorepo root.'));\n console.log(chalk.dim(' Expected: apps/console/package.json\\n'));\n process.exit(1);\n }\n\n console.log(chalk.dim(` Console: ${consolePath}`));\n console.log(chalk.dim(' Mode: MSW (in-browser mock server)\\n'));\n\n // Delegate to the console's dev script which starts Vite + MSW\n const child = spawn('pnpm', ['run', 'dev'], {\n cwd: consolePath,\n stdio: 'inherit',\n env: { ...process.env, NODE_ENV: 'development' },\n shell: true,\n });\n\n child.on('error', (err) => {\n console.error(chalk.red(`\\n ✗ Failed to start studio: ${err.message}`));\n process.exit(1);\n });\n\n child.on('exit', (code) => process.exit(code ?? 0));\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { globSync } from 'glob';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function check() {\n console.log(chalk.bold('Object UI Schema Check'));\n const cwd = process.cwd();\n \n // 1. Find all JSON/YAML files\n const files = globSync('**/*.{json,yaml,yml}', { \n cwd, \n ignore: ['node_modules/**', 'dist/**', '.git/**'] \n });\n \n console.log(`Analyzing ${files.length} files...`);\n \n let errors = 0;\n \n for (const file of files) {\n try {\n // Basic JSON parsing check\n if (file.endsWith('.json')) {\n const content = JSON.parse(readFileSync(join(cwd, file), 'utf-8'));\n // Schema validation: check for ObjectUI schema patterns\n if (content && typeof content === 'object' && content.type) {\n const knownTypes = [\n 'page', 'form', 'grid', 'crud', 'kanban', 'calendar', 'dashboard',\n 'chart', 'detail', 'list', 'timeline', 'gantt', 'map', 'gallery',\n 'object-view', 'detail-view', 'object-chart',\n ];\n if (typeof content.type === 'string' && !knownTypes.includes(content.type)) {\n console.log(chalk.yellow(`⚠️ Unknown schema type \"${content.type}\" in ${file}`));\n }\n }\n }\n } catch (e) {\n console.log(chalk.red(`x Invalid JSON in ${file}: ${(e as Error).message}`));\n errors++;\n }\n }\n \n if (errors === 0) {\n console.log(chalk.green('✓ All checks passed'));\n } else {\n console.log(chalk.red(`Found ${errors} errors`));\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { readFileSync, existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { load as loadYaml } from 'js-yaml';\nimport { safeValidateSchema } from '@object-ui/types/zod';\nimport { findSpecVocabularyFormFields } from '../utils/spec-vocabulary-hint.js';\n\n/**\n * Validate a schema file\n * \n * @param schemaPath - Path to the schema file (JSON or YAML)\n */\nexport async function validate(schemaPath: string) {\n console.log(chalk.blue('🔍 ObjectUI Schema Validator\\n'));\n\n // Resolve the schema path\n const resolvedPath = resolve(process.cwd(), schemaPath);\n\n // Check if file exists\n if (!existsSync(resolvedPath)) {\n console.error(chalk.red(`✗ Error: Schema file not found: ${schemaPath}`));\n process.exit(1);\n }\n\n try {\n // Read the file\n const fileContent = readFileSync(resolvedPath, 'utf-8');\n let schema: unknown;\n\n // Parse based on file extension\n if (schemaPath.endsWith('.yaml') || schemaPath.endsWith('.yml')) {\n console.log(chalk.gray(`Reading YAML schema from: ${schemaPath}`));\n schema = loadYaml(fileContent);\n } else if (schemaPath.endsWith('.json')) {\n console.log(chalk.gray(`Reading JSON schema from: ${schemaPath}`));\n schema = JSON.parse(fileContent);\n } else {\n // Try JSON first, then YAML\n try {\n schema = JSON.parse(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as JSON)`));\n } catch {\n schema = loadYaml(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as YAML)`));\n }\n }\n\n // Validate the schema\n console.log(chalk.gray('Validating schema...\\n'));\n const result = safeValidateSchema(schema);\n\n if (result.success) {\n console.log(chalk.green('✓ Schema is valid!\\n'));\n \n // Show some info about the schema\n const data = result.data;\n console.log(chalk.bold('Schema Information:'));\n console.log(chalk.gray(' Type:'), data.type || 'unknown');\n \n if (data.id) {\n console.log(chalk.gray(' ID:'), data.id);\n }\n \n if (data.label || data.title) {\n console.log(chalk.gray(' Label:'), data.label || data.title);\n }\n \n // Count children if present\n if (data.children && Array.isArray(data.children)) {\n console.log(chalk.gray(' Children:'), data.children.length);\n }\n\n // Mixed-vocabulary entries validate (the runtime `name` satisfies the\n // schema) but the spec `field` key is dead weight: the renderer ignores\n // it and strip-mode validation drops it. Valid ≠ clean — say so (#3090).\n const mixed = findSpecVocabularyFormFields(schema).filter((f) => f.mixedName);\n if (mixed.length > 0) {\n console.log(chalk.yellow('\\nWarnings:'));\n for (const m of mixed) {\n console.log(chalk.yellow(\n ` ${m.path}: '${m.mixedName}' also carries { field: '${m.field}' } — mixed form-field ` +\n `vocabularies. The renderer ignores \\`field\\` here; drop one of the two.`,\n ));\n }\n }\n\n console.log('');\n process.exit(0);\n } else {\n console.error(chalk.red('✗ Schema validation failed!\\n'));\n console.error(chalk.bold('Validation Errors:'));\n \n // Format Zod errors nicely. `.issues` is the only accessor on a Zod 4\n // ZodError — the `.errors` alias was removed, so reading it yielded\n // undefined and this loop threw a TypeError that the catch below\n // reported as \"Error reading or parsing schema file\", hiding the very\n // errors this command exists to print.\n result.error.issues.forEach((issue, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${issue.message}`));\n if (issue.path && issue.path.length > 0) {\n console.error(chalk.gray(` Path: ${issue.path.join(' → ')}`));\n }\n if (issue.code) {\n console.error(chalk.gray(` Code: ${issue.code}`));\n }\n });\n\n // \"name: expected string, received undefined\" on a `{ field: … }` entry\n // reads as an instruction to bolt a `name` on — which converts the\n // metadata WRONGLY (the spec shape stands for an object-schema merge\n // that a bare rename throws away). When the input matches that\n // signature, name the actual boundary and the real fixes (#3090).\n const specShaped = findSpecVocabularyFormFields(schema).filter((f) => !f.mixedName);\n if (specShaped.length > 0) {\n console.error(chalk.bold('\\nLikely cause — spec form-view vocabulary in a standalone form:'));\n for (const s of specShaped) {\n console.error(chalk.yellow(\n ` ${s.path}: { field: '${s.field}' } is the spec form-VIEW shape (an object-field reference).`,\n ));\n }\n console.error(chalk.yellow(\n ` A standalone \\`type: 'form'\\` component uses { name: … } (the form data path).\\n` +\n ` Fix: author the field with \\`name\\` and its own type/label — or, to reference object fields\\n` +\n ` with the spec shape, use an object-bound form (\\`type: 'object-form'\\` with objectName +\\n` +\n ` sections), whose section fields are translated by the renderer.`,\n ));\n }\n\n console.error('');\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('\\n✗ Error reading or parsing schema file:'));\n console.error(chalk.red((error as Error).message));\n console.error('');\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Spec-vocabulary detector for `objectui validate` (#3090).\n *\n * `{ field: 'x' }` inside a standalone `type: 'form'` component is the spec\n * form-VIEW vocabulary (an object-field reference) — a different layer from\n * the runtime vocabulary this CLI validates (`name` = form data path). The\n * zod error for it (\"name: expected string, received undefined\") reads as an\n * instruction to bolt a `name` on, which converts the metadata WRONGLY: an\n * agent following it loses the object-schema merge the spec shape stands for.\n * This detector lets the CLI say what actually happened and what the real fix\n * is. The error message is the prompt the next agent executes — it has to\n * point at the boundary, not at the symptom.\n *\n * Scope is deliberately exact: only `fields` arrays hanging DIRECTLY off a\n * `type: 'form'` node. Section fields (`type: 'object-form'` → `sections[]`)\n * legitimately accept the spec shape — `normalizeSectionField` translates\n * them — and a runtime FormField's `field` key legitimately holds the\n * resolved metadata OBJECT, so only a STRING `field` marks the spec shape.\n */\n\nexport interface SpecVocabularyFinding {\n /** JSON-ish path to the entry, e.g. `children[0].fields[2]`. */\n path: string;\n /** The spec `field` value (the referenced object field). */\n field: string;\n /** Set when the entry ALSO carries a runtime `name` (mixed vocabularies). */\n mixedName?: string;\n}\n\nexport function findSpecVocabularyFormFields(\n node: unknown,\n path = '',\n): SpecVocabularyFinding[] {\n if (Array.isArray(node)) {\n return node.flatMap((child, i) => findSpecVocabularyFormFields(child, `${path}[${i}]`));\n }\n if (node === null || typeof node !== 'object') return [];\n\n const record = node as Record<string, unknown>;\n const findings: SpecVocabularyFinding[] = [];\n\n if (record.type === 'form' && Array.isArray(record.fields)) {\n record.fields.forEach((f, i) => {\n if (f && typeof f === 'object' && typeof (f as any).field === 'string') {\n const name = (f as any).name;\n findings.push({\n path: `${path ? `${path}.` : ''}fields[${i}]`,\n field: (f as any).field,\n ...(typeof name === 'string' ? { mixedName: name } : {}),\n });\n }\n });\n }\n\n for (const [key, value] of Object.entries(record)) {\n // The entries themselves were just inspected; don't re-walk them as\n // generic children or each finding would double-report.\n if (record.type === 'form' && key === 'fields') continue;\n findings.push(\n ...findSpecVocabularyFormFields(value, path ? `${path}.${key}` : key),\n );\n }\n return findings;\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Create a new plugin using the @object-ui/create-plugin package\n * \n * @param pluginName - Name of the plugin to create\n */\nexport async function createPlugin(pluginName: string) {\n console.log(chalk.blue('🚀 Creating ObjectUI plugin...\\n'));\n\n // Resolve the create-plugin script path\n const createPluginScript = resolve(\n __dirname,\n '../../../create-plugin/dist/index.js'\n );\n\n return new Promise<void>((resolve, reject) => {\n // Spawn the create-plugin command\n const child = spawn('node', [createPluginScript, pluginName], {\n stdio: 'inherit',\n shell: true,\n });\n\n child.on('error', (error) => {\n console.error(chalk.red('Failed to create plugin:'), error);\n reject(error);\n });\n\n child.on('exit', (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`create-plugin exited with code ${code}`));\n }\n });\n });\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, statSync, readdirSync } from 'fs';\nimport { resolve, join, extname } from 'path';\n\ninterface AnalyzeOptions {\n bundleSize?: boolean;\n renderPerformance?: boolean;\n}\n\n/**\n * Analyze bundle size by scanning dist directory\n */\nasync function analyzeBundleSize() {\n console.log(chalk.bold('\\n📦 Bundle Size Analysis\\n'));\n\n const distDir = resolve(process.cwd(), 'dist');\n \n if (!existsSync(distDir)) {\n console.log(chalk.yellow('⚠ No dist directory found. Run build first.'));\n return;\n }\n\n const files: Array<{ path: string; size: number }> = [];\n \n function scanDirectory(dir: string) {\n const items = readdirSync(dir);\n \n for (const item of items) {\n const fullPath = join(dir, item);\n const stat = statSync(fullPath);\n \n if (stat.isDirectory()) {\n scanDirectory(fullPath);\n } else {\n files.push({\n path: fullPath.replace(distDir + '/', ''),\n size: stat.size,\n });\n }\n }\n }\n \n scanDirectory(distDir);\n \n // Sort by size (largest first)\n files.sort((a, b) => b.size - a.size);\n \n // Calculate totals\n const totalSize = files.reduce((sum, file) => sum + file.size, 0);\n const jsFiles = files.filter(f => extname(f.path) === '.js');\n const cssFiles = files.filter(f => extname(f.path) === '.css');\n \n const jsSize = jsFiles.reduce((sum, file) => sum + file.size, 0);\n const cssSize = cssFiles.reduce((sum, file) => sum + file.size, 0);\n \n console.log(chalk.bold('Summary:'));\n console.log(chalk.gray(' Total Size:'), formatBytes(totalSize));\n console.log(chalk.gray(' JavaScript:'), formatBytes(jsSize), chalk.dim(`(${jsFiles.length} files)`));\n console.log(chalk.gray(' CSS: '), formatBytes(cssSize), chalk.dim(`(${cssFiles.length} files)`));\n console.log(chalk.gray(' Other: '), formatBytes(totalSize - jsSize - cssSize));\n \n console.log(chalk.bold('\\nLargest Files:'));\n files.slice(0, 10).forEach((file) => {\n const sizeStr = formatBytes(file.size).padStart(10);\n console.log(chalk.gray(` ${sizeStr}`), file.path);\n });\n \n // Bundle size recommendations\n console.log(chalk.bold('\\n💡 Recommendations:'));\n \n if (totalSize > 1024 * 1024) {\n console.log(chalk.yellow(' ⚠ Total bundle size is large (> 1MB)'));\n console.log(chalk.gray(' Consider code splitting or lazy loading'));\n }\n \n if (jsSize > 500 * 1024) {\n console.log(chalk.yellow(' ⚠ JavaScript bundle is large (> 500KB)'));\n console.log(chalk.gray(' Consider:'));\n console.log(chalk.gray(' - Tree shaking unused code'));\n console.log(chalk.gray(' - Lazy loading components'));\n console.log(chalk.gray(' - Using dynamic imports'));\n }\n \n if (files.length > 100) {\n console.log(chalk.yellow(` ⚠ Large number of files (${files.length})`));\n console.log(chalk.gray(' Consider bundling or combining files'));\n }\n \n console.log('');\n}\n\n/**\n * Analyze render performance (placeholder for now)\n */\nasync function analyzeRenderPerformance() {\n console.log(chalk.bold('\\n⚡ Render Performance Analysis\\n'));\n \n console.log(chalk.gray('Performance analysis features:'));\n console.log(chalk.gray(' ✓ Expression caching enabled'));\n console.log(chalk.gray(' ✓ Component memoization available'));\n console.log(chalk.gray(' ✓ Virtual scrolling support for large lists'));\n \n console.log(chalk.bold('\\n💡 Performance Tips:'));\n console.log(chalk.gray(' • Use virtual scrolling for lists > 100 items'));\n console.log(chalk.gray(' • Cache frequently evaluated expressions'));\n console.log(chalk.gray(' • Use React.memo for expensive components'));\n console.log(chalk.gray(' • Implement pagination for large datasets'));\n console.log(chalk.gray(' • Use code splitting for large apps'));\n \n console.log('');\n}\n\n/**\n * Format bytes to human-readable string\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n \n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n \n return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;\n}\n\n/**\n * Analyze application performance\n * \n * @param options - Analysis options\n */\nexport async function analyze(options: AnalyzeOptions = {}) {\n console.log(chalk.blue('🔍 ObjectUI Performance Analyzer\\n'));\n\n const runAll = !options.bundleSize && !options.renderPerformance;\n \n if (options.bundleSize || runAll) {\n await analyzeBundleSize();\n }\n \n if (options.renderPerformance || runAll) {\n await analyzeRenderPerformance();\n }\n \n console.log(chalk.green('✓ Analysis complete!\\n'));\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,YAAY,WAAW,YAAY,gBAAgB;AAC5D,SAAS,MAAM,SAAS,eAAe;AACvC,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAS9B,eAAsB,IAAI,YAAoB,SAAqB;AACjE,QAAM,MAAM,QAAQ,IAAI;AAGxB,MAAI,eAAe;AACnB,QAAM,mBAAmB;AACzB,MAAI,cAAc;AAClB,MAAI,WAAW;AACf,MAAI,YAAqB;AAGzB,QAAM,qBAAqB,QAAQ,KAAK,UAAU;AAElD,MAAI,WAAW,kBAAkB,KAAK,SAAS,kBAAkB,EAAE,OAAO,GAAG;AAE3E,UAAM,UAAU,QAAQ,kBAAkB;AAC1C,UAAM,oBAAoB,KAAK,SAAS,OAAO;AAE/C,QAAI,WAAW,iBAAiB,GAAG;AACjC,cAAQ,IAAI,MAAM,KAAK,2CAAoC,OAAO,EAAE,CAAC;AACrE,qBAAe;AACf,oBAAc;AACd,iBAAW;AAGX,UAAI;AACF,oBAAY,gBAAgB,kBAAkB;AAC9C,gBAAQ,IAAI,MAAM,KAAK,+CAAqC,CAAC;AAAA,MAC/D,SAAS,IAAI;AACX,gBAAQ,KAAK,4BAA4B;AAAA,MAC3C;AAAA,IACF;AAAA,EACF;AAGA,MAAI,CAAC,aAAa;AACf,UAAM,gBAAgB,KAAK,KAAK,OAAO;AACvC,QAAI,WAAW,aAAa,GAAG;AAC5B,oBAAc;AACd,iBAAW;AAEX,YAAM,cAAc,KAAK,KAAK,UAAU;AACxC,UAAI,WAAW,WAAW,GAAG;AAC3B,YAAI;AACF,sB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;AAGH,QAAQ,MAAM;","names":["chalk","require","react","existsSync","mkdirSync","join","resolve","chalk","execSync","resolve","chalk","join","existsSync","mkdirSync","execSync","react","existsSync","join","resolve","chalk","execSync","existsSync","join","chalk","execSync","existsSync","join","chalk","chalk","existsSync","mkdirSync","join","chalk","existsSync","join","chalk","chalk","existsSync","join","resolve","dirname","__filename","__dirname","chalk","readFileSync","join","chalk","readFileSync","existsSync","resolve","chalk","resolve","existsSync","readFileSync","chalk","spawn","resolve","dirname","fileURLToPath","chalk","existsSync","statSync","resolve","join","readFileSync","fileURLToPath","dirname","join","__filename","__dirname","chalk"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.2.0",
|
|
4
4
|
"description": "Standalone CLI for Object UI — scaffold, develop, build and validate JSON/YAML schema-driven applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://www.objectui.org/docs/utilities/cli",
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
"license": "MIT",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@types/glob": "^9.0.0",
|
|
51
|
-
"@vitejs/plugin-react": "^6.0.
|
|
52
|
-
"chalk": "^
|
|
51
|
+
"@vitejs/plugin-react": "^6.0.4",
|
|
52
|
+
"chalk": "^6.0.0",
|
|
53
53
|
"commander": "^15.0.0",
|
|
54
54
|
"express": "^4.22.2",
|
|
55
|
-
"express-rate-limit": "^8.6.
|
|
55
|
+
"express-rate-limit": "^8.6.1",
|
|
56
56
|
"glob": "^13.0.6",
|
|
57
|
-
"js-yaml": "^5.2.
|
|
57
|
+
"js-yaml": "^5.2.2",
|
|
58
58
|
"vite": "^8.1.5",
|
|
59
|
-
"@object-ui/components": "
|
|
60
|
-
"@object-ui/react": "
|
|
61
|
-
"@object-ui/types": "
|
|
59
|
+
"@object-ui/components": "17.2.0",
|
|
60
|
+
"@object-ui/react": "17.2.0",
|
|
61
|
+
"@object-ui/types": "17.2.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/express": "^4.17.25",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"build": "tsup",
|
|
76
76
|
"dev": "tsup --watch",
|
|
77
77
|
"lint": "eslint src",
|
|
78
|
-
"test": "vitest run"
|
|
78
|
+
"test": "vitest run",
|
|
79
|
+
"type-check": "tsc --noEmit"
|
|
79
80
|
}
|
|
80
81
|
}
|