@verdaccio/cli 9.0.0-next-9.17 → 9.0.0-next-9.19

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/bin/verdaccio CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('../build');
3
+ require('../build').runCli();
package/build/cli.d.ts CHANGED
@@ -1 +1,10 @@
1
- export {};
1
+ import { CliRuntimeOptions } from './runtime';
2
+ /**
3
+ * Build and run the Verdaccio CLI.
4
+ *
5
+ * Called with no arguments it behaves exactly like the standalone `verdaccio`
6
+ * binary. Downstream distributions can inject a custom server factory (and
7
+ * version/name) via {@link CliRuntimeOptions} — e.g. a registry that needs to
8
+ * boot with a custom Storage — without re-implementing the command set.
9
+ */
10
+ export declare function runCli(options?: CliRuntimeOptions): Promise<number>;
package/build/cli.js CHANGED
@@ -1,28 +1,41 @@
1
- require("./_virtual/_rolldown/runtime.js");
2
1
  const require_info = require("./commands/info.js");
2
+ const require_runtime = require("./runtime.js");
3
3
  const require_init = require("./commands/init.js");
4
4
  const require_version = require("./commands/version.js");
5
5
  const require_utils = require("./utils.js");
6
6
  let clipanion = require("clipanion");
7
7
  let _verdaccio_core = require("@verdaccio/core");
8
8
  //#region src/cli.ts
9
- if (process.getuid && process.getuid() === 0) _verdaccio_core.warningUtils.emit(_verdaccio_core.warningUtils.Codes.VERWAR001);
10
- if (!require_utils.isVersionValid(process.version)) throw new Error(`Verdaccio requires at least Node.js v${require_utils.MIN_NODE_VERSION} or higher and you have installed ${process.version},
9
+ /**
10
+ * Build and run the Verdaccio CLI.
11
+ *
12
+ * Called with no arguments it behaves exactly like the standalone `verdaccio`
13
+ * binary. Downstream distributions can inject a custom server factory (and
14
+ * version/name) via {@link CliRuntimeOptions} — e.g. a registry that needs to
15
+ * boot with a custom Storage — without re-implementing the command set.
16
+ */
17
+ function runCli(options = {}) {
18
+ require_runtime.configureCli(options);
19
+ if (process.getuid && process.getuid() === 0) _verdaccio_core.warningUtils.emit(_verdaccio_core.warningUtils.Codes.VERWAR001);
20
+ if (!require_utils.isVersionValid(process.version)) throw new Error(`Verdaccio requires at least Node.js v${require_utils.MIN_NODE_VERSION} or higher and you have installed ${process.version},
11
21
  please upgrade your Node.js distribution`);
12
- var [node, app, ...args] = process.argv;
13
- var cli = new clipanion.Cli({
14
- binaryLabel: `verdaccio`,
15
- binaryName: `${node} ${app}`,
16
- binaryVersion: _verdaccio_core.pkgUtils.getPackageJson(typeof __dirname !== "undefined" ? __dirname : {}.dirname, "..").version
17
- });
18
- cli.register(require_info.InfoCommand);
19
- cli.register(require_init.InitCommand);
20
- cli.register(require_version.VersionCommand);
21
- cli.runExit(args, clipanion.Cli.defaultContext);
22
- process.on("uncaughtException", function(err) {
23
- console.error(`uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this: \n${err.stack}`);
24
- process.exit(1);
25
- });
22
+ const [node, app, ...args] = process.argv;
23
+ const version = options.version ?? _verdaccio_core.pkgUtils.getPackageJson(typeof __dirname !== "undefined" ? __dirname : {}.dirname, "..").version;
24
+ const cli = new clipanion.Cli({
25
+ binaryLabel: `verdaccio`,
26
+ binaryName: `${node} ${app}`,
27
+ binaryVersion: version
28
+ });
29
+ cli.register(require_info.InfoCommand);
30
+ cli.register(require_init.InitCommand);
31
+ cli.register(require_version.VersionCommand);
32
+ process.on("uncaughtException", function(err) {
33
+ console.error(`uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this: \n${err.stack}`);
34
+ process.exit(1);
35
+ });
36
+ return cli.runExit(args, clipanion.Cli.defaultContext);
37
+ }
26
38
  //#endregion
39
+ exports.runCli = runCli;
27
40
 
28
41
  //# sourceMappingURL=cli.js.map
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 { MIN_NODE_VERSION, isVersionValid } from './utils';\n\nif (process.getuid && process.getuid() === 0) {\n warningUtils.emit(warningUtils.Codes.VERWAR001);\n}\n\nif (!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\nconst [node, app, ...args] = process.argv;\n\nconst cli = new Cli({\n binaryLabel: `verdaccio`,\n binaryName: `${node} ${app}`,\n binaryVersion: pkgUtils.getPackageJson(\n typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname,\n '..'\n ).version as string,\n});\n\ncli.register(InfoCommand);\ncli.register(InitCommand);\ncli.register(VersionCommand);\ncli.runExit(args, Cli.defaultContext);\n\nprocess.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"],"mappings":";;;;;;;;AASA,IAAI,QAAQ,UAAU,QAAQ,QAAQ,KAAK,EACzC,iBAAA,aAAa,KAAK,gBAAA,aAAa,MAAM,UAAU;AAGjD,IAAI,CAAC,cAAA,eAAe,QAAQ,QAAQ,CAClC,OAAM,IAAI,MACR,wCAAwC,cAAA,iBAAiB,oCAAoC,QAAQ,QAAQ;8CAE9G;AAGH,IAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,QAAQ;AAErC,IAAM,MAAM,IAAI,UAAA,IAAI;CAClB,aAAa;CACb,YAAY,GAAG,KAAK,GAAG;CACvB,eAAe,gBAAA,SAAS,eACtB,OAAO,cAAc,cAAc,YAAA,EAAA,CAAwB,SAC3D,KACD,CAAC;CACH,CAAC;AAEF,IAAI,SAAS,aAAA,YAAY;AACzB,IAAI,SAAS,aAAA,YAAY;AACzB,IAAI,SAAS,gBAAA,eAAe;AAC5B,IAAI,QAAQ,MAAM,UAAA,IAAI,eAAe;AAErC,QAAQ,GAAG,qBAAqB,SAAU,KAAK;AAC7C,SAAQ,MACN,6FAA6F,IAAI,QAClG;AACD,SAAQ,KAAK,EAAE;EACf"}
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<number> {\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 ??\n (pkgUtils.getPackageJson(\n typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname,\n '..'\n ).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,GAAoB;CACvE,gBAAA,aAAa,OAAO;CAEpB,IAAI,QAAQ,UAAU,QAAQ,OAAO,MAAM,GACzC,gBAAA,aAAa,KAAK,gBAAA,aAAa,MAAM,SAAS;CAGhD,IAAI,CAAC,cAAA,eAAe,QAAQ,OAAO,GACjC,MAAM,IAAI,MACR,wCAAwC,cAAA,iBAAiB,oCAAoC,QAAQ,QAAQ;6CAE/G;CAGF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,QAAQ;CAErC,MAAM,UACJ,QAAQ,WACP,gBAAA,SAAS,eACR,OAAO,cAAc,cAAc,YAAA,CAAA,EAAwB,SAC3D,IACF,EAAE;CAEJ,MAAM,MAAM,IAAI,UAAA,IAAI;EAClB,aAAa;EACb,YAAY,GAAG,KAAK,GAAG;EACvB,eAAe;CACjB,CAAC;CAED,IAAI,SAAS,aAAA,WAAW;CACxB,IAAI,SAAS,aAAA,WAAW;CACxB,IAAI,SAAS,gBAAA,cAAc;CAE3B,QAAQ,GAAG,qBAAqB,SAAU,KAAK;EAC7C,QAAQ,MACN,6FAA6F,IAAI,OACnG;EACA,QAAQ,KAAK,CAAC;CAChB,CAAC;CAED,OAAO,IAAI,QAAQ,MAAM,UAAA,IAAI,cAAc;AAC7C"}
package/build/cli.mjs CHANGED
@@ -1,27 +1,41 @@
1
1
  import { InfoCommand } from "./commands/info.mjs";
2
+ import { configureCli } from "./runtime.mjs";
2
3
  import { InitCommand } from "./commands/init.mjs";
3
4
  import { VersionCommand } from "./commands/version.mjs";
4
5
  import { MIN_NODE_VERSION, isVersionValid } from "./utils.mjs";
5
6
  import { Cli } from "clipanion";
6
7
  import { pkgUtils, warningUtils } from "@verdaccio/core";
7
8
  //#region src/cli.ts
8
- if (process.getuid && process.getuid() === 0) warningUtils.emit(warningUtils.Codes.VERWAR001);
9
- if (!isVersionValid(process.version)) throw new Error(`Verdaccio requires at least Node.js v${MIN_NODE_VERSION} or higher and you have installed ${process.version},
9
+ /**
10
+ * Build and run the Verdaccio CLI.
11
+ *
12
+ * Called with no arguments it behaves exactly like the standalone `verdaccio`
13
+ * binary. Downstream distributions can inject a custom server factory (and
14
+ * version/name) via {@link CliRuntimeOptions} — e.g. a registry that needs to
15
+ * boot with a custom Storage — without re-implementing the command set.
16
+ */
17
+ function runCli(options = {}) {
18
+ configureCli(options);
19
+ if (process.getuid && process.getuid() === 0) warningUtils.emit(warningUtils.Codes.VERWAR001);
20
+ if (!isVersionValid(process.version)) throw new Error(`Verdaccio requires at least Node.js v${MIN_NODE_VERSION} or higher and you have installed ${process.version},
10
21
  please upgrade your Node.js distribution`);
11
- var [node, app, ...args] = process.argv;
12
- var cli = new Cli({
13
- binaryLabel: `verdaccio`,
14
- binaryName: `${node} ${app}`,
15
- binaryVersion: pkgUtils.getPackageJson(typeof __dirname !== "undefined" ? __dirname : import.meta.dirname, "..").version
16
- });
17
- cli.register(InfoCommand);
18
- cli.register(InitCommand);
19
- cli.register(VersionCommand);
20
- cli.runExit(args, Cli.defaultContext);
21
- process.on("uncaughtException", function(err) {
22
- console.error(`uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this: \n${err.stack}`);
23
- process.exit(1);
24
- });
22
+ const [node, app, ...args] = process.argv;
23
+ const version = options.version ?? pkgUtils.getPackageJson(typeof __dirname !== "undefined" ? __dirname : import.meta.dirname, "..").version;
24
+ const cli = new Cli({
25
+ binaryLabel: `verdaccio`,
26
+ binaryName: `${node} ${app}`,
27
+ binaryVersion: version
28
+ });
29
+ cli.register(InfoCommand);
30
+ cli.register(InitCommand);
31
+ cli.register(VersionCommand);
32
+ process.on("uncaughtException", function(err) {
33
+ console.error(`uncaught exception, please report (https://github.com/verdaccio/verdaccio/issues) this: \n${err.stack}`);
34
+ process.exit(1);
35
+ });
36
+ return cli.runExit(args, Cli.defaultContext);
37
+ }
25
38
  //#endregion
39
+ export { runCli };
26
40
 
27
41
  //# sourceMappingURL=cli.mjs.map
package/build/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","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 { MIN_NODE_VERSION, isVersionValid } from './utils';\n\nif (process.getuid && process.getuid() === 0) {\n warningUtils.emit(warningUtils.Codes.VERWAR001);\n}\n\nif (!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\nconst [node, app, ...args] = process.argv;\n\nconst cli = new Cli({\n binaryLabel: `verdaccio`,\n binaryName: `${node} ${app}`,\n binaryVersion: pkgUtils.getPackageJson(\n typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname,\n '..'\n ).version as string,\n});\n\ncli.register(InfoCommand);\ncli.register(InitCommand);\ncli.register(VersionCommand);\ncli.runExit(args, Cli.defaultContext);\n\nprocess.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"],"mappings":";;;;;;;AASA,IAAI,QAAQ,UAAU,QAAQ,QAAQ,KAAK,EACzC,cAAa,KAAK,aAAa,MAAM,UAAU;AAGjD,IAAI,CAAC,eAAe,QAAQ,QAAQ,CAClC,OAAM,IAAI,MACR,wCAAwC,iBAAiB,oCAAoC,QAAQ,QAAQ;8CAE9G;AAGH,IAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,QAAQ;AAErC,IAAM,MAAM,IAAI,IAAI;CAClB,aAAa;CACb,YAAY,GAAG,KAAK,GAAG;CACvB,eAAe,SAAS,eACtB,OAAO,cAAc,cAAc,YAAY,OAAO,KAAK,SAC3D,KACD,CAAC;CACH,CAAC;AAEF,IAAI,SAAS,YAAY;AACzB,IAAI,SAAS,YAAY;AACzB,IAAI,SAAS,eAAe;AAC5B,IAAI,QAAQ,MAAM,IAAI,eAAe;AAErC,QAAQ,GAAG,qBAAqB,SAAU,KAAK;AAC7C,SAAQ,MACN,6FAA6F,IAAI,QAClG;AACD,SAAQ,KAAK,EAAE;EACf"}
1
+ {"version":3,"file":"cli.mjs","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<number> {\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 ??\n (pkgUtils.getPackageJson(\n typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname,\n '..'\n ).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,GAAoB;CACvE,aAAa,OAAO;CAEpB,IAAI,QAAQ,UAAU,QAAQ,OAAO,MAAM,GACzC,aAAa,KAAK,aAAa,MAAM,SAAS;CAGhD,IAAI,CAAC,eAAe,QAAQ,OAAO,GACjC,MAAM,IAAI,MACR,wCAAwC,iBAAiB,oCAAoC,QAAQ,QAAQ;6CAE/G;CAGF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,QAAQ;CAErC,MAAM,UACJ,QAAQ,WACP,SAAS,eACR,OAAO,cAAc,cAAc,YAAY,OAAO,KAAK,SAC3D,IACF,EAAE;CAEJ,MAAM,MAAM,IAAI,IAAI;EAClB,aAAa;EACb,YAAY,GAAG,KAAK,GAAG;EACvB,eAAe;CACjB,CAAC;CAED,IAAI,SAAS,WAAW;CACxB,IAAI,SAAS,WAAW;CACxB,IAAI,SAAS,cAAc;CAE3B,QAAQ,GAAG,qBAAqB,SAAU,KAAK;EAC7C,QAAQ,MACN,6FAA6F,IAAI,OACnG;EACA,QAAQ,KAAK,CAAC;CAChB,CAAC;CAED,OAAO,IAAI,QAAQ,MAAM,IAAI,cAAc;AAC7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"info.js","names":[],"sources":["../../src/commands/info.ts"],"sourcesContent":["import { Command } from 'clipanion';\nimport envinfo from 'envinfo';\n\nexport class InfoCommand extends Command {\n public static paths = [[`--info`], [`-i`]];\n\n public async execute(): Promise<void> {\n this.context.stdout.write('\\nEnvironment Info:');\n const data = await envinfo.run({\n System: ['OS', 'CPU'],\n Binaries: ['node', 'yarn', 'npm', 'pnpm'],\n Virtualization: ['Docker'],\n Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],\n npmGlobalPackages: ['verdaccio'],\n });\n\n this.context.stdout.write(data);\n process.exit(0);\n }\n}\n"],"mappings":";;;;;AAGA,IAAa,cAAb,cAAiC,UAAA,QAAQ;CACvC,OAAc,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;CAE1C,MAAa,UAAyB;AACpC,OAAK,QAAQ,OAAO,MAAM,sBAAsB;EAChD,MAAM,OAAO,MAAM,QAAA,QAAQ,IAAI;GAC7B,QAAQ,CAAC,MAAM,MAAM;GACrB,UAAU;IAAC;IAAQ;IAAQ;IAAO;IAAO;GACzC,gBAAgB,CAAC,SAAS;GAC1B,UAAU;IAAC;IAAU;IAAQ;IAAW;IAAS;GACjD,mBAAmB,CAAC,YAAY;GACjC,CAAC;AAEF,OAAK,QAAQ,OAAO,MAAM,KAAK;AAC/B,UAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"info.js","names":[],"sources":["../../src/commands/info.ts"],"sourcesContent":["import { Command } from 'clipanion';\nimport envinfo from 'envinfo';\n\nexport class InfoCommand extends Command {\n public static paths = [[`--info`], [`-i`]];\n\n public async execute(): Promise<void> {\n this.context.stdout.write('\\nEnvironment Info:');\n const data = await envinfo.run({\n System: ['OS', 'CPU'],\n Binaries: ['node', 'yarn', 'npm', 'pnpm'],\n Virtualization: ['Docker'],\n Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],\n npmGlobalPackages: ['verdaccio'],\n });\n\n this.context.stdout.write(data);\n process.exit(0);\n }\n}\n"],"mappings":";;;;;AAGA,IAAa,cAAb,cAAiC,UAAA,QAAQ;CACvC,OAAc,QAAQ,CAAC,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC;CAEzC,MAAa,UAAyB;EACpC,KAAK,QAAQ,OAAO,MAAM,qBAAqB;EAC/C,MAAM,OAAO,MAAM,QAAA,QAAQ,IAAI;GAC7B,QAAQ,CAAC,MAAM,KAAK;GACpB,UAAU;IAAC;IAAQ;IAAQ;IAAO;GAAM;GACxC,gBAAgB,CAAC,QAAQ;GACzB,UAAU;IAAC;IAAU;IAAQ;IAAW;GAAQ;GAChD,mBAAmB,CAAC,WAAW;EACjC,CAAC;EAED,KAAK,QAAQ,OAAO,MAAM,IAAI;EAC9B,QAAQ,KAAK,CAAC;CAChB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"info.mjs","names":[],"sources":["../../src/commands/info.ts"],"sourcesContent":["import { Command } from 'clipanion';\nimport envinfo from 'envinfo';\n\nexport class InfoCommand extends Command {\n public static paths = [[`--info`], [`-i`]];\n\n public async execute(): Promise<void> {\n this.context.stdout.write('\\nEnvironment Info:');\n const data = await envinfo.run({\n System: ['OS', 'CPU'],\n Binaries: ['node', 'yarn', 'npm', 'pnpm'],\n Virtualization: ['Docker'],\n Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],\n npmGlobalPackages: ['verdaccio'],\n });\n\n this.context.stdout.write(data);\n process.exit(0);\n }\n}\n"],"mappings":";;;AAGA,IAAa,cAAb,cAAiC,QAAQ;CACvC,OAAc,QAAQ,CAAC,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;CAE1C,MAAa,UAAyB;AACpC,OAAK,QAAQ,OAAO,MAAM,sBAAsB;EAChD,MAAM,OAAO,MAAM,QAAQ,IAAI;GAC7B,QAAQ,CAAC,MAAM,MAAM;GACrB,UAAU;IAAC;IAAQ;IAAQ;IAAO;IAAO;GACzC,gBAAgB,CAAC,SAAS;GAC1B,UAAU;IAAC;IAAU;IAAQ;IAAW;IAAS;GACjD,mBAAmB,CAAC,YAAY;GACjC,CAAC;AAEF,OAAK,QAAQ,OAAO,MAAM,KAAK;AAC/B,UAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"info.mjs","names":[],"sources":["../../src/commands/info.ts"],"sourcesContent":["import { Command } from 'clipanion';\nimport envinfo from 'envinfo';\n\nexport class InfoCommand extends Command {\n public static paths = [[`--info`], [`-i`]];\n\n public async execute(): Promise<void> {\n this.context.stdout.write('\\nEnvironment Info:');\n const data = await envinfo.run({\n System: ['OS', 'CPU'],\n Binaries: ['node', 'yarn', 'npm', 'pnpm'],\n Virtualization: ['Docker'],\n Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],\n npmGlobalPackages: ['verdaccio'],\n });\n\n this.context.stdout.write(data);\n process.exit(0);\n }\n}\n"],"mappings":";;;AAGA,IAAa,cAAb,cAAiC,QAAQ;CACvC,OAAc,QAAQ,CAAC,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC;CAEzC,MAAa,UAAyB;EACpC,KAAK,QAAQ,OAAO,MAAM,qBAAqB;EAC/C,MAAM,OAAO,MAAM,QAAQ,IAAI;GAC7B,QAAQ,CAAC,MAAM,KAAK;GACpB,UAAU;IAAC;IAAQ;IAAQ;IAAO;GAAM;GACxC,gBAAgB,CAAC,QAAQ;GACzB,UAAU;IAAC;IAAU;IAAQ;IAAW;GAAQ;GAChD,mBAAmB,CAAC,WAAW;EACjC,CAAC;EAED,KAAK,QAAQ,OAAO,MAAM,IAAI;EAC9B,QAAQ,KAAK,CAAC;CAChB;AACF"}
@@ -1,11 +1,9 @@
1
- const require_runtime = require("../_virtual/_rolldown/runtime.js");
1
+ const require_runtime = require("../runtime.js");
2
2
  let clipanion = require("clipanion");
3
3
  let _verdaccio_core = require("@verdaccio/core");
4
4
  let _verdaccio_config = require("@verdaccio/config");
5
5
  let _verdaccio_logger = require("@verdaccio/logger");
6
6
  let _verdaccio_node_api = require("@verdaccio/node-api");
7
- let _verdaccio_server = require("@verdaccio/server");
8
- _verdaccio_server = require_runtime.__toESM(_verdaccio_server);
9
7
  var InitCommand = class extends clipanion.Command {
10
8
  static paths = [clipanion.Command.Default];
11
9
  port = clipanion.Option.String("-l,-p,--listen,--port", { description: "host:port number to listen on (default: localhost:4873)" });
@@ -47,8 +45,10 @@ var InitCommand = class extends clipanion.Command {
47
45
  const { web } = configParsed;
48
46
  process.title = web?.title || "verdaccio";
49
47
  const currentDir = typeof __dirname !== "undefined" ? __dirname : {}.dirname;
50
- const { version, name } = _verdaccio_core.pkgUtils.getPackageJson(currentDir, "../..");
51
- await (0, _verdaccio_node_api.initServer)(configParsed, this.port, version, name, _verdaccio_server.default);
48
+ const pkg = _verdaccio_core.pkgUtils.getPackageJson(currentDir, "../..");
49
+ const version = require_runtime.getVersionOverride() ?? pkg.version;
50
+ const name = require_runtime.getPkgNameOverride() ?? pkg.name;
51
+ await (0, _verdaccio_node_api.initServer)(configParsed, this.port, version, name, require_runtime.getStartServer());
52
52
  const logLevel = configParsed.log?.level || "default";
53
53
  _verdaccio_logger.logger.info({ logLevel }, "log level: @{logLevel}");
54
54
  _verdaccio_logger.logger.info("server started");
@@ -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 startServer from '@verdaccio/server';\nimport type { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';\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 = typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname;\n const { version, name } = pkgUtils.getPackageJson(currentDir, '../..');\n\n await initServer(\n configParsed,\n this.port as string,\n version as string,\n name as string,\n startServer\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":";;;;;;;;AAWA,IAAa,cAAb,cAAiC,UAAA,QAAQ;CACvC,OAAc,QAAQ,CAAC,UAAA,QAAQ,QAAQ;CAEvC,OAAe,UAAA,OAAO,OAAO,yBAAyB,EACpD,aAAa,2DACd,CAAC;CAEF,OAAO,QAAQ,UAAA,QAAQ,MAAM;EAC3B,aAAa;EACb,SAAS;;;;;;;;;;;;;EAaT,UAAU;GACR,CAAC,kDAAkD,YAAY;GAC/D,CAAC,oCAAoC,0BAA0B;GAC/D,CACE,oFACA,sDACD;GACF;EACF,CAAC;CAEF,SAAiB,UAAA,OAAO,OAAO,eAAe,EAC5C,aAAa,wDACd,CAAC;CAEF,MAAc,WAAW,WAAuB;AAC9C,MAAI,UAAU,MAAM;AAClB,aAAU,MAAM,UAAU;AAC1B,mBAAA,aAAa,KAAK,gBAAA,aAAa,MAAM,UAAU;;AAEjD,SAAA,GAAA,kBAAA,OAAY,UAAU,IAAwB;;CAGhD,MAAa,UAAU;AACrB,MAAI;GACF,MAAM,sBAAA,GAAA,kBAAA,gBAAoC,KAAK,OAAiB;GAChE,MAAM,gBAAA,GAAA,kBAAA,iBAA+B,mBAAmB;AACxD,SAAM,KAAK,WAAW,aAAa;AACnC,qBAAA,OAAO,KAAK,EAAE,MAAM,oBAAoB,EAAE,6BAA6B;GACvE,MAAM,EAAE,QAAQ;AAEhB,WAAQ,QAAQ,KAAK,SAAA;GAErB,MAAM,aAAa,OAAO,cAAc,cAAc,YAAA,EAAA,CAAwB;GAC9E,MAAM,EAAE,SAAS,SAAS,gBAAA,SAAS,eAAe,YAAY,QAAQ;AAEtE,UAAA,GAAA,oBAAA,YACE,cACA,KAAK,MACL,SACA,MACA,kBAAA,QACD;GAED,MAAM,WAAW,aAAa,KAAK,SAAS;AAC5C,qBAAA,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB;AACnD,qBAAA,OAAO,KAAK,iBAAiB;WACtB,KAAU;AACjB,WAAQ,MAAM,IAAI;AAClB,WAAQ,KAAK,EAAE"}
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 = typeof __dirname !== 'undefined' ? __dirname : 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":";;;;;;AAYA,IAAa,cAAb,cAAiC,UAAA,QAAQ;CACvC,OAAc,QAAQ,CAAC,UAAA,QAAQ,OAAO;CAEtC,OAAe,UAAA,OAAO,OAAO,yBAAyB,EACpD,aAAa,0DACf,CAAC;CAED,OAAO,QAAQ,UAAA,QAAQ,MAAM;EAC3B,aAAa;EACb,SAAS;;;;;;;;;;;;;EAaT,UAAU;GACR,CAAC,kDAAkD,WAAW;GAC9D,CAAC,oCAAoC,yBAAyB;GAC9D,CACE,oFACA,qDACF;EACF;CACF,CAAC;CAED,SAAiB,UAAA,OAAO,OAAO,eAAe,EAC5C,aAAa,uDACf,CAAC;CAED,MAAc,WAAW,WAAuB;EAC9C,IAAI,UAAU,MAAM;GAClB,UAAU,MAAM,UAAU;GAC1B,gBAAA,aAAa,KAAK,gBAAA,aAAa,MAAM,SAAS;EAChD;EACA,OAAA,GAAA,kBAAA,OAAY,UAAU,GAAuB;CAC/C;CAEA,MAAa,UAAU;EACrB,IAAI;GACF,MAAM,sBAAA,GAAA,kBAAA,gBAAoC,KAAK,MAAgB;GAC/D,MAAM,gBAAA,GAAA,kBAAA,iBAA+B,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,OAAO,cAAc,cAAc,YAAA,CAAA,EAAwB;GAC9E,MAAM,MAAM,gBAAA,SAAS,eAAe,YAAY,OAAO;GACvD,MAAM,UAAU,gBAAA,mBAAmB,KAAM,IAAI;GAC7C,MAAM,OAAO,gBAAA,mBAAmB,KAAM,IAAI;GAE1C,OAAA,GAAA,oBAAA,YACE,cACA,KAAK,MACL,SACA,MACA,gBAAA,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,9 +1,9 @@
1
+ import { getPkgNameOverride, getStartServer, getVersionOverride } from "../runtime.mjs";
1
2
  import { Command, Option } from "clipanion";
2
3
  import { pkgUtils, warningUtils } from "@verdaccio/core";
3
4
  import { findConfigFile, parseConfigFile } from "@verdaccio/config";
4
5
  import { logger, setup } from "@verdaccio/logger";
5
6
  import { initServer } from "@verdaccio/node-api";
6
- import startServer from "@verdaccio/server";
7
7
  var InitCommand = class extends Command {
8
8
  static paths = [Command.Default];
9
9
  port = Option.String("-l,-p,--listen,--port", { description: "host:port number to listen on (default: localhost:4873)" });
@@ -45,8 +45,10 @@ var InitCommand = class extends Command {
45
45
  const { web } = configParsed;
46
46
  process.title = web?.title || "verdaccio";
47
47
  const currentDir = typeof __dirname !== "undefined" ? __dirname : import.meta.dirname;
48
- const { version, name } = pkgUtils.getPackageJson(currentDir, "../..");
49
- await initServer(configParsed, this.port, version, name, startServer);
48
+ const pkg = pkgUtils.getPackageJson(currentDir, "../..");
49
+ const version = getVersionOverride() ?? pkg.version;
50
+ const name = getPkgNameOverride() ?? pkg.name;
51
+ await initServer(configParsed, this.port, version, name, getStartServer());
50
52
  const logLevel = configParsed.log?.level || "default";
51
53
  logger.info({ logLevel }, "log level: @{logLevel}");
52
54
  logger.info("server started");
@@ -1 +1 @@
1
- {"version":3,"file":"init.mjs","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 startServer from '@verdaccio/server';\nimport type { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';\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 = typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname;\n const { version, name } = pkgUtils.getPackageJson(currentDir, '../..');\n\n await initServer(\n configParsed,\n this.port as string,\n version as string,\n name as string,\n startServer\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":";;;;;;AAWA,IAAa,cAAb,cAAiC,QAAQ;CACvC,OAAc,QAAQ,CAAC,QAAQ,QAAQ;CAEvC,OAAe,OAAO,OAAO,yBAAyB,EACpD,aAAa,2DACd,CAAC;CAEF,OAAO,QAAQ,QAAQ,MAAM;EAC3B,aAAa;EACb,SAAS;;;;;;;;;;;;;EAaT,UAAU;GACR,CAAC,kDAAkD,YAAY;GAC/D,CAAC,oCAAoC,0BAA0B;GAC/D,CACE,oFACA,sDACD;GACF;EACF,CAAC;CAEF,SAAiB,OAAO,OAAO,eAAe,EAC5C,aAAa,wDACd,CAAC;CAEF,MAAc,WAAW,WAAuB;AAC9C,MAAI,UAAU,MAAM;AAClB,aAAU,MAAM,UAAU;AAC1B,gBAAa,KAAK,aAAa,MAAM,UAAU;;AAEjD,QAAM,MAAM,UAAU,IAAwB;;CAGhD,MAAa,UAAU;AACrB,MAAI;GACF,MAAM,qBAAqB,eAAe,KAAK,OAAiB;GAChE,MAAM,eAAe,gBAAgB,mBAAmB;AACxD,SAAM,KAAK,WAAW,aAAa;AACnC,UAAO,KAAK,EAAE,MAAM,oBAAoB,EAAE,6BAA6B;GACvE,MAAM,EAAE,QAAQ;AAEhB,WAAQ,QAAQ,KAAK,SAAA;GAErB,MAAM,aAAa,OAAO,cAAc,cAAc,YAAY,OAAO,KAAK;GAC9E,MAAM,EAAE,SAAS,SAAS,SAAS,eAAe,YAAY,QAAQ;AAEtE,SAAM,WACJ,cACA,KAAK,MACL,SACA,MACA,YACD;GAED,MAAM,WAAW,aAAa,KAAK,SAAS;AAC5C,UAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB;AACnD,UAAO,KAAK,iBAAiB;WACtB,KAAU;AACjB,WAAQ,MAAM,IAAI;AAClB,WAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"init.mjs","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 = typeof __dirname !== 'undefined' ? __dirname : 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":";;;;;;AAYA,IAAa,cAAb,cAAiC,QAAQ;CACvC,OAAc,QAAQ,CAAC,QAAQ,OAAO;CAEtC,OAAe,OAAO,OAAO,yBAAyB,EACpD,aAAa,0DACf,CAAC;CAED,OAAO,QAAQ,QAAQ,MAAM;EAC3B,aAAa;EACb,SAAS;;;;;;;;;;;;;EAaT,UAAU;GACR,CAAC,kDAAkD,WAAW;GAC9D,CAAC,oCAAoC,yBAAyB;GAC9D,CACE,oFACA,qDACF;EACF;CACF,CAAC;CAED,SAAiB,OAAO,OAAO,eAAe,EAC5C,aAAa,uDACf,CAAC;CAED,MAAc,WAAW,WAAuB;EAC9C,IAAI,UAAU,MAAM;GAClB,UAAU,MAAM,UAAU;GAC1B,aAAa,KAAK,aAAa,MAAM,SAAS;EAChD;EACA,MAAM,MAAM,UAAU,GAAuB;CAC/C;CAEA,MAAa,UAAU;EACrB,IAAI;GACF,MAAM,qBAAqB,eAAe,KAAK,MAAgB;GAC/D,MAAM,eAAe,gBAAgB,kBAAkB;GACvD,MAAM,KAAK,WAAW,YAAY;GAClC,OAAO,KAAK,EAAE,MAAM,mBAAmB,GAAG,4BAA4B;GACtE,MAAM,EAAE,QAAQ;GAEhB,QAAQ,QAAQ,KAAK,SAAA;GAErB,MAAM,aAAa,OAAO,cAAc,cAAc,YAAY,OAAO,KAAK;GAC9E,MAAM,MAAM,SAAS,eAAe,YAAY,OAAO;GACvD,MAAM,UAAU,mBAAmB,KAAM,IAAI;GAC7C,MAAM,OAAO,mBAAmB,KAAM,IAAI;GAE1C,MAAM,WACJ,cACA,KAAK,MACL,SACA,MACA,eAAe,CACjB;GAEA,MAAM,WAAW,aAAa,KAAK,SAAS;GAC5C,OAAO,KAAK,EAAE,SAAS,GAAG,wBAAwB;GAClD,OAAO,KAAK,gBAAgB;EAC9B,SAAS,KAAU;GACjB,QAAQ,MAAM,GAAG;GACjB,QAAQ,KAAK,CAAC;EAChB;CACF;AACF"}
@@ -1,4 +1,4 @@
1
- require("../_virtual/_rolldown/runtime.js");
1
+ const require_runtime = require("../runtime.js");
2
2
  let clipanion = require("clipanion");
3
3
  let _verdaccio_core = require("@verdaccio/core");
4
4
  //#region src/commands/version.ts
@@ -6,7 +6,7 @@ var VersionCommand = class extends clipanion.Command {
6
6
  static paths = [[`--version`], [`-v`]];
7
7
  async execute() {
8
8
  const currentDir = typeof __dirname !== "undefined" ? __dirname : {}.dirname;
9
- const { version } = _verdaccio_core.pkgUtils.getPackageJson(currentDir, "../..");
9
+ const version = require_runtime.getVersionOverride() ?? _verdaccio_core.pkgUtils.getPackageJson(currentDir, "../..").version;
10
10
  this.context.stdout.write(`v${version}\n`);
11
11
  process.exit(0);
12
12
  }
@@ -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\nexport class VersionCommand extends Command {\n static paths = [[`--version`], [`-v`]];\n\n async execute() {\n const currentDir = typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname;\n const { version } = pkgUtils.getPackageJson(currentDir, '../..');\n this.context.stdout.write(`v${version}\\n`);\n process.exit(0);\n }\n}\n"],"mappings":";;;;AAIA,IAAa,iBAAb,cAAoC,UAAA,QAAQ;CAC1C,OAAO,QAAQ,CAAC,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC;CAEtC,MAAM,UAAU;EACd,MAAM,aAAa,OAAO,cAAc,cAAc,YAAA,EAAA,CAAwB;EAC9E,MAAM,EAAE,YAAY,gBAAA,SAAS,eAAe,YAAY,QAAQ;AAChE,OAAK,QAAQ,OAAO,MAAM,IAAI,QAAQ,IAAI;AAC1C,UAAQ,KAAK,EAAE"}
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 = typeof __dirname !== 'undefined' ? __dirname : 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,cAAoC,UAAA,QAAQ;CAC1C,OAAO,QAAQ,CAAC,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC;CAErC,MAAM,UAAU;EACd,MAAM,aAAa,OAAO,cAAc,cAAc,YAAA,CAAA,EAAwB;EAC9E,MAAM,UAAU,gBAAA,mBAAmB,KAAK,gBAAA,SAAS,eAAe,YAAY,OAAO,EAAE;EACrF,KAAK,QAAQ,OAAO,MAAM,IAAI,QAAQ,GAAG;EACzC,QAAQ,KAAK,CAAC;CAChB;AACF"}
@@ -1,3 +1,4 @@
1
+ import { getVersionOverride } from "../runtime.mjs";
1
2
  import { Command } from "clipanion";
2
3
  import { pkgUtils } from "@verdaccio/core";
3
4
  //#region src/commands/version.ts
@@ -5,7 +6,7 @@ var VersionCommand = class extends Command {
5
6
  static paths = [[`--version`], [`-v`]];
6
7
  async execute() {
7
8
  const currentDir = typeof __dirname !== "undefined" ? __dirname : import.meta.dirname;
8
- const { version } = pkgUtils.getPackageJson(currentDir, "../..");
9
+ const version = getVersionOverride() ?? pkgUtils.getPackageJson(currentDir, "../..").version;
9
10
  this.context.stdout.write(`v${version}\n`);
10
11
  process.exit(0);
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","names":[],"sources":["../../src/commands/version.ts"],"sourcesContent":["import { Command } from 'clipanion';\n\nimport { pkgUtils } from '@verdaccio/core';\n\nexport class VersionCommand extends Command {\n static paths = [[`--version`], [`-v`]];\n\n async execute() {\n const currentDir = typeof __dirname !== 'undefined' ? __dirname : import.meta.dirname;\n const { version } = pkgUtils.getPackageJson(currentDir, '../..');\n this.context.stdout.write(`v${version}\\n`);\n process.exit(0);\n }\n}\n"],"mappings":";;;AAIA,IAAa,iBAAb,cAAoC,QAAQ;CAC1C,OAAO,QAAQ,CAAC,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC;CAEtC,MAAM,UAAU;EACd,MAAM,aAAa,OAAO,cAAc,cAAc,YAAY,OAAO,KAAK;EAC9E,MAAM,EAAE,YAAY,SAAS,eAAe,YAAY,QAAQ;AAChE,OAAK,QAAQ,OAAO,MAAM,IAAI,QAAQ,IAAI;AAC1C,UAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"version.mjs","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 = typeof __dirname !== 'undefined' ? __dirname : 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,cAAoC,QAAQ;CAC1C,OAAO,QAAQ,CAAC,CAAC,WAAW,GAAG,CAAC,IAAI,CAAC;CAErC,MAAM,UAAU;EACd,MAAM,aAAa,OAAO,cAAc,cAAc,YAAY,OAAO,KAAK;EAC9E,MAAM,UAAU,mBAAmB,KAAK,SAAS,eAAe,YAAY,OAAO,EAAE;EACrF,KAAK,QAAQ,OAAO,MAAM,IAAI,QAAQ,GAAG;EACzC,QAAQ,KAAK,CAAC;CAChB;AACF"}
package/build/index.d.ts CHANGED
@@ -0,0 +1,7 @@
1
+ export { runCli } from './cli';
2
+ export { configureCli } from './runtime';
3
+ export type { CliRuntimeOptions, ServerFactory } from './runtime';
4
+ export { InfoCommand } from './commands/info';
5
+ export { InitCommand } from './commands/init';
6
+ export { VersionCommand } from './commands/version';
7
+ export { MIN_NODE_VERSION, isVersionValid } from './utils';
package/build/index.js CHANGED
@@ -2,4 +2,16 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- require("./cli.js");
5
+ const require_info = require("./commands/info.js");
6
+ const require_runtime = require("./runtime.js");
7
+ const require_init = require("./commands/init.js");
8
+ const require_version = require("./commands/version.js");
9
+ const require_utils = require("./utils.js");
10
+ const require_cli = require("./cli.js");
11
+ exports.InfoCommand = require_info.InfoCommand;
12
+ exports.InitCommand = require_init.InitCommand;
13
+ exports.MIN_NODE_VERSION = require_utils.MIN_NODE_VERSION;
14
+ exports.VersionCommand = require_version.VersionCommand;
15
+ exports.configureCli = require_runtime.configureCli;
16
+ exports.isVersionValid = require_utils.isVersionValid;
17
+ exports.runCli = require_cli.runCli;
package/build/index.mjs CHANGED
@@ -1 +1,7 @@
1
- import "./cli.mjs";
1
+ import { InfoCommand } from "./commands/info.mjs";
2
+ import { configureCli } from "./runtime.mjs";
3
+ import { InitCommand } from "./commands/init.mjs";
4
+ import { VersionCommand } from "./commands/version.mjs";
5
+ import { MIN_NODE_VERSION, isVersionValid } from "./utils.mjs";
6
+ import { runCli } from "./cli.mjs";
7
+ export { InfoCommand, InitCommand, MIN_NODE_VERSION, VersionCommand, configureCli, isVersionValid, runCli };
@@ -0,0 +1,18 @@
1
+ import { ConfigYaml } from '@verdaccio/types';
2
+ export type ServerFactory = (config: ConfigYaml) => Promise<any>;
3
+ export interface CliRuntimeOptions {
4
+ /**
5
+ * The server factory used by the default (start) command. Defaults to
6
+ * `@verdaccio/server`. Downstream distributions (e.g. a registry that needs a
7
+ * custom Storage) can inject their own factory here.
8
+ */
9
+ startServer?: ServerFactory;
10
+ /** Version string reported by `--version` and the startup banner. */
11
+ version?: string;
12
+ /** Process/package name reported on startup. */
13
+ pkgName?: string;
14
+ }
15
+ export declare function configureCli(options?: CliRuntimeOptions): void;
16
+ export declare function getStartServer(): ServerFactory;
17
+ export declare function getVersionOverride(): string | undefined;
18
+ export declare function getPkgNameOverride(): string | undefined;
@@ -0,0 +1,28 @@
1
+ const require_runtime = require("./_virtual/_rolldown/runtime.js");
2
+ let _verdaccio_server = require("@verdaccio/server");
3
+ _verdaccio_server = require_runtime.__toESM(_verdaccio_server);
4
+ //#region src/runtime.ts
5
+ var _startServer = _verdaccio_server.default;
6
+ var _version;
7
+ var _pkgName;
8
+ function configureCli(options = {}) {
9
+ if (options.startServer) _startServer = options.startServer;
10
+ if (options.version) _version = options.version;
11
+ if (options.pkgName) _pkgName = options.pkgName;
12
+ }
13
+ function getStartServer() {
14
+ return _startServer;
15
+ }
16
+ function getVersionOverride() {
17
+ return _version;
18
+ }
19
+ function getPkgNameOverride() {
20
+ return _pkgName;
21
+ }
22
+ //#endregion
23
+ exports.configureCli = configureCli;
24
+ exports.getPkgNameOverride = getPkgNameOverride;
25
+ exports.getStartServer = getStartServer;
26
+ exports.getVersionOverride = getVersionOverride;
27
+
28
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +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,eAA8B,kBAAA;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"}
@@ -0,0 +1,23 @@
1
+ import defaultStartServer from "@verdaccio/server";
2
+ //#region src/runtime.ts
3
+ var _startServer = defaultStartServer;
4
+ var _version;
5
+ var _pkgName;
6
+ function configureCli(options = {}) {
7
+ if (options.startServer) _startServer = options.startServer;
8
+ if (options.version) _version = options.version;
9
+ if (options.pkgName) _pkgName = options.pkgName;
10
+ }
11
+ function getStartServer() {
12
+ return _startServer;
13
+ }
14
+ function getVersionOverride() {
15
+ return _version;
16
+ }
17
+ function getPkgNameOverride() {
18
+ return _pkgName;
19
+ }
20
+ //#endregion
21
+ export { configureCli, getPkgNameOverride, getStartServer, getVersionOverride };
22
+
23
+ //# sourceMappingURL=runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.mjs","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,eAA8B;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import semver from 'semver';\n\nexport const MIN_NODE_VERSION = '24.0.0';\n\nexport function isVersionValid(processVersion) {\n const version = processVersion.slice(1);\n return semver.satisfies(version, `>=${MIN_NODE_VERSION}`);\n}\n"],"mappings":";;;;AAEA,IAAa,mBAAmB;AAEhC,SAAgB,eAAe,gBAAgB;CAC7C,MAAM,UAAU,eAAe,MAAM,EAAE;AACvC,QAAO,OAAA,QAAO,UAAU,SAAS,KAAK,mBAAmB"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import semver from 'semver';\n\nexport const MIN_NODE_VERSION = '24.0.0';\n\nexport function isVersionValid(processVersion) {\n const version = processVersion.slice(1);\n return semver.satisfies(version, `>=${MIN_NODE_VERSION}`);\n}\n"],"mappings":";;;;AAEA,IAAa,mBAAmB;AAEhC,SAAgB,eAAe,gBAAgB;CAC7C,MAAM,UAAU,eAAe,MAAM,CAAC;CACtC,OAAO,OAAA,QAAO,UAAU,SAAS,KAAK,kBAAkB;AAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import semver from 'semver';\n\nexport const MIN_NODE_VERSION = '24.0.0';\n\nexport function isVersionValid(processVersion) {\n const version = processVersion.slice(1);\n return semver.satisfies(version, `>=${MIN_NODE_VERSION}`);\n}\n"],"mappings":";;AAEA,IAAa,mBAAmB;AAEhC,SAAgB,eAAe,gBAAgB;CAC7C,MAAM,UAAU,eAAe,MAAM,EAAE;AACvC,QAAO,OAAO,UAAU,SAAS,KAAK,mBAAmB"}
1
+ {"version":3,"file":"utils.mjs","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import semver from 'semver';\n\nexport const MIN_NODE_VERSION = '24.0.0';\n\nexport function isVersionValid(processVersion) {\n const version = processVersion.slice(1);\n return semver.satisfies(version, `>=${MIN_NODE_VERSION}`);\n}\n"],"mappings":";;AAEA,IAAa,mBAAmB;AAEhC,SAAgB,eAAe,gBAAgB;CAC7C,MAAM,UAAU,eAAe,MAAM,CAAC;CACtC,OAAO,OAAO,UAAU,SAAS,KAAK,kBAAkB;AAC1D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/cli",
3
- "version": "9.0.0-next-9.17",
3
+ "version": "9.0.0-next-9.19",
4
4
  "author": {
5
5
  "name": "Juan Picado",
6
6
  "email": "juanpicado19@gmail.com"
@@ -37,19 +37,21 @@
37
37
  "main": "./build/index.js",
38
38
  "types": "build/index.d.ts",
39
39
  "dependencies": {
40
- "@verdaccio/config": "9.0.0-next-9.17",
41
- "@verdaccio/core": "9.0.0-next-9.17",
42
- "@verdaccio/logger": "9.0.0-next-9.17",
43
- "@verdaccio/node-api": "9.0.0-next-9.17",
44
- "@verdaccio/server": "9.0.0-next-9.17",
40
+ "@verdaccio/config": "9.0.0-next-9.19",
41
+ "@verdaccio/core": "9.0.0-next-9.19",
42
+ "@verdaccio/logger": "9.0.0-next-9.19",
43
+ "@verdaccio/node-api": "9.0.0-next-9.19",
44
+ "@verdaccio/server": "9.0.0-next-9.19",
45
45
  "clipanion": "4.0.0-rc.4",
46
46
  "envinfo": "7.19.0",
47
- "semver": "7.7.4"
47
+ "semver": "7.8.1",
48
+ "tsx": "4.21.0"
48
49
  },
49
50
  "devDependencies": {
50
- "@verdaccio/types": "14.0.0-next-9.8",
51
- "ts-node": "10.9.2",
52
- "vitest": "4.1.0"
51
+ "@verdaccio/types": "14.0.0-next-9.10",
52
+ "rimraf": "6.1.3",
53
+ "vite": "8.0.14",
54
+ "vitest": "4.1.7"
53
55
  },
54
56
  "funding": {
55
57
  "type": "opencollective",
@@ -74,6 +76,6 @@
74
76
  "test": "vitest run",
75
77
  "watch": "vite build --watch",
76
78
  "build": "vite build",
77
- "start": "ts-node src/index.ts"
79
+ "start": "tsx src/index.ts"
78
80
  }
79
81
  }