@zmdb/cli 1.0.0-beta.1

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 (207) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +19 -0
  3. package/dist/__fixtures__/http-client/src/contract.d.ts +38 -0
  4. package/dist/__fixtures__/http-client/src/contract.d.ts.map +1 -0
  5. package/dist/__fixtures__/http-client/src/contract.js +121 -0
  6. package/dist/__fixtures__/http-client/src/contract.js.map +1 -0
  7. package/dist/__fixtures__/http-client/src/models.d.ts +11 -0
  8. package/dist/__fixtures__/http-client/src/models.d.ts.map +1 -0
  9. package/dist/__fixtures__/http-client/src/models.js +2 -0
  10. package/dist/__fixtures__/http-client/src/models.js.map +1 -0
  11. package/dist/__fixtures__/http-client/src/schema.d.ts +4 -0
  12. package/dist/__fixtures__/http-client/src/schema.d.ts.map +1 -0
  13. package/dist/__fixtures__/http-client/src/schema.js +2 -0
  14. package/dist/__fixtures__/http-client/src/schema.js.map +1 -0
  15. package/dist/__fixtures__/http-client/src/unrelated.d.ts +2 -0
  16. package/dist/__fixtures__/http-client/src/unrelated.d.ts.map +1 -0
  17. package/dist/__fixtures__/http-client/src/unrelated.js +2 -0
  18. package/dist/__fixtures__/http-client/src/unrelated.js.map +1 -0
  19. package/dist/__fixtures__/http-client/zmdb.config.d.ts +16 -0
  20. package/dist/__fixtures__/http-client/zmdb.config.d.ts.map +1 -0
  21. package/dist/__fixtures__/http-client/zmdb.config.js +12 -0
  22. package/dist/__fixtures__/http-client/zmdb.config.js.map +1 -0
  23. package/dist/__fixtures__/project/src/schema.d.ts +6 -0
  24. package/dist/__fixtures__/project/src/schema.d.ts.map +1 -0
  25. package/dist/__fixtures__/project/src/schema.js +2 -0
  26. package/dist/__fixtures__/project/src/schema.js.map +1 -0
  27. package/dist/__fixtures__/project/zmdb.config.d.ts +22 -0
  28. package/dist/__fixtures__/project/zmdb.config.d.ts.map +1 -0
  29. package/dist/__fixtures__/project/zmdb.config.js +55 -0
  30. package/dist/__fixtures__/project/zmdb.config.js.map +1 -0
  31. package/dist/application-loader.d.ts +4 -0
  32. package/dist/application-loader.d.ts.map +1 -0
  33. package/dist/application-loader.js +102 -0
  34. package/dist/application-loader.js.map +1 -0
  35. package/dist/args.d.ts +23 -0
  36. package/dist/args.d.ts.map +1 -0
  37. package/dist/args.js +353 -0
  38. package/dist/args.js.map +1 -0
  39. package/dist/atomic.d.ts +13 -0
  40. package/dist/atomic.d.ts.map +1 -0
  41. package/dist/atomic.js +28 -0
  42. package/dist/atomic.js.map +1 -0
  43. package/dist/bin.d.ts +3 -0
  44. package/dist/bin.d.ts.map +1 -0
  45. package/dist/bin.js +4 -0
  46. package/dist/bin.js.map +1 -0
  47. package/dist/commands/check.d.ts +5 -0
  48. package/dist/commands/check.d.ts.map +1 -0
  49. package/dist/commands/check.js +7 -0
  50. package/dist/commands/check.js.map +1 -0
  51. package/dist/commands/client.d.ts +38 -0
  52. package/dist/commands/client.d.ts.map +1 -0
  53. package/dist/commands/client.js +347 -0
  54. package/dist/commands/client.js.map +1 -0
  55. package/dist/commands/codegen.d.ts +9 -0
  56. package/dist/commands/codegen.d.ts.map +1 -0
  57. package/dist/commands/codegen.js +56 -0
  58. package/dist/commands/codegen.js.map +1 -0
  59. package/dist/commands/embed.d.ts +8 -0
  60. package/dist/commands/embed.d.ts.map +1 -0
  61. package/dist/commands/embed.js +17 -0
  62. package/dist/commands/embed.js.map +1 -0
  63. package/dist/commands/export.d.ts +5 -0
  64. package/dist/commands/export.d.ts.map +1 -0
  65. package/dist/commands/export.js +6 -0
  66. package/dist/commands/export.js.map +1 -0
  67. package/dist/commands/generate.d.ts +5 -0
  68. package/dist/commands/generate.d.ts.map +1 -0
  69. package/dist/commands/generate.js +6 -0
  70. package/dist/commands/generate.js.map +1 -0
  71. package/dist/commands/migrate.d.ts +9 -0
  72. package/dist/commands/migrate.d.ts.map +1 -0
  73. package/dist/commands/migrate.js +18 -0
  74. package/dist/commands/migrate.js.map +1 -0
  75. package/dist/commands/new.d.ts +4 -0
  76. package/dist/commands/new.d.ts.map +1 -0
  77. package/dist/commands/new.js +35 -0
  78. package/dist/commands/new.js.map +1 -0
  79. package/dist/commands/pull.d.ts +5 -0
  80. package/dist/commands/pull.d.ts.map +1 -0
  81. package/dist/commands/pull.js +14 -0
  82. package/dist/commands/pull.js.map +1 -0
  83. package/dist/commands/push.d.ts +6 -0
  84. package/dist/commands/push.d.ts.map +1 -0
  85. package/dist/commands/push.js +11 -0
  86. package/dist/commands/push.js.map +1 -0
  87. package/dist/commands/studio.d.ts +31 -0
  88. package/dist/commands/studio.d.ts.map +1 -0
  89. package/dist/commands/studio.js +154 -0
  90. package/dist/commands/studio.js.map +1 -0
  91. package/dist/commands/upgrade.d.ts +5 -0
  92. package/dist/commands/upgrade.d.ts.map +1 -0
  93. package/dist/commands/upgrade.js +11 -0
  94. package/dist/commands/upgrade.js.map +1 -0
  95. package/dist/database.d.ts +4 -0
  96. package/dist/database.d.ts.map +1 -0
  97. package/dist/database.js +8 -0
  98. package/dist/database.js.map +1 -0
  99. package/dist/errors.d.ts +7 -0
  100. package/dist/errors.d.ts.map +1 -0
  101. package/dist/errors.js +20 -0
  102. package/dist/errors.js.map +1 -0
  103. package/dist/index.d.ts +34 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +626 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/lifecycle.d.ts +6 -0
  108. package/dist/lifecycle.d.ts.map +1 -0
  109. package/dist/lifecycle.js +75 -0
  110. package/dist/lifecycle.js.map +1 -0
  111. package/dist/migration-project.d.ts +14 -0
  112. package/dist/migration-project.d.ts.map +1 -0
  113. package/dist/migration-project.js +74 -0
  114. package/dist/migration-project.js.map +1 -0
  115. package/dist/output.d.ts +27 -0
  116. package/dist/output.d.ts.map +1 -0
  117. package/dist/output.js +60 -0
  118. package/dist/output.js.map +1 -0
  119. package/dist/repl.d.ts +48 -0
  120. package/dist/repl.d.ts.map +1 -0
  121. package/dist/repl.js +265 -0
  122. package/dist/repl.js.map +1 -0
  123. package/dist/scaffold.d.ts +28 -0
  124. package/dist/scaffold.d.ts.map +1 -0
  125. package/dist/scaffold.js +414 -0
  126. package/dist/scaffold.js.map +1 -0
  127. package/dist/studio/index.d.ts +20 -0
  128. package/dist/studio/index.d.ts.map +1 -0
  129. package/dist/studio/index.js +607 -0
  130. package/dist/studio/index.js.map +1 -0
  131. package/dist/templates/command.d.ts +3 -0
  132. package/dist/templates/command.d.ts.map +1 -0
  133. package/dist/templates/command.js +65 -0
  134. package/dist/templates/command.js.map +1 -0
  135. package/dist/templates/controller.d.ts +3 -0
  136. package/dist/templates/controller.d.ts.map +1 -0
  137. package/dist/templates/controller.js +41 -0
  138. package/dist/templates/controller.js.map +1 -0
  139. package/dist/templates/index.d.ts +4 -0
  140. package/dist/templates/index.d.ts.map +1 -0
  141. package/dist/templates/index.js +18 -0
  142. package/dist/templates/index.js.map +1 -0
  143. package/dist/templates/module.d.ts +3 -0
  144. package/dist/templates/module.d.ts.map +1 -0
  145. package/dist/templates/module.js +41 -0
  146. package/dist/templates/module.js.map +1 -0
  147. package/dist/templates/project.d.ts +3 -0
  148. package/dist/templates/project.d.ts.map +1 -0
  149. package/dist/templates/project.js +280 -0
  150. package/dist/templates/project.js.map +1 -0
  151. package/dist/templates/repository.d.ts +3 -0
  152. package/dist/templates/repository.d.ts.map +1 -0
  153. package/dist/templates/repository.js +66 -0
  154. package/dist/templates/repository.js.map +1 -0
  155. package/dist/templates/schema.d.ts +3 -0
  156. package/dist/templates/schema.d.ts.map +1 -0
  157. package/dist/templates/schema.js +36 -0
  158. package/dist/templates/schema.js.map +1 -0
  159. package/dist/templates/types.d.ts +25 -0
  160. package/dist/templates/types.d.ts.map +1 -0
  161. package/dist/templates/types.js +17 -0
  162. package/dist/templates/types.js.map +1 -0
  163. package/package.json +72 -0
  164. package/src/__fixtures__/http-client/package.json +5 -0
  165. package/src/__fixtures__/http-client/src/contract.ts +85 -0
  166. package/src/__fixtures__/http-client/src/models.ts +12 -0
  167. package/src/__fixtures__/http-client/src/schema.ts +3 -0
  168. package/src/__fixtures__/http-client/src/unrelated.ts +1 -0
  169. package/src/__fixtures__/http-client/tsconfig.json +17 -0
  170. package/src/__fixtures__/http-client/zmdb.config.ts +12 -0
  171. package/src/__fixtures__/project/package.json +5 -0
  172. package/src/__fixtures__/project/src/schema.ts +6 -0
  173. package/src/__fixtures__/project/tsconfig.json +24 -0
  174. package/src/__fixtures__/project/zmdb.config.ts +57 -0
  175. package/src/application-loader.ts +108 -0
  176. package/src/args.ts +391 -0
  177. package/src/atomic.ts +43 -0
  178. package/src/bin.ts +5 -0
  179. package/src/commands/check.ts +11 -0
  180. package/src/commands/client.ts +415 -0
  181. package/src/commands/codegen.ts +73 -0
  182. package/src/commands/embed.ts +36 -0
  183. package/src/commands/export.ts +10 -0
  184. package/src/commands/generate.ts +14 -0
  185. package/src/commands/migrate.ts +38 -0
  186. package/src/commands/new.ts +48 -0
  187. package/src/commands/pull.ts +32 -0
  188. package/src/commands/push.ts +21 -0
  189. package/src/commands/studio.ts +200 -0
  190. package/src/commands/upgrade.ts +14 -0
  191. package/src/database.ts +9 -0
  192. package/src/errors.ts +19 -0
  193. package/src/index.ts +710 -0
  194. package/src/lifecycle.ts +73 -0
  195. package/src/migration-project.ts +91 -0
  196. package/src/output.ts +77 -0
  197. package/src/repl.ts +328 -0
  198. package/src/scaffold.ts +485 -0
  199. package/src/studio/index.ts +674 -0
  200. package/src/templates/command.ts +66 -0
  201. package/src/templates/controller.ts +42 -0
  202. package/src/templates/index.ts +29 -0
  203. package/src/templates/module.ts +42 -0
  204. package/src/templates/project.ts +281 -0
  205. package/src/templates/repository.ts +67 -0
  206. package/src/templates/schema.ts +37 -0
  207. package/src/templates/types.ts +46 -0
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # @zmdb/cli
2
+
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 `zmdb@1.0.0-beta.1` for the complete product facade and the same executable.
5
+
6
+ ```sh
7
+ yarn add --dev @zmdb/cli@1.0.0-beta.1 typescript@^7.0.2
8
+ yarn zmdb --help
9
+ yarn zmdb codegen --project tsconfig.json
10
+ ```
11
+
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 `zmdb/config`.
14
+
15
+ `@zmdb/cli` exposes `runCli`, migration generation, embedding, schema export, declaration pulling and HTTP artifact helpers. `zmdb/cli` exports the same function identities. Command implementations
16
+ load when selected, so application imports do not need to load reflection, esbuild or a REPL.
17
+
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
+ matching this package's peer ranges. Database commands obtain their driver from the application's config; install the database package that owns that driver.
@@ -0,0 +1,38 @@
1
+ import type { AcceptedAccount, Account, Health } from './models.js';
2
+ interface GetAccountOperation {
3
+ readonly path: {
4
+ readonly accountId: string;
5
+ };
6
+ readonly responses: {
7
+ readonly 200: {
8
+ readonly body: Account;
9
+ };
10
+ readonly 202: {
11
+ readonly body: AcceptedAccount;
12
+ };
13
+ };
14
+ }
15
+ interface HealthOperation {
16
+ readonly responses: {
17
+ readonly 200: {
18
+ readonly body: Health;
19
+ };
20
+ };
21
+ }
22
+ export declare class AccountsController {
23
+ getAccount(): {
24
+ id: string;
25
+ displayName: string;
26
+ };
27
+ health(): {
28
+ ok: boolean;
29
+ };
30
+ }
31
+ export declare const HTTP_CONTRACT: import("@zmdb/web/contract").HttpContractDeclaration<{
32
+ readonly get_accounts_accountId: import("@zmdb/web/contract").HttpOperationDeclaration<GetAccountOperation, import("@zmdb/web/contract").HttpController, string>;
33
+ }>;
34
+ export declare const HEALTH_CONTRACT: import("@zmdb/web/contract").HttpContractDeclaration<{
35
+ readonly get_accounts_health: import("@zmdb/web/contract").HttpOperationDeclaration<HealthOperation, import("@zmdb/web/contract").HttpController, string>;
36
+ }>;
37
+ export {};
38
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/contract.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKpE,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE;QAClB,QAAQ,CAAC,GAAG,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC;QACzC,QAAQ,CAAC,GAAG,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;SAAE,CAAC;KAClD,CAAC;CACH;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,SAAS,EAAE;QAClB,QAAQ,CAAC,GAAG,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACzC,CAAC;CACH;AAED,qBACa,kBAAkB;IAE7B,UAAU;QACC,EAAE;QAAe,WAAW;MACtC;IAID,MAAM;QACK,EAAE;MACZ;CACF;AAED,eAAO,MAAM,aAAa;;EA0BxB,CAAC;AAEH,eAAO,MAAM,eAAe;;EAoB1B,CAAC"}
@@ -0,0 +1,121 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
35
+ import { defineHttpContract, httpOperation } from '@zmdb/web/contract';
36
+ import { Controller, Get, Public } from '@zmdb/web/routing';
37
+ const previousLoads = Reflect.get(globalThis, '__zmdbHttpContractFixtureLoads');
38
+ Reflect.set(globalThis, '__zmdbHttpContractFixtureLoads', typeof previousLoads === 'number' ? previousLoads + 1 : 1);
39
+ let AccountsController = (() => {
40
+ let _classDecorators = [Controller('/accounts')];
41
+ let _classDescriptor;
42
+ let _classExtraInitializers = [];
43
+ let _classThis;
44
+ let _instanceExtraInitializers = [];
45
+ let _getAccount_decorators;
46
+ let _health_decorators;
47
+ var AccountsController = class {
48
+ static { _classThis = this; }
49
+ static {
50
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
51
+ _getAccount_decorators = [Get('/:accountId')];
52
+ _health_decorators = [Public(), Get('/health')];
53
+ __esDecorate(this, null, _getAccount_decorators, { kind: "method", name: "getAccount", static: false, private: false, access: { has: obj => "getAccount" in obj, get: obj => obj.getAccount }, metadata: _metadata }, null, _instanceExtraInitializers);
54
+ __esDecorate(this, null, _health_decorators, { kind: "method", name: "health", static: false, private: false, access: { has: obj => "health" in obj, get: obj => obj.health }, metadata: _metadata }, null, _instanceExtraInitializers);
55
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
56
+ AccountsController = _classThis = _classDescriptor.value;
57
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
58
+ __runInitializers(_classThis, _classExtraInitializers);
59
+ }
60
+ getAccount() {
61
+ return { id: 'account-1', displayName: 'Account 1' };
62
+ }
63
+ health() {
64
+ return { ok: true };
65
+ }
66
+ constructor() {
67
+ __runInitializers(this, _instanceExtraInitializers);
68
+ }
69
+ };
70
+ return AccountsController = _classThis;
71
+ })();
72
+ export { AccountsController };
73
+ export const HTTP_CONTRACT = defineHttpContract({
74
+ securitySchemes: {
75
+ bearerAuth: { type: 'http', scheme: 'bearer' },
76
+ },
77
+ operations: {
78
+ get_accounts_accountId: httpOperation({
79
+ controller: AccountsController,
80
+ handler: 'getAccount',
81
+ method: 'GET',
82
+ path: '/accounts/:accountId',
83
+ parameters: [{ in: 'path', property: 'accountId', name: 'accountId' }],
84
+ responses: {
85
+ 200: {
86
+ description: 'Found',
87
+ body: { kind: 'json', mediaType: 'application/json' },
88
+ },
89
+ 202: {
90
+ description: 'Accepted',
91
+ body: { kind: 'json', mediaType: 'application/json' },
92
+ },
93
+ },
94
+ security: [{ bearerAuth: [] }],
95
+ version: { kind: 'none' },
96
+ deprecated: false,
97
+ }),
98
+ },
99
+ });
100
+ export const HEALTH_CONTRACT = defineHttpContract({
101
+ securitySchemes: {},
102
+ operations: {
103
+ get_accounts_health: httpOperation({
104
+ controller: AccountsController,
105
+ handler: 'health',
106
+ method: 'GET',
107
+ path: '/accounts/health',
108
+ parameters: [],
109
+ responses: {
110
+ 200: {
111
+ description: 'Healthy',
112
+ body: { kind: 'json', mediaType: 'application/json' },
113
+ },
114
+ },
115
+ security: [],
116
+ version: { kind: 'none' },
117
+ deprecated: false,
118
+ }),
119
+ },
120
+ });
121
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/contract.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI5D,MAAM,aAAa,GAAY,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,gCAAgC,CAAC,CAAC;AACzF,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,gCAAgC,EAAE,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAiBxG,kBAAkB;4BAD9B,UAAU,CAAC,WAAW,CAAC;;;;;;;;;;;sCAErB,GAAG,CAAC,aAAa,CAAC;kCAKlB,MAAM,EAAE,EACR,GAAG,CAAC,SAAS,CAAC;YALf,iLAAA,UAAU,6DAET;YAID,qKAAA,MAAM,6DAEL;YAVH,6KAWC;;;YAXY,uDAAkB;;QAE7B,UAAU;YACR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E,KAAK;YACb,IAAI,EAAE,kBAAkB;YACxB,UAAU,EAAE,EAAE;YACd,SAAS,EAAE;gBACT,GAAG,EAAE;oBACH,WAAW,EAAE,SAAS;oBACtB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE;iBACtD;aACF;YACD,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,UAAU,EAAE,KAAK;SAClB,CAAC;KACH;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface Account {
2
+ readonly id: string;
3
+ readonly displayName: string;
4
+ }
5
+ export interface AcceptedAccount {
6
+ readonly jobId: string;
7
+ }
8
+ export interface Health {
9
+ readonly ok: boolean;
10
+ }
11
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/models.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export interface FixtureSchema {
2
+ readonly id: number;
3
+ }
4
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const unrelated = "not part of the HTTP contract dependency set";
2
+ //# sourceMappingURL=unrelated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unrelated.d.ts","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/unrelated.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,iDAAiD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const unrelated = 'not part of the HTTP contract dependency set';
2
+ //# sourceMappingURL=unrelated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unrelated.js","sourceRoot":"","sources":["../../../../src/__fixtures__/http-client/src/unrelated.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,8CAA8C,CAAC"}
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ schema: string;
3
+ dialect: import("@zmdb/sql").SqlDialect<"sqlite">;
4
+ project: string;
5
+ http: {
6
+ contracts: string;
7
+ openApi: {
8
+ out: string;
9
+ };
10
+ client: {
11
+ out: string;
12
+ };
13
+ };
14
+ };
15
+ export default _default;
16
+ //# sourceMappingURL=zmdb.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zmdb.config.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/http-client/zmdb.config.ts"],"names":[],"mappings":";IAGE,MAAM;IACN,OAAO;IACP,OAAO;IACP,IAAI;QACF,SAAS;QACT,OAAO;YAAI,GAAG;;QACd,MAAM;YAAI,GAAG"}
@@ -0,0 +1,12 @@
1
+ import { sqlite } from '@zmdb/sqlite';
2
+ export default {
3
+ schema: './src/schema.ts',
4
+ dialect: sqlite,
5
+ project: './tsconfig.json',
6
+ http: {
7
+ contracts: './src/contract.ts#HTTP_CONTRACT',
8
+ openApi: { out: './generated/openapi.json' },
9
+ client: { out: './generated/http-client.generated.ts' },
10
+ },
11
+ };
12
+ //# sourceMappingURL=zmdb.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zmdb.config.js","sourceRoot":"","sources":["../../../src/__fixtures__/http-client/zmdb.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,eAAe;IACb,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,iBAAiB;IAC1B,IAAI,EAAE;QACJ,SAAS,EAAE,iCAAiC;QAC5C,OAAO,EAAE,EAAE,GAAG,EAAE,0BAA0B,EAAE;QAC5C,MAAM,EAAE,EAAE,GAAG,EAAE,sCAAsC,EAAE;KACxD;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { PrimaryKey, Serial, Sql, Table } from 'zmdb/tags';
2
+ export interface User extends Table<'users'> {
3
+ id: number & Sql<'integer'> & Serial & PrimaryKey;
4
+ email: string & Sql<'text'>;
5
+ }
6
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +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,WAAW,CAAC;AAEhE,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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/__fixtures__/project/src/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ declare const _default: {
2
+ schema: string;
3
+ dialect: import("@zmdb/sql").SqlDialect<"sqlite">;
4
+ project: string;
5
+ out: string;
6
+ driver: () => {
7
+ dialect: import("@zmdb/sql").SqlDialect<"sqlite">;
8
+ execute(query: {
9
+ readonly text: string;
10
+ readonly parameters: readonly unknown[];
11
+ }): Promise<Record<string, import("node:sqlite").SQLOutputValue>[]>;
12
+ transaction<Result>(run: (transaction: {
13
+ dialect: import("@zmdb/sql").SqlDialect<"sqlite">;
14
+ execute(query: {
15
+ readonly text: string;
16
+ readonly parameters: readonly unknown[];
17
+ }): Promise<Record<string, import("node:sqlite").SQLOutputValue>[]>;
18
+ }) => Promise<Result>): Promise<Result>;
19
+ };
20
+ };
21
+ export default _default;
22
+ //# sourceMappingURL=zmdb.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zmdb.config.d.ts","sourceRoot":"","sources":["../../../src/__fixtures__/project/zmdb.config.ts"],"names":[],"mappings":";;;;;;;uBA8B2B;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAA;SAAE;oBAarE,MAAM,OAAO,CAAC,WAAW;;2BAbtB;gBAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAA;aAAE;SAa7B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { DatabaseSync } from 'node:sqlite';
2
+ import { sqlite } from '@zmdb/sqlite';
3
+ const databasePath = process.env.ZMDB_TEST_DATABASE;
4
+ if (databasePath === undefined)
5
+ throw new Error('ZMDB_TEST_DATABASE is required');
6
+ function sqliteValue(value) {
7
+ if (value === null ||
8
+ typeof value === 'number' ||
9
+ typeof value === 'bigint' ||
10
+ typeof value === 'string' ||
11
+ value instanceof Uint8Array) {
12
+ return value;
13
+ }
14
+ if (value instanceof Date)
15
+ return value.toISOString();
16
+ throw new TypeError(`cannot bind ${typeof value} to sqlite`);
17
+ }
18
+ export default {
19
+ schema: 'src/**/*.ts',
20
+ dialect: sqlite,
21
+ project: './tsconfig.json',
22
+ out: './migrations',
23
+ driver: () => {
24
+ const database = new DatabaseSync(databasePath);
25
+ const driver = {
26
+ dialect: sqlite,
27
+ async execute(query) {
28
+ const read = /^\s*(?:PRAGMA|SELECT|WITH)\b/i.test(query.text) || /\bRETURNING\b/i.test(query.text);
29
+ const parameters = query.parameters.map(sqliteValue);
30
+ if (!read && query.parameters.length === 0) {
31
+ database.exec(query.text);
32
+ return [];
33
+ }
34
+ const statement = database.prepare(query.text);
35
+ return read ? statement.all(...parameters) : (statement.run(...parameters), []);
36
+ },
37
+ };
38
+ return {
39
+ ...driver,
40
+ async transaction(run) {
41
+ database.exec('BEGIN');
42
+ try {
43
+ const result = await run(driver);
44
+ database.exec('COMMIT');
45
+ return result;
46
+ }
47
+ catch (error) {
48
+ database.exec('ROLLBACK');
49
+ throw error;
50
+ }
51
+ },
52
+ };
53
+ },
54
+ };
55
+ //# sourceMappingURL=zmdb.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zmdb.config.js","sourceRoot":"","sources":["../../../src/__fixtures__/project/zmdb.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;AACpD,IAAI,YAAY,KAAK,SAAS;IAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AAElF,SAAS,W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SAAS,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QACF,OAAO;YACL,GAAG,MAAM;YACT,KAAK,CAAC,WAAW,CAAS,GAAoD;gBAC5E,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACvB,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;oBACjC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACxB,OAAO,MAAM,CAAC;gBAChB,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;oBAC1B,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ModuleClass } from '@zmdb/app/modules';
2
+ export declare function requireOptionalPeer(name: '@zmdb/app' | '@zmdb/web' | 'esbuild'): void;
3
+ export declare function loadRootModule(moduleSpec: string, cwd: string): Promise<ModuleClass>;
4
+ //# sourceMappingURL=application-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application-loader.d.ts","sourceRoot":"","sources":["../src/application-loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMrD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,IAAI,CASrF;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CA+B1F"}
@@ -0,0 +1,102 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { registerHooks } from 'node:module';
3
+ import { resolve } from 'node:path';
4
+ import { fileURLToPath, pathToFileURL } from 'node:url';
5
+ import { CliInvocationError } from './errors.js';
6
+ let applicationLoader;
7
+ export function requireOptionalPeer(name) {
8
+ try {
9
+ import.meta.resolve(name);
10
+ }
11
+ catch (error) {
12
+ if (error instanceof Error && 'code' in error && error.code === 'ERR_MODULE_NOT_FOUND') {
13
+ throw new CliInvocationError(`this command requires ${name}; install ${name}`);
14
+ }
15
+ throw error;
16
+ }
17
+ }
18
+ export async function loadRootModule(moduleSpec, cwd) {
19
+ const hash = moduleSpec.lastIndexOf('#');
20
+ if (hash <= 0 || hash === moduleSpec.length - 1) {
21
+ throw new CliInvocationError(`module spec "${moduleSpec}" must be <path>#<export>`);
22
+ }
23
+ const namedPath = moduleSpec.slice(0, hash);
24
+ const exportName = moduleSpec.slice(hash + 1);
25
+ const file = resolve(cwd, namedPath);
26
+ if (!existsSync(file)) {
27
+ throw new CliInvocationError(`module path "${namedPath}" does not exist; cannot load export "${exportName}"`);
28
+ }
29
+ requireOptionalPeer('esbuild');
30
+ await installApplicationLoader();
31
+ let loaded;
32
+ try {
33
+ const candidate = await import(pathToFileURL(file).href);
34
+ if (typeof candidate !== 'object' || candidate === null) {
35
+ throw new Error(`module path "${namedPath}" did not load as a module record`);
36
+ }
37
+ loaded = candidate;
38
+ }
39
+ catch (error) {
40
+ throw new Error(`could not import module path "${namedPath}" for export "${exportName}": ${errorMessage(error)}`, {
41
+ cause: error,
42
+ });
43
+ }
44
+ const root = Reflect.get(loaded, exportName);
45
+ if (!isModuleClass(root)) {
46
+ throw new CliInvocationError(`module path "${namedPath}" has no class export "${exportName}"`);
47
+ }
48
+ return root;
49
+ }
50
+ /**
51
+ * Lower Stage-3 decorators while importing application TypeScript.
52
+ *
53
+ * Node 26 strips types but does not parse standard decorator syntax. The hook
54
+ * applies the same esbuild transform used by the repository's Vitest setup, and
55
+ * only after the CLI command asks to import application source.
56
+ */
57
+ async function installApplicationLoader() {
58
+ applicationLoader ??= import('esbuild').then(({ transformSync }) => {
59
+ registerHooks({
60
+ resolve(specifier, context, nextResolve) {
61
+ if (context.parentURL !== undefined && /^\.{1,2}\/.*\.js$/.test(specifier)) {
62
+ const asJavaScript = new URL(specifier, context.parentURL);
63
+ if (!existsSync(fileURLToPath(asJavaScript))) {
64
+ const asTypeScript = new URL(`${specifier.slice(0, -'.js'.length)}.ts`, context.parentURL);
65
+ if (existsSync(fileURLToPath(asTypeScript))) {
66
+ return { url: asTypeScript.href, shortCircuit: true };
67
+ }
68
+ }
69
+ }
70
+ return nextResolve(specifier, context);
71
+ },
72
+ load(url, context, nextLoad) {
73
+ if (!url.startsWith('file:') || !/\.[cm]?tsx?$/.test(new URL(url).pathname)) {
74
+ return nextLoad(url, context);
75
+ }
76
+ const file = fileURLToPath(url);
77
+ const transformed = transformSync(readFileSync(file, 'utf8'), {
78
+ loader: file.endsWith('.tsx') ? 'tsx' : 'ts',
79
+ format: 'esm',
80
+ target: 'es2022',
81
+ sourcefile: file,
82
+ sourcemap: 'inline',
83
+ tsconfigRaw: {
84
+ compilerOptions: {
85
+ experimentalDecorators: false,
86
+ useDefineForClassFields: true,
87
+ },
88
+ },
89
+ });
90
+ return { format: 'module', source: transformed.code, shortCircuit: true };
91
+ },
92
+ });
93
+ });
94
+ await applicationLoader;
95
+ }
96
+ function errorMessage(error) {
97
+ return error instanceof Error ? error.message : String(error);
98
+ }
99
+ function isModuleClass(value) {
100
+ return typeof value === 'function';
101
+ }
102
+ //# sourceMappingURL=application-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application-loader.js","sourceRoot":"","sources":["../src/application-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,IAAI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H,MAAM,iBAAiB,CAAC;AAC1B,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AACD,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC"}
package/dist/args.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ export interface ParsedCommand {
2
+ readonly command: string;
3
+ readonly config: string;
4
+ readonly project?: string;
5
+ readonly json: boolean;
6
+ readonly help: boolean;
7
+ readonly version: boolean;
8
+ readonly positionals: readonly string[];
9
+ readonly values: Readonly<Record<string, unknown>>;
10
+ }
11
+ export type ParseCommandResult = {
12
+ readonly parsed: ParsedCommand;
13
+ } | {
14
+ readonly error: string;
15
+ readonly command: string;
16
+ readonly config: string;
17
+ readonly json: boolean;
18
+ };
19
+ export declare function isCommand(command: string): boolean;
20
+ export declare function parseCommand(command: string, argv: readonly string[], cwd: string): ParseCommandResult;
21
+ export declare function globalHelp(): string;
22
+ export declare function commandHelp(command: string): string;
23
+ //# sourceMappingURL=args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAkQA,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAClC;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1G,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB,CA+CtG;AAED,wBAAgB,UAAU,IAAI,MAAM,CAgBnC;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWnD"}