|
5 | 5 | * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause |
6 | 6 | */ |
7 | 7 |
|
8 | | -import * as os from 'node:os'; |
| 8 | +import os from 'node:os'; |
9 | 9 | import { resolve } from 'node:path'; |
10 | 10 | import { Flags, SfCommand } from '@salesforce/sf-plugins-core'; |
11 | 11 | // eslint-disable-next-line sf-plugin/no-oclif-flags-command-import |
12 | 12 | import { Command, Config, Interfaces } from '@oclif/core'; |
13 | 13 | import { Messages, SfError } from '@salesforce/core'; |
14 | 14 | import { AnyJson, ensure } from '@salesforce/ts-types'; |
15 | | -import chalk = require('chalk'); |
| 15 | +import chalk from 'chalk'; |
16 | 16 | import { PJSON } from '@oclif/core/lib/interfaces'; |
17 | | -import { Ditamap } from '../../ditamap/ditamap'; |
18 | | -import { Docs } from '../../docs'; |
19 | | -import { CliMeta, CommandClass, events, SfTopic, SfTopics } from '../../utils'; |
| 17 | +import { Ditamap } from '../../ditamap/ditamap.js'; |
| 18 | +import { Docs } from '../../docs.js'; |
| 19 | +import { CliMeta, CommandClass, events, SfTopic, SfTopics } from '../../utils.js'; |
20 | 20 |
|
21 | 21 | // Initialize Messages with the current plugin directory |
22 | | -Messages.importMessagesDirectory(__dirname); |
| 22 | +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); |
23 | 23 | const messages = Messages.loadMessages('@salesforce/plugin-command-reference', 'main'); |
24 | 24 |
|
25 | 25 | export type CommandReferenceGenerateResults = { |
@@ -156,7 +156,7 @@ export default class CommandReferenceGenerate extends SfCommand<CommandReference |
156 | 156 | await docs.build(commands); |
157 | 157 | this.log(`\nWrote generated doc to ${Ditamap.outputDir}`); |
158 | 158 |
|
159 | | - if (flags.erroronwarnings && warnings.length > 0) { |
| 159 | + if (flags['error-on-warnings'] && warnings.length > 0) { |
160 | 160 | throw new SfError(`Found ${warnings.length} warnings.`); |
161 | 161 | } |
162 | 162 |
|
|
0 commit comments