@vltpkg/cli-sdk 1.0.0-rc.13 → 1.0.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/list.d.ts +0 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +3 -8
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/publish.js +1 -1
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/query.d.ts +0 -1
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +3 -8
- package/dist/commands/query.js.map +1 -1
- package/dist/config/definition.d.ts +5 -14
- package/dist/config/definition.d.ts.map +1 -1
- package/dist/config/definition.js +5 -15
- package/dist/config/definition.js.map +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +31 -1
- package/dist/config/index.js.map +1 -1
- package/dist/custom-help.d.ts.map +1 -1
- package/dist/custom-help.js +0 -8
- package/dist/custom-help.js.map +1 -1
- package/package.json +26 -26
- package/dist/commands/serve.d.ts +0 -14
- package/dist/commands/serve.d.ts.map +0 -1
- package/dist/commands/serve.js +0 -103
- package/dist/commands/serve.js.map +0 -1
- package/dist/start-gui.d.ts +0 -10
- package/dist/start-gui.d.ts.map +0 -1
- package/dist/start-gui.js +0 -60
- package/dist/start-gui.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/config/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,CAAC,MAAM,WAAW;AACtB,uCAAuC;AACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;IAC5B,6DAA6D;IAC7D,sDAAsD;IACxD,CAAC,CAAC,OA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,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA","sourcesContent":["import { error } from '@vltpkg/error-cause'\nimport { XDG } from '@vltpkg/xdg'\nimport { jack } from 'jackspeak'\n\nexport const defaultView =\n // If stdout is a TTY, use human output\n process.stdout.isTTY ? 'human'\n // If its not a TTY but is a CI environment, use human output\n // TODO: make a better view option for CI environments\n : process.env.CI ? 'human'\n // Otherwise, use json output\n : 'json'\n\nexport const defaultEditor = () =>\n process.env.EDITOR ||\n process.env.VISUAL ||\n (process.platform === 'win32' ?\n `${process.env.SYSTEMROOT}\\\\notepad.exe`\n : 'vi')\n\nconst canonicalCommands = {\n bugs: 'bugs',\n build: 'build',\n cache: 'cache',\n ci: 'ci',\n config: 'config',\n docs: 'docs',\n exec: 'exec',\n 'exec-local': 'exec-local',\n help: 'help',\n init: 'init',\n install: 'install',\n login: 'login',\n logout: 'logout',\n list: 'list',\n ls: 'ls',\n pack: 'pack',\n pkg: 'pkg',\n publish: 'publish',\n query: 'query',\n 'run-exec': 'run-exec',\n run: 'run',\n serve: 'serve',\n token: 'token',\n uninstall: 'uninstall',\n update: 'update',\n 'exec-cache': 'exec-cache',\n version: 'version',\n whoami: 'whoami',\n} as const\n\nconst aliases = {\n i: 'install',\n add: 'install',\n rm: 'uninstall',\n u: 'update',\n p: 'pkg',\n pub: 'publish',\n q: 'query',\n b: 'build',\n r: 'run',\n 'run-script': 'run',\n rx: 'run-exec',\n s: 'serve',\n x: 'exec',\n xl: 'exec-local',\n h: 'help',\n '?': 'help',\n ls: 'list',\n xc: 'exec-cache',\n} as const\n\n/**\n * Command aliases mapped to their canonical names\n */\nexport const commands = {\n ...canonicalCommands,\n ...aliases,\n} as const\n\n/**\n * Canonical command names mapped to an array of its aliases\n */\nexport const commandAliases = Object.entries(aliases).reduce(\n (acc, [alias, canonical]) => {\n const commandAliases = acc.get(canonical)\n if (commandAliases) {\n commandAliases.push(alias)\n } else {\n acc.set(canonical, [alias])\n }\n return acc\n },\n new Map<string, string[]>(),\n)\n\nexport type Commands = typeof commands\n\nexport const getCommand = (\n s?: string,\n): Commands[keyof Commands] | undefined =>\n s && s in commands ? commands[s as keyof Commands] : undefined\n\nconst xdg = new XDG('vlt')\nconst cacheDir = xdg.cache()\n\n/**\n * Fields that are parsed as a set of key=value pairs\n */\nexport const recordFields = [\n 'git-hosts',\n 'registries',\n 'git-host-archives',\n 'scope-registries',\n 'jsr-registries',\n] as const\n\nexport type RecordField = (typeof recordFields)[number]\n\nexport const isRecordField = (s: string): s is RecordField =>\n recordFields.includes(s as RecordField)\n\nconst stopParsingCommands: Commands[keyof Commands][] = [\n 'run',\n 'run-exec',\n 'exec-local',\n 'exec',\n]\n\nlet stopParsing: boolean | undefined = undefined\n\nconst j = jack({\n envPrefix: 'VLT',\n allowPositionals: true,\n usage: `vlt [<options>] [<cmd> [<args> ...]]`,\n stopAtPositionalTest: arg => {\n if (stopParsing) return true\n const a = arg as keyof Commands\n // we stop parsing AFTER the thing, so you can do\n // vlt run --vlt --configs scriptName --args --for --script\n // or\n // vlt exec --vlt --configs command --args --for --command\n if (stopParsingCommands.includes(commands[a])) {\n stopParsing = true\n }\n return false\n },\n})\n .heading('vlt')\n .description(\n `More documentation available at <https://docs.vlt.sh>`,\n )\n .heading('Subcommands')\n\nj.description(Object.keys(canonicalCommands).join(', '), {\n pre: true,\n}).description(\n 'Run `vlt <cmd> --help` for more information about a specific command',\n)\n\nexport const definition = j\n /**\n * Definition of all configuration values used by vlt.\n */\n .heading('Configuration')\n .description(\n `If a \\`vlt.json\\` file is present in the root of the current project,\n then that will be used as a source of configuration information.\n\n Next, the \\`vlt.json\\` file in the XDG specified config directory\n will be checked, and loaded for any fields not set in the local project.\n\n Object type values will be merged together. Set a field to \\`null\\` in\n the JSON configuration to explicitly remove it.\n\n Command-specific fields may be set in a nested \\`command\\` object that\n overrides any options defined at the top level.\n `,\n )\n\n .flag({\n color: {\n short: 'c',\n description: 'Use colors (Default for TTY)',\n },\n 'no-color': {\n short: 'C',\n description: 'Do not use colors (Default for non-TTY)',\n },\n })\n\n .opt({\n registry: {\n hint: 'url',\n default: 'https://registry.npmjs.org/',\n description: `Sets the registry for fetching packages, when no registry\n is explicitly set on a specifier.\n\n For example, \\`express@latest\\` will be resolved by looking\n up the metadata from this registry.\n\n Note that alias specifiers starting with \\`npm:\\` will\n still map to \\`https://registry.npmjs.org/\\` if this is\n changed, unless the a new mapping is created via the\n \\`--registries\\` option.\n `,\n },\n })\n\n .optList({\n registries: {\n hint: 'name=url',\n description: `Specify named registry hosts by their prefix. To set the\n default registry used for non-namespaced specifiers,\n use the \\`--registry\\` option.\n\n Prefixes can be used as a package alias. For example:\n\n \\`\\`\\`\n vlt --registries loc=http://reg.local install foo@loc:foo@1.x\n \\`\\`\\`\n\n By default, the public npm registry is registered to the\n \\`npm:\\` prefix. It is not recommended to change this\n mapping in most cases.\n `,\n },\n\n 'scope-registries': {\n hint: '@scope=url',\n description: `Map package name scopes to registry URLs.\n\n For example,\n \\`--scope-registries @acme=https://registry.acme/\\`\n would tell vlt to fetch any packages named\n \\`@acme/...\\` from the \\`https://registry.acme/\\`\n registry.\n\n Note: this way of specifying registries is more ambiguous,\n compared with using the \\`--registries\\` field and explicit\n prefixes, because instead of failing when the configuration\n is absent, it will instead attempt to fetch from the\n default registry.\n\n By comparison, using\n \\`--registries acme=https://registry.acme/\\` and then\n specifying dependencies such as \\`\"foo\": \"acme:foo@1.x\"\\`\n means that regardless of the name, the package will be\n fetched from the explicitly named registry, or fail if\n no registry is defined with that name.\n\n However, custom registry aliases are not supported by other\n package managers.`,\n },\n\n 'jsr-registries': {\n hint: 'name=url',\n description: `Map alias names to JSR.io registry urls.\n\n For example,\n \\`--jsr-registries acme=https://jsr.acme.io/\\` would\n tell vlt to fetch any packages with the \\`acme:\\` registry\n prefix from the \\`https://jsr.acme.io/\\` registry, using\n the \"npm Compatibility\" translation. So for example,\n the package \\`acme:@foo/bar\\` would fetch the\n \\`@jsr/foo__bar\\` package from the \\`jsr.acme.io\\`\n registry.\n\n By default the \\`jsr\\` alias is always mapped to\n \\`https://npm.jsr.io/\\`, so existing \\`jsr:\\` packages will\n be fetched from the public \\`jsr\\` registry appropriately.\n `,\n },\n\n 'git-hosts': {\n hint: `name=template`,\n short: 'G',\n description: `Map a shorthand name to a git remote URL template.\n\n The \\`template\\` may contain placeholders, which will be\n swapped with the relevant values.\n\n \\`$1\\`, \\`$2\\`, etc. are replaced with the appropriate\n n-th path portion. For example, \\`github:user/project\\`\n would replace the \\`$1\\` in the template with \\`user\\`,\n and \\`$2\\` with \\`project\\`.`,\n },\n\n 'git-host-archives': {\n hint: `name=template`,\n short: 'A',\n description: `Similar to the \\`--git-host <name>=<template>\\` option,\n this option can define a template string that will be\n expanded to provide the URL to download a pre-built\n tarball of the git repository.\n\n In addition to the n-th path portion expansions performed\n by \\`--git-host\\`, this field will also expand the\n string \\`$committish\\` in the template, replacing it with\n the resolved git committish value to be fetched.`,\n },\n })\n\n .opt({\n cache: {\n hint: 'path',\n description: `\n Location of the vlt on-disk cache. Defaults to the platform-specific\n directory recommended by the XDG specification.\n `,\n default: cacheDir,\n },\n tag: {\n description: `Default \\`dist-tag\\` to install or publish`,\n default: 'latest',\n },\n before: {\n hint: 'date',\n description: `Do not install any packages published after this date`,\n },\n os: {\n description: `The operating system to use as the selector when choosing\n packages based on their \\`os\\` value.`,\n default: process.platform,\n },\n arch: {\n description: `CPU architecture to use as the selector when choosing\n packages based on their \\`cpu\\` value.`,\n default: process.arch,\n },\n 'node-version': {\n hint: 'version',\n description: `Node version to use when choosing packages based on\n their \\`engines.node\\` value.`,\n default: process.version,\n },\n })\n\n .flag({\n 'git-shallow': {\n description: `Set to force \\`--depth=1\\` on all git clone actions.\n When set explicitly to false with --no-git-shallow,\n then \\`--depth=1\\` will not be used.\n\n When not set explicitly, \\`--depth=1\\` will be used for\n git hosts known to support this behavior.`,\n },\n })\n .num({\n 'fetch-retries': {\n hint: 'n',\n description: `Number of retries to perform when encountering network\n errors or likely-transient errors from git hosts.`,\n default: 3,\n },\n 'fetch-retry-factor': {\n hint: 'n',\n description: `The exponential backoff factor to use when retrying\n requests due to network issues.`,\n default: 2,\n },\n 'fetch-retry-mintimeout': {\n hint: 'n',\n description: `Number of milliseconds before starting first retry`,\n default: 0,\n },\n 'fetch-retry-maxtimeout': {\n hint: 'n',\n description: `Maximum number of milliseconds between two retries`,\n default: 30_000,\n },\n 'stale-while-revalidate-factor': {\n hint: 'n',\n default: 60,\n description: `If the server does not serve a \\`stale-while-revalidate\\`\n value in the \\`cache-control\\` header, then this multiplier\n is applied to the \\`max-age\\` or \\`s-maxage\\` values.\n\n By default, this is \\`60\\`, so for example a response that\n is cacheable for 5 minutes will allow a stale response\n while revalidating for up to 5 hours.\n\n If the server *does* provide a \\`stale-while-revalidate\\`\n value, then that is always used.\n\n Set to 0 to prevent any \\`stale-while-revalidate\\` behavior\n unless explicitly allowed by the server's \\`cache-control\\`\n header.\n `,\n },\n })\n\n .opt({\n identity: {\n short: 'i',\n validate: (v: unknown) =>\n typeof v === 'string' && /^[a-z0-9]*$/.test(v),\n hint: 'name',\n default: '',\n description: `Provide a string to define an identity for storing auth\n information when logging into registries.\n\n Authentication tokens will be stored in the XDG data\n directory, in \\`vlt/auth/$\\{identity}/keychain.json\\`.\n\n If no identity is provided, then the default \\`''\\` will\n be used, storing the file at \\`vlt/auth/keychain.json\\`.\n\n May only contain lowercase alphanumeric characters.\n `,\n },\n })\n\n .optList({\n workspace: {\n hint: 'ws',\n short: 'w',\n description: `Set to limit the spaces being worked on when working on\n workspaces.\n\n Can be paths or glob patterns matching paths.\n\n Specifying workspaces by package.json name is not\n supported.`,\n },\n 'workspace-group': {\n short: 'g',\n description: `Specify named workspace group names to load and operate on\n when doing recursive operations on workspaces.`,\n },\n })\n\n .opt({\n scope: {\n short: 's',\n hint: 'query',\n description:\n 'Set to filter the scope of an operation using a DSS Query.',\n },\n target: {\n short: 't',\n hint: 'query',\n description:\n 'Set to select packages using a DSS Query selector.',\n },\n })\n\n .flag({\n 'if-present': {\n description: `When running scripts across multiple packages,\n only include packages that have the script.\n\n If this is not set, then the run will fail if any\n packages do not have the script.\n\n This will default to true if --scope, --workspace,\n --workspace-group, or --recursive is set. Otherwise,\n it will default to false.`,\n },\n })\n\n .flag({\n recursive: {\n short: 'r',\n description: `Run an operation across multiple workspaces.\n\n No effect when used in non-monorepo projects.\n\n Implied by setting --workspace or --workspace-group. If\n not set, then the action is run on the project root.`,\n },\n\n bail: {\n short: 'b',\n description: `When running scripts across multiple workspaces, stop\n on the first failure.`,\n default: true,\n },\n\n 'no-bail': {\n short: 'B',\n description: `When running scripts across multiple workspaces, continue\n on failure, running the script for all workspaces.`,\n },\n })\n\n .opt({\n config: {\n hint: 'all | user | project',\n description: `Specify which configuration to show or operate on when running\n \\`vlt config\\` commands. For read operations (get, pick, list):\n \\`all\\` shows merged configuration from both user and project\n files (default). For write operations (set, delete, edit):\n defaults to \\`project\\`. \\`user\\` shows/modifies only user-level\n configuration, \\`project\\` shows/modifies only project-level\n configuration.`,\n validOptions: ['all', 'user', 'project'] as const,\n default: 'all',\n },\n\n editor: {\n hint: 'program',\n description: `The blocking editor to use for \\`vlt config edit\\` and\n any other cases where a file should be opened for\n editing.\n\n Defaults to the \\`EDITOR\\` or \\`VISUAL\\` env if set, or\n \\`notepad.exe\\` on Windows, or \\`vi\\` elsewhere.`,\n default: defaultEditor(),\n },\n\n 'script-shell': {\n hint: 'program',\n description: `The shell to use when executing \\`package.json#scripts\\`.\n\n For \\`vlt exec\\` and \\`vlt exec-local\\`, this is never set,\n meaning that command arguments are run exactly as provided.\n\n For \\`vlt run\\` (and other things that run lifecycle\n scripts in \\`package.json#scripts\\`), the entire command\n with all arguments is provided as a single string, meaning\n that some value must be provided for shell interpretation,\n and so for these contexts, the \\`script-shell\\` value will\n default to \\`/bin/sh\\` on POSIX systems or \\`cmd.exe\\` on\n Windows.\n `,\n },\n\n 'fallback-command': {\n hint: 'command',\n description: `The command to run when the first argument doesn't\n match any known commands.\n\n For pnpm-style behavior, set this to 'run-exec'. e.g:\n \\`\\`\\`\n vlt config set fallback-command=run-exec\n \\`\\`\\``,\n default: 'help',\n validOptions: Object.keys(canonicalCommands),\n },\n })\n\n .opt({\n package: {\n hint: 'p',\n description: `When running \\`vlt exec\\`, this allows you to explicitly\n set the package to search for bins. If not provided, then\n vlt will interpret the first argument as the package, and\n attempt to run the default executable.`,\n },\n })\n\n .opt({\n view: {\n hint: 'output',\n default: defaultView,\n description: `Configures the output format for commands.\n\n Defaults to \\`human\\` if stdout is a TTY, or \\`json\\`\n if it is not.\n\n - human: Maximally ergonomic output reporting for human\n consumption.\n - json: Parseable JSON output for machines.\n - inspect: Output results with \\`util.inspect\\`.\n - gui: Start a local web server and opens a browser to\n explore the results. (Only relevant for certain\n commands.)\n - mermaid: Output mermaid diagramming syntax. (Only\n relevant for certain commands.)\n - silent: Suppress all output to stdout.\n\n If the requested view format is not supported for the\n current command, or if no option is provided, then it\n will fall back to the default.\n `,\n validOptions: [\n 'human',\n 'json',\n 'mermaid',\n 'gui',\n 'inspect',\n 'silent',\n ] as const,\n },\n })\n\n .optList({\n 'dashboard-root': {\n hint: 'path',\n description: `The root directory to use for the dashboard browser-based UI.\n If not set, the user home directory is used.`,\n },\n })\n\n .flag({\n 'save-dev': {\n short: 'D',\n description: `Save installed packages to a package.json file as\n devDependencies`,\n },\n 'save-optional': {\n short: 'O',\n description: `Save installed packages to a package.json file as\n optionalDependencies`,\n },\n 'save-peer': {\n description: `Save installed packages to a package.json file as\n peerDependencies`,\n },\n 'save-prod': {\n short: 'P',\n description: `Save installed packages into dependencies specifically.\n This is useful if a package already exists in\n devDependencies or optionalDependencies, but you want to\n move it to be a non-optional production dependency.`,\n },\n })\n\n .opt({\n 'expect-results': {\n hint: 'value',\n validate: (v: unknown) =>\n typeof v === 'string' && /^([<>]=?)?[0-9]+$/.test(v),\n description: `When running \\`vlt query\\`, this option allows you to\n set a expected number of resulting items.\n\n Accepted values are numbers and strings.\n\n Strings starting with \\`>\\`, \\`<\\`, \\`>=\\` or \\`<=\\`\n followed by a number can be used to check if the result\n is greater than or less than a specific number.`,\n },\n })\n\n .flag({\n 'dry-run': {\n description: 'Run command without making any changes',\n },\n 'expect-lockfile': {\n description:\n 'Fail if lockfile is missing or out of date. Used by ci command to enforce lockfile integrity.',\n },\n 'frozen-lockfile': {\n description:\n 'Fail if lockfile is missing or out of sync with package.json. Prevents any lockfile modifications.',\n },\n 'lockfile-only': {\n description:\n 'Only update the lockfile (vlt-lock.json) and package.json files, skip all node_modules operations including package extraction and filesystem changes.',\n },\n })\n .opt({\n 'allow-scripts': {\n hint: 'query',\n description: `Filter which packages are allowed to run lifecycle scripts using DSS query syntax.\n When provided, only packages matching the query will execute their\n install, preinstall, postinstall, prepare, preprepare, and postprepare scripts.\n Defaults to ':not(*)' which means no scripts will be run.\n \n Example: --allow-scripts=\":root > *, #my-package\"\n Runs scripts only for direct dependencies of the current project and any occurrences\n of a specific dependency with the name \"my-package\" anywhere in the dependency graph.`,\n },\n })\n .opt({\n access: {\n description: 'Set the access level of the package',\n validOptions: ['public', 'restricted'] as const,\n default: 'public',\n },\n })\n .opt({\n otp: {\n description: `Provide an OTP to use when publishing a package.`,\n },\n 'publish-directory': {\n hint: 'path',\n description: `Directory to use for pack and publish operations instead of the current directory.\n The directory must exist and nothing will be copied to it.`,\n },\n port: {\n hint: 'number',\n description: `Port for the browser-based UI server when using vlt serve command (default: 8000).`,\n },\n 'registry-port': {\n hint: 'number',\n description: `Port for the VSR registry when using vlt serve command (default: 1337).`,\n },\n })\n\n .flag({\n yes: {\n short: 'y',\n description: `Automatically accept any confirmation prompts`,\n },\n version: {\n short: 'v',\n description: 'Print the version',\n },\n help: {\n short: 'h',\n description: 'Print helpful information',\n },\n all: {\n short: 'a',\n description: 'Show all commands, bins, and flags',\n },\n })\n\nexport const getSortedCliOptions = () => {\n const defs = definition.toJSON()\n return getSortedKeys().map((k: keyof typeof defs) => {\n const def = defs[k]\n /* c8 ignore next */\n if (!def) throw error('invalid key found', { found: k })\n if (def.type === 'boolean') return `--${k}`\n return `--${k}=<${def.hint ?? k}>`\n })\n}\n\nexport const getSortedKeys = () =>\n Object.keys(definition.toJSON()).sort((a, b) => a.localeCompare(b))\n"]}
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/config/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,CAAC,MAAM,WAAW;AACtB,uCAAuC;AACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO;IAC5B,6DAA6D;IAC7D,sDAAsD;IACxD,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;QACxB,6BAA6B;QAC/B,CAAC,CAAC,MAAM,CAAA;AAEV,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAChC,OAAO,CAAC,GAAG,CAAC,MAAM;IAClB,OAAO,CAAC,GAAG,CAAC,MAAM;IAClB,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;QAC7B,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,eAAe;QAC1C,CAAC,CAAC,IAAI,CAAC,CAAA;AAET,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,IAAI;IACR,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,YAAY;IAC1B,IAAI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AAG,CAAC,CAAC,CAAoB,EAAE,EAAE;QAClD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACnB,oBAAoB;QACpB,IAAI,CAAC,GAAG;YAAE,MAAM,KAAK,CAAC,mBAAmB,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;QACxD,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,EAAE,CAAA;QAC3C,OAAO,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAA;IACpC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAChC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA","sourcesContent":["import { error } from '@vltpkg/error-cause'\nimport { XDG } from '@vltpkg/xdg'\nimport { jack } from 'jackspeak'\n\nexport const defaultView =\n // If stdout is a TTY, use human output\n process.stdout.isTTY ? 'human'\n // If its not a TTY but is a CI environment, use human output\n // TODO: make a better view option for CI environments\n : process.env.CI ? 'human'\n // Otherwise, use json output\n : 'json'\n\nexport const defaultEditor = () =>\n process.env.EDITOR ||\n process.env.VISUAL ||\n (process.platform === 'win32' ?\n `${process.env.SYSTEMROOT}\\\\notepad.exe`\n : 'vi')\n\nconst canonicalCommands = {\n bugs: 'bugs',\n build: 'build',\n cache: 'cache',\n ci: 'ci',\n config: 'config',\n docs: 'docs',\n exec: 'exec',\n 'exec-local': 'exec-local',\n help: 'help',\n init: 'init',\n install: 'install',\n login: 'login',\n logout: 'logout',\n list: 'list',\n ls: 'ls',\n pack: 'pack',\n pkg: 'pkg',\n publish: 'publish',\n query: 'query',\n 'run-exec': 'run-exec',\n run: 'run',\n token: 'token',\n uninstall: 'uninstall',\n update: 'update',\n 'exec-cache': 'exec-cache',\n version: 'version',\n whoami: 'whoami',\n} as const\n\nconst aliases = {\n i: 'install',\n add: 'install',\n rm: 'uninstall',\n u: 'update',\n p: 'pkg',\n pub: 'publish',\n q: 'query',\n b: 'build',\n r: 'run',\n 'run-script': 'run',\n rx: 'run-exec',\n x: 'exec',\n xl: 'exec-local',\n h: 'help',\n '?': 'help',\n ls: 'list',\n xc: 'exec-cache',\n} as const\n\n/**\n * Command aliases mapped to their canonical names\n */\nexport const commands = {\n ...canonicalCommands,\n ...aliases,\n} as const\n\n/**\n * Canonical command names mapped to an array of its aliases\n */\nexport const commandAliases = Object.entries(aliases).reduce(\n (acc, [alias, canonical]) => {\n const commandAliases = acc.get(canonical)\n if (commandAliases) {\n commandAliases.push(alias)\n } else {\n acc.set(canonical, [alias])\n }\n return acc\n },\n new Map<string, string[]>(),\n)\n\nexport type Commands = typeof commands\n\nexport const getCommand = (\n s?: string,\n): Commands[keyof Commands] | undefined =>\n s && s in commands ? commands[s as keyof Commands] : undefined\n\nconst xdg = new XDG('vlt')\nconst cacheDir = xdg.cache()\n\n/**\n * Fields that are parsed as a set of key=value pairs\n */\nexport const recordFields = [\n 'git-hosts',\n 'registries',\n 'git-host-archives',\n 'scope-registries',\n 'jsr-registries',\n] as const\n\nexport type RecordField = (typeof recordFields)[number]\n\nexport const isRecordField = (s: string): s is RecordField =>\n recordFields.includes(s as RecordField)\n\nconst stopParsingCommands: Commands[keyof Commands][] = [\n 'run',\n 'run-exec',\n 'exec-local',\n 'exec',\n]\n\nlet stopParsing: boolean | undefined = undefined\n\nconst j = jack({\n envPrefix: 'VLT',\n allowPositionals: true,\n usage: `vlt [<options>] [<cmd> [<args> ...]]`,\n stopAtPositionalTest: arg => {\n if (stopParsing) return true\n const a = arg as keyof Commands\n // we stop parsing AFTER the thing, so you can do\n // vlt run --vlt --configs scriptName --args --for --script\n // or\n // vlt exec --vlt --configs command --args --for --command\n if (stopParsingCommands.includes(commands[a])) {\n stopParsing = true\n }\n return false\n },\n})\n .heading('vlt')\n .description(\n `More documentation available at <https://docs.vlt.sh>`,\n )\n .heading('Subcommands')\n\nj.description(Object.keys(canonicalCommands).join(', '), {\n pre: true,\n}).description(\n 'Run `vlt <cmd> --help` for more information about a specific command',\n)\n\nexport const definition = j\n /**\n * Definition of all configuration values used by vlt.\n */\n .heading('Configuration')\n .description(\n `If a \\`vlt.json\\` file is present in the root of the current project,\n then that will be used as a source of configuration information.\n\n Next, the \\`vlt.json\\` file in the XDG specified config directory\n will be checked, and loaded for any fields not set in the local project.\n\n Object type values will be merged together. Set a field to \\`null\\` in\n the JSON configuration to explicitly remove it.\n\n Command-specific fields may be set in a nested \\`command\\` object that\n overrides any options defined at the top level.\n `,\n )\n\n .flag({\n color: {\n short: 'c',\n description: 'Use colors (Default for TTY)',\n },\n 'no-color': {\n short: 'C',\n description: 'Do not use colors (Default for non-TTY)',\n },\n })\n\n .opt({\n registry: {\n hint: 'url',\n default: 'https://registry.npmjs.org/',\n description: `Sets the registry for fetching packages, when no registry\n is explicitly set on a specifier.\n\n For example, \\`express@latest\\` will be resolved by looking\n up the metadata from this registry.\n\n Note that alias specifiers starting with \\`npm:\\` will\n still map to \\`https://registry.npmjs.org/\\` if this is\n changed, unless the a new mapping is created via the\n \\`--registries\\` option.\n `,\n },\n })\n\n .optList({\n registries: {\n hint: 'name=url',\n description: `Specify named registry hosts by their prefix. To set the\n default registry used for non-namespaced specifiers,\n use the \\`--registry\\` option.\n\n Prefixes can be used as a package alias. For example:\n\n \\`\\`\\`\n vlt --registries loc=http://reg.local install foo@loc:foo@1.x\n \\`\\`\\`\n\n By default, the public npm registry is registered to the\n \\`npm:\\` prefix. It is not recommended to change this\n mapping in most cases.\n `,\n },\n\n 'scope-registries': {\n hint: '@scope=url',\n description: `Map package name scopes to registry URLs.\n\n For example,\n \\`--scope-registries @acme=https://registry.acme/\\`\n would tell vlt to fetch any packages named\n \\`@acme/...\\` from the \\`https://registry.acme/\\`\n registry.\n\n Note: this way of specifying registries is more ambiguous,\n compared with using the \\`--registries\\` field and explicit\n prefixes, because instead of failing when the configuration\n is absent, it will instead attempt to fetch from the\n default registry.\n\n By comparison, using\n \\`--registries acme=https://registry.acme/\\` and then\n specifying dependencies such as \\`\"foo\": \"acme:foo@1.x\"\\`\n means that regardless of the name, the package will be\n fetched from the explicitly named registry, or fail if\n no registry is defined with that name.\n\n However, custom registry aliases are not supported by other\n package managers.`,\n },\n\n 'jsr-registries': {\n hint: 'name=url',\n description: `Map alias names to JSR.io registry urls.\n\n For example,\n \\`--jsr-registries acme=https://jsr.acme.io/\\` would\n tell vlt to fetch any packages with the \\`acme:\\` registry\n prefix from the \\`https://jsr.acme.io/\\` registry, using\n the \"npm Compatibility\" translation. So for example,\n the package \\`acme:@foo/bar\\` would fetch the\n \\`@jsr/foo__bar\\` package from the \\`jsr.acme.io\\`\n registry.\n\n By default the \\`jsr\\` alias is always mapped to\n \\`https://npm.jsr.io/\\`, so existing \\`jsr:\\` packages will\n be fetched from the public \\`jsr\\` registry appropriately.\n `,\n },\n\n 'git-hosts': {\n hint: `name=template`,\n short: 'G',\n description: `Map a shorthand name to a git remote URL template.\n\n The \\`template\\` may contain placeholders, which will be\n swapped with the relevant values.\n\n \\`$1\\`, \\`$2\\`, etc. are replaced with the appropriate\n n-th path portion. For example, \\`github:user/project\\`\n would replace the \\`$1\\` in the template with \\`user\\`,\n and \\`$2\\` with \\`project\\`.`,\n },\n\n 'git-host-archives': {\n hint: `name=template`,\n short: 'A',\n description: `Similar to the \\`--git-host <name>=<template>\\` option,\n this option can define a template string that will be\n expanded to provide the URL to download a pre-built\n tarball of the git repository.\n\n In addition to the n-th path portion expansions performed\n by \\`--git-host\\`, this field will also expand the\n string \\`$committish\\` in the template, replacing it with\n the resolved git committish value to be fetched.`,\n },\n })\n\n .opt({\n cache: {\n hint: 'path',\n description: `\n Location of the vlt on-disk cache. Defaults to the platform-specific\n directory recommended by the XDG specification.\n `,\n default: cacheDir,\n },\n tag: {\n description: `Default \\`dist-tag\\` to install or publish`,\n default: 'latest',\n },\n before: {\n hint: 'date',\n description: `Do not install any packages published after this date`,\n },\n os: {\n description: `The operating system to use as the selector when choosing\n packages based on their \\`os\\` value.`,\n default: process.platform,\n },\n arch: {\n description: `CPU architecture to use as the selector when choosing\n packages based on their \\`cpu\\` value.`,\n default: process.arch,\n },\n libc: {\n description: `Override the libc family to use as the selector when choosing\n packages based on their \\`libc\\` value (e.g. glibc, musl).\n By default, this is auto-detected on Linux systems.`,\n },\n 'node-version': {\n hint: 'version',\n description: `Node version to use when choosing packages based on\n their \\`engines.node\\` value.`,\n default: process.version,\n },\n })\n\n .flag({\n 'git-shallow': {\n description: `Set to force \\`--depth=1\\` on all git clone actions.\n When set explicitly to false with --no-git-shallow,\n then \\`--depth=1\\` will not be used.\n\n When not set explicitly, \\`--depth=1\\` will be used for\n git hosts known to support this behavior.`,\n },\n })\n .num({\n 'fetch-retries': {\n hint: 'n',\n description: `Number of retries to perform when encountering network\n errors or likely-transient errors from git hosts.`,\n default: 3,\n },\n 'fetch-retry-factor': {\n hint: 'n',\n description: `The exponential backoff factor to use when retrying\n requests due to network issues.`,\n default: 2,\n },\n 'fetch-retry-mintimeout': {\n hint: 'n',\n description: `Number of milliseconds before starting first retry`,\n default: 0,\n },\n 'fetch-retry-maxtimeout': {\n hint: 'n',\n description: `Maximum number of milliseconds between two retries`,\n default: 30_000,\n },\n 'stale-while-revalidate-factor': {\n hint: 'n',\n default: 60,\n description: `If the server does not serve a \\`stale-while-revalidate\\`\n value in the \\`cache-control\\` header, then this multiplier\n is applied to the \\`max-age\\` or \\`s-maxage\\` values.\n\n By default, this is \\`60\\`, so for example a response that\n is cacheable for 5 minutes will allow a stale response\n while revalidating for up to 5 hours.\n\n If the server *does* provide a \\`stale-while-revalidate\\`\n value, then that is always used.\n\n Set to 0 to prevent any \\`stale-while-revalidate\\` behavior\n unless explicitly allowed by the server's \\`cache-control\\`\n header.\n `,\n },\n })\n\n .opt({\n identity: {\n short: 'i',\n validate: (v: unknown) =>\n typeof v === 'string' && /^[a-z0-9]*$/.test(v),\n hint: 'name',\n default: '',\n description: `Provide a string to define an identity for storing auth\n information when logging into registries.\n\n Authentication tokens will be stored in the XDG data\n directory, in \\`vlt/auth/$\\{identity}/keychain.json\\`.\n\n If no identity is provided, then the default \\`''\\` will\n be used, storing the file at \\`vlt/auth/keychain.json\\`.\n\n May only contain lowercase alphanumeric characters.\n `,\n },\n })\n\n .optList({\n workspace: {\n hint: 'ws',\n short: 'w',\n description: `Set to limit the spaces being worked on when working on\n workspaces.\n\n Can be paths or glob patterns matching paths.\n\n Specifying workspaces by package.json name is not\n supported.`,\n },\n 'workspace-group': {\n description: `Specify named workspace group names to load and operate on\n when doing recursive operations on workspaces.`,\n },\n })\n\n .opt({\n scope: {\n short: 's',\n hint: 'query',\n description:\n 'Set to filter the scope of an operation using a DSS Query.',\n },\n target: {\n short: 't',\n hint: 'query',\n description:\n 'Set to select packages using a DSS Query selector.',\n },\n })\n\n .flag({\n 'if-present': {\n description: `When running scripts across multiple packages,\n only include packages that have the script.\n\n If this is not set, then the run will fail if any\n packages do not have the script.\n\n This will default to true if --scope, --workspace,\n --workspace-group, or --recursive is set. Otherwise,\n it will default to false.`,\n },\n })\n\n .flag({\n recursive: {\n short: 'r',\n description: `Run an operation across multiple workspaces.\n\n No effect when used in non-monorepo projects.\n\n Implied by setting --workspace or --workspace-group. If\n not set, then the action is run on the project root.`,\n },\n\n bail: {\n short: 'b',\n description: `When running scripts across multiple workspaces, stop\n on the first failure.`,\n default: true,\n },\n\n 'no-bail': {\n short: 'B',\n description: `When running scripts across multiple workspaces, continue\n on failure, running the script for all workspaces.`,\n },\n })\n\n .opt({\n config: {\n hint: 'all | user | project',\n description: `Specify which configuration to show or operate on when running\n \\`vlt config\\` commands. For read operations (get, pick, list):\n \\`all\\` shows merged configuration from both user and project\n files (default). For write operations (set, delete, edit):\n defaults to \\`project\\`. \\`user\\` shows/modifies only user-level\n configuration, \\`project\\` shows/modifies only project-level\n configuration.`,\n validOptions: ['all', 'user', 'project'] as const,\n default: 'all',\n },\n\n editor: {\n hint: 'program',\n description: `The blocking editor to use for \\`vlt config edit\\` and\n any other cases where a file should be opened for\n editing.\n\n Defaults to the \\`EDITOR\\` or \\`VISUAL\\` env if set, or\n \\`notepad.exe\\` on Windows, or \\`vi\\` elsewhere.`,\n default: defaultEditor(),\n },\n\n 'script-shell': {\n hint: 'program',\n description: `The shell to use when executing \\`package.json#scripts\\`.\n\n For \\`vlt exec\\` and \\`vlt exec-local\\`, this is never set,\n meaning that command arguments are run exactly as provided.\n\n For \\`vlt run\\` (and other things that run lifecycle\n scripts in \\`package.json#scripts\\`), the entire command\n with all arguments is provided as a single string, meaning\n that some value must be provided for shell interpretation,\n and so for these contexts, the \\`script-shell\\` value will\n default to \\`/bin/sh\\` on POSIX systems or \\`cmd.exe\\` on\n Windows.\n `,\n },\n\n 'fallback-command': {\n hint: 'command',\n description: `The command to run when the first argument doesn't\n match any known commands.\n\n For pnpm-style behavior, set this to 'run-exec'. e.g:\n \\`\\`\\`\n vlt config set fallback-command=run-exec\n \\`\\`\\``,\n default: 'help',\n validOptions: Object.keys(canonicalCommands),\n },\n })\n\n .opt({\n package: {\n hint: 'p',\n description: `When running \\`vlt exec\\`, this allows you to explicitly\n set the package to search for bins. If not provided, then\n vlt will interpret the first argument as the package, and\n attempt to run the default executable.`,\n },\n })\n\n .opt({\n view: {\n hint: 'output',\n default: defaultView,\n description: `Configures the output format for commands.\n\n Defaults to \\`human\\` if stdout is a TTY, or \\`json\\`\n if it is not.\n\n - human: Maximally ergonomic output reporting for human\n consumption.\n - json: Parseable JSON output for machines.\n - inspect: Output results with \\`util.inspect\\`.\n - mermaid: Output mermaid diagramming syntax. (Only\n relevant for certain commands.)\n - silent: Suppress all output to stdout.\n\n If the requested view format is not supported for the\n current command, or if no option is provided, then it\n will fall back to the default.\n `,\n validOptions: [\n 'human',\n 'json',\n 'mermaid',\n 'inspect',\n 'silent',\n ] as const,\n },\n })\n\n .optList({\n 'dashboard-root': {\n hint: 'path',\n description: `The root directory to use for the dashboard browser-based UI.\n If not set, the user home directory is used.`,\n },\n })\n\n .flag({\n 'save-dev': {\n short: 'D',\n description: `Save installed packages to a package.json file as\n devDependencies`,\n },\n 'save-optional': {\n short: 'O',\n description: `Save installed packages to a package.json file as\n optionalDependencies`,\n },\n 'save-peer': {\n description: `Save installed packages to a package.json file as\n peerDependencies`,\n },\n 'save-prod': {\n short: 'P',\n description: `Save installed packages into dependencies specifically.\n This is useful if a package already exists in\n devDependencies or optionalDependencies, but you want to\n move it to be a non-optional production dependency.`,\n },\n })\n\n .opt({\n 'expect-results': {\n hint: 'value',\n validate: (v: unknown) =>\n typeof v === 'string' && /^([<>]=?)?[0-9]+$/.test(v),\n description: `When running \\`vlt query\\`, this option allows you to\n set a expected number of resulting items.\n\n Accepted values are numbers and strings.\n\n Strings starting with \\`>\\`, \\`<\\`, \\`>=\\` or \\`<=\\`\n followed by a number can be used to check if the result\n is greater than or less than a specific number.`,\n },\n })\n\n .flag({\n 'dry-run': {\n description: 'Run command without making any changes',\n },\n 'expect-lockfile': {\n description:\n 'Fail if lockfile is missing or out of date. Used by ci command to enforce lockfile integrity.',\n },\n 'frozen-lockfile': {\n description:\n 'Fail if lockfile is missing or out of sync with package.json. Prevents any lockfile modifications.',\n },\n 'lockfile-only': {\n description:\n 'Only update the lockfile (vlt-lock.json) and package.json files, skip all node_modules operations including package extraction and filesystem changes.',\n },\n })\n .opt({\n 'allow-scripts': {\n hint: 'query',\n description: `Filter which packages are allowed to run lifecycle scripts using DSS query syntax.\n When provided, only packages matching the query will execute their\n install, preinstall, postinstall, prepare, preprepare, and postprepare scripts.\n Defaults to ':not(*)' which means no scripts will be run.\n \n Example: --allow-scripts=\":root > *, #my-package\"\n Runs scripts only for direct dependencies of the current project and any occurrences\n of a specific dependency with the name \"my-package\" anywhere in the dependency graph.`,\n },\n })\n .opt({\n access: {\n description: 'Set the access level of the package',\n validOptions: ['public', 'restricted'] as const,\n default: 'public',\n },\n })\n .opt({\n otp: {\n description: `Provide an OTP to use when publishing a package.`,\n },\n 'publish-directory': {\n hint: 'path',\n description: `Directory to use for pack and publish operations instead of the current directory.\n The directory must exist and nothing will be copied to it.`,\n },\n })\n\n .flag({\n yes: {\n short: 'y',\n description: `Automatically accept any confirmation prompts`,\n },\n version: {\n short: 'v',\n description: 'Print the version',\n },\n help: {\n short: 'h',\n description: 'Print helpful information',\n },\n all: {\n short: 'a',\n description: 'Show all commands, bins, and flags',\n },\n })\n\nexport const getSortedCliOptions = () => {\n const defs = definition.toJSON()\n return getSortedKeys().map((k: keyof typeof defs) => {\n const def = defs[k]\n /* c8 ignore next */\n if (!def) throw error('invalid key found', { found: k })\n if (def.type === 'boolean') return `--${k}`\n return `--${k}=<${def.hint ?? k}>`\n })\n}\n\nexport const getSortedKeys = () =>\n Object.keys(definition.toJSON()).sort((a, b) => a.localeCompare(b))\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAM/C,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EACL,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CAAC;IAMrC;;;OAGG;IACG,eAAe,CACnB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC;IA2FrC;;;OAGG;IACG,gBAAgB,CACpB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EAAE;IAwClB;;;;;;;;;OASG;IACG,cAAc,CAClB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAmC9C;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBrC;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BrC;;;OAGG;WACU,IAAI,CACf,WAAW,SAAgB,EAC3B,IAAI,WAAe;IACnB;;;OAGG;IACH,MAAM,UAAQ,GACb,OAAO,CAAC,YAAY,CAAC;CAOzB;AAKD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAClC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAA;IACvC,MAAM,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IACzC,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAA"}
|
package/dist/config/index.js
CHANGED
|
@@ -281,10 +281,40 @@ export class Config {
|
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
const { command, ...values } = recordsToPairs(c);
|
|
284
|
+
// Validate registries keys don't contain reserved ~ character
|
|
285
|
+
const registries = c.registries;
|
|
286
|
+
if (registries && typeof registries === 'object') {
|
|
287
|
+
const registriesObj = Array.isArray(registries) ?
|
|
288
|
+
reducePairs(registries)
|
|
289
|
+
: registries;
|
|
290
|
+
for (const key of Object.keys(registriesObj)) {
|
|
291
|
+
if (key === '' || key.includes('~')) {
|
|
292
|
+
throw error('Reserved character found in registries name', {
|
|
293
|
+
path: file,
|
|
294
|
+
found: key,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
284
299
|
if (command) {
|
|
285
300
|
for (const [c, opts] of Object.entries(command)) {
|
|
286
301
|
const cmd = getCommand(c);
|
|
287
|
-
if (cmd) {
|
|
302
|
+
if (cmd && opts && typeof opts === 'object') {
|
|
303
|
+
// Validate registries in command-specific config
|
|
304
|
+
const cmdRegistries = opts.registries;
|
|
305
|
+
if (cmdRegistries && typeof cmdRegistries === 'object') {
|
|
306
|
+
const cmdRegistriesObj = Array.isArray(cmdRegistries) ?
|
|
307
|
+
reducePairs(cmdRegistries)
|
|
308
|
+
: cmdRegistries;
|
|
309
|
+
for (const key of Object.keys(cmdRegistriesObj)) {
|
|
310
|
+
if (key === '' || key.includes('~')) {
|
|
311
|
+
throw error('Reserved character found in registries name', {
|
|
312
|
+
path: file,
|
|
313
|
+
found: key,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
288
318
|
this.commandValues[cmd] = merge(this.commandValues[cmd] ?? {}, opts);
|
|
289
319
|
}
|
|
290
320
|
}
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,eAAe,CAA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.json` file in the local project\n * if present. This will override the user-level configs in the appropriate\n * XDG config path.\n *\n * Command-specific configuration can be specified by putting options in a\n * field in the `command` object. For example:\n *\n * ```json\n * {\n * \"registry\": \"https://registry.npmjs.org/\",\n * \"command\": {\n * \"publish\": {\n * \"registry\": \"http://registry.internal\"\n * }\n * }\n * }\n * ```\n * @module\n */\n\nimport { error } from '@vltpkg/error-cause'\nimport { PackageInfoClient } from '@vltpkg/package-info'\nimport { PackageJson } from '@vltpkg/package-json'\nimport { resetCaches } from '@vltpkg/dep-id'\nimport type { SpecOptions } from '@vltpkg/spec'\nimport {\n assertRecordStringString,\n assertRecordStringT,\n isRecordStringString,\n} from '@vltpkg/types'\nimport type { Validator, WhichConfig } from '@vltpkg/vlt-json'\nimport { find, load, reload, save } from '@vltpkg/vlt-json'\nimport { Monorepo } from '@vltpkg/workspaces'\nimport type { Jack, OptionsResults, Unwrap } from 'jackspeak'\nimport { readFile, rm, writeFile } from 'node:fs/promises'\nimport { dirname } from 'node:path'\nimport { PathScurry } from 'path-scurry'\nimport type { Commands, RecordField } from './definition.ts'\nimport {\n commands,\n definition,\n getCommand,\n isRecordField,\n recordFields,\n} from './definition.ts'\nimport { merge } from './merge.ts'\nexport {\n commands,\n definition,\n isRecordField,\n recordFields,\n type Commands,\n}\n\nexport const kCustomInspect = Symbol.for('nodejs.util.inspect.custom')\n\nexport type RecordPairs = Record<string, unknown>\nexport type RecordString = Record<string, string>\n\n// turn a set of pairs into a Record object.\n// if a kv pair doesn't have a = character, set to `''`\nconst reducePairs = <T extends string[]>(\n pairs: T,\n): RecordString | T => {\n const record: RecordString = {}\n for (const kv of pairs) {\n const eq = kv.indexOf('=')\n if (eq === -1) record[kv] = ''\n else {\n const key = kv.substring(0, eq)\n const val = kv.substring(eq + 1)\n record[key] = val\n }\n }\n return record\n}\n\nconst isRecordFieldValue = (k: string, v: unknown): v is string[] =>\n Array.isArray(v) &&\n recordFields.includes(k as (typeof recordFields)[number])\n\nexport type PairsAsRecords = ConfigOptionsNoExtras & {\n command?: {\n [k in keyof Commands]?: ConfigOptionsNoExtras\n }\n}\n\nexport const pairsToRecords = (\n obj:\n | NonNullable<ConfigFileData>\n | OptionsResults<ConfigDefinitions>,\n): PairsAsRecords => {\n return Object.fromEntries(\n Object.entries(obj).map(([k, v]) => [\n k,\n k === 'command' && v && typeof v === 'object' ?\n Object.fromEntries(\n Object.entries(v).map(([k, v]) => [\n k,\n pairsToRecords(v as NonNullable<ConfigFileData>),\n ]),\n )\n : isRecordFieldValue(k, v) ? reducePairs(v)\n : v,\n ]),\n // hard cast because TS can't see through the entries/fromEntries\n ) as unknown as PairsAsRecords\n}\n\nexport const recordsToPairs = (obj: RecordPairs): RecordPairs => {\n return Object.fromEntries(\n Object.entries(obj)\n .filter(\n ([k]) =>\n !(\n k === 'scurry' ||\n k === 'packageJson' ||\n k === 'monorepo' ||\n k === 'projectRoot' ||\n k === 'packageInfo'\n ),\n )\n .map(([k, v]) => [\n k,\n k === 'command' && v && typeof v === 'object' ?\n recordsToPairs(v as RecordPairs)\n : (\n !v ||\n typeof v !== 'object' ||\n Array.isArray(v) ||\n !isRecordField(k)\n ) ?\n v\n : Object.entries(v).map(([k, v]) => `${k}=${v}`),\n ]),\n )\n}\n\nconst kRecord = Symbol('parsed key=value record')\n\nexport type ConfigDataNoCommand = {\n [k in keyof OptionsResults<ConfigDefinitions>]?: OptionsResults<ConfigDefinitions>[k]\n}\n\n/**\n * Config data can be any options, and also a 'command' field which\n * contains command names and override options for that command.\n */\nexport type ConfigData = ConfigDataNoCommand & {\n command?: {\n [k in keyof Commands]?: ConfigDataNoCommand\n }\n}\n\nexport type ConfigFileDataNoCommand = {\n [k in keyof ConfigDataNoCommand]: k extends (\n OptListKeys<ConfigDataNoCommand>\n ) ?\n RecordString | string[]\n : ConfigDataNoCommand[k]\n}\n\n/**\n * Config data as it appears in the config field of the vlt.json, with kv pair\n * lists stored as `Record<string, string>` and\n */\nexport type ConfigFileData = ConfigFileDataNoCommand & {\n command?: {\n [k in keyof Commands]?: ConfigFileDataNoCommand\n }\n}\n\nexport type ConfigOptionsNoExtras = {\n [k in keyof OptionsResults<ConfigDefinitions>]: k extends (\n RecordField\n ) ?\n RecordString\n : k extends 'command' ? never\n : OptionsResults<ConfigDefinitions>[k]\n}\n\nexport type ConfigOptions = ConfigOptionsNoExtras &\n Pick<SpecOptions, 'catalog' | 'catalogs'> & {\n packageJson: PackageJson\n scurry: PathScurry\n projectRoot: string\n monorepo?: Monorepo\n packageInfo: PackageInfoClient\n }\n\n/**\n * The base config definition set as a type\n */\nexport type ConfigDefinitions = Unwrap<typeof definition>\n\nexport type StringListKeys<O> = {\n [k in keyof O]: O[k] extends string[] | undefined ? k : never\n}\nexport type OptListKeys<O> = Exclude<\n StringListKeys<O>[keyof StringListKeys<O>],\n undefined\n>\n\n/**\n * Class that handles configuration for vlt.\n *\n * Call {@link Config.load} to get one of these.\n */\nexport class Config {\n /**\n * The {@link https://npmjs.com/jackspeak | JackSpeak} object\n * representing vlt's configuration\n */\n jack: Jack<ConfigDefinitions>\n\n /**\n * Parsed values in effect\n */\n values?: OptionsResults<ConfigDefinitions>\n\n /**\n * Command-specific config values\n */\n commandValues: {\n [cmd in Commands[keyof Commands]]?: ConfigData\n } = {}\n\n /**\n * A flattened object of the parsed configuration\n */\n get options(): ConfigOptions {\n if (this.#options) return this.#options\n const scurry = new PathScurry(this.projectRoot)\n const packageJson = new PackageJson()\n const asRecords = pairsToRecords(this.parse().values)\n const extras = {\n projectRoot: this.projectRoot,\n scurry,\n packageJson,\n monorepo: Monorepo.maybeLoad(this.projectRoot, {\n scurry,\n packageJson,\n load: {\n paths: asRecords.workspace,\n groups: asRecords['workspace-group'],\n },\n }),\n catalog: load<Record<string, string>>(\n 'catalog',\n assertRecordStringString,\n ),\n catalogs: load<Record<string, Record<string, string>>>(\n 'catalogs',\n o =>\n assertRecordStringT(\n o,\n isRecordStringString,\n 'Record<string, Record<string, string>>',\n ),\n ),\n }\n\n const options: Omit<ConfigOptions, 'packageInfo'> = Object.assign(\n asRecords,\n extras,\n )\n\n this.#options = Object.assign(options, {\n packageInfo: new PackageInfoClient(options),\n [kCustomInspect]() {\n return Object.fromEntries(\n Object.entries(options).filter(\n ([k]) =>\n k !== 'monorepo' &&\n k !== 'scurry' &&\n k !== 'packageJson' &&\n k !== 'packageInfo',\n ),\n )\n },\n })\n return this.#options\n }\n\n /**\n * Reset the options value, optionally setting a new project root\n * to recalculate the options.\n */\n resetOptions(projectRoot: string = process.cwd()) {\n this.projectRoot = projectRoot\n this.#options = undefined\n resetCaches()\n }\n\n // memoized options() getter value\n #options?: ConfigOptions\n\n /**\n * positional arguments to the vlt process\n */\n positionals?: string[]\n\n /**\n * Original arguments used for parsing (stored for reload purposes)\n * @internal\n */\n #originalArgs?: string[]\n\n /**\n * The root of the project where a vlt.json, vlt.json,\n * package.json, or .git was found. Not necessarily the `process.cwd()`,\n * though that is the default location.\n *\n * Never walks up as far as `$HOME`. So for example, if a project is in\n * `~/projects/xyz`, then the highest dir it will check is `~/projects`\n */\n projectRoot: string\n\n /**\n * `Record<alias, canonical name>` to dereference command aliases.\n */\n commands: Commands\n\n /**\n * Which command name to use for overriding with command-specific values,\n * determined from the argv when parse() is called.\n */\n command?: Commands[keyof Commands]\n\n constructor(\n jack: Jack<ConfigDefinitions> = definition,\n projectRoot = process.cwd(),\n ) {\n this.projectRoot = projectRoot\n this.commands = commands\n this.jack = jack\n }\n\n /**\n * Parse the arguments and set configuration and positionals accordingly.\n */\n parse(args: string[] = process.argv): this & ParsedConfig {\n if (isParsed(this)) return this\n\n // Store the original args for potential reload\n this.#originalArgs = [...args]\n\n this.jack.loadEnvDefaults()\n const p = this.jack.parseRaw(args)\n\n const fallback = getCommand(p.values['fallback-command'])\n this.command = getCommand(p.positionals[0])\n\n const cmdOrFallback = this.command ?? fallback\n const cmdSpecific =\n cmdOrFallback && this.commandValues[cmdOrFallback]\n if (cmdSpecific) {\n this.jack.setConfigValues(recordsToPairs(cmdSpecific))\n }\n\n // ok, applied cmd-specific defaults, do rest of the parse\n this.jack.applyDefaults(p)\n this.jack.writeEnv(p)\n\n if (this.command) p.positionals.shift()\n else this.command = getCommand(p.values['fallback-command'])\n\n Object.assign(this, p)\n\n /* c8 ignore start - unpossible */\n if (!isParsed(this)) throw error('failed to parse config')\n /* c8 ignore stop */\n\n return this\n }\n\n /**\n * Get a `key=value` list option value as an object.\n *\n * For example, a list option with a vlaue of `['key=value', 'xyz=as=df' ]`\n * would be returned as `{key: 'value', xyz: 'as=df'}`\n *\n * Results are memoized, so subsequent calls for the same key will return the\n * same object. If new strings are added to the list, then the memoized value\n * is *not* updated, so only use once configurations have been fully loaded.\n *\n * If the config value is not set at all, an empty object is returned.\n */\n getRecord(k: OptListKeys<ConfigData>): RecordString {\n const pairs = this.get(k) as\n | (string[] & { [kRecord]?: RecordString })\n | undefined\n if (!pairs) return {}\n if (pairs[kRecord]) return pairs[kRecord]\n const kv = pairs.reduce((kv: RecordString, pair) => {\n const eq = pair.indexOf('=')\n if (eq === -1) return kv\n const key = pair.substring(0, eq)\n const val = pair.substring(eq + 1)\n kv[key] = val\n return kv\n }, {})\n Object.assign(pairs, { [kRecord]: kv })\n return kv\n }\n\n /**\n * Get a configuration value.\n *\n * Note: `key=value` pair configs are returned as a string array. To get them\n * as an object, use {@link Config#getRecord}.\n */\n get<K extends keyof OptionsResults<ConfigDefinitions>>(\n k: K,\n ): OptionsResults<ConfigDefinitions>[K] {\n /* c8 ignore next -- impossible but TS doesn't know that */\n return (this.values ?? this.parse().values)[k]\n }\n\n /**\n * Write the config values to the user or project config file.\n */\n async writeConfigFile(\n this: LoadedConfig,\n which: WhichConfig,\n values: NonNullable<ConfigFileData>,\n ) {\n save('config', pairsToRecords(values), which)\n await this.#reloadConfig()\n }\n\n /**\n * Fold in the provided fields with the existing properties\n * in the config file.\n */\n async addConfigToFile(\n this: LoadedConfig,\n which: WhichConfig,\n values: NonNullable<ConfigFileData>,\n ) {\n return this.writeConfigFile(\n which,\n merge((await this.#maybeLoadConfigFile(which)) ?? {}, values),\n )\n }\n\n // called in this weird bound way so that it can be used by the\n // vlt-json config loading module.\n #validator: Validator<ConfigFileData> = function (\n this: Config,\n c: unknown,\n file: string,\n ) {\n this.#validateConfig(c, file)\n }.bind(this)\n\n #validateConfig(\n c: unknown,\n file: string,\n ): asserts c is ConfigFileData {\n if (!c || typeof c !== 'object' || Array.isArray(c)) {\n throw error('invalid config, expected object', {\n path: file,\n found: c,\n wanted: 'ConfigFileData',\n })\n }\n\n const { command, ...values } = recordsToPairs(c as RecordPairs)\n if (command) {\n for (const [c, opts] of Object.entries(command)) {\n const cmd = getCommand(c)\n if (cmd) {\n this.commandValues[cmd] = merge<ConfigData>(\n this.commandValues[cmd] ?? ({} as ConfigData),\n opts as ConfigData,\n )\n }\n }\n }\n this.jack.setConfigValues(values, file)\n }\n\n /**\n * if the file exists, parse and load it. returns object if data was\n * loaded, or undefined if not.\n */\n async #maybeLoadConfigFile(whichConfig: WhichConfig) {\n return load('config', this.#validator, whichConfig)\n }\n\n /**\n * Deletes the specified config fields from the named file\n * Returns `true` if anything was changed.\n */\n async deleteConfigKeys(\n this: LoadedConfig,\n which: WhichConfig,\n fields: string[],\n ) {\n const data = await this.#maybeLoadConfigFile(which)\n if (!data) return false\n let didSomething = false\n for (const f of fields) {\n const [key, ...sk] = f.split('.') as [\n h: string,\n ...rest: string[],\n ]\n const subs = sk.join('.')\n const k = key as keyof ConfigDefinitions\n const v = data[k]\n if (v === undefined) continue\n if (subs && v && typeof v === 'object') {\n if (Array.isArray(v)) {\n const i = v.findIndex(subvalue =>\n subvalue.startsWith(`${subs}=`),\n )\n if (i !== -1) {\n if (v.length === 1) delete data[k]\n else v.splice(i, 1)\n didSomething = true\n }\n } else {\n if (v[subs] !== undefined) {\n delete v[subs]\n if (Object.keys(v).length === 0) delete data[k]\n didSomething = true\n }\n }\n } else {\n didSomething = true\n delete data[k]\n }\n }\n if (didSomething) await this.writeConfigFile(which, data)\n return didSomething\n }\n\n /**\n * Edit the user or project configuration file.\n *\n * If the file isn't present, then it starts with `{}` so the user has\n * something to work with.\n *\n * If the result is not valid, or no config settings are contained in the\n * file after editing, then it's restored to what it was before, which might\n * mean deleting the file.\n */\n async editConfigFile(\n this: LoadedConfig,\n which: WhichConfig,\n edit: (file: string) => Promise<void> | void,\n ) {\n // load the file as a backup\n // call the edit function\n // reload it\n const file = find(which)\n const backup = await readFile(file, 'utf8').catch(() => undefined)\n if (!backup) {\n await writeFile(\n file,\n JSON.stringify({ config: {} }, null, 2) + '\\n',\n )\n }\n let valid = false\n try {\n await edit(file)\n // force it to reload the file and validate it again\n // if this fails, we roll back.\n const result = reload('config', which)\n save('config', result ?? {}, which)\n valid = true\n } finally {\n if (!valid) {\n // TODO: maybe write the file to a re-edit backup location?\n // then you could do `vlt config edit retry` or something.\n if (backup) {\n await writeFile(file, backup)\n reload(which)\n } else {\n await rm(file, { force: true })\n }\n }\n }\n }\n\n /**\n * Find the local config file and load both it and the user-level config in\n * the XDG config home.\n */\n async loadConfigFile(): Promise<this> {\n await this.#maybeLoadConfigFile('user')\n this.projectRoot = dirname(find('project', this.projectRoot))\n await this.#maybeLoadConfigFile('project')\n return this\n }\n\n /**\n * Clear cached config values to force re-reading from updated files.\n * @internal\n */\n async #reloadConfig() {\n // Clear the memoized options to force recalculation\n this.#options = undefined\n }\n\n /**\n * Force a complete reload of config files from disk.\n * This clears all caches and re-reads config files.\n * Useful for long-running processes that need to pick up config changes.\n */\n async reloadFromDisk(): Promise<void> {\n // Clear the memoized options to force recalculation\n this.#options = undefined\n\n // Clear the parsed state to force re-parsing\n // This is crucial because parse() returns early if already parsed\n this.values = undefined\n this.positionals = undefined\n this.command = undefined\n\n // Clear vlt-json caches for both user and project configs\n // This ensures that the next time config files are read, they'll be re-read from disk\n const { unload } = await import('@vltpkg/vlt-json')\n unload('user')\n unload('project')\n\n // Force reload of config files by calling the load methods again\n // This will re-read the files and re-apply them to the jack parser\n await this.#maybeLoadConfigFile('user')\n await this.#maybeLoadConfigFile('project')\n\n // Re-parse to pick up the updated config values using the original arguments\n this.parse(this.#originalArgs)\n }\n\n /**\n * cache of the loaded config\n */\n static #loaded: LoadedConfig | undefined\n\n /**\n * Load the configuration and return a Promise to a\n * {@link Config} object\n */\n static async load(\n projectRoot = process.cwd(),\n argv = process.argv,\n /**\n * only used in tests, resets the memoization\n * @internal\n */\n reload = false,\n ): Promise<LoadedConfig> {\n if (this.#loaded && !reload) return this.#loaded\n const a = new Config(definition, projectRoot)\n const b = await a.loadConfigFile()\n this.#loaded = b.parse(argv) as LoadedConfig\n return this.#loaded\n }\n}\n\nconst isParsed = (c: Config): c is ParsedConfig =>\n !!(c.values && c.positionals && c.command)\n\nexport type ParsedConfig = Config & {\n command: NonNullable<Config['command']>\n values: OptionsResults<ConfigDefinitions>\n positionals: string[]\n}\n\n/**\n * A fully loaded {@link Config} object\n */\nexport type LoadedConfig = ParsedConfig\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAA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AoB,CAAC,MAAM,CAAC,CAAA;QACvC,MAAM,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAA;QAE1C,6EAA6E;QAC7E,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAA0B;IAExC;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CACf,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,EAC3B,IAAI,GAAG,OAAO,CAAC,IAAI;IACnB;;;OAGG;IACH,MAAM,GAAG,KAAK;QAEd,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC,OAAO,CAAA;QAChD,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;QAC7C,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,cAAc,EAAE,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAiB,CAAA;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAqB,EAAE,CAChD,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA","sourcesContent":["/**\n * Module that handles all vlt configuration needs\n *\n * Project-level configs are set in a `vlt.json` file in the local project\n * if present. This will override the user-level configs in the appropriate\n * XDG config path.\n *\n * Command-specific configuration can be specified by putting options in a\n * field in the `command` object. For example:\n *\n * ```json\n * {\n * \"registry\": \"https://registry.npmjs.org/\",\n * \"command\": {\n * \"publish\": {\n * \"registry\": \"http://registry.internal\"\n * }\n * }\n * }\n * ```\n * @module\n */\n\nimport { error } from '@vltpkg/error-cause'\nimport { PackageInfoClient } from '@vltpkg/package-info'\nimport { PackageJson } from '@vltpkg/package-json'\nimport { resetCaches } from '@vltpkg/dep-id'\nimport type { SpecOptions } from '@vltpkg/spec'\nimport {\n assertRecordStringString,\n assertRecordStringT,\n isRecordStringString,\n} from '@vltpkg/types'\nimport type { Validator, WhichConfig } from '@vltpkg/vlt-json'\nimport { find, load, reload, save } from '@vltpkg/vlt-json'\nimport { Monorepo } from '@vltpkg/workspaces'\nimport type { Jack, OptionsResults, Unwrap } from 'jackspeak'\nimport { readFile, rm, writeFile } from 'node:fs/promises'\nimport { dirname } from 'node:path'\nimport { PathScurry } from 'path-scurry'\nimport type { Commands, RecordField } from './definition.ts'\nimport {\n commands,\n definition,\n getCommand,\n isRecordField,\n recordFields,\n} from './definition.ts'\nimport { merge } from './merge.ts'\nexport {\n commands,\n definition,\n isRecordField,\n recordFields,\n type Commands,\n}\n\nexport const kCustomInspect = Symbol.for('nodejs.util.inspect.custom')\n\nexport type RecordPairs = Record<string, unknown>\nexport type RecordString = Record<string, string>\n\n// turn a set of pairs into a Record object.\n// if a kv pair doesn't have a = character, set to `''`\nconst reducePairs = <T extends string[]>(\n pairs: T,\n): RecordString | T => {\n const record: RecordString = {}\n for (const kv of pairs) {\n const eq = kv.indexOf('=')\n if (eq === -1) record[kv] = ''\n else {\n const key = kv.substring(0, eq)\n const val = kv.substring(eq + 1)\n record[key] = val\n }\n }\n return record\n}\n\nconst isRecordFieldValue = (k: string, v: unknown): v is string[] =>\n Array.isArray(v) &&\n recordFields.includes(k as (typeof recordFields)[number])\n\nexport type PairsAsRecords = ConfigOptionsNoExtras & {\n command?: {\n [k in keyof Commands]?: ConfigOptionsNoExtras\n }\n}\n\nexport const pairsToRecords = (\n obj:\n | NonNullable<ConfigFileData>\n | OptionsResults<ConfigDefinitions>,\n): PairsAsRecords => {\n return Object.fromEntries(\n Object.entries(obj).map(([k, v]) => [\n k,\n k === 'command' && v && typeof v === 'object' ?\n Object.fromEntries(\n Object.entries(v).map(([k, v]) => [\n k,\n pairsToRecords(v as NonNullable<ConfigFileData>),\n ]),\n )\n : isRecordFieldValue(k, v) ? reducePairs(v)\n : v,\n ]),\n // hard cast because TS can't see through the entries/fromEntries\n ) as unknown as PairsAsRecords\n}\n\nexport const recordsToPairs = (obj: RecordPairs): RecordPairs => {\n return Object.fromEntries(\n Object.entries(obj)\n .filter(\n ([k]) =>\n !(\n k === 'scurry' ||\n k === 'packageJson' ||\n k === 'monorepo' ||\n k === 'projectRoot' ||\n k === 'packageInfo'\n ),\n )\n .map(([k, v]) => [\n k,\n k === 'command' && v && typeof v === 'object' ?\n recordsToPairs(v as RecordPairs)\n : (\n !v ||\n typeof v !== 'object' ||\n Array.isArray(v) ||\n !isRecordField(k)\n ) ?\n v\n : Object.entries(v).map(([k, v]) => `${k}=${v}`),\n ]),\n )\n}\n\nconst kRecord = Symbol('parsed key=value record')\n\nexport type ConfigDataNoCommand = {\n [k in keyof OptionsResults<ConfigDefinitions>]?: OptionsResults<ConfigDefinitions>[k]\n}\n\n/**\n * Config data can be any options, and also a 'command' field which\n * contains command names and override options for that command.\n */\nexport type ConfigData = ConfigDataNoCommand & {\n command?: {\n [k in keyof Commands]?: ConfigDataNoCommand\n }\n}\n\nexport type ConfigFileDataNoCommand = {\n [k in keyof ConfigDataNoCommand]: k extends (\n OptListKeys<ConfigDataNoCommand>\n ) ?\n RecordString | string[]\n : ConfigDataNoCommand[k]\n}\n\n/**\n * Config data as it appears in the config field of the vlt.json, with kv pair\n * lists stored as `Record<string, string>` and\n */\nexport type ConfigFileData = ConfigFileDataNoCommand & {\n command?: {\n [k in keyof Commands]?: ConfigFileDataNoCommand\n }\n}\n\nexport type ConfigOptionsNoExtras = {\n [k in keyof OptionsResults<ConfigDefinitions>]: k extends (\n RecordField\n ) ?\n RecordString\n : k extends 'command' ? never\n : OptionsResults<ConfigDefinitions>[k]\n}\n\nexport type ConfigOptions = ConfigOptionsNoExtras &\n Pick<SpecOptions, 'catalog' | 'catalogs'> & {\n packageJson: PackageJson\n scurry: PathScurry\n projectRoot: string\n monorepo?: Monorepo\n packageInfo: PackageInfoClient\n }\n\n/**\n * The base config definition set as a type\n */\nexport type ConfigDefinitions = Unwrap<typeof definition>\n\nexport type StringListKeys<O> = {\n [k in keyof O]: O[k] extends string[] | undefined ? k : never\n}\nexport type OptListKeys<O> = Exclude<\n StringListKeys<O>[keyof StringListKeys<O>],\n undefined\n>\n\n/**\n * Class that handles configuration for vlt.\n *\n * Call {@link Config.load} to get one of these.\n */\nexport class Config {\n /**\n * The {@link https://npmjs.com/jackspeak | JackSpeak} object\n * representing vlt's configuration\n */\n jack: Jack<ConfigDefinitions>\n\n /**\n * Parsed values in effect\n */\n values?: OptionsResults<ConfigDefinitions>\n\n /**\n * Command-specific config values\n */\n commandValues: {\n [cmd in Commands[keyof Commands]]?: ConfigData\n } = {}\n\n /**\n * A flattened object of the parsed configuration\n */\n get options(): ConfigOptions {\n if (this.#options) return this.#options\n const scurry = new PathScurry(this.projectRoot)\n const packageJson = new PackageJson()\n const asRecords = pairsToRecords(this.parse().values)\n const extras = {\n projectRoot: this.projectRoot,\n scurry,\n packageJson,\n monorepo: Monorepo.maybeLoad(this.projectRoot, {\n scurry,\n packageJson,\n load: {\n paths: asRecords.workspace,\n groups: asRecords['workspace-group'],\n },\n }),\n catalog: load<Record<string, string>>(\n 'catalog',\n assertRecordStringString,\n ),\n catalogs: load<Record<string, Record<string, string>>>(\n 'catalogs',\n o =>\n assertRecordStringT(\n o,\n isRecordStringString,\n 'Record<string, Record<string, string>>',\n ),\n ),\n }\n\n const options: Omit<ConfigOptions, 'packageInfo'> = Object.assign(\n asRecords,\n extras,\n )\n\n this.#options = Object.assign(options, {\n packageInfo: new PackageInfoClient(options),\n [kCustomInspect]() {\n return Object.fromEntries(\n Object.entries(options).filter(\n ([k]) =>\n k !== 'monorepo' &&\n k !== 'scurry' &&\n k !== 'packageJson' &&\n k !== 'packageInfo',\n ),\n )\n },\n })\n return this.#options\n }\n\n /**\n * Reset the options value, optionally setting a new project root\n * to recalculate the options.\n */\n resetOptions(projectRoot: string = process.cwd()) {\n this.projectRoot = projectRoot\n this.#options = undefined\n resetCaches()\n }\n\n // memoized options() getter value\n #options?: ConfigOptions\n\n /**\n * positional arguments to the vlt process\n */\n positionals?: string[]\n\n /**\n * Original arguments used for parsing (stored for reload purposes)\n * @internal\n */\n #originalArgs?: string[]\n\n /**\n * The root of the project where a vlt.json, vlt.json,\n * package.json, or .git was found. Not necessarily the `process.cwd()`,\n * though that is the default location.\n *\n * Never walks up as far as `$HOME`. So for example, if a project is in\n * `~/projects/xyz`, then the highest dir it will check is `~/projects`\n */\n projectRoot: string\n\n /**\n * `Record<alias, canonical name>` to dereference command aliases.\n */\n commands: Commands\n\n /**\n * Which command name to use for overriding with command-specific values,\n * determined from the argv when parse() is called.\n */\n command?: Commands[keyof Commands]\n\n constructor(\n jack: Jack<ConfigDefinitions> = definition,\n projectRoot = process.cwd(),\n ) {\n this.projectRoot = projectRoot\n this.commands = commands\n this.jack = jack\n }\n\n /**\n * Parse the arguments and set configuration and positionals accordingly.\n */\n parse(args: string[] = process.argv): this & ParsedConfig {\n if (isParsed(this)) return this\n\n // Store the original args for potential reload\n this.#originalArgs = [...args]\n\n this.jack.loadEnvDefaults()\n const p = this.jack.parseRaw(args)\n\n const fallback = getCommand(p.values['fallback-command'])\n this.command = getCommand(p.positionals[0])\n\n const cmdOrFallback = this.command ?? fallback\n const cmdSpecific =\n cmdOrFallback && this.commandValues[cmdOrFallback]\n if (cmdSpecific) {\n this.jack.setConfigValues(recordsToPairs(cmdSpecific))\n }\n\n // ok, applied cmd-specific defaults, do rest of the parse\n this.jack.applyDefaults(p)\n this.jack.writeEnv(p)\n\n if (this.command) p.positionals.shift()\n else this.command = getCommand(p.values['fallback-command'])\n\n Object.assign(this, p)\n\n /* c8 ignore start - unpossible */\n if (!isParsed(this)) throw error('failed to parse config')\n /* c8 ignore stop */\n\n return this\n }\n\n /**\n * Get a `key=value` list option value as an object.\n *\n * For example, a list option with a vlaue of `['key=value', 'xyz=as=df' ]`\n * would be returned as `{key: 'value', xyz: 'as=df'}`\n *\n * Results are memoized, so subsequent calls for the same key will return the\n * same object. If new strings are added to the list, then the memoized value\n * is *not* updated, so only use once configurations have been fully loaded.\n *\n * If the config value is not set at all, an empty object is returned.\n */\n getRecord(k: OptListKeys<ConfigData>): RecordString {\n const pairs = this.get(k) as\n | (string[] & { [kRecord]?: RecordString })\n | undefined\n if (!pairs) return {}\n if (pairs[kRecord]) return pairs[kRecord]\n const kv = pairs.reduce((kv: RecordString, pair) => {\n const eq = pair.indexOf('=')\n if (eq === -1) return kv\n const key = pair.substring(0, eq)\n const val = pair.substring(eq + 1)\n kv[key] = val\n return kv\n }, {})\n Object.assign(pairs, { [kRecord]: kv })\n return kv\n }\n\n /**\n * Get a configuration value.\n *\n * Note: `key=value` pair configs are returned as a string array. To get them\n * as an object, use {@link Config#getRecord}.\n */\n get<K extends keyof OptionsResults<ConfigDefinitions>>(\n k: K,\n ): OptionsResults<ConfigDefinitions>[K] {\n /* c8 ignore next -- impossible but TS doesn't know that */\n return (this.values ?? this.parse().values)[k]\n }\n\n /**\n * Write the config values to the user or project config file.\n */\n async writeConfigFile(\n this: LoadedConfig,\n which: WhichConfig,\n values: NonNullable<ConfigFileData>,\n ) {\n save('config', pairsToRecords(values), which)\n await this.#reloadConfig()\n }\n\n /**\n * Fold in the provided fields with the existing properties\n * in the config file.\n */\n async addConfigToFile(\n this: LoadedConfig,\n which: WhichConfig,\n values: NonNullable<ConfigFileData>,\n ) {\n return this.writeConfigFile(\n which,\n merge((await this.#maybeLoadConfigFile(which)) ?? {}, values),\n )\n }\n\n // called in this weird bound way so that it can be used by the\n // vlt-json config loading module.\n #validator: Validator<ConfigFileData> = function (\n this: Config,\n c: unknown,\n file: string,\n ) {\n this.#validateConfig(c, file)\n }.bind(this)\n\n #validateConfig(\n c: unknown,\n file: string,\n ): asserts c is ConfigFileData {\n if (!c || typeof c !== 'object' || Array.isArray(c)) {\n throw error('invalid config, expected object', {\n path: file,\n found: c,\n wanted: 'ConfigFileData',\n })\n }\n\n const { command, ...values } = recordsToPairs(c as RecordPairs)\n\n // Validate registries keys don't contain reserved ~ character\n const registries = (c as RecordPairs).registries\n if (registries && typeof registries === 'object') {\n const registriesObj =\n Array.isArray(registries) ?\n reducePairs(registries)\n : registries\n for (const key of Object.keys(registriesObj)) {\n if (key === '' || key.includes('~')) {\n throw error('Reserved character found in registries name', {\n path: file,\n found: key,\n })\n }\n }\n }\n\n if (command) {\n for (const [c, opts] of Object.entries(command)) {\n const cmd = getCommand(c)\n if (cmd && opts && typeof opts === 'object') {\n // Validate registries in command-specific config\n const cmdRegistries = (opts as RecordPairs).registries\n if (cmdRegistries && typeof cmdRegistries === 'object') {\n const cmdRegistriesObj =\n Array.isArray(cmdRegistries) ?\n reducePairs(cmdRegistries)\n : cmdRegistries\n for (const key of Object.keys(cmdRegistriesObj)) {\n if (key === '' || key.includes('~')) {\n throw error(\n 'Reserved character found in registries name',\n {\n path: file,\n found: key,\n },\n )\n }\n }\n }\n\n this.commandValues[cmd] = merge<ConfigData>(\n this.commandValues[cmd] ?? ({} as ConfigData),\n opts as ConfigData,\n )\n }\n }\n }\n this.jack.setConfigValues(values, file)\n }\n\n /**\n * if the file exists, parse and load it. returns object if data was\n * loaded, or undefined if not.\n */\n async #maybeLoadConfigFile(whichConfig: WhichConfig) {\n return load('config', this.#validator, whichConfig)\n }\n\n /**\n * Deletes the specified config fields from the named file\n * Returns `true` if anything was changed.\n */\n async deleteConfigKeys(\n this: LoadedConfig,\n which: WhichConfig,\n fields: string[],\n ) {\n const data = await this.#maybeLoadConfigFile(which)\n if (!data) return false\n let didSomething = false\n for (const f of fields) {\n const [key, ...sk] = f.split('.') as [\n h: string,\n ...rest: string[],\n ]\n const subs = sk.join('.')\n const k = key as keyof ConfigDefinitions\n const v = data[k]\n if (v === undefined) continue\n if (subs && v && typeof v === 'object') {\n if (Array.isArray(v)) {\n const i = v.findIndex(subvalue =>\n subvalue.startsWith(`${subs}=`),\n )\n if (i !== -1) {\n if (v.length === 1) delete data[k]\n else v.splice(i, 1)\n didSomething = true\n }\n } else {\n if (v[subs] !== undefined) {\n delete v[subs]\n if (Object.keys(v).length === 0) delete data[k]\n didSomething = true\n }\n }\n } else {\n didSomething = true\n delete data[k]\n }\n }\n if (didSomething) await this.writeConfigFile(which, data)\n return didSomething\n }\n\n /**\n * Edit the user or project configuration file.\n *\n * If the file isn't present, then it starts with `{}` so the user has\n * something to work with.\n *\n * If the result is not valid, or no config settings are contained in the\n * file after editing, then it's restored to what it was before, which might\n * mean deleting the file.\n */\n async editConfigFile(\n this: LoadedConfig,\n which: WhichConfig,\n edit: (file: string) => Promise<void> | void,\n ) {\n // load the file as a backup\n // call the edit function\n // reload it\n const file = find(which)\n const backup = await readFile(file, 'utf8').catch(() => undefined)\n if (!backup) {\n await writeFile(\n file,\n JSON.stringify({ config: {} }, null, 2) + '\\n',\n )\n }\n let valid = false\n try {\n await edit(file)\n // force it to reload the file and validate it again\n // if this fails, we roll back.\n const result = reload('config', which)\n save('config', result ?? {}, which)\n valid = true\n } finally {\n if (!valid) {\n // TODO: maybe write the file to a re-edit backup location?\n // then you could do `vlt config edit retry` or something.\n if (backup) {\n await writeFile(file, backup)\n reload(which)\n } else {\n await rm(file, { force: true })\n }\n }\n }\n }\n\n /**\n * Find the local config file and load both it and the user-level config in\n * the XDG config home.\n */\n async loadConfigFile(): Promise<this> {\n await this.#maybeLoadConfigFile('user')\n this.projectRoot = dirname(find('project', this.projectRoot))\n await this.#maybeLoadConfigFile('project')\n return this\n }\n\n /**\n * Clear cached config values to force re-reading from updated files.\n * @internal\n */\n async #reloadConfig() {\n // Clear the memoized options to force recalculation\n this.#options = undefined\n }\n\n /**\n * Force a complete reload of config files from disk.\n * This clears all caches and re-reads config files.\n * Useful for long-running processes that need to pick up config changes.\n */\n async reloadFromDisk(): Promise<void> {\n // Clear the memoized options to force recalculation\n this.#options = undefined\n\n // Clear the parsed state to force re-parsing\n // This is crucial because parse() returns early if already parsed\n this.values = undefined\n this.positionals = undefined\n this.command = undefined\n\n // Clear vlt-json caches for both user and project configs\n // This ensures that the next time config files are read, they'll be re-read from disk\n const { unload } = await import('@vltpkg/vlt-json')\n unload('user')\n unload('project')\n\n // Force reload of config files by calling the load methods again\n // This will re-read the files and re-apply them to the jack parser\n await this.#maybeLoadConfigFile('user')\n await this.#maybeLoadConfigFile('project')\n\n // Re-parse to pick up the updated config values using the original arguments\n this.parse(this.#originalArgs)\n }\n\n /**\n * cache of the loaded config\n */\n static #loaded: LoadedConfig | undefined\n\n /**\n * Load the configuration and return a Promise to a\n * {@link Config} object\n */\n static async load(\n projectRoot = process.cwd(),\n argv = process.argv,\n /**\n * only used in tests, resets the memoization\n * @internal\n */\n reload = false,\n ): Promise<LoadedConfig> {\n if (this.#loaded && !reload) return this.#loaded\n const a = new Config(definition, projectRoot)\n const b = await a.loadConfigFile()\n this.#loaded = b.parse(argv) as LoadedConfig\n return this.#loaded\n }\n}\n\nconst isParsed = (c: Config): c is ParsedConfig =>\n !!(c.values && c.positionals && c.command)\n\nexport type ParsedConfig = Config & {\n command: NonNullable<Config['command']>\n values: OptionsResults<ConfigDefinitions>\n positionals: string[]\n}\n\n/**\n * A fully loaded {@link Config} object\n */\nexport type LoadedConfig = ParsedConfig\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-help.d.ts","sourceRoot":"","sources":["../src/custom-help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom-help.d.ts","sourceRoot":"","sources":["../src/custom-help.ts"],"names":[],"mappings":"AA0PA;;GAEG;AACH,eAAO,MAAM,mBAAmB,wBAAqB,MAiDpD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,wBAAqB,MA8HjD,CAAA"}
|
package/dist/custom-help.js
CHANGED
|
@@ -192,14 +192,6 @@ const allCommands = [
|
|
|
192
192
|
desc: 'Run a script &/or fallback to executing a binary',
|
|
193
193
|
showByDefault: false,
|
|
194
194
|
},
|
|
195
|
-
{
|
|
196
|
-
name: 'serve',
|
|
197
|
-
aliases: ['s'],
|
|
198
|
-
args: '',
|
|
199
|
-
desc: 'Start a local package registry server',
|
|
200
|
-
showByDefault: true,
|
|
201
|
-
defaultOrder: 9,
|
|
202
|
-
},
|
|
203
195
|
{
|
|
204
196
|
name: 'token',
|
|
205
197
|
aliases: [],
|
package/dist/custom-help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-help.js","sourceRoot":"","sources":["../src/custom-help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CACjC,MAAM,CAAC,IAAI,CAAC,QAAQ,EACpB,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAG5C,CAAA;AAED,+BAA+B;AAC/B,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAIzC,MAAM,UAAU,GAAG,CAAC,MAAe,EAAY,EAAE;IAC/C,IAAI,CAAC,MAAM;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IAE/B,OAAO,CAAC,KAAwB,EAAE,IAAY,EAAU,EAAE;QACxD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACrD,IAAI,UAAU,GAAG,IAAI,CAAA;QAErB,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;YACvB,QAAQ,CAAC,EAAE,CAAC;gBACV,KAAK,QAAQ,CAAC;gBACd,KAAK,cAAc;oBACjB,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;oBACrC,MAAK;gBACP,KAAK,MAAM;oBACT,UAAU,GAAG,KAAK,CAAC,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AC,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;IAC9F,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAA;IAEb,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,+BAA+B,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,OAAO,EAAE,CAAC;;EAE7H,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC;;IAEhB,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC;;EAE3C,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC;;EAErB,eAAe;;EAEf,CAAC,CAAC,MAAM,EAAE,gBAAgB,CAAC;;WAElB,CAAC,CAAC,KAAK,EAAE,aAAa,CAAC;WACvB,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC;;EAEjC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC;;EAElB,YAAY;;sBAEQ,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC;uBAClB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC;;EAE/C,CAAC,CAAC,KAAK,EAAE,+EAA+E,CAAC,EAAE,CAAA;AAC7F,CAAC,CAAA","sourcesContent":["import { loadPackageJson } from 'package-json-from-dist'\nimport chalk from 'chalk'\n\nconst { version } = loadPackageJson(\n import.meta.filename,\n process.env.__VLT_INTERNAL_CLI_PACKAGE_JSON,\n) as {\n version: string\n}\n\n// Custom yellow color: #FFE15D\nconst customYellow = chalk.hex('#FFE15D')\n\ntype StylerFn = (style: string | string[], text: string) => string\n\nconst makeStyler = (colors: boolean): StylerFn => {\n if (!colors) return (_, s) => s\n\n return (style: string | string[], text: string): string => {\n const styles = Array.isArray(style) ? style : [style]\n let styledText = text\n\n for (const s of styles) {\n switch (s) {\n case 'yellow':\n case 'yellowBright':\n styledText = customYellow(styledText)\n break\n case 'bold':\n styledText = chalk.bold(styledText)\n break\n case 'dim':\n styledText = chalk.dim(styledText)\n break\n case 'dark':\n styledText = chalk.gray(styledText)\n break\n case 'cyan':\n styledText = chalk.cyan(styledText)\n break\n case 'green':\n styledText = chalk.green(styledText)\n break\n default:\n // Fallback to chalk's built-in colors\n if (\n s in chalk &&\n typeof chalk[s as keyof typeof chalk] === 'function'\n ) {\n styledText = (\n chalk[s as keyof typeof chalk] as (\n text: string,\n ) => string\n )(styledText)\n }\n break\n }\n }\n\n return styledText\n }\n}\n\n// Single source of truth for all commands with metadata\nconst allCommands = [\n {\n name: 'build',\n aliases: ['b'],\n args: '<selector>',\n desc: 'Build packages with lifecycle scripts',\n showByDefault: true,\n defaultOrder: 4,\n },\n {\n name: 'cache',\n aliases: [],\n args: '[add|ls|info|clean|delete|delete-before|delete-all]',\n desc: 'Manage the package cache',\n showByDefault: false,\n },\n {\n name: 'ci',\n aliases: [],\n args: '',\n desc: 'Clean install (frozen lockfile)',\n showByDefault: false,\n },\n {\n name: 'config',\n aliases: [],\n args: '[get|pick|list|set|delete|edit|location]',\n desc: 'Get or set configuration',\n showByDefault: false,\n },\n {\n name: 'docs',\n aliases: [],\n args: '',\n desc: 'Open the docs of the current project',\n showByDefault: false,\n },\n {\n name: 'exec',\n aliases: ['x'],\n args: '<executable>',\n desc: 'Execute a package bin',\n showByDefault: true,\n defaultOrder: 6,\n },\n {\n name: 'exec-cache',\n aliases: ['xc'],\n args: '[ls|delete|info|install]',\n desc: 'Manage the exec cache',\n showByDefault: false,\n },\n {\n name: 'exec-local',\n aliases: ['xl'],\n args: '<command>',\n desc: 'Execute a local package bin',\n showByDefault: false,\n },\n {\n name: 'help',\n aliases: ['h', '?'],\n args: '[<command>]',\n desc: 'Show help for a command',\n showByDefault: false,\n },\n {\n name: 'init',\n aliases: [],\n args: '',\n desc: 'Initialize a new project',\n showByDefault: true,\n defaultOrder: 1,\n },\n {\n name: 'install',\n aliases: ['i', 'add'],\n args: '[<package>...]',\n desc: 'Install dependencies',\n showByDefault: true,\n defaultOrder: 2,\n },\n {\n name: 'list',\n aliases: ['ls'],\n args: '',\n desc: 'List installed packages',\n showByDefault: false,\n },\n {\n name: 'login',\n aliases: [],\n args: '',\n desc: 'Authenticate with a registry',\n showByDefault: false,\n },\n {\n name: 'logout',\n aliases: [],\n args: '',\n desc: 'Log out from a registry',\n showByDefault: false,\n },\n {\n name: 'pack',\n aliases: [],\n args: '',\n desc: 'Create a tarball from a package',\n showByDefault: false,\n },\n {\n name: 'pkg',\n aliases: ['p'],\n args: '<command>',\n desc: 'Manage package metadata',\n showByDefault: true,\n defaultOrder: 7,\n },\n {\n name: 'publish',\n aliases: ['pub'],\n args: '',\n desc: 'Publish package to registry',\n showByDefault: true,\n defaultOrder: 8,\n },\n {\n name: 'query',\n aliases: ['q'],\n args: '<selector>',\n desc: 'Query for packages in the project',\n showByDefault: true,\n defaultOrder: 3,\n },\n {\n name: 'run',\n aliases: ['r'],\n args: '<script>',\n desc: 'Run a script defined in package.json',\n showByDefault: true,\n defaultOrder: 5,\n },\n {\n name: 'run-exec',\n aliases: ['rx'],\n args: '<script>',\n desc: 'Run a script &/or fallback to executing a binary',\n showByDefault: false,\n },\n {\n name: 'serve',\n aliases: ['s'],\n args: '',\n desc: 'Start a local package registry server',\n showByDefault: true,\n defaultOrder: 9,\n },\n {\n name: 'token',\n aliases: [],\n args: '[add|rm]',\n desc: 'Manage authentication tokens',\n showByDefault: false,\n },\n {\n name: 'uninstall',\n aliases: ['rm'],\n args: '[<package>...]',\n desc: 'Remove dependencies',\n showByDefault: false,\n },\n {\n name: 'update',\n aliases: ['u'],\n args: '',\n desc: 'Update package versions to latest in-range',\n showByDefault: false,\n },\n {\n name: 'version',\n aliases: [],\n args: '<increment>',\n desc: 'Bump package version',\n showByDefault: false,\n },\n {\n name: 'whoami',\n aliases: [],\n args: '',\n desc: 'Display the current user',\n showByDefault: false,\n },\n]\n\n/**\n * Generates the custom default help output for vlt\n */\nexport const generateDefaultHelp = (colors = false): string => {\n const s = makeStyler(colors)\n\n // Get default commands and sort by defaultOrder\n const defaultCommands = allCommands\n .filter(cmd => cmd.showByDefault)\n .sort((a, b) => (a.defaultOrder || 0) - (b.defaultOrder || 0))\n\n // Generate commands with tighter alias spacing but proper table structure\n const commandsSection = defaultCommands\n .map(cmd => {\n // Tighter alias column (5 chars to accommodate space after comma) - only show first alias\n const firstAlias = cmd.aliases.length > 0 ? cmd.aliases[0] : ''\n const aliasColumn =\n firstAlias ? (firstAlias + ', ').padEnd(5) : ' '\n // Consistent name column (10 chars)\n const nameColumn = cmd.name.padEnd(10)\n // Consistent args column (14 chars)\n const argsColumn = cmd.args.padEnd(16)\n\n return ` ${s('dim', aliasColumn)}${s(['yellow', 'bold'], nameColumn)}${s('dim', argsColumn)}${cmd.desc}`\n })\n .join('\\n')\n\n return `${s(['bold'], '⚡️ vlt')} ${s('dim', '/vōlt/')} next-gen package management ${s('dim', `v${version}`)}\n\n${s('bold', 'USAGE')}\n\n ${s('bold', 'vlt')} ${s('dim', '<command>')}\n\n${s('bold', 'COMMON COMMANDS')}\n\n${commandsSection}\n \n${s('bold', 'COMPANION BINS')}\n\n ${s('bold', 'vlr')} ${s('dim', 'eq. vlt run')}\n ${s('bold', 'vlx')} ${s('dim', 'eq. vlt exec')}\n \n${s('bold', 'COMMON FLAGS')}\n\n ${s('green', '-v, --version')} Log the cli version\n ${s('green', '-a, --all')} List all commands, bins & flags\n\nLearn more: https://${s('bold', 'vlt.sh')}\nGet support: https://${s('bold', 'vlt.community')}\n\n${s('dim', `This is not the full usage information, run \\`vlt -a\\` for more.`)}\n`\n}\n\n/**\n * Generates the full help output with all commands when --all flag is used\n */\nexport const generateFullHelp = (colors = false): string => {\n const s = makeStyler(colors)\n\n // Use all commands sorted alphabetically\n const commands = [...allCommands].sort((a, b) =>\n a.name.localeCompare(b.name),\n )\n\n // Define only globally applicable flags (alphabetically sorted by long name)\n const flags = [\n {\n shorts: ['a'],\n long: 'all',\n args: '',\n desc: 'Show all commands, bins, and flags',\n },\n {\n shorts: ['c'],\n long: 'color',\n args: '',\n desc: 'Enable color output',\n },\n {\n shorts: ['h'],\n long: 'help',\n args: '',\n desc: 'Print helpful information',\n },\n {\n shorts: [],\n long: 'no-color',\n args: '',\n desc: 'Disable color output',\n },\n {\n shorts: [],\n long: 'registry',\n args: '<url>',\n desc: 'Override default registry',\n },\n {\n shorts: ['v'],\n long: 'version',\n args: '',\n desc: 'Print the version',\n },\n {\n shorts: ['y'],\n long: 'yes',\n args: '',\n desc: 'Automatically accept prompts',\n },\n ]\n\n // Generate commands section with letter grouping spacing\n let commandsSection = ''\n let lastFirstLetter = ''\n\n commands.forEach((cmd, index) => {\n const firstLetter = cmd.name[0]?.toLowerCase() || ''\n\n // Add extra spacing between different letter groups\n if (firstLetter !== lastFirstLetter && index > 0) {\n commandsSection += '\\n'\n }\n\n // Fixed width columns for proper alignment with space after comma\n const aliasColumn =\n cmd.aliases.length > 0 ?\n (cmd.aliases.join(', ') + ', ').padEnd(9)\n : ' '\n const nameColumn = cmd.name.padEnd(12)\n // Truncate args if longer than 16 chars and add ellipsis\n const truncatedArgs =\n cmd.args.length > 16 ?\n cmd.args.substring(0, 13) + '...'\n : cmd.args\n const argsColumn = truncatedArgs.padEnd(16)\n\n commandsSection += `${s('dim', aliasColumn)}${s(['yellow', 'bold'], nameColumn)}${s('dim', argsColumn)}${cmd.desc}`\n\n if (index < commands.length - 1) {\n commandsSection += '\\n'\n }\n\n lastFirstLetter = firstLetter\n })\n\n // Generate flags section with same structure as commands\n const flagsSection = flags\n .map(f => {\n // Match command structure: alias column, name column, args column, description\n const aliasColumn =\n f.shorts.length > 0 ?\n ('-' + f.shorts.join(', -') + ', ').padEnd(7)\n : ' '\n const nameColumn = ('--' + f.long).padEnd(12)\n const argsColumn = (f.args || '').padEnd(17)\n\n return ` ${s('dim', aliasColumn)}${s('green', nameColumn)}${s('dim', argsColumn)}${f.desc}`\n })\n .join('\\n')\n\n return `${s(['bold'], '⚡️ vlt')} ${s('dim', '/vōlt/')} ${s('dim', '- next-gen package management')} ${s('dim', `v${version}`)}\n\n${s('bold', 'USAGE')}\n\n ${s('bold', 'vlt')} ${s('dim', '<command>')}\n\n${s('bold', 'COMMANDS')}\n\n${commandsSection}\n\n${s('bold', 'COMPANION BINS')}\n\n vlr ${s('dim', 'eq. vlt run')}\n vlx ${s('dim', 'eq. vlt exec')}\n\n${s('bold', 'FLAGS')}\n\n${flagsSection}\n\nLearn more: https://${s('bold', 'vlt.sh')}\nGet support: https://${s('bold', 'vlt.community')}\n\n${s('dim', `Run \\`vlt help <command>\\` for detailed information about a specific command.`)}`\n}\n"]}
|
|
1
|
+
{"version":3,"file":"custom-help.js","sourceRoot":"","sources":["../src/custom-help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CACjC,MAAM,CAAC,IAAI,CAAC,QAAQ,EACpB,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAG5C,CAAA;AAED,+BAA+B;AAC/B,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AAIzC,MAAM,UAAU,GAAG,CAAC,MAAe,EAAY,EAAE;IAC/C,IAAI,CAAC,MAAM;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IAE/B,OAAO,CAAC,KAAwB,EAAE,IAAY,EAAU,EAAE;QACxD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;QACrD,IAAI,UAAU,GAAG,IAAI,CAAA;QAErB,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,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AAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;IAC9F,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAA;IAEb,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,+BAA+B,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,OAAO,EAAE,CAAC;;EAE7H,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC;;IAEhB,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,WAAW,CAAC;;EAE3C,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC;;EAErB,eAAe;;EAEf,CAAC,CAAC,MAAM,EAAE,gBAAgB,CAAC;;WAElB,CAAC,CAAC,KAAK,EAAE,aAAa,CAAC;WACvB,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC;;EAEjC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC;;EAElB,YAAY;;sBAEQ,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC;uBAClB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC;;EAE/C,CAAC,CAAC,KAAK,EAAE,+EAA+E,CAAC,EAAE,CAAA;AAC7F,CAAC,CAAA","sourcesContent":["import { loadPackageJson } from 'package-json-from-dist'\nimport chalk from 'chalk'\n\nconst { version } = loadPackageJson(\n import.meta.filename,\n process.env.__VLT_INTERNAL_CLI_PACKAGE_JSON,\n) as {\n version: string\n}\n\n// Custom yellow color: #FFE15D\nconst customYellow = chalk.hex('#FFE15D')\n\ntype StylerFn = (style: string | string[], text: string) => string\n\nconst makeStyler = (colors: boolean): StylerFn => {\n if (!colors) return (_, s) => s\n\n return (style: string | string[], text: string): string => {\n const styles = Array.isArray(style) ? style : [style]\n let styledText = text\n\n for (const s of styles) {\n switch (s) {\n case 'yellow':\n case 'yellowBright':\n styledText = customYellow(styledText)\n break\n case 'bold':\n styledText = chalk.bold(styledText)\n break\n case 'dim':\n styledText = chalk.dim(styledText)\n break\n case 'dark':\n styledText = chalk.gray(styledText)\n break\n case 'cyan':\n styledText = chalk.cyan(styledText)\n break\n case 'green':\n styledText = chalk.green(styledText)\n break\n default:\n // Fallback to chalk's built-in colors\n if (\n s in chalk &&\n typeof chalk[s as keyof typeof chalk] === 'function'\n ) {\n styledText = (\n chalk[s as keyof typeof chalk] as (\n text: string,\n ) => string\n )(styledText)\n }\n break\n }\n }\n\n return styledText\n }\n}\n\n// Single source of truth for all commands with metadata\nconst allCommands = [\n {\n name: 'build',\n aliases: ['b'],\n args: '<selector>',\n desc: 'Build packages with lifecycle scripts',\n showByDefault: true,\n defaultOrder: 4,\n },\n {\n name: 'cache',\n aliases: [],\n args: '[add|ls|info|clean|delete|delete-before|delete-all]',\n desc: 'Manage the package cache',\n showByDefault: false,\n },\n {\n name: 'ci',\n aliases: [],\n args: '',\n desc: 'Clean install (frozen lockfile)',\n showByDefault: false,\n },\n {\n name: 'config',\n aliases: [],\n args: '[get|pick|list|set|delete|edit|location]',\n desc: 'Get or set configuration',\n showByDefault: false,\n },\n {\n name: 'docs',\n aliases: [],\n args: '',\n desc: 'Open the docs of the current project',\n showByDefault: false,\n },\n {\n name: 'exec',\n aliases: ['x'],\n args: '<executable>',\n desc: 'Execute a package bin',\n showByDefault: true,\n defaultOrder: 6,\n },\n {\n name: 'exec-cache',\n aliases: ['xc'],\n args: '[ls|delete|info|install]',\n desc: 'Manage the exec cache',\n showByDefault: false,\n },\n {\n name: 'exec-local',\n aliases: ['xl'],\n args: '<command>',\n desc: 'Execute a local package bin',\n showByDefault: false,\n },\n {\n name: 'help',\n aliases: ['h', '?'],\n args: '[<command>]',\n desc: 'Show help for a command',\n showByDefault: false,\n },\n {\n name: 'init',\n aliases: [],\n args: '',\n desc: 'Initialize a new project',\n showByDefault: true,\n defaultOrder: 1,\n },\n {\n name: 'install',\n aliases: ['i', 'add'],\n args: '[<package>...]',\n desc: 'Install dependencies',\n showByDefault: true,\n defaultOrder: 2,\n },\n {\n name: 'list',\n aliases: ['ls'],\n args: '',\n desc: 'List installed packages',\n showByDefault: false,\n },\n {\n name: 'login',\n aliases: [],\n args: '',\n desc: 'Authenticate with a registry',\n showByDefault: false,\n },\n {\n name: 'logout',\n aliases: [],\n args: '',\n desc: 'Log out from a registry',\n showByDefault: false,\n },\n {\n name: 'pack',\n aliases: [],\n args: '',\n desc: 'Create a tarball from a package',\n showByDefault: false,\n },\n {\n name: 'pkg',\n aliases: ['p'],\n args: '<command>',\n desc: 'Manage package metadata',\n showByDefault: true,\n defaultOrder: 7,\n },\n {\n name: 'publish',\n aliases: ['pub'],\n args: '',\n desc: 'Publish package to registry',\n showByDefault: true,\n defaultOrder: 8,\n },\n {\n name: 'query',\n aliases: ['q'],\n args: '<selector>',\n desc: 'Query for packages in the project',\n showByDefault: true,\n defaultOrder: 3,\n },\n {\n name: 'run',\n aliases: ['r'],\n args: '<script>',\n desc: 'Run a script defined in package.json',\n showByDefault: true,\n defaultOrder: 5,\n },\n {\n name: 'run-exec',\n aliases: ['rx'],\n args: '<script>',\n desc: 'Run a script &/or fallback to executing a binary',\n showByDefault: false,\n },\n {\n name: 'token',\n aliases: [],\n args: '[add|rm]',\n desc: 'Manage authentication tokens',\n showByDefault: false,\n },\n {\n name: 'uninstall',\n aliases: ['rm'],\n args: '[<package>...]',\n desc: 'Remove dependencies',\n showByDefault: false,\n },\n {\n name: 'update',\n aliases: ['u'],\n args: '',\n desc: 'Update package versions to latest in-range',\n showByDefault: false,\n },\n {\n name: 'version',\n aliases: [],\n args: '<increment>',\n desc: 'Bump package version',\n showByDefault: false,\n },\n {\n name: 'whoami',\n aliases: [],\n args: '',\n desc: 'Display the current user',\n showByDefault: false,\n },\n]\n\n/**\n * Generates the custom default help output for vlt\n */\nexport const generateDefaultHelp = (colors = false): string => {\n const s = makeStyler(colors)\n\n // Get default commands and sort by defaultOrder\n const defaultCommands = allCommands\n .filter(cmd => cmd.showByDefault)\n .sort((a, b) => (a.defaultOrder || 0) - (b.defaultOrder || 0))\n\n // Generate commands with tighter alias spacing but proper table structure\n const commandsSection = defaultCommands\n .map(cmd => {\n // Tighter alias column (5 chars to accommodate space after comma) - only show first alias\n const firstAlias = cmd.aliases.length > 0 ? cmd.aliases[0] : ''\n const aliasColumn =\n firstAlias ? (firstAlias + ', ').padEnd(5) : ' '\n // Consistent name column (10 chars)\n const nameColumn = cmd.name.padEnd(10)\n // Consistent args column (14 chars)\n const argsColumn = cmd.args.padEnd(16)\n\n return ` ${s('dim', aliasColumn)}${s(['yellow', 'bold'], nameColumn)}${s('dim', argsColumn)}${cmd.desc}`\n })\n .join('\\n')\n\n return `${s(['bold'], '⚡️ vlt')} ${s('dim', '/vōlt/')} next-gen package management ${s('dim', `v${version}`)}\n\n${s('bold', 'USAGE')}\n\n ${s('bold', 'vlt')} ${s('dim', '<command>')}\n\n${s('bold', 'COMMON COMMANDS')}\n\n${commandsSection}\n \n${s('bold', 'COMPANION BINS')}\n\n ${s('bold', 'vlr')} ${s('dim', 'eq. vlt run')}\n ${s('bold', 'vlx')} ${s('dim', 'eq. vlt exec')}\n \n${s('bold', 'COMMON FLAGS')}\n\n ${s('green', '-v, --version')} Log the cli version\n ${s('green', '-a, --all')} List all commands, bins & flags\n\nLearn more: https://${s('bold', 'vlt.sh')}\nGet support: https://${s('bold', 'vlt.community')}\n\n${s('dim', `This is not the full usage information, run \\`vlt -a\\` for more.`)}\n`\n}\n\n/**\n * Generates the full help output with all commands when --all flag is used\n */\nexport const generateFullHelp = (colors = false): string => {\n const s = makeStyler(colors)\n\n // Use all commands sorted alphabetically\n const commands = [...allCommands].sort((a, b) =>\n a.name.localeCompare(b.name),\n )\n\n // Define only globally applicable flags (alphabetically sorted by long name)\n const flags = [\n {\n shorts: ['a'],\n long: 'all',\n args: '',\n desc: 'Show all commands, bins, and flags',\n },\n {\n shorts: ['c'],\n long: 'color',\n args: '',\n desc: 'Enable color output',\n },\n {\n shorts: ['h'],\n long: 'help',\n args: '',\n desc: 'Print helpful information',\n },\n {\n shorts: [],\n long: 'no-color',\n args: '',\n desc: 'Disable color output',\n },\n {\n shorts: [],\n long: 'registry',\n args: '<url>',\n desc: 'Override default registry',\n },\n {\n shorts: ['v'],\n long: 'version',\n args: '',\n desc: 'Print the version',\n },\n {\n shorts: ['y'],\n long: 'yes',\n args: '',\n desc: 'Automatically accept prompts',\n },\n ]\n\n // Generate commands section with letter grouping spacing\n let commandsSection = ''\n let lastFirstLetter = ''\n\n commands.forEach((cmd, index) => {\n const firstLetter = cmd.name[0]?.toLowerCase() || ''\n\n // Add extra spacing between different letter groups\n if (firstLetter !== lastFirstLetter && index > 0) {\n commandsSection += '\\n'\n }\n\n // Fixed width columns for proper alignment with space after comma\n const aliasColumn =\n cmd.aliases.length > 0 ?\n (cmd.aliases.join(', ') + ', ').padEnd(9)\n : ' '\n const nameColumn = cmd.name.padEnd(12)\n // Truncate args if longer than 16 chars and add ellipsis\n const truncatedArgs =\n cmd.args.length > 16 ?\n cmd.args.substring(0, 13) + '...'\n : cmd.args\n const argsColumn = truncatedArgs.padEnd(16)\n\n commandsSection += `${s('dim', aliasColumn)}${s(['yellow', 'bold'], nameColumn)}${s('dim', argsColumn)}${cmd.desc}`\n\n if (index < commands.length - 1) {\n commandsSection += '\\n'\n }\n\n lastFirstLetter = firstLetter\n })\n\n // Generate flags section with same structure as commands\n const flagsSection = flags\n .map(f => {\n // Match command structure: alias column, name column, args column, description\n const aliasColumn =\n f.shorts.length > 0 ?\n ('-' + f.shorts.join(', -') + ', ').padEnd(7)\n : ' '\n const nameColumn = ('--' + f.long).padEnd(12)\n const argsColumn = (f.args || '').padEnd(17)\n\n return ` ${s('dim', aliasColumn)}${s('green', nameColumn)}${s('dim', argsColumn)}${f.desc}`\n })\n .join('\\n')\n\n return `${s(['bold'], '⚡️ vlt')} ${s('dim', '/vōlt/')} ${s('dim', '- next-gen package management')} ${s('dim', `v${version}`)}\n\n${s('bold', 'USAGE')}\n\n ${s('bold', 'vlt')} ${s('dim', '<command>')}\n\n${s('bold', 'COMMANDS')}\n\n${commandsSection}\n\n${s('bold', 'COMPANION BINS')}\n\n vlr ${s('dim', 'eq. vlt run')}\n vlx ${s('dim', 'eq. vlt exec')}\n\n${s('bold', 'FLAGS')}\n\n${flagsSection}\n\nLearn more: https://${s('bold', 'vlt.sh')}\nGet support: https://${s('bold', 'vlt.community')}\n\n${s('dim', `Run \\`vlt help <command>\\` for detailed information about a specific command.`)}`\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/cli-sdk",
|
|
3
3
|
"description": "The source for the vlt CLI",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.15",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -28,31 +28,31 @@
|
|
|
28
28
|
"ssri": "^13.0.0",
|
|
29
29
|
"supports-color": "^10.2.2",
|
|
30
30
|
"tar": "^7.5.2",
|
|
31
|
-
"@vltpkg/config": "1.0.0-rc.
|
|
32
|
-
"@vltpkg/
|
|
33
|
-
"@vltpkg/
|
|
34
|
-
"@vltpkg/
|
|
35
|
-
"@vltpkg/
|
|
36
|
-
"@vltpkg/graph": "1.0.0-rc.
|
|
37
|
-
"@vltpkg/graph
|
|
38
|
-
"@vltpkg/
|
|
39
|
-
"@vltpkg/
|
|
40
|
-
"@vltpkg/package-info": "1.0.0-rc.
|
|
41
|
-
"@vltpkg/package-json": "1.0.0-rc.
|
|
42
|
-
"@vltpkg/
|
|
43
|
-
"@vltpkg/
|
|
44
|
-
"@vltpkg/registry-client": "1.0.0-rc.
|
|
45
|
-
"@vltpkg/run": "1.0.0-rc.
|
|
46
|
-
"@vltpkg/rollback-remove": "1.0.0-rc.
|
|
47
|
-
"@vltpkg/security-archive": "1.0.0-rc.
|
|
48
|
-
"@vltpkg/server": "1.0.0-rc.
|
|
49
|
-
"@vltpkg/spec": "1.0.0-rc.
|
|
50
|
-
"@vltpkg/types": "1.0.0-rc.
|
|
51
|
-
"@vltpkg/url-open": "1.0.0-rc.
|
|
52
|
-
"@vltpkg/
|
|
53
|
-
"@vltpkg/vlx": "1.0.0-rc.
|
|
54
|
-
"@vltpkg/
|
|
55
|
-
"@vltpkg/
|
|
31
|
+
"@vltpkg/config": "1.0.0-rc.15",
|
|
32
|
+
"@vltpkg/dep-id": "1.0.0-rc.15",
|
|
33
|
+
"@vltpkg/dot-prop": "1.0.0-rc.15",
|
|
34
|
+
"@vltpkg/error-cause": "1.0.0-rc.15",
|
|
35
|
+
"@vltpkg/git": "1.0.0-rc.15",
|
|
36
|
+
"@vltpkg/graph-run": "1.0.0-rc.15",
|
|
37
|
+
"@vltpkg/graph": "1.0.0-rc.15",
|
|
38
|
+
"@vltpkg/init": "1.0.0-rc.15",
|
|
39
|
+
"@vltpkg/output": "1.0.0-rc.15",
|
|
40
|
+
"@vltpkg/package-info": "1.0.0-rc.15",
|
|
41
|
+
"@vltpkg/package-json": "1.0.0-rc.15",
|
|
42
|
+
"@vltpkg/promise-spawn": "1.0.0-rc.15",
|
|
43
|
+
"@vltpkg/query": "1.0.0-rc.15",
|
|
44
|
+
"@vltpkg/registry-client": "1.0.0-rc.15",
|
|
45
|
+
"@vltpkg/run": "1.0.0-rc.15",
|
|
46
|
+
"@vltpkg/rollback-remove": "1.0.0-rc.15",
|
|
47
|
+
"@vltpkg/security-archive": "1.0.0-rc.15",
|
|
48
|
+
"@vltpkg/server": "1.0.0-rc.15",
|
|
49
|
+
"@vltpkg/spec": "1.0.0-rc.15",
|
|
50
|
+
"@vltpkg/types": "1.0.0-rc.15",
|
|
51
|
+
"@vltpkg/url-open": "1.0.0-rc.15",
|
|
52
|
+
"@vltpkg/vlt-json": "1.0.0-rc.15",
|
|
53
|
+
"@vltpkg/vlx": "1.0.0-rc.15",
|
|
54
|
+
"@vltpkg/xdg": "1.0.0-rc.15",
|
|
55
|
+
"@vltpkg/workspaces": "1.0.0-rc.15"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@eslint/js": "^9.39.1",
|