Skip to content

[EC3-2572] Publish react-codemirror to GitHub Packages#2

Merged
EshtiakAlam merged 3 commits into
masterfrom
shihab/EC3-2572-react-codemirror-publish-gh-packages
Jun 30, 2026
Merged

[EC3-2572] Publish react-codemirror to GitHub Packages#2
EshtiakAlam merged 3 commits into
masterfrom
shihab/EC3-2572-react-codemirror-publish-gh-packages

Conversation

@EshtiakAlam

@EshtiakAlam EshtiakAlam commented Jun 30, 2026

Copy link
Copy Markdown

Description

Publishes @optimizely/react-codemirror to the GitHub Packages npm registry as part of the jFrog decommission (EC3-1515). The package was previously hosted on JFrog Artifactory; this migrates publishing to GitHub Packages with no version bump (stays 1.0.1) and no source-logic changes.

Two reference points to keep distinct:

  • vs the cloned repo base (this diff): the repo's package.json carried the unscoped name react-codemirror. This PR corrects it to the scoped @optimizely/react-codemirror so it matches the name the package was already published under on jFrog, repoints repository.url, and adds publishConfig.
  • vs the existing jFrog react-codemirror-1.0.1.tgz: the produced tarball is verified equivalent —
    • Identical file list (14 files).
    • All shared files byte-identical (lib/, dist/, src/, example/, README, LICENSE, etc.).
    • package.json differs only in repository.url (repointed to optimizely/react-codemirror, required so GH Packages links the package to this repo) and an added publishConfig (required to route the publish). The package name already matched jFrog (@optimizely/react-codemirror), so there is no name delta relative to the jFrog tarball — the name change is only relative to the repo base above.

Note on homepage/bugs: these intentionally remain pointed at JedWatson/react-codemirror. Upstream stays the canonical source for docs/issues for this fork (no source changes here); only repository.url is repointed, as GH Packages requires it to associate the package with this repo.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement in tooling
  • Optimization
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Changelist

  • Correct package name (react-codemirror@optimizely/react-codemirror) to match the prior jFrog-published name, repoint repository.url to optimizely/react-codemirror, and add publishConfignpm.pkg.github.com.
  • Add .npmignore so the .github/ tooling is excluded from the published tarball (keeps payload byte-identical to jFrog).
  • Add release-triggered publish.yml workflow (mirrors the optly-components pattern): publishes via GITHUB_TOKEN on GitHub Release; workflow_dispatch runs a dry-run. Guards: tag format, tag reachable from the repo's default branch, and package.json version matches the tag. No build/install step — lib/ and dist/ are committed, so it publishes the existing artifacts as-is.

Test plan

  • Test A: Run the workflow via workflow_dispatch and confirm the --dry-run publish is green (packs the expected 14 files).
  • Test B: Cut GitHub Release v1.0.1 and confirm @optimizely/react-codemirror@1.0.1 appears on the GitHub Packages registry and installs in a downstream consumer.

References

Jira Issues

EC3-2572

- Scope package as @optimizely/react-codemirror, repoint repository to optimizely
- Add publishConfig targeting npm.pkg.github.com
- Add .npmignore to keep .github tooling out of the published tarball
- Add release-triggered publish workflow (GITHUB_TOKEN, dry-run on dispatch)
Comment thread .github/workflows/publish.yml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates publishing of @optimizely/react-codemirror from the prior Artifactory/jFrog setup to GitHub Packages by updating package metadata and adding a release-driven GitHub Actions publish workflow.

Changes:

  • Updates package.json to point repository.url at optimizely/react-codemirror, adds publishConfig.registry, and scopes the package name.
  • Adds .npmignore to exclude repository tooling (.github/) from the published tarball.
  • Adds a publish.yml workflow to publish on GitHub Release (and dry-run on workflow_dispatch) with tag/version guards.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
package.json Adjusts npm package metadata for GitHub Packages publishing and repository association.
.npmignore Excludes .github/ from npm package contents to keep the published payload clean.
.github/workflows/publish.yml Adds automated release-based publishing to GitHub Packages (plus manual dry-run).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread package.json
Comment thread .github/workflows/publish.yml Outdated
- Set persist-credentials: false on actions/checkout so GITHUB_TOKEN is not
  written to .git/config (Arnica medium finding)
- Drop redundant authenticated git fetch; fetch-depth: 0 already provides
  origin/master for the local merge-base check
- Replace hardcoded origin/master with github.event.repository.default_branch
  so the publish guard survives a default-branch rename (master -> main)
@EshtiakAlam EshtiakAlam merged commit 434f8b5 into master Jun 30, 2026
1 check passed
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.

3 participants