@verdaccio/cli 9.0.0-next-9.36 → 9.0.0-next-9.38
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/build/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["import { Cli } from 'clipanion';\n\nimport { pkgUtils, warningUtils } from '@verdaccio/core';\n\nimport { InfoCommand } from './commands/info';\nimport { InitCommand } from './commands/init';\nimport { VersionCommand } from './commands/version';\nimport type { CliRuntimeOptions } from './runtime';\nimport { configureCli } from './runtime';\nimport { MIN_NODE_VERSION, isVersionValid } from './utils';\n\n/**\n * Build and run the Verdaccio CLI.\n *\n * Called with no arguments it behaves exactly like the standalone `verdaccio`\n * binary. Downstream distributions can inject a custom server factory (and\n * version/name) via {@link CliRuntimeOptions} — e.g. a registry that needs to\n * boot with a custom Storage — without re-implementing the command set.\n */\nexport function runCli(options: CliRuntimeOptions = {}): Promise<void> {\n configureCli(options);\n\n if (process.getuid && process.getuid() === 0) {\n warningUtils.emit(warningUtils.Codes.VERWAR001);\n }\n\n if (!isVersionValid(process.version)) {\n throw new Error(\n `Verdaccio requires at least Node.js v${MIN_NODE_VERSION} or higher and you have installed ${process.version},\n please upgrade your Node.js distribution`\n );\n }\n\n const [node, app, ...args] = process.argv;\n\n const version =\n options.version ?? (pkgUtils.getPackageJson(import.meta.dirname, '..').version as string);\n\n const cli = new Cli({\n binaryLabel: `verdaccio`,\n binaryName: `${node} ${app}`,\n binaryVersion: version,\n });\n\n cli.register(InfoCommand);\n cli.register(InitCommand);\n cli.register(VersionCommand);\n\n process.on('uncaughtException', function (err) {\n console.error(\n `uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this: \\n${err.stack}`\n );\n process.exit(1);\n });\n\n return cli.runExit(args, Cli.defaultContext);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,OAAO,UAA6B,CAAC,GAAkB;CACrE,gBAAA,aAAa,OAAO;CAEpB,IAAI,QAAQ,UAAU,QAAQ,OAAO,MAAM,GACzC,gBAAA,aAAa,
|
|
1
|
+
{"version":3,"file":"cli.js","names":["warningUtils","isVersionValid","MIN_NODE_VERSION","pkgUtils","Cli","InfoCommand","InitCommand","VersionCommand"],"sources":["../src/cli.ts"],"sourcesContent":["import { Cli } from 'clipanion';\n\nimport { pkgUtils, warningUtils } from '@verdaccio/core';\n\nimport { InfoCommand } from './commands/info';\nimport { InitCommand } from './commands/init';\nimport { VersionCommand } from './commands/version';\nimport type { CliRuntimeOptions } from './runtime';\nimport { configureCli } from './runtime';\nimport { MIN_NODE_VERSION, isVersionValid } from './utils';\n\n/**\n * Build and run the Verdaccio CLI.\n *\n * Called with no arguments it behaves exactly like the standalone `verdaccio`\n * binary. Downstream distributions can inject a custom server factory (and\n * version/name) via {@link CliRuntimeOptions} — e.g. a registry that needs to\n * boot with a custom Storage — without re-implementing the command set.\n */\nexport function runCli(options: CliRuntimeOptions = {}): Promise<void> {\n configureCli(options);\n\n if (process.getuid && process.getuid() === 0) {\n warningUtils.emit(warningUtils.Codes.VERWAR001);\n }\n\n if (!isVersionValid(process.version)) {\n throw new Error(\n `Verdaccio requires at least Node.js v${MIN_NODE_VERSION} or higher and you have installed ${process.version},\n please upgrade your Node.js distribution`\n );\n }\n\n const [node, app, ...args] = process.argv;\n\n const version =\n options.version ?? (pkgUtils.getPackageJson(import.meta.dirname, '..').version as string);\n\n const cli = new Cli({\n binaryLabel: `verdaccio`,\n binaryName: `${node} ${app}`,\n binaryVersion: version,\n });\n\n cli.register(InfoCommand);\n cli.register(InitCommand);\n cli.register(VersionCommand);\n\n process.on('uncaughtException', function (err) {\n console.error(\n `uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this: \\n${err.stack}`\n );\n process.exit(1);\n });\n\n return cli.runExit(args, Cli.defaultContext);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmBA,SAAgB,OAAO,UAA6B,CAAC,GAAkB;CACrE,gBAAA,aAAa,OAAO;CAEpB,IAAI,QAAQ,UAAU,QAAQ,OAAO,MAAM,GACzC,gBAAA,aAAa,KAAKA,gBAAAA,aAAa,MAAM,SAAS;CAGhD,IAAI,CAACC,cAAAA,eAAe,QAAQ,OAAO,GACjC,MAAM,IAAI,MACR,wCAAwCC,cAAAA,iBAAiB,oCAAoC,QAAQ,QAAQ;6CAE/G;CAGF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,QAAQ;CAErC,MAAM,UACJ,QAAQ,WAAYC,gBAAAA,SAAS,eAAA,WAAoC,IAAI,CAAC,CAAC;CAEzE,MAAM,MAAM,IAAIC,UAAAA,IAAI;EAClB,aAAa;EACb,YAAY,GAAG,KAAK,GAAG;EACvB,eAAe;CACjB,CAAC;CAED,IAAI,SAASC,aAAAA,WAAW;CACxB,IAAI,SAASC,aAAAA,WAAW;CACxB,IAAI,SAASC,gBAAAA,cAAc;CAE3B,QAAQ,GAAG,qBAAqB,SAAU,KAAK;EAC7C,QAAQ,MACN,6FAA6F,IAAI,OACnG;EACA,QAAQ,KAAK,CAAC;CAChB,CAAC;CAED,OAAO,IAAI,QAAQ,MAAMH,UAAAA,IAAI,cAAc;AAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-info.js","names":[],"sources":["../../src/commands/env-info.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { execFile } from 'node:child_process';\nimport fs from 'node:fs/promises';\nimport os from 'node:os';\nimport { promisify } from 'node:util';\n\nimport { findExistingConfigFile, getConfigParsed } from '@verdaccio/config';\nimport type { ConfigYaml } from '@verdaccio/types';\n\nconst run = promisify(execFile);\n\nasync function exec(cmd: string, args: string[]): Promise<string | null> {\n try {\n const { stdout } = await run(cmd, args, { timeout: 5000 });\n return stdout.trim();\n } catch {\n return null;\n }\n}\n\n/** Extract a `x.y.z` version out of a tool's `--version` output. */\nexport function parseVersion(raw: string): string {\n const match = raw.match(/\\d+\\.\\d+\\.\\d+[^\\s,]*/);\n return match ? match[0] : raw.replace(/^v/, '').trim();\n}\n\n/** Mask a path: keep the structure and the basename, replace each directory with `**`. */\nexport function maskPath(target: string): string {\n const parts = target.split(/[/\\\\]/);\n const last = parts.length - 1;\n return parts.map((segment, i) => (segment === '' || i === last ? segment : '**')).join('/');\n}\n\nfunction which(bin: string): Promise<string | null> {\n return exec('which', [bin]);\n}\n\nasync function binary(label: string, bin: string, mask: boolean): Promise<string | null> {\n const location = await which(bin);\n if (location === null) {\n return null;\n }\n const raw = await exec(bin, ['--version']);\n if (raw === null) {\n return null;\n }\n const version = parseVersion(raw);\n return ` ${label}: ${version} - ${mask ? maskPath(location) : location}`;\n}\n\nasync function osInfo(): Promise<string> {\n if (process.platform === 'darwin') {\n const name = await exec('sw_vers', ['-productName']);\n const version = await exec('sw_vers', ['-productVersion']);\n if (name && version) {\n return `${name} ${version}`;\n }\n }\n if (process.platform === 'linux') {\n try {\n const release = await fs.readFile('/etc/os-release', 'utf8');\n const match = release.match(/PRETTY_NAME=\"?([^\"\\n]+)/);\n if (match) {\n return match[1];\n }\n } catch {\n // fall through to the generic label\n }\n }\n return `${process.platform} ${os.release()}`;\n}\n\nfunction cpuInfo(): string {\n const cpus = os.cpus();\n const model = cpus[0]?.model ?? 'unknown';\n return `(${cpus.length}) ${os.arch()} ${model}`;\n}\n\nasync function globalVerdaccio(): Promise<string | null> {\n const raw = await exec('npm', ['ls', '-g', '--depth=0', '--json', 'verdaccio']);\n if (raw === null) {\n return null;\n }\n try {\n const version = JSON.parse(raw)?.dependencies?.verdaccio?.version;\n return version ? ` verdaccio: ${version}` : null;\n } catch {\n return null;\n }\n}\n\n/** Configured plugins and whether the storage is the built-in local filesystem. */\nexport function verdaccioConfigLines(\n config: ConfigYaml,\n configPath?: string,\n mask = false\n): string[] {\n const lines = [' Verdaccio:'];\n if (configPath) {\n lines.push(` config: ${mask ? maskPath(configPath) : configPath}`);\n }\n const store = config.store ? Object.keys(config.store) : [];\n lines.push(\n store.length === 0\n ? ` storage: local filesystem${config.storage ? ` (${mask ? maskPath(config.storage) : config.storage})` : ''}`\n : ` storage: ${store.join(', ')} plugin`\n );\n const auth = Object.keys(config.auth ?? {});\n lines.push(` auth plugins: ${auth.length > 0 ? auth.join(', ') : '(none)'}`);\n const middlewares = Object.keys(config.middlewares ?? {});\n if (middlewares.length > 0) {\n lines.push(` middleware plugins: ${middlewares.join(', ')}`);\n }\n const filters = Object.keys(config.filters ?? {});\n if (filters.length > 0) {\n lines.push(` filter plugins: ${filters.join(', ')}`);\n }\n return lines;\n}\n\nasync function verdaccioInfo(mask: boolean): Promise<string[]> {\n try {\n // side-effect-free lookup: --info must never create a config file\n const configPath = findExistingConfigFile();\n if (configPath === undefined) {\n return [];\n }\n return verdaccioConfigLines(getConfigParsed(configPath), configPath, mask);\n } catch {\n return [];\n }\n}\n\n/** A one-line hint drawn in a box, used to point at the --mask option. */\nfunction hintBox(text: string): string {\n const rule = '─'.repeat(text.length + 2);\n return chalk.cyan(`┌${rule}┐\\n│ ${text} │\\n└${rule}┘`);\n}\n\n/**\n * Local replacement for `envinfo` — the same environment report the CLI used to\n * print, minus the browsers section, plus the configured plugins and storage.\n */\nexport async function getEnvInfo(mask = false): Promise<string> {\n const lines: string[] = ['', 'Environment Info:', ' System:'];\n lines.push(` OS: ${await osInfo()}`);\n lines.push(` CPU: ${cpuInfo()}`);\n\n // binary/version detection relies on `which` and unshimmed executables, which are\n // unreliable on Windows — skip it there rather than print broken or empty entries\n if (process.platform !== 'win32') {\n const binaries = (\n await Promise.all([\n binary('node', 'node', mask),\n binary('yarn', 'yarn', mask),\n binary('npm', 'npm', mask),\n binary('pnpm', 'pnpm', mask),\n ])\n ).filter((line): line is string => line !== null);\n if (binaries.length > 0) {\n lines.push(' Binaries:', ...binaries);\n }\n\n const docker = await binary('Docker', 'docker', mask);\n if (docker) {\n lines.push(' Virtualization:', docker);\n }\n\n const verdaccio = await globalVerdaccio();\n if (verdaccio) {\n lines.push(' npmGlobalPackages:', verdaccio);\n }\n }\n\n lines.push(...(await verdaccioInfo(mask)));\n\n let report = lines.join('\\n') + '\\n';\n if (!mask) {\n report += `\\n${hintBox('tip: add --mask to obscure file paths (keeps the structure)')}\\n`;\n }\n return report;\n}\n"],"mappings":";;;;;;;;;;;AASA,IAAM,OAAA,
|
|
1
|
+
{"version":3,"file":"env-info.js","names":["promisify","execFile","fs","os","findExistingConfigFile","getConfigParsed"],"sources":["../../src/commands/env-info.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { execFile } from 'node:child_process';\nimport fs from 'node:fs/promises';\nimport os from 'node:os';\nimport { promisify } from 'node:util';\n\nimport { findExistingConfigFile, getConfigParsed } from '@verdaccio/config';\nimport type { ConfigYaml } from '@verdaccio/types';\n\nconst run = promisify(execFile);\n\nasync function exec(cmd: string, args: string[]): Promise<string | null> {\n try {\n const { stdout } = await run(cmd, args, { timeout: 5000 });\n return stdout.trim();\n } catch {\n return null;\n }\n}\n\n/** Extract a `x.y.z` version out of a tool's `--version` output. */\nexport function parseVersion(raw: string): string {\n const match = raw.match(/\\d+\\.\\d+\\.\\d+[^\\s,]*/);\n return match ? match[0] : raw.replace(/^v/, '').trim();\n}\n\n/** Mask a path: keep the structure and the basename, replace each directory with `**`. */\nexport function maskPath(target: string): string {\n const parts = target.split(/[/\\\\]/);\n const last = parts.length - 1;\n return parts.map((segment, i) => (segment === '' || i === last ? segment : '**')).join('/');\n}\n\nfunction which(bin: string): Promise<string | null> {\n return exec('which', [bin]);\n}\n\nasync function binary(label: string, bin: string, mask: boolean): Promise<string | null> {\n const location = await which(bin);\n if (location === null) {\n return null;\n }\n const raw = await exec(bin, ['--version']);\n if (raw === null) {\n return null;\n }\n const version = parseVersion(raw);\n return ` ${label}: ${version} - ${mask ? maskPath(location) : location}`;\n}\n\nasync function osInfo(): Promise<string> {\n if (process.platform === 'darwin') {\n const name = await exec('sw_vers', ['-productName']);\n const version = await exec('sw_vers', ['-productVersion']);\n if (name && version) {\n return `${name} ${version}`;\n }\n }\n if (process.platform === 'linux') {\n try {\n const release = await fs.readFile('/etc/os-release', 'utf8');\n const match = release.match(/PRETTY_NAME=\"?([^\"\\n]+)/);\n if (match) {\n return match[1];\n }\n } catch {\n // fall through to the generic label\n }\n }\n return `${process.platform} ${os.release()}`;\n}\n\nfunction cpuInfo(): string {\n const cpus = os.cpus();\n const model = cpus[0]?.model ?? 'unknown';\n return `(${cpus.length}) ${os.arch()} ${model}`;\n}\n\nasync function globalVerdaccio(): Promise<string | null> {\n const raw = await exec('npm', ['ls', '-g', '--depth=0', '--json', 'verdaccio']);\n if (raw === null) {\n return null;\n }\n try {\n const version = JSON.parse(raw)?.dependencies?.verdaccio?.version;\n return version ? ` verdaccio: ${version}` : null;\n } catch {\n return null;\n }\n}\n\n/** Configured plugins and whether the storage is the built-in local filesystem. */\nexport function verdaccioConfigLines(\n config: ConfigYaml,\n configPath?: string,\n mask = false\n): string[] {\n const lines = [' Verdaccio:'];\n if (configPath) {\n lines.push(` config: ${mask ? maskPath(configPath) : configPath}`);\n }\n const store = config.store ? Object.keys(config.store) : [];\n lines.push(\n store.length === 0\n ? ` storage: local filesystem${config.storage ? ` (${mask ? maskPath(config.storage) : config.storage})` : ''}`\n : ` storage: ${store.join(', ')} plugin`\n );\n const auth = Object.keys(config.auth ?? {});\n lines.push(` auth plugins: ${auth.length > 0 ? auth.join(', ') : '(none)'}`);\n const middlewares = Object.keys(config.middlewares ?? {});\n if (middlewares.length > 0) {\n lines.push(` middleware plugins: ${middlewares.join(', ')}`);\n }\n const filters = Object.keys(config.filters ?? {});\n if (filters.length > 0) {\n lines.push(` filter plugins: ${filters.join(', ')}`);\n }\n return lines;\n}\n\nasync function verdaccioInfo(mask: boolean): Promise<string[]> {\n try {\n // side-effect-free lookup: --info must never create a config file\n const configPath = findExistingConfigFile();\n if (configPath === undefined) {\n return [];\n }\n return verdaccioConfigLines(getConfigParsed(configPath), configPath, mask);\n } catch {\n return [];\n }\n}\n\n/** A one-line hint drawn in a box, used to point at the --mask option. */\nfunction hintBox(text: string): string {\n const rule = '─'.repeat(text.length + 2);\n return chalk.cyan(`┌${rule}┐\\n│ ${text} │\\n└${rule}┘`);\n}\n\n/**\n * Local replacement for `envinfo` — the same environment report the CLI used to\n * print, minus the browsers section, plus the configured plugins and storage.\n */\nexport async function getEnvInfo(mask = false): Promise<string> {\n const lines: string[] = ['', 'Environment Info:', ' System:'];\n lines.push(` OS: ${await osInfo()}`);\n lines.push(` CPU: ${cpuInfo()}`);\n\n // binary/version detection relies on `which` and unshimmed executables, which are\n // unreliable on Windows — skip it there rather than print broken or empty entries\n if (process.platform !== 'win32') {\n const binaries = (\n await Promise.all([\n binary('node', 'node', mask),\n binary('yarn', 'yarn', mask),\n binary('npm', 'npm', mask),\n binary('pnpm', 'pnpm', mask),\n ])\n ).filter((line): line is string => line !== null);\n if (binaries.length > 0) {\n lines.push(' Binaries:', ...binaries);\n }\n\n const docker = await binary('Docker', 'docker', mask);\n if (docker) {\n lines.push(' Virtualization:', docker);\n }\n\n const verdaccio = await globalVerdaccio();\n if (verdaccio) {\n lines.push(' npmGlobalPackages:', verdaccio);\n }\n }\n\n lines.push(...(await verdaccioInfo(mask)));\n\n let report = lines.join('\\n') + '\\n';\n if (!mask) {\n report += `\\n${hintBox('tip: add --mask to obscure file paths (keeps the structure)')}\\n`;\n }\n return report;\n}\n"],"mappings":";;;;;;;;;;;AASA,IAAM,OAAA,GAAMA,UAAAA,UAAAA,CAAUC,mBAAAA,QAAQ;AAE9B,eAAe,KAAK,KAAa,MAAwC;CACvE,IAAI;EACF,MAAM,EAAE,WAAW,MAAM,IAAI,KAAK,MAAM,EAAE,SAAS,IAAK,CAAC;EACzD,OAAO,OAAO,KAAK;CACrB,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAgB,aAAa,KAAqB;CAChD,MAAM,QAAQ,IAAI,MAAM,sBAAsB;CAC9C,OAAO,QAAQ,MAAM,KAAK,IAAI,QAAQ,MAAM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AAQ;EACN,OAAO,CAAC;CACV;AACF;;AAGA,SAAS,QAAQ,MAAsB;CACrC,MAAM,OAAO,IAAI,OAAO,KAAK,SAAS,CAAC;CACvC,OAAO,MAAA,QAAM,KAAK,IAAI,KAAK,OAAO,KAAK,OAAO,KAAK,EAAE;AACvD;;;;;AAMA,eAAsB,WAAW,OAAO,OAAwB;CAC9D,MAAM,QAAkB;EAAC;EAAI;EAAqB;CAAW;CAC7D,MAAM,KAAK,WAAW,MAAM,OAAO,GAAG;CACtC,MAAM,KAAK,YAAY,QAAQ,GAAG;CAIlC,IAAI,QAAQ,aAAa,SAAS;EAChC,MAAM,YACJ,MAAM,QAAQ,IAAI;GAChB,OAAO,QAAQ,QAAQ,IAAI;GAC3B,OAAO,QAAQ,QAAQ,IAAI;GAC3B,OAAO,OAAO,OAAO,IAAI;GACzB,OAAO,QAAQ,QAAQ,IAAI;EAC7B,CAAC,EAAA,CACD,QAAQ,SAAyB,SAAS,IAAI;EAChD,IAAI,SAAS,SAAS,GACpB,MAAM,KAAK,eAAe,GAAG,QAAQ;EAGvC,MAAM,SAAS,MAAM,OAAO,UAAU,UAAU,IAAI;EACpD,IAAI,QACF,MAAM,KAAK,qBAAqB,MAAM;EAGxC,MAAM,YAAY,MAAM,gBAAgB;EACxC,IAAI,WACF,MAAM,KAAK,wBAAwB,SAAS;CAEhD;CAEA,MAAM,KAAK,GAAI,MAAM,cAAc,IAAI,CAAE;CAEzC,IAAI,SAAS,MAAM,KAAK,IAAI,IAAI;CAChC,IAAI,CAAC,MACH,UAAU,KAAK,QAAQ,6DAA6D,EAAE;CAExF,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","names":[],"sources":["../../src/commands/info.ts"],"sourcesContent":["import { Command, Option } from 'clipanion';\n\nimport { getEnvInfo } from './env-info';\n\nexport class InfoCommand extends Command {\n public static paths = [[`--info`], [`-i`]];\n\n public mask = Option.Boolean(`--mask`, false, {\n description: `obscure file paths in the report (keeps the structure, hides the names)`,\n });\n\n public async execute(): Promise<void> {\n this.context.stdout.write(await getEnvInfo(this.mask));\n process.exit(0);\n }\n}\n"],"mappings":";;;AAIA,IAAa,cAAb,
|
|
1
|
+
{"version":3,"file":"info.js","names":["Command","Option","getEnvInfo"],"sources":["../../src/commands/info.ts"],"sourcesContent":["import { Command, Option } from 'clipanion';\n\nimport { getEnvInfo } from './env-info';\n\nexport class InfoCommand extends Command {\n public static paths = [[`--info`], [`-i`]];\n\n public mask = Option.Boolean(`--mask`, false, {\n description: `obscure file paths in the report (keeps the structure, hides the names)`,\n });\n\n public async execute(): Promise<void> {\n this.context.stdout.write(await getEnvInfo(this.mask));\n process.exit(0);\n }\n}\n"],"mappings":";;;AAIA,IAAa,cAAb,cAAiCA,UAAAA,QAAQ;CACvC,OAAc,QAAQ,CAAC,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC;CAEzC,OAAcC,UAAAA,OAAO,QAAQ,UAAU,OAAO,EAC5C,aAAa,0EACf,CAAC;CAED,MAAa,UAAyB;EACpC,KAAK,QAAQ,OAAO,MAAM,MAAMC,iBAAAA,WAAW,KAAK,IAAI,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","names":[],"sources":["../../src/commands/init.ts"],"sourcesContent":["import { Command, Option } from 'clipanion';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { pkgUtils, warningUtils } from '@verdaccio/core';\nimport { logger, setup } from '@verdaccio/logger';\nimport { initServer } from '@verdaccio/node-api';\nimport type { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';\n\nimport { getPkgNameOverride, getStartServer, getVersionOverride } from '../runtime';\n\nexport const DEFAULT_PROCESS_NAME: string = 'verdaccio';\n\nexport class InitCommand extends Command {\n public static paths = [Command.Default];\n\n private port = Option.String('-l,-p,--listen,--port', {\n description: 'host:port number to listen on (default: localhost:4873)',\n });\n\n static usage = Command.Usage({\n description: `launch the server`,\n details: `\n This start the registry in the default port.\n\n When used without arguments, it:\n\n - bootstrap the server at the port \\`4873\\`\n\n The optional arguments are:\n\n - \\`-l | --listen | -p | --port\\` to switch the default server port,\n - \\`-c | --config\\` to define a different configuration path location,\n\n `,\n examples: [\n [`Runs the server with the default configuration`, `verdaccio`],\n [`Runs the server in the port 5000`, `verdaccio --listen 5000`],\n [\n `Runs the server by using a different absolute location of the configuration file`,\n `verdaccio --config /home/user/verdaccio/config.yaml`,\n ],\n ],\n });\n\n private config = Option.String('-c,--config', {\n description: 'use this configuration file (default: ./config.yaml)',\n });\n\n private async initLogger(logConfig: ConfigYaml) {\n if (logConfig.logs) {\n logConfig.log = logConfig.logs;\n warningUtils.emit(warningUtils.Codes.VERWAR002);\n }\n await setup(logConfig.log as LoggerConfigItem);\n }\n\n public async execute() {\n try {\n const configPathLocation = findConfigFile(this.config as string);\n const configParsed = parseConfigFile(configPathLocation);\n await this.initLogger(configParsed);\n logger.info({ file: configPathLocation }, 'using config file: @{file}');\n const { web } = configParsed;\n\n process.title = web?.title || DEFAULT_PROCESS_NAME;\n\n const currentDir = import.meta.dirname;\n const pkg = pkgUtils.getPackageJson(currentDir, '../..');\n const version = getVersionOverride() ?? (pkg.version as string);\n const name = getPkgNameOverride() ?? (pkg.name as string);\n\n await initServer(\n configParsed,\n this.port as string,\n version as string,\n name as string,\n getStartServer()\n );\n\n const logLevel = configParsed.log?.level || 'default';\n logger.info({ logLevel }, 'log level: @{logLevel}');\n logger.info('server started');\n } catch (err: any) {\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;AAUA,IAAa,uBAA+B;AAE5C,IAAa,cAAb,
|
|
1
|
+
{"version":3,"file":"init.js","names":["Command","Option","warningUtils","setup","findConfigFile","parseConfigFile","pkgUtils","getVersionOverride","getPkgNameOverride","initServer","getStartServer"],"sources":["../../src/commands/init.ts"],"sourcesContent":["import { Command, Option } from 'clipanion';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { pkgUtils, warningUtils } from '@verdaccio/core';\nimport { logger, setup } from '@verdaccio/logger';\nimport { initServer } from '@verdaccio/node-api';\nimport type { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';\n\nimport { getPkgNameOverride, getStartServer, getVersionOverride } from '../runtime';\n\nexport const DEFAULT_PROCESS_NAME: string = 'verdaccio';\n\nexport class InitCommand extends Command {\n public static paths = [Command.Default];\n\n private port = Option.String('-l,-p,--listen,--port', {\n description: 'host:port number to listen on (default: localhost:4873)',\n });\n\n static usage = Command.Usage({\n description: `launch the server`,\n details: `\n This start the registry in the default port.\n\n When used without arguments, it:\n\n - bootstrap the server at the port \\`4873\\`\n\n The optional arguments are:\n\n - \\`-l | --listen | -p | --port\\` to switch the default server port,\n - \\`-c | --config\\` to define a different configuration path location,\n\n `,\n examples: [\n [`Runs the server with the default configuration`, `verdaccio`],\n [`Runs the server in the port 5000`, `verdaccio --listen 5000`],\n [\n `Runs the server by using a different absolute location of the configuration file`,\n `verdaccio --config /home/user/verdaccio/config.yaml`,\n ],\n ],\n });\n\n private config = Option.String('-c,--config', {\n description: 'use this configuration file (default: ./config.yaml)',\n });\n\n private async initLogger(logConfig: ConfigYaml) {\n if (logConfig.logs) {\n logConfig.log = logConfig.logs;\n warningUtils.emit(warningUtils.Codes.VERWAR002);\n }\n await setup(logConfig.log as LoggerConfigItem);\n }\n\n public async execute() {\n try {\n const configPathLocation = findConfigFile(this.config as string);\n const configParsed = parseConfigFile(configPathLocation);\n await this.initLogger(configParsed);\n logger.info({ file: configPathLocation }, 'using config file: @{file}');\n const { web } = configParsed;\n\n process.title = web?.title || DEFAULT_PROCESS_NAME;\n\n const currentDir = import.meta.dirname;\n const pkg = pkgUtils.getPackageJson(currentDir, '../..');\n const version = getVersionOverride() ?? (pkg.version as string);\n const name = getPkgNameOverride() ?? (pkg.name as string);\n\n await initServer(\n configParsed,\n this.port as string,\n version as string,\n name as string,\n getStartServer()\n );\n\n const logLevel = configParsed.log?.level || 'default';\n logger.info({ logLevel }, 'log level: @{logLevel}');\n logger.info('server started');\n } catch (err: any) {\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;AAUA,IAAa,uBAA+B;AAE5C,IAAa,cAAb,cAAiCA,UAAAA,QAAQ;CACvC,OAAc,QAAQ,CAACA,UAAAA,QAAQ,OAAO;CAEtC,OAAeC,UAAAA,OAAO,OAAO,yBAAyB,EACpD,aAAa,0DACf,CAAC;CAED,OAAO,QAAQD,UAAAA,QAAQ,MAAM;EAC3B,aAAa;EACb,SAAS;;;;;;;;;;;;;EAaT,UAAU;GACR,CAAC,kDAAkD,WAAW;GAC9D,CAAC,oCAAoC,yBAAyB;GAC9D,CACE,oFACA,qDACF;EACF;CACF,CAAC;CAED,SAAiBC,UAAAA,OAAO,OAAO,eAAe,EAC5C,aAAa,uDACf,CAAC;CAED,MAAc,WAAW,WAAuB;EAC9C,IAAI,UAAU,MAAM;GAClB,UAAU,MAAM,UAAU;GAC1B,gBAAA,aAAa,KAAKC,gBAAAA,aAAa,MAAM,SAAS;EAChD;EACA,OAAA,GAAMC,kBAAAA,MAAAA,CAAM,UAAU,GAAuB;CAC/C;CAEA,MAAa,UAAU;EACrB,IAAI;GACF,MAAM,sBAAA,GAAqBC,kBAAAA,eAAAA,CAAe,KAAK,MAAgB;GAC/D,MAAM,gBAAA,GAAeC,kBAAAA,gBAAAA,CAAgB,kBAAkB;GACvD,MAAM,KAAK,WAAW,YAAY;GAClC,kBAAA,OAAO,KAAK,EAAE,MAAM,mBAAmB,GAAG,4BAA4B;GACtE,MAAM,EAAE,QAAQ;GAEhB,QAAQ,QAAQ,KAAK,SAAA;GAErB,MAAM,aAAA;GACN,MAAM,MAAMC,gBAAAA,SAAS,eAAe,YAAY,OAAO;GACvD,MAAM,UAAUC,gBAAAA,mBAAmB,KAAM,IAAI;GAC7C,MAAM,OAAOC,gBAAAA,mBAAmB,KAAM,IAAI;GAE1C,OAAA,GAAMC,oBAAAA,WAAAA,CACJ,cACA,KAAK,MACL,SACA,MACAC,gBAAAA,eAAe,CACjB;GAEA,MAAM,WAAW,aAAa,KAAK,SAAS;GAC5C,kBAAA,OAAO,KAAK,EAAE,SAAS,GAAG,wBAAwB;GAClD,kBAAA,OAAO,KAAK,gBAAgB;EAC9B,SAAS,KAAU;GACjB,QAAQ,MAAM,GAAG;GACjB,QAAQ,KAAK,CAAC;EAChB;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/commands/version.ts"],"sourcesContent":["import { Command } from 'clipanion';\n\nimport { pkgUtils } from '@verdaccio/core';\n\nimport { getVersionOverride } from '../runtime';\n\nexport class VersionCommand extends Command {\n static paths = [[`--version`], [`-v`]];\n\n async execute() {\n const currentDir = import.meta.dirname;\n const version = getVersionOverride() ?? pkgUtils.getPackageJson(currentDir, '../..').version;\n this.context.stdout.write(`v${version}\\n`);\n process.exit(0);\n }\n}\n"],"mappings":";;;;AAMA,IAAa,iBAAb,
|
|
1
|
+
{"version":3,"file":"version.js","names":["Command","getVersionOverride","pkgUtils"],"sources":["../../src/commands/version.ts"],"sourcesContent":["import { Command } from 'clipanion';\n\nimport { pkgUtils } from '@verdaccio/core';\n\nimport { getVersionOverride } from '../runtime';\n\nexport class VersionCommand extends Command {\n static paths = [[`--version`], [`-v`]];\n\n async execute() {\n const currentDir = import.meta.dirname;\n const version = getVersionOverride() ?? pkgUtils.getPackageJson(currentDir, '../..').version;\n this.context.stdout.write(`v${version}\\n`);\n process.exit(0);\n }\n}\n"],"mappings":";;;;AAMA,IAAa,iBAAb,cAAoCA,UAAAA,QAAQ;CAC1C,OAAO,QAAQ,CAAC,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC;CAErC,MAAM,UAAU;EACd,MAAM,aAAA;EACN,MAAM,UAAUC,gBAAAA,mBAAmB,KAAKC,gBAAAA,SAAS,eAAe,YAAY,OAAO,CAAC,CAAC;EACrF,KAAK,QAAQ,OAAO,MAAM,IAAI,QAAQ,GAAG;EACzC,QAAQ,KAAK,CAAC;CAChB;AACF"}
|
package/build/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","names":[],"sources":["../src/runtime.ts"],"sourcesContent":["import defaultStartServer from '@verdaccio/server';\nimport type { ConfigYaml } from '@verdaccio/types';\n\nexport type ServerFactory = (config: ConfigYaml) => Promise<any>;\n\nexport interface CliRuntimeOptions {\n /**\n * The server factory used by the default (start) command. Defaults to\n * `@verdaccio/server`. Downstream distributions (e.g. a registry that needs a\n * custom Storage) can inject their own factory here.\n */\n startServer?: ServerFactory;\n /** Version string reported by `--version` and the startup banner. */\n version?: string;\n /** Process/package name reported on startup. */\n pkgName?: string;\n}\n\nlet _startServer: ServerFactory = defaultStartServer;\nlet _version: string | undefined;\nlet _pkgName: string | undefined;\n\nexport function configureCli(options: CliRuntimeOptions = {}): void {\n if (options.startServer) {\n _startServer = options.startServer;\n }\n if (options.version) {\n _version = options.version;\n }\n if (options.pkgName) {\n _pkgName = options.pkgName;\n }\n}\n\nexport function getStartServer(): ServerFactory {\n return _startServer;\n}\n\nexport function getVersionOverride(): string | undefined {\n return _version;\n}\n\nexport function getPkgNameOverride(): string | undefined {\n return _pkgName;\n}\n"],"mappings":";;;;AAkBA,IAAI,
|
|
1
|
+
{"version":3,"file":"runtime.js","names":["defaultStartServer"],"sources":["../src/runtime.ts"],"sourcesContent":["import defaultStartServer from '@verdaccio/server';\nimport type { ConfigYaml } from '@verdaccio/types';\n\nexport type ServerFactory = (config: ConfigYaml) => Promise<any>;\n\nexport interface CliRuntimeOptions {\n /**\n * The server factory used by the default (start) command. Defaults to\n * `@verdaccio/server`. Downstream distributions (e.g. a registry that needs a\n * custom Storage) can inject their own factory here.\n */\n startServer?: ServerFactory;\n /** Version string reported by `--version` and the startup banner. */\n version?: string;\n /** Process/package name reported on startup. */\n pkgName?: string;\n}\n\nlet _startServer: ServerFactory = defaultStartServer;\nlet _version: string | undefined;\nlet _pkgName: string | undefined;\n\nexport function configureCli(options: CliRuntimeOptions = {}): void {\n if (options.startServer) {\n _startServer = options.startServer;\n }\n if (options.version) {\n _version = options.version;\n }\n if (options.pkgName) {\n _pkgName = options.pkgName;\n }\n}\n\nexport function getStartServer(): ServerFactory {\n return _startServer;\n}\n\nexport function getVersionOverride(): string | undefined {\n return _version;\n}\n\nexport function getPkgNameOverride(): string | undefined {\n return _pkgName;\n}\n"],"mappings":";;;;AAkBA,IAAI,eAA8BA,kBAAAA;AAClC,IAAI;AACJ,IAAI;AAEJ,SAAgB,aAAa,UAA6B,CAAC,GAAS;CAClE,IAAI,QAAQ,aACV,eAAe,QAAQ;CAEzB,IAAI,QAAQ,SACV,WAAW,QAAQ;CAErB,IAAI,QAAQ,SACV,WAAW,QAAQ;AAEvB;AAEA,SAAgB,iBAAgC;CAC9C,OAAO;AACT;AAEA,SAAgB,qBAAyC;CACvD,OAAO;AACT;AAEA,SAAgB,qBAAyC;CACvD,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/cli",
|
|
3
|
-
"version": "9.0.0-next-9.
|
|
3
|
+
"version": "9.0.0-next-9.38",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Juan Picado",
|
|
6
6
|
"email": "juanpicado19@gmail.com"
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"main": "./build/index.js",
|
|
38
38
|
"types": "build/index.d.ts",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@verdaccio/config": "9.0.0-next-9.
|
|
41
|
-
"@verdaccio/core": "9.0.0-next-9.
|
|
42
|
-
"@verdaccio/logger": "9.0.0-next-9.
|
|
43
|
-
"@verdaccio/node-api": "9.0.0-next-9.
|
|
44
|
-
"@verdaccio/server": "9.0.0-next-9.
|
|
45
|
-
"chalk": "
|
|
40
|
+
"@verdaccio/config": "9.0.0-next-9.38",
|
|
41
|
+
"@verdaccio/core": "9.0.0-next-9.38",
|
|
42
|
+
"@verdaccio/logger": "9.0.0-next-9.38",
|
|
43
|
+
"@verdaccio/node-api": "9.0.0-next-9.38",
|
|
44
|
+
"@verdaccio/server": "9.0.0-next-9.38",
|
|
45
|
+
"chalk": "6.0.1",
|
|
46
46
|
"clipanion": "4.0.0-rc.4",
|
|
47
47
|
"semver": "7.8.5"
|
|
48
48
|
},
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@verdaccio/types": "14.0.0-next-9.17",
|
|
51
51
|
"rimraf": "6.1.3",
|
|
52
52
|
"tsx": "4.22.4",
|
|
53
|
-
"vite": "8.
|
|
54
|
-
"vitest": "
|
|
53
|
+
"vite": "8.3.4",
|
|
54
|
+
"vitest": "5.0.5"
|
|
55
55
|
},
|
|
56
56
|
"funding": {
|
|
57
57
|
"type": "opencollective",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"clean": "rimraf ./build",
|
|
76
|
-
"test": "vitest run",
|
|
76
|
+
"test": "vitest run --fsModuleCachePath node_modules/.vitest-cache",
|
|
77
77
|
"watch": "vite build --watch",
|
|
78
78
|
"build": "vite build",
|
|
79
79
|
"start": "tsx src/index.ts"
|