Skip to content

Commit 742f606

Browse files
authored
chore: don't generate attributes in frontend model meta (#798)
1 parent 600d13b commit 742f606

File tree

13 files changed

+41
-32
lines changed

13 files changed

+41
-32
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"test-ci": "ZENSTACK_TEST=1 pnpm -r run test --silent --forceExit",
99
"lint": "pnpm -r lint",
1010
"publish-all": "pnpm --filter \"./packages/**\" -r publish --access public",
11-
"publish-preview": "pnpm --filter \"./packages/**\" -r publish --force --registry https://preview.registry.zenstack.dev/"
11+
"publish-preview": "pnpm --filter \"./packages/**\" -r publish --force --registry https://preview.registry.zenstack.dev/",
12+
"unpublish-preview": "pnpm --recursive --shell-mode exec -- npm unpublish -f --registry https://preview.registry.zenstack.dev/ \"\\$PNPM_PACKAGE_NAME\""
1213
},
1314
"keywords": [],
1415
"author": "",

packages/language/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"watch": "concurrently \"langium generate --watch\" \"tsc --watch\"",
1111
"lint": "eslint src --ext ts",
1212
"build": "pnpm lint && pnpm clean && pnpm generate && tsc && copyfiles -F ./README.md ./LICENSE ./package.json dist && pnpm pack dist --pack-destination '../../../.build'",
13-
"prepublishOnly": "pnpm build",
14-
"publish-dev": "pnpm build && pnpm publish --tag dev"
13+
"prepublishOnly": "pnpm build"
1514
},
1615
"publishConfig": {
1716
"directory": "dist",

packages/plugins/swr/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"watch": "tsc --watch",
1515
"lint": "eslint src --ext ts",
1616
"test": "ZENSTACK_TEST=1 jest",
17-
"prepublishOnly": "pnpm build",
18-
"publish-dev": "pnpm publish --tag dev"
17+
"prepublishOnly": "pnpm build"
1918
},
2019
"publishConfig": {
2120
"directory": "dist",

packages/plugins/swr/src/generator.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ export async function generate(model: Model, options: PluginOptions, dmmf: DMMF.
3434

3535
const models = getDataModels(model);
3636

37-
await generateModelMeta(project, models, path.join(outDir, '__model_meta.ts'), false, true);
37+
await generateModelMeta(project, models, {
38+
output: path.join(outDir, '__model_meta.ts'),
39+
compile: false,
40+
preserveTsFiles: true,
41+
generateAttributes: false,
42+
});
3843

3944
generateIndex(project, outDir, models);
4045

packages/plugins/tanstack-query/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@
7070
"watch": "concurrently \"tsc --watch\" \"tsup-node --config ./tsup.config.ts --watch\" \"tsup-node --config ./tsup-v5.config.ts --watch\"",
7171
"lint": "eslint src --ext ts",
7272
"test": "ZENSTACK_TEST=1 jest",
73-
"prepublishOnly": "pnpm build",
74-
"publish-dev": "pnpm publish --tag dev"
73+
"prepublishOnly": "pnpm build"
7574
},
7675
"publishConfig": {
7776
"directory": "dist",

packages/plugins/tanstack-query/src/generator.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ export async function generate(model: Model, options: PluginOptions, dmmf: DMMF.
4545
throw new PluginError(options.name, `Unsupported version "${version}": use "v4" or "v5"`);
4646
}
4747

48-
await generateModelMeta(project, models, path.join(outDir, '__model_meta.ts'), false, true);
48+
await generateModelMeta(project, models, {
49+
output: path.join(outDir, '__model_meta.ts'),
50+
compile: false,
51+
preserveTsFiles: true,
52+
generateAttributes: false,
53+
});
4954

5055
generateIndex(project, outDir, models, target, version);
5156

packages/plugins/trpc/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"watch": "tsc --watch",
1515
"lint": "eslint src --ext ts",
1616
"test": "ZENSTACK_TEST=1 jest",
17-
"prepublishOnly": "pnpm build",
18-
"publish-dev": "pnpm publish --tag dev"
17+
"prepublishOnly": "pnpm build"
1918
},
2019
"publishConfig": {
2120
"directory": "dist",

packages/runtime/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"build": "pnpm lint && pnpm clean && tsc && tsup-node --config ./tsup-browser.config.ts && tsup-node --config ./tsup-cross.config.ts && copyfiles ./package.json ./README.md ../../LICENSE dist && copyfiles -u1 'res/**/*' dist && pnpm pack dist --pack-destination '../../../.build'",
1313
"watch": "concurrently \"tsc --watch\" \"tsup-node --config ./tsup-browser.config.ts --watch\" \"tsup-node --config ./tsup-cross.config.ts --watch\"",
1414
"lint": "eslint src --ext ts",
15-
"prepublishOnly": "pnpm build",
16-
"publish-dev": "pnpm publish --tag dev"
15+
"prepublishOnly": "pnpm build"
1716
},
1817
"main": "index.js",
1918
"types": "index.d.ts",

packages/schema/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"lint": "eslint src tests --ext ts",
7676
"test": "ZENSTACK_TEST=1 jest",
7777
"prepublishOnly": "pnpm build",
78-
"publish-dev": "pnpm publish --registry http://localhost:4873",
7978
"postinstall": "node bin/post-install.js"
8079
},
8180
"dependencies": {

packages/schema/src/plugins/model-meta/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ const run: PluginFunction = async (model, options, _dmmf, globalOptions) => {
3131
shouldCompile = globalOptions.compile;
3232
}
3333

34-
await generateModelMeta(project, dataModels, outFile, shouldCompile, options.preserveTsFiles === true);
34+
await generateModelMeta(project, dataModels, {
35+
output: outFile,
36+
compile: shouldCompile,
37+
preserveTsFiles: options.preserveTsFiles === true,
38+
generateAttributes: true,
39+
});
3540
};
3641

3742
export default run;

0 commit comments

Comments
 (0)