jacobp100 / technicalc-core

13 stars 0 forks source link

Congratulations! #1

Closed idkjs closed 3 years ago

idkjs commented 3 years ago

I was reading the code to learn.

This is tight work, boss. Thanks for sharing.

Incidentally, running yarn build from the root is not producing the expected dist folder.

yarn build
yarn run v1.22.10
$ yarn build-packages && yarn build-bundles
$ bsb -make-world
Dependency pinned on technicalc-calculator
Dependency pinned on technicalc-editor
Dependency pinned on technicalc-prebuilt
Dependency Finished
$ yarn workspace technicalc-prebuilt build
$ node build
(node:17787) UnhandledPromiseRejectionWarning: Error: Command failed: node scripts/units /Users/mando/Github/technicalc-core/dist/units.json
fs.js:476
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/Users/mando/Github/technicalc-core/dist/units.json'
jacobp100 commented 3 years ago

Thanks!

I'll do an update for this - but as a quick fix, I think you can just make a dist directory at the project root then try running again

idkjs commented 3 years ago

That, indeed, gets it built. Will have to keep that silly fix in mind. Assuming its supposed to run in the browser, will have to add an index.html somewhere too.

Thanks twice.

idkjs commented 3 years ago

Is this part of the project intended to be run outside of the app? As a cli or in the web maybe?

npx parcel serve dist/client.js does not seem to think so.

Thanks.

jacobp100 commented 3 years ago

Ah, no, it doesn't work in the browser as-is. The only editor for the project is in the TechniCalc app, which is done in React Native, and apart from what is here, is closed source.

It should be relatively easy to make a basic editor in the browser with client.js and MathJax - Elements.toMml can be passed directly to MathJax to render in the page.

You can see an example of using the client on my website here:- https://github.com/jacobp100/jacob-does-code/blob/master/assets/technicalc/computation.js

To run this page, you'll need to have an encoded calculation which you can get from the app or the Encoding module from technicalc-editor - but an example https://jacobdoescode.com/technicalc?exdaF

idkjs commented 3 years ago

Thanks. I will study it. There is so much to learn here.