(v1) Internal code sharing strategy#1162
Conversation
🦋 Changeset detectedLatest commit: 0f9f9bb The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
arkenv
@arkenv/bun-plugin
@arkenv/cli
@arkenv/fumadocs-ui
@arkenv/nextjs
@arkenv/vite-plugin
commit: |
📦 Bundle Size Report
✅ All size limits passed! |
There was a problem hiding this comment.
ℹ️ Two rough edges worth noting — otherwise clean consolidation.
Reviewed changes — consolidates @repo/scope and @repo/types into a new arkenv/internal subpath export, eliminating version-skew risks for ArkType scopes in monorepos.
- Move scope and types into
packages/arkenv/src/internal/— source files frompackages/internal/scope/andpackages/internal/types/are relocated into the core package's source tree, preserving all tests and type definitions. - Add
./internalexport to core package — new barrel entry (src/internal.ts) andexportsfield inpackage.jsonexpose shared internals viaarkenv/internal, withsplitting: truein tsdown to deduplicate shared chunks. - Update all import paths across plugins —
@repo/scopeand@repo/typesimports inarkenv,@arkenv/vite-plugin,@arkenv/bun-plugin, and@arkenv/nextjsare replaced with relative orarkenv/internalimports. - Delete the standalone internal workspace packages —
packages/internal/scope/andpackages/internal/types/config files removed;packages/internal/*dropped frompnpm-workspace.yaml. - Add ADR 0006 — documents the single-core-with-internal-exports strategy and the wrapper plugin architecture decision.
ℹ️ docs/CONTEXT.md package names don't match current package.json names
The diff renames the core package from arkenv to @arkenv/core and the CLI from @arkenv/cli to arkenv in docs/CONTEXT.md, but neither package.json has been renamed yet. The ADR says "soon to be @arkenv/core" — implying these are aspirational edits. In the meantime, agents and contributors reading CONTEXT.md will see package names that don't exist.
Technical details
# CONTEXT.md package name skew
## Affected sites
- `docs/CONTEXT.md:86` — core package listed as `@arkenv/core` (actual name: `arkenv`)
- `docs/CONTEXT.md:88` — CLI listed as `arkenv` (actual name: `@arkenv/cli`)
- `docs/CONTEXT.md:97` — heading says `@arkenv/core` (actual name: `arkenv`)
- `docs/adr/0006-internal-code-sharing-strategy.md:11` — says "soon to be `@arkenv/core`"
## Required outcome
- Either update CONTEXT.md names to match the current `package.json` names, or defer the CONTEXT.md edit to the actual rename PR.
## Suggested approach
The simplest fix: revert the CONTEXT.md changes in this PR and include them with the package rename PR that makes the names canonical.Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
packages/arkenv/src/arktype/README.md:11(RIGHT) — file not in PR diff
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
this should probably be in v1 |
There was a problem hiding this comment.
ℹ️ One minor note — the merge from
devintroduces an ADR numbering collision.
Reviewed changes — merged dev into the feature branch (commit 898ae4a), bringing in 38 files including CI workflow updates, new skills, documentation changes, and a dist.test.ts for the core package.
- Merge
dev— routine sync pulling in CI workflows, skills (excalidraw,rename-skill), scripts, and docs - Added
dist.test.ts— new test verifying built outputs ofarkenv,arkenv/standard, andarkenv/core - Added
docs/adr/0006-branching-and-release-flow.md— new ADR on branching and release strategy fromdev
ℹ️ ADR 0006 numbering collision with the merge
The merge from dev introduces docs/adr/0006-branching-and-release-flow.md, but this PR already adds docs/adr/0006-internal-code-sharing-strategy.md. Both files are numbered 0006.
Technical details
# ADR 0006 numbering collision
## Affected sites
- `docs/adr/0006-internal-code-sharing-strategy.md` — added by this PR
- `docs/adr/0006-branching-and-release-flow.md` — introduced by the merge from `dev`
## Required outcome
- One of the two ADRs must be renumbered to a unique sequence number (e.g. `0007`).
## Open questions for the human
- Which ADR should keep `0006`? The PR's internal-code-sharing-strategy ADR was authored first in this branch, but numbering order is typically chronological by merge. If the branching-and-release-flow ADR landed on `dev` first, it should keep `0006` and the PR's ADR should renumber to `0007`.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|

Fixes #736
This PR consolidates the internal packages
@repo/scopeand@repo/typesinto the unifiedarkenv/internalsubpath export. This addresses the version skew risks with ArkType scopes in monorepos while maintaining zero user configuration and strict bundle size constraints.