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

fix: remove deprecated sfdx-core references #562

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Conversation

mshanemc
Copy link
Contributor

@mshanemc mshanemc commented Apr 2, 2024

What does this PR do?

remove use of deprecated methods from aliasAccessor
adjust NUTs to allow aliases:list in any order

What issues does this PR fix or reference?

@W-15387805@

@mshanemc mshanemc changed the title Sm/core-7-prep fix: remove deprecated sfdx-core references Apr 2, 2024
} else {
stateAggregator.aliases.set(alias, value);
const results = await Promise.all(
Object.entries(parsed).map(async ([alias, value]) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we're setting aliases in parallel you'll see some NUTs change because the alias entries can end up in any order

[also, they're now good tests of the alias cross-save lockfile feature]

@@ -76,7 +76,8 @@ describe('alias list NUTs', () => {

it('lists multiple results correctly JSON', () => {
const result = execCmd('alias list --json', { ensureExitCode: 0 }).jsonOutput?.result;
expect(result).to.deep.equal([
expect(result).lengthOf(3);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these each now assert the total length and that each item is included

src/alias.ts Outdated
@@ -49,3 +49,13 @@ export abstract class AliasCommand<T> extends SfCommand<T> {
this.table(results, columns, { title, 'no-truncate': true });
}
}

export const setUnsetErrorHandler = (err: unknown, alias: string, value?: string): AliasResult => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY, used by both set and unset

Copy link
Contributor

@shetzel shetzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit suggestion: rename setUnsetErrorHandler to aliasErrorHandler?

@mshanemc mshanemc merged commit 70a36ac into main Apr 2, 2024
10 checks passed
@mshanemc mshanemc deleted the sm/core-7-prep branch April 2, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants