Skip to content

Commit

Permalink
relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Sep 12, 2024
1 parent 9c9a0cf commit fed3df0
Show file tree
Hide file tree
Showing 6 changed files with 264 additions and 23 deletions.
234 changes: 226 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@
},
"dependencies": {
"@viz-js/viz": "^3.2.3",
"heta-compiler": "github:hetalang/heta-compiler#rewrite-export",
"heta-compiler": "github:hetalang/heta-compiler#relative-paths",
"jquery": "^3.7.0",
"js-yaml": "^4.1.0",
"jszip": "^3.10.1",
"monaco-editor": "^0.44.0",
"monaco-yaml": "^5.2.2",
"w3-css": "^4.1.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ $(async () => {
// save all as object {filepath1: buffer1, filepath2: buffer2, ...}
let fileDict = {};
for (let [filepath, page] of leftCollection.pagesStorage) {
fileDict['/' + filepath] = await page.getArrayBuffer(); // ArrayBuffer
fileDict[filepath] = await page.getArrayBuffer(); // ArrayBuffer
}

// run builder
Expand Down
8 changes: 5 additions & 3 deletions src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ self.onmessage = (evt) => {

return; // BRAKE
}
console.log(builder)
if (builder.container.hetaErrors().length > 0) {
postMessage({action: 'console', value: 'Compilation ERROR! See logs.\n'});
postMessage({action: 'finished', dict: outputDict});
Expand All @@ -57,7 +57,7 @@ function main(inputDict, outputDict) {

// === read declaration file ===
// search
let declarationFileName = ['/platform.json', '/platform.yml', '/platform'].find((x) => inputDict[x]);
let declarationFileName = ['platform.json', 'platform.yml', 'platform'].find((x) => inputDict[x]);
let declarationBuffer = inputDict[declarationFileName];

if (!declarationBuffer) {
Expand Down Expand Up @@ -86,7 +86,9 @@ function main(inputDict, outputDict) {
postMessage({action: 'console', value: value});
}
}
var builder = new Builder(declaration, '/', (fn) => {

var builder = new Builder(declaration, '.', (fn) => {

let arrayBuffer = inputDict[fn]; // Uint8Array
if (!arrayBuffer) {
throw new HetaLevelError(`Module ${fn} is not found,`);
Expand Down
4 changes: 2 additions & 2 deletions src/heta-templates/platform.yml.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default `{
export: [
{ format: JSON, omit: [], noUnitsExpr: false },
#{ format: YAML, omit: [], noUnitsExpr: false },
#{ format: DBSolve, powTransform: keep, version: 26 },
#{ format: SLV, eventsOff: false, powTransform: keep, version: 26 },
#{ format: DBSolve, powTransform: keep, version: 26, groupConstBy: 'tags[0]' },
#{ format: SLV, eventsOff: false, powTransform: keep, version: 26, groupConstBy: 'tags[0]' },
{ format: SBML, version: L2V4 },
#{ format: Simbio },
#{ format: Mrgsolve },
Expand Down
Loading

0 comments on commit fed3df0

Please sign in to comment.