Add local npm registry publish and install
This commit is contained in:
@@ -101,6 +101,27 @@ pip install <package>`,
|
||||
];
|
||||
|
||||
case 'npm':
|
||||
if (isLocal) {
|
||||
const reg = `${url}/api/v1/local/${name}/`;
|
||||
return [
|
||||
{
|
||||
title: 'Configure .npmrc (registry + publish token)',
|
||||
language: 'bash',
|
||||
code: `cat >> .npmrc <<'EOF'
|
||||
registry=${reg}
|
||||
//${host}/api/v1/local/${name}/:_authToken=unused
|
||||
EOF`,
|
||||
note: 'npm refuses to publish without an _authToken for the registry; any value works. For a scope only, use @<scope>:registry=… instead of registry=.',
|
||||
},
|
||||
{
|
||||
title: 'Publish and install',
|
||||
language: 'bash',
|
||||
code: `npm publish
|
||||
npm install <package>`,
|
||||
note: 'Versions are immutable: republishing an existing version is rejected. The dist-tags sent with the publish (latest, or --tag) move to the new version.',
|
||||
},
|
||||
];
|
||||
}
|
||||
return [
|
||||
{
|
||||
title: 'Point npm at this registry',
|
||||
|
||||
Reference in New Issue
Block a user