From 359e337791c7b1ee6447283a727da7015c5092e6 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Tue, 3 Feb 2026 22:43:43 +0100 Subject: [PATCH] Drop Biome.js for oxfmt and oxlint --- .github/PULL_REQUEST_TEMPLATE.md | 3 +- .github/workflows/close-pull-request.yml | 30 ++++++++-------- .symfony.bundle.yaml | 6 ++-- CHANGELOG.md | 44 +++++++++++++----------- README.md | 8 ++--- assets/README.md | 11 +++--- assets/dist/translator_controller.d.ts | 11 +++--- assets/package.json | 4 +-- assets/src/types.d.ts | 11 +++--- 9 files changed, 66 insertions(+), 62 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index df3b474..887284e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,4 @@ -Please do not submit any Pull Requests here. They will be closed. ---- +## Please do not submit any Pull Requests here. They will be closed. Please submit your PR here instead: https://github.com/symfony/ux diff --git a/.github/workflows/close-pull-request.yml b/.github/workflows/close-pull-request.yml index 57e4e3f..8150a6a 100644 --- a/.github/workflows/close-pull-request.yml +++ b/.github/workflows/close-pull-request.yml @@ -1,20 +1,20 @@ name: Close Pull Request on: - pull_request_target: - types: [opened] + pull_request_target: + types: [opened] jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thanks for your Pull Request! We love contributions. - - However, you should instead open your PR on the main repository: - https://github.com/symfony/ux - - This repository is what we call a "subtree split": a read-only subset of that main repository. - We're looking forward to your PR there! + run: + runs-on: ubuntu-latest + steps: + - uses: superbrothers/close-pull-request@v3 + with: + comment: | + Thanks for your Pull Request! We love contributions. + + However, you should instead open your PR on the main repository: + https://github.com/symfony/ux + + This repository is what we call a "subtree split": a read-only subset of that main repository. + We're looking forward to your PR there! diff --git a/.symfony.bundle.yaml b/.symfony.bundle.yaml index 6d9a74a..5662042 100644 --- a/.symfony.bundle.yaml +++ b/.symfony.bundle.yaml @@ -1,3 +1,3 @@ -branches: ["2.x"] -maintained_branches: ["2.x"] -doc_dir: "doc" +branches: ['2.x'] +maintained_branches: ['2.x'] +doc_dir: 'doc' diff --git a/CHANGELOG.md b/CHANGELOG.md index ab0daed..927d622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 2.32 -- **[BC BREAK]** Refactor API to use string-based translation keys instead of generated constants. +- **[BC BREAK]** Refactor API to use string-based translation keys instead of generated constants. Translation keys are now simple strings instead of TypeScript constants. The main advantages are: @@ -13,6 +13,7 @@ - And you can still get autocompletion and type-safety :rocket: **Before:** + ```typescript import { trans } from '@symfony/ux-translator'; import { SYMFONY_GREAT } from '@app/translations'; @@ -21,6 +22,7 @@ ``` **After:** + ```typescript import { createTranslator } from '@symfony/ux-translator'; import { messages } from '../var/translations/index.js'; @@ -38,6 +40,7 @@ for further reducing bundle size. **For AssetMapper users:** You can remove the following entries from your `importmap.php`: + ```php '@app/translations' => [ 'path' => './var/translations/index.js', @@ -49,56 +52,57 @@ **Note:** This is a breaking change, but the UX Translator component is still experimental. -- **[BC BREAK]** Refactor `TranslationsDumper` to accept configuration options via `dump()` method parameters, instead of constructor arguments or method calls: - - Removed `$dumpDir` and `$dumpTypeScript` constructor arguments - - Removed `TranslationsDumper::addIncludedDomain()` and `TranslationsDumper::addExcludedDomain()` methods +- **[BC BREAK]** Refactor `TranslationsDumper` to accept configuration options via `dump()` method parameters, + instead of constructor arguments or method calls: + - Removed `$dumpDir` and `$dumpTypeScript` constructor arguments + - Removed `TranslationsDumper::addIncludedDomain()` and `TranslationsDumper::addExcludedDomain()` methods **Note:** This is a breaking change, but the UX Translator component is still experimental. -- Add configuration `ux_translator.dump_typescript` to enable/disable TypeScript types dumping, - default to `true`. Generating TypeScript types is useful when developing, - but not in production when using the AssetMapper (which does not use these types). +- Add configuration `ux_translator.dump_typescript` to enable/disable TypeScript types dumping, + default to `true`. Generating TypeScript types is useful when developing, + but not in production when using the AssetMapper (which does not use these types). -- Add `keys_patterns` configuration option to filter dumped translations by key patterns (e.g., `app.*`, `!*.internal`) +- Add `keys_patterns` configuration option to filter dumped translations by key patterns (e.g., `app.*`, `!*.internal`) ## 2.30 -- Ensure compatibility with PHP 8.5 +- Ensure compatibility with PHP 8.5 ## 2.29.0 -- Add Symfony 8 support +- Add Symfony 8 support ## 2.22.0 -- Support both the Symfony format (`fr_FR`) and W3C specification (`fr-FR`) for locale subcodes. +- Support both the Symfony format (`fr_FR`) and W3C specification (`fr-FR`) for locale subcodes. ## 2.20.0 -- Add `throwWhenNotFound` function to configure the behavior when a translation is not found. +- Add `throwWhenNotFound` function to configure the behavior when a translation is not found. ## 2.19.0 -- Add configuration to filter dumped translations by domain. +- Add configuration to filter dumped translations by domain. ## 2.16.0 -- Increase version range of `intl-messageformat` to `^10.5.11`, in order to see - a faster implementation of ICU messages parsing. #1443 +- Increase version range of `intl-messageformat` to `^10.5.11`, in order to see + a faster implementation of ICU messages parsing. #1443 ## 2.13.2 -- Revert "Change JavaScript package to `type: module`" +- Revert "Change JavaScript package to `type: module`" ## 2.13.0 -- Add Symfony 7 support. -- Change JavaScript package to `type: module` +- Add Symfony 7 support. +- Change JavaScript package to `type: module` ## 2.9.0 -- Add support for symfony/asset-mapper +- Add support for symfony/asset-mapper ## 2.8.0 -- Component added +- Component added diff --git a/README.md b/README.md index efa99f5..cb4bb06 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ https://github.com/symfony/ux to create issues or submit pull requests. ## Resources -- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/assets/README.md b/assets/README.md index f8c9ed2..c166757 100644 --- a/assets/README.md +++ b/assets/README.md @@ -6,9 +6,10 @@ JavaScript assets of the [symfony/ux-translator](https://packagist.org/packages/ This npm package is **reserved for advanced users** who want to decouple their JavaScript dependencies from their PHP dependencies (e.g., when building Docker images, running JavaScript-only pipelines, etc.). -We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. +We **strongly recommend not installing this package directly**, but instead install the PHP package [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) in your Symfony application with [Flex](https://github.com/symfony/flex) enabled. If you still want to install this package directly, please make sure its version exactly matches [symfony/ux-translator](https://packagist.org/packages/symfony/ux-translator) PHP package version: + ```shell composer require symfony/ux-translator:2.23.0 npm add @symfony/ux-translator@2.23.0 @@ -18,7 +19,7 @@ npm add @symfony/ux-translator@2.23.0 ## Resources -- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) -- [Report issues](https://github.com/symfony/ux/issues) and - [send Pull Requests](https://github.com/symfony/ux/pulls) - in the [main Symfony UX repository](https://github.com/symfony/ux) +- [Documentation](https://symfony.com/bundles/ux-translator/current/index.html) +- [Report issues](https://github.com/symfony/ux/issues) and + [send Pull Requests](https://github.com/symfony/ux/pulls) + in the [main Symfony UX repository](https://github.com/symfony/ux) diff --git a/assets/dist/translator_controller.d.ts b/assets/dist/translator_controller.d.ts index c98285d..13679cc 100644 --- a/assets/dist/translator_controller.d.ts +++ b/assets/dist/translator_controller.d.ts @@ -9,11 +9,12 @@ type ParametersType = Record | NoParametersType; type RemoveIntlIcuSuffix = T extends `${infer U}+intl-icu` ? U : T; type DomainsOf = M extends Message ? keyof Translations : never; type LocaleOf = M extends Message ? Locale : never; -type ParametersOf = M extends Message - ? Translations[D] extends { parameters: infer Parameters } - ? Parameters - : never - : never; +type ParametersOf = + M extends Message + ? Translations[D] extends { parameters: infer Parameters } + ? Parameters + : never + : never; interface Message { translations: { diff --git a/assets/package.json b/assets/package.json index 1d4c012..5135af5 100644 --- a/assets/package.json +++ b/assets/package.json @@ -20,9 +20,7 @@ "test": "pnpm run test:unit && pnpm run test:browser", "test:unit": "../../../bin/unit_test_package.sh .", "test:browser": "playwright test", - "test:browser:ui": "playwright test --ui", - "check": "biome check", - "ci": "biome ci" + "test:browser:ui": "playwright test --ui" }, "symfony": { "importmap": { diff --git a/assets/src/types.d.ts b/assets/src/types.d.ts index 51d6577..2d4d260 100644 --- a/assets/src/types.d.ts +++ b/assets/src/types.d.ts @@ -9,11 +9,12 @@ export type ParametersType = Record | NoParamete export type RemoveIntlIcuSuffix = T extends `${infer U}+intl-icu` ? U : T; export type DomainsOf = M extends Message ? keyof Translations : never; export type LocaleOf = M extends Message ? Locale : never; -export type ParametersOf = M extends Message - ? Translations[D] extends { parameters: infer Parameters } - ? Parameters - : never - : never; +export type ParametersOf = + M extends Message + ? Translations[D] extends { parameters: infer Parameters } + ? Parameters + : never + : never; export interface Message { translations: {