@quilted/rollup 0.2.4 → 0.2.5
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 +6 -0
- package/build/esm/app.mjs +60 -71
- package/build/esm/features/node.mjs +57 -0
- package/build/esm/module.mjs +21 -22
- package/build/esm/package.mjs +36 -79
- package/build/esm/server.mjs +16 -25
- package/build/esm/shared/project.mjs +100 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/app.d.ts +5 -5
- package/build/typescript/app.d.ts.map +1 -1
- package/build/typescript/features/node.d.ts +4 -0
- package/build/typescript/features/node.d.ts.map +1 -0
- package/build/typescript/module.d.ts +1 -1
- package/build/typescript/module.d.ts.map +1 -1
- package/build/typescript/package.d.ts +3 -5
- package/build/typescript/package.d.ts.map +1 -1
- package/build/typescript/server.d.ts +0 -1
- package/build/typescript/server.d.ts.map +1 -1
- package/build/typescript/shared/project.d.ts +33 -0
- package/build/typescript/shared/project.d.ts.map +1 -0
- package/package.json +10 -1
- package/source/app.ts +73 -80
- package/source/features/node.ts +74 -0
- package/source/module.ts +20 -22
- package/source/package.ts +37 -109
- package/source/server.ts +16 -30
- package/source/shared/project.ts +150 -0
- package/build/esm/shared/package-json.mjs +0 -16
- package/build/esm/shared/path.mjs +0 -7
- package/source/shared/package-json.ts +0 -20
- package/source/shared/path.ts +0 -5
|
@@ -163,7 +163,7 @@ export interface AppServerOutputOptions extends Pick<RollupNodePluginOptions, 'b
|
|
|
163
163
|
format?: 'esmodules' | 'esm' | 'es' | 'commonjs' | 'cjs';
|
|
164
164
|
}
|
|
165
165
|
export { MAGIC_MODULE_ENTRY, MAGIC_MODULE_APP_COMPONENT, MAGIC_MODULE_BROWSER_ASSETS, MAGIC_MODULE_REQUEST_ROUTER, };
|
|
166
|
-
export declare function quiltAppOptions({ root
|
|
166
|
+
export declare function quiltAppOptions({ root, app, env, graphql, assets, browser: browserOptions, server: serverOptions, }?: AppOptions): Promise<RollupOptions[]>;
|
|
167
167
|
export declare function quiltAppBrowserOptions(options?: AppBrowserOptions): Promise<{
|
|
168
168
|
plugins: InputPluginOption[];
|
|
169
169
|
output: {
|
|
@@ -183,8 +183,8 @@ export declare function quiltAppBrowserOptions(options?: AppBrowserOptions): Pro
|
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
}>;
|
|
186
|
-
export declare function quiltAppBrowser({ root
|
|
187
|
-
export declare function quiltAppBrowserInput({ root
|
|
186
|
+
export declare function quiltAppBrowser({ root, app, entry, env, assets, module, graphql, }?: AppBrowserOptions): Promise<InputPluginOption[]>;
|
|
187
|
+
export declare function quiltAppBrowserInput({ root, entry, }?: Pick<AppBrowserOptions, 'root' | 'entry'>): {
|
|
188
188
|
name: string;
|
|
189
189
|
options(this: import("rollup").MinimalPluginContext, options: import("rollup").InputOptions): Promise<{
|
|
190
190
|
input: import("rollup").InputOption;
|
|
@@ -222,8 +222,8 @@ export declare function quiltAppServerOptions(options?: AppServerOptions): Promi
|
|
|
222
222
|
generatedCode: "es2015";
|
|
223
223
|
};
|
|
224
224
|
}>;
|
|
225
|
-
export declare function quiltAppServer({ root
|
|
226
|
-
export declare function quiltAppServerInput({ root
|
|
225
|
+
export declare function quiltAppServer({ root, app, env, entry, format, graphql, assets, output, }?: AppServerOptions): Promise<InputPluginOption[]>;
|
|
226
|
+
export declare function quiltAppServerInput({ root, entry, format, }?: Pick<AppServerOptions, 'root' | 'entry' | 'format'>): {
|
|
227
227
|
name: string;
|
|
228
228
|
options(this: import("rollup").MinimalPluginContext, options: import("rollup").InputOptions): Promise<{
|
|
229
229
|
input: import("rollup").InputOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../source/app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../source/app.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,aAAa,EACb,iBAAiB,E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AAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,GAAG;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC;IACrC,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CAC3B;;;;;;;;;;EAyDL;AAED,wBAAgB,4BAA4B;;;;;;;;;;EAqE3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../source/features/node.ts"],"names":[],"mappings":"AAIA,wBAAsB,sBAAsB,CAAC,EAC3C,IAAoB,GACrB,GAAE;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAM,yCAmEtB"}
|
|
@@ -41,7 +41,7 @@ export interface ModuleAssetsOptions extends Pick<RollupNodePluginOptions, 'bund
|
|
|
41
41
|
hash?: boolean | 'async-only';
|
|
42
42
|
targets?: BrowserGroupTargetSelection;
|
|
43
43
|
}
|
|
44
|
-
export declare function quiltModule({ root
|
|
44
|
+
export declare function quiltModule({ root, entry, env, assets, graphql, }?: ModuleOptions): Promise<{
|
|
45
45
|
input: string;
|
|
46
46
|
plugins: InputPluginOption[];
|
|
47
47
|
output: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../source/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../source/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,iBAAiB,EAAqB,MAAM,QAAQ,CAAC;AAGlE,OAAO,EACL,uBAAuB,EAGxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAmB,KAAK,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAE/E,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEpB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,qBAAqB,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAE5D;;OAEG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAED,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC;IAC/C;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAC9B,OAAO,CAAC,EAAE,2BAA2B,CAAC;CACvC;AAED,wBAAsB,WAAW,CAAC,EAChC,IAAoB,EACpB,KAAK,EACL,GAAG,EACH,MAAM,EACN,OAAc,GACf,GAAE,aAAkB;;;;;;;;;;;;;;;;;;GAyFpB"}
|
|
@@ -99,10 +99,9 @@ export interface PackageOptions extends PackageESModuleOptions {
|
|
|
99
99
|
*/
|
|
100
100
|
esnext?: boolean;
|
|
101
101
|
}
|
|
102
|
-
export declare function quiltPackage({ root
|
|
102
|
+
export declare function quiltPackage({ root, commonjs, esnext: explicitESNext, entries, executable, bundle, react, graphql, customize, }?: PackageOptions): Promise<(RollupOptions | {
|
|
103
103
|
input: string[];
|
|
104
104
|
plugins: Plugin<any>[];
|
|
105
|
-
onwarn(warning: import("rollup").RollupLog, defaultWarn: import("rollup").LoggingFunction): void;
|
|
106
105
|
output: OutputOptions[];
|
|
107
106
|
} | {
|
|
108
107
|
input: string[];
|
|
@@ -150,10 +149,9 @@ export declare function quiltPackage({ root: rootPath, commonjs, esnext: explici
|
|
|
150
149
|
treeshake?: boolean | import("rollup").TreeshakingPreset | import("rollup").TreeshakingOptions | undefined;
|
|
151
150
|
watch?: false | import("rollup").WatcherOptions | undefined;
|
|
152
151
|
})[]>;
|
|
153
|
-
export declare function quiltPackageESModules({ root
|
|
152
|
+
export declare function quiltPackageESModules({ root, commonjs, entries, executable, react: useReact, bundle, graphql, customize, }?: PackageESModuleOptions): Promise<RollupOptions | {
|
|
154
153
|
input: string[];
|
|
155
154
|
plugins: Plugin<any>[];
|
|
156
|
-
onwarn(warning: import("rollup").RollupLog, defaultWarn: import("rollup").LoggingFunction): void;
|
|
157
155
|
output: OutputOptions[];
|
|
158
156
|
}>;
|
|
159
157
|
/**
|
|
@@ -176,7 +174,7 @@ export declare function quiltPackageESModules({ root: rootPath, commonjs, entrie
|
|
|
176
174
|
* }
|
|
177
175
|
* ```
|
|
178
176
|
*/
|
|
179
|
-
export declare function quiltPackageESNext({ root
|
|
177
|
+
export declare function quiltPackageESNext({ root, react: useReact, graphql, entries, bundle, customize, }?: PackageBaseOptions): Promise<RollupOptions | {
|
|
180
178
|
input: string[];
|
|
181
179
|
plugins: Plugin<any>[];
|
|
182
180
|
onwarn(warning: import("rollup").RollupLog, defaultWarn: import("rollup").LoggingFunction): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../source/package.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../source/package.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAC,MAAM,QAAQ,CAAC;AAItE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAM5B,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC;IAC/C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EzB;AAID,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,EAAC,IAAI,EAAE,WAAgB,EAAC,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAC;;;EAyE1E"}
|
|
@@ -89,7 +89,6 @@ export declare function quiltServer({ root: rootPath, entry, format, env, graphq
|
|
|
89
89
|
server: string;
|
|
90
90
|
};
|
|
91
91
|
plugins: InputPluginOption[];
|
|
92
|
-
onwarn(warning: import("rollup").RollupLog, defaultWarn: import("rollup").LoggingFunction): void;
|
|
93
92
|
output: {
|
|
94
93
|
format: "esm" | "cjs";
|
|
95
94
|
dir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../source/server.ts"],"names":[],"mappings":"
|
|
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;AAG/E,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,CAAC;IAErC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,qBAAqB,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAE5D;;OAEG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAE7B;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC;IAC/C;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAE9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,UAAU,GAAG,KAAK,CAAC;CAC1D;AAED,OAAO,EAAC,kBAAkB,EAAE,2BAA2B,EAAC,CAAC;AAEzD,wBAAsB,WAAW,CAAC,EAChC,IAAI,EAAE,QAAwB,EAC9B,KAAK,EACL,MAAyB,EACzB,GAAG,EACH,OAAc,EACd,MAAM,EACN,IAAI,EACJ,IAAI,GACL,GAAE,aAAkB;;;;;;;;;;;;;GAqGpB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type GlobOptions } from 'glob';
|
|
2
|
+
export declare class Project {
|
|
3
|
+
#private;
|
|
4
|
+
static load(root: string | URL): Project;
|
|
5
|
+
readonly root: string;
|
|
6
|
+
get path(): string;
|
|
7
|
+
get name(): string;
|
|
8
|
+
get packageJSON(): PackageJSON;
|
|
9
|
+
constructor(root: string | URL);
|
|
10
|
+
resolve(...segments: string[]): string;
|
|
11
|
+
glob(pattern: string | string[], options?: GlobOptions): Promise<string[]>;
|
|
12
|
+
}
|
|
13
|
+
export interface PackageJSONRaw {
|
|
14
|
+
name: string;
|
|
15
|
+
main?: string;
|
|
16
|
+
private?: boolean;
|
|
17
|
+
exports?: Record<string, string | Record<string, string>>;
|
|
18
|
+
dependencies?: Record<string, string>;
|
|
19
|
+
peerDependencies?: Record<string, string>;
|
|
20
|
+
peerDependenciesMeta?: Record<string, {
|
|
21
|
+
optional?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
devDependencies?: Record<string, string>;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export declare class PackageJSON {
|
|
27
|
+
readonly raw: PackageJSONRaw;
|
|
28
|
+
readonly path: string;
|
|
29
|
+
get name(): string;
|
|
30
|
+
constructor(rootOrPath: string);
|
|
31
|
+
}
|
|
32
|
+
export declare function sourceEntriesForProject(project: Project): Promise<Record<string, string>>;
|
|
33
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../source/shared/project.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,WAAW,EAAC,MAAM,MAAM,CAAC;AAI5C,qBAAa,OAAO;;IAClB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG;IAa9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,IAAI,IAAI,WAEP;IAED,IAAI,IAAI,WAEP;IAGD,IAAI,WAAW,gBAGd;gBAEW,IAAI,EAAE,MAAM,GAAG,GAAG;IAI9B,OAAO,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE;IAI7B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW;CAOvD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,qBAAa,WAAW;IACtB,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,IAAI,IAAI,WAEP;gBAEW,UAAU,EAAE,MAAM;CAM/B;AAMD,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,OAAO,mCA4C7D"}
|
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.5",
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=14.0.0"
|
|
12
12
|
},
|
|
@@ -58,6 +58,12 @@
|
|
|
58
58
|
"quilt:esnext": "./build/esnext/features/graphql.esnext",
|
|
59
59
|
"import": "./build/esm/features/graphql.mjs"
|
|
60
60
|
},
|
|
61
|
+
"./features/node": {
|
|
62
|
+
"types": "./build/typescript/features/node.d.ts",
|
|
63
|
+
"quilt:source": "./source/features/node.ts",
|
|
64
|
+
"quilt:esnext": "./build/esnext/features/node.esnext",
|
|
65
|
+
"import": "./build/esm/features/node.mjs"
|
|
66
|
+
},
|
|
61
67
|
"./features/typescript": {
|
|
62
68
|
"types": "./build/typescript/features/typescript.d.ts",
|
|
63
69
|
"quilt:source": "./source/features/typescript.ts",
|
|
@@ -86,6 +92,9 @@
|
|
|
86
92
|
"features/graphql": [
|
|
87
93
|
"./build/typescript/features/graphql.d.ts"
|
|
88
94
|
],
|
|
95
|
+
"features/node": [
|
|
96
|
+
"./build/typescript/features/node.d.ts"
|
|
97
|
+
],
|
|
89
98
|
"features/typescript": [
|
|
90
99
|
"./build/typescript/features/typescript.d.ts"
|
|
91
100
|
]
|
package/source/app.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import * as fs from 'fs/promises';
|
|
3
|
-
import {glob} from 'glob';
|
|
4
3
|
import {createRequire} from 'module';
|
|
5
4
|
|
|
6
5
|
import type {
|
|
@@ -35,8 +34,7 @@ import {
|
|
|
35
34
|
rollupGenerateOptionsForBrowsers,
|
|
36
35
|
type BrowserGroupTargetSelection,
|
|
37
36
|
} from './shared/browserslist.ts';
|
|
38
|
-
import {
|
|
39
|
-
import {resolveRoot} from './shared/path.ts';
|
|
37
|
+
import {Project} from './shared/project.ts';
|
|
40
38
|
|
|
41
39
|
export interface AppBaseOptions {
|
|
42
40
|
/**
|
|
@@ -234,7 +232,7 @@ export {
|
|
|
234
232
|
const require = createRequire(import.meta.url);
|
|
235
233
|
|
|
236
234
|
export async function quiltAppOptions({
|
|
237
|
-
root
|
|
235
|
+
root = process.cwd(),
|
|
238
236
|
app,
|
|
239
237
|
env,
|
|
240
238
|
graphql,
|
|
@@ -242,9 +240,9 @@ export async function quiltAppOptions({
|
|
|
242
240
|
browser: browserOptions,
|
|
243
241
|
server: serverOptions,
|
|
244
242
|
}: AppOptions = {}) {
|
|
245
|
-
const
|
|
243
|
+
const project = Project.load(root);
|
|
246
244
|
|
|
247
|
-
const browserGroups = await getBrowserGroups({root});
|
|
245
|
+
const browserGroups = await getBrowserGroups({root: project.root});
|
|
248
246
|
const browserGroupEntries = Object.entries(browserGroups);
|
|
249
247
|
const hasMultipleBrowserGroups = browserGroupEntries.length > 1;
|
|
250
248
|
|
|
@@ -253,7 +251,7 @@ export async function quiltAppOptions({
|
|
|
253
251
|
browserGroupEntries.forEach(([name, browsers], index) => {
|
|
254
252
|
optionPromises.push(
|
|
255
253
|
quiltAppBrowserOptions({
|
|
256
|
-
root,
|
|
254
|
+
root: project.root,
|
|
257
255
|
app,
|
|
258
256
|
graphql,
|
|
259
257
|
...browserOptions,
|
|
@@ -276,7 +274,7 @@ export async function quiltAppOptions({
|
|
|
276
274
|
|
|
277
275
|
optionPromises.push(
|
|
278
276
|
quiltAppServerOptions({
|
|
279
|
-
root,
|
|
277
|
+
root: project.root,
|
|
280
278
|
app,
|
|
281
279
|
graphql,
|
|
282
280
|
...serverOptions,
|
|
@@ -292,13 +290,13 @@ export async function quiltAppOptions({
|
|
|
292
290
|
}
|
|
293
291
|
|
|
294
292
|
export async function quiltAppBrowserOptions(options: AppBrowserOptions = {}) {
|
|
295
|
-
const {root
|
|
296
|
-
const
|
|
293
|
+
const {root = process.cwd(), assets} = options;
|
|
294
|
+
const project = Project.load(root);
|
|
297
295
|
|
|
298
296
|
const [plugins, browserGroup] = await Promise.all([
|
|
299
297
|
quiltAppBrowser(options),
|
|
300
298
|
getBrowserGroupTargetDetails(assets?.targets, {
|
|
301
|
-
root,
|
|
299
|
+
root: project.root,
|
|
302
300
|
}),
|
|
303
301
|
]);
|
|
304
302
|
|
|
@@ -312,7 +310,7 @@ export async function quiltAppBrowserOptions(options: AppBrowserOptions = {}) {
|
|
|
312
310
|
plugins,
|
|
313
311
|
output: {
|
|
314
312
|
format: isESM ? 'esm' : 'systemjs',
|
|
315
|
-
dir:
|
|
313
|
+
dir: project.resolve(`build/assets`),
|
|
316
314
|
entryFileNames: `[name]${targetFilenamePart}.[hash].js`,
|
|
317
315
|
assetFileNames: `[name]${targetFilenamePart}.[hash].[ext]`,
|
|
318
316
|
chunkFileNames: `[name]${targetFilenamePart}.[hash].js`,
|
|
@@ -323,7 +321,7 @@ export async function quiltAppBrowserOptions(options: AppBrowserOptions = {}) {
|
|
|
323
321
|
}
|
|
324
322
|
|
|
325
323
|
export async function quiltAppBrowser({
|
|
326
|
-
root
|
|
324
|
+
root = process.cwd(),
|
|
327
325
|
app,
|
|
328
326
|
entry,
|
|
329
327
|
env,
|
|
@@ -331,14 +329,14 @@ export async function quiltAppBrowser({
|
|
|
331
329
|
module,
|
|
332
330
|
graphql = true,
|
|
333
331
|
}: AppBrowserOptions = {}) {
|
|
334
|
-
const
|
|
332
|
+
const project = Project.load(root);
|
|
335
333
|
const mode = (typeof env === 'object' ? env?.mode : env) ?? 'production';
|
|
336
334
|
const minify = assets?.minify ?? mode === 'production';
|
|
337
335
|
const baseURL = assets?.baseURL ?? '/assets/';
|
|
338
336
|
const assetsInline = assets?.inline ?? true;
|
|
339
337
|
|
|
340
338
|
const browserGroup = await getBrowserGroupTargetDetails(assets?.targets, {
|
|
341
|
-
root,
|
|
339
|
+
root: project.root,
|
|
342
340
|
});
|
|
343
341
|
const targetFilenamePart = browserGroup.name ? `.${browserGroup.name}` : '';
|
|
344
342
|
|
|
@@ -347,6 +345,7 @@ export async function quiltAppBrowser({
|
|
|
347
345
|
{magicModuleEnv, replaceProcessEnv},
|
|
348
346
|
{sourceCode},
|
|
349
347
|
{tsconfigAliases},
|
|
348
|
+
{monorepoPackageAliases},
|
|
350
349
|
{react},
|
|
351
350
|
{css},
|
|
352
351
|
{assetManifest, rawAssets, staticAssets},
|
|
@@ -355,12 +354,12 @@ export async function quiltAppBrowser({
|
|
|
355
354
|
{workers},
|
|
356
355
|
{esnext},
|
|
357
356
|
nodePlugins,
|
|
358
|
-
packageJSON,
|
|
359
357
|
] = await Promise.all([
|
|
360
358
|
import('rollup-plugin-visualizer'),
|
|
361
359
|
import('./features/env.ts'),
|
|
362
360
|
import('./features/source-code.ts'),
|
|
363
361
|
import('./features/typescript.ts'),
|
|
362
|
+
import('./features/node.ts'),
|
|
364
363
|
import('./features/react.ts'),
|
|
365
364
|
import('./features/css.ts'),
|
|
366
365
|
import('./features/assets.ts'),
|
|
@@ -369,11 +368,10 @@ export async function quiltAppBrowser({
|
|
|
369
368
|
import('./features/workers.ts'),
|
|
370
369
|
import('./features/esnext.ts'),
|
|
371
370
|
getNodePlugins({bundle: true}),
|
|
372
|
-
loadPackageJSON(root),
|
|
373
371
|
]);
|
|
374
372
|
|
|
375
373
|
const plugins: InputPluginOption[] = [
|
|
376
|
-
quiltAppBrowserInput({root, entry}),
|
|
374
|
+
quiltAppBrowserInput({root: project.root, entry}),
|
|
377
375
|
...nodePlugins,
|
|
378
376
|
systemJS({minify}),
|
|
379
377
|
replaceProcessEnv({mode}),
|
|
@@ -414,31 +412,32 @@ export async function quiltAppBrowser({
|
|
|
414
412
|
asyncModules({
|
|
415
413
|
baseURL,
|
|
416
414
|
preload: true,
|
|
417
|
-
moduleID: ({imported}) => path.relative(root, imported),
|
|
415
|
+
moduleID: ({imported}) => path.relative(project.root, imported),
|
|
418
416
|
}),
|
|
419
417
|
workers({
|
|
420
418
|
baseURL,
|
|
421
419
|
outputOptions: {
|
|
422
420
|
format: 'iife',
|
|
423
421
|
inlineDynamicImports: true,
|
|
424
|
-
dir:
|
|
422
|
+
dir: project.resolve(`build/assets`),
|
|
425
423
|
entryFileNames: `[name]${targetFilenamePart}.[hash].js`,
|
|
426
424
|
assetFileNames: `[name]${targetFilenamePart}.[hash].[ext]`,
|
|
427
425
|
chunkFileNames: `[name]${targetFilenamePart}.[hash].js`,
|
|
428
426
|
},
|
|
429
427
|
}),
|
|
430
|
-
tsconfigAliases({root}),
|
|
428
|
+
tsconfigAliases({root: project.root}),
|
|
429
|
+
monorepoPackageAliases({root: project.root}),
|
|
431
430
|
];
|
|
432
431
|
|
|
433
432
|
if (assets?.clean ?? true) {
|
|
434
433
|
plugins.push(
|
|
435
434
|
removeBuildFiles(['build/assets', 'build/manifests', 'build/reports'], {
|
|
436
|
-
root,
|
|
435
|
+
root: project.root,
|
|
437
436
|
}),
|
|
438
437
|
);
|
|
439
438
|
}
|
|
440
439
|
|
|
441
|
-
const appEntry = await resolveAppEntry(app,
|
|
440
|
+
const appEntry = await resolveAppEntry(app, project);
|
|
442
441
|
|
|
443
442
|
if (appEntry) {
|
|
444
443
|
plugins.push(magicModuleAppComponent({entry: appEntry}));
|
|
@@ -451,8 +450,7 @@ export async function quiltAppBrowser({
|
|
|
451
450
|
|
|
452
451
|
plugins.push(
|
|
453
452
|
graphql({
|
|
454
|
-
manifest:
|
|
455
|
-
root,
|
|
453
|
+
manifest: project.resolve(
|
|
456
454
|
`build/manifests/graphql${targetFilenamePart}.json`,
|
|
457
455
|
),
|
|
458
456
|
}),
|
|
@@ -474,18 +472,14 @@ export async function quiltAppBrowser({
|
|
|
474
472
|
assetManifest({
|
|
475
473
|
baseURL,
|
|
476
474
|
cacheKey,
|
|
477
|
-
file:
|
|
478
|
-
root,
|
|
479
|
-
`build/manifests/assets${targetFilenamePart}.json`,
|
|
480
|
-
),
|
|
475
|
+
file: project.resolve(`build/manifests/assets${targetFilenamePart}.json`),
|
|
481
476
|
priority: assets?.priority,
|
|
482
477
|
}),
|
|
483
478
|
visualizer({
|
|
484
479
|
template: 'treemap',
|
|
485
480
|
open: false,
|
|
486
481
|
brotliSize: true,
|
|
487
|
-
filename:
|
|
488
|
-
root,
|
|
482
|
+
filename: project.resolve(
|
|
489
483
|
`build/reports/bundle-visualizer${targetFilenamePart}.html`,
|
|
490
484
|
),
|
|
491
485
|
}),
|
|
@@ -495,10 +489,10 @@ export async function quiltAppBrowser({
|
|
|
495
489
|
}
|
|
496
490
|
|
|
497
491
|
export function quiltAppBrowserInput({
|
|
498
|
-
root
|
|
492
|
+
root = process.cwd(),
|
|
499
493
|
entry,
|
|
500
494
|
}: Pick<AppBrowserOptions, 'root' | 'entry'> = {}) {
|
|
501
|
-
const
|
|
495
|
+
const project = Project.load(root);
|
|
502
496
|
|
|
503
497
|
return {
|
|
504
498
|
name: '@quilted/app-browser/input',
|
|
@@ -506,12 +500,13 @@ export function quiltAppBrowserInput({
|
|
|
506
500
|
const finalEntry =
|
|
507
501
|
normalizeRollupInput(options.input) ??
|
|
508
502
|
(entry
|
|
509
|
-
?
|
|
510
|
-
: await
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
503
|
+
? project.resolve(entry)
|
|
504
|
+
: await project
|
|
505
|
+
.glob('{browser,client,web}.{ts,tsx,mjs,js,jsx}', {
|
|
506
|
+
nodir: true,
|
|
507
|
+
absolute: true,
|
|
508
|
+
})
|
|
509
|
+
.then((files) => files[0])) ??
|
|
515
510
|
MAGIC_MODULE_ENTRY;
|
|
516
511
|
|
|
517
512
|
return {
|
|
@@ -528,9 +523,9 @@ export function quiltAppBrowserInput({
|
|
|
528
523
|
}
|
|
529
524
|
|
|
530
525
|
export async function quiltAppServerOptions(options: AppServerOptions = {}) {
|
|
531
|
-
const {root
|
|
526
|
+
const {root = process.cwd(), output} = options;
|
|
532
527
|
|
|
533
|
-
const
|
|
528
|
+
const project = Project.load(root);
|
|
534
529
|
const hash = output?.hash ?? 'async-only';
|
|
535
530
|
const outputFormat = output?.format ?? 'esmodules';
|
|
536
531
|
|
|
@@ -541,7 +536,7 @@ export async function quiltAppServerOptions(options: AppServerOptions = {}) {
|
|
|
541
536
|
output: {
|
|
542
537
|
format:
|
|
543
538
|
outputFormat === 'commonjs' || outputFormat === 'cjs' ? 'cjs' : 'esm',
|
|
544
|
-
dir:
|
|
539
|
+
dir: project.resolve(`build/server`),
|
|
545
540
|
entryFileNames: `[name]${hash === true ? `.[hash]` : ''}.js`,
|
|
546
541
|
chunkFileNames: `[name]${
|
|
547
542
|
hash === true || hash === 'async-only' ? `.[hash]` : ''
|
|
@@ -553,7 +548,7 @@ export async function quiltAppServerOptions(options: AppServerOptions = {}) {
|
|
|
553
548
|
}
|
|
554
549
|
|
|
555
550
|
export async function quiltAppServer({
|
|
556
|
-
root
|
|
551
|
+
root = process.cwd(),
|
|
557
552
|
app,
|
|
558
553
|
env,
|
|
559
554
|
entry,
|
|
@@ -562,7 +557,7 @@ export async function quiltAppServer({
|
|
|
562
557
|
assets,
|
|
563
558
|
output,
|
|
564
559
|
}: AppServerOptions = {}) {
|
|
565
|
-
const
|
|
560
|
+
const project = Project.load(root);
|
|
566
561
|
const mode = (typeof env === 'object' ? env?.mode : env) ?? 'production';
|
|
567
562
|
|
|
568
563
|
const baseURL = assets?.baseURL ?? '/assets/';
|
|
@@ -577,28 +572,28 @@ export async function quiltAppServer({
|
|
|
577
572
|
{sourceCode},
|
|
578
573
|
{react},
|
|
579
574
|
{tsconfigAliases},
|
|
575
|
+
{monorepoPackageAliases},
|
|
580
576
|
{css},
|
|
581
577
|
{rawAssets, staticAssets},
|
|
582
578
|
{asyncModules},
|
|
583
579
|
{esnext},
|
|
584
580
|
nodePlugins,
|
|
585
|
-
packageJSON,
|
|
586
581
|
] = await Promise.all([
|
|
587
582
|
import('rollup-plugin-visualizer'),
|
|
588
583
|
import('./features/env.ts'),
|
|
589
584
|
import('./features/source-code.ts'),
|
|
590
585
|
import('./features/react.ts'),
|
|
591
586
|
import('./features/typescript.ts'),
|
|
587
|
+
import('./features/node.ts'),
|
|
592
588
|
import('./features/css.ts'),
|
|
593
589
|
import('./features/assets.ts'),
|
|
594
590
|
import('./features/async.ts'),
|
|
595
591
|
import('./features/esnext.ts'),
|
|
596
592
|
getNodePlugins({bundle}),
|
|
597
|
-
loadPackageJSON(root),
|
|
598
593
|
]);
|
|
599
594
|
|
|
600
595
|
const plugins: InputPluginOption[] = [
|
|
601
|
-
quiltAppServerInput({root, entry, format}),
|
|
596
|
+
quiltAppServerInput({root: project.root, entry, format}),
|
|
602
597
|
...nodePlugins,
|
|
603
598
|
replaceProcessEnv({mode}),
|
|
604
599
|
magicModuleEnv({...resolveEnvOption(env), mode}),
|
|
@@ -637,25 +632,27 @@ export async function quiltAppServer({
|
|
|
637
632
|
asyncModules({
|
|
638
633
|
baseURL,
|
|
639
634
|
preload: false,
|
|
640
|
-
moduleID: ({imported}) => path.relative(root, imported),
|
|
635
|
+
moduleID: ({imported}) => path.relative(project.root, imported),
|
|
641
636
|
}),
|
|
642
|
-
removeBuildFiles(['build/server'], {root}),
|
|
643
|
-
tsconfigAliases({root}),
|
|
637
|
+
removeBuildFiles(['build/server'], {root: project.root}),
|
|
638
|
+
tsconfigAliases({root: project.root}),
|
|
639
|
+
monorepoPackageAliases({root: project.root}),
|
|
644
640
|
];
|
|
645
641
|
|
|
646
|
-
const appEntry = await resolveAppEntry(app,
|
|
642
|
+
const appEntry = await resolveAppEntry(app, project);
|
|
647
643
|
|
|
648
644
|
if (appEntry) {
|
|
649
645
|
plugins.push(magicModuleAppComponent({entry: appEntry}));
|
|
650
646
|
}
|
|
651
647
|
|
|
652
648
|
const serverEntry = entry
|
|
653
|
-
?
|
|
654
|
-
: await
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
649
|
+
? project.resolve(entry)
|
|
650
|
+
: await project
|
|
651
|
+
.glob('{server,service,backend}.{ts,tsx,mjs,js,jsx}', {
|
|
652
|
+
nodir: true,
|
|
653
|
+
absolute: true,
|
|
654
|
+
})
|
|
655
|
+
.then((files) => files[0]);
|
|
659
656
|
|
|
660
657
|
plugins.push(
|
|
661
658
|
magicModuleAppServerEntry({
|
|
@@ -680,10 +677,7 @@ export async function quiltAppServer({
|
|
|
680
677
|
template: 'treemap',
|
|
681
678
|
open: false,
|
|
682
679
|
brotliSize: false,
|
|
683
|
-
filename:
|
|
684
|
-
root,
|
|
685
|
-
`build/reports/bundle-visualizer.server.html`,
|
|
686
|
-
),
|
|
680
|
+
filename: project.resolve(`build/reports/bundle-visualizer.server.html`),
|
|
687
681
|
}),
|
|
688
682
|
);
|
|
689
683
|
|
|
@@ -691,11 +685,11 @@ export async function quiltAppServer({
|
|
|
691
685
|
}
|
|
692
686
|
|
|
693
687
|
export function quiltAppServerInput({
|
|
694
|
-
root
|
|
688
|
+
root = process.cwd(),
|
|
695
689
|
entry,
|
|
696
690
|
format = 'request-router',
|
|
697
691
|
}: Pick<AppServerOptions, 'root' | 'entry' | 'format'> = {}) {
|
|
698
|
-
const
|
|
692
|
+
const project = Project.load(root);
|
|
699
693
|
|
|
700
694
|
return {
|
|
701
695
|
name: '@quilted/app-server/input',
|
|
@@ -704,12 +698,13 @@ export function quiltAppServerInput({
|
|
|
704
698
|
|
|
705
699
|
if (!finalEntry) {
|
|
706
700
|
const serverEntry = entry
|
|
707
|
-
?
|
|
708
|
-
: await
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
701
|
+
? project.resolve(entry)
|
|
702
|
+
: await project
|
|
703
|
+
.glob('{server,service,backend}.{ts,tsx,mjs,js,jsx}', {
|
|
704
|
+
nodir: true,
|
|
705
|
+
absolute: true,
|
|
706
|
+
})
|
|
707
|
+
.then((files) => files[0]);
|
|
713
708
|
|
|
714
709
|
finalEntry =
|
|
715
710
|
format === 'request-router'
|
|
@@ -1047,26 +1042,24 @@ function createManualChunksSorter(): GetManualChunk {
|
|
|
1047
1042
|
};
|
|
1048
1043
|
}
|
|
1049
1044
|
|
|
1050
|
-
async function resolveAppEntry(
|
|
1051
|
-
entry: string | undefined,
|
|
1052
|
-
{root, packageJSON}: {root: string; packageJSON: PackageJSON},
|
|
1053
|
-
) {
|
|
1045
|
+
async function resolveAppEntry(entry: string | undefined, project: Project) {
|
|
1054
1046
|
if (entry) {
|
|
1055
|
-
return
|
|
1047
|
+
return project.resolve(entry);
|
|
1056
1048
|
}
|
|
1057
1049
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1050
|
+
const {packageJSON} = project;
|
|
1051
|
+
|
|
1052
|
+
if (typeof packageJSON.raw.main === 'string') {
|
|
1053
|
+
return project.resolve(packageJSON.raw.main);
|
|
1060
1054
|
}
|
|
1061
1055
|
|
|
1062
|
-
const rootEntry = (packageJSON.exports as any)?.['.'];
|
|
1056
|
+
const rootEntry = (packageJSON.raw.exports as any)?.['.'];
|
|
1063
1057
|
|
|
1064
1058
|
if (typeof rootEntry === 'string') {
|
|
1065
|
-
return
|
|
1059
|
+
return project.resolve(rootEntry);
|
|
1066
1060
|
}
|
|
1067
1061
|
|
|
1068
|
-
const globbed = await glob('{App,app,index}.{ts,tsx,mjs,js,jsx}', {
|
|
1069
|
-
cwd: root,
|
|
1062
|
+
const globbed = await project.glob('{App,app,index}.{ts,tsx,mjs,js,jsx}', {
|
|
1070
1063
|
nodir: true,
|
|
1071
1064
|
absolute: true,
|
|
1072
1065
|
});
|