@orkestrel/sea 0.0.6 → 0.0.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.
|
@@ -894,7 +894,9 @@ export declare interface SEAInterface {
|
|
|
894
894
|
* `name` — output executable name (no extension).
|
|
895
895
|
* `entry` — the entry point to embed (path and module format).
|
|
896
896
|
* `output` — directory for the final executable.
|
|
897
|
-
* `assets` — key→path mapping for SEA embedded assets.
|
|
897
|
+
* `assets` — key→path mapping for SEA embedded assets. When compression
|
|
898
|
+
* writes a mapped path's Brotli output, the blob embeds that output under the
|
|
899
|
+
* original key without mutating this record. Other entries keep their paths.
|
|
898
900
|
* `compression` — directories to Brotli-compress before embedding.
|
|
899
901
|
* `windows` — Windows-specific build options (console/GUI terminal).
|
|
900
902
|
* `root` — project root directory. Default: `process.cwd()`.
|
|
@@ -894,7 +894,9 @@ export declare interface SEAInterface {
|
|
|
894
894
|
* `name` — output executable name (no extension).
|
|
895
895
|
* `entry` — the entry point to embed (path and module format).
|
|
896
896
|
* `output` — directory for the final executable.
|
|
897
|
-
* `assets` — key→path mapping for SEA embedded assets.
|
|
897
|
+
* `assets` — key→path mapping for SEA embedded assets. When compression
|
|
898
|
+
* writes a mapped path's Brotli output, the blob embeds that output under the
|
|
899
|
+
* original key without mutating this record. Other entries keep their paths.
|
|
898
900
|
* `compression` — directories to Brotli-compress before embedding.
|
|
899
901
|
* `windows` — Windows-specific build options (console/GUI terminal).
|
|
900
902
|
* `root` — project root directory. Default: `process.cwd()`.
|
package/dist/src/server/index.js
CHANGED
|
@@ -2040,7 +2040,7 @@ var SEA = class {
|
|
|
2040
2040
|
this.#check();
|
|
2041
2041
|
const compression = this.#compress(root);
|
|
2042
2042
|
this.#check();
|
|
2043
|
-
const blob = this.#blob(root);
|
|
2043
|
+
const blob = this.#blob(root, compression);
|
|
2044
2044
|
this.#check();
|
|
2045
2045
|
const assembled = this.#assemble(root, blob);
|
|
2046
2046
|
const size = statSync(assembled.executable).size;
|
|
@@ -2135,7 +2135,7 @@ var SEA = class {
|
|
|
2135
2135
|
this.#emitter.emit("compress", manifest);
|
|
2136
2136
|
return manifest;
|
|
2137
2137
|
}
|
|
2138
|
-
#blob(root) {
|
|
2138
|
+
#blob(root, compression) {
|
|
2139
2139
|
const entry = resolve(root, this.#options.entry.path);
|
|
2140
2140
|
ensureExists(entry, `Entry not found: ${this.#options.entry.path}`, "ENTRY");
|
|
2141
2141
|
const output = resolve(root, this.#options.output);
|
|
@@ -2145,7 +2145,7 @@ var SEA = class {
|
|
|
2145
2145
|
const config = createBlobConfig({
|
|
2146
2146
|
path: entry,
|
|
2147
2147
|
...this.#options.entry.format === void 0 ? {} : { format: this.#options.entry.format }
|
|
2148
|
-
}, blob, this.#assets(root), this.#options.blob);
|
|
2148
|
+
}, blob, this.#assets(root, compression), this.#options.blob);
|
|
2149
2149
|
writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
2150
2150
|
runShell([
|
|
2151
2151
|
process.execPath,
|
|
@@ -2273,9 +2273,14 @@ var SEA = class {
|
|
|
2273
2273
|
...terminal === void 0 ? {} : { terminal }
|
|
2274
2274
|
};
|
|
2275
2275
|
}
|
|
2276
|
-
#assets(root) {
|
|
2276
|
+
#assets(root, compression) {
|
|
2277
|
+
const outputs = /* @__PURE__ */ new Map();
|
|
2278
|
+
for (const result of compression?.assets ?? []) outputs.set(result.input, result.output);
|
|
2277
2279
|
const assets = {};
|
|
2278
|
-
for (const [name, path] of Object.entries(this.#options.assets ?? {}))
|
|
2280
|
+
for (const [name, path] of Object.entries(this.#options.assets ?? {})) {
|
|
2281
|
+
const input = ensureContained(root, path);
|
|
2282
|
+
assets[name] = outputs.get(input) ?? input;
|
|
2283
|
+
}
|
|
2279
2284
|
return assets;
|
|
2280
2285
|
}
|
|
2281
2286
|
};
|