Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: devScripts update #854

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.12.0",
"@salesforce/apex-node": "^2.1.7",
"@salesforce/core": "^6.4.0",
"@salesforce/core": "^6.4.2",
"@salesforce/kit": "^3.0.15",
"@salesforce/sf-plugins-core": "^5.0.10",
"@salesforce/source-deploy-retrieve": "^10.2.3",
Expand All @@ -18,13 +18,13 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.0.5",
"@salesforce/cli-plugins-testkit": "^5.1.2",
"@salesforce/dev-scripts": "^8.1.2",
"@salesforce/dev-scripts": "^8.1.3",
"@salesforce/plugin-command-reference": "^3.0.51",
"@salesforce/plugin-source": "^2.11.4",
"@salesforce/source-testkit": "^2.1.76",
"@salesforce/ts-sinon": "^1.4.19",
"cross-env": "^7.0.3",
"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/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { EOL } from 'node:os';
import { writeFile, readFile } from 'node:fs/promises';
import { existsSync } from 'node:fs';
import { exec } from 'node:child_process';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Hook } from '@oclif/core';
import { Messages } from '@salesforce/core';
import { Env, parseJsonMap } from '@salesforce/kit';
Expand All @@ -26,7 +26,7 @@ import {
} from '@salesforce/sf-plugins-core';
import { DeployerResult } from '@salesforce/sf-plugins-core/lib/deployer.js';

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

const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy');

Expand Down
4 changes: 2 additions & 2 deletions src/commands/project/convert/mdapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

import { Messages, SfError } from '@salesforce/core';
import {
ComponentSet,
Expand All @@ -26,7 +26,7 @@ import { Interfaces } from '@oclif/core';
import { ConvertMdapiJson } from '../../../utils/types.js';
import { MetadataConvertResultFormatter } from '../../../formatters/metadataConvertResultFormatter.js';

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

export interface EnsureFsFlagOptions {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/convert/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

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

import { Messages } from '@salesforce/core';
import {
ComponentSet,
Expand All @@ -27,7 +27,7 @@ import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js';
import { SourceConvertResultFormatter } from '../../../formatters/sourceConvertResultFormatter.js';
import { ConvertResultJson } from '../../../utils/types.js';

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

export class Source extends SfCommand<ConvertResultJson> {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/project/delete/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import fs from 'node:fs';
import path from 'node:path';
import os from 'node:os';
import { fileURLToPath } from 'node:url';

import { Interfaces } from '@oclif/core';
import { Lifecycle, Messages, Org, SfError } from '@salesforce/core';
import {
Expand Down Expand Up @@ -44,7 +44,7 @@ import { testLevelFlag, testsFlag } from '../../../utils/flags.js';
const fsPromises = fs.promises;
const testFlags = 'Test';

Messages.importMessagesDirectory(path.dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.source');
const xorFlags = ['metadata', 'source-dir'];
export class Source extends SfCommand<DeleteSourceJson> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/delete/tracking.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 { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Messages } from '@salesforce/core';
import chalk from 'chalk';
import { SourceTracking } from '@salesforce/source-tracking';
Expand All @@ -18,7 +18,7 @@ import {
SfCommand,
} from '@salesforce/sf-plugins-core';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.tracking');

export type DeleteTrackingResult = {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/deploy/cancel.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 { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Messages } from '@salesforce/core';
import { Duration } from '@salesforce/kit';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
Expand All @@ -17,7 +17,7 @@ import { AsyncDeployCancelResultFormatter } from '../../../formatters/asyncDeplo
import { DeployCancelResultFormatter } from '../../../formatters/deployCancelResultFormatter.js';
import { DeployResultJson } from '../../../utils/types.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.cancel');

export default class DeployMetadataCancel extends SfCommand<DeployResultJson> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/deploy/preview.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 { Messages } from '@salesforce/core';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { SourceTracking } from '@salesforce/source-tracking';
import { ForceIgnore } from '@salesforce/source-deploy-retrieve';
import { buildComponentSet } from '../../../utils/deploy.js';
import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.preview');

const exclusiveFlags = ['manifest', 'source-dir', 'metadata'];
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/deploy/quick.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 { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import chalk from 'chalk';
import { Messages, Org } from '@salesforce/core';
import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core';
Expand All @@ -19,7 +19,7 @@ import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResul
import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js';
import { API, DeployResultJson } from '../../../utils/types.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.quick');

export default class DeployMetadataQuick extends SfCommand<DeployResultJson> {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/deploy/report.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 { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Messages, Org, SfProject } from '@salesforce/core';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { ComponentSet, DeployResult, MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
Expand All @@ -17,7 +17,7 @@ import { DeployReportResultFormatter } from '../../../formatters/deployReportRes
import { API, DeployResultJson } from '../../../utils/types.js';
import { coverageFormattersFlag } from '../../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.report');
const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata');
const testFlags = 'Test';
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/deploy/resume.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 { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import chalk from 'chalk';
import { EnvironmentVariable, Messages, Org, SfError } from '@salesforce/core';
import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core';
Expand All @@ -20,7 +20,7 @@ import { DeployCache } from '../../../utils/deployCache.js';
import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js';
import { coverageFormattersFlag } from '../../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.resume');

const testFlags = 'Test';
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/deploy/start.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 chalk from 'chalk';
import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError } from '@salesforce/core';
import { DeployVersionData } from '@salesforce/source-deploy-retrieve';
Expand All @@ -24,7 +24,7 @@ import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from
import { writeConflictTable } from '../../../utils/conflicts.js';
import { getOptionalProject } from '../../../utils/project.js';

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

const exclusiveFlags = ['manifest', 'source-dir', 'metadata', 'metadata-dir'];
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/deploy/validate.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 * as os from 'node:os';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import chalk from 'chalk';
import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError } from '@salesforce/core';
import { CodeCoverageWarnings, DeployVersionData, RequestStatus } from '@salesforce/source-deploy-retrieve';
Expand All @@ -21,7 +21,7 @@ import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js';
import { ConfigVars } from '../../../configMeta.js';
import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from '../../../utils/flags.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.validate');
const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata');

Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/generate/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* 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 { join, dirname } from 'node:path';
import { join } from 'node:path';
import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';

import { Messages, Org } from '@salesforce/core';
import { ComponentSetBuilder } from '@salesforce/source-deploy-retrieve';
import {
Expand All @@ -18,7 +18,7 @@ import {
} from '@salesforce/sf-plugins-core';
import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js';

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

const manifestTypes = {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/list/ignored.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* 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 { join, dirname } from 'node:path';
import { join } from 'node:path';
import fs from 'node:fs';
import { fileURLToPath } from 'node:url';

import { Messages, SfError } from '@salesforce/core';
import { ForceIgnore } from '@salesforce/source-deploy-retrieve';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'list.ignored');

export type SourceIgnoredResults = {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/reset/tracking.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 { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';


import { Messages } from '@salesforce/core';
import { SourceTracking } from '@salesforce/source-tracking';
import {
Expand All @@ -18,7 +18,7 @@ import {
StandardColors,
} from '@salesforce/sf-plugins-core';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.tracking');

export type ResetTrackingResult = {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/project/retrieve/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* 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 { SourceTracking } from '@salesforce/source-tracking';
import { ForceIgnore } from '@salesforce/source-deploy-retrieve';
import { PreviewResult, printTables, compileResults, getConflictFiles } from '../../../utils/previewOutput.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.metadata.preview');

export default class RetrieveMetadataPreview extends SfCommand<PreviewResult> {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/project/retrieve/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { rm } from 'node:fs/promises';
import { dirname, join, resolve } from 'node:path';

import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';

import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError, SfProject } from '@salesforce/core';
import {
RetrieveResult,
Expand All @@ -36,7 +36,7 @@ import { RetrieveResultJson } from '../../../utils/types.js';
import { writeConflictTable } from '../../../utils/conflicts.js';
import { promisesQueue } from '../../../utils/promiseQueue.js';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.start');
const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer');

Expand Down
6 changes: 3 additions & 3 deletions src/configMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* 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 type { ConfigValue } from '@salesforce/core';
import { Messages } from '@salesforce/core/lib/messages.js';

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

export enum ConfigVars {
Expand Down
6 changes: 3 additions & 3 deletions src/formatters/asyncDeployCancelResultFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* 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 { ux } from '@oclif/core';
import { Messages } from '@salesforce/core';
import { AsyncDeployResultJson, DeployResultJson, Formatter } from '../utils/types.js';
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)

export const deployAsyncMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.async');

Expand Down
Loading
Loading