feat: Implement devcenter open and preview commands in oclif v4#46
feat: Implement devcenter open and preview commands in oclif v4#46michaelmalave wants to merge 9 commits intofeat/ruby-to-typescriptfrom
Conversation
k80bowman
left a comment
There was a problem hiding this comment.
The commands work just fine, thank you for all of this. I left quite a few comments, though. Mostly they are smaller pattern/oclif things. I also noticed that there are no bin files.
src/commands/devcenter/preview.ts
Outdated
| debug: Flags.boolean({ | ||
| description: | ||
| 'log preview server activity (HTTP handling, file saves); enables oclif debug for this command (see `DEBUG` e.g. oclif:heroku:devcenter:preview)', | ||
| }), |
There was a problem hiding this comment.
Is this flag in the original? I couldn't find it. Also, I don't think it's necessary. We don't need to specifically enable oclif debug. In other commands, if we want to label specific debug messages, we do that through the debug package itself.
| * Heroku API token for `api.heroku.com` from netrc, same resolution as the Heroku CLI | ||
| * (`netrc-parser`: plain `~/.netrc` or `~/.netrc.gpg` when present, decrypted via `gpg`). | ||
| */ | ||
| export function getHerokuApiToken(): string { |
There was a problem hiding this comment.
I'm ok with this implementation for now, but we should open a work item for updating this to use the credential manager.
There was a problem hiding this comment.
created and added to the tracker. https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002SqrglYAB/view
Co-authored-by: Katy Bowman <katy.bowman@salesforce.com> Signed-off-by: Michael Malave <michael.malave@salesforce.com>
…, use ux.stdout, stub browser opens via sinon, add nock init, switch to shared ESLint config, and align tsconfig/package.json with CLI
…auto-generated command docs
Summary
This PR introduces
@heroku-cli/heroku-cli-plugin-devcenter, a Node 22+ oclif plugin that implementsheroku devcenter:openandheroku devcenter:previewusing TypeScript, HTTP calls to Dev Center foropen, local markdown/YAML handling and a local Express preview server forpreview.src/→dist/build, ESLint (oclif config), CI (multi-OS, Node 22 and 24), Dependabot for npm, and README/CONTRIBUTING updates for the new workflow.paths, Dev Center HTTP client, article parsing/rendering,~/.netrchelpers for future auth), preview templates and server, plus nock/supertest/unit tests and arunCommandhelper for command tests.DEVCENTER_CLI_CWDandDEVCENTER_CLI_TESTso tests stay isolated and non-interactive (no real browser open in tests).The Ruby
devcentergem andbin/devcenterremain the supported way to runpullandpushuntil a follow-up release.Breaking change (for users of a published npm plugin only): N/A for gem users; installing/linking this package is additive. A later PR that removes the gem will document the full breaking change.
Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
Setup:
npm install npm run build heroku plugins:link .Help:
Open a published article in the browser:
Preview a local article:
Related Issues:
GUS work item: W-20888065