@zmdb/cli 1.0.0-beta.1 → 1.0.0-beta.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.
- package/README.md +5 -5
- package/dist/__fixtures__/project/src/schema.d.ts +1 -1
- package/dist/__fixtures__/project/src/schema.d.ts.map +1 -1
- package/dist/templates/command.js +3 -3
- package/dist/templates/controller.js +4 -4
- package/dist/templates/module.js +3 -3
- package/dist/templates/project.js +9 -9
- package/dist/templates/project.js.map +1 -1
- package/dist/templates/repository.js +7 -7
- package/dist/templates/schema.js +3 -3
- package/package.json +8 -8
- package/src/__fixtures__/project/src/schema.ts +1 -1
- package/src/__fixtures__/project/tsconfig.json +1 -1
- package/src/templates/command.ts +3 -3
- package/src/templates/controller.ts +4 -4
- package/src/templates/module.ts +3 -3
- package/src/templates/project.ts +9 -9
- package/src/templates/repository.ts +7 -7
- package/src/templates/schema.ts +3 -3
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# @zmdb/cli
|
|
2
2
|
|
|
3
3
|
`@zmdb/cli` owns the single `zmdb` executable for schema, migration, code generation, scaffolding, application inspection, REPL, Studio and HTTP client commands. Install it with TypeScript for
|
|
4
|
-
standalone tooling, or install
|
|
4
|
+
standalone tooling, or install `@zmdb/core@1.0.0-beta.2` for the complete product facade and the same executable.
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
|
-
yarn add --dev @zmdb/cli@1.0.0-beta.
|
|
7
|
+
yarn add --dev @zmdb/cli@1.0.0-beta.2 typescript@^7.0.2
|
|
8
8
|
yarn zmdb --help
|
|
9
9
|
yarn zmdb codegen --project tsconfig.json
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Requires Node.js 26 or later. The CLI delegates reflection and AOT emission to `@zmdb/compiler`, and schema plans, files and ledger execution to `@zmdb/migrations`. Those packages remain usable
|
|
13
|
-
independently. Project configuration is loaded by `@zmdb/compiler/config`; `zmdb.config.ts` can use the `defineConfig` helper from `@zmdb/compiler/config/contract` or
|
|
13
|
+
independently. Project configuration is loaded by `@zmdb/compiler/config`; `zmdb.config.ts` can use the `defineConfig` helper from `@zmdb/compiler/config/contract` or `@zmdb/core/config`.
|
|
14
14
|
|
|
15
|
-
`@zmdb/cli` exposes `runCli`, migration generation, embedding, schema export, declaration pulling and HTTP artifact helpers.
|
|
16
|
-
load when selected, so application imports do not need to load reflection, esbuild or a REPL.
|
|
15
|
+
`@zmdb/cli` exposes `runCli`, migration generation, embedding, schema export, declaration pulling and HTTP artifact helpers. `@zmdb/core/cli` exports the same function identities. Command
|
|
16
|
+
implementations load when selected, so application imports do not need to load reflection, esbuild or a REPL.
|
|
17
17
|
|
|
18
18
|
Application inspection and REPL require the optional peers `@zmdb/app`, `@zmdb/web` and `esbuild`; Studio and HTTP generation use `@zmdb/web`. Install the selected optional peers with versions
|
|
19
19
|
matching this package's peer ranges. Database commands obtain their driver from the application's config; install the database package that owns that driver.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/__fixtures__/project/src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/__fixtures__/project/src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEtE,MAAM,WAAW,IAAK,SAAQ,KAAK,CAAC,OAAO,CAAC;IAC1C,EAAE,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,UAAU,CAAC;IAClD,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B"}
|
|
@@ -2,7 +2,7 @@ export const commandTemplate = ({ name }) => ({
|
|
|
2
2
|
files: [
|
|
3
3
|
{
|
|
4
4
|
path: `src/${name.fileStem}.command.ts`,
|
|
5
|
-
source: `import { assert } from 'zmdb';
|
|
5
|
+
source: `import { assert } from '@zmdb/core';
|
|
6
6
|
import { Command } from '@zmdb/app/commands';
|
|
7
7
|
|
|
8
8
|
export interface ${name.pascal}Args {
|
|
@@ -34,8 +34,8 @@ export class ${name.pascal}Command {
|
|
|
34
34
|
{
|
|
35
35
|
path: `src/${name.fileStem}.command.spec.ts`,
|
|
36
36
|
source: `import { createCommandApp } from '@zmdb/app/commands';
|
|
37
|
-
import { createTestApp } from 'zmdb/testing';
|
|
38
|
-
import { Module } from 'zmdb';
|
|
37
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
38
|
+
import { Module } from '@zmdb/core';
|
|
39
39
|
import { describe, expect, it } from 'vitest';
|
|
40
40
|
|
|
41
41
|
import {
|
|
@@ -2,7 +2,7 @@ export const controllerTemplate = ({ name }) => ({
|
|
|
2
2
|
files: [
|
|
3
3
|
{
|
|
4
4
|
path: `src/${name.fileStem}.controller.ts`,
|
|
5
|
-
source: `import { Controller, Get } from 'zmdb';
|
|
5
|
+
source: `import { Controller, Get } from '@zmdb/core';
|
|
6
6
|
|
|
7
7
|
@Controller('/${name.fileStem}')
|
|
8
8
|
export class ${name.pascal}Controller {
|
|
@@ -15,9 +15,9 @@ export class ${name.pascal}Controller {
|
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
path: `src/${name.fileStem}.controller.spec.ts`,
|
|
18
|
-
source: `import { Module } from 'zmdb';
|
|
19
|
-
import { createTestApp } from 'zmdb/testing';
|
|
20
|
-
import { bodyText } from 'zmdb/web';
|
|
18
|
+
source: `import { Module } from '@zmdb/core';
|
|
19
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
20
|
+
import { bodyText } from '@zmdb/core/web';
|
|
21
21
|
import { describe, expect, it } from 'vitest';
|
|
22
22
|
|
|
23
23
|
import { ${name.pascal}Controller } from './${name.fileStem}.controller.js';
|
package/dist/templates/module.js
CHANGED
|
@@ -2,8 +2,8 @@ export const moduleTemplate = ({ name }) => ({
|
|
|
2
2
|
files: [
|
|
3
3
|
{
|
|
4
4
|
path: `src/${name.fileStem}.module.ts`,
|
|
5
|
-
source: `import { Module } from 'zmdb';
|
|
6
|
-
import { createToken } from 'zmdb/web';
|
|
5
|
+
source: `import { Module } from '@zmdb/core';
|
|
6
|
+
import { createToken } from '@zmdb/core/web';
|
|
7
7
|
|
|
8
8
|
export interface ${name.pascal}Status {
|
|
9
9
|
readonly name: '${name.fileStem}';
|
|
@@ -21,7 +21,7 @@ export class ${name.pascal}Module {}
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
path: `src/${name.fileStem}.module.spec.ts`,
|
|
24
|
-
source: `import { createTestApp } from 'zmdb/testing';
|
|
24
|
+
source: `import { createTestApp } from '@zmdb/core/testing';
|
|
25
25
|
import { describe, expect, it } from 'vitest';
|
|
26
26
|
|
|
27
27
|
import { ${name.constant}_STATUS, ${name.pascal}Module } from './${name.fileStem}.module.js';
|
|
@@ -19,8 +19,8 @@ export const projectTemplate = ({ name, packageVersion }) => ({
|
|
|
19
19
|
typecheck: 'tsc --noEmit',
|
|
20
20
|
},
|
|
21
21
|
dependencies: {
|
|
22
|
+
'@zmdb/core': packageVersion,
|
|
22
23
|
'@zmdb/sqlite': packageVersion,
|
|
23
|
-
zmdb: packageVersion,
|
|
24
24
|
},
|
|
25
25
|
devDependencies: {
|
|
26
26
|
'@types/node': '26.4.1',
|
|
@@ -65,7 +65,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
65
65
|
|
|
66
66
|
import { build } from 'esbuild';
|
|
67
67
|
import { format } from 'oxfmt';
|
|
68
|
-
import { zmdbAot } from 'zmdb/compiler';
|
|
68
|
+
import { zmdbAot } from '@zmdb/core/compiler';
|
|
69
69
|
|
|
70
70
|
const root = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
71
71
|
const formatOptions = ${JSON.stringify(FORMAT_OPTIONS)};
|
|
@@ -159,8 +159,8 @@ export default defineConfig({
|
|
|
159
159
|
source: `import { DatabaseSync } from 'node:sqlite';
|
|
160
160
|
import { fileURLToPath } from 'node:url';
|
|
161
161
|
|
|
162
|
-
import { defineConfig } from 'zmdb';
|
|
163
|
-
import { sqlite, sqliteDriver } from 'zmdb/sqlite';
|
|
162
|
+
import { defineConfig } from '@zmdb/core';
|
|
163
|
+
import { sqlite, sqliteDriver } from '@zmdb/core/sqlite';
|
|
164
164
|
|
|
165
165
|
const databasePath = fileURLToPath(new URL('./database.sqlite', import.meta.url));
|
|
166
166
|
|
|
@@ -175,7 +175,7 @@ export default defineConfig({
|
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
path: 'src/app.module.ts',
|
|
178
|
-
source: `import { Module } from 'zmdb';
|
|
178
|
+
source: `import { Module } from '@zmdb/core';
|
|
179
179
|
|
|
180
180
|
import { HealthController } from './health.controller.js';
|
|
181
181
|
|
|
@@ -187,7 +187,7 @@ export class AppModule {}
|
|
|
187
187
|
path: 'src/main.ts',
|
|
188
188
|
source: `import { createServer } from 'node:http';
|
|
189
189
|
|
|
190
|
-
import { compileModule, createRouter, toNodeHandler } from 'zmdb/web';
|
|
190
|
+
import { compileModule, createRouter, toNodeHandler } from '@zmdb/core/web';
|
|
191
191
|
|
|
192
192
|
import { AppModule } from './app.module.js';
|
|
193
193
|
|
|
@@ -233,7 +233,7 @@ server.listen(port, '127.0.0.1', () => {
|
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
path: 'src/health.controller.ts',
|
|
236
|
-
source: `import { Controller, Get } from 'zmdb';
|
|
236
|
+
source: `import { Controller, Get } from '@zmdb/core';
|
|
237
237
|
|
|
238
238
|
@Controller('/health')
|
|
239
239
|
export class HealthController {
|
|
@@ -246,8 +246,8 @@ export class HealthController {
|
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
248
|
path: 'src/health.controller.spec.ts',
|
|
249
|
-
source: `import { createTestApp } from 'zmdb/testing';
|
|
250
|
-
import { bodyText } from 'zmdb/web';
|
|
249
|
+
source: `import { createTestApp } from '@zmdb/core/testing';
|
|
250
|
+
import { bodyText } from '@zmdb/core/web';
|
|
251
251
|
import { describe, expect, it } from 'vitest';
|
|
252
252
|
|
|
253
253
|
import config from '../zmdb.config.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/templates/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,YAAY,CAAC;AAElE,MAAM,CAAC,MAAM,eAAe,GAAoB,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,KAAK,EAAE;QACL;YACE,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;gBACxB,IAAI,EAAE,IAAI,CAAC,QAAQ;gBACnB,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,OAAO;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,KAAK,EAAE,4BAA4B;oBACnC,KAAK,EACH,qIAAqI;oBACvI,GAAG,EAAE,4BAA4B;oBACjC,WAAW,EAAE,kCAAkC;oBAC/C,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,oBAAoB;oBAC3B,IAAI,EAAE,qEAAqE;oBAC3E,SAAS,EAAE,cAAc;iBAC1B;gBACD,YAAY,EAAE;oBACZ,
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/templates/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,YAAY,CAAC;AAElE,MAAM,CAAC,MAAM,eAAe,GAAoB,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7E,KAAK,EAAE;QACL;YACE,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;gBACxB,IAAI,EAAE,IAAI,CAAC,QAAQ;gBACnB,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,OAAO;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE;oBACP,KAAK,EAAE,4BAA4B;oBACnC,KAAK,EACH,qIAAqI;oBACvI,GAAG,EAAE,4BAA4B;oBACjC,WAAW,EAAE,kCAAkC;oBAC/C,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,oBAAoB;oBAC3B,IAAI,EAAE,qEAAqE;oBAC3E,SAAS,EAAE,cAAc;iBAC1B;gBACD,YAAY,EAAE;oBACZ,YAAY,EAAE,cAAc;oBAC5B,cAAc,EAAE,cAAc;iBAC/B;gBACD,eAAe,EAAE;oBACf,aAAa,EAAE,QAAQ;oBACvB,OAAO,EAAE,QAAQ;oBACjB,KAAK,EAAE,QAAQ;oBACf,MAAM,EAAE,QAAQ;oBAChB,UAAU,EAAE,OAAO;oBACnB,MAAM,EAAE,OAAO;iBAChB;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;iBACb;aACF,CAAC,IAAI;SACP;QACD;YACE,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;gBACxB,eAAe,EAAE;oBACf,0BAA0B,EAAE,KAAK;oBACjC,0BAA0B,EAAE,IAAI;oBAChC,eAAe,EAAE,IAAI;oBACrB,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC;oBACtC,MAAM,EAAE,UAAU;oBAClB,gBAAgB,EAAE,UAAU;oBAC5B,MAAM,EAAE,IAAI;oBACZ,kBAAkB,EAAE,IAAI;oBACxB,wBAAwB,EAAE,IAAI;oBAC9B,YAAY,EAAE,IAAI;oBAClB,MAAM,EAAE,IAAI;oBACZ,MAAM,EAAE,QAAQ;oBAChB,KAAK,EAAE,CAAC,MAAM,CAAC;oBACf,oBAAoB,EAAE,IAAI;iBAC3B;gBACD,OAAO,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,CAAC;aAC/D,CAAC,IAAI;SACP;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE;;;;;;;;;wBASU,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyErD;SACI;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE;;;;;;;CAOb;SACI;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE;;;;;;;;;;;;;;;CAeb;SACI;QACD;YACE,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE;;;;;;CAMb;SACI;QACD;YACE,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Cb;SACI;QACD;YACE,IAAI,EAAE,0BAA0B;YAChC,MAAM,EAAE;;;;;;;;;CASb;SACI;QACD;YACE,IAAI,EAAE,+BAA+B;YACrC,MAAM,EAAE;;;;;;;;;;;;;;;;;;CAkBb;SACI;QACD;YACE,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE;;;;;CAKb;SACI;KACF;CACF,CAAC,CAAC"}
|
|
@@ -2,10 +2,10 @@ export const repositoryTemplate = ({ name }) => ({
|
|
|
2
2
|
files: [
|
|
3
3
|
{
|
|
4
4
|
path: `src/${name.fileStem}.repository.ts`,
|
|
5
|
-
source: `import { defineRepository, schemaOf, type Driver } from 'zmdb';
|
|
6
|
-
import type { BaseRepository } from 'zmdb/orm';
|
|
7
|
-
import { repositoryToken } from 'zmdb/app/data';
|
|
8
|
-
import type { ProviderDef } from 'zmdb/app/modules';
|
|
5
|
+
source: `import { defineRepository, schemaOf, type Driver } from '@zmdb/core';
|
|
6
|
+
import type { BaseRepository } from '@zmdb/core/orm';
|
|
7
|
+
import { repositoryToken } from '@zmdb/core/app/data';
|
|
8
|
+
import type { ProviderDef } from '@zmdb/core/app/modules';
|
|
9
9
|
|
|
10
10
|
import type { ${name.pascal} } from './${name.fileStem}.js';
|
|
11
11
|
|
|
@@ -25,9 +25,9 @@ export function ${name.camel}RepositoryProvider(driver: Driver): ProviderDef<Bas
|
|
|
25
25
|
path: `src/${name.fileStem}.repository.spec.ts`,
|
|
26
26
|
source: `import { DatabaseSync } from 'node:sqlite';
|
|
27
27
|
|
|
28
|
-
import { sqliteDriver } from 'zmdb/sqlite';
|
|
29
|
-
import { createTestApp } from 'zmdb/testing';
|
|
30
|
-
import { Module } from 'zmdb';
|
|
28
|
+
import { sqliteDriver } from '@zmdb/core/sqlite';
|
|
29
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
30
|
+
import { Module } from '@zmdb/core';
|
|
31
31
|
import { describe, expect, it } from 'vitest';
|
|
32
32
|
|
|
33
33
|
import {
|
package/dist/templates/schema.js
CHANGED
|
@@ -2,7 +2,7 @@ export const schemaTemplate = ({ name }) => ({
|
|
|
2
2
|
files: [
|
|
3
3
|
{
|
|
4
4
|
path: `src/${name.fileStem}.ts`,
|
|
5
|
-
source: `import type { PrimaryKey, Serial, Sql, Table } from 'zmdb';
|
|
5
|
+
source: `import type { PrimaryKey, Serial, Sql, Table } from '@zmdb/core';
|
|
6
6
|
|
|
7
7
|
export interface ${name.pascal} extends Table<'${name.table}'> {
|
|
8
8
|
id: number & Sql<'integer'> & Serial & PrimaryKey;
|
|
@@ -12,8 +12,8 @@ export interface ${name.pascal} extends Table<'${name.table}'> {
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
path: `src/${name.fileStem}.spec.ts`,
|
|
15
|
-
source: `import { Module, is, schemaOf } from 'zmdb';
|
|
16
|
-
import { createTestApp } from 'zmdb/testing';
|
|
15
|
+
source: `import { Module, is, schemaOf } from '@zmdb/core';
|
|
16
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
17
17
|
import { describe, expect, it } from 'vitest';
|
|
18
18
|
|
|
19
19
|
import type { ${name.pascal} } from './${name.fileStem}.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zmdb/cli",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "The zmdb executable and developer command APIs for schema, application and HTTP workflows.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"test": "vitest run"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@zmdb/compiler": "1.0.0-beta.
|
|
44
|
-
"@zmdb/migrations": "1.0.0-beta.
|
|
43
|
+
"@zmdb/compiler": "1.0.0-beta.2",
|
|
44
|
+
"@zmdb/migrations": "1.0.0-beta.2",
|
|
45
45
|
"oxfmt": "0.66.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@zmdb/app": "1.0.0-beta.
|
|
49
|
-
"@zmdb/orm": "1.0.0-beta.
|
|
50
|
-
"@zmdb/schema": "1.0.0-beta.
|
|
51
|
-
"@zmdb/sql": "1.0.0-beta.
|
|
52
|
-
"@zmdb/web": "1.0.0-beta.
|
|
48
|
+
"@zmdb/app": "1.0.0-beta.2",
|
|
49
|
+
"@zmdb/orm": "1.0.0-beta.2",
|
|
50
|
+
"@zmdb/schema": "1.0.0-beta.2",
|
|
51
|
+
"@zmdb/sql": "1.0.0-beta.2",
|
|
52
|
+
"@zmdb/web": "1.0.0-beta.2",
|
|
53
53
|
"esbuild": ">=0.28.2 <0.29.0",
|
|
54
54
|
"typescript": ">=7.0.2 <8.0.0"
|
|
55
55
|
},
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@zmdb/sql/*": ["__ROOT__/packages/sql/src/*/index.ts"],
|
|
13
13
|
"@zmdb/schema": ["__ROOT__/packages/schema/src/index.ts"],
|
|
14
14
|
"@zmdb/schema/*": ["__ROOT__/packages/schema/src/*/index.ts"],
|
|
15
|
-
"zmdb/tags": ["__ROOT__/packages/zmdb/src/tags.ts"]
|
|
15
|
+
"@zmdb/core/tags": ["__ROOT__/packages/zmdb/src/tags.ts"]
|
|
16
16
|
},
|
|
17
17
|
"skipLibCheck": true,
|
|
18
18
|
"strict": true,
|
package/src/templates/command.ts
CHANGED
|
@@ -4,7 +4,7 @@ export const commandTemplate: TemplateFactory = ({ name }) => ({
|
|
|
4
4
|
files: [
|
|
5
5
|
{
|
|
6
6
|
path: `src/${name.fileStem}.command.ts`,
|
|
7
|
-
source: `import { assert } from 'zmdb';
|
|
7
|
+
source: `import { assert } from '@zmdb/core';
|
|
8
8
|
import { Command } from '@zmdb/app/commands';
|
|
9
9
|
|
|
10
10
|
export interface ${name.pascal}Args {
|
|
@@ -36,8 +36,8 @@ export class ${name.pascal}Command {
|
|
|
36
36
|
{
|
|
37
37
|
path: `src/${name.fileStem}.command.spec.ts`,
|
|
38
38
|
source: `import { createCommandApp } from '@zmdb/app/commands';
|
|
39
|
-
import { createTestApp } from 'zmdb/testing';
|
|
40
|
-
import { Module } from 'zmdb';
|
|
39
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
40
|
+
import { Module } from '@zmdb/core';
|
|
41
41
|
import { describe, expect, it } from 'vitest';
|
|
42
42
|
|
|
43
43
|
import {
|
|
@@ -4,7 +4,7 @@ export const controllerTemplate: TemplateFactory = ({ name }) => ({
|
|
|
4
4
|
files: [
|
|
5
5
|
{
|
|
6
6
|
path: `src/${name.fileStem}.controller.ts`,
|
|
7
|
-
source: `import { Controller, Get } from 'zmdb';
|
|
7
|
+
source: `import { Controller, Get } from '@zmdb/core';
|
|
8
8
|
|
|
9
9
|
@Controller('/${name.fileStem}')
|
|
10
10
|
export class ${name.pascal}Controller {
|
|
@@ -17,9 +17,9 @@ export class ${name.pascal}Controller {
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
path: `src/${name.fileStem}.controller.spec.ts`,
|
|
20
|
-
source: `import { Module } from 'zmdb';
|
|
21
|
-
import { createTestApp } from 'zmdb/testing';
|
|
22
|
-
import { bodyText } from 'zmdb/web';
|
|
20
|
+
source: `import { Module } from '@zmdb/core';
|
|
21
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
22
|
+
import { bodyText } from '@zmdb/core/web';
|
|
23
23
|
import { describe, expect, it } from 'vitest';
|
|
24
24
|
|
|
25
25
|
import { ${name.pascal}Controller } from './${name.fileStem}.controller.js';
|
package/src/templates/module.ts
CHANGED
|
@@ -4,8 +4,8 @@ export const moduleTemplate: TemplateFactory = ({ name }) => ({
|
|
|
4
4
|
files: [
|
|
5
5
|
{
|
|
6
6
|
path: `src/${name.fileStem}.module.ts`,
|
|
7
|
-
source: `import { Module } from 'zmdb';
|
|
8
|
-
import { createToken } from 'zmdb/web';
|
|
7
|
+
source: `import { Module } from '@zmdb/core';
|
|
8
|
+
import { createToken } from '@zmdb/core/web';
|
|
9
9
|
|
|
10
10
|
export interface ${name.pascal}Status {
|
|
11
11
|
readonly name: '${name.fileStem}';
|
|
@@ -23,7 +23,7 @@ export class ${name.pascal}Module {}
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
path: `src/${name.fileStem}.module.spec.ts`,
|
|
26
|
-
source: `import { createTestApp } from 'zmdb/testing';
|
|
26
|
+
source: `import { createTestApp } from '@zmdb/core/testing';
|
|
27
27
|
import { describe, expect, it } from 'vitest';
|
|
28
28
|
|
|
29
29
|
import { ${name.constant}_STATUS, ${name.pascal}Module } from './${name.fileStem}.module.js';
|
package/src/templates/project.ts
CHANGED
|
@@ -21,8 +21,8 @@ export const projectTemplate: TemplateFactory = ({ name, packageVersion }) => ({
|
|
|
21
21
|
typecheck: 'tsc --noEmit',
|
|
22
22
|
},
|
|
23
23
|
dependencies: {
|
|
24
|
+
'@zmdb/core': packageVersion,
|
|
24
25
|
'@zmdb/sqlite': packageVersion,
|
|
25
|
-
zmdb: packageVersion,
|
|
26
26
|
},
|
|
27
27
|
devDependencies: {
|
|
28
28
|
'@types/node': '26.4.1',
|
|
@@ -67,7 +67,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
67
67
|
|
|
68
68
|
import { build } from 'esbuild';
|
|
69
69
|
import { format } from 'oxfmt';
|
|
70
|
-
import { zmdbAot } from 'zmdb/compiler';
|
|
70
|
+
import { zmdbAot } from '@zmdb/core/compiler';
|
|
71
71
|
|
|
72
72
|
const root = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
73
73
|
const formatOptions = ${JSON.stringify(FORMAT_OPTIONS)};
|
|
@@ -161,8 +161,8 @@ export default defineConfig({
|
|
|
161
161
|
source: `import { DatabaseSync } from 'node:sqlite';
|
|
162
162
|
import { fileURLToPath } from 'node:url';
|
|
163
163
|
|
|
164
|
-
import { defineConfig } from 'zmdb';
|
|
165
|
-
import { sqlite, sqliteDriver } from 'zmdb/sqlite';
|
|
164
|
+
import { defineConfig } from '@zmdb/core';
|
|
165
|
+
import { sqlite, sqliteDriver } from '@zmdb/core/sqlite';
|
|
166
166
|
|
|
167
167
|
const databasePath = fileURLToPath(new URL('./database.sqlite', import.meta.url));
|
|
168
168
|
|
|
@@ -177,7 +177,7 @@ export default defineConfig({
|
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
path: 'src/app.module.ts',
|
|
180
|
-
source: `import { Module } from 'zmdb';
|
|
180
|
+
source: `import { Module } from '@zmdb/core';
|
|
181
181
|
|
|
182
182
|
import { HealthController } from './health.controller.js';
|
|
183
183
|
|
|
@@ -189,7 +189,7 @@ export class AppModule {}
|
|
|
189
189
|
path: 'src/main.ts',
|
|
190
190
|
source: `import { createServer } from 'node:http';
|
|
191
191
|
|
|
192
|
-
import { compileModule, createRouter, toNodeHandler } from 'zmdb/web';
|
|
192
|
+
import { compileModule, createRouter, toNodeHandler } from '@zmdb/core/web';
|
|
193
193
|
|
|
194
194
|
import { AppModule } from './app.module.js';
|
|
195
195
|
|
|
@@ -235,7 +235,7 @@ server.listen(port, '127.0.0.1', () => {
|
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
path: 'src/health.controller.ts',
|
|
238
|
-
source: `import { Controller, Get } from 'zmdb';
|
|
238
|
+
source: `import { Controller, Get } from '@zmdb/core';
|
|
239
239
|
|
|
240
240
|
@Controller('/health')
|
|
241
241
|
export class HealthController {
|
|
@@ -248,8 +248,8 @@ export class HealthController {
|
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
path: 'src/health.controller.spec.ts',
|
|
251
|
-
source: `import { createTestApp } from 'zmdb/testing';
|
|
252
|
-
import { bodyText } from 'zmdb/web';
|
|
251
|
+
source: `import { createTestApp } from '@zmdb/core/testing';
|
|
252
|
+
import { bodyText } from '@zmdb/core/web';
|
|
253
253
|
import { describe, expect, it } from 'vitest';
|
|
254
254
|
|
|
255
255
|
import config from '../zmdb.config.js';
|
|
@@ -4,10 +4,10 @@ export const repositoryTemplate: TemplateFactory = ({ name }) => ({
|
|
|
4
4
|
files: [
|
|
5
5
|
{
|
|
6
6
|
path: `src/${name.fileStem}.repository.ts`,
|
|
7
|
-
source: `import { defineRepository, schemaOf, type Driver } from 'zmdb';
|
|
8
|
-
import type { BaseRepository } from 'zmdb/orm';
|
|
9
|
-
import { repositoryToken } from 'zmdb/app/data';
|
|
10
|
-
import type { ProviderDef } from 'zmdb/app/modules';
|
|
7
|
+
source: `import { defineRepository, schemaOf, type Driver } from '@zmdb/core';
|
|
8
|
+
import type { BaseRepository } from '@zmdb/core/orm';
|
|
9
|
+
import { repositoryToken } from '@zmdb/core/app/data';
|
|
10
|
+
import type { ProviderDef } from '@zmdb/core/app/modules';
|
|
11
11
|
|
|
12
12
|
import type { ${name.pascal} } from './${name.fileStem}.js';
|
|
13
13
|
|
|
@@ -27,9 +27,9 @@ export function ${name.camel}RepositoryProvider(driver: Driver): ProviderDef<Bas
|
|
|
27
27
|
path: `src/${name.fileStem}.repository.spec.ts`,
|
|
28
28
|
source: `import { DatabaseSync } from 'node:sqlite';
|
|
29
29
|
|
|
30
|
-
import { sqliteDriver } from 'zmdb/sqlite';
|
|
31
|
-
import { createTestApp } from 'zmdb/testing';
|
|
32
|
-
import { Module } from 'zmdb';
|
|
30
|
+
import { sqliteDriver } from '@zmdb/core/sqlite';
|
|
31
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
32
|
+
import { Module } from '@zmdb/core';
|
|
33
33
|
import { describe, expect, it } from 'vitest';
|
|
34
34
|
|
|
35
35
|
import {
|
package/src/templates/schema.ts
CHANGED
|
@@ -4,7 +4,7 @@ export const schemaTemplate: TemplateFactory = ({ name }) => ({
|
|
|
4
4
|
files: [
|
|
5
5
|
{
|
|
6
6
|
path: `src/${name.fileStem}.ts`,
|
|
7
|
-
source: `import type { PrimaryKey, Serial, Sql, Table } from 'zmdb';
|
|
7
|
+
source: `import type { PrimaryKey, Serial, Sql, Table } from '@zmdb/core';
|
|
8
8
|
|
|
9
9
|
export interface ${name.pascal} extends Table<'${name.table}'> {
|
|
10
10
|
id: number & Sql<'integer'> & Serial & PrimaryKey;
|
|
@@ -14,8 +14,8 @@ export interface ${name.pascal} extends Table<'${name.table}'> {
|
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
path: `src/${name.fileStem}.spec.ts`,
|
|
17
|
-
source: `import { Module, is, schemaOf } from 'zmdb';
|
|
18
|
-
import { createTestApp } from 'zmdb/testing';
|
|
17
|
+
source: `import { Module, is, schemaOf } from '@zmdb/core';
|
|
18
|
+
import { createTestApp } from '@zmdb/core/testing';
|
|
19
19
|
import { describe, expect, it } from 'vitest';
|
|
20
20
|
|
|
21
21
|
import type { ${name.pascal} } from './${name.fileStem}.js';
|