Skip to content

feat: Implement devcenter pull and push commands in oclif v4#47

Open
michaelmalave wants to merge 24 commits intofeat/ruby-to-typescriptfrom
feat/ruby-to-typescript-2
Open

feat: Implement devcenter pull and push commands in oclif v4#47
michaelmalave wants to merge 24 commits intofeat/ruby-to-typescriptfrom
feat/ruby-to-typescript-2

Conversation

@michaelmalave
Copy link
Copy Markdown

@michaelmalave michaelmalave commented Apr 9, 2026

Summary

This PR adds heroku devcenter:pull and heroku devcenter:push to the existing Node/TypeScript oclif plugin, alongside the open / preview commands from PR 1.

  • pull: loads an article from public JSON, retries with ~/.netrc Heroku credentials, then falls back to the private GET /api/v1/private/articles/<slug>.json API for drafts; supports --force / --debug; overwrite confirmation via @inquirer/prompts (tests use DEVCENTER_CLI_TEST_CONFIRM).
  • push: reads local YAML front matter + markdown, runs broken-link check, validate, and update against Dev Center private APIs using ~/.netrc (plain file only; not .netrc.gpg).
  • Tests: command tests for pull and push (plus existing open, preview, and preview-server tests). DEVCENTER_CLI_CWD, DEVCENTER_CLI_TEST, and DEVCENTER_CLI_TEST_CONFIRM keep runs isolated and non-interactive.
  • Quality: npm test runs Mocha then ESLint (same pattern as PR 1). c8 coverage gates and lib unit tests are intentionally deferred to PR 3 so this PR stays reviewable.
  • Docs: README/CONTRIBUTING updated for full plugin install/usage, pull fallback behavior, push auth, and test env vars.

The Ruby gem and bin/devcenter are unchanged; users can keep using the gem or the plugin.

Type of change

Breaking changes (major semver update)

  • Add a ! after your change type to denote a change that breaks current behavior

Feature additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Patch updates (patch semver update)

  • fix: Bug fix
  • deps: Dependency upgrade
  • revert: Revert a previous commit
  • chore: Change that does not affect production code
  • refactor: Refactoring existing code without changing behavior
  • test: Add/update/remove tests

Testing

Setup:

npm install
npm run build
heroku plugins:link .

First heroku login. Then run these commands which should create the .md files in the location you run from and open the preview locally

heroku devcenter:pull slowdb
heroku devcenter:pull https://devcenter.heroku.com/articles/slowdb

This will send an update to the article, not publish if in drafts.

heroku devcenter:push slowdb

Related Issues

GUS work items: W-20888087

@michaelmalave michaelmalave requested a review from a team as a code owner April 9, 2026 20:58
@michaelmalave michaelmalave changed the base branch from main to feat/ruby-to-typescript April 9, 2026 21:13
@michaelmalave michaelmalave changed the title feat: add devcenter pull and push with c8 coverage feat: Implement devcenter pull and push commands in oclif v4 Apr 13, 2026
michaelmalave and others added 17 commits April 13, 2026 13:38
…etrc on Windows and .netrc elsewhere, matching netrc-parser
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
…_ROOT helper from tests in favor of default test-utils behavior
…from git (add to .gitignore), and remove redundant debug tests from command files
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.

1 participant