@zenstackhq/cli 3.4.1 → 3.4.3
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/index.cjs +15 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -2246,7 +2246,7 @@ var sqlite = {
|
|
|
2246
2246
|
const stmt = db.prepare(sql);
|
|
2247
2247
|
return stmt.all();
|
|
2248
2248
|
}, "all");
|
|
2249
|
-
const tablesRaw = all("SELECT name, type, sql AS definition FROM sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' ORDER BY name");
|
|
2249
|
+
const tablesRaw = all("SELECT name, type, sql AS definition FROM sqlite_schema WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%' AND name <> '_prisma_migrations' ORDER BY name");
|
|
2250
2250
|
const autoIncrementTables = /* @__PURE__ */ new Set();
|
|
2251
2251
|
for (const t of tablesRaw) {
|
|
2252
2252
|
if (t.type === "table" && t.definition) {
|
|
@@ -3379,6 +3379,10 @@ async function run6(projectPath) {
|
|
|
3379
3379
|
name: "@zenstackhq/cli@latest",
|
|
3380
3380
|
dev: true
|
|
3381
3381
|
},
|
|
3382
|
+
{
|
|
3383
|
+
name: "@zenstackhq/schema@latest",
|
|
3384
|
+
dev: false
|
|
3385
|
+
},
|
|
3382
3386
|
{
|
|
3383
3387
|
name: "@zenstackhq/orm@latest",
|
|
3384
3388
|
dev: false
|
|
@@ -3661,7 +3665,8 @@ async function run9(options) {
|
|
|
3661
3665
|
}
|
|
3662
3666
|
const provider = getStringLiteral2(dataSource?.fields.find((f) => f.name === "provider")?.value);
|
|
3663
3667
|
const dialect = await createDialect(provider, databaseUrl, outputPath);
|
|
3664
|
-
const
|
|
3668
|
+
const fileUrl = typeof __filename !== "undefined" ? __filename : import.meta.url;
|
|
3669
|
+
const jiti = createJiti2(fileUrl);
|
|
3665
3670
|
const schemaModule = await jiti.import(path9.join(outputPath, "schema"));
|
|
3666
3671
|
const schema = schemaModule.schema;
|
|
3667
3672
|
const omit = {};
|
|
@@ -3679,7 +3684,8 @@ async function run9(options) {
|
|
|
3679
3684
|
const db = new ZenStackClient(schema, {
|
|
3680
3685
|
dialect,
|
|
3681
3686
|
log: log && log.length > 0 ? log : void 0,
|
|
3682
|
-
omit: Object.keys(omit).length > 0 ? omit : void 0
|
|
3687
|
+
omit: Object.keys(omit).length > 0 ? omit : void 0,
|
|
3688
|
+
skipValidationForComputedFields: true
|
|
3683
3689
|
});
|
|
3684
3690
|
try {
|
|
3685
3691
|
await db.$connect();
|
|
@@ -3772,7 +3778,7 @@ async function createDialect(provider, databaseUrl, outputPath) {
|
|
|
3772
3778
|
}
|
|
3773
3779
|
}
|
|
3774
3780
|
__name(createDialect, "createDialect");
|
|
3775
|
-
function
|
|
3781
|
+
function createProxyApp(client, schema) {
|
|
3776
3782
|
const app = express();
|
|
3777
3783
|
app.use(cors());
|
|
3778
3784
|
app.use(express.json({
|
|
@@ -3794,6 +3800,11 @@ function startServer(client, schema, options) {
|
|
|
3794
3800
|
zenstackVersion: getVersion()
|
|
3795
3801
|
});
|
|
3796
3802
|
});
|
|
3803
|
+
return app;
|
|
3804
|
+
}
|
|
3805
|
+
__name(createProxyApp, "createProxyApp");
|
|
3806
|
+
function startServer(client, schema, options) {
|
|
3807
|
+
const app = createProxyApp(client, schema);
|
|
3797
3808
|
const server = app.listen(options.port, () => {
|
|
3798
3809
|
console.log(`ZenStack proxy server is running on port: ${options.port}`);
|
|
3799
3810
|
console.log(`You can visit ZenStack Studio at: ${colors11.blue("https://studio.zenstack.dev")}`);
|