AgentSkillsCN

validate-dev-build

**工作流技能**——在开发环境中构建发射器,并完成端到端测试的验证。适用场景:“验证开发构建”。

SKILL.md
--- frontmatter
name: validate-dev-build
description: '**WORKFLOW SKILL** - Build the emitter with dev dependencies, and validate end-to-end tests. USE FOR: "validate dev build".'

Skill Instructions

Request

The request would come in the form of:

  • "Validate dev build for <test-case>"

Steps

Update Node.js dependencies to dev

Read "typespec-extension/package.json", if it does not depend on a dev version of @typespec/compiler (e.g. X-dev.Y), run following command on repository root:

code
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

code
tsp compile --config . [location-of-test-case]

to generate Java code.