Sha256: 0a593b5c544648d55769428550c69b7c69315b1c4465b6fdaa8b1fc4dfd14768
Contents?: true
Size: 1.39 KB
Versions: 25
Compression:
Stored size: 1.39 KB
Contents
#!/usr/bin/env node const {resolve} = require('path'); const {execSync} = require('child_process') const Repository = require(resolve('.', 'node_modules', 'lerna', 'lib', 'Repository')); const PackageUtilities = require(resolve('.', 'node_modules', 'lerna', 'lib', 'PackageUtilities')); function npmTag(version) { const isNext = ['-beta', '-alpha', '-rc', '-next'].some(distributionType => version.includes(distributionType), ); return isNext ? 'next' : 'latest'; } const taggedPackages = execSync('git tag --points-at HEAD') .toString() .trim() .split('\n') .map(tag => { if (tag.startsWith('@')) { return `@${tag.split('@')[1]}`; } return tag.split('@')[0]; }); const repository = new Repository('.'); const unsortedPackages = PackageUtilities.getPackages({rootPath: '.', packageConfigs: repository.packageConfigs}); const packages = PackageUtilities.topologicallyBatchPackages(unsortedPackages, true) .reduce((acc, packageGroup) => [...acc, ...packageGroup], []) .filter(({name}) => taggedPackages.includes(name)); packages.forEach(({name, version}) => { const command = `node_modules/.bin/lerna publish --yes --npm-client=npm --skip-npm=false --skip-git --force-publish=${name} --repo-version=${version} --scope=${name} --npm-tag=${npmTag( version, )}`; // eslint-disable-next-line no-console console.log(command); require('child_process').execSync(command); });
Version data entries
25 entries across 25 versions & 1 rubygems