Skip to content

Commit

Permalink
chore: updates from devScripts
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-cli-bot committed Dec 28, 2023
1 parent 7f35b04 commit abe64db
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 132 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.0.4",
"@salesforce/cli-plugins-testkit": "^5.1.3",
"@salesforce/dev-scripts": "^8.1.2",
"@salesforce/dev-scripts": "^8.1.3",
"@salesforce/plugin-command-reference": "^3.0.54",
"@types/yeoman-assert": "^3.1.4",
"@types/yeoman-environment": "^2.10.9",
"@types/yeoman-generator": "^5.2.13",
"eslint-plugin-sf-plugin": "^1.16.15",
"eslint-plugin-sf-plugin": "^1.17.0",
"oclif": "^4.1.0",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
Expand Down
6 changes: 3 additions & 3 deletions src/commands/analytics/generate/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* 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 { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import AnalyticsTemplateGenerator from '@salesforce/templates/lib/generators/analyticsTemplateGenerator.js';
import { AnalyticsTemplateOptions, CreateOutput } from '@salesforce/templates';
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
import { outputDirFlag } from '../../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'analyticsTemplate');
export default class AnalyticsTemplate extends SfCommand<CreateOutput> {
public static readonly examples = messages.getMessages('examples');
Expand Down
6 changes: 3 additions & 3 deletions src/commands/apex/generate/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { ApexClassOptions, CreateOutput } from '@salesforce/templates';
import ApexClassGenerator from '@salesforce/templates/lib/generators/apexClassGenerator.js';
Expand All @@ -14,7 +14,7 @@ import { Messages } from '@salesforce/core';
import { runGenerator, getCustomTemplates } from '../../../utils/templateCommand.js';
import { outputDirFlag } from '../../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'apexClass');
const commonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'messages');
const apexClassFileSuffix = /.cls$/;
Expand Down
6 changes: 3 additions & 3 deletions src/commands/apex/generate/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 {
arrayWithDeprecation,
Flags,
Expand All @@ -21,7 +21,7 @@ import { Messages } from '@salesforce/core';
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
import { outputDirFlag } from '../../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const apexTriggerFileSuffix = /.trigger$/;
const commonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'messages');
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'apexTrigger');
Expand Down
6 changes: 3 additions & 3 deletions src/commands/lightning/generate/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { CreateOutput, LightningAppOptions } from '@salesforce/templates';
import LightningAppGenerator from '@salesforce/templates/lib/generators/lightningAppGenerator.js';
Expand All @@ -14,7 +14,7 @@ import { Messages } from '@salesforce/core';
import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand.js';
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const lightningCommonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
const lightningAppMessages = Messages.loadMessages('@salesforce/plugin-templates', 'lightningApp');
const lightningAppFileSuffix = /.app$/;
Expand Down
6 changes: 3 additions & 3 deletions src/commands/lightning/generate/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

// tslint:disable:no-unused-expression

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


import { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { CreateOutput, LightningComponentOptions } from '@salesforce/templates';
import LightningComponentGenerator from '@salesforce/templates/lib/generators/lightningComponentGenerator.js';
Expand All @@ -17,7 +17,7 @@ import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
const BUNDLE_TYPE = 'Component';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'lightningCmp');
const lightningCommon = Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
export default class LightningComponent extends SfCommand<CreateOutput> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/lightning/generate/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { CreateOutput, LightningEventOptions } from '@salesforce/templates';
import LightningEventGenerator from '@salesforce/templates/lib/generators/lightningEventGenerator.js';
Expand All @@ -16,7 +16,7 @@ import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
const lightningEventFileSuffix = /.evt$/;
const BUNDLE_TYPE = 'Event';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);

const messages = Messages.loadMessages('@salesforce/plugin-templates', 'lightningEvent');
const lightningCommon = Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
Expand Down
6 changes: 3 additions & 3 deletions src/commands/lightning/generate/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { CreateOutput, LightningInterfaceOptions } from '@salesforce/templates';
import LightningInterfaceGenerator from '@salesforce/templates/lib/generators/lightningInterfaceGenerator.js';
Expand All @@ -16,7 +16,7 @@ import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
const lightningInterfaceFileSuffix = /.intf$/;
const BUNDLE_TYPE = 'Interface';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'lightningInterface');
const lightningCommon = Messages.loadMessages('@salesforce/plugin-templates', 'lightning');

Expand Down
6 changes: 3 additions & 3 deletions src/commands/lightning/generate/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 { Flags, loglevel, SfCommand, orgApiVersionFlagWithDeprecations, Ux } from '@salesforce/sf-plugins-core';
import { CreateOutput, LightningTestOptions } from '@salesforce/templates';
import LightningTestGenerator from '@salesforce/templates/lib/generators/lightningTestGenerator.js';
Expand All @@ -15,7 +15,7 @@ import { getCustomTemplates, runGenerator } from '../../../utils/templateCommand
import { internalFlag, outputDirFlagLightning } from '../../../utils/flags.js';
const lightningTestFileSuffix = /.resource$/;

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'lightningTest');
const lightningMessages = Messages.loadMessages('@salesforce/plugin-templates', 'lightning');
export default class LightningTest extends SfCommand<CreateOutput> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* 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 { Flags, loglevel, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { CreateOutput, ProjectOptions } from '@salesforce/templates';
import ProjectGenerator from '@salesforce/templates/lib/generators/projectGenerator.js';
import { Messages } from '@salesforce/core';
import { getCustomTemplates, runGenerator } from '../../utils/templateCommand.js';
import { outputDirFlag } from '../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'project');
export default class Project extends SfCommand<CreateOutput> {
public static readonly summary = messages.getMessage('summary');
Expand Down
6 changes: 3 additions & 3 deletions src/commands/static-resource/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
* 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 { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import { CreateOutput, StaticResourceOptions } from '@salesforce/templates';
import { Messages } from '@salesforce/core';
import StaticResourceGenerator from '@salesforce/templates/lib/generators/staticResourceGenerator.js';
import { outputDirFlag } from '../../utils/flags.js';
import { getCustomTemplates, runGenerator } from '../../utils/templateCommand.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'staticResource');
export default class StaticResource extends SfCommand<CreateOutput> {
public static readonly summary = messages.getMessage('summary');
Expand Down
6 changes: 3 additions & 3 deletions src/commands/visualforce/generate/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 { Flags, SfCommand, orgApiVersionFlagWithDeprecations, Ux, loglevel } from '@salesforce/sf-plugins-core';
import { CreateOutput, VisualforceComponentOptions } from '@salesforce/templates';
import VisualforceComponentGenerator from '@salesforce/templates/lib/generators/visualforceComponentGenerator.js';
Expand All @@ -16,7 +16,7 @@ import { runGenerator, getCustomTemplates } from '../../../utils/templateCommand
const visualforceComponentFileSuffix = /.component$/;
const VF_TYPE = 'Component';

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

Expand Down
6 changes: 3 additions & 3 deletions src/commands/visualforce/generate/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* 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 { Flags, loglevel, orgApiVersionFlagWithDeprecations, SfCommand, Ux } from '@salesforce/sf-plugins-core';
import VisualforcePageGenerator from '@salesforce/templates/lib/generators/visualforcePageGenerator.js';
import { CreateOutput, CreateUtil, VisualforcePageOptions } from '@salesforce/templates';
Expand All @@ -15,7 +15,7 @@ import { outputDirFlag } from '../../../utils/flags.js';
const visualforcePageFileSuffix = /.page$/;
const VF_TYPE = 'Page';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const commonMessages = Messages.loadMessages('@salesforce/plugin-templates', 'messages');
const messages = Messages.loadMessages('@salesforce/plugin-templates', 'vf');
export default class VisualforcePage extends SfCommand<CreateOutput> {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/templateCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

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

import { Ux } from '@salesforce/sf-plugins-core';
import { ConfigAggregator, Messages, OrgConfigProperties } from '@salesforce/core';
import { CreateOutput, TemplateService } from '@salesforce/templates';
Expand All @@ -26,7 +26,7 @@ import AnalyticsTemplateGenerator from '@salesforce/templates/lib/generators/ana
import LightningComponentGenerator from '@salesforce/templates/lib/generators/lightningComponentGenerator.js';
import ApexTriggerGenerator from '@salesforce/templates/lib/generators/apexTriggerGenerator.js';

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

export type generatorInputs = {
Expand Down
Loading

0 comments on commit abe64db

Please sign in to comment.