@changesets/cli
Advanced tools
Comparing version 2.27.7 to 2.27.8
@@ -13,4 +13,3 @@ 'use strict'; | ||
var path = require('path'); | ||
var _objectSpread = require('@babel/runtime/helpers/objectSpread2'); | ||
var chalk = require('chalk'); | ||
var pc = require('picocolors'); | ||
var child_process = require('child_process'); | ||
@@ -29,3 +28,3 @@ var git = require('@changesets/git'); | ||
var pLimit = require('p-limit'); | ||
var preferredPM = require('preferred-pm'); | ||
var packageManagerDetector = require('package-manager-detector'); | ||
var spawn = require('spawndamnit'); | ||
@@ -62,3 +61,3 @@ var ciInfo = require('ci-info'); | ||
var path__default = /*#__PURE__*/_interopDefault(path); | ||
var chalk__default = /*#__PURE__*/_interopDefault(chalk); | ||
var pc__default = /*#__PURE__*/_interopDefault(pc); | ||
var git__namespace = /*#__PURE__*/_interopNamespace(git); | ||
@@ -72,3 +71,2 @@ var writeChangeset__default = /*#__PURE__*/_interopDefault(writeChangeset); | ||
var pLimit__default = /*#__PURE__*/_interopDefault(pLimit); | ||
var preferredPM__default = /*#__PURE__*/_interopDefault(preferredPM); | ||
var spawn__default = /*#__PURE__*/_interopDefault(spawn); | ||
@@ -80,2 +78,51 @@ var getReleasePlan__default = /*#__PURE__*/_interopDefault(getReleasePlan); | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
function getCommitFunctions(commit, cwd) { | ||
@@ -222,4 +269,5 @@ let commitFunctions = {}; | ||
blue, | ||
cyan | ||
} = chalk__default["default"]; | ||
cyan, | ||
gray | ||
} = pc__default["default"]; | ||
@@ -393,3 +441,3 @@ async function confirmMajorRelease(pkgJSON) { | ||
logger.log("Please enter a summary for this change (this will be in the changelogs)."); | ||
logger.log(chalk__default["default"].gray(" (submit empty line to open external editor)")); | ||
logger.log(gray(" (submit empty line to open external editor)")); | ||
let summary = await askQuestion("Summary"); | ||
@@ -435,5 +483,5 @@ | ||
const patchReleases = getReleasesOfType("patch"); | ||
if (majorReleases.length > 0) logger.log(`${chalk__default["default"].bold.green("major")}: ${majorReleases.join(", ")}`); | ||
if (minorReleases.length > 0) logger.log(`${chalk__default["default"].bold.green("minor")}: ${minorReleases.join(", ")}`); | ||
if (patchReleases.length > 0) logger.log(`${chalk__default["default"].bold.green("patch")}: ${patchReleases.join(", ")}`); | ||
if (majorReleases.length > 0) logger.log(`${pc__default["default"].bold(pc__default["default"].green("major"))}: ${majorReleases.join(", ")}`); | ||
if (minorReleases.length > 0) logger.log(`${pc__default["default"].bold(pc__default["default"].green("minor"))}: ${minorReleases.join(", ")}`); | ||
if (patchReleases.length > 0) logger.log(`${pc__default["default"].bold(pc__default["default"].green("patch"))}: ${patchReleases.join(", ")}`); | ||
logger.log(""); | ||
@@ -444,3 +492,3 @@ | ||
Note: All dependents of these packages that will be incompatible with | ||
the new version will be ${chalk__default["default"].redBright("patch bumped")} when this changeset is applied. | ||
the new version will be ${pc__default["default"].redBright("patch bumped")} when this changeset is applied. | ||
`; | ||
@@ -482,3 +530,3 @@ logger.log(message + "\n"); | ||
if (!newChangeset.confirmed) { | ||
newChangeset = _objectSpread(_objectSpread({}, newChangeset), {}, { | ||
newChangeset = _objectSpread2(_objectSpread2({}, newChangeset), {}, { | ||
confirmed: await askConfirm("Is this your desired changeset?") | ||
@@ -498,5 +546,5 @@ }); | ||
await git__namespace.commit(await getAddMessage(newChangeset, commitOpts), cwd); | ||
logger.log(chalk__default["default"].green(`${empty ? "Empty " : ""}Changeset added and committed`)); | ||
logger.log(pc__default["default"].green(`${empty ? "Empty " : ""}Changeset added and committed`)); | ||
} else { | ||
logger.log(chalk__default["default"].green(`${empty ? "Empty " : ""}Changeset added! - you can now commit it\n`)); | ||
logger.log(pc__default["default"].green(`${empty ? "Empty " : ""}Changeset added! - you can now commit it\n`)); | ||
} | ||
@@ -512,7 +560,7 @@ | ||
} else { | ||
logger.log(chalk__default["default"].green("If you want to modify or expand on the changeset summary, you can find it here")); | ||
logger.log(pc__default["default"].green("If you want to modify or expand on the changeset summary, you can find it here")); | ||
} | ||
const changesetPath = path__default["default"].resolve(changesetBase, `${changesetID}.md`); | ||
logger.info(chalk__default["default"].blue(changesetPath)); | ||
logger.info(pc__default["default"].blue(changesetPath)); | ||
@@ -534,3 +582,3 @@ if (open) { | ||
const defaultConfig = `${JSON.stringify(_objectSpread(_objectSpread({}, config.defaultWrittenConfig), {}, { | ||
const defaultConfig = `${JSON.stringify(_objectSpread2(_objectSpread2({}, config.defaultWrittenConfig), {}, { | ||
baseBranch: "main" | ||
@@ -560,7 +608,7 @@ }), null, 2)}\n`; | ||
await fs__default["default"].writeFile(path__default["default"].resolve(changesetBase, "config.json"), defaultConfig); | ||
logger.log(chalk__default["default"]`Thanks for choosing {green changesets} to help manage your versioning and publishing\n`); | ||
logger.log(`Thanks for choosing ${pc__default["default"].green("changesets")} to help manage your versioning and publishing\n`); | ||
logger.log("You should be set up to start using changesets now!\n"); | ||
logger.info("We have added a `.changeset` folder, and a couple of files to help you out:"); | ||
logger.info(chalk__default["default"]`- {blue .changeset/README.md} contains information about using changesets`); | ||
logger.info(chalk__default["default"]`- {blue .changeset/config.json} is our default config`); | ||
logger.info(`- ${pc__default["default"].blue(".changeset/README.md")} contains information about using changesets`); | ||
logger.info(`- ${pc__default["default"].blue(".changeset/config.json")} is our default config`); | ||
} | ||
@@ -573,3 +621,3 @@ } | ||
await pre$1.enterPre(cwd, options.tag); | ||
logger__namespace.success(`Entered pre mode with tag ${chalk__default["default"].cyan(options.tag)}`); | ||
logger__namespace.success(`Entered pre mode with tag ${pc__default["default"].cyan(options.tag)}`); | ||
logger__namespace.info("Run `changeset version` to version packages with prerelease versions"); | ||
@@ -642,3 +690,5 @@ } catch (err) { | ||
async function getPublishTool(cwd) { | ||
const pm = await preferredPM__default["default"](cwd); | ||
const pm = await packageManagerDetector.detect({ | ||
cwd | ||
}); | ||
if (!pm || pm.name !== "pnpm") return { | ||
@@ -718,3 +768,3 @@ name: "npm" | ||
if (((_pkgInfo$error = pkgInfo.error) === null || _pkgInfo$error === void 0 ? void 0 : _pkgInfo$error.code) === "E404") { | ||
logger.warn(`Received 404 for npm info ${chalk__default["default"].cyan(`"${packageJson.name}"`)}`); | ||
logger.warn(`Received 404 for npm info ${pc__default["default"].cyan(`"${packageJson.name}"`)}`); | ||
return { | ||
@@ -727,3 +777,3 @@ published: false, | ||
if (pkgInfo.error) { | ||
logger.error(`Received an unknown error code: ${pkgInfo.error.code} for npm info ${chalk__default["default"].cyan(`"${packageJson.name}"`)}`); | ||
logger.error(`Received an unknown error code: ${pkgInfo.error.code} for npm info ${pc__default["default"].cyan(`"${packageJson.name}"`)}`); | ||
logger.error(pkgInfo.error.summary); | ||
@@ -901,3 +951,3 @@ if (pkgInfo.error.detail) logger.error(pkgInfo.error.detail); | ||
} = pkg.packageJson; | ||
logger.info(`Publishing ${chalk__default["default"].cyan(`"${name}"`)} at ${chalk__default["default"].green(`"${version}"`)}`); | ||
logger.info(`Publishing ${pc__default["default"].cyan(`"${name}"`)} at ${pc__default["default"].green(`"${version}"`)}`); | ||
const publishConfirmation = await publish$1(name, { | ||
@@ -955,3 +1005,3 @@ cwd: pkg.dir, | ||
if (preState !== undefined && publishedState === "only-pre") { | ||
logger.info(`${name} is being published to ${chalk__default["default"].cyan("latest")} rather than ${chalk__default["default"].cyan(preState.tag)} because there has not been a regular release of it yet`); | ||
logger.info(`${name} is being published to ${pc__default["default"].cyan("latest")} rather than ${pc__default["default"].cyan(preState.tag)} because there has not been a regular release of it yet`); | ||
} | ||
@@ -996,4 +1046,4 @@ } else { | ||
let importantSeparator$1 = chalk__default["default"].red("===============================IMPORTANT!==============================="); | ||
let importantEnd$1 = chalk__default["default"].red("----------------------------------------------------------------------"); | ||
let importantSeparator$1 = pc__default["default"].red("===============================IMPORTANT!==============================="); | ||
let importantEnd$1 = pc__default["default"].red("----------------------------------------------------------------------"); | ||
@@ -1004,4 +1054,4 @@ function showNonLatestTagWarning(tag, preState) { | ||
if (preState) { | ||
logger.warn(`You are in prerelease mode so packages will be published to the ${chalk__default["default"].cyan(preState.tag)} | ||
dist tag except for packages that have not had normal releases which will be published to ${chalk__default["default"].cyan("latest")}`); | ||
logger.warn(`You are in prerelease mode so packages will be published to the ${pc__default["default"].cyan(preState.tag)} | ||
dist tag except for packages that have not had normal releases which will be published to ${pc__default["default"].cyan("latest")}`); | ||
} else if (tag !== "latest") { | ||
@@ -1141,9 +1191,9 @@ logger.warn(`Packages will be released under the ${tag} tag`); | ||
if (packages.length) { | ||
logger.info(chalk__default["default"]`Packages to be bumped at {green ${type}}:\n`); | ||
logger.info(`Packages to be bumped at ${pc__default["default"].green(type)}:\n`); | ||
const pkgs = packages.map(({ | ||
name | ||
}) => `- ${name}`).join("\n"); | ||
logger.log(chalk__default["default"].green(pkgs)); | ||
logger.log(pc__default["default"].green(pkgs)); | ||
} else { | ||
logger.info(chalk__default["default"]`{red NO} packages to be bumped at {green ${type}}`); | ||
logger.info(`${pc__default["default"].green("NO")} packages to be bumped at ${pc__default["default"].green(type)}`); | ||
} | ||
@@ -1156,3 +1206,3 @@ } | ||
if (packages.length) { | ||
logger.info(chalk__default["default"]`Packages to be bumped at {green ${type}}`); | ||
logger.info(`Packages to be bumped at ${pc__default["default"].green(type)}`); | ||
@@ -1164,10 +1214,10 @@ for (const { | ||
} of packages) { | ||
logger.log(chalk__default["default"]`- {green ${name}} {cyan ${version}}`); | ||
logger.log(`- ${pc__default["default"].green(name)} ${pc__default["default"].cyan(version)}`); | ||
for (const c of changesets) { | ||
logger.log(chalk__default["default"]` - {blue .changeset/${c}.md}`); | ||
logger.log(` - ${pc__default["default"].blue(`.changeset/${c}.md`)}`); | ||
} | ||
} | ||
} else { | ||
logger.info(chalk__default["default"]`Running release would release {red NO} packages as a {green ${type}}`); | ||
logger.info(`Running release would release ${pc__default["default"].red("NO")} packages as a ${pc__default["default"].green(type)}`); | ||
} | ||
@@ -1222,8 +1272,8 @@ } | ||
let importantSeparator = chalk__default["default"].red("===============================IMPORTANT!==============================="); | ||
let importantEnd = chalk__default["default"].red("----------------------------------------------------------------------"); | ||
let importantSeparator = pc__default["default"].red("===============================IMPORTANT!==============================="); | ||
let importantEnd = pc__default["default"].red("----------------------------------------------------------------------"); | ||
async function version(cwd, options, config) { | ||
var _config$snapshot$prer; | ||
const releaseConfig = _objectSpread(_objectSpread({}, config), {}, { | ||
const releaseConfig = _objectSpread2(_objectSpread2({}, config), {}, { | ||
// Disable committing when in snapshot mode | ||
@@ -1565,2 +1615,9 @@ commit: options.snapshot ? false : config.commit | ||
process.exit(0); | ||
} // Version should only be shown if it's the only argument passed | ||
if (parsed.version && args.length === 1) { | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
console.log(require("@changesets/cli/package.json").version); | ||
process.exit(0); | ||
} | ||
@@ -1567,0 +1624,0 @@ |
@@ -12,4 +12,3 @@ import mri from 'mri'; | ||
import path, { join } from 'path'; | ||
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2'; | ||
import chalk from 'chalk'; | ||
import pc from 'picocolors'; | ||
import { spawn } from 'child_process'; | ||
@@ -29,3 +28,3 @@ import * as git from '@changesets/git'; | ||
import pLimit from 'p-limit'; | ||
import preferredPM from 'preferred-pm'; | ||
import { detect } from 'package-manager-detector'; | ||
import spawn$1 from 'spawndamnit'; | ||
@@ -38,2 +37,51 @@ import { isCI } from 'ci-info'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
function getCommitFunctions(commit, cwd) { | ||
@@ -180,4 +228,5 @@ let commitFunctions = {}; | ||
blue, | ||
cyan | ||
} = chalk; | ||
cyan, | ||
gray | ||
} = pc; | ||
@@ -351,3 +400,3 @@ async function confirmMajorRelease(pkgJSON) { | ||
log("Please enter a summary for this change (this will be in the changelogs)."); | ||
log(chalk.gray(" (submit empty line to open external editor)")); | ||
log(gray(" (submit empty line to open external editor)")); | ||
let summary = await askQuestion("Summary"); | ||
@@ -393,5 +442,5 @@ | ||
const patchReleases = getReleasesOfType("patch"); | ||
if (majorReleases.length > 0) log(`${chalk.bold.green("major")}: ${majorReleases.join(", ")}`); | ||
if (minorReleases.length > 0) log(`${chalk.bold.green("minor")}: ${minorReleases.join(", ")}`); | ||
if (patchReleases.length > 0) log(`${chalk.bold.green("patch")}: ${patchReleases.join(", ")}`); | ||
if (majorReleases.length > 0) log(`${pc.bold(pc.green("major"))}: ${majorReleases.join(", ")}`); | ||
if (minorReleases.length > 0) log(`${pc.bold(pc.green("minor"))}: ${minorReleases.join(", ")}`); | ||
if (patchReleases.length > 0) log(`${pc.bold(pc.green("patch"))}: ${patchReleases.join(", ")}`); | ||
log(""); | ||
@@ -402,3 +451,3 @@ | ||
Note: All dependents of these packages that will be incompatible with | ||
the new version will be ${chalk.redBright("patch bumped")} when this changeset is applied. | ||
the new version will be ${pc.redBright("patch bumped")} when this changeset is applied. | ||
`; | ||
@@ -440,3 +489,3 @@ log(message + "\n"); | ||
if (!newChangeset.confirmed) { | ||
newChangeset = _objectSpread(_objectSpread({}, newChangeset), {}, { | ||
newChangeset = _objectSpread2(_objectSpread2({}, newChangeset), {}, { | ||
confirmed: await askConfirm("Is this your desired changeset?") | ||
@@ -456,5 +505,5 @@ }); | ||
await git.commit(await getAddMessage(newChangeset, commitOpts), cwd); | ||
log(chalk.green(`${empty ? "Empty " : ""}Changeset added and committed`)); | ||
log(pc.green(`${empty ? "Empty " : ""}Changeset added and committed`)); | ||
} else { | ||
log(chalk.green(`${empty ? "Empty " : ""}Changeset added! - you can now commit it\n`)); | ||
log(pc.green(`${empty ? "Empty " : ""}Changeset added! - you can now commit it\n`)); | ||
} | ||
@@ -470,7 +519,7 @@ | ||
} else { | ||
log(chalk.green("If you want to modify or expand on the changeset summary, you can find it here")); | ||
log(pc.green("If you want to modify or expand on the changeset summary, you can find it here")); | ||
} | ||
const changesetPath = path.resolve(changesetBase, `${changesetID}.md`); | ||
info(chalk.blue(changesetPath)); | ||
info(pc.blue(changesetPath)); | ||
@@ -492,3 +541,3 @@ if (open) { | ||
const defaultConfig = `${JSON.stringify(_objectSpread(_objectSpread({}, defaultWrittenConfig), {}, { | ||
const defaultConfig = `${JSON.stringify(_objectSpread2(_objectSpread2({}, defaultWrittenConfig), {}, { | ||
baseBranch: "main" | ||
@@ -518,7 +567,7 @@ }), null, 2)}\n`; | ||
await fs.writeFile(path.resolve(changesetBase, "config.json"), defaultConfig); | ||
log(chalk`Thanks for choosing {green changesets} to help manage your versioning and publishing\n`); | ||
log(`Thanks for choosing ${pc.green("changesets")} to help manage your versioning and publishing\n`); | ||
log("You should be set up to start using changesets now!\n"); | ||
info("We have added a `.changeset` folder, and a couple of files to help you out:"); | ||
info(chalk`- {blue .changeset/README.md} contains information about using changesets`); | ||
info(chalk`- {blue .changeset/config.json} is our default config`); | ||
info(`- ${pc.blue(".changeset/README.md")} contains information about using changesets`); | ||
info(`- ${pc.blue(".changeset/config.json")} is our default config`); | ||
} | ||
@@ -531,3 +580,3 @@ } | ||
await enterPre(cwd, options.tag); | ||
logger.success(`Entered pre mode with tag ${chalk.cyan(options.tag)}`); | ||
logger.success(`Entered pre mode with tag ${pc.cyan(options.tag)}`); | ||
logger.info("Run `changeset version` to version packages with prerelease versions"); | ||
@@ -600,3 +649,5 @@ } catch (err) { | ||
async function getPublishTool(cwd) { | ||
const pm = await preferredPM(cwd); | ||
const pm = await detect({ | ||
cwd | ||
}); | ||
if (!pm || pm.name !== "pnpm") return { | ||
@@ -676,3 +727,3 @@ name: "npm" | ||
if (((_pkgInfo$error = pkgInfo.error) === null || _pkgInfo$error === void 0 ? void 0 : _pkgInfo$error.code) === "E404") { | ||
warn(`Received 404 for npm info ${chalk.cyan(`"${packageJson.name}"`)}`); | ||
warn(`Received 404 for npm info ${pc.cyan(`"${packageJson.name}"`)}`); | ||
return { | ||
@@ -685,3 +736,3 @@ published: false, | ||
if (pkgInfo.error) { | ||
error(`Received an unknown error code: ${pkgInfo.error.code} for npm info ${chalk.cyan(`"${packageJson.name}"`)}`); | ||
error(`Received an unknown error code: ${pkgInfo.error.code} for npm info ${pc.cyan(`"${packageJson.name}"`)}`); | ||
error(pkgInfo.error.summary); | ||
@@ -859,3 +910,3 @@ if (pkgInfo.error.detail) error(pkgInfo.error.detail); | ||
} = pkg.packageJson; | ||
info(`Publishing ${chalk.cyan(`"${name}"`)} at ${chalk.green(`"${version}"`)}`); | ||
info(`Publishing ${pc.cyan(`"${name}"`)} at ${pc.green(`"${version}"`)}`); | ||
const publishConfirmation = await publish$1(name, { | ||
@@ -913,3 +964,3 @@ cwd: pkg.dir, | ||
if (preState !== undefined && publishedState === "only-pre") { | ||
info(`${name} is being published to ${chalk.cyan("latest")} rather than ${chalk.cyan(preState.tag)} because there has not been a regular release of it yet`); | ||
info(`${name} is being published to ${pc.cyan("latest")} rather than ${pc.cyan(preState.tag)} because there has not been a regular release of it yet`); | ||
} | ||
@@ -954,4 +1005,4 @@ } else { | ||
let importantSeparator$1 = chalk.red("===============================IMPORTANT!==============================="); | ||
let importantEnd$1 = chalk.red("----------------------------------------------------------------------"); | ||
let importantSeparator$1 = pc.red("===============================IMPORTANT!==============================="); | ||
let importantEnd$1 = pc.red("----------------------------------------------------------------------"); | ||
@@ -962,4 +1013,4 @@ function showNonLatestTagWarning(tag, preState) { | ||
if (preState) { | ||
warn(`You are in prerelease mode so packages will be published to the ${chalk.cyan(preState.tag)} | ||
dist tag except for packages that have not had normal releases which will be published to ${chalk.cyan("latest")}`); | ||
warn(`You are in prerelease mode so packages will be published to the ${pc.cyan(preState.tag)} | ||
dist tag except for packages that have not had normal releases which will be published to ${pc.cyan("latest")}`); | ||
} else if (tag !== "latest") { | ||
@@ -1099,9 +1150,9 @@ warn(`Packages will be released under the ${tag} tag`); | ||
if (packages.length) { | ||
info(chalk`Packages to be bumped at {green ${type}}:\n`); | ||
info(`Packages to be bumped at ${pc.green(type)}:\n`); | ||
const pkgs = packages.map(({ | ||
name | ||
}) => `- ${name}`).join("\n"); | ||
log(chalk.green(pkgs)); | ||
log(pc.green(pkgs)); | ||
} else { | ||
info(chalk`{red NO} packages to be bumped at {green ${type}}`); | ||
info(`${pc.green("NO")} packages to be bumped at ${pc.green(type)}`); | ||
} | ||
@@ -1114,3 +1165,3 @@ } | ||
if (packages.length) { | ||
info(chalk`Packages to be bumped at {green ${type}}`); | ||
info(`Packages to be bumped at ${pc.green(type)}`); | ||
@@ -1122,10 +1173,10 @@ for (const { | ||
} of packages) { | ||
log(chalk`- {green ${name}} {cyan ${version}}`); | ||
log(`- ${pc.green(name)} ${pc.cyan(version)}`); | ||
for (const c of changesets) { | ||
log(chalk` - {blue .changeset/${c}.md}`); | ||
log(` - ${pc.blue(`.changeset/${c}.md`)}`); | ||
} | ||
} | ||
} else { | ||
info(chalk`Running release would release {red NO} packages as a {green ${type}}`); | ||
info(`Running release would release ${pc.red("NO")} packages as a ${pc.green(type)}`); | ||
} | ||
@@ -1180,8 +1231,8 @@ } | ||
let importantSeparator = chalk.red("===============================IMPORTANT!==============================="); | ||
let importantEnd = chalk.red("----------------------------------------------------------------------"); | ||
let importantSeparator = pc.red("===============================IMPORTANT!==============================="); | ||
let importantEnd = pc.red("----------------------------------------------------------------------"); | ||
async function version(cwd, options, config) { | ||
var _config$snapshot$prer; | ||
const releaseConfig = _objectSpread(_objectSpread({}, config), {}, { | ||
const releaseConfig = _objectSpread2(_objectSpread2({}, config), {}, { | ||
// Disable committing when in snapshot mode | ||
@@ -1523,2 +1574,9 @@ commit: options.snapshot ? false : config.commit | ||
process.exit(0); | ||
} // Version should only be shown if it's the only argument passed | ||
if (parsed.version && args.length === 1) { | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
console.log(require("@changesets/cli/package.json").version); | ||
process.exit(0); | ||
} | ||
@@ -1525,0 +1583,0 @@ |
{ | ||
"name": "@changesets/cli", | ||
"version": "2.27.7", | ||
"version": "2.27.8", | ||
"description": "Organise your package versioning and publishing to make both contributors and maintainers happy", | ||
@@ -69,21 +69,19 @@ "bin": { | ||
"dependencies": { | ||
"@babel/runtime": "^7.20.1", | ||
"@changesets/apply-release-plan": "^7.0.4", | ||
"@changesets/assemble-release-plan": "^6.0.3", | ||
"@changesets/apply-release-plan": "^7.0.5", | ||
"@changesets/assemble-release-plan": "^6.0.4", | ||
"@changesets/changelog-git": "^0.2.0", | ||
"@changesets/config": "^3.0.2", | ||
"@changesets/config": "^3.0.3", | ||
"@changesets/errors": "^0.2.0", | ||
"@changesets/get-dependents-graph": "^2.1.1", | ||
"@changesets/get-release-plan": "^4.0.3", | ||
"@changesets/git": "^3.0.0", | ||
"@changesets/logger": "^0.1.0", | ||
"@changesets/pre": "^2.0.0", | ||
"@changesets/read": "^0.6.0", | ||
"@changesets/should-skip-package": "^0.1.0", | ||
"@changesets/get-dependents-graph": "^2.1.2", | ||
"@changesets/get-release-plan": "^4.0.4", | ||
"@changesets/git": "^3.0.1", | ||
"@changesets/logger": "^0.1.1", | ||
"@changesets/pre": "^2.0.1", | ||
"@changesets/read": "^0.6.1", | ||
"@changesets/should-skip-package": "^0.1.1", | ||
"@changesets/types": "^6.0.0", | ||
"@changesets/write": "^0.3.1", | ||
"@changesets/write": "^0.3.2", | ||
"@manypkg/get-packages": "^1.1.3", | ||
"@types/semver": "^7.5.0", | ||
"ansi-colors": "^4.1.3", | ||
"chalk": "^2.1.0", | ||
"ci-info": "^3.7.0", | ||
@@ -93,7 +91,7 @@ "enquirer": "^2.3.0", | ||
"fs-extra": "^7.0.1", | ||
"human-id": "^1.0.2", | ||
"mri": "^1.2.0", | ||
"outdent": "^0.5.0", | ||
"p-limit": "^2.2.0", | ||
"preferred-pm": "^3.0.0", | ||
"package-manager-detector": "^0.2.0", | ||
"picocolors": "^1.1.0", | ||
"resolve-from": "^5.0.0", | ||
@@ -107,4 +105,5 @@ "semver": "^7.5.3", | ||
"@changesets/test-utils": "*", | ||
"human-id": "^1.0.2", | ||
"strip-ansi": "^5.2.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127056
30
2824
4
+ Addedpicocolors@^1.1.0
+ Addedpackage-manager-detector@0.2.4(transitive)
- Removed@babel/runtime@^7.20.1
- Removedchalk@^2.1.0
- Removedhuman-id@^1.0.2
- Removedpreferred-pm@^3.0.0
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfind-up@5.0.0(transitive)
- Removedfind-yarn-workspace-root2@1.2.16(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedload-yaml-file@0.2.0(transitive)
- Removedlocate-path@6.0.0(transitive)
- Removedp-limit@3.1.0(transitive)
- Removedp-locate@5.0.0(transitive)
- Removedpkg-dir@4.2.0(transitive)
- Removedpreferred-pm@3.1.4(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedwhich-pm@2.2.0(transitive)
- Removedyocto-queue@0.1.0(transitive)
Updated@changesets/config@^3.0.3
Updated@changesets/git@^3.0.1
Updated@changesets/logger@^0.1.1
Updated@changesets/pre@^2.0.1
Updated@changesets/read@^0.6.1
Updated@changesets/write@^0.3.2