-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: show channel in --available table #840
Conversation
QA Notes✅ : channels in output ➜ sf update --available
› Warning: @oclif/plugin-update is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
Looking up versions... Found 140 versions
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────────┬─────────┐
│ Location │ Version │ Channel │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────────┼─────────┤
│ https://developer.salesforce.com/media/salesforce-cli/sf/versions/2.46.6/191291b/sf-v2.46.6-191291b-darwin-arm64.tar.gz │ 2.46.6 │ nightly │
│ https://developer.salesforce.com/media/salesforce-cli/sf/versions/2.46.5/a4ab13a/sf-v2.46.5-a4ab13a-darwin-arm64.tar.gz │ 2.46.5 │ │
│ https://developer.salesforce.com/media/salesforce-cli/sf/versions/2.46.5-qa.0/b6df280/sf-v2.46.5-qa.0-b6df280-darwin-arm64.tar.gz │ 2.46.5-qa.0 │ qa ❌ : |
✅ : flag validation ➜ sf update --available --force
› Warning: @oclif/plugin-update is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
› Error: The following error occurred:
› --available=true cannot also be provided when using --force
› See more help with --help
➜ dreamhouse-lwc git:(main) ✗ hub:(GLOBAL - DevHub) scratch:([email protected])
➜ sf update --available --interactive
› Warning: @oclif/plugin-update is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
› Error: The following error occurred:
› --interactive=true cannot also be provided when using --available
› See more help with --help |
sort(Object.keys(index)) | ||
.reverse() | ||
.map((version) => { | ||
const location = localVersions.find((l) => basename(l).startsWith(version)) || index[version] | ||
if (distTags) { | ||
return [location, version, distTags[version] ?? ''] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
distTags[version]
So in order for this to work, then one must create an NPM tag together with publish to S3?
A bit curious, if the requirement to keep two sources of truth as opposed to just S3. Or S3 doesn't have this kind of information?
Sorry if the question is trivial 🙏 Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it assumes that you're publishing to both npm and S3. But this assumption has been true for a long time here and can be turned off by setting disableNpmLookup
to true in oclif.update
in your package.json
Really the only way to get the information from S3 is to know ahead of time which channels you want (e.g. I want to show stable
, stable-rc
, and nightly
). But that's hard to do in a plugin like this which is meant to be used by a wide variety of CLIs. For instance one CLI might make heavy use of nightly
channel whereas another CLI might use a beta
channel. Of course, this could be configured at the CLI level but I figured that since we were already assuming elsewhere that the CLI is published both to npm and S3 we could continue making that assumption.
Channel
in theupdate --available
table.update --interactive
promptIn both cases, we assume that
dist-tags
in npm correlate to what's in S3. Can be disabled with settingoclif.update.disableNpmLookup
to true in CLI package.jsonFixes #674
@W-15974839@