xbintsc 0.3.25 → 0.3.46
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/README.md +39 -3
- package/dist/src/cli/main.js +124 -30
- package/dist/src/cli/main.js.map +1 -1
- package/dist/src/codegen/generator/calls/access.js +8 -1
- package/dist/src/codegen/generator/calls/access.js.map +1 -1
- package/dist/src/codegen/generator/module.js +10 -0
- package/dist/src/codegen/generator/module.js.map +1 -1
- package/dist/src/codegen/generator/state.js +24 -0
- package/dist/src/codegen/generator/state.js.map +1 -1
- package/dist/src/codegen/generator/tables.d.ts +6 -0
- package/dist/src/codegen/generator/tables.js +38 -0
- package/dist/src/codegen/generator/tables.js.map +1 -1
- package/dist/src/driver/bundler/commonjs.d.ts +52 -0
- package/dist/src/driver/bundler/commonjs.js +493 -0
- package/dist/src/driver/bundler/commonjs.js.map +1 -0
- package/dist/src/driver/bundler/graph.js +14 -0
- package/dist/src/driver/bundler/graph.js.map +1 -1
- package/dist/src/driver/bundler/merge.js +14 -0
- package/dist/src/driver/bundler/merge.js.map +1 -1
- package/dist/src/driver/bundler/types.d.ts +8 -0
- package/dist/src/driver/compiler.d.ts +8 -1
- package/dist/src/driver/compiler.js +73 -5
- package/dist/src/driver/compiler.js.map +1 -1
- package/dist/src/driver/config.d.ts +53 -0
- package/dist/src/driver/config.js +141 -0
- package/dist/src/driver/config.js.map +1 -0
- package/dist/src/driver/icon.d.ts +62 -0
- package/dist/src/driver/icon.js +151 -0
- package/dist/src/driver/icon.js.map +1 -0
- package/dist/src/driver/index.d.ts +4 -0
- package/dist/src/driver/index.js +4 -0
- package/dist/src/driver/index.js.map +1 -1
- package/dist/src/driver/mac-bundle.d.ts +41 -0
- package/dist/src/driver/mac-bundle.js +123 -0
- package/dist/src/driver/mac-bundle.js.map +1 -0
- package/dist/src/driver/win-icon.d.ts +27 -0
- package/dist/src/driver/win-icon.js +80 -0
- package/dist/src/driver/win-icon.js.map +1 -0
- package/dist/src/parser/statements.js +17 -4
- package/dist/src/parser/statements.js.map +1 -1
- package/dist/tests/cli/main.test.js +46 -1
- package/dist/tests/cli/main.test.js.map +1 -1
- package/dist/tests/driver/config.test.d.ts +1 -0
- package/dist/tests/driver/config.test.js +124 -0
- package/dist/tests/driver/config.test.js.map +1 -0
- package/dist/tests/driver/icon.test.d.ts +1 -0
- package/dist/tests/driver/icon.test.js +421 -0
- package/dist/tests/driver/icon.test.js.map +1 -0
- package/dist/tests/driver/modules.test.js +109 -0
- package/dist/tests/driver/modules.test.js.map +1 -1
- package/dist/tests/e2e/fetch.test.d.ts +12 -0
- package/dist/tests/e2e/fetch.test.js +272 -0
- package/dist/tests/e2e/fetch.test.js.map +1 -0
- package/dist/tests/e2e/gc.test.d.ts +1 -0
- package/dist/tests/e2e/gc.test.js +168 -0
- package/dist/tests/e2e/gc.test.js.map +1 -0
- package/dist/tests/e2e/gui-dom.test.d.ts +5 -0
- package/dist/tests/e2e/gui-dom.test.js +102 -0
- package/dist/tests/e2e/gui-dom.test.js.map +1 -0
- package/dist/tests/e2e/gui-events.test.d.ts +5 -0
- package/dist/tests/e2e/gui-events.test.js +60 -0
- package/dist/tests/e2e/gui-events.test.js.map +1 -0
- package/dist/tests/e2e/gui-helpers.d.ts +31 -0
- package/dist/tests/e2e/gui-helpers.js +74 -0
- package/dist/tests/e2e/gui-helpers.js.map +1 -0
- package/dist/tests/e2e/gui-layout.test.d.ts +4 -0
- package/dist/tests/e2e/gui-layout.test.js +88 -0
- package/dist/tests/e2e/gui-layout.test.js.map +1 -0
- package/dist/tests/e2e/gui-lifecycle.test.d.ts +5 -0
- package/dist/tests/e2e/gui-lifecycle.test.js +58 -0
- package/dist/tests/e2e/gui-lifecycle.test.js.map +1 -0
- package/dist/tests/e2e/gui-paint.test.d.ts +5 -0
- package/dist/tests/e2e/gui-paint.test.js +111 -0
- package/dist/tests/e2e/gui-paint.test.js.map +1 -0
- package/dist/tests/e2e/gui-script.test.d.ts +5 -0
- package/dist/tests/e2e/gui-script.test.js +78 -0
- package/dist/tests/e2e/gui-script.test.js.map +1 -0
- package/dist/tests/e2e/gui-style.test.d.ts +5 -0
- package/dist/tests/e2e/gui-style.test.js +175 -0
- package/dist/tests/e2e/gui-style.test.js.map +1 -0
- package/dist/tests/e2e/harness.d.ts +2 -0
- package/dist/tests/e2e/harness.js +1 -0
- package/dist/tests/e2e/harness.js.map +1 -1
- package/dist/tests/e2e/icon.test.d.ts +7 -0
- package/dist/tests/e2e/icon.test.js +80 -0
- package/dist/tests/e2e/icon.test.js.map +1 -0
- package/dist/tests/e2e/npm-modules.test.d.ts +4 -1
- package/dist/tests/e2e/npm-modules.test.js +47 -1
- package/dist/tests/e2e/npm-modules.test.js.map +1 -1
- package/dist/tests/e2e/runtime-coverage-typed-array.test.d.ts +9 -0
- package/dist/tests/e2e/runtime-coverage-typed-array.test.js +140 -0
- package/dist/tests/e2e/runtime-coverage-typed-array.test.js.map +1 -0
- package/dist/tests/parser/statements.test.js +11 -0
- package/dist/tests/parser/statements.test.js.map +1 -1
- package/package.json +3 -2
- package/runtime/ext_gui/css.cpp +4 -517
- package/runtime/ext_gui/css_internal.h +27 -0
- package/runtime/ext_gui/css_match.cpp +195 -0
- package/runtime/ext_gui/css_selector.cpp +207 -0
- package/runtime/ext_gui/css_sheet.cpp +129 -0
- package/runtime/ext_gui/dom.cpp +7 -403
- package/runtime/ext_gui/dom_api.cpp +63 -1146
- package/runtime/ext_gui/dom_api_document.cpp +96 -0
- package/runtime/ext_gui/dom_api_events.cpp +123 -0
- package/runtime/ext_gui/dom_api_internal.h +135 -0
- package/runtime/ext_gui/dom_api_node.cpp +329 -0
- package/runtime/ext_gui/dom_api_node_read.cpp +294 -0
- package/runtime/ext_gui/dom_api_proto.cpp +135 -0
- package/runtime/ext_gui/dom_api_style.cpp +192 -0
- package/runtime/ext_gui/dom_internal.h +39 -0
- package/runtime/ext_gui/dom_parse.cpp +348 -0
- package/runtime/ext_gui/dom_serialize.cpp +54 -0
- package/runtime/ext_gui/gui.cpp +56 -286
- package/runtime/ext_gui/gui_events.cpp +294 -0
- package/runtime/ext_gui/gui_internal.h +29 -0
- package/runtime/ext_gui/layout.cpp +6 -597
- package/runtime/ext_gui/layout_flex.cpp +200 -0
- package/runtime/ext_gui/layout_flow.cpp +191 -0
- package/runtime/ext_gui/layout_flow_internal.h +149 -0
- package/runtime/ext_gui/layout_inline.cpp +181 -0
- package/runtime/ext_gui/layout_internal.h +20 -0
- package/runtime/ext_gui/renderer.cpp +15 -679
- package/runtime/ext_gui/renderer_image.cpp +233 -0
- package/runtime/ext_gui/renderer_internal.h +112 -0
- package/runtime/ext_gui/renderer_shaders.h +108 -0
- package/runtime/ext_gui/renderer_text.cpp +342 -0
- package/runtime/ext_gui/style.cpp +12 -660
- package/runtime/ext_gui/style_internal.h +33 -0
- package/runtime/ext_gui/style_print.cpp +113 -0
- package/runtime/ext_gui/style_ua.cpp +98 -0
- package/runtime/ext_gui/style_values.cpp +468 -0
- package/runtime/ext_gui/window.cpp +1 -0
- package/runtime/ext_node/buffer/parts/prototype.inc +1 -0
- package/runtime/ext_node/dgram/dgram.c +1 -0
- package/runtime/ext_node/events/events.c +1 -0
- package/runtime/ext_node/fs/fs_ops.c +10 -25
- package/runtime/ext_node/fs/glob.c +13 -30
- package/runtime/ext_node/fs/promises.c +1 -0
- package/runtime/ext_node/http/parts/prototypes.inc +5 -0
- package/runtime/ext_node/net/parts/prototypes.inc +2 -0
- package/runtime/ext_node/process/process.c +9 -7
- package/runtime/ext_node/stream/stream.c +1 -0
- package/runtime/ext_node/util/util.c +6 -6
- package/runtime/rt.h +16 -0
- package/runtime/rt_internal.h +67 -2
- package/runtime/xt_alloc.c +442 -5
- package/runtime/xt_builtins.c +1 -0
- package/runtime/xt_containers/access.inc +32 -1
- package/runtime/xt_fetch/buffer.inc +64 -0
- package/runtime/xt_fetch/headers.inc +312 -0
- package/runtime/xt_fetch/request.inc +386 -0
- package/runtime/xt_fetch/response.inc +107 -0
- package/runtime/xt_fetch/socket.inc +72 -0
- package/runtime/xt_fetch/url.inc +108 -0
- package/runtime/xt_fetch.c +39 -0
- package/runtime/xt_generator.c +95 -1
- package/runtime/xt_loop.c +35 -1
- package/runtime/xt_promise.c +46 -0
- package/runtime/xt_stdlib2/error.inc +1 -0
- package/runtime/xt_stdlib2/regexp-match.inc +8 -7
- package/runtime/xt_stdlib2/set.inc +1 -1
- package/runtime/xt_symbol.c +2 -0
- package/runtime/xt_typed_array/construction.inc +142 -0
- package/runtime/xt_typed_array/elements.inc +92 -0
- package/runtime/xt_typed_array/methods.inc +329 -0
- package/runtime/xt_typed_array.c +72 -0
- package/runtime/xt_values/number-format.inc +26 -0
- package/scripts/check-file-length.ts +85 -0
- package/src/cli/main.ts +137 -29
- package/src/codegen/generator/calls/access.ts +9 -1
- package/src/codegen/generator/module.ts +10 -0
- package/src/codegen/generator/state.ts +24 -0
- package/src/codegen/generator/tables.ts +40 -0
- package/src/driver/bundler/commonjs.ts +553 -0
- package/src/driver/bundler/graph.ts +14 -0
- package/src/driver/bundler/merge.ts +15 -0
- package/src/driver/bundler/types.ts +8 -0
- package/src/driver/compiler.ts +83 -5
- package/src/driver/config.ts +173 -0
- package/src/driver/icon.ts +184 -0
- package/src/driver/index.ts +30 -0
- package/src/driver/mac-bundle.ts +156 -0
- package/src/driver/win-icon.ts +96 -0
- package/src/parser/statements.ts +17 -4
- package/dist/tests/e2e/gui.test.d.ts +0 -12
- package/dist/tests/e2e/gui.test.js +0 -702
- package/dist/tests/e2e/gui.test.js.map +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end tests for the `gui` extension — compiling and running `<script>`
|
|
3
|
+
* bodies (inline and external, with imports) from loaded HTML.
|
|
4
|
+
*/
|
|
5
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
6
|
+
import { createGuiHarness, guiAvailable } from "./gui-helpers.js";
|
|
7
|
+
const harness = createGuiHarness();
|
|
8
|
+
describe.skipIf(!guiAvailable)("gui extension — scripts", () => {
|
|
9
|
+
beforeAll(() => harness.setup());
|
|
10
|
+
afterAll(() => harness.cleanup());
|
|
11
|
+
it("compiles inline <script> bodies from an imported .html asset", () => {
|
|
12
|
+
const { value } = harness.compileAndRun("script", `
|
|
13
|
+
import { createWindow, run } from "gui";
|
|
14
|
+
import page from "./page.html";
|
|
15
|
+
|
|
16
|
+
const win = createWindow({ title: "script", width: 320, height: 240 });
|
|
17
|
+
win.on("ready", () => {
|
|
18
|
+
const button = win.document.getElementById("b");
|
|
19
|
+
button.click();
|
|
20
|
+
button.click();
|
|
21
|
+
console.log("after=" + win.document.getElementById("count").textContent);
|
|
22
|
+
console.log("button=" + button.textContent);
|
|
23
|
+
win.close();
|
|
24
|
+
});
|
|
25
|
+
win.loadHTML(page);
|
|
26
|
+
run();
|
|
27
|
+
`, {
|
|
28
|
+
"page.html": `<html><body>
|
|
29
|
+
<div id="count">0</div>
|
|
30
|
+
<button id="b">0</button>
|
|
31
|
+
<script lang="ts">
|
|
32
|
+
const button = document.getElementById("b");
|
|
33
|
+
const label = document.getElementById("count");
|
|
34
|
+
let n = 0;
|
|
35
|
+
button.addEventListener("click", () => {
|
|
36
|
+
n = n + 1;
|
|
37
|
+
button.textContent = String(n);
|
|
38
|
+
label.textContent = String(n);
|
|
39
|
+
});
|
|
40
|
+
</script>
|
|
41
|
+
</body></html>`,
|
|
42
|
+
});
|
|
43
|
+
expect(value("after")).toBe("2");
|
|
44
|
+
expect(value("button")).toBe("2");
|
|
45
|
+
});
|
|
46
|
+
it("runs external <script src> modules with imports at load time", () => {
|
|
47
|
+
const { value } = harness.compileAndRun("scriptsrc", `
|
|
48
|
+
import { createWindow, run } from "gui";
|
|
49
|
+
import page from "./page-src.html";
|
|
50
|
+
|
|
51
|
+
const win = createWindow({ title: "scriptsrc", width: 320, height: 240 });
|
|
52
|
+
win.on("ready", () => {
|
|
53
|
+
const button = win.document.getElementById("b");
|
|
54
|
+
button.click();
|
|
55
|
+
button.click();
|
|
56
|
+
console.log("srcAfter=" + win.document.getElementById("b").textContent);
|
|
57
|
+
win.close();
|
|
58
|
+
});
|
|
59
|
+
win.loadHTML(page);
|
|
60
|
+
run();
|
|
61
|
+
`, {
|
|
62
|
+
"page-src.html": `<html><body><button id="b">0</button><script src="./counter.ts"></script></body></html>`,
|
|
63
|
+
"counter.ts": `
|
|
64
|
+
import { double } from "./helper";
|
|
65
|
+
const button = document.getElementById("b");
|
|
66
|
+
let n = 0;
|
|
67
|
+
button.addEventListener("click", () => {
|
|
68
|
+
n = double(n) + 1;
|
|
69
|
+
button.textContent = String(n);
|
|
70
|
+
});
|
|
71
|
+
`,
|
|
72
|
+
"helper.ts": "export function double(n: number) { return n * 2; }",
|
|
73
|
+
});
|
|
74
|
+
/* 0 -> 1 -> 3 proves the hoisted import (double) is linked. */
|
|
75
|
+
expect(value("srcAfter")).toBe("3");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=gui-script.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gui-script.test.js","sourceRoot":"","sources":["../../../tests/e2e/gui-script.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;AAEnC,QAAQ,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,yBAAyB,EAAE,GAAG,EAAE;IAC7D,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAElC,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,aAAa,CACrC,QAAQ,EACR;;;;;;;;;;;;;;;OAeC,EACD;YACE,WAAW,EAAE;;;;;;;;;;;;;eAaN;SACR,CACF,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,aAAa,CACrC,WAAW,EACX;;;;;;;;;;;;;;OAcC,EACD;YACE,eAAe,EAAE,yFAAyF;YAC1G,YAAY,EAAE;;;;;;;;CAQrB;YACO,WAAW,EAAE,qDAAqD;SACnE,CACF,CAAC;QACF,+DAA+D;QAC/D,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end tests for the `gui` extension — CSS cascade, stateful selectors
|
|
3
|
+
* (`:hover` / `:focus`) and transitions.
|
|
4
|
+
*/
|
|
5
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
6
|
+
import { createGuiHarness, guiAvailable } from "./gui-helpers.js";
|
|
7
|
+
const harness = createGuiHarness();
|
|
8
|
+
describe.skipIf(!guiAvailable)("gui extension — style", () => {
|
|
9
|
+
beforeAll(() => harness.setup());
|
|
10
|
+
afterAll(() => harness.cleanup());
|
|
11
|
+
it("parses HTML/CSS and cascades computed styles", () => {
|
|
12
|
+
const { value } = harness.compileAndRun("cascade", `
|
|
13
|
+
import { createWindow, run } from "gui";
|
|
14
|
+
|
|
15
|
+
const HTML = \`
|
|
16
|
+
<html>
|
|
17
|
+
<head>
|
|
18
|
+
<style>
|
|
19
|
+
body { font-size: 16px; color: #111111; }
|
|
20
|
+
div { width: 10%; }
|
|
21
|
+
.box { width: 25%; }
|
|
22
|
+
#main { width: 60%; color: #222222; }
|
|
23
|
+
.box > .inner { padding-top: 3px; }
|
|
24
|
+
.box .inner { padding-top: 5px; }
|
|
25
|
+
li:first-child { color: #555555; }
|
|
26
|
+
li:nth-child(2) { color: #666666; }
|
|
27
|
+
li:not(.skip) { font-weight: bold; }
|
|
28
|
+
[data-role="lead"] { text-align: center; }
|
|
29
|
+
.em { font-size: 2em; }
|
|
30
|
+
.rem { font-size: 2rem; }
|
|
31
|
+
.imp { color: #000000; }
|
|
32
|
+
.imp { color: #ff0000 !important; }
|
|
33
|
+
</style>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<div id="main" class="box">
|
|
37
|
+
<div class="inner" style="color: #00ff00">x</div>
|
|
38
|
+
<div class="inner">y</div>
|
|
39
|
+
</div>
|
|
40
|
+
<ul>
|
|
41
|
+
<li>one</li>
|
|
42
|
+
<li>two</li>
|
|
43
|
+
<li class="skip">three</li>
|
|
44
|
+
</ul>
|
|
45
|
+
<p data-role="lead">lead</p>
|
|
46
|
+
<div class="em">em</div>
|
|
47
|
+
<div class="rem">rem</div>
|
|
48
|
+
<div class="imp" style="color: #0000ff">important</div>
|
|
49
|
+
</body>
|
|
50
|
+
</html>
|
|
51
|
+
\`;
|
|
52
|
+
|
|
53
|
+
const win = createWindow({ title: "cascade", width: 800, height: 600 });
|
|
54
|
+
win.on("ready", () => {
|
|
55
|
+
const out = (label, value) => console.log(label + "=" + value);
|
|
56
|
+
out("main-width", win.computedStyle("#main", "width"));
|
|
57
|
+
out("inner-padding", win.computedStyle(".inner", "padding-top"));
|
|
58
|
+
out("inner-color", win.computedStyle(".inner", "color"));
|
|
59
|
+
out("body-color", win.computedStyle("body", "color"));
|
|
60
|
+
out("li1-color", win.computedStyle("li:first-child", "color"));
|
|
61
|
+
out("li2-color", win.computedStyle("li:nth-child(2)", "color"));
|
|
62
|
+
out("li2-weight", win.computedStyle("li:nth-child(2)", "font-weight"));
|
|
63
|
+
out("skip-weight", win.computedStyle("li.skip", "font-weight"));
|
|
64
|
+
out("lead-align", win.computedStyle("[data-role=\\"lead\\"]", "text-align"));
|
|
65
|
+
out("em-size", win.computedStyle(".em", "font-size"));
|
|
66
|
+
out("rem-size", win.computedStyle(".rem", "font-size"));
|
|
67
|
+
out("imp-color", win.computedStyle(".imp", "color"));
|
|
68
|
+
out("li-count", win.queryCount("li"));
|
|
69
|
+
out("lead-count", win.queryCount("[data-role=\\"lead\\"]"));
|
|
70
|
+
});
|
|
71
|
+
win.loadHTML(HTML);
|
|
72
|
+
run();
|
|
73
|
+
`);
|
|
74
|
+
expect(value("main-width")).toBe("60%"); // id beats class and tag
|
|
75
|
+
expect(value("inner-padding")).toBe("5px"); // equal specificity, later rule wins
|
|
76
|
+
expect(value("inner-color")).toBe("rgb(0, 255, 0)"); // inline beats the sheet
|
|
77
|
+
expect(value("body-color")).toBe("rgb(17, 17, 17)");
|
|
78
|
+
expect(value("li1-color")).toBe("rgb(85, 85, 85)"); // :first-child
|
|
79
|
+
expect(value("li2-color")).toBe("rgb(102, 102, 102)"); // :nth-child(2)
|
|
80
|
+
expect(value("li2-weight")).toBe("700"); // :not(.skip)
|
|
81
|
+
expect(value("skip-weight")).toBe("400"); // :not(.skip) excluded it
|
|
82
|
+
expect(value("lead-align")).toBe("center"); // [data-role="lead"]
|
|
83
|
+
expect(value("em-size")).toBe("32px"); // 2em of the 16px parent
|
|
84
|
+
expect(value("rem-size")).toBe("32px"); // 2rem of the 16px root
|
|
85
|
+
expect(value("imp-color")).toBe("rgb(255, 0, 0)"); // !important beats inline
|
|
86
|
+
expect(value("li-count")).toBe("3");
|
|
87
|
+
expect(value("lead-count")).toBe("1");
|
|
88
|
+
});
|
|
89
|
+
it("applies :hover and :focus state to selector matching", () => {
|
|
90
|
+
const { value } = harness.compileAndRun("state", `
|
|
91
|
+
import { createWindow, run } from "gui";
|
|
92
|
+
|
|
93
|
+
const HTML = \`
|
|
94
|
+
<html><head><style>
|
|
95
|
+
body { margin: 0; }
|
|
96
|
+
#box { width: 100px; height: 50px; background: #000000; }
|
|
97
|
+
#box:hover { background: #ff0000; }
|
|
98
|
+
#box:focus { background: #00ff00; }
|
|
99
|
+
#box:hover > #inner { color: #0000ff; }
|
|
100
|
+
#inner { width: 20px; height: 20px; color: #888888; }
|
|
101
|
+
</style></head><body>
|
|
102
|
+
<div id="box"><div id="inner">x</div></div>
|
|
103
|
+
</body></html>
|
|
104
|
+
\`;
|
|
105
|
+
|
|
106
|
+
const win = createWindow({ title: "state", width: 400, height: 300 });
|
|
107
|
+
win.on("ready", () => {
|
|
108
|
+
console.log("initial-bg=" + win.computedStyle("#box", "background-color"));
|
|
109
|
+
console.log("initial-color=" + win.computedStyle("#inner", "color"));
|
|
110
|
+
win.sendEvent("mousemove", { x: 50, y: 40 });
|
|
111
|
+
console.log("hover-bg=" + win.computedStyle("#box", "background-color"));
|
|
112
|
+
win.sendEvent("mousemove", { x: 5, y: 5 });
|
|
113
|
+
console.log("inner-hover-color=" + win.computedStyle("#inner", "color"));
|
|
114
|
+
win.sendEvent("mousedown", { x: 50, y: 40, button: 0 });
|
|
115
|
+
console.log("focus-bg=" + win.computedStyle("#box", "background-color"));
|
|
116
|
+
win.close();
|
|
117
|
+
});
|
|
118
|
+
win.loadHTML(HTML);
|
|
119
|
+
run();
|
|
120
|
+
`);
|
|
121
|
+
expect(value("initial-bg")).toBe("rgb(0, 0, 0)"); // no :hover rule match
|
|
122
|
+
expect(value("initial-color")).toBe("rgb(136, 136, 136)");
|
|
123
|
+
expect(value("hover-bg")).toBe("rgb(255, 0, 0)"); // hovering #box
|
|
124
|
+
// Hover also applies to ancestors of the hovered element.
|
|
125
|
+
expect(value("inner-hover-color")).toBe("rgb(0, 0, 255)");
|
|
126
|
+
expect(value("focus-bg")).toBe("rgb(0, 255, 0)"); // :focus wins over :hover
|
|
127
|
+
});
|
|
128
|
+
it("interpolates CSS transitions as the clock advances", () => {
|
|
129
|
+
const { value } = harness.compileAndRun("transition", `
|
|
130
|
+
import { createWindow, run } from "gui";
|
|
131
|
+
|
|
132
|
+
const HTML = \`
|
|
133
|
+
<html><head><style>
|
|
134
|
+
body { margin: 0; }
|
|
135
|
+
#box {
|
|
136
|
+
width: 100px; height: 50px; background-color: #000000; color: #888888;
|
|
137
|
+
border-radius: 0px;
|
|
138
|
+
transition: background-color 1000ms linear, color 500ms linear, border-radius 1000ms linear;
|
|
139
|
+
}
|
|
140
|
+
#box:hover { background-color: #ffffff; color: #0000ff; border-radius: 10px; }
|
|
141
|
+
</style></head><body>
|
|
142
|
+
<div id="box">hi</div>
|
|
143
|
+
</body></html>
|
|
144
|
+
\`;
|
|
145
|
+
|
|
146
|
+
const win = createWindow({ title: "transition", width: 400, height: 300 });
|
|
147
|
+
win.on("ready", () => {
|
|
148
|
+
win.sendEvent("mousemove", { x: 50, y: 25 });
|
|
149
|
+
console.log("start=" + win.computedStyle("#box", "background-color"));
|
|
150
|
+
win.advance(250);
|
|
151
|
+
console.log("q1-bg=" + win.computedStyle("#box", "background-color"));
|
|
152
|
+
console.log("q1-color=" + win.computedStyle("#box", "color"));
|
|
153
|
+
win.advance(250);
|
|
154
|
+
console.log("q2-bg=" + win.computedStyle("#box", "background-color"));
|
|
155
|
+
console.log("q2-color=" + win.computedStyle("#box", "color"));
|
|
156
|
+
console.log("q2-radius=" + win.computedStyle("#box", "border-radius"));
|
|
157
|
+
win.advance(500);
|
|
158
|
+
console.log("end-bg=" + win.computedStyle("#box", "background-color"));
|
|
159
|
+
console.log("end-radius=" + win.computedStyle("#box", "border-radius"));
|
|
160
|
+
win.close();
|
|
161
|
+
});
|
|
162
|
+
win.loadHTML(HTML);
|
|
163
|
+
run();
|
|
164
|
+
`);
|
|
165
|
+
expect(value("start")).toBe("rgb(0, 0, 0)"); // 0% progress at t=0
|
|
166
|
+
expect(value("q1-bg")).toBe("rgb(64, 64, 64)"); // 25% of black->white
|
|
167
|
+
expect(value("q1-color")).toBe("rgb(68, 68, 196)"); // 50% of the 500ms color run
|
|
168
|
+
expect(value("q2-bg")).toBe("rgb(128, 128, 128)"); // halfway
|
|
169
|
+
expect(value("q2-color")).toBe("rgb(0, 0, 255)"); // finished
|
|
170
|
+
expect(value("q2-radius")).toBe("5px");
|
|
171
|
+
expect(value("end-bg")).toBe("rgb(255, 255, 255)"); // finished
|
|
172
|
+
expect(value("end-radius")).toBe("10px");
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
//# sourceMappingURL=gui-style.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gui-style.test.js","sourceRoot":"","sources":["../../../tests/e2e/gui-style.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;AAEnC,QAAQ,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAC3D,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAElC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,aAAa,CACrC,SAAS,EACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6DC,CACF,CAAC;QAEF,MA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U,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,6BAA6B;QACjF,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,UAAU;QAC7D,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,WAAW;QAC7D,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW;QAC/D,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -14,6 +14,8 @@ export interface RunOptions {
|
|
|
14
14
|
timeout?: number;
|
|
15
15
|
/** Extra modules written next to the entry file, keyed by relative path. */
|
|
16
16
|
files?: Record<string, string>;
|
|
17
|
+
/** Extra environment variables for the compiled binary (e.g. XT_GC_THRESHOLD). */
|
|
18
|
+
env?: Record<string, string>;
|
|
17
19
|
}
|
|
18
20
|
export interface RunResult {
|
|
19
21
|
stdout: string;
|
|
@@ -51,6 +51,7 @@ export function describeE2E(name, define, options = {}) {
|
|
|
51
51
|
expect(result.diagnostics.filter((d) => d.category === "error")).toEqual([]);
|
|
52
52
|
const executed = spawnSync(result.outputPath, [], {
|
|
53
53
|
encoding: "utf8",
|
|
54
|
+
...(runOptions.env ? { env: { ...process.env, ...runOptions.env } } : {}),
|
|
54
55
|
...(runOptions.timeout ? { timeout: runOptions.timeout } : {}),
|
|
55
56
|
});
|
|
56
57
|
return { stdout: executed.stdout ?? "", stderr: executed.stderr ?? "", status: executed.status };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../../../tests/e2e/harness.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,iBAAiB,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"harness.js","sourceRoot":"","sources":["../../../tests/e2e/harness.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,qBA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,EAAE,aAAyB,EAAE;gBACpD,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;gBAClD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAC9B,CAAC;YACD,cAAc;YACd,cAAc;YACd,sBAAsB,CAAC,MAAc,EAAE,aAAyB,EAAE;gBAChE,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;gBACpD,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE;oBACpC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBACrD,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC9D,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACzD,CAAC,CAAC;gBACH,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end icon tests: compile a GUI program with `app.icon`, run it headless
|
|
3
|
+
* and verify the icon bytes really ended up in the binary. The macOS bundle
|
|
4
|
+
* branch is exercised on darwin only. Skipped where the GUI archive is missing
|
|
5
|
+
* (run `npm run gui`) or on Windows.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-to-end icon tests: compile a GUI program with `app.icon`, run it headless
|
|
3
|
+
* and verify the icon bytes really ended up in the binary. The macOS bundle
|
|
4
|
+
* branch is exercised on darwin only. Skipped where the GUI archive is missing
|
|
5
|
+
* (run `npm run gui`) or on Windows.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { spawnSync } from "node:child_process";
|
|
11
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
12
|
+
import { build } from "../../src/driver/compiler.js";
|
|
13
|
+
import { createDefaultRegistry } from "../../src/extensions/registry.js";
|
|
14
|
+
import { guiExtension } from "../../src/extensions/gui/index.js";
|
|
15
|
+
import { guiAvailable } from "./gui-helpers.js";
|
|
16
|
+
const LOGO_PNG_BASE64 = "iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAFElEQVR42mP4z8DwH4Sh1H8G0gUALFAf4eNWqTEAAAAASUVORK5CYII=";
|
|
17
|
+
const SOURCE = [
|
|
18
|
+
'import { createWindow, run } from "gui";',
|
|
19
|
+
"const win = createWindow({ title: 'icon', width: 320, height: 240 });",
|
|
20
|
+
"console.log(`window=${win !== undefined}`);",
|
|
21
|
+
"run();",
|
|
22
|
+
].join("\n");
|
|
23
|
+
describe.skipIf(!guiAvailable)("application icon", () => {
|
|
24
|
+
let workdir = "";
|
|
25
|
+
let logoPath = "";
|
|
26
|
+
let png;
|
|
27
|
+
beforeAll(() => {
|
|
28
|
+
workdir = mkdtempSync(join(tmpdir(), "xbintsc-icon-e2e-"));
|
|
29
|
+
png = Buffer.from(LOGO_PNG_BASE64, "base64");
|
|
30
|
+
logoPath = join(workdir, "logo.png");
|
|
31
|
+
writeFileSync(logoPath, png);
|
|
32
|
+
});
|
|
33
|
+
afterAll(() => {
|
|
34
|
+
rmSync(workdir, { recursive: true, force: true });
|
|
35
|
+
});
|
|
36
|
+
function compile(name, app) {
|
|
37
|
+
const entry = join(workdir, `${name}.ts`);
|
|
38
|
+
writeFileSync(entry, SOURCE);
|
|
39
|
+
const result = build(entry, {
|
|
40
|
+
emit: "exe",
|
|
41
|
+
outDir: join(workdir, `out-${name}`),
|
|
42
|
+
cacheDir: join(workdir, `.cache-${name}`),
|
|
43
|
+
extensions: createDefaultRegistry().register(guiExtension),
|
|
44
|
+
preferPrebuilt: true,
|
|
45
|
+
app,
|
|
46
|
+
});
|
|
47
|
+
expect(result.diagnostics.filter((diagnostic) => diagnostic.category === "error")).toEqual([]);
|
|
48
|
+
return result.outputPath;
|
|
49
|
+
}
|
|
50
|
+
it("embeds the icon bytes and runs", () => {
|
|
51
|
+
const outputPath = compile("withicon", { icon: logoPath });
|
|
52
|
+
expect(readFileSync(outputPath).includes(png)).toBe(true);
|
|
53
|
+
const executed = spawnSync(outputPath, [], {
|
|
54
|
+
encoding: "utf8",
|
|
55
|
+
env: { ...process.env, XT_GUI_AUTOCLOSE_MS: "400" },
|
|
56
|
+
});
|
|
57
|
+
expect(executed.status, executed.stderr).toBe(0);
|
|
58
|
+
expect(executed.stdout).toContain("window=true");
|
|
59
|
+
});
|
|
60
|
+
it.skipIf(process.platform !== "darwin")("produces a macOS .app bundle with an icon", () => {
|
|
61
|
+
const entry = join(workdir, "bundled.ts");
|
|
62
|
+
writeFileSync(entry, SOURCE);
|
|
63
|
+
const result = build(entry, {
|
|
64
|
+
emit: "exe",
|
|
65
|
+
outDir: join(workdir, "out-bundled"),
|
|
66
|
+
cacheDir: join(workdir, ".cache-bundled"),
|
|
67
|
+
extensions: createDefaultRegistry().register(guiExtension),
|
|
68
|
+
app: { name: "IconDemo", icon: logoPath, bundle: true, bundleId: "com.example.icondemo" },
|
|
69
|
+
});
|
|
70
|
+
expect(result.diagnostics.filter((diagnostic) => diagnostic.category === "error")).toEqual([]);
|
|
71
|
+
expect(result.bundlePath).toBeDefined();
|
|
72
|
+
const bundle = result.bundlePath;
|
|
73
|
+
expect(existsSync(join(bundle, "Contents", "MacOS", "IconDemo"))).toBe(true);
|
|
74
|
+
expect(existsSync(join(bundle, "Contents", "Resources", "AppIcon.icns"))).toBe(true);
|
|
75
|
+
const plist = readFileSync(join(bundle, "Contents", "Info.plist"), "utf8");
|
|
76
|
+
expect(plist).toContain("<string>com.example.icondemo</string>");
|
|
77
|
+
expect(plist).toContain("<string>AppIcon</string>");
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=icon.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.test.js","sourceRoot":"","sources":["../../../tests/e2e/icon.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,eAAe,GACnB,0GAA0G,CAAC;AAE7G,MAAM,MAAM,GAAG;IACb,0CAA0C;IAC1C,uEAAuE;IACvE,6CAA6C;IAC7C,QAAQ;CACT,CAAC,IAAI,CAAC,IA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CAAC,QAAQ,CAAC,YAAY,CAAC;YAC1D,GAAG,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,sBAAsB,EAAE;SAC1F,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC/F,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAW,CAAC;QAClC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7E,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrF,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;QAC3E,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,uCAAuC,CAAC,CAAC;QACjE,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* End-to-end tests for importing packages from `node_modules`. The bundler
|
|
3
3
|
* resolves a bare specifier up the directory tree, follows the package
|
|
4
4
|
* `exports`/`main` fields and merges the package's ESM sources into the entry
|
|
5
|
-
* module. CommonJS packages (which use `require`) are
|
|
5
|
+
* module. CommonJS packages (which use `require`) are supported when they live
|
|
6
|
+
* under `node_modules`: the bundler gives each one a synthetic `module`/`exports`
|
|
7
|
+
* pair and rewrites `require` calls. `require` in user code (outside
|
|
8
|
+
* `node_modules`) is still rejected by the code generator.
|
|
6
9
|
*
|
|
7
10
|
* Suites are skipped automatically when no clang-compatible compiler is found.
|
|
8
11
|
*/
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* End-to-end tests for importing packages from `node_modules`. The bundler
|
|
3
3
|
* resolves a bare specifier up the directory tree, follows the package
|
|
4
4
|
* `exports`/`main` fields and merges the package's ESM sources into the entry
|
|
5
|
-
* module. CommonJS packages (which use `require`) are
|
|
5
|
+
* module. CommonJS packages (which use `require`) are supported when they live
|
|
6
|
+
* under `node_modules`: the bundler gives each one a synthetic `module`/`exports`
|
|
7
|
+
* pair and rewrites `require` calls. `require` in user code (outside
|
|
8
|
+
* `node_modules`) is still rejected by the code generator.
|
|
6
9
|
*
|
|
7
10
|
* Suites are skipped automatically when no clang-compatible compiler is found.
|
|
8
11
|
*/
|
|
@@ -51,5 +54,48 @@ describeE2E("node_modules packages", (harness) => {
|
|
|
51
54
|
};
|
|
52
55
|
expect(runProgram(source, { files })).toBe("[hi]");
|
|
53
56
|
});
|
|
57
|
+
it("imports named exports from a CommonJS package", () => {
|
|
58
|
+
const source = 'import { pad, extra } from "leftpad";\nconsole.log(pad("5", 3), extra);';
|
|
59
|
+
const files = {
|
|
60
|
+
"node_modules/leftpad/package.json": '{ "name": "leftpad", "main": "index.js" }',
|
|
61
|
+
"node_modules/leftpad/index.js": 'exports.pad = function (s, n) { var out = s; while (out.length < n) out = "0" + out; return out; };\nmodule.exports.extra = 7;',
|
|
62
|
+
};
|
|
63
|
+
expectSameOutputAsNode(source, { files, name: "cjs-named" });
|
|
64
|
+
});
|
|
65
|
+
it("imports the whole `module.exports` object as the default export", () => {
|
|
66
|
+
const source = 'import leftpad from "leftpad";\nconsole.log(leftpad.pad("7", 2), leftpad.extra);';
|
|
67
|
+
const files = {
|
|
68
|
+
"node_modules/leftpad/package.json": '{ "name": "leftpad", "main": "index.js" }',
|
|
69
|
+
"node_modules/leftpad/index.js": 'module.exports = { pad: function (s, n) { return s + n; }, extra: 3 };',
|
|
70
|
+
};
|
|
71
|
+
expectSameOutputAsNode(source, { files, name: "cjs-default" });
|
|
72
|
+
});
|
|
73
|
+
it("follows `require` between CommonJS packages", () => {
|
|
74
|
+
const source = 'import { run } from "usecjs";\nconsole.log(run());';
|
|
75
|
+
const files = {
|
|
76
|
+
"node_modules/leftpad/package.json": '{ "name": "leftpad", "main": "index.js" }',
|
|
77
|
+
"node_modules/leftpad/index.js": 'exports.pad = function (s, n) { var out = s; while (out.length < n) out = "0" + out; return out; };',
|
|
78
|
+
"node_modules/usecjs/package.json": '{ "name": "usecjs", "main": "index.js" }',
|
|
79
|
+
"node_modules/usecjs/index.js": 'var lp = require("leftpad");\nmodule.exports.run = function () { return lp.pad("5", 3); };',
|
|
80
|
+
};
|
|
81
|
+
expectSameOutputAsNode(source, { files, name: "cjs-require" });
|
|
82
|
+
});
|
|
83
|
+
it("requires an ESM module from CommonJS", () => {
|
|
84
|
+
const source = 'import f from "c";\nconsole.log(f());';
|
|
85
|
+
const files = {
|
|
86
|
+
"node_modules/c/package.json": '{ "name": "c", "main": "index.js" }',
|
|
87
|
+
"node_modules/c/index.js": 'var dep = require("./dep.js");\nmodule.exports = function () { return dep.hello(); };',
|
|
88
|
+
"node_modules/c/dep.js": 'export function hello() { return "from-esm"; }',
|
|
89
|
+
};
|
|
90
|
+
expectSameOutputAsNode(source, { files, name: "cjs-require-esm" });
|
|
91
|
+
});
|
|
92
|
+
it("supports `require` of a built-in from a CommonJS package", () => {
|
|
93
|
+
const source = 'import f from "usepath";\nconsole.log(f());';
|
|
94
|
+
const files = {
|
|
95
|
+
"node_modules/usepath/package.json": '{ "name": "usepath", "main": "index.js" }',
|
|
96
|
+
"node_modules/usepath/index.js": 'const { basename } = require("node:path");\nmodule.exports = function () { return basename("/a/b/c.txt"); };',
|
|
97
|
+
};
|
|
98
|
+
expectSameOutputAsNode(source, { files, name: "cjs-builtin", extensions: true });
|
|
99
|
+
});
|
|
54
100
|
});
|
|
55
101
|
//# sourceMappingURL=npm-modules.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm-modules.test.js","sourceRoot":"","sources":["../../../tests/e2e/npm-modules.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"npm-modules.test.js","sourceRoot":"","sources":["../../../tests/e2e/npm-modules.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,WAAW,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE;IAC/C,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC;IAEvD,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,MAAM,GAAG,8DAA8D,CAAC;QAC9E,MAAM,KAAK,GAAG;YACZ,iCAAiC,EAAE,+EAA+E;YAClH,6BAA6B,EAC3B,oEAAoE;SACvE,CAAC;QACF,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,MAAM,GAAG;;;KAGd,CAAC;QACF,MAAM,KAAK,GAAG;YACZ,iCAAiC,EAAE,2DAA2D;YAC9F,6BAA6B,EAC3B,kHAAkH;SACrH,CAAC;QACF,sBAAsB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,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CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,MAAM,GAAG,oDAAoD,CAAC;QACpE,MAAM,KAAK,GAAG;YACZ,mCAAmC,EAAE,2CAA2C;YAChF,+BAA+B,EAC7B,qGAAqG;YACvG,kCAAkC,EAAE,0CAA0C;YAC9E,8BAA8B,EAC5B,4FAA4F;SAC/F,CAAC;QACF,sBAAsB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,MAAM,GAAG,uCAAuC,CAAC;QACvD,MAAM,KAAK,GAAG;YACZ,6BAA6B,EAAE,qCAAqC;YACpE,yBAAyB,EACvB,uFAAuF;YACzF,uBAAuB,EAAE,gDAAgD;SAC1E,CAAC;QACF,sBAAsB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAClE,MAAM,MAAM,GAAG,6CAA6C,CAAC;QAC7D,MAAM,KAAK,GAAG;YACZ,mCAAmC,EAAE,2CAA2C;YAChF,+BAA+B,EAC7B,8GAA8G;SACjH,CAAC;QACF,sBAAsB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-coverage tests for typed arrays (Uint8Array, Int32Array, ...).
|
|
3
|
+
*
|
|
4
|
+
* `subarray` is documented as returning a copy, so the suite deliberately only
|
|
5
|
+
* exercises it through observationally equivalent operations; `keys`/`values`/
|
|
6
|
+
* `entries` return arrays rather than iterators, hence the `Array.from` wrappers
|
|
7
|
+
* that work with both.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|