Skip to content

Commit 3684299

Browse files
committed
refactor: new message import style
1 parent 7a7db1d commit 3684299

File tree

10 files changed

+12
-30
lines changed

10 files changed

+12
-30
lines changed

src/commands/alias/list.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { StateAggregator, Messages } from '@salesforce/core';
119
import { loglevel } from '@salesforce/sf-plugins-core';
1210
import { AliasCommand, AliasResults } from '../../alias.js';
1311

14-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1513
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'alias.list');
1614
export default class AliasList extends AliasCommand<AliasResults> {
1715
public static summary = messages.getMessage('summary');

src/commands/alias/set.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { loglevel, parseVarArgs } from '@salesforce/sf-plugins-core';
119
import { StateAggregator, Messages } from '@salesforce/core';
1210
import { AliasCommand, AliasResults } from '../../alias.js';
1311

14-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1513
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'alias.set');
1614

1715
export default class AliasSet extends AliasCommand<AliasResults> {

src/commands/alias/unset.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { Flags, loglevel } from '@salesforce/sf-plugins-core';
119
import { StateAggregator, Messages } from '@salesforce/core';
1210
import { AliasCommand, AliasResults } from '../../alias.js';
1311

14-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1513
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'alias.unset');
1614

1715
export default class AliasUnset extends AliasCommand<AliasResults> {

src/commands/config/get.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
* Licensed under the BSD 3-Clause license.
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7-
import { fileURLToPath } from 'node:url';
8-
import { dirname } from 'node:path';
7+
98
import { Flags, loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
109
import { ConfigAggregator, Messages } from '@salesforce/core';
1110
import {
@@ -17,7 +16,7 @@ import {
1716
ConfigResponses,
1817
} from '../../config.js';
1918

20-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
19+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
2120
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.get');
2221

2322
export class Get extends SfCommand<ConfigResponses> {

src/commands/config/list.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
* Licensed under the BSD 3-Clause license.
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
7-
import { fileURLToPath } from 'node:url';
8-
import { dirname } from 'node:path';
7+
98
import { ConfigAggregator, Messages } from '@salesforce/core';
109
import { loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
1110
import { ConfigResponses, buildSuccessMsg, output } from '../../config.js';
1211

13-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1413
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.list');
1514

1615
export default class List extends SfCommand<ConfigResponses> {

src/commands/config/set.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { parseVarArgs, Flags, loglevel, Ux, SfCommand } from '@salesforce/sf-plugins-core';
119
import { Config, Messages, Org, SfError, OrgConfigProperties } from '@salesforce/core';
1210
import { CONFIG_HELP_SECTION, Msg, buildFailureMsg, calculateSuggestion, output } from '../../config.js';
1311

14-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1513
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.set');
1614

1715
export type SetOrUnsetConfigCommandResult = { successes: Msg[]; failures: Msg[] };

src/commands/config/unset.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { Flags, loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
119
import { Config, Messages } from '@salesforce/core';
1210
import { CONFIG_HELP_SECTION, buildFailureMsg, calculateSuggestion, output } from '../../config.js';
1311
import { SetOrUnsetConfigCommandResult } from './set.js';
1412

15-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1614
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.unset');
1715

1816
export class UnSet extends SfCommand<SetOrUnsetConfigCommandResult> {

test/commands/alias/set.nut.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit';
119
import { expect } from 'chai';
1210
import { Messages } from '@salesforce/core';
1311

14-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
12+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1513
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'alias.set');
1614

1715
function unsetAll() {

test/commands/alias/unset.nut.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit';
119
import { expect } from 'chai';
1210
import { Messages } from '@salesforce/core';
1311
import { AliasResults } from '../../../src/alias.js';
1412

15-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1614
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'alias.unset');
1715

1816
describe('alias unset NUTs', () => {

test/commands/config/set.nut.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { fileURLToPath } from 'node:url';
9-
import { dirname } from 'node:path';
108
import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit';
119
import { assert, expect } from 'chai';
1210
import { Messages } from '@salesforce/core';
1311
import { SetOrUnsetConfigCommandResult } from '../../../src/commands/config/set.js';
1412

15-
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
13+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
1614
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.set');
1715

1816
let testSession: TestSession;

0 commit comments

Comments
 (0)