Skip to content

Commit

Permalink
Merge pull request #446 from salesforcecli/devScripts2023-12-28
Browse files Browse the repository at this point in the history
refactor: devScripts update
  • Loading branch information
svc-cli-bot authored Dec 28, 2023
2 parents e013580 + ac1eef7 commit 2e37919
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 165 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@oclif/core": "^3.14.1",
"@octokit/rest": "^19.0.13",
"@salesforce/core": "^6.4.1",
"@salesforce/core": "^6.4.2",
"@salesforce/kit": "^3.0.15",
"@salesforce/sf-plugins-core": "^5.0.10",
"@salesforce/ts-types": "^2.0.9",
Expand All @@ -25,14 +25,14 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.0.5",
"@salesforce/cli-plugins-testkit": "^5.1.1",
"@salesforce/dev-scripts": "^8.1.2",
"@salesforce/dev-scripts": "^8.1.3",
"@salesforce/plugin-command-reference": "^3.0.54",
"@types/js-yaml": "^4.0.5",
"@types/lodash.defaultsdeep": "^4.6.9",
"@types/shelljs": "^0.8.14",
"@types/yeoman-generator": "^5.2.14",
"@types/yeoman-test": "^4.0.3",
"eslint-plugin-sf-plugin": "^1.16.15",
"eslint-plugin-sf-plugin": "^1.17.0",
"oclif": "^4.1.0",
"shx": "^0.3.3",
"ts-node": "^10.9.2",
Expand Down
6 changes: 3 additions & 3 deletions src/commands/dev/audit/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import fs from 'node:fs';
import { dirname, join, parse, relative, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { join, parse, relative, resolve } from 'node:path';

import { ensureString } from '@salesforce/ts-types';
import { Logger, Messages } from '@salesforce/core';
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
Expand Down Expand Up @@ -50,7 +50,7 @@ type MessageRefNode = NodeType & {

type Node = FileNode | BundleNode | MessageNode | MessageRefNode | BundleRefNode;

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'audit.messages');

export default class AuditMessages extends SfCommand<AuditResults> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/dev/configure/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

// because github api isn't camelcased
/* eslint-disable camelcase */
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import { Octokit } from '@octokit/rest';
import { OctokitError } from '../../../types.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'configure.repo');

export type ConfigureRepoResult = {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/dev/configure/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// because github api isn't camelcased
/* eslint-disable camelcase */

import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import fs from 'node:fs';
import { ux } from '@oclif/core';

Expand All @@ -21,7 +21,7 @@ import shelljs from 'shelljs';
import yaml from 'js-yaml';
import { OctokitError } from '../../../types.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'configure.secrets');

type SecretClassification =
Expand Down
4 changes: 2 additions & 2 deletions src/commands/dev/convert/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import fs from 'node:fs';
import { EOL } from 'node:os';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';

Messages.importMessagesDirectory(path.dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.convert.messages');

export type DevConvertMessagesResult = {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/dev/convert/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/
import fs from 'node:fs';
import os from 'node:os';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.convert.script');

type Flag = {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/dev/generate/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Messages } from '@salesforce/core';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { fileExists, generate } from '../../../util.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.generate.command');

export default class GenerateCommand extends SfCommand<void> {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/dev/generate/flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import path from 'node:path';
import os from 'node:os';
import fs from 'node:fs/promises';
import { fileURLToPath } from 'node:url';

import shelljs from 'shelljs';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
Expand All @@ -20,7 +20,7 @@ import fg from 'fast-glob';
import { fileExists, FlagBuilder } from '../../../util.js';
import { FlagAnswers } from '../../../types.js';

Messages.importMessagesDirectory(path.dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.generate.flag');

const toLowerKebabCase = (str: string): string =>
Expand Down
6 changes: 3 additions & 3 deletions src/commands/dev/generate/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Messages } from '@salesforce/core';
import { SfCommand } from '@salesforce/sf-plugins-core';
import { generate } from '../../../util.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.generate.library');

export default class GenerateLibrary extends SfCommand<void> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/dev/generate/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
* Licensed under the BSD 3-Clause license.
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Messages } from '@salesforce/core';
import { SfCommand } from '@salesforce/sf-plugins-core';
import { generate } from '../../../util.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'dev.generate.plugin');

export default class GeneratePlugin extends SfCommand<void> {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Messages } from '@salesforce/core';
import { NYC, PackageJson } from '../types.js';
import { readJson, validatePluginName } from '../util.js';

Messages.importMessagesDirectory(path.dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-dev', 'plugin.generator');

const TEMPLATES_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), '../../templates');
Expand Down
Loading

0 comments on commit 2e37919

Please sign in to comment.