Skip to content

Allow plugins #2

Description

@tunnckoCore

Because, npm is just one of them.

Wrap this as "npm plugin"

cli/src/cli.js

Lines 47 to 68 in b630bf3

const defaultRegistry = 'https://registry.npmjs.org/';
const registry =
argv.registry || proc.env.NPM_REGISTRY || defaultRegistry;
const content = ded`//registry.npmjs.org/:_authToken=${token}
sign-git-tag=false
git-tag-version=false
allow-same-version=false
`;
const opts = {
cwd: argv.cwd,
stdio: 'inherit',
};
await util.promisify(fs.writeFile)(
path.join(argv.cwd, '.npmrc'),
content,
);
await exec(`npm version ${result.nextVersion}`, opts);
await exec(`npm publish --registry ${registry}`, opts);
console.log('Successfully published.');

To the plugin function pass argv, process.env and the result object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions