Updated the following:
client (release group)
Dependencies on build-tools updated:
@fluid-tools/build-cli: 0.44.0
@fluidframework/build-tools: 0.44.0
@fluidframework/bundle-size-tools: 0.44.0
@fluid-tools/version-tools: 0.44.0
I also made two small changes to the root Biome config and the
test-snapshots Biome config. The configs exposed a case where `git
ls-files` will return a path to a directory - if that directory is a
submodule. These config changes enable the Biome task caching to work
even with this ls-files oddity by ensuring the directory path doesn't
make it into the cached file list.
When the Biome fluid-build task was added it didn't support reading
Biome config files. Thadded the capability to read Biome config
files, including following `extends` values and merging the resulting
include/ignore settings across the files/formatter/linter settings. The
BiomeTask now uses this capability to enumerate the files to consider
when caching. While we don't use Biome for linting today, I tried to
make the code as general-purpose as possible so we could easily adapt
the task for linting in the future.
I added some test data and test cases. They're not exhaustive but they
cover the critical stuff and exercise the recursive loading.
[AB#9090](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/9090)
## Description
Adds the paths where benchmark tests generate reports to the list of
things ignored by biome when formatting or checking for formatting. Ran
into a build error in an environment where I had one of these output
files from a previous run of benchmark tests.
Changes:
1. Remove production dependency in
@fluid-example/bubblebench-shared-tree
2. Update versions to ~1.8.3 (and set config to want ~)
3. Handle deprecations
a. Replace "javascript.formatter.trailingComma" with "...trailingCommas"
b. Replace cli argument `--apply` with `--write`
4. Apply formatting updates
5. Add Biome to npm-package-json-script-dep
6. Remove unused `--formatter-enabled=true` from commands
7. Add missing biome devDeps in build-tools
Under 1.7.3 VS Code extensions users could experience server connection failures and need 1.8 version to get support from Biome. See [biomejs/biome-vscode#261](https://github.com/biomejs/biome-vscode/issues/261)
Tags asserts for the RC5 release.
Command used:
```shell
pnpm policy-check:asserts
```
Also updated the biome config to properly exclude the generated file,
and updated scripts to call `format` instead of `pretty-quick`.
Makes the following biome-related config changes:
- Removes the `biome.lspBin` workspace setting. The value does not work
on Windows, and the setting cannot vary per platform. Without the
setting the extension seems to find biome on all platforms.
- Updates the ignore settings in biome to better handle things like
common packages, which were previously ignored when using Format on
Save. I also picked up additional patterns from the prettier ignore
file, including ignores for test collateral that is breaking some
builds.
- Treat tsdoc files as JSONC-without-trailing-commas.
## Summary
The client release group is updated to use biome for formatting instead
of prettier.
## Changes
1. The `format` script in each package now calls biome instead of
prettier.
2. The root `format` task runs a single biome command from the root
instead of running format in every package.
3. The vscode root workspace settings have been updated to set the biome
extension as the default formatter.
4. The root biome config is now in JSONC instead of JSON.
5. Paths outside the client and build-tools release groups are ignored
in the biome config because they're not using biome (yet).
## Known issues
- Despite best efforts, formatting back and forth between biome and
prettier is not 100% fidelity. Some changes that biome makes prettier
does not revert, though it also doesn't start failing or anything. You
can see examples by running `pnpm format && pnpm format:prettier` from
the root and looking and the remaining changes.
- Reformatting does sometimes cause lint disable statements to get
misplaced and they have to be manually fixed up.
## Summary
Adds several scripts that can be run to convert projects in the client
release group to use the biome formatter. The process can be effectively
reversed by running another script, so projects can switch between
prettier and biome using the scripts and the build will continue to
work.
After enabling biome formatting, you can manually format using biome
with the `format:biome`script.
Once projects are completely on biome and we no longer need to port
changes between prettier branches and biome branches, then we can remove
prettier completely using the remove-prettier script. We should only do
that once the last release branch using prettier is no longer in
service.
## Scripts
### add-biome.sh
This script adds biome formatting scripts to a project. It also adds a
local biome config file to the project if needed.
The `format:prettier` and `check:prettier` tasks are left intact, and
the `format` task still calls prettier. This
enables one to manually format using biome while leaving the overall
build using prettier.
After running this script, you can clean up the package.json files by
running `pnpm policy-check:fix`.
**This PR includes the changes made by running this script across the
client release group.**
### enable-biome.sh
This script enables biome formatting in a project. It updates the
`format` and `check:format` scripts to call biome. It
should only be run on projects that have already had biome added to it.
### enable-prettier.sh
This script enables prettier formatting in a project. It updates the
`format` and `check:format` scripts to call
prettier. It's the opposite of the enable-biome.sh script.
### remove-prettier.sh
Once a project is completely switched to biome and no longer needs
prettier, this script will remove the prettier
dependency and any related scripts and config files.