/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
libs/commands/create/src/command.ts
94 строки
3 KB
AI-JamesHenry
feat!: support node ^22.13.0 || ^24.0.0 || ^26.0.0, ship lerna as ESM-only (#4390)
14 июл 2026, 11:38
Не верифицирован
14 июл 2026, 11:38
a148ba2
Код
Авторство
О чём код?
import type { CommandModule } from "yargs"; /** * @see https://github.com/yargs/yargs/blob/main/docs/advanced.md#providing-a-command-module */ const command: CommandModule = { command: "create <name> [loc]", describe: "Create a new lerna-managed package", builder(yargs) { yargs .positional("name", { describe: "The package name (including scope), which must be locally unique _and_ publicly available", type: "string", }) .positional("loc", { describe: "A custom package location, defaulting to the first configured package location", type: "string", }) .options({ access: { group: "Command Options:", defaultDescription: "public", describe: "When using a scope, set publishConfig.access value", choices: ["public", "restricted"], }, bin: { group: "Command Options:", defaultDescription: "<name>", describe: "Package has an executable. Customize with --bin <executableName>", }, description: { group: "Command Options:", describe: "Package description", type: "string", }, dependencies: { group: "Command Options:", describe: "A list of package dependencies", type: "array", }, "es-module": { group: "Command Options:", describe: "Initialize a transpiled ES Module", type: "boolean", }, homepage: { group: "Command Options:", describe: "The package homepage, defaulting to a subpath of the root pkg.homepage", type: "string", }, keywords: { group: "Command Options:", describe: "A list of package keywords", type: "array", }, license: { group: "Command Options:", defaultDescription: "ISC", describe: "The desired package license (SPDX identifier)", type: "string", }, private: { group: "Command Options:", describe: "Make the new package private, never published to any external registry", type: "boolean", }, registry: { group: "Command Options:", describe: "Configure the package's publishConfig.registry", type: "string", }, tag: { group: "Command Options:", describe: "Configure the package's publishConfig.tag", type: "string", }, y: { group: "Command Options:", describe: "Skip all prompts, accepting default values", alias: "yes", type: "boolean", }, }); return yargs; }, async handler(argv) { const cmd: any = await import("."); return (cmd.default ?? cmd)(argv); }, }; export default command; export { command as "module.exports" };