@coreframe/scripts 0.1.0 → 0.1.2

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.
Files changed (96) hide show
  1. package/dist/config.d.ts +18 -4
  2. package/dist/config.js +1 -3
  3. package/dist/coreframe.d.ts +243 -241
  4. package/dist/coreframe.js +1 -239
  5. package/dist/db/client.d.ts +26 -18
  6. package/dist/db/client.js +1 -29
  7. package/dist/db/config.d.ts +22 -19
  8. package/dist/db/config.js +1 -32
  9. package/dist/db/drizzle-kit.d.ts +6 -5
  10. package/dist/db/drizzle-kit.js +1 -21
  11. package/dist/db/ensure.d.ts +20 -2
  12. package/dist/db/ensure.js +1 -39
  13. package/dist/db/migrate-held.d.ts +16 -10
  14. package/dist/db/migrate-held.js +3 -112
  15. package/dist/db/migrate.d.ts +4 -2
  16. package/dist/db/migrate.js +1 -24
  17. package/dist/db/project.d.ts +19 -7
  18. package/dist/db/project.js +1 -9
  19. package/dist/db/reset.d.ts +4 -2
  20. package/dist/db/reset.js +1 -18
  21. package/dist/db/schema-push.d.ts +22 -0
  22. package/dist/db/schema-push.js +1 -0
  23. package/dist/db/seed.d.ts +6 -3
  24. package/dist/db/seed.js +1 -22
  25. package/dist/db/setup.d.ts +6 -3
  26. package/dist/db/setup.js +1 -14
  27. package/dist/deploy/check-migrations.d.ts +4 -2
  28. package/dist/deploy/check-migrations.js +1 -17
  29. package/dist/deploy/checks.d.ts +6 -2
  30. package/dist/deploy/checks.js +1 -27
  31. package/dist/deploy/config.d.ts +47 -44
  32. package/dist/deploy/config.js +1 -9
  33. package/dist/deploy/migrations.d.ts +21 -18
  34. package/dist/deploy/migrations.js +4 -203
  35. package/dist/deploy/pending-migrations.d.ts +9 -5
  36. package/dist/deploy/pending-migrations.js +1 -30
  37. package/dist/deploy/tauri-release.d.ts +93 -73
  38. package/dist/deploy/tauri-release.js +1 -512
  39. package/dist/deploy/version.d.ts +15 -13
  40. package/dist/deploy/version.js +1 -41
  41. package/dist/deploy.d.ts +16 -15
  42. package/dist/deploy.js +1 -246
  43. package/dist/dev.d.ts +23 -12
  44. package/dist/dev.js +1 -95
  45. package/dist/image-generator.d.ts +18 -2
  46. package/dist/image-generator.js +1 -59
  47. package/dist/project.d.ts +4 -1
  48. package/dist/project.js +1 -13
  49. package/dist/typecheck.d.ts +4 -2
  50. package/dist/typecheck.js +1 -44
  51. package/dist/upgrade/check-skill-current.d.ts +10 -5
  52. package/dist/upgrade/check-skill-current.js +1 -87
  53. package/dist/upgrade/ensure-template-remote.d.ts +10 -5
  54. package/dist/upgrade/ensure-template-remote.js +1 -56
  55. package/dist/upgrade/fast-forward-template-files.d.ts +8 -6
  56. package/dist/upgrade/fast-forward-template-files.js +1 -279
  57. package/package.json +7 -2
  58. package/config.test.ts +0 -15
  59. package/config.ts +0 -9
  60. package/coreframe.ts +0 -272
  61. package/db/client.ts +0 -72
  62. package/db/config.ts +0 -41
  63. package/db/drizzle-kit.test.ts +0 -27
  64. package/db/drizzle-kit.ts +0 -39
  65. package/db/ensure.ts +0 -67
  66. package/db/migrate-held.test.ts +0 -81
  67. package/db/migrate-held.ts +0 -166
  68. package/db/migrate.ts +0 -39
  69. package/db/project.ts +0 -28
  70. package/db/reset.ts +0 -24
  71. package/db/seed.ts +0 -38
  72. package/db/setup.ts +0 -18
  73. package/deploy/check-migrations.ts +0 -31
  74. package/deploy/checks.ts +0 -38
  75. package/deploy/config.test.ts +0 -24
  76. package/deploy/config.ts +0 -68
  77. package/deploy/migrations.test.ts +0 -110
  78. package/deploy/migrations.ts +0 -317
  79. package/deploy/pending-migrations.test.ts +0 -93
  80. package/deploy/pending-migrations.ts +0 -45
  81. package/deploy/tauri-release.test.ts +0 -196
  82. package/deploy/tauri-release.ts +0 -816
  83. package/deploy/version.test.ts +0 -29
  84. package/deploy/version.ts +0 -65
  85. package/deploy.test.ts +0 -101
  86. package/deploy.ts +0 -346
  87. package/dev.test.ts +0 -153
  88. package/dev.ts +0 -155
  89. package/image-generator.ts +0 -84
  90. package/project.ts +0 -6
  91. package/tsconfig.build.json +0 -12
  92. package/tsconfig.json +0 -20
  93. package/typecheck.ts +0 -55
  94. package/upgrade/check-skill-current.ts +0 -112
  95. package/upgrade/ensure-template-remote.ts +0 -79
  96. package/upgrade/fast-forward-template-files.ts +0 -408
package/dist/config.d.ts CHANGED
@@ -1,5 +1,19 @@
1
- import type { DeployConfig } from "./deploy/config.ts";
2
- export type CoreframeConfig = {
3
- deploy?: DeployConfig;
1
+ import { DatabaseDialect } from "./db/client.js";
2
+ import { DeployConfig } from "./deploy/config.js";
3
+
4
+ //#region config.d.ts
5
+ type CoreframeConfig = {
6
+ database?: DatabaseConfig;
7
+ deploy?: DeployConfig;
4
8
  };
5
- export declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
9
+ type DatabaseConfig = {
10
+ dialect: DatabaseDialect;
11
+ };
12
+ declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
13
+ declare function readProjectConfig({
14
+ cwd
15
+ }?: {
16
+ cwd?: string;
17
+ }): Promise<CoreframeConfig>;
18
+ //#endregion
19
+ export { CoreframeConfig, DatabaseConfig, defineConfig, readProjectConfig };
package/dist/config.js CHANGED
@@ -1,3 +1 @@
1
- export function defineConfig(config) {
2
- return config;
3
- }
1
+ import{access as e}from"node:fs/promises";import{resolve as t}from"node:path";import{pathToFileURL as n}from"node:url";function r(e){return e}async function i({cwd:r=process.cwd()}={}){let i=t(r,`coreframe.config.ts`);try{await e(i)}catch{return{}}return(await import(n(i).href)).default??{}}export{r as defineConfig,i as readProjectConfig};
@@ -1,280 +1,282 @@
1
- #!/usr/bin/env node
2
- export declare const coreframeCli: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
3
- parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
4
- command: "db";
5
- args: {
6
- command: "generate";
7
- args: {
8
- args: string[];
9
- };
10
- } | {
11
- command: "migrate";
12
- args: {
13
- args: string[];
14
- };
15
- } | {
16
- command: "studio";
17
- args: {
18
- args: string[];
19
- };
20
- } | {
21
- command: "ensure";
22
- args: {};
23
- } | {
24
- command: "migrate-held";
25
- args: {
26
- confirm: "run-held-migrations" | undefined;
27
- };
28
- } | {
29
- command: "migrate-local";
30
- args: {};
31
- } | {
32
- command: "migrations-check";
33
- args: {};
34
- } | {
35
- command: "reset";
36
- args: {};
37
- } | {
38
- command: "seed";
39
- args: {};
40
- } | {
41
- command: "setup";
42
- args: {};
43
- };
44
- } | {
45
- command: "deploy";
46
- args: {
47
- runMigrations: boolean;
48
- skipMigrations: boolean;
49
- skipPostDeployChecks: boolean;
50
- tauriLocalPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
51
- tauriWorkflowName: string | undefined;
52
- tauriWorkflowPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
53
- tauriWorkflowRef: string | undefined;
54
- yes: boolean;
55
- };
56
- } | {
57
- command: "dev";
58
- args: {
59
- platform: "ios" | "android" | "desktop" | "web" | undefined;
60
- };
1
+ //#region coreframe.d.ts
2
+ declare const coreframeCli: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
3
+ parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
4
+ command: "deploy";
5
+ args: {
6
+ runMigrations: boolean;
7
+ skipMigrations: boolean;
8
+ skipPostDeployChecks: boolean;
9
+ tauriLocalPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
10
+ tauriWorkflowName: string | undefined;
11
+ tauriWorkflowPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
12
+ tauriWorkflowRef: string | undefined;
13
+ yes: boolean;
14
+ };
15
+ } | {
16
+ command: "typecheck";
17
+ args: {};
18
+ } | {
19
+ command: "dev";
20
+ args: {
21
+ platform: "ios" | "android" | "web" | "desktop" | undefined;
22
+ };
23
+ } | {
24
+ command: "upgrade";
25
+ args: {
26
+ command: "ensure-template-remote";
27
+ args: {
28
+ remote: string;
29
+ noFetch: boolean;
30
+ };
61
31
  } | {
62
- command: "typecheck";
63
- args: {};
32
+ command: "check-skill-current";
33
+ args: {
34
+ target: string;
35
+ apply: boolean;
36
+ };
64
37
  } | {
65
- command: "upgrade";
66
- args: {
67
- command: "ensure-template-remote";
68
- args: {
69
- remote: string;
70
- noFetch: boolean;
71
- };
72
- } | {
73
- command: "check-skill-current";
74
- args: {
75
- target: string;
76
- apply: boolean;
77
- };
78
- } | {
79
- command: "fast-forward-template-files";
80
- args: {
81
- target: string;
82
- base: string | undefined;
83
- apply: boolean;
84
- };
85
- };
86
- }>>;
87
- } & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
38
+ command: "fast-forward-template-files";
39
+ args: {
40
+ target: string;
41
+ base: string | undefined;
42
+ apply: boolean;
43
+ };
44
+ };
45
+ } | {
88
46
  command: "db";
89
47
  args: {
90
- command: "generate";
91
- args: {
92
- args: string[];
93
- };
48
+ command: "ensure";
49
+ args: {};
94
50
  } | {
95
- command: "migrate";
96
- args: {
97
- args: string[];
98
- };
51
+ command: "generate";
52
+ args: {
53
+ args: string[];
54
+ };
99
55
  } | {
100
- command: "studio";
101
- args: {
102
- args: string[];
103
- };
56
+ command: "migrate";
57
+ args: {
58
+ args: string[];
59
+ };
104
60
  } | {
105
- command: "ensure";
106
- args: {};
61
+ command: "studio";
62
+ args: {
63
+ args: string[];
64
+ };
107
65
  } | {
108
- command: "migrate-held";
109
- args: {
110
- confirm: "run-held-migrations" | undefined;
111
- };
66
+ command: "migrate-held";
67
+ args: {
68
+ confirm: "run-held-migrations" | undefined;
69
+ };
112
70
  } | {
113
- command: "migrate-local";
114
- args: {};
71
+ command: "migrate-local";
72
+ args: {};
115
73
  } | {
116
- command: "migrations-check";
117
- args: {};
74
+ command: "migrations-check";
75
+ args: {};
118
76
  } | {
119
- command: "reset";
120
- args: {};
77
+ command: "reset";
78
+ args: {};
121
79
  } | {
122
- command: "seed";
123
- args: {};
80
+ command: "seed";
81
+ args: {};
124
82
  } | {
125
- command: "setup";
126
- args: {};
83
+ command: "setup";
84
+ args: {};
127
85
  };
86
+ }>>;
87
+ } & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
88
+ command: "deploy";
89
+ args: {
90
+ runMigrations: boolean;
91
+ skipMigrations: boolean;
92
+ skipPostDeployChecks: boolean;
93
+ tauriLocalPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
94
+ tauriWorkflowName: string | undefined;
95
+ tauriWorkflowPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
96
+ tauriWorkflowRef: string | undefined;
97
+ yes: boolean;
98
+ };
128
99
  } | {
129
- command: "deploy";
100
+ command: "typecheck";
101
+ args: {};
102
+ } | {
103
+ command: "dev";
104
+ args: {
105
+ platform: "ios" | "android" | "web" | "desktop" | undefined;
106
+ };
107
+ } | {
108
+ command: "upgrade";
109
+ args: {
110
+ command: "ensure-template-remote";
130
111
  args: {
131
- runMigrations: boolean;
132
- skipMigrations: boolean;
133
- skipPostDeployChecks: boolean;
134
- tauriLocalPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
135
- tauriWorkflowName: string | undefined;
136
- tauriWorkflowPlatforms: ("macos" | "windows" | "linux" | "ios" | "android")[];
137
- tauriWorkflowRef: string | undefined;
138
- yes: boolean;
112
+ remote: string;
113
+ noFetch: boolean;
139
114
  };
140
- } | {
141
- command: "dev";
115
+ } | {
116
+ command: "check-skill-current";
142
117
  args: {
143
- platform: "ios" | "android" | "desktop" | "web" | undefined;
118
+ target: string;
119
+ apply: boolean;
144
120
  };
121
+ } | {
122
+ command: "fast-forward-template-files";
123
+ args: {
124
+ target: string;
125
+ base: string | undefined;
126
+ apply: boolean;
127
+ };
128
+ };
145
129
  } | {
146
- command: "typecheck";
130
+ command: "db";
131
+ args: {
132
+ command: "ensure";
147
133
  args: {};
148
- } | {
149
- command: "upgrade";
134
+ } | {
135
+ command: "generate";
150
136
  args: {
151
- command: "ensure-template-remote";
152
- args: {
153
- remote: string;
154
- noFetch: boolean;
155
- };
156
- } | {
157
- command: "check-skill-current";
158
- args: {
159
- target: string;
160
- apply: boolean;
161
- };
162
- } | {
163
- command: "fast-forward-template-files";
164
- args: {
165
- target: string;
166
- base: string | undefined;
167
- apply: boolean;
168
- };
137
+ args: string[];
169
138
  };
170
- }, {
171
- command: "db";
172
- value: {
173
- command: "generate";
174
- value: Promise<void>;
175
- } | {
176
- command: "migrate";
177
- value: Promise<void>;
178
- } | {
179
- command: "studio";
180
- value: Promise<void>;
181
- } | {
182
- command: "ensure";
183
- value: Promise<void>;
184
- } | {
185
- command: "migrate-held";
186
- value: Promise<void>;
187
- } | {
188
- command: "migrate-local";
189
- value: Promise<void>;
190
- } | {
191
- command: "migrations-check";
192
- value: Promise<void>;
193
- } | {
194
- command: "reset";
195
- value: Promise<void>;
196
- } | {
197
- command: "seed";
198
- value: Promise<void>;
199
- } | {
200
- command: "setup";
201
- value: Promise<void>;
139
+ } | {
140
+ command: "migrate";
141
+ args: {
142
+ args: string[];
202
143
  };
144
+ } | {
145
+ command: "studio";
146
+ args: {
147
+ args: string[];
148
+ };
149
+ } | {
150
+ command: "migrate-held";
151
+ args: {
152
+ confirm: "run-held-migrations" | undefined;
153
+ };
154
+ } | {
155
+ command: "migrate-local";
156
+ args: {};
157
+ } | {
158
+ command: "migrations-check";
159
+ args: {};
160
+ } | {
161
+ command: "reset";
162
+ args: {};
163
+ } | {
164
+ command: "seed";
165
+ args: {};
166
+ } | {
167
+ command: "setup";
168
+ args: {};
169
+ };
170
+ }, {
171
+ command: "deploy";
172
+ value: Promise<void>;
203
173
  } | {
204
- command: "deploy";
205
- value: Promise<void>;
174
+ command: "typecheck";
175
+ value: Promise<void>;
206
176
  } | {
207
- command: "dev";
208
- value: Promise<void>;
177
+ command: "dev";
178
+ value: Promise<void>;
179
+ } | {
180
+ command: "upgrade";
181
+ value: {
182
+ command: "ensure-template-remote";
183
+ value: void;
184
+ } | {
185
+ command: "check-skill-current";
186
+ value: void;
187
+ } | {
188
+ command: "fast-forward-template-files";
189
+ value: void;
190
+ };
209
191
  } | {
192
+ command: "db";
193
+ value: {
194
+ command: "ensure";
195
+ value: Promise<void>;
196
+ } | {
197
+ command: "generate";
198
+ value: Promise<void>;
199
+ } | {
200
+ command: "migrate";
201
+ value: Promise<void>;
202
+ } | {
203
+ command: "studio";
204
+ value: Promise<void>;
205
+ } | {
206
+ command: "migrate-held";
207
+ value: Promise<void>;
208
+ } | {
209
+ command: "migrate-local";
210
+ value: Promise<void>;
211
+ } | {
212
+ command: "migrations-check";
213
+ value: Promise<void>;
214
+ } | {
215
+ command: "reset";
216
+ value: Promise<void>;
217
+ } | {
218
+ command: "seed";
219
+ value: Promise<void>;
220
+ } | {
221
+ command: "setup";
222
+ value: Promise<void>;
223
+ };
224
+ }> & {
225
+ run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
226
+ command: "deploy";
227
+ value: Promise<void>;
228
+ } | {
210
229
  command: "typecheck";
211
230
  value: Promise<void>;
212
- } | {
231
+ } | {
232
+ command: "dev";
233
+ value: Promise<void>;
234
+ } | {
213
235
  command: "upgrade";
214
236
  value: {
215
- command: "ensure-template-remote";
216
- value: void;
237
+ command: "ensure-template-remote";
238
+ value: void;
217
239
  } | {
218
- command: "check-skill-current";
219
- value: void;
240
+ command: "check-skill-current";
241
+ value: void;
220
242
  } | {
221
- command: "fast-forward-template-files";
222
- value: void;
243
+ command: "fast-forward-template-files";
244
+ value: void;
223
245
  };
224
- }> & {
225
- run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
226
- command: "db";
227
- value: {
228
- command: "generate";
229
- value: Promise<void>;
230
- } | {
231
- command: "migrate";
232
- value: Promise<void>;
233
- } | {
234
- command: "studio";
235
- value: Promise<void>;
236
- } | {
237
- command: "ensure";
238
- value: Promise<void>;
239
- } | {
240
- command: "migrate-held";
241
- value: Promise<void>;
242
- } | {
243
- command: "migrate-local";
244
- value: Promise<void>;
245
- } | {
246
- command: "migrations-check";
247
- value: Promise<void>;
248
- } | {
249
- command: "reset";
250
- value: Promise<void>;
251
- } | {
252
- command: "seed";
253
- value: Promise<void>;
254
- } | {
255
- command: "setup";
256
- value: Promise<void>;
257
- };
246
+ } | {
247
+ command: "db";
248
+ value: {
249
+ command: "ensure";
250
+ value: Promise<void>;
251
+ } | {
252
+ command: "generate";
253
+ value: Promise<void>;
258
254
  } | {
259
- command: "deploy";
260
- value: Promise<void>;
255
+ command: "migrate";
256
+ value: Promise<void>;
261
257
  } | {
262
- command: "dev";
263
- value: Promise<void>;
258
+ command: "studio";
259
+ value: Promise<void>;
264
260
  } | {
265
- command: "typecheck";
266
- value: Promise<void>;
261
+ command: "migrate-held";
262
+ value: Promise<void>;
267
263
  } | {
268
- command: "upgrade";
269
- value: {
270
- command: "ensure-template-remote";
271
- value: void;
272
- } | {
273
- command: "check-skill-current";
274
- value: void;
275
- } | {
276
- command: "fast-forward-template-files";
277
- value: void;
278
- };
279
- }>>;
264
+ command: "migrate-local";
265
+ value: Promise<void>;
266
+ } | {
267
+ command: "migrations-check";
268
+ value: Promise<void>;
269
+ } | {
270
+ command: "reset";
271
+ value: Promise<void>;
272
+ } | {
273
+ command: "seed";
274
+ value: Promise<void>;
275
+ } | {
276
+ command: "setup";
277
+ value: Promise<void>;
278
+ };
279
+ }>>;
280
280
  };
281
+ //#endregion
282
+ export { coreframeCli };