@lmjs/core 2.6.4 → 2.7.0
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/build/cdn.js +27 -0
- package/cdn/integrity.json +7 -0
- package/cdn/lm.full.js +126 -0
- package/cdn/lm.js +109 -0
- package/dist/lumenjs-core.js +1 -1
- package/package.json +3 -1
- package/src/_re.js +87 -0
package/build/cdn.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// cdn/ inside the published @lmjs/core (D-20261029-03): jsDelivr serves it at
|
|
3
|
+
// https://cdn.jsdelivr.net/npm/@lmjs/core@<version>/cdn/lm.js the moment the version is public, and `lm build` of the
|
|
4
|
+
// same @lmjs/cli version loads it with an SRI hash. The files are made from the CLI's own runtime seed
|
|
5
|
+
// (packages/cli/lib/files/libs/lm.js), byte for byte what the CLI hashes, and the two packages must have the same version.
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const rt = require("../../cli/lib/cdn-runtime.js");
|
|
9
|
+
|
|
10
|
+
const core = require("../package.json");
|
|
11
|
+
const cli = require("../../cli/package.json");
|
|
12
|
+
if (core.version !== cli.version) {
|
|
13
|
+
console.error("@lmjs/core " + core.version + " and @lmjs/cli " + cli.version + " differ: the CLI would load a runtime that is not in this package.");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
const out = path.join(__dirname, "..", "cdn");
|
|
17
|
+
fs.rmSync(out, { recursive: true, force: true });
|
|
18
|
+
fs.mkdirSync(out, { recursive: true });
|
|
19
|
+
const files = rt.runtimeFiles();
|
|
20
|
+
const integrity = {};
|
|
21
|
+
for (const name of Object.keys(files)) {
|
|
22
|
+
fs.writeFileSync(path.join(out, name), files[name]);
|
|
23
|
+
integrity[name] = rt.sri(files[name]);
|
|
24
|
+
}
|
|
25
|
+
fs.writeFileSync(path.join(out, "integrity.json"), JSON.stringify({ version: core.version, files: integrity }, null, 2) + "\n");
|
|
26
|
+
console.log("cdn/ for " + rt.jsdelivrBase(core.version));
|
|
27
|
+
for (const n of Object.keys(integrity)) console.log(" " + n + " " + integrity[n]);
|