-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Node.js #65
Support Node.js #65
Conversation
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, I tried to figure this stuff out and it was a nightmare.
After thinking it over, I think we may want to publish both the browser and node.js versions of the code together as a single npm package, assuming that doesn't break things. Users of node.js would simply import from manta.js/node
, and users of manta.js would import from manta.js/browser
. Running yarn build
would run scripts to build for both targets. Since this would break current import paths, we would want to bump the major version of this package as well.
I think this change would help avoid human error while publishing these packages to npm, which could be potentially very serious. It's not strictly correct to have one package.json file for two different packages, because a package can only have one name
, and that's what npm looks at when publishing. Although I would prefer to publish these packages in CI, we currently publish packages manually, for better or worse. Whenever I publish manta.js given the configuration in this PR, I would have to manually update the name in the package.json, and be very careful not to confuse the two different build targets. If the process for publishing packages isn't really straightforward there's room for human error, and I've definitely made mistakes in the past.
|
Yeah I'm looking into the best way to do that |
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
Ok this should make it so manta.js defaults to browser build. Please double check this doesn't break anything. It works in both node and browser environment for me. No changes to browser... I could make it more explicit exporting browser build to |
So still build it with |
Yeah or there is now a
Updated so script is extra paranoid to clean |
Signed-off-by: Charles Ferrell <charlie@manta.network>
Also needed to add a few more specs to node specific README. Not sure how easy to follow along it is |
Getting this again after building with
EDIT: nvm I see what I did wrong. It does work. |
Yeah we need to mention it here https://github.com/Manta-Network/sdk/blob/main/manta-js/README.md?plain=1#L13-L18 |
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: Charles Ferrell <charlie@manta.network>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested on front end, looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err sorry, one more thing, still need to bump the version. I think 0.1.0 makes sense since there is significant new functionality but changes are not breaking
Signed-off-by: Charles Ferrell <charlie@manta.network>
Just lmk and I can publish the package |
Merge and publish |
good on my end, we can bundle #71 in this new release too, or have it bump another version |
I'm gonna bump the version to 1.0.0, I think there was a previously published version 0.1.0, and npm won't let me publish over it |
Signed-off-by: Kevin Gislason <33131270+Kevingislason@users.noreply.github.com>
0928ee4
Support node
todo: Add documentation for using manta.js in nodeSimple docs added to README