Unify typespec-java emitter and emitter-tests into one npm project - #5019
Open
XiaofeiCao wants to merge 11 commits into
Open
Unify typespec-java emitter and emitter-tests into one npm project#5019XiaofeiCao wants to merge 11 commits into
XiaofeiCao wants to merge 11 commits into
Conversation
emitter-tests is no longer a standalone npm project consuming a packed
.tgz; it is now part of the @azure-tools/typespec-java workspace package.
The e2e Maven+tsp assets remain under emitter-tests/, but the harness
scripts (Generate.ps1, Spector-Tests.ps1, SyncTests.ps1) moved to the
package root and run against the workspace build, resolving the locally
built emitter via an explicit --emit <package-root> (like typespec-go).
- package.json: add regenerate/test:java:e2e/spector-* scripts and
spector/http-specs workspace:^ devDeps; drop overrides/.tgz flow
- remove Build-TypeSpec.ps1, emitter-tests/{package.json,Setup.ps1,setup.py}
- CI/ADO: run via pnpm scripts with working-directory packages/typespec-java
- update .gitignore/.prettierignore and developer docs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bdf71a18-d69d-45d1-a513-08b63a71d4e3
…-emitter-tests # Conflicts: # packages/typespec-java/emitter-tests/package.json
The upstream backmerge (Azure#5014) modified emitter-tests/package.json while this branch had deleted it; the take-incoming merge resurrected it. Remove it again to keep the unified single-npm-project layout, and restore the ../node_modules spec-copy paths in Generate.ps1 that the merge reverted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bdf71a18-d69d-45d1-a513-08b63a71d4e3
Unused one-off sparse-checkout helper for an external repo; not referenced by any script, CI, or pom, and not part of the core sync source. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bdf71a18-d69d-45d1-a513-08b63a71d4e3
Contributor
|
All changed packages have been documented.
Show changes
|
commit: |
Contributor
|
You can try these changes here
|
Spector JUnit tests (Multipart/File/Encode/SharedRoute) read
node_modules/@typespec/http-specs/assets/image.{jpg,png} relative to the
Maven working directory (emitter-tests/). After unifying into one npm
project, node_modules moved to the typespec-java package root, so the
assets resolved from emitter-tests/ no longer exist (FileNotFoundException).
FileUtils.java is synced verbatim from core, so carry the Azure-specific
edit (../node_modules) as core.test.patch, applied by SyncTests.ps1 after
each sync (mirroring Copy-Sources.ps1's core.patch). Unlike core.patch, the
patched sources are committed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bdf71a18-d69d-45d1-a513-08b63a71d4e3
…-emitter-tests # Conflicts: # pnpm-lock.yaml
XiaofeiCao
marked this pull request as ready for review
July 23, 2026 09:41
XiaofeiCao
requested review from
alzimmermsft,
bterlson,
haolingdong-msft,
markcowl,
timotheeguerin and
weidongxu-microsoft
as code owners
July 23, 2026 09:41
…-emitter-tests # Conflicts: # packages/typespec-java/Generate.ps1 # packages/typespec-java/emitter-tests/package.json # packages/typespec-java/package.json # pnpm-lock.yaml
timotheeguerin
approved these changes
Jul 27, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5008
What
Unify the
@azure-tools/typespec-javaemitter and its emitter-tests into a single npm project, matching howtypespec-goandtypespec-pythonare structured. Previouslyemitter-tests/was a standalone npm + Maven project, deliberately excluded from the pnpm workspace, that consumed the emitter via a packed.tgzand pinned peer versions with npmoverrides.Why
typespec-javawas the only language emitter whose e2e tests lived in a separate npm project. This required a bespoke pack +npm installflow (Build-TypeSpec.ps1), a secondpackage.json/package-lock.json, anoverridesblock, and a core-driven version sync. Consolidating removes that maintenance overhead and makes Java consistent with the other emitters.How
regenerate,test:java:e2e,spector-*,sync-tests) and the spector/http-specs devDependencies (workspace:^) now live in the rootpackages/typespec-java/package.json. Removedemitter-tests/package.json,package-lock.json, andBuild-TypeSpec.ps1/Setup.ps1/setup.py.emitter-tests/no longer has its ownpackage.json,emit: ["@azure-tools/typespec-java"]inemitter-tests/tspconfig.yamlresolves to the parent package via Node package self-reference (no.tgz, no--emitargument).tsp compile <spec>.tspworks directly.Generate.ps1,Spector-Tests.ps1,SyncTests.ps1); theyPush-Location/Set-Locationintoemitter-tests/for the Maven/tsp work.pnpm run regenerate/pnpm run test:java:e2ewithworking-directory: packages/typespec-java(ci-java.yml,nightly-e2e.yml,spector-coverage.yml)..gitignore/.prettierignoreand developer docs; removed an orphanedtsp-checkout.sh.Behavioral note
The e2e tests now run against the workspace/dev peer versions (via the catalog), like typespec-go/python, instead of the previously pinned released versions.
CONTRIBUTING.mdnow documents the unified workspace build using the repository’s safe Turbo wrapper.Validation
pnpm build(Maven jar + tsc) succeeds.pnpm run regenerategenerates the full local + http-specs/azure-http-specs suites through the self-reference emitter (2800+ Java files).pnpm install --frozen-lockfileis consistent.