@pnpm/plugin-commands-config 0.0.0-20230605-20230605142810
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/LICENSE +22 -0
- package/README.md +15 -0
- package/lib/ConfigCommandOptions.d.ts +5 -0
- package/lib/ConfigCommandOptions.js +3 -0
- package/lib/ConfigCommandOptions.js.map +1 -0
- package/lib/config.d.ts +10 -0
- package/lib/config.js +118 -0
- package/lib/config.js.map +1 -0
- package/lib/configGet.d.ts +2 -0
- package/lib/configGet.js +9 -0
- package/lib/configGet.js.map +1 -0
- package/lib/configList.d.ts +2 -0
- package/lib/configList.js +17 -0
- package/lib/configList.js.map +1 -0
- package/lib/configSet.d.ts +2 -0
- package/lib/configSet.js +50 -0
- package/lib/configSet.js.map +1 -0
- package/lib/get.d.ts +7 -0
- package/lib/get.js +36 -0
- package/lib/get.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +33 -0
- package/lib/index.js.map +1 -0
- package/lib/set.d.ts +7 -0
- package/lib/set.js +36 -0
- package/lib/set.js.map +1 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
|
|
4
|
+
Copyright (c) 2016-2023 Zoltan Kochan and other contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @pnpm/plugin-commands-config
|
|
2
|
+
|
|
3
|
+
> Commands for reading and writing settings to/from config files
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@pnpm/plugin-commands-config)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @pnpm/plugin-commands-config
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigCommandOptions.js","sourceRoot":"","sources":["../src/ConfigCommandOptions.ts"],"names":[],"mappings":""}
|
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ConfigCommandOptions } from './ConfigCommandOptions';
|
|
2
|
+
export declare function rcOptionsTypes(): {};
|
|
3
|
+
export declare function cliOptionsTypes(): {
|
|
4
|
+
global: BooleanConstructor;
|
|
5
|
+
location: string[];
|
|
6
|
+
json: BooleanConstructor;
|
|
7
|
+
};
|
|
8
|
+
export declare const commandNames: string[];
|
|
9
|
+
export declare function help(): string;
|
|
10
|
+
export declare function handler(opts: ConfigCommandOptions, params: string[]): Promise<any>;
|
package/lib/config.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.handler = exports.help = exports.commandNames = exports.cliOptionsTypes = exports.rcOptionsTypes = void 0;
|
|
7
|
+
const cli_utils_1 = require("@pnpm/cli-utils");
|
|
8
|
+
const error_1 = require("@pnpm/error");
|
|
9
|
+
const render_help_1 = __importDefault(require("render-help"));
|
|
10
|
+
const configGet_1 = require("./configGet");
|
|
11
|
+
const configSet_1 = require("./configSet");
|
|
12
|
+
const configList_1 = require("./configList");
|
|
13
|
+
function rcOptionsTypes() {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
exports.rcOptionsTypes = rcOptionsTypes;
|
|
17
|
+
function cliOptionsTypes() {
|
|
18
|
+
return {
|
|
19
|
+
global: Boolean,
|
|
20
|
+
location: ['global', 'project'],
|
|
21
|
+
json: Boolean,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.cliOptionsTypes = cliOptionsTypes;
|
|
25
|
+
exports.commandNames = ['config', 'c'];
|
|
26
|
+
function help() {
|
|
27
|
+
return (0, render_help_1.default)({
|
|
28
|
+
description: 'Manage the pnpm configuration files.',
|
|
29
|
+
descriptionLists: [
|
|
30
|
+
{
|
|
31
|
+
title: 'Commands',
|
|
32
|
+
list: [
|
|
33
|
+
{
|
|
34
|
+
description: 'Set the config key to the value provided',
|
|
35
|
+
name: 'set',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
description: 'Print the config value for the provided key',
|
|
39
|
+
name: 'get',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
description: 'Remove the config key from the config file',
|
|
43
|
+
name: 'delete',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
description: 'Show all the config settings',
|
|
47
|
+
name: 'list',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: 'Options',
|
|
53
|
+
list: [
|
|
54
|
+
{
|
|
55
|
+
description: 'Sets the configuration in the global config file',
|
|
56
|
+
name: '--global',
|
|
57
|
+
shortAlias: '-g',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
description: 'When set to "project", the .npmrc file at the nearest package.json will be used',
|
|
61
|
+
name: '--location <project|global>',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
description: 'Show all the config settings in JSON format',
|
|
65
|
+
name: '--json',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
url: (0, cli_utils_1.docsUrl)('config'),
|
|
71
|
+
usages: [
|
|
72
|
+
'pnpm config set <key> <value>',
|
|
73
|
+
'pnpm config get <key>',
|
|
74
|
+
'pnpm config delete <key>',
|
|
75
|
+
'pnpm config list',
|
|
76
|
+
'pnpm config list --json',
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
exports.help = help;
|
|
81
|
+
async function handler(opts, params) {
|
|
82
|
+
if (params.length === 0) {
|
|
83
|
+
throw new error_1.PnpmError('CONFIG_NO_SUBCOMMAND', 'Please specify the subcommand', {
|
|
84
|
+
hint: help(),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (opts.location) {
|
|
88
|
+
opts.global = opts.location === 'global';
|
|
89
|
+
}
|
|
90
|
+
else if (opts.cliOptions['global'] == null) {
|
|
91
|
+
opts.global = true;
|
|
92
|
+
}
|
|
93
|
+
switch (params[0]) {
|
|
94
|
+
case 'set': {
|
|
95
|
+
let [key, value] = params.slice(1);
|
|
96
|
+
if (value == null) {
|
|
97
|
+
const parts = key.split('=');
|
|
98
|
+
key = parts.shift();
|
|
99
|
+
value = parts.join('=');
|
|
100
|
+
}
|
|
101
|
+
return (0, configSet_1.configSet)(opts, key, value ?? '');
|
|
102
|
+
}
|
|
103
|
+
case 'get': {
|
|
104
|
+
return (0, configGet_1.configGet)(opts, params[1]);
|
|
105
|
+
}
|
|
106
|
+
case 'delete': {
|
|
107
|
+
return (0, configSet_1.configSet)(opts, params[1], null);
|
|
108
|
+
}
|
|
109
|
+
case 'list': {
|
|
110
|
+
return (0, configList_1.configList)(opts);
|
|
111
|
+
}
|
|
112
|
+
default: {
|
|
113
|
+
throw new error_1.PnpmError('CONFIG_UNKNOWN_SUBCOMMAND', 'This subcommand is not known');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.handler = handler;
|
|
118
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"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"}
|
package/lib/configGet.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configGet = void 0;
|
|
4
|
+
function configGet(opts, key) {
|
|
5
|
+
const config = opts.rawConfig[key];
|
|
6
|
+
return typeof config === 'boolean' ? config.toString() : config;
|
|
7
|
+
}
|
|
8
|
+
exports.configGet = configGet;
|
|
9
|
+
//# sourceMappingURL=configGet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configGet.js","sourceRoot":"","sources":["../src/configGet.ts"],"names":[],"mappings":";;;AAEA,SAAgB,SAAS,CAAE,IAA0B,EAAE,GAAW;IAChE,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAClC,OAAO,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AACjE,CAAC;AAHD,8BAGC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configList = void 0;
|
|
7
|
+
const ini_1 = require("ini");
|
|
8
|
+
const sort_keys_1 = __importDefault(require("sort-keys"));
|
|
9
|
+
async function configList(opts) {
|
|
10
|
+
const sortedConfig = (0, sort_keys_1.default)(opts.rawConfig);
|
|
11
|
+
if (opts.json) {
|
|
12
|
+
return JSON.stringify(sortedConfig, null, 2);
|
|
13
|
+
}
|
|
14
|
+
return (0, ini_1.encode)(sortedConfig);
|
|
15
|
+
}
|
|
16
|
+
exports.configList = configList;
|
|
17
|
+
//# sourceMappingURL=configList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configList.js","sourceRoot":"","sources":["../src/configList.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA4B;AAC5B,0DAAgC;AAGzB,KAAK,UAAU,UAAU,CAAE,IAA0B;IAC1D,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC7C,IAAI,IAAI,CAAC,IAAI,EAAE;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;KAC7C;IACD,OAAO,IAAA,YAAM,EAAC,YAAY,CAAC,CAAA;AAC7B,CAAC;AAND,gCAMC"}
|
package/lib/configSet.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configSet = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const run_npm_1 = require("@pnpm/run-npm");
|
|
9
|
+
const read_ini_file_1 = require("read-ini-file");
|
|
10
|
+
const write_ini_file_1 = require("write-ini-file");
|
|
11
|
+
async function configSet(opts, key, value) {
|
|
12
|
+
const configPath = opts.global ? path_1.default.join(opts.configDir, 'rc') : path_1.default.join(opts.dir, '.npmrc');
|
|
13
|
+
if (opts.global && settingShouldFallBackToNpm(key)) {
|
|
14
|
+
const _runNpm = run_npm_1.runNpm.bind(null, opts.npmPath);
|
|
15
|
+
if (value == null) {
|
|
16
|
+
_runNpm(['config', 'delete', key]);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
_runNpm(['config', 'set', `${key}=${value}`]);
|
|
20
|
+
}
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const settings = await safeReadIniFile(configPath);
|
|
24
|
+
if (value == null) {
|
|
25
|
+
if (settings[key] == null)
|
|
26
|
+
return;
|
|
27
|
+
delete settings[key];
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
settings[key] = value;
|
|
31
|
+
}
|
|
32
|
+
await (0, write_ini_file_1.writeIniFile)(configPath, settings);
|
|
33
|
+
}
|
|
34
|
+
exports.configSet = configSet;
|
|
35
|
+
function settingShouldFallBackToNpm(key) {
|
|
36
|
+
return (['registry', '_auth', '_authToken', 'username', '_password'].includes(key) ||
|
|
37
|
+
key[0] === '@' ||
|
|
38
|
+
key.startsWith('//'));
|
|
39
|
+
}
|
|
40
|
+
async function safeReadIniFile(configPath) {
|
|
41
|
+
try {
|
|
42
|
+
return await (0, read_ini_file_1.readIniFile)(configPath);
|
|
43
|
+
}
|
|
44
|
+
catch (err) { // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
45
|
+
if (err.code === 'ENOENT')
|
|
46
|
+
return {};
|
|
47
|
+
throw err;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=configSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSet.js","sourceRoot":"","sources":["../src/configSet.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,2CAAsC;AACtC,iDAA2C;AAC3C,mDAA6C;AAGtC,KAAK,UAAU,SAAS,CAAE,IAA0B,EAAE,GAAW,EAAE,KAAoB;IAC5F,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAChG,IAAI,IAAI,CAAC,MAAM,IAAI,0BAA0B,CAAC,GAAG,CAAC,EAAE;QAClD,MAAM,OAAO,GAAG,gBAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/C,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAA;SACnC;aAAM;YACL,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAA;SAC9C;QACD,OAAM;KACP;IACD,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAA;IAClD,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI;YAAE,OAAM;QACjC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAA;KACrB;SAAM;QACL,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;KACtB;IACD,MAAM,IAAA,6BAAY,EAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;AAC1C,CAAC;AAnBD,8BAmBC;AAED,SAAS,0BAA0B,CAAE,GAAW;IAC9C,OAAO,CACL,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC1E,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;QACd,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CACrB,CAAA;AACH,CAAC;AAED,KAAK,UAAU,eAAe,CAAE,UAAkB;IAChD,IAAI;QACF,OAAO,MAAM,IAAA,2BAAW,EAAC,UAAU,CAA4B,CAAA;KAChE;IAAC,OAAO,GAAQ,EAAE,EAAE,yDAAyD;QAC5E,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAA;QACpC,MAAM,GAAG,CAAA;KACV;AACH,CAAC"}
|
package/lib/get.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as configCmd from './config';
|
|
2
|
+
import { type ConfigCommandOptions } from './ConfigCommandOptions';
|
|
3
|
+
export declare const rcOptionsTypes: typeof configCmd.rcOptionsTypes;
|
|
4
|
+
export declare const cliOptionsTypes: typeof configCmd.cliOptionsTypes;
|
|
5
|
+
export declare const help: typeof configCmd.help;
|
|
6
|
+
export declare const commandNames: string[];
|
|
7
|
+
export declare function handler(opts: ConfigCommandOptions, params: string[]): Promise<any>;
|
package/lib/get.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.handler = exports.commandNames = exports.help = exports.cliOptionsTypes = exports.rcOptionsTypes = void 0;
|
|
27
|
+
const configCmd = __importStar(require("./config"));
|
|
28
|
+
exports.rcOptionsTypes = configCmd.rcOptionsTypes;
|
|
29
|
+
exports.cliOptionsTypes = configCmd.cliOptionsTypes;
|
|
30
|
+
exports.help = configCmd.help;
|
|
31
|
+
exports.commandNames = ['get'];
|
|
32
|
+
async function handler(opts, params) {
|
|
33
|
+
return configCmd.handler(opts, ['get', ...params]);
|
|
34
|
+
}
|
|
35
|
+
exports.handler = handler;
|
|
36
|
+
//# sourceMappingURL=get.js.map
|
package/lib/get.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../src/get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AAGxB,QAAA,cAAc,GAAG,SAAS,CAAC,cAAc,CAAA;AACzC,QAAA,eAAe,GAAG,SAAS,CAAC,eAAe,CAAA;AAC3C,QAAA,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;AAErB,QAAA,YAAY,GAAG,CAAC,KAAK,CAAC,CAAA;AAE5B,KAAK,UAAU,OAAO,CAAE,IAA0B,EAAE,MAAgB;IACzE,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,CAAA;AACpD,CAAC;AAFD,0BAEC"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.setCommand = exports.getCommand = exports.config = void 0;
|
|
27
|
+
const config = __importStar(require("./config"));
|
|
28
|
+
exports.config = config;
|
|
29
|
+
const getCommand = __importStar(require("./get"));
|
|
30
|
+
exports.getCommand = getCommand;
|
|
31
|
+
const setCommand = __importStar(require("./set"));
|
|
32
|
+
exports.setCommand = setCommand;
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAIzB,wBAAM;AAHf,kDAAmC;AAGlB,gCAAU;AAF3B,kDAAmC;AAEN,gCAAU"}
|
package/lib/set.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as configCmd from './config';
|
|
2
|
+
import { type ConfigCommandOptions } from './ConfigCommandOptions';
|
|
3
|
+
export declare const rcOptionsTypes: typeof configCmd.rcOptionsTypes;
|
|
4
|
+
export declare const cliOptionsTypes: typeof configCmd.cliOptionsTypes;
|
|
5
|
+
export declare const help: typeof configCmd.help;
|
|
6
|
+
export declare const commandNames: string[];
|
|
7
|
+
export declare function handler(opts: ConfigCommandOptions, params: string[]): Promise<any>;
|
package/lib/set.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.handler = exports.commandNames = exports.help = exports.cliOptionsTypes = exports.rcOptionsTypes = void 0;
|
|
27
|
+
const configCmd = __importStar(require("./config"));
|
|
28
|
+
exports.rcOptionsTypes = configCmd.rcOptionsTypes;
|
|
29
|
+
exports.cliOptionsTypes = configCmd.cliOptionsTypes;
|
|
30
|
+
exports.help = configCmd.help;
|
|
31
|
+
exports.commandNames = ['set'];
|
|
32
|
+
async function handler(opts, params) {
|
|
33
|
+
return configCmd.handler(opts, ['set', ...params]);
|
|
34
|
+
}
|
|
35
|
+
exports.handler = handler;
|
|
36
|
+
//# sourceMappingURL=set.js.map
|
package/lib/set.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../src/set.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AAGxB,QAAA,cAAc,GAAG,SAAS,CAAC,cAAc,CAAA;AACzC,QAAA,eAAe,GAAG,SAAS,CAAC,eAAe,CAAA;AAC3C,QAAA,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;AAErB,QAAA,YAAY,GAAG,CAAC,KAAK,CAAC,CAAA;AAE5B,KAAK,UAAU,OAAO,CAAE,IAA0B,EAAE,MAAgB;IACzE,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,CAAA;AACpD,CAAC;AAFD,0BAEC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pnpm/plugin-commands-config",
|
|
3
|
+
"version": "0.0.0-20230605-20230605142810",
|
|
4
|
+
"description": "Commands for reading and writing settings to/from config files",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"!*.map"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=16.14"
|
|
13
|
+
},
|
|
14
|
+
"repository": "https://github.com/pnpm/pnpm/blob/main/config/plugin-commands-config",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"pnpm8",
|
|
17
|
+
"pnpm",
|
|
18
|
+
"config"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/pnpm/pnpm/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/pnpm/pnpm/blob/main/config/plugin-commands-config#readme",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"ini": "4.1.1",
|
|
27
|
+
"read-ini-file": "4.0.0",
|
|
28
|
+
"render-help": "^1.0.3",
|
|
29
|
+
"sort-keys": "^4.2.0",
|
|
30
|
+
"write-ini-file": "4.0.1",
|
|
31
|
+
"@pnpm/run-npm": "6.0.0",
|
|
32
|
+
"@pnpm/error": "0.0.0-20230605-20230605142810",
|
|
33
|
+
"@pnpm/cli-utils": "0.0.0-20230605-20230605142810",
|
|
34
|
+
"@pnpm/config": "0.0.0-20230605-20230605142810"
|
|
35
|
+
},
|
|
36
|
+
"funding": "https://opencollective.com/pnpm",
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@pnpm/logger": "^5.0.0",
|
|
39
|
+
"@types/ini": "1.3.31",
|
|
40
|
+
"@pnpm/plugin-commands-config": "0.0.0-20230605-20230605142810",
|
|
41
|
+
"@pnpm/prepare": "0.0.0-20230605-20230605142810"
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": "./lib/index.js"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
48
|
+
"_test": "jest",
|
|
49
|
+
"test": "pnpm run compile && pnpm run _test",
|
|
50
|
+
"compile": "tsc --build && pnpm run lint --fix"
|
|
51
|
+
}
|
|
52
|
+
}
|