Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ You are a highly experienced engineer with expertise in
## Behavior

- Always run `pnpm install` at least once before running other `pnpm` commands.
- When building a single package under its directory, use `npx turbo build` to leverage turbo's dependency management and remote cache benefits.
- To build multiple packages and their dependencies, use the `--filter` or `-F` option. For example: `pnpm turbo build -F @azure/<package_A>... -F @azure/<package_B>...`. The trailing `...` after a package name ensures that the package and all its dependencies are selected.
- When building a single package, run `npx turbo build --token 1` under its directory to leverage turbo's dependency management and remote cache benefits.
- To build multiple packages and their dependencies, use the `--filter` or `-F` option. For example: `pnpm turbo build -F @azure/<package_A>... -F @azure/<package_B>... --token 1`. The trailing `...` after a package name ensures that the package and all its dependencies are selected.
- Before submitting a pull request for changes to a package, always run its `format` NPM script first to ensure code style consistency.
- Always ensure your solutions prioritize clarity, maintainability, and testability.
- Never suggest re-recording tests as a fix to an issue
Expand Down Expand Up @@ -72,7 +72,7 @@ In general, whenever a code refers to `@azure/core-*` packages, we will expect c
- `@azure/core-xml`: `sdk/core/core-xml`
- `@azure-rest/core-client`: `sdk/core/core-client-rest`

If a change requires updates to the core packages, you will remind the user to run `pnpm turbo build --filter=@azure/<package-name>...` commands.
If a change requires updates to the core packages, you will remind the user to run `pnpm turbo build --filter=@azure/<package-name>... --token 1` commands.

### Pre-requisites

Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
## Build, Test, and Development Commands
- `pnpm install` — install workspace deps (Node current LTS, pnpm v10).
- Incremental builds: `pnpm turbo build -F {package name} --token 1` (build changed packages only; enables remote cache read).
- Full build: `pnpm build` — builds all packages via Turborepo (avoid).
- Full build: `pnpm build --token 1` — builds all packages via Turborepo (avoid).
- Tests: `pnpm test`; or `pnpm test:node` / `pnpm test:browser`.
- Lint/format: `pnpm lint`, `pnpm lint:fix`, `pnpm format`, `pnpm check-format`.
- Filter examples: `pnpm test --filter @azure/web-pubsub`, `pnpm turbo build --filter sdk/web-pubsub/web-pubsub...`.
- Filter examples: `pnpm test --filter @azure/web-pubsub`, `pnpm turbo build --filter sdk/web-pubsub/web-pubsub... --token 1`.

## Coding Style & Naming Conventions
- TypeScript; 2-space indent; semicolons; printWidth 100; double quotes (see `.prettierrc.json`).
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Build and Testing Commands
- Install dependencies: `pnpm install`
- Build all packages: `pnpm build`
- Build specific package: `pnpm turbo build --filter=@azure/<package-name>...`
- Build all packages: `pnpm build --token 1`
- Build specific package: `pnpm turbo build --filter=@azure/<package-name>... --token 1`
- Lint: `pnpm lint` (never turn off linting rules)
- Format code: `pnpm format`
- Run tests: `pnpm test`
Expand Down
36 changes: 18 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ If you prefer to setup your own environment instead, make sure you have these pr
To build all packages:

4. Install and link all dependencies (`pnpm install`)
5. Build the code base (`pnpm build`)
5. Build the code base (`pnpm build --token 1`), with remote build cache enabled.

You rarely need to build all packages though, as it takes over one hour to finish. Instead, you can build selected packages impacted by your changes. To build specific package(s), use the `--filter=@azure/package-name...` command-line option:

6. Install and link all dependencies (`pnpm install`)
7. Build the package, for example, `pnpm turbo build --filter=@azure/service-bus...`. Alternatively when under the package directory, `npx turbo build`
7. Build the package, for example, `pnpm turbo build --filter=@azure/service-bus... --token 1`. Alternatively when under the package directory, `npx turbo build --token 1`

## Development Workflows

Expand Down Expand Up @@ -117,9 +117,9 @@ On the other hand, if you know your library does not work with the existing vers

### Building using pnpm

Run `pnpm build` from repo root directory to build any projects that have been modified since the last build.
Run `pnpm build --token 1` from repo root directory to build any projects that have been modified since the last build.

Run `pnpm turbo build --filter=<packagename>...` to build a single project, and all local projects that it depends on. You can pass `--filter` multiple times to build multiple projects. Keep in mind that pnpm refers to packages by their full names, so packages will be named something like `@azure/<servicename>`. To ensure that it builds all of its dependencies, you must use the `...` suffix. For example, to build the `@azure/communication-chat` package, you would run `pnpm turbo build --filter=@azure/communication-chat...`. Alternatively, you can run `npx turbo build` to build current package's dependencies then the package itself.
Run `pnpm turbo build --filter=<packagename>... --token 1` to build a single project, and all local projects that it depends on. You can pass `--filter` multiple times to build multiple projects. Keep in mind that pnpm refers to packages by their full names, so packages will be named something like `@azure/<servicename>`. To ensure that it builds all of its dependencies, you must use the `...` suffix. For example, to build the `@azure/communication-chat` package, you would run `pnpm turbo build --filter=@azure/communication-chat... --token 1`. Alternatively, you can run `npx turbo build --token 1` to build current package's dependencies then the package itself.

### Testing

Expand Down Expand Up @@ -192,20 +192,20 @@ If you're having problems and want to restore your repo to a clean state without

Generally speaking, the following commands are roughly equivalent:

| NPM command | pnpm command | Where to run | pnpm command effect |
|--------------------------------------|-----------------------------------------------|-------------------|------------------------------------------------------------------|
| `npm install` | `pnpm install` | Anywhere in repo | Install dependencies for all projects in the pnpm workspace |
| `npm install --save[-dev] <package>` | `pnpm add -p <package> [-D]` | Package directory | Add or update a dependency in the current project |
| `npm build` | `pnpm build` | Repo root | Build all projects in the pnpm workspace |
| | `pnpm turbo build --filter=<package>...` | Anywhere in repo | Build named project and any projects it depends on |
| | `pnpm turbo build` | Package directory | Build the current project |
| `npm test` | `pnpm test` | Repo root | Run dev tests in all projects in the pnpm workspace |
| | `pnpm test --filter=<packagename>...` | Repo root | Run dev tests in named project and any projects it depends on |
| | `pnpm test` | Package directory | Run dev tests in the current project only |
| `npm run <scriptname>` | `pnpm <scriptname>` | Repo root | Run named script in all projects in the pnpm workspace |
| | `pnpm <scriptname> --filter=<packagename>...` | Repo root | Run named script in named project and any projects it depends on |
| | `pnpm <scriptname>` | Package directory | Run named script in the current project only |
| `npx <command>` | `npx <command>` | Anywhere | Run named command provided by installed dependency package |
| NPM command | pnpm command | Where to run | pnpm command effect |
|--------------------------------------|----------------------------------------------------|-------------------|------------------------------------------------------------------|
| `npm install` | `pnpm install` | Anywhere in repo | Install dependencies for all projects in the pnpm workspace |
| `npm install --save[-dev] <package>` | `pnpm add -p <package> [-D]` | Package directory | Add or update a dependency in the current project |
| `npm build` | `pnpm build --token 1` | Repo root | Build all projects in the pnpm workspace |
| | `pnpm turbo build --filter=<package>... --token 1` | Anywhere in repo | Build named project and any projects it depends on |
| | `pnpm turbo build --token 1` | Package directory | Build the current project |
| `npm test` | `pnpm test` | Repo root | Run dev tests in all projects in the pnpm workspace |
| | `pnpm test --filter=<packagename>...` | Repo root | Run dev tests in named project and any projects it depends on |
| | `pnpm test` | Package directory | Run dev tests in the current project only |
| `npm run <scriptname>` | `pnpm <scriptname>` | Repo root | Run named script in all projects in the pnpm workspace |
| | `pnpm <scriptname> --filter=<packagename>...` | Repo root | Run named script in named project and any projects it depends on |
| | `pnpm <scriptname>` | Package directory | Run named script in the current project only |
| `npx <command>` | `npx <command>` | Anywhere | Run named command provided by installed dependency package |

Similarly other monorepo commands (`clean`, `test`, `test:node`, `format`, `lint`, etc.) also work with selections via `--filter` or `-F` option. It is supported to pass `--filter` or `-F` option multiple times.

Expand Down
4 changes: 2 additions & 2 deletions documentation/Quickstart-on-how-to-write-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ After writing your test cases you need to run your test cases and record the tes

## Run tests in record mode

Before running tests, it's advised to update the dependencies and build our project by running the command `pnpm install && pnpm build --filter=<package-name>...`. Please notice this command is time-consuming and it will take around 10 mins, you could refer [here](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md#resolving-dependency-version-conflicts) for more details.
Before running tests, it's advised to update the dependencies and build our project by running the command `pnpm install && pnpm build --filter=<package-name>... --token 1`. Please notice this command is time-consuming and it will take around 10 mins, you could refer [here](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md#resolving-dependency-version-conflicts) for more details.

```Shell
> pnpm install
> pnpm build --filter=@azure-rest/purview-datamap...
> pnpm build --filter=@azure-rest/purview-datamap... --token 1
```

Then, we could go to the project folder to run the tests. By default, if you don't specify `TEST_MODE`, it will run previously recorded tests.
Expand Down
12 changes: 6 additions & 6 deletions documentation/RLC-Swagger-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ We are working on to automatically generate everything right now, but currently,

```shell
pnpm update
pnpm build --filter=<your-package-name>...
pnpm build --filter=<your-package-name>... --token 1
cd <your-sdk-folder>
pnpm pack
```
Expand Down Expand Up @@ -155,14 +155,14 @@ See the [JavaScript Codegen Quick Start for Test](https://github.com/Azure/azure
On Linux, you could use `export` to set env variable:

```shell
pnpm build --filter=${PACKAGE_NAME}...
pnpm build --filter=${PACKAGE_NAME}... --token 1
export TEST_MODE=record && pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```

On Windows, you could use `SET`:

```shell
pnpm build --filter=${PACKAGE_NAME}...
pnpm build --filter=${PACKAGE_NAME}... --token 1
SET TEST_MODE=record&& pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```

Expand All @@ -171,14 +171,14 @@ See the [JavaScript Codegen Quick Start for Test](https://github.com/Azure/azure
On Linux, you could use below commands:

```shell
pnpm build --filter=${PACKAGE_NAME}...
pnpm build --filter=${PACKAGE_NAME}... --token 1
export TEST_MODE=playback && pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```

On Windows, you can use:

```shell
pnpm build --filter=${PACKAGE_NAME}...
pnpm build --filter=${PACKAGE_NAME}... --token 1
SET TEST_MODE=playback&& pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```

Expand Down Expand Up @@ -266,7 +266,7 @@ Now, we can use the exact same steps to build an releasable artifact.

```shell
pnpm install
pnpm build --filter=<your-package-name>...
pnpm build --filter=<your-package-name>... --token 1
cd <your-sdk-folder>
export TEST_MODE=record && pnpm test
pnpm pack
Expand Down
12 changes: 6 additions & 6 deletions documentation/steps-after-generations.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ After this finishes, you will see the generated code in `src` folder in your **{

```shell
pnpm install
pnpm build --filter=<your-package-name>...
pnpm build --filter=<your-package-name>... --token 1
```

# Customizing the generated code
Expand Down Expand Up @@ -60,14 +60,14 @@ See the [Javascript Codegen Quick Start for Test](https://github.com/Azure/azure
On Linux, you could use `export` to set env variable:

```shell
pnpm build --filter=${PACKAGE_NAME}...
pnpm build --filter=${PACKAGE_NAME}... --token 1
export TEST_MODE=record && pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```

On Windows, you could use `SET`:

```shell
pnpm build --filter=${PACKAGE_NAME}
pnpm build --filter=${PACKAGE_NAME}... --token 1
SET TEST_MODE=record&& pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```

Expand All @@ -76,13 +76,13 @@ See the [Javascript Codegen Quick Start for Test](https://github.com/Azure/azure
On Linux, you could use below commands:

```shell
pnpm build --filter=${PACKAGE_NAME}
pnpm build --filter=${PACKAGE_NAME}... --token 1
export TEST_MODE=playback && pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```
On Windows, you can use:

```shell
pnpm build --filter=${PACKAGE_NAME}
pnpm build --filter=${PACKAGE_NAME}... --token 1
SET TEST_MODE=playback&& pnpm test # this will run live test and generate a recordings folder, you will need to submit it in the PR.
```

Expand Down Expand Up @@ -156,7 +156,7 @@ Now, we can use the exact same steps to build a releasable artifact.

```shell
pnpm update
pnpm build --filter=<your-package-name>...
pnpm build --filter=<your-package-name>... --token 1
cd <your-sdk-folder>
export TEST_MODE=record && pnpm test
pnpm pack
Expand Down