@salesforce/plugin-command-reference 2.4.1 → 2.4.2
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/lib/commands/commandreference/generate.d.ts +1 -1
- package/lib/commands/commandreference/generate.js +27 -17
- package/lib/commands/commandreference/generate.js.map +1 -1
- package/lib/commands/jit/install.js +2 -1
- package/lib/commands/jit/install.js.map +1 -1
- package/lib/ditamap/base-ditamap.js +1 -0
- package/lib/ditamap/base-ditamap.js.map +1 -1
- package/lib/ditamap/cli-reference-topic.js +1 -0
- package/lib/ditamap/cli-reference-topic.js.map +1 -1
- package/lib/ditamap/cli-reference.js +1 -0
- package/lib/ditamap/cli-reference.js.map +1 -1
- package/lib/ditamap/command.d.ts +2 -2
- package/lib/ditamap/command.js +32 -24
- package/lib/ditamap/command.js.map +1 -1
- package/lib/ditamap/ditamap.d.ts +7 -8
- package/lib/ditamap/ditamap.js +10 -10
- package/lib/ditamap/ditamap.js.map +1 -1
- package/lib/ditamap/help-reference.js +1 -0
- package/lib/ditamap/help-reference.js.map +1 -1
- package/lib/ditamap/main-topic-intro.d.ts +1 -2
- package/lib/ditamap/main-topic-intro.js +4 -3
- package/lib/ditamap/main-topic-intro.js.map +1 -1
- package/lib/ditamap/topic-commands.d.ts +1 -2
- package/lib/ditamap/topic-commands.js +1 -0
- package/lib/ditamap/topic-commands.js.map +1 -1
- package/lib/ditamap/topic-ditamap.js +1 -0
- package/lib/ditamap/topic-ditamap.js.map +1 -1
- package/lib/docs.d.ts +3 -3
- package/lib/docs.js +33 -27
- package/lib/docs.js.map +1 -1
- package/lib/utils.d.ts +2 -4
- package/lib/utils.js +2 -15
- package/lib/utils.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +138 -34
|
@@ -5,7 +5,7 @@ export default class CommandReferenceGenerate extends SfCommand<AnyJson> {
|
|
|
5
5
|
static description: string;
|
|
6
6
|
static flags: {
|
|
7
7
|
outputdir: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
-
plugins: Interfaces.OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
plugins: Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
9
|
all: Interfaces.BooleanFlag<boolean>;
|
|
10
10
|
'ditamap-suffix': Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
11
|
hidden: Interfaces.BooleanFlag<boolean>;
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const fs = require("fs/promises");
|
|
10
|
+
const fs_1 = require("fs");
|
|
9
11
|
const os = require("os");
|
|
10
12
|
const path = require("path");
|
|
11
|
-
const fs_extra_1 = require("fs-extra");
|
|
12
13
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
13
14
|
const core_1 = require("@oclif/core");
|
|
14
15
|
const core_2 = require("@salesforce/core");
|
|
15
16
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
16
17
|
const chalk = require("chalk");
|
|
18
|
+
const kit_1 = require("@salesforce/kit");
|
|
17
19
|
const ditamap_1 = require("../../ditamap/ditamap");
|
|
18
20
|
const docs_1 = require("../../docs");
|
|
19
21
|
const utils_1 = require("../../utils");
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
21
|
-
const uniqBy = require('lodash.uniqby');
|
|
22
22
|
// Initialize Messages with the current plugin directory
|
|
23
23
|
core_2.Messages.importMessagesDirectory(__dirname);
|
|
24
24
|
const messages = core_2.Messages.loadMessages('@salesforce/plugin-command-reference', 'main');
|
|
@@ -29,9 +29,9 @@ class CommandReferenceGenerate extends sf_plugins_core_1.SfCommand {
|
|
|
29
29
|
let pluginNames;
|
|
30
30
|
if (!flags.plugins && !flags.all) {
|
|
31
31
|
const pJsonPath = path.join(process.cwd(), 'package.json');
|
|
32
|
-
if (
|
|
33
|
-
const packageJson =
|
|
34
|
-
pluginNames = [(0, ts_types_1.
|
|
32
|
+
if ((0, fs_1.existsSync)(pJsonPath)) {
|
|
33
|
+
const packageJson = (0, kit_1.parseJsonMap)(await fs.readFile(pJsonPath, 'utf-8'));
|
|
34
|
+
pluginNames = [(0, ts_types_1.ensureString)(packageJson.name)];
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
37
|
throw new core_2.SfError("No plugins provided. Provide the '--plugins' flag or cd into a directory that contains a valid oclif plugin.");
|
|
@@ -48,7 +48,7 @@ class CommandReferenceGenerate extends sf_plugins_core_1.SfCommand {
|
|
|
48
48
|
pluginNames = this.config.plugins.map((p) => p.name).filter((p) => !ignore.some((i) => i.test(p)));
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
pluginNames = flags.plugins;
|
|
51
|
+
pluginNames = flags.plugins ?? [];
|
|
52
52
|
}
|
|
53
53
|
const plugins = pluginNames
|
|
54
54
|
.map((plugin) => plugin.trim())
|
|
@@ -72,7 +72,7 @@ class CommandReferenceGenerate extends sf_plugins_core_1.SfCommand {
|
|
|
72
72
|
ditamap_1.Ditamap.plugins = this.pluginMap(plugins);
|
|
73
73
|
ditamap_1.Ditamap.pluginVersions = plugins.map((name) => {
|
|
74
74
|
const plugin = this.getPlugin(name);
|
|
75
|
-
const version = plugin
|
|
75
|
+
const version = plugin?.version;
|
|
76
76
|
if (!version)
|
|
77
77
|
throw new Error(`No version found for plugin ${name}`);
|
|
78
78
|
return { name, version };
|
|
@@ -83,10 +83,12 @@ class CommandReferenceGenerate extends sf_plugins_core_1.SfCommand {
|
|
|
83
83
|
});
|
|
84
84
|
const warnings = [];
|
|
85
85
|
utils_1.events.on('warning', (msg) => {
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
86
87
|
process.stderr.write(chalk.yellow(`> ${msg}\n`));
|
|
87
88
|
warnings.push(msg);
|
|
88
89
|
});
|
|
89
|
-
|
|
90
|
+
const cmnds = await this.loadCommands();
|
|
91
|
+
await docs.build(cmnds);
|
|
90
92
|
this.log(`\nWrote generated doc to ${ditamap_1.Ditamap.outputDir}`);
|
|
91
93
|
if (flags.erroronwarnings && warnings.length > 0) {
|
|
92
94
|
throw new core_2.SfError(`Found ${warnings.length} warnings.`);
|
|
@@ -96,7 +98,7 @@ class CommandReferenceGenerate extends sf_plugins_core_1.SfCommand {
|
|
|
96
98
|
pluginMap(plugins) {
|
|
97
99
|
const pluginToParentPlugin = {};
|
|
98
100
|
const resolveChildPlugins = (parentPlugin) => {
|
|
99
|
-
for (const childPlugin of parentPlugin.pjson.oclif.plugins
|
|
101
|
+
for (const childPlugin of parentPlugin.pjson.oclif.plugins ?? []) {
|
|
100
102
|
pluginToParentPlugin[childPlugin] = parentPlugin.name;
|
|
101
103
|
resolveChildPlugins((0, ts_types_1.ensure)(this.getPlugin(childPlugin)));
|
|
102
104
|
}
|
|
@@ -120,9 +122,10 @@ class CommandReferenceGenerate extends sf_plugins_core_1.SfCommand {
|
|
|
120
122
|
for (const cmd of this.config.commands) {
|
|
121
123
|
// Only load topics for each plugin once
|
|
122
124
|
if (cmd.pluginName && !plugins[cmd.pluginName]) {
|
|
125
|
+
// eslint-disable-next-line no-await-in-loop
|
|
123
126
|
const commandClass = await this.loadCommand(cmd);
|
|
124
|
-
if (commandClass.plugin
|
|
125
|
-
|
|
127
|
+
if (commandClass.plugin?.pjson.oclif.topics) {
|
|
128
|
+
Object.assign(topicsMeta, commandClass.plugin.pjson.oclif.topics);
|
|
126
129
|
plugins[commandClass.plugin.name] = true;
|
|
127
130
|
}
|
|
128
131
|
}
|
|
@@ -138,26 +141,33 @@ class CommandReferenceGenerate extends sf_plugins_core_1.SfCommand {
|
|
|
138
141
|
});
|
|
139
142
|
// Load all properties on all extending classes.
|
|
140
143
|
while (commandClass !== undefined) {
|
|
141
|
-
commandClass =
|
|
144
|
+
commandClass = Reflect.getPrototypeOf(commandClass) || undefined;
|
|
142
145
|
obj = Object.assign({}, commandClass, obj, {
|
|
143
|
-
flags: Object.assign({}, commandClass
|
|
146
|
+
flags: Object.assign({}, commandClass?.flags, obj.flags),
|
|
144
147
|
});
|
|
145
148
|
}
|
|
146
149
|
return obj;
|
|
147
150
|
}
|
|
148
151
|
catch (error) {
|
|
149
|
-
return
|
|
152
|
+
return cmd;
|
|
150
153
|
}
|
|
151
154
|
});
|
|
152
155
|
const commands = await Promise.all(promises);
|
|
153
|
-
return
|
|
156
|
+
return Array.from(commands
|
|
157
|
+
.reduce((acc, cmd) => {
|
|
158
|
+
acc.set(cmd.id, cmd);
|
|
159
|
+
return acc;
|
|
160
|
+
}, new Map())
|
|
161
|
+
.values());
|
|
154
162
|
}
|
|
163
|
+
// eslint-disable-next-line class-methods-use-this
|
|
155
164
|
async loadCommand(command) {
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/return-await
|
|
156
166
|
return command.load.constructor.name === 'AsyncFunction' ? await command.load() : command.load();
|
|
157
167
|
}
|
|
158
168
|
loadCliMeta() {
|
|
159
169
|
return {
|
|
160
|
-
binary: this.config.pjson.oclif.bin
|
|
170
|
+
binary: this.config.pjson.oclif.bin ?? 'sfdx',
|
|
161
171
|
topicSeparator: this.config.pjson.oclif.topicSeparator,
|
|
162
172
|
state: this.config.pjson.oclif.state,
|
|
163
173
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/commandreference/generate.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,yBAAyB;AACzB,6BAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/commandreference/generate.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,kCAAkC;AAClC,2BAAgC;AAChC,yBAAyB;AACzB,6BAA6B;AAC7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AK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QAC5D,OAAO,EAAE,YAAY;KACtB,CAAC;IACF,OAAO,EAAE,YAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QACzD,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,CAAC,KAAK,CAAC;KACnB,CAAC;IACF,GAAG,EAAE,YAAK,CAAC,OAAO,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QACtD,SAAS,EAAE,CAAC,SAAS,CAAC;KACvB,CAAC;IACF,gBAAgB,EAAE,YAAK,CAAC,MAAM,CAAC;QAC7B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;QAChE,OAAO,EAAE,iBAAO,CAAC,MAAM;KACxB,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,CAAC;IACpF,eAAe,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC,EAAE,CAAC;CACtG,CAAC"}
|
|
@@ -19,11 +19,12 @@ class JitInstall extends sf_plugins_core_1.SfCommand {
|
|
|
19
19
|
async run() {
|
|
20
20
|
const { flags } = await this.parse(JitInstall);
|
|
21
21
|
this.styledHeader(`Install all JIT Plugins${flags['dry-run'] ? ' (dry-run)' : ''}`);
|
|
22
|
-
for (const [plugin, version] of Object.entries(this.config.pjson.oclif.jitPlugins)) {
|
|
22
|
+
for (const [plugin, version] of Object.entries(this.config.pjson.oclif.jitPlugins ?? {})) {
|
|
23
23
|
this.log(`• ${plugin} ${chalk.dim(version)}`);
|
|
24
24
|
if (flags['dry-run'])
|
|
25
25
|
continue;
|
|
26
26
|
try {
|
|
27
|
+
// eslint-disable-next-line no-await-in-loop
|
|
27
28
|
await this.config.runCommand('plugins:install', [`${plugin}@${version}`]);
|
|
28
29
|
}
|
|
29
30
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/jit/install.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,iEAA+D;AAC/D,2CAA4C;AAC5C,+BAA+B;AAE/B,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,sCAAsC,EAAE,aAAa,EAAE;IACpF,SAAS;IACT,UAAU;IACV,uBAAuB;CACxB,CAAC,CAAC;AAEH,MAAqB,UAAW,SAAQ,2BAAe;IAW9C,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAE/C,IAAI,CAAC,YAAY,CAAC,0BAA0B,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACpF,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/jit/install.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,iEAA+D;AAC/D,2CAA4C;AAC5C,+BAA+B;AAE/B,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,IAAI,CAAC,sCAAsC,EAAE,aA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D,CAAC;CACH,CAAC"}
|
|
@@ -15,6 +15,7 @@ class BaseDitamap extends ditamap_1.Ditamap {
|
|
|
15
15
|
namespaceDitamapFiles: topics.sort().map((topic) => ditamap_1.Ditamap.file(`${topic}/cli_reference_${topic}`, 'ditamap')),
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
+
// eslint-disable-next-line class-methods-use-this
|
|
18
19
|
getTemplateFileName() {
|
|
19
20
|
return 'base_ditamap.hbs';
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-ditamap.js","sourceRoot":"","sources":["../../src/ditamap/base-ditamap.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAEpC,MAAa,WAAY,SAAQ,iBAAO;IACtC,YAAmB,MAAgB;QACjC,sCAAsC;QACtC,KAAK,CAAC,iBAAO,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE;YAC9C,qBAAqB,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAO,CAAC,IAAI,CAAC,GAAG,KAAK,kBAAkB,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;SAChH,CAAC,CAAC;IACL,CAAC;
|
|
1
|
+
{"version":3,"file":"base-ditamap.js","sourceRoot":"","sources":["../../src/ditamap/base-ditamap.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAEpC,MAAa,WAAY,SAAQ,iBAAO;IACtC,YAAmB,MAAgB;QACjC,sCAAsC;QACtC,KAAK,CAAC,iBAAO,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE;YAC9C,qBAAqB,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAO,CAAC,IAAI,CAAC,GAAG,KAAK,kBAAkB,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;SAChH,CAAC,CAAC;IACL,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AAZD,kCAYC"}
|
|
@@ -20,6 +20,7 @@ class CLIReferenceTopic extends ditamap_1.Ditamap {
|
|
|
20
20
|
// Override destination to include topic and subtopic
|
|
21
21
|
this.destination = (0, path_1.join)(ditamap_1.Ditamap.outputDir, topic, filename);
|
|
22
22
|
}
|
|
23
|
+
// eslint-disable-next-line class-methods-use-this
|
|
23
24
|
getTemplateFileName() {
|
|
24
25
|
return 'cli_reference_topic.hbs';
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-reference-topic.js","sourceRoot":"","sources":["../../src/ditamap/cli-reference-topic.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,uCAAoC;AAEpC,MAAa,iBAAkB,SAAQ,iBAAO;IAC5C,YAAmB,KAAa,EAAE,eAAuB;QACvD,MAAM,QAAQ,GAAG,iBAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,EAAE,EAAE,KAAK,CAAC,CAAC;QAC/D,sCAAsC;QACtC,KAAK,CAAC,QAAQ,EAAE;YACd,KAAK;YACL,eAAe;SAChB,CAAC,CAAC;QAEH,qDAAqD;QACrD,IAAI,CAAC,WAAW,GAAG,IAAA,WAAI,EAAC,iBAAO,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-reference-topic.js","sourceRoot":"","sources":["../../src/ditamap/cli-reference-topic.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,uCAAoC;AAEpC,MAAa,iBAAkB,SAAQ,iBAAO;IAC5C,YAAmB,KAAa,EAAE,eAAuB;QACvD,MAAM,QAAQ,GAAG,iBAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,EAAE,EAAE,KAAK,CAAC,CAAC;QAC/D,sCAAsC;QACtC,KAAK,CAAC,QAAQ,EAAE;YACd,KAAK;YACL,eAAe;SAChB,CAAC,CAAC;QAEH,qDAAqD;QACrD,IAAI,CAAC,WAAW,GAAG,IAAA,WAAI,EAAC,iBAAO,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,yBAAyB,CAAC;IACnC,CAAC;CACF;AAjBD,8CAiBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-reference.js","sourceRoot":"","sources":["../../src/ditamap/cli-reference.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAEpC,MAAa,YAAa,SAAQ,iBAAO;IACvC;QACE,MAAM,QAAQ,GAAG,iBAAO,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QAEtD,KAAK,CAAC,QAAQ,EAAE;YACd,UAAU,EAAE,iBAAO,CAAC,UAAU;YAC9B,cAAc,EAAE,iBAAO,CAAC,cAAc;SACvC,CAAC,CAAC;IACL,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-reference.js","sourceRoot":"","sources":["../../src/ditamap/cli-reference.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAEpC,MAAa,YAAa,SAAQ,iBAAO;IACvC;QACE,MAAM,QAAQ,GAAG,iBAAO,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QAEtD,KAAK,CAAC,QAAQ,EAAE;YACd,UAAU,EAAE,iBAAO,CAAC,UAAU;YAC9B,cAAc,EAAE,iBAAO,CAAC,cAAc;SACvC,CAAC,CAAC;IACL,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,uBAAuB,CAAC;IACjC,CAAC;CACF;AAdD,oCAcC"}
|
package/lib/ditamap/command.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dictionary
|
|
1
|
+
import { Dictionary } from '@salesforce/ts-types';
|
|
2
2
|
import { CommandClass } from '../utils';
|
|
3
3
|
import { Ditamap } from './ditamap';
|
|
4
4
|
export type CommandHelpInfo = {
|
|
@@ -13,7 +13,7 @@ export type CommandHelpInfo = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare class Command extends Ditamap {
|
|
15
15
|
private flags;
|
|
16
|
-
constructor(topic: string, subtopic: string, command: CommandClass, commandMeta?:
|
|
16
|
+
constructor(topic: string, subtopic: string | null, command: CommandClass, commandMeta?: Record<string, unknown>);
|
|
17
17
|
getParametersForTemplate(flags: Dictionary<CommandHelpInfo>): Promise<CommandHelpInfo[]>;
|
|
18
18
|
getTemplateFileName(): string;
|
|
19
19
|
protected transformToDitamap(): Promise<string>;
|
package/lib/ditamap/command.js
CHANGED
|
@@ -12,10 +12,10 @@ const ts_types_1 = require("@salesforce/ts-types");
|
|
|
12
12
|
const utils_1 = require("../utils");
|
|
13
13
|
const ditamap_1 = require("./ditamap");
|
|
14
14
|
const getDefault = async (flag) => {
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
15
|
+
if (!flag) {
|
|
16
|
+
return '';
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
if (typeof flag.default === 'function') {
|
|
19
19
|
try {
|
|
20
20
|
const help = await flag.default();
|
|
21
21
|
return help || '';
|
|
@@ -25,7 +25,7 @@ const getDefault = async (flag) => {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
return
|
|
28
|
+
return flag.default;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
class Command extends ditamap_1.Ditamap {
|
|
@@ -42,25 +42,31 @@ class Command extends ditamap_1.Ditamap {
|
|
|
42
42
|
let trailblazerCommunityUrl;
|
|
43
43
|
let trailblazerCommunityName;
|
|
44
44
|
if (commandMeta.trailblazerCommunityLink) {
|
|
45
|
-
const community =
|
|
46
|
-
trailblazerCommunityUrl = community.url;
|
|
47
|
-
trailblazerCommunityName = community.name;
|
|
45
|
+
const community = commandMeta.trailblazerCommunityLink;
|
|
46
|
+
trailblazerCommunityUrl = community.url ?? 'unknown';
|
|
47
|
+
trailblazerCommunityName = community.name ?? 'unknown';
|
|
48
48
|
}
|
|
49
|
-
const commandName =
|
|
50
|
-
const examples = (command.examples
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
const commandName = command.id.replace(/:/g, (0, ts_types_1.asString)(commandMeta.topicSeparator, ':'));
|
|
50
|
+
const examples = (command.examples ?? []).map((example) => {
|
|
51
|
+
let desc;
|
|
52
|
+
let commands;
|
|
53
|
+
if (typeof example === 'string') {
|
|
54
|
+
const parts = example.split('\n');
|
|
55
|
+
desc = parts.length > 1 ? parts[0] : null;
|
|
56
|
+
commands = parts.length > 1 ? parts.slice(1) : [parts[0]];
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
desc = example.description;
|
|
60
|
+
commands = [example.command];
|
|
61
|
+
}
|
|
54
62
|
return {
|
|
55
63
|
description: desc,
|
|
56
|
-
commands: commands.map((c) =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.replace(/<%= command.id %>/g, commandName);
|
|
60
|
-
}),
|
|
64
|
+
commands: commands.map((c) => c
|
|
65
|
+
.replace(/<%= config.bin %>/g, (0, ts_types_1.asString)(commandMeta.binary, 'unknown'))
|
|
66
|
+
.replace(/<%= command.id %>/g, commandName)),
|
|
61
67
|
};
|
|
62
68
|
});
|
|
63
|
-
const state = command.state
|
|
69
|
+
const state = command.state ?? commandMeta.state;
|
|
64
70
|
this.data = Object.assign(command, {
|
|
65
71
|
name: commandName,
|
|
66
72
|
binary: commandMeta.binary,
|
|
@@ -81,22 +87,24 @@ class Command extends ditamap_1.Ditamap {
|
|
|
81
87
|
async getParametersForTemplate(flags) {
|
|
82
88
|
const final = [];
|
|
83
89
|
for (const [flagName, flag] of Object.entries(flags)) {
|
|
84
|
-
if (flag
|
|
90
|
+
if (flag?.hidden)
|
|
85
91
|
continue;
|
|
86
|
-
const description = Array.isArray(flag
|
|
87
|
-
const entireDescription = flag
|
|
92
|
+
const description = Array.isArray(flag?.description) ? flag?.description.join('\n') : flag?.description ?? '';
|
|
93
|
+
const entireDescription = flag?.summary ? `${flag.summary}\n${description}` : description;
|
|
88
94
|
const updated = Object.assign({}, flag, {
|
|
89
95
|
name: flagName,
|
|
90
96
|
description: this.formatParagraphs(entireDescription),
|
|
91
|
-
optional: !flag
|
|
92
|
-
kind: flag
|
|
93
|
-
hasValue: flag
|
|
97
|
+
optional: !flag?.required,
|
|
98
|
+
kind: flag?.kind ?? flag?.type,
|
|
99
|
+
hasValue: flag?.type !== 'boolean',
|
|
100
|
+
// eslint-disable-next-line no-await-in-loop
|
|
94
101
|
defaultFlagValue: await getDefault(flag),
|
|
95
102
|
});
|
|
96
103
|
final.push(updated);
|
|
97
104
|
}
|
|
98
105
|
return final;
|
|
99
106
|
}
|
|
107
|
+
// eslint-disable-next-line class-methods-use-this
|
|
100
108
|
getTemplateFileName() {
|
|
101
109
|
return 'command.hbs';
|
|
102
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/ditamap/command.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/ditamap/command.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,mDAAwF;AACxF,oCAAmD;AACnD,uCAAoC;AAapC,MAAM,UAAU,GAAG,KAAK,EAAE,IAAsB,EAAmB,EAAE;IACnE,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,EAAE,CAAC;KACX;IACD,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,EAAE;QACtC,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAA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AK,SAAS;gBAClC,4CAA4C;gBAC5C,gBAAgB,EAAE,MAAM,UAAU,CAAC,IAAI,CAAC;aACzC,CAAC,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACrB;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,aAAa,CAAC;IACvB,CAAC;IAES,KAAK,CAAC,kBAAkB;QAChC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QACzD,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACpC,CAAC;CACF;AA7GD,0BA6GC"}
|
package/lib/ditamap/ditamap.d.ts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import { JsonMap } from '@salesforce/ts-types';
|
|
2
1
|
export declare abstract class Ditamap {
|
|
3
2
|
private filename;
|
|
4
|
-
protected data:
|
|
3
|
+
protected data: Record<string, unknown>;
|
|
5
4
|
static SUFFIX: string;
|
|
6
5
|
static templatesDir: string;
|
|
7
6
|
static outputDir: string;
|
|
8
7
|
static cliVersion: string;
|
|
9
|
-
static plugins:
|
|
8
|
+
static plugins: Record<string, unknown>;
|
|
10
9
|
static pluginVersions: Array<{
|
|
11
10
|
name: string;
|
|
12
11
|
version: string;
|
|
13
12
|
}>;
|
|
13
|
+
private static _suffix;
|
|
14
|
+
protected destination: string;
|
|
15
|
+
private readonly source;
|
|
16
|
+
constructor(filename: string, data: Record<string, unknown>);
|
|
14
17
|
static get suffix(): string;
|
|
15
18
|
static set suffix(suffix: string);
|
|
16
19
|
static file(name: string, ext: string): string;
|
|
17
|
-
private static _suffix;
|
|
18
|
-
protected destination: string;
|
|
19
|
-
private source;
|
|
20
|
-
constructor(filename: string, data: JsonMap);
|
|
21
|
-
abstract getTemplateFileName(): string;
|
|
22
20
|
getFilename(): string;
|
|
23
21
|
getOutputFilePath(): string;
|
|
24
22
|
write(): Promise<void>;
|
|
@@ -31,4 +29,5 @@ export declare abstract class Ditamap {
|
|
|
31
29
|
* @returns {object}
|
|
32
30
|
*/
|
|
33
31
|
protected transformToDitamap(): Promise<string>;
|
|
32
|
+
abstract getTemplateFileName(): string;
|
|
34
33
|
}
|
package/lib/ditamap/ditamap.js
CHANGED
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.Ditamap = void 0;
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const fs = require("fs/promises");
|
|
12
|
-
const mkdirp = require("mkdirp");
|
|
13
12
|
const debugCreator = require("debug");
|
|
14
13
|
const hb = require("handlebars");
|
|
15
14
|
const debug = debugCreator('commandreference');
|
|
@@ -26,14 +25,20 @@ hb.registerHelper('uniqueId', (...strings) => {
|
|
|
26
25
|
/*
|
|
27
26
|
* Returns true if the string should be formatted as code block in docs
|
|
28
27
|
*/
|
|
29
|
-
//
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
29
|
hb.registerHelper('isCodeBlock', function (val, options) {
|
|
31
|
-
return val.
|
|
30
|
+
return val.startsWith('sf') || val.startsWith('sfdx') || val.includes('$') || val.includes('>>')
|
|
32
31
|
? options.fn(this)
|
|
33
32
|
: options.inverse(this);
|
|
34
33
|
});
|
|
35
34
|
hb.registerHelper('nextVersion', (value) => parseInt(value, 2) + 1);
|
|
36
35
|
class Ditamap {
|
|
36
|
+
constructor(filename, data) {
|
|
37
|
+
this.filename = filename;
|
|
38
|
+
this.data = data;
|
|
39
|
+
this.source = (0, path_1.join)(Ditamap.templatesDir, this.getTemplateFileName());
|
|
40
|
+
this.destination = (0, path_1.join)(Ditamap.outputDir, filename);
|
|
41
|
+
}
|
|
37
42
|
static get suffix() {
|
|
38
43
|
return Ditamap._suffix;
|
|
39
44
|
}
|
|
@@ -43,12 +48,6 @@ class Ditamap {
|
|
|
43
48
|
static file(name, ext) {
|
|
44
49
|
return Ditamap.suffix ? `${name}_${Ditamap.suffix}.${ext}` : `${name}.${ext}`;
|
|
45
50
|
}
|
|
46
|
-
constructor(filename, data) {
|
|
47
|
-
this.filename = filename;
|
|
48
|
-
this.data = data;
|
|
49
|
-
this.source = (0, path_1.join)(Ditamap.templatesDir, this.getTemplateFileName());
|
|
50
|
-
this.destination = (0, path_1.join)(Ditamap.outputDir, filename);
|
|
51
|
-
}
|
|
52
51
|
getFilename() {
|
|
53
52
|
return this.filename;
|
|
54
53
|
}
|
|
@@ -56,10 +55,11 @@ class Ditamap {
|
|
|
56
55
|
return this.destination;
|
|
57
56
|
}
|
|
58
57
|
async write() {
|
|
59
|
-
await
|
|
58
|
+
await fs.mkdir((0, path_1.dirname)(this.destination), { recursive: true });
|
|
60
59
|
const output = await this.transformToDitamap();
|
|
61
60
|
await fs.writeFile(this.destination, output);
|
|
62
61
|
}
|
|
62
|
+
// eslint-disable-next-line class-methods-use-this
|
|
63
63
|
formatParagraphs(textToFormat) {
|
|
64
64
|
return textToFormat ? textToFormat.split('\n').filter((n) => n !== '') : [];
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ditamap.js","sourceRoot":"","sources":["../../src/ditamap/ditamap.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAAqC;AACrC,kCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"ditamap.js","sourceRoot":"","sources":["../../src/ditamap/ditamap.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAAqC;AACrC,kCAAkC;AAClC,sCAAsC;AACtC,iCAAiC;AAGjC,MAAM,KAAK,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAE/C,EAAE,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,GAAW,EAAE,EAAE,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ACL,CAAC;
|
|
1
|
+
{"version":3,"file":"help-reference.js","sourceRoot":"","sources":["../../src/ditamap/help-reference.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAEpC,MAAa,aAAc,SAAQ,iBAAO;IACxC;QACE,sCAAsC;QACtC,MAAM,QAAQ,GAAG,iBAAO,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;AAbD,sCAaC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { JsonMap } from '@salesforce/ts-types';
|
|
2
1
|
import { Ditamap } from './ditamap';
|
|
3
2
|
export declare class MainTopicIntro extends Ditamap {
|
|
4
|
-
constructor(topic: string, subtopic: string, subTopicMeta:
|
|
3
|
+
constructor(topic: string, subtopic: string, subTopicMeta: Record<string, unknown>);
|
|
5
4
|
getTemplateFileName(): string;
|
|
6
5
|
}
|
|
@@ -17,9 +17,9 @@ class MainTopicIntro extends ditamap_1.Ditamap {
|
|
|
17
17
|
let trailblazerCommunityUrl;
|
|
18
18
|
let trailblazerCommunityName;
|
|
19
19
|
if (subTopicMeta.trailblazerCommunityLink) {
|
|
20
|
-
const community = (0, ts_types_1.
|
|
21
|
-
trailblazerCommunityUrl = community.url;
|
|
22
|
-
trailblazerCommunityName = community.name;
|
|
20
|
+
const community = (0, ts_types_1.ensureObject)(subTopicMeta.trailblazerCommunityLink);
|
|
21
|
+
trailblazerCommunityUrl = community.url ?? 'unknown';
|
|
22
|
+
trailblazerCommunityName = community.name ?? 'unknown';
|
|
23
23
|
}
|
|
24
24
|
if (!subTopicMeta.longDescription && !subTopicMeta.external) {
|
|
25
25
|
subTopicMeta.longDescription = (0, utils_1.punctuate)((0, ts_types_1.asString)(subTopicMeta.description));
|
|
@@ -35,6 +35,7 @@ class MainTopicIntro extends ditamap_1.Ditamap {
|
|
|
35
35
|
});
|
|
36
36
|
this.destination = (0, path_1.join)(ditamap_1.Ditamap.outputDir, topic, filename);
|
|
37
37
|
}
|
|
38
|
+
// eslint-disable-next-line class-methods-use-this
|
|
38
39
|
getTemplateFileName() {
|
|
39
40
|
return 'main_topic_intro.hbs';
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main-topic-intro.js","sourceRoot":"","sources":["../../src/ditamap/main-topic-intro.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"main-topic-intro.js","sourceRoot":"","sources":["../../src/ditamap/main-topic-intro.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,mDAA8D;AAC9D,oCAAqC;AACrC,uCAAoC;AAEpC,MAAa,cAAe,SAAQ,iBAAO;IACzC,YAAmB,KAAa,EAAE,QAAgB,EAAE,YAAqC;QACvF,MAAM,QAAQ,GAAG,iBAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,IAAI,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;QAE3E,IAAI,uBAA2C,CAAC;QAChD,IAAI,wBAA4C,CAAC;QACjD,IAAI,YAAY,CAAC,wBAAwB,EAAE;YACzC,MAAM,SAAS,GAAG,IAAA,uBAAY,EAA0B,YAAY,CAAC,wBAAwB,CAG5F,CAAC;YACF,uBAAuB,GAAG,SAAS,CAAC,GAAG,IAAI,SAAS,CAAC;YACrD,wBAAwB,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC;SACxD;QAED,IAAI,CAAC,YAAY,CAAC,eAAe,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;YAC3D,YAAY,CAAC,eAAe,GAAG,IAAA,iBAAS,EAAC,IAAA,mBAAQ,EAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;SAC9E;QAED,KAAK,CAAC,QAAQ,EAAE;YACd,KAAK,EAAE,QAAQ;YACf,eAAe,EAAE,YAAY,CAAC,eAAe;YAC7C,gBAAgB,EAAE,YAAY,CAAC,KAAK,KAAK,WAAW;YACpD,kBAAkB,EAAE,YAAY,CAAC,KAAK,KAAK,aAAa;YACxD,WAAW,EAAE,YAAY,CAAC,KAAK,KAAK,MAAM;YAC1C,uBAAuB;YACvB,wBAAwB;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,GAAG,IAAA,WAAI,EAAC,iBAAO,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,sBAAsB,CAAC;IAChC,CAAC;CACF;AApCD,wCAoCC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { JsonMap } from '@salesforce/ts-types';
|
|
2
1
|
import { Ditamap } from './ditamap';
|
|
3
2
|
export declare class TopicCommands extends Ditamap {
|
|
4
|
-
constructor(topic: string, topicMeta:
|
|
3
|
+
constructor(topic: string, topicMeta: Record<string, unknown>);
|
|
5
4
|
getTemplateFileName(): string;
|
|
6
5
|
}
|
|
@@ -17,6 +17,7 @@ class TopicCommands extends ditamap_1.Ditamap {
|
|
|
17
17
|
// Override destination to include topic and subtopic
|
|
18
18
|
this.destination = (0, path_1.join)(ditamap_1.Ditamap.outputDir, topic, filename);
|
|
19
19
|
}
|
|
20
|
+
// eslint-disable-next-line class-methods-use-this
|
|
20
21
|
getTemplateFileName() {
|
|
21
22
|
return 'cli_reference_topic_commands.hbs';
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic-commands.js","sourceRoot":"","sources":["../../src/ditamap/topic-commands.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;
|
|
1
|
+
{"version":3,"file":"topic-commands.js","sourceRoot":"","sources":["../../src/ditamap/topic-commands.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,uCAAoC;AAEpC,MAAa,aAAc,SAAQ,iBAAO;IACxC,YAAmB,KAAa,EAAE,SAAkC;QAClE,MAAM,QAAQ,GAAG,iBAAO,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,IAAA,WAAI,EAAC,iBAAO,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAED,kDAAkD;IAC3C,mBAAmB;QACxB,OAAO,kCAAkC,CAAC;IAC5C,CAAC;CACF;AAdD,sCAcC"}
|
|
@@ -18,6 +18,7 @@ class TopicDitamap extends ditamap_1.Ditamap {
|
|
|
18
18
|
// Override destination to include topic and subtopic
|
|
19
19
|
this.destination = (0, path_1.join)(ditamap_1.Ditamap.outputDir, topic, filename);
|
|
20
20
|
}
|
|
21
|
+
// eslint-disable-next-line class-methods-use-this
|
|
21
22
|
getTemplateFileName() {
|
|
22
23
|
return 'topic_ditamap.hbs';
|
|
23
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"topic-ditamap.js","sourceRoot":"","sources":["../../src/ditamap/topic-ditamap.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA4B;AAC5B,uCAAoC;AAEpC,MAAa,YAAa,SAAQ,iBAAO;IACvC,YAAmB,KAAa,EAAE,UAAoB;QACpD,MAAM,QAAQ,GAAG,iBAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;QACnE,sCAAsC;QACtC,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,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} from '@salesforce/ts-types';
|
|
2
2
|
import { CommandClass } from './utils';
|
|
3
3
|
export declare class Docs {
|
|
4
4
|
private outputDir;
|
|
@@ -6,9 +6,9 @@ export declare class Docs {
|
|
|
6
6
|
private hidden;
|
|
7
7
|
private topicMeta;
|
|
8
8
|
private cliMeta;
|
|
9
|
-
constructor(outputDir: string, plugins:
|
|
9
|
+
constructor(outputDir: string, plugins: Record<string, unknown>, hidden: boolean, topicMeta: Record<string, unknown>, cliMeta: Record<string, unknown>);
|
|
10
10
|
build(commands: CommandClass[]): Promise<void>;
|
|
11
|
-
populateTopic(topic: string, subtopics: Dictionary<CommandClass | CommandClass[]>): Promise<
|
|
11
|
+
populateTopic(topic: string, subtopics: Dictionary<CommandClass | CommandClass[]>): Promise<AnyJson[]>;
|
|
12
12
|
/**
|
|
13
13
|
* Group all commands by the top level topic and then subtopic. e.g. force, analytics, evergreen, etc
|
|
14
14
|
* then org, apex, etc within the force namespace.
|
package/lib/docs.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.Docs = void 0;
|
|
10
|
-
const
|
|
10
|
+
const fs = require("fs/promises");
|
|
11
11
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
12
12
|
const chalk = require("chalk");
|
|
13
13
|
const base_ditamap_1 = require("./ditamap/base-ditamap");
|
|
@@ -30,17 +30,21 @@ class Docs {
|
|
|
30
30
|
}
|
|
31
31
|
async build(commands) {
|
|
32
32
|
// Create if doesn't exist
|
|
33
|
-
await
|
|
33
|
+
await fs.mkdir(this.outputDir, { recursive: true });
|
|
34
34
|
await this.populateTemplate(commands);
|
|
35
35
|
}
|
|
36
36
|
async populateTopic(topic, subtopics) {
|
|
37
|
-
|
|
37
|
+
if (!this.topicMeta?.[topic]) {
|
|
38
|
+
throw new Error(`No topic meta for ${topic} - add this topic to the oclif section of the package.json.`);
|
|
39
|
+
}
|
|
40
|
+
const topicMeta = (this.topicMeta[topic] ?? {});
|
|
38
41
|
let description = (0, ts_types_1.asString)(topicMeta.description);
|
|
39
42
|
if (!description && !topicMeta.external) {
|
|
43
|
+
// TODO: check why the same property is used again when it is already used above
|
|
40
44
|
description = (0, utils_1.punctuate)((0, ts_types_1.asString)(topicMeta.description));
|
|
41
45
|
if (!description) {
|
|
42
46
|
utils_1.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.`);
|
|
43
|
-
return;
|
|
47
|
+
return [];
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
const subTopicNames = [];
|
|
@@ -54,11 +58,12 @@ class Docs {
|
|
|
54
58
|
// If it is not subtopic (array) it is a command in the top-level topic
|
|
55
59
|
const command = Object.assign({}, subtopicOrCommand);
|
|
56
60
|
const commandMeta = this.resolveCommandMeta((0, ts_types_1.ensureString)(command.id), command, 1);
|
|
61
|
+
// eslint-disable-next-line no-await-in-loop
|
|
57
62
|
await this.populateCommand(topic, null, command, commandMeta);
|
|
58
63
|
commandIds.push(command.id);
|
|
59
64
|
continue;
|
|
60
65
|
}
|
|
61
|
-
const subTopicsMeta = (0, ts_types_1.
|
|
66
|
+
const subTopicsMeta = (0, ts_types_1.ensureObject)(topicMeta.subtopics);
|
|
62
67
|
if (!subTopicsMeta[subtopic]) {
|
|
63
68
|
emitNoTopicMetadataWarning(`${topic}:${subtopic}`);
|
|
64
69
|
continue;
|
|
@@ -67,18 +72,20 @@ class Docs {
|
|
|
67
72
|
// Commands within the sub topic
|
|
68
73
|
for (const command of subtopicOrCommand) {
|
|
69
74
|
const fullTopic = (0, ts_types_1.ensureString)(command.id).replace(/:\w+$/, '');
|
|
70
|
-
const commandsInFullTopic = subtopicOrCommand.filter((cmd) => (0, ts_types_1.ensureString)(cmd.id).
|
|
75
|
+
const commandsInFullTopic = subtopicOrCommand.filter((cmd) => (0, ts_types_1.ensureString)(cmd.id).startsWith(fullTopic));
|
|
71
76
|
const commandMeta = this.resolveCommandMeta((0, ts_types_1.ensureString)(command.id), command, commandsInFullTopic.length);
|
|
77
|
+
// eslint-disable-next-line no-await-in-loop
|
|
72
78
|
await this.populateCommand(topic, subtopic, command, commandMeta);
|
|
73
79
|
commandIds.push(command.id);
|
|
74
80
|
}
|
|
75
81
|
}
|
|
76
82
|
catch (error) {
|
|
77
|
-
|
|
83
|
+
const err = error instanceof Error ? error : typeof error === 'string' ? new Error(error) : new Error('Unknown error');
|
|
84
|
+
if (err.name === 'UnexpectedValueTypeError') {
|
|
78
85
|
emitNoTopicMetadataWarning(`${topic}:${subtopic}`);
|
|
79
86
|
}
|
|
80
87
|
else {
|
|
81
|
-
utils_1.events.emit('warning', `Can't create topic for ${topic}:${subtopic}: ${
|
|
88
|
+
utils_1.events.emit('warning', `Can't create topic for ${topic}:${subtopic}: ${err.message}\n`);
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
}
|
|
@@ -107,7 +114,7 @@ class Docs {
|
|
|
107
114
|
if (plugin && this.plugins[plugin.name]) {
|
|
108
115
|
// Also include the namespace on the commands so we don't need to do the split at other times in the code.
|
|
109
116
|
command.topic = topLevelTopic;
|
|
110
|
-
const topics = topLevelTopics[topLevelTopic]
|
|
117
|
+
const topics = topLevelTopics[topLevelTopic] ?? {};
|
|
111
118
|
if (commandParts.length === 1) {
|
|
112
119
|
// This is a top-level topic that is also a command
|
|
113
120
|
topics[commandParts[0]] = command;
|
|
@@ -119,18 +126,20 @@ class Docs {
|
|
|
119
126
|
else {
|
|
120
127
|
const subtopic = commandParts[1];
|
|
121
128
|
try {
|
|
122
|
-
const topicMeta = (0, ts_types_1.
|
|
123
|
-
const subTopicsMeta = (0, ts_types_1.
|
|
129
|
+
const topicMeta = (0, ts_types_1.ensureObject)(this.topicMeta[topLevelTopic]);
|
|
130
|
+
const subTopicsMeta = (0, ts_types_1.ensureObject)(topicMeta.subtopics);
|
|
124
131
|
if (subTopicsMeta.hidden && !this.hidden) {
|
|
125
132
|
continue;
|
|
126
133
|
}
|
|
127
134
|
}
|
|
128
|
-
catch (e) {
|
|
135
|
+
catch (e) {
|
|
136
|
+
// It means no meta so it isn't hidden, although it should always fail before here with no meta found
|
|
137
|
+
}
|
|
129
138
|
command.subtopic = subtopic;
|
|
130
139
|
const existingSubTopics = topics[subtopic];
|
|
131
140
|
let subtopicCommands = [];
|
|
132
141
|
if (existingSubTopics) {
|
|
133
|
-
subtopicCommands = (0, ts_types_1.
|
|
142
|
+
subtopicCommands = (0, ts_types_1.ensureArray)(existingSubTopics);
|
|
134
143
|
}
|
|
135
144
|
(0, ts_types_1.ensureArray)(subtopicCommands);
|
|
136
145
|
subtopicCommands.push(command);
|
|
@@ -151,6 +160,7 @@ class Docs {
|
|
|
151
160
|
for (const topic of topics) {
|
|
152
161
|
utils_1.events.emit('topic', { topic });
|
|
153
162
|
const subtopics = (0, ts_types_1.ensure)(topicsAndSubtopics[topic]);
|
|
163
|
+
// eslint-disable-next-line no-await-in-loop
|
|
154
164
|
await this.populateTopic(topic, subtopics);
|
|
155
165
|
}
|
|
156
166
|
}
|
|
@@ -163,32 +173,28 @@ class Docs {
|
|
|
163
173
|
let currentMeta;
|
|
164
174
|
for (part of commandParts) {
|
|
165
175
|
if (currentMeta) {
|
|
166
|
-
const subtopics = (0, ts_types_1.
|
|
167
|
-
currentMeta = (0, ts_types_1.
|
|
176
|
+
const subtopics = (0, ts_types_1.ensureObject)(currentMeta.subtopics);
|
|
177
|
+
currentMeta = (0, ts_types_1.ensureObject)(subtopics[part]);
|
|
168
178
|
}
|
|
169
179
|
else {
|
|
170
|
-
currentMeta = (0, ts_types_1.
|
|
180
|
+
currentMeta = (0, ts_types_1.ensureObject)(this.topicMeta[part]);
|
|
171
181
|
}
|
|
172
182
|
// Collect all tiers of the meta, so the command will also pick up the topic state (isPilot, etc) if applicable
|
|
173
183
|
Object.assign({}, commandMeta, currentMeta);
|
|
174
184
|
}
|
|
175
185
|
}
|
|
176
186
|
catch (error) {
|
|
187
|
+
// @ts-expect-error: part may be undefined
|
|
177
188
|
if (commandId.endsWith(part)) {
|
|
178
189
|
// This means there wasn't meta information going all the way down to the command, which is ok.
|
|
179
190
|
return commandMeta;
|
|
180
191
|
}
|
|
181
|
-
else {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if (!commandMeta.description) {
|
|
188
|
-
commandMeta.description = command.description;
|
|
189
|
-
commandMeta.longDescription = command.longDescription || (0, utils_1.punctuate)(command.description);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
+
else if (commandsInTopic !== 1) {
|
|
193
|
+
utils_1.events.emit('warning', `subtopic "${part}" meta not found for command ${commandId}`);
|
|
194
|
+
}
|
|
195
|
+
else if (!commandMeta.description) {
|
|
196
|
+
commandMeta.description = command.description;
|
|
197
|
+
commandMeta.longDescription = (command.longDescription ? command.longDescription : (0, utils_1.punctuate)(command.description));
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
200
|
return commandMeta;
|
package/lib/docs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,kCAAkC;AAClC,mDAS8B;AAC9B,+BAA+B;AAC/B,yDAAqD;AACrD,2DAAuD;AACvD,+CAA4C;AAC5C,6DAAyD;AACzD,2DAAuD;AACvD,mCAA0D;AAC1D,6DAAyD;AAEzD,SAAS,0BAA0B,CAAC,KAAa;IAC/C,cAAM,CAAC,IAAI,CACT,SAAS,EACT,yBAAyB,KAAK,CAAC,IAAI,CACjC,KAAK,CACN,+GAA+G,CACjH,CAAC;AACJ,CAAC;AAED,MAAa,IAAI;IACf,YACU,SAAiB,EACjB,OAAgC,EAChC,MAAe,EACf,SA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EAAC,OAAO,CAAC,WAAW,CAAC,CACxE,CAAC;aACd;SACF;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;YAClC,OAAO,EAAE,CAAC;SACX;QAED,MAAM,cAAc,GAAG,IAAI,iBAAO,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;AArOD,oBAqOC"}
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import { Dictionary, JsonMap } from '@salesforce/ts-types';
|
|
4
3
|
import { Command } from '@oclif/core';
|
|
5
4
|
export type CommandClass = Command.Class & {
|
|
6
5
|
topic: string;
|
|
7
6
|
subtopic: string;
|
|
8
|
-
} &
|
|
7
|
+
} & Record<string, unknown>;
|
|
9
8
|
export declare const events: EventEmitter;
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function punctuate(description: string): string;
|
|
9
|
+
export declare function punctuate(description?: string): string | undefined;
|
|
12
10
|
export declare function helpFromDescription(description: string): string;
|
package/lib/utils.js
CHANGED
|
@@ -6,30 +6,17 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.helpFromDescription = exports.punctuate = exports.
|
|
9
|
+
exports.helpFromDescription = exports.punctuate = exports.events = void 0;
|
|
10
10
|
const events_1 = require("events");
|
|
11
11
|
const os_1 = require("os");
|
|
12
|
-
const ts_types_1 = require("@salesforce/ts-types");
|
|
13
12
|
exports.events = new events_1.EventEmitter();
|
|
14
|
-
function mergeDeep(target, source) {
|
|
15
|
-
Object.keys(source).forEach((key) => {
|
|
16
|
-
if ((0, ts_types_1.isObject)(target[key]) && (0, ts_types_1.isObject)(source[key])) {
|
|
17
|
-
mergeDeep(target[key], source[key]);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
target[key] = source[key];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
return target;
|
|
24
|
-
}
|
|
25
|
-
exports.mergeDeep = mergeDeep;
|
|
26
13
|
function punctuate(description) {
|
|
27
14
|
if (!description)
|
|
28
15
|
return description;
|
|
29
16
|
const lines = description.split(os_1.EOL);
|
|
30
17
|
let mainDescription = lines[0];
|
|
31
18
|
mainDescription = mainDescription.charAt(0).toUpperCase() + mainDescription.substring(1);
|
|
32
|
-
if (mainDescription.
|
|
19
|
+
if (!mainDescription.endsWith('.')) {
|
|
33
20
|
mainDescription += '.';
|
|
34
21
|
}
|
|
35
22
|
return mainDescription;
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAsC;AACtC,2BAAyB;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAsC;AACtC,2BAAyB;AAKZ,QAAA,MAAM,GAAG,IAAI,qBAAY,EAAE,CAAC;AAEzC,SAAgB,SAAS,CAAC,WAAoB;IAC5C,IAAI,CAAC,WAAW;QAAE,OAAO,WAAW,CAAC;IAErC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,QAAG,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;QAClC,eAAe,IAAI,GAAG,CAAC;KACxB;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAbD,8BAaC;AAED,SAAgB,mBAAmB,CAAC,WAAmB;IACrD,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,QAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7E,CAAC;AAFD,kDAEC"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-command-reference",
|
|
3
3
|
"description": "Generate the Salesforce CLI command reference guide",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.2",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/salesforcecli/plugin-command-reference/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@oclif/core": "^2.
|
|
9
|
-
"@salesforce/core": "^3.
|
|
10
|
-
"@salesforce/kit": "^1.
|
|
11
|
-
"@salesforce/sf-plugins-core": "^2.
|
|
8
|
+
"@oclif/core": "^2.8.2",
|
|
9
|
+
"@salesforce/core": "^3.34.7",
|
|
10
|
+
"@salesforce/kit": "^1.9.2",
|
|
11
|
+
"@salesforce/sf-plugins-core": "^2.2.9",
|
|
12
12
|
"@salesforce/ts-types": "^1.7.1",
|
|
13
13
|
"chalk": "^3.0.0",
|
|
14
|
-
"fs-extra": "^10.0.1",
|
|
15
14
|
"handlebars": "^4.7.7",
|
|
16
15
|
"lodash.uniqby": "^4.7.0",
|
|
17
16
|
"mkdirp": "^1.0.4",
|
|
18
17
|
"tslib": "^2"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
|
-
"@oclif/plugin-help": "^5.
|
|
20
|
+
"@oclif/plugin-help": "^5.2.9",
|
|
22
21
|
"@salesforce/dev-config": "^3.1.0",
|
|
23
|
-
"@salesforce/dev-scripts": "^
|
|
24
|
-
"@salesforce/plugin-
|
|
22
|
+
"@salesforce/dev-scripts": "^4.3.0",
|
|
23
|
+
"@salesforce/plugin-auth": "^2.7.12",
|
|
25
24
|
"@salesforce/prettier-config": "^0.0.2",
|
|
25
|
+
"@types/debug": "^4.1.7",
|
|
26
26
|
"@types/fs-extra": "^9.0.13",
|
|
27
27
|
"@types/lodash.uniqby": "^4.7.6",
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
29
|
-
"@typescript-eslint/parser": "^
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
29
|
+
"@typescript-eslint/parser": "^5.59.0",
|
|
30
30
|
"chai": "^4.2.0",
|
|
31
|
-
"eslint": "^
|
|
32
|
-
"eslint-config-prettier": "^
|
|
33
|
-
"eslint-config-salesforce": "^
|
|
34
|
-
"eslint-config-salesforce-license": "^0.
|
|
35
|
-
"eslint-config-salesforce-typescript": "^
|
|
31
|
+
"eslint": "^8.38.0",
|
|
32
|
+
"eslint-config-prettier": "^8.8.0",
|
|
33
|
+
"eslint-config-salesforce": "^1.2.0",
|
|
34
|
+
"eslint-config-salesforce-license": "^0.2.0",
|
|
35
|
+
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
36
36
|
"eslint-plugin-header": "^3.0.0",
|
|
37
|
-
"eslint-plugin-import": "2.
|
|
38
|
-
"eslint-plugin-jsdoc": "^
|
|
39
|
-
"eslint-plugin-prettier": "^3.1.3",
|
|
37
|
+
"eslint-plugin-import": "^2.27.5",
|
|
38
|
+
"eslint-plugin-jsdoc": "^43.0.7",
|
|
40
39
|
"husky": "^7.0.4",
|
|
41
|
-
"mocha": "^
|
|
40
|
+
"mocha": "^10.2.0",
|
|
42
41
|
"nyc": "^15.1.0",
|
|
43
|
-
"oclif": "^3.
|
|
44
|
-
"prettier": "^2.
|
|
42
|
+
"oclif": "^3.8.1",
|
|
43
|
+
"prettier": "^2.8.7",
|
|
45
44
|
"pretty-quick": "^3.1.0",
|
|
46
45
|
"shx": "^0.3.3",
|
|
47
46
|
"sinon": "10.0.0",
|
|
48
47
|
"ts-node": "^10.0.0",
|
|
49
|
-
"typescript": "^4.
|
|
48
|
+
"typescript": "^4.9.5",
|
|
49
|
+
"wireit": "^0.9.5"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=14.0.0"
|
|
@@ -78,30 +78,134 @@
|
|
|
78
78
|
},
|
|
79
79
|
"devPlugins": [
|
|
80
80
|
"@oclif/plugin-help",
|
|
81
|
-
"@salesforce/plugin-
|
|
81
|
+
"@salesforce/plugin-auth"
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
"repository": "salesforcecli/plugin-command-reference",
|
|
85
85
|
"scripts": {
|
|
86
|
-
"build": "
|
|
86
|
+
"build": "wireit",
|
|
87
87
|
"clean": "sf-clean",
|
|
88
88
|
"clean-all": "sf-clean all",
|
|
89
|
-
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
|
|
90
|
-
"
|
|
91
|
-
"compile": "sf-compile",
|
|
89
|
+
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -rf test/tmp && shx rm -f oclif.manifest.json",
|
|
90
|
+
"compile": "wireit",
|
|
92
91
|
"docs": "sf-docs",
|
|
93
|
-
"format": "
|
|
94
|
-
"lint": "
|
|
92
|
+
"format": "wireit",
|
|
93
|
+
"lint": "wireit",
|
|
95
94
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
96
|
-
"posttest": "yarn lint",
|
|
97
95
|
"prepack": "sf-prepack",
|
|
98
96
|
"prepare": "sf-install",
|
|
99
|
-
"
|
|
100
|
-
"test": "
|
|
97
|
+
"test": "wireit",
|
|
98
|
+
"test:only": "wireit",
|
|
101
99
|
"version": "oclif readme"
|
|
102
100
|
},
|
|
103
101
|
"publishConfig": {
|
|
104
102
|
"access": "public"
|
|
105
103
|
},
|
|
106
|
-
"main": "lib/index.js"
|
|
104
|
+
"main": "lib/index.js",
|
|
105
|
+
"wireit": {
|
|
106
|
+
"build": {
|
|
107
|
+
"dependencies": [
|
|
108
|
+
"compile",
|
|
109
|
+
"lint"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"compile": {
|
|
113
|
+
"command": "tsc -p . --pretty --incremental",
|
|
114
|
+
"files": [
|
|
115
|
+
"src/**/*.ts",
|
|
116
|
+
"**/tsconfig.json",
|
|
117
|
+
"messages/**"
|
|
118
|
+
],
|
|
119
|
+
"output": [
|
|
120
|
+
"lib/**",
|
|
121
|
+
"*.tsbuildinfo"
|
|
122
|
+
],
|
|
123
|
+
"clean": "if-file-deleted"
|
|
124
|
+
},
|
|
125
|
+
"format": {
|
|
126
|
+
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
|
|
127
|
+
"files": [
|
|
128
|
+
"src/**/*.ts",
|
|
129
|
+
"test/**/*.ts",
|
|
130
|
+
"schemas/**/*.json",
|
|
131
|
+
"command-snapshot.json",
|
|
132
|
+
".prettier*"
|
|
133
|
+
],
|
|
134
|
+
"output": []
|
|
135
|
+
},
|
|
136
|
+
"lint": {
|
|
137
|
+
"command": "eslint src test --color --cache --cache-location .eslintcache",
|
|
138
|
+
"files": [
|
|
139
|
+
"src/**/*.ts",
|
|
140
|
+
"test/**/*.ts",
|
|
141
|
+
"messages/**",
|
|
142
|
+
"**/.eslint*",
|
|
143
|
+
"**/tsconfig.json"
|
|
144
|
+
],
|
|
145
|
+
"output": []
|
|
146
|
+
},
|
|
147
|
+
"test:compile": {
|
|
148
|
+
"command": "tsc -p \"./test\" --pretty",
|
|
149
|
+
"files": [
|
|
150
|
+
"test/**/*.ts",
|
|
151
|
+
"**/tsconfig.json"
|
|
152
|
+
],
|
|
153
|
+
"output": []
|
|
154
|
+
},
|
|
155
|
+
"test": {
|
|
156
|
+
"dependencies": [
|
|
157
|
+
"test:only",
|
|
158
|
+
"lint"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"test:only": {
|
|
162
|
+
"command": "nyc mocha \"test/**/*.test.ts\"",
|
|
163
|
+
"env": {
|
|
164
|
+
"FORCE_COLOR": "2"
|
|
165
|
+
},
|
|
166
|
+
"dependencies": [
|
|
167
|
+
"test:compile",
|
|
168
|
+
"test:command-reference"
|
|
169
|
+
],
|
|
170
|
+
"files": [
|
|
171
|
+
"test/**/*.ts",
|
|
172
|
+
"src/**/*.ts",
|
|
173
|
+
"**/tsconfig.json",
|
|
174
|
+
".mocha*",
|
|
175
|
+
"!*.nut.ts",
|
|
176
|
+
".nycrc",
|
|
177
|
+
"tmp/test/**"
|
|
178
|
+
],
|
|
179
|
+
"output": []
|
|
180
|
+
},
|
|
181
|
+
"test:command-reference": {
|
|
182
|
+
"command": "\"./bin/dev\" commandreference:generate --plugins auth --outputdir ./tmp/test",
|
|
183
|
+
"files": [
|
|
184
|
+
"src/**/*.ts",
|
|
185
|
+
"messages/**",
|
|
186
|
+
"package.json"
|
|
187
|
+
],
|
|
188
|
+
"output": [
|
|
189
|
+
"tmp/test/**"
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
"test:deprecation-policy": {
|
|
193
|
+
"command": "\"./bin/dev\" snapshot:compare",
|
|
194
|
+
"files": [
|
|
195
|
+
"src/**/*.ts"
|
|
196
|
+
],
|
|
197
|
+
"output": [],
|
|
198
|
+
"dependencies": [
|
|
199
|
+
"compile"
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
"test:json-schema": {
|
|
203
|
+
"command": "\"./bin/dev\" schema:compare",
|
|
204
|
+
"files": [
|
|
205
|
+
"src/**/*.ts",
|
|
206
|
+
"schemas"
|
|
207
|
+
],
|
|
208
|
+
"output": []
|
|
209
|
+
}
|
|
210
|
+
}
|
|
107
211
|
}
|