@yowasp/yosys 0.0.0-experimental1 → 0.0.0-experimental3

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.
@@ -373,16 +373,16 @@ var BaseApplication = class {
373
373
 
374
374
  // node_modules/@yowasp/runtime/lib/api-browser.js
375
375
  var Application = class extends BaseApplication {
376
- constructor(baseURL2, resourceFilenames, wasmFilenames, instantiate2, argv0) {
376
+ constructor(baseURL, resourceFilenames, wasmFilenames, instantiate2, argv0) {
377
377
  async function getResources() {
378
378
  const resources = {};
379
379
  for (const [dirName, jsonFilename] of Object.entries(resourceFilenames))
380
- resources[dirName] = await fetch(new URL(jsonFilename, baseURL2)).then((resp) => resp.json());
380
+ resources[dirName] = await fetch(new URL(jsonFilename, baseURL)).then((resp) => resp.json());
381
381
  return resources;
382
382
  }
383
383
  const wasmModules = {};
384
384
  for (const [modName, wasmFilename] of Object.entries(wasmFilenames))
385
- wasmModules[modName] = fetch(new URL(wasmFilename, baseURL2)).then(WebAssembly.compileStreaming);
385
+ wasmModules[modName] = fetch(new URL(wasmFilename, baseURL)).then(WebAssembly.compileStreaming);
386
386
  super(getResources, wasmModules, instantiate2, argv0);
387
387
  }
388
388
  };
@@ -4537,9 +4537,7 @@ async function instantiate(getCoreModule, imports, instantiateCore = WebAssembly
4537
4537
  }
4538
4538
 
4539
4539
  // lib/api.js
4540
- var baseURL = "http://127.0.0.1:8000/gen/bundle-browser.js";
4541
- console.log("baseURL", baseURL);
4542
- var yosys = new Application(baseURL, {
4540
+ var yosys = new Application(import.meta.url, {
4543
4541
  "share": "./yosys-share.json"
4544
4542
  }, {
4545
4543
  "yosys.core.wasm": "./yosys.core.wasm",
@@ -376,16 +376,16 @@ var BaseApplication = class {
376
376
 
377
377
  // node_modules/@yowasp/runtime/lib/api-node.js
378
378
  var Application = class extends BaseApplication {
379
- constructor(baseURL2, resourceFilenames, wasmFilenames, instantiate2, argv0) {
379
+ constructor(baseURL, resourceFilenames, wasmFilenames, instantiate2, argv0) {
380
380
  async function getResources() {
381
381
  const resources = {};
382
382
  for (const [dirName, jsonFilename] of Object.entries(resourceFilenames))
383
- resources[dirName] = JSON.parse(await readFile(new URL(jsonFilename, baseURL2)));
383
+ resources[dirName] = JSON.parse(await readFile(new URL(jsonFilename, baseURL)));
384
384
  return resources;
385
385
  }
386
386
  const wasmModules = {};
387
387
  for (const [modName, wasmFilename] of Object.entries(wasmFilenames))
388
- wasmModules[modName] = readFile(new URL(wasmFilename, baseURL2)).then(WebAssembly.compile);
388
+ wasmModules[modName] = readFile(new URL(wasmFilename, baseURL)).then(WebAssembly.compile);
389
389
  super(getResources, wasmModules, instantiate2, argv0);
390
390
  }
391
391
  };
@@ -4540,9 +4540,7 @@ async function instantiate(getCoreModule, imports, instantiateCore = WebAssembly
4540
4540
  }
4541
4541
 
4542
4542
  // lib/api.js
4543
- var baseURL = import.meta.url;
4544
- console.log("baseURL", baseURL);
4545
- var yosys = new Application(baseURL, {
4543
+ var yosys = new Application(import.meta.url, {
4546
4544
  "share": "./yosys-share.json"
4547
4545
  }, {
4548
4546
  "yosys.core.wasm": "./yosys.core.wasm",
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@yowasp/yosys", "version": "0.0.0-experimental1", "description": "Yosys Open SYnthesis Suite", "author": "Catherine <whitequark@whitequark.org>", "license": "ISC", "homepage": "https://yowasp.org/", "repository": {"type": "git", "url": "git+https://github.com/YoWASP/yosys.git"}, "bugs": {"url": "https://github.com/YoWASP/yosys/issues"}, "type": "module", "files": ["gen/*.json", "gen/*.wasm", "gen/bundle-*.js"], "exports": {"node": "./gen/bundle-node.js", "browser": "./gen/bundle-browser.js"}, "dependencies": {"@yowasp/runtime": "../../runtime-js"}, "devDependencies": {"@bytecodealliance/jco": "^0.14.1", "esbuild": "^0.19.8"}, "scripts": {"pack": "yowasp-pack-resources ../yosys-build/share gen/yosys-share.json", "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' --out-dir gen/", "build:node": "esbuild --bundle lib/api.js --outfile=gen/bundle-node.js --format=esm --platform=node --define:BASE_URL=null", "build:browser": "esbuild --bundle lib/api.js --outfile=gen/bundle-browser.js --format=esm --platform=browser --define:BASE_URL=\\\"https://unpkg.com/@yowasp/yosys@0.0.0-experimental1/gen/bundle-browser.js\\\""}}
1
+ {"name": "@yowasp/yosys", "version": "0.0.0-experimental3", "description": "Yosys Open SYnthesis Suite", "author": "Catherine <whitequark@whitequark.org>", "license": "ISC", "homepage": "https://yowasp.org/", "repository": {"type": "git", "url": "git+https://github.com/YoWASP/yosys.git"}, "bugs": {"url": "https://github.com/YoWASP/yosys/issues"}, "type": "module", "files": ["gen/*.json", "gen/*.wasm", "gen/bundle-*.js"], "exports": {"node": "./gen/bundle-node.js", "browser": "./gen/bundle-browser.js"}, "dependencies": {"@yowasp/runtime": "^2.0.6"}, "devDependencies": {"@bytecodealliance/jco": "^0.14.1", "esbuild": "^0.19.8"}, "scripts": {"pack": "yowasp-pack-resources ../yosys-build/share gen/yosys-share.json", "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' --out-dir gen/", "build:node": "esbuild --bundle lib/api.js --outfile=gen/bundle-node.js --format=esm --platform=node", "build:browser": "esbuild --bundle lib/api.js --outfile=gen/bundle-browser.js --format=esm --platform=browser"}}