Skip to content

Commit 807891e

Browse files
authored
Merge pull request #310 from zenstackhq/dev
merge dev to main (v3.0.0-beta.10)
2 parents 68adf79 + 05bf237 commit 807891e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+567
-474
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"skipFiles": ["<node_internals>/**"],
1212
"type": "node",
1313
"args": ["generate"],
14-
"cwd": "${workspaceFolder}/samples/blog/zenstack"
14+
"cwd": "${workspaceFolder}/samples/blog"
1515
},
1616
{
1717
"name": "Debug with TSX",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zenstack-v3",
3-
"version": "3.0.0-beta.9",
3+
"version": "3.0.0-beta.10",
44
"description": "ZenStack",
55
"packageManager": "[email protected]",
66
"scripts": {

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publisher": "zenstack",
44
"displayName": "ZenStack CLI",
55
"description": "FullStack database toolkit with built-in access control and automatic API generation.",
6-
"version": "3.0.0-beta.9",
6+
"version": "3.0.0-beta.10",
77
"type": "module",
88
"author": {
99
"name": "ZenStack Team"

packages/cli/src/actions/generate.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function runPlugins(schemaFile: string, model: Model, outputPath: string,
6464
for (const plugin of plugins) {
6565
const provider = getPluginProvider(plugin);
6666

67-
let cliPlugin: CliPlugin;
67+
let cliPlugin: CliPlugin | undefined;
6868
if (provider.startsWith('@core/')) {
6969
cliPlugin = (corePlugins as any)[provider.slice('@core/'.length)];
7070
if (!cliPlugin) {
@@ -78,12 +78,14 @@ async function runPlugins(schemaFile: string, model: Model, outputPath: string,
7878
}
7979
try {
8080
cliPlugin = (await import(moduleSpec)).default as CliPlugin;
81-
} catch (error) {
82-
throw new CliError(`Failed to load plugin ${provider}: ${error}`);
81+
} catch {
82+
// plugin may not export a generator so we simply ignore the error here
8383
}
8484
}
8585

86-
processedPlugins.push({ cliPlugin, pluginOptions: getPluginOptions(plugin) });
86+
if (cliPlugin) {
87+
processedPlugins.push({ cliPlugin, pluginOptions: getPluginOptions(plugin) });
88+
}
8789
}
8890

8991
const defaultPlugins = [corePlugins['typescript']].reverse();

packages/cli/src/actions/migrate.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ async function runDev(prismaSchemaFile: string, options: DevOptions) {
8282

8383
async function runReset(prismaSchemaFile: string, options: ResetOptions) {
8484
try {
85-
const cmd = ['prisma migrate reset', ` --schema "${prismaSchemaFile}"`, options.force ? ' --force' : ''].join(
86-
'',
87-
);
85+
const cmd = [
86+
'prisma migrate reset',
87+
` --schema "${prismaSchemaFile}"`,
88+
' --skip-generate',
89+
options.force ? ' --force' : ''
90+
].join('');
8891

8992
await execPackage(cmd);
9093
} catch (err) {

packages/cli/src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
// replaced at build time
22
export const TELEMETRY_TRACKING_TOKEN = '<TELEMETRY_TRACKING_TOKEN>';
3+
4+
// plugin-contributed model file name
5+
export const PLUGIN_MODULE_NAME = 'plugin.zmodel';

packages/common-helpers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/common-helpers",
3-
"version": "3.0.0-beta.9",
3+
"version": "3.0.0-beta.10",
44
"description": "ZenStack Common Helpers",
55
"type": "module",
66
"scripts": {

packages/config/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/eslint-config",
3-
"version": "3.0.0-beta.9",
3+
"version": "3.0.0-beta.10",
44
"type": "module",
55
"private": true,
66
"license": "MIT"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zenstackhq/typescript-config",
3-
"version": "3.0.0-beta.9",
3+
"version": "3.0.0-beta.10",
44
"private": true,
55
"license": "MIT"
66
}

packages/config/vitest-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@zenstackhq/vitest-config",
33
"type": "module",
4-
"version": "3.0.0-beta.9",
4+
"version": "3.0.0-beta.10",
55
"private": true,
66
"license": "MIT",
77
"exports": {

0 commit comments

Comments
 (0)