@verdaccio/cli 6.0.0-6-next.37 → 6.0.0-6-next.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/CHANGELOG.md +11 -0
- package/build/commands/init.js +8 -7
- package/build/commands/init.js.map +1 -1
- package/package.json +5 -5
- package/src/commands/init.ts +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @verdaccio/cli
|
|
2
2
|
|
|
3
|
+
## 6.0.0-6-next.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b849128d: fix: handle upload scoped tarball
|
|
8
|
+
- Updated dependencies [b849128d]
|
|
9
|
+
- @verdaccio/core@6.0.0-6-next.8
|
|
10
|
+
- @verdaccio/config@6.0.0-6-next.17
|
|
11
|
+
- @verdaccio/logger@6.0.0-6-next.14
|
|
12
|
+
- @verdaccio/node-api@6.0.0-6-next.36
|
|
13
|
+
|
|
3
14
|
## 6.0.0-6-next.37
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/build/commands/init.js
CHANGED
|
@@ -9,6 +9,8 @@ var _clipanion = require("clipanion");
|
|
|
9
9
|
|
|
10
10
|
var _config = require("@verdaccio/config");
|
|
11
11
|
|
|
12
|
+
var _core = require("@verdaccio/core");
|
|
13
|
+
|
|
12
14
|
var _logger = require("@verdaccio/logger");
|
|
13
15
|
|
|
14
16
|
var _nodeApi = require("@verdaccio/node-api");
|
|
@@ -44,16 +46,15 @@ class InitCommand extends _clipanion.Command {
|
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
initLogger(logConfig) {
|
|
47
|
-
|
|
49
|
+
// @ts-expect-error
|
|
50
|
+
if (logConfig.logs) {
|
|
48
51
|
// @ts-expect-error
|
|
49
|
-
|
|
50
|
-
throw Error('the property config "logs" property is longer supported, rename to "log" and use object instead');
|
|
51
|
-
}
|
|
52
|
+
logConfig.log = logConfig.logs;
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
} catch (err) {
|
|
55
|
-
throw new Error(err);
|
|
54
|
+
_core.warningUtils.emit(_core.warningUtils.Codes.VERWAR002);
|
|
56
55
|
}
|
|
56
|
+
|
|
57
|
+
(0, _logger.setup)(logConfig.log);
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
async execute() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","names":["DEFAULT_PROCESS_NAME","InitCommand","Command","paths","Default","port","Option","String","description","usage","Usage","details","examples","config","initLogger","logConfig","logs","
|
|
1
|
+
{"version":3,"file":"init.js","names":["DEFAULT_PROCESS_NAME","InitCommand","Command","paths","Default","port","Option","String","description","usage","Usage","details","examples","config","initLogger","logConfig","logs","log","warningUtils","emit","Codes","VERWAR002","setup","execute","configPathLocation","findConfigFile","configParsed","parseConfigFile","web","process","title","version","name","require","initServer","logger","info","err","console","error","exit"],"sources":["../../src/commands/init.ts"],"sourcesContent":["import { Command, Option } from 'clipanion';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { warningUtils } from '@verdaccio/core';\nimport { logger, setup } from '@verdaccio/logger';\nimport { initServer } from '@verdaccio/node-api';\nimport { 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 // eslint-disable-next-line\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 initLogger(logConfig: ConfigYaml) {\n // @ts-expect-error\n if (logConfig.logs) {\n // @ts-expect-error\n logConfig.log = logConfig.logs;\n warningUtils.emit(warningUtils.Codes.VERWAR002);\n }\n 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 this.initLogger(configParsed);\n const { web } = configParsed;\n\n process.title = web?.title || DEFAULT_PROCESS_NAME;\n\n const { version, name } = require('../../package.json');\n\n await initServer(configParsed, this.port as string, version, name);\n logger.info('server started');\n } catch (err: any) {\n console.error(err);\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AAGO,MAAMA,oBAA4B,GAAG,WAArC;;;AAEA,MAAMC,WAAN,SAA0BC,kBAA1B,CAAkC;EACpB,OAALC,KAAK,GAAG,CAACD,kBAAA,CAAQE,OAAT,CAAH;EAEXC,IAAI,GAAGC,iBAAA,CAAOC,MAAP,CAAc,uBAAd,EAAuC;IACpDC,WAAW,EAAE;EADuC,CAAvC,CAAH,CAH2B,CAOvC;;EACY,OAALC,KAAK,GAAGP,kBAAA,CAAQQ,KAAR,CAAc;IAC3BF,WAAW,EAAG,mBADa;IAE3BG,OAAO,EAAG;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAd+B;IAe3BC,QAAQ,EAAE,CACR,CAAE,gDAAF,EAAoD,WAApD,CADQ,EAER,CAAE,kCAAF,EAAsC,yBAAtC,CAFQ,EAGR,CACG,kFADH,EAEG,qDAFH,CAHQ;EAfiB,CAAd,CAAH;EAyBJC,MAAM,GAAGP,iBAAA,CAAOC,MAAP,CAAc,aAAd,EAA6B;IAC5CC,WAAW,EAAE;EAD+B,CAA7B,CAAH;;EAINM,UAAU,CAACC,SAAD,EAAwB;IACxC;IACA,IAAIA,SAAS,CAACC,IAAd,EAAoB;MAClB;MACAD,SAAS,CAACE,GAAV,GAAgBF,SAAS,CAACC,IAA1B;;MACAE,kBAAA,CAAaC,IAAb,CAAkBD,kBAAA,CAAaE,KAAb,CAAmBC,SAArC;IACD;;IACD,IAAAC,aAAA,EAAMP,SAAS,CAACE,GAAhB;EACD;;EAEmB,MAAPM,OAAO,GAAG;IACrB,IAAI;MACF,MAAMC,kBAAkB,GAAG,IAAAC,sBAAA,EAAe,KAAKZ,MAApB,CAA3B;MACA,MAAMa,YAAY,GAAG,IAAAC,uBAAA,EAAgBH,kBAAhB,CAArB;MACA,KAAKV,UAAL,CAAgBY,YAAhB;MACA,MAAM;QAAEE;MAAF,IAAUF,YAAhB;MAEAG,OAAO,CAACC,KAAR,GAAgB,CAAAF,GAAG,SAAH,IAAAA,GAAG,WAAH,YAAAA,GAAG,CAAEE,KAAL,KAAc9B,oBAA9B;;MAEA,MAAM;QAAE+B,OAAF;QAAWC;MAAX,IAAoBC,OAAO,CAAC,oBAAD,CAAjC;;MAEA,MAAM,IAAAC,mBAAA,EAAWR,YAAX,EAAyB,KAAKrB,IAA9B,EAA8C0B,OAA9C,EAAuDC,IAAvD,CAAN;;MACAG,cAAA,CAAOC,IAAP,CAAY,gBAAZ;IACD,CAZD,CAYE,OAAOC,GAAP,EAAiB;MACjBC,OAAO,CAACC,KAAR,CAAcF,GAAd;MACAR,OAAO,CAACW,IAAR,CAAa,CAAb;IACD;EACF;;AAhEsC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/cli",
|
|
3
|
-
"version": "6.0.0-6-next.
|
|
3
|
+
"version": "6.0.0-6-next.38",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Juan Picado",
|
|
6
6
|
"email": "juanpicado19@gmail.com"
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"main": "./build/index.js",
|
|
35
35
|
"types": "build/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@verdaccio/core": "6.0.0-6-next.
|
|
38
|
-
"@verdaccio/config": "6.0.0-6-next.
|
|
39
|
-
"@verdaccio/logger": "6.0.0-6-next.
|
|
40
|
-
"@verdaccio/node-api": "6.0.0-6-next.
|
|
37
|
+
"@verdaccio/core": "6.0.0-6-next.8",
|
|
38
|
+
"@verdaccio/config": "6.0.0-6-next.17",
|
|
39
|
+
"@verdaccio/logger": "6.0.0-6-next.14",
|
|
40
|
+
"@verdaccio/node-api": "6.0.0-6-next.36",
|
|
41
41
|
"clipanion": "3.1.0",
|
|
42
42
|
"envinfo": "7.8.1",
|
|
43
43
|
"kleur": "3.0.3",
|
package/src/commands/init.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'clipanion';
|
|
2
2
|
|
|
3
3
|
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
|
4
|
+
import { warningUtils } from '@verdaccio/core';
|
|
4
5
|
import { logger, setup } from '@verdaccio/logger';
|
|
5
6
|
import { initServer } from '@verdaccio/node-api';
|
|
6
7
|
import { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';
|
|
@@ -45,17 +46,13 @@ export class InitCommand extends Command {
|
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
private initLogger(logConfig: ConfigYaml) {
|
|
48
|
-
|
|
49
|
+
// @ts-expect-error
|
|
50
|
+
if (logConfig.logs) {
|
|
49
51
|
// @ts-expect-error
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'the property config "logs" property is longer supported, rename to "log" and use object instead'
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
setup(logConfig.log as LoggerConfigItem);
|
|
56
|
-
} catch (err: any) {
|
|
57
|
-
throw new Error(err);
|
|
52
|
+
logConfig.log = logConfig.logs;
|
|
53
|
+
warningUtils.emit(warningUtils.Codes.VERWAR002);
|
|
58
54
|
}
|
|
55
|
+
setup(logConfig.log as LoggerConfigItem);
|
|
59
56
|
}
|
|
60
57
|
|
|
61
58
|
public async execute() {
|