Skip to content

Commit 8594bf1

Browse files
authored
feat: update new table (#1229)
* feat: update new table * fix: remove the required for promote
1 parent d81e80b commit 8594bf1

File tree

8 files changed

+1114
-475
lines changed

8 files changed

+1114
-475
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@salesforce/kit": "^3.2.0",
1919
"@salesforce/plugin-command-reference": "^3.1.11",
2020
"@salesforce/plugin-trust": "^3.7.17",
21-
"@salesforce/sf-plugins-core": "^11.2.1",
21+
"@salesforce/sf-plugins-core": "^12.0.7",
2222
"@salesforce/ts-types": "^2.0.10",
2323
"aws-sdk": "^2.1691.0",
2424
"chalk": "^5.3.0",

src/commands/channel/promote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export default class Promote extends SfCommand<PromoteResult> {
162162
target,
163163
sha,
164164
version,
165-
platforms: this.flags.platform,
165+
platforms: this.flags.platform ?? [],
166166
};
167167
}
168168

src/commands/dependabot/automerge.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,9 @@ export default class AutoMerge extends SfCommand<void> {
106106
const greenPRs = (await Promise.all(eligiblePRs.map((pr) => this.isGreen(pr)))).filter(isPrNotUndefined);
107107
const mergeablePRs = (await Promise.all(greenPRs.map((pr) => this.isMergeable(pr)))).filter(isPrNotUndefined);
108108

109-
this.table(
110-
mergeablePRs.map((pr) => ({ title: pr.title, html_url: pr.html_url })),
111-
{
112-
title: { header: 'Green, Mergeable PR' },
113-
html_url: { header: 'Link' },
114-
}
115-
);
109+
this.table({
110+
data: mergeablePRs.map((pr) => ({ 'Green, Mergeable PR': pr.title, Link: pr.html_url })),
111+
});
116112
this.log('');
117113

118114
const prToMerge = mergeablePRs[0];

src/commands/github/check/closed.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,12 @@ export default class GithubCheckClosed extends SfCommand<GithubCheckClosedResult
101101
})
102102
)
103103
.filter((item) => item.status);
104-
this.table(
105-
results,
106-
{
107-
issueUrl: { header: 'github issue' },
108-
workItem: { header: 'work item' },
109-
status: { header: 'status' },
110-
},
111-
{ sort: 'status' }
112-
);
104+
105+
this.table({
106+
data: results,
107+
columns: [{ key: 'issueUrl', name: 'github issue' }, { key: 'workItem', name: 'work item' }, 'status'],
108+
sort: { status: 'asc' },
109+
});
113110
return results;
114111
}
115112
}

src/commands/npm/dependencies/pin.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,10 @@ export default class Pin extends SfCommand<ChangedPackageVersions> {
4141
packageJson.writePackageJson();
4242
}
4343

44-
this.table(pkg, {
45-
name: { header: 'Name' },
46-
version: { header: 'Version' },
47-
tag: { header: 'Tag' },
48-
alias: { header: 'Alias' },
44+
this.table({
45+
data: pkg,
46+
columns: ['name', 'version', 'tag'],
4947
});
50-
5148
return pkg;
5249
}
5350
}

src/commands/repositories/index.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,15 @@ export default class Repositories extends SfCommand<RepositoryResult> {
6060
const repositories = await retrieveKnownRepositories();
6161
const ux = new Ux({ jsonEnabled: flags.json ?? false });
6262

63-
ux.table(
64-
repositories,
65-
{
66-
organization: {},
67-
name: {},
68-
url: {},
69-
packages: {
70-
get: (row: RepositoryInfo): string => row.packages.map((pkg) => `${pkg.type} ${pkg.name}`).join('\n'),
71-
extended: true,
72-
},
73-
},
74-
{
75-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
76-
printLine: this.log.bind(this),
63+
ux.table({
64+
data: repositories.map((s) => ({
65+
organization: s.organization,
66+
name: s.name,
67+
url: s.url,
68+
packages: s.packages.map((pkg) => `${pkg.type} ${pkg.name}`).join('\n'),
7769
...flags, // parsed flags
78-
}
79-
);
80-
70+
})),
71+
});
8172
return repositories;
8273
}
8374
}

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"outDir": "lib",
55
"rootDir": "src",
6+
"baseUrl": ".",
67
"moduleResolution": "Node16",
78
"skipLibCheck": true
89
},

0 commit comments

Comments
 (0)