-
Notifications
You must be signed in to change notification settings - Fork 85
use AGENTS.md for agent to work on the emitter, add SKILL for "validate-dev-build" #3218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
weidongxu-microsoft
merged 11 commits into
Azure:main
from
weidongxu-microsoft:try-agents.md
Feb 5, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
35d0a63
prompt: migrate copilot-instructions.md to AGENTS.md
weidongxu-microsoft 9e4b167
remove copilot-instructions
weidongxu-microsoft 680b677
some instruction for dev
weidongxu-microsoft c53ec96
more doc
weidongxu-microsoft 61f9c70
Merge branch 'main' into try-agents.md
weidongxu-microsoft ed4e10f
Merge branch 'main' into try-agents.md
weidongxu-microsoft 361d666
spelling
weidongxu-microsoft 74c9a72
add skill to build from dev
weidongxu-microsoft 76f3125
add skill to use dev typespec dependencies
weidongxu-microsoft 0321cd9
spellcheck
weidongxu-microsoft ed255ff
remove the e2e part in AGENTS
weidongxu-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| name: validate-dev-build | ||
| description: Build the emitter with dev dependencies, and validate end-to-end tests | ||
| argument-hint: [test-case] | ||
| --- | ||
|
|
||
| ## Update Node.js dependencies to dev | ||
|
|
||
| Read "typespec-extension/package.json", if it does not depends on a dev version of `@typespec/compiler` (e.g. `X-dev.Y`), run following command on repository root: | ||
| ``` | ||
| npx -y @azure-tools/typespec-bump-deps typespec-extension/package.json typespec-tests/package.json --add-npm-overrides | ||
| ``` | ||
|
|
||
| Under "typespec-extension" folder, run `npm install --force` to install the dev dependencies. | ||
|
|
||
| ## Prepare end-to-end test environment | ||
|
|
||
| Under "typespec-tests" folder, run `Setup.ps1`. | ||
|
|
||
| ## Generate end-to-end test code | ||
|
|
||
| Under "typespec-tests" folder. | ||
|
|
||
| `[test-case]` usually in the form of an URL, e.g. "https://github.com/Azure/typespec-azure/tree/main/packages/azure-http-specs/specs/azure/client-generator-core/override" | ||
|
|
||
| Map this URL to the location of the test case in "node_modules". | ||
| E.g. above would map to "node_modules/@azure-tools/azure-http-specs/specs/azure/client-generator-core/override/client.tsp" | ||
|
|
||
| URL "https://github.com/microsoft/typespec/tree/main/packages/http-specs/specs/encode/array" would map to "node_modules/@typespec/http-specs/specs/encode/array/main.tsp" | ||
|
|
||
| - Use "client.tsp" when available. Otherwise, use "main.tsp". | ||
| - Escape the `@`, if it is necessary to do so in terminal. | ||
|
|
||
| Run | ||
| ``` | ||
| tsp compile --config . [location-of-test-case] | ||
| ``` | ||
| to generate Java code. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # 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 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. | ||
| 6. Save the files, and run `npm install` in "typespec-extension" folder, so that "package-lock.json" would be updated. | ||
| 7. Commit the changes in "typespec-extension" and "typespec-tests" folders. | ||
| 8. Run `pwsh SyncTests.ps1` in "typespec-tests" folder. | ||
| 9. 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. |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized we have
RebuildJar=falseby default.. We may consider removing this parameter and let it rebuild jar(mvn package) every time..Another look, it doesn't seem to be used any more..
autorest.java/typespec-tests/Setup.ps1
Line 3 in 132e859
We should be good.