dyne / slangroom

Enhance zencode smart contracts with your slang
https://dyne.org/slangroom/
GNU Affero General Public License v3.0
5 stars 1 forks source link

refactor(git): make git plugin usable on browser #189

Closed matteo-cristino closed 2 months ago

matteo-cristino commented 3 months ago

This still does not work, when adding @slangroom/git to @slangroom/browser I get:

Uncaught Error: Dynamic require of "fs" is not supported

maybe we should use BrowserFS instaead of fs?

Or even lightning-fs from the autors of isomorphic-git

for the moment will leave it here as a draft, to be worked on when we have time

puria commented 3 months ago

This still does not work, when adding @slangroom/git to @slangroom/browser I get:

Uncaught Error: Dynamic require of "fs" is not supported

maybe we should use BrowserFS instaead of fs?

Or even lightning-fs from the autors of isomorphic-git

go for it... lightning-fs seems very promising!

matteo-cristino commented 3 months ago

Looking better at lightning-fs it seems that it works just in the browser and thus it is not isomoprhic. This left us with ZenFS that is the active fork of BrowserFS

matteo-cristino commented 2 months ago

Now fs and path should have been fixed, waiting for a new zenFS release that fix a bug to continue on tests.

But I found out another thing that is that also process is not define on the browser, where we use it to get the env variables in @slangroom/git

export const sandboxDir = () => {
    // TODO: sanitize sandboxDir
    return process.env['FILES_DIR'];
};

Will continue on next week to see what can be done for this 🫠

matteo-cristino commented 2 months ago

superseded by #195