Skip to content
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

Missing eik npm? #336

Open
mfolkeseth opened this issue Apr 15, 2021 · 3 comments
Open

Missing eik npm? #336

mfolkeseth opened this issue Apr 15, 2021 · 3 comments

Comments

@mfolkeseth
Copy link

mfolkeseth commented Apr 15, 2021

Hi guys,

I am looking into this project and it looks great. I have one question tho; am I missing something or is there no eik npm-command?

https://github.com/eik-lib/cli/tree/master/commands

edit: For my own reference. npm command removed here 92d297b

@mfolkeseth mfolkeseth changed the title Missing eik npm Missing eik npm? Apr 15, 2021
@digitalsadhu
Copy link
Member

Yes, the npm command has been removed as we no longer include a rollup bundle setup. It made more sense for us to allow users to use whatever bundle system they prefer. This means in practice that we have the pkg and the npm URL namespaces available but there's no actual difference between them behind the scenes. You can simply choose which namespace to publish to. We see the need for the separation to handle possible name clashes with the npm repository. Apologies regarding the docs, they are lagging a bit behind. They will be updated when our latest version goes live soon (this is currently published as @next)

@mfolkeseth
Copy link
Author

Thanks for the reply @digitalsadhu. I am looking forward to the next release.

Before I close this task tho, maybe you can help me clarify something? I got the impression that eik npm is "take the latest version of this npm package and publish it to my eik server under package", which I think is a cool feature. Is this correct? And if so, I fail to see how this is related to the choice of bundle setup. Again, if my interpretation of eik npm intentions is correct, how might one achieve this with the current setup. I keep getting the feeling that I am missing something.

PS. If you tell me to just wait for the next release and read the docs, that is totally cool. No rush 😎
Right now I am just having a but of trouble to follow your train of thoughts through code.

@digitalsadhu
Copy link
Member

We want to avoid (in core) making decisions about how to build a package for publishing to the server. What we were having to do before was say ok. X package (I'm looking at you React) does not provide esm support (which we need for import maps to work) so we are going to have to run the package through a build step. But hold on, what's this, X package has a peer dependency on package Y (For example React and React Dom) Neither of which support esm out of the box so we kinda need to handle them together to get things to play nice. If you can see where I'm going with this... We were having to make more decisions for the Eik user than we were comfortable with so as a design choice, we've attempted in later releases to try to align the namespaces map, npm and package. This means we want to have a single command eik publish that will publish to a namespace determined by a type field in eik.json (or package.json under the eik key).
If you wish to publish an npm dependency you need to set the build as you see fit and set the Eik type field to npm and run eik publish as you would for a package. Having said that, I do see the value in having a tool which will, for most cases, be able to automate this process somewhat. I'm not quite sure what the best approach would be, however. Perhaps another command or cli flag, a plugin (we don't have a plugin system at this time) or a separate tool. Something to discuss. Thoughts @trygve-lie ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants