@guren/core 1.8.0 → 1.9.0

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.
@@ -1,7 +1,8 @@
1
+ //#region src/internal/deploy-build.d.ts
1
2
  type PathLike = string | URL;
2
3
  type ManifestEntry = {
3
- file?: string;
4
- css?: string[];
4
+ file?: string;
5
+ css?: string[];
5
6
  };
6
7
  type Manifest = Record<string, ManifestEntry>;
7
8
  declare function resolvePathLike(value: PathLike): string;
@@ -15,8 +16,8 @@ declare function resolvePathLike(value: PathLike): string;
15
16
  * *exists* picks the malformed one that was just skipped.
16
17
  */
17
18
  declare function readManifest(...paths: string[]): {
18
- manifest: Manifest;
19
- path: string;
19
+ manifest: Manifest;
20
+ path: string;
20
21
  } | undefined;
21
22
  /**
22
23
  * Throw unless `out` is safe to delete: it must be neither the app root nor a
@@ -63,8 +64,8 @@ declare function resetOutputDir(out: string, root: string, label: string): void;
63
64
  */
64
65
  declare function importSpecifier(fromDir: string, target: string, label: string): string;
65
66
  interface ClientAssetEnv {
66
- entry?: string;
67
- styles?: string;
67
+ entry?: string;
68
+ styles?: string;
68
69
  }
69
70
  /**
70
71
  * Locate the built client entry and its CSS in the Vite client manifest, as
@@ -100,8 +101,8 @@ declare function resolveSsrEntryFile(ssrDir: string, ssrEntryKey: string, label:
100
101
  * call — callers already hold a chunk path that manifest produced.
101
102
  */
102
103
  declare function ssrRuntimePaths(ssrDir: string, ssrFile: string, prefix: string): {
103
- entry: string;
104
- manifest?: string;
104
+ entry: string;
105
+ manifest?: string;
105
106
  };
106
107
  /**
107
108
  * Copy `public/` into a platform's static-asset staging directory.
@@ -117,15 +118,15 @@ declare function stageStaticAssets(publicDir: string, assetsOut: string): void;
117
118
  /** What a dev-only module is needed for, so a plugin can word its own message. */
118
119
  type DevOnlyModuleKind = 'sqlite' | 'vite' | 'mcp' | 'sql-driver';
119
120
  interface DevOnlyModule {
120
- readonly specifier: string;
121
- readonly kind: DevOnlyModuleKind;
122
- /**
123
- * Names the importing code destructures. A stub must declare every one of
124
- * them: an empty module fails the bundle with "no matching export" rather
125
- * than at runtime. Empty means the module is only ever read through
126
- * namespace property access, so an empty module suffices.
127
- */
128
- readonly exportNames: readonly string[];
121
+ readonly specifier: string;
122
+ readonly kind: DevOnlyModuleKind;
123
+ /**
124
+ * Names the importing code destructures. A stub must declare every one of
125
+ * them: an empty module fails the bundle with "no matching export" rather
126
+ * than at runtime. Empty means the module is only ever read through
127
+ * namespace property access, so an empty module suffices.
128
+ */
129
+ readonly exportNames: readonly string[];
129
130
  }
130
131
  /**
131
132
  * Modules that cannot run off Bun but sit in the graph of any app importing
@@ -151,25 +152,25 @@ interface DevOnlyModule {
151
152
  * have a new entry here surface as a compile error there.
152
153
  */
153
154
  declare const DEV_ONLY_MODULES: readonly [{
154
- readonly specifier: "bun:sqlite";
155
- readonly kind: "sqlite";
156
- readonly exportNames: readonly ["Database"];
155
+ readonly specifier: 'bun:sqlite';
156
+ readonly kind: 'sqlite';
157
+ readonly exportNames: readonly ["Database"];
157
158
  }, {
158
- readonly specifier: "vite";
159
- readonly kind: "vite";
160
- readonly exportNames: readonly ["createServer"];
159
+ readonly specifier: 'vite';
160
+ readonly kind: 'vite';
161
+ readonly exportNames: readonly ["createServer"];
161
162
  }, {
162
- readonly specifier: "@guren/cli";
163
- readonly kind: "mcp";
164
- readonly exportNames: readonly [];
163
+ readonly specifier: '@guren/cli';
164
+ readonly kind: 'mcp';
165
+ readonly exportNames: readonly [];
165
166
  }, {
166
- readonly specifier: "@modelcontextprotocol/sdk/server/mcp.js";
167
- readonly kind: "mcp";
168
- readonly exportNames: readonly ["McpServer", "ResourceTemplate"];
167
+ readonly specifier: '@modelcontextprotocol/sdk/server/mcp.js';
168
+ readonly kind: 'mcp';
169
+ readonly exportNames: readonly ["McpServer", "ResourceTemplate"];
169
170
  }, {
170
- readonly specifier: "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
171
- readonly kind: "mcp";
172
- readonly exportNames: readonly ["WebStandardStreamableHTTPServerTransport"];
171
+ readonly specifier: '@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js';
172
+ readonly kind: 'mcp';
173
+ readonly exportNames: readonly ["WebStandardStreamableHTTPServerTransport"];
173
174
  }];
174
175
  /**
175
176
  * A database `@guren/orm` can connect through, named after the factory an
@@ -188,15 +189,15 @@ type DatabaseDialect = 'postgres' | 'mysql' | 'sqlite' | 'aws-data-api' | 'd1';
188
189
  * nothing, which is silent.
189
190
  */
190
191
  declare const DATABASE_FACTORIES: {
191
- readonly createPostgresDatabase: "postgres";
192
- readonly createMySqlDatabase: "mysql";
193
- readonly createSqliteDatabase: "sqlite";
194
- readonly createAwsDataApiDatabase: "aws-data-api";
195
- readonly createD1Database: "d1";
192
+ readonly createPostgresDatabase: 'postgres';
193
+ readonly createMySqlDatabase: 'mysql';
194
+ readonly createSqliteDatabase: 'sqlite';
195
+ readonly createAwsDataApiDatabase: 'aws-data-api';
196
+ readonly createD1Database: 'd1';
196
197
  };
197
198
  /** A client library reached only by the dialect it belongs to. */
198
199
  interface SqlClientModule extends DevOnlyModule {
199
- readonly dialect: DatabaseDialect;
200
+ readonly dialect: DatabaseDialect;
200
201
  }
201
202
  /**
202
203
  * The database client libraries `@guren/orm`'s Postgres, MySQL and Aurora
@@ -224,25 +225,25 @@ interface SqlClientModule extends DevOnlyModule {
224
225
  * is what a bundler checks a stub against.
225
226
  */
226
227
  declare const SQL_CLIENT_MODULES: readonly [{
227
- readonly specifier: "postgres";
228
- readonly kind: "sql-driver";
229
- readonly dialect: "postgres";
230
- readonly exportNames: readonly [];
228
+ readonly specifier: 'postgres';
229
+ readonly kind: 'sql-driver';
230
+ readonly dialect: 'postgres';
231
+ readonly exportNames: readonly [];
231
232
  }, {
232
- readonly specifier: "mysql2";
233
- readonly kind: "sql-driver";
234
- readonly dialect: "mysql";
235
- readonly exportNames: readonly [];
233
+ readonly specifier: 'mysql2';
234
+ readonly kind: 'sql-driver';
235
+ readonly dialect: 'mysql';
236
+ readonly exportNames: readonly [];
236
237
  }, {
237
- readonly specifier: "mysql2/promise";
238
- readonly kind: "sql-driver";
239
- readonly dialect: "mysql";
240
- readonly exportNames: readonly ["createPool"];
238
+ readonly specifier: 'mysql2/promise';
239
+ readonly kind: 'sql-driver';
240
+ readonly dialect: 'mysql';
241
+ readonly exportNames: readonly ["createPool"];
241
242
  }, {
242
- readonly specifier: "@aws-sdk/client-rds-data";
243
- readonly kind: "sql-driver";
244
- readonly dialect: "aws-data-api";
245
- readonly exportNames: readonly ["RDSDataClient", "BeginTransactionCommand", "CommitTransactionCommand", "ExecuteStatementCommand", "RollbackTransactionCommand"];
243
+ readonly specifier: '@aws-sdk/client-rds-data';
244
+ readonly kind: 'sql-driver';
245
+ readonly dialect: 'aws-data-api';
246
+ readonly exportNames: readonly ["RDSDataClient", "BeginTransactionCommand", "CommitTransactionCommand", "ExecuteStatementCommand", "RollbackTransactionCommand"];
246
247
  }];
247
248
  type SqlClientSpecifier = (typeof SQL_CLIENT_MODULES)[number]['specifier'];
248
249
  /**
@@ -254,16 +255,16 @@ type SqlClientSpecifier = (typeof SQL_CLIENT_MODULES)[number]['specifier'];
254
255
  * disagree, a build would stub clients for an app whose config the doctor
255
256
  * says is fine — so a change to either belongs in both.
256
257
  */
257
- declare const DATABASE_CONFIG_CANDIDATES: readonly ["config/database.ts", "db/config.ts"];
258
+ declare const DATABASE_CONFIG_CANDIDATES: readonly ['config/database.ts', 'db/config.ts'];
258
259
  interface DatabaseDialectDetection {
259
- /**
260
- * Every dialect the config declares, or undefined when the build could not
261
- * tell — which is not the same as "none", and callers must not treat it as
262
- * an empty set.
263
- */
264
- dialects?: readonly DatabaseDialect[];
265
- /** Root-relative path of the file that was read, when one was found. */
266
- source?: string;
260
+ /**
261
+ * Every dialect the config declares, or undefined when the build could not
262
+ * tell — which is not the same as "none", and callers must not treat it as
263
+ * an empty set.
264
+ */
265
+ dialects?: readonly DatabaseDialect[];
266
+ /** Root-relative path of the file that was read, when one was found. */
267
+ source?: string;
267
268
  }
268
269
  /**
269
270
  * Which databases an app connects to, read off its database config.
@@ -294,8 +295,8 @@ declare const DATABASE_DIALECTS: readonly DatabaseDialect[];
294
295
  declare function parseDatabaseDialects(value: string, label: string): readonly DatabaseDialect[];
295
296
  /** One client to stub, with the explanation its stub throws. */
296
297
  interface UnusedSqlClient {
297
- readonly module: SqlClientModule;
298
- readonly message: string;
298
+ readonly module: SqlClientModule;
299
+ readonly message: string;
299
300
  }
300
301
  /**
301
302
  * The database clients an app does not connect through, for a platform where
@@ -316,9 +317,9 @@ interface UnusedSqlClient {
316
317
  * @param label Platform name for the messages, e.g. `'Lambda build'`.
317
318
  */
318
319
  declare function unusedSqlClients(input: {
319
- root: string;
320
- label: string;
321
- dialects?: readonly DatabaseDialect[];
320
+ root: string;
321
+ label: string;
322
+ dialects?: readonly DatabaseDialect[];
322
323
  }): readonly UnusedSqlClient[];
323
324
  type DevOnlySpecifier = (typeof DEV_ONLY_MODULES)[number]['specifier'];
324
325
  declare function renderDevOnlyStub(module: DevOnlyModule, message: string): string;
@@ -330,5 +331,5 @@ declare function renderDevOnlyStub(module: DevOnlyModule, message: string): stri
330
331
  * upstream cannot pull the real SDK into a deployed bundle.
331
332
  */
332
333
  declare const MCP_SDK_SUBPATH_PREFIX = "@modelcontextprotocol/sdk/";
333
-
334
- export { type ClientAssetEnv, DATABASE_CONFIG_CANDIDATES, DATABASE_DIALECTS, DATABASE_FACTORIES, DEV_ONLY_MODULES, type DatabaseDialect, type DatabaseDialectDetection, type DevOnlyModule, type DevOnlyModuleKind, type DevOnlySpecifier, MCP_SDK_SUBPATH_PREFIX, type Manifest, type ManifestEntry, type PathLike, SQL_CLIENT_MODULES, type SqlClientModule, type SqlClientSpecifier, type UnusedSqlClient, assertOutputDirOutsideRoot, detectDatabaseDialects, importSpecifier, parseDatabaseDialects, readManifest, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, unusedSqlClients };
334
+ //#endregion
335
+ export { ClientAssetEnv, DATABASE_CONFIG_CANDIDATES, DATABASE_DIALECTS, DATABASE_FACTORIES, DEV_ONLY_MODULES, DatabaseDialect, DatabaseDialectDetection, DevOnlyModule, DevOnlyModuleKind, DevOnlySpecifier, MCP_SDK_SUBPATH_PREFIX, Manifest, ManifestEntry, PathLike, SQL_CLIENT_MODULES, SqlClientModule, SqlClientSpecifier, UnusedSqlClient, assertOutputDirOutsideRoot, detectDatabaseDialects, importSpecifier, parseDatabaseDialects, readManifest, renderDevOnlyStub, resetOutputDir, resolveClientAssetEnv, resolvePathLike, resolveSsrEntryFile, ssrRuntimePaths, stageStaticAssets, unusedSqlClients };