question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JavaScript Packing Issues and Best Practices

See original GitHub issue

Hello all, I currently see a few issues surrounding the creation and maintainence of JavaScript packages:

  1. 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
  2. Because of (1), all PRs the bot is making against JS packages are broken.
  3. 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).
  4. 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?
  5. Related to (4), do we need to use npm to install JS packages at all? If all npm 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:open
  • Created 5 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
scopatzcommented, Jun 5, 2018

If the original tarball were available as an environment variable

Yeah that would be nice

It’s technically possible (debian tries to do this), but I would strongly discourage any attempt to do this. It’s antithetical to how node and npm work,

Ok, good to know. We should avoid it then.

Like pip+distutils, it’s a dependency solver, build system, arbitrary code execution, config files, etc.

Yeah, so there is no reason to try to duplicate that effort.

I don’t think packaging node libraries with conda makes much sense. Only repackaging applications makes sense to me, because libraries installed globally aren’t importable (dependencies are always local)

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 execute conda env create -f environment.yml and be up and running. It seems like this may not be possible with JS packages.

1reaction
CJ-Wrightcommented, Jun 6, 2018

@scopatz the bot has issued 38 PRs updating to the new JS syntax. Edit: (as clarification, that is all the filters picked up)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found