drizzle-kit 0.20.18-d190692 → 0.20.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/@types/utils.d.ts +12 -0
  2. package/bin.cjs +55769 -103683
  3. package/cli/commands/migrate.d.ts +270 -0
  4. package/cli/commands/mysqlIntrospect.d.ts +119 -0
  5. package/cli/commands/mysqlPushUtils.d.ts +18 -0
  6. package/cli/commands/mysqlUp.d.ts +4 -0
  7. package/cli/commands/pgConnect.d.ts +5 -0
  8. package/cli/commands/pgIntrospect.d.ts +123 -0
  9. package/cli/commands/pgPushUtils.d.ts +14 -0
  10. package/cli/commands/pgUp.d.ts +4 -0
  11. package/cli/commands/sqliteIntrospect.d.ts +107 -0
  12. package/cli/commands/sqlitePushUtils.d.ts +21 -0
  13. package/cli/commands/sqliteUtils.d.ts +162 -0
  14. package/cli/commands/upFolders.d.ts +27 -0
  15. package/cli/commands/utils.d.ts +274 -0
  16. package/cli/selector-ui.d.ts +13 -0
  17. package/cli/validations/common.d.ts +13 -0
  18. package/cli/validations/mysql.d.ts +365 -0
  19. package/cli/validations/outputs.d.ts +40 -0
  20. package/cli/validations/pg.d.ts +438 -0
  21. package/cli/views.d.ts +61 -0
  22. package/drivers/index.d.ts +39 -0
  23. package/global.d.ts +4 -0
  24. package/index.d.mts +68 -46
  25. package/index.d.ts +68 -46
  26. package/index.js +0 -1
  27. package/introspect-mysql.d.ts +9 -0
  28. package/introspect-pg.d.ts +12 -0
  29. package/introspect-sqlite.d.ts +10 -0
  30. package/jsonDiffer.d.ts +76 -0
  31. package/jsonStatements.d.ts +349 -0
  32. package/migrationPreparator.d.ts +35 -0
  33. package/package.json +64 -31
  34. package/payload.d.mts +18 -1052
  35. package/payload.d.ts +18 -1052
  36. package/payload.js +33563 -19279
  37. package/payload.mjs +33457 -19180
  38. package/schemaValidator.d.ts +1313 -0
  39. package/serializer/index.d.ts +9 -0
  40. package/serializer/mysqlImports.d.ts +11 -0
  41. package/serializer/mysqlSchema.d.ts +3833 -0
  42. package/serializer/mysqlSerializer.d.ts +7 -0
  43. package/serializer/pgImports.d.ts +11 -0
  44. package/serializer/pgSchema.d.ts +4333 -0
  45. package/serializer/pgSerializer.d.ts +7 -0
  46. package/serializer/schemaToDrizzle.d.ts +7 -0
  47. package/serializer/sqliteImports.d.ts +9 -0
  48. package/serializer/sqliteSchema.d.ts +3227 -0
  49. package/serializer/sqliteSerializer.d.ts +6 -0
  50. package/snapshotsDiffer.d.ts +2660 -0
  51. package/sqlgenerator.d.ts +33 -0
  52. package/utils/words.d.ts +7 -0
  53. package/utils-studio.d.mts +5 -0
  54. package/utils-studio.d.ts +5 -0
  55. package/utils-studio.js +809 -4584
  56. package/utils-studio.mjs +793 -4565
  57. package/utils.d.ts +199 -0
  58. package/utils.js +7165 -4635
  59. package/utils.mjs +7125 -4595
@@ -0,0 +1,349 @@
1
+ import { CommonSquashedSchema, Dialect } from "./schemaValidator";
2
+ import { MySqlSchema } from "./serializer/mysqlSchema";
3
+ import { PgSchema } from "./serializer/pgSchema";
4
+ import { AlteredColumn, Column, Table } from "./snapshotsDiffer";
5
+ export interface JsonSqliteCreateTableStatement {
6
+ type: "sqlite_create_table";
7
+ tableName: string;
8
+ columns: Column[];
9
+ referenceData: string[];
10
+ compositePKs: string[][];
11
+ uniqueConstraints?: string[];
12
+ }
13
+ export interface JsonCreateTableStatement {
14
+ type: "create_table";
15
+ tableName: string;
16
+ schema: string;
17
+ columns: Column[];
18
+ compositePKs: string[];
19
+ compositePkName?: string;
20
+ uniqueConstraints?: string[];
21
+ }
22
+ export interface JsonDropTableStatement {
23
+ type: "drop_table";
24
+ tableName: string;
25
+ schema: string;
26
+ }
27
+ export interface JsonRenameTableStatement {
28
+ type: "rename_table";
29
+ fromSchema: string;
30
+ toSchema: string;
31
+ tableNameFrom: string;
32
+ tableNameTo: string;
33
+ }
34
+ export interface JsonCreateEnumStatement {
35
+ type: "create_type_enum";
36
+ name: string;
37
+ values: string[];
38
+ }
39
+ export interface JsonAddValueToEnumStatement {
40
+ type: "alter_type_add_value";
41
+ name: string;
42
+ value: string;
43
+ }
44
+ export interface JsonDropColumnStatement {
45
+ type: "alter_table_drop_column";
46
+ tableName: string;
47
+ columnName: string;
48
+ schema: string;
49
+ }
50
+ export interface JsonAddColumnStatement {
51
+ type: "alter_table_add_column";
52
+ tableName: string;
53
+ column: Column;
54
+ schema: string;
55
+ }
56
+ export interface JsonSqliteAddColumnStatement {
57
+ type: "sqlite_alter_table_add_column";
58
+ tableName: string;
59
+ column: Column;
60
+ referenceData?: string;
61
+ }
62
+ export interface JsonCreateIndexStatement {
63
+ type: "create_index";
64
+ tableName: string;
65
+ data: string;
66
+ schema: string;
67
+ }
68
+ export interface JsonReferenceStatement {
69
+ type: "create_reference" | "alter_reference" | "delete_reference";
70
+ data: string;
71
+ schema: string;
72
+ tableName: string;
73
+ }
74
+ export interface JsonCreateUniqueConstraint {
75
+ type: "create_unique_constraint";
76
+ tableName: string;
77
+ data: string;
78
+ schema?: string;
79
+ constraintName?: string;
80
+ }
81
+ export interface JsonDeleteUniqueConstraint {
82
+ type: "delete_unique_constraint";
83
+ tableName: string;
84
+ data: string;
85
+ schema?: string;
86
+ constraintName?: string;
87
+ }
88
+ export interface JsonAlterUniqueConstraint {
89
+ type: "alter_unique_constraint";
90
+ tableName: string;
91
+ old: string;
92
+ new: string;
93
+ schema?: string;
94
+ oldConstraintName?: string;
95
+ newConstraintName?: string;
96
+ }
97
+ export interface JsonCreateCompositePK {
98
+ type: "create_composite_pk";
99
+ tableName: string;
100
+ data: string;
101
+ schema?: string;
102
+ constraintName?: string;
103
+ }
104
+ export interface JsonDeleteCompositePK {
105
+ type: "delete_composite_pk";
106
+ tableName: string;
107
+ data: string;
108
+ schema?: string;
109
+ constraintName?: string;
110
+ }
111
+ export interface JsonAlterCompositePK {
112
+ type: "alter_composite_pk";
113
+ tableName: string;
114
+ old: string;
115
+ new: string;
116
+ schema?: string;
117
+ oldConstraintName?: string;
118
+ newConstraintName?: string;
119
+ }
120
+ export interface JsonAlterTableSetSchema {
121
+ type: "alter_table_set_schema";
122
+ tableName: string;
123
+ schema: string;
124
+ }
125
+ export interface JsonAlterTableRemoveFromSchema {
126
+ type: "alter_table_remove_from_schema";
127
+ tableName: string;
128
+ schema: string;
129
+ }
130
+ export interface JsonAlterTableSetNewSchema {
131
+ type: "alter_table_set_new_schema";
132
+ tableName: string;
133
+ from: string;
134
+ to: string;
135
+ }
136
+ export interface JsonCreateReferenceStatement extends JsonReferenceStatement {
137
+ type: "create_reference";
138
+ }
139
+ export interface JsonAlterReferenceStatement extends JsonReferenceStatement {
140
+ type: "alter_reference";
141
+ oldFkey: string;
142
+ }
143
+ export interface JsonDeleteReferenceStatement extends JsonReferenceStatement {
144
+ type: "delete_reference";
145
+ }
146
+ export interface JsonDropIndexStatement {
147
+ type: "drop_index";
148
+ tableName: string;
149
+ data: string;
150
+ schema: string;
151
+ }
152
+ export interface JsonRenameColumnStatement {
153
+ type: "alter_table_rename_column";
154
+ tableName: string;
155
+ oldColumnName: string;
156
+ newColumnName: string;
157
+ schema: string;
158
+ }
159
+ export interface JsonAlterColumnTypeStatement {
160
+ type: "alter_table_alter_column_set_type";
161
+ tableName: string;
162
+ columnName: string;
163
+ newDataType: string;
164
+ oldDataType: string;
165
+ schema: string;
166
+ columnDefault: string;
167
+ columnOnUpdate: boolean;
168
+ columnNotNull: boolean;
169
+ columnAutoIncrement: boolean;
170
+ columnPk: boolean;
171
+ }
172
+ export interface JsonAlterColumnSetPrimaryKeyStatement {
173
+ type: "alter_table_alter_column_set_pk";
174
+ tableName: string;
175
+ schema: string;
176
+ columnName: string;
177
+ }
178
+ export interface JsonAlterColumnDropPrimaryKeyStatement {
179
+ type: "alter_table_alter_column_drop_pk";
180
+ tableName: string;
181
+ columnName: string;
182
+ schema: string;
183
+ }
184
+ export interface JsonAlterColumnSetDefaultStatement {
185
+ type: "alter_table_alter_column_set_default";
186
+ tableName: string;
187
+ columnName: string;
188
+ newDefaultValue: any;
189
+ oldDefaultValue?: any;
190
+ schema: string;
191
+ newDataType: string;
192
+ columnOnUpdate: boolean;
193
+ columnNotNull: boolean;
194
+ columnAutoIncrement: boolean;
195
+ columnPk: boolean;
196
+ }
197
+ export interface JsonAlterColumnDropDefaultStatement {
198
+ type: "alter_table_alter_column_drop_default";
199
+ tableName: string;
200
+ columnName: string;
201
+ schema: string;
202
+ newDataType: string;
203
+ columnDefault: string;
204
+ columnOnUpdate: boolean;
205
+ columnNotNull: boolean;
206
+ columnAutoIncrement: boolean;
207
+ columnPk: boolean;
208
+ }
209
+ export interface JsonAlterColumnSetNotNullStatement {
210
+ type: "alter_table_alter_column_set_notnull";
211
+ tableName: string;
212
+ columnName: string;
213
+ schema: string;
214
+ newDataType: string;
215
+ columnDefault: string;
216
+ columnOnUpdate: boolean;
217
+ columnNotNull: boolean;
218
+ columnAutoIncrement: boolean;
219
+ columnPk: boolean;
220
+ }
221
+ export interface JsonAlterColumnDropNotNullStatement {
222
+ type: "alter_table_alter_column_drop_notnull";
223
+ tableName: string;
224
+ columnName: string;
225
+ schema: string;
226
+ newDataType: string;
227
+ columnDefault: string;
228
+ columnOnUpdate: boolean;
229
+ columnNotNull: boolean;
230
+ columnAutoIncrement: boolean;
231
+ columnPk: boolean;
232
+ }
233
+ export interface JsonAlterColumnSetOnUpdateStatement {
234
+ type: "alter_table_alter_column_set_on_update";
235
+ tableName: string;
236
+ columnName: string;
237
+ schema: string;
238
+ newDataType: string;
239
+ columnDefault: string;
240
+ columnOnUpdate: boolean;
241
+ columnNotNull: boolean;
242
+ columnAutoIncrement: boolean;
243
+ columnPk: boolean;
244
+ }
245
+ export interface JsonAlterColumnDropOnUpdateStatement {
246
+ type: "alter_table_alter_column_drop_on_update";
247
+ tableName: string;
248
+ columnName: string;
249
+ schema: string;
250
+ newDataType: string;
251
+ columnDefault: string;
252
+ columnOnUpdate: boolean;
253
+ columnNotNull: boolean;
254
+ columnAutoIncrement: boolean;
255
+ columnPk: boolean;
256
+ }
257
+ export interface JsonAlterColumnSetAutoincrementStatement {
258
+ type: "alter_table_alter_column_set_autoincrement";
259
+ tableName: string;
260
+ columnName: string;
261
+ schema: string;
262
+ newDataType: string;
263
+ columnDefault: string;
264
+ columnOnUpdate: boolean;
265
+ columnNotNull: boolean;
266
+ columnAutoIncrement: boolean;
267
+ columnPk: boolean;
268
+ }
269
+ export interface JsonAlterColumnDropAutoincrementStatement {
270
+ type: "alter_table_alter_column_drop_autoincrement";
271
+ tableName: string;
272
+ columnName: string;
273
+ schema: string;
274
+ newDataType: string;
275
+ columnDefault: string;
276
+ columnOnUpdate: boolean;
277
+ columnNotNull: boolean;
278
+ columnAutoIncrement: boolean;
279
+ columnPk: boolean;
280
+ }
281
+ export interface JsonCreateSchema {
282
+ type: "create_schema";
283
+ name: string;
284
+ }
285
+ export interface JsonDropSchema {
286
+ type: "drop_schema";
287
+ name: string;
288
+ }
289
+ export interface JsonRenameSchema {
290
+ type: "rename_schema";
291
+ from: string;
292
+ to: string;
293
+ }
294
+ export type JsonAlterColumnStatement = JsonRenameColumnStatement | JsonAlterColumnTypeStatement | JsonAlterColumnSetDefaultStatement | JsonAlterColumnDropDefaultStatement | JsonAlterColumnSetNotNullStatement | JsonAlterColumnDropNotNullStatement | JsonAlterColumnDropOnUpdateStatement | JsonAlterColumnSetOnUpdateStatement | JsonAlterColumnDropAutoincrementStatement | JsonAlterColumnSetAutoincrementStatement | JsonAlterColumnSetPrimaryKeyStatement | JsonAlterColumnDropPrimaryKeyStatement;
295
+ export type JsonStatement = JsonAlterColumnStatement | JsonCreateTableStatement | JsonDropTableStatement | JsonRenameTableStatement | JsonCreateEnumStatement | JsonAddValueToEnumStatement | JsonDropColumnStatement | JsonAddColumnStatement | JsonCreateIndexStatement | JsonCreateReferenceStatement | JsonAlterReferenceStatement | JsonDeleteReferenceStatement | JsonDropIndexStatement | JsonReferenceStatement | JsonSqliteCreateTableStatement | JsonSqliteAddColumnStatement | JsonCreateCompositePK | JsonDeleteCompositePK | JsonAlterCompositePK | JsonCreateUniqueConstraint | JsonDeleteUniqueConstraint | JsonAlterUniqueConstraint | JsonCreateSchema | JsonDropSchema | JsonRenameSchema | JsonAlterTableSetSchema | JsonAlterTableRemoveFromSchema | JsonAlterTableSetNewSchema;
296
+ export declare const preparePgCreateTableJson: (table: Table, json2: PgSchema) => JsonCreateTableStatement;
297
+ export declare const prepareMySqlCreateTableJson: (table: Table, json2: PgSchema) => JsonCreateTableStatement;
298
+ export declare const prepareSQLiteCreateTable: (table: Table) => JsonSqliteCreateTableStatement;
299
+ export declare const prepareDropTableJson: (table: Table) => JsonDropTableStatement;
300
+ export declare const prepareRenameTableJson: (tableFrom: Table, tableTo: Table) => JsonRenameTableStatement;
301
+ export declare const prepareCreateEnumJson: (name: string, values: string[]) => JsonCreateEnumStatement;
302
+ export declare const prepareAddValuesToEnumJson: (name: string, values: string[]) => JsonAddValueToEnumStatement[];
303
+ export declare const prepareCreateSchemasJson: (values: string[]) => JsonCreateSchema[];
304
+ export declare const prepareRenameSchemasJson: (values: {
305
+ from: string;
306
+ to: string;
307
+ }[]) => JsonRenameSchema[];
308
+ export declare const prepareDeleteSchemasJson: (values: string[]) => JsonDropSchema[];
309
+ export declare const prepareRenameColumns: (tableName: string, schema: string, pairs: {
310
+ from: Column;
311
+ to: Column;
312
+ }[]) => JsonRenameColumnStatement[];
313
+ export declare const prepareAlterTableColumnsJson: (tableName: string, schema: string, deleted: Column[], added: Column[], altered: AlteredColumn[], addedFk: Record<string, string>, json2: CommonSquashedSchema, dialect?: Dialect) => {
314
+ addColumns: JsonStatement[];
315
+ dropColumns: JsonDropColumnStatement[];
316
+ alterColumns: JsonAlterColumnStatement[];
317
+ };
318
+ export declare const prepareCreateIndexesJson: (tableName: string, schema: string, indexes: Record<string, string>) => JsonCreateIndexStatement[];
319
+ export declare const prepareCreateReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, string>) => JsonCreateReferenceStatement[];
320
+ export declare const prepareDropReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, string>) => JsonDeleteReferenceStatement[];
321
+ export declare const prepareAlterReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, {
322
+ __old: string;
323
+ __new: string;
324
+ }>) => JsonReferenceStatement[];
325
+ export declare const prepareDropIndexesJson: (tableName: string, schema: string, indexes: Record<string, string>) => JsonDropIndexStatement[];
326
+ export declare const prepareAddCompositePrimaryKeySqlite: (tableName: string, pks: Record<string, string>) => JsonCreateCompositePK[];
327
+ export declare const prepareDeleteCompositePrimaryKeySqlite: (tableName: string, pks: Record<string, string>) => JsonDeleteCompositePK[];
328
+ export declare const prepareAlterCompositePrimaryKeySqlite: (tableName: string, pks: Record<string, {
329
+ __old: string;
330
+ __new: string;
331
+ }>) => JsonAlterCompositePK[];
332
+ export declare const prepareAddCompositePrimaryKeyPg: (tableName: string, schema: string, pks: Record<string, string>, json2: PgSchema) => JsonCreateCompositePK[];
333
+ export declare const prepareDeleteCompositePrimaryKeyPg: (tableName: string, schema: string, pks: Record<string, string>, json1: PgSchema) => JsonDeleteCompositePK[];
334
+ export declare const prepareAlterCompositePrimaryKeyPg: (tableName: string, schema: string, pks: Record<string, {
335
+ __old: string;
336
+ __new: string;
337
+ }>, json1: PgSchema, json2: PgSchema) => JsonAlterCompositePK[];
338
+ export declare const prepareAddUniqueConstraintPg: (tableName: string, schema: string, unqs: Record<string, string>) => JsonCreateUniqueConstraint[];
339
+ export declare const prepareDeleteUniqueConstraintPg: (tableName: string, schema: string, unqs: Record<string, string>) => JsonDeleteUniqueConstraint[];
340
+ export declare const prepareAlterUniqueConstraintPg: (tableName: string, schema: string, unqs: Record<string, {
341
+ __old: string;
342
+ __new: string;
343
+ }>) => JsonAlterUniqueConstraint[];
344
+ export declare const prepareAddCompositePrimaryKeyMySql: (tableName: string, pks: Record<string, string>, json1: MySqlSchema, json2: MySqlSchema) => JsonCreateCompositePK[];
345
+ export declare const prepareDeleteCompositePrimaryKeyMySql: (tableName: string, pks: Record<string, string>, json1: MySqlSchema) => JsonDeleteCompositePK[];
346
+ export declare const prepareAlterCompositePrimaryKeyMySql: (tableName: string, pks: Record<string, {
347
+ __old: string;
348
+ __new: string;
349
+ }>, json1: MySqlSchema, json2: MySqlSchema) => JsonAlterCompositePK[];
@@ -0,0 +1,35 @@
1
+ import { PgSchema, PgSchemaInternal } from "./serializer/pgSchema";
2
+ import { SQLiteSchema } from "./serializer/sqliteSchema";
3
+ import { MySqlSchema } from "./serializer/mysqlSchema";
4
+ export declare const prepareMySqlDbPushSnapshot: (prev: MySqlSchema, schemaPath: string | string[]) => Promise<{
5
+ prev: MySqlSchema;
6
+ cur: MySqlSchema;
7
+ }>;
8
+ export declare const prepareSQLiteDbPushSnapshot: (prev: SQLiteSchema, schemaPath: string | string[]) => Promise<{
9
+ prev: SQLiteSchema;
10
+ cur: SQLiteSchema;
11
+ }>;
12
+ export declare const preparePgDbPushSnapshot: (prev: PgSchema, schemaPath: string | string[], schemaFilter?: string[]) => Promise<{
13
+ prev: PgSchema;
14
+ cur: PgSchema;
15
+ }>;
16
+ export declare const prepareMySqlMigrationSnapshot: (migrationFolders: string[], schemaPath: string | string[]) => Promise<{
17
+ prev: MySqlSchema;
18
+ cur: MySqlSchema;
19
+ custom: MySqlSchema;
20
+ }>;
21
+ export declare const prepareSqliteMigrationSnapshot: (snapshots: string[], schemaPath: string | string[]) => Promise<{
22
+ prev: SQLiteSchema;
23
+ cur: SQLiteSchema;
24
+ custom: SQLiteSchema;
25
+ }>;
26
+ export declare const fillPgSnapshot: ({ serialized, id, idPrev, }: {
27
+ serialized: PgSchemaInternal;
28
+ id: string;
29
+ idPrev: string;
30
+ }) => PgSchema;
31
+ export declare const preparePgMigrationSnapshot: (snapshots: string[], schemaPath: string | string[]) => Promise<{
32
+ prev: PgSchema;
33
+ cur: PgSchema;
34
+ custom: PgSchema;
35
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.18-d190692",
3
+ "version": "0.20.18",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -8,21 +8,57 @@
8
8
  "drizzle-kit": "./bin.cjs"
9
9
  },
10
10
  "scripts": {
11
+ "test:pg:push": "drizzle-kit push:pg",
11
12
  "payload": "tsx ./dev/payload.ts",
12
13
  "migrate:old": "drizzle-kit generate:mysql",
13
- "cli": "tsx ./src/cli/index.ts",
14
- "test": "vitest",
15
- "build": "rm -rf ./dist && tsx build.ts && cp package.json dist/ && attw --pack dist",
14
+ "push": "node -r esbuild-register ./src/cli/index.ts push:mysql",
15
+ "push:sqlite": "node -r ./src/loader.mjs ./src/cli/index.ts push:sqlite",
16
+ "try1": "tsx ./src/t.ts",
17
+ "migrate:old:mysql": "drizzle-kit generate:mysql --out ./dev/migrations-mysql --schema ./dev/migrations-mysql/schema.ts",
18
+ "start:pg": "node -r esbuild-register ./src/cli/index.ts generate:pg",
19
+ "start:sqlite": "node -r esbuild-register ./src/cli/index.ts generate:sqlite",
20
+ "start:mysql": "node -r esbuild-register ./src/cli/index.ts generate:mysql",
21
+ "check:pg": "node -r esbuild-register ./src/cli/index.ts check --out ./dev/migrations --dialect pg",
22
+ "introspect:mysql": "node -r esbuild-register ./src/cli/index.ts introspect:mysql --config drizzle.config2.ts",
23
+ "introspect:sqlite": "node -r esbuild-register ./src/cli/index.ts introspect:sqlite --driver=sqlite",
24
+ "introspect:pg": "node -r esbuild-register ./src/cli/index.ts introspect:pg --out ./dev/introspect-pg --connectionString=postgresql://postgres@localhost:5432/introspect",
25
+ "drop": "node -r esbuild-register ./src/cli/index.ts drop",
26
+ "up:pg": "node -r esbuild-register ./src/cli/index.ts up:pg --out ./dev/migrations-pg",
27
+ "up:mysql": "node -r esbuild-register ./src/cli/index.ts up:mysql --out ./dev/migrations-mysql",
28
+ "check:equedi": "node -r esbuild-register ./src/cli/index.ts check --out ./dev/equedi --dialect pg",
29
+ "run": "node -r esbuild-register index.ts",
30
+ "watch": "esbuild ./src/clie/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild --external:pg-native --sourcemap --watch",
31
+ "diff": "esbuild ./src/clie/index.ts ./dev/diff.ts",
32
+ "prepare:mysql": "node -r esbuild-register dev/mysql/index.ts",
33
+ "prepare:pg": "node -r esbuild-register dev/index.ts",
34
+ "prepare-snapshot": "node -r esbuild-register ./dev/prepare-snapshot prepare ./dev/data",
35
+ "sim": "node -r esbuild-register ./dev/simulate.ts",
36
+ "sim:sqlite": "node -r esbuild-register ./dev/sqlite/index.ts",
37
+ "test": "ava test --timeout=60s",
38
+ "build": "rm -rf ./dist && tsc -p tsconfig.cli-types.json && pnpm mts && tsx build.ts",
39
+ "mts": "cp dist/index.d.ts dist/index.d.mts && cp dist/utils-studio.d.ts dist/utils-studio.d.mts && cp dist/payload.d.ts dist/payload.d.mts",
16
40
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
17
41
  "packit": "pnpm build && cp package.json dist/ && cd dist && pnpm pack",
18
42
  "tsc": "tsc -p tsconfig.build.json",
19
- "pub": "cp package.json readme.md dist/ && cd dist && npm publish"
43
+ "pub": "cp package.json readme.md dist/ && cd dist && npm publish",
44
+ "studio": "tsx ./src/cli/index.ts studio --verbose --port=3000",
45
+ "studio:dev": "tsx ./src/cli/index.ts studio --verbose"
46
+ },
47
+ "ava": {
48
+ "files": [
49
+ "test/**/*.ts"
50
+ ],
51
+ "extensions": {
52
+ "ts": "module"
53
+ },
54
+ "nodeArguments": [
55
+ "--loader=tsx"
56
+ ]
20
57
  },
21
58
  "dependencies": {
22
59
  "@esbuild-kit/esm-loader": "^2.5.5",
23
60
  "@hono/node-server": "^1.9.0",
24
61
  "@hono/zod-validator": "^0.2.0",
25
- "@types/json-diff": "^1.0.3",
26
62
  "camelcase": "^7.0.1",
27
63
  "chalk": "^5.2.0",
28
64
  "commander": "^9.4.1",
@@ -34,55 +70,40 @@
34
70
  "hono": "^4.1.4",
35
71
  "json-diff": "0.9.0",
36
72
  "minimatch": "^7.4.3",
37
- "pluralize": "^8.0.0",
38
73
  "semver": "^7.5.4",
39
74
  "superjson": "^2.2.1",
40
- "ws": "^8.16.0",
41
75
  "zod": "^3.20.2"
42
76
  },
43
77
  "devDependencies": {
44
- "@arethetypeswrong/cli": "^0.15.3",
45
- "@aws-sdk/client-rds-data": "^3.556.0",
46
78
  "@cloudflare/workers-types": "^4.20230518.0",
47
- "@electric-sql/pglite": "^0.1.3",
48
79
  "@libsql/client": "^0.4.2",
49
- "@neondatabase/serverless": "^0.9.1",
50
- "@originjs/vite-plugin-commonjs": "^1.0.3",
51
- "@planetscale/database": "^1.16.0",
52
80
  "@types/better-sqlite3": "^7.6.4",
53
- "@types/dockerode": "^3.3.28",
81
+ "@types/dockerode": "^3.3.14",
54
82
  "@types/glob": "^8.1.0",
55
83
  "@types/minimatch": "^5.1.2",
56
84
  "@types/node": "^18.11.15",
57
85
  "@types/pg": "^8.10.7",
58
- "@types/pluralize": "^0.0.33",
59
86
  "@types/semver": "^7.5.5",
60
- "@types/uuid": "^9.0.8",
61
- "@types/ws": "^8.5.10",
62
- "@typescript-eslint/eslint-plugin": "^7.2.0",
63
- "@typescript-eslint/parser": "^7.2.0",
64
- "@vercel/postgres": "^0.8.0",
87
+ "@typescript-eslint/eslint-plugin": "^5.46.1",
88
+ "@typescript-eslint/parser": "^5.46.1",
65
89
  "ava": "^5.1.0",
66
90
  "better-sqlite3": "^9.4.3",
67
91
  "dockerode": "^3.3.4",
68
92
  "dotenv": "^16.0.3",
69
93
  "drizzle-kit": "0.20.14",
70
- "drizzle-orm": "0.30.9-f9be0ab",
94
+ "drizzle-orm": "0.30.5",
71
95
  "esbuild-node-externals": "^1.9.0",
72
- "eslint": "^8.57.0",
73
- "eslint-config-prettier": "^9.1.0",
74
- "eslint-plugin-prettier": "^5.1.3",
96
+ "eslint": "^8.29.0",
97
+ "eslint-config-prettier": "^8.5.0",
98
+ "eslint-plugin-prettier": "^4.2.1",
75
99
  "get-port": "^6.1.2",
76
100
  "mysql2": "2.3.3",
77
101
  "pg": "^8.11.3",
78
- "postgres": "^3.4.4",
102
+ "postgres": "^3.3.5",
79
103
  "prettier": "^2.8.1",
80
- "tsup": "^8.0.2",
81
104
  "tsx": "^3.12.1",
82
- "typescript": "^5.4.3",
83
- "uuid": "^9.0.1",
84
- "vite-tsconfig-paths": "^4.3.2",
85
- "vitest": "^1.4.0",
105
+ "typescript": "^4.9.4",
106
+ "uvu": "^0.5.6",
86
107
  "wrangler": "^3.22.1",
87
108
  "zx": "^7.2.2"
88
109
  },
@@ -99,6 +120,18 @@
99
120
  "types": "./index.d.mts",
100
121
  "default": "./index.mjs"
101
122
  },
123
+ "./utils-studio": {
124
+ "import": {
125
+ "types": "./utils-studio.d.mts",
126
+ "default": "./utils-studio.mjs"
127
+ },
128
+ "require": {
129
+ "types": "./utils-studio.d.ts",
130
+ "default": "./utils-studio.js"
131
+ },
132
+ "types": "./utils-studio.d.mts",
133
+ "default": "./utils-studio.mjs"
134
+ },
102
135
  "./payload": {
103
136
  "import": {
104
137
  "types": "./payload.d.mts",