@manypkg/cli
Advanced tools
Comparing version 0.21.4 to 0.22.0
# @manypkg/cli | ||
## 0.22.0 | ||
### Minor Changes | ||
- [#231](https://github.com/Thinkmill/manypkg/pull/231) [`aeb50f5`](https://github.com/Thinkmill/manypkg/commit/aeb50f53bae8c241792593d170547a788dbd86c9) Thanks [@VanTanev](https://github.com/VanTanev)! - Upgraded `package-json`, `semver` and `sembear` dependencies. | ||
- [#226](https://github.com/Thinkmill/manypkg/pull/226) [`2fafd9a`](https://github.com/Thinkmill/manypkg/commit/2fafd9a9f4fce590ad37b1b1e2286ff6f2db725e) Thanks [@VanTanev](https://github.com/VanTanev)! - Replace `chalk` with `picocolors` | ||
- [#228](https://github.com/Thinkmill/manypkg/pull/228) [`1cbdcb9`](https://github.com/Thinkmill/manypkg/commit/1cbdcb9d9905392cc90ff16111f4d6fc4722b90a) Thanks [@VanTanev](https://github.com/VanTanev)! - Remove the `find-up` dependency. | ||
- [#231](https://github.com/Thinkmill/manypkg/pull/231) [`aeb50f5`](https://github.com/Thinkmill/manypkg/commit/aeb50f53bae8c241792593d170547a788dbd86c9) Thanks [@VanTanev](https://github.com/VanTanev)! - Node.js version requirement raised to `>= 18.0.0` | ||
- [#224](https://github.com/Thinkmill/manypkg/pull/224) [`3c3198a`](https://github.com/Thinkmill/manypkg/commit/3c3198a4a0f51cdbb09be996f4c2ed78fa5ce2a1) Thanks [@VanTanev](https://github.com/VanTanev)! - Replace `spawndamnit` with `tinyexec` for fewer dependencies | ||
- [#229](https://github.com/Thinkmill/manypkg/pull/229) [`4a835ed`](https://github.com/Thinkmill/manypkg/commit/4a835ed40fe40b046810b60c00d918a5aa36dfc8) Thanks [@VanTanev](https://github.com/VanTanev)! - Update `validate-npm-package-name` to `5.0.1` to remove one transitive dependency. | ||
- [#225](https://github.com/Thinkmill/manypkg/pull/225) [`d0f4d92`](https://github.com/Thinkmill/manypkg/commit/d0f4d926040bca29b1f2dd9f366e60854fb16118) Thanks [@VanTanev](https://github.com/VanTanev)! - Replace `fs-extra` with native `node:fs/promises` | ||
## 0.21.4 | ||
@@ -4,0 +22,0 @@ |
@@ -1,1 +0,2 @@ | ||
export * from "./declarations/src/index"; | ||
export * from "./declarations/src/index.js"; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFueXBrZy1jbGkuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9 |
'use strict'; | ||
var chalk = require('chalk'); | ||
var pc = require('picocolors'); | ||
var util = require('util'); | ||
@@ -11,5 +11,5 @@ var getPackages = require('@manypkg/get-packages'); | ||
var normalizePath = require('normalize-path'); | ||
var fs = require('fs-extra'); | ||
var fs = require('node:fs/promises'); | ||
var path = require('path'); | ||
var spawn = require('spawndamnit'); | ||
var tinyexec = require('tinyexec'); | ||
var detectIndent = require('detect-indent'); | ||
@@ -38,3 +38,3 @@ var pLimit = require('p-limit'); | ||
var chalk__default = /*#__PURE__*/_interopDefault(chalk); | ||
var pc__default = /*#__PURE__*/_interopDefault(pc); | ||
var util__default = /*#__PURE__*/_interopDefault(util); | ||
@@ -45,5 +45,4 @@ var semver__namespace = /*#__PURE__*/_interopNamespace(semver); | ||
var normalizePath__default = /*#__PURE__*/_interopDefault(normalizePath); | ||
var fs__namespace = /*#__PURE__*/_interopNamespace(fs); | ||
var fs__default = /*#__PURE__*/_interopDefault(fs); | ||
var path__default = /*#__PURE__*/_interopDefault(path); | ||
var spawn__default = /*#__PURE__*/_interopDefault(spawn); | ||
var detectIndent__default = /*#__PURE__*/_interopDefault(detectIndent); | ||
@@ -54,5 +53,5 @@ var pLimit__default = /*#__PURE__*/_interopDefault(pLimit); | ||
let prefix = { | ||
error: chalk__default["default"].red("error"), | ||
success: chalk__default["default"].green("success"), | ||
info: chalk__default["default"].cyan("info") | ||
error: pc__default["default"].red("error"), | ||
success: pc__default["default"].green("success"), | ||
info: pc__default["default"].cyan("info") | ||
}[messageType]; | ||
@@ -394,3 +393,3 @@ let fullPrefix = "☔️ " + prefix + (scope === undefined ? "" : " " + scope); | ||
print: () => { | ||
return `the root package.json contains ${chalk__default["default"].yellow("devDependencies")}, this is disallowed as ${chalk__default["default"].yellow("devDependencies")} vs ${chalk__default["default"].green("dependencies")} in a private package does not affect anything and creates confusion.`; | ||
return `the root package.json contains ${pc__default["default"].yellow("devDependencies")}, this is disallowed as ${pc__default["default"].yellow("devDependencies")} vs ${pc__default["default"].green("dependencies")} in a private package does not affect anything and creates confusion.`; | ||
} | ||
@@ -529,5 +528,5 @@ }); | ||
async function writePackage(pkg) { | ||
let pkgRaw = await fs__namespace.readFile(path__default["default"].join(pkg.dir, "package.json"), "utf-8"); | ||
let pkgRaw = await fs__default["default"].readFile(path__default["default"].join(pkg.dir, "package.json"), "utf-8"); | ||
let indent = detectIndent__default["default"](pkgRaw).indent || " "; | ||
return fs__namespace.writeFile(path__default["default"].join(pkg.dir, "package.json"), JSON.stringify(pkg.packageJson, null, indent) + (pkgRaw.endsWith("\n") ? "\n" : "")); | ||
return fs__default["default"].writeFile(path__default["default"].join(pkg.dir, "package.json"), JSON.stringify(pkg.packageJson, null, indent) + (pkgRaw.endsWith("\n") ? "\n" : "")); | ||
} | ||
@@ -543,5 +542,7 @@ async function install(toolType, cwd) { | ||
}; | ||
await spawn__default["default"](cliRunners[toolType], toolType === "pnpm" ? ["install"] : toolType === "lerna" ? ["bootstrap", "--since", "HEAD"] : [], { | ||
cwd, | ||
stdio: "inherit" | ||
await tinyexec.exec(cliRunners[toolType], toolType === "pnpm" ? ["install"] : toolType === "lerna" ? ["bootstrap", "--since", "HEAD"] : [], { | ||
nodeOptions: { | ||
cwd, | ||
stdio: "inherit" | ||
} | ||
}); | ||
@@ -560,8 +561,10 @@ } | ||
const { | ||
code | ||
} = await spawn__default["default"]("yarn", args.slice(1), { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit" | ||
exitCode | ||
} = await tinyexec.exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
@@ -579,8 +582,10 @@ const matchingPackages = packages.filter(pkg => { | ||
const { | ||
code | ||
} = await spawn__default["default"]("yarn", args.slice(1), { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit" | ||
exitCode | ||
} = await tinyexec.exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
@@ -699,5 +704,7 @@ } | ||
} | ||
return await spawn__default["default"]("npm", ["dist-tag", "add", `${packageJson.name}@${packageJson.version}`, tag, ...flags], { | ||
stdio: "inherit", | ||
env: Object.assign({}, process.env, envOverride) | ||
return await tinyexec.exec("npm", ["dist-tag", "add", `${packageJson.name}@${packageJson.version}`, tag, ...flags], { | ||
nodeOptions: { | ||
stdio: "inherit", | ||
env: envOverride | ||
} | ||
}); | ||
@@ -779,9 +786,11 @@ } | ||
return execLimit(async () => { | ||
let { | ||
code | ||
} = await spawn__default["default"](args[0], args.slice(1), { | ||
cwd: pkg.dir, | ||
stdio: "inherit" | ||
const { | ||
exitCode | ||
} = await tinyexec.exec(args[0], args.slice(1), { | ||
nodeOptions: { | ||
cwd: pkg.dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
highestExitCode = Math.max(code, highestExitCode); | ||
highestExitCode = Math.max(exitCode ?? 1, highestExitCode); | ||
}); | ||
@@ -788,0 +797,0 @@ })); |
'use strict'; | ||
var chalk = require('chalk'); | ||
var pc = require('picocolors'); | ||
var util = require('util'); | ||
@@ -11,5 +11,5 @@ var getPackages = require('@manypkg/get-packages'); | ||
var normalizePath = require('normalize-path'); | ||
var fs = require('fs-extra'); | ||
var fs = require('node:fs/promises'); | ||
var path = require('path'); | ||
var spawn = require('spawndamnit'); | ||
var tinyexec = require('tinyexec'); | ||
var detectIndent = require('detect-indent'); | ||
@@ -38,3 +38,3 @@ var pLimit = require('p-limit'); | ||
var chalk__default = /*#__PURE__*/_interopDefault(chalk); | ||
var pc__default = /*#__PURE__*/_interopDefault(pc); | ||
var util__default = /*#__PURE__*/_interopDefault(util); | ||
@@ -45,5 +45,4 @@ var semver__namespace = /*#__PURE__*/_interopNamespace(semver); | ||
var normalizePath__default = /*#__PURE__*/_interopDefault(normalizePath); | ||
var fs__namespace = /*#__PURE__*/_interopNamespace(fs); | ||
var fs__default = /*#__PURE__*/_interopDefault(fs); | ||
var path__default = /*#__PURE__*/_interopDefault(path); | ||
var spawn__default = /*#__PURE__*/_interopDefault(spawn); | ||
var detectIndent__default = /*#__PURE__*/_interopDefault(detectIndent); | ||
@@ -54,5 +53,5 @@ var pLimit__default = /*#__PURE__*/_interopDefault(pLimit); | ||
let prefix = { | ||
error: chalk__default["default"].red("error"), | ||
success: chalk__default["default"].green("success"), | ||
info: chalk__default["default"].cyan("info") | ||
error: pc__default["default"].red("error"), | ||
success: pc__default["default"].green("success"), | ||
info: pc__default["default"].cyan("info") | ||
}[messageType]; | ||
@@ -394,3 +393,3 @@ let fullPrefix = "☔️ " + prefix + (scope === undefined ? "" : " " + scope); | ||
print: () => { | ||
return `the root package.json contains ${chalk__default["default"].yellow("devDependencies")}, this is disallowed as ${chalk__default["default"].yellow("devDependencies")} vs ${chalk__default["default"].green("dependencies")} in a private package does not affect anything and creates confusion.`; | ||
return `the root package.json contains ${pc__default["default"].yellow("devDependencies")}, this is disallowed as ${pc__default["default"].yellow("devDependencies")} vs ${pc__default["default"].green("dependencies")} in a private package does not affect anything and creates confusion.`; | ||
} | ||
@@ -529,5 +528,5 @@ }); | ||
async function writePackage(pkg) { | ||
let pkgRaw = await fs__namespace.readFile(path__default["default"].join(pkg.dir, "package.json"), "utf-8"); | ||
let pkgRaw = await fs__default["default"].readFile(path__default["default"].join(pkg.dir, "package.json"), "utf-8"); | ||
let indent = detectIndent__default["default"](pkgRaw).indent || " "; | ||
return fs__namespace.writeFile(path__default["default"].join(pkg.dir, "package.json"), JSON.stringify(pkg.packageJson, null, indent) + (pkgRaw.endsWith("\n") ? "\n" : "")); | ||
return fs__default["default"].writeFile(path__default["default"].join(pkg.dir, "package.json"), JSON.stringify(pkg.packageJson, null, indent) + (pkgRaw.endsWith("\n") ? "\n" : "")); | ||
} | ||
@@ -543,5 +542,7 @@ async function install(toolType, cwd) { | ||
}; | ||
await spawn__default["default"](cliRunners[toolType], toolType === "pnpm" ? ["install"] : toolType === "lerna" ? ["bootstrap", "--since", "HEAD"] : [], { | ||
cwd, | ||
stdio: "inherit" | ||
await tinyexec.exec(cliRunners[toolType], toolType === "pnpm" ? ["install"] : toolType === "lerna" ? ["bootstrap", "--since", "HEAD"] : [], { | ||
nodeOptions: { | ||
cwd, | ||
stdio: "inherit" | ||
} | ||
}); | ||
@@ -560,8 +561,10 @@ } | ||
const { | ||
code | ||
} = await spawn__default["default"]("yarn", args.slice(1), { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit" | ||
exitCode | ||
} = await tinyexec.exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
@@ -579,8 +582,10 @@ const matchingPackages = packages.filter(pkg => { | ||
const { | ||
code | ||
} = await spawn__default["default"]("yarn", args.slice(1), { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit" | ||
exitCode | ||
} = await tinyexec.exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
@@ -699,5 +704,7 @@ } | ||
} | ||
return await spawn__default["default"]("npm", ["dist-tag", "add", `${packageJson.name}@${packageJson.version}`, tag, ...flags], { | ||
stdio: "inherit", | ||
env: Object.assign({}, process.env, envOverride) | ||
return await tinyexec.exec("npm", ["dist-tag", "add", `${packageJson.name}@${packageJson.version}`, tag, ...flags], { | ||
nodeOptions: { | ||
stdio: "inherit", | ||
env: envOverride | ||
} | ||
}); | ||
@@ -779,9 +786,11 @@ } | ||
return execLimit(async () => { | ||
let { | ||
code | ||
} = await spawn__default["default"](args[0], args.slice(1), { | ||
cwd: pkg.dir, | ||
stdio: "inherit" | ||
const { | ||
exitCode | ||
} = await tinyexec.exec(args[0], args.slice(1), { | ||
nodeOptions: { | ||
cwd: pkg.dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
highestExitCode = Math.max(code, highestExitCode); | ||
highestExitCode = Math.max(exitCode ?? 1, highestExitCode); | ||
}); | ||
@@ -788,0 +797,0 @@ })); |
@@ -1,2 +0,2 @@ | ||
import chalk from 'chalk'; | ||
import pc from 'picocolors'; | ||
import util from 'util'; | ||
@@ -10,5 +10,5 @@ import { getPackages } from '@manypkg/get-packages'; | ||
import normalizePath from 'normalize-path'; | ||
import * as fs from 'fs-extra'; | ||
import fs from 'node:fs/promises'; | ||
import path from 'path'; | ||
import spawn from 'spawndamnit'; | ||
import { exec } from 'tinyexec'; | ||
import detectIndent from 'detect-indent'; | ||
@@ -19,5 +19,5 @@ import pLimit from 'p-limit'; | ||
let prefix = { | ||
error: chalk.red("error"), | ||
success: chalk.green("success"), | ||
info: chalk.cyan("info") | ||
error: pc.red("error"), | ||
success: pc.green("success"), | ||
info: pc.cyan("info") | ||
}[messageType]; | ||
@@ -359,3 +359,3 @@ let fullPrefix = "☔️ " + prefix + (scope === undefined ? "" : " " + scope); | ||
print: () => { | ||
return `the root package.json contains ${chalk.yellow("devDependencies")}, this is disallowed as ${chalk.yellow("devDependencies")} vs ${chalk.green("dependencies")} in a private package does not affect anything and creates confusion.`; | ||
return `the root package.json contains ${pc.yellow("devDependencies")}, this is disallowed as ${pc.yellow("devDependencies")} vs ${pc.green("dependencies")} in a private package does not affect anything and creates confusion.`; | ||
} | ||
@@ -507,5 +507,7 @@ }); | ||
}; | ||
await spawn(cliRunners[toolType], toolType === "pnpm" ? ["install"] : toolType === "lerna" ? ["bootstrap", "--since", "HEAD"] : [], { | ||
cwd, | ||
stdio: "inherit" | ||
await exec(cliRunners[toolType], toolType === "pnpm" ? ["install"] : toolType === "lerna" ? ["bootstrap", "--since", "HEAD"] : [], { | ||
nodeOptions: { | ||
cwd, | ||
stdio: "inherit" | ||
} | ||
}); | ||
@@ -524,8 +526,10 @@ } | ||
const { | ||
code | ||
} = await spawn("yarn", args.slice(1), { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit" | ||
exitCode | ||
} = await exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
@@ -543,8 +547,10 @@ const matchingPackages = packages.filter(pkg => { | ||
const { | ||
code | ||
} = await spawn("yarn", args.slice(1), { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit" | ||
exitCode | ||
} = await exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
@@ -663,5 +669,7 @@ } | ||
} | ||
return await spawn("npm", ["dist-tag", "add", `${packageJson.name}@${packageJson.version}`, tag, ...flags], { | ||
stdio: "inherit", | ||
env: Object.assign({}, process.env, envOverride) | ||
return await exec("npm", ["dist-tag", "add", `${packageJson.name}@${packageJson.version}`, tag, ...flags], { | ||
nodeOptions: { | ||
stdio: "inherit", | ||
env: envOverride | ||
} | ||
}); | ||
@@ -743,9 +751,11 @@ } | ||
return execLimit(async () => { | ||
let { | ||
code | ||
} = await spawn(args[0], args.slice(1), { | ||
cwd: pkg.dir, | ||
stdio: "inherit" | ||
const { | ||
exitCode | ||
} = await exec(args[0], args.slice(1), { | ||
nodeOptions: { | ||
cwd: pkg.dir, | ||
stdio: "inherit" | ||
} | ||
}); | ||
highestExitCode = Math.max(code, highestExitCode); | ||
highestExitCode = Math.max(exitCode ?? 1, highestExitCode); | ||
}); | ||
@@ -752,0 +762,0 @@ })); |
{ | ||
"name": "@manypkg/cli", | ||
"version": "0.21.4", | ||
"version": "0.22.0", | ||
"repository": { | ||
@@ -17,16 +17,15 @@ "type": "git", | ||
"@manypkg/get-packages": "^2.2.1", | ||
"chalk": "^2.4.2", | ||
"detect-indent": "^6.0.0", | ||
"find-up": "^4.1.0", | ||
"fs-extra": "^8.1.0", | ||
"normalize-path": "^3.0.0", | ||
"p-limit": "^2.2.1", | ||
"package-json": "^8.1.0", | ||
"package-json": "^10.0.1", | ||
"parse-github-url": "^1.0.2", | ||
"sembear": "^0.5.0", | ||
"semver": "^6.3.0", | ||
"spawndamnit": "^2.0.0", | ||
"validate-npm-package-name": "^3.0.0" | ||
"picocolors": "^1.1.0", | ||
"sembear": "^0.7.0", | ||
"semver": "^7.6.3", | ||
"tinyexec": "^0.3.1", | ||
"validate-npm-package-name": "^5.0.1" | ||
}, | ||
"devDependencies": { | ||
"@changesets/types": "^5.2.1", | ||
"fixturez": "^1.1.0", | ||
@@ -36,4 +35,4 @@ "strip-ansi": "^6.0.0" | ||
"engines": { | ||
"node": ">=14.18.0" | ||
"node": ">=18.0.0" | ||
} | ||
} |
import { makeCheck, sortObject } from "./utils"; | ||
import chalk from "chalk"; | ||
import pc from "picocolors"; | ||
import { Package } from "@manypkg/get-packages"; | ||
@@ -27,7 +27,5 @@ | ||
print: () => { | ||
return `the root package.json contains ${chalk.yellow( | ||
return `the root package.json contains ${pc.yellow( | ||
"devDependencies" | ||
)}, this is disallowed as ${chalk.yellow( | ||
"devDependencies" | ||
)} vs ${chalk.green( | ||
)}, this is disallowed as ${pc.yellow("devDependencies")} vs ${pc.green( | ||
"dependencies" | ||
@@ -34,0 +32,0 @@ )} in a private package does not affect anything and creates confusion.`; |
@@ -82,8 +82,2 @@ import { Package } from "@manypkg/get-packages"; | ||
export type Check<ErrorType> = | ||
| RootCheck<ErrorType> | ||
| AllCheck<ErrorType> | ||
| RootCheckWithFix<ErrorType> | ||
| AllCheckWithFix<ErrorType>; | ||
export function sortObject(prevObj: { [key: string]: string }) { | ||
@@ -90,0 +84,0 @@ let newObj: { [key: string]: string } = {}; |
import { makeCheck, NORMAL_DEPENDENCY_TYPES } from "./utils"; | ||
import { Package } from "@manypkg/get-packages"; | ||
export type ErrorType = { | ||
type ErrorType = { | ||
type: "WORKSPACE_REQUIRED"; | ||
@@ -6,0 +6,0 @@ workspace: Package; |
@@ -11,3 +11,3 @@ import path from "path"; | ||
import { npmTagAll } from "./npm-tag"; | ||
import spawn from "spawndamnit"; | ||
import { exec } from "tinyexec"; | ||
import pLimit from "p-limit"; | ||
@@ -97,7 +97,9 @@ | ||
return execLimit(async () => { | ||
let { code } = await spawn(args[0], args.slice(1), { | ||
cwd: pkg.dir, | ||
stdio: "inherit", | ||
const { exitCode } = await exec(args[0], args.slice(1), { | ||
nodeOptions: { | ||
cwd: pkg.dir, | ||
stdio: "inherit", | ||
}, | ||
}); | ||
highestExitCode = Math.max(code, highestExitCode); | ||
highestExitCode = Math.max(exitCode ?? 1, highestExitCode); | ||
}); | ||
@@ -104,0 +106,0 @@ }) |
@@ -1,5 +0,5 @@ | ||
import chalk from "chalk"; | ||
import pc from "picocolors"; | ||
import util from "util"; | ||
export function format( | ||
function format( | ||
args: Array<any>, | ||
@@ -10,5 +10,5 @@ messageType: "error" | "success" | "info", | ||
let prefix = { | ||
error: chalk.red("error"), | ||
success: chalk.green("success"), | ||
info: chalk.cyan("info"), | ||
error: pc.red("error"), | ||
success: pc.green("success"), | ||
info: pc.cyan("info"), | ||
}[messageType]; | ||
@@ -15,0 +15,0 @@ let fullPrefix = "☔️ " + prefix + (scope === undefined ? "" : " " + scope); |
import { getPackages } from "@manypkg/get-packages"; | ||
import { PackageJSON } from "@changesets/types"; | ||
import spawn from "spawndamnit"; | ||
import type { PackageJSON } from "@changesets/types"; | ||
import { exec } from "tinyexec"; | ||
import pLimit from "p-limit"; | ||
@@ -33,3 +33,3 @@ | ||
return await spawn( | ||
return await exec( | ||
"npm", | ||
@@ -44,4 +44,6 @@ [ | ||
{ | ||
stdio: "inherit", | ||
env: Object.assign({}, process.env, envOverride), | ||
nodeOptions: { | ||
stdio: "inherit", | ||
env: envOverride, | ||
}, | ||
} | ||
@@ -48,0 +50,0 @@ ); |
import { runCmd } from "./run"; | ||
import fixturez from "fixturez"; | ||
import spawn from "spawndamnit"; | ||
import { exec } from "tinyexec"; | ||
import stripAnsi from "strip-ansi"; | ||
@@ -25,4 +25,4 @@ | ||
'should execute "%s %s" and exit with %i', | ||
async (arg0, arg1, exitCode) => { | ||
const { stdout, stderr, code } = await spawn( | ||
async (arg0, arg1, expectedExitCode) => { | ||
const { exitCode, stdout, stderr } = await exec( | ||
require.resolve("../bin"), | ||
@@ -32,6 +32,6 @@ // @ts-ignore | ||
{ | ||
cwd: f.find("basic-with-scripts"), | ||
nodeOptions: { cwd: f.find("basic-with-scripts") }, | ||
} | ||
); | ||
expect(code).toBe(exitCode); | ||
expect(exitCode).toBe(expectedExitCode); | ||
expect(stripAnsi(stdout.toString())).toMatchSnapshot("stdout"); | ||
@@ -38,0 +38,0 @@ expect(stripAnsi(stderr.toString())).toMatchSnapshot("stderr"); |
import { getPackages } from "@manypkg/get-packages"; | ||
import path from "path"; | ||
import spawn from "spawndamnit"; | ||
import { exec } from "tinyexec"; | ||
import * as logger from "./logger"; | ||
@@ -15,7 +14,9 @@ import { ExitError } from "./errors"; | ||
if (exactMatchingPackage) { | ||
const { code } = await spawn("yarn", args.slice(1), { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit", | ||
const { exitCode } = await exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: exactMatchingPackage.dir, | ||
stdio: "inherit", | ||
}, | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
@@ -43,8 +44,10 @@ | ||
} else { | ||
const { code } = await spawn("yarn", args.slice(1), { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit", | ||
const { exitCode } = await exec("yarn", args.slice(1), { | ||
nodeOptions: { | ||
cwd: matchingPackages[0].dir, | ||
stdio: "inherit", | ||
}, | ||
}); | ||
throw new ExitError(code); | ||
throw new ExitError(exitCode ?? 1); | ||
} | ||
} |
@@ -99,3 +99,3 @@ import { getPackages } from "@manypkg/get-packages"; | ||
export function getPackageInfo(pkgName: string) { | ||
function getPackageInfo(pkgName: string) { | ||
return npmRequestLimit(async () => { | ||
@@ -102,0 +102,0 @@ const getPackageJson = (await import("package-json")).default; |
@@ -1,5 +0,5 @@ | ||
import * as fs from "fs-extra"; | ||
import fs from "node:fs/promises"; | ||
import { Package, Tool } from "@manypkg/get-packages"; | ||
import path from "path"; | ||
import spawn from "spawndamnit"; | ||
import { exec } from "tinyexec"; | ||
import detectIndent from "detect-indent"; | ||
@@ -27,3 +27,3 @@ | ||
await spawn( | ||
await exec( | ||
cliRunners[toolType], | ||
@@ -35,4 +35,4 @@ toolType === "pnpm" | ||
: [], | ||
{ cwd, stdio: "inherit" } | ||
{ nodeOptions: { cwd, stdio: "inherit" } } | ||
); | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
11
7
170564
3
36
4325
+ Addedpicocolors@^1.1.0
+ Addedtinyexec@^0.3.1
+ Addedky@1.7.2(transitive)
+ Addedpackage-json@10.0.1(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedsembear@0.7.0(transitive)
+ Addedtinyexec@0.3.1(transitive)
+ Addedvalidate-npm-package-name@5.0.1(transitive)
- Removedchalk@^2.4.2
- Removedfind-up@^4.1.0
- Removedfs-extra@^8.1.0
- Removedspawndamnit@^2.0.0
- Removed@sindresorhus/is@5.6.0(transitive)
- Removed@szmarczak/http-timer@5.0.1(transitive)
- Removed@types/http-cache-semantics@4.0.4(transitive)
- Removed@types/semver@6.2.7(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedbuiltins@1.0.3(transitive)
- Removedcacheable-lookup@7.0.0(transitive)
- Removedcacheable-request@10.2.14(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcross-spawn@5.1.0(transitive)
- Removeddecompress-response@6.0.0(transitive)
- Removeddefer-to-connect@2.0.1(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedform-data-encoder@2.1.4(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedget-stream@6.0.1(transitive)
- Removedgot@12.6.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhttp-cache-semantics@4.1.1(transitive)
- Removedhttp2-wrapper@2.2.1(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjson-buffer@3.0.1(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedkeyv@4.5.4(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedlowercase-keys@3.0.0(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedmimic-response@3.1.04.0.0(transitive)
- Removednormalize-url@8.0.1(transitive)
- Removedp-cancelable@3.0.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedpackage-json@8.1.1(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedquick-lru@5.1.1(transitive)
- Removedresolve-alpn@1.2.1(transitive)
- Removedresponselike@3.0.0(transitive)
- Removedsembear@0.5.2(transitive)
- Removedsemver@6.3.1(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedspawndamnit@2.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedvalidate-npm-package-name@3.0.0(transitive)
- Removedwhich@1.3.1(transitive)
- Removedyallist@2.1.2(transitive)
Updatedpackage-json@^10.0.1
Updatedsembear@^0.7.0
Updatedsemver@^7.6.3