### Packages impacted by this PR
- @azure/template-dpg
### Issues associated with this PR
- https://github.com/Azure/azure-sdk-for-js/issues/31338
### Describe the problem that is addressed by this PR
Upgrades @azure/template-dpg to ESM/vitest
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
---------
Co-authored-by: Jeremy Meng <jeremy.ymeng@gmail.com>
* change our verifyChangelogs over to utilizing the artifact details. if we don't have an artifact details at all, don't verify changelog. if we do, but skipverifychangelog is present, don't verify changelog. if we have artifact details, but no disable, verify the changelog
---------
Co-authored-by: Scott Beddall <scbedd@microsoft.com>
- apply lint:fix results
- revert fixes that are not related to consistent-type-imports and cases error
- regenerate .api.md files
- format
- update core-comparison diff
also remove dependency on `@microsoft/api-extractor` as we already move to
`dev-tool run extract-api` which calls api-extractor Api instead.
***NO_CI***
### Packages impacted by this PR
- @azure/template
### Issues associated with this PR
- #31296
### Describe the problem that is addressed by this PR
Adds a better timeout and retry logic for the issues with the best being
flaky.
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
### Packages impacted by this PR
- @azure/template
### Issues associated with this PR
### Describe the problem that is addressed by this PR
Adds `supportsTracing` back to the template project.
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
---------
Co-authored-by: Timo van Veenendaal <timov@microsoft.com>
### Packages impacted by this PR
- `@azure/template`
### Describe the problem that is addressed by this PR
Grants the "App Configuration Data Owner" when deploying the template
live test resources. This fixes some issues recording tests for the
template package (and possibly the live tests too).
Copied from the App Config test-resources.bicep
[here](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appconfiguration/test-resources.bicep)
One of the template tests has been flaky on Mac OS. Given that template
is run as part of core and likely most PRs we decided to pend the test
for now and investigate it as part of #31296
### Packages impacted by this PR
@azure/dev-tool
### Issues associated with this PR
Resolves#29672
### Describe the problem that is addressed by this PR
With the move to ESM and tshy we've been running into issues using the
existing TS_NODE
based loader in dev-tool. Specifically we're seeing errors such as:
```
[run-samples] Error: Must use import to load ES Module: D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts
require() of ES modules is not supported.
require() of D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts from D:\a_work\1\s\common\tools\dev-tool\src\commands\samples\run.ts is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from D:\a_work\1\s\sdk\template\template\package.json.
```
ts-node is being phased out for tsx, a modern alternative that handles
hybrid scenarios like us in much simpler manner.
This PR switches our loader from ts-node to tsx. Now we can run samples
again for both cjs and esm!
### Packages impacted by this PR
- @azure/dev-tool
### Issues associated with this PR
### Describe the problem that is addressed by this PR
This PR implements a new dev-tool command: `dev-tool run
update-snippets`.
This command looks for code fences in markdown files and JSDoc comments,
and updates them with the contents of test methods in a file named
`snippets.spec.ts`.
For example, the following fence indicates that the contents of a test
named "new_configurationclient" should be used:
````
```js snippet:new_configurationclient
```
````
After running `dev-tool run update-snippets`, the contents of the
snippet will be populated:
````
```js snippet:new_configurationclient
import { ConfigurationClient } from "@azure/template";
import { DefaultAzureCredential } from "@azure/identity";
const client = new ConfigurationClient(
"<app configuration endpoint>",
new DefaultAzureCredential()
);
```
````
To accomplish this, the command uses the TypeScript compiler API to
extract and transpile snippets from `snippets.spec.ts`. Snippets are the
contents of calls to the `it` function. If syntax with the shape
`it(<literal string>, <function with block>)` appears in
`snippets.spec.ts`, it will be considered a snippet that is valid for
injection.
("Function with block" means either a `function () { ... }` expression
or an arrow function with a block on the arrow side (`() => { ... }`).
An arrow function that has an expression on the right hand side (`() =>
(...)`) will not be recognized.)
For example:
```ts
it("new_configurationclient", function () {
// @ts-ignore
const client = new ConfigurationClient(
process.env.ENDPOINT ?? "<app configuration endpoint>",
new DefaultAzureCredential()
);
});
```
The transpiler automatically "cleans" and validates the snippet using
similar techniques as the sample transpiler. As a result, it enforces
the same syntactic rules that the sample transpiler does. In addition to
those, it removes references to `process.env` (if an alternative is
specified), removes compiler pragmas like `// @ts-ignore`, and
automatically inserts imports for symbols that the snippet uses. So in
the above snippet, imports for `ConfigurationClient` and
`DefaultAzureCredential` are required, automatically detected, and
injected into the resulting snippet.
Snippets without `snippet:${name}` tags are _errors_ when using this
command, so a package must be fully migrated to use it.
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
### Provide a list of related PRs _(if any)_
- #24536
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
***NO_CI***
- replace version to "~5.6.2"
- rush update
- add `"skipLibCheck": true` for several packages that are affected by https://github.com/vitest-dev/vitest/issues/4688
- [formrecognizer] help TypeScript to understand with more explicit type
- [schema-registry-{avro,json}] skip lib check due to lru-cache issue with the Iterator TReturn change
https://github.com/isaacs/node-lru-cache/issues/348
- [eslint-plugin] github-source-headers rule should use "MIT License".
This change updates our linter rule and the whole repository to have consistent
license header.
***NO_CI***
- remove "All rights reserved." from header
- "MIT license" => "MIT License"
***NO_CI***
- add one flat config file for perf tests
- update NPM scripts of these packages to use that flat config for perf tests
As eslint v8 still not switched to flat config by default, this change
temporarily uses `cross-env` to set `ESLINT_USE_FLAT_CONFIG=true`
Once we moved to eslint v9 the env var can be removed.
Previously dev-tool has been fixed to generate correct include path in samples
tsconfig.json but samples were not updated.
This PR fixes the samples tsconfig.json in one run; otherwise with the recent
branch protection policy changes, when individual packages re-publish samples,
js-core team would have to approve the tsconfig.json changes.
***NO_CI***
which only extends from tsconfig.json. There might be more customization for
packages in the early days but not any more.
This PR removes it and updates packages to extends tsconfig.json directly
***NO_CI***
Run `rush build` on the repo to ensure the newly added `source` fields
are generated.
This avoids unnecessary noise on PRs that may build tshy packages as
part of their dependency graph (such as #29374)
## What's happening?
- [x] Get Scott's test-proxy version from #29471
- [x] Update `recorder 3.5.0` with
- [x] Central Sanitizers
- [x] /removeSanitizers API
- [x] remove fallback sanitizers
- [x] Publish `recorder 3.5.0`
- [x] Update `recorder 4.x` with the `recorder 3.5.0` changes and make
sure they are in sync.
- [x] Update lock file with `rush update --full` to get latest recorder
and test-credential packages
- [x] Test/fix packages
- [x] recorder
- [x] storage
- [x] template
- [x] '@azure-rest/synapse-access-control'
- [x] '@azure/arm-resources'
- [x] arm-links
- [x] arm-resources
- [x] event-grid
- [x] template-dpg
- [x] synpase packages
- [ ] '@azure/identity' (future PR)
- [x] '@azure/arm-eventgrid'
- [x] '@azure/ai-text-analytics'
## Future Work
- [ ] Figure out identity tests/recordings
- [ ] Make sure CI pipelines for each of the services that are not
triggered in this PR get to green by either re-recording or tweaking the
recorder config for the package
---------
Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
Build cache was enabled for most of our commonly built packages in PR
https://github.com/Azure/azure-sdk-for-js/pull/27409.
This PR enables build cache for several more packages that get built in
core -
ci pipelines to further reduce time on packages when they haven't
changed.
As far as I know for NodeJS the majority of our packages don't need
`build:test` as we either runs test on .ts files, or `build` script
already generates the .js files under `dist-esm`. Currently we only need
to build the test for browser testing.
This PR moves commands in `build:test` into the browser test scripts for
core packages, thus saving us from rebuilding when testing for NodeJS.
### Packages impacted by this PR
- @azure/template
### Issues associated with this PR
- #29538
### Describe the problem that is addressed by this PR
Adding `loupe` directly to `template` and removing from `test-recorder`.
### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
### Are there test cases added in this PR? _(If not, why?)_
### Provide a list of related PRs _(if any)_
### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
We already centralize prettier version in dev-tool and use `dev-tool run
vendored prettier` command to format. Looks that some packages brought
the dev dependency back during merge. This PR corrects those and also
includes the result of `rush format` on the repo.