Skip to content

Commit 64cebcf

Browse files
committed
chore: updates for 0.25 coordination
1 parent 23a6e0a commit 64cebcf

File tree

11 files changed

+26
-478
lines changed

11 files changed

+26
-478
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Project Structure & Module Organization
44

5-
Core CLI logic lives in `src/`: `cli/` exposes the executable wrapper, `drizzle-to-zero.ts` coordinates schema translation, adapters sit in `node-postgres/` and `postgres-js/`, and helpers such as `tables.ts` or `relations.ts` centralize shared builders. Vitest unit suites reside in `tests/`, while end-to-end fixtures live under `integration/`, `no-config-integration/`, and `db/`. Generated bundles land in `dist/` and coverage reports in `coverage/`; treat them as expendable artifacts unless you are preparing a release.
5+
Core CLI logic lives in `src/`: `cli/` exposes the executable wrapper, `drizzle-to-zero.ts` coordinates schema translation, and helpers such as `tables.ts` or `relations.ts` centralize shared builders. Vitest unit suites reside in `tests/`, while end-to-end fixtures live under `integration/`, `no-config-integration/`, and `db/`. Generated bundles land in `dist/` and coverage reports in `coverage/`; treat them as expendable artifacts unless you are preparing a release.
66

77
## Build, Test, and Development Commands
88

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ You can also control optional outputs from the generator:
9292

9393
- **--skip-types**: Skip generating table `Row<>` type exports.
9494
- **--skip-builder**: Skip generating the query `builder` export.
95-
- **--disable-legacy-mutators**: Disable legacy CRUD mutators (sets `enableLegacyMutators` to `false` in the generated schema). Use this when you want to use only custom mutators instead of the default CRUD operations.
96-
- **--disable-legacy-queries**: Disable legacy CRUD queries (sets `enableLegacyQueries` to `false` in the generated schema). Use this when you want to use only custom queries.
95+
- **--enable-legacy-mutators**: Disable legacy CRUD mutators (sets `enableLegacyMutators` to `true` in the generated schema).
96+
- **--enable-legacy-queries**: Disable legacy CRUD queries (sets `enableLegacyQueries` to `true` in the generated schema).
9797

9898
For more information on disabling legacy mutators and queries, see the [Zero documentation](https://zero.rocicorp.dev/docs/custom-mutators#disabling-crud-mutators).
9999

build.ts

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,7 @@ const main = async () => {
1919
],
2020
});
2121

22-
await tsup.build({
23-
outDir: "./dist/postgres-js",
24-
splitting: false,
25-
dts: true,
26-
entry: ["src/postgres-js/index.ts"],
27-
format: ["cjs", "esm"],
28-
external: [
29-
"esbuild",
30-
"tsx",
31-
"prettier",
32-
"typescript",
33-
"@rocicorp/zero",
34-
"drizzle-orm",
35-
"commander",
36-
"ts-morph",
37-
],
38-
});
39-
40-
await tsup.build({
41-
outDir: "./dist/node-postgres",
42-
splitting: false,
43-
dts: true,
44-
entry: ["src/node-postgres/index.ts"],
45-
format: ["cjs", "esm"],
46-
external: [
47-
"esbuild",
48-
"tsx",
49-
"prettier",
50-
"typescript",
51-
"@rocicorp/zero",
52-
"drizzle-orm",
53-
"commander",
54-
"ts-morph",
55-
],
56-
});
22+
5723

5824
await tsup.build({
5925
outDir: "./dist/cli",

integration/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"scripts": {
66
"build": "tsc",
7-
"drizzle-zero:generate": "drizzle-zero generate -f --disable-legacy-mutators --disable-legacy-queries",
7+
"drizzle-zero:generate": "drizzle-zero generate -f",
88
"pretest": "pnpm drizzle-zero:generate",
99
"test": "pnpm build && vitest run"
1010
},

no-config-integration/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"scripts": {
66
"build": "tsc",
7-
"drizzle-zero:generate": "drizzle-zero generate -f -s ../db/schema.ts --disable-legacy-mutators --disable-legacy-queries",
7+
"drizzle-zero:generate": "drizzle-zero generate -f -s ../db/schema.ts",
88
"pretest": "pnpm drizzle-zero:generate",
99
"test": "pnpm build && vitest run"
1010
},

package.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-zero",
3-
"version": "0.16.2",
3+
"version": "0.17.0",
44
"description": "Generate Zero schemas from Drizzle ORM schemas",
55
"type": "module",
66
"scripts": {
@@ -23,16 +23,6 @@
2323
"import": "./dist/index.js",
2424
"require": "./dist/index.cjs"
2525
},
26-
"./node-postgres": {
27-
"types": "./dist/node-postgres/index.d.ts",
28-
"import": "./dist/node-postgres/index.js",
29-
"require": "./dist/node-postgres/index.cjs"
30-
},
31-
"./postgres-js": {
32-
"types": "./dist/postgres-js/index.d.ts",
33-
"import": "./dist/postgres-js/index.js",
34-
"require": "./dist/postgres-js/index.cjs"
35-
},
3626
"./package.json": "./package.json"
3727
},
3828
"files": [
@@ -65,7 +55,7 @@
6555
"url": "https://github.com/0xcadams/drizzle-zero/issues"
6656
},
6757
"peerDependencies": {
68-
"@rocicorp/zero": ">=0.22.2025081301",
58+
"@rocicorp/zero": "",
6959
"@types/pg": "",
7060
"drizzle-orm": ">=0.36.0",
7161
"pg": "",

src/cli/index.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export interface GeneratorOptions {
5555
jsFileExtension?: boolean;
5656
skipTypes?: boolean;
5757
skipBuilder?: boolean;
58-
disableLegacyMutators?: boolean;
59-
disableLegacyQueries?: boolean;
58+
enableLegacyMutators?: boolean;
59+
enableLegacyQueries?: boolean;
6060
}
6161

6262
async function main(opts: GeneratorOptions = {}) {
@@ -71,8 +71,8 @@ async function main(opts: GeneratorOptions = {}) {
7171
jsFileExtension,
7272
skipTypes,
7373
skipBuilder,
74-
disableLegacyMutators,
75-
disableLegacyQueries,
74+
enableLegacyMutators,
75+
enableLegacyQueries,
7676
} = { ...opts };
7777

7878
const resolvedTsConfigPath = tsConfigPath ?? defaultTsConfigFile;
@@ -142,8 +142,8 @@ async function main(opts: GeneratorOptions = {}) {
142142
jsExtensionOverride: jsFileExtension ? "force" : "auto",
143143
skipTypes: Boolean(skipTypes),
144144
skipBuilder: Boolean(skipBuilder),
145-
disableLegacyMutators: Boolean(disableLegacyMutators),
146-
disableLegacyQueries: Boolean(disableLegacyQueries),
145+
enableLegacyMutators: Boolean(enableLegacyMutators),
146+
enableLegacyQueries: Boolean(enableLegacyQueries),
147147
});
148148

149149
if (format) {
@@ -190,13 +190,13 @@ async function cli() {
190190
.option("--skip-types", "Skip generating table Row<> type exports", false)
191191
.option("--skip-builder", "Skip generating the builder export", false)
192192
.option(
193-
"--disable-legacy-mutators",
194-
"Disable legacy CRUD mutators (sets enableLegacyMutators to false)",
193+
"--enable-legacy-mutators",
194+
"Enable legacy CRUD mutators (sets enableLegacyMutators to true)",
195195
false,
196196
)
197197
.option(
198-
"--disable-legacy-queries",
199-
"Disable legacy CRUD queries (sets enableLegacyQueries to false)",
198+
"--enable-legacy-queries",
199+
"Enable legacy CRUD queries (sets enableLegacyQueries to true)",
200200
false,
201201
)
202202
.action(async (command) => {
@@ -213,8 +213,8 @@ async function cli() {
213213
jsFileExtension: command.jsFileExtension,
214214
skipTypes: command.skipTypes,
215215
skipBuilder: command.skipBuilder,
216-
disableLegacyMutators: command.disableLegacyMutators,
217-
disableLegacyQueries: command.disableLegacyQueries,
216+
enableLegacyMutators: command.enableLegacyMutators,
217+
enableLegacyQueries: command.enableLegacyQueries,
218218
});
219219

220220
if (command.output) {

src/cli/shared.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export async function getGeneratedSchema({
1717
jsExtensionOverride = "auto",
1818
skipTypes = false,
1919
skipBuilder = false,
20-
disableLegacyMutators = false,
21-
disableLegacyQueries = false,
20+
enableLegacyMutators = false,
21+
enableLegacyQueries = false,
2222
debug,
2323
}: {
2424
tsProject: Project;
@@ -29,8 +29,8 @@ export async function getGeneratedSchema({
2929
jsExtensionOverride?: "auto" | "force" | "none";
3030
skipTypes?: boolean;
3131
skipBuilder?: boolean;
32-
disableLegacyMutators?: boolean;
33-
disableLegacyQueries?: boolean;
32+
enableLegacyMutators?: boolean;
33+
enableLegacyQueries?: boolean;
3434
debug?: boolean;
3535
}) {
3636
// Auto-detect if .js extensions are needed based on tsconfig
@@ -360,9 +360,9 @@ export async function getGeneratedSchema({
360360
);
361361
}
362362
} else if (key === "enableLegacyMutators") {
363-
writer.write(disableLegacyMutators ? "false" : "true");
363+
writer.write(enableLegacyMutators ? "true" : "false");
364364
} else if (key === "enableLegacyQueries") {
365-
writer.write(disableLegacyQueries ? "false" : "true");
365+
writer.write(enableLegacyQueries ? "true" : "false");
366366
} else {
367367
writeValue(writer, propValue, {
368368
keys: [...keys, key],

src/node-postgres/index.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

src/postgres-js/index.ts

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)