Skip to content

refactor!: use c7, c8 and none as the only platform value and drop the unused in-memory store - #110

Merged
emaarco merged 2 commits into
mainfrom
emaarco/improve-codebase-architecture-review
Oct 27, 2026
Merged

emaarco merged 2 commits into
mainfrom
emaarco/improve-codebase-architecture-review

Conversation

@emaarco

@emaarco emaarco commented Oct 27, 2026

Copy link
Copy Markdown
Member

Summary

This PR makes two small cleanups that came out of an architecture review.

One internal platform value. The platform used to have three spellings inside the code: c7 | c8 | none in validation, camunda7 | camunda8 | undefined from Doc.platform() and EditContext.platform(), and zeebe in DecisionLinkWriter. Two hand-written ternaries translated between them. Now 'c7' | 'c8' | 'none' is the only internal value. The --target camunda7|camunda8|none spelling users type is translated in one place, platformOfTarget() in PlatformDetection.ts. That file now also holds TARGETS and the Target type. PlatformDetection.target() is removed, and the editing code compares against c7/c8 directly.

No in-memory document store. InMemoryDocumentStore was never read or written: the in-memory API always passes a loaded document and dryRun: true. The services now take their load and save ports as optional, after the project settings. Reading a file without a load port fails with E_FILE_NOT_FOUND, the error the store gave. Writing without a save port fails with E_NO_FILE. NoProjectSettings stays. docs/architecture.md and GLOSSARY.md are updated.

Breaking change for library callers: Doc.platform() now returns 'c7' | 'c8' | 'none' instead of 'camunda7' | 'camunda8' | undefined. TARGETS is still exported from the package entry. CLI options and output are unchanged.

Checklist

  • npm run typecheck passes
  • npm run gate passes
  • src/report/guide.ts and the matching page in docs/ are updated (only if a command, option or output changed)
  • PR title is a changelog-worthy Conventional-Commit summary

npm run gate passed on the branch head: 2398 tests, iso and bench within their budgets with no budget raised, fuzz with 0 errors. The first commit was also typechecked and tested on its own. The guide item does not apply because no command, option or output changed.

Linked issue

No linked issue.

BREAKING CHANGE: Doc.platform() returns 'c7' | 'c8' | 'none' instead of 'camunda7' | 'camunda8' | undefined. TARGETS is now exported from the platform detection module; the --target spelling is unchanged.
The in-memory API only passes loaded documents and never writes, so the services take their load and save ports as optional instead of a store that was never read or written.
@emaarco
emaarco enabled auto-merge (squash) October 27, 2026 15:22
@emaarco
emaarco disabled auto-merge October 27, 2026 15:22
@emaarco
emaarco merged commit 6ebce59 into main Oct 27, 2026
8 checks passed
@emaarco
emaarco deleted the emaarco/improve-codebase-architecture-review branch October 27, 2026 15:31
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