JavaScript Packing Issues and Best Practices
See original GitHub issueHello all, I currently see a few issues surrounding the creation and maintainence of JavaScript packages:
- The current way of building JS packages (
npm install -g .
) no longer works with conda build v3.- For example, https://github.com/conda-forge/jstz-feedstock/pull/1 produces the following:
Error: lib/node_modules/jstz is a symlink to a path that may not exist after the build is completed (../../../work/jstz-2.0.0)
- This is apparently because of changes to npm (CC @isuruf @minrk)
- The fix is
npm pack; npm install -g pkg-version.tgz
- For example, https://github.com/conda-forge/jstz-feedstock/pull/1 produces the following:
- Because of (1), all PRs the bot is making against JS packages are broken.
- The maintainers of most JS packages (@sannykr @cshaley) haven’t been responsive to the bots PRs or gitter (but it hasn’t been that long on gitter).
npm
seems to install a copy of all dependencies for each package that is installed. Is there any way around this so that we can have real dependency chains on the graph in conda?- Related to (4), do we need to use
npm
to install JS packages at all? If allnpm install
is doing is shoving some files into a known directory and adding some symlinks, it seems like we could do that with conda-build as well. It is not as though there would be any penalty or collision with npm either, since npm would copy the package again anyway.
Anyway, some feedback, guidance, and discussion would be most welcome! CC @conda-forge/core
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Package management basics - Learn web development | MDN
There's a lot of tools available and the JavaScript package ecosystem is growing at an unprecedented rate, which has pros and cons. There's ......
Read more >Best practices for creating a modern npm package - Snyk
In this tutorial, we're going to walk step by step through creating an npm package using modern best practices (as of 2022).
Read more >JavaScript best practices - W3C Wiki
Contents · Introduction · Call things by their name — easy, short and readable variable and function names · Avoid globals · Stick...
Read more >Thoughts on packing Node.js applications + Webpack ...
While minifying ofcourse. I plan to do like a "progressive enhancement" of packing. So start a normal directory copy, though when possible, ...
Read more >Google JavaScript Style Guide
Like other programming style guides, the issues covered span not only aesthetic issues of formatting, but other types of conventions or coding standards...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah that would be nice
Ok, good to know. We should avoid it then.
Yeah, so there is no reason to try to duplicate that effort.
This makes sense as a general rule to me as a conda-forge developer. As a conda-forge user it is more frustrating, because now to be able to develop an application I have to be using two package managers: conda and npm. It seems like npm’s model forces us into this mode where we have to use npm.
More precisely, I would like to have an
environment.yml
file that specifies all of the dependencies for a project so that anyone could executeconda env create -f environment.yml
and be up and running. It seems like this may not be possible with JS packages.@scopatz the bot has issued 38 PRs updating to the new JS syntax. Edit: (as clarification, that is all the filters picked up)