@embroider/core 4.6.6 → 4.6.8
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 +5 -5
- package/dist/src/app-files.d.ts +0 -34
- package/dist/src/app-files.d.ts.map +0 -1
- package/dist/src/app-files.js +0 -201
- package/dist/src/app-files.js.map +0 -1
- package/dist/src/describe-exports.d.ts +0 -5
- package/dist/src/describe-exports.d.ts.map +0 -1
- package/dist/src/describe-exports.js +0 -52
- package/dist/src/describe-exports.js.map +0 -1
- package/dist/src/html-entrypoint.d.ts +0 -23
- package/dist/src/html-entrypoint.d.ts.map +0 -1
- package/dist/src/html-entrypoint.js +0 -185
- package/dist/src/html-entrypoint.js.map +0 -1
- package/dist/src/html-placeholder.d.ts +0 -40
- package/dist/src/html-placeholder.d.ts.map +0 -1
- package/dist/src/html-placeholder.js +0 -130
- package/dist/src/html-placeholder.js.map +0 -1
- package/dist/src/index.d.ts +0 -15
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -50
- package/dist/src/index.js.map +0 -1
- package/dist/src/js-handlebars.d.ts +0 -2
- package/dist/src/js-handlebars.d.ts.map +0 -1
- package/dist/src/js-handlebars.js +0 -20
- package/dist/src/js-handlebars.js.map +0 -1
- package/dist/src/measure-concat.d.ts +0 -14
- package/dist/src/measure-concat.d.ts.map +0 -1
- package/dist/src/measure-concat.js +0 -33
- package/dist/src/measure-concat.js.map +0 -1
- package/dist/src/messages.d.ts +0 -9
- package/dist/src/messages.d.ts.map +0 -1
- package/dist/src/messages.js +0 -74
- package/dist/src/messages.js.map +0 -1
- package/dist/src/module-request.d.ts +0 -45
- package/dist/src/module-request.d.ts.map +0 -1
- package/dist/src/module-request.js +0 -87
- package/dist/src/module-request.js.map +0 -1
- package/dist/src/module-resolver-options.d.ts +0 -43
- package/dist/src/module-resolver-options.d.ts.map +0 -1
- package/dist/src/module-resolver-options.js +0 -155
- package/dist/src/module-resolver-options.js.map +0 -1
- package/dist/src/module-resolver.d.ts +0 -71
- package/dist/src/module-resolver.d.ts.map +0 -1
- package/dist/src/module-resolver.js +0 -1167
- package/dist/src/module-resolver.js.map +0 -1
- package/dist/src/node-resolve.d.ts +0 -36
- package/dist/src/node-resolve.d.ts.map +0 -1
- package/dist/src/node-resolve.js +0 -134
- package/dist/src/node-resolve.js.map +0 -1
- package/dist/src/options.d.ts +0 -26
- package/dist/src/options.d.ts.map +0 -1
- package/dist/src/options.js +0 -26
- package/dist/src/options.js.map +0 -1
- package/dist/src/packager.d.ts +0 -20
- package/dist/src/packager.d.ts.map +0 -1
- package/dist/src/packager.js +0 -34
- package/dist/src/packager.js.map +0 -1
- package/dist/src/portable.d.ts +0 -26
- package/dist/src/portable.d.ts.map +0 -1
- package/dist/src/portable.js +0 -231
- package/dist/src/portable.js.map +0 -1
- package/dist/src/resolvable-extensions.d.ts +0 -2
- package/dist/src/resolvable-extensions.d.ts.map +0 -1
- package/dist/src/resolvable-extensions.js +0 -13
- package/dist/src/resolvable-extensions.js.map +0 -1
- package/dist/src/resolver-loader.d.ts +0 -9
- package/dist/src/resolver-loader.d.ts.map +0 -1
- package/dist/src/resolver-loader.js +0 -54
- package/dist/src/resolver-loader.js.map +0 -1
- package/dist/src/stage.d.ts +0 -9
- package/dist/src/stage.d.ts.map +0 -1
- package/dist/src/stage.js +0 -3
- package/dist/src/stage.js.map +0 -1
- package/dist/src/virtual-content.d.ts +0 -36
- package/dist/src/virtual-content.d.ts.map +0 -1
- package/dist/src/virtual-content.js +0 -232
- package/dist/src/virtual-content.js.map +0 -1
- package/dist/src/virtual-entrypoint.d.ts +0 -22
- package/dist/src/virtual-entrypoint.d.ts.map +0 -1
- package/dist/src/virtual-entrypoint.js +0 -280
- package/dist/src/virtual-entrypoint.js.map +0 -1
- package/dist/src/virtual-route-entrypoint.d.ts +0 -11
- package/dist/src/virtual-route-entrypoint.d.ts.map +0 -1
- package/dist/src/virtual-route-entrypoint.js +0 -68
- package/dist/src/virtual-route-entrypoint.js.map +0 -1
- package/dist/src/virtual-test-support-styles.d.ts +0 -8
- package/dist/src/virtual-test-support-styles.d.ts.map +0 -1
- package/dist/src/virtual-test-support-styles.js +0 -61
- package/dist/src/virtual-test-support-styles.js.map +0 -1
- package/dist/src/virtual-test-support.d.ts +0 -8
- package/dist/src/virtual-test-support.d.ts.map +0 -1
- package/dist/src/virtual-test-support.js +0 -65
- package/dist/src/virtual-test-support.js.map +0 -1
- package/dist/src/virtual-vendor-styles.d.ts +0 -9
- package/dist/src/virtual-vendor-styles.d.ts.map +0 -1
- package/dist/src/virtual-vendor-styles.js +0 -84
- package/dist/src/virtual-vendor-styles.js.map +0 -1
- package/dist/src/virtual-vendor.d.ts +0 -8
- package/dist/src/virtual-vendor.d.ts.map +0 -1
- package/dist/src/virtual-vendor.js +0 -55
- package/dist/src/virtual-vendor.js.map +0 -1
- package/dist/src/wait-for-trees.d.ts +0 -14
- package/dist/src/wait-for-trees.d.ts.map +0 -1
- package/dist/src/wait-for-trees.js +0 -98
- package/dist/src/wait-for-trees.js.map +0 -1
- package/dist/tests/babel-debug-util.d.ts +0 -2
- package/dist/tests/babel-debug-util.d.ts.map +0 -1
- package/dist/tests/babel-debug-util.js +0 -36
- package/dist/tests/babel-debug-util.js.map +0 -1
- package/dist/tests/example-target.d.ts +0 -3
- package/dist/tests/example-target.d.ts.map +0 -1
- package/dist/tests/example-target.js +0 -10
- package/dist/tests/example-target.js.map +0 -1
- package/dist/tests/portable.test.d.ts +0 -2
- package/dist/tests/portable.test.d.ts.map +0 -1
- package/dist/tests/portable.test.js +0 -14
- package/dist/tests/portable.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export declare function makeTag(document: Document, options: {
|
|
2
|
-
from: HTMLElement;
|
|
3
|
-
tag?: string;
|
|
4
|
-
attributes?: {
|
|
5
|
-
[name: string]: string | null;
|
|
6
|
-
};
|
|
7
|
-
}): HTMLElement;
|
|
8
|
-
export declare function makeTag(document: Document, options: {
|
|
9
|
-
from?: HTMLElement;
|
|
10
|
-
tag: string;
|
|
11
|
-
attributes?: {
|
|
12
|
-
[name: string]: string | null;
|
|
13
|
-
};
|
|
14
|
-
}): HTMLElement;
|
|
15
|
-
export declare function normalizeScriptTag(tag: HTMLElement): void;
|
|
16
|
-
export declare function normalizeStyleLink(tag: HTMLElement): void;
|
|
17
|
-
export default class Placeholder {
|
|
18
|
-
private target;
|
|
19
|
-
end: InDOMNode;
|
|
20
|
-
start: StartNode;
|
|
21
|
-
constructor(target: HTMLElement);
|
|
22
|
-
reset(): void;
|
|
23
|
-
clear(): void;
|
|
24
|
-
insert(node: Node): void;
|
|
25
|
-
appendToHead(node: Node): void;
|
|
26
|
-
isScript(): boolean;
|
|
27
|
-
insertURL(url: string): void | HTMLElement;
|
|
28
|
-
insertScriptTag(src: string): HTMLElement;
|
|
29
|
-
insertStyleLink(href: string): void;
|
|
30
|
-
insertNewline(node?: InDOMNode): void;
|
|
31
|
-
}
|
|
32
|
-
interface InDOMNode extends Node {
|
|
33
|
-
parentElement: HTMLElement;
|
|
34
|
-
ownerDocument: Document;
|
|
35
|
-
}
|
|
36
|
-
interface StartNode extends InDOMNode {
|
|
37
|
-
nextSibling: InDOMNode & ChildNode;
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
40
|
-
//# sourceMappingURL=html-placeholder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-placeholder.d.ts","sourceRoot":"","sources":["../../src/html-placeholder.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CAAE,GAC3F,WAAW,CAAC;AACf,wBAAgB,OAAO,CACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CAAE,GAC3F,WAAW,CAAC;AAsCf,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAKzD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAQzD;AAED,MAAM,CAAC,OAAO,OAAO,WAAW;IAMlB,OAAO,CAAC,MAAM;IAL1B,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;gBAIG,MAAM,EAAE,WAAW;IAiBvC,KAAK;IAKL,KAAK;IAML,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAIxB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAI9B,QAAQ,IAAI,OAAO;IAInB,SAAS,CAAC,GAAG,EAAE,MAAM;IAUrB,eAAe,CAAC,GAAG,EAAE,MAAM;IAS3B,eAAe,CAAC,IAAI,EAAE,MAAM;IAsB5B,aAAa,CAAC,IAAI,GAAE,SAAoB,GAAG,IAAI;CAGhD;AAGD,UAAU,SAAU,SAAQ,IAAI;IAC9B,aAAa,EAAE,WAAW,CAAC;IAC3B,aAAa,EAAE,QAAQ,CAAC;CACzB;AAGD,UAAU,SAAU,SAAQ,SAAS;IACnC,WAAW,EAAE,SAAS,GAAG,SAAS,CAAC;CACpC"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeTag = makeTag;
|
|
4
|
-
exports.normalizeScriptTag = normalizeScriptTag;
|
|
5
|
-
exports.normalizeStyleLink = normalizeStyleLink;
|
|
6
|
-
function makeTag(document, { from, tag, attributes } = {}) {
|
|
7
|
-
if (!tag && from) {
|
|
8
|
-
tag = from.tagName;
|
|
9
|
-
}
|
|
10
|
-
if (!tag) {
|
|
11
|
-
throw new Error('Must supply one of `options.from` or `options.tag`');
|
|
12
|
-
}
|
|
13
|
-
let cloned = document.createElement(tag);
|
|
14
|
-
let overrides = new Map(Object.entries(attributes ?? {}));
|
|
15
|
-
if (from) {
|
|
16
|
-
for (let { name, value: originalValue } of from.attributes) {
|
|
17
|
-
let value = overrides.has(name) ? overrides.get(name) : originalValue;
|
|
18
|
-
overrides.delete(name);
|
|
19
|
-
if (value === null) {
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
cloned.setAttribute(name, value);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
for (let [name, value] of overrides) {
|
|
28
|
-
if (value !== null) {
|
|
29
|
-
cloned.setAttribute(name, value);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return cloned;
|
|
33
|
-
}
|
|
34
|
-
function normalizeScriptTag(tag) {
|
|
35
|
-
if (tag.getAttribute('type') === 'module') {
|
|
36
|
-
// we always convert modules to scripts, dropping
|
|
37
|
-
tag.removeAttribute('type');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function normalizeStyleLink(tag) {
|
|
41
|
-
let rel = tag.getAttribute('rel');
|
|
42
|
-
if (rel === null) {
|
|
43
|
-
tag.setAttribute('rel', 'stylesheet');
|
|
44
|
-
}
|
|
45
|
-
else if (!rel.includes('stylesheet')) {
|
|
46
|
-
tag.setAttribute('rel', `${rel} stylesheet`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
class Placeholder {
|
|
50
|
-
target;
|
|
51
|
-
end;
|
|
52
|
-
start;
|
|
53
|
-
// remove the target Element from the DOM, and track where it was so we can
|
|
54
|
-
// update that location later.
|
|
55
|
-
constructor(target) {
|
|
56
|
-
this.target = target;
|
|
57
|
-
if (!target.ownerDocument || !target.parentElement) {
|
|
58
|
-
throw new Error('can only construct a placeholder for an element that is in DOM');
|
|
59
|
-
}
|
|
60
|
-
let start = target.ownerDocument.createTextNode('');
|
|
61
|
-
target.parentElement.insertBefore(start, target);
|
|
62
|
-
let endNode = target.ownerDocument.createTextNode('');
|
|
63
|
-
target.replaceWith(endNode);
|
|
64
|
-
// Type cast is justified because start always has a nextSibling (it's
|
|
65
|
-
// "end") and because we know we already inserted the node.
|
|
66
|
-
this.start = start;
|
|
67
|
-
// Type cast is justified because we know we already inserted the node.
|
|
68
|
-
this.end = endNode;
|
|
69
|
-
}
|
|
70
|
-
reset() {
|
|
71
|
-
this.clear();
|
|
72
|
-
this.insert(this.target);
|
|
73
|
-
}
|
|
74
|
-
clear() {
|
|
75
|
-
while (this.start.nextSibling !== this.end) {
|
|
76
|
-
this.start.parentElement.removeChild(this.start.nextSibling);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
insert(node) {
|
|
80
|
-
this.end.parentElement.insertBefore(node, this.end);
|
|
81
|
-
}
|
|
82
|
-
appendToHead(node) {
|
|
83
|
-
this.end.ownerDocument.head.appendChild(node);
|
|
84
|
-
}
|
|
85
|
-
isScript() {
|
|
86
|
-
return this.target.tagName === 'SCRIPT';
|
|
87
|
-
}
|
|
88
|
-
insertURL(url) {
|
|
89
|
-
if (url.endsWith('.js')) {
|
|
90
|
-
return this.insertScriptTag(url);
|
|
91
|
-
}
|
|
92
|
-
if (url.endsWith('.css')) {
|
|
93
|
-
return this.insertStyleLink(url);
|
|
94
|
-
}
|
|
95
|
-
throw new Error(`don't know how to insertURL ${url}`);
|
|
96
|
-
}
|
|
97
|
-
insertScriptTag(src) {
|
|
98
|
-
let newTag = makeTag(this.end.ownerDocument, { from: this.target, attributes: { src } });
|
|
99
|
-
normalizeScriptTag(newTag);
|
|
100
|
-
this.insert(newTag);
|
|
101
|
-
this.insertNewline();
|
|
102
|
-
return newTag;
|
|
103
|
-
}
|
|
104
|
-
insertStyleLink(href) {
|
|
105
|
-
let newTag;
|
|
106
|
-
if (this.isScript()) {
|
|
107
|
-
// Add dynamic styles from scripts to the bottom of the head, and not to where the script was,
|
|
108
|
-
// to prevent FOUC when pre-rendering (FastBoot)
|
|
109
|
-
newTag = makeTag(this.end.ownerDocument, {
|
|
110
|
-
from: this.target,
|
|
111
|
-
tag: 'link',
|
|
112
|
-
attributes: { href, type: null, src: null },
|
|
113
|
-
});
|
|
114
|
-
normalizeStyleLink(newTag);
|
|
115
|
-
this.appendToHead(newTag);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
// Keep the new style in the same place as the original one
|
|
119
|
-
newTag = makeTag(this.end.ownerDocument, { from: this.target, attributes: { href } });
|
|
120
|
-
normalizeStyleLink(newTag);
|
|
121
|
-
this.insert(newTag);
|
|
122
|
-
}
|
|
123
|
-
this.insertNewline(newTag);
|
|
124
|
-
}
|
|
125
|
-
insertNewline(node = this.end) {
|
|
126
|
-
node.parentElement.insertBefore(node.ownerDocument.createTextNode('\n'), node);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
exports.default = Placeholder;
|
|
130
|
-
//# sourceMappingURL=html-placeholder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-placeholder.js","sourceRoot":"","sources":["../../src/html-placeholder.ts"],"names":[],"mappings":";;AAQA,0BAmCC;AAED,gDAKC;AAED,gDAQC;AApDD,SAAgB,OAAO,CACrB,QAAkB,EAClB,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,KAA2F,EAAE;IAEpH,IAAI,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACjB,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,G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AI,CAAC,MAAM;gBACjB,GAAG,EAAE,MAAM;gBACX,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;aAC5C,CAAC,CAAC;YACH,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAC3B,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,2DAA2D;YAC3D,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YACtF,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,MAAmB,CAAC,CAAC;IAC1C,CAAC;IAED,aAAa,CAAC,OAAkB,IAAI,CAAC,GAAG;QACtC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACjF,CAAC;CACF;AA1FD,8BA0FC","sourcesContent":["export function makeTag(\n document: Document,\n options: { from: HTMLElement; tag?: string; attributes?: { [name: string]: string | null } }\n): HTMLElement;\nexport function makeTag(\n document: Document,\n options: { from?: HTMLElement; tag: string; attributes?: { [name: string]: string | null } }\n): HTMLElement;\nexport function makeTag(\n document: Document,\n { from, tag, attributes }: { from?: HTMLElement; tag?: string; attributes?: { [name: string]: string | null } } = {}\n): HTMLElement {\n if (!tag && from) {\n tag = from.tagName;\n }\n\n if (!tag) {\n throw new Error('Must supply one of `options.from` or `options.tag`');\n }\n\n let cloned = document.createElement(tag);\n let overrides = new Map(Object.entries(attributes ?? {}));\n\n if (from) {\n for (let { name, value: originalValue } of from.attributes) {\n let value = overrides.has(name) ? overrides.get(name)! : originalValue;\n overrides.delete(name);\n\n if (value === null) {\n continue;\n } else {\n cloned.setAttribute(name, value);\n }\n }\n }\n\n for (let [name, value] of overrides) {\n if (value !== null) {\n cloned.setAttribute(name, value);\n }\n }\n\n return cloned;\n}\n\nexport function normalizeScriptTag(tag: HTMLElement): void {\n if (tag.getAttribute('type') === 'module') {\n // we always convert modules to scripts, dropping\n tag.removeAttribute('type');\n }\n}\n\nexport function normalizeStyleLink(tag: HTMLElement): void {\n let rel = tag.getAttribute('rel');\n\n if (rel === null) {\n tag.setAttribute('rel', 'stylesheet');\n } else if (!rel.includes('stylesheet')) {\n tag.setAttribute('rel', `${rel} stylesheet`);\n }\n}\n\nexport default class Placeholder {\n end: InDOMNode;\n start: StartNode;\n\n // remove the target Element from the DOM, and track where it was so we can\n // update that location later.\n constructor(private target: HTMLElement) {\n if (!target.ownerDocument || !target.parentElement) {\n throw new Error('can only construct a placeholder for an element that is in DOM');\n }\n let start = target.ownerDocument.createTextNode('');\n target.parentElement.insertBefore(start, target);\n let endNode = target.ownerDocument.createTextNode('');\n target.replaceWith(endNode);\n\n // Type cast is justified because start always has a nextSibling (it's\n // \"end\") and because we know we already inserted the node.\n this.start = start as StartNode;\n\n // Type cast is justified because we know we already inserted the node.\n this.end = endNode as InDOMNode;\n }\n\n reset() {\n this.clear();\n this.insert(this.target);\n }\n\n clear() {\n while (this.start.nextSibling !== this.end) {\n this.start.parentElement.removeChild(this.start.nextSibling);\n }\n }\n\n insert(node: Node): void {\n this.end.parentElement.insertBefore(node, this.end);\n }\n\n appendToHead(node: Node): void {\n this.end.ownerDocument.head.appendChild(node);\n }\n\n isScript(): boolean {\n return this.target.tagName === 'SCRIPT';\n }\n\n insertURL(url: string) {\n if (url.endsWith('.js')) {\n return this.insertScriptTag(url);\n }\n if (url.endsWith('.css')) {\n return this.insertStyleLink(url);\n }\n throw new Error(`don't know how to insertURL ${url}`);\n }\n\n insertScriptTag(src: string) {\n let newTag = makeTag(this.end.ownerDocument, { from: this.target, attributes: { src } });\n normalizeScriptTag(newTag);\n\n this.insert(newTag);\n this.insertNewline();\n return newTag;\n }\n\n insertStyleLink(href: string) {\n let newTag: HTMLElement;\n\n if (this.isScript()) {\n // Add dynamic styles from scripts to the bottom of the head, and not to where the script was,\n // to prevent FOUC when pre-rendering (FastBoot)\n newTag = makeTag(this.end.ownerDocument, {\n from: this.target,\n tag: 'link',\n attributes: { href, type: null, src: null },\n });\n normalizeStyleLink(newTag);\n this.appendToHead(newTag);\n } else {\n // Keep the new style in the same place as the original one\n newTag = makeTag(this.end.ownerDocument, { from: this.target, attributes: { href } });\n normalizeStyleLink(newTag);\n this.insert(newTag);\n }\n this.insertNewline(newTag as InDOMNode);\n }\n\n insertNewline(node: InDOMNode = this.end): void {\n node.parentElement.insertBefore(node.ownerDocument.createTextNode('\\n'), node);\n }\n}\n\n// an html node that's definitely inserted into the DOM\ninterface InDOMNode extends Node {\n parentElement: HTMLElement;\n ownerDocument: Document;\n}\n\n// an html node that definitely has a next sibling.\ninterface StartNode extends InDOMNode {\n nextSibling: InDOMNode & ChildNode;\n}\n"]}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { Packager, PackagerConstructor, Variant, applyVariantToBabelConfig, getPackagerCacheDir } from './packager';
|
|
2
|
-
export { HTMLEntrypoint, BundleSummary } from './html-entrypoint';
|
|
3
|
-
export { default as Stage } from './stage';
|
|
4
|
-
export { default as Options, optionsWithDefaults } from './options';
|
|
5
|
-
export { default as WaitForTrees, OutputPaths } from './wait-for-trees';
|
|
6
|
-
export { compile as jsHandlebarsCompile } from './js-handlebars';
|
|
7
|
-
export { todo, unsupported, warn, debug, expectWarning, throwOnWarnings } from './messages';
|
|
8
|
-
export { Resolver } from './module-resolver';
|
|
9
|
-
export { ModuleRequest, type Resolution, type RequestAdapter, type RequestAdapterCreate } from './module-request';
|
|
10
|
-
export type { Options as ResolverOptions } from './module-resolver-options';
|
|
11
|
-
export { ResolverLoader } from './resolver-loader';
|
|
12
|
-
export { virtualContent, type VirtualResponse } from './virtual-content';
|
|
13
|
-
export type { Engine } from './app-files';
|
|
14
|
-
export * from '@embroider/shared-internals';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACpH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAClH,YAAY,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,cAAc,6BAA6B,CAAC"}
|
package/dist/src/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.virtualContent = exports.ResolverLoader = exports.ModuleRequest = exports.Resolver = exports.throwOnWarnings = exports.expectWarning = exports.debug = exports.warn = exports.unsupported = exports.todo = exports.jsHandlebarsCompile = exports.WaitForTrees = exports.optionsWithDefaults = exports.HTMLEntrypoint = exports.getPackagerCacheDir = exports.applyVariantToBabelConfig = void 0;
|
|
21
|
-
var packager_1 = require("./packager");
|
|
22
|
-
Object.defineProperty(exports, "applyVariantToBabelConfig", { enumerable: true, get: function () { return packager_1.applyVariantToBabelConfig; } });
|
|
23
|
-
Object.defineProperty(exports, "getPackagerCacheDir", { enumerable: true, get: function () { return packager_1.getPackagerCacheDir; } });
|
|
24
|
-
var html_entrypoint_1 = require("./html-entrypoint");
|
|
25
|
-
Object.defineProperty(exports, "HTMLEntrypoint", { enumerable: true, get: function () { return html_entrypoint_1.HTMLEntrypoint; } });
|
|
26
|
-
var options_1 = require("./options");
|
|
27
|
-
Object.defineProperty(exports, "optionsWithDefaults", { enumerable: true, get: function () { return options_1.optionsWithDefaults; } });
|
|
28
|
-
var wait_for_trees_1 = require("./wait-for-trees");
|
|
29
|
-
Object.defineProperty(exports, "WaitForTrees", { enumerable: true, get: function () { return __importDefault(wait_for_trees_1).default; } });
|
|
30
|
-
var js_handlebars_1 = require("./js-handlebars");
|
|
31
|
-
Object.defineProperty(exports, "jsHandlebarsCompile", { enumerable: true, get: function () { return js_handlebars_1.compile; } });
|
|
32
|
-
var messages_1 = require("./messages");
|
|
33
|
-
Object.defineProperty(exports, "todo", { enumerable: true, get: function () { return messages_1.todo; } });
|
|
34
|
-
Object.defineProperty(exports, "unsupported", { enumerable: true, get: function () { return messages_1.unsupported; } });
|
|
35
|
-
Object.defineProperty(exports, "warn", { enumerable: true, get: function () { return messages_1.warn; } });
|
|
36
|
-
Object.defineProperty(exports, "debug", { enumerable: true, get: function () { return messages_1.debug; } });
|
|
37
|
-
Object.defineProperty(exports, "expectWarning", { enumerable: true, get: function () { return messages_1.expectWarning; } });
|
|
38
|
-
Object.defineProperty(exports, "throwOnWarnings", { enumerable: true, get: function () { return messages_1.throwOnWarnings; } });
|
|
39
|
-
var module_resolver_1 = require("./module-resolver");
|
|
40
|
-
Object.defineProperty(exports, "Resolver", { enumerable: true, get: function () { return module_resolver_1.Resolver; } });
|
|
41
|
-
var module_request_1 = require("./module-request");
|
|
42
|
-
Object.defineProperty(exports, "ModuleRequest", { enumerable: true, get: function () { return module_request_1.ModuleRequest; } });
|
|
43
|
-
var resolver_loader_1 = require("./resolver-loader");
|
|
44
|
-
Object.defineProperty(exports, "ResolverLoader", { enumerable: true, get: function () { return resolver_loader_1.ResolverLoader; } });
|
|
45
|
-
var virtual_content_1 = require("./virtual-content");
|
|
46
|
-
Object.defineProperty(exports, "virtualContent", { enumerable: true, get: function () { return virtual_content_1.virtualContent; } });
|
|
47
|
-
// this is reexported because we already make users manage a peerDep from some
|
|
48
|
-
// other packages (like embroider/webpack and @embroider/compat
|
|
49
|
-
__exportStar(require("@embroider/shared-internals"), exports);
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,uCAAoH;AAAnE,qHAAA,yBAAyB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAC/F,qDAAkE;AAAzD,iHAAA,cAAc,OAAA;AAEvB,qCAAoE;AAAvC,8GAAA,mBAAmB,OAAA;AAChD,mDAAwE;AAA/D,+HAAA,OAAO,OAAgB;AAChC,iDAAiE;AAAxD,oHAAA,OAAO,OAAuB;AACvC,uCAA4F;AAAnF,gGAAA,IAAI,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,gGAAA,IAAI,OAAA;AAAE,iGAAA,KAAK,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,2GAAA,eAAe,OAAA;AACvE,qDAA6C;AAApC,2GAAA,QAAQ,OAAA;AACjB,mDAAkH;AAAzG,+GAAA,aAAa,OAAA;AAEtB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,qDAAyE;AAAhE,iHAAA,cAAc,OAAA;AAGvB,8EAA8E;AAC9E,+DAA+D;AAC/D,8DAA4C","sourcesContent":["export { Packager, PackagerConstructor, Variant, applyVariantToBabelConfig, getPackagerCacheDir } from './packager';\nexport { HTMLEntrypoint, BundleSummary } from './html-entrypoint';\nexport { default as Stage } from './stage';\nexport { default as Options, optionsWithDefaults } from './options';\nexport { default as WaitForTrees, OutputPaths } from './wait-for-trees';\nexport { compile as jsHandlebarsCompile } from './js-handlebars';\nexport { todo, unsupported, warn, debug, expectWarning, throwOnWarnings } from './messages';\nexport { Resolver } from './module-resolver';\nexport { ModuleRequest, type Resolution, type RequestAdapter, type RequestAdapterCreate } from './module-request';\nexport type { Options as ResolverOptions } from './module-resolver-options';\nexport { ResolverLoader } from './resolver-loader';\nexport { virtualContent, type VirtualResponse } from './virtual-content';\nexport type { Engine } from './app-files';\n\n// this is reexported because we already make users manage a peerDep from some\n// other packages (like embroider/webpack and @embroider/compat\nexport * from '@embroider/shared-internals';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"js-handlebars.d.ts","sourceRoot":"","sources":["../../src/js-handlebars.ts"],"names":[],"mappings":"AAcA,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,mCAEpC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.compile = compile;
|
|
7
|
-
// This is handlebars plus helpers specifically for generating Javascript.
|
|
8
|
-
const handlebars_1 = __importDefault(require("handlebars"));
|
|
9
|
-
const js_string_escape_1 = __importDefault(require("js-string-escape"));
|
|
10
|
-
handlebars_1.default.registerHelper('js-string-escape', js_string_escape_1.default);
|
|
11
|
-
handlebars_1.default.registerHelper('json-stringify', function (input, indent) {
|
|
12
|
-
return JSON.stringify(input, null, indent);
|
|
13
|
-
});
|
|
14
|
-
handlebars_1.default.registerHelper('eq', function (a, b) {
|
|
15
|
-
return a === b;
|
|
16
|
-
});
|
|
17
|
-
function compile(input) {
|
|
18
|
-
return handlebars_1.default.compile(input, { noEscape: true });
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=js-handlebars.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"js-handlebars.js","sourceRoot":"","sources":["../../src/js-handlebars.ts"],"names":[],"mappings":";;;;;AAcA,0BAEC;AAhBD,0EAA0E;AAC1E,4DAAoC;AACpC,wEAA8C;AAE9C,oBAAU,CAAC,cAAc,CAAC,kBAAkB,EAAE,0BAAc,CAAC,CAAC;AAE9D,oBAAU,CAAC,cAAc,CAAC,gBAAgB,EAAE,UAAU,KAAU,EAAE,MAAe;IAC/E,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC;AAEH,oBAAU,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAM,EAAE,CAAM;IACtD,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEH,SAAgB,OAAO,CAAC,KAAa;IACnC,OAAO,oBAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC","sourcesContent":["// This is handlebars plus helpers specifically for generating Javascript.\nimport handlebars from 'handlebars';\nimport jsStringEscape from 'js-string-escape';\n\nhandlebars.registerHelper('js-string-escape', jsStringEscape);\n\nhandlebars.registerHelper('json-stringify', function (input: any, indent?: number) {\n return JSON.stringify(input, null, indent);\n});\n\nhandlebars.registerHelper('eq', function (a: any, b: any) {\n return a === b;\n});\n\nexport function compile(input: string) {\n return handlebars.compile(input, { noEscape: true });\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type SourceMapConcat from 'fast-sourcemap-concat';
|
|
2
|
-
export default class MeasureConcat {
|
|
3
|
-
private name;
|
|
4
|
-
private concat;
|
|
5
|
-
private baseDir;
|
|
6
|
-
stats: {
|
|
7
|
-
[filename: string]: number;
|
|
8
|
-
};
|
|
9
|
-
constructor(name: string, concat: SourceMapConcat, baseDir: string);
|
|
10
|
-
addFile(filename: string): void;
|
|
11
|
-
addSpace(contents: string): void;
|
|
12
|
-
end(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=measure-concat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measure-concat.d.ts","sourceRoot":"","sources":["../../src/measure-concat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AAIzD,MAAM,CAAC,OAAO,OAAO,aAAa;IAEpB,OAAO,CAAC,IAAI;IAAU,OAAO,CAAC,MAAM;IAAmB,OAAO,CAAC,OAAO;IADlF,KAAK,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAM;gBACvB,IAAI,EAAE,MAAM,EAAU,MAAM,EAAE,eAAe,EAAU,OAAO,EAAE,MAAM;IAC1F,OAAO,CAAC,QAAQ,EAAE,MAAM;IAIxB,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAInB,GAAG;CAUV"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const path_1 = require("path");
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
class MeasureConcat {
|
|
6
|
-
name;
|
|
7
|
-
concat;
|
|
8
|
-
baseDir;
|
|
9
|
-
stats = {};
|
|
10
|
-
constructor(name, concat, baseDir) {
|
|
11
|
-
this.name = name;
|
|
12
|
-
this.concat = concat;
|
|
13
|
-
this.baseDir = baseDir;
|
|
14
|
-
}
|
|
15
|
-
addFile(filename) {
|
|
16
|
-
this.stats[filename] = (0, fs_1.statSync)((0, path_1.join)(this.baseDir, filename)).size;
|
|
17
|
-
return this.concat.addFile(filename);
|
|
18
|
-
}
|
|
19
|
-
addSpace(contents) {
|
|
20
|
-
this.stats['in-memory'] = (this.stats['in-memory'] || 0) + contents.length;
|
|
21
|
-
return this.concat.addSpace(contents);
|
|
22
|
-
}
|
|
23
|
-
async end() {
|
|
24
|
-
console.log(`Concatenated ${this.name}:`);
|
|
25
|
-
console.log(Object.entries(this.stats)
|
|
26
|
-
.sort((a, b) => b[1] - a[1])
|
|
27
|
-
.map(([name, bytes]) => ` ${name}: ${bytes} bytes`)
|
|
28
|
-
.join('\n'));
|
|
29
|
-
return await this.concat.end();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.default = MeasureConcat;
|
|
33
|
-
//# sourceMappingURL=measure-concat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measure-concat.js","sourceRoot":"","sources":["../../src/measure-concat.ts"],"names":[],"mappings":";;AACA,+BAA4B;AAC5B,2BAA8B;AAE9B,MAAqB,aAAa;IAEZ;IAAsB;IAAiC;IAD3E,KAAK,GAAmC,EAAE,CAAC;IAC3C,YAAoB,IAAY,EAAU,MAAuB,EAAU,OAAe;QAAtE,SAAI,GAAJ,IAAI,CAAQ;QAAU,WAAM,GAAN,MAAM,CAAiB;QAAU,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;IAC9F,OAAO,CAAC,QAAgB;QACtB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAA,aAAQ,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IACD,QAAQ,CAAC,QAAgB;QACvB,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC3E,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,GAAG;QACP,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CACT,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;aACvB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAC3B,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,KAAK,KAAK,QAAQ,CAAC;aACnD,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;QACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;IACjC,CAAC;CACF;AArBD,gCAqBC","sourcesContent":["import type SourceMapConcat from 'fast-sourcemap-concat';\nimport { join } from 'path';\nimport { statSync } from 'fs';\n\nexport default class MeasureConcat {\n stats: { [filename: string]: number } = {};\n constructor(private name: string, private concat: SourceMapConcat, private baseDir: string) {}\n addFile(filename: string) {\n this.stats[filename] = statSync(join(this.baseDir, filename)).size;\n return this.concat.addFile(filename);\n }\n addSpace(contents: string) {\n this.stats['in-memory'] = (this.stats['in-memory'] || 0) + contents.length;\n return this.concat.addSpace(contents);\n }\n async end() {\n console.log(`Concatenated ${this.name}:`);\n console.log(\n Object.entries(this.stats)\n .sort((a, b) => b[1] - a[1])\n .map(([name, bytes]) => ` ${name}: ${bytes} bytes`)\n .join('\\n')\n );\n return await this.concat.end();\n }\n}\n"]}
|
package/dist/src/messages.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import makeDebug from 'debug';
|
|
2
|
-
declare const todo: makeDebug.Debugger;
|
|
3
|
-
declare const unsupported: makeDebug.Debugger;
|
|
4
|
-
declare const debug: makeDebug.Debugger;
|
|
5
|
-
export declare function warn(message: string, ...params: any[]): void;
|
|
6
|
-
export declare function throwOnWarnings(hooks?: NestedHooks): void;
|
|
7
|
-
export declare function expectWarning(pattern: RegExp, fn: () => void): boolean;
|
|
8
|
-
export { todo, unsupported, debug };
|
|
9
|
-
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,OAAO,CAAC;AAM9B,QAAA,MAAM,IAAI,oBAA8B,CAAC;AACzC,QAAA,MAAM,WAAW,oBAAqC,CAAC;AACvD,QAAA,MAAM,KAAK,oBAA+B,CAAC;AAwB3C,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,QAMrD;AAID,wBAAgB,eAAe,CAAC,KAAK,CAAC,EAAE,WAAW,QAclD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,IAAI,WAQ5D;AAED,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/src/messages.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.debug = exports.unsupported = exports.todo = void 0;
|
|
7
|
-
exports.warn = warn;
|
|
8
|
-
exports.throwOnWarnings = throwOnWarnings;
|
|
9
|
-
exports.expectWarning = expectWarning;
|
|
10
|
-
const debug_1 = __importDefault(require("debug"));
|
|
11
|
-
const util_1 = require("util");
|
|
12
|
-
const todo = (0, debug_1.default)('embroider:todo');
|
|
13
|
-
exports.todo = todo;
|
|
14
|
-
const unsupported = (0, debug_1.default)('embroider:unsupported');
|
|
15
|
-
exports.unsupported = unsupported;
|
|
16
|
-
const debug = (0, debug_1.default)('embroider:debug');
|
|
17
|
-
exports.debug = debug;
|
|
18
|
-
function realWarn(message, params) {
|
|
19
|
-
if (hardFailMode > 0) {
|
|
20
|
-
throw new Error(`Unexpected warning in test suite: ${(0, util_1.format)(message, ...params)}`);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
console.log('WARNING: ' + (0, util_1.format)(message, ...params));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
let expectStack = [];
|
|
27
|
-
let handled = new WeakSet();
|
|
28
|
-
function expectedWarn(message, params) {
|
|
29
|
-
let formattedMessage = (0, util_1.format)(message, ...params);
|
|
30
|
-
for (let pattern of expectStack) {
|
|
31
|
-
if (pattern.test(formattedMessage)) {
|
|
32
|
-
handled.add(pattern);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
realWarn(message, params);
|
|
37
|
-
}
|
|
38
|
-
function warn(message, ...params) {
|
|
39
|
-
if (expectStack.length === 0) {
|
|
40
|
-
realWarn(message, params);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
expectedWarn(message, params);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// for use in our test suites
|
|
47
|
-
let hardFailMode = 0;
|
|
48
|
-
function throwOnWarnings(hooks) {
|
|
49
|
-
if (hooks) {
|
|
50
|
-
// qunit mode
|
|
51
|
-
hooks.before(() => {
|
|
52
|
-
hardFailMode++;
|
|
53
|
-
});
|
|
54
|
-
hooks.after(() => {
|
|
55
|
-
hardFailMode--;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
// Jest mode
|
|
60
|
-
beforeAll(() => hardFailMode++);
|
|
61
|
-
afterAll(() => hardFailMode--);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function expectWarning(pattern, fn) {
|
|
65
|
-
expectStack.push(pattern);
|
|
66
|
-
try {
|
|
67
|
-
fn();
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
expectStack.pop();
|
|
71
|
-
}
|
|
72
|
-
return handled.has(pattern);
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=messages.js.map
|
package/dist/src/messages.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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IACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;AACH,CAAC;AAED,6BAA6B;AAC7B,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,SAAgB,eAAe,CAAC,KAAmB;IACjD,IAAI,KAAK,EAAE,CAAC;QACV,aAAa;QACb,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE;YAChB,YAAY,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE;YACf,YAAY,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,YAAY;QACZ,SAAS,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;QAChC,QAAQ,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CAAC,OAAe,EAAE,EAAc;IAC3D,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1B,IAAI,CAAC;QACH,EAAE,EAAE,CAAC;IACP,CAAC;YAAS,CAAC;QACT,WAAW,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import makeDebug from 'debug';\nimport { format } from 'util';\n// @ts-expect-error we can't import the NestedHooks from qunit here\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type qunit from 'qunit';\n\nconst todo = makeDebug('embroider:todo');\nconst unsupported = makeDebug('embroider:unsupported');\nconst debug = makeDebug('embroider:debug');\n\nfunction realWarn(message: string, params: any[]) {\n if (hardFailMode > 0) {\n throw new Error(`Unexpected warning in test suite: ${format(message, ...params)}`);\n } else {\n console.log('WARNING: ' + format(message, ...params));\n }\n}\n\nlet expectStack = [] as RegExp[];\nlet handled: WeakSet<RegExp> = new WeakSet();\n\nfunction expectedWarn(message: string, params: any[]) {\n let formattedMessage = format(message, ...params);\n for (let pattern of expectStack) {\n if (pattern.test(formattedMessage)) {\n handled.add(pattern);\n return;\n }\n }\n realWarn(message, params);\n}\n\nexport function warn(message: string, ...params: any[]) {\n if (expectStack.length === 0) {\n realWarn(message, params);\n } else {\n expectedWarn(message, params);\n }\n}\n\n// for use in our test suites\nlet hardFailMode = 0;\nexport function throwOnWarnings(hooks?: NestedHooks) {\n if (hooks) {\n // qunit mode\n hooks.before(() => {\n hardFailMode++;\n });\n hooks.after(() => {\n hardFailMode--;\n });\n } else {\n // Jest mode\n beforeAll(() => hardFailMode++);\n afterAll(() => hardFailMode--);\n }\n}\n\nexport function expectWarning(pattern: RegExp, fn: () => void) {\n expectStack.push(pattern);\n try {\n fn();\n } finally {\n expectStack.pop();\n }\n return handled.has(pattern);\n}\n\nexport { todo, unsupported, debug };\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { VirtualResponse } from './virtual-content';
|
|
2
|
-
export type Resolution<T = unknown, E = unknown> = {
|
|
3
|
-
type: 'found';
|
|
4
|
-
filename: string;
|
|
5
|
-
virtual: VirtualResponse | false;
|
|
6
|
-
result: T;
|
|
7
|
-
} | {
|
|
8
|
-
type: 'not_found';
|
|
9
|
-
err: E;
|
|
10
|
-
};
|
|
11
|
-
export type RequestAdapterCreate<Init, Res extends Resolution> = (params: Init) => {
|
|
12
|
-
initialState: InitialRequestState;
|
|
13
|
-
adapter: RequestAdapter<Res>;
|
|
14
|
-
} | undefined;
|
|
15
|
-
export interface RequestAdapter<Res extends Resolution> {
|
|
16
|
-
readonly debugType: string;
|
|
17
|
-
resolve(request: ModuleRequest<Res>): Promise<Res>;
|
|
18
|
-
notFoundResponse(request: ModuleRequest<Res>): Res | (() => Promise<Res>);
|
|
19
|
-
virtualResponse(request: ModuleRequest<Res>, response: VirtualResponse): Res | (() => Promise<Res>);
|
|
20
|
-
}
|
|
21
|
-
export interface InitialRequestState {
|
|
22
|
-
readonly specifier: string;
|
|
23
|
-
readonly fromFile: string;
|
|
24
|
-
readonly meta: Record<string, unknown> | undefined;
|
|
25
|
-
}
|
|
26
|
-
export declare class ModuleRequest<Res extends Resolution = Resolution> implements ModuleRequest<Res> {
|
|
27
|
-
#private;
|
|
28
|
-
static create<Init, Res extends Resolution>(createAdapter: RequestAdapterCreate<Init, Res>, params: Init): ModuleRequest<Res> | undefined;
|
|
29
|
-
private constructor();
|
|
30
|
-
get specifier(): string;
|
|
31
|
-
get fromFile(): string;
|
|
32
|
-
get debugType(): string;
|
|
33
|
-
get meta(): Record<string, unknown> | undefined;
|
|
34
|
-
get resolvedTo(): Res | (() => Promise<Res>) | undefined;
|
|
35
|
-
alias(newSpecifier: string): this;
|
|
36
|
-
rehome(newFromFile: string): this;
|
|
37
|
-
virtualize(virtualResponse: VirtualResponse): this;
|
|
38
|
-
withMeta(meta: Record<string, any> | undefined): this;
|
|
39
|
-
notFound(): this;
|
|
40
|
-
resolveTo(res: Res | (() => Promise<Res>)): this;
|
|
41
|
-
defaultResolve(): Promise<Res>;
|
|
42
|
-
clone(): this;
|
|
43
|
-
}
|
|
44
|
-
export declare function extractResolution<Res extends Resolution = Resolution>(res: Res | (() => Promise<Res>)): Promise<Res>;
|
|
45
|
-
//# sourceMappingURL=module-request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-request.d.ts","sourceRoot":"","sources":["../../src/module-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzD,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAC3C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO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,MAAM,EAAE,IAAI,GACX,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS;IAajC,OAAO;IAOP,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAE9C;IAED,IAAI,UAAU,IAAI,GAAG,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAEvD;IAED,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IASjC,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IASjC,UAAU,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;IAIlD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI;IAOrD,QAAQ,IAAI,IAAI;IAIhB,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI;IAMhD,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC;IAI9B,KAAK,IAAI,IAAI;CAGd;AAED,wBAAsB,iBAAiB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU,EACzE,GAAG,EAAE,GAAG,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAC9B,OAAO,CAAC,GAAG,CAAC,CAMd"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModuleRequest = void 0;
|
|
4
|
-
exports.extractResolution = extractResolution;
|
|
5
|
-
class ModuleRequest {
|
|
6
|
-
static create(createAdapter, params) {
|
|
7
|
-
let result = createAdapter(params);
|
|
8
|
-
if (result) {
|
|
9
|
-
return new ModuleRequest(result.adapter, result.initialState);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
#adapter;
|
|
13
|
-
#specifier;
|
|
14
|
-
#fromFile;
|
|
15
|
-
#meta;
|
|
16
|
-
#resolvedTo;
|
|
17
|
-
constructor(adapter, initialize) {
|
|
18
|
-
this.#adapter = adapter;
|
|
19
|
-
this.#specifier = initialize.specifier;
|
|
20
|
-
this.#fromFile = initialize.fromFile;
|
|
21
|
-
this.#meta = initialize.meta;
|
|
22
|
-
}
|
|
23
|
-
get specifier() {
|
|
24
|
-
return this.#specifier;
|
|
25
|
-
}
|
|
26
|
-
get fromFile() {
|
|
27
|
-
return this.#fromFile;
|
|
28
|
-
}
|
|
29
|
-
get debugType() {
|
|
30
|
-
return this.#adapter.debugType;
|
|
31
|
-
}
|
|
32
|
-
get meta() {
|
|
33
|
-
return this.#meta;
|
|
34
|
-
}
|
|
35
|
-
get resolvedTo() {
|
|
36
|
-
return this.#resolvedTo;
|
|
37
|
-
}
|
|
38
|
-
alias(newSpecifier) {
|
|
39
|
-
if (this.#specifier === newSpecifier) {
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
let result = this.clone();
|
|
43
|
-
result.#specifier = newSpecifier;
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
rehome(newFromFile) {
|
|
47
|
-
if (this.#fromFile === newFromFile) {
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
let result = this.clone();
|
|
51
|
-
result.#fromFile = newFromFile;
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
virtualize(virtualResponse) {
|
|
55
|
-
return this.resolveTo(this.#adapter.virtualResponse(this, virtualResponse));
|
|
56
|
-
}
|
|
57
|
-
withMeta(meta) {
|
|
58
|
-
let result = this.clone();
|
|
59
|
-
result.#meta = meta;
|
|
60
|
-
result.#resolvedTo = this.#resolvedTo;
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
notFound() {
|
|
64
|
-
return this.resolveTo(this.#adapter.notFoundResponse(this));
|
|
65
|
-
}
|
|
66
|
-
resolveTo(res) {
|
|
67
|
-
let result = this.clone();
|
|
68
|
-
result.#resolvedTo = res;
|
|
69
|
-
return result;
|
|
70
|
-
}
|
|
71
|
-
defaultResolve() {
|
|
72
|
-
return this.#adapter.resolve(this);
|
|
73
|
-
}
|
|
74
|
-
clone() {
|
|
75
|
-
return new ModuleRequest(this.#adapter, this);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.ModuleRequest = ModuleRequest;
|
|
79
|
-
async function extractResolution(res) {
|
|
80
|
-
if (typeof res === 'function') {
|
|
81
|
-
return await res();
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
return res;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=module-request.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-request.js","sourceRoot":"","sources":["../../src/module-request.ts"],"names":[],"mappings":";;;AA4HA,8CAQC;AApGD,MAAa,aAAa;IACxB,MAAM,CAAC,MAAM,CACX,aAA8C,EAC9C,MAAY;QAEZ,IAAI,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED,QAAQ,CAAsB;IAC9B,UAAU,CAAS;IACnB,SAAS,CAAS;IAClB,KAAK,CAAsC;IAC3C,WAAW,CAAyC;IAEpD,YAAoB,OAA4B,EAAE,UAA+B;QAC/E,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC;IAC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,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,SAAS,CAAC,GAA+B;QACvC,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,KAAK;QACH,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAS,CAAC;IACxD,CAAC;CACF;AA1FD,sCA0FC;AAEM,KAAK,UAAU,iBAAiB,CACrC,GAA+B;IAE/B,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,OAAO,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC","sourcesContent":["import type { VirtualResponse } from './virtual-content';\n\n// This is generic because different build systems have different ways of\n// representing a found module, and we just pass those values through.\nexport type Resolution<T = unknown, E = unknown> =\n | { type: 'found'; filename: string; virtual: VirtualResponse | false; result: T }\n\n // the important thing about this Resolution is that embroider should do its\n // fallback behaviors here.\n | { type: 'not_found'; err: E };\n\nexport type RequestAdapterCreate<Init, Res extends Resolution> = (\n params: Init\n) => { initialState: InitialRequestState; adapter: RequestAdapter<Res> } | undefined;\n\nexport interface RequestAdapter<Res extends Resolution> {\n readonly debugType: string;\n resolve(request: ModuleRequest<Res>): Promise<Res>;\n\n // the function-returning variants of both of these are only because webpack\n // plugins are a pain in the butt. Integrators are encouraged to use the plain\n // Response-returning variants in all sane build environments.\n notFoundResponse(request: ModuleRequest<Res>): Res | (() => Promise<Res>);\n virtualResponse(request: ModuleRequest<Res>, response: VirtualResponse): Res | (() => Promise<Res>);\n}\n\nexport interface InitialRequestState {\n readonly specifier: string;\n readonly fromFile: string;\n readonly meta: Record<string, unknown> | undefined;\n}\n\nexport class ModuleRequest<Res extends Resolution = Resolution> implements ModuleRequest<Res> {\n static create<Init, Res extends Resolution>(\n createAdapter: RequestAdapterCreate<Init, Res>,\n params: Init\n ): ModuleRequest<Res> | undefined {\n let result = createAdapter(params);\n if (result) {\n return new ModuleRequest(result.adapter, result.initialState);\n }\n }\n\n #adapter: RequestAdapter<Res>;\n #specifier: string;\n #fromFile: string;\n #meta: Record<string, unknown> | undefined;\n #resolvedTo: Res | (() => Promise<Res>) | undefined;\n\n private constructor(adapter: RequestAdapter<Res>, initialize: InitialRequestState) {\n this.#adapter = adapter;\n this.#specifier = initialize.specifier;\n this.#fromFile = initialize.fromFile;\n this.#meta = initialize.meta;\n }\n\n get specifier(): string {\n return this.#specifier;\n }\n\n get fromFile(): string {\n return this.#fromFile;\n }\n\n get debugType(): string {\n return this.#adapter.debugType;\n }\n\n get meta(): Record<string, unknown> | undefined {\n return this.#meta;\n }\n\n get resolvedTo(): Res | (() => Promise<Res>) | undefined {\n return this.#resolvedTo;\n }\n\n alias(newSpecifier: string): this {\n if (this.#specifier === newSpecifier) {\n return this;\n }\n let result = this.clone();\n result.#specifier = newSpecifier;\n return result;\n }\n\n rehome(newFromFile: string): this {\n if (this.#fromFile === newFromFile) {\n return this;\n }\n let result = this.clone();\n result.#fromFile = newFromFile;\n return result;\n }\n\n virtualize(virtualResponse: VirtualResponse): this {\n return this.resolveTo(this.#adapter.virtualResponse(this, virtualResponse));\n }\n\n withMeta(meta: Record<string, any> | undefined): this {\n let result = this.clone();\n result.#meta = meta;\n result.#resolvedTo = this.#resolvedTo;\n return result;\n }\n\n notFound(): this {\n return this.resolveTo(this.#adapter.notFoundResponse(this));\n }\n\n resolveTo(res: Res | (() => Promise<Res>)): this {\n let result = this.clone();\n result.#resolvedTo = res;\n return result;\n }\n\n defaultResolve(): Promise<Res> {\n return this.#adapter.resolve(this);\n }\n\n clone(): this {\n return new ModuleRequest(this.#adapter, this) as this;\n }\n}\n\nexport async function extractResolution<Res extends Resolution = Resolution>(\n res: Res | (() => Promise<Res>)\n): Promise<Res> {\n if (typeof res === 'function') {\n return await res();\n } else {\n return res;\n }\n}\n"]}
|