@salesforce/plugin-info 2.6.51 → 2.6.52-dev.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/README.md +15 -15
- package/lib/commands/doctor.d.ts +6 -6
- package/lib/commands/doctor.js +62 -65
- package/lib/commands/doctor.js.map +1 -1
- package/lib/commands/info/releasenotes/display.d.ts +3 -3
- package/lib/commands/info/releasenotes/display.js +41 -45
- package/lib/commands/info/releasenotes/display.js.map +1 -1
- package/lib/constants.js +1 -4
- package/lib/constants.js.map +1 -1
- package/lib/diagnostics.d.ts +1 -1
- package/lib/diagnostics.js +15 -14
- package/lib/diagnostics.js.map +1 -1
- package/lib/doctor.d.ts +1 -1
- package/lib/doctor.js +30 -27
- package/lib/doctor.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -7
- package/lib/index.js.map +1 -1
- package/lib/shared/getDistTagVersion.d.ts +5 -2
- package/lib/shared/getDistTagVersion.js +10 -10
- package/lib/shared/getDistTagVersion.js.map +1 -1
- package/lib/shared/getInfoConfig.d.ts +8 -5
- package/lib/shared/getInfoConfig.js +6 -9
- package/lib/shared/getInfoConfig.js.map +1 -1
- package/lib/shared/getReleaseNotes.d.ts +5 -2
- package/lib/shared/getReleaseNotes.js +11 -14
- package/lib/shared/getReleaseNotes.js.map +1 -1
- package/lib/shared/index.d.ts +7 -0
- package/lib/shared/index.js +17 -0
- package/lib/shared/index.js.map +1 -0
- package/lib/shared/parseReleaseNotes.d.ts +5 -2
- package/lib/shared/parseReleaseNotes.js +10 -13
- package/lib/shared/parseReleaseNotes.js.map +1 -1
- package/messages/doctor.md +2 -6
- package/oclif.lock +8453 -0
- package/oclif.manifest.json +100 -57
- package/package.json +31 -53
- package/lib/hooks/init/init_doctor.d.ts +0 -3
- package/lib/hooks/init/init_doctor.js +0 -23
- package/lib/hooks/init/init_doctor.js.map +0 -1
package/lib/diagnostics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAevD,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC;AAEjF;;;;;;;;GAQG;AACH,MAAM,OAAO,WAAW;IAGc;IAA0B;IAFtD,SAAS,CAAoB;IAErC,YAAoC,MAAgB,EAAU,MAAyB;QAAnD,WAAM,GAAN,MAAM,CAAU;QAAU,WAAM,GAAN,MAAM,CAAmB;QACrF,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,GAAG;QACR,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAA6C,CAAC;QAChG,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED,6DAA6D;IAC7D,wCAAwC;IACxC,EAAE;IACF,wDAAwD;IACxD,sDAAsD;IACtD,EAAE;IACF,6DAA6D;IAE7D;;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,SAAS,CAAC,GAAG,CAAC;YACzC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACrF;QACD,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,iBAAiB;QAC5B,MAAM,QAAQ,GAAG,mBAAmB,CAAC;QACrC,IAAI,MAAM,GAA+B,MAAM,CAAC;QAEhD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QAC7C,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;QAC/D,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAC3B,MAAM,GAAG,MAAM,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;QACH,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAChF,CAAC;CACF"}
|
package/lib/doctor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnyJson, KeyValue } from '@salesforce/ts-types';
|
|
2
2
|
import { Interfaces } from '@oclif/core';
|
|
3
3
|
import { PluginVersionDetail } from '@oclif/core/lib/interfaces';
|
|
4
|
-
import { DiagnosticStatus } from './diagnostics';
|
|
4
|
+
import { DiagnosticStatus } from './diagnostics.js';
|
|
5
5
|
export interface SfDoctor {
|
|
6
6
|
addCommandName(commandName: string): void;
|
|
7
7
|
addDiagnosticStatus(status: DiagnosticStatus): void;
|
package/lib/doctor.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-info', 'doctor');
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import { join, dirname, basename } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
import { Messages, SfError } from '@salesforce/core';
|
|
11
|
+
import { Env, omit } from '@salesforce/kit';
|
|
12
|
+
import { Diagnostics } from './diagnostics.js';
|
|
13
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
14
|
+
const messages = Messages.loadMessages('@salesforce/plugin-info', 'doctor');
|
|
17
15
|
const PINNED_SUGGESTIONS = [
|
|
18
16
|
messages.getMessage('pinnedSuggestions.checkGitHubIssues'),
|
|
19
17
|
messages.getMessage('pinnedSuggestions.checkSfdcStatus'),
|
|
@@ -21,13 +19,20 @@ const PINNED_SUGGESTIONS = [
|
|
|
21
19
|
// private config from the CLI
|
|
22
20
|
// eslint-disable-next-line no-underscore-dangle
|
|
23
21
|
let __cliConfig;
|
|
24
|
-
class Doctor {
|
|
22
|
+
export class Doctor {
|
|
23
|
+
// singleton instance
|
|
24
|
+
static instance;
|
|
25
|
+
id;
|
|
26
|
+
// Contains all gathered data and results of diagnostics.
|
|
27
|
+
diagnosis;
|
|
28
|
+
stdoutWriteStream;
|
|
29
|
+
stderrWriteStream;
|
|
25
30
|
constructor(config) {
|
|
26
31
|
this.id = Date.now();
|
|
27
32
|
__cliConfig = config;
|
|
28
|
-
const sfdxEnvVars = new
|
|
29
|
-
const sfEnvVars = new
|
|
30
|
-
const cliConfig =
|
|
33
|
+
const sfdxEnvVars = new Env().entries().filter((e) => e[0].startsWith('SFDX_'));
|
|
34
|
+
const sfEnvVars = new Env().entries().filter((e) => e[0].startsWith('SF_'));
|
|
35
|
+
const cliConfig = omit(config, ['plugins', 'pjson', 'userPJSON', 'options']);
|
|
31
36
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
32
37
|
cliConfig.nodeEngine = config.pjson.engines.node;
|
|
33
38
|
const { pluginVersions, ...versionDetails } = config.versionDetails;
|
|
@@ -48,7 +53,7 @@ class Doctor {
|
|
|
48
53
|
*/
|
|
49
54
|
static getInstance() {
|
|
50
55
|
if (!Doctor.instance) {
|
|
51
|
-
throw new
|
|
56
|
+
throw new SfError(messages.getMessage('doctorNotInitializedError'), 'SfDoctorInitError');
|
|
52
57
|
}
|
|
53
58
|
return Doctor.instance;
|
|
54
59
|
}
|
|
@@ -67,7 +72,7 @@ class Doctor {
|
|
|
67
72
|
*/
|
|
68
73
|
static init(config) {
|
|
69
74
|
if (Doctor.instance) {
|
|
70
|
-
|
|
75
|
+
return Doctor.instance;
|
|
71
76
|
}
|
|
72
77
|
Doctor.instance = new this(config);
|
|
73
78
|
return Doctor.instance;
|
|
@@ -78,7 +83,7 @@ class Doctor {
|
|
|
78
83
|
* @returns An array of diagnostic promises.
|
|
79
84
|
*/
|
|
80
85
|
diagnose() {
|
|
81
|
-
return new
|
|
86
|
+
return new Diagnostics(this, __cliConfig).run();
|
|
82
87
|
}
|
|
83
88
|
/**
|
|
84
89
|
* Add a suggestion in the form of:
|
|
@@ -147,13 +152,13 @@ class Doctor {
|
|
|
147
152
|
}
|
|
148
153
|
writeStdout(contents) {
|
|
149
154
|
if (!this.stdoutWriteStream) {
|
|
150
|
-
throw new
|
|
155
|
+
throw new SfError(messages.getMessage('doctorNotInitializedError'), 'SfDoctorInitError');
|
|
151
156
|
}
|
|
152
157
|
return writeFile(this.stdoutWriteStream, contents);
|
|
153
158
|
}
|
|
154
159
|
writeStderr(contents) {
|
|
155
160
|
if (!this.stderrWriteStream) {
|
|
156
|
-
throw new
|
|
161
|
+
throw new SfError(messages.getMessage('doctorNotInitializedError'), 'SfDoctorInitError');
|
|
157
162
|
}
|
|
158
163
|
return writeFile(this.stderrWriteStream, contents);
|
|
159
164
|
}
|
|
@@ -166,7 +171,7 @@ class Doctor {
|
|
|
166
171
|
createStderrWriteStream(fullPath) {
|
|
167
172
|
if (!this.stderrWriteStream) {
|
|
168
173
|
createOutputDir(fullPath);
|
|
169
|
-
this.stderrWriteStream = fs.createWriteStream(
|
|
174
|
+
this.stderrWriteStream = fs.createWriteStream(join(fullPath));
|
|
170
175
|
}
|
|
171
176
|
}
|
|
172
177
|
closeStderr() {
|
|
@@ -178,9 +183,9 @@ class Doctor {
|
|
|
178
183
|
this.stdoutWriteStream?.close();
|
|
179
184
|
}
|
|
180
185
|
getDoctoredFilePath(filePath) {
|
|
181
|
-
const dir =
|
|
182
|
-
const fileName = `${this.id}-${
|
|
183
|
-
const fullPath =
|
|
186
|
+
const dir = dirname(filePath);
|
|
187
|
+
const fileName = `${this.id}-${basename(filePath)}`;
|
|
188
|
+
const fullPath = join(dir, fileName);
|
|
184
189
|
this.diagnosis.logFilePaths.push(fullPath);
|
|
185
190
|
return fullPath;
|
|
186
191
|
}
|
|
@@ -188,8 +193,7 @@ class Doctor {
|
|
|
188
193
|
this.diagnosis.commandExitCode = code;
|
|
189
194
|
}
|
|
190
195
|
}
|
|
191
|
-
|
|
192
|
-
function formatPlugins(config, plugins) {
|
|
196
|
+
export function formatPlugins(config, plugins) {
|
|
193
197
|
function getFriendlyName(name) {
|
|
194
198
|
const scope = config?.pjson?.oclif?.scope;
|
|
195
199
|
if (!scope)
|
|
@@ -204,9 +208,8 @@ function formatPlugins(config, plugins) {
|
|
|
204
208
|
.sort((a, b) => (a.name > b.name ? 1 : -1))
|
|
205
209
|
.map((plugin) => `${getFriendlyName(plugin.name)} ${plugin.version} (${plugin.type}) ${plugin.type === 'link' ? plugin.root : ''}`.trim());
|
|
206
210
|
}
|
|
207
|
-
exports.formatPlugins = formatPlugins;
|
|
208
211
|
const createOutputDir = (fullPath) => {
|
|
209
|
-
const dir =
|
|
212
|
+
const dir = dirname(fullPath);
|
|
210
213
|
if (!fs.existsSync(dir)) {
|
|
211
214
|
fs.mkdirSync(dir, { recursive: true });
|
|
212
215
|
}
|
package/lib/doctor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,WAAW,EAAoB,MAAM,kBAAkB,CAAC;AAmCjE,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AAE5E,MAAM,kBAAkB,GAAG;IACzB,QAAQ,CAAC,UAAU,CAAC,qCAAqC,CAAC;IAC1D,QAAQ,CAAC,UAAU,C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OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Doctor, SfDoctor, SfDoctorDiagnosis } from './doctor';
|
|
2
|
-
export { Diagnostics, DiagnosticStatus } from './diagnostics';
|
|
1
|
+
export { Doctor, SfDoctor, SfDoctorDiagnosis } from './doctor.js';
|
|
2
|
+
export { Diagnostics, DiagnosticStatus } from './diagnostics.js';
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var doctor_1 = require("./doctor");
|
|
11
|
-
Object.defineProperty(exports, "Doctor", { enumerable: true, get: function () { return doctor_1.Doctor; } });
|
|
12
|
-
var diagnostics_1 = require("./diagnostics");
|
|
13
|
-
Object.defineProperty(exports, "Diagnostics", { enumerable: true, get: function () { return diagnostics_1.Diagnostics; } });
|
|
7
|
+
export { Doctor } from './doctor.js';
|
|
8
|
+
export { Diagnostics } from './diagnostics.js';
|
|
14
9
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAA+B,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,WAAW,EAAoB,MAAM,kBAAkB,CAAC"}
|
|
@@ -2,5 +2,8 @@ export type DistTagJson = {
|
|
|
2
2
|
latest: string;
|
|
3
3
|
'latest-rc': string;
|
|
4
4
|
};
|
|
5
|
-
declare const getDistTagVersion: (url: string, distTag: string) => Promise<string>;
|
|
6
|
-
|
|
5
|
+
export declare const getDistTagVersion: (url: string, distTag: string) => Promise<string>;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
getDistTagVersion: (url: string, distTag: string) => Promise<string>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const constants_1 = require("../constants");
|
|
13
|
-
const getDistTagVersion = async (url, distTag) => {
|
|
7
|
+
import got from 'got';
|
|
8
|
+
import { ProxyAgent } from 'proxy-agent';
|
|
9
|
+
import { SFDX_RELEASE_NOTES_TIMEOUT } from '../constants.js';
|
|
10
|
+
export const getDistTagVersion = async (url, distTag) => {
|
|
14
11
|
// TODO: Could use npm instead here. That way private cli repos could auth with .npmrc
|
|
15
12
|
// -- could utilize this: https://github.com/salesforcecli/plugin-trust/blob/0393b906a30e8858816625517eda5db69377c178/src/lib/npmCommand.ts
|
|
16
|
-
const options = {
|
|
17
|
-
|
|
13
|
+
const options = {
|
|
14
|
+
timeout: { request: SFDX_RELEASE_NOTES_TIMEOUT },
|
|
15
|
+
agent: { https: new ProxyAgent() },
|
|
16
|
+
};
|
|
17
|
+
const body = await got.get(url, options).json();
|
|
18
18
|
// We are only interested in latest and latest-rc, could update this if other tags are desired
|
|
19
19
|
return distTag.includes('rc') ? body['latest-rc'] : body['latest'];
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
export default { getDistTagVersion };
|
|
22
22
|
//# sourceMappingURL=getDistTagVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDistTagVersion.js","sourceRoot":"","sources":["../../src/shared/getDistTagVersion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDistTagVersion.js","sourceRoot":"","sources":["../../src/shared/getDistTagVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAO7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,GAAW,EAAE,OAAe,EAAmB,EAAE;IACvF,sFAAsF;IACtF,2IAA2I;IAC3I,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;QAChD,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,UAAU,EAAE,EAAE;KACnC,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,EAAe,CAAC;IAE7D,8FAA8F;IAC9F,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF,eAAe,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface PjsonWithInfo extends PJSON {
|
|
3
|
-
oclif: PJSON['oclif'] & {
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
export interface PjsonWithInfo extends Interfaces.PJSON {
|
|
3
|
+
oclif: Interfaces.PJSON['oclif'] & {
|
|
4
4
|
info: InfoConfig;
|
|
5
5
|
};
|
|
6
6
|
}
|
|
@@ -11,5 +11,8 @@ export interface InfoConfig {
|
|
|
11
11
|
releaseNotesFilename: string;
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
declare const getInfoConfig: (path: string) => Promise<InfoConfig>;
|
|
15
|
-
|
|
14
|
+
export declare const getInfoConfig: (path: string) => Promise<InfoConfig>;
|
|
15
|
+
declare const _default: {
|
|
16
|
+
getInfoConfig: (path: string) => Promise<InfoConfig>;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const fs = require("fs");
|
|
7
|
+
import pathPkg from 'node:path';
|
|
8
|
+
import fs from 'node:fs/promises';
|
|
12
9
|
/* sfdx example to add to cli pjson.oclif
|
|
13
10
|
|
|
14
11
|
example location with npm install:
|
|
@@ -23,14 +20,14 @@ Add to oclif object
|
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
*/
|
|
26
|
-
const getInfoConfig = async (path) => {
|
|
23
|
+
export const getInfoConfig = async (path) => {
|
|
27
24
|
// TODO: could add env var support for these values
|
|
28
|
-
const fullPath =
|
|
29
|
-
const json = JSON.parse(await fs.
|
|
25
|
+
const fullPath = pathPkg.join(path, 'package.json');
|
|
26
|
+
const json = JSON.parse(await fs.readFile(fullPath, 'utf8'));
|
|
30
27
|
const { info } = json.oclif;
|
|
31
28
|
if (!info)
|
|
32
29
|
throw new Error('getInfoConfig() failed to find pjson.oclif.info config');
|
|
33
30
|
return info;
|
|
34
31
|
};
|
|
35
|
-
|
|
32
|
+
export default { getInfoConfig };
|
|
36
33
|
//# sourceMappingURL=getInfoConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInfoConfig.js","sourceRoot":"","sources":["../../src/shared/getInfoConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getInfoConfig.js","sourceRoot":"","sources":["../../src/shared/getInfoConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAiBlC;;;;;;;;;;;;;EAaE;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,IAAY,EAAuB,EAAE;IACvE,mDAAmD;IACnD,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEpD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAkB,CAAC;IAE9E,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;IAE5B,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAErF,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
declare const getReleaseNotes: (base: string, filename: string, version: string) => Promise<string>;
|
|
2
|
-
|
|
1
|
+
export declare const getReleaseNotes: (base: string, filename: string, version: string) => Promise<string>;
|
|
2
|
+
declare const _default: {
|
|
3
|
+
getReleaseNotes: (base: string, filename: string, version: string) => Promise<string>;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const getReleaseNotes = async (base, filename, version) => {
|
|
15
|
-
const majorVersion = (0, semver_1.major)(version);
|
|
7
|
+
import got from 'got';
|
|
8
|
+
import semver from 'semver';
|
|
9
|
+
import { ProxyAgent } from 'proxy-agent';
|
|
10
|
+
import { SFDX_RELEASE_NOTES_TIMEOUT } from '../constants.js';
|
|
11
|
+
export const getReleaseNotes = async (base, filename, version) => {
|
|
12
|
+
const majorVersion = semver.major(version);
|
|
16
13
|
const rawBase = base.replace('github.com', 'raw.githubusercontent.com').replace('/blob/', '/').replace('/tree/', '/');
|
|
17
14
|
const options = {
|
|
18
|
-
timeout:
|
|
15
|
+
timeout: { request: SFDX_RELEASE_NOTES_TIMEOUT },
|
|
19
16
|
throwHttpErrors: false,
|
|
20
|
-
agent: { https: new
|
|
17
|
+
agent: { https: new ProxyAgent() },
|
|
21
18
|
};
|
|
22
19
|
const getPromises = [
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
got.get(`${rawBase}/v${majorVersion}.md`, options),
|
|
21
|
+
got.get(`${rawBase}/${filename}`, { ...options, throwHttpErrors: true }),
|
|
25
22
|
];
|
|
26
23
|
const [versioned, readme] = await Promise.all(getPromises);
|
|
27
24
|
const { body } = versioned.statusCode === 200 ? versioned : readme;
|
|
28
25
|
return body;
|
|
29
26
|
};
|
|
30
|
-
|
|
27
|
+
export default { getReleaseNotes };
|
|
31
28
|
//# sourceMappingURL=getReleaseNotes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getReleaseNotes.js","sourceRoot":"","sources":["../../src/shared/getRelea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AAC,CAAC,CAAC,MAAM,CAAC;IAEnE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
getDistTagVersion: (url: string, distTag: string) => Promise<string>;
|
|
3
|
+
getInfoConfig: (path: string) => Promise<import("./getInfoConfig.js").InfoConfig>;
|
|
4
|
+
getReleaseNotes: (base: string, filename: string, version: string) => Promise<string>;
|
|
5
|
+
parseReleaseNotes: (notes: string, version: string, baseUrl: string) => import("marked").marked.Token[];
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import { getDistTagVersion } from './getDistTagVersion.js';
|
|
8
|
+
import { getInfoConfig } from './getInfoConfig.js';
|
|
9
|
+
import { getReleaseNotes } from './getReleaseNotes.js';
|
|
10
|
+
import { parseReleaseNotes } from './parseReleaseNotes.js';
|
|
11
|
+
export default {
|
|
12
|
+
getDistTagVersion,
|
|
13
|
+
getInfoConfig,
|
|
14
|
+
getReleaseNotes,
|
|
15
|
+
parseReleaseNotes,
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,eAAe;IACb,iBAAiB;IACjB,aAAa;IACb,eAAe;IACf,iBAAiB;CAClB,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { marked } from 'marked';
|
|
2
|
-
declare const parseReleaseNotes: (notes: string, version: string, baseUrl: string) => marked.Token[];
|
|
3
|
-
|
|
2
|
+
export declare const parseReleaseNotes: (notes: string, version: string, baseUrl: string) => marked.Token[];
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parseReleaseNotes: (notes: string, version: string, baseUrl: string) => marked.Token[];
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const semver = require("semver");
|
|
12
|
-
const parseReleaseNotes = (notes, version, baseUrl) => {
|
|
7
|
+
import { marked } from 'marked';
|
|
8
|
+
import { coerce, major, minor, maxSatisfying } from 'semver';
|
|
9
|
+
export const parseReleaseNotes = (notes, version, baseUrl) => {
|
|
13
10
|
let found = false;
|
|
14
11
|
let closestVersion = null;
|
|
15
12
|
let versions = [];
|
|
16
|
-
const parsed =
|
|
13
|
+
const parsed = marked.lexer(notes);
|
|
17
14
|
const findVersion = (desiredVersion) => {
|
|
18
15
|
versions = [];
|
|
19
16
|
if (desiredVersion === null) {
|
|
@@ -24,7 +21,7 @@ const parseReleaseNotes = (notes, version, baseUrl) => {
|
|
|
24
21
|
if (token.type === 'heading' && token.depth === 2) {
|
|
25
22
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
26
23
|
// @ts-ignore
|
|
27
|
-
const coercedVersion =
|
|
24
|
+
const coercedVersion = coerce(token.text).version;
|
|
28
25
|
// We will use this to find the closest patch if passed version is not found
|
|
29
26
|
versions.push(coercedVersion);
|
|
30
27
|
if (coercedVersion === desiredVersion) {
|
|
@@ -41,8 +38,8 @@ const parseReleaseNotes = (notes, version, baseUrl) => {
|
|
|
41
38
|
let tokens = findVersion(version);
|
|
42
39
|
if (!tokens || tokens.length === 0) {
|
|
43
40
|
// If version was not found, try again with the closest patch version
|
|
44
|
-
const semverRange = `${
|
|
45
|
-
closestVersion =
|
|
41
|
+
const semverRange = `${major(version)}.${minor(version)}.x`;
|
|
42
|
+
closestVersion = maxSatisfying(versions, semverRange);
|
|
46
43
|
tokens = findVersion(closestVersion);
|
|
47
44
|
if (!tokens.length) {
|
|
48
45
|
throw new Error(`Didn't find version '${version}'. View release notes online at: ${baseUrl}`);
|
|
@@ -55,12 +52,12 @@ const parseReleaseNotes = (notes, version, baseUrl) => {
|
|
|
55
52
|
token.href = `${baseUrl}/${token.href}`;
|
|
56
53
|
}
|
|
57
54
|
};
|
|
58
|
-
|
|
55
|
+
marked.walkTokens(tokens, fixRelativeLinks);
|
|
59
56
|
if (closestVersion !== null) {
|
|
60
|
-
const warning =
|
|
57
|
+
const warning = marked.lexer(`# ATTENTION: Version ${version} was not found. Showing notes for closest patch version ${closestVersion}.`)[0];
|
|
61
58
|
tokens.unshift(warning);
|
|
62
59
|
}
|
|
63
60
|
return tokens;
|
|
64
61
|
};
|
|
65
|
-
|
|
62
|
+
export default { parseReleaseNotes };
|
|
66
63
|
//# sourceMappingURL=parseReleaseNotes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseReleaseNotes.js","sourceRoot":"","sources":["../../src/shared/parseReleaseNotes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseReleaseNotes.js","sourceRoot":"","sources":["../../src/shared/parseReleaseNotes.ts"],"names":[],"mappings":"AAAA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AAC,MAAM,KAAK,CAAC,EAAE;QAClC,qEAAqE;QACrE,MAAM,WAAW,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAE5D,cAAc,GAAG,aAAa,CAAS,QAAQ,EAAE,WAAW,CAAC,CAAC;QAE9D,MAAM,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;QAErC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,oCAAoC,OAAO,EAAE,CAAC,CAAC;SAC/F;KACF;IAED,MAAM,gBAAgB,GAAG,CAAC,KAAmB,EAAQ,EAAE;QACrD,wEAAwE;QACxE,oGAAoG;QACpG,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE;YAC/E,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;SACzC;IACH,CAAC,CAAC;IAEF,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAE5C,IAAI,cAAc,KAAK,IAAI,EAAE;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAC1B,wBAAwB,OAAO,2DAA2D,cAAc,GAAG,CAC5G,CAAC,CAAC,CAAC,CAAC;QAEL,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;KACzB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,EAAE,iBAAiB,EAAE,CAAC"}
|
package/messages/doctor.md
CHANGED
|
@@ -10,11 +10,11 @@ Use the --command parameter to run a specific command in debug mode; the doctor
|
|
|
10
10
|
|
|
11
11
|
Plugin providers can also implement their own doctor diagnostic tests by listening to the "sf-doctor" event and running plugin specific tests that are then included in the doctor diagnostics log.
|
|
12
12
|
|
|
13
|
-
# flags.command
|
|
13
|
+
# flags.command.summary
|
|
14
14
|
|
|
15
15
|
Command to run in debug mode; results are written to a log file.
|
|
16
16
|
|
|
17
|
-
# flags.plugin
|
|
17
|
+
# flags.plugin.summary
|
|
18
18
|
|
|
19
19
|
Specific plugin on which to run diagnostics.
|
|
20
20
|
|
|
@@ -52,10 +52,6 @@ Check http://status.salesforce.com for general Salesforce availability and perfo
|
|
|
52
52
|
|
|
53
53
|
Must first initialize a new SfDoctor.
|
|
54
54
|
|
|
55
|
-
# doctorAlreadyInitializedError
|
|
56
|
-
|
|
57
|
-
SfDoctor has already been initialized.
|
|
58
|
-
|
|
59
55
|
# pluginNotInstalledError
|
|
60
56
|
|
|
61
57
|
Specified plugin [%s] isn't installed. Install it, correct the name, or choose another plugin.
|