Skip to content

Conversation

@k-capehart
Copy link
Contributor

Somehow I went down this rabbit hole of updating packages, and realized we had a number of deprecated dependencies.

Naturally, I then had to make some updates to the scan command to match the new dependencies. I ran into some issues with CommonJS, so migrated the projected to an ES Module. I'm not 100% confident in that decision, but it fixed the problem after some more configuring.

Lastly, I added a dependabot.yaml so we can get notified of dependency updates and maybe avoid problems like this in the future. I followed the documentation here: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates

@k-capehart k-capehart requested a review from junners June 27, 2024 20:08
Copy link
Contributor

@junners junners left a comment

Choose a reason for hiding this comment

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

Wow! You went incredibly deep on this! Thank you so much for your contribution!

"target": "es2019",
"lib": ["es2020"],
"moduleResolution": "Node16",
"module": "Node16",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll have to check whether sf cli can consume this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should, the reason I changed it in this specific way is because of the dev-config here: https://github.com/forcedotcom/dev-config/blob/main/tsconfig-esm.json

The template that Salesforce provides for CLI plugins extends this config by default.

char: 'u',
description: 'Retrieve the latest metadata from the target before the scan.',
required: false,
})
Copy link
Contributor Author

@k-capehart k-capehart Jun 28, 2024

Choose a reason for hiding this comment

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

Another thing to note: I'm not sure what happened to the targetusername flag? I think an older version of @salesforce/core had this as a default flag for all commands, but now we need to explicitly create it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm gotcha. I haven't used this with flow scanner due to my usage contained in the scanning directory. All invocations of sf cli core gets the default username property to set the target org

Copy link
Contributor

Choose a reason for hiding this comment

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

But yea you're absolutely right, scan.ts has defaultusername which calls retrive on org

@junners
Copy link
Contributor

junners commented Jun 28, 2024

I've bumped all the dependencies here as well as added an alias -o for the -u flag since the wider sf cli uses -o for target org

@junners
Copy link
Contributor

junners commented Jun 28, 2024

Always appreciate the support and contribution @k-capehart ❤️

@junners junners merged commit 1b55888 into master Jun 28, 2024
@junners junners deleted the migrate-deprecated-packages branch June 28, 2024 23:33
@junners
Copy link
Contributor

junners commented Jun 28, 2024

🎉 This PR is included in version 2.27.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

RubenHalman pushed a commit that referenced this pull request Nov 30, 2025
…_yarn-multi-351a35f700

fix(deps): bump mocha and @types/mocha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants