xbintsc 0.6.22 → 0.6.24
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/AGENTS.md +5 -0
- package/dist/src/cli/help.d.ts +1 -1
- package/dist/src/driver/build-key.js +2 -1
- package/dist/src/driver/build-key.js.map +1 -1
- package/dist/src/driver/bundler/concatenate.d.ts +23 -0
- package/dist/src/driver/bundler/concatenate.js +210 -0
- package/dist/src/driver/bundler/concatenate.js.map +1 -0
- package/dist/src/driver/bundler/merge.d.ts +4 -4
- package/dist/src/driver/bundler/merge.js +24 -207
- package/dist/src/driver/bundler/merge.js.map +1 -1
- package/dist/src/driver/bundler/{namespace-import.d.ts → namespace-object.d.ts} +5 -1
- package/dist/src/driver/bundler/{namespace-import.js → namespace-object.js} +6 -2
- package/dist/src/driver/bundler/namespace-object.js.map +1 -0
- package/dist/src/driver/bundler/{reexport-fixup.d.ts → reexport-resolution.d.ts} +9 -3
- package/dist/src/driver/bundler/{reexport-fixup.js → reexport-resolution.js} +16 -6
- package/dist/src/driver/bundler/reexport-resolution.js.map +1 -0
- package/dist/src/driver/fingerprint.d.ts +11 -0
- package/dist/src/driver/fingerprint.js +25 -0
- package/dist/src/driver/fingerprint.js.map +1 -1
- package/dist/src/driver/link-features.js +36 -11
- package/dist/src/driver/link-features.js.map +1 -1
- package/dist/src/driver/modules.d.ts +12 -5
- package/dist/src/driver/modules.js +12 -5
- package/dist/src/driver/modules.js.map +1 -1
- package/dist/src/driver/paths.d.ts +10 -0
- package/dist/src/driver/paths.js +18 -0
- package/dist/src/driver/paths.js.map +1 -1
- package/dist/src/driver/runtime-objects.d.ts +1 -1
- package/dist/src/driver/runtime-objects.js +22 -6
- package/dist/src/driver/runtime-objects.js.map +1 -1
- package/dist/src/driver/toolchain.d.ts +1 -1
- package/dist/src/driver/toolchain.js +10 -1
- package/dist/src/driver/toolchain.js.map +1 -1
- package/dist/src/driver/version.d.ts +1 -1
- package/dist/src/driver/version.js +1 -1
- package/dist/src/extensions/node/http2/feature.d.ts +14 -0
- package/dist/src/extensions/node/http2/feature.js +28 -0
- package/dist/src/extensions/node/http2/feature.js.map +1 -0
- package/dist/src/extensions/node/http2/index.d.ts +5 -1
- package/dist/src/extensions/node/http2/index.js +6 -1
- package/dist/src/extensions/node/http2/index.js.map +1 -1
- package/dist/src/extensions/node/index.js +3 -1
- package/dist/src/extensions/node/index.js.map +1 -1
- package/dist/src/extensions/node/tls/feature.d.ts +12 -0
- package/dist/src/extensions/node/tls/feature.js +24 -0
- package/dist/src/extensions/node/tls/feature.js.map +1 -0
- package/dist/src/extensions/node/tls/index.d.ts +5 -1
- package/dist/src/extensions/node/tls/index.js +5 -1
- package/dist/src/extensions/node/tls/index.js.map +1 -1
- package/dist/src/extensions/node/zlib/compression.js +11 -6
- package/dist/src/extensions/node/zlib/compression.js.map +1 -1
- package/dist/src/extensions/registry.js +2 -1
- package/dist/src/extensions/registry.js.map +1 -1
- package/dist/src/extensions/storage.js +4 -3
- package/dist/src/extensions/storage.js.map +1 -1
- package/dist/src/extensions/tls.d.ts +26 -0
- package/dist/src/extensions/tls.js +46 -0
- package/dist/src/extensions/tls.js.map +1 -0
- package/dist/tests/driver/deferred-reexport.test.js +25 -0
- package/dist/tests/driver/deferred-reexport.test.js.map +1 -1
- package/dist/tests/driver/link-features.test.js +9 -0
- package/dist/tests/driver/link-features.test.js.map +1 -1
- package/dist/tests/e2e/fetch.test.js +3 -1
- package/dist/tests/e2e/fetch.test.js.map +1 -1
- package/dist/tests/e2e/http2.test.d.ts +7 -0
- package/dist/tests/e2e/http2.test.js +201 -0
- package/dist/tests/e2e/http2.test.js.map +1 -0
- package/dist/tests/e2e/net-helpers.d.ts +28 -0
- package/dist/tests/e2e/net-helpers.js +59 -0
- package/dist/tests/e2e/net-helpers.js.map +1 -0
- package/dist/tests/e2e/node-modules.test.js +3 -5
- package/dist/tests/e2e/node-modules.test.js.map +1 -1
- package/dist/tests/e2e/tls.test.d.ts +10 -0
- package/dist/tests/e2e/tls.test.js +197 -0
- package/dist/tests/e2e/tls.test.js.map +1 -0
- package/dist/tests/extensions/storage.test.js +3 -2
- package/dist/tests/extensions/storage.test.js.map +1 -1
- package/doc/ai/contributing.md +14 -0
- package/doc/ai/extensions.md +5 -3
- package/doc/ai/language-support.md +1 -1
- package/doc/ai/zh-CN/contributing.md +12 -0
- package/doc/ai/zh-CN/extensions.md +4 -2
- package/doc/ai/zh-CN/language-support.md +1 -1
- package/doc/gui/api.md +1 -1
- package/doc/gui/build.md +5 -3
- package/doc/gui/rendering.md +1 -1
- package/doc/gui.md +1 -1
- package/doc/implemented/async.md +1 -1
- package/doc/implemented/extensions.md +1 -0
- package/doc/implemented/fetch.md +19 -4
- package/doc/implemented/node/http2.md +51 -0
- package/doc/implemented/node/tls.md +56 -0
- package/doc/implemented/node.md +8 -0
- package/doc/implemented/storage.md +2 -1
- package/doc/implemented.md +2 -2
- package/doc/unimplemented/node/modules.md +6 -6
- package/doc/unimplemented/toolchain.md +1 -1
- package/doc/zh-CN/gui/api.md +1 -1
- package/doc/zh-CN/gui/build.md +4 -2
- package/doc/zh-CN/gui/rendering.md +1 -1
- package/doc/zh-CN/gui.md +1 -1
- package/doc/zh-CN/implemented/async.md +1 -1
- package/doc/zh-CN/implemented/extensions.md +1 -0
- package/doc/zh-CN/implemented/fetch.md +15 -3
- package/doc/zh-CN/implemented/node/http2.md +44 -0
- package/doc/zh-CN/implemented/node/tls.md +47 -0
- package/doc/zh-CN/implemented/node.md +7 -0
- package/doc/zh-CN/implemented/storage.md +2 -1
- package/doc/zh-CN/implemented.md +2 -2
- package/doc/zh-CN/unimplemented/node/modules.md +3 -3
- package/doc/zh-CN/unimplemented/toolchain.md +1 -1
- package/package.json +16 -8
- package/runtime/ext_node/http2/http2.c +25 -11
- package/runtime/ext_node/http2/http2_backend.c +48 -0
- package/runtime/ext_node/http2/http2_bridge.c +25 -0
- package/runtime/ext_node/http2/parts/api.inc +40 -0
- package/runtime/ext_node/http2/parts/client.inc +215 -0
- package/runtime/ext_node/http2/parts/common.inc +330 -0
- package/runtime/ext_node/http2/parts/events.inc +139 -0
- package/runtime/ext_node/http2/parts/server.inc +301 -0
- package/runtime/ext_node/http2/parts/streams.inc +254 -0
- package/runtime/ext_node/tls/parts/api.inc +38 -0
- package/runtime/ext_node/tls/parts/connect.inc +107 -0
- package/runtime/ext_node/tls/parts/helpers.inc +121 -0
- package/runtime/ext_node/tls/parts/server.inc +101 -0
- package/runtime/ext_node/tls/parts/socket.inc +171 -0
- package/runtime/ext_node/tls/tls.c +21 -13
- package/runtime/ext_node/tls/tls_backend.c +50 -0
- package/runtime/ext_node/zlib/{miniz/compression_bridge.c → compression_bridge.c} +1 -1
- package/runtime/xt_fetch/async.inc +19 -12
- package/runtime/xt_fetch/socket.inc +55 -0
- package/runtime/xt_fetch.c +3 -0
- package/runtime/xt_http2/nghttp2_compat.h +19 -0
- package/runtime/xt_http2/nghttp2_static.h +18 -0
- package/runtime/xt_http2_api.h +38 -0
- package/runtime/xt_node_tls_api.h +37 -0
- package/runtime/xt_protocol_registry.c +22 -0
- package/runtime/xt_storage/storage_internal.h +3 -3
- package/runtime/xt_tls/parts/api.inc +21 -0
- package/runtime/xt_tls/parts/client.inc +112 -0
- package/runtime/xt_tls/parts/io.inc +157 -0
- package/runtime/xt_tls/parts/server.inc +102 -0
- package/runtime/xt_tls/parts/setup.inc +146 -0
- package/runtime/xt_tls/tls_bridge.c +27 -0
- package/runtime/xt_tls/tls_core.c +39 -0
- package/runtime/xt_tls/tls_internal.h +73 -0
- package/runtime/xt_tls_api.h +73 -0
- package/scripts/build-gui.ts +8 -7
- package/scripts/build-tls.ts +248 -0
- package/scripts/check-file-length.ts +4 -25
- package/scripts/fetch-vendored.ts +244 -0
- package/scripts/package-release.ts +13 -3
- package/src/driver/build-key.ts +7 -1
- package/src/driver/bundler/README.md +55 -0
- package/src/driver/bundler/concatenate.ts +244 -0
- package/src/driver/bundler/merge.ts +24 -215
- package/src/driver/bundler/{namespace-import.ts → namespace-object.ts} +5 -1
- package/src/driver/bundler/{reexport-fixup.ts → reexport-resolution.ts} +15 -5
- package/src/driver/fingerprint.ts +24 -0
- package/src/driver/link-features.ts +33 -11
- package/src/driver/modules.ts +12 -5
- package/src/driver/paths.ts +20 -0
- package/src/driver/runtime-objects.ts +25 -6
- package/src/driver/toolchain.ts +11 -2
- package/src/driver/version.ts +1 -1
- package/src/extensions/node/http2/feature.ts +33 -0
- package/src/extensions/node/http2/index.ts +6 -1
- package/src/extensions/node/index.ts +3 -1
- package/src/extensions/node/tls/feature.ts +29 -0
- package/src/extensions/node/tls/index.ts +5 -1
- package/src/extensions/node/zlib/compression.ts +11 -6
- package/src/extensions/registry.ts +2 -1
- package/src/extensions/storage.ts +4 -3
- package/src/extensions/tls.ts +52 -0
- package/{runtime/ext_gui → vendor/stb}/stb_image.h +17 -1
- package/dist/src/driver/bundler/namespace-import.js.map +0 -1
- package/dist/src/driver/bundler/reexport-fixup.js.map +0 -1
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz.c +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_common.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_export.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tdef.c +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tdef.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tinfl.c +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_tinfl.h +0 -0
- /package/{runtime/ext_node/zlib → vendor}/miniz/miniz_zip.h +0 -0
- /package/{runtime/ext_gui → vendor/nanosvg}/nanosvg.h +0 -0
- /package/{runtime/ext_gui → vendor/nanosvg}/nanosvgrast.h +0 -0
- /package/{runtime/xt_storage → vendor}/sqlite3/sqlite3.c +0 -0
- /package/{runtime/xt_storage → vendor}/sqlite3/sqlite3.h +0 -0
- /package/{runtime/ext_gui → vendor/stb}/stb_truetype.h +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `http2` link feature: nghttp2-backed `node:http2`.
|
|
3
|
+
*
|
|
4
|
+
* HTTP/2 framing and HPACK come from the vendored nghttp2 archive; TLS (and
|
|
5
|
+
* therefore ALPN) comes from the `tls` feature, and the JavaScript object
|
|
6
|
+
* surface reuses `node-tls`'s server wrapper for `createSecureServer`. The
|
|
7
|
+
* always-linked `http2` module forwards to the dispatch table this feature
|
|
8
|
+
* installs, so a checkout without the archive still compiles and reports a
|
|
9
|
+
* clear runtime error instead of failing to link.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { LinkFeature, ProgramUsage } from "../../link-feature.js";
|
|
13
|
+
import { resolveFrom } from "../module.js";
|
|
14
|
+
import { requireRuntimeLibrary } from "../../tls.js";
|
|
15
|
+
|
|
16
|
+
/** True when the bundled program imports `http2` or uses its server API. */
|
|
17
|
+
export function mentionsHttp2(usage: ProgramUsage): boolean {
|
|
18
|
+
return (
|
|
19
|
+
usage.strings.includes("http2") ||
|
|
20
|
+
usage.strings.includes("node:http2") ||
|
|
21
|
+
usage.identifiers.has("createSecureServer") ||
|
|
22
|
+
usage.identifiers.has("Http2Session")
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const http2Feature: LinkFeature = {
|
|
27
|
+
name: "http2",
|
|
28
|
+
description: "node:http2 client and server using nghttp2 over TLS or cleartext",
|
|
29
|
+
requires: ["tls", "node-tls"],
|
|
30
|
+
runtimeSources: () => [resolveFrom(import.meta.url, "../../../../runtime/ext_node/http2/http2_bridge.c")],
|
|
31
|
+
nativeObjects: () => [requireRuntimeLibrary("nghttp2", "npm run tls")],
|
|
32
|
+
used: mentionsHttp2,
|
|
33
|
+
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Node's `http2` module —
|
|
2
|
+
* Node's `http2` module — importable bindings.
|
|
3
|
+
*
|
|
4
|
+
* The implementation is the optional `http2` link feature (nghttp2 over
|
|
5
|
+
* cleartext h2c or TLS/ALPN `h2`); this module keeps the import surface stable
|
|
6
|
+
* and forwards to it. See `feature.ts` for the feature selection.
|
|
3
7
|
*/
|
|
4
8
|
|
|
5
9
|
import type { NodeModule } from "../module.js";
|
|
@@ -10,6 +14,7 @@ const exports: ModuleExports = {
|
|
|
10
14
|
connect: { symbol: "xt_http2_connect" },
|
|
11
15
|
createServer: { symbol: "xt_http2_create_server" },
|
|
12
16
|
createSecureServer: { symbol: "xt_http2_create_secure_server" },
|
|
17
|
+
constants: { valueSymbol: "xt_http2_constants" },
|
|
13
18
|
};
|
|
14
19
|
|
|
15
20
|
export const http2Module: NodeModule = {
|
|
@@ -52,6 +52,8 @@ import { sqliteModule } from "./sqlite/index.js";
|
|
|
52
52
|
import { streamWebModule } from "./stream-web/index.js";
|
|
53
53
|
import { tlsModule } from "./tls/index.js";
|
|
54
54
|
import { http2Module } from "./http2/index.js";
|
|
55
|
+
import { nodeTlsFeature } from "./tls/feature.js";
|
|
56
|
+
import { http2Feature } from "./http2/feature.js";
|
|
55
57
|
|
|
56
58
|
/** Every Node module the extension currently provides. */
|
|
57
59
|
const modules: readonly NodeModule[] = [
|
|
@@ -118,5 +120,5 @@ export const nodeExtension: Extension = {
|
|
|
118
120
|
}
|
|
119
121
|
return exposed;
|
|
120
122
|
},
|
|
121
|
-
linkFeatures: () => [compressionFeature],
|
|
123
|
+
linkFeatures: () => [compressionFeature, nodeTlsFeature, http2Feature],
|
|
122
124
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `node-tls` link feature: the JavaScript surface of `node:tls`.
|
|
3
|
+
*
|
|
4
|
+
* The always-linked `tls` module keeps the importable bindings and reports a
|
|
5
|
+
* clear runtime error when the feature is absent. When a program imports
|
|
6
|
+
* `node:tls`, this feature compiles the backend that builds `TLSSocket`
|
|
7
|
+
* objects on top of the `tls` feature's mbedTLS transport.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { LinkFeature, ProgramUsage } from "../../link-feature.js";
|
|
11
|
+
import { resolveFrom } from "../module.js";
|
|
12
|
+
|
|
13
|
+
/** True when the bundled program imports `tls` or names its main class. */
|
|
14
|
+
export function mentionsNodeTls(usage: ProgramUsage): boolean {
|
|
15
|
+
return (
|
|
16
|
+
usage.strings.includes("tls") ||
|
|
17
|
+
usage.strings.includes("node:tls") ||
|
|
18
|
+
usage.identifiers.has("TLSSocket") ||
|
|
19
|
+
usage.identifiers.has("createSecureServer")
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const nodeTlsFeature: LinkFeature = {
|
|
24
|
+
name: "node-tls",
|
|
25
|
+
description: "node:tls TLSSocket/client/server on top of mbedTLS",
|
|
26
|
+
requires: ["tls"],
|
|
27
|
+
runtimeSources: () => [resolveFrom(import.meta.url, "../../../../runtime/ext_node/tls/tls_backend.c")],
|
|
28
|
+
used: mentionsNodeTls,
|
|
29
|
+
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Node's `tls` module —
|
|
2
|
+
* Node's `tls` module — importable bindings.
|
|
3
|
+
*
|
|
4
|
+
* The implementation is the optional `node-tls` link feature (mbedTLS-backed
|
|
5
|
+
* `TLSSocket`, `connect` and `createServer`); this module keeps the import
|
|
6
|
+
* surface stable and forwards to it. See `feature.ts` for feature selection.
|
|
3
7
|
*/
|
|
4
8
|
|
|
5
9
|
import type { NodeModule } from "../module.js";
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* and installs its raw-DEFLATE backend into the `zlib` module.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import { join } from "node:path";
|
|
10
11
|
import type { LinkFeature, ProgramUsage } from "../../link-feature.js";
|
|
12
|
+
import { findVendorDir } from "../../../driver/paths.js";
|
|
11
13
|
import { resolveFrom } from "../module.js";
|
|
12
14
|
|
|
13
15
|
const COMPRESSION_IDENTIFIERS: ReadonlySet<string> = new Set([
|
|
@@ -37,12 +39,15 @@ const COMPRESSION_IDENTIFIERS: ReadonlySet<string> = new Set([
|
|
|
37
39
|
export const compressionFeature: LinkFeature = {
|
|
38
40
|
name: "compression",
|
|
39
41
|
description: "miniz DEFLATE compression/decompression for node:zlib",
|
|
40
|
-
runtimeSources: () =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
runtimeSources: () => {
|
|
43
|
+
const miniz = join(findVendorDir(), "miniz");
|
|
44
|
+
return [
|
|
45
|
+
join(miniz, "miniz.c"),
|
|
46
|
+
join(miniz, "miniz_tdef.c"),
|
|
47
|
+
join(miniz, "miniz_tinfl.c"),
|
|
48
|
+
resolveFrom(import.meta.url, "../../../../runtime/ext_node/zlib/compression_bridge.c"),
|
|
49
|
+
];
|
|
50
|
+
},
|
|
46
51
|
used: (usage: ProgramUsage): boolean =>
|
|
47
52
|
[...usage.identifiers].some((name) => COMPRESSION_IDENTIFIERS.has(name)),
|
|
48
53
|
};
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import type { LinkFeature } from "./link-feature.js";
|
|
15
15
|
import { storageGlobals, storageLinkFeatures } from "./storage.js";
|
|
16
|
+
import { tlsFeature } from "./tls.js";
|
|
16
17
|
|
|
17
18
|
export interface BuiltinFunction {
|
|
18
19
|
/** Exported C symbol, called as `xt_value symbol(int32_t argc, xt_value *argv)`. */
|
|
@@ -355,7 +356,7 @@ export const coreExtension: Extension = {
|
|
|
355
356
|
print: { symbol: "xt_println" },
|
|
356
357
|
}),
|
|
357
358
|
globalValues: () => storageGlobals,
|
|
358
|
-
linkFeatures: () => storageLinkFeatures,
|
|
359
|
+
linkFeatures: () => [...storageLinkFeatures, tlsFeature],
|
|
359
360
|
};
|
|
360
361
|
|
|
361
362
|
export function createDefaultRegistry(): ExtensionRegistry {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { join } from "node:path";
|
|
18
18
|
import type { GlobalValue } from "./registry.js";
|
|
19
19
|
import type { LinkFeature, ProgramUsage } from "./link-feature.js";
|
|
20
|
-
import { findRuntimeDir } from "../driver/paths.js";
|
|
20
|
+
import { findRuntimeDir, findVendorDir } from "../driver/paths.js";
|
|
21
21
|
|
|
22
22
|
/** The browser storage globals resolved by the core extension. */
|
|
23
23
|
export const storageGlobals: Readonly<Record<string, GlobalValue>> = {
|
|
@@ -44,10 +44,11 @@ export const storageLinkFeatures: readonly LinkFeature[] = [
|
|
|
44
44
|
* sources, so it is compiled and linked only when the feature is active.
|
|
45
45
|
* `storage.c` defines the `xt_storage_local` / `xt_storage_session` globals
|
|
46
46
|
* the code generator reaches for, and `indexed_db.c` / `indexed_db_store.c`
|
|
47
|
-
* define `xt_storage_indexed_db`; all three reference the vendored SQLite
|
|
47
|
+
* define `xt_storage_indexed_db`; all three reference the vendored SQLite
|
|
48
|
+
* fetched into `vendor/sqlite3` (see `npm run vendor`).
|
|
48
49
|
*/
|
|
49
50
|
runtimeSources: () => [
|
|
50
|
-
join(
|
|
51
|
+
join(findVendorDir(), "sqlite3", "sqlite3.c"),
|
|
51
52
|
join(findRuntimeDir(), "xt_storage", "storage.c"),
|
|
52
53
|
join(findRuntimeDir(), "xt_storage", "indexed_db.c"),
|
|
53
54
|
join(findRuntimeDir(), "xt_storage", "indexed_db_store.c"),
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `tls` link feature: mbedTLS, used by `fetch` for `https://` URLs.
|
|
3
|
+
*
|
|
4
|
+
* TLS is heavy (~200 KiB of mbedTLS code) and most programs never make an
|
|
5
|
+
* HTTPS request, so it is an optional feature of the always-on `core`
|
|
6
|
+
* extension. The driver scans the bundled program for an `https://` literal and
|
|
7
|
+
* only then compiles `runtime/xt_tls/tls_bridge.c` and links the mbedTLS
|
|
8
|
+
* archive (which contains `tls_core.c`); the always-linked runtime reaches the
|
|
9
|
+
* backend through the `xt_tls_core_api` dispatch table, which stays NULL
|
|
10
|
+
* otherwise.
|
|
11
|
+
*
|
|
12
|
+
* `node:tls` and `node:http2` declare their own features that `requires` this
|
|
13
|
+
* one, and `--feature tls` forces it for a URL the scan cannot see. The archive
|
|
14
|
+
* is produced by `npm run tls`; without it the feature is reported unavailable
|
|
15
|
+
* and HTTPS requests reject with a clear runtime error.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { resolve } from "node:path";
|
|
19
|
+
import { findRuntimeDir } from "../driver/paths.js";
|
|
20
|
+
import { findRuntimeLibrary } from "../driver/runtime-lib.js";
|
|
21
|
+
import type { LinkFeature, ProgramUsage } from "./link-feature.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a prebuilt third-party archive, or throw with the command that builds
|
|
25
|
+
* it. `resolveLinkFeatures` turns the throw into a warning for an auto-detected
|
|
26
|
+
* feature and into an error for an explicitly forced one.
|
|
27
|
+
*/
|
|
28
|
+
export function requireRuntimeLibrary(name: string, buildCommand: string): string {
|
|
29
|
+
const archive = findRuntimeLibrary(name);
|
|
30
|
+
if (archive === undefined) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`the '${name}' archive is not built; run \`${buildCommand}\` to fetch and build it`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return archive;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** True when a string literal names an HTTPS URL. */
|
|
39
|
+
export function mentionsHttps(usage: ProgramUsage): boolean {
|
|
40
|
+
return usage.strings.some((text) => /^https:\/\//i.test(text));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const tlsFeature: LinkFeature = {
|
|
44
|
+
name: "tls",
|
|
45
|
+
description: "mbedTLS TLS transport used by fetch() for https:// URLs and node:tls",
|
|
46
|
+
runtimeSources: () => [resolve(findRuntimeDir(), "xt_tls", "tls_bridge.c")],
|
|
47
|
+
nativeObjects: () => [requireRuntimeLibrary("tls", "npm run tls")],
|
|
48
|
+
// Windows reads its root certificate store through crypt32; the Win32 socket
|
|
49
|
+
// and bcrypt libraries are already linked by the driver.
|
|
50
|
+
linkerFlags: () => (process.platform === "win32" ? ["-lcrypt32"] : []),
|
|
51
|
+
used: (usage: ProgramUsage): boolean => mentionsHttps(usage) || usage.identifiers.has("TLSSocket"),
|
|
52
|
+
};
|
|
@@ -706,6 +706,21 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
|
|
|
706
706
|
#define STBI_NO_SIMD
|
|
707
707
|
#endif
|
|
708
708
|
|
|
709
|
+
#if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD)
|
|
710
|
+
// Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET
|
|
711
|
+
//
|
|
712
|
+
// 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the
|
|
713
|
+
// Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant.
|
|
714
|
+
// As a result, enabling SSE2 on 32-bit MinGW is dangerous when not
|
|
715
|
+
// simultaneously enabling "-mstackrealign".
|
|
716
|
+
//
|
|
717
|
+
// See https://github.com/nothings/stb/issues/81 for more information.
|
|
718
|
+
//
|
|
719
|
+
// So default to no SSE2 on 32-bit MinGW. If you've read this far and added
|
|
720
|
+
// -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2.
|
|
721
|
+
#define STBI_NO_SIMD
|
|
722
|
+
#endif
|
|
723
|
+
|
|
709
724
|
#if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET))
|
|
710
725
|
#define STBI_SSE2
|
|
711
726
|
#include <emmintrin.h>
|
|
@@ -7790,9 +7805,10 @@ STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *c, void *user
|
|
|
7790
7805
|
bug with < 92 byte PIC,PNM,HDR,TGA
|
|
7791
7806
|
2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
|
|
7792
7807
|
2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
|
|
7808
|
+
2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
|
|
7793
7809
|
2.03 (2015-04-12) extra corruption checking (mmozeiko)
|
|
7794
7810
|
stbi_set_flip_vertically_on_load (nguillemot)
|
|
7795
|
-
fix NEON support
|
|
7811
|
+
fix NEON support; fix mingw support
|
|
7796
7812
|
2.02 (2015-01-19) fix incorrect assert, fix warning
|
|
7797
7813
|
2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2
|
|
7798
7814
|
2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"namespace-import.js","sourceRoot":"","sources":["../../../../src/driver/bundler/namespace-import.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,UAAU,GAMX,MAAM,oBAAoB,CAAC;AAG5B,6EAA6E;AAC7E,MAAM,UAAU,0BAA0B,CACxC,SAAoB,EACpB,SAAiB,EACjB,UAAwB;IAExB,MAAM,UAAU,GAAyB,EAAE,CAAC;IAC5C,KAAK,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;QACxD,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,UAAU,CAAC,kBAAkB;YACnC,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,EAAE;YACvG,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,EAAE;YACxG,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,GAAG,EAAE,SAAS,CAAC,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,WAAW,GAA4B;QAC3C,IAAI,EAAE,UAAU,CAAC,uBAAuB;QACxC,UAAU;QACV,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,GAAG,EAAE,SAAS,CAAC,GAAG;KACnB,CAAC;IACF,MAAM,WAAW,GAAwB;QACvC,IAAI,EAAE,UAAU,CAAC,mBAAmB;QACpC,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,EAAE;QACpG,WAAW,EAAE,KAAK;QAClB,WAAW;QACX,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,GAAG,EAAE,SAAS,CAAC,GAAG;KACnB,CAAC;IACF,MAAM,IAAI,GAA4B;QACpC,IAAI,EAAE,UAAU,CAAC,uBAAuB;QACxC,eAAe,EAAE,OAAgB;QACjC,YAAY,EAAE,CAAC,WAAW,CAAC;QAC3B,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,GAAG,EAAE,SAAS,CAAC,GAAG;KACnB,CAAC;IACF,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,iBAAiB;QAClC,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,GAAG,EAAE,SAAS,CAAC,GAAG;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reexport-fixup.js","sourceRoot":"","sources":["../../../../src/driver/bundler/reexport-fixup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,UAAU,GAKX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,0BAA0B,EAAE,MAAM,uB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CAAC;oBAC5E,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;oBAC3E,IAAI,UAAU,EAAE,CAAC;wBACf,mBAAmB,CAAC,GAAG,CACrB,SAAS,EACT,0BAA0B,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,EAAE,UAAU,CAAC,CAC/E,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,IAAI,SAAS,CAAC,IAAI,KAAK,UAAU,CAAC,iBAAiB,EAAE,CAAC;gBAC3D,MAAM,WAAW,GAAG,SAA8B,CAAC;gBACnD,MAAM,MAAM,GAAG,WAAW,CAAC,YAAY,CAAC;gBACxC,IAAI,MAAM,EAAE,UAAU;oBAAE,SAAS;gBACjC,MAAM,QAAQ,GAAG,MAAM,EAAE,aAAa,CAAC;gBACvC,IAAI,QAAQ,EAAE,IAAI,KAAK,UAAU,CAAC,eAAe,EAAE,CAAC;oBAClD,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;oBAC3E,IAAI,UAAU,EAAE,CAAC;wBACf,mBAAmB,CAAC,GAAG,CACrB,SAAS,EACT,0BAA0B,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,UAAU,CAAC,CAC3F,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|