Skip to content

Commit d88cbe8

Browse files
committed
refactor: decouple plugins from core engine by replacing workspace peer dependencies with hardcoded range
1 parent f8ef94b commit d88cbe8

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

docs/adr/0011-independent-versioning-strategy.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ Because this is a monorepo, plugins reference the local `arkenv` package during
5353
- When published to npm, pnpm rewrites `workspace:*` to the **exact current version** (e.g., `"1.0.0-alpha.1"`).
5454
- This is correct for `devDependencies` because they are not installed by end users.
5555

56-
**`peerDependencies`: `"arkenv": "workspace:^"`**
56+
**`peerDependencies`: `"arkenv": "^1.0.0"`**
5757

58-
- During local development, this also links to the workspace package.
59-
- When published to npm, pnpm rewrites `workspace:^` to a **caret range** (e.g., `"^1.0.0-alpha.1"`).
60-
- This is **mandatory** for `peerDependencies`. Using `workspace:*` here would publish an exact pin, meaning every patch release of `arkenv` would trigger an unmet peer dependency warning for all users until they manually update every plugin. The caret range allows users to upgrade `arkenv` within the major version without friction.
58+
- We use the **Wide Peer** strategy by hardcoding the absolute minimum supported version of `arkenv`. We completely drop the `workspace:` prefix here.
59+
- This decoupling is necessary to solve the "Artificial Floor" problem where using `workspace:^` forces the published package to artificially require the exact version of the core engine present in the monorepo at publish time.
60+
- Because it is a regular hardcoded range, anyone from `1.0.0` upwards can install the new plugin update without being forced to upgrade their core engine.
6161

6262
**`dependencies` (Highly Coupled Internals): `"arkenv": "workspace:~"`**
6363

@@ -66,11 +66,11 @@ Because this is a monorepo, plugins reference the local `arkenv` package during
6666
- This ensures that a minor feature update to `arkenv` cannot silently break the coupled internal tool. If `arkenv` bumps its minor version, the dependent package must also be released and bumped.
6767
- **Not currently used** in the ArkEnv monorepo, but reserved for future highly-coupled internal tools.
6868

69-
| Field | Protocol | Local Dev | Published |
70-
| ---------------------- | ------------- | ------------------ | ------------------------------- |
71-
| `devDependencies` | `workspace:*` | Links to workspace | Exact version (`1.0.0-alpha.1`) |
72-
| `peerDependencies` | `workspace:^` | Links to workspace | Caret range (`^1.0.0-alpha.1`) |
73-
| `dependencies` (tight) | `workspace:~` | Links to workspace | Tilde range (`~1.0.0-alpha.1`) |
69+
| Field | Protocol | Local Dev | Published |
70+
| ---------------------- | ------------- | ------------------- | ------------------------------- |
71+
| `devDependencies` | `workspace:*` | Links to workspace | Exact version (`1.0.0-alpha.1`) |
72+
| `peerDependencies` | `^1.0.0` | Standard resolution | Hardcoded range (`^1.0.0`) |
73+
| `dependencies` (tight) | `workspace:~` | Links to workspace | Tilde range (`~1.0.0-alpha.1`) |
7474

7575
> **Reference:** See [pnpm documentation on publishing workspace packages](https://pnpm.io/workspaces#publishing-workspace-packages) for full details on how `workspace:` protocols are rewritten during publish.
7676

packages/bun-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"vitest": "catalog:"
2424
},
2525
"peerDependencies": {
26-
"arkenv": "workspace:^",
26+
"arkenv": "^1.0.0",
2727
"arktype": "^2.1.22",
2828
"bun": "^1.0.0"
2929
},

packages/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"vitest": "catalog:"
2727
},
2828
"peerDependencies": {
29-
"arkenv": "workspace:^",
29+
"arkenv": "^1.0.0",
3030
"arktype": "^2.1.22",
3131
"next": "^13.4.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-0"
3232
},

packages/nuxt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"vitest": "catalog:"
2828
},
2929
"peerDependencies": {
30-
"arkenv": "workspace:^",
30+
"arkenv": "^1.0.0",
3131
"arktype": "^2.1.22",
3232
"nuxt": "^3.0.0 || ^4.0.0-0"
3333
},

packages/vite-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"vitest": "catalog:"
2323
},
2424
"peerDependencies": {
25-
"arkenv": "workspace:^",
25+
"arkenv": "^1.0.0",
2626
"arktype": "^2.1.22",
2727
"vite": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
2828
},

0 commit comments

Comments
 (0)