@objectql/cli 1.8.4 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/commands/database-push.d.ts +5 -0
- package/dist/commands/database-push.js +15 -0
- package/dist/commands/database-push.js.map +1 -0
- package/dist/commands/dev.d.ts +2 -0
- package/dist/commands/dev.js +94 -6
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.js +37 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.js +31 -30
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/serve.d.ts +2 -0
- package/dist/commands/serve.js +122 -46
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/start.d.ts +1 -0
- package/dist/commands/start.js +15 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/index.js +15 -338
- package/dist/index.js.map +1 -1
- package/dist/register/ai.d.ts +2 -0
- package/dist/register/ai.js +24 -0
- package/dist/register/ai.js.map +1 -0
- package/dist/register/database.d.ts +2 -0
- package/dist/register/database.js +64 -0
- package/dist/register/database.js.map +1 -0
- package/dist/register/i18n.d.ts +2 -0
- package/dist/register/i18n.js +52 -0
- package/dist/register/i18n.js.map +1 -0
- package/dist/register/lifecycle.d.ts +2 -0
- package/dist/register/lifecycle.js +68 -0
- package/dist/register/lifecycle.js.map +1 -0
- package/dist/register/scaffold.d.ts +2 -0
- package/dist/register/scaffold.js +48 -0
- package/dist/register/scaffold.js.map +1 -0
- package/dist/register/tools.d.ts +2 -0
- package/dist/register/tools.js +49 -0
- package/dist/register/tools.js.map +1 -0
- package/package.json +13 -7
- package/templates/hello-world/.vscode/extensions.json +7 -0
- package/templates/hello-world/CHANGELOG.md +49 -0
- package/templates/hello-world/README.md +29 -0
- package/templates/hello-world/package.json +24 -0
- package/templates/hello-world/src/index.ts +58 -0
- package/templates/hello-world/tsconfig.json +10 -0
- package/templates/starter/.vscode/extensions.json +7 -0
- package/{CHANGELOG.md → templates/starter/CHANGELOG.md} +46 -42
- package/templates/starter/README.md +17 -0
- package/templates/starter/__tests__/projects-hooks-actions.test.ts +490 -0
- package/templates/starter/jest.config.js +16 -0
- package/templates/starter/package.json +52 -0
- package/templates/starter/src/README.pages.md +110 -0
- package/templates/starter/src/demo.app.yml +4 -0
- package/templates/starter/src/i18n/zh-CN/projects.json +22 -0
- package/templates/starter/src/modules/kitchen-sink/kitchen_sink.data.yml +18 -0
- package/templates/starter/src/modules/kitchen-sink/kitchen_sink.object.yml +156 -0
- package/templates/starter/src/modules/projects/project_approval.workflow.yml +51 -0
- package/templates/starter/src/modules/projects/projects.action.ts +472 -0
- package/templates/starter/src/modules/projects/projects.data.yml +13 -0
- package/templates/starter/src/modules/projects/projects.hook.ts +339 -0
- package/templates/starter/src/modules/projects/projects.object.yml +148 -0
- package/templates/starter/src/modules/projects/projects.permission.yml +141 -0
- package/templates/starter/src/modules/projects/projects.validation.yml +37 -0
- package/templates/starter/src/modules/tasks/tasks.data.yml +23 -0
- package/templates/starter/src/modules/tasks/tasks.object.yml +34 -0
- package/templates/starter/src/modules/tasks/tasks.permission.yml +167 -0
- package/templates/starter/src/seed.ts +55 -0
- package/templates/starter/src/types/index.ts +3 -0
- package/templates/starter/src/types/kitchen_sink.ts +101 -0
- package/templates/starter/src/types/projects.ts +49 -0
- package/templates/starter/src/types/tasks.ts +33 -0
- package/templates/starter/tsconfig.json +11 -0
- package/templates/starter/tsconfig.tsbuildinfo +1 -0
- package/AI_EXAMPLES.md +0 -154
- package/AI_IMPLEMENTATION_SUMMARY.md +0 -509
- package/AI_TUTORIAL.md +0 -144
- package/IMPLEMENTATION_SUMMARY.md +0 -437
- package/USAGE_EXAMPLES.md +0 -951
- package/__tests__/commands.test.ts +0 -426
- package/jest.config.js +0 -19
- package/src/commands/ai.ts +0 -509
- package/src/commands/build.ts +0 -98
- package/src/commands/dev.ts +0 -23
- package/src/commands/format.ts +0 -110
- package/src/commands/generate.ts +0 -135
- package/src/commands/i18n.ts +0 -303
- package/src/commands/init.ts +0 -191
- package/src/commands/lint.ts +0 -98
- package/src/commands/migrate.ts +0 -314
- package/src/commands/new.ts +0 -221
- package/src/commands/repl.ts +0 -120
- package/src/commands/serve.ts +0 -96
- package/src/commands/start.ts +0 -100
- package/src/commands/sync.ts +0 -328
- package/src/commands/test.ts +0 -98
- package/src/index.ts +0 -356
- package/tsconfig.json +0 -15
- package/tsconfig.tsbuildinfo +0 -1
package/dist/commands/start.js
CHANGED
|
@@ -72,6 +72,14 @@ async function start(options) {
|
|
|
72
72
|
console.warn(chalk_1.default.yellow(`⚠️ Failed to load config: ${e.message}`));
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
+
// Process modules override
|
|
76
|
+
if (options.modules) {
|
|
77
|
+
const moduleList = options.modules.split(',').map(p => p.trim());
|
|
78
|
+
if (!config)
|
|
79
|
+
config = {};
|
|
80
|
+
config.modules = moduleList;
|
|
81
|
+
console.log(chalk_1.default.yellow(`⚠️ Overriding modules: ${moduleList.join(', ')}`));
|
|
82
|
+
}
|
|
75
83
|
// Initialize datasource from config or use default SQLite
|
|
76
84
|
// Note: Config files may use 'datasource' (singular) while ObjectQLConfig uses 'datasources' (plural)
|
|
77
85
|
const datasourceConfig = ((_a = config === null || config === void 0 ? void 0 : config.datasources) === null || _a === void 0 ? void 0 : _a.default) || ((_b = config === null || config === void 0 ? void 0 : config.datasource) === null || _b === void 0 ? void 0 : _b.default) || {
|
|
@@ -88,6 +96,13 @@ async function start(options) {
|
|
|
88
96
|
// Load Schema
|
|
89
97
|
try {
|
|
90
98
|
const loader = new platform_node_1.ObjectLoader(app.metadata);
|
|
99
|
+
// Load modules first (if any)
|
|
100
|
+
// Backwards compatibility for presets
|
|
101
|
+
const modulesToLoad = (config === null || config === void 0 ? void 0 : config.modules) || (config === null || config === void 0 ? void 0 : config.presets);
|
|
102
|
+
if (modulesToLoad) {
|
|
103
|
+
await (0, platform_node_1.loadModules)(loader, modulesToLoad);
|
|
104
|
+
}
|
|
105
|
+
// Load project source
|
|
91
106
|
loader.load(rootDir);
|
|
92
107
|
await app.init();
|
|
93
108
|
console.log(chalk_1.default.green('✅ Schema loaded successfully.'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,sBA2FC;AAtHD,yCAA0C;AAC1C,qDAAiD;AACjD,2DAAoE;AACpE,6CAAqD;AACrD,+BAAoC;AACpC,2CAA6B;AAC7B,uCAAyB;AACzB,kDAA0B;AAgB1B;;;GAGG;AACI,KAAK,UAAU,KAAK,CAAC,OAAqB;;IAC7C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC,CAAC;IAElE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC,CAAC;IAE3D,4BAA4B;IAC5B,IAAI,MAAM,GAAwB,IAAI,CAAC;IACvC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,oBAAoB,CAAC,CAAC;IAEpF,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,IAAI,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,wBAAwB,UAAU,EAAE,CAAC,CAAC,CAAC;YAC9D,qDAAqD;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AO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC,CAAC;QAClE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,qCAAqC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9E,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,qCAAqC,OAAO,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC;QAE1F,2BAA2B;QAC3B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;YACvB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,qDAAqD,CAAC,CAAC,CAAC;YACjF,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;gBAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,346 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const commander_1 = require("commander");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const test_1 = require("./commands/test");
|
|
11
|
-
const lint_1 = require("./commands/lint");
|
|
12
|
-
const format_1 = require("./commands/format");
|
|
13
|
-
const init_1 = require("./commands/init");
|
|
14
|
-
const new_1 = require("./commands/new");
|
|
15
|
-
const i18n_1 = require("./commands/i18n");
|
|
16
|
-
const migrate_1 = require("./commands/migrate");
|
|
17
|
-
const ai_1 = require("./commands/ai");
|
|
18
|
-
const sync_1 = require("./commands/sync");
|
|
4
|
+
const lifecycle_1 = require("./register/lifecycle");
|
|
5
|
+
const scaffold_1 = require("./register/scaffold");
|
|
6
|
+
const database_1 = require("./register/database");
|
|
7
|
+
const ai_1 = require("./register/ai");
|
|
8
|
+
const tools_1 = require("./register/tools");
|
|
9
|
+
const i18n_1 = require("./register/i18n");
|
|
19
10
|
const program = new commander_1.Command();
|
|
20
11
|
program
|
|
21
12
|
.name('objectql')
|
|
22
|
-
.description('ObjectQL CLI tool')
|
|
13
|
+
.description('ObjectQL CLI tool - The ObjectStack AI Protocol Interface')
|
|
23
14
|
.version('1.5.0');
|
|
24
|
-
//
|
|
25
|
-
program
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.option('--skip-git', 'Skip git initialization')
|
|
33
|
-
.action(async (options) => {
|
|
34
|
-
try {
|
|
35
|
-
await (0, init_1.initProject)(options);
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
console.error(error);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
// New command - Generate metadata files
|
|
43
|
-
program
|
|
44
|
-
.command('new <type> <name>')
|
|
45
|
-
.description('Generate a new metadata file (object, view, form, etc.)')
|
|
46
|
-
.option('-d, --dir <path>', 'Output directory', '.')
|
|
47
|
-
.action(async (type, name, options) => {
|
|
48
|
-
try {
|
|
49
|
-
await (0, new_1.newMetadata)({ type, name, dir: options.dir });
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
console.error(error);
|
|
53
|
-
process.exit(1);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
// Generate command - Generate TypeScript types
|
|
57
|
-
program
|
|
58
|
-
.command('generate')
|
|
59
|
-
.alias('g')
|
|
60
|
-
.description('Generate TypeScript interfaces from ObjectQL schema files')
|
|
61
|
-
.option('-s, --source <path>', 'Source directory containing *.object.yml', '.')
|
|
62
|
-
.option('-o, --output <path>', 'Output directory for generated types', './src/generated')
|
|
63
|
-
.action(async (options) => {
|
|
64
|
-
try {
|
|
65
|
-
await (0, generate_1.generateTypes)(options.source, options.output);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
console.error(error);
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
// I18n commands
|
|
73
|
-
const i18nCmd = program
|
|
74
|
-
.command('i18n')
|
|
75
|
-
.description('Internationalization commands');
|
|
76
|
-
i18nCmd
|
|
77
|
-
.command('extract')
|
|
78
|
-
.description('Extract translatable strings from metadata files')
|
|
79
|
-
.option('-s, --source <path>', 'Source directory', '.')
|
|
80
|
-
.option('-o, --output <path>', 'Output directory', './src/i18n')
|
|
81
|
-
.option('-l, --lang <lang>', 'Language code', 'en')
|
|
82
|
-
.action(async (options) => {
|
|
83
|
-
try {
|
|
84
|
-
await (0, i18n_1.i18nExtract)(options);
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
console.error(error);
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
i18nCmd
|
|
92
|
-
.command('init <lang>')
|
|
93
|
-
.description('Initialize i18n for a new language')
|
|
94
|
-
.option('-b, --base-dir <path>', 'Base i18n directory', './src/i18n')
|
|
95
|
-
.action(async (lang, options) => {
|
|
96
|
-
try {
|
|
97
|
-
await (0, i18n_1.i18nInit)({ lang, baseDir: options.baseDir });
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
console.error(error);
|
|
101
|
-
process.exit(1);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
i18nCmd
|
|
105
|
-
.command('validate <lang>')
|
|
106
|
-
.description('Validate translation completeness')
|
|
107
|
-
.option('-b, --base-dir <path>', 'Base i18n directory', './src/i18n')
|
|
108
|
-
.option('--base-lang <lang>', 'Base language to compare against', 'en')
|
|
109
|
-
.action(async (lang, options) => {
|
|
110
|
-
try {
|
|
111
|
-
await (0, i18n_1.i18nValidate)({ lang, baseDir: options.baseDir, baseLang: options.baseLang });
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
console.error(error);
|
|
115
|
-
process.exit(1);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
// Migration commands
|
|
119
|
-
const migrateCmd = program
|
|
120
|
-
.command('migrate')
|
|
121
|
-
.description('Run pending database migrations')
|
|
122
|
-
.option('-c, --config <path>', 'Path to objectql.config.ts/js')
|
|
123
|
-
.option('-d, --dir <path>', 'Migrations directory', './migrations')
|
|
124
|
-
.action(async (options) => {
|
|
125
|
-
try {
|
|
126
|
-
await (0, migrate_1.migrate)(options);
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
console.error(error);
|
|
130
|
-
process.exit(1);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
migrateCmd
|
|
134
|
-
.command('create <name>')
|
|
135
|
-
.description('Create a new migration file')
|
|
136
|
-
.option('-d, --dir <path>', 'Migrations directory', './migrations')
|
|
137
|
-
.action(async (name, options) => {
|
|
138
|
-
try {
|
|
139
|
-
await (0, migrate_1.migrateCreate)({ name, dir: options.dir });
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
console.error(error);
|
|
143
|
-
process.exit(1);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
migrateCmd
|
|
147
|
-
.command('status')
|
|
148
|
-
.description('Show migration status')
|
|
149
|
-
.option('-c, --config <path>', 'Path to objectql.config.ts/js')
|
|
150
|
-
.option('-d, --dir <path>', 'Migrations directory', './migrations')
|
|
151
|
-
.action(async (options) => {
|
|
152
|
-
try {
|
|
153
|
-
await (0, migrate_1.migrateStatus)(options);
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
console.error(error);
|
|
157
|
-
process.exit(1);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
// Sync command - Introspect database and generate .object.yml files
|
|
161
|
-
program
|
|
162
|
-
.command('sync')
|
|
163
|
-
.description('Sync database schema to ObjectQL object definitions')
|
|
164
|
-
.option('-c, --config <path>', 'Path to objectql.config.ts/js')
|
|
165
|
-
.option('-o, --output <path>', 'Output directory for .object.yml files', './src/objects')
|
|
166
|
-
.option('-t, --tables <tables...>', 'Specific tables to sync (default: all)')
|
|
167
|
-
.option('-f, --force', 'Overwrite existing files')
|
|
168
|
-
.action(async (options) => {
|
|
169
|
-
try {
|
|
170
|
-
await (0, sync_1.syncDatabase)(options);
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
console.error(error);
|
|
174
|
-
process.exit(1);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
// REPL command
|
|
178
|
-
program
|
|
179
|
-
.command('repl')
|
|
180
|
-
.alias('r')
|
|
181
|
-
.description('Start an interactive shell (REPL) to query the database')
|
|
182
|
-
.option('-c, --config <path>', 'Path to objectql.config.ts/js')
|
|
183
|
-
.action(async (options) => {
|
|
184
|
-
await (0, repl_1.startRepl)(options.config);
|
|
185
|
-
});
|
|
186
|
-
// Dev command - Start development server
|
|
187
|
-
program
|
|
188
|
-
.command('dev')
|
|
189
|
-
.alias('d')
|
|
190
|
-
.description('Start development server with hot reload')
|
|
191
|
-
.option('-p, --port <number>', 'Port to listen on', '3000')
|
|
192
|
-
.option('-d, --dir <path>', 'Directory containing schema', '.')
|
|
193
|
-
.option('--no-watch', 'Disable file watching')
|
|
194
|
-
.action(async (options) => {
|
|
195
|
-
await (0, dev_1.dev)({
|
|
196
|
-
port: parseInt(options.port),
|
|
197
|
-
dir: options.dir,
|
|
198
|
-
watch: options.watch
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
// Start command - Production server
|
|
202
|
-
program
|
|
203
|
-
.command('start')
|
|
204
|
-
.description('Start production server')
|
|
205
|
-
.option('-p, --port <number>', 'Port to listen on', '3000')
|
|
206
|
-
.option('-d, --dir <path>', 'Directory containing schema', '.')
|
|
207
|
-
.option('-c, --config <path>', 'Path to objectql.config.ts/js')
|
|
208
|
-
.action(async (options) => {
|
|
209
|
-
await (0, start_1.start)({
|
|
210
|
-
port: parseInt(options.port),
|
|
211
|
-
dir: options.dir,
|
|
212
|
-
config: options.config
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
// Build command - Build project for production
|
|
216
|
-
program
|
|
217
|
-
.command('build')
|
|
218
|
-
.alias('b')
|
|
219
|
-
.description('Build project and generate types')
|
|
220
|
-
.option('-d, --dir <path>', 'Source directory', '.')
|
|
221
|
-
.option('-o, --output <path>', 'Output directory', './dist')
|
|
222
|
-
.option('--no-types', 'Skip TypeScript type generation')
|
|
223
|
-
.option('--no-validate', 'Skip metadata validation')
|
|
224
|
-
.action(async (options) => {
|
|
225
|
-
await (0, build_1.build)({
|
|
226
|
-
dir: options.dir,
|
|
227
|
-
output: options.output,
|
|
228
|
-
types: options.types,
|
|
229
|
-
validate: options.validate
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
// Test command - Run tests
|
|
233
|
-
program
|
|
234
|
-
.command('test')
|
|
235
|
-
.alias('t')
|
|
236
|
-
.description('Run tests')
|
|
237
|
-
.option('-d, --dir <path>', 'Project directory', '.')
|
|
238
|
-
.option('-w, --watch', 'Watch mode')
|
|
239
|
-
.option('--coverage', 'Generate coverage report')
|
|
240
|
-
.action(async (options) => {
|
|
241
|
-
await (0, test_1.test)({
|
|
242
|
-
dir: options.dir,
|
|
243
|
-
watch: options.watch,
|
|
244
|
-
coverage: options.coverage
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
// Lint command - Validate metadata
|
|
248
|
-
program
|
|
249
|
-
.command('lint')
|
|
250
|
-
.alias('l')
|
|
251
|
-
.description('Validate metadata files')
|
|
252
|
-
.option('-d, --dir <path>', 'Directory to lint', '.')
|
|
253
|
-
.option('--fix', 'Automatically fix issues')
|
|
254
|
-
.action(async (options) => {
|
|
255
|
-
await (0, lint_1.lint)({
|
|
256
|
-
dir: options.dir,
|
|
257
|
-
fix: options.fix
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
// Format command - Format metadata files
|
|
261
|
-
program
|
|
262
|
-
.command('format')
|
|
263
|
-
.alias('fmt')
|
|
264
|
-
.description('Format metadata files with Prettier')
|
|
265
|
-
.option('-d, --dir <path>', 'Directory to format', '.')
|
|
266
|
-
.option('--check', 'Check if files are formatted without modifying')
|
|
267
|
-
.action(async (options) => {
|
|
268
|
-
await (0, format_1.format)({
|
|
269
|
-
dir: options.dir,
|
|
270
|
-
check: options.check
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
// Serve command (kept for backwards compatibility)
|
|
274
|
-
program
|
|
275
|
-
.command('serve')
|
|
276
|
-
.alias('s')
|
|
277
|
-
.description('Start a development server (alias for dev)')
|
|
278
|
-
.option('-p, --port <number>', 'Port to listen on', '3000')
|
|
279
|
-
.option('-d, --dir <path>', 'Directory containing schema', '.')
|
|
280
|
-
.action(async (options) => {
|
|
281
|
-
await (0, serve_1.serve)({ port: parseInt(options.port), dir: options.dir });
|
|
282
|
-
});
|
|
283
|
-
// AI command - Interactive by default, with specific subcommands for other modes
|
|
284
|
-
const aiCmd = program
|
|
285
|
-
.command('ai')
|
|
286
|
-
.description('AI-powered interactive application builder (starts conversational mode by default)');
|
|
287
|
-
// Default action: Interactive conversational mode
|
|
288
|
-
aiCmd
|
|
289
|
-
.argument('[output-dir]', 'Output directory for generated files', './src')
|
|
290
|
-
.action(async (outputDir) => {
|
|
291
|
-
try {
|
|
292
|
-
await (0, ai_1.aiConversational)({ output: outputDir });
|
|
293
|
-
}
|
|
294
|
-
catch (error) {
|
|
295
|
-
console.error(error);
|
|
296
|
-
process.exit(1);
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
// Subcommand: Generate (one-shot generation)
|
|
300
|
-
aiCmd
|
|
301
|
-
.command('generate')
|
|
302
|
-
.description('Generate application from description (one-shot, non-interactive)')
|
|
303
|
-
.requiredOption('-d, --description <text>', 'Application description')
|
|
304
|
-
.option('-o, --output <path>', 'Output directory', './src')
|
|
305
|
-
.option('-t, --type <type>', 'Generation type: basic, complete, or custom', 'custom')
|
|
306
|
-
.action(async (options) => {
|
|
307
|
-
try {
|
|
308
|
-
await (0, ai_1.aiGenerate)(options);
|
|
309
|
-
}
|
|
310
|
-
catch (error) {
|
|
311
|
-
console.error(error);
|
|
312
|
-
process.exit(1);
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
// Subcommand: Validate
|
|
316
|
-
aiCmd
|
|
317
|
-
.command('validate')
|
|
318
|
-
.description('Validate metadata files with AI analysis')
|
|
319
|
-
.argument('<path>', 'Path to metadata files directory')
|
|
320
|
-
.option('--fix', 'Automatically fix issues')
|
|
321
|
-
.option('-v, --verbose', 'Detailed output')
|
|
322
|
-
.action(async (pathArg, options) => {
|
|
323
|
-
try {
|
|
324
|
-
await (0, ai_1.aiValidate)({ path: pathArg, ...options });
|
|
325
|
-
}
|
|
326
|
-
catch (error) {
|
|
327
|
-
console.error(error);
|
|
328
|
-
process.exit(1);
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
// Subcommand: Chat
|
|
332
|
-
aiCmd
|
|
333
|
-
.command('chat')
|
|
334
|
-
.description('AI assistant for questions and guidance')
|
|
335
|
-
.option('-p, --prompt <text>', 'Initial prompt')
|
|
336
|
-
.action(async (options) => {
|
|
337
|
-
try {
|
|
338
|
-
await (0, ai_1.aiChat)({ initialPrompt: options.prompt });
|
|
339
|
-
}
|
|
340
|
-
catch (error) {
|
|
341
|
-
console.error(error);
|
|
342
|
-
process.exit(1);
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
program.parse();
|
|
15
|
+
// Register all command groups
|
|
16
|
+
(0, lifecycle_1.registerLifecycleCommands)(program);
|
|
17
|
+
(0, scaffold_1.registerScaffoldCommands)(program);
|
|
18
|
+
(0, database_1.registerDatabaseCommands)(program);
|
|
19
|
+
(0, ai_1.registerAiCommands)(program);
|
|
20
|
+
(0, tools_1.registerToolsCommands)(program);
|
|
21
|
+
(0, i18n_1.registerI18nCommands)(program);
|
|
22
|
+
program.parse(process.argv);
|
|
346
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,oDAAiE;AACjE,kDAA+D;AAC/D,kDAA+D;AAC/D,sCAAmD;AACnD,4CAAyD;AACzD,0CAAuD;AAEvD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,2DAA2D,CAAC;KACxE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,8BAA8B;AAC9B,IAAA,qCAAyB,EAAC,OAAO,CAAC,CAAC;AACnC,IAAA,mCAAwB,EAAC,OAAO,CAAC,CAAC;AAClC,IAAA,mCAAwB,EAAC,OAAO,CAAC,CAAC;AAClC,IAAA,uBAAkB,EAAC,OAAO,CAAC,CAAC;AAC5B,IAAA,6BAAqB,EAAC,OAAO,CAAC,CAAC;AAC/B,IAAA,2BAAoB,EAAC,OAAO,CAAC,CAAC;AAE9B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerAiCommands = registerAiCommands;
|
|
4
|
+
const ai_1 = require("../commands/ai");
|
|
5
|
+
function registerAiCommands(program) {
|
|
6
|
+
const aiCmd = program
|
|
7
|
+
.command('ai')
|
|
8
|
+
.description('AI Architect capabilities');
|
|
9
|
+
aiCmd
|
|
10
|
+
.command('chat')
|
|
11
|
+
.description('Interactive architecture chat')
|
|
12
|
+
.option('-p, --prompt <text>', 'Initial prompt')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
await (0, ai_1.aiChat)({ initialPrompt: options.prompt });
|
|
15
|
+
});
|
|
16
|
+
aiCmd
|
|
17
|
+
.command('run <prompt>')
|
|
18
|
+
.description('Execute an AI modification on the project (e.g. "Add a blog module")')
|
|
19
|
+
.option('-o, --output <path>', 'Output directory', './src')
|
|
20
|
+
.action(async (prompt, options) => {
|
|
21
|
+
await (0, ai_1.aiGenerate)({ description: prompt, output: options.output, type: 'custom' });
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/register/ai.ts"],"names":[],"mappings":";;AAGA,gDAoBC;AAtBD,uCAAoD;AAEpD,SAAgB,kBAAkB,CAAC,OAAgB;IAC/C,MAAM,KAAK,GAAG,OAAO;SAChB,OAAO,CAAC,IAAI,CAAC;SACb,WAAW,CAAC,2BAA2B,CAAC,CAAC;IAE9C,KAAK;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,+BAA+B,CAAC;SAC5C,MAAM,CAAC,qBAAqB,EAAE,gBAAgB,CAAC;SAC/C,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACtB,MAAM,IAAA,WAAM,EAAC,EAAE,aAAa,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEP,KAAK;SACA,OAAO,CAAC,cAAc,CAAC;SACvB,WAAW,CAAC,sEAAsE,CAAC;SACnF,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,OAAO,CAAC;SAC1D,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;QAC9B,MAAM,IAAA,eAAU,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDatabaseCommands = registerDatabaseCommands;
|
|
4
|
+
const sync_1 = require("../commands/sync");
|
|
5
|
+
const database_push_1 = require("../commands/database-push");
|
|
6
|
+
const migrate_1 = require("../commands/migrate");
|
|
7
|
+
function registerDatabaseCommands(program) {
|
|
8
|
+
const dbCmd = program.command('db').description('Database operations');
|
|
9
|
+
dbCmd
|
|
10
|
+
.command('push')
|
|
11
|
+
.description('Push metadata schema changes to the database')
|
|
12
|
+
.option('--force', 'Bypass safety checks')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
try {
|
|
15
|
+
await (0, database_push_1.dbPushCommand)(options);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
console.error(error);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
dbCmd
|
|
23
|
+
.command('pull')
|
|
24
|
+
.description('Introspect database and generate metadata (Reverse Engineering)')
|
|
25
|
+
.option('-c, --config <path>', 'Path to objectql.config.ts/js')
|
|
26
|
+
.option('-o, --output <path>', 'Output directory', './src/objects')
|
|
27
|
+
.option('-t, --tables <tables...>', 'Specific tables to sync')
|
|
28
|
+
.option('-f, --force', 'Overwrite existing files')
|
|
29
|
+
.action(async (options) => {
|
|
30
|
+
try {
|
|
31
|
+
// Maps to existing syncDatabase
|
|
32
|
+
await (0, sync_1.syncDatabase)(options);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.error(error);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const migrateCmd = program
|
|
40
|
+
.command('migrate')
|
|
41
|
+
.description('Manage database migrations');
|
|
42
|
+
migrateCmd
|
|
43
|
+
.command('up')
|
|
44
|
+
.description('Run pending migrations')
|
|
45
|
+
.option('-c, --config <path>', 'Path to objectql.config.ts/js')
|
|
46
|
+
.option('-d, --dir <path>', 'Migrations directory', './migrations')
|
|
47
|
+
.action(async (options) => {
|
|
48
|
+
await (0, migrate_1.migrate)(options);
|
|
49
|
+
});
|
|
50
|
+
migrateCmd
|
|
51
|
+
.command('create <name>')
|
|
52
|
+
.description('Create a new migration file')
|
|
53
|
+
.option('-d, --dir <path>', 'Migrations directory', './migrations')
|
|
54
|
+
.action(async (name, options) => {
|
|
55
|
+
await (0, migrate_1.migrateCreate)({ name, dir: options.dir });
|
|
56
|
+
});
|
|
57
|
+
migrateCmd
|
|
58
|
+
.command('status')
|
|
59
|
+
.description('Show migration status')
|
|
60
|
+
.action(async (options) => {
|
|
61
|
+
await (0, migrate_1.migrateStatus)(options);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/register/database.ts"],"names":[],"mappings":";;AAKA,4DA4DC;AAhED,2CAAgD;AAChD,6DAA0D;AAC1D,iDAA4E;AAE5E,SAAgB,wBAAwB,CAAC,OAAgB;IACrD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;IAEvE,KAAK;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,SAAS,EAAE,sBAAsB,CAAC;SACzC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACtB,IAAI,CAAC;YACD,MAAM,IAAA,6BAAa,EAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,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O,EAAE,EAAE;QAC5B,MAAM,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEP,UAAU;SACL,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,uBAAuB,CAAC;SACpC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACtB,MAAM,IAAA,uBAAa,EAAC,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerI18nCommands = registerI18nCommands;
|
|
4
|
+
const i18n_1 = require("../commands/i18n");
|
|
5
|
+
function registerI18nCommands(program) {
|
|
6
|
+
const i18nCmd = program
|
|
7
|
+
.command('i18n')
|
|
8
|
+
.description('Internationalization commands');
|
|
9
|
+
i18nCmd
|
|
10
|
+
.command('extract')
|
|
11
|
+
.description('Extract translatable strings from metadata files')
|
|
12
|
+
.option('-s, --source <path>', 'Source directory', '.')
|
|
13
|
+
.option('-o, --output <path>', 'Output directory', './src/i18n')
|
|
14
|
+
.option('-l, --lang <lang>', 'Language code', 'en')
|
|
15
|
+
.action(async (options) => {
|
|
16
|
+
try {
|
|
17
|
+
await (0, i18n_1.i18nExtract)(options);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
console.error(error);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
i18nCmd
|
|
25
|
+
.command('init <lang>')
|
|
26
|
+
.description('Initialize i18n for a new language')
|
|
27
|
+
.option('-b, --base-dir <path>', 'Base i18n directory', './src/i18n')
|
|
28
|
+
.action(async (lang, options) => {
|
|
29
|
+
try {
|
|
30
|
+
await (0, i18n_1.i18nInit)({ lang, baseDir: options.baseDir });
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
console.error(error);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
i18nCmd
|
|
38
|
+
.command('validate <lang>')
|
|
39
|
+
.description('Validate translation completeness')
|
|
40
|
+
.option('-b, --base-dir <path>', 'Base i18n directory', './src/i18n')
|
|
41
|
+
.option('--base-lang <lang>', 'Base language to compare against', 'en')
|
|
42
|
+
.action(async (lang, options) => {
|
|
43
|
+
try {
|
|
44
|
+
await (0, i18n_1.i18nValidate)({ lang, baseDir: options.baseDir, baseLang: options.baseLang });
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/register/i18n.ts"],"names":[],"mappings":";;AAGA,oDA8CC;AAhDD,2CAAuE;AAEvE,SAAgB,oBAAoB,CAAC,OAAgB;IACjD,MAAM,OAAO,GAAG,OAAO;SAClB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAElD,OAAO;SACF,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,CAAC;SACtD,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,EAAE,YAAY,CAAC;SAC/D,MAAM,CAAC,mBAAmB,EAAE,eAAe,EAAE,IAAI,CAAC;SAClD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACtB,IAAI,CAAC;YACD,MAAM,IAAA,kBAAW,EAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,KA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