zitejs 0.9.15 → 0.9.16
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/dist/cjs/cli.js +9 -3
- package/dist/cjs/dev/index.js +17 -0
- package/dist/esm/cli.js +9 -3
- package/dist/esm/dev/index.d.ts +1 -0
- package/dist/esm/dev/index.js +16 -0
- package/package.json +1 -1
package/dist/cjs/cli.js
CHANGED
|
@@ -50,6 +50,11 @@ async function main() {
|
|
|
50
50
|
await runDev();
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
|
+
case 'generate': {
|
|
54
|
+
const { runGenerate } = await Promise.resolve().then(() => __importStar(require('./dev/index.js')));
|
|
55
|
+
await runGenerate();
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
53
58
|
case 'check': {
|
|
54
59
|
const { runCheck } = await Promise.resolve().then(() => __importStar(require('./check/index.js')));
|
|
55
60
|
await runCheck();
|
|
@@ -63,11 +68,12 @@ async function main() {
|
|
|
63
68
|
default:
|
|
64
69
|
console.error(command
|
|
65
70
|
? `Unknown command: ${command}`
|
|
66
|
-
: 'Usage: zitejs <sync|dev|check|bundle>');
|
|
71
|
+
: 'Usage: zitejs <sync|dev|generate|check|bundle>');
|
|
67
72
|
console.error('');
|
|
68
73
|
console.error('Commands:');
|
|
69
|
-
console.error(' sync
|
|
70
|
-
console.error(' dev
|
|
74
|
+
console.error(' sync Generate .zite/db.ts from database schema (single-app)');
|
|
75
|
+
console.error(' dev Run sync then watch for changes (like npx convex dev)');
|
|
76
|
+
console.error(' generate One-shot sync + regenerate all apps .zite/ files (monorepo)');
|
|
71
77
|
console.error(' check Run tsc --noEmit and vite build for all apps');
|
|
72
78
|
console.error(' bundle Bundle src/api/*.ts endpoints for cloudflare-lambda');
|
|
73
79
|
process.exit(1);
|
package/dist/cjs/dev/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runGenerate = runGenerate;
|
|
3
4
|
exports.runDev = runDev;
|
|
4
5
|
const fs_1 = require("fs");
|
|
5
6
|
const fs_2 = require("fs");
|
|
@@ -52,6 +53,22 @@ function regenerateAppApiTs(appDir) {
|
|
|
52
53
|
console.log(`Updated apps/${appDir}/.zite/api.ts`);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
56
|
+
async function runGenerate() {
|
|
57
|
+
// 1. Run sync (generates root .zite/db.ts)
|
|
58
|
+
try {
|
|
59
|
+
await (0, index_js_1.runSync)();
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
console.warn('Sync failed (continuing with app generation):', err instanceof Error ? err.message : err);
|
|
63
|
+
}
|
|
64
|
+
// 2. Find all apps and regenerate their .zite/ files
|
|
65
|
+
const appDirs = findAppDirs();
|
|
66
|
+
for (const app of appDirs) {
|
|
67
|
+
regenerateAppApiTs(app);
|
|
68
|
+
regenerateAppTypedWrappers(app);
|
|
69
|
+
}
|
|
70
|
+
console.log('Done!');
|
|
71
|
+
}
|
|
55
72
|
async function runDev() {
|
|
56
73
|
const env = process.env.ZITE_ENV ?? 'production';
|
|
57
74
|
console.log(`zitejs dev — environment: ${env}`);
|
package/dist/esm/cli.js
CHANGED
|
@@ -15,6 +15,11 @@ async function main() {
|
|
|
15
15
|
await runDev();
|
|
16
16
|
break;
|
|
17
17
|
}
|
|
18
|
+
case 'generate': {
|
|
19
|
+
const { runGenerate } = await import('./dev/index.js');
|
|
20
|
+
await runGenerate();
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
18
23
|
case 'check': {
|
|
19
24
|
const { runCheck } = await import('./check/index.js');
|
|
20
25
|
await runCheck();
|
|
@@ -28,11 +33,12 @@ async function main() {
|
|
|
28
33
|
default:
|
|
29
34
|
console.error(command
|
|
30
35
|
? `Unknown command: ${command}`
|
|
31
|
-
: 'Usage: zitejs <sync|dev|check|bundle>');
|
|
36
|
+
: 'Usage: zitejs <sync|dev|generate|check|bundle>');
|
|
32
37
|
console.error('');
|
|
33
38
|
console.error('Commands:');
|
|
34
|
-
console.error(' sync
|
|
35
|
-
console.error(' dev
|
|
39
|
+
console.error(' sync Generate .zite/db.ts from database schema (single-app)');
|
|
40
|
+
console.error(' dev Run sync then watch for changes (like npx convex dev)');
|
|
41
|
+
console.error(' generate One-shot sync + regenerate all apps .zite/ files (monorepo)');
|
|
36
42
|
console.error(' check Run tsc --noEmit and vite build for all apps');
|
|
37
43
|
console.error(' bundle Bundle src/api/*.ts endpoints for cloudflare-lambda');
|
|
38
44
|
process.exit(1);
|
package/dist/esm/dev/index.d.ts
CHANGED
package/dist/esm/dev/index.js
CHANGED
|
@@ -49,6 +49,22 @@ function regenerateAppApiTs(appDir) {
|
|
|
49
49
|
console.log(`Updated apps/${appDir}/.zite/api.ts`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
export async function runGenerate() {
|
|
53
|
+
// 1. Run sync (generates root .zite/db.ts)
|
|
54
|
+
try {
|
|
55
|
+
await runSync();
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
console.warn('Sync failed (continuing with app generation):', err instanceof Error ? err.message : err);
|
|
59
|
+
}
|
|
60
|
+
// 2. Find all apps and regenerate their .zite/ files
|
|
61
|
+
const appDirs = findAppDirs();
|
|
62
|
+
for (const app of appDirs) {
|
|
63
|
+
regenerateAppApiTs(app);
|
|
64
|
+
regenerateAppTypedWrappers(app);
|
|
65
|
+
}
|
|
66
|
+
console.log('Done!');
|
|
67
|
+
}
|
|
52
68
|
export async function runDev() {
|
|
53
69
|
const env = process.env.ZITE_ENV ?? 'production';
|
|
54
70
|
console.log(`zitejs dev — environment: ${env}`);
|