@salesforce/plugin-command-reference 3.0.75 → 3.0.76
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 +9 -7
- package/lib/commands/commandreference/generate.js +68 -70
- package/lib/commands/commandreference/generate.js.map +1 -1
- package/lib/commands/jit/install.d.ts +1 -1
- package/lib/commands/jit/install.js +14 -17
- package/lib/commands/jit/install.js.map +1 -1
- package/lib/ditamap/base-ditamap.d.ts +1 -1
- package/lib/ditamap/base-ditamap.js +4 -8
- package/lib/ditamap/base-ditamap.js.map +1 -1
- package/lib/ditamap/cli-reference.d.ts +1 -1
- package/lib/ditamap/cli-reference.js +5 -9
- package/lib/ditamap/cli-reference.js.map +1 -1
- package/lib/ditamap/command.d.ts +2 -2
- package/lib/ditamap/command.js +19 -20
- package/lib/ditamap/command.js.map +1 -1
- package/lib/ditamap/ditamap.d.ts +1 -1
- package/lib/ditamap/ditamap.js +20 -14
- package/lib/ditamap/ditamap.js.map +1 -1
- package/lib/ditamap/help-reference.d.ts +1 -1
- package/lib/ditamap/help-reference.js +3 -7
- package/lib/ditamap/help-reference.js.map +1 -1
- package/lib/ditamap/topic-commands.d.ts +2 -2
- package/lib/ditamap/topic-commands.js +5 -9
- package/lib/ditamap/topic-commands.js.map +1 -1
- package/lib/ditamap/topic-ditamap.d.ts +1 -1
- package/lib/ditamap/topic-ditamap.js +5 -9
- package/lib/ditamap/topic-ditamap.js.map +1 -1
- package/lib/docs.d.ts +1 -1
- package/lib/docs.js +33 -33
- package/lib/docs.js.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/lib/utils.d.ts +2 -2
- package/lib/utils.js +6 -11
- package/lib/utils.js.map +1 -1
- package/npm-shrinkwrap.json +1971 -1842
- package/oclif.lock +998 -888
- package/oclif.manifest.json +29 -5
- package/package.json +17 -16
package/lib/ditamap/ditamap.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const hb = require("handlebars");
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import fs from 'node:fs/promises';
|
|
10
|
+
import debugCreator from 'debug';
|
|
11
|
+
import hb from 'handlebars';
|
|
14
12
|
const debug = debugCreator('commandreference');
|
|
15
13
|
hb.registerHelper('toUpperCase', (str) => str.toUpperCase());
|
|
16
14
|
hb.registerHelper('join', (array) => array.join(', '));
|
|
@@ -32,12 +30,23 @@ hb.registerHelper('isCodeBlock', function (val, options) {
|
|
|
32
30
|
: options.inverse(this);
|
|
33
31
|
});
|
|
34
32
|
hb.registerHelper('nextVersion', (value) => parseInt(value, 2) + 1);
|
|
35
|
-
class Ditamap {
|
|
33
|
+
export class Ditamap {
|
|
34
|
+
filename;
|
|
35
|
+
data;
|
|
36
|
+
static SUFFIX = 'unified';
|
|
37
|
+
static templatesDir = join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'templates');
|
|
38
|
+
static outputDir;
|
|
39
|
+
static cliVersion;
|
|
40
|
+
static plugins;
|
|
41
|
+
static pluginVersions;
|
|
42
|
+
static _suffix;
|
|
43
|
+
destination;
|
|
44
|
+
source;
|
|
36
45
|
constructor(filename, data) {
|
|
37
46
|
this.filename = filename;
|
|
38
47
|
this.data = data;
|
|
39
|
-
this.source =
|
|
40
|
-
this.destination =
|
|
48
|
+
this.source = join(Ditamap.templatesDir, this.getTemplateFileName());
|
|
49
|
+
this.destination = join(Ditamap.outputDir, filename);
|
|
41
50
|
}
|
|
42
51
|
static get suffix() {
|
|
43
52
|
return Ditamap._suffix;
|
|
@@ -55,7 +64,7 @@ class Ditamap {
|
|
|
55
64
|
return this.destination;
|
|
56
65
|
}
|
|
57
66
|
async write() {
|
|
58
|
-
await fs.mkdir(
|
|
67
|
+
await fs.mkdir(dirname(this.destination), { recursive: true });
|
|
59
68
|
const output = await this.transformToDitamap();
|
|
60
69
|
await fs.writeFile(this.destination, output);
|
|
61
70
|
}
|
|
@@ -78,7 +87,4 @@ class Ditamap {
|
|
|
78
87
|
return template(this.data);
|
|
79
88
|
}
|
|
80
89
|
}
|
|
81
|
-
exports.Ditamap = Ditamap;
|
|
82
|
-
Ditamap.SUFFIX = 'unified';
|
|
83
|
-
Ditamap.templatesDir = (0, node_path_1.join)(__dirname, '..', '..', 'templates');
|
|
84
90
|
//# sourceMappingURL=ditamap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ditamap.js","sourceRoot":"","sources":["../../src/ditamap/ditamap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ditamap.js","sourceRoot":"","sources":["../../src/ditamap/ditamap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,YAAY,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,MAAM,KAAK,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAE/C,EAAE,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;AACrE,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,KAAe,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,EAAE,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AK;QAChB,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAE/C,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,kDAAkD;IACxC,gBAAgB,CAAC,YAAqB;QAC9C,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACO,KAAK,CAAC,kBAAkB;QAChC,EAAE;QACF,KAAK,CAAC,cAAc,IAAI,CAAC,WAAW,SAAS,IAAI,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QAC3E,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
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 ditamap_1 = require("./ditamap");
|
|
11
|
-
class HelpReference extends ditamap_1.Ditamap {
|
|
7
|
+
import { Ditamap } from './ditamap.js';
|
|
8
|
+
export class HelpReference extends Ditamap {
|
|
12
9
|
constructor() {
|
|
13
10
|
// Set the data of topic and filenames
|
|
14
|
-
const filename =
|
|
11
|
+
const filename = Ditamap.file('cli_reference_help', 'xml');
|
|
15
12
|
super(filename, {
|
|
16
13
|
id: filename.replace('.xml', ''),
|
|
17
14
|
});
|
|
@@ -21,5 +18,4 @@ class HelpReference extends ditamap_1.Ditamap {
|
|
|
21
18
|
return 'cli_reference_help.hbs';
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
exports.HelpReference = HelpReference;
|
|
25
21
|
//# sourceMappingURL=help-reference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-reference.js","sourceRoot":"","sources":["../../src/ditamap/help-reference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help-reference.js","sourceRoot":"","sources":["../../src/ditamap/help-reference.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,aAAc,SAAQ,OAAO;IACxC;QACE,sCAAsC;QACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;QAC3D,KAAK,CAAC,QAAQ,EAAE;YACd,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SfTopic } from '../utils';
|
|
2
|
-
import { Ditamap } from './ditamap';
|
|
1
|
+
import { SfTopic } from '../utils.js';
|
|
2
|
+
import { Ditamap } from './ditamap.js';
|
|
3
3
|
export declare class TopicCommands extends Ditamap {
|
|
4
4
|
constructor(topic: string, topicMeta: SfTopic);
|
|
5
5
|
getTemplateFileName(): string;
|
|
@@ -1,26 +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 ditamap_1 = require("./ditamap");
|
|
12
|
-
class TopicCommands extends ditamap_1.Ditamap {
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { Ditamap } from './ditamap.js';
|
|
9
|
+
export class TopicCommands extends Ditamap {
|
|
13
10
|
constructor(topic, topicMeta) {
|
|
14
|
-
const filename =
|
|
11
|
+
const filename = Ditamap.file(`cli_reference_${topic}_commands`, 'xml');
|
|
15
12
|
// Set the data of topic and filenames
|
|
16
13
|
super(filename, topicMeta);
|
|
17
14
|
// Override destination to include topic and subtopic
|
|
18
|
-
this.destination =
|
|
15
|
+
this.destination = join(Ditamap.outputDir, topic, filename);
|
|
19
16
|
}
|
|
20
17
|
// eslint-disable-next-line class-methods-use-this
|
|
21
18
|
getTemplateFileName() {
|
|
22
19
|
return 'cli_reference_topic_commands.hbs';
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.TopicCommands = TopicCommands;
|
|
26
22
|
//# sourceMappingURL=topic-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic-commands.js","sourceRoot":"","sources":["../../src/ditamap/topic-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"topic-commands.js","sourceRoot":"","sources":["../../src/ditamap/topic-commands.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,aAAc,SAAQ,OAAO;IACxC,YAAmB,KAAa,EAAE,SAAkB;QAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,WAAW,EAAE,KAAK,CAAC,CAAC;QACxE,sCAAsC;QACtC,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAE3B,qDAAqD;QACrD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,kCAAkC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -1,27 +1,23 @@
|
|
|
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
|
-
|
|
11
|
-
const ditamap_1 = require("./ditamap");
|
|
12
|
-
class TopicDitamap extends ditamap_1.Ditamap {
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { Ditamap } from './ditamap.js';
|
|
9
|
+
export class TopicDitamap extends Ditamap {
|
|
13
10
|
constructor(topic, commandIds) {
|
|
14
|
-
const filename =
|
|
11
|
+
const filename = Ditamap.file(`cli_reference_${topic}`, 'ditamap');
|
|
15
12
|
// Set the data of topic and filenames
|
|
16
13
|
const commands = commandIds.sort().map((c) => ({ command: c.replace(/:/g, '_') }));
|
|
17
14
|
super(filename, { topic, commands });
|
|
18
15
|
// Override destination to include topic and subtopic
|
|
19
|
-
this.destination =
|
|
16
|
+
this.destination = join(Ditamap.outputDir, topic, filename);
|
|
20
17
|
}
|
|
21
18
|
// eslint-disable-next-line class-methods-use-this
|
|
22
19
|
getTemplateFileName() {
|
|
23
20
|
return 'topic_ditamap.hbs';
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
exports.TopicDitamap = TopicDitamap;
|
|
27
23
|
//# sourceMappingURL=topic-ditamap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic-ditamap.js","sourceRoot":"","sources":["../../src/ditamap/topic-ditamap.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"topic-ditamap.js","sourceRoot":"","sources":["../../src/ditamap/topic-ditamap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,YAAa,SAAQ,OAAO;IACvC,YAAmB,KAAa,EAAE,UAAoB;QACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;QACnE,sCAAsC;QACtC,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACnF,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAErC,qDAAqD;QACrD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;CACF"}
|
package/lib/docs.d.ts
CHANGED
package/lib/docs.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const utils_1 = require("./utils");
|
|
19
|
-
const help_reference_1 = require("./ditamap/help-reference");
|
|
7
|
+
import fs from 'node:fs/promises';
|
|
8
|
+
import { ensureString } from '@salesforce/ts-types';
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
import { BaseDitamap } from './ditamap/base-ditamap.js';
|
|
11
|
+
import { CLIReference } from './ditamap/cli-reference.js';
|
|
12
|
+
import { Command } from './ditamap/command.js';
|
|
13
|
+
import { TopicCommands } from './ditamap/topic-commands.js';
|
|
14
|
+
import { TopicDitamap } from './ditamap/topic-ditamap.js';
|
|
15
|
+
import { events, punctuate } from './utils.js';
|
|
16
|
+
import { HelpReference } from './ditamap/help-reference.js';
|
|
20
17
|
function emitNoTopicMetadataWarning(topic) {
|
|
21
|
-
|
|
18
|
+
events.emit('warning', `No metadata for topic ${chalk.bold(topic)}. That topic owner must add topic metadata in the oclif section in the package.json file within their plugin.`);
|
|
22
19
|
}
|
|
23
|
-
class Docs {
|
|
20
|
+
export class Docs {
|
|
21
|
+
outputDir;
|
|
22
|
+
hidden;
|
|
23
|
+
topicMeta;
|
|
24
|
+
cliMeta;
|
|
24
25
|
constructor(outputDir, hidden, topicMeta, cliMeta) {
|
|
25
26
|
this.outputDir = outputDir;
|
|
26
27
|
this.hidden = hidden;
|
|
@@ -40,9 +41,9 @@ class Docs {
|
|
|
40
41
|
let description = topicMeta.description;
|
|
41
42
|
if (!description && !topicMeta.external) {
|
|
42
43
|
// TODO: check why the same property is used again when it is already used above
|
|
43
|
-
description =
|
|
44
|
+
description = punctuate(topicMeta.description);
|
|
44
45
|
if (!description) {
|
|
45
|
-
|
|
46
|
+
events.emit('warning', `No description for topic ${chalk.bold(topic)}. Skipping until topic owner adds topic metadata in the oclif section in the package.json file within their plugin.`);
|
|
46
47
|
return [];
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -58,9 +59,9 @@ class Docs {
|
|
|
58
59
|
subTopicNames.push(subtopic);
|
|
59
60
|
// Commands within the sub topic
|
|
60
61
|
for (const command of classes) {
|
|
61
|
-
const fullTopic =
|
|
62
|
-
const commandsInFullTopic = classes.filter((cmd) =>
|
|
63
|
-
const commandMeta = this.resolveCommandMeta(
|
|
62
|
+
const fullTopic = ensureString(command.id).replace(/:\w+$/, '');
|
|
63
|
+
const commandsInFullTopic = classes.filter((cmd) => ensureString(cmd.id).startsWith(fullTopic));
|
|
64
|
+
const commandMeta = this.resolveCommandMeta(ensureString(command.id), command, commandsInFullTopic.length);
|
|
64
65
|
// eslint-disable-next-line no-await-in-loop
|
|
65
66
|
await this.populateCommand(topic, subtopic, command, commandMeta);
|
|
66
67
|
commandIds.push(command.id);
|
|
@@ -72,14 +73,14 @@ class Docs {
|
|
|
72
73
|
emitNoTopicMetadataWarning(`${topic}:${subtopic}`);
|
|
73
74
|
}
|
|
74
75
|
else {
|
|
75
|
-
|
|
76
|
+
events.emit('warning', `Can't create topic for ${topic}:${subtopic}: ${err.message}\n`);
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
// The topic ditamap with all of the subtopic links.
|
|
80
|
-
|
|
81
|
-
await new
|
|
82
|
-
await new
|
|
81
|
+
events.emit('subtopics', topic, subTopicNames);
|
|
82
|
+
await new TopicCommands(topic, topicMeta).write();
|
|
83
|
+
await new TopicDitamap(topic, commandIds).write();
|
|
83
84
|
return subTopicNames;
|
|
84
85
|
}
|
|
85
86
|
/**
|
|
@@ -96,7 +97,7 @@ class Docs {
|
|
|
96
97
|
if (command.hidden && !this.hidden) {
|
|
97
98
|
continue;
|
|
98
99
|
}
|
|
99
|
-
const commandParts =
|
|
100
|
+
const commandParts = ensureString(command.id).split(':');
|
|
100
101
|
const topLevelTopic = commandParts[0];
|
|
101
102
|
const plugin = command.plugin;
|
|
102
103
|
if (plugin) {
|
|
@@ -136,12 +137,12 @@ class Docs {
|
|
|
136
137
|
}
|
|
137
138
|
async populateTemplate(commands) {
|
|
138
139
|
const topicsAndSubtopics = this.groupTopicsAndSubtopics(commands);
|
|
139
|
-
await new
|
|
140
|
-
await new
|
|
140
|
+
await new CLIReference().write();
|
|
141
|
+
await new HelpReference().write();
|
|
141
142
|
// Generate one base file with all top-level topics.
|
|
142
|
-
await new
|
|
143
|
+
await new BaseDitamap(Array.from(topicsAndSubtopics.keys())).write();
|
|
143
144
|
for (const [topic, subtopics] of topicsAndSubtopics.entries()) {
|
|
144
|
-
|
|
145
|
+
events.emit('topic', { topic });
|
|
145
146
|
// eslint-disable-next-line no-await-in-loop
|
|
146
147
|
await this.populateTopic(topic, subtopics);
|
|
147
148
|
}
|
|
@@ -172,11 +173,11 @@ class Docs {
|
|
|
172
173
|
return commandMeta;
|
|
173
174
|
}
|
|
174
175
|
else if (commandsInTopic !== 1) {
|
|
175
|
-
|
|
176
|
+
events.emit('warning', `subtopic "${part}" meta not found for command ${commandId}`);
|
|
176
177
|
}
|
|
177
178
|
else if (!commandMeta.description) {
|
|
178
179
|
commandMeta.description = command.description;
|
|
179
|
-
commandMeta.longDescription = (command.longDescription ? command.longDescription :
|
|
180
|
+
commandMeta.longDescription = (command.longDescription ? command.longDescription : punctuate(command.description));
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
return commandMeta;
|
|
@@ -186,10 +187,9 @@ class Docs {
|
|
|
186
187
|
if (command.hidden && !this.hidden) {
|
|
187
188
|
return '';
|
|
188
189
|
}
|
|
189
|
-
const commandDitamap = new
|
|
190
|
+
const commandDitamap = new Command(topic, subtopic, command, commandMeta);
|
|
190
191
|
await commandDitamap.write();
|
|
191
192
|
return commandDitamap.getFilename();
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
|
-
exports.Docs = Docs;
|
|
195
195
|
//# sourceMappingURL=docs.js.map
|
package/lib/docs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAW,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAW,MAAM,EAAE,SAAS,EAAmC,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAI5D,SAAS,0BAA0B,CAAC,KAAa;IAC/C,MAAM,CAAC,IAAI,CACT,SAAS,EACT,yBAAyB,KAAK,CAAC,IAAI,CACjC,KAAK,CACN,+GAA+G,CACjH,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,IAAI;IAEL;IACA;IACA;IACA;IAJV,YACU,SAAiB,EACjB,MAAe,EACf,SAAmB,EACnB,OAAgB;QAHhB,cAAS,GAAT,SAAS,CAAQ;QACjB,WAAM,GAAN,MAAM,CAAS;QACf,cAAS,GAAT,SAAS,CAAU;QACnB,YAAO,GAA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,WAAW,CAAC;YACrB,CAAC;iBAAM,IAAI,eAAe,KAAK,CAAC,EAAE,CAAC;gBACjC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,IAAI,gCAAgC,SAAS,EAAE,CAAC,CAAC;YACvF,CAAC;iBAAM,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;gBACpC,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;gBAC9C,WAAW,CAAC,eAAe,GAAG,CAC5B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,CACxE,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEO,KAAK,CAAC,eAAe,CAC3B,KAAa,EACb,QAAuB,EACvB,OAAqB,EACrB,WAAoC;QAEpC,oCAAoC;QACpC,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QAC1E,MAAM,cAAc,CAAC,KAAK,EAAE,CAAC;QAC7B,OAAO,cAAc,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;CACF"}
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
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
|
-
exports.default = {};
|
|
7
|
+
export default {};
|
|
10
8
|
//# 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,eAAe,EAAE,CAAC"}
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import { EventEmitter } from 'node:events';
|
|
3
3
|
import { Command, Interfaces } from '@oclif/core';
|
|
4
4
|
import { AnyJson } from '@salesforce/ts-types';
|
|
@@ -9,7 +9,7 @@ export type CommandClass = Pick<Command.Class, 'id' | 'hidden' | 'description' |
|
|
|
9
9
|
binary: string;
|
|
10
10
|
deprecated?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const events: EventEmitter
|
|
12
|
+
export declare const events: EventEmitter<[never]>;
|
|
13
13
|
export declare function punctuate(description?: string): string | undefined;
|
|
14
14
|
export declare const replaceConfigVariables: (text: string, bin: string, id: string) => string;
|
|
15
15
|
export type CliMeta = {
|
package/lib/utils.js
CHANGED
|
@@ -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
|
-
|
|
12
|
-
exports.events = new node_events_1.EventEmitter();
|
|
13
|
-
function punctuate(description) {
|
|
7
|
+
import { EventEmitter } from 'node:events';
|
|
8
|
+
import { EOL } from 'node:os';
|
|
9
|
+
export const events = new EventEmitter();
|
|
10
|
+
export function punctuate(description) {
|
|
14
11
|
if (!description)
|
|
15
12
|
return description;
|
|
16
|
-
const lines = description.split(
|
|
13
|
+
const lines = description.split(EOL);
|
|
17
14
|
let mainDescription = lines[0];
|
|
18
15
|
mainDescription = mainDescription.charAt(0).toUpperCase() + mainDescription.substring(1);
|
|
19
16
|
if (!mainDescription.endsWith('.')) {
|
|
@@ -21,7 +18,5 @@ function punctuate(description) {
|
|
|
21
18
|
}
|
|
22
19
|
return mainDescription;
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
const replaceConfigVariables = (text, bin, id) => text.replace(/<%= config.bin %>/g, bin ?? 'unknown').replace(/<%= command.id %>/g, id);
|
|
26
|
-
exports.replaceConfigVariables = replaceConfigVariables;
|
|
21
|
+
export const replaceConfigVariables = (text, bin, id) => text.replace(/<%= config.bin %>/g, bin ?? 'unknown').replace(/<%= command.id %>/g, id);
|
|
27
22
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAS9B,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;AAEzC,MAAM,UAAU,SAAS,CAAC,WAAoB;IAC5C,IAAI,CAAC,WAAW;QAAE,OAAO,WAAW,CAAC;IAErC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,eAAe,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAE/B,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEzF,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,eAAe,IAAI,GAAG,CAAC;IACzB,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU,EAAU,EAAE,CACtF,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,GAAG,IAAI,SAAS,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC"}
|