Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Last active April 6, 2019 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThisIsMissEm/29cb0348a5e307bedd0d8b93420008d5 to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/29cb0348a5e307bedd0d8b93420008d5 to your computer and use it in GitHub Desktop.
Concept for multi-registry support in package.json
{
"name": "my-app",
"version": "1.0.0",
"registries": {
"npm": { "url": "registry.npmjs.org", "default": true },
"tidelift": { "url": "registry.tidelift.org" },
"acme-corp": { "url": "verdaccio.acme.corp" }
},
"dependencies": {
"express": "^4.0.x",
"*acme-corp/ui": "^1.0.4",
"*tidelift/express-pro": "2.0.5"
}
}
@baweaver
Copy link

baweaver commented Apr 6, 2019

Vague idea, but yeah, this is a hard one especially if trying not to break backwards compatibility. Best I can figure is adding a separate sources field that can inline any of the registries info like above (which I really like the idea of) or just reference a name from one:

{
  "name": "my-app",
  "version": "1.0.0",
  "registries": {
    "npm": { "url": "registry.npmjs.org", "default": true },
    "tidelift": { "url": "registry.tidelift.org" },
    "acme-corp": { "url": "verdaccio.acme.corp" }
  },
  "dependencies": {
    "express": "^4.0.x",
    "ui": "^1.0.4",
    "express-pro": "2.0.5",
    "my-package": "1.0.0"
  },
  "sources": {
    "ui": "acme-corp",
    "express-pro": "tildelift",
    "my-package": {
      "git": "https://github.com/name/my-package"
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment