@pnpm/plugin-commands-doctor 1.0.0

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 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-2022 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-doctor
2
+
3
+ > pnpm commands for checks of known common issues
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@pnpm/plugin-commands-doctor.svg)](https://www.npmjs.com/package/@pnpm/plugin-commands-doctor)
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ pnpm add @pnpm/plugin-commands-doctor
11
+ ```
12
+
13
+ ## License
14
+
15
+ MIT
@@ -0,0 +1,7 @@
1
+ import { Config } from '@pnpm/config';
2
+ export declare const rcOptionsTypes: typeof cliOptionsTypes;
3
+ export declare function cliOptionsTypes(): {};
4
+ export declare const shorthands: {};
5
+ export declare const commandNames: string[];
6
+ export declare function help(): string;
7
+ export declare function handler(opts: Pick<Config, 'failedToLoadBuiltInConfig'>): Promise<void>;
package/lib/doctor.js ADDED
@@ -0,0 +1,36 @@
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.shorthands = exports.cliOptionsTypes = exports.rcOptionsTypes = void 0;
7
+ const render_help_1 = __importDefault(require("render-help"));
8
+ const cli_utils_1 = require("@pnpm/cli-utils");
9
+ const logger_1 = require("@pnpm/logger");
10
+ exports.rcOptionsTypes = cliOptionsTypes;
11
+ function cliOptionsTypes() {
12
+ return {};
13
+ }
14
+ exports.cliOptionsTypes = cliOptionsTypes;
15
+ exports.shorthands = {};
16
+ exports.commandNames = ['doctor'];
17
+ function help() {
18
+ return (0, render_help_1.default)({
19
+ description: 'Checks for known common issues.',
20
+ url: (0, cli_utils_1.docsUrl)('doctor'),
21
+ usages: ['pnpm doctor [options]'],
22
+ });
23
+ }
24
+ exports.help = help;
25
+ async function handler(opts) {
26
+ const { failedToLoadBuiltInConfig } = opts;
27
+ if (failedToLoadBuiltInConfig) {
28
+ // If true, means loading npm builtin config failed. Then there may have a prefix error, related: https://github.com/pnpm/pnpm/issues/5404
29
+ logger_1.logger.warn({
30
+ message: 'Load npm builtin configs failed. If the prefix builtin config does not work, you can use "pnpm config ls" to show builtin configs. And then use "pnpm config --global set <key> <value>" to migrate configs from builtin to global.',
31
+ prefix: process.cwd(),
32
+ });
33
+ }
34
+ }
35
+ exports.handler = handler;
36
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAoC;AACpC,+CAAyC;AACzC,yCAAqC;AAGxB,QAAA,cAAc,GAAG,eAAe,CAAA;AAE7C,SAAgB,eAAe;IAC7B,OAAO,EAAE,CAAA;AACX,CAAC;AAFD,0CAEC;AAEY,QAAA,UAAU,GAAG,EAAE,CAAA;AAEf,QAAA,YAAY,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEtC,SAAgB,IAAI;IAClB,OAAO,IAAA,qBAAU,EAAC;QAChB,WAAW,EAAE,iCAAiC;QAC9C,GAAG,EAAE,IAAA,mBAAO,EAAC,QAAQ,CAAC;QACtB,MAAM,EAAE,CAAC,uBAAuB,CAAC;KAClC,CAAC,CAAA;AACJ,CAAC;AAND,oBAMC;AAEM,KAAK,UAAU,OAAO,CAC3B,IAA+C;IAE/C,MAAM,EAAE,yBAAyB,EAAE,GAAG,IAAI,CAAA;IAC1C,IAAI,yBAAyB,EAAE;QAC7B,0IAA0I;QAC1I,eAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,qOAAqO;YAC9O,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE;SACtB,CAAC,CAAA;KACH;AACH,CAAC;AAXD,0BAWC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import * as doctor from './doctor';
2
+ export { doctor };
package/lib/index.js ADDED
@@ -0,0 +1,29 @@
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.doctor = void 0;
27
+ const doctor = __importStar(require("./doctor"));
28
+ exports.doctor = doctor;
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAkC;AAEzB,wBAAM"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@pnpm/plugin-commands-doctor",
3
+ "version": "1.0.0",
4
+ "description": "Commands for checks of known common issues ",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "files": [
8
+ "lib",
9
+ "!*.map"
10
+ ],
11
+ "engines": {
12
+ "node": ">=14.6"
13
+ },
14
+ "repository": "https://github.com/pnpm/pnpm/blob/main/packages/plugin-commands-doctor",
15
+ "keywords": [
16
+ "pnpm7",
17
+ "pnpm",
18
+ "doctor"
19
+ ],
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/pnpm/pnpm/issues"
23
+ },
24
+ "homepage": "https://github.com/pnpm/pnpm/blob/main/packages/plugin-commands-doctor#readme",
25
+ "dependencies": {
26
+ "@pnpm/cli-utils": "1.0.2",
27
+ "@pnpm/config": "16.0.2",
28
+ "render-help": "^1.0.2"
29
+ },
30
+ "peerDependencies": {
31
+ "@pnpm/logger": "^5.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@pnpm/plugin-commands-doctor": "1.0.0"
35
+ },
36
+ "funding": "https://opencollective.com/pnpm",
37
+ "exports": {
38
+ ".": "./lib/index.js"
39
+ },
40
+ "scripts": {
41
+ "lint": "eslint src/**/*.ts test/**/*.ts",
42
+ "_test": "jest",
43
+ "test": "pnpm run compile && pnpm run _test",
44
+ "compile": "tsc --build && pnpm run lint --fix"
45
+ }
46
+ }