Skip to content

feat(npm): prepare build and add publish workflow#27

Merged
Hug0-Drelon merged 3 commits into
masterfrom
feat/npm-publish
Jul 17, 2026
Merged

feat(npm): prepare build and add publish workflow#27
Hug0-Drelon merged 3 commits into
masterfrom
feat/npm-publish

Conversation

@Hug0-Drelon

@Hug0-Drelon Hug0-Drelon commented Jul 17, 2026

Copy link
Copy Markdown
Member

What?

Prepare @wpsyntex/polylang-react-library for npm publication: Babel packaging for a prebuilt build/ artifact, plus a publish workflow aligned with e2e-test-utils.

Why?

The package is still consumed via GitHub installs. Publishing to npm ships a pre-transpiled library that fits Polylang / Polylang Pro webpack (babel-loader excludes node_modules, @wordpress/* stay externals).

How?

  1. Move Babel tools to devDependencies, add clean / prepublishOnly, and document the npm install path.
  2. Add publish-npm.yml (release → latest, workflow_dispatchnext) gated on lint via workflow_call.

Consumer updates in Polylang / Polylang Pro are intentionally out of scope.

Test plan

  • CI lint passes on this PR
  • Locally: npm ci --omit=peer && npm run build succeeds
  • After merge: dry-run via workflow_dispatch publishes a *-dev.<sha> version under the next tag
  • GitHub Release publish lands on latest once ready
  • Confirm NPM_TOKEN secret exists on this repo (same setup as e2e-test-utils)

Move transpile tools to devDependencies, add clean/prepublishOnly, and document the prebuilt build/ artifact for consumers that externalize WordPress packages.
Publish on GitHub release (latest) or workflow_dispatch (next), after lint, mirroring e2e-test-utils.
ESLint needs @wordpress/* peers on disk; --omit=peer left those imports unresolved.
@Hug0-Drelon Hug0-Drelon self-assigned this Jul 17, 2026
@Hug0-Drelon
Hug0-Drelon merged commit bfa6068 into master Jul 17, 2026
2 checks passed
@Hug0-Drelon
Hug0-Drelon deleted the feat/npm-publish branch July 17, 2026 16:08
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