@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.cjs
CHANGED
|
@@ -2263,7 +2263,7 @@ var sqlite = {
|
|
|
2263
2263
|
const stmt = db.prepare(sql);
|
|
2264
2264
|
return stmt.all();
|
|
2265
2265
|
}, "all");
|
|
2266
|
-
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");
|
|
2266
|
+
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");
|
|
2267
2267
|
const autoIncrementTables = /* @__PURE__ */ new Set();
|
|
2268
2268
|
for (const t of tablesRaw) {
|
|
2269
2269
|
if (t.type === "table" && t.definition) {
|
|
@@ -3396,6 +3396,10 @@ async function run6(projectPath) {
|
|
|
3396
3396
|
name: "@zenstackhq/cli@latest",
|
|
3397
3397
|
dev: true
|
|
3398
3398
|
},
|
|
3399
|
+
{
|
|
3400
|
+
name: "@zenstackhq/schema@latest",
|
|
3401
|
+
dev: false
|
|
3402
|
+
},
|
|
3399
3403
|
{
|
|
3400
3404
|
name: "@zenstackhq/orm@latest",
|
|
3401
3405
|
dev: false
|
|
@@ -3680,7 +3684,8 @@ async function run9(options) {
|
|
|
3680
3684
|
}
|
|
3681
3685
|
const provider = (0, import_utils8.getStringLiteral)(dataSource?.fields.find((f) => f.name === "provider")?.value);
|
|
3682
3686
|
const dialect = await createDialect(provider, databaseUrl, outputPath);
|
|
3683
|
-
const
|
|
3687
|
+
const fileUrl = typeof __filename !== "undefined" ? __filename : import_meta3.url;
|
|
3688
|
+
const jiti = (0, import_jiti2.createJiti)(fileUrl);
|
|
3684
3689
|
const schemaModule = await jiti.import(import_node_path9.default.join(outputPath, "schema"));
|
|
3685
3690
|
const schema = schemaModule.schema;
|
|
3686
3691
|
const omit = {};
|
|
@@ -3698,7 +3703,8 @@ async function run9(options) {
|
|
|
3698
3703
|
const db = new import_orm.ZenStackClient(schema, {
|
|
3699
3704
|
dialect,
|
|
3700
3705
|
log: log && log.length > 0 ? log : void 0,
|
|
3701
|
-
omit: Object.keys(omit).length > 0 ? omit : void 0
|
|
3706
|
+
omit: Object.keys(omit).length > 0 ? omit : void 0,
|
|
3707
|
+
skipValidationForComputedFields: true
|
|
3702
3708
|
});
|
|
3703
3709
|
try {
|
|
3704
3710
|
await db.$connect();
|
|
@@ -3791,7 +3797,7 @@ async function createDialect(provider, databaseUrl, outputPath) {
|
|
|
3791
3797
|
}
|
|
3792
3798
|
}
|
|
3793
3799
|
__name(createDialect, "createDialect");
|
|
3794
|
-
function
|
|
3800
|
+
function createProxyApp(client, schema) {
|
|
3795
3801
|
const app = (0, import_express2.default)();
|
|
3796
3802
|
app.use((0, import_cors.default)());
|
|
3797
3803
|
app.use(import_express2.default.json({
|
|
@@ -3813,6 +3819,11 @@ function startServer(client, schema, options) {
|
|
|
3813
3819
|
zenstackVersion: getVersion()
|
|
3814
3820
|
});
|
|
3815
3821
|
});
|
|
3822
|
+
return app;
|
|
3823
|
+
}
|
|
3824
|
+
__name(createProxyApp, "createProxyApp");
|
|
3825
|
+
function startServer(client, schema, options) {
|
|
3826
|
+
const app = createProxyApp(client, schema);
|
|
3816
3827
|
const server = app.listen(options.port, () => {
|
|
3817
3828
|
console.log(`ZenStack proxy server is running on port: ${options.port}`);
|
|
3818
3829
|
console.log(`You can visit ZenStack Studio at: ${import_colors11.default.blue("https://studio.zenstack.dev")}`);
|