Skip to content

65 move model implementations into the model package#66

Merged
tomsontom merged 4 commits into
mainfrom
65-move-model-implementations-into-the-model-package
Jun 19, 2026
Merged

65 move model implementations into the model package#66
tomsontom merged 4 commits into
mainfrom
65-move-model-implementations-into-the-model-package

Conversation

@tomsontom

Copy link
Copy Markdown
Member

No description provided.

@tomsontom tomsontom linked an issue Jun 19, 2026 that may be closed by this pull request
@tomsontom

Copy link
Copy Markdown
Member Author

Review

Overview

This PR repackages the generated Java code for both server (Quarkus/Jakarta WS) and client (JDK HTTP client) targets:

  • <root>.service.model<root>.model
  • <root>.impl.model.json<root>.model.impl.json

The actual hand-written change is small and confined to ~17 files in packages/cli/src/java-server/, java-server-jakarta-ws/, and java-rest-client-jdk/ — string-literal package paths in the generator templates. The other ~615 changed files are regenerated sample/test output (Java sources under java-test/, generated TS test fixtures) reflecting the new package names — pure renames with no independent logic changes.

Code quality

  • The renames are consistent across all three generator backends (server, server-jakarta-ws, client-jdk) — every occurrence of service.model and impl.model.json was updated together.
  • Two small incidental improvements rode along with the refactor:
    • java-server/union.ts: generateUnion's artifactConfig parameter was mistyped as JavaClientAPIGeneratorConfig; now correctly typed as JavaServerGeneratorConfig, and the unused import was dropped.
    • java-server-jakarta-ws/builder-factory.ts: a hardcoded _Base.BaseData literal was replaced with the Base variable bound via fqn(...), making the emitted type name robust to import aliasing collisions, consistent with the rest of the file.
  • java-server/builder-factory.ts: correctly switched to pass artifactConfig.rootPackageName instead of the local packageName (which is <root>.service), since the model package is no longer nested under .service.

Verification performed

  • tsc --noEmit on packages/cli — passes.
  • npm run test (vitest) — 11 test files fail, but all failures are ECONNREFUSED to localhost:3000 (tests expect a live sample server) — pre-existing infra dependency, unrelated to this change.
  • Regenerated Java sources compile cleanly: mvn clean compile succeeds for both java-test/java-quarkus (644 source files) and java-test/java-client (182 source files) under the new package layout.

Risks / things to double check

  • The PR body is empty — worth adding a short description linking to issue Move model-implementations into the model-package #65 for posterity.
  • Since this changes the public package layout of generated client/server code, it's a breaking change for any existing consumers of the generator output (import paths shift). Worth confirming this is called out as a breaking change if the generator is versioned/released.

No correctness issues found. The mechanical rename is consistent and verified to compile end-to-end.

@tomsontom tomsontom merged commit 741e329 into main Jun 19, 2026
2 checks passed
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.

Move model-implementations into the model-package

1 participant