@guren/core 1.7.0 → 1.8.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.
- package/dist/bin.d.ts +1 -5
- package/dist/bin.js +1 -2
- package/dist/index.d.ts +113 -111
- package/dist/index.js +342 -287
- package/dist/internal/deploy-build.d.ts +71 -70
- package/dist/internal/deploy-build.js +467 -209
- package/dist/internal/zod-compat.d.ts +12 -11
- package/dist/internal/zod-compat.js +112 -60
- package/dist/lambda.d.ts +2 -1
- package/dist/lambda.js +2 -17
- package/dist/redis.d.ts +2 -1
- package/dist/redis.js +2 -23
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/vite.d.ts +3 -2
- package/dist/vite.js +2 -5
- package/package.json +11 -7
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
//#region src/internal/deploy-build.d.ts
|
|
1
2
|
type PathLike = string | URL;
|
|
2
3
|
type ManifestEntry = {
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
67
|
-
|
|
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
|
-
|
|
104
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
readonly specifier: 'bun:sqlite';
|
|
156
|
+
readonly kind: 'sqlite';
|
|
157
|
+
readonly exportNames: readonly ["Database"];
|
|
157
158
|
}, {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
readonly specifier: 'vite';
|
|
160
|
+
readonly kind: 'vite';
|
|
161
|
+
readonly exportNames: readonly ["createServer"];
|
|
161
162
|
}, {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
readonly specifier: '@guren/cli';
|
|
164
|
+
readonly kind: 'mcp';
|
|
165
|
+
readonly exportNames: readonly [];
|
|
165
166
|
}, {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
readonly specifier: '@modelcontextprotocol/sdk/server/mcp.js';
|
|
168
|
+
readonly kind: 'mcp';
|
|
169
|
+
readonly exportNames: readonly ["McpServer", "ResourceTemplate"];
|
|
169
170
|
}, {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
readonly specifier: 'postgres';
|
|
229
|
+
readonly kind: 'sql-driver';
|
|
230
|
+
readonly dialect: 'postgres';
|
|
231
|
+
readonly exportNames: readonly [];
|
|
231
232
|
}, {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
readonly specifier: 'mysql2';
|
|
234
|
+
readonly kind: 'sql-driver';
|
|
235
|
+
readonly dialect: 'mysql';
|
|
236
|
+
readonly exportNames: readonly [];
|
|
236
237
|
}, {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
readonly specifier: 'mysql2/promise';
|
|
239
|
+
readonly kind: 'sql-driver';
|
|
240
|
+
readonly dialect: 'mysql';
|
|
241
|
+
readonly exportNames: readonly ["createPool"];
|
|
241
242
|
}, {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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 [
|
|
258
|
+
declare const DATABASE_CONFIG_CANDIDATES: readonly ['config/database.ts', 'db/config.ts'];
|
|
258
259
|
interface DatabaseDialectDetection {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
298
|
-
|
|
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
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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 {
|
|
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 };
|