diproche / webinterface

1 stars 0 forks source link

Integrate diproche via swipl-wasm #118

Open TimothyGillespie opened 5 years ago

TimothyGillespie commented 5 years ago

Quiet some work has to be done here.

The swipl-wasm files cannot be imported via "import" because they are not in the src folder. It works with npm test but not with npm start.

Other issues may appear when using npm start like unused dependencies. If it works like this is yet to be seen. The tests pass for now.

TimothyGillespie commented 5 years ago

I added a deployment key to semaphore but it didn't work. I will look into what I did wrong tomorrow.

TimothyGillespie commented 5 years ago

I made the mistake of using https instead of ssh. Semaphore of course cannot use the deploy key with https. But the ssh set up doesn't work either even though I did things the same way as with the first diproche dependency. I tried a few things, but couldn't figure it out for now.

TimothyGillespie commented 5 years ago

Two errors occure. With npm start this error list will be given:

npm start error ``` ./src/util/swipl-wasm/swipl-web.js Line 19: Unexpected use of 'location' no-restricted-globals Line 21: Unexpected use of 'location' no-restricted-globals Line 23: Unexpected use of 'location' no-restricted-globals Line 1319: 'read' is not defined no-undef Line 1325: 'readbuffer' is not defined no-undef Line 1327: 'read' is not defined no-undef Line 1332: 'scriptArgs' is not defined no-undef Line 1334: 'arguments' is not defined no-undef Line 1338: 'quit' is not defined no-undef Line 1380: Unexpected use of 'print' no-restricted-globals Line 1381: Unexpected use of 'print' no-restricted-globals Line 1385: 'printErr' is not defined no-undef Line 1555: Expected an assignment or function call and instead saw an expression no-unused-expressions Line 1555: 'tempI64' is not defined no-undef Line 1557: 'tempDouble' is not defined no-undef Line 1558: 'tempDouble' is not defined no-undef Line 1559: 'tempDouble' is not defined no-undef Line 1560: 'tempDouble' is not defined no-undef Line 1564: 'tempDouble' is not defined no-undef Line 1564: 'tempDouble' is not defined no-undef Line 1568: 'tempI64' is not defined no-undef Line 1569: 'tempI64' is not defined no-undef Line 2761: 'readline' is not defined no-undef Line 3715: 'FileReaderSync' is not defined no-undef Line 4935: 'path' is not defined no-undef Line 5576: 'Browser' is not defined no-undef Line 5603: 'Browser' is not defined no-undef Line 5865: 'SOCKFS' is not defined no-undef Line 5873: '__read_sockaddr' is not defined no-undef Line 5875: 'DNS' is not defined no-undef Line 6706: 'loadWebAssemblyModule' is not defined no-undef Line 6824: Unexpected use of 'self' no-restricted-globals Line 6825: Unexpected use of 'self' no-restricted-globals Line 6827: Unexpected use of 'self' no-restricted-globals Line 6828: Unexpected use of 'self' no-restricted-globals Search for the keywords to learn more about each error. This error occurred during the build time and cannot be dismissed. ```

These are ts errors in the swipl-js file, but I apparently cannot disable ts checks of these. I tried the // @ts-nocheck flag and the "checkJs": "false" option in the tsconfig.jason. Both didn't seem to work. They must have been previously ignored since they were not in the src folder.


The test of diprocheHandler.test.ts threw this:

diprocheHandler test errors ``` TypeError: Cannot read property 'expectedDataFileDownloads' of undefined 1 | // Not sure why it has to be imported like this, but if I don't it breaks 2 | import { Module } from "../../../src/util/prolog/swiplwasmHandler"; > 3 | if (!Module.expectedDataFileDownloads) { | ^ 4 | Module.expectedDataFileDownloads = 0; 5 | Module.finishedDataFileDownloads = 0; 6 | } at Object.expectedDataFileDownloads (src/util/swipl-wasm/swipl-web.js:3:13) at Object. (src/util/prolog/swiplwasmHandler.ts:3:1) at Object. (src/util/diproche/diprocheHandler.ts:3:1) at Object. (src/util/diproche/diprocheHandler.test.ts:1:1) ```

The latter error was resolvable by changing the import order, but there is still an issue with the diprocheHandler test just timing out and thus failing. It did work previously, when the swipl-wasm files were outside the src folder.