Conversation
- Updated `tsdown.config.ts` in both `arkor` and `create-arkor` to define `__ARKOR_VERSION__` from `package.json`. - Modified `scaffold.ts` to use the defined version for `arkor` in `devDependencies`, ensuring consistent versioning across scaffolding. - Enhanced tests in `scaffold.test.ts` to dynamically reference the `arkor` version, improving maintainability and accuracy.
Greptile SummaryThis PR replaces the hardcoded
Confidence Score: 4/5Not safe to merge as-is — One P1 logic bug: packages/create-arkor/tsdown.config.ts — must import from Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["packages/arkor/package.json\n(version: X.Y.Z)"] -->|imported by| B["packages/arkor/tsdown.config.ts\ndefine: __ARKOR_VERSION__ = X.Y.Z ✅"]
C["packages/create-arkor/package.json\n(version: A.B.C)"] -->|imported by| D["packages/create-arkor/tsdown.config.ts\ndefine: __ARKOR_VERSION__ = A.B.C ⚠️"]
B --> E["@arkor/cli-internal bundle\n(via alwaysBundle)"]
D --> F["@arkor/cli-internal bundle\n(via alwaysBundle)"]
E --> G["scaffold.ts → PINNED_ARKOR_VERSION = '^X.Y.Z'\nscaffolded package.json: arkor@'^X.Y.Z' ✅"]
F --> H["scaffold.ts → PINNED_ARKOR_VERSION = '^A.B.C'\nscaffolded package.json: arkor@'^A.B.C' ⚠️ wrong if A.B.C ≠ X.Y.Z"]
Reviews (1): Last reviewed commit: "feat: integrate arkor versioning into sc..." | Re-trigger Greptile |
| alwaysBundle: ["@arkor/cli-internal"], | ||
| }, | ||
| define: { |
There was a problem hiding this comment.
Wrong version source for
__ARKOR_VERSION__
create-arkor injects its own version field, but scaffold.ts uses __ARKOR_VERSION__ to pin the arkor package in the user's scaffolded package.json. If arkor and create-arkor ever publish different version numbers, npx create-arkor will write the wrong version of arkor into new projects. The test in scaffold.test.ts always reads from packages/arkor/package.json, which masks this mismatch — both are 0.0.1-alpha.0 today, so the bug is latent.
The define should reference arkor's package.json:
import pkg from "../arkor/package.json" with { type: "json" };| alwaysBundle: ["@arkor/cli-internal"], | |
| }, | |
| define: { | |
| import pkg from "../arkor/package.json" with { type: "json" }; |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0392c89cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| alwaysBundle: ["@arkor/cli-internal"], | ||
| }, | ||
| define: { | ||
| __ARKOR_VERSION__: JSON.stringify(pkg.version), |
There was a problem hiding this comment.
Inject arkor version into create-arkor bundle
This define currently injects create-arkor’s own package version, but scaffold.ts uses __ARKOR_VERSION__ to pin the generated project's devDependencies.arkor. If create-arkor is ever released without an identical arkor version, scaffolds will pin to a non-existent or wrong arkor semver and installs can fail; the pinned value should come from packages/arkor/package.json instead.
Useful? React with 👍 / 👎.
Replaced the hardcoded scaffold version
^0.0.1-alpha.0with a sharedPINNED_ARKOR_VERSIONconstant that uses__ARKOR_VERSION__when injected at bundle time, and otherwise falls back to^0.0.1-alpha.0.Applied that constant in both package.json write paths:
Added version define injection in
packages/arkor/tsdown.config.ts:define: { __ARKOR_VERSION__: JSON.stringify(pkg.version) }.Added the same version define injection in
packages/create-arkor/tsdown.config.ts.Updated scaffold tests to compute expected pinned version dynamically from
packages/arkor/package.jsoninstead of using a hardcoded string