plgg-bundle 0.0.1 → 0.0.2
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/package.json +1 -4
- package/dist/Dev/fixtures/devPoc.spec.d.ts +0 -2
- package/dist/Dev/fixtures/devPoc.spec.d.ts.map +0 -1
- package/dist/Dev/fixtures/devPoc.spec.js +0 -145
- package/dist/Dev/fixtures/devPoc.spec.js.map +0 -1
- package/dist/Dev/model/Fetch.d.ts +0 -20
- package/dist/Dev/model/Fetch.d.ts.map +0 -1
- package/dist/Dev/model/Fetch.js +0 -8
- package/dist/Dev/model/Fetch.js.map +0 -1
- package/dist/Dev/model/ModuleGraph.d.ts +0 -27
- package/dist/Dev/model/ModuleGraph.d.ts.map +0 -1
- package/dist/Dev/model/ModuleGraph.js +0 -2
- package/dist/Dev/model/ModuleGraph.js.map +0 -1
- package/dist/Dev/model/Protocol.d.ts +0 -22
- package/dist/Dev/model/Protocol.d.ts.map +0 -1
- package/dist/Dev/model/Protocol.js +0 -31
- package/dist/Dev/model/Protocol.js.map +0 -1
- package/dist/Dev/node/devServer.d.ts +0 -21
- package/dist/Dev/node/devServer.d.ts.map +0 -1
- package/dist/Dev/node/devServer.js +0 -298
- package/dist/Dev/node/devServer.js.map +0 -1
- package/dist/Dev/node/httpAdapter.d.ts +0 -19
- package/dist/Dev/node/httpAdapter.d.ts.map +0 -1
- package/dist/Dev/node/httpAdapter.js +0 -76
- package/dist/Dev/node/httpAdapter.js.map +0 -1
- package/dist/Dev/node/scanGraph.d.ts +0 -21
- package/dist/Dev/node/scanGraph.d.ts.map +0 -1
- package/dist/Dev/node/scanGraph.js +0 -145
- package/dist/Dev/node/scanGraph.js.map +0 -1
- package/dist/Dev/node/watch.d.ts +0 -10
- package/dist/Dev/node/watch.d.ts.map +0 -1
- package/dist/Dev/node/watch.js +0 -44
- package/dist/Dev/node/watch.js.map +0 -1
- package/dist/Dev/usecase/allowedHost.d.ts +0 -16
- package/dist/Dev/usecase/allowedHost.d.ts.map +0 -1
- package/dist/Dev/usecase/allowedHost.js +0 -33
- package/dist/Dev/usecase/allowedHost.js.map +0 -1
- package/dist/Dev/usecase/allowedHost.spec.d.ts +0 -2
- package/dist/Dev/usecase/allowedHost.spec.d.ts.map +0 -1
- package/dist/Dev/usecase/allowedHost.spec.js +0 -13
- package/dist/Dev/usecase/allowedHost.spec.js.map +0 -1
- package/dist/Dev/usecase/buildGraph.d.ts +0 -12
- package/dist/Dev/usecase/buildGraph.d.ts.map +0 -1
- package/dist/Dev/usecase/buildGraph.js +0 -24
- package/dist/Dev/usecase/buildGraph.js.map +0 -1
- package/dist/Dev/usecase/buildGraph.spec.d.ts +0 -2
- package/dist/Dev/usecase/buildGraph.spec.d.ts.map +0 -1
- package/dist/Dev/usecase/buildGraph.spec.js +0 -16
- package/dist/Dev/usecase/buildGraph.spec.js.map +0 -1
- package/dist/Dev/usecase/decorateDevHtml.d.ts +0 -12
- package/dist/Dev/usecase/decorateDevHtml.d.ts.map +0 -1
- package/dist/Dev/usecase/decorateDevHtml.js +0 -15
- package/dist/Dev/usecase/decorateDevHtml.js.map +0 -1
- package/dist/Dev/usecase/decorateDevHtml.spec.d.ts +0 -2
- package/dist/Dev/usecase/decorateDevHtml.spec.d.ts.map +0 -1
- package/dist/Dev/usecase/decorateDevHtml.spec.js +0 -19
- package/dist/Dev/usecase/decorateDevHtml.spec.js.map +0 -1
- package/dist/Dev/usecase/invalidate.d.ts +0 -17
- package/dist/Dev/usecase/invalidate.d.ts.map +0 -1
- package/dist/Dev/usecase/invalidate.js +0 -57
- package/dist/Dev/usecase/invalidate.js.map +0 -1
- package/dist/Dev/usecase/invalidate.spec.d.ts +0 -2
- package/dist/Dev/usecase/invalidate.spec.d.ts.map +0 -1
- package/dist/Dev/usecase/invalidate.spec.js +0 -64
- package/dist/Dev/usecase/invalidate.spec.js.map +0 -1
- package/dist/Dev/usecase/parseImports.d.ts +0 -24
- package/dist/Dev/usecase/parseImports.d.ts.map +0 -1
- package/dist/Dev/usecase/parseImports.js +0 -40
- package/dist/Dev/usecase/parseImports.js.map +0 -1
- package/dist/Dev/usecase/parseImports.spec.d.ts +0 -2
- package/dist/Dev/usecase/parseImports.spec.d.ts.map +0 -1
- package/dist/Dev/usecase/parseImports.spec.js +0 -24
- package/dist/Dev/usecase/parseImports.spec.js.map +0 -1
- package/dist/Dev/usecase/reloadDecision.d.ts +0 -20
- package/dist/Dev/usecase/reloadDecision.d.ts.map +0 -1
- package/dist/Dev/usecase/reloadDecision.js +0 -52
- package/dist/Dev/usecase/reloadDecision.js.map +0 -1
- package/dist/Dev/usecase/reloadDecision.spec.d.ts +0 -2
- package/dist/Dev/usecase/reloadDecision.spec.d.ts.map +0 -1
- package/dist/Dev/usecase/reloadDecision.spec.js +0 -17
- package/dist/Dev/usecase/reloadDecision.spec.js.map +0 -1
- package/dist/domain/model/BundleConfig.d.ts +0 -136
- package/dist/domain/model/BundleConfig.d.ts.map +0 -1
- package/dist/domain/model/BundleConfig.js +0 -18
- package/dist/domain/model/BundleConfig.js.map +0 -1
- package/dist/domain/model/BundleConfig.spec.d.ts +0 -2
- package/dist/domain/model/BundleConfig.spec.d.ts.map +0 -1
- package/dist/domain/model/BundleConfig.spec.js +0 -8
- package/dist/domain/model/BundleConfig.spec.js.map +0 -1
- package/dist/domain/usecase/asBundleConfig.d.ts +0 -17
- package/dist/domain/usecase/asBundleConfig.d.ts.map +0 -1
- package/dist/domain/usecase/asBundleConfig.js +0 -179
- package/dist/domain/usecase/asBundleConfig.js.map +0 -1
- package/dist/domain/usecase/asBundleConfig.spec.d.ts +0 -2
- package/dist/domain/usecase/asBundleConfig.spec.d.ts.map +0 -1
- package/dist/domain/usecase/asBundleConfig.spec.js +0 -119
- package/dist/domain/usecase/asBundleConfig.spec.js.map +0 -1
- package/dist/domain/usecase/build.d.ts +0 -14
- package/dist/domain/usecase/build.d.ts.map +0 -1
- package/dist/domain/usecase/build.js +0 -177
- package/dist/domain/usecase/build.js.map +0 -1
- package/dist/domain/usecase/collectModules.d.ts +0 -53
- package/dist/domain/usecase/collectModules.d.ts.map +0 -1
- package/dist/domain/usecase/collectModules.js +0 -118
- package/dist/domain/usecase/collectModules.js.map +0 -1
- package/dist/domain/usecase/deriveExternal.d.ts +0 -25
- package/dist/domain/usecase/deriveExternal.d.ts.map +0 -1
- package/dist/domain/usecase/deriveExternal.js +0 -79
- package/dist/domain/usecase/deriveExternal.js.map +0 -1
- package/dist/domain/usecase/deriveExternal.spec.d.ts +0 -2
- package/dist/domain/usecase/deriveExternal.spec.d.ts.map +0 -1
- package/dist/domain/usecase/deriveExternal.spec.js +0 -56
- package/dist/domain/usecase/deriveExternal.spec.js.map +0 -1
- package/dist/domain/usecase/discoverWorkspace.d.ts +0 -27
- package/dist/domain/usecase/discoverWorkspace.d.ts.map +0 -1
- package/dist/domain/usecase/discoverWorkspace.js +0 -116
- package/dist/domain/usecase/discoverWorkspace.js.map +0 -1
- package/dist/domain/usecase/discoverWorkspace.spec.d.ts +0 -2
- package/dist/domain/usecase/discoverWorkspace.spec.d.ts.map +0 -1
- package/dist/domain/usecase/discoverWorkspace.spec.js +0 -23
- package/dist/domain/usecase/discoverWorkspace.spec.js.map +0 -1
- package/dist/domain/usecase/emitBundle.d.ts +0 -43
- package/dist/domain/usecase/emitBundle.d.ts.map +0 -1
- package/dist/domain/usecase/emitBundle.js +0 -157
- package/dist/domain/usecase/emitBundle.js.map +0 -1
- package/dist/domain/usecase/emitBundle.spec.d.ts +0 -2
- package/dist/domain/usecase/emitBundle.spec.d.ts.map +0 -1
- package/dist/domain/usecase/emitBundle.spec.js +0 -80
- package/dist/domain/usecase/emitBundle.spec.js.map +0 -1
- package/dist/domain/usecase/emitDts.d.ts +0 -32
- package/dist/domain/usecase/emitDts.d.ts.map +0 -1
- package/dist/domain/usecase/emitDts.js +0 -99
- package/dist/domain/usecase/emitDts.js.map +0 -1
- package/dist/domain/usecase/isExternal.d.ts +0 -12
- package/dist/domain/usecase/isExternal.d.ts.map +0 -1
- package/dist/domain/usecase/isExternal.js +0 -16
- package/dist/domain/usecase/isExternal.js.map +0 -1
- package/dist/domain/usecase/isExternal.spec.d.ts +0 -2
- package/dist/domain/usecase/isExternal.spec.d.ts.map +0 -1
- package/dist/domain/usecase/isExternal.spec.js +0 -16
- package/dist/domain/usecase/isExternal.spec.js.map +0 -1
- package/dist/domain/usecase/resolveSpecifier.d.ts +0 -35
- package/dist/domain/usecase/resolveSpecifier.d.ts.map +0 -1
- package/dist/domain/usecase/resolveSpecifier.js +0 -83
- package/dist/domain/usecase/resolveSpecifier.js.map +0 -1
- package/dist/domain/usecase/resolveSpecifier.spec.d.ts +0 -2
- package/dist/domain/usecase/resolveSpecifier.spec.d.ts.map +0 -1
- package/dist/domain/usecase/resolveSpecifier.spec.js +0 -44
- package/dist/domain/usecase/resolveSpecifier.spec.js.map +0 -1
- package/dist/domain/usecase/resolveWorkspaceSpecifier.d.ts +0 -29
- package/dist/domain/usecase/resolveWorkspaceSpecifier.d.ts.map +0 -1
- package/dist/domain/usecase/resolveWorkspaceSpecifier.js +0 -89
- package/dist/domain/usecase/resolveWorkspaceSpecifier.js.map +0 -1
- package/dist/domain/usecase/resolveWorkspaceSpecifier.spec.d.ts +0 -2
- package/dist/domain/usecase/resolveWorkspaceSpecifier.spec.d.ts.map +0 -1
- package/dist/domain/usecase/resolveWorkspaceSpecifier.spec.js +0 -27
- package/dist/domain/usecase/resolveWorkspaceSpecifier.spec.js.map +0 -1
- package/dist/domain/usecase/rewriteDtsAliases.d.ts +0 -25
- package/dist/domain/usecase/rewriteDtsAliases.d.ts.map +0 -1
- package/dist/domain/usecase/rewriteDtsAliases.js +0 -71
- package/dist/domain/usecase/rewriteDtsAliases.js.map +0 -1
- package/dist/domain/usecase/rewriteDtsAliases.spec.d.ts +0 -2
- package/dist/domain/usecase/rewriteDtsAliases.spec.d.ts.map +0 -1
- package/dist/domain/usecase/rewriteDtsAliases.spec.js +0 -35
- package/dist/domain/usecase/rewriteDtsAliases.spec.js.map +0 -1
- package/dist/entrypoints/cli.d.ts +0 -2
- package/dist/entrypoints/cli.d.ts.map +0 -1
- package/dist/entrypoints/cli.js +0 -79
- package/dist/entrypoints/cli.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -28
- package/dist/index.js.map +0 -1
- package/dist/vendors/runner.d.ts +0 -20
- package/dist/vendors/runner.d.ts.map +0 -1
- package/dist/vendors/runner.js +0 -60
- package/dist/vendors/runner.js.map +0 -1
- package/dist/vendors/runner.spec.d.ts +0 -2
- package/dist/vendors/runner.spec.d.ts.map +0 -1
- package/dist/vendors/runner.spec.js +0 -20
- package/dist/vendors/runner.spec.js.map +0 -1
- package/dist/vendors/transpiler.d.ts +0 -19
- package/dist/vendors/transpiler.d.ts.map +0 -1
- package/dist/vendors/transpiler.js +0 -42
- package/dist/vendors/transpiler.js.map +0 -1
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { relative } from "node:path";
|
|
3
|
-
import {} from "plgg-bundle/domain/model/BundleConfig";
|
|
4
|
-
import { resolveSpecifier } from "plgg-bundle/domain/usecase/resolveSpecifier";
|
|
5
|
-
import { isExternal } from "plgg-bundle/domain/usecase/isExternal";
|
|
6
|
-
import { transpileToCjs } from "plgg-bundle/vendors/transpiler";
|
|
7
|
-
/**
|
|
8
|
-
* Walk the import graph from `entryFile`, transpiling
|
|
9
|
-
* each `.ts` to CJS, resolving every `require(...)`
|
|
10
|
-
* specifier to either an intra-bundle module id (to
|
|
11
|
-
* inline) or an external (to keep as a runtime
|
|
12
|
-
* require), and rewriting the inlined `require("spec")`
|
|
13
|
-
* calls to `require("<id>")`. Pure in-house graph logic;
|
|
14
|
-
* only the per-file TS→JS step is vendored. Throws on an
|
|
15
|
-
* unresolvable import or a read failure.
|
|
16
|
-
*/
|
|
17
|
-
export const collectModules = (args) => {
|
|
18
|
-
const ctx = {
|
|
19
|
-
root: args.root,
|
|
20
|
-
external: args.external,
|
|
21
|
-
resolve: args.resolve ??
|
|
22
|
-
((specifier, fromFile) => resolveSpecifier({
|
|
23
|
-
specifier,
|
|
24
|
-
fromFile,
|
|
25
|
-
aliasPrefix: args.aliasPrefix,
|
|
26
|
-
aliasSrcRoot: args.aliasSrcRoot,
|
|
27
|
-
})),
|
|
28
|
-
};
|
|
29
|
-
const acc = new Map();
|
|
30
|
-
walk(ctx, args.entryFile, acc);
|
|
31
|
-
return {
|
|
32
|
-
entryId: idOf(args.root, args.entryFile),
|
|
33
|
-
modules: [...acc.values()],
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Depth-first accumulation into a Map keyed by id, so a
|
|
38
|
-
* diamond import is transpiled once. Mutates `acc`.
|
|
39
|
-
*/
|
|
40
|
-
const walk = (ctx, file, acc) => {
|
|
41
|
-
const id = idOf(ctx.root, file);
|
|
42
|
-
if (acc.has(id)) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const cjs = transpileToCjs(file, readSource(file));
|
|
46
|
-
const deps = linkModule(ctx, file, id, cjs, acc);
|
|
47
|
-
for (const depFile of deps) {
|
|
48
|
-
walk(ctx, depFile, acc);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Resolve and rewrite every `require(...)` in a
|
|
53
|
-
* transpiled module, register it in `acc`, and return
|
|
54
|
-
* the resolved file paths of its intra-bundle deps.
|
|
55
|
-
* Throws on an unresolvable (non-external) specifier.
|
|
56
|
-
*/
|
|
57
|
-
const linkModule = (ctx, file, id, cjs, acc) => {
|
|
58
|
-
const specifiers = requireSpecifiers(cjs);
|
|
59
|
-
const externals = [];
|
|
60
|
-
const deps = [];
|
|
61
|
-
let rewritten = cjs;
|
|
62
|
-
for (const spec of specifiers) {
|
|
63
|
-
if (isExternal(ctx.external, spec)) {
|
|
64
|
-
externals.push(spec);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
const resolved = ctx.resolve(spec, file);
|
|
68
|
-
if (resolved === undefined) {
|
|
69
|
-
throw new Error(`ResolveError: cannot resolve "${spec}" from ${id}`);
|
|
70
|
-
}
|
|
71
|
-
deps.push(resolved);
|
|
72
|
-
rewritten = replaceRequire(rewritten, spec, idOf(ctx.root, resolved));
|
|
73
|
-
}
|
|
74
|
-
acc.set(id, {
|
|
75
|
-
id,
|
|
76
|
-
code: rewritten,
|
|
77
|
-
externals,
|
|
78
|
-
});
|
|
79
|
-
return deps;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Read a source file, re-throwing with context.
|
|
83
|
-
*/
|
|
84
|
-
const readSource = (file) => {
|
|
85
|
-
try {
|
|
86
|
-
return readFileSync(file, "utf8");
|
|
87
|
-
}
|
|
88
|
-
catch (cause) {
|
|
89
|
-
throw new Error(`IoError: cannot read ${file}: ${cause instanceof Error
|
|
90
|
-
? cause.message
|
|
91
|
-
: String(cause)}`);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* A module's stable id: its path relative to the
|
|
96
|
-
* package root, POSIX-normalized. The runtime keys on
|
|
97
|
-
* exactly this string.
|
|
98
|
-
*/
|
|
99
|
-
const idOf = (root, file) => relative(root, file).split("\\").join("/");
|
|
100
|
-
/**
|
|
101
|
-
* Extract the literal string specifiers of all
|
|
102
|
-
* top-level `require("...")` / `require('...')` calls
|
|
103
|
-
* a transpiled CJS module makes.
|
|
104
|
-
*/
|
|
105
|
-
const requireSpecifiers = (cjs) => [
|
|
106
|
-
...cjs.matchAll(/require\(\s*["']([^"']+)["']\s*\)/g),
|
|
107
|
-
].flatMap((m) => m[1] === undefined ? [] : [m[1]]);
|
|
108
|
-
/**
|
|
109
|
-
* Rewrite every `require("spec")` occurrence to
|
|
110
|
-
* `require("id")`. Operates on the exact specifier
|
|
111
|
-
* string so distinct specifiers do not interfere.
|
|
112
|
-
*/
|
|
113
|
-
const replaceRequire = (cjs, spec, id) => cjs
|
|
114
|
-
.split(`require("${spec}")`)
|
|
115
|
-
.join(`require("${id}")`)
|
|
116
|
-
.split(`require('${spec}')`)
|
|
117
|
-
.join(`require("${id}")`);
|
|
118
|
-
//# sourceMappingURL=collectModules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectModules.js","sourceRoot":"","sources":["../../../src/domain/usecase/collectModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAiB,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAyBhE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAa9B,EAAS,EAAE;IACV,MAAM,GAAG,GAAQ;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,OAAO,EACL,IAAI,CAAC,OAAO;YACZ,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CACvB,gBAAgB,CAAC;gBACf,SAAS;gBACT,QAAQ;gBACR,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;aAChC,CAAC,CAAC;KACR,CAAC;IACF,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC/B,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;QACxC,OAAO,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAA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ACH,MAAM,cAAc,GAAG,CACrB,GAAW,EACX,IAAY,EACZ,EAAU,EACF,EAAE,CACV,GAAG;KACA,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC;KAC3B,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC;KACxB,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC;KAC3B,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type External } from "plgg-bundle/domain/model/BundleConfig";
|
|
2
|
-
/**
|
|
3
|
-
* Derive a package's externals from its `package.json`
|
|
4
|
-
* (the declared dependency graph) plus Node builtins —
|
|
5
|
-
* the ruling-B rule, so externals cannot drift from what
|
|
6
|
-
* the manifest says the package depends on. Anything a
|
|
7
|
-
* module imports that is neither the package's own
|
|
8
|
-
* source (self-alias / relative) nor a declared
|
|
9
|
-
* dependency nor `node:*` is an *undeclared* dependency
|
|
10
|
-
* and the graph walk fails loudly rather than silently
|
|
11
|
-
* inlining or externalizing it.
|
|
12
|
-
*
|
|
13
|
-
* Declared = keys of `dependencies` + `peerDependencies`
|
|
14
|
-
* + `optionalDependencies`. A specifier is external when
|
|
15
|
-
* it is a declared dep exactly (`plgg-view`) OR a PUBLIC
|
|
16
|
-
* SUBPATH export of one (`plgg-view/style`,
|
|
17
|
-
* `plgg-server/ssg`) — the consumer resolves the subpath
|
|
18
|
-
* at runtime via the dep's own `exports` map, so a library
|
|
19
|
-
* bundle must never inline it. `node:*` is matched by
|
|
20
|
-
* prefix. An undeclared specifier (neither a dep nor a
|
|
21
|
-
* dep subpath nor `node:*`) still fails the graph walk
|
|
22
|
-
* loudly.
|
|
23
|
-
*/
|
|
24
|
-
export declare const deriveExternal: (root: string) => External;
|
|
25
|
-
//# sourceMappingURL=deriveExternal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deriveExternal.d.ts","sourceRoot":"","sources":["../../../src/domain/usecase/deriveExternal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,KACX,QAQF,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import {} from "plgg-bundle/domain/model/BundleConfig";
|
|
4
|
-
/**
|
|
5
|
-
* Derive a package's externals from its `package.json`
|
|
6
|
-
* (the declared dependency graph) plus Node builtins —
|
|
7
|
-
* the ruling-B rule, so externals cannot drift from what
|
|
8
|
-
* the manifest says the package depends on. Anything a
|
|
9
|
-
* module imports that is neither the package's own
|
|
10
|
-
* source (self-alias / relative) nor a declared
|
|
11
|
-
* dependency nor `node:*` is an *undeclared* dependency
|
|
12
|
-
* and the graph walk fails loudly rather than silently
|
|
13
|
-
* inlining or externalizing it.
|
|
14
|
-
*
|
|
15
|
-
* Declared = keys of `dependencies` + `peerDependencies`
|
|
16
|
-
* + `optionalDependencies`. A specifier is external when
|
|
17
|
-
* it is a declared dep exactly (`plgg-view`) OR a PUBLIC
|
|
18
|
-
* SUBPATH export of one (`plgg-view/style`,
|
|
19
|
-
* `plgg-server/ssg`) — the consumer resolves the subpath
|
|
20
|
-
* at runtime via the dep's own `exports` map, so a library
|
|
21
|
-
* bundle must never inline it. `node:*` is matched by
|
|
22
|
-
* prefix. An undeclared specifier (neither a dep nor a
|
|
23
|
-
* dep subpath nor `node:*`) still fails the graph walk
|
|
24
|
-
* loudly.
|
|
25
|
-
*/
|
|
26
|
-
export const deriveExternal = (root) => {
|
|
27
|
-
const declared = declaredDeps(root);
|
|
28
|
-
return (specifier) => declared.has(specifier) ||
|
|
29
|
-
[...declared].some((dep) => specifier.startsWith(`${dep}/`)) ||
|
|
30
|
-
specifier.startsWith("node:");
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* The set of declared dependency names from a package's
|
|
34
|
-
* `package.json`. Throws (re-thrown with context) if the
|
|
35
|
-
* manifest is missing or unparseable.
|
|
36
|
-
*/
|
|
37
|
-
const declaredDeps = (root) => {
|
|
38
|
-
const path = join(root, "package.json");
|
|
39
|
-
const parsed = parse(path, read(path));
|
|
40
|
-
return new Set([
|
|
41
|
-
...keysOf(parsed, "dependencies"),
|
|
42
|
-
...keysOf(parsed, "peerDependencies"),
|
|
43
|
-
...keysOf(parsed, "optionalDependencies"),
|
|
44
|
-
]);
|
|
45
|
-
};
|
|
46
|
-
const read = (path) => {
|
|
47
|
-
try {
|
|
48
|
-
return readFileSync(path, "utf8");
|
|
49
|
-
}
|
|
50
|
-
catch (cause) {
|
|
51
|
-
throw new Error(`IoError: cannot read ${path}: ${messageOf(cause)}`);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const parse = (path, text) => {
|
|
55
|
-
try {
|
|
56
|
-
return JSON.parse(text);
|
|
57
|
-
}
|
|
58
|
-
catch (cause) {
|
|
59
|
-
throw new Error(`ConfigError: ${path} is not valid JSON: ${messageOf(cause)}`);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* The keys of one dependency map on a parsed
|
|
64
|
-
* package.json, narrowing at the `unknown` boundary.
|
|
65
|
-
*/
|
|
66
|
-
const keysOf = (pkg, field) => {
|
|
67
|
-
if (!isRecord(pkg)) {
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
const map = pkg[field];
|
|
71
|
-
return isRecord(map) ? Object.keys(map) : [];
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Whether a value is a non-null object (records the
|
|
75
|
-
* narrowing for property reads).
|
|
76
|
-
*/
|
|
77
|
-
const isRecord = (v) => typeof v === "object" && v !== null;
|
|
78
|
-
const messageOf = (e) => e instanceof Error ? e.message : String(e);
|
|
79
|
-
//# sourceMappingURL=deriveExternal.js.map
|
|
@@ -1 +0,0 @@
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-
import { test, check, all, toBe, } from "plgg-test";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { mkdtempSync, writeFileSync, } from "node:fs";
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import { deriveExternal } from "plgg-bundle/domain/usecase/deriveExternal";
|
|
6
|
-
import { isExternal } from "plgg-bundle/domain/usecase/isExternal";
|
|
7
|
-
/** True when `deriveExternal(root)` throws an Error. */
|
|
8
|
-
const rejects = (root) => {
|
|
9
|
-
try {
|
|
10
|
-
deriveExternal(root);
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
catch (e) {
|
|
14
|
-
return e instanceof Error;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
/** A temp dir carrying a specific package.json body. */
|
|
18
|
-
const withManifest = (body) => {
|
|
19
|
-
const dir = mkdtempSync(join(tmpdir(), "plgg-derive-"));
|
|
20
|
-
writeFileSync(join(dir, "package.json"), body);
|
|
21
|
-
return dir;
|
|
22
|
-
};
|
|
23
|
-
// plgg-bundle's own root: its package.json declares
|
|
24
|
-
// `typescript` as the sole dependency.
|
|
25
|
-
const root = join(import.meta.dirname, "..", "..", "..");
|
|
26
|
-
const external = deriveExternal(root);
|
|
27
|
-
test("deriveExternal externalizes declared deps and node builtins", () => all([
|
|
28
|
-
check(isExternal(external, "typescript"), toBe(true)),
|
|
29
|
-
check(isExternal(external, "node:fs"), toBe(true)),
|
|
30
|
-
check(isExternal(external, "node:child_process"), toBe(true)),
|
|
31
|
-
]));
|
|
32
|
-
test("deriveExternal externalizes a PUBLIC SUBPATH of a declared dep", () =>
|
|
33
|
-
// `typescript/lib/...` is a subpath of the declared
|
|
34
|
-
// `typescript` dep → external (resolved at runtime via
|
|
35
|
-
// the dep's own exports), mirroring `plgg-server/ssg`.
|
|
36
|
-
check(isExternal(external, "typescript/lib/typescript"), toBe(true)));
|
|
37
|
-
test("deriveExternal does NOT externalize undeclared / own-source specifiers", () => all([
|
|
38
|
-
// plgg is not a dependency of plgg-bundle → not
|
|
39
|
-
// external (an import of it would fail loudly).
|
|
40
|
-
check(isExternal(external, "plgg"), toBe(false)),
|
|
41
|
-
check(isExternal(external, "./resolveSpecifier"), toBe(false)),
|
|
42
|
-
check(isExternal(external, "plgg-bundle/domain/model/BundleConfig"), toBe(false)),
|
|
43
|
-
]));
|
|
44
|
-
test("deriveExternal throws when package.json is missing", () => check(rejects(join(tmpdir(), "plgg-derive-missing-xyz")), toBe(true)));
|
|
45
|
-
test("deriveExternal throws on an unparseable package.json", () => check(rejects(withManifest("{ not valid json")), toBe(true)));
|
|
46
|
-
test("deriveExternal treats a non-object manifest as zero declared deps", () => {
|
|
47
|
-
const ext = deriveExternal(withManifest(`"just a string"`));
|
|
48
|
-
return all([
|
|
49
|
-
// node:* is still external by prefix …
|
|
50
|
-
check(isExternal(ext, "node:fs"), toBe(true)),
|
|
51
|
-
// … but nothing is declared, so any package specifier
|
|
52
|
-
// is undeclared (not external).
|
|
53
|
-
check(isExternal(ext, "whatever"), toBe(false)),
|
|
54
|
-
]);
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=deriveExternal.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deriveExternal.spec.js","sourceRoot":"","sources":["../../../src/domain/usecase/deriveExternal.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE,wDAAwD;AACxD,MAAM,OAAO,GAAG,CAAC,IAAY,EAAW,EAAE;IACxC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E,CAClF,GAAG,CAAC;IACF,gDAAgD;IAChD,gDAAgD;IAChD,KAAK,CACH,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC5B,IAAI,CAAC,KAAK,CAAC,CACZ;IACD,KAAK,CACH,UAAU,CAAC,QAAQ,EAAE,oBAAoB,CAAC,EAC1C,IAAI,CAAC,KAAK,CAAC,CACZ;IACD,KAAK,CACH,UAAU,CACR,QAAQ,EACR,uCAAuC,CACxC,EACD,IAAI,CAAC,KAAK,CAAC,CACZ;CACF,CAAC,CAAC,CAAC;AAEN,IAAI,CAAC,oDAAoD,EAAE,GAAG,EAAE,CAC9D,KAAK,CACH,OAAO,CACL,IAAI,CAAC,MAAM,EAAE,EAAE,yBAAyB,CAAC,CAC1C,EACD,IAAI,CAAC,IAAI,CAAC,CACX,CAAC,CAAC;AAEL,IAAI,CAAC,sDAAsD,EAAE,GAAG,EAAE,CAChE,KAAK,CACH,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,EACzC,IAAI,CAAC,IAAI,CAAC,CACX,CAAC,CAAC;AAEL,IAAI,CAAC,mEAAmE,EAAE,GAAG,EAAE;IAC7E,MAAM,GAAG,GAAG,cAAc,CACxB,YAAY,CAAC,iBAAiB,CAAC,CAChC,CAAC;IACF,OAAO,GAAG,CAAC;QACT,uCAAuC;QACvC,KAAK,CACH,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,EAC1B,IAAI,CAAC,IAAI,CAAC,CACX;QACD,sDAAsD;QACtD,gCAAgC;QAChC,KAAK,CACH,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,EAC3B,IAAI,CAAC,KAAK,CAAC,CACZ;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A workspace sibling the app bundler can INLINE from
|
|
3
|
-
* source: its package `name`, its `dir`, and the map from
|
|
4
|
-
* each public export subpath (`"."`, `"./client"`, …) to
|
|
5
|
-
* the `import.default` dist path declared in its
|
|
6
|
-
* `package.json` `exports`. The app resolver reverses
|
|
7
|
-
* that dist path to the entry's source file (so the
|
|
8
|
-
* `./style` → `dist/styleEntry.es.js` → `src/styleEntry`
|
|
9
|
-
* rename is honoured), and falls back to a self-alias
|
|
10
|
-
* `name/<path>` → `src/<path>` for non-export internal
|
|
11
|
-
* imports.
|
|
12
|
-
*/
|
|
13
|
-
export type WorkspacePackage = Readonly<{
|
|
14
|
-
name: string;
|
|
15
|
-
dir: string;
|
|
16
|
-
/** export subpath (`"."` | `"./x"`) → dist default. */
|
|
17
|
-
exports: ReadonlyMap<string, string>;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Discover every sibling package under the directory that
|
|
21
|
-
* holds `packageRoot` (the monorepo `packages/` dir) —
|
|
22
|
-
* each entry that has a `package.json` with a `name`.
|
|
23
|
-
* Sorted longest-name-first so a later prefix match picks
|
|
24
|
-
* `plgg-view` over `plgg`. Throws on a read/parse failure.
|
|
25
|
-
*/
|
|
26
|
-
export declare const discoverWorkspace: (packageRoot: string) => ReadonlyArray<WorkspacePackage>;
|
|
27
|
-
//# sourceMappingURL=discoverWorkspace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discoverWorkspace.d.ts","sourceRoot":"","sources":["../../../src/domain/usecase/discoverWorkspace.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,KAClB,aAAa,CAAC,gBAAgB,CAUhC,CAAC"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { readdirSync, readFileSync, existsSync, statSync, } from "node:fs";
|
|
2
|
-
import { join, dirname } from "node:path";
|
|
3
|
-
/**
|
|
4
|
-
* Discover every sibling package under the directory that
|
|
5
|
-
* holds `packageRoot` (the monorepo `packages/` dir) —
|
|
6
|
-
* each entry that has a `package.json` with a `name`.
|
|
7
|
-
* Sorted longest-name-first so a later prefix match picks
|
|
8
|
-
* `plgg-view` over `plgg`. Throws on a read/parse failure.
|
|
9
|
-
*/
|
|
10
|
-
export const discoverWorkspace = (packageRoot) => {
|
|
11
|
-
const siblingsDir = dirname(packageRoot);
|
|
12
|
-
return readdirSync(siblingsDir)
|
|
13
|
-
.map((name) => join(siblingsDir, name))
|
|
14
|
-
.filter(isPackageDir)
|
|
15
|
-
.map(readPackage)
|
|
16
|
-
.flatMap((p) => (p === undefined ? [] : [p]))
|
|
17
|
-
.sort((a, b) => b.name.length - a.name.length);
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Whether a path is a directory holding a
|
|
21
|
-
* `package.json`.
|
|
22
|
-
*/
|
|
23
|
-
const isPackageDir = (dir) => statSync(dir).isDirectory() &&
|
|
24
|
-
existsSync(join(dir, "package.json"));
|
|
25
|
-
/**
|
|
26
|
-
* Read one package's manifest into a
|
|
27
|
-
* {@link WorkspacePackage}, or `undefined` when it
|
|
28
|
-
* declares no `name`. Throws on unreadable/invalid JSON.
|
|
29
|
-
*/
|
|
30
|
-
const readPackage = (dir) => {
|
|
31
|
-
const pkg = parseJson(join(dir, "package.json"));
|
|
32
|
-
const name = pkg["name"];
|
|
33
|
-
return typeof name === "string"
|
|
34
|
-
? { name, dir, exports: exportMap(pkg) }
|
|
35
|
-
: undefined;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Parse a `package.json`, re-throwing with context.
|
|
39
|
-
*/
|
|
40
|
-
const parseJson = (path) => {
|
|
41
|
-
try {
|
|
42
|
-
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
43
|
-
return isRecord(parsed) ? parsed : {};
|
|
44
|
-
}
|
|
45
|
-
catch (cause) {
|
|
46
|
-
throw new Error(`WorkspaceError: cannot read ${path}: ${cause instanceof Error
|
|
47
|
-
? cause.message
|
|
48
|
-
: String(cause)}`);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Build the subpath → dist-default map from an `exports`
|
|
53
|
-
* field, tolerating both shapes used in the repo:
|
|
54
|
-
* - a subpath map (`{ ".": …, "./client": … }`), and
|
|
55
|
-
* - a bare conditions object (`{ import: …, require: … }`)
|
|
56
|
-
* which IS the `"."` export.
|
|
57
|
-
*/
|
|
58
|
-
const exportMap = (pkg) => {
|
|
59
|
-
const exports = pkg["exports"];
|
|
60
|
-
const out = new Map();
|
|
61
|
-
if (!isRecord(exports)) {
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
if (isSubpathMap(exports)) {
|
|
65
|
-
for (const [key, val] of Object.entries(exports)) {
|
|
66
|
-
const def = conditionDefault(val);
|
|
67
|
-
if (def !== undefined) {
|
|
68
|
-
out.set(key, def);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return out;
|
|
72
|
-
}
|
|
73
|
-
const def = conditionDefault(exports);
|
|
74
|
-
if (def !== undefined) {
|
|
75
|
-
out.set(".", def);
|
|
76
|
-
}
|
|
77
|
-
return out;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Whether an `exports` object is a subpath map (its keys
|
|
81
|
-
* are `.`/`./…` paths) rather than a bare conditions
|
|
82
|
-
* object (keys like `import`/`require`).
|
|
83
|
-
*/
|
|
84
|
-
const isSubpathMap = (exports) => Object.keys(exports).some((k) => k.startsWith("."));
|
|
85
|
-
/**
|
|
86
|
-
* Extract the resolved default file from a conditions
|
|
87
|
-
* object: the `import` (or `require`) branch's `default`,
|
|
88
|
-
* or a directly-stringed condition. Returns `undefined`
|
|
89
|
-
* when none is present.
|
|
90
|
-
*/
|
|
91
|
-
const conditionDefault = (conditions) => {
|
|
92
|
-
if (typeof conditions === "string") {
|
|
93
|
-
return conditions;
|
|
94
|
-
}
|
|
95
|
-
if (!isRecord(conditions)) {
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
return (branchDefault(conditions["import"]) ??
|
|
99
|
-
branchDefault(conditions["require"]) ??
|
|
100
|
-
branchDefault(conditions["default"]));
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* The `default` of one condition branch, where the branch
|
|
104
|
-
* is either a string or a `{ types, default }` object.
|
|
105
|
-
*/
|
|
106
|
-
const branchDefault = (branch) => typeof branch === "string"
|
|
107
|
-
? branch
|
|
108
|
-
: isRecord(branch) &&
|
|
109
|
-
typeof branch["default"] === "string"
|
|
110
|
-
? branch["default"]
|
|
111
|
-
: undefined;
|
|
112
|
-
/**
|
|
113
|
-
* Whether a value is a non-null object.
|
|
114
|
-
*/
|
|
115
|
-
const isRecord = (v) => typeof v === "object" && v !== null;
|
|
116
|
-
//# sourceMappingURL=discoverWorkspace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discoverWorkspace.js","sourceRoot":"","sources":["../../../src/domain/usecase/discoverWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqB1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,WAAmB,EACc,EAAE;IACnC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACzC,OAAO,WAAW,CAAC,WAAW,CAAC;SAC5B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;SACtC,MAAM,CAAC,YAAY,CAAC;SACpB,GAAG,CAAC,WAAW,CAAC;SAChB,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AAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,CACL,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACnC,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QACpC,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,aAAa,GAAG,CACpB,MAAe,EACK,EAAE,CACtB,OAAO,MAAM,KAAK,QAAQ;IACxB,CAAC,CAAC,MAAM;IACR,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;QACd,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,QAAQ;QACvC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;QACnB,CAAC,CAAC,SAAS,CAAC;AAElB;;GAEG;AACH,MAAM,QAAQ,GAAG,CACf,CAAU,EACoB,EAAE,CAChC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discoverWorkspace.spec.d.ts","sourceRoot":"","sources":["../../../src/domain/usecase/discoverWorkspace.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { test, check, all, toBe, } from "plgg-test";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { discoverWorkspace } from "plgg-bundle/domain/usecase/discoverWorkspace";
|
|
4
|
-
// Run against the real monorepo: this package's root is
|
|
5
|
-
// `packages/plgg-bundle`, so discovery scans `packages/*`.
|
|
6
|
-
const bundleRoot = join(import.meta.dirname, "..", "..", "..");
|
|
7
|
-
const packages = discoverWorkspace(bundleRoot);
|
|
8
|
-
const byName = (name) => packages.find((p) => p.name === name);
|
|
9
|
-
test("discoverWorkspace finds sibling packages", () => all([
|
|
10
|
-
check(byName("plgg") !== undefined, toBe(true)),
|
|
11
|
-
check(byName("plgg-view") !== undefined, toBe(true)),
|
|
12
|
-
]));
|
|
13
|
-
test("discoverWorkspace reads the conditions-only '.' export (plgg)", () => check(byName("plgg")?.exports.get("."), toBe("./dist/index.es.js")));
|
|
14
|
-
test("discoverWorkspace reads a subpath export incl. the styleEntry rename", () => all([
|
|
15
|
-
check(byName("plgg-view")?.exports.get("./client"), toBe("./dist/client.es.js")),
|
|
16
|
-
check(byName("plgg-view")?.exports.get("./style"), toBe("./dist/styleEntry.es.js")),
|
|
17
|
-
]));
|
|
18
|
-
test("discoverWorkspace sorts longest-name first (so plgg-view beats plgg)", () => {
|
|
19
|
-
const iView = packages.findIndex((p) => p.name === "plgg-view");
|
|
20
|
-
const iCore = packages.findIndex((p) => p.name === "plgg");
|
|
21
|
-
return check(iView < iCore, toBe(true));
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=discoverWorkspace.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discoverWorkspace.spec.js","sourceRoot":"","sources":["../../../src/domain/usecase/discoverWorkspace.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,wDAAwD;AACxD,2DAA2D;AAC3D,MAAM,UAAU,GAAG,IAAI,CACrB,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;AAEF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC/C,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAC9B,QAAQ,CAAC,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AAC,CAAC,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { type Format } from "plgg-bundle/domain/model/BundleConfig";
|
|
2
|
-
import { type Graph } from "plgg-bundle/domain/usecase/collectModules";
|
|
3
|
-
/**
|
|
4
|
-
* Render a resolved {@link Graph} into one bundle's
|
|
5
|
-
* source text for the given {@link Format}, using an
|
|
6
|
-
* in-house module-registry runtime: every module body
|
|
7
|
-
* is wrapped in its own `(module, exports, require)`
|
|
8
|
-
* closure keyed by id, and a cached `__require` links
|
|
9
|
-
* them at runtime. This is collision-free by
|
|
10
|
-
* construction (each module keeps its own scope), so it
|
|
11
|
-
* needs none of rolldown's scope-hoisting/renaming and
|
|
12
|
-
* stays pure JS.
|
|
13
|
-
*
|
|
14
|
-
* Externals (specifiers left out of the bundle —
|
|
15
|
-
* `node:*`, sibling `plgg*` packages, …) are handled
|
|
16
|
-
* per format:
|
|
17
|
-
* - CJS: an un-rewritten `require("<external>")` in a
|
|
18
|
-
* module body falls through the registry to the host
|
|
19
|
-
* `require`.
|
|
20
|
-
* - ESM: there is no host `require`, so the bundle emits
|
|
21
|
-
* a real top-level `import * as __extN from
|
|
22
|
-
* "<external>"` for each distinct external and the
|
|
23
|
-
* registry routes `__require("<external>")` to that
|
|
24
|
-
* namespace.
|
|
25
|
-
*/
|
|
26
|
-
export declare const emitCjsBundle: (graph: Graph) => string;
|
|
27
|
-
/**
|
|
28
|
-
* ESM bundle. `exportNames` is the exact public surface
|
|
29
|
-
* (the entry's enumerable export keys), supplied by the
|
|
30
|
-
* orchestrator from the CJS bundle's runtime keys —
|
|
31
|
-
* ESM cannot declare exports dynamically. Externals are
|
|
32
|
-
* imported as namespaces at the top and resolved by the
|
|
33
|
-
* registry; an id that is neither a bundled module nor a
|
|
34
|
-
* declared external falls back to a native dynamic
|
|
35
|
-
* `import(id)` (see {@link externalFallback}).
|
|
36
|
-
*/
|
|
37
|
-
export declare const emitEsmBundle: (graph: Graph, exportNames: ReadonlyArray<string>) => string;
|
|
38
|
-
/**
|
|
39
|
-
* Dispatch on format for callers that hold the names
|
|
40
|
-
* regardless.
|
|
41
|
-
*/
|
|
42
|
-
export declare const emitBundle: (graph: Graph, format: Format, exportNames: ReadonlyArray<string>) => string;
|
|
43
|
-
//# sourceMappingURL=emitBundle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emitBundle.d.ts","sourceRoot":"","sources":["../../../src/domain/usecase/emitBundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EACL,KAAK,KAAK,EAEX,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,KAAK,KACX,MAOW,CAAC;AAEf;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,KAAK,EACZ,aAAa,aAAa,CAAC,MAAM,CAAC,KACjC,MAYF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,EACZ,QAAQ,MAAM,EACd,aAAa,aAAa,CAAC,MAAM,CAAC,KACjC,MAGuB,CAAC"}
|