Skip to content

Commit

Permalink
feat: dependencies updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagonnascimento committed Sep 7, 2024
1 parent e81ed3a commit fc133f9
Show file tree
Hide file tree
Showing 14 changed files with 2,532 additions and 3,689 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cjs/
3 changes: 3 additions & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'plugin:sf-plugin/recommended'],
root: true,
rules: {
header: 'off',
},
};
File renamed without changes.
File renamed without changes.
82 changes: 37 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,42 @@
"description": "A sf plugin enabling deploy of releases that requires multi steps in order to be deployed. It supports deploy of metadata, datapacks (SFI) and shell commnads. ",
"version": "1.4.3",
"dependencies": {
"@oclif/core": "^2.16.0",
"@salesforce/core": "^3.34.8",
"@salesforce/kit": "^3.1.2",
"@salesforce/sf-plugins-core": "^2.4.3",
"tslib": "^2"
"@oclif/core": "^4",
"@salesforce/core": "^7.2.0",
"@salesforce/sf-plugins-core": "^10.0.0",
"xml2js": "^0.6.2"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.1.9",
"@oclif/test": "^2.5.6",
"@salesforce/cli-plugins-testkit": "^3.4.0",
"@salesforce/dev-config": "^4.3.1",
"@salesforce/dev-scripts": "^9.1.2",
"@salesforce/prettier-config": "^0.0.3",
"@salesforce/ts-sinon": "^1.4.26",
"@swc/core": "^1.5.28",
"@types/inquirer": "^9.0.7",
"@salesforce/cli-plugins-testkit": "^5.3.10",
"@salesforce/dev-scripts": "^10",
"@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"chai": "^4.3.6",
"eslint": "^8.48.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-salesforce": "^2.0.1",
"eslint-config-salesforce-typescript": "^1.1.3",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "^44.2.4",
"eslint-plugin-sf-plugin": "^1.20.5",
"husky": "^7.0.4",
"mocha": "^9.2.2",
"nyc": "^15.1.0",
"oclif": "^3.14.0",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"shx": "0.3.4",
"eslint-plugin-sf-plugin": "^1.18.6",
"oclif": "^4.14.0",
"sinon": "10.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.7.3",
"wireit": "^0.14.4"
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"files": [
"/lib",
"/messages",
"/oclif.manifest.json"
"/oclif.manifest.json",
"/oclif.lock"
],
"keywords": [
"force",
"salesforce",
"sfdx",
"salesforcedx",
"sfdx-plugin",
"sf",
"sf-plugin",
"sf"
"sfdx",
"sfdx-plugin"
],
"license": "BSD-3-Clause",
"main": "lib/index.js",
"oclif": {
"commands": "./lib/commands",
"bin": "sf",
Expand All @@ -71,18 +50,20 @@
"builds": {
"description": "Ability to deploy multi-steps builds based on a buildfile.json"
}
}
},
"flexibleTaxonomy": true
},
"scripts": {
"build": "wireit",
"clean": "sf-clean",
"clean-all": "sf-clean all",
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
"compile": "wireit",
"docs": "sf-docs",
"format": "wireit",
"link-check": "wireit",
"lint": "wireit",
"postinstall": "yarn husky install || true",
"postpack": "sf-clean --ignore-signing-artifacts",
"prepack": "sf-prepack",
"test": "wireit",
"test:nuts": "echo NO NUTS for now",
"test:only": "wireit",
Expand Down Expand Up @@ -164,7 +145,7 @@
"output": []
},
"test:command-reference": {
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" commandreference:generate --erroronwarnings",
"files": [
"src/**/*.ts",
"messages/**",
Expand All @@ -175,7 +156,7 @@
]
},
"test:deprecation-policy": {
"command": "\"./bin/dev\" snapshot:compare",
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" snapshot:compare",
"files": [
"src/**/*.ts"
],
Expand All @@ -185,13 +166,24 @@
]
},
"test:json-schema": {
"command": "\"./bin/dev\" schema:compare",
"command": "node --loader ts-node/esm --no-warnings=ExperimentalWarning \"./bin/dev.js\" schema:compare",
"files": [
"src/**/*.ts",
"schemas"
],
"output": []
},
"link-check": {
"command": "node -e \"process.exit(process.env.CI ? 0 : 1)\" || linkinator \"**/*.md\" --skip \"CHANGELOG.md|node_modules|test/|confluence.internal.salesforce.com|my.salesforce.com|%s\" --markdown --retry --directory-listing --verbosity error",
"files": [
"./*.md",
"./!(CHANGELOG).md",
"messages/**/*.md"
],
"output": []
}
},
"exports": "./lib/index.js",
"type": "module",
"author": "Tiago Nascimento"
}
}
9 changes: 5 additions & 4 deletions src/commands/builds/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable sf-plugin/run-matches-class-type */
/* eslint-disable no-console */
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import BuildsUtil from '../../modules/utils';
import Commands from '../../modules/commands';
import { AuthParameters, Build, BuildsDeployResult } from '../../modules/types';
import BuildsUtil from '../../modules/utils.ts';
import Commands from '../../modules/commands.ts';
import { AuthParameters, Build, BuildsDeployResult } from '../../modules/types.ts';

Messages.importMessagesDirectory(__dirname);
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('sf-orgdevmode-builds', 'builds.deploy');

export default class BuildsDeploy extends SfCommand<BuildsDeployResult> {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export = {};
export default {};
4 changes: 2 additions & 2 deletions src/modules/commands.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import { AuthParameters, Build } from './types';
import BuildsUtils from './utils';
import { AuthParameters, Build } from './types.ts';
import BuildsUtils from './utils.ts';

export default class Commands {
public static auth(authParms: AuthParameters): void {
Expand Down
9 changes: 5 additions & 4 deletions src/modules/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as fs from 'node:fs';
import { spawnSync, SpawnSyncReturns, SpawnSyncOptionsWithStringEncoding } from 'node:child_process';
import * as xml2js from 'xml2js';
import { Package, PackageType } from './types';
import { Package, PackageType } from './types.ts';

export default class BuildsUtils {
/**
Expand Down Expand Up @@ -43,7 +43,7 @@ export default class BuildsUtils {

const spawn: SpawnSyncReturns<string> = BuildsUtils.execSpawnSync(command, args, options);

console.log(`Status of execution: ${spawn.status}`);
console.log(`Status of execution: ${spawn.status ?? '0'}`);
let spawnOut = spawn.stdout;
// se resposta for JSON do sfdx, tentando limpar ela removendo caracteres de quebra de linha (\n) que o SFDX CLI pode colocar
// na estrutura da resposta - para conseguirmos um print decente do resultado no log
Expand All @@ -55,10 +55,10 @@ export default class BuildsUtils {
}
console.log(`Output: ${spawnOut}`);

if (spawn.error || spawn.status !== 0) {
if (spawn.error ?? spawn.status !== 0) {
let errorMessage = 'Error executing command!';
if (spawn.error) {
errorMessage += spawn.error;
errorMessage += spawn.error.toString();
}

if (spawn.stderr) {
Expand Down Expand Up @@ -88,6 +88,7 @@ export default class BuildsUtils {
public static parsePackageXml(manifestPath: string): Package {
const xmlString: string = BuildsUtils.execReadFileSync(manifestPath);
let xmlJson!: Package;
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
xml2js.parseString(xmlString, (err, res) => {
if (err) {
console.error(`Error parsing ${manifestPath}`);
Expand Down
3 changes: 2 additions & 1 deletion test/.eslintrc.js → test/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: '../.eslintrc.js',
extends: '../.eslintrc.cjs',
// Allow describe and it
env: { mocha: true },
rules: {
Expand All @@ -14,5 +14,6 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
// Easily return a promise in a mocked method.
'@typescript-eslint/require-await': 'off',
header: 'off',
},
};
13 changes: 7 additions & 6 deletions test/commands/builds/deploy.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-unused-vars */
import * as ChildProcess from 'node:child_process';
import { expect, test } from '@oclif/test';
import * as sinon from 'sinon';

import pkg from 'sinon';
const { stub } = pkg;
// Import the BuildsDeploy command class
import BuildsDeploy from '../../../src/commands/builds/deploy';
import BuildsUtils from '../../../src/modules/utils';
import BuildsDeploy from '../../../src/commands/builds/deploy.ts';
import BuildsUtils from '../../../src/modules/utils.ts';

describe('BuildsDeploy', () => {
const buildManifest1 = {
Expand Down Expand Up @@ -78,8 +79,8 @@ describe('BuildsDeploy', () => {
signal: null,
};

const execSpawnSync = sinon.stub(BuildsUtils, 'execSpawnSync').returns(spawnSyncReturns);
const execReadFileSync = sinon.stub(BuildsUtils, 'execReadFileSync');
const execSpawnSync = stub(BuildsUtils, 'execSpawnSync').returns(spawnSyncReturns);
const execReadFileSync = stub(BuildsUtils, 'execReadFileSync');
execReadFileSync.onCall(0).returns(JSON.stringify(buildManifest1));
execReadFileSync
.onCall(1)
Expand Down
7 changes: 5 additions & 2 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"extends": "@salesforce/dev-config/tsconfig-test-strict",
"extends": "@salesforce/dev-config/tsconfig-test-strict-esm",
"include": ["./**/*.ts"],
"compilerOptions": {
"skipLibCheck": true
"skipLibCheck": true,
"allowImportingTsExtensions": true,
"noEmit": true,
"esModuleInterop": true
}
}
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"extends": "@salesforce/dev-config/tsconfig-strict",
"extends": "@salesforce/dev-config/tsconfig-strict-esm",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
"rootDir": "src",
"allowImportingTsExtensions": true,
"noEmit": true
},
"include": ["./src/**/*.ts"]
}
Loading

0 comments on commit fc133f9

Please sign in to comment.