@yowasp/yosys 0.62.1087 → 0.64.89-dev.1114
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/gen/bundle.js +27 -3
- package/gen/yosys-resources.tar +0 -0
- package/gen/yosys.core.wasm +0 -0
- package/package.json +2 -2
package/gen/bundle.js
CHANGED
|
@@ -599,7 +599,7 @@ function parseTar(data, opts) {
|
|
|
599
599
|
const files = [];
|
|
600
600
|
let offset = 0;
|
|
601
601
|
while (offset < buffer.byteLength - 512) {
|
|
602
|
-
|
|
602
|
+
let name = _readString(buffer, offset, 100);
|
|
603
603
|
if (name.length === 0) {
|
|
604
604
|
break;
|
|
605
605
|
}
|
|
@@ -613,6 +613,7 @@ function parseTar(data, opts) {
|
|
|
613
613
|
const type = _type === TAR_TYPE_FILE ? "file" : _type === TAR_TYPE_DIR ? "directory" : _type;
|
|
614
614
|
const user = _readString(buffer, offset + 265, 32);
|
|
615
615
|
const group = _readString(buffer, offset + 297, 32);
|
|
616
|
+
name = _sanitizePath(name);
|
|
616
617
|
const meta = {
|
|
617
618
|
name,
|
|
618
619
|
type,
|
|
@@ -647,6 +648,29 @@ function parseTar(data, opts) {
|
|
|
647
648
|
}
|
|
648
649
|
return files;
|
|
649
650
|
}
|
|
651
|
+
function _sanitizePath(path) {
|
|
652
|
+
let normalized = path.replace(/\\/g, "/");
|
|
653
|
+
normalized = normalized.replace(/^[a-zA-Z]:\//, "");
|
|
654
|
+
normalized = normalized.replace(/^\/+/, "");
|
|
655
|
+
const hasLeadingDotSlash = normalized.startsWith("./");
|
|
656
|
+
const parts = normalized.split("/");
|
|
657
|
+
const resolved = [];
|
|
658
|
+
for (const part of parts) {
|
|
659
|
+
if (part === "..") {
|
|
660
|
+
resolved.pop();
|
|
661
|
+
} else if (part !== "." && part !== "") {
|
|
662
|
+
resolved.push(part);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
let result = resolved.join("/");
|
|
666
|
+
if (hasLeadingDotSlash && !result.startsWith("./")) {
|
|
667
|
+
result = "./" + result;
|
|
668
|
+
}
|
|
669
|
+
if (path.endsWith("/") && !result.endsWith("/")) {
|
|
670
|
+
result += "/";
|
|
671
|
+
}
|
|
672
|
+
return result;
|
|
673
|
+
}
|
|
650
674
|
function _readString(buffer, offset, size) {
|
|
651
675
|
const view = new Uint8Array(buffer, offset, size);
|
|
652
676
|
const i = view.indexOf(0);
|
|
@@ -696,7 +720,7 @@ var modules = async (fetch2) => ({
|
|
|
696
720
|
var filesystem = async (fetch2) => ({
|
|
697
721
|
"share": await fetch2(new URL("./yosys-resources.tar", import.meta.url)).then((resp) => resp.arrayBuffer()).then(unpackTarFilesystem)
|
|
698
722
|
});
|
|
699
|
-
var totalSize =
|
|
723
|
+
var totalSize = 49464725;
|
|
700
724
|
|
|
701
725
|
// gen/yosys.js
|
|
702
726
|
var ComponentError = class extends Error {
|
|
@@ -5586,7 +5610,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
5586
5610
|
var yosys = new Application(yosys_resources_exports, instantiate, "yowasp-yosys");
|
|
5587
5611
|
var runYosys = yosys.run.bind(yosys);
|
|
5588
5612
|
var commands = { "yosys": runYosys };
|
|
5589
|
-
var version = "0.
|
|
5613
|
+
var version = "0.64.89-dev.1114";
|
|
5590
5614
|
export {
|
|
5591
5615
|
Exit,
|
|
5592
5616
|
commands,
|
package/gen/yosys-resources.tar
CHANGED
|
Binary file
|
package/gen/yosys.core.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yowasp/yosys",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.89-dev.1114",
|
|
4
4
|
"description": "Yosys Open SYnthesis Suite",
|
|
5
5
|
"author": "Catherine <whitequark@whitequark.org>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"transpile": "jco new ../yosys-build/yosys.wasm --wasi-command --output yosys.wasm && jco transpile yosys.wasm --instantiation async --no-typescript --no-namespaced-exports --map 'wasi:io/*=runtime#io' --map 'wasi:cli/*=runtime#cli' --map 'wasi:clocks/*=runtime#*' --map 'wasi:filesystem/*=runtime#fs' --map 'wasi:random/*=runtime#random' --out-dir gen/",
|
|
34
34
|
"pack": "yowasp-pack-resources gen/yosys-resources.js gen ../yosys-build/share",
|
|
35
|
-
"build": "esbuild --bundle lib/api.js --outfile=gen/bundle.js --format=esm --platform=node --define:VERSION=\\\"0.
|
|
35
|
+
"build": "esbuild --bundle lib/api.js --outfile=gen/bundle.js --format=esm --platform=node --define:VERSION=\\\"0.64.89-dev.1114\\\"",
|
|
36
36
|
"all": "npm run transpile && npm run pack && npm run build"
|
|
37
37
|
}
|
|
38
38
|
}
|