Skip to content

feat!: rename packages and prepare 1.0.0 restructure#337

Merged
jedrazb merged 5 commits into1.0.0-releasefrom
feat/1.0.0-package-restructure
May 4, 2026
Merged

feat!: rename packages and prepare 1.0.0 restructure#337
jedrazb merged 5 commits into1.0.0-releasefrom
feat/1.0.0-package-restructure

Conversation

@jedrazb
Copy link
Copy Markdown
Contributor

@jedrazb jedrazb commented May 4, 2026

Summary

Unified 1.0.0 rename. All five packages ship under matching versions in a single coordinated release. Targets the long-living 1.0.0-release branch — PR #245 (Vue impl) lands separately into the same branch before this whole train merges to main.

Old name New name Status
@eigenpal/docx-js-editor @eigenpal/docx-editor-react Old name kept alive as a thin re-export shim
@eigenpal/docx-core @eigenpal/docx-editor-core Now public — was previously workspace-internal
@eigenpal/docx-editor-agents (unchanged) Bumps to 1.0.0 alongside the rest
@eigenpal/docx-editor-vue (unchanged) Now public, stub today, real impl lands via #245

What changed

  • Bulk rename across source, configs, docs, examples (@eigenpal/docx-core@eigenpal/docx-editor-core, @eigenpal/docx-js-editor@eigenpal/docx-editor-react).
  • packages/core and packages/vue flipped from private: true to public-publishable.
  • New packages/react-legacy-shim/ — publishes under the old @eigenpal/docx-js-editor name, pure re-export of @eigenpal/docx-editor-react. Existing installs keep working with no code changes.
    • scripts/copy-assets.mjs copies styles.css and i18n/*.json from upstream into the shim's own tarball at build time so subpath imports (/styles.css, /i18n/de.json) resolve post-publish.
    • sideEffects: ["*.css"] so bundlers don't tree-shake the CSS away.
    • tsup externals collapsed to one regex.
  • packages/vue/tsup.config.ts added so the existing stub builds; feat: add vue version of docx editor #245 will replace the stub.
  • .changeset/config.json: fixed group now contains all 5 packages, ignore cleared, baseBranch set to 1.0.0-release.
  • Root build pipeline: core → react → (agents ∥ vue ∥ shim).
  • Restored historical CHANGELOG entries — past releases really did publish under the old names.
  • Fixed vite alias regex in examples/{vite,vue,collaboration}/vite.config.ts that the bulk sed missed.

Migration for consumers

- import { DocxEditor } from '@eigenpal/docx-js-editor';
+ import { DocxEditor } from '@eigenpal/docx-editor-react';

No API changes. The shim keeps the old name working indefinitely, but won't get new features — those land on @eigenpal/docx-editor-react directly.

Version math

bunx changeset status confirms all 5 packages bump at major. Per semver, major from 0.4.11.0.0, from 0.0.281.0.0, from 0.0.11.0.0. No manual package.json edits needed.

Review pass

Round 1 (3 parallel review agents) found and fixed:

  • Blocker: shim's ./styles.css and ./i18n/*.json exports pointed into ./node_modules/... which doesn't ship in the tarball. Now copies into the shim's own dist/ + i18n/ at build time.
  • Bug: vite alias regex still matched old @eigenpal/docx-core.
  • Bug: historical CHANGELOG entries got rewritten by the bulk sed — restored.

Round 2 (2 parallel review agents) found and fixed:

  • Bug: shim's sideEffects: false would let bundlers tree-shake the CSS export. Mirrored upstream's ["*.css"].
  • Stale-asset risk: cpSync with recursive: true merges into existing dir; an upstream-deleted locale would still ship. Added rmSync before copy.
  • Build serialization: shim only depends on react. Pipeline now lets agents/vue/shim run in parallel after react.

Open items (handled outside this PR)

  • PR feat: add vue version of docx editor #245 (Vue impl) merges into 1.0.0-release before this train ships
  • Vercel preview alias for 1.0.0-release branch (project settings)
  • React/Vue parity comparison page (after feat: add vue version of docx editor #245 lands)
  • npm Trusted Publisher set up for the new package names (docx-editor-core, docx-editor-react, docx-editor-vue)
  • After 1.0.0 publishes: npm deprecate @eigenpal/docx-js-editor "renamed to @eigenpal/docx-editor-react"

Test plan

  • bun run typecheck clean across all 5 packages including the shim
  • bun run build succeeds end-to-end with the new pipeline ordering
  • npm pack --dry-run for the shim confirms dist/styles.css and i18n/*.json ship in the tarball (38.7 kB)
  • No leftover @eigenpal/docx-core or @eigenpal/docx-js-editor references in source (only in shim's own name + intentional CHANGELOG history)
  • Smoke-test in a downstream consumer using the old @eigenpal/docx-js-editor import path
  • Vercel preview deployment renders both the React and Vue demos from 1.0.0-release

🤖 Generated with Claude Code

Renames the npm packages to a unified `docx-editor-*` naming and ships
the framework-agnostic core publicly:

- `@eigenpal/docx-js-editor`  → `@eigenpal/docx-editor-react`
- `@eigenpal/docx-core`       → `@eigenpal/docx-editor-core` (now public)
- `@eigenpal/docx-editor-vue` stays private until #245 lands its build
- `@eigenpal/docx-editor-agents` unchanged

Adds `packages/react-legacy-shim/` as a thin re-export of
`docx-editor-react` published under the old `docx-js-editor` name so
existing installs keep working without code changes. The shim is in
the changesets fixed group with `docx-editor-react` and
`docx-editor-agents` so versions stay in lockstep.

Note: changesets cannot auto-bump from `0.x` to `1.0.0`; the maintainer
needs to edit each `package.json` `version` to `1.0.0` inside the
auto-opened release PR before merging.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docx-editor Ready Ready Preview, Comment May 4, 2026 9:10am

Request Review

@jedrazb jedrazb changed the base branch from main to 1.0.0-release May 4, 2026 06:50
- Restore historical CHANGELOG entries for `packages/react/` and
  `packages/agent-use/` — past releases really did publish under the
  old `@eigenpal/docx-js-editor` / `@eigenpal/docx-core` names; rewriting
  the history would mislead anyone debugging an old install.
- Fix vite alias regex in `examples/{vite,vue,collaboration}/vite.config.ts`
  — bulk sed missed the regex bodies (`/^@eigenpal\/docx-core\/(.+)/`).
- Fix shim's `./styles.css` and `./i18n/*.json` exports. The previous
  paths into `./node_modules/@eigenpal/docx-editor-react/...` would not
  resolve post-publish (npm hoists the dep, and `node_modules` doesn't
  ship in the tarball). Now copies the assets into the shim's own
  `dist/styles.css` and `i18n/` at build time via `scripts/copy-assets.mjs`.
- Simplify shim's tsup `external` to a single regex.
- Drop the manual-version-bump caveat from the changeset entry — `major`
  on `0.4.1` produces `1.0.0` automatically per semver.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Drop \`private: true\` from \`packages/vue/package.json\` so it ships at 1.0.0
  with the rest. Add a minimal \`tsup.config.ts\` so the existing stub
  (\`src/index.ts\`) builds; #245 will replace the stub with the real
  implementation when it merges into \`1.0.0-release\`.
- Extend the changeset \`fixed\` group to all five packages
  (\`docx-editor-react\`, \`docx-editor-core\`, \`docx-editor-agents\`,
  \`docx-editor-vue\`, \`docx-js-editor\`) and clear \`ignore\`.
- List every package explicitly in the 1.0.0 changeset entry so the
  changelog spells out the bump per-package.
- Add \`docx-editor-vue\` to the root build pipeline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ze build

- `packages/react-legacy-shim/package.json`: change `sideEffects: false` to
  `["*.css"]`. The shim re-exports `./styles.css`, but webpack/esbuild
  tree-shake unused side-effects when the package declares none. Match
  the upstream `@eigenpal/docx-editor-react` declaration so consumers
  doing `import '@eigenpal/docx-js-editor/styles.css'` actually get the
  styles emitted.
- `packages/react-legacy-shim/scripts/copy-assets.mjs`: rmSync the
  destination i18n dir before cpSync. Without this, `cpSync` with
  `recursive: true` merges into the existing dir, so a locale removed
  upstream still ships from a stale prior build.
- root `package.json` build pipeline: split the middle group so only
  react gates downstream. Now `core → react → (agents ∥ vue ∥ shim)` —
  agents and vue don't depend on react, but the shim's copy-assets does,
  so the shim still waits. Cuts the critical path by one tsup run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- packages/vue/package.json: prefix description with [STUB] so the npm
  page warns Vue users that renderAsync is not yet implemented. Without
  this, a 1.0.0 version number is the loudest possible "production-ready"
  signal and the package can't back it up until #245 lands.
- README.md: flag vue as "stub at 1.0.0, not yet functional" in the
  packages table; add the prosemirror peer-deps install line under
  Quick Start for strict installers (pnpm / npm 6 / auto-install-peers
  off).
- packages/react-legacy-shim/README.md: replace vague "foreseeable
  future" wording with a concrete commitment ("ships in lockstep for the
  entire 1.x line; plan to migrate before 2.0.0").
- .changeset/1-0-0-package-restructure.md: spell out that vue is a
  runtime-throwing stub at 1.0.0 — the per-package CHANGELOG that lands
  on npm now tells the truth.
- CLAUDE.md: document the post-publish `npm deprecate
  @eigenpal/docx-js-editor` step so first-wave 1.0.0 installs get a
  migration banner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jedrazb jedrazb merged commit e68eac3 into 1.0.0-release May 4, 2026
2 checks passed
@jedrazb jedrazb deleted the feat/1.0.0-package-restructure branch May 4, 2026 09:21
jedrazb added a commit that referenced this pull request May 4, 2026
…eview (#338)

* docs: document 1.0.0-release as the active integration branch

Adds a top-of-file section in CLAUDE.md so future contributors (and
agents) know that 1.0.0-related work targets the long-living
1.0.0-release branch, not main. Lists what has merged so far (#337),
what is still pending (#245), and the post-train cleanup (npm deprecate,
reset baseBranch back to main).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(examples): add /react /vue parity preview for the 1.0.0-release Vercel deploy

Adds a single deployment that mounts both example apps at distinct routes
so community members can verify React and Vue parity side by side.

  /         landing page with two iframes (React left, Vue right)
  /react/   examples/vite — @eigenpal/docx-editor-react
  /vue/     examples/vue  — @eigenpal/docx-editor-vue

Both apps build with USE_PUBLISHED_PACKAGES=1, which makes their vite
configs skip the workspace source aliases. Vite then resolves the
@eigenpal/* package names through node_modules → the workspace's
built dist/ — the same module resolution a community member gets after
\`npm install\`. So the deployment is the real installed experience,
not the dev-mode source-aliased one.

Plumbing:
- examples/{vite,vue}/vite.config.ts: gate the source-alias array on
  USE_PUBLISHED_PACKAGES, accept VITE_BASE_PATH for subroute mounting.
- examples/vite/package.json: switch dep on docx-editor-react from a
  bogus "^0.0.7" to workspace:*, add docx-editor-core (it's imported
  directly from the demo's App.tsx).
- root package.json: include examples/vite and examples/vue in the
  bun workspaces array so deps actually symlink.
- root package.json scripts: build:parity orchestrates root build →
  react example → vue example → assemble into examples/parity/dist/.
- examples/parity/index.html: landing page with side-by-side iframes,
  responsive single-column at <900px width.
- examples/parity/README.md: how to set up the new Vercel project
  (root dir, build command, output dir, branch alias).

The existing root vercel.json (latest.docx-editor.dev off main) is
untouched — the 1.0.0-release deployment is a separate Vercel project
that the maintainer configures via dashboard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(vercel): make parity build the default for all deployments

Updates root vercel.json so any Vercel project pointed at this repo
gets the /react /vue parity preview without dashboard overrides:
- buildCommand: bun run build:parity
- outputDirectory: examples/parity/dist
- rewrites: SPA fallbacks for /react/* and /vue/* plus the landing
  page fallback at /.
- framework: null (build command handles it).

This applies to:
- The existing latest.docx-editor.dev project (deploys off main) — on
  its next deploy after this lands, / will show the side-by-side
  comparison and /react/ /vue/ give the standalone experiences.
- The new 1.0.0-release Vercel project — no manual settings needed,
  just point at the repo and assign the custom domain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(parity): resolve review findings — fetch base path, stale refs, DX polish

Round 3 of reviews surfaced one blocker, two bugs, and several DX
improvements. Applying the in-scope ones.

BLOCKER
- examples/vite/src/App.tsx:233 — fetch('/docx-editor-demo.docx') is an
  absolute path, which under the parity build at /react/ falls through
  to the catchall rewrite and returns the landing HTML. The .catch
  branch then silently created an empty document. Switched to
  \`fetch(\${import.meta.env.BASE_URL}docx-editor-demo.docx)\` so vite
  rewrites the path correctly for any base.

BUGS
- examples/vue/src/App.vue:6 — pre-rename package name in the visible
  copy. Updated to @eigenpal/docx-editor-core.
- examples/vite/vercel.json — stale, never consulted at the repo root,
  but a footgun if a Vercel project is ever pointed at examples/vite as
  Root Directory. Deleted.

DX polish (parity landing)
- Added a banner above the iframes explaining Vue is in active
  development (#245) so first-time visitors don't think the package is
  half-broken when the Vue pane shows a placeholder.
- Added GitHub link + npm install snippet to the header so the landing
  page actually exits to docs / install / repo.
- Mobile layout: capped each pane at 60vh instead of stacking 200vh
  total — both labels visible at once, scroll inside iframe instead of
  the page.
- Dropped redundant <span> wrappers in <h2> and the loading="eager"
  default on <iframe>.

Code quality
- Normalized USE_PUBLISHED_PACKAGES check from === '1' to === 'true' in
  both vite configs to match the existing ENABLE_FRAMEWORK_SWITCHER
  convention. Also updated the build:parity:* scripts.
- Dropped redundant fields from vercel.json: installCommand (auto from
  bun.lock) and framework: null (omit-key equivalent in fresh config).

Contributor DX
- Added bun run dev:parity script: builds + serves the parity output on
  port 4173 in one command. Without this, contributors had to memorize
  the build + serve incantation.
- examples/parity/README.md: added a "Why this exists" section
  explaining the dev/parity build divergence and what the deployment is
  proving (real installed bytes, not source-aliased dev mode).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(parity): switch from side-by-side to single-column with framework toggle

Side-by-side iframes felt cramped, especially on the React side where
the editor toolbar already eats horizontal space. Replaced with a
single full-width iframe and a React/Vue toggle in the header.

  Header: [docx-editor] [React | Vue] npm install ... GitHub ↗ Fullscreen ↗
  Body:   <iframe> takes the rest of the viewport

Switcher behavior:
- Default: React. ?framework=vue in the URL switches to Vue at load.
- Clicking either tab swaps the iframe src and updates the install snippet,
  the fullscreen link target, and the URL (replaceState — no scroll
  jump).
- The Vue stub banner is gated to only show when the Vue tab is active —
  no warning noise for visitors who never click Vue.

The /react/ and /vue/ routes still serve the standalone fullscreen
experiences; only the landing page changed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(parity): drop landing wrapper, switcher lives in each editor's toolbar

You were right — having both /react /vue routes AND a ?framework= URL
param on / was redundant. Cleanup:

- Delete examples/parity/index.html (the landing iframe wrapper).
- vercel.json: / now 307-redirects to /react/. Bookmark whichever
  adapter you want.
- examples/shared/AdapterSwitcher.tsx — small React pill, two anchor
  tags pointing at /react/ and /vue/. Drop-in alongside the existing
  ExampleSwitcher in examples/vite/src/App.tsx.
- examples/vue/src/App.vue — same pill as plain HTML/CSS so the stub
  has it too. When PR #245 lands, the real Vue editor inherits the
  pattern.

Each adapter now owns the full viewport. Switcher is just navigation —
no iframe, no param, canonical URLs, bookmarkable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(vercel): pin install to lockfile so cached node_modules can't drift

The 1.0.0-release deploy failed because Vercel's cached .bun/ store
held both prosemirror-transform@1.11.0 (from a pre-PR lockfile) and
1.12.0 (current). DTS build for @eigenpal/docx-editor-core saw two
incompatible Mapping types and crashed with TS2322.

Adding installCommand: 'bun install --frozen-lockfile' forces Vercel
to match the committed lockfile exactly. New version drift = build
fails fast at install rather than producing a confusing type error
mid-build. (Maintainer needs to clear Vercel build cache once for
this PR's deploy.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(deps): tighten prosemirror-transform peer/dev to ^1.12.0

The 1.0.0-release Vercel build kept failing because a stale 1.11.0
slipped into Vercel's .bun/ store next to 1.12.0, and tsup's dts gen
pulled types from the older one — TS2322 on TableExtension.ts:2330
because Mapping has private '_maps' that diverges between minor
versions of prosemirror-transform.

Root cause: peer/dev constraint was ^1.10.2, satisfied by both 1.11.0
and 1.12.0. The root overrides force 1.12.0 in the lockfile but Vercel's
resolver evidently picks something different for transitive deps.

Bumping the constraint to ^1.12.0 in packages/core and packages/react
removes the ambiguity at the package level — every resolver, on any
platform, must land on >=1.12.0. The override stays for belt-and-braces.

Also confirmed the lockfile only carries 1.12.0 after re-resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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