npm / npm/rfcs

[RRFC] Support a src package companion to main one

Open
#142 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
777
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Motivation ("The Why")

There is a significant trend in thinning the size of npm packages by removing:

  1. source files (in case it's transpiled)
  2. test files
  3. build files
  4. docs (including GOVERNANCE and CODE_OF_CONDUCT files)

However it's important that those files are available along side the release in an immutable fashion (in case the main repo is unavailable for example) as they will be needed to recreate the project.

This is a common concept for Linux distributions as they ship both source and binary package as part of the same release.

Example

I propose we add another field in package.json:

{
  ...
  "source" : [
    "src",
    "build",
    ...
   ]
}

And then a command npm source <pkg> that downloads the source tarball.
A config lag that always installs the full tarball inside node_modules would be nice.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed package.json source field and the npm source command described in the issue. Define the package contents, source tarball behavior, and configuration for installing the full tarball; done would require an agreed design before implementation can begin.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.