Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4b89f7b
initial commit to migrate autorest.java to typespec-azure
srnagar May 27, 2026
541efbe
Update typespec-java change version and packages
srnagar Jun 6, 2026
0c783f9
merge from main
srnagar Jun 6, 2026
0df8b51
add label
srnagar Jun 6, 2026
e6dbff7
update pnpm-lock.yaml
srnagar Jun 6, 2026
50eef7f
linting errors
srnagar Jun 7, 2026
909038a
fix catalog dependencies
srnagar Jun 7, 2026
623cda6
update lock file
srnagar Jun 7, 2026
518231b
cspell fix
srnagar Jun 7, 2026
3df4d87
version consistency
srnagar Jun 8, 2026
1f7faac
catalog version
srnagar Jun 8, 2026
a0c91f6
build core java gen
srnagar Jun 8, 2026
910a108
no transfer progress logs
srnagar Jun 8, 2026
cce328e
skip spotless
srnagar Jun 8, 2026
47ab7d3
Merge remote-tracking branch 'upstream/main' into typespec-java
srnagar Jun 9, 2026
06fd3a3
fix linting
srnagar Jun 9, 2026
966c20a
update tsconfig
srnagar Jun 9, 2026
b0f632f
ignore typespec-java package from eslint
srnagar Jun 9, 2026
6421dd5
cleanup
srnagar Jun 9, 2026
46818d5
remove redundant package.json
srnagar Jun 9, 2026
80b46bb
remove old tests
srnagar Jun 9, 2026
772f07c
Merge branch 'main' into typespec-java
srnagar Jun 9, 2026
b1165df
update build
srnagar Jun 9, 2026
f821baa
update build command
srnagar Jun 9, 2026
327863b
ignore build artifacts
srnagar Jun 10, 2026
cb97a4c
merge from main
srnagar Jun 28, 2026
93873cc
fix lock file
srnagar Jun 28, 2026
0f44c37
fix linting
srnagar Jun 29, 2026
36adeb1
Merge remote-tracking branch 'upstream/main' into typespec-java
srnagar Jun 30, 2026
fdb8f65
address comments
srnagar Jun 30, 2026
a0d05ad
include ts files
srnagar Jun 30, 2026
82454ec
update copy target
srnagar Jun 30, 2026
1d92a9b
fix build
srnagar Jun 30, 2026
717054d
remove eng
srnagar Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .chronus/changes/typespec-java-2026-4-27-21-56-46.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: internal
packages:
- "@azure-tools/typespec-java"
---

[Java] Move `@azure-tools/typespec-java` to typespec-azure repo
8 changes: 8 additions & 0 deletions .github/policies/issues.triage.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ configuration:
label: emitter:python
- hasLabel:
label: emitter:typescript
- hasLabel:
label: emitter:java
- hasLabel:
label: emitter:client:all
- hasLabel:
Expand Down Expand Up @@ -65,6 +67,8 @@ configuration:
label: emitter:python
- labelAdded:
label: emitter:typescript
- labelAdded:
label: emitter:java
- labelAdded:
label: emitter:client:all
- labelAdded:
Expand Down Expand Up @@ -100,6 +104,8 @@ configuration:
label: emitter:python
- labelRemoved:
label: emitter:typescript
- labelRemoved:
label: emitter:java
- labelRemoved:
label: emitter:client:all
- labelRemoved:
Expand All @@ -126,6 +132,8 @@ configuration:
label: emitter:python
- hasLabel:
label: emitter:typescript
- hasLabel:
label: emitter:java
- hasLabel:
label: emitter:client:all
- hasLabel:
Expand Down
7 changes: 7 additions & 0 deletions .github/policies/prs.triage.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ configuration:
then:
- addLabel:
label: emitter:typescript
- if:
- includesModifiedFiles:
files:
- packages/typespec-java/**/*
then:
- addLabel:
label: emitter:java
- if:
- includesModifiedFiles:
files:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "typespec-java / CI"

on:
pull_request:
branches:
- main
- release/*
paths:
- "packages/typespec-java/**"
- ".github/workflows/ci-java.yml"
merge_group:

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/setup
- name: Install dependencies
run: pnpm install
- name: Build typespec-java package
run: pnpm turbo run --filter "@azure-tools/typespec-java..." build
lint:
name: Lint
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/setup
- name: Install dependencies
run: pnpm install
- name: Run linters
working-directory: packages/typespec-java
run: pnpm lint
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,10 @@ packages/samples/test/output/azure/templates-contoso/setup.*
# python emitter
packages/typespec-python/tests/generated/**
packages/typespec-python/alpha

# java emitter
packages/typespec-java/src/typespec-extension/generator/**
packages/typespec-java/src/typespec-extension/test
packages/typespec-java/src/typespec-extension/src/*
packages/typespec-java/src/typespec-extension/generator/**
!packages/typespec-java/src/typespec-extension/options.ts
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ Area of the codebase
| `emitter:autorest` | #957300 | Issues for @azure-tools/typespec-autorest emitter |
| `emitter:python` | #957300 | Issues for @azure-tools/typespec-python emitter |
| `emitter:typescript` | #957300 | Issues for @azure-tools/typespec-ts emitter |
| `emitter:java` | #0096c7 | Issues for @azure-tools/typespec-java emitter |
| `emitter:client:all` | #957300 | General client emitter issues that do not involve TCGC or typespec-azure-http-specs |
| `eng` | #65bfff | |
| `ide` | #846da1 | Issues for Azure specific ide features |
Expand Down
94 changes: 92 additions & 2 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,76 +31,166 @@ enableFiletypes:
- tsp
- typespec
words:
- AADDS
- adtest
- alexa
- allof
- apim
- appinsightsappid
- apos
- armcontoso
- armId
- Arqs
- azcore
Comment thread
srnagar marked this conversation as resolved.
Resolved
- azkeys
- azsdk
- azsecrets
- Bazs
- Bcff
- BNOT
- byos
- byval
- centralus
- centraluseuap
- chartjs
- Chenjie
- clazz
- clsx
- Cmek
- commitish
- contosobenchmark
- contosowidgetmanager
- Chenjie
- DALMATION
- dcont
- deduplicator
- devcenter
- Dhttp
- discriminatorenum
- Dlocal
- Dmaven
- DMSS
- Donezo
- DskipTests
- Dspotless
- Dtrim
- dynatrace
- Easm
- endpointlro
- ESRPRELPACMANTEST
- espt
- euap
- exampleapptenantid
- exampleid
- farchived
- fhir
- foos
- français
- Globa
- groupme
- GZRS
- healthdataaiservices
- horiz
- Howtos
- incentivizes
- infile
- ipconfigurations
- kvset
- kwargs
- liftr
- LINUXNEXTVMIMAGE
- LINUXOS
- LINUXVMIMAGE
- llcinitial
- llcresi
- llcupdate
- LNOT
- locationyaml
- logz
- LRO
- lropaging
- lroparameterizedendpoints
- Lucene
- luisappid
- MACVMIMAGE
- mgmt
- mkdirp
- mobo
- msaappid
- msaapptenantid
- msazure
- msdata
- mycert
- mycompany
- mylocation
- mysignalrservice
- ndash
- noflatten
- nonstringenum
- northcentralus
- notypedheadersmethods
- nsps
- nupkg
- odata
- okhttp
- olcmtest
- olcmtestcontainer
- Onco
- oncophenotype
- Pageble
- PAYG
- petstoreopgrp
- popd
- println
- prismjs
- propery
- psscriptanalyzer
- Ptest
- pushd
- pypi
- pystac
- pytest
- qnas
- RAGRS
- RAGZRS
- regionality
- responseasbool
- reinjected
- Reranker
- requiredfieldsascotrargstransformation
- requirexmsflattened
- responseasbool
- rpaasoneboxacr
- rpass
- Rscc
- Rscd
- Rsce
- Rscl
- Rsct
- sampleclientid
- scont
- Serv
- SERVICERP
- seti
- signalr
- Skus
- southcentralus
- stac
- strconv
- streamstyleserializationctorargs
- subid
- subscriptionidapiversion
- supportsnetworkacls
- tcgc
- testcmk
- tofile
- tsmv
- uknorth
- uksouth
- ukwest
- userrp
- vnet
- westcentralus
- WINDOWSVMIMAGE
- Xcognitive
- azcore
- azkeys
- azsecrets
Expand Down
5 changes: 5 additions & 0 deletions eng/config/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const AreaLabels = defineLabels({
color: "957300",
description: "Issues for @azure-tools/typespec-ts emitter",
},
"emitter:java": {
color: "0096c7",
description: "Issues for @azure-tools/typespec-java emitter",
},
"emitter:client:all": {
color: "957300",
description:
Expand Down Expand Up @@ -68,6 +72,7 @@ export const AreaPaths: Record<keyof typeof AreaLabels, string[]> = {
"emitter:autorest": ["packages/typespec-autorest/"],
"emitter:python": ["packages/typespec-python/"],
"emitter:typescript": ["packages/typespec-ts/"],
"emitter:java": ["packages/typespec-java/"],
"lib:tcgc": ["packages/typespec-client-generator-core/"],
"lib:azure-http-specs": ["packages/azure-http-specs/"],
ide: [],
Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig(
"**/website/build/**/*",
"**/.astro/**/*",
"core/**/*", // The TypeSpec core submodule has its own ESLint config - don't lint it from here to avoid OOM
"packages/typespec-java/**/*", // Has its own ESLint config
"**/venv/**/*", // Ignore python virtual env
"**/.vscode-test-web/**/*", // Ignore VSCode test web project
// TODO: enable
Expand Down
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[tools]
python = "3.12"
uv = "latest"
java = "microsoft-11"
maven = "3.9.16"
61 changes: 61 additions & 0 deletions packages/typespec-java/src/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Development

The emitter is the [TypeSpec](https://typespec.io/) library for emitting Java client from the TypeSpec REST protocol binding.

See [Emitter](https://typespec.io/docs/extending-typespec/emitters-basics/) for the basics on the TypeSpec emitter library.

See [Developer Guide for TypeSpec Emitter](docs/developer/typespec/readme.md) for basics on this repository.

Guideline:

- Most of the development work should happen in "core/packages/http-client-java" folder.
- Before starting the development in "core" folder, always checkout latest code from main branch, and create a dev branch upon it.
- When checking in code in "core" folder, do not check-in the files in "core.patch".
- When preparing the PR, create 2 PRs, one for the code changes in submodule ("typespec" repository, if there is change), one for the code changes in this repository (which would include the update on "core" submodule).

## TypeScript Part for the Emitter

TypeScript code for the Emitter is in "core/packages/http-client-java/emitter" folder. Follow the package.json for the build and unit test.

The code there, in runtime, produces a "code-model.yaml" file, and passes it to Java Part to generate Java client.

## Java Part for the Emitter

Java code for the Emitter is in "core/packages/http-client-java/generator/http-client-generator" (which depends on "http-client-generator-core" and "http-client-generator-mgmt" module). Follow the pom.xml for the build and unit test.

The code there, in runtime, consumes the "code-model.yaml" file produced by the TypeSpec Part, and generate the Java client.

# Update and Release

## Update Node.js Package for Latest Dependencies

Instructions:

- Always use absolute path when change directory.

Steps:

1. In "core" folder, run `git pull upstream main` to fetch latest commit from upstream or origin.
2. Go back to project root. Commit the change in "core" folder.
3. Run `ncu -u` on "package.json" in both "package.json" from "typespec-extension" and "typespec-tests" folder.
4. Update package versions in `peerDependencies` (keep the semver range) in "package.json" from "typespec-extension" folder, according to the corresponding package versions in `devDependencies`.
5. Update version of "@azure-tools/openai-typespec" lib in "package.json" from "typespec-extension" folder, set it to the same semantic version used in https://raw.githubusercontent.com/Azure/azure-rest-api-specs/refs/heads/main/package.json
6. Update package versions in `override` (keep the semver range) in "package.json" from "typespec-tests" folder, according to the corresponding package versions in "package.json" from "typespec-extension" folder.
7. Save the files, and run `npm install` in "typespec-extension" folder, so that "package-lock.json" would be updated.
8. Run `npm audit fix` in "typespec-extension" folder.
9. Commit the changes in "typespec-extension" and "typespec-tests" folders.
10. Run `pwsh SyncTests.ps1` in "typespec-tests" folder.
11. Commit the changes in "typespec-tests" folder, include new files.

## Prepare for Minor/Patch Release

Steps:

1. Bump minor/patch version of `@typespec/typespec-java` in both "package.json" from "typespec-extension" and "typespec-tests" folder.
2. Save the file, and run `npm install` in "typespec-extension" folder, so that "package-lock.json" would be updated.
3. Add a new item in release history in "typespec-extension/changelog.md". The version would be the minor/patch version. The date would be today.

The [publish to NPM pipeline](https://dev.azure.com/azure-sdk/internal/_build?definitionId=5618) needs to be triggered, after the PR is merged.

After release, the [sync SDK pipeline](https://dev.azure.com/azure-sdk/internal/_build?definitionId=6270) needs to be triggered, to sync the released typespec-java into the SDK repository.
This pipeline also regenerates all SDK based on TypeSpec.
Loading
Loading