Skip to content

Commit e8715aa

Browse files
authored
Merge pull request #629 from salesforcecli/devScripts2024-06-06
refactor: devScripts update
2 parents f289e23 + edcce5a commit e8715aa

File tree

5 files changed

+143
-75
lines changed

5 files changed

+143
-75
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
8-
"@oclif/core": "^3.26.5",
8+
"@oclif/core": "^4",
99
"@salesforce/core": "^7.3.9",
10-
"@salesforce/sf-plugins-core": "^9.0.7",
10+
"@salesforce/sf-plugins-core": "^10.0.0",
1111
"fast-levenshtein": "^3.0.0"
1212
},
1313
"devDependencies": {
1414
"@oclif/plugin-command-snapshot": "^5.2.0",
1515
"@oclif/test": "^3.2.15",
1616
"@salesforce/cli-plugins-testkit": "^5.3.6",
17-
"@salesforce/dev-scripts": "^9.1.3",
17+
"@salesforce/dev-scripts": "^10.1.0",
1818
"@salesforce/plugin-command-reference": "^3.0.85",
1919
"@salesforce/plugin-deploy-retrieve": "^3.8.3",
2020
"@salesforce/ts-sinon": "^1.4.17",

src/alias.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
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 { ux } from '@oclif/core';
98
import { SfCommand } from '@salesforce/sf-plugins-core';
109

1110
export type AliasResult = {
@@ -21,14 +20,21 @@ export type AliasResult = {
2120

2221
export type AliasResults = AliasResult[];
2322

23+
type AliasColumns = {
24+
alias: { header: string };
25+
value: { header: string };
26+
success?: { header: string };
27+
message?: { header: string };
28+
};
29+
2430
export abstract class AliasCommand<T> extends SfCommand<T> {
2531
protected output(title: string, results: AliasResults): void {
2632
if (results.length === 0) {
2733
this.log('No results');
2834
return;
2935
}
3036

31-
const columns: ux.Table.table.Columns<AliasResult> = {
37+
const columns: AliasColumns = {
3238
alias: { header: 'Alias' },
3339
value: { header: 'Value' },
3440
};
@@ -43,6 +49,7 @@ export abstract class AliasCommand<T> extends SfCommand<T> {
4349

4450
columns.message = { header: 'Message' };
4551

52+
// results.map((r) => ({ ...r, message: r.error?.message }));
4653
results.map((result) => (result.message = result.error?.message));
4754
}
4855

src/hooks/init/load_config_meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ModuleLoader } from '@oclif/core';
1111

1212
const OCLIF_META_PJSON_KEY = 'configMeta';
1313

14-
const hook: Hook<'init'> = async ({ config, context }): Promise<void> => {
14+
const hook: Hook.Init = async ({ config, context }): Promise<void> => {
1515
const flattenedConfigMetas = (
1616
await Promise.all(
1717
(config.getPluginsList() || []).flatMap(async (plugin) => {

test/commands/config/get.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,18 @@ describe('config:get', () => {
122122
.do((ctx) => {
123123
const mockPluginRoot = path.resolve(
124124
path.dirname(fileURLToPath(import.meta.url)),
125-
'../../config-meta-mocks/typescript-src'
125+
'../../config-meta-mocks/javascript-lib'
126126
);
127-
ctx.config.plugins.set('sfdx-cli-ts-plugin-2', {
127+
128+
// @ts-expect-error because oclif/test v3 uses oclif/core v3 but plugin-settings is using oclif/core v4
129+
// We can resolve the type error once we migrate these tests to oclif/test v4
130+
ctx.config.plugins.set('sfdx-cli-js-plugin-2', {
128131
root: mockPluginRoot,
129132
hooks: {},
130133
pjson: JSON.parse(readFileSync(path.resolve(mockPluginRoot, 'package.json'), 'utf-8')),
131-
name: 'sfdx-cli-ts-plugin-2',
134+
name: 'sfdx-cli-js-plugin-2',
132135
commands: [],
136+
topics: [],
133137
} as unknown as Plugin);
134138
})
135139
.stdout()

0 commit comments

Comments
 (0)