@quilted/rollup 0.2.12 → 0.2.14
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/CHANGELOG.md +14 -0
- package/build/esm/app.mjs +87 -66
- package/build/esm/index.mjs +3 -1
- package/build/esm/server.mjs +45 -12
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/app.d.ts +112 -28
- package/build/typescript/app.d.ts.map +1 -1
- package/build/typescript/index.d.ts +4 -2
- package/build/typescript/index.d.ts.map +1 -1
- package/build/typescript/server.d.ts +86 -25
- package/build/typescript/server.d.ts.map +1 -1
- package/build/typescript/shared/server.d.ts +35 -0
- package/build/typescript/shared/server.d.ts.map +1 -0
- package/package.json +11 -2
- package/source/app.ts +152 -91
- package/source/index.ts +13 -4
- package/source/server.ts +88 -32
- package/source/shared/server.ts +46 -0
- package/build/esm/features/request-router.mjs +0 -31
- package/source/features/request-router.ts +0 -34
|
@@ -3,6 +3,8 @@ import { MAGIC_MODULE_ENTRY, MAGIC_MODULE_APP_COMPONENT, MAGIC_MODULE_BROWSER_AS
|
|
|
3
3
|
import { type MagicModuleEnvOptions } from './features/env.ts';
|
|
4
4
|
import { type RollupNodePluginOptions } from './shared/rollup.ts';
|
|
5
5
|
import { type BrowserGroupTargetSelection } from './shared/browserslist.ts';
|
|
6
|
+
import type { ServerRuntime } from './shared/server.ts';
|
|
7
|
+
import type { NodeServerRuntimeOptions } from './server.ts';
|
|
6
8
|
export interface AppBaseOptions {
|
|
7
9
|
/**
|
|
8
10
|
* The root directory containing the source code for your application.
|
|
@@ -49,6 +51,10 @@ export interface AppOptions extends AppBaseOptions {
|
|
|
49
51
|
* Customizes the server build of your application.
|
|
50
52
|
*/
|
|
51
53
|
server?: Omit<AppServerOptions, keyof AppBaseOptions> & Pick<AppServerOptions, 'env'>;
|
|
54
|
+
/**
|
|
55
|
+
* Customizations to the application for the runtime it will execute in.
|
|
56
|
+
*/
|
|
57
|
+
runtime?: AppRuntime;
|
|
52
58
|
}
|
|
53
59
|
export interface AppBrowserOptions extends AppBaseOptions {
|
|
54
60
|
/**
|
|
@@ -69,6 +75,10 @@ export interface AppBrowserOptions extends AppBaseOptions {
|
|
|
69
75
|
* Customizes the assets created for your application.
|
|
70
76
|
*/
|
|
71
77
|
assets?: AppBrowserAssetsOptions;
|
|
78
|
+
/**
|
|
79
|
+
* Customizations to the application for the runtime it will execute in.
|
|
80
|
+
*/
|
|
81
|
+
runtime?: Omit<AppRuntime, 'server'>;
|
|
72
82
|
}
|
|
73
83
|
export interface AppBrowserModuleOptions {
|
|
74
84
|
/**
|
|
@@ -91,6 +101,7 @@ export interface AppBrowserAssetsOptions {
|
|
|
91
101
|
* @default true
|
|
92
102
|
*/
|
|
93
103
|
minify?: boolean;
|
|
104
|
+
directory?: string;
|
|
94
105
|
baseURL?: string;
|
|
95
106
|
targets?: BrowserGroupTargetSelection;
|
|
96
107
|
priority?: number;
|
|
@@ -137,6 +148,10 @@ export interface AppServerOptions extends AppBaseOptions {
|
|
|
137
148
|
* Customizes the output files created for your server.
|
|
138
149
|
*/
|
|
139
150
|
output?: AppServerOutputOptions;
|
|
151
|
+
/**
|
|
152
|
+
* Customizations to the server for the runtime it will execute in.
|
|
153
|
+
*/
|
|
154
|
+
runtime?: AppServerRuntime;
|
|
140
155
|
}
|
|
141
156
|
export interface AppServerOutputOptions extends Pick<RollupNodePluginOptions, 'bundle'> {
|
|
142
157
|
/**
|
|
@@ -155,16 +170,30 @@ export interface AppServerOutputOptions extends Pick<RollupNodePluginOptions, 'b
|
|
|
155
170
|
* @default 'async-only'
|
|
156
171
|
*/
|
|
157
172
|
hash?: boolean | 'async-only';
|
|
173
|
+
}
|
|
174
|
+
export interface AppRuntime {
|
|
158
175
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* @default 'esmodules'
|
|
176
|
+
* Overrides to the assets for this application.
|
|
162
177
|
*/
|
|
163
|
-
|
|
178
|
+
assets?: {
|
|
179
|
+
/**
|
|
180
|
+
* The directory to output the application’s assets into.
|
|
181
|
+
*/
|
|
182
|
+
directory?: string;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Customizations to the server for this runtime.
|
|
186
|
+
*/
|
|
187
|
+
server?: AppServerRuntime;
|
|
188
|
+
}
|
|
189
|
+
export interface AppServerRuntime extends Omit<ServerRuntime, 'requestRouter'> {
|
|
190
|
+
requestRouter?(options: {
|
|
191
|
+
assets: Required<Pick<AppBrowserAssetsOptions, 'baseURL'>>;
|
|
192
|
+
}): string;
|
|
164
193
|
}
|
|
165
194
|
export { MAGIC_MODULE_ENTRY, MAGIC_MODULE_APP_COMPONENT, MAGIC_MODULE_BROWSER_ASSETS, MAGIC_MODULE_REQUEST_ROUTER, };
|
|
166
|
-
export declare function
|
|
167
|
-
export declare function
|
|
195
|
+
export declare function quiltApp({ root, app, env, graphql, assets, browser: browserOptions, server: serverOptions, runtime, }?: AppOptions): Promise<RollupOptions[]>;
|
|
196
|
+
export declare function quiltAppBrowser(options?: AppBrowserOptions): Promise<{
|
|
168
197
|
plugins: InputPluginOption[];
|
|
169
198
|
output: {
|
|
170
199
|
format: "esm" | "systemjs";
|
|
@@ -184,7 +213,7 @@ export declare function quiltAppBrowserOptions(options?: AppBrowserOptions): Pro
|
|
|
184
213
|
minifyInternalExports: true;
|
|
185
214
|
};
|
|
186
215
|
}>;
|
|
187
|
-
export declare function
|
|
216
|
+
export declare function quiltAppBrowserPlugins({ root, app, entry, env, assets, module, graphql, }?: AppBrowserOptions): Promise<InputPluginOption[]>;
|
|
188
217
|
export declare function quiltAppBrowserInput({ root, entry, }?: Pick<AppBrowserOptions, 'root' | 'entry'>): {
|
|
189
218
|
name: string;
|
|
190
219
|
options(this: import("rollup").MinimalPluginContext, options: import("rollup").InputOptions): Promise<{
|
|
@@ -212,10 +241,64 @@ export declare function quiltAppBrowserInput({ root, entry, }?: Pick<AppBrowserO
|
|
|
212
241
|
watch?: false | import("rollup").WatcherOptions | undefined;
|
|
213
242
|
}>;
|
|
214
243
|
};
|
|
215
|
-
export declare function
|
|
244
|
+
export declare function quiltAppServer(options?: AppServerOptions): Promise<{
|
|
216
245
|
plugins: InputPluginOption[];
|
|
217
246
|
output: {
|
|
218
|
-
format: "
|
|
247
|
+
format: "esm";
|
|
248
|
+
dir: string;
|
|
249
|
+
entryFileNames: string;
|
|
250
|
+
chunkFileNames: string;
|
|
251
|
+
assetFileNames: string;
|
|
252
|
+
generatedCode: "es2015";
|
|
253
|
+
} | {
|
|
254
|
+
amd?: import("rollup").AmdOptions | undefined;
|
|
255
|
+
assetFileNames: string | ((chunkInfo: import("rollup").PreRenderedAsset) => string);
|
|
256
|
+
banner?: string | import("rollup").AddonFunction | undefined;
|
|
257
|
+
chunkFileNames: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string);
|
|
258
|
+
compact?: boolean | undefined;
|
|
259
|
+
dir: string;
|
|
260
|
+
dynamicImportInCjs?: boolean | undefined;
|
|
261
|
+
entryFileNames: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string);
|
|
262
|
+
esModule?: boolean | "if-default-prop" | undefined;
|
|
263
|
+
experimentalMinChunkSize?: number | undefined;
|
|
264
|
+
exports?: "default" | "named" | "none" | "auto" | undefined;
|
|
265
|
+
extend?: boolean | undefined;
|
|
266
|
+
externalImportAssertions?: boolean | undefined;
|
|
267
|
+
externalImportAttributes?: boolean | undefined;
|
|
268
|
+
externalLiveBindings?: boolean | undefined;
|
|
269
|
+
file?: string | undefined;
|
|
270
|
+
footer?: string | import("rollup").AddonFunction | undefined;
|
|
271
|
+
format: import("rollup").ModuleFormat;
|
|
272
|
+
freeze?: boolean | undefined;
|
|
273
|
+
generatedCode: import("rollup").GeneratedCodePreset | import("rollup").GeneratedCodeOptions;
|
|
274
|
+
globals?: import("rollup").GlobalsOption | undefined;
|
|
275
|
+
hoistTransitiveImports?: boolean | undefined;
|
|
276
|
+
indent?: string | boolean | undefined;
|
|
277
|
+
inlineDynamicImports?: boolean | undefined;
|
|
278
|
+
interop?: import("rollup").InteropType | import("rollup").GetInterop | undefined;
|
|
279
|
+
intro?: string | import("rollup").AddonFunction | undefined;
|
|
280
|
+
manualChunks?: import("rollup").ManualChunksOption | undefined;
|
|
281
|
+
minifyInternalExports?: boolean | undefined;
|
|
282
|
+
name?: string | undefined;
|
|
283
|
+
noConflict?: boolean | undefined;
|
|
284
|
+
outro?: string | import("rollup").AddonFunction | undefined;
|
|
285
|
+
paths?: import("rollup").OptionsPaths | undefined;
|
|
286
|
+
plugins?: import("rollup").OutputPluginOption;
|
|
287
|
+
preserveModules?: boolean | undefined;
|
|
288
|
+
preserveModulesRoot?: string | undefined;
|
|
289
|
+
sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
|
|
290
|
+
sourcemap?: boolean | "inline" | "hidden" | undefined;
|
|
291
|
+
sourcemapBaseUrl?: string | undefined;
|
|
292
|
+
sourcemapExcludeSources?: boolean | undefined;
|
|
293
|
+
sourcemapFile?: string | undefined;
|
|
294
|
+
sourcemapFileNames?: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string) | undefined;
|
|
295
|
+
sourcemapIgnoreList?: boolean | import("rollup").SourcemapIgnoreListOption | undefined;
|
|
296
|
+
sourcemapPathTransform?: import("rollup").SourcemapPathTransformOption | undefined;
|
|
297
|
+
strict?: boolean | undefined;
|
|
298
|
+
systemNullSetters?: boolean | undefined;
|
|
299
|
+
validate?: boolean | undefined;
|
|
300
|
+
} | {
|
|
301
|
+
format: "esm" | "cjs";
|
|
219
302
|
dir: string;
|
|
220
303
|
entryFileNames: string;
|
|
221
304
|
chunkFileNames: string;
|
|
@@ -223,7 +306,7 @@ export declare function quiltAppServerOptions(options?: AppServerOptions): Promi
|
|
|
223
306
|
generatedCode: "es2015";
|
|
224
307
|
};
|
|
225
308
|
}>;
|
|
226
|
-
export declare function
|
|
309
|
+
export declare function quiltAppServerPlugins({ root, app, env, entry, format, graphql, assets, output, runtime, }?: AppServerOptions): Promise<InputPluginOption[]>;
|
|
227
310
|
export declare function quiltAppServerInput({ root, entry, format, }?: Pick<AppServerOptions, 'root' | 'entry' | 'format'>): {
|
|
228
311
|
name: string;
|
|
229
312
|
options(this: import("rollup").MinimalPluginContext, options: import("rollup").InputOptions): Promise<{
|
|
@@ -251,6 +334,25 @@ export declare function quiltAppServerInput({ root, entry, format, }?: Pick<AppS
|
|
|
251
334
|
watch?: false | import("rollup").WatcherOptions | undefined;
|
|
252
335
|
}>;
|
|
253
336
|
};
|
|
337
|
+
export interface NodeAppServerRuntimeOptions extends NodeServerRuntimeOptions {
|
|
338
|
+
/**
|
|
339
|
+
* Whether the server should serve assets from the asset output directory.
|
|
340
|
+
*
|
|
341
|
+
* @default true
|
|
342
|
+
*/
|
|
343
|
+
assets?: boolean;
|
|
344
|
+
}
|
|
345
|
+
export declare function nodeAppServerRuntime({ host, port, format, assets: serveAssets, }?: NodeAppServerRuntimeOptions): {
|
|
346
|
+
env: string;
|
|
347
|
+
output: {
|
|
348
|
+
options: {
|
|
349
|
+
format: "esm" | "cjs";
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
requestRouter({ assets }: {
|
|
353
|
+
assets: Required<Pick<AppBrowserAssetsOptions, "baseURL">>;
|
|
354
|
+
}): string;
|
|
355
|
+
};
|
|
254
356
|
export declare function magicModuleAppComponent({ entry, root, }: {
|
|
255
357
|
entry?: string;
|
|
256
358
|
root?: string;
|
|
@@ -287,24 +389,6 @@ export declare function magicModuleAppBrowserEntry({ hydrate, selector, }?: AppB
|
|
|
287
389
|
moduleSideEffects: "no-treeshake" | undefined;
|
|
288
390
|
} | null>) | undefined;
|
|
289
391
|
};
|
|
290
|
-
export declare function magicModuleAppServerEntry({ host, port, assets, format, }?: {
|
|
291
|
-
host?: string;
|
|
292
|
-
port?: number;
|
|
293
|
-
assets?: boolean | {
|
|
294
|
-
baseURL: string;
|
|
295
|
-
};
|
|
296
|
-
format?: 'module' | 'commonjs';
|
|
297
|
-
}): {
|
|
298
|
-
name: string;
|
|
299
|
-
resolveId(this: import("rollup").PluginContext, id: string): Promise<{
|
|
300
|
-
id: string;
|
|
301
|
-
moduleSideEffects: "no-treeshake" | undefined;
|
|
302
|
-
} | null>;
|
|
303
|
-
load: ((this: import("rollup").PluginContext, source: string) => Promise<{
|
|
304
|
-
code: string;
|
|
305
|
-
moduleSideEffects: "no-treeshake" | undefined;
|
|
306
|
-
} | null>) | undefined;
|
|
307
|
-
};
|
|
308
392
|
export declare function magicModuleAppAssetManifests(): {
|
|
309
393
|
name: string;
|
|
310
394
|
resolveId(this: import("rollup").PluginContext, id: string): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../source/app.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,aAAa,EACb,iBAAiB,EACjB,cAAc,EACf,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAmB,KAAK,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAOL,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../source/app.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,aAAa,EACb,iBAAiB,EACjB,cAAc,EACf,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAmB,KAAK,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAG/E,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAOL,KAAK,2BA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;;EAiC1D;AAED,MAAM,WAAW,2BAA4B,SAAQ,wBAAwB;IAC3E;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,IAAI,EACJ,MAAiB,EACjB,MAAM,EAAE,WAAkB,GAC3B,GAAE,2BAAgC;;;;;;;;;;EA4DlC;AAED,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,IAAoB,GACrB,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;;;;;;;;;;EA+BA;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACL,IAAoB,GACrB,GAAE,IAAI,CAAC,gBAAgB,EAAE,OAAO,GAAG,MAAM,CAAM;;;;;;;;;;EAiD/C;AAED,wBAAgB,0BAA0B,CAAC,EACzC,OAAc,EACd,QAAiB,GAClB,GAAE,uBAA4B;;;;;;;;;;EA0B9B;AAED,wBAAgB,4BAA4B;;;;;;;;;;EAqE3C;AAED,wBAAsB,wBAAwB,CAAC,EAC7C,KAAK,EACL,IAAoB,GACrB,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CACrB,+BAgBA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { quiltApp, quiltAppBrowser, quiltAppBrowserPlugins, quiltAppServer, quiltAppServerPlugins, type AppOptions, type AppBaseOptions, type AppBrowserOptions, type AppServerOptions, type AppRuntime, type AppServerRuntime, } from './app.ts';
|
|
2
2
|
export { quiltModule, type ModuleOptions } from './module.ts';
|
|
3
3
|
export { quiltPackage, quiltPackageESModules, quiltPackageESNext, type PackageOptions, } from './package.ts';
|
|
4
|
-
export { quiltServer, type ServerOptions } from './server.ts';
|
|
4
|
+
export { quiltServer, type ServerOptions, type ServerOutputOptions, type ServerRuntime, } from './server.ts';
|
|
5
|
+
export { multiline } from './shared/strings.ts';
|
|
6
|
+
export * from './constants.ts';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,WAAW,EAAE,KAAK,aAAa,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAC9C,cAAc,gBAAgB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { type InputPluginOption } from 'rollup';
|
|
|
2
2
|
import { RollupNodePluginOptions } from './shared/rollup.ts';
|
|
3
3
|
import { type MagicModuleEnvOptions } from './features/env.ts';
|
|
4
4
|
import { MAGIC_MODULE_ENTRY, MAGIC_MODULE_REQUEST_ROUTER } from './constants.ts';
|
|
5
|
+
import type { ServerRuntime } from './shared/server.ts';
|
|
5
6
|
export interface ServerOptions {
|
|
6
7
|
/**
|
|
7
8
|
* The root directory containing the source code for your application.
|
|
@@ -44,22 +45,17 @@ export interface ServerOptions {
|
|
|
44
45
|
*/
|
|
45
46
|
output?: ServerOutputOptions;
|
|
46
47
|
/**
|
|
47
|
-
*
|
|
48
|
-
* when you use the `request-router` format — if you use the `custom` format,
|
|
49
|
-
* you are responsible for starting the server yourself.
|
|
50
|
-
*
|
|
51
|
-
* If you do not provide a value here, the server will listen for requests on
|
|
52
|
-
* the port specified by `process.env.NODE_ENV`.
|
|
48
|
+
* Customizations to the server for the runtime it will execute in.
|
|
53
49
|
*/
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The host that the server will listen on when it runs. This only applies
|
|
57
|
-
* when you use the `request-router` format — if you use the `custom` format,
|
|
58
|
-
* you are responsible for starting the server yourself.
|
|
59
|
-
*/
|
|
60
|
-
host?: string;
|
|
50
|
+
runtime?: ServerRuntime;
|
|
61
51
|
}
|
|
62
52
|
export interface ServerOutputOptions extends Pick<RollupNodePluginOptions, 'bundle'> {
|
|
53
|
+
/**
|
|
54
|
+
* The directory to output the server into.
|
|
55
|
+
*
|
|
56
|
+
* @default 'build/server'
|
|
57
|
+
*/
|
|
58
|
+
directory?: string;
|
|
63
59
|
/**
|
|
64
60
|
* Whether to minify assets created for this server.
|
|
65
61
|
*
|
|
@@ -76,26 +72,91 @@ export interface ServerOutputOptions extends Pick<RollupNodePluginOptions, 'bund
|
|
|
76
72
|
* @default 'async-only'
|
|
77
73
|
*/
|
|
78
74
|
hash?: boolean | 'async-only';
|
|
79
|
-
/**
|
|
80
|
-
* What module format to use for the server output.
|
|
81
|
-
*
|
|
82
|
-
* @default 'esmodules'
|
|
83
|
-
*/
|
|
84
|
-
format?: 'esmodules' | 'esm' | 'es' | 'commonjs' | 'cjs';
|
|
85
75
|
}
|
|
76
|
+
export type { ServerRuntime };
|
|
86
77
|
export { MAGIC_MODULE_ENTRY, MAGIC_MODULE_REQUEST_ROUTER };
|
|
87
|
-
export declare function quiltServer({ root: rootPath, entry, format, env, graphql, output,
|
|
78
|
+
export declare function quiltServer({ root: rootPath, entry, format, env, graphql, output, runtime, }?: ServerOptions): Promise<{
|
|
88
79
|
input: string | {
|
|
89
80
|
server: string;
|
|
90
81
|
};
|
|
91
82
|
plugins: InputPluginOption[];
|
|
92
83
|
output: {
|
|
93
|
-
|
|
84
|
+
amd?: import("rollup").AmdOptions | undefined;
|
|
85
|
+
assetFileNames: string | ((chunkInfo: import("rollup").PreRenderedAsset) => string);
|
|
86
|
+
banner?: string | import("rollup").AddonFunction | undefined;
|
|
87
|
+
chunkFileNames: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string);
|
|
88
|
+
compact?: boolean | undefined;
|
|
94
89
|
dir: string;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
dynamicImportInCjs?: boolean | undefined;
|
|
91
|
+
entryFileNames: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string);
|
|
92
|
+
esModule?: boolean | "if-default-prop" | undefined;
|
|
93
|
+
experimentalMinChunkSize?: number | undefined;
|
|
94
|
+
exports?: "default" | "named" | "none" | "auto" | undefined;
|
|
95
|
+
extend?: boolean | undefined;
|
|
96
|
+
externalImportAssertions?: boolean | undefined;
|
|
97
|
+
externalImportAttributes?: boolean | undefined;
|
|
98
|
+
externalLiveBindings?: boolean | undefined;
|
|
99
|
+
file?: string | undefined;
|
|
100
|
+
footer?: string | import("rollup").AddonFunction | undefined;
|
|
101
|
+
format: import("rollup").ModuleFormat;
|
|
102
|
+
freeze?: boolean | undefined;
|
|
103
|
+
generatedCode: import("rollup").GeneratedCodePreset | import("rollup").GeneratedCodeOptions;
|
|
104
|
+
globals?: import("rollup").GlobalsOption | undefined;
|
|
105
|
+
hoistTransitiveImports?: boolean | undefined;
|
|
106
|
+
indent?: string | boolean | undefined;
|
|
107
|
+
inlineDynamicImports?: boolean | undefined;
|
|
108
|
+
interop?: import("rollup").InteropType | import("rollup").GetInterop | undefined;
|
|
109
|
+
intro?: string | import("rollup").AddonFunction | undefined;
|
|
110
|
+
manualChunks?: import("rollup").ManualChunksOption | undefined;
|
|
111
|
+
minifyInternalExports?: boolean | undefined;
|
|
112
|
+
name?: string | undefined;
|
|
113
|
+
noConflict?: boolean | undefined;
|
|
114
|
+
outro?: string | import("rollup").AddonFunction | undefined;
|
|
115
|
+
paths?: import("rollup").OptionsPaths | undefined;
|
|
116
|
+
plugins?: import("rollup").OutputPluginOption;
|
|
117
|
+
preserveModules?: boolean | undefined;
|
|
118
|
+
preserveModulesRoot?: string | undefined;
|
|
119
|
+
sanitizeFileName?: boolean | ((fileName: string) => string) | undefined;
|
|
120
|
+
sourcemap?: boolean | "inline" | "hidden" | undefined;
|
|
121
|
+
sourcemapBaseUrl?: string | undefined;
|
|
122
|
+
sourcemapExcludeSources?: boolean | undefined;
|
|
123
|
+
sourcemapFile?: string | undefined;
|
|
124
|
+
sourcemapFileNames?: string | ((chunkInfo: import("rollup").PreRenderedChunk) => string) | undefined;
|
|
125
|
+
sourcemapIgnoreList?: boolean | import("rollup").SourcemapIgnoreListOption | undefined;
|
|
126
|
+
sourcemapPathTransform?: import("rollup").SourcemapPathTransformOption | undefined;
|
|
127
|
+
strict?: boolean | undefined;
|
|
128
|
+
systemNullSetters?: boolean | undefined;
|
|
129
|
+
validate?: boolean | undefined;
|
|
99
130
|
};
|
|
100
131
|
}>;
|
|
132
|
+
export interface NodeServerRuntimeOptions {
|
|
133
|
+
/**
|
|
134
|
+
* The port that the server will listen on when it runs. This only applies
|
|
135
|
+
* when you use the `request-router` format — if you use the `custom` format,
|
|
136
|
+
* you are responsible for starting the server yourself.
|
|
137
|
+
*
|
|
138
|
+
* If you do not provide a value here, the server will listen for requests on
|
|
139
|
+
* the port specified by `process.env.NODE_ENV`.
|
|
140
|
+
*/
|
|
141
|
+
port?: number | string;
|
|
142
|
+
/**
|
|
143
|
+
* The host that the server will listen on when it runs.
|
|
144
|
+
*/
|
|
145
|
+
host?: string;
|
|
146
|
+
/**
|
|
147
|
+
* What module format to use for the server output.
|
|
148
|
+
*
|
|
149
|
+
* @default 'module'
|
|
150
|
+
*/
|
|
151
|
+
format?: 'module' | 'modules' | 'esmodules' | 'esm' | 'es' | 'commonjs' | 'cjs';
|
|
152
|
+
}
|
|
153
|
+
export declare function nodeServerRuntime({ host, port, format, }?: NodeServerRuntimeOptions): {
|
|
154
|
+
env: string;
|
|
155
|
+
output: {
|
|
156
|
+
options: {
|
|
157
|
+
format: "esm" | "cjs";
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
requestRouter(): string;
|
|
161
|
+
};
|
|
101
162
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../source/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,iBAAiB,EAAqB,MAAM,QAAQ,CAAC;AAGlE,OAAO,EACL,uBAAuB,EAGxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAmB,KAAK,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAC,kBAAkB,EAAE,2BAA2B,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../source/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,iBAAiB,EAAqB,MAAM,QAAQ,CAAC;AAGlE,OAAO,EACL,uBAAuB,EAGxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAmB,KAAK,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAC,kBAAkB,EAAE,2BAA2B,EAAC,MAAM,gBAAgB,CAAC;AAE/E,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEpB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,gBAAgB,GAAG,QAAQ,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2
|
+
export interface ServerRuntime {
|
|
3
|
+
/**
|
|
4
|
+
* A string that will be inlined directly as code to reference a runtime constant
|
|
5
|
+
* that contains environment variables.
|
|
6
|
+
*/
|
|
7
|
+
env?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Overrides to the output options for this server.
|
|
10
|
+
*/
|
|
11
|
+
output?: {
|
|
12
|
+
/**
|
|
13
|
+
* What module format to use for the server output.
|
|
14
|
+
*
|
|
15
|
+
* @default 'module'
|
|
16
|
+
*/
|
|
17
|
+
format?: 'module' | 'modules' | 'esmodules' | 'esm' | 'es' | 'commonjs' | 'cjs';
|
|
18
|
+
/**
|
|
19
|
+
* The directory to output the server to.
|
|
20
|
+
*/
|
|
21
|
+
directory?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Overrides to the Rollup output options.
|
|
24
|
+
*/
|
|
25
|
+
options?: OutputOptions;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The content to use as the entry point when the server uses the `request-router`
|
|
29
|
+
* format for their server. This file should import the request router instance for
|
|
30
|
+
* this app from 'quilt:module/request-router', and create a server that is appropriate
|
|
31
|
+
* for this runtime.
|
|
32
|
+
*/
|
|
33
|
+
requestRouter?(): string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../source/shared/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,QAAQ,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;;;WAIG;QACH,MAAM,CAAC,EACH,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,IAAI,GACJ,UAAU,GACV,KAAK,CAAC;QAEV;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,OAAO,CAAC,EAAE,aAAa,CAAC;KACzB,CAAC;IAEF;;;;;OAKG;IACH,aAAa,CAAC,IAAI,MAAM,CAAC;CAC1B"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"access": "public",
|
|
7
7
|
"@quilted/registry": "https://registry.npmjs.org"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.14",
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=14.0.0"
|
|
12
12
|
},
|
|
@@ -52,6 +52,12 @@
|
|
|
52
52
|
"quilt:esnext": "./build/esnext/features/assets.esnext",
|
|
53
53
|
"import": "./build/esm/features/assets.mjs"
|
|
54
54
|
},
|
|
55
|
+
"./features/async": {
|
|
56
|
+
"types": "./build/typescript/features/async.d.ts",
|
|
57
|
+
"quilt:source": "./source/features/async.ts",
|
|
58
|
+
"quilt:esnext": "./build/esnext/features/async.esnext",
|
|
59
|
+
"import": "./build/esm/features/async.mjs"
|
|
60
|
+
},
|
|
55
61
|
"./features/env": {
|
|
56
62
|
"types": "./build/typescript/features/env.d.ts",
|
|
57
63
|
"quilt:source": "./source/features/env.ts",
|
|
@@ -101,6 +107,9 @@
|
|
|
101
107
|
"features/assets": [
|
|
102
108
|
"./build/typescript/features/assets.d.ts"
|
|
103
109
|
],
|
|
110
|
+
"features/async": [
|
|
111
|
+
"./build/typescript/features/async.d.ts"
|
|
112
|
+
],
|
|
104
113
|
"features/env": [
|
|
105
114
|
"./build/typescript/features/env.d.ts"
|
|
106
115
|
],
|
|
@@ -150,7 +159,7 @@
|
|
|
150
159
|
"mrmime": "^1.0.1",
|
|
151
160
|
"rollup-plugin-esbuild": "^6.1.0",
|
|
152
161
|
"rollup-plugin-node-externals": "^6.1.2",
|
|
153
|
-
"rollup-plugin-visualizer": "^5.9.
|
|
162
|
+
"rollup-plugin-visualizer": "^5.9.3",
|
|
154
163
|
"semver": "^7.5.4",
|
|
155
164
|
"systemjs": "^6.14.2"
|
|
156
165
|
},
|