quickjs 0.19.0.pre1 → 0.19.0.pre2

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.
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # FormatJS Intl polyfill (`en` locale only — getCanonicalLocales, Locale,
4
- # PluralRules, NumberFormat, DateTimeFormat). Compiled and cached on first
5
- # VM that enables the feature; the file is not read until then.
6
-
7
- Quickjs.register_polyfill(
8
- Quickjs::POLYFILL_INTL,
9
- source: -> { File.read(File.expand_path('intl-en.min.js', __dir__)) },
10
- init: "Object.defineProperty(globalThis, 'Intl', { value:{} });"
11
- )
@@ -1,72 +0,0 @@
1
- import { readFileSync } from "fs";
2
-
3
- const lock = JSON.parse(readFileSync(new URL("./package-lock.json", import.meta.url)));
4
-
5
- const ROOT_PACKAGES = [
6
- "@formatjs/intl-getcanonicallocales",
7
- "@formatjs/intl-locale",
8
- "@formatjs/intl-pluralrules",
9
- "@formatjs/intl-numberformat",
10
- "@formatjs/intl-datetimeformat",
11
- ];
12
-
13
- const BUILD_ONLY = new Set([
14
- "rolldown", "@rolldown/pluginutils", "@oxc-project/types",
15
- "@emnapi/core", "@emnapi/runtime", "@emnapi/wasi-threads",
16
- "@napi-rs/wasm-runtime", "@tybys/wasm-util",
17
- ]);
18
-
19
- function collectDeps(pkgName, visited = new Set()) {
20
- if (visited.has(pkgName) || BUILD_ONLY.has(pkgName)) return visited;
21
- visited.add(pkgName);
22
- const info = lock.packages[`node_modules/${pkgName}`];
23
- if (!info) return visited;
24
- for (const dep of Object.keys({ ...info.dependencies, ...info.peerDependencies ?? {} })) {
25
- collectDeps(dep, visited);
26
- }
27
- return visited;
28
- }
29
-
30
- const allDeps = new Set();
31
- for (const root of ROOT_PACKAGES) collectDeps(root, allDeps);
32
-
33
- let hasError = false;
34
- const byYear = {};
35
-
36
- for (const pkg of [...allDeps].sort()) {
37
- let licenseText;
38
- try {
39
- licenseText = readFileSync(`node_modules/${pkg}/LICENSE.md`, "utf8");
40
- } catch {
41
- try {
42
- licenseText = readFileSync(`node_modules/${pkg}/LICENSE`, "utf8");
43
- } catch {
44
- console.error(`ERROR: No license file found for ${pkg}`);
45
- hasError = true;
46
- continue;
47
- }
48
- }
49
-
50
- const isMIT = licenseText.includes("MIT License");
51
- const yearMatch = licenseText.match(/Copyright\s+\(c\)\s+(\d{4})/i);
52
- const authorMatch = licenseText.match(/Copyright\s+\(c\)\s+\d{4}\s+(.+)/i);
53
-
54
- if (!isMIT) {
55
- console.error(`ERROR: ${pkg} is NOT MIT licensed`);
56
- hasError = true;
57
- }
58
-
59
- const year = yearMatch?.[1] ?? "unknown";
60
- const author = authorMatch?.[1]?.trim() ?? "unknown";
61
- byYear[year] ??= { author, packages: [] };
62
- byYear[year].packages.push(pkg);
63
- }
64
-
65
- console.log("Bundled dependencies by copyright year:\n");
66
- for (const year of Object.keys(byYear).sort()) {
67
- const { author, packages } = byYear[year];
68
- console.log(` MIT License Copyright (c) ${year} ${author}`);
69
- for (const pkg of packages) console.log(` - ${pkg}`);
70
- }
71
-
72
- if (hasError) process.exit(1);
@@ -1,15 +0,0 @@
1
- // FormatJS Intl polyfills for QuickJS (no native Intl support)
2
- // Order matters: getCanonicalLocales and Locale are deps of the others
3
-
4
- import "@formatjs/intl-getcanonicallocales/polyfill-force.js";
5
- import "@formatjs/intl-locale/polyfill-force.js";
6
-
7
- import "@formatjs/intl-pluralrules/polyfill-force.js";
8
- import "@formatjs/intl-pluralrules/locale-data/en";
9
-
10
- import "@formatjs/intl-numberformat/polyfill-force.js";
11
- import "@formatjs/intl-numberformat/locale-data/en";
12
-
13
- import "@formatjs/intl-datetimeformat/polyfill-force.js";
14
- import "@formatjs/intl-datetimeformat/locale-data/en";
15
- import "@formatjs/intl-datetimeformat/add-all-tz.js";