diff --git a/.github/workflows/main-suite.yml b/.github/workflows/main-suite.yml index 9dc281853..a244c85d1 100644 --- a/.github/workflows/main-suite.yml +++ b/.github/workflows/main-suite.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node: ["16", "18", "19", "20"] + node: ["20", "22"] os: [ubuntu-latest, windows-latest] steps: diff --git a/.prettierignore b/.prettierignore index 96d87a6b2..9afd6010b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,3 +11,4 @@ coverage/ website/ .github examples +/.nx/workspace-data diff --git a/CHANGELOG.md b/CHANGELOG.md index 6177e7d0f..57466502e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.0.0](https://github.com/lingui/js-lingui/compare/v4.14.1...v5.0.0) (2024-11-28) + +We are pleased to announce the release of Lingui 5.0! This release is a **major milestone** for the project and includes a number of new features, improvements and bug fixes. + +Check out the links below for more details: + +- [Blog Post: Announcing Lingui 5.0](https://lingui.dev/blog/2024/11/28/announcing-lingui-5.0) +- [Migration Guide from 4.x to 5.x](https://lingui.dev/releases/migration-5) +- [Full Changelog](https://github.com/lingui/js-lingui/compare/v4.14.1...v5.0.0) + ## [4.14.1](https://github.com/lingui/js-lingui/compare/v4.14.0...v4.14.1) (2024-11-28) ### Bug Fixes diff --git a/README.md b/README.md index 0f1f3a9b5..e21003f20 100644 --- a/README.md +++ b/README.md @@ -12,78 +12,56 @@ [![Join the community on Discord][Badge-Discord]][Discord] [**Documentation**][Documentation] · [**Quickstart**](#quickstart) · [**Example**](#example) · [**Support**](#support) · [**Contribute**](#contribute) · [**License**](#license) + > Internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language. > > --- [ W3C Web Internationalization FAQ](https://www.w3.org/International/questions/qa-i18n) +Lingui is an easy yet powerful internationalization (i18n) framework for global projects. -Lingui is an easy yet powerful internationalization framework for global projects. - -- **Clean and readable** - Keep your code clean and readable, while the library uses - battle-tested and powerful **ICU MessageFormat** under the hood. +- **Clean and readable** - Keep your code clean and readable, while the library uses battle-tested and powerful **ICU MessageFormat** under the hood. -- **Universal** - Use it everywhere. `@lingui/core` provides the essential intl - functionality which works in any JavaScript project while `@lingui/react` offers - components to leverage React rendering. +- **Universal** - Use it everywhere. `@lingui/core` provides the essential intl functionality which works in any JavaScript project while `@lingui/react` offers components to leverage React rendering, including React Server Components (RSC) support. -- **Full rich-text support** - Use React components inside localized messages - without any limitation. Writing rich-text messages is as easy as writing JSX. +- **Full rich-text support** - Use React components inside localized messages without any limitation. Writing rich-text messages is as easy as writing JSX. -- **Powerful tooling** - Manage the whole intl workflow using Lingui [CLI][RefCLI]. It - extracts messages from source code, validates messages coming from translators and - checks that all messages are translated before shipping to production. +- **Powerful tooling** - Manage your intl workflow with the Lingui [CLI](https://lingui.dev/ref/cli), [Vite Plugin](https://lingui.dev/ref/vite-plugin), and [ESLint Plugin](https://lingui.dev/ref/eslint-plugin). The CLI extracts, compiles and validates messages, while the Vite plugin compiles catalogs on the fly, and the ESLint plugin helps catch common usage errors. -- **Unopinionated** - Integrate Lingui into your existing workflow. It supports - message keys as well as auto-generated messages. Translations are stored either in - JSON or standard PO files, which are supported in almost all translation tools. +- **Unopinionated** - Integrate Lingui into your existing workflow. It supports message keys as well as auto-generated messages. Translations are stored either in JSON or standard PO files, which are supported in almost all translation tools. -- **Lightweight and optimized** - Core library is only [1.5 kB gzipped][BundleCore], - React components are an additional [1.3 kBs gzipped][BundleReact]. That's less than Redux - for a full-featured intl library. +- **Lightweight and optimized** - Core library is less than [3 kB gzipped](https://bundlephobia.com/result?p=@lingui/core), React components are additional [1.4 kB gzipped](https://bundlephobia.com/result?p=@lingui/react). -- **Active community** - Join us on [Discord][Discord] to discuss the latest development. - At the moment, Lingui is the most active intl project on GitHub. +- **Active community** - Join the growing [community of developers](https://lingui.dev/community) who are using Lingui to build global products. -- **Compatible with react-intl** - Low-level React API is very similar to react-intl - and the message format is the same. It's easy to migrate an existing project. +- **Compatible with react-intl** - Low-level React API is very similar to react-intl and the message format is the same. It's easy to migrate an existing project. ## Quickstart -### Install - -- [React projects][TutorialSetupReact] -- [Vite project][SetupVite] +1. [Introduction](https://lingui.dev/introduction) +2. [Installation and Setup](https://lingui.dev/installation) ### Tutorials -- [React][TutorialReact] -- [React Native][TutorialReactNative] -- [Plain JavaScript][TutorialJavaScript] -- [Working with Command Line Tool][CLI] - -### Plugins - -- [SWC Plugin][SWCPlugin] -- [Vite Plugin][VitePlugin] -- [ESLint Plugin](ESLintPlugin) - -If you're a react-intl user, check out [a comparison of react-intl and Lingui](https://lingui.dev/misc/react-intl). +- [React](https://lingui.dev/tutorials/react) +- [React Server Components](https://lingui.dev/tutorials/react-rsc) +- [React Native](https://lingui.dev/tutorials/react-native) +- [JavaScript](https://lingui.dev/tutorials/javascript) ## Example Short example how i18n looks with JSX: ```js -import { Trans } from "@lingui/macro" +import { Trans } from "@lingui/react/macro" function App() { return ( - - Read the documentation - for more info. - + + Read the documentation + for more info. + ) } ``` @@ -95,14 +73,14 @@ msgid "msg.docs" msgstr "Read the <0>documentation for more info." ``` -For more example see the [Examples][Examples] directory. +For more example see the [Examples](https://github.com/lingui/js-lingui/tree/main/examples) directory. ## Support If you are having issues, please let us know. -- Join us on [Discord](https://discord.gg/gFWwAYnMtA) to chat with the community. -- Ask questions on [StackOverflow](https://stackoverflow.com/questions/ask?tags=linguijs) and mark it with [Lingui](https://stackoverflow.com/questions/tagged/linguijs) tag. +- Join us on [Discord][Discord] to chat with the community. +- Ask questions on [StackOverflow](https://stackoverflow.com/questions/ask?tags=linguijs) and mark it with the [`linguijs`](https://stackoverflow.com/questions/tagged/linguijs) tag. - If something doesn't work as documented, documentation is missing or if you just want to suggest a new feature, [create an issue][Issues]. - You can also [Ask Lingui JS Guru](https://gurubase.io/g/lingui-js), it is a Lingui JS focused AI to answer your questions. @@ -124,31 +102,16 @@ This project exists thanks to [all the people][Contributors] who contribute. [[C The project is licensed under the [MIT][License] license. [Documentation]: https://lingui.dev -[TutorialReact]: https://lingui.dev/tutorials/react -[TutorialReactNative]: https://lingui.dev/tutorials/react-native -[TutorialJavaScript]: https://lingui.dev/tutorials/javascript -[CLI]: https://lingui.dev/ref/cli -[TutorialSetupReact]: https://lingui.dev/tutorials/setup-react -[SetupVite]: https://lingui.dev/tutorials/setup-vite -[RefCLI]: https://lingui.dev/ref/cli [Examples]: https://github.com/lingui/js-lingui/tree/main/examples - -[SWCPlugin]: https://lingui.dev/ref/swc-plugin -[VitePlugin]: https://lingui.dev/ref/vite-plugin -[ESLintPlugin]: https://lingui.dev/ref/eslint-plugin - [Badge-MainSuite-GithubCI]: https://github.com/lingui/js-lingui/workflows/main-suite/badge.svg [Badge-ReleaseWorkflowTesting-GithubCI]: https://github.com/lingui/js-lingui/workflows/release-workflow-test/badge.svg [Badge-Coverage]: https://img.shields.io/codecov/c/github/lingui/js-lingui/main.svg [Badge-PRWelcome]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square [Badge-Discord]: https://img.shields.io/discord/974702239358783608.svg?label=Discord&logo=Discord&colorB=7289da&style=flat-square [Contributors]: https://github.com/lingui/js-lingui/graphs/contributors - [Coverage]: https://codecov.io/gh/lingui/js-lingui [License]: https://github.com/lingui/js-lingui/blob/main/LICENSE [Contributing]: https://github.com/lingui/js-lingui/blob/main/CONTRIBUTING.md [Issues]: https://github.com/lingui/js-lingui/issues/new/choose [PRWelcome]: http://makeapullrequest.com -[BundleReact]: https://bundlephobia.com/result?p=@lingui/react -[BundleCore]: https://bundlephobia.com/result?p=@lingui/core [Discord]: https://discord.gg/gFWwAYnMtA diff --git a/examples/create-react-app/package.json b/examples/create-react-app/package.json index 88b406479..15e5eef41 100644 --- a/examples/create-react-app/package.json +++ b/examples/create-react-app/package.json @@ -32,9 +32,8 @@ ] }, "devDependencies": { - "@lingui/cli": "^4.1.2", - "@lingui/loader": "^4.1.2", - "@lingui/macro": "^4.1.2", + "@lingui/cli": "^4.11.2", + "@lingui/loader": "^4.11.2", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", diff --git a/examples/create-react-app/src/App.test.tsx b/examples/create-react-app/src/App.test.tsx index 0a95c196c..8ad75e60a 100644 --- a/examples/create-react-app/src/App.test.tsx +++ b/examples/create-react-app/src/App.test.tsx @@ -2,15 +2,14 @@ import React from "react" import { getByText, render, act } from "@testing-library/react" import { i18n } from "@lingui/core" import { I18nProvider } from "@lingui/react" - import App from "./App" i18n.load({ en: { - ZXBDaP: "Language switcher example:", + "zg/nOF": "Language switcher example: ", }, cs: { - ZXBDaP: "Příklad přepínače jazyků:", + "zg/nOF": "Příklad přepínače jazyků: ", }, }) diff --git a/examples/create-react-app/src/App.tsx b/examples/create-react-app/src/App.tsx index 509c746d1..e25b3875c 100644 --- a/examples/create-react-app/src/App.tsx +++ b/examples/create-react-app/src/App.tsx @@ -1,6 +1,6 @@ import "./App.css" import React, { useState } from "react" -import { Trans, Plural } from "@lingui/macro" +import { Trans, Plural } from "@lingui/react/macro" import { locales, dynamicActivate } from "./i18n" import { useLingui } from "@lingui/react" diff --git a/examples/create-react-app/src/locales/cs.po b/examples/create-react-app/src/locales/cs.po index 6acf82b08..2c0a1d096 100644 --- a/examples/create-react-app/src/locales/cs.po +++ b/examples/create-react-app/src/locales/cs.po @@ -11,38 +11,38 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#: src/App.tsx:31 +#: src/App.tsx:43 msgid "{count, plural, zero {There are no books} one {There's one book} other {There are # books}}" msgstr "{count, plural, zero {Nejsou žádné knihy} one {Je tu jedna kniha} other {Existuje # knih}}" -#: src/App.tsx:37 +#: src/App.tsx:50 msgid "Date formatter example:" msgstr "Příklad formátovače data:" -#: src/App.tsx:28 +#: src/App.tsx:40 msgid "Decrement" msgstr "Úbytek" -#: src/App.tsx:45 +#: src/App.tsx:59 msgid "I have a balance of {0}" msgstr "Mám zůstatek {0}" -#: src/App.tsx:25 +#: src/App.tsx:37 msgid "Increment" msgstr "Přírůstek" -#: src/App.tsx:14 -msgid "Language switcher example:" -msgstr "Příklad přepínače jazyků:" +#: src/App.tsx:19 +msgid "Language switcher example: " +msgstr "Příklad přepínače jazyků: " -#: src/App.tsx:43 +#: src/App.tsx:56 msgid "Number formatter example:" msgstr "Příklad formátovače čísel:" -#: src/App.tsx:22 -msgid "Plurals example:" -msgstr "Příklad množného čísla:" +#: src/App.tsx:33 +msgid "Plurals example: " +msgstr "Příklad množného čísla: " -#: src/App.tsx:39 +#: src/App.tsx:53 msgid "Today is {0}" msgstr "Dnes je {0}" diff --git a/examples/create-react-app/src/locales/en.po b/examples/create-react-app/src/locales/en.po index 542c5392f..7cd5d0540 100644 --- a/examples/create-react-app/src/locales/en.po +++ b/examples/create-react-app/src/locales/en.po @@ -13,38 +13,38 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" -#: src/App.tsx:31 +#: src/App.tsx:43 msgid "{count, plural, zero {There are no books} one {There's one book} other {There are # books}}" msgstr "{count, plural, zero {There are no books} one {There's one book} other {There are # books}}" -#: src/App.tsx:37 +#: src/App.tsx:50 msgid "Date formatter example:" msgstr "Date formatter example:" -#: src/App.tsx:28 +#: src/App.tsx:40 msgid "Decrement" msgstr "Decrement" -#: src/App.tsx:45 +#: src/App.tsx:59 msgid "I have a balance of {0}" msgstr "I have a balance of {0}" -#: src/App.tsx:25 +#: src/App.tsx:37 msgid "Increment" msgstr "Increment" -#: src/App.tsx:14 -msgid "Language switcher example:" -msgstr "Language switcher example:" +#: src/App.tsx:19 +msgid "Language switcher example: " +msgstr "Language switcher example: " -#: src/App.tsx:43 +#: src/App.tsx:56 msgid "Number formatter example:" msgstr "Number formatter example:" -#: src/App.tsx:22 -msgid "Plurals example:" -msgstr "Plurals example:" +#: src/App.tsx:33 +msgid "Plurals example: " +msgstr "Plurals example: " -#: src/App.tsx:39 +#: src/App.tsx:53 msgid "Today is {0}" msgstr "Today is {0}" diff --git a/examples/create-react-app/yarn.lock b/examples/create-react-app/yarn.lock index 19105dbcb..d0f3a1177 100644 --- a/examples/create-react-app/yarn.lock +++ b/examples/create-react-app/yarn.lock @@ -2670,34 +2670,34 @@ __metadata: languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.1.2" - checksum: 61cae1343e55073ae4cd7bbaf3e77362e71799af4be4e6cfc759e4d33eef6bca0f6a312bb43654ebc0abf8717e2c77c2b421420c47dfa2f0c3cc0f96dcf67015 +"@lingui/babel-plugin-extract-messages@npm:4.11.2": + version: 4.11.2 + resolution: "@lingui/babel-plugin-extract-messages@npm:4.11.2" + checksum: 7b3be3815cf1a5d717b4d777ef7238f0aa69d6145aaf60311f31ba7fe4da1359d7ad1d46a35203031a2a7a72e61e340872ca73cb071ebd9d7ade39728efdb2bd languageName: node linkType: hard -"@lingui/cli@npm:4.1.2, @lingui/cli@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/cli@npm:4.1.2" +"@lingui/cli@npm:4.11.2, @lingui/cli@npm:^4.11.2": + version: 4.11.2 + resolution: "@lingui/cli@npm:4.11.2" dependencies: "@babel/core": ^7.21.0 "@babel/generator": ^7.21.1 "@babel/parser": ^7.21.2 "@babel/runtime": ^7.21.0 "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.1.2 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/format-po": 4.1.2 - "@lingui/message-utils": 4.1.2 + "@lingui/babel-plugin-extract-messages": 4.11.2 + "@lingui/conf": 4.11.2 + "@lingui/core": 4.11.2 + "@lingui/format-po": 4.11.2 + "@lingui/message-utils": 4.11.2 babel-plugin-macros: ^3.0.1 chalk: ^4.1.0 chokidar: 3.5.1 cli-table: 0.3.6 commander: ^10.0.0 convert-source-map: ^2.0.0 - date-fns: ^2.16.1 + date-fns: ^3.6.0 esbuild: ^0.17.10 glob: ^7.1.4 inquirer: ^7.3.3 @@ -2712,13 +2712,13 @@ __metadata: source-map: ^0.8.0-beta.0 bin: lingui: dist/lingui.js - checksum: 3dd985af16702f2e6fc91c6e263fbfe93cbbdcaea01e54dd5a710a583fa40a48b070f4efdd872eb6518b960d431910b9e8a07cea2000a44e634285e953fdd7c6 + checksum: 99a90f86646df3438a64be2087b3865a31284a5805b2e8d49823de892090966386d04569dd8dda701bbaecd9bc82a072ffc053afbbdd4153a3d797f5efb11436 languageName: node linkType: hard -"@lingui/conf@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/conf@npm:4.1.2" +"@lingui/conf@npm:4.11.2": + version: 4.11.2 + resolution: "@lingui/conf@npm:4.11.2" dependencies: "@babel/runtime": ^7.20.13 chalk: ^4.1.0 @@ -2726,7 +2726,7 @@ __metadata: jest-validate: ^29.4.3 jiti: ^1.17.1 lodash.get: ^4.4.2 - checksum: 2fbeeaf0c2e7b895c3128b7e5e7e72a43d21bfd2b8f5bff6d0ec46ee8ae22d1c9af54540d7d070a21639b652ff1b9482b33504db79787801d0db693763508fe0 + checksum: 16cd06773a6a97dc99fdd7742ec02392defa058e07a0892ce2b9425a9a30720eef87acfa740b6e41bf9c345d21489f311d6e1f060e745d53f00738d151e89862 languageName: node linkType: hard @@ -2740,44 +2740,39 @@ __metadata: languageName: node linkType: hard -"@lingui/format-po@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/format-po@npm:4.1.2" +"@lingui/core@npm:4.11.2": + version: 4.11.2 + resolution: "@lingui/core@npm:4.11.2" dependencies: - "@lingui/conf": 4.1.2 - "@lingui/message-utils": 4.1.2 - date-fns: ^2.29.3 - pofile: ^1.1.4 - checksum: 205afaea64d59c70d876610d4480195c20a5649bc64a7618b69ba6adf702886de723517b0526129e0fccca01a4d2185c02746d7d77fc47cfc4e01cc65ee540ad + "@babel/runtime": ^7.20.13 + "@lingui/message-utils": 4.11.2 + unraw: ^3.0.0 + checksum: 10e77a8486dd8ae9ab3a687276a626d568f6b65b57a3071f9ee18c31989133a0a429eec28c0254e48a36fa77ff775f9b6dfa945df6767f2fc91782c10582d3ca languageName: node linkType: hard -"@lingui/loader@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/loader@npm:4.1.2" +"@lingui/format-po@npm:4.11.2": + version: 4.11.2 + resolution: "@lingui/format-po@npm:4.11.2" dependencies: - "@babel/runtime": ^7.20.13 - "@lingui/cli": 4.1.2 - "@lingui/conf": 4.1.2 - peerDependencies: - webpack: ^5.0.0 - checksum: 7c2d00a0de024a4f5dab3651c3d7e15b03e92e5b91c1070cbc8975f3c9c2dcb5647f460ec7b88e151e73714229549a1ac87e842ebf40e1924b5c0dace3a89767 + "@lingui/conf": 4.11.2 + "@lingui/message-utils": 4.11.2 + date-fns: ^3.6.0 + pofile: ^1.1.4 + checksum: 89af5d48bac0170d0b8658c170ae0342b27519fd623b41abad41139a3105079360a4e937607b96f531ae1394f7a3d55b4186f50e7935c2bdc2539bdaad3ae58a languageName: node linkType: hard -"@lingui/macro@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/macro@npm:4.1.2" +"@lingui/loader@npm:^4.11.2": + version: 4.11.2 + resolution: "@lingui/loader@npm:4.11.2" dependencies: "@babel/runtime": ^7.20.13 - "@babel/types": ^7.20.7 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/message-utils": 4.1.2 + "@lingui/cli": 4.11.2 + "@lingui/conf": 4.11.2 peerDependencies: - "@lingui/react": ^4.0.0 - babel-plugin-macros: 2 || 3 - checksum: bfe69b093a0724f54fc5bccee42787c0ef8f98479524226d5a34c4d5129878138e74be429e423da99633e02da6aa82026ad39dfe01ea8334bab4a39fdf282a89 + webpack: ^5.0.0 + checksum: 0f38f7277d5e1db89f7753f8ff94c20028c03e3f93db9445e483b04bd44f55890b84e0cf2ed810deefa9940233c47f9896afccd80c529ffba105f2df24950ef8 languageName: node linkType: hard @@ -2790,6 +2785,16 @@ __metadata: languageName: node linkType: hard +"@lingui/message-utils@npm:4.11.2": + version: 4.11.2 + resolution: "@lingui/message-utils@npm:4.11.2" + dependencies: + "@messageformat/parser": ^5.0.0 + js-sha256: ^0.10.1 + checksum: 126469e50fa189d9aebdf8785249ff91a9e725b241a141bdfe95727fd8c27d8f3ff792625c3e59cf2e73b8862d08d9babb93e3338891250999c020f0967bfac6 + languageName: node + linkType: hard + "@lingui/react@npm:^4.1.2": version: 4.1.2 resolution: "@lingui/react@npm:4.1.2" @@ -5571,10 +5576,9 @@ __metadata: version: 0.0.0-use.local resolution: "create-react-ts-app@workspace:." dependencies: - "@lingui/cli": ^4.1.2 + "@lingui/cli": ^4.11.2 "@lingui/core": ^4.1.2 - "@lingui/loader": ^4.1.2 - "@lingui/macro": ^4.1.2 + "@lingui/loader": ^4.11.2 "@lingui/react": ^4.1.2 "@testing-library/jest-dom": ^5.16.5 "@testing-library/react": ^14.0.0 @@ -5913,17 +5917,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.16.1": - version: 2.16.1 - resolution: "date-fns@npm:2.16.1" - checksum: f19c2b3b9bd62fdbc55b160c87b4656b3a260d79ee7a32a9cbc19107c3d61d71b569c0957351f9a07fc84c35283f74b0af5276620d4a37e36eef1898fa6c25b2 - languageName: node - linkType: hard - -"date-fns@npm:^2.29.3": - version: 2.29.3 - resolution: "date-fns@npm:2.29.3" - checksum: e01cf5b62af04e05dfff921bb9c9933310ed0e1ae9a81eb8653452e64dc841acf7f6e01e1a5ae5644d0337e9a7f936175fd2cb6819dc122fdd9c5e86c56be484 +"date-fns@npm:^3.6.0": + version: 3.6.0 + resolution: "date-fns@npm:3.6.0" + checksum: 0daa1e9a436cf99f9f2ae9232b55e11f3dd46132bee10987164f3eebd29f245b2e066d7d7db40782627411ecf18551d8f4c9fcdf2226e48bb66545407d448ab7 languageName: node linkType: hard @@ -9587,6 +9584,13 @@ __metadata: languageName: node linkType: hard +"js-sha256@npm:^0.10.1": + version: 0.10.1 + resolution: "js-sha256@npm:0.10.1" + checksum: 6eb5c9f95aa902cec1930f036deb3bc664024b75fede456c0ac74b855797776c18620f47efec36787077a56ba2f3b8d6aacc7733ff8a2b5bb9ce6b655a35c5e6 + languageName: node + linkType: hard + "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -14515,6 +14519,13 @@ __metadata: languageName: node linkType: hard +"unraw@npm:^3.0.0": + version: 3.0.0 + resolution: "unraw@npm:3.0.0" + checksum: 19eee0bc500ce197d262b79723a2c8c81c1d716baaa2a62c48a4d0d6b9e1fd9d350c5df86262e51343d591ab9c8a47ed150317d0b867b2b65795cdc17ef69873 + languageName: node + linkType: hard + "upath@npm:^1.2.0": version: 1.2.0 resolution: "upath@npm:1.2.0" diff --git a/examples/js/babel.config.js b/examples/js/babel.config.js index 47b5e59ea..821be2745 100644 --- a/examples/js/babel.config.js +++ b/examples/js/babel.config.js @@ -1,4 +1,4 @@ module.exports = { presets: ["@babel/env"], - plugins: ["macros"], + plugins: ["@lingui/babel-plugin-lingui-macro"], } diff --git a/examples/js/package.json b/examples/js/package.json index 6d67ccc6b..5448af32f 100644 --- a/examples/js/package.json +++ b/examples/js/package.json @@ -12,14 +12,13 @@ "extract": "lingui extract --clean" }, "dependencies": { - "@lingui/core": "^4.1.2", - "@lingui/macro": "^4.1.2" + "@lingui/core": "^5.0.0-next.3" }, "devDependencies": { "@babel/core": "^7.20.12", "@babel/preset-env": "^7.20.2", - "@lingui/cli": "^4.1.2", - "babel-plugin-macros": "^3.1.0", + "@lingui/babel-plugin-lingui-macro": "^5.0.0-next.3", + "@lingui/cli": "^5.0.0-next.3", "jest": "^29.5.0" } } diff --git a/examples/js/src/ids.js b/examples/js/src/ids.js index 42bb3159c..a5fd14cbb 100644 --- a/examples/js/src/ids.js +++ b/examples/js/src/ids.js @@ -1,5 +1,5 @@ import { i18n } from "@lingui/core" -import { t, plural, defineMessage } from "@lingui/macro" +import { t, plural, defineMessage } from "@lingui/core/macro" i18n.load({ en: require("./locale/en/messages").messages, diff --git a/examples/js/src/messages.js b/examples/js/src/messages.js index 378e17b13..3ec0210a6 100644 --- a/examples/js/src/messages.js +++ b/examples/js/src/messages.js @@ -1,5 +1,5 @@ import { i18n } from "@lingui/core" -import { t, plural, defineMessage } from "@lingui/macro" +import { t, plural, defineMessage } from "@lingui/core/macro" i18n.load({ en: require("./locale/en/messages").messages, diff --git a/examples/js/yarn.lock b/examples/js/yarn.lock index 7b2410e67..ecb7e0a3c 100644 --- a/examples/js/yarn.lock +++ b/examples/js/yarn.lock @@ -391,6 +391,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-string-parser@npm:7.25.7" + checksum: 0835fda5efe02cdcb5144a939b639acc017ba4aa1cc80524b44032ddb714080d3e40e8f0d3240832b7bd86f5513f0b63d4fe77d8fc52d8c8720ae674182c0753 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.10.4": version: 7.10.4 resolution: "@babel/helper-validator-identifier@npm:7.10.4" @@ -405,6 +412,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-identifier@npm:7.25.7" + checksum: 062f55208deead4876eb474dc6fd55155c9eada8d0a505434de3b9aa06c34195562e0f3142b22a08793a38d740238efa2fe00ff42956cdcb8ac03f0b6c542247 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.9.0, @babel/helper-validator-identifier@npm:^7.9.5": version: 7.9.5 resolution: "@babel/helper-validator-identifier@npm:7.9.5" @@ -511,6 +525,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.0": + version: 7.25.8 + resolution: "@babel/parser@npm:7.25.8" + dependencies: + "@babel/types": ^7.25.8 + bin: + parser: ./bin/babel-parser.js + checksum: c33f6d26542f156927c5dbe131265c791177d271e582338e960f803903086ec5c152bf25deae5f4c061b7bee14dc0b5fd2882ccb5a21c16ee0738d24fcc0406e + languageName: node + linkType: hard + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.18.6": version: 7.18.6 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.18.6" @@ -1596,6 +1621,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/types@npm:7.25.8" + dependencies: + "@babel/helper-string-parser": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + to-fast-properties: ^2.0.0 + checksum: 93d84858e820dbfa0fc4882b3ba6a421544d224ee61455a58eed0af9fc3518b30dc2166b8ba48cdd2e91083c5885ed773c36acf46d177b7b1fad9c35b6eb7639 + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -1603,156 +1639,163 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm64@npm:0.17.12" +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm@npm:0.17.12" +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-x64@npm:0.17.12" +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-arm64@npm:0.17.12" +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-x64@npm:0.17.12" +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-arm64@npm:0.17.12" +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-x64@npm:0.17.12" +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm64@npm:0.17.12" +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm@npm:0.17.12" +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ia32@npm:0.17.12" +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-loong64@npm:0.17.12" +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-mips64el@npm:0.17.12" +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ppc64@npm:0.17.12" +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-riscv64@npm:0.17.12" +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-s390x@npm:0.17.12" +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-x64@npm:0.17.12" +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/netbsd-x64@npm:0.17.12" +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/openbsd-x64@npm:0.17.12" +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/sunos-x64@npm:0.17.12" +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-arm64@npm:0.17.12" +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-ia32@npm:0.17.12" +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-x64@npm:0.17.12" +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -1764,6 +1807,20 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + "@istanbuljs/load-nyc-config@npm:^1.0.0": version: 1.0.0 resolution: "@istanbuljs/load-nyc-config@npm:1.0.0" @@ -2065,38 +2122,58 @@ __metadata: languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.1.2" - checksum: 61cae1343e55073ae4cd7bbaf3e77362e71799af4be4e6cfc759e4d33eef6bca0f6a312bb43654ebc0abf8717e2c77c2b421420c47dfa2f0c3cc0f96dcf67015 +"@lingui/babel-plugin-extract-messages@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-extract-messages@npm:5.0.0-next.3" + checksum: a0c7632295c4e07eab9b5754b0f3e2944a7b59dda8cbbdacb5ba5c500b7be9c73b44e114bd1323dc3a6fa4ff64657f7f6d9b8c981facd2c55c782577418f68d8 languageName: node linkType: hard -"@lingui/cli@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/cli@npm:4.1.2" +"@lingui/babel-plugin-lingui-macro@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-lingui-macro@npm:5.0.0-next.3" + dependencies: + "@babel/core": ^7.20.12 + "@babel/runtime": ^7.20.13 + "@babel/types": ^7.20.7 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + peerDependencies: + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: ac7ebe134c4c324a1945de6cbc1f28c9d821233fa3d5228134034fde420e5f38f9c240cd090de6cae905dfe910496462c304e73d25ecf6a91e23afc3458c6248 + languageName: node + linkType: hard + +"@lingui/cli@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/cli@npm:5.0.0-next.3" dependencies: "@babel/core": ^7.21.0 "@babel/generator": ^7.21.1 - "@babel/parser": ^7.21.2 + "@babel/parser": ^7.22.0 "@babel/runtime": ^7.21.0 "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.1.2 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/format-po": 4.1.2 - "@lingui/message-utils": 4.1.2 + "@lingui/babel-plugin-extract-messages": ^5.0.0-next.3 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/format-po": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 babel-plugin-macros: ^3.0.1 chalk: ^4.1.0 chokidar: 3.5.1 - cli-table: 0.3.6 + cli-table: ^0.3.11 commander: ^10.0.0 convert-source-map: ^2.0.0 - date-fns: ^2.16.1 - esbuild: ^0.17.10 - glob: ^7.1.4 + date-fns: ^3.6.0 + esbuild: ^0.21.5 + glob: ^11.0.0 inquirer: ^7.3.3 - micromatch: 4.0.2 + micromatch: ^4.0.7 normalize-path: ^3.0.0 ora: ^5.1.0 pathe: ^1.1.0 @@ -2107,13 +2184,13 @@ __metadata: source-map: ^0.8.0-beta.0 bin: lingui: dist/lingui.js - checksum: 3dd985af16702f2e6fc91c6e263fbfe93cbbdcaea01e54dd5a710a583fa40a48b070f4efdd872eb6518b960d431910b9e8a07cea2000a44e634285e953fdd7c6 + checksum: eada44db8e4c16fa4de50e46cf98889d8b787cf5accfca3edbb8bad9e45f77054e54f2bfffcbbf64f35d2f8199d0349cde69f57a5da49f4b34deb509b065bfd9 languageName: node linkType: hard -"@lingui/conf@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/conf@npm:4.1.2" +"@lingui/conf@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/conf@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 chalk: ^4.1.0 @@ -2121,54 +2198,48 @@ __metadata: jest-validate: ^29.4.3 jiti: ^1.17.1 lodash.get: ^4.4.2 - checksum: 2fbeeaf0c2e7b895c3128b7e5e7e72a43d21bfd2b8f5bff6d0ec46ee8ae22d1c9af54540d7d070a21639b652ff1b9482b33504db79787801d0db693763508fe0 + checksum: c618ab075f96678fc1bb32326b5b0a2ff43e1ab3320b79493bf8f2525e2fa3fa85215d848eb7b4d2db816671c80c92c680868029c9fc34cceb9a3177fa9126ca languageName: node linkType: hard -"@lingui/core@npm:4.1.2, @lingui/core@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/core@npm:4.1.2" +"@lingui/core@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/core@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/message-utils": 4.1.2 - checksum: 480d13a13b855944d36d4145934fb18a0e8cb0625004114c540b9a7e5dce83206944a91d8daa55395ea3b11958bedaeb1731fd3e4224f7817f47fb1825450e6f + "@lingui/message-utils": ^5.0.0-next.3 + unraw: ^3.0.0 + peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: 4544ed44b2bc16ac6c0bf957b470608ba5ae4f62035030e706f9347225cefd0f845872658af728e758118f04cd65c1e7c851ebf6e7d1d7a660d30bf8404883df languageName: node linkType: hard -"@lingui/format-po@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/format-po@npm:4.1.2" +"@lingui/format-po@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/format-po@npm:5.0.0-next.3" dependencies: - "@lingui/conf": 4.1.2 - "@lingui/message-utils": 4.1.2 - date-fns: ^2.29.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + date-fns: ^3.6.0 pofile: ^1.1.4 - checksum: 205afaea64d59c70d876610d4480195c20a5649bc64a7618b69ba6adf702886de723517b0526129e0fccca01a4d2185c02746d7d77fc47cfc4e01cc65ee540ad + checksum: c73b4e2c4b95e4475e5c676817dc0299e9b46e5bf05f5c9204cc8b99fe65770072464aecdd0c93d4ae4492f384905469258b2786b5d546164e904d97019c9165 languageName: node linkType: hard -"@lingui/macro@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/macro@npm:4.1.2" - dependencies: - "@babel/runtime": ^7.20.13 - "@babel/types": ^7.20.7 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/message-utils": 4.1.2 - peerDependencies: - "@lingui/react": ^4.0.0 - babel-plugin-macros: 2 || 3 - checksum: bfe69b093a0724f54fc5bccee42787c0ef8f98479524226d5a34c4d5129878138e74be429e423da99633e02da6aa82026ad39dfe01ea8334bab4a39fdf282a89 - languageName: node - linkType: hard - -"@lingui/message-utils@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/message-utils@npm:4.1.2" +"@lingui/message-utils@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/message-utils@npm:5.0.0-next.3" dependencies: "@messageformat/parser": ^5.0.0 - checksum: a0a78959f22b866a298da342931a3eee474cdd486b9bdedf50ecdb7caa479dac773bc21b10a2d39c1d4363d5b7a236ccd853d9e4f46bcf0c1741becc7c078382 + js-sha256: ^0.10.1 + checksum: 9aad0d2ae0829231b6683d2681aeb1703d06093bfc9a65037e58d2051496c1efe92f8d72edda85695c53aff5c075e28b4601bf10ad76d0883d74e662e1cdb02d languageName: node linkType: hard @@ -2419,6 +2490,13 @@ __metadata: languageName: node linkType: hard +"ansi-regex@npm:^6.0.1": + version: 6.1.0 + resolution: "ansi-regex@npm:6.1.0" + checksum: 495834a53b0856c02acd40446f7130cb0f8284f4a39afdab20d5dc42b2e198b1196119fe887beed8f9055c4ff2055e3b2f6d4641d0be018cdfb64fedf6fc1aac + languageName: node + linkType: hard + "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -2445,6 +2523,13 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + "anymatch@npm:^3.0.3": version: 3.1.1 resolution: "anymatch@npm:3.1.1" @@ -2540,7 +2625,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-macros@npm:^3.0.1, babel-plugin-macros@npm:^3.1.0": +"babel-plugin-macros@npm:^3.0.1": version: 3.1.0 resolution: "babel-plugin-macros@npm:3.1.0" dependencies: @@ -2654,7 +2739,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1, braces@npm:^3.0.2, braces@npm:~3.0.2": +"braces@npm:^3.0.2, braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -2663,6 +2748,15 @@ __metadata: languageName: node linkType: hard +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: ^7.1.1 + checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69 + languageName: node + linkType: hard + "browserslist@npm:^4.21.3, browserslist@npm:^4.21.5": version: 4.21.5 resolution: "browserslist@npm:4.21.5" @@ -2855,12 +2949,12 @@ __metadata: languageName: node linkType: hard -"cli-table@npm:0.3.6": - version: 0.3.6 - resolution: "cli-table@npm:0.3.6" +"cli-table@npm:^0.3.11": + version: 0.3.11 + resolution: "cli-table@npm:0.3.11" dependencies: colors: 1.0.3 - checksum: b0cd08578c810240920438cc2b3ffb4b4f5106b29f3362707f1d8cfc0c0440ad2afb70b96e30ce37f72f0ffe1e844ae7341dde4df17d51ad345eb186a5903af2 + checksum: 59fb61f992ac9bc8610ed98c72bf7f5d396c5afb42926b6747b46b0f8bb98a0dfa097998e77542ac334c1eb7c18dbf4f104d5783493273c5ec4c34084aa7c663 languageName: node linkType: hard @@ -3022,7 +3116,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -3033,17 +3127,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.16.1": - version: 2.16.1 - resolution: "date-fns@npm:2.16.1" - checksum: f19c2b3b9bd62fdbc55b160c87b4656b3a260d79ee7a32a9cbc19107c3d61d71b569c0957351f9a07fc84c35283f74b0af5276620d4a37e36eef1898fa6c25b2 - languageName: node - linkType: hard - -"date-fns@npm:^2.29.3": - version: 2.29.3 - resolution: "date-fns@npm:2.29.3" - checksum: e01cf5b62af04e05dfff921bb9c9933310ed0e1ae9a81eb8653452e64dc841acf7f6e01e1a5ae5644d0337e9a7f936175fd2cb6819dc122fdd9c5e86c56be484 +"date-fns@npm:^3.6.0": + version: 3.6.0 + resolution: "date-fns@npm:3.6.0" + checksum: 0daa1e9a436cf99f9f2ae9232b55e11f3dd46132bee10987164f3eebd29f245b2e066d7d7db40782627411ecf18551d8f4c9fcdf2226e48bb66545407d448ab7 languageName: node linkType: hard @@ -3119,6 +3206,13 @@ __metadata: languageName: node linkType: hard +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.4.284": version: 1.4.320 resolution: "electron-to-chromium@npm:1.4.320" @@ -3140,6 +3234,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -3172,33 +3273,36 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.17.10": - version: 0.17.12 - resolution: "esbuild@npm:0.17.12" - dependencies: - "@esbuild/android-arm": 0.17.12 - "@esbuild/android-arm64": 0.17.12 - "@esbuild/android-x64": 0.17.12 - "@esbuild/darwin-arm64": 0.17.12 - "@esbuild/darwin-x64": 0.17.12 - "@esbuild/freebsd-arm64": 0.17.12 - "@esbuild/freebsd-x64": 0.17.12 - "@esbuild/linux-arm": 0.17.12 - "@esbuild/linux-arm64": 0.17.12 - "@esbuild/linux-ia32": 0.17.12 - "@esbuild/linux-loong64": 0.17.12 - "@esbuild/linux-mips64el": 0.17.12 - "@esbuild/linux-ppc64": 0.17.12 - "@esbuild/linux-riscv64": 0.17.12 - "@esbuild/linux-s390x": 0.17.12 - "@esbuild/linux-x64": 0.17.12 - "@esbuild/netbsd-x64": 0.17.12 - "@esbuild/openbsd-x64": 0.17.12 - "@esbuild/sunos-x64": 0.17.12 - "@esbuild/win32-arm64": 0.17.12 - "@esbuild/win32-ia32": 0.17.12 - "@esbuild/win32-x64": 0.17.12 +"esbuild@npm:^0.21.5": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": 0.21.5 + "@esbuild/android-arm": 0.21.5 + "@esbuild/android-arm64": 0.21.5 + "@esbuild/android-x64": 0.21.5 + "@esbuild/darwin-arm64": 0.21.5 + "@esbuild/darwin-x64": 0.21.5 + "@esbuild/freebsd-arm64": 0.21.5 + "@esbuild/freebsd-x64": 0.21.5 + "@esbuild/linux-arm": 0.21.5 + "@esbuild/linux-arm64": 0.21.5 + "@esbuild/linux-ia32": 0.21.5 + "@esbuild/linux-loong64": 0.21.5 + "@esbuild/linux-mips64el": 0.21.5 + "@esbuild/linux-ppc64": 0.21.5 + "@esbuild/linux-riscv64": 0.21.5 + "@esbuild/linux-s390x": 0.21.5 + "@esbuild/linux-x64": 0.21.5 + "@esbuild/netbsd-x64": 0.21.5 + "@esbuild/openbsd-x64": 0.21.5 + "@esbuild/sunos-x64": 0.21.5 + "@esbuild/win32-arm64": 0.21.5 + "@esbuild/win32-ia32": 0.21.5 + "@esbuild/win32-x64": 0.21.5 dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true "@esbuild/android-arm": optional: true "@esbuild/android-arm64": @@ -3245,7 +3349,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: ea6d33eb1bc6c9e00dcee5e253c7e935251b4801d376661fd9f19a9dcffc27f970078a6f7116d6c78ee825ceff9b974594b0b616bd560ce4d875a951aa92977b + checksum: 2911c7b50b23a9df59a7d6d4cdd3a4f85855787f374dce751148dbb13305e0ce7e880dde1608c2ab7a927fc6cec3587b80995f7fc87a64b455f8b70b55fd8ec1 languageName: node linkType: hard @@ -3369,6 +3473,15 @@ __metadata: languageName: node linkType: hard +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: ^5.0.1 + checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798 + languageName: node + linkType: hard + "find-up@npm:^3.0.0": version: 3.0.0 resolution: "find-up@npm:3.0.0" @@ -3388,6 +3501,16 @@ __metadata: languageName: node linkType: hard +"foreground-child@npm:^3.1.0": + version: 3.3.0 + resolution: "foreground-child@npm:3.3.0" + dependencies: + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 1989698488f725b05b26bc9afc8a08f08ec41807cd7b92ad85d96004ddf8243fd3e79486b8348c64a3011ae5cc2c9f0936af989e1f28339805d8bc178a75b451 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -3476,6 +3599,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.0": + version: 11.0.0 + resolution: "glob@npm:11.0.0" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^4.0.1 + minimatch: ^10.0.0 + minipass: ^7.1.2 + package-json-from-dist: ^1.0.0 + path-scurry: ^2.0.0 + bin: + glob: dist/esm/bin.mjs + checksum: 8a2dd914d5776987be5244624d9491bbcaf19f2387e06783737003ff696ebfd2264190c47014f8709c1c02d8bc892f17660cf986c587b107e194c0a3151ab333 + languageName: node + linkType: hard + "glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.1.6 resolution: "glob@npm:7.1.6" @@ -3867,6 +4006,15 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.0.1": + version: 4.0.2 + resolution: "jackspeak@npm:4.0.2" + dependencies: + "@isaacs/cliui": ^8.0.2 + checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 + languageName: node + linkType: hard + "jest-changed-files@npm:^29.5.0": version: 29.5.0 resolution: "jest-changed-files@npm:29.5.0" @@ -4318,6 +4466,13 @@ __metadata: languageName: node linkType: hard +"js-sha256@npm:^0.10.1": + version: 0.10.1 + resolution: "js-sha256@npm:0.10.1" + checksum: 6eb5c9f95aa902cec1930f036deb3bc664024b75fede456c0ac74b855797776c18620f47efec36787077a56ba2f3b8d6aacc7733ff8a2b5bb9ce6b655a35c5e6 + languageName: node + linkType: hard + "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -4466,6 +4621,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.0.1 + resolution: "lru-cache@npm:11.0.1" + checksum: 6056230a99fb399234e82368b99586bd4740079e80649102f681b19337b7d8c6bc8dd7f8b8c59377c31d26deb89f548b717ae932e139b4b795879d920fccf820 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -4540,16 +4702,6 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.2": - version: 4.0.2 - resolution: "micromatch@npm:4.0.2" - dependencies: - braces: ^3.0.1 - picomatch: ^2.0.5 - checksum: 39590a96d9ffad21f0afac044d0a5af4f33715a16fdd82c53a01c8f5ff6f70832a31b53e52972dac3deff8bf9f0bed0207d1c34e54ab3306a5e4c4efd5f7d249 - languageName: node - linkType: hard - "micromatch@npm:^4.0.4": version: 4.0.5 resolution: "micromatch@npm:4.0.5" @@ -4560,6 +4712,16 @@ __metadata: languageName: node linkType: hard +"micromatch@npm:^4.0.7": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" + dependencies: + braces: ^3.0.3 + picomatch: ^2.3.1 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 + languageName: node + linkType: hard + "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -4567,6 +4729,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.0.0": + version: 10.0.1 + resolution: "minimatch@npm:10.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: f5b63c2f30606091a057c5f679b067f84a2cd0ffbd2dbc9143bda850afd353c7be81949ff11ae0c86988f07390eeca64efd7143ee05a0dab37f6c6b38a2ebb6c + languageName: node + linkType: hard + "minimatch@npm:^3.0.4": version: 3.0.4 resolution: "minimatch@npm:3.0.4" @@ -4652,6 +4823,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 2bfd325b95c555f2b4d2814d49325691c7bee937d753814861b0b49d5edcda55cbbf22b6b6a60bb91eddac8668771f03c5ff647dcd9d0f798e9548b9cdc46ee3 + languageName: node + linkType: hard + "minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -4888,6 +5066,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -4956,6 +5141,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.0 + resolution: "path-scurry@npm:2.0.0" + dependencies: + lru-cache: ^11.0.0 + minipass: ^7.1.2 + checksum: 9953ce3857f7e0796b187a7066eede63864b7e1dfc14bf0484249801a5ab9afb90d9a58fc533ebb1b552d23767df8aa6a2c6c62caf3f8a65f6ce336a97bbb484 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -4977,7 +5172,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5": +"picomatch@npm:^2.0.4": version: 2.2.2 resolution: "picomatch@npm:2.2.2" checksum: 897a589f94665b4fd93e075fa94893936afe3f7bbef44250f0e878a8d9d001972a79589cac2856c24f6f5aa3b0abc9c8ba00c98fae4dc22bc0117188864d4181 @@ -5419,6 +5614,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "sisteransi@npm:^1.0.4": version: 1.0.5 resolution: "sisteransi@npm:1.0.5" @@ -5522,6 +5724,17 @@ __metadata: languageName: node linkType: hard +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0": + version: 4.2.0 + resolution: "string-width@npm:4.2.0" + dependencies: + emoji-regex: ^8.0.0 + is-fullwidth-code-point: ^3.0.0 + strip-ansi: ^6.0.0 + checksum: ee2c68df9a3ce4256565d2bdc8490f5706f195f88e799d3d425889264d3eff3d7984fe8b38dfc983dac948e03d8cdc737294b1c81f1528c37c9935d86b67593d + languageName: node + linkType: hard + "string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" @@ -5533,14 +5746,14 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^4.1.0, string-width@npm:^4.2.0": - version: 4.2.0 - resolution: "string-width@npm:4.2.0" +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" dependencies: - emoji-regex: ^8.0.0 - is-fullwidth-code-point: ^3.0.0 - strip-ansi: ^6.0.0 - checksum: ee2c68df9a3ce4256565d2bdc8490f5706f195f88e799d3d425889264d3eff3d7984fe8b38dfc983dac948e03d8cdc737294b1c81f1528c37c9935d86b67593d + eastasianwidth: ^0.2.0 + emoji-regex: ^9.2.2 + strip-ansi: ^7.0.1 + checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 languageName: node linkType: hard @@ -5553,6 +5766,15 @@ __metadata: languageName: node linkType: hard +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: ^5.0.1 + checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + languageName: node + linkType: hard + "strip-ansi@npm:^6.0.0": version: 6.0.0 resolution: "strip-ansi@npm:6.0.0" @@ -5562,12 +5784,12 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.1": - version: 6.0.1 - resolution: "strip-ansi@npm:6.0.1" +"strip-ansi@npm:^7.0.1": + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" dependencies: - ansi-regex: ^5.0.1 - checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + ansi-regex: ^6.0.1 + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d languageName: node linkType: hard @@ -5800,6 +6022,13 @@ __metadata: languageName: node linkType: hard +"unraw@npm:^3.0.0": + version: 3.0.0 + resolution: "unraw@npm:3.0.0" + checksum: 19eee0bc500ce197d262b79723a2c8c81c1d716baaa2a62c48a4d0d6b9e1fd9d350c5df86262e51343d591ab9c8a47ed150317d0b867b2b65795cdc17ef69873 + languageName: node + linkType: hard + "update-browserslist-db@npm:^1.0.10": version: 1.0.10 resolution: "update-browserslist-db@npm:1.0.10" @@ -5838,10 +6067,9 @@ __metadata: dependencies: "@babel/core": ^7.20.12 "@babel/preset-env": ^7.20.2 - "@lingui/cli": ^4.1.2 - "@lingui/core": ^4.1.2 - "@lingui/macro": ^4.1.2 - babel-plugin-macros: ^3.1.0 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.3 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 jest: ^29.5.0 languageName: unknown linkType: soft @@ -5902,7 +6130,7 @@ __metadata: languageName: node linkType: hard -"wrap-ansi@npm:^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" dependencies: @@ -5913,6 +6141,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" diff --git a/examples/nextjs-babel/.babelrc b/examples/nextjs-babel/.babelrc index e6b0c4713..63c841270 100644 --- a/examples/nextjs-babel/.babelrc +++ b/examples/nextjs-babel/.babelrc @@ -2,5 +2,5 @@ "presets": [ "next/babel" ], - "plugins": ["macros"] + "plugins": ["@lingui/babel-plugin-lingui-macro"] } diff --git a/examples/nextjs-babel/package.json b/examples/nextjs-babel/package.json index 601521f8a..20d7c947b 100644 --- a/examples/nextjs-babel/package.json +++ b/examples/nextjs-babel/package.json @@ -9,19 +9,18 @@ "start": "next start" }, "dependencies": { - "@lingui/core": "^4.1.2", - "@lingui/react": "^4.1.2", + "@lingui/core": "^5.0.0-next.2", + "@lingui/react": "^5.0.0-next.2", "classnames": "^2.3.1", "next": "13.2.4", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { - "@lingui/cli": "^4.1.2", - "@lingui/loader": "^4.1.2", - "@lingui/macro": "^4.1.2", + "@lingui/babel-plugin-lingui-macro": "^5.0.0-next.2", + "@lingui/cli": "^5.0.0-next.2", + "@lingui/loader": "^5.0.0-next.2", "@types/react": "^18.0.28", - "babel-plugin-macros": "^3.1.0", "typescript": "^4.9.5", "webpack": "^5.76.2" } diff --git a/examples/nextjs-babel/src/components/Layout.tsx b/examples/nextjs-babel/src/components/Layout.tsx index 11c77cd38..c43f11538 100644 --- a/examples/nextjs-babel/src/components/Layout.tsx +++ b/examples/nextjs-babel/src/components/Layout.tsx @@ -1,32 +1,29 @@ import Head from "next/head" import classnames from "classnames" -import { t, Trans } from "@lingui/macro" +import { Trans, useLingui } from "@lingui/react/macro" import styles from "./Layout.module.css" -import { useLingui } from "@lingui/react" import { useRouter } from "next/router" export function Layout({ title = null, className = "", children }) { /** - * This hook is needed to subscribe your - * component for changes if you use t`` macro + * This macro hook is needed to get `t` which + * is bound to i18n from React.Context */ - useLingui() + const { t } = useLingui() const router = useRouter() const { pathname, asPath, query } = router - // Default props can't be translated at module level because active locale - // isn't known when module is imported, but rather when component - // is rendered. - if (title == null) { - title = t`Example project using LinguiJS` - } - return (
- {title} + {/* + The Next Head component is not being rendered in the React + component tree and React Context is not being passed down to the components placed in the . + That means we cannot use the component here and instead have to use `t` macro. + */} + {title || t`Example project using LinguiJS`} diff --git a/examples/nextjs-babel/src/pages/examples.tsx b/examples/nextjs-babel/src/pages/examples.tsx index 95f3f5efb..5dfc2cb51 100644 --- a/examples/nextjs-babel/src/pages/examples.tsx +++ b/examples/nextjs-babel/src/pages/examples.tsx @@ -1,4 +1,5 @@ -import { Trans, Plural, plural, msg } from "@lingui/macro" +import { plural, msg } from "@lingui/core/macro" +import { Trans, Plural } from "@lingui/react/macro" import { Layout } from "../components/Layout" import { PluralExample } from "../components/PluralExample" diff --git a/examples/nextjs-babel/src/pages/index.tsx b/examples/nextjs-babel/src/pages/index.tsx index 7fc141161..260f36479 100644 --- a/examples/nextjs-babel/src/pages/index.tsx +++ b/examples/nextjs-babel/src/pages/index.tsx @@ -1,6 +1,6 @@ import Link from "next/link" -import { Trans } from "@lingui/macro" +import { Trans } from "@lingui/react/macro" import { Layout } from "../components/Layout" import styles from "./index.module.css" diff --git a/examples/nextjs-babel/yarn.lock b/examples/nextjs-babel/yarn.lock index 33607edc5..617bd0287 100644 --- a/examples/nextjs-babel/yarn.lock +++ b/examples/nextjs-babel/yarn.lock @@ -33,6 +33,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/code-frame@npm:7.25.7" + dependencies: + "@babel/highlight": ^7.25.7 + picocolors: ^1.0.0 + checksum: f235cdf9c5d6f172898a27949bd63731c5f201671f77bcf4c2ad97229bc462d89746c1a7f5671a132aecff5baf43f3d878b93a7ecc6aa71f9612d2b51270c53e + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.20.5": version: 7.21.0 resolution: "@babel/compat-data@npm:7.21.0" @@ -40,6 +50,36 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.25.7": + version: 7.25.8 + resolution: "@babel/compat-data@npm:7.25.8" + checksum: 7ac648b110ec0fcd3a3d3fc62c69c0325b536b3c97bafea8a4392dfc68d9ea9ab1f36d1b2f231d404473fc81f503b4a630425677fc9a3cce2ee33d74842ea109 + languageName: node + linkType: hard + +"@babel/core@npm:^7.20.12": + version: 7.25.8 + resolution: "@babel/core@npm:7.25.8" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/helper-compilation-targets": ^7.25.7 + "@babel/helper-module-transforms": ^7.25.7 + "@babel/helpers": ^7.25.7 + "@babel/parser": ^7.25.8 + "@babel/template": ^7.25.7 + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.8 + convert-source-map: ^2.0.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.3 + semver: ^6.3.1 + checksum: 77ddf693faf6997915e7bbe16e9f21ca1c0e58bc60ace9eac51c373b21d1b46ce50de650195c136a594b0e5fcb901ca17bb57c2d20bf175b3c325211138bcfde + languageName: node + linkType: hard + "@babel/core@npm:^7.21.0": version: 7.21.3 resolution: "@babel/core@npm:7.21.3" @@ -75,6 +115,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/generator@npm:7.25.7" + dependencies: + "@babel/types": ^7.25.7 + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.25 + jsesc: ^3.0.2 + checksum: f81cf9dc0191ae4411d82978114382ad6e047bfb678f9a95942bac5034a41719d88f047679f5e2f51ba7728b54ebd1cc32a10df7b556215d8a6ab9bdd4f11831 + languageName: node + linkType: hard + "@babel/helper-compilation-targets@npm:^7.20.7": version: 7.20.7 resolution: "@babel/helper-compilation-targets@npm:7.20.7" @@ -90,6 +142,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-compilation-targets@npm:7.25.7" + dependencies: + "@babel/compat-data": ^7.25.7 + "@babel/helper-validator-option": ^7.25.7 + browserslist: ^4.24.0 + lru-cache: ^5.1.1 + semver: ^6.3.1 + checksum: 5b57e7d4b9302c07510ad3318763c053c3d46f2d40a45c2ea0c59160ccf9061a34975ae62f36a32f15d8d03497ecd5ca43a96417c1fd83eb8c035e77a69840ef + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-environment-visitor@npm:7.18.9" @@ -125,6 +190,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-imports@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a7255755e9799978de4bf72563b94b53cf955e5fc3d2acc67c783d3b84d5d34dd41691e473ecc124a94654483fff573deacd87eccd8bd16b47ac4455b5941b30 + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.21.2": version: 7.21.2 resolution: "@babel/helper-module-transforms@npm:7.21.2" @@ -141,6 +216,20 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-transforms@npm:7.25.7" + dependencies: + "@babel/helper-module-imports": ^7.25.7 + "@babel/helper-simple-access": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + "@babel/traverse": ^7.25.7 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: b1daeded78243da969d90b105a564ed918dcded66fba5cd24fe09cb13f7ee9e84d9b9dee789d60237b9a674582d9831a35dbaf6f0a92a3af5f035234a5422814 + languageName: node + linkType: hard + "@babel/helper-simple-access@npm:^7.20.2": version: 7.20.2 resolution: "@babel/helper-simple-access@npm:7.20.2" @@ -150,6 +239,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-simple-access@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 684d0b0330c42d62834355f127df3ed78f16e6f1f66213c72adb7b3b0bcd6283ea8792f5b172868b3ca6518c479b54e18adac564219519072dda9053cca210bd + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-split-export-declaration@npm:7.18.6" @@ -166,6 +265,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-string-parser@npm:7.25.7" + checksum: 0835fda5efe02cdcb5144a939b639acc017ba4aa1cc80524b44032ddb714080d3e40e8f0d3240832b7bd86f5513f0b63d4fe77d8fc52d8c8720ae674182c0753 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.10.4": version: 7.10.4 resolution: "@babel/helper-validator-identifier@npm:7.10.4" @@ -180,6 +286,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-identifier@npm:7.25.7" + checksum: 062f55208deead4876eb474dc6fd55155c9eada8d0a505434de3b9aa06c34195562e0f3142b22a08793a38d740238efa2fe00ff42956cdcb8ac03f0b6c542247 + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.18.6": version: 7.21.0 resolution: "@babel/helper-validator-option@npm:7.21.0" @@ -187,6 +300,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-option@npm:7.25.7" + checksum: 87b801fe7d8337699f2fba5323243dd974ea214d27cf51faf2f0063da6dc5bb67c9bb7867fd337573870f9ab498d2788a75bcf9685442bd9430611c62b0195d1 + languageName: node + linkType: hard + "@babel/helpers@npm:^7.21.0": version: 7.21.0 resolution: "@babel/helpers@npm:7.21.0" @@ -198,6 +318,16 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helpers@npm:7.25.7" + dependencies: + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a73242850915ef2956097431fbab3a840b7d6298555ad4c6f596db7d1b43cf769181716e7b65f8f7015fe48748b9c454d3b9c6cf4506cb840b967654463b0819 + languageName: node + linkType: hard + "@babel/highlight@npm:^7.10.4": version: 7.10.4 resolution: "@babel/highlight@npm:7.10.4" @@ -220,7 +350,19 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.2, @babel/parser@npm:^7.21.3": +"@babel/highlight@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/highlight@npm:7.25.7" + dependencies: + "@babel/helper-validator-identifier": ^7.25.7 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + picocolors: ^1.0.0 + checksum: b6aa45c5bf7ecc16b8204bbed90335706131ac6cacb0f1bfb1b862ada3741539c913b56c9d26beb56cece0c231ffab36f66aa36aac6b04b32669c314705203f2 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.3": version: 7.21.3 resolution: "@babel/parser@npm:7.21.3" bin: @@ -229,6 +371,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.0, @babel/parser@npm:^7.25.7, @babel/parser@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/parser@npm:7.25.8" + dependencies: + "@babel/types": ^7.25.8 + bin: + parser: ./bin/babel-parser.js + checksum: c33f6d26542f156927c5dbe131265c791177d271e582338e960f803903086ec5c152bf25deae5f4c061b7bee14dc0b5fd2882ccb5a21c16ee0738d24fcc0406e + languageName: node + linkType: hard + "@babel/runtime@npm:^7.12.5": version: 7.13.10 resolution: "@babel/runtime@npm:7.13.10" @@ -258,6 +411,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/template@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 83f025a4a777103965ee41b7c0fa2bb1c847ea7ed2b9f2cb258998ea96dfc580206176b532edf6d723d85237bc06fca26be5c8772e2af7d9e4fe6927e3bed8a3 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.21.0, @babel/traverse@npm:^7.21.2, @babel/traverse@npm:^7.21.3": version: 7.21.3 resolution: "@babel/traverse@npm:7.21.3" @@ -276,6 +440,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/traverse@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + debug: ^4.3.1 + globals: ^11.1.0 + checksum: 4d329b6e7a409a63f4815bbc0a08d0b0cb566c5a2fecd1767661fe1821ced213c554d7d74e6aca048672fed2c8f76071cb0d94f4bd5f120fba8d55a38af63094 + languageName: node + linkType: hard + "@babel/types@npm:^7.18.6, @babel/types@npm:^7.20.2, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.2, @babel/types@npm:^7.21.3": version: 7.21.3 resolution: "@babel/types@npm:7.21.3" @@ -287,6 +466,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.7, @babel/types@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/types@npm:7.25.8" + dependencies: + "@babel/helper-string-parser": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + to-fast-properties: ^2.0.0 + checksum: 93d84858e820dbfa0fc4882b3ba6a421544d224ee61455a58eed0af9fc3518b30dc2166b8ba48cdd2e91083c5885ed773c36acf46d177b7b1fad9c35b6eb7639 + languageName: node + linkType: hard + "@babel/types@npm:^7.8.3": version: 7.21.2 resolution: "@babel/types@npm:7.21.2" @@ -298,156 +488,163 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm64@npm:0.17.12" +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm@npm:0.17.12" +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-x64@npm:0.17.12" +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-arm64@npm:0.17.12" +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-x64@npm:0.17.12" +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-arm64@npm:0.17.12" +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-x64@npm:0.17.12" +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm64@npm:0.17.12" +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm@npm:0.17.12" +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ia32@npm:0.17.12" +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-loong64@npm:0.17.12" +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-mips64el@npm:0.17.12" +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ppc64@npm:0.17.12" +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-riscv64@npm:0.17.12" +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-s390x@npm:0.17.12" +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-x64@npm:0.17.12" +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/netbsd-x64@npm:0.17.12" +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/openbsd-x64@npm:0.17.12" +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/sunos-x64@npm:0.17.12" +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-arm64@npm:0.17.12" +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-ia32@npm:0.17.12" +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-x64@npm:0.17.12" +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -459,6 +656,20 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + "@jest/schemas@npm:^29.4.3": version: 29.4.3 resolution: "@jest/schemas@npm:29.4.3" @@ -503,6 +714,17 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": ^1.2.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.24 + checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:3.1.0": version: 3.1.0 resolution: "@jridgewell/resolve-uri@npm:3.1.0" @@ -510,6 +732,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.2 + resolution: "@jridgewell/resolve-uri@npm:3.1.2" + checksum: 83b85f72c59d1c080b4cbec0fef84528963a1b5db34e4370fa4bd1e3ff64a0d80e0cee7369d11d73c704e0286fb2865b530acac7a871088fbe92b5edf1000870 + languageName: node + linkType: hard + "@jridgewell/set-array@npm:^1.0.0, @jridgewell/set-array@npm:^1.0.1": version: 1.1.2 resolution: "@jridgewell/set-array@npm:1.1.2" @@ -517,6 +746,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 + languageName: node + linkType: hard + "@jridgewell/source-map@npm:^0.3.2": version: 0.3.2 resolution: "@jridgewell/source-map@npm:0.3.2" @@ -534,6 +770,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:^0.3.14, @jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.17 resolution: "@jridgewell/trace-mapping@npm:0.3.17" @@ -544,38 +787,68 @@ __metadata: languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.1.2" - checksum: 61cae1343e55073ae4cd7bbaf3e77362e71799af4be4e6cfc759e4d33eef6bca0f6a312bb43654ebc0abf8717e2c77c2b421420c47dfa2f0c3cc0f96dcf67015 +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 9d3c40d225e139987b50c48988f8717a54a8c994d8a948ee42e1412e08988761d0754d7d10b803061cc3aebf35f92a5dbbab493bd0e1a9ef9e89a2130e83ba34 + languageName: node + linkType: hard + +"@lingui/babel-plugin-extract-messages@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/babel-plugin-extract-messages@npm:5.0.0-next.2" + checksum: 22d0202d931f0ed9fef64e3f459a4e9b265395bb38f81fc265b8d678428655963eb2a579e2c87f0a6be59a5468134316ed307bade86762040f41cb0eb7f4df3b + languageName: node + linkType: hard + +"@lingui/babel-plugin-lingui-macro@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/babel-plugin-lingui-macro@npm:5.0.0-next.2" + dependencies: + "@babel/core": ^7.20.12 + "@babel/runtime": ^7.20.13 + "@babel/types": ^7.20.7 + "@lingui/conf": ^5.0.0-next.2 + "@lingui/core": ^5.0.0-next.2 + "@lingui/message-utils": ^5.0.0-next.2 + peerDependencies: + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: e53296caa57f6e6107d1e14f6406e70ef4c0a192acf2f75068147b76119ac9555e268d9916876b0188092926833a58bb9a8a76240d2871dc809380192a88665a languageName: node linkType: hard -"@lingui/cli@npm:4.1.2, @lingui/cli@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/cli@npm:4.1.2" +"@lingui/cli@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/cli@npm:5.0.0-next.2" dependencies: "@babel/core": ^7.21.0 "@babel/generator": ^7.21.1 - "@babel/parser": ^7.21.2 + "@babel/parser": ^7.22.0 "@babel/runtime": ^7.21.0 "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.1.2 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/format-po": 4.1.2 - "@lingui/message-utils": 4.1.2 + "@lingui/babel-plugin-extract-messages": ^5.0.0-next.2 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.2 + "@lingui/conf": ^5.0.0-next.2 + "@lingui/core": ^5.0.0-next.2 + "@lingui/format-po": ^5.0.0-next.2 + "@lingui/message-utils": ^5.0.0-next.2 babel-plugin-macros: ^3.0.1 chalk: ^4.1.0 chokidar: 3.5.1 - cli-table: 0.3.6 + cli-table: ^0.3.11 commander: ^10.0.0 convert-source-map: ^2.0.0 - date-fns: ^2.16.1 - esbuild: ^0.17.10 - glob: ^7.1.4 + date-fns: ^3.6.0 + esbuild: ^0.21.5 + glob: ^11.0.0 inquirer: ^7.3.3 - micromatch: 4.0.2 + micromatch: ^4.0.7 normalize-path: ^3.0.0 ora: ^5.1.0 pathe: ^1.1.0 @@ -586,13 +859,13 @@ __metadata: source-map: ^0.8.0-beta.0 bin: lingui: dist/lingui.js - checksum: 3dd985af16702f2e6fc91c6e263fbfe93cbbdcaea01e54dd5a710a583fa40a48b070f4efdd872eb6518b960d431910b9e8a07cea2000a44e634285e953fdd7c6 + checksum: 19141ce360e5838c5ef8dbc7e104e0393772ef22aceb7c6cba2a50370e5ecc5cc3a56ecd21f5404986983092bb89d8dd4d2f4ae101de586f2471081d9cab3ba3 languageName: node linkType: hard -"@lingui/conf@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/conf@npm:4.1.2" +"@lingui/conf@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/conf@npm:5.0.0-next.2" dependencies: "@babel/runtime": ^7.20.13 chalk: ^4.1.0 @@ -600,79 +873,80 @@ __metadata: jest-validate: ^29.4.3 jiti: ^1.17.1 lodash.get: ^4.4.2 - checksum: 2fbeeaf0c2e7b895c3128b7e5e7e72a43d21bfd2b8f5bff6d0ec46ee8ae22d1c9af54540d7d070a21639b652ff1b9482b33504db79787801d0db693763508fe0 + checksum: 39a209d51c926d27431fb6d5e399f19acac8efd7b87525df1b188ef565cf9185532fd4f93fe7b7dc84865c357b7845ed267d47a0996f7472e52118add6d5f771 languageName: node linkType: hard -"@lingui/core@npm:4.1.2, @lingui/core@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/core@npm:4.1.2" +"@lingui/core@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/core@npm:5.0.0-next.2" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/message-utils": 4.1.2 - checksum: 480d13a13b855944d36d4145934fb18a0e8cb0625004114c540b9a7e5dce83206944a91d8daa55395ea3b11958bedaeb1731fd3e4224f7817f47fb1825450e6f + "@lingui/message-utils": ^5.0.0-next.2 + unraw: ^3.0.0 + peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.2 + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: c06c51818d0f543b1c186b3892f1b222d343f0f9b7639567d20724cf0bdd0ddc894a0a1c2909ed26834ac5b3f30142775b1de070f078d5b82f5d264f54a3e11f languageName: node linkType: hard -"@lingui/format-po@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/format-po@npm:4.1.2" +"@lingui/format-po@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/format-po@npm:5.0.0-next.2" dependencies: - "@lingui/conf": 4.1.2 - "@lingui/message-utils": 4.1.2 - date-fns: ^2.29.3 + "@lingui/conf": ^5.0.0-next.2 + "@lingui/message-utils": ^5.0.0-next.2 + date-fns: ^3.6.0 pofile: ^1.1.4 - checksum: 205afaea64d59c70d876610d4480195c20a5649bc64a7618b69ba6adf702886de723517b0526129e0fccca01a4d2185c02746d7d77fc47cfc4e01cc65ee540ad + checksum: f146dcab3c8ddf6bb5af59086802de6fd7de4cb014891c95507d70f3272ffe4c84c37da46ecbaabed2f6d2634f65dcd39cf99831f399fe22806eb0b72f80319c languageName: node linkType: hard -"@lingui/loader@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/loader@npm:4.1.2" +"@lingui/loader@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/loader@npm:5.0.0-next.2" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/cli": 4.1.2 - "@lingui/conf": 4.1.2 + "@lingui/cli": ^5.0.0-next.2 + "@lingui/conf": ^5.0.0-next.2 peerDependencies: webpack: ^5.0.0 - checksum: 7c2d00a0de024a4f5dab3651c3d7e15b03e92e5b91c1070cbc8975f3c9c2dcb5647f460ec7b88e151e73714229549a1ac87e842ebf40e1924b5c0dace3a89767 - languageName: node - linkType: hard - -"@lingui/macro@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/macro@npm:4.1.2" - dependencies: - "@babel/runtime": ^7.20.13 - "@babel/types": ^7.20.7 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/message-utils": 4.1.2 - peerDependencies: - "@lingui/react": ^4.0.0 - babel-plugin-macros: 2 || 3 - checksum: bfe69b093a0724f54fc5bccee42787c0ef8f98479524226d5a34c4d5129878138e74be429e423da99633e02da6aa82026ad39dfe01ea8334bab4a39fdf282a89 + checksum: 4bf55c9e26c2f08467a1dac246c0eb5b9a8e191ce0413d4732fff6dd9052e2c0a054a5b98dff820b87151dc80695fb082b6a767de9f0db499389e56c04360cd7 languageName: node linkType: hard -"@lingui/message-utils@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/message-utils@npm:4.1.2" +"@lingui/message-utils@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/message-utils@npm:5.0.0-next.2" dependencies: "@messageformat/parser": ^5.0.0 - checksum: a0a78959f22b866a298da342931a3eee474cdd486b9bdedf50ecdb7caa479dac773bc21b10a2d39c1d4363d5b7a236ccd853d9e4f46bcf0c1741becc7c078382 + js-sha256: ^0.10.1 + checksum: 42ba2da7197b57890dcb817a003cd804f321e50c3165a258f94feb37ad636ff255e7f3b50eb595e30bfed62a404e3bbd5a0c9f79b13933473e6a4cf48ba95c1d languageName: node linkType: hard -"@lingui/react@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/react@npm:4.1.2" +"@lingui/react@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/react@npm:5.0.0-next.2" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/core": 4.1.2 + "@lingui/core": ^5.0.0-next.2 peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.2 + babel-plugin-macros: 2 || 3 react: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 887a4341c1afa45abab4bf9e753c74329a2bb3e5a6d941968c91c2540e7506e54c00def50f75744e6c704a38772ccaaff04f1e622f114e0ba542136ad4f6227e + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: 263d3d1909398126a3bb779ac0f455f99bd004791aacb1a34a9a0cf2a9d029526ec0a06784b3530107342311abbe720d965cb12fa2a909205612b5226332a4e5 languageName: node linkType: hard @@ -1211,6 +1485,13 @@ __metadata: languageName: node linkType: hard +"ansi-regex@npm:^6.0.1": + version: 6.1.0 + resolution: "ansi-regex@npm:6.1.0" + checksum: 495834a53b0856c02acd40446f7130cb0f8284f4a39afdab20d5dc42b2e198b1196119fe887beed8f9055c4ff2055e3b2f6d4641d0be018cdfb64fedf6fc1aac + languageName: node + linkType: hard + "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -1220,7 +1501,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^4.1.0": +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": version: 4.3.0 resolution: "ansi-styles@npm:4.3.0" dependencies: @@ -1236,6 +1517,13 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + "anymatch@npm:~3.1.1": version: 3.1.1 resolution: "anymatch@npm:3.1.1" @@ -1281,17 +1569,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-macros@npm:^3.1.0": - version: 3.1.0 - resolution: "babel-plugin-macros@npm:3.1.0" - dependencies: - "@babel/runtime": ^7.12.5 - cosmiconfig: ^7.0.0 - resolve: ^1.19.0 - checksum: 765de4abebd3e4688ebdfbff8571ddc8cd8061f839bb6c3e550b0344a4027b04c60491f843296ce3f3379fb356cc873d57a9ee6694262547eb822c14a25be9a6 - languageName: node - linkType: hard - "balanced-match@npm:^1.0.0": version: 1.0.0 resolution: "balanced-match@npm:1.0.0" @@ -1325,7 +1602,16 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1, braces@npm:~3.0.2": +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: ^7.1.1 + checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69 + languageName: node + linkType: hard + +"braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -1348,6 +1634,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.24.0": + version: 4.24.0 + resolution: "browserslist@npm:4.24.0" + dependencies: + caniuse-lite: ^1.0.30001663 + electron-to-chromium: ^1.5.28 + node-releases: ^2.0.18 + update-browserslist-db: ^1.1.0 + bin: + browserslist: cli.js + checksum: de200d3eb8d6ed819dad99719099a28fb6ebeb88016a5ac42fbdc11607e910c236a84ca1b0bbf232477d4b88ab64e8ab6aa67557cdd40a73ca9c2834f92ccce0 + languageName: node + linkType: hard + "buffer-from@npm:^1.0.0": version: 1.1.1 resolution: "buffer-from@npm:1.1.1" @@ -1395,21 +1695,21 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001406": - version: 1.0.30001469 - resolution: "caniuse-lite@npm:1.0.30001469" - checksum: 8e496509d7e9ff189c72205675b5db0c5f1b6a09917027441e835efae0848a468a8c4e7d2b409ffc202438fcd23ae53e017f976a03c22c04d12d3c0e1e33e5de +"caniuse-lite@npm:^1.0.30001406, caniuse-lite@npm:^1.0.30001449": + version: 1.0.30001594 + resolution: "caniuse-lite@npm:1.0.30001594" + checksum: 59e52b2213f34fa9317813037fbab4f9b163f9bfeaeeb53035a57046ee2366b69eafc257997eab22982dc061d0576d1f4ef97c29425e1989f6589a7b1d8ed2d5 languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001449": - version: 1.0.30001460 - resolution: "caniuse-lite@npm:1.0.30001460" - checksum: dad91eb82aa65aecf33ad6a04ad620b9df6f0152020dc6c1874224e8c6f4aa50695f585201b3dfcd2760b3c43326a86c9505cc03af856698fbef67b267ef786f +"caniuse-lite@npm:^1.0.30001663": + version: 1.0.30001669 + resolution: "caniuse-lite@npm:1.0.30001669" + checksum: 8ed0c69d0c6aa3b1cbc5ba4e5f5330943e7b7165e257f6955b8b73f043d07ad922265261f2b54d9bbaf02886bbdba5e6f5b16662310a13f91f17035af3212de1 languageName: node linkType: hard -"chalk@npm:^2.0.0": +"chalk@npm:^2.0.0, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -1500,12 +1800,12 @@ __metadata: languageName: node linkType: hard -"cli-table@npm:0.3.6": - version: 0.3.6 - resolution: "cli-table@npm:0.3.6" +"cli-table@npm:^0.3.11": + version: 0.3.11 + resolution: "cli-table@npm:0.3.11" dependencies: colors: 1.0.3 - checksum: b0cd08578c810240920438cc2b3ffb4b4f5106b29f3362707f1d8cfc0c0440ad2afb70b96e30ce37f72f0ffe1e844ae7341dde4df17d51ad345eb186a5903af2 + checksum: 59fb61f992ac9bc8610ed98c72bf7f5d396c5afb42926b6747b46b0f8bb98a0dfa097998e77542ac334c1eb7c18dbf4f104d5783493273c5ec4c34084aa7c663 languageName: node linkType: hard @@ -1645,6 +1945,17 @@ __metadata: languageName: node linkType: hard +"cross-spawn@npm:^7.0.0": + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" + dependencies: + path-key: ^3.1.0 + shebang-command: ^2.0.0 + which: ^2.0.1 + checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + languageName: node + linkType: hard + "csstype@npm:^3.0.2": version: 3.0.4 resolution: "csstype@npm:3.0.4" @@ -1652,17 +1963,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.16.1": - version: 2.16.1 - resolution: "date-fns@npm:2.16.1" - checksum: f19c2b3b9bd62fdbc55b160c87b4656b3a260d79ee7a32a9cbc19107c3d61d71b569c0957351f9a07fc84c35283f74b0af5276620d4a37e36eef1898fa6c25b2 - languageName: node - linkType: hard - -"date-fns@npm:^2.29.3": - version: 2.29.3 - resolution: "date-fns@npm:2.29.3" - checksum: e01cf5b62af04e05dfff921bb9c9933310ed0e1ae9a81eb8653452e64dc841acf7f6e01e1a5ae5644d0337e9a7f936175fd2cb6819dc122fdd9c5e86c56be484 +"date-fns@npm:^3.6.0": + version: 3.6.0 + resolution: "date-fns@npm:3.6.0" + checksum: 0daa1e9a436cf99f9f2ae9232b55e11f3dd46132bee10987164f3eebd29f245b2e066d7d7db40782627411ecf18551d8f4c9fcdf2226e48bb66545407d448ab7 languageName: node linkType: hard @@ -1678,6 +1982,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.3.1": + version: 4.3.7 + resolution: "debug@npm:4.3.7" + dependencies: + ms: ^2.1.3 + peerDependenciesMeta: + supports-color: + optional: true + checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 + languageName: node + linkType: hard + "defaults@npm:^1.0.3": version: 1.0.3 resolution: "defaults@npm:1.0.3" @@ -1701,6 +2017,13 @@ __metadata: languageName: node linkType: hard +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.4.284": version: 1.4.320 resolution: "electron-to-chromium@npm:1.4.320" @@ -1708,6 +2031,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.28": + version: 1.5.39 + resolution: "electron-to-chromium@npm:1.5.39" + checksum: cd3b644c20f30fc1c393168bafa0e42a3dde576129603266ab61248b76a36837084073895a845676f8fe90dbb31d385bbef53901b60381f3ae82b40a5bece352 + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -1715,6 +2045,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -1764,33 +2101,36 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.17.10": - version: 0.17.12 - resolution: "esbuild@npm:0.17.12" - dependencies: - "@esbuild/android-arm": 0.17.12 - "@esbuild/android-arm64": 0.17.12 - "@esbuild/android-x64": 0.17.12 - "@esbuild/darwin-arm64": 0.17.12 - "@esbuild/darwin-x64": 0.17.12 - "@esbuild/freebsd-arm64": 0.17.12 - "@esbuild/freebsd-x64": 0.17.12 - "@esbuild/linux-arm": 0.17.12 - "@esbuild/linux-arm64": 0.17.12 - "@esbuild/linux-ia32": 0.17.12 - "@esbuild/linux-loong64": 0.17.12 - "@esbuild/linux-mips64el": 0.17.12 - "@esbuild/linux-ppc64": 0.17.12 - "@esbuild/linux-riscv64": 0.17.12 - "@esbuild/linux-s390x": 0.17.12 - "@esbuild/linux-x64": 0.17.12 - "@esbuild/netbsd-x64": 0.17.12 - "@esbuild/openbsd-x64": 0.17.12 - "@esbuild/sunos-x64": 0.17.12 - "@esbuild/win32-arm64": 0.17.12 - "@esbuild/win32-ia32": 0.17.12 - "@esbuild/win32-x64": 0.17.12 +"esbuild@npm:^0.21.5": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": 0.21.5 + "@esbuild/android-arm": 0.21.5 + "@esbuild/android-arm64": 0.21.5 + "@esbuild/android-x64": 0.21.5 + "@esbuild/darwin-arm64": 0.21.5 + "@esbuild/darwin-x64": 0.21.5 + "@esbuild/freebsd-arm64": 0.21.5 + "@esbuild/freebsd-x64": 0.21.5 + "@esbuild/linux-arm": 0.21.5 + "@esbuild/linux-arm64": 0.21.5 + "@esbuild/linux-ia32": 0.21.5 + "@esbuild/linux-loong64": 0.21.5 + "@esbuild/linux-mips64el": 0.21.5 + "@esbuild/linux-ppc64": 0.21.5 + "@esbuild/linux-riscv64": 0.21.5 + "@esbuild/linux-s390x": 0.21.5 + "@esbuild/linux-x64": 0.21.5 + "@esbuild/netbsd-x64": 0.21.5 + "@esbuild/openbsd-x64": 0.21.5 + "@esbuild/sunos-x64": 0.21.5 + "@esbuild/win32-arm64": 0.21.5 + "@esbuild/win32-ia32": 0.21.5 + "@esbuild/win32-x64": 0.21.5 dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true "@esbuild/android-arm": optional: true "@esbuild/android-arm64": @@ -1837,7 +2177,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: ea6d33eb1bc6c9e00dcee5e253c7e935251b4801d376661fd9f19a9dcffc27f970078a6f7116d6c78ee825ceff9b974594b0b616bd560ce4d875a951aa92977b + checksum: 2911c7b50b23a9df59a7d6d4cdd3a4f85855787f374dce751148dbb13305e0ce7e880dde1608c2ab7a927fc6cec3587b80995f7fc87a64b455f8b70b55fd8ec1 languageName: node linkType: hard @@ -1848,6 +2188,13 @@ __metadata: languageName: node linkType: hard +"escalade@npm:^3.2.0": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 47b029c83de01b0d17ad99ed766347b974b0d628e848de404018f3abee728e987da0d2d370ad4574aa3d5b5bfc368754fd085d69a30f8e75903486ec4b5b709e + languageName: node + linkType: hard + "escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" @@ -1938,6 +2285,15 @@ __metadata: languageName: node linkType: hard +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: ^5.0.1 + checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798 + languageName: node + linkType: hard + "find-up@npm:^3.0.0": version: 3.0.0 resolution: "find-up@npm:3.0.0" @@ -1947,6 +2303,16 @@ __metadata: languageName: node linkType: hard +"foreground-child@npm:^3.1.0": + version: 3.3.0 + resolution: "foreground-child@npm:3.3.0" + dependencies: + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 1989698488f725b05b26bc9afc8a08f08ec41807cd7b92ad85d96004ddf8243fd3e79486b8348c64a3011ae5cc2c9f0936af989e1f28339805d8bc178a75b451 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -2028,6 +2394,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.0": + version: 11.0.0 + resolution: "glob@npm:11.0.0" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^4.0.1 + minimatch: ^10.0.0 + minipass: ^7.1.2 + package-json-from-dist: ^1.0.0 + path-scurry: ^2.0.0 + bin: + glob: dist/esm/bin.mjs + checksum: 8a2dd914d5776987be5244624d9491bbcaf19f2387e06783737003ff696ebfd2264190c47014f8709c1c02d8bc892f17660cf986c587b107e194c0a3151ab333 + languageName: node + linkType: hard + "glob@npm:^7.1.3": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -2327,6 +2709,15 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.0.1": + version: 4.0.2 + resolution: "jackspeak@npm:4.0.2" + dependencies: + "@isaacs/cliui": ^8.0.2 + checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 + languageName: node + linkType: hard + "jest-get-type@npm:^29.4.3": version: 29.4.3 resolution: "jest-get-type@npm:29.4.3" @@ -2368,6 +2759,13 @@ __metadata: languageName: node linkType: hard +"js-sha256@npm:^0.10.1": + version: 0.10.1 + resolution: "js-sha256@npm:0.10.1" + checksum: 6eb5c9f95aa902cec1930f036deb3bc664024b75fede456c0ac74b855797776c18620f47efec36787077a56ba2f3b8d6aacc7733ff8a2b5bb9ce6b655a35c5e6 + languageName: node + linkType: hard + "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -2395,6 +2793,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: a36d3ca40574a974d9c2063bf68c2b6141c20da8f2a36bd3279fc802563f35f0527a6c828801295bdfb2803952cf2cf387786c2c90ed564f88d5782475abfe3c + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.0, json-parse-even-better-errors@npm:^2.3.1": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -2409,7 +2816,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.2": +"json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -2490,6 +2897,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.0.1 + resolution: "lru-cache@npm:11.0.1" + checksum: 6056230a99fb399234e82368b99586bd4740079e80649102f681b19337b7d8c6bc8dd7f8b8c59377c31d26deb89f548b717ae932e139b4b795879d920fccf820 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -2546,13 +2960,13 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.2": - version: 4.0.2 - resolution: "micromatch@npm:4.0.2" +"micromatch@npm:^4.0.7": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" dependencies: - braces: ^3.0.1 - picomatch: ^2.0.5 - checksum: 39590a96d9ffad21f0afac044d0a5af4f33715a16fdd82c53a01c8f5ff6f70832a31b53e52972dac3deff8bf9f0bed0207d1c34e54ab3306a5e4c4efd5f7d249 + braces: ^3.0.3 + picomatch: ^2.3.1 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 languageName: node linkType: hard @@ -2579,6 +2993,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.0.0": + version: 10.0.1 + resolution: "minimatch@npm:10.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: f5b63c2f30606091a057c5f679b067f84a2cd0ffbd2dbc9143bda850afd353c7be81949ff11ae0c86988f07390eeca64efd7143ee05a0dab37f6c6b38a2ebb6c + languageName: node + linkType: hard + "minimatch@npm:^3.0.4": version: 3.0.4 resolution: "minimatch@npm:3.0.4" @@ -2673,6 +3096,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 2bfd325b95c555f2b4d2814d49325691c7bee937d753814861b0b49d5edcda55cbbf22b6b6a60bb91eddac8668771f03c5ff647dcd9d0f798e9548b9cdc46ee3 + languageName: node + linkType: hard + "minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -2706,7 +3136,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.0.0": +"ms@npm:^2.0.0, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -2747,13 +3177,12 @@ __metadata: version: 0.0.0-use.local resolution: "next-js-babel@workspace:." dependencies: - "@lingui/cli": ^4.1.2 - "@lingui/core": ^4.1.2 - "@lingui/loader": ^4.1.2 - "@lingui/macro": ^4.1.2 - "@lingui/react": ^4.1.2 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.2 + "@lingui/cli": ^5.0.0-next.2 + "@lingui/core": ^5.0.0-next.2 + "@lingui/loader": ^5.0.0-next.2 + "@lingui/react": ^5.0.0-next.2 "@types/react": ^18.0.28 - babel-plugin-macros: ^3.1.0 classnames: ^2.3.1 next: 13.2.4 react: 18.2.0 @@ -2854,6 +3283,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^2.0.18": + version: 2.0.18 + resolution: "node-releases@npm:2.0.18" + checksum: ef55a3d853e1269a6d6279b7692cd6ff3e40bc74947945101138745bfdc9a5edabfe72cb19a31a8e45752e1910c4c65c77d931866af6357f242b172b7283f5b3 + languageName: node + linkType: hard + "node-releases@npm:^2.0.8": version: 2.0.10 resolution: "node-releases@npm:2.0.10" @@ -2966,6 +3402,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -3001,6 +3444,13 @@ __metadata: languageName: node linkType: hard +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 + languageName: node + linkType: hard + "path-parse@npm:^1.0.6": version: 1.0.6 resolution: "path-parse@npm:1.0.6" @@ -3008,6 +3458,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.0 + resolution: "path-scurry@npm:2.0.0" + dependencies: + lru-cache: ^11.0.0 + minipass: ^7.1.2 + checksum: 9953ce3857f7e0796b187a7066eede63864b7e1dfc14bf0484249801a5ab9afb90d9a58fc533ebb1b552d23767df8aa6a2c6c62caf3f8a65f6ce336a97bbb484 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -3029,13 +3489,27 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5, picomatch@npm:^2.2.1": +"picocolors@npm:^1.1.0": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: a64d653d3a188119ff45781dfcdaeedd7625583f45280aea33fcb032c7a0d3959f2368f9b192ad5e8aade75b74dbd954ffe3106c158509a45e4c18ab379a2acd + languageName: node + linkType: hard + +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1": version: 2.2.2 resolution: "picomatch@npm:2.2.2" checksum: 897a589f94665b4fd93e075fa94893936afe3f7bbef44250f0e878a8d9d001972a79589cac2856c24f6f5aa3b0abc9c8ba00c98fae4dc22bc0117188864d4181 languageName: node linkType: hard +"picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf + languageName: node + linkType: hard + "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -3301,6 +3775,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^6.3.1": + version: 6.3.1 + resolution: "semver@npm:6.3.1" + bin: + semver: bin/semver.js + checksum: ae47d06de28836adb9d3e25f22a92943477371292d9b665fb023fae278d345d508ca1958232af086d85e0155aee22e313e100971898bbb8d5d89b8b1d4054ca2 + languageName: node + linkType: hard + "semver@npm:^7.3.5": version: 7.3.8 resolution: "semver@npm:7.3.8" @@ -3328,6 +3811,22 @@ __metadata: languageName: node linkType: hard +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: ^3.0.0 + checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.2": version: 3.0.3 resolution: "signal-exit@npm:3.0.3" @@ -3342,6 +3841,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "smart-buffer@npm:^4.2.0": version: 4.2.0 resolution: "smart-buffer@npm:4.2.0" @@ -3412,7 +3918,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -3434,6 +3940,17 @@ __metadata: languageName: node linkType: hard +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" + dependencies: + eastasianwidth: ^0.2.0 + emoji-regex: ^9.2.2 + strip-ansi: ^7.0.1 + checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -3443,6 +3960,15 @@ __metadata: languageName: node linkType: hard +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: ^5.0.1 + checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + languageName: node + linkType: hard + "strip-ansi@npm:^6.0.0": version: 6.0.0 resolution: "strip-ansi@npm:6.0.0" @@ -3452,12 +3978,12 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.1": - version: 6.0.1 - resolution: "strip-ansi@npm:6.0.1" +"strip-ansi@npm:^7.0.1": + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" dependencies: - ansi-regex: ^5.0.1 - checksum: f3cd25890aef3ba6e1a74e20896c21a46f482e93df4a06567cebf2b57edabb15133f1f94e57434e0a958d61186087b1008e89c94875d019910a213181a14fc8c + ansi-regex: ^6.0.1 + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d languageName: node linkType: hard @@ -3661,6 +4187,13 @@ __metadata: languageName: node linkType: hard +"unraw@npm:^3.0.0": + version: 3.0.0 + resolution: "unraw@npm:3.0.0" + checksum: 19eee0bc500ce197d262b79723a2c8c81c1d716baaa2a62c48a4d0d6b9e1fd9d350c5df86262e51343d591ab9c8a47ed150317d0b867b2b65795cdc17ef69873 + languageName: node + linkType: hard + "update-browserslist-db@npm:^1.0.10": version: 1.0.10 resolution: "update-browserslist-db@npm:1.0.10" @@ -3675,6 +4208,20 @@ __metadata: languageName: node linkType: hard +"update-browserslist-db@npm:^1.1.0": + version: 1.1.1 + resolution: "update-browserslist-db@npm:1.1.1" + dependencies: + escalade: ^3.2.0 + picocolors: ^1.1.0 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 2ea11bd2562122162c3e438d83a1f9125238c0844b6d16d366e3276d0c0acac6036822dc7df65fc5a89c699cdf9f174acf439c39bedf3f9a2f3983976e4b4c3e + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -3772,7 +4319,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^2.0.2": +"which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" dependencies: @@ -3792,6 +4339,28 @@ __metadata: languageName: node linkType: hard +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + languageName: node + linkType: hard + +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" diff --git a/examples/nextjs-swc/next-env.d.ts b/examples/nextjs-swc/next-env.d.ts index fd36f9494..725dd6f24 100644 --- a/examples/nextjs-swc/next-env.d.ts +++ b/examples/nextjs-swc/next-env.d.ts @@ -3,4 +3,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/examples/nextjs-swc/package.json b/examples/nextjs-swc/package.json index 6e2894574..be87c83c3 100644 --- a/examples/nextjs-swc/package.json +++ b/examples/nextjs-swc/package.json @@ -12,18 +12,17 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@lingui/core": "^4.11.0", - "@lingui/react": "^4.11.0", + "@lingui/core": "^5.0.0-next.3", + "@lingui/react": "^5.0.0-next.3", "negotiator": "^0.6.3", - "next": "^14.2.3", + "next": "^14.2.15", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { - "@lingui/cli": "^4.11.0", - "@lingui/loader": "^4.11.0", - "@lingui/macro": "^4.11.0", - "@lingui/swc-plugin": "4.0.7", + "@lingui/cli": "^5.0.0-next.3", + "@lingui/loader": "^5.0.0-next.3", + "@lingui/swc-plugin": "^5.0.0-next.2", "@types/negotiator": "^0.6.3", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", diff --git a/examples/nextjs-swc/src/components/AboutText.tsx b/examples/nextjs-swc/src/components/AboutText.tsx index a8cc9bb69..87f24d511 100644 --- a/examples/nextjs-swc/src/components/AboutText.tsx +++ b/examples/nextjs-swc/src/components/AboutText.tsx @@ -1,4 +1,4 @@ -import { Trans } from '@lingui/macro' +import { Trans } from '@lingui/react/macro' export function AboutText() { return ( diff --git a/examples/nextjs-swc/src/components/Developers.tsx b/examples/nextjs-swc/src/components/Developers.tsx index 64ef1ed61..2f1af12cb 100644 --- a/examples/nextjs-swc/src/components/Developers.tsx +++ b/examples/nextjs-swc/src/components/Developers.tsx @@ -2,7 +2,7 @@ // this is a client component because it uses the `useState` hook import { useState } from 'react' -import { Trans, Plural } from '@lingui/macro' +import { Trans, Plural } from '@lingui/react/macro' export default function Developers() { const [selected, setSelected] = useState('1') diff --git a/examples/nextjs-swc/src/components/Switcher.tsx b/examples/nextjs-swc/src/components/Switcher.tsx index eee524d57..8f4563df8 100644 --- a/examples/nextjs-swc/src/components/Switcher.tsx +++ b/examples/nextjs-swc/src/components/Switcher.tsx @@ -2,7 +2,7 @@ // this is a client component because it uses the `useState` hook import { useState } from 'react' -import { msg } from '@lingui/macro' +import { msg } from '@lingui/core/macro' import { useLingui } from '@lingui/react' import { usePathname, useRouter } from 'next/navigation' @@ -49,4 +49,4 @@ export function Switcher() { })} ) -} +} \ No newline at end of file diff --git a/examples/nextjs-swc/yarn.lock b/examples/nextjs-swc/yarn.lock index 1d563ab0d..0357755dc 100644 --- a/examples/nextjs-swc/yarn.lock +++ b/examples/nextjs-swc/yarn.lock @@ -33,6 +33,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/code-frame@npm:7.25.7" + dependencies: + "@babel/highlight": ^7.25.7 + picocolors: ^1.0.0 + checksum: f235cdf9c5d6f172898a27949bd63731c5f201671f77bcf4c2ad97229bc462d89746c1a7f5671a132aecff5baf43f3d878b93a7ecc6aa71f9612d2b51270c53e + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.20.5": version: 7.21.0 resolution: "@babel/compat-data@npm:7.21.0" @@ -40,6 +50,36 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.25.7": + version: 7.25.8 + resolution: "@babel/compat-data@npm:7.25.8" + checksum: 7ac648b110ec0fcd3a3d3fc62c69c0325b536b3c97bafea8a4392dfc68d9ea9ab1f36d1b2f231d404473fc81f503b4a630425677fc9a3cce2ee33d74842ea109 + languageName: node + linkType: hard + +"@babel/core@npm:^7.20.12": + version: 7.25.8 + resolution: "@babel/core@npm:7.25.8" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/helper-compilation-targets": ^7.25.7 + "@babel/helper-module-transforms": ^7.25.7 + "@babel/helpers": ^7.25.7 + "@babel/parser": ^7.25.8 + "@babel/template": ^7.25.7 + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.8 + convert-source-map: ^2.0.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.3 + semver: ^6.3.1 + checksum: 77ddf693faf6997915e7bbe16e9f21ca1c0e58bc60ace9eac51c373b21d1b46ce50de650195c136a594b0e5fcb901ca17bb57c2d20bf175b3c325211138bcfde + languageName: node + linkType: hard + "@babel/core@npm:^7.21.0": version: 7.21.0 resolution: "@babel/core@npm:7.21.0" @@ -75,6 +115,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/generator@npm:7.25.7" + dependencies: + "@babel/types": ^7.25.7 + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.25 + jsesc: ^3.0.2 + checksum: f81cf9dc0191ae4411d82978114382ad6e047bfb678f9a95942bac5034a41719d88f047679f5e2f51ba7728b54ebd1cc32a10df7b556215d8a6ab9bdd4f11831 + languageName: node + linkType: hard + "@babel/helper-compilation-targets@npm:^7.20.7": version: 7.20.7 resolution: "@babel/helper-compilation-targets@npm:7.20.7" @@ -90,6 +142,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-compilation-targets@npm:7.25.7" + dependencies: + "@babel/compat-data": ^7.25.7 + "@babel/helper-validator-option": ^7.25.7 + browserslist: ^4.24.0 + lru-cache: ^5.1.1 + semver: ^6.3.1 + checksum: 5b57e7d4b9302c07510ad3318763c053c3d46f2d40a45c2ea0c59160ccf9061a34975ae62f36a32f15d8d03497ecd5ca43a96417c1fd83eb8c035e77a69840ef + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-environment-visitor@npm:7.18.9" @@ -125,6 +190,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-imports@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a7255755e9799978de4bf72563b94b53cf955e5fc3d2acc67c783d3b84d5d34dd41691e473ecc124a94654483fff573deacd87eccd8bd16b47ac4455b5941b30 + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.21.0": version: 7.21.2 resolution: "@babel/helper-module-transforms@npm:7.21.2" @@ -141,6 +216,20 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-transforms@npm:7.25.7" + dependencies: + "@babel/helper-module-imports": ^7.25.7 + "@babel/helper-simple-access": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + "@babel/traverse": ^7.25.7 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: b1daeded78243da969d90b105a564ed918dcded66fba5cd24fe09cb13f7ee9e84d9b9dee789d60237b9a674582d9831a35dbaf6f0a92a3af5f035234a5422814 + languageName: node + linkType: hard + "@babel/helper-simple-access@npm:^7.20.2": version: 7.20.2 resolution: "@babel/helper-simple-access@npm:7.20.2" @@ -150,6 +239,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-simple-access@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 684d0b0330c42d62834355f127df3ed78f16e6f1f66213c72adb7b3b0bcd6283ea8792f5b172868b3ca6518c479b54e18adac564219519072dda9053cca210bd + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-split-export-declaration@npm:7.18.6" @@ -166,6 +265,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-string-parser@npm:7.25.7" + checksum: 0835fda5efe02cdcb5144a939b639acc017ba4aa1cc80524b44032ddb714080d3e40e8f0d3240832b7bd86f5513f0b63d4fe77d8fc52d8c8720ae674182c0753 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.14.5": version: 7.14.5 resolution: "@babel/helper-validator-identifier@npm:7.14.5" @@ -180,6 +286,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-identifier@npm:7.25.7" + checksum: 062f55208deead4876eb474dc6fd55155c9eada8d0a505434de3b9aa06c34195562e0f3142b22a08793a38d740238efa2fe00ff42956cdcb8ac03f0b6c542247 + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.18.6": version: 7.21.0 resolution: "@babel/helper-validator-option@npm:7.21.0" @@ -187,6 +300,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-option@npm:7.25.7" + checksum: 87b801fe7d8337699f2fba5323243dd974ea214d27cf51faf2f0063da6dc5bb67c9bb7867fd337573870f9ab498d2788a75bcf9685442bd9430611c62b0195d1 + languageName: node + linkType: hard + "@babel/helpers@npm:^7.21.0": version: 7.21.0 resolution: "@babel/helpers@npm:7.21.0" @@ -198,6 +318,16 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helpers@npm:7.25.7" + dependencies: + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a73242850915ef2956097431fbab3a840b7d6298555ad4c6f596db7d1b43cf769181716e7b65f8f7015fe48748b9c454d3b9c6cf4506cb840b967654463b0819 + languageName: node + linkType: hard + "@babel/highlight@npm:^7.14.5": version: 7.14.5 resolution: "@babel/highlight@npm:7.14.5" @@ -220,6 +350,18 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/highlight@npm:7.25.7" + dependencies: + "@babel/helper-validator-identifier": ^7.25.7 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + picocolors: ^1.0.0 + checksum: b6aa45c5bf7ecc16b8204bbed90335706131ac6cacb0f1bfb1b862ada3741539c913b56c9d26beb56cece0c231ffab36f66aa36aac6b04b32669c314705203f2 + languageName: node + linkType: hard + "@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.0, @babel/parser@npm:^7.21.2": version: 7.21.2 resolution: "@babel/parser@npm:7.21.2" @@ -229,6 +371,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.0, @babel/parser@npm:^7.25.7, @babel/parser@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/parser@npm:7.25.8" + dependencies: + "@babel/types": ^7.25.8 + bin: + parser: ./bin/babel-parser.js + checksum: c33f6d26542f156927c5dbe131265c791177d271e582338e960f803903086ec5c152bf25deae5f4c061b7bee14dc0b5fd2882ccb5a21c16ee0738d24fcc0406e + languageName: node + linkType: hard + "@babel/runtime@npm:^7.12.5": version: 7.14.5 resolution: "@babel/runtime@npm:7.14.5" @@ -267,6 +420,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/template@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 83f025a4a777103965ee41b7c0fa2bb1c847ea7ed2b9f2cb258998ea96dfc580206176b532edf6d723d85237bc06fca26be5c8772e2af7d9e4fe6927e3bed8a3 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.21.0, @babel/traverse@npm:^7.21.2": version: 7.21.2 resolution: "@babel/traverse@npm:7.21.2" @@ -285,6 +449,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/traverse@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + debug: ^4.3.1 + globals: ^11.1.0 + checksum: 4d329b6e7a409a63f4815bbc0a08d0b0cb566c5a2fecd1767661fe1821ced213c554d7d74e6aca048672fed2c8f76071cb0d94f4bd5f120fba8d55a38af63094 + languageName: node + linkType: hard + "@babel/types@npm:^7.18.6, @babel/types@npm:^7.20.2, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.2": version: 7.21.2 resolution: "@babel/types@npm:7.21.2" @@ -296,6 +475,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.7, @babel/types@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/types@npm:7.25.8" + dependencies: + "@babel/helper-string-parser": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + to-fast-properties: ^2.0.0 + checksum: 93d84858e820dbfa0fc4882b3ba6a421544d224ee61455a58eed0af9fc3518b30dc2166b8ba48cdd2e91083c5885ed773c36acf46d177b7b1fad9c35b6eb7639 + languageName: node + linkType: hard + "@babel/types@npm:^7.8.3": version: 7.21.3 resolution: "@babel/types@npm:7.21.3" @@ -307,156 +497,163 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm64@npm:0.17.12" +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm@npm:0.17.12" +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-x64@npm:0.17.12" +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-arm64@npm:0.17.12" +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-x64@npm:0.17.12" +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-arm64@npm:0.17.12" +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-x64@npm:0.17.12" +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm64@npm:0.17.12" +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm@npm:0.17.12" +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ia32@npm:0.17.12" +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-loong64@npm:0.17.12" +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-mips64el@npm:0.17.12" +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ppc64@npm:0.17.12" +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-riscv64@npm:0.17.12" +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-s390x@npm:0.17.12" +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-x64@npm:0.17.12" +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/netbsd-x64@npm:0.17.12" +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/openbsd-x64@npm:0.17.12" +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/sunos-x64@npm:0.17.12" +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-arm64@npm:0.17.12" +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-ia32@npm:0.17.12" +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-x64@npm:0.17.12" +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -593,6 +790,17 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": ^1.2.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.24 + checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:3.1.0": version: 3.1.0 resolution: "@jridgewell/resolve-uri@npm:3.1.0" @@ -600,6 +808,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.2 + resolution: "@jridgewell/resolve-uri@npm:3.1.2" + checksum: 83b85f72c59d1c080b4cbec0fef84528963a1b5db34e4370fa4bd1e3ff64a0d80e0cee7369d11d73c704e0286fb2865b530acac7a871088fbe92b5edf1000870 + languageName: node + linkType: hard + "@jridgewell/set-array@npm:^1.0.0, @jridgewell/set-array@npm:^1.0.1": version: 1.1.2 resolution: "@jridgewell/set-array@npm:1.1.2" @@ -607,6 +822,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.10": version: 1.4.14 resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" @@ -614,6 +836,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.17 resolution: "@jridgewell/trace-mapping@npm:0.3.17" @@ -624,38 +853,68 @@ __metadata: languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.11.0": - version: 4.11.0 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.11.0" - checksum: d5cbd9952d2c7ada4e9601502ee090412f70a53f824724ce888efbcbbaeba1d8cdcabcc9e780a78abd567ad44249cb2dca453c084f9049e516f47f66c78c858d +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 9d3c40d225e139987b50c48988f8717a54a8c994d8a948ee42e1412e08988761d0754d7d10b803061cc3aebf35f92a5dbbab493bd0e1a9ef9e89a2130e83ba34 + languageName: node + linkType: hard + +"@lingui/babel-plugin-extract-messages@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-extract-messages@npm:5.0.0-next.3" + checksum: a0c7632295c4e07eab9b5754b0f3e2944a7b59dda8cbbdacb5ba5c500b7be9c73b44e114bd1323dc3a6fa4ff64657f7f6d9b8c981facd2c55c782577418f68d8 + languageName: node + linkType: hard + +"@lingui/babel-plugin-lingui-macro@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-lingui-macro@npm:5.0.0-next.3" + dependencies: + "@babel/core": ^7.20.12 + "@babel/runtime": ^7.20.13 + "@babel/types": ^7.20.7 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + peerDependencies: + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: ac7ebe134c4c324a1945de6cbc1f28c9d821233fa3d5228134034fde420e5f38f9c240cd090de6cae905dfe910496462c304e73d25ecf6a91e23afc3458c6248 languageName: node linkType: hard -"@lingui/cli@npm:4.11.0, @lingui/cli@npm:^4.11.0": - version: 4.11.0 - resolution: "@lingui/cli@npm:4.11.0" +"@lingui/cli@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/cli@npm:5.0.0-next.3" dependencies: "@babel/core": ^7.21.0 "@babel/generator": ^7.21.1 - "@babel/parser": ^7.21.2 + "@babel/parser": ^7.22.0 "@babel/runtime": ^7.21.0 "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.11.0 - "@lingui/conf": 4.11.0 - "@lingui/core": 4.11.0 - "@lingui/format-po": 4.11.0 - "@lingui/message-utils": 4.11.0 + "@lingui/babel-plugin-extract-messages": ^5.0.0-next.3 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/format-po": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 babel-plugin-macros: ^3.0.1 chalk: ^4.1.0 chokidar: 3.5.1 - cli-table: 0.3.6 + cli-table: ^0.3.11 commander: ^10.0.0 convert-source-map: ^2.0.0 date-fns: ^3.6.0 - esbuild: ^0.17.10 - glob: ^7.1.4 + esbuild: ^0.21.5 + glob: ^11.0.0 inquirer: ^7.3.3 - micromatch: 4.0.2 + micromatch: ^4.0.7 normalize-path: ^3.0.0 ora: ^5.1.0 pathe: ^1.1.0 @@ -666,13 +925,13 @@ __metadata: source-map: ^0.8.0-beta.0 bin: lingui: dist/lingui.js - checksum: ab5edeee88496a68287054e6fcbbe93dad3afe038cb8b1edb9538876b2a1b11412cb65caf89e8ebd120182147a10688740d3b07ae9269c3aedc1513d73922305 + checksum: eada44db8e4c16fa4de50e46cf98889d8b787cf5accfca3edbb8bad9e45f77054e54f2bfffcbbf64f35d2f8199d0349cde69f57a5da49f4b34deb509b065bfd9 languageName: node linkType: hard -"@lingui/conf@npm:4.11.0": - version: 4.11.0 - resolution: "@lingui/conf@npm:4.11.0" +"@lingui/conf@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/conf@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 chalk: ^4.1.0 @@ -680,87 +939,86 @@ __metadata: jest-validate: ^29.4.3 jiti: ^1.17.1 lodash.get: ^4.4.2 - checksum: 486e2dc91a3c0b30f3580028d5d210859454c165c614f73b92858e4339bc1d0d0a936c4b12a3b7f49ceb96a6e6014745bbbc81b313038aeb52ce31b53b6dddfc + checksum: c618ab075f96678fc1bb32326b5b0a2ff43e1ab3320b79493bf8f2525e2fa3fa85215d848eb7b4d2db816671c80c92c680868029c9fc34cceb9a3177fa9126ca languageName: node linkType: hard -"@lingui/core@npm:4.11.0, @lingui/core@npm:^4.11.0": - version: 4.11.0 - resolution: "@lingui/core@npm:4.11.0" +"@lingui/core@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/core@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/message-utils": 4.11.0 + "@lingui/message-utils": ^5.0.0-next.3 unraw: ^3.0.0 - checksum: 3200615b036b22c6f4176f508f230cd93221f6c35fee96c8ba60bf57de0fc7620d1038b127cc500974130ba6224199688e9c1f719150d7bac4c4ca3dac777543 + peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: 4544ed44b2bc16ac6c0bf957b470608ba5ae4f62035030e706f9347225cefd0f845872658af728e758118f04cd65c1e7c851ebf6e7d1d7a660d30bf8404883df languageName: node linkType: hard -"@lingui/format-po@npm:4.11.0": - version: 4.11.0 - resolution: "@lingui/format-po@npm:4.11.0" +"@lingui/format-po@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/format-po@npm:5.0.0-next.3" dependencies: - "@lingui/conf": 4.11.0 - "@lingui/message-utils": 4.11.0 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 date-fns: ^3.6.0 pofile: ^1.1.4 - checksum: d318abbdfb1edaf60b2142727794c0e474dfaa878793c6ba9823bed6939152e4d9b8508c3a3cc8d5b4b37d6f547747280f16c23abf2917cf00d8c3d522bb875d + checksum: c73b4e2c4b95e4475e5c676817dc0299e9b46e5bf05f5c9204cc8b99fe65770072464aecdd0c93d4ae4492f384905469258b2786b5d546164e904d97019c9165 languageName: node linkType: hard -"@lingui/loader@npm:^4.11.0": - version: 4.11.0 - resolution: "@lingui/loader@npm:4.11.0" +"@lingui/loader@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/loader@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/cli": 4.11.0 - "@lingui/conf": 4.11.0 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 peerDependencies: webpack: ^5.0.0 - checksum: 51ef4ed0f6bb815ea79af737951cac7917975786e83d3a3ee68ee30dd821cd38b11de0faf161a27d48033594b4a08631cb80476b61ec78b411e73dde6ab988c8 - languageName: node - linkType: hard - -"@lingui/macro@npm:^4.11.0": - version: 4.11.0 - resolution: "@lingui/macro@npm:4.11.0" - dependencies: - "@babel/runtime": ^7.20.13 - "@babel/types": ^7.20.7 - "@lingui/conf": 4.11.0 - "@lingui/core": 4.11.0 - "@lingui/message-utils": 4.11.0 - peerDependencies: - "@lingui/react": ^4.0.0 - babel-plugin-macros: 2 || 3 - checksum: 6c57d781504a3afd64ec5023d00675d5abe7ba437b961da3d79351f34d2124dd2d2440e89c10e96d28497a9460b6304cde8d77bb83f7166288520b002e198caa + checksum: 3dc90e0c0c83695fba9f2ff135e12fb63f26600b578182ecdeb6df0748461b619dc49bc4e9e4401b334aa1acdb2d0b0ecbdd08c2e2fc4366631978b6ef116146 languageName: node linkType: hard -"@lingui/message-utils@npm:4.11.0": - version: 4.11.0 - resolution: "@lingui/message-utils@npm:4.11.0" +"@lingui/message-utils@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/message-utils@npm:5.0.0-next.3" dependencies: "@messageformat/parser": ^5.0.0 js-sha256: ^0.10.1 - checksum: 27fe229a2b4a61ab7a13c2c34629b9bf9c89d9d13f1cc2dc614895dec6a5207a8680362df6376139da8d70dee8009800c3f4ba8408f9446ab2739520e955a415 + checksum: 9aad0d2ae0829231b6683d2681aeb1703d06093bfc9a65037e58d2051496c1efe92f8d72edda85695c53aff5c075e28b4601bf10ad76d0883d74e662e1cdb02d languageName: node linkType: hard -"@lingui/react@npm:^4.11.0": - version: 4.11.0 - resolution: "@lingui/react@npm:4.11.0" +"@lingui/react@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/react@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/core": 4.11.0 + "@lingui/core": ^5.0.0-next.3 peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 react: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 82833f4eb2e10481701aa38ea9369c8485ac6bf177a2dbfe46da3fdf083e22220cdea1dbb09974156d1395f5b49866c9d356f6b9e57a32f808a6f533654d8c1e + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: c02d01d11fe308718c7cb497811a3f4f7ee33ae0bbb217e1428ece9318d24d70c2649cb6dd4d430585fb8d8384e2f9e8ff7d1aa4cce0a1d2f49e23c28e3660dd languageName: node linkType: hard -"@lingui/swc-plugin@npm:4.0.7": - version: 4.0.7 - resolution: "@lingui/swc-plugin@npm:4.0.7" +"@lingui/swc-plugin@npm:^5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/swc-plugin@npm:5.0.0-next.2" peerDependencies: "@lingui/macro": 4 peerDependenciesMeta: @@ -768,7 +1026,7 @@ __metadata: optional: true next: optional: true - checksum: a63a0e0d0fda0f1c38eaa77d20f97d9d57c5cd91e8a22a872a1bedd270ca1b0fe63dc11633cb4015d44ffe8f911612bdcd35a1565bc55a7dbdbff45b58e5d6a5 + checksum: 4e5655f699577d22aa99099393d2e5bd7eaa94db011c1196d63c91cac5ea590796f1d1685aa19e2213195b55020350b9ac7d44a39051621da5e1a5cb3349bd74 languageName: node linkType: hard @@ -781,10 +1039,10 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:14.2.3": - version: 14.2.3 - resolution: "@next/env@npm:14.2.3" - checksum: 47ddb64ec6cdc13dfcf560ba42cce71d7948174bf800162738e20ba0147cc46a5f6fdde1eb7957a3676a9eca6dccf6603836ed7c755eab238d9f5c73614d9880 +"@next/env@npm:14.2.15": + version: 14.2.15 + resolution: "@next/env@npm:14.2.15" + checksum: bf794604ee62e86ca092120c790815c0caf367009966baa14e75dbd8454a59df524327539d5febc7da42841c3bf6a10443ae0f95280599352a8def56291857fd languageName: node linkType: hard @@ -797,65 +1055,65 @@ __metadata: languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-darwin-arm64@npm:14.2.3" +"@next/swc-darwin-arm64@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-darwin-arm64@npm:14.2.15" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-darwin-x64@npm:14.2.3" +"@next/swc-darwin-x64@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-darwin-x64@npm:14.2.15" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-arm64-gnu@npm:14.2.3" +"@next/swc-linux-arm64-gnu@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-arm64-gnu@npm:14.2.15" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-arm64-musl@npm:14.2.3" +"@next/swc-linux-arm64-musl@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-arm64-musl@npm:14.2.15" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-x64-gnu@npm:14.2.3" +"@next/swc-linux-x64-gnu@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-x64-gnu@npm:14.2.15" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-linux-x64-musl@npm:14.2.3" +"@next/swc-linux-x64-musl@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-linux-x64-musl@npm:14.2.15" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-win32-arm64-msvc@npm:14.2.3" +"@next/swc-win32-arm64-msvc@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-win32-arm64-msvc@npm:14.2.15" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-win32-ia32-msvc@npm:14.2.3" +"@next/swc-win32-ia32-msvc@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-win32-ia32-msvc@npm:14.2.15" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:14.2.3": - version: 14.2.3 - resolution: "@next/swc-win32-x64-msvc@npm:14.2.3" +"@next/swc-win32-x64-msvc@npm:14.2.15": + version: 14.2.15 + resolution: "@next/swc-win32-x64-msvc@npm:14.2.15" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -1530,6 +1788,15 @@ __metadata: languageName: node linkType: hard +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: ^7.1.1 + checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69 + languageName: node + linkType: hard + "browserslist@npm:^4.21.3": version: 4.21.5 resolution: "browserslist@npm:4.21.5" @@ -1544,6 +1811,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.24.0": + version: 4.24.0 + resolution: "browserslist@npm:4.24.0" + dependencies: + caniuse-lite: ^1.0.30001663 + electron-to-chromium: ^1.5.28 + node-releases: ^2.0.18 + update-browserslist-db: ^1.1.0 + bin: + browserslist: cli.js + checksum: de200d3eb8d6ed819dad99719099a28fb6ebeb88016a5ac42fbdc11607e910c236a84ca1b0bbf232477d4b88ab64e8ab6aa67557cdd40a73ca9c2834f92ccce0 + languageName: node + linkType: hard + "buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -1640,7 +1921,14 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^2.0.0": +"caniuse-lite@npm:^1.0.30001663": + version: 1.0.30001669 + resolution: "caniuse-lite@npm:1.0.30001669" + checksum: 8ed0c69d0c6aa3b1cbc5ba4e5f5330943e7b7165e257f6955b8b73f043d07ad922265261f2b54d9bbaf02886bbdba5e6f5b16662310a13f91f17035af3212de1 + languageName: node + linkType: hard + +"chalk@npm:^2.0.0, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -1717,12 +2005,12 @@ __metadata: languageName: node linkType: hard -"cli-table@npm:0.3.6": - version: 0.3.6 - resolution: "cli-table@npm:0.3.6" +"cli-table@npm:^0.3.11": + version: 0.3.11 + resolution: "cli-table@npm:0.3.11" dependencies: colors: 1.0.3 - checksum: b0cd08578c810240920438cc2b3ffb4b4f5106b29f3362707f1d8cfc0c0440ad2afb70b96e30ce37f72f0ffe1e844ae7341dde4df17d51ad345eb186a5903af2 + checksum: 59fb61f992ac9bc8610ed98c72bf7f5d396c5afb42926b6747b46b0f8bb98a0dfa097998e77542ac334c1eb7c18dbf4f104d5783493273c5ec4c34084aa7c663 languageName: node linkType: hard @@ -2072,6 +2360,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.28": + version: 1.5.39 + resolution: "electron-to-chromium@npm:1.5.39" + checksum: cd3b644c20f30fc1c393168bafa0e42a3dde576129603266ab61248b76a36837084073895a845676f8fe90dbb31d385bbef53901b60381f3ae82b40a5bece352 + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -2321,33 +2616,36 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.17.10": - version: 0.17.12 - resolution: "esbuild@npm:0.17.12" - dependencies: - "@esbuild/android-arm": 0.17.12 - "@esbuild/android-arm64": 0.17.12 - "@esbuild/android-x64": 0.17.12 - "@esbuild/darwin-arm64": 0.17.12 - "@esbuild/darwin-x64": 0.17.12 - "@esbuild/freebsd-arm64": 0.17.12 - "@esbuild/freebsd-x64": 0.17.12 - "@esbuild/linux-arm": 0.17.12 - "@esbuild/linux-arm64": 0.17.12 - "@esbuild/linux-ia32": 0.17.12 - "@esbuild/linux-loong64": 0.17.12 - "@esbuild/linux-mips64el": 0.17.12 - "@esbuild/linux-ppc64": 0.17.12 - "@esbuild/linux-riscv64": 0.17.12 - "@esbuild/linux-s390x": 0.17.12 - "@esbuild/linux-x64": 0.17.12 - "@esbuild/netbsd-x64": 0.17.12 - "@esbuild/openbsd-x64": 0.17.12 - "@esbuild/sunos-x64": 0.17.12 - "@esbuild/win32-arm64": 0.17.12 - "@esbuild/win32-ia32": 0.17.12 - "@esbuild/win32-x64": 0.17.12 +"esbuild@npm:^0.21.5": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": 0.21.5 + "@esbuild/android-arm": 0.21.5 + "@esbuild/android-arm64": 0.21.5 + "@esbuild/android-x64": 0.21.5 + "@esbuild/darwin-arm64": 0.21.5 + "@esbuild/darwin-x64": 0.21.5 + "@esbuild/freebsd-arm64": 0.21.5 + "@esbuild/freebsd-x64": 0.21.5 + "@esbuild/linux-arm": 0.21.5 + "@esbuild/linux-arm64": 0.21.5 + "@esbuild/linux-ia32": 0.21.5 + "@esbuild/linux-loong64": 0.21.5 + "@esbuild/linux-mips64el": 0.21.5 + "@esbuild/linux-ppc64": 0.21.5 + "@esbuild/linux-riscv64": 0.21.5 + "@esbuild/linux-s390x": 0.21.5 + "@esbuild/linux-x64": 0.21.5 + "@esbuild/netbsd-x64": 0.21.5 + "@esbuild/openbsd-x64": 0.21.5 + "@esbuild/sunos-x64": 0.21.5 + "@esbuild/win32-arm64": 0.21.5 + "@esbuild/win32-ia32": 0.21.5 + "@esbuild/win32-x64": 0.21.5 dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true "@esbuild/android-arm": optional: true "@esbuild/android-arm64": @@ -2394,7 +2692,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: ea6d33eb1bc6c9e00dcee5e253c7e935251b4801d376661fd9f19a9dcffc27f970078a6f7116d6c78ee825ceff9b974594b0b616bd560ce4d875a951aa92977b + checksum: 2911c7b50b23a9df59a7d6d4cdd3a4f85855787f374dce751148dbb13305e0ce7e880dde1608c2ab7a927fc6cec3587b80995f7fc87a64b455f8b70b55fd8ec1 languageName: node linkType: hard @@ -2405,6 +2703,13 @@ __metadata: languageName: node linkType: hard +"escalade@npm:^3.2.0": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 47b029c83de01b0d17ad99ed766347b974b0d628e848de404018f3abee728e987da0d2d370ad4574aa3d5b5bfc368754fd085d69a30f8e75903486ec4b5b709e + languageName: node + linkType: hard + "escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" @@ -2786,6 +3091,15 @@ __metadata: languageName: node linkType: hard +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: ^5.0.1 + checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798 + languageName: node + linkType: hard + "find-up@npm:^3.0.0": version: 3.0.0 resolution: "find-up@npm:3.0.0" @@ -3042,6 +3356,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.0": + version: 11.0.0 + resolution: "glob@npm:11.0.0" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^4.0.1 + minimatch: ^10.0.0 + minipass: ^7.1.2 + package-json-from-dist: ^1.0.0 + path-scurry: ^2.0.0 + bin: + glob: dist/esm/bin.mjs + checksum: 8a2dd914d5776987be5244624d9491bbcaf19f2387e06783737003ff696ebfd2264190c47014f8709c1c02d8bc892f17660cf986c587b107e194c0a3151ab333 + languageName: node + linkType: hard + "glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.1.7 resolution: "glob@npm:7.1.7" @@ -3798,6 +4128,15 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.0.1": + version: 4.0.2 + resolution: "jackspeak@npm:4.0.2" + dependencies: + "@isaacs/cliui": ^8.0.2 + checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 + languageName: node + linkType: hard + "jest-get-type@npm:^29.4.3": version: 29.4.3 resolution: "jest-get-type@npm:29.4.3" @@ -3862,6 +4201,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: a36d3ca40574a974d9c2063bf68c2b6141c20da8f2a36bd3279fc802563f35f0527a6c828801295bdfb2803952cf2cf387786c2c90ed564f88d5782475abfe3c + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -3894,7 +4242,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.2": +"json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -4040,6 +4388,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.0.1 + resolution: "lru-cache@npm:11.0.1" + checksum: 6056230a99fb399234e82368b99586bd4740079e80649102f681b19337b7d8c6bc8dd7f8b8c59377c31d26deb89f548b717ae932e139b4b795879d920fccf820 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -4096,16 +4451,6 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.2": - version: 4.0.2 - resolution: "micromatch@npm:4.0.2" - dependencies: - braces: ^3.0.1 - picomatch: ^2.0.5 - checksum: 39590a96d9ffad21f0afac044d0a5af4f33715a16fdd82c53a01c8f5ff6f70832a31b53e52972dac3deff8bf9f0bed0207d1c34e54ab3306a5e4c4efd5f7d249 - languageName: node - linkType: hard - "micromatch@npm:^4.0.4": version: 4.0.4 resolution: "micromatch@npm:4.0.4" @@ -4116,6 +4461,16 @@ __metadata: languageName: node linkType: hard +"micromatch@npm:^4.0.7": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" + dependencies: + braces: ^3.0.3 + picomatch: ^2.3.1 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 + languageName: node + linkType: hard + "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -4132,6 +4487,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.0.0": + version: 10.0.1 + resolution: "minimatch@npm:10.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: f5b63c2f30606091a057c5f679b067f84a2cd0ffbd2dbc9143bda850afd353c7be81949ff11ae0c86988f07390eeca64efd7143ee05a0dab37f6c6b38a2ebb6c + languageName: node + linkType: hard + "minimatch@npm:^3.0.4": version: 3.0.4 resolution: "minimatch@npm:3.0.4" @@ -4249,7 +4613,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0": +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.1.2": version: 7.1.2 resolution: "minipass@npm:7.1.2" checksum: 2bfd325b95c555f2b4d2814d49325691c7bee937d753814861b0b49d5edcda55cbbf22b6b6a60bb91eddac8668771f03c5ff647dcd9d0f798e9548b9cdc46ee3 @@ -4326,20 +4690,20 @@ __metadata: languageName: node linkType: hard -"next@npm:^14.2.3": - version: 14.2.3 - resolution: "next@npm:14.2.3" - dependencies: - "@next/env": 14.2.3 - "@next/swc-darwin-arm64": 14.2.3 - "@next/swc-darwin-x64": 14.2.3 - "@next/swc-linux-arm64-gnu": 14.2.3 - "@next/swc-linux-arm64-musl": 14.2.3 - "@next/swc-linux-x64-gnu": 14.2.3 - "@next/swc-linux-x64-musl": 14.2.3 - "@next/swc-win32-arm64-msvc": 14.2.3 - "@next/swc-win32-ia32-msvc": 14.2.3 - "@next/swc-win32-x64-msvc": 14.2.3 +"next@npm:^14.2.15": + version: 14.2.15 + resolution: "next@npm:14.2.15" + dependencies: + "@next/env": 14.2.15 + "@next/swc-darwin-arm64": 14.2.15 + "@next/swc-darwin-x64": 14.2.15 + "@next/swc-linux-arm64-gnu": 14.2.15 + "@next/swc-linux-arm64-musl": 14.2.15 + "@next/swc-linux-x64-gnu": 14.2.15 + "@next/swc-linux-x64-musl": 14.2.15 + "@next/swc-win32-arm64-msvc": 14.2.15 + "@next/swc-win32-ia32-msvc": 14.2.15 + "@next/swc-win32-x64-msvc": 14.2.15 "@swc/helpers": 0.5.5 busboy: 1.6.0 caniuse-lite: ^1.0.30001579 @@ -4380,7 +4744,7 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: d34ea63adf23fe46efebe2a9c536c9127c0ee006d74c60d6d23aecbef650798c976b27c17910ca585f3bb1223b10924cb429b9ce930f3074aee1170d1519dccc + checksum: bed22817ea82c679e78c1f1e6530991ae89f3c51d547a876dddcda4a3b34cbb970af7c714793e1a1f0a1974859ccc97e10b5aceb61e9807ea94318116e8e7dd6 languageName: node linkType: hard @@ -4388,19 +4752,18 @@ __metadata: version: 0.0.0-use.local resolution: "nextjs-swc-example@workspace:." dependencies: - "@lingui/cli": ^4.11.0 - "@lingui/core": ^4.11.0 - "@lingui/loader": ^4.11.0 - "@lingui/macro": ^4.11.0 - "@lingui/react": ^4.11.0 - "@lingui/swc-plugin": 4.0.7 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/loader": ^5.0.0-next.3 + "@lingui/react": ^5.0.0-next.3 + "@lingui/swc-plugin": ^5.0.0-next.2 "@types/negotiator": ^0.6.3 "@types/react": ^18.3.3 "@types/react-dom": ^18.3.0 eslint: ^8.57.0 eslint-config-next: ^14.2.3 negotiator: ^0.6.3 - next: ^14.2.3 + next: ^14.2.15 react: 18.2.0 react-dom: 18.2.0 typescript: ^5.4.5 @@ -4427,6 +4790,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^2.0.18": + version: 2.0.18 + resolution: "node-releases@npm:2.0.18" + checksum: ef55a3d853e1269a6d6279b7692cd6ff3e40bc74947945101138745bfdc9a5edabfe72cb19a31a8e45752e1910c4c65c77d931866af6357f242b172b7283f5b3 + languageName: node + linkType: hard + "node-releases@npm:^2.0.8": version: 2.0.10 resolution: "node-releases@npm:2.0.10" @@ -4699,6 +5069,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -4765,6 +5142,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.0 + resolution: "path-scurry@npm:2.0.0" + dependencies: + lru-cache: ^11.0.0 + minipass: ^7.1.2 + checksum: 9953ce3857f7e0796b187a7066eede63864b7e1dfc14bf0484249801a5ab9afb90d9a58fc533ebb1b552d23767df8aa6a2c6c62caf3f8a65f6ce336a97bbb484 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -4786,13 +5173,27 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3": +"picocolors@npm:^1.1.0": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: a64d653d3a188119ff45781dfcdaeedd7625583f45280aea33fcb032c7a0d3959f2368f9b192ad5e8aade75b74dbd954ffe3106c158509a45e4c18ab379a2acd + languageName: node + linkType: hard + +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3": version: 2.3.0 resolution: "picomatch@npm:2.3.0" checksum: 16818720ea7c5872b6af110760dee856c8e4cd79aed1c7a006d076b1cc09eff3ae41ca5019966694c33fbd2e1cc6ea617ab10e4adac6df06556168f13be3fca2 languageName: node linkType: hard +"picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf + languageName: node + linkType: hard + "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -5869,6 +6270,20 @@ __metadata: languageName: node linkType: hard +"update-browserslist-db@npm:^1.1.0": + version: 1.1.1 + resolution: "update-browserslist-db@npm:1.1.1" + dependencies: + escalade: ^3.2.0 + picocolors: ^1.1.0 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 2ea11bd2562122162c3e438d83a1f9125238c0844b6d16d366e3276d0c0acac6036822dc7df65fc5a89c699cdf9f174acf439c39bedf3f9a2f3983976e4b4c3e + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" diff --git a/examples/react-native/babel.config.js b/examples/react-native/babel.config.js index fb0e6f1ab..3c30295ba 100644 --- a/examples/react-native/babel.config.js +++ b/examples/react-native/babel.config.js @@ -1,7 +1,7 @@ module.exports = function (api) { api.cache(false); return { - plugins: ["macros"], + plugins: ["@lingui/babel-plugin-lingui-macro"], presets: ["babel-preset-expo"], }; }; diff --git a/examples/react-native/package.json b/examples/react-native/package.json index 819299453..5bdbbc5a6 100644 --- a/examples/react-native/package.json +++ b/examples/react-native/package.json @@ -16,8 +16,8 @@ "dependencies": { "@formatjs/intl-locale": "^4.0.2", "@formatjs/intl-pluralrules": "^5.2.16", - "@lingui/core": "^4.12.0", - "@lingui/react": "^4.12.0", + "@lingui/core": "^5.0.0-next.3", + "@lingui/react": "^5.0.0-next.3", "expo": "~51.0.37", "expo-status-bar": "~1.12.1", "expo-updates": "~0.25.27", @@ -27,13 +27,13 @@ }, "devDependencies": { "@babel/core": "^7.24.0", - "@lingui/cli": "^4.12.0", - "@lingui/macro": "^4.12.0", - "@lingui/metro-transformer": "^4.12.0", + "@lingui/babel-plugin-lingui-macro": "^5.0.0-next.3", + "@lingui/cli": "^5.0.0-next.3", + "@lingui/macro": "^5.0.0-next.3", + "@lingui/metro-transformer": "^5.0.0-next.3", "@react-native-community/eslint-config": "^3.2.0", "@types/react": "~18.2.79", "@typescript-eslint/eslint-plugin": "^5.59.11", - "babel-plugin-macros": "^3.1.0", "eslint": "^8.42.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-ft-flow": "^2.0.3", diff --git a/examples/react-native/src/MainScreen.tsx b/examples/react-native/src/MainScreen.tsx index aa699a3c1..d842445e4 100644 --- a/examples/react-native/src/MainScreen.tsx +++ b/examples/react-native/src/MainScreen.tsx @@ -1,13 +1,13 @@ import React, { useState } from "react"; import { StyleSheet, Text, View, Alert, SafeAreaView } from "react-native"; -import { Plural, SelectOrdinal, t, Trans } from "@lingui/macro"; -import { useLingui } from "@lingui/react"; +import { Plural, SelectOrdinal, Trans } from "@lingui/react/macro"; +import { useLingui } from "@lingui/react/macro"; import { Button } from "./PaddedButton"; import { Heading } from "./Components"; export const Body = React.memo(() => { const [messages, setMessages] = useState([]); - const { i18n } = useLingui(); + const { i18n, t } = useLingui(); const markAllAsRead = () => { // NOTE - here we're implicitly using the i18n instance that does NOT come from the React context, but from @lingui/core @@ -65,6 +65,8 @@ const Inbox = ({ markAsRead: () => void; addMessage: () => void; }) => { + const { t } = useLingui(); + const messagesCount = messages.length; return ( diff --git a/examples/react-native/yarn.lock b/examples/react-native/yarn.lock index 1c7319312..2ee266661 100644 --- a/examples/react-native/yarn.lock +++ b/examples/react-native/yarn.lock @@ -64,6 +64,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/code-frame@npm:7.25.7" + dependencies: + "@babel/highlight": ^7.25.7 + picocolors: ^1.0.0 + checksum: f235cdf9c5d6f172898a27949bd63731c5f201671f77bcf4c2ad97229bc462d89746c1a7f5671a132aecff5baf43f3d878b93a7ecc6aa71f9612d2b51270c53e + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.17.7, @babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.21.4": version: 7.21.4 resolution: "@babel/compat-data@npm:7.21.4" @@ -85,6 +95,13 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.25.7": + version: 7.25.8 + resolution: "@babel/compat-data@npm:7.25.8" + checksum: 7ac648b110ec0fcd3a3d3fc62c69c0325b536b3c97bafea8a4392dfc68d9ea9ab1f36d1b2f231d404473fc81f503b4a630425677fc9a3cce2ee33d74842ea109 + languageName: node + linkType: hard + "@babel/core@npm:^7.13.16, @babel/core@npm:^7.20.0, @babel/core@npm:^7.21.0": version: 7.21.4 resolution: "@babel/core@npm:7.21.4" @@ -131,6 +148,29 @@ __metadata: languageName: node linkType: hard +"@babel/core@npm:^7.20.12": + version: 7.25.8 + resolution: "@babel/core@npm:7.25.8" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/helper-compilation-targets": ^7.25.7 + "@babel/helper-module-transforms": ^7.25.7 + "@babel/helpers": ^7.25.7 + "@babel/parser": ^7.25.8 + "@babel/template": ^7.25.7 + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.8 + convert-source-map: ^2.0.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.3 + semver: ^6.3.1 + checksum: 77ddf693faf6997915e7bbe16e9f21ca1c0e58bc60ace9eac51c373b21d1b46ce50de650195c136a594b0e5fcb901ca17bb57c2d20bf175b3c325211138bcfde + languageName: node + linkType: hard + "@babel/core@npm:^7.24.0": version: 7.25.2 resolution: "@babel/core@npm:7.25.2" @@ -229,6 +269,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/generator@npm:7.25.7" + dependencies: + "@babel/types": ^7.25.7 + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.25 + jsesc: ^3.0.2 + checksum: f81cf9dc0191ae4411d82978114382ad6e047bfb678f9a95942bac5034a41719d88f047679f5e2f51ba7728b54ebd1cc32a10df7b556215d8a6ab9bdd4f11831 + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-annotate-as-pure@npm:7.18.6" @@ -299,6 +351,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-compilation-targets@npm:7.25.7" + dependencies: + "@babel/compat-data": ^7.25.7 + "@babel/helper-validator-option": ^7.25.7 + browserslist: ^4.24.0 + lru-cache: ^5.1.1 + semver: ^6.3.1 + checksum: 5b57e7d4b9302c07510ad3318763c053c3d46f2d40a45c2ea0c59160ccf9061a34975ae62f36a32f15d8d03497ecd5ca43a96417c1fd83eb8c035e77a69840ef + languageName: node + linkType: hard + "@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0": version: 7.21.4 resolution: "@babel/helper-create-class-features-plugin@npm:7.21.4" @@ -461,6 +526,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-imports@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a7255755e9799978de4bf72563b94b53cf955e5fc3d2acc67c783d3b84d5d34dd41691e473ecc124a94654483fff573deacd87eccd8bd16b47ac4455b5941b30 + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.21.2": version: 7.21.2 resolution: "@babel/helper-module-transforms@npm:7.21.2" @@ -507,6 +582,20 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-transforms@npm:7.25.7" + dependencies: + "@babel/helper-module-imports": ^7.25.7 + "@babel/helper-simple-access": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + "@babel/traverse": ^7.25.7 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: b1daeded78243da969d90b105a564ed918dcded66fba5cd24fe09cb13f7ee9e84d9b9dee789d60237b9a674582d9831a35dbaf6f0a92a3af5f035234a5422814 + languageName: node + linkType: hard + "@babel/helper-optimise-call-expression@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-optimise-call-expression@npm:7.18.6" @@ -629,6 +718,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-simple-access@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 684d0b0330c42d62834355f127df3ed78f16e6f1f66213c72adb7b3b0bcd6283ea8792f5b172868b3ca6518c479b54e18adac564219519072dda9053cca210bd + languageName: node + linkType: hard + "@babel/helper-skip-transparent-expression-wrappers@npm:^7.20.0": version: 7.20.0 resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.20.0" @@ -750,6 +849,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-option@npm:7.25.7" + checksum: 87b801fe7d8337699f2fba5323243dd974ea214d27cf51faf2f0063da6dc5bb67c9bb7867fd337573870f9ab498d2788a75bcf9685442bd9430611c62b0195d1 + languageName: node + linkType: hard + "@babel/helper-wrap-function@npm:^7.18.9": version: 7.20.5 resolution: "@babel/helper-wrap-function@npm:7.20.5" @@ -806,6 +912,16 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helpers@npm:7.25.7" + dependencies: + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a73242850915ef2956097431fbab3a840b7d6298555ad4c6f596db7d1b43cf769181716e7b65f8f7015fe48748b9c454d3b9c6cf4506cb840b967654463b0819 + languageName: node + linkType: hard + "@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.18.6": version: 7.18.6 resolution: "@babel/highlight@npm:7.18.6" @@ -840,6 +956,18 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/highlight@npm:7.25.7" + dependencies: + "@babel/helper-validator-identifier": ^7.25.7 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + picocolors: ^1.0.0 + checksum: b6aa45c5bf7ecc16b8204bbed90335706131ac6cacb0f1bfb1b862ada3741539c913b56c9d26beb56cece0c231ffab36f66aa36aac6b04b32669c314705203f2 + languageName: node + linkType: hard + "@babel/parser@npm:^7.13.16, @babel/parser@npm:^7.20.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.4": version: 7.21.4 resolution: "@babel/parser@npm:7.21.4" @@ -849,16 +977,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.21.2": - version: 7.21.8 - resolution: "@babel/parser@npm:7.21.8" - bin: - parser: ./bin/babel-parser.js - checksum: 1b9a820fedfb6ef179e6ffa1dbc080808882949dec68340a616da2aa354af66ea2886bd68e61bd444d270aa0b24ad6273e3cfaf17d6878c34bf2521becacb353 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.22.0": +"@babel/parser@npm:^7.22.0, @babel/parser@npm:^7.25.7, @babel/parser@npm:^7.25.8": version: 7.25.8 resolution: "@babel/parser@npm:7.25.8" dependencies: @@ -1782,6 +1901,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/template@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 83f025a4a777103965ee41b7c0fa2bb1c847ea7ed2b9f2cb258998ea96dfc580206176b532edf6d723d85237bc06fca26be5c8772e2af7d9e4fe6927e3bed8a3 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.20.0, @babel/traverse@npm:^7.20.5, @babel/traverse@npm:^7.20.7, @babel/traverse@npm:^7.21.0, @babel/traverse@npm:^7.21.2, @babel/traverse@npm:^7.21.4": version: 7.21.4 resolution: "@babel/traverse@npm:7.21.4" @@ -1833,6 +1963,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/traverse@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + debug: ^4.3.1 + globals: ^11.1.0 + checksum: 4d329b6e7a409a63f4815bbc0a08d0b0cb566c5a2fecd1767661fe1821ced213c554d7d74e6aca048672fed2c8f76071cb0d94f4bd5f120fba8d55a38af63094 + languageName: node + linkType: hard + "@babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.20.0, @babel/types@npm:^7.20.2, @babel/types@npm:^7.20.5, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.2, @babel/types@npm:^7.21.4": version: 7.21.4 resolution: "@babel/types@npm:7.21.4" @@ -1844,7 +1989,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.19.0, @babel/types@npm:^7.2.0, @babel/types@npm:^7.25.8": +"@babel/types@npm:^7.19.0, @babel/types@npm:^7.2.0, @babel/types@npm:^7.25.7, @babel/types@npm:^7.25.8": version: 7.25.8 resolution: "@babel/types@npm:7.25.8" dependencies: @@ -1888,156 +2033,163 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/android-arm64@npm:0.17.18" +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/android-arm@npm:0.17.18" +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/android-x64@npm:0.17.18" +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/darwin-arm64@npm:0.17.18" +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/darwin-x64@npm:0.17.18" +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/freebsd-arm64@npm:0.17.18" +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/freebsd-x64@npm:0.17.18" +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-arm64@npm:0.17.18" +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-arm@npm:0.17.18" +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-ia32@npm:0.17.18" +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-loong64@npm:0.17.18" +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-mips64el@npm:0.17.18" +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-ppc64@npm:0.17.18" +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-riscv64@npm:0.17.18" +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-s390x@npm:0.17.18" +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/linux-x64@npm:0.17.18" +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/netbsd-x64@npm:0.17.18" +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/openbsd-x64@npm:0.17.18" +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/sunos-x64@npm:0.17.18" +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/win32-arm64@npm:0.17.18" +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/win32-ia32@npm:0.17.18" +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.17.18": - version: 0.17.18 - resolution: "@esbuild/win32-x64@npm:0.17.18" +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -2873,73 +3025,47 @@ __metadata: languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.11.2": - version: 4.11.2 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.11.2" - checksum: 7b3be3815cf1a5d717b4d777ef7238f0aa69d6145aaf60311f31ba7fe4da1359d7ad1d46a35203031a2a7a72e61e340872ca73cb071ebd9d7ade39728efdb2bd +"@lingui/babel-plugin-extract-messages@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-extract-messages@npm:5.0.0-next.3" + checksum: a0c7632295c4e07eab9b5754b0f3e2944a7b59dda8cbbdacb5ba5c500b7be9c73b44e114bd1323dc3a6fa4ff64657f7f6d9b8c981facd2c55c782577418f68d8 languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.12.0": - version: 4.12.0 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.12.0" - checksum: de5385390d9fbe4fa02d9d1d21a973413b885a43b41c1b0b02ccbba17d99eaad339beedf3de73f95dd6cde94544f8e69814e87aadca70491c65856280519efc3 - languageName: node - linkType: hard - -"@lingui/cli@npm:4.11.2": - version: 4.11.2 - resolution: "@lingui/cli@npm:4.11.2" +"@lingui/babel-plugin-lingui-macro@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-lingui-macro@npm:5.0.0-next.3" dependencies: - "@babel/core": ^7.21.0 - "@babel/generator": ^7.21.1 - "@babel/parser": ^7.21.2 - "@babel/runtime": ^7.21.0 - "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.11.2 - "@lingui/conf": 4.11.2 - "@lingui/core": 4.11.2 - "@lingui/format-po": 4.11.2 - "@lingui/message-utils": 4.11.2 - babel-plugin-macros: ^3.0.1 - chalk: ^4.1.0 - chokidar: 3.5.1 - cli-table: 0.3.6 - commander: ^10.0.0 - convert-source-map: ^2.0.0 - date-fns: ^3.6.0 - esbuild: ^0.17.10 - glob: ^7.1.4 - inquirer: ^7.3.3 - micromatch: 4.0.2 - normalize-path: ^3.0.0 - ora: ^5.1.0 - pathe: ^1.1.0 - pkg-up: ^3.1.0 - pofile: ^1.1.4 - pseudolocale: ^2.0.0 - ramda: ^0.27.1 - source-map: ^0.8.0-beta.0 - bin: - lingui: dist/lingui.js - checksum: 99a90f86646df3438a64be2087b3865a31284a5805b2e8d49823de892090966386d04569dd8dda701bbaecd9bc82a072ffc053afbbdd4153a3d797f5efb11436 + "@babel/core": ^7.20.12 + "@babel/runtime": ^7.20.13 + "@babel/types": ^7.20.7 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + peerDependencies: + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: ac7ebe134c4c324a1945de6cbc1f28c9d821233fa3d5228134034fde420e5f38f9c240cd090de6cae905dfe910496462c304e73d25ecf6a91e23afc3458c6248 languageName: node linkType: hard -"@lingui/cli@npm:^4.12.0": - version: 4.12.0 - resolution: "@lingui/cli@npm:4.12.0" +"@lingui/cli@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/cli@npm:5.0.0-next.3" dependencies: "@babel/core": ^7.21.0 "@babel/generator": ^7.21.1 "@babel/parser": ^7.22.0 "@babel/runtime": ^7.21.0 "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.12.0 - "@lingui/conf": 4.12.0 - "@lingui/core": 4.12.0 - "@lingui/format-po": 4.12.0 - "@lingui/message-utils": 4.12.0 + "@lingui/babel-plugin-extract-messages": ^5.0.0-next.3 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/format-po": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 babel-plugin-macros: ^3.0.1 chalk: ^4.1.0 chokidar: 3.5.1 @@ -2947,10 +3073,10 @@ __metadata: commander: ^10.0.0 convert-source-map: ^2.0.0 date-fns: ^3.6.0 - esbuild: ^0.17.10 - glob: ^7.1.4 + esbuild: ^0.21.5 + glob: ^11.0.0 inquirer: ^7.3.3 - micromatch: ^4.0.2 + micromatch: ^4.0.7 normalize-path: ^3.0.0 ora: ^5.1.0 pathe: ^1.1.0 @@ -2961,27 +3087,13 @@ __metadata: source-map: ^0.8.0-beta.0 bin: lingui: dist/lingui.js - checksum: bd27814e97d9cb50f3604644299d87f6b743cab1772fd0de60e4408e882a6ce5410969f59bd088f245c405333f3a530786400747e4401f8021f2ced0bc19d4af - languageName: node - linkType: hard - -"@lingui/conf@npm:4.11.2": - version: 4.11.2 - resolution: "@lingui/conf@npm:4.11.2" - dependencies: - "@babel/runtime": ^7.20.13 - chalk: ^4.1.0 - cosmiconfig: ^8.0.0 - jest-validate: ^29.4.3 - jiti: ^1.17.1 - lodash.get: ^4.4.2 - checksum: 16cd06773a6a97dc99fdd7742ec02392defa058e07a0892ce2b9425a9a30720eef87acfa740b6e41bf9c345d21489f311d6e1f060e745d53f00738d151e89862 + checksum: eada44db8e4c16fa4de50e46cf98889d8b787cf5accfca3edbb8bad9e45f77054e54f2bfffcbbf64f35d2f8199d0349cde69f57a5da49f4b34deb509b065bfd9 languageName: node linkType: hard -"@lingui/conf@npm:4.12.0": - version: 4.12.0 - resolution: "@lingui/conf@npm:4.12.0" +"@lingui/conf@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/conf@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 chalk: ^4.1.0 @@ -2989,99 +3101,76 @@ __metadata: jest-validate: ^29.4.3 jiti: ^1.17.1 lodash.get: ^4.4.2 - checksum: 88e0b383a9c9bfa0b7c2efaac747f1c72f52a2c2750bc47a2a887a07f9bef6ece80dafdeba7beccc6c13c9218edbfc02e0ef119bbca1f5842dec4f32b5c71a90 + checksum: c618ab075f96678fc1bb32326b5b0a2ff43e1ab3320b79493bf8f2525e2fa3fa85215d848eb7b4d2db816671c80c92c680868029c9fc34cceb9a3177fa9126ca languageName: node linkType: hard -"@lingui/core@npm:4.11.2": - version: 4.11.2 - resolution: "@lingui/core@npm:4.11.2" +"@lingui/core@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/core@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/message-utils": 4.11.2 + "@lingui/message-utils": ^5.0.0-next.3 unraw: ^3.0.0 - checksum: 10e77a8486dd8ae9ab3a687276a626d568f6b65b57a3071f9ee18c31989133a0a429eec28c0254e48a36fa77ff775f9b6dfa945df6767f2fc91782c10582d3ca - languageName: node - linkType: hard - -"@lingui/core@npm:4.12.0, @lingui/core@npm:^4.12.0": - version: 4.12.0 - resolution: "@lingui/core@npm:4.12.0" - dependencies: - "@babel/runtime": ^7.20.13 - "@lingui/message-utils": 4.12.0 - unraw: ^3.0.0 - checksum: ee529d0d62c130f0dafa908b672bfd95af61dc3c8d7a018f15524546472cd47f665ad5f4b26f296d51e4f8b00a8f790d804d85000c9eacbe77ca022b9e081e06 - languageName: node - linkType: hard - -"@lingui/format-po@npm:4.11.2": - version: 4.11.2 - resolution: "@lingui/format-po@npm:4.11.2" - dependencies: - "@lingui/conf": 4.11.2 - "@lingui/message-utils": 4.11.2 - date-fns: ^3.6.0 - pofile: ^1.1.4 - checksum: 89af5d48bac0170d0b8658c170ae0342b27519fd623b41abad41139a3105079360a4e937607b96f531ae1394f7a3d55b4186f50e7935c2bdc2539bdaad3ae58a + peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: 4544ed44b2bc16ac6c0bf957b470608ba5ae4f62035030e706f9347225cefd0f845872658af728e758118f04cd65c1e7c851ebf6e7d1d7a660d30bf8404883df languageName: node linkType: hard -"@lingui/format-po@npm:4.12.0": - version: 4.12.0 - resolution: "@lingui/format-po@npm:4.12.0" +"@lingui/format-po@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/format-po@npm:5.0.0-next.3" dependencies: - "@lingui/conf": 4.12.0 - "@lingui/message-utils": 4.12.0 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 date-fns: ^3.6.0 pofile: ^1.1.4 - checksum: 2466e916a144b44353f0a0cdf1dda0e52f6d4d54421daa11de6097c9880bb4bc756937bad3b01fdeb0ff9a756a9adfe8df675c4f8a259dc20b754f333f8ac2be + checksum: c73b4e2c4b95e4475e5c676817dc0299e9b46e5bf05f5c9204cc8b99fe65770072464aecdd0c93d4ae4492f384905469258b2786b5d546164e904d97019c9165 languageName: node linkType: hard -"@lingui/macro@npm:^4.12.0": - version: 4.12.0 - resolution: "@lingui/macro@npm:4.12.0" +"@lingui/macro@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/macro@npm:5.0.0-next.3" dependencies: - "@babel/runtime": ^7.20.13 - "@babel/types": ^7.20.7 - "@lingui/conf": 4.12.0 - "@lingui/core": 4.12.0 - "@lingui/message-utils": 4.12.0 + "@lingui/core": ^5.0.0-next.3 + "@lingui/react": ^5.0.0-next.3 peerDependencies: - "@lingui/react": ^4.0.0 + "@lingui/babel-plugin-lingui-macro": 4.11.2 babel-plugin-macros: 2 || 3 - checksum: c81f47161a784b50f616975f3bfeabd94f54c019385706d1bc2262bfd73fa058414fba4fcdb73c2c7a81102791f1a310f26b5d52a0ef656ae54cb70b8e0ef9fd - languageName: node - linkType: hard - -"@lingui/message-utils@npm:4.11.2": - version: 4.11.2 - resolution: "@lingui/message-utils@npm:4.11.2" - dependencies: - "@messageformat/parser": ^5.0.0 - js-sha256: ^0.10.1 - checksum: 126469e50fa189d9aebdf8785249ff91a9e725b241a141bdfe95727fd8c27d8f3ff792625c3e59cf2e73b8862d08d9babb93e3338891250999c020f0967bfac6 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: c28844d770e72d5ed758a3f1f6bf630567c6756043e559cad4a77a5139e0204200950c0367d6b09d0b433b7f81025d8d266b1441cc129f92ce1958017385b0bb languageName: node linkType: hard -"@lingui/message-utils@npm:4.12.0": - version: 4.12.0 - resolution: "@lingui/message-utils@npm:4.12.0" +"@lingui/message-utils@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/message-utils@npm:5.0.0-next.3" dependencies: "@messageformat/parser": ^5.0.0 js-sha256: ^0.10.1 - checksum: dd7e8b36b4fc289a4df4243efdc9c001bcfbdf5c7f7a9a344734f5c59de16dc4d9b538c7f34e4863a37794d73d7bc14f5e0d1c31cda64791b030e0d5a964b519 + checksum: 9aad0d2ae0829231b6683d2681aeb1703d06093bfc9a65037e58d2051496c1efe92f8d72edda85695c53aff5c075e28b4601bf10ad76d0883d74e662e1cdb02d languageName: node linkType: hard -"@lingui/metro-transformer@npm:^4.12.0": - version: 4.12.0 - resolution: "@lingui/metro-transformer@npm:4.12.0" +"@lingui/metro-transformer@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/metro-transformer@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/cli": 4.11.2 - "@lingui/conf": 4.11.2 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 memoize-one: ^6.0.0 peerDependencies: "@expo/metro-config": "*" @@ -3096,19 +3185,26 @@ __metadata: optional: true expo: optional: true - checksum: 4a0a4447874c577edf71006b4aacb9cf29dc4b9a69a53e9d871a0cbac95aad4722f39ef1812f6c5088f6b0a80b3465268739ad57ffb5f10aa389640b478ccf59 + checksum: 311c534dcc93651b8227edc3add768a507c477ec5db40b4e1f6861802e1ddc61f6cf58b2c2124e4df80588d7c34d62d64181f2b0e13160fbf2f2960aa95924d5 languageName: node linkType: hard -"@lingui/react@npm:^4.12.0": - version: 4.12.0 - resolution: "@lingui/react@npm:4.12.0" +"@lingui/react@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/react@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/core": 4.12.0 + "@lingui/core": ^5.0.0-next.3 peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 react: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: f52a9ea844311442f2ee2f7b7079b64293c14073c683198b48d398998ef322d4da909690a88101cf0fc69f1623a609a8de13f82cb707ce8bd79a110c0292222c + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: c02d01d11fe308718c7cb497811a3f4f7ee33ae0bbb217e1428ece9318d24d70c2649cb6dd4d430585fb8d8384e2f9e8ff7d1aa4cce0a1d2f49e23c28e3660dd languageName: node linkType: hard @@ -4379,7 +4475,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-macros@npm:^3.0.1, babel-plugin-macros@npm:^3.1.0": +"babel-plugin-macros@npm:^3.0.1": version: 3.1.0 resolution: "babel-plugin-macros@npm:3.1.0" dependencies: @@ -4578,7 +4674,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1, braces@npm:^3.0.2, braces@npm:~3.0.2": +"braces@npm:^3.0.2, braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -4587,6 +4683,15 @@ __metadata: languageName: node linkType: hard +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: ^7.1.1 + checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69 + languageName: node + linkType: hard + "browserslist@npm:^4.21.3, browserslist@npm:^4.21.5": version: 4.21.5 resolution: "browserslist@npm:4.21.5" @@ -4615,6 +4720,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.24.0": + version: 4.24.0 + resolution: "browserslist@npm:4.24.0" + dependencies: + caniuse-lite: ^1.0.30001663 + electron-to-chromium: ^1.5.28 + node-releases: ^2.0.18 + update-browserslist-db: ^1.1.0 + bin: + browserslist: cli.js + checksum: de200d3eb8d6ed819dad99719099a28fb6ebeb88016a5ac42fbdc11607e910c236a84ca1b0bbf232477d4b88ab64e8ab6aa67557cdd40a73ca9c2834f92ccce0 + languageName: node + linkType: hard + "bser@npm:2.1.1": version: 2.1.1 resolution: "bser@npm:2.1.1" @@ -4795,6 +4914,13 @@ __metadata: languageName: node linkType: hard +"caniuse-lite@npm:^1.0.30001663": + version: 1.0.30001669 + resolution: "caniuse-lite@npm:1.0.30001669" + checksum: 8ed0c69d0c6aa3b1cbc5ba4e5f5330943e7b7165e257f6955b8b73f043d07ad922265261f2b54d9bbaf02886bbdba5e6f5b16662310a13f91f17035af3212de1 + languageName: node + linkType: hard + "chalk@npm:4, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.2": version: 4.1.2 resolution: "chalk@npm:4.1.2" @@ -4916,15 +5042,6 @@ __metadata: languageName: node linkType: hard -"cli-table@npm:0.3.6": - version: 0.3.6 - resolution: "cli-table@npm:0.3.6" - dependencies: - colors: 1.0.3 - checksum: b0cd08578c810240920438cc2b3ffb4b4f5106b29f3362707f1d8cfc0c0440ad2afb70b96e30ce37f72f0ffe1e844ae7341dde4df17d51ad345eb186a5903af2 - languageName: node - linkType: hard - "cli-table@npm:^0.3.11": version: 0.3.11 resolution: "cli-table@npm:0.3.11" @@ -5534,6 +5651,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.28": + version: 1.5.39 + resolution: "electron-to-chromium@npm:1.5.39" + checksum: cd3b644c20f30fc1c393168bafa0e42a3dde576129603266ab61248b76a36837084073895a845676f8fe90dbb31d385bbef53901b60381f3ae82b40a5bece352 + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.5.4": version: 1.5.5 resolution: "electron-to-chromium@npm:1.5.5" @@ -5718,33 +5842,36 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.17.10": - version: 0.17.18 - resolution: "esbuild@npm:0.17.18" - dependencies: - "@esbuild/android-arm": 0.17.18 - "@esbuild/android-arm64": 0.17.18 - "@esbuild/android-x64": 0.17.18 - "@esbuild/darwin-arm64": 0.17.18 - "@esbuild/darwin-x64": 0.17.18 - "@esbuild/freebsd-arm64": 0.17.18 - "@esbuild/freebsd-x64": 0.17.18 - "@esbuild/linux-arm": 0.17.18 - "@esbuild/linux-arm64": 0.17.18 - "@esbuild/linux-ia32": 0.17.18 - "@esbuild/linux-loong64": 0.17.18 - "@esbuild/linux-mips64el": 0.17.18 - "@esbuild/linux-ppc64": 0.17.18 - "@esbuild/linux-riscv64": 0.17.18 - "@esbuild/linux-s390x": 0.17.18 - "@esbuild/linux-x64": 0.17.18 - "@esbuild/netbsd-x64": 0.17.18 - "@esbuild/openbsd-x64": 0.17.18 - "@esbuild/sunos-x64": 0.17.18 - "@esbuild/win32-arm64": 0.17.18 - "@esbuild/win32-ia32": 0.17.18 - "@esbuild/win32-x64": 0.17.18 +"esbuild@npm:^0.21.5": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": 0.21.5 + "@esbuild/android-arm": 0.21.5 + "@esbuild/android-arm64": 0.21.5 + "@esbuild/android-x64": 0.21.5 + "@esbuild/darwin-arm64": 0.21.5 + "@esbuild/darwin-x64": 0.21.5 + "@esbuild/freebsd-arm64": 0.21.5 + "@esbuild/freebsd-x64": 0.21.5 + "@esbuild/linux-arm": 0.21.5 + "@esbuild/linux-arm64": 0.21.5 + "@esbuild/linux-ia32": 0.21.5 + "@esbuild/linux-loong64": 0.21.5 + "@esbuild/linux-mips64el": 0.21.5 + "@esbuild/linux-ppc64": 0.21.5 + "@esbuild/linux-riscv64": 0.21.5 + "@esbuild/linux-s390x": 0.21.5 + "@esbuild/linux-x64": 0.21.5 + "@esbuild/netbsd-x64": 0.21.5 + "@esbuild/openbsd-x64": 0.21.5 + "@esbuild/sunos-x64": 0.21.5 + "@esbuild/win32-arm64": 0.21.5 + "@esbuild/win32-ia32": 0.21.5 + "@esbuild/win32-x64": 0.21.5 dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true "@esbuild/android-arm": optional: true "@esbuild/android-arm64": @@ -5791,7 +5918,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: 900b333f649fd89804216fb61fb5a0ffadc6dc37a2ec3b5981b588f72821676ea649a7c0ec785f0dbe6e774080b084c8af5f6ee7adbc1b138faf2a8c35e2c69c + checksum: 2911c7b50b23a9df59a7d6d4cdd3a4f85855787f374dce751148dbb13305e0ce7e880dde1608c2ab7a927fc6cec3587b80995f7fc87a64b455f8b70b55fd8ec1 languageName: node linkType: hard @@ -6527,6 +6654,15 @@ __metadata: languageName: node linkType: hard +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: ^5.0.1 + checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798 + languageName: node + linkType: hard + "finalhandler@npm:1.1.2": version: 1.1.2 resolution: "finalhandler@npm:1.1.2" @@ -6926,6 +7062,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.0": + version: 11.0.0 + resolution: "glob@npm:11.0.0" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^4.0.1 + minimatch: ^10.0.0 + minipass: ^7.1.2 + package-json-from-dist: ^1.0.0 + path-scurry: ^2.0.0 + bin: + glob: dist/esm/bin.mjs + checksum: 8a2dd914d5776987be5244624d9491bbcaf19f2387e06783737003ff696ebfd2264190c47014f8709c1c02d8bc892f17660cf986c587b107e194c0a3151ab333 + languageName: node + linkType: hard + "glob@npm:^6.0.1": version: 6.0.4 resolution: "glob@npm:6.0.4" @@ -7808,6 +7960,15 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.0.1": + version: 4.0.2 + resolution: "jackspeak@npm:4.0.2" + dependencies: + "@isaacs/cliui": ^8.0.2 + checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 + languageName: node + linkType: hard + "jest-environment-node@npm:^29.6.3": version: 29.7.0 resolution: "jest-environment-node@npm:29.7.0" @@ -8045,6 +8206,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: a36d3ca40574a974d9c2063bf68c2b6141c20da8f2a36bd3279fc802563f35f0527a6c828801295bdfb2803952cf2cf387786c2c90ed564f88d5782475abfe3c + languageName: node + linkType: hard + "jsesc@npm:~0.5.0": version: 0.5.0 resolution: "jsesc@npm:0.5.0" @@ -8287,15 +8457,15 @@ __metadata: "@babel/core": ^7.24.0 "@formatjs/intl-locale": ^4.0.2 "@formatjs/intl-pluralrules": ^5.2.16 - "@lingui/cli": ^4.12.0 - "@lingui/core": ^4.12.0 - "@lingui/macro": ^4.12.0 - "@lingui/metro-transformer": ^4.12.0 - "@lingui/react": ^4.12.0 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.3 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/macro": ^5.0.0-next.3 + "@lingui/metro-transformer": ^5.0.0-next.3 + "@lingui/react": ^5.0.0-next.3 "@react-native-community/eslint-config": ^3.2.0 "@types/react": ~18.2.79 "@typescript-eslint/eslint-plugin": ^5.59.11 - babel-plugin-macros: ^3.1.0 eslint: ^8.42.0 eslint-config-prettier: ^8.8.0 eslint-plugin-ft-flow: ^2.0.3 @@ -8430,6 +8600,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.0.1 + resolution: "lru-cache@npm:11.0.1" + checksum: 6056230a99fb399234e82368b99586bd4740079e80649102f681b19337b7d8c6bc8dd7f8b8c59377c31d26deb89f548b717ae932e139b4b795879d920fccf820 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -8798,16 +8975,6 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.2": - version: 4.0.2 - resolution: "micromatch@npm:4.0.2" - dependencies: - braces: ^3.0.1 - picomatch: ^2.0.5 - checksum: 39590a96d9ffad21f0afac044d0a5af4f33715a16fdd82c53a01c8f5ff6f70832a31b53e52972dac3deff8bf9f0bed0207d1c34e54ab3306a5e4c4efd5f7d249 - languageName: node - linkType: hard - "micromatch@npm:^4.0.2, micromatch@npm:^4.0.4": version: 4.0.5 resolution: "micromatch@npm:4.0.5" @@ -8818,6 +8985,16 @@ __metadata: languageName: node linkType: hard +"micromatch@npm:^4.0.7": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" + dependencies: + braces: ^3.0.3 + picomatch: ^2.3.1 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 + languageName: node + linkType: hard + "mime-db@npm:1.52.0, mime-db@npm:>= 1.43.0 < 2": version: 1.52.0 resolution: "mime-db@npm:1.52.0" @@ -8875,6 +9052,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.0.0": + version: 10.0.1 + resolution: "minimatch@npm:10.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: f5b63c2f30606091a057c5f679b067f84a2cd0ffbd2dbc9143bda850afd353c7be81949ff11ae0c86988f07390eeca64efd7143ee05a0dab37f6c6b38a2ebb6c + languageName: node + linkType: hard + "minimatch@npm:^5.0.1": version: 5.1.6 resolution: "minimatch@npm:5.1.6" @@ -9728,6 +9914,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.0 + resolution: "path-scurry@npm:2.0.0" + dependencies: + lru-cache: ^11.0.0 + minipass: ^7.1.2 + checksum: 9953ce3857f7e0796b187a7066eede63864b7e1dfc14bf0484249801a5ab9afb90d9a58fc533ebb1b552d23767df8aa6a2c6c62caf3f8a65f6ce336a97bbb484 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -9756,7 +9952,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3, picomatch@npm:^2.3.1": +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.3, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf diff --git a/examples/rspack/src/Inbox.tsx b/examples/rspack/src/Inbox.tsx index 37ff340f2..1cef363c8 100644 --- a/examples/rspack/src/Inbox.tsx +++ b/examples/rspack/src/Inbox.tsx @@ -1,33 +1,42 @@ -import { useLingui } from "@lingui/react"; +import { useLingui } from "@lingui/react" -import { Plural, Trans } from "@lingui/macro"; +import { Plural, Trans } from "@lingui/react/macro" -import LocaleSwitcher from './LocaleSwitcher'; +import LocaleSwitcher from "./LocaleSwitcher" export default function Inbox() { - const messages = [{}, {}]; - const messagesCount = messages.length; - const lastLogin = new Date(); - const markAsRead = () => { - alert("Marked as read."); - }; - const { i18n } = useLingui(); + const messages = [{}, {}] + const messagesCount = messages.length + const lastLogin = new Date() + const markAsRead = () => { + alert("Marked as read.") + } + const { i18n } = useLingui() - return ( -
- -

Message Inbox

-

- - See all unread messages - {" or "} - mark them as read. - -

-

- -

- < footer > Last login on {i18n.date(lastLogin)}. -
- ); -} \ No newline at end of file + return ( +
+ +

+ Message Inbox +

+

+ + See all unread messages + {" or "} + mark them as read. + +

+

+ +

+
+ {" "} + Last login on {i18n.date(lastLogin)}. +
+
+ ) +} diff --git a/examples/vite-project-react-babel/package.json b/examples/vite-project-react-babel/package.json index f4e339a4e..452a98299 100644 --- a/examples/vite-project-react-babel/package.json +++ b/examples/vite-project-react-babel/package.json @@ -10,19 +10,19 @@ "preview": "vite preview" }, "dependencies": { - "@lingui/macro": "^4.1.2", - "@lingui/react": "^4.1.2", + "@lingui/core": "^5.0.0-next.3", + "@lingui/react": "^5.0.0-next.3", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@lingui/cli": "^4.1.2", - "@lingui/vite-plugin": "^4.1.2", + "@lingui/babel-plugin-lingui-macro": "5.0.0-next.3", + "@lingui/cli": "^5.0.0-next.3", + "@lingui/vite-plugin": "^5.0.0-next.3", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^3.1.0", - "babel-plugin-macros": "^3.1.0", + "@vitejs/plugin-react": "^4.3.2", "typescript": "^4.9.3", - "vite": "^4.2.0" + "vite": "^5.4.9" } } diff --git a/examples/vite-project-react-babel/src/App.tsx b/examples/vite-project-react-babel/src/App.tsx index f49b33473..6e4bf77c5 100644 --- a/examples/vite-project-react-babel/src/App.tsx +++ b/examples/vite-project-react-babel/src/App.tsx @@ -3,7 +3,7 @@ import reactLogo from "./assets/react.svg" import linguiLogo from "./assets/lingui-logo.svg" import viteLogo from "/vite.svg" import "./App.css" -import { Plural, Trans } from "@lingui/macro" +import { Plural, Trans } from "@lingui/react/macro" import { I18nProvider } from "@lingui/react" import { i18n } from "@lingui/core" import { loadCatalog } from "./i18n" diff --git a/examples/vite-project-react-babel/vite.config.ts b/examples/vite-project-react-babel/vite.config.ts index 36f36fe31..8055ef97b 100644 --- a/examples/vite-project-react-babel/vite.config.ts +++ b/examples/vite-project-react-babel/vite.config.ts @@ -7,10 +7,9 @@ export default defineConfig({ plugins: [ react({ babel: { - plugins: ["macros"], + plugins: ["@lingui/babel-plugin-lingui-macro"], }, }), - lingui(), ], }) diff --git a/examples/vite-project-react-babel/yarn.lock b/examples/vite-project-react-babel/yarn.lock index d82ae79de..548eb0c25 100644 --- a/examples/vite-project-react-babel/yarn.lock +++ b/examples/vite-project-react-babel/yarn.lock @@ -24,6 +24,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/code-frame@npm:7.25.7" + dependencies: + "@babel/highlight": ^7.25.7 + picocolors: ^1.0.0 + checksum: f235cdf9c5d6f172898a27949bd63731c5f201671f77bcf4c2ad97229bc462d89746c1a7f5671a132aecff5baf43f3d878b93a7ecc6aa71f9612d2b51270c53e + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.20.5": version: 7.21.0 resolution: "@babel/compat-data@npm:7.21.0" @@ -31,6 +41,13 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.25.7": + version: 7.25.8 + resolution: "@babel/compat-data@npm:7.25.8" + checksum: 7ac648b110ec0fcd3a3d3fc62c69c0325b536b3c97bafea8a4392dfc68d9ea9ab1f36d1b2f231d404473fc81f503b4a630425677fc9a3cce2ee33d74842ea109 + languageName: node + linkType: hard + "@babel/core@npm:^7.20.12, @babel/core@npm:^7.21.0": version: 7.21.3 resolution: "@babel/core@npm:7.21.3" @@ -54,6 +71,29 @@ __metadata: languageName: node linkType: hard +"@babel/core@npm:^7.25.2": + version: 7.25.8 + resolution: "@babel/core@npm:7.25.8" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/helper-compilation-targets": ^7.25.7 + "@babel/helper-module-transforms": ^7.25.7 + "@babel/helpers": ^7.25.7 + "@babel/parser": ^7.25.8 + "@babel/template": ^7.25.7 + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.8 + convert-source-map: ^2.0.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.3 + semver: ^6.3.1 + checksum: 77ddf693faf6997915e7bbe16e9f21ca1c0e58bc60ace9eac51c373b21d1b46ce50de650195c136a594b0e5fcb901ca17bb57c2d20bf175b3c325211138bcfde + languageName: node + linkType: hard + "@babel/generator@npm:^7.21.1, @babel/generator@npm:^7.21.3": version: 7.21.3 resolution: "@babel/generator@npm:7.21.3" @@ -66,6 +106,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/generator@npm:7.25.7" + dependencies: + "@babel/types": ^7.25.7 + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.25 + jsesc: ^3.0.2 + checksum: f81cf9dc0191ae4411d82978114382ad6e047bfb678f9a95942bac5034a41719d88f047679f5e2f51ba7728b54ebd1cc32a10df7b556215d8a6ab9bdd4f11831 + languageName: node + linkType: hard + "@babel/helper-compilation-targets@npm:^7.20.7": version: 7.20.7 resolution: "@babel/helper-compilation-targets@npm:7.20.7" @@ -81,6 +133,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-compilation-targets@npm:7.25.7" + dependencies: + "@babel/compat-data": ^7.25.7 + "@babel/helper-validator-option": ^7.25.7 + browserslist: ^4.24.0 + lru-cache: ^5.1.1 + semver: ^6.3.1 + checksum: 5b57e7d4b9302c07510ad3318763c053c3d46f2d40a45c2ea0c59160ccf9061a34975ae62f36a32f15d8d03497ecd5ca43a96417c1fd83eb8c035e77a69840ef + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-environment-visitor@npm:7.18.9" @@ -116,6 +181,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-imports@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a7255755e9799978de4bf72563b94b53cf955e5fc3d2acc67c783d3b84d5d34dd41691e473ecc124a94654483fff573deacd87eccd8bd16b47ac4455b5941b30 + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.21.2": version: 7.21.2 resolution: "@babel/helper-module-transforms@npm:7.21.2" @@ -132,10 +207,24 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.19.0, @babel/helper-plugin-utils@npm:^7.20.2": - version: 7.20.2 - resolution: "@babel/helper-plugin-utils@npm:7.20.2" - checksum: f6cae53b7fdb1bf3abd50fa61b10b4470985b400cc794d92635da1e7077bb19729f626adc0741b69403d9b6e411cddddb9c0157a709cc7c4eeb41e663be5d74b +"@babel/helper-module-transforms@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-transforms@npm:7.25.7" + dependencies: + "@babel/helper-module-imports": ^7.25.7 + "@babel/helper-simple-access": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + "@babel/traverse": ^7.25.7 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: b1daeded78243da969d90b105a564ed918dcded66fba5cd24fe09cb13f7ee9e84d9b9dee789d60237b9a674582d9831a35dbaf6f0a92a3af5f035234a5422814 + languageName: node + linkType: hard + +"@babel/helper-plugin-utils@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-plugin-utils@npm:7.25.7" + checksum: eef4450361e597f11247d252e69207324dfe0431df9b8bcecc8bef1204358e93fa7776a659c3c4f439e9ee71cd967aeca6c4d6034ebc17a7ae48143bbb580f2f languageName: node linkType: hard @@ -148,6 +237,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-simple-access@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 684d0b0330c42d62834355f127df3ed78f16e6f1f66213c72adb7b3b0bcd6283ea8792f5b172868b3ca6518c479b54e18adac564219519072dda9053cca210bd + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-split-export-declaration@npm:7.18.6" @@ -164,6 +263,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-string-parser@npm:7.25.7" + checksum: 0835fda5efe02cdcb5144a939b639acc017ba4aa1cc80524b44032ddb714080d3e40e8f0d3240832b7bd86f5513f0b63d4fe77d8fc52d8c8720ae674182c0753 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.18.6, @babel/helper-validator-identifier@npm:^7.19.1": version: 7.19.1 resolution: "@babel/helper-validator-identifier@npm:7.19.1" @@ -171,6 +277,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-identifier@npm:7.25.7" + checksum: 062f55208deead4876eb474dc6fd55155c9eada8d0a505434de3b9aa06c34195562e0f3142b22a08793a38d740238efa2fe00ff42956cdcb8ac03f0b6c542247 + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.18.6": version: 7.21.0 resolution: "@babel/helper-validator-option@npm:7.21.0" @@ -178,6 +291,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-option@npm:7.25.7" + checksum: 87b801fe7d8337699f2fba5323243dd974ea214d27cf51faf2f0063da6dc5bb67c9bb7867fd337573870f9ab498d2788a75bcf9685442bd9430611c62b0195d1 + languageName: node + linkType: hard + "@babel/helpers@npm:^7.21.0": version: 7.21.0 resolution: "@babel/helpers@npm:7.21.0" @@ -189,6 +309,16 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helpers@npm:7.25.7" + dependencies: + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a73242850915ef2956097431fbab3a840b7d6298555ad4c6f596db7d1b43cf769181716e7b65f8f7015fe48748b9c454d3b9c6cf4506cb840b967654463b0819 + languageName: node + linkType: hard + "@babel/highlight@npm:^7.18.6": version: 7.18.6 resolution: "@babel/highlight@npm:7.18.6" @@ -200,7 +330,30 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.2, @babel/parser@npm:^7.21.3": +"@babel/highlight@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/highlight@npm:7.25.7" + dependencies: + "@babel/helper-validator-identifier": ^7.25.7 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + picocolors: ^1.0.0 + checksum: b6aa45c5bf7ecc16b8204bbed90335706131ac6cacb0f1bfb1b862ada3741539c913b56c9d26beb56cece0c231ffab36f66aa36aac6b04b32669c314705203f2 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.22.0, @babel/parser@npm:^7.25.7, @babel/parser@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/parser@npm:7.25.8" + dependencies: + "@babel/types": ^7.25.8 + bin: + parser: ./bin/babel-parser.js + checksum: c33f6d26542f156927c5dbe131265c791177d271e582338e960f803903086ec5c152bf25deae5f4c061b7bee14dc0b5fd2882ccb5a21c16ee0738d24fcc0406e + languageName: node + linkType: hard + +"@babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.3": version: 7.21.3 resolution: "@babel/parser@npm:7.21.3" bin: @@ -209,25 +362,25 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-react-jsx-self@npm:^7.18.6": - version: 7.21.0 - resolution: "@babel/plugin-transform-react-jsx-self@npm:7.21.0" +"@babel/plugin-transform-react-jsx-self@npm:^7.24.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-react-jsx-self@npm:7.25.7" dependencies: - "@babel/helper-plugin-utils": ^7.20.2 + "@babel/helper-plugin-utils": ^7.25.7 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 696f74c04a265409ccd46e333ff762e6011d394e6972128b5d97db4c1647289141bc7ebd45ab2bab99b60932f9793e8f89ee9432d3bde19962de2100456f6147 + checksum: bce354e2871c82087e52eda7eccc5927cce3e961af275ec190ba3060b9eafad497baf8da269217a69e242464d863d95c59d346339e802616fb910862db6763b8 languageName: node linkType: hard -"@babel/plugin-transform-react-jsx-source@npm:^7.19.6": - version: 7.19.6 - resolution: "@babel/plugin-transform-react-jsx-source@npm:7.19.6" +"@babel/plugin-transform-react-jsx-source@npm:^7.24.7": + version: 7.25.7 + resolution: "@babel/plugin-transform-react-jsx-source@npm:7.25.7" dependencies: - "@babel/helper-plugin-utils": ^7.19.0 + "@babel/helper-plugin-utils": ^7.25.7 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 1e9e29a4efc5b79840bd4f68e404f5ab7765ce48c7bd22f12f2b185f9c782c66933bdf54a1b21879e4e56e6b50b4e88aca82789ecb1f61123af6dfa9ab16c555 + checksum: 1f87d8fa16ff1d8736224b8775ff5d2c65e562f29c8b272d4f36d427063fdfc83d97dd4250c2568b97f6afb45d2cc7d45f7b96ab0b91fc7c5e9f38154bd10fb7 languageName: node linkType: hard @@ -251,6 +404,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/template@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 83f025a4a777103965ee41b7c0fa2bb1c847ea7ed2b9f2cb258998ea96dfc580206176b532edf6d723d85237bc06fca26be5c8772e2af7d9e4fe6927e3bed8a3 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.21.0, @babel/traverse@npm:^7.21.2, @babel/traverse@npm:^7.21.3": version: 7.21.3 resolution: "@babel/traverse@npm:7.21.3" @@ -269,6 +433,32 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/traverse@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + debug: ^4.3.1 + globals: ^11.1.0 + checksum: 4d329b6e7a409a63f4815bbc0a08d0b0cb566c5a2fecd1767661fe1821ced213c554d7d74e6aca048672fed2c8f76071cb0d94f4bd5f120fba8d55a38af63094 + languageName: node + linkType: hard + +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.25.7, @babel/types@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/types@npm:7.25.8" + dependencies: + "@babel/helper-string-parser": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + to-fast-properties: ^2.0.0 + checksum: 93d84858e820dbfa0fc4882b3ba6a421544d224ee61455a58eed0af9fc3518b30dc2166b8ba48cdd2e91083c5885ed773c36acf46d177b7b1fad9c35b6eb7639 + languageName: node + linkType: hard + "@babel/types@npm:^7.18.6, @babel/types@npm:^7.20.2, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.2, @babel/types@npm:^7.21.3, @babel/types@npm:^7.8.3": version: 7.21.3 resolution: "@babel/types@npm:7.21.3" @@ -280,156 +470,163 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm64@npm:0.17.12" +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-arm@npm:0.17.12" +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/android-x64@npm:0.17.12" +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-arm64@npm:0.17.12" +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/darwin-x64@npm:0.17.12" +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-arm64@npm:0.17.12" +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/freebsd-x64@npm:0.17.12" +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm64@npm:0.17.12" +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-arm@npm:0.17.12" +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ia32@npm:0.17.12" +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-loong64@npm:0.17.12" +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-mips64el@npm:0.17.12" +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-ppc64@npm:0.17.12" +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-riscv64@npm:0.17.12" +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-s390x@npm:0.17.12" +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/linux-x64@npm:0.17.12" +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/netbsd-x64@npm:0.17.12" +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/openbsd-x64@npm:0.17.12" +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/sunos-x64@npm:0.17.12" +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-arm64@npm:0.17.12" +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-ia32@npm:0.17.12" +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.17.12": - version: 0.17.12 - resolution: "@esbuild/win32-x64@npm:0.17.12" +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -441,6 +638,20 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + "@jest/schemas@npm:^29.4.3": version: 29.4.3 resolution: "@jest/schemas@npm:29.4.3" @@ -485,6 +696,17 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": ^1.2.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.24 + checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:3.1.0": version: 3.1.0 resolution: "@jridgewell/resolve-uri@npm:3.1.0" @@ -492,6 +714,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.2 + resolution: "@jridgewell/resolve-uri@npm:3.1.2" + checksum: 83b85f72c59d1c080b4cbec0fef84528963a1b5db34e4370fa4bd1e3ff64a0d80e0cee7369d11d73c704e0286fb2865b530acac7a871088fbe92b5edf1000870 + languageName: node + linkType: hard + "@jridgewell/set-array@npm:^1.0.0, @jridgewell/set-array@npm:^1.0.1": version: 1.1.2 resolution: "@jridgewell/set-array@npm:1.1.2" @@ -499,13 +728,27 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.13": +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.10": version: 1.4.14 resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97 languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.17 resolution: "@jridgewell/trace-mapping@npm:0.3.17" @@ -516,38 +759,68 @@ __metadata: languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.1.2" - checksum: 61cae1343e55073ae4cd7bbaf3e77362e71799af4be4e6cfc759e4d33eef6bca0f6a312bb43654ebc0abf8717e2c77c2b421420c47dfa2f0c3cc0f96dcf67015 +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 9d3c40d225e139987b50c48988f8717a54a8c994d8a948ee42e1412e08988761d0754d7d10b803061cc3aebf35f92a5dbbab493bd0e1a9ef9e89a2130e83ba34 languageName: node linkType: hard -"@lingui/cli@npm:4.1.2, @lingui/cli@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/cli@npm:4.1.2" +"@lingui/babel-plugin-extract-messages@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-extract-messages@npm:5.0.0-next.3" + checksum: a0c7632295c4e07eab9b5754b0f3e2944a7b59dda8cbbdacb5ba5c500b7be9c73b44e114bd1323dc3a6fa4ff64657f7f6d9b8c981facd2c55c782577418f68d8 + languageName: node + linkType: hard + +"@lingui/babel-plugin-lingui-macro@npm:5.0.0-next.3, @lingui/babel-plugin-lingui-macro@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-lingui-macro@npm:5.0.0-next.3" + dependencies: + "@babel/core": ^7.20.12 + "@babel/runtime": ^7.20.13 + "@babel/types": ^7.20.7 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + peerDependencies: + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: ac7ebe134c4c324a1945de6cbc1f28c9d821233fa3d5228134034fde420e5f38f9c240cd090de6cae905dfe910496462c304e73d25ecf6a91e23afc3458c6248 + languageName: node + linkType: hard + +"@lingui/cli@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/cli@npm:5.0.0-next.3" dependencies: "@babel/core": ^7.21.0 "@babel/generator": ^7.21.1 - "@babel/parser": ^7.21.2 + "@babel/parser": ^7.22.0 "@babel/runtime": ^7.21.0 "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.1.2 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/format-po": 4.1.2 - "@lingui/message-utils": 4.1.2 + "@lingui/babel-plugin-extract-messages": ^5.0.0-next.3 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/format-po": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 babel-plugin-macros: ^3.0.1 chalk: ^4.1.0 chokidar: 3.5.1 - cli-table: 0.3.6 + cli-table: ^0.3.11 commander: ^10.0.0 convert-source-map: ^2.0.0 - date-fns: ^2.16.1 - esbuild: ^0.17.10 - glob: ^7.1.4 + date-fns: ^3.6.0 + esbuild: ^0.21.5 + glob: ^11.0.0 inquirer: ^7.3.3 - micromatch: 4.0.2 + micromatch: ^4.0.7 normalize-path: ^3.0.0 ora: ^5.1.0 pathe: ^1.1.0 @@ -558,13 +831,13 @@ __metadata: source-map: ^0.8.0-beta.0 bin: lingui: dist/lingui.js - checksum: 3dd985af16702f2e6fc91c6e263fbfe93cbbdcaea01e54dd5a710a583fa40a48b070f4efdd872eb6518b960d431910b9e8a07cea2000a44e634285e953fdd7c6 + checksum: eada44db8e4c16fa4de50e46cf98889d8b787cf5accfca3edbb8bad9e45f77054e54f2bfffcbbf64f35d2f8199d0349cde69f57a5da49f4b34deb509b065bfd9 languageName: node linkType: hard -"@lingui/conf@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/conf@npm:4.1.2" +"@lingui/conf@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/conf@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 chalk: ^4.1.0 @@ -572,78 +845,79 @@ __metadata: jest-validate: ^29.4.3 jiti: ^1.17.1 lodash.get: ^4.4.2 - checksum: 2fbeeaf0c2e7b895c3128b7e5e7e72a43d21bfd2b8f5bff6d0ec46ee8ae22d1c9af54540d7d070a21639b652ff1b9482b33504db79787801d0db693763508fe0 + checksum: c618ab075f96678fc1bb32326b5b0a2ff43e1ab3320b79493bf8f2525e2fa3fa85215d848eb7b4d2db816671c80c92c680868029c9fc34cceb9a3177fa9126ca languageName: node linkType: hard -"@lingui/core@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/core@npm:4.1.2" +"@lingui/core@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/core@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/message-utils": 4.1.2 - checksum: 480d13a13b855944d36d4145934fb18a0e8cb0625004114c540b9a7e5dce83206944a91d8daa55395ea3b11958bedaeb1731fd3e4224f7817f47fb1825450e6f + "@lingui/message-utils": ^5.0.0-next.3 + unraw: ^3.0.0 + peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: 4544ed44b2bc16ac6c0bf957b470608ba5ae4f62035030e706f9347225cefd0f845872658af728e758118f04cd65c1e7c851ebf6e7d1d7a660d30bf8404883df languageName: node linkType: hard -"@lingui/format-po@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/format-po@npm:4.1.2" +"@lingui/format-po@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/format-po@npm:5.0.0-next.3" dependencies: - "@lingui/conf": 4.1.2 - "@lingui/message-utils": 4.1.2 - date-fns: ^2.29.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + date-fns: ^3.6.0 pofile: ^1.1.4 - checksum: 205afaea64d59c70d876610d4480195c20a5649bc64a7618b69ba6adf702886de723517b0526129e0fccca01a4d2185c02746d7d77fc47cfc4e01cc65ee540ad + checksum: c73b4e2c4b95e4475e5c676817dc0299e9b46e5bf05f5c9204cc8b99fe65770072464aecdd0c93d4ae4492f384905469258b2786b5d546164e904d97019c9165 languageName: node linkType: hard -"@lingui/macro@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/macro@npm:4.1.2" - dependencies: - "@babel/runtime": ^7.20.13 - "@babel/types": ^7.20.7 - "@lingui/conf": 4.1.2 - "@lingui/core": 4.1.2 - "@lingui/message-utils": 4.1.2 - peerDependencies: - "@lingui/react": ^4.0.0 - babel-plugin-macros: 2 || 3 - checksum: bfe69b093a0724f54fc5bccee42787c0ef8f98479524226d5a34c4d5129878138e74be429e423da99633e02da6aa82026ad39dfe01ea8334bab4a39fdf282a89 - languageName: node - linkType: hard - -"@lingui/message-utils@npm:4.1.2": - version: 4.1.2 - resolution: "@lingui/message-utils@npm:4.1.2" +"@lingui/message-utils@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/message-utils@npm:5.0.0-next.3" dependencies: "@messageformat/parser": ^5.0.0 - checksum: a0a78959f22b866a298da342931a3eee474cdd486b9bdedf50ecdb7caa479dac773bc21b10a2d39c1d4363d5b7a236ccd853d9e4f46bcf0c1741becc7c078382 + js-sha256: ^0.10.1 + checksum: 9aad0d2ae0829231b6683d2681aeb1703d06093bfc9a65037e58d2051496c1efe92f8d72edda85695c53aff5c075e28b4601bf10ad76d0883d74e662e1cdb02d languageName: node linkType: hard -"@lingui/react@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/react@npm:4.1.2" +"@lingui/react@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/react@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/core": 4.1.2 + "@lingui/core": ^5.0.0-next.3 peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 react: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 887a4341c1afa45abab4bf9e753c74329a2bb3e5a6d941968c91c2540e7506e54c00def50f75744e6c704a38772ccaaff04f1e622f114e0ba542136ad4f6227e + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: c02d01d11fe308718c7cb497811a3f4f7ee33ae0bbb217e1428ece9318d24d70c2649cb6dd4d430585fb8d8384e2f9e8ff7d1aa4cce0a1d2f49e23c28e3660dd languageName: node linkType: hard -"@lingui/vite-plugin@npm:^4.1.2": - version: 4.1.2 - resolution: "@lingui/vite-plugin@npm:4.1.2" +"@lingui/vite-plugin@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/vite-plugin@npm:5.0.0-next.3" dependencies: - "@lingui/cli": 4.1.2 - "@lingui/conf": 4.1.2 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 peerDependencies: - vite: 3 - 4 - checksum: a249f07b56d2e5c385c131041a99c145f155339b36e86cf7f8b99905df05110cc5338184ad159f41167259017b6646a5772840876f6d0e553b76598d28ed8cd1 + vite: ^3 || ^4 || ^5.0.9 + checksum: 4ee7528765d45cbb60df868307d6f488b36f94afc7c9f64c2fac3c64c4ffa91c2dc730b4d9f56b244c14a0b09510a8be3cb455f907e439f1ce0748e7a3897655 languageName: node linkType: hard @@ -676,6 +950,118 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-android-arm-eabi@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.24.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-android-arm64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-android-arm64@npm:4.24.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.24.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.24.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-gnueabihf@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.24.0" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-musleabihf@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.24.0" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.24.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.24.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.24.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.24.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-s390x-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.24.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.24.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.24.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.24.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.24.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.24.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@sinclair/typebox@npm:^0.25.16": version: 0.25.24 resolution: "@sinclair/typebox@npm:0.25.24" @@ -690,6 +1076,54 @@ __metadata: languageName: node linkType: hard +"@types/babel__core@npm:^7.20.5": + version: 7.20.5 + resolution: "@types/babel__core@npm:7.20.5" + dependencies: + "@babel/parser": ^7.20.7 + "@babel/types": ^7.20.7 + "@types/babel__generator": "*" + "@types/babel__template": "*" + "@types/babel__traverse": "*" + checksum: a3226f7930b635ee7a5e72c8d51a357e799d19cbf9d445710fa39ab13804f79ab1a54b72ea7d8e504659c7dfc50675db974b526142c754398d7413aa4bc30845 + languageName: node + linkType: hard + +"@types/babel__generator@npm:*": + version: 7.6.8 + resolution: "@types/babel__generator@npm:7.6.8" + dependencies: + "@babel/types": ^7.0.0 + checksum: 5b332ea336a2efffbdeedb92b6781949b73498606ddd4205462f7d96dafd45ff3618770b41de04c4881e333dd84388bfb8afbdf6f2764cbd98be550d85c6bb48 + languageName: node + linkType: hard + +"@types/babel__template@npm:*": + version: 7.4.4 + resolution: "@types/babel__template@npm:7.4.4" + dependencies: + "@babel/parser": ^7.1.0 + "@babel/types": ^7.0.0 + checksum: d7a02d2a9b67e822694d8e6a7ddb8f2b71a1d6962dfd266554d2513eefbb205b33ca71a0d163b1caea3981ccf849211f9964d8bd0727124d18ace45aa6c9ae29 + languageName: node + linkType: hard + +"@types/babel__traverse@npm:*": + version: 7.20.6 + resolution: "@types/babel__traverse@npm:7.20.6" + dependencies: + "@babel/types": ^7.20.7 + checksum: 2bdc65eb62232c2d5c1086adeb0c31e7980e6fd7e50a3483b4a724a1a1029c84d9cb59749cf8de612f9afa2bc14c85b8f50e64e21f8a4398fa77eb9059a4283c + languageName: node + linkType: hard + +"@types/estree@npm:1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 8825d6e729e16445d9a1dd2fb1db2edc5ed400799064cd4d028150701031af012ba30d6d03fe9df40f4d7a437d0de6d2b256020152b7b09bde9f2e420afdffd9 + languageName: node + linkType: hard + "@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0": version: 2.0.4 resolution: "@types/istanbul-lib-coverage@npm:2.0.4" @@ -779,18 +1213,18 @@ __metadata: languageName: node linkType: hard -"@vitejs/plugin-react@npm:^3.1.0": - version: 3.1.0 - resolution: "@vitejs/plugin-react@npm:3.1.0" +"@vitejs/plugin-react@npm:^4.3.2": + version: 4.3.2 + resolution: "@vitejs/plugin-react@npm:4.3.2" dependencies: - "@babel/core": ^7.20.12 - "@babel/plugin-transform-react-jsx-self": ^7.18.6 - "@babel/plugin-transform-react-jsx-source": ^7.19.6 - magic-string: ^0.27.0 - react-refresh: ^0.14.0 + "@babel/core": ^7.25.2 + "@babel/plugin-transform-react-jsx-self": ^7.24.7 + "@babel/plugin-transform-react-jsx-source": ^7.24.7 + "@types/babel__core": ^7.20.5 + react-refresh: ^0.14.2 peerDependencies: - vite: ^4.1.0-beta.0 - checksum: 450fac79e67cba9e1581c860f78e687b44108ab4117663ef20db279316e03cd8e87f94fef376e27cc5e200bd52813dcc09b70ea570c7c7cc291fcd47eb260fbc + vite: ^4.2.0 || ^5.0.0 + checksum: 6bd3f8ec4a5c1f9f2970217d6a7291fafb41b7760f7761b982b6835c8f9cd3874cea9eb3b6659aa75c511954fcec7707116ea32042854b1be47902ebbb781794 languageName: node linkType: hard @@ -847,6 +1281,13 @@ __metadata: languageName: node linkType: hard +"ansi-regex@npm:^6.0.1": + version: 6.1.0 + resolution: "ansi-regex@npm:6.1.0" + checksum: 495834a53b0856c02acd40446f7130cb0f8284f4a39afdab20d5dc42b2e198b1196119fe887beed8f9055c4ff2055e3b2f6d4641d0be018cdfb64fedf6fc1aac + languageName: node + linkType: hard + "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -856,7 +1297,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^4.1.0": +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": version: 4.3.0 resolution: "ansi-styles@npm:4.3.0" dependencies: @@ -872,6 +1313,13 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + "anymatch@npm:~3.1.1": version: 3.1.3 resolution: "anymatch@npm:3.1.3" @@ -906,7 +1354,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-macros@npm:^3.0.1, babel-plugin-macros@npm:^3.1.0": +"babel-plugin-macros@npm:^3.0.1": version: 3.1.0 resolution: "babel-plugin-macros@npm:3.1.0" dependencies: @@ -968,7 +1416,16 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1, braces@npm:~3.0.2": +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: ^7.1.1 + checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69 + languageName: node + linkType: hard + +"braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -991,6 +1448,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.24.0": + version: 4.24.0 + resolution: "browserslist@npm:4.24.0" + dependencies: + caniuse-lite: ^1.0.30001663 + electron-to-chromium: ^1.5.28 + node-releases: ^2.0.18 + update-browserslist-db: ^1.1.0 + bin: + browserslist: cli.js + checksum: de200d3eb8d6ed819dad99719099a28fb6ebeb88016a5ac42fbdc11607e910c236a84ca1b0bbf232477d4b88ab64e8ab6aa67557cdd40a73ca9c2834f92ccce0 + languageName: node + linkType: hard + "buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -1048,7 +1519,14 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^2.0.0": +"caniuse-lite@npm:^1.0.30001663": + version: 1.0.30001669 + resolution: "caniuse-lite@npm:1.0.30001669" + checksum: 8ed0c69d0c6aa3b1cbc5ba4e5f5330943e7b7165e257f6955b8b73f043d07ad922265261f2b54d9bbaf02886bbdba5e6f5b16662310a13f91f17035af3212de1 + languageName: node + linkType: hard + +"chalk@npm:^2.0.0, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -1125,12 +1603,12 @@ __metadata: languageName: node linkType: hard -"cli-table@npm:0.3.6": - version: 0.3.6 - resolution: "cli-table@npm:0.3.6" +"cli-table@npm:^0.3.11": + version: 0.3.11 + resolution: "cli-table@npm:0.3.11" dependencies: colors: 1.0.3 - checksum: b0cd08578c810240920438cc2b3ffb4b4f5106b29f3362707f1d8cfc0c0440ad2afb70b96e30ce37f72f0ffe1e844ae7341dde4df17d51ad345eb186a5903af2 + checksum: 59fb61f992ac9bc8610ed98c72bf7f5d396c5afb42926b6747b46b0f8bb98a0dfa097998e77542ac334c1eb7c18dbf4f104d5783493273c5ec4c34084aa7c663 languageName: node linkType: hard @@ -1256,6 +1734,17 @@ __metadata: languageName: node linkType: hard +"cross-spawn@npm:^7.0.0": + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" + dependencies: + path-key: ^3.1.0 + shebang-command: ^2.0.0 + which: ^2.0.1 + checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + languageName: node + linkType: hard + "csstype@npm:^3.0.2": version: 3.1.1 resolution: "csstype@npm:3.1.1" @@ -1263,10 +1752,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.16.1, date-fns@npm:^2.29.3": - version: 2.29.3 - resolution: "date-fns@npm:2.29.3" - checksum: e01cf5b62af04e05dfff921bb9c9933310ed0e1ae9a81eb8653452e64dc841acf7f6e01e1a5ae5644d0337e9a7f936175fd2cb6819dc122fdd9c5e86c56be484 +"date-fns@npm:^3.6.0": + version: 3.6.0 + resolution: "date-fns@npm:3.6.0" + checksum: 0daa1e9a436cf99f9f2ae9232b55e11f3dd46132bee10987164f3eebd29f245b2e066d7d7db40782627411ecf18551d8f4c9fcdf2226e48bb66545407d448ab7 languageName: node linkType: hard @@ -1282,6 +1771,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.3.1": + version: 4.3.7 + resolution: "debug@npm:4.3.7" + dependencies: + ms: ^2.1.3 + peerDependenciesMeta: + supports-color: + optional: true + checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 + languageName: node + linkType: hard + "defaults@npm:^1.0.3": version: 1.0.4 resolution: "defaults@npm:1.0.4" @@ -1305,6 +1806,13 @@ __metadata: languageName: node linkType: hard +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.4.284": version: 1.4.337 resolution: "electron-to-chromium@npm:1.4.337" @@ -1312,6 +1820,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.28": + version: 1.5.39 + resolution: "electron-to-chromium@npm:1.5.39" + checksum: cd3b644c20f30fc1c393168bafa0e42a3dde576129603266ab61248b76a36837084073895a845676f8fe90dbb31d385bbef53901b60381f3ae82b40a5bece352 + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -1319,6 +1834,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -1351,33 +1873,36 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.17.10, esbuild@npm:^0.17.5": - version: 0.17.12 - resolution: "esbuild@npm:0.17.12" - dependencies: - "@esbuild/android-arm": 0.17.12 - "@esbuild/android-arm64": 0.17.12 - "@esbuild/android-x64": 0.17.12 - "@esbuild/darwin-arm64": 0.17.12 - "@esbuild/darwin-x64": 0.17.12 - "@esbuild/freebsd-arm64": 0.17.12 - "@esbuild/freebsd-x64": 0.17.12 - "@esbuild/linux-arm": 0.17.12 - "@esbuild/linux-arm64": 0.17.12 - "@esbuild/linux-ia32": 0.17.12 - "@esbuild/linux-loong64": 0.17.12 - "@esbuild/linux-mips64el": 0.17.12 - "@esbuild/linux-ppc64": 0.17.12 - "@esbuild/linux-riscv64": 0.17.12 - "@esbuild/linux-s390x": 0.17.12 - "@esbuild/linux-x64": 0.17.12 - "@esbuild/netbsd-x64": 0.17.12 - "@esbuild/openbsd-x64": 0.17.12 - "@esbuild/sunos-x64": 0.17.12 - "@esbuild/win32-arm64": 0.17.12 - "@esbuild/win32-ia32": 0.17.12 - "@esbuild/win32-x64": 0.17.12 +"esbuild@npm:^0.21.3, esbuild@npm:^0.21.5": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": 0.21.5 + "@esbuild/android-arm": 0.21.5 + "@esbuild/android-arm64": 0.21.5 + "@esbuild/android-x64": 0.21.5 + "@esbuild/darwin-arm64": 0.21.5 + "@esbuild/darwin-x64": 0.21.5 + "@esbuild/freebsd-arm64": 0.21.5 + "@esbuild/freebsd-x64": 0.21.5 + "@esbuild/linux-arm": 0.21.5 + "@esbuild/linux-arm64": 0.21.5 + "@esbuild/linux-ia32": 0.21.5 + "@esbuild/linux-loong64": 0.21.5 + "@esbuild/linux-mips64el": 0.21.5 + "@esbuild/linux-ppc64": 0.21.5 + "@esbuild/linux-riscv64": 0.21.5 + "@esbuild/linux-s390x": 0.21.5 + "@esbuild/linux-x64": 0.21.5 + "@esbuild/netbsd-x64": 0.21.5 + "@esbuild/openbsd-x64": 0.21.5 + "@esbuild/sunos-x64": 0.21.5 + "@esbuild/win32-arm64": 0.21.5 + "@esbuild/win32-ia32": 0.21.5 + "@esbuild/win32-x64": 0.21.5 dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true "@esbuild/android-arm": optional: true "@esbuild/android-arm64": @@ -1424,7 +1949,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: ea6d33eb1bc6c9e00dcee5e253c7e935251b4801d376661fd9f19a9dcffc27f970078a6f7116d6c78ee825ceff9b974594b0b616bd560ce4d875a951aa92977b + checksum: 2911c7b50b23a9df59a7d6d4cdd3a4f85855787f374dce751148dbb13305e0ce7e880dde1608c2ab7a927fc6cec3587b80995f7fc87a64b455f8b70b55fd8ec1 languageName: node linkType: hard @@ -1435,6 +1960,13 @@ __metadata: languageName: node linkType: hard +"escalade@npm:^3.2.0": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 47b029c83de01b0d17ad99ed766347b974b0d628e848de404018f3abee728e987da0d2d370ad4574aa3d5b5bfc368754fd085d69a30f8e75903486ec4b5b709e + languageName: node + linkType: hard + "escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" @@ -1471,6 +2003,15 @@ __metadata: languageName: node linkType: hard +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: ^5.0.1 + checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798 + languageName: node + linkType: hard + "find-up@npm:^3.0.0": version: 3.0.0 resolution: "find-up@npm:3.0.0" @@ -1480,6 +2021,16 @@ __metadata: languageName: node linkType: hard +"foreground-child@npm:^3.1.0": + version: 3.3.0 + resolution: "foreground-child@npm:3.3.0" + dependencies: + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 1989698488f725b05b26bc9afc8a08f08ec41807cd7b92ad85d96004ddf8243fd3e79486b8348c64a3011ae5cc2c9f0936af989e1f28339805d8bc178a75b451 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1506,6 +2057,16 @@ __metadata: languageName: node linkType: hard +"fsevents@npm:~2.3.3": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" + dependencies: + node-gyp: latest + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 + conditions: os=darwin + languageName: node + linkType: hard + "fsevents@patch:fsevents@~2.3.1#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": version: 2.3.2 resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" @@ -1515,6 +2076,15 @@ __metadata: languageName: node linkType: hard +"fsevents@patch:fsevents@~2.3.3#~builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" + dependencies: + node-gyp: latest + conditions: os=darwin + languageName: node + linkType: hard + "function-bind@npm:^1.1.1": version: 1.1.1 resolution: "function-bind@npm:1.1.1" @@ -1554,6 +2124,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.0": + version: 11.0.0 + resolution: "glob@npm:11.0.0" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^4.0.1 + minimatch: ^10.0.0 + minipass: ^7.1.2 + package-json-from-dist: ^1.0.0 + path-scurry: ^2.0.0 + bin: + glob: dist/esm/bin.mjs + checksum: 8a2dd914d5776987be5244624d9491bbcaf19f2387e06783737003ff696ebfd2264190c47014f8709c1c02d8bc892f17660cf986c587b107e194c0a3151ab333 + languageName: node + linkType: hard + "glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -1846,6 +2432,15 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.0.1": + version: 4.0.2 + resolution: "jackspeak@npm:4.0.2" + dependencies: + "@isaacs/cliui": ^8.0.2 + checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 + languageName: node + linkType: hard + "jest-get-type@npm:^29.4.3": version: 29.4.3 resolution: "jest-get-type@npm:29.4.3" @@ -1876,6 +2471,13 @@ __metadata: languageName: node linkType: hard +"js-sha256@npm:^0.10.1": + version: 0.10.1 + resolution: "js-sha256@npm:0.10.1" + checksum: 6eb5c9f95aa902cec1930f036deb3bc664024b75fede456c0ac74b855797776c18620f47efec36787077a56ba2f3b8d6aacc7733ff8a2b5bb9ce6b655a35c5e6 + languageName: node + linkType: hard + "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -1903,6 +2505,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: a36d3ca40574a974d9c2063bf68c2b6141c20da8f2a36bd3279fc802563f35f0527a6c828801295bdfb2803952cf2cf387786c2c90ed564f88d5782475abfe3c + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -1910,7 +2521,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.2": +"json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -1985,6 +2596,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.0.1 + resolution: "lru-cache@npm:11.0.1" + checksum: 6056230a99fb399234e82368b99586bd4740079e80649102f681b19337b7d8c6bc8dd7f8b8c59377c31d26deb89f548b717ae932e139b4b795879d920fccf820 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -2010,15 +2628,6 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.27.0": - version: 0.27.0 - resolution: "magic-string@npm:0.27.0" - dependencies: - "@jridgewell/sourcemap-codec": ^1.4.13 - checksum: 273faaa50baadb7a2df6e442eac34ad611304fc08fe16e24fe2e472fd944bfcb73ffb50d2dc972dc04e92784222002af46868cb9698b1be181c81830fd95a13e - languageName: node - linkType: hard - "make-fetch-happen@npm:^10.0.3": version: 10.2.1 resolution: "make-fetch-happen@npm:10.2.1" @@ -2043,13 +2652,13 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.2": - version: 4.0.2 - resolution: "micromatch@npm:4.0.2" +"micromatch@npm:^4.0.7": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" dependencies: - braces: ^3.0.1 - picomatch: ^2.0.5 - checksum: 39590a96d9ffad21f0afac044d0a5af4f33715a16fdd82c53a01c8f5ff6f70832a31b53e52972dac3deff8bf9f0bed0207d1c34e54ab3306a5e4c4efd5f7d249 + braces: ^3.0.3 + picomatch: ^2.3.1 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 languageName: node linkType: hard @@ -2060,6 +2669,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.0.0": + version: 10.0.1 + resolution: "minimatch@npm:10.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: f5b63c2f30606091a057c5f679b067f84a2cd0ffbd2dbc9143bda850afd353c7be81949ff11ae0c86988f07390eeca64efd7143ee05a0dab37f6c6b38a2ebb6c + languageName: node + linkType: hard + "minimatch@npm:^3.1.1": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -2145,6 +2763,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 2bfd325b95c555f2b4d2814d49325691c7bee937d753814861b0b49d5edcda55cbbf22b6b6a60bb91eddac8668771f03c5ff647dcd9d0f798e9548b9cdc46ee3 + languageName: node + linkType: hard + "minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -2178,7 +2803,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.0.0": +"ms@npm:^2.0.0, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -2192,12 +2817,12 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.4": - version: 3.3.4 - resolution: "nanoid@npm:3.3.4" +"nanoid@npm:^3.3.7": + version: 3.3.7 + resolution: "nanoid@npm:3.3.7" bin: nanoid: bin/nanoid.cjs - checksum: 2fddd6dee994b7676f008d3ffa4ab16035a754f4bb586c61df5a22cf8c8c94017aadd360368f47d653829e0569a92b129979152ff97af23a558331e47e37cd9c + checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 languageName: node linkType: hard @@ -2228,6 +2853,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^2.0.18": + version: 2.0.18 + resolution: "node-releases@npm:2.0.18" + checksum: ef55a3d853e1269a6d6279b7692cd6ff3e40bc74947945101138745bfdc9a5edabfe72cb19a31a8e45752e1910c4c65c77d931866af6357f242b172b7283f5b3 + languageName: node + linkType: hard + "node-releases@npm:^2.0.8": version: 2.0.10 resolution: "node-releases@npm:2.0.10" @@ -2341,6 +2973,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -2376,6 +3015,13 @@ __metadata: languageName: node linkType: hard +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 + languageName: node + linkType: hard + "path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" @@ -2383,6 +3029,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.0 + resolution: "path-scurry@npm:2.0.0" + dependencies: + lru-cache: ^11.0.0 + minipass: ^7.1.2 + checksum: 9953ce3857f7e0796b187a7066eede63864b7e1dfc14bf0484249801a5ab9afb90d9a58fc533ebb1b552d23767df8aa6a2c6c62caf3f8a65f6ce336a97bbb484 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -2404,7 +3060,14 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5, picomatch@npm:^2.2.1": +"picocolors@npm:^1.1.0": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: a64d653d3a188119ff45781dfcdaeedd7625583f45280aea33fcb032c7a0d3959f2368f9b192ad5e8aade75b74dbd954ffe3106c158509a45e4c18ab379a2acd + languageName: node + linkType: hard + +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf @@ -2427,14 +3090,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.21": - version: 8.4.21 - resolution: "postcss@npm:8.4.21" +"postcss@npm:^8.4.43": + version: 8.4.47 + resolution: "postcss@npm:8.4.47" dependencies: - nanoid: ^3.3.4 - picocolors: ^1.0.0 - source-map-js: ^1.0.2 - checksum: e39ac60ccd1542d4f9d93d894048aac0d686b3bb38e927d8386005718e6793dbbb46930f0a523fe382f1bbd843c6d980aaea791252bf5e176180e5a4336d9679 + nanoid: ^3.3.7 + picocolors: ^1.1.0 + source-map-js: ^1.2.1 + checksum: f78440a9d8f97431dd2ab1ab8e1de64f12f3eff38a3d8d4a33919b96c381046a314658d2de213a5fa5eb296b656de76a3ec269fdea27f16d5ab465b916a0f52c languageName: node linkType: hard @@ -2510,10 +3173,10 @@ __metadata: languageName: node linkType: hard -"react-refresh@npm:^0.14.0": - version: 0.14.0 - resolution: "react-refresh@npm:0.14.0" - checksum: dc69fa8c993df512f42dd0f1b604978ae89bd747c0ed5ec595c0cc50d535fb2696619ccd98ae28775cc01d0a7c146a532f0f7fb81dc22e1977c242a4912312f4 +"react-refresh@npm:^0.14.2": + version: 0.14.2 + resolution: "react-refresh@npm:0.14.2" + checksum: d80db4bd40a36dab79010dc8aa317a5b931f960c0d83c4f3b81f0552cbcf7f29e115b84bb7908ec6a1eb67720fff7023084eff73ece8a7ddc694882478464382 languageName: node linkType: hard @@ -2560,7 +3223,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.19.0, resolve@npm:^1.22.1": +"resolve@npm:^1.19.0": version: 1.22.1 resolution: "resolve@npm:1.22.1" dependencies: @@ -2573,7 +3236,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin": +"resolve@patch:resolve@^1.19.0#~builtin": version: 1.22.1 resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d" dependencies: @@ -2614,17 +3277,66 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^3.18.0": - version: 3.20.1 - resolution: "rollup@npm:3.20.1" - dependencies: +"rollup@npm:^4.20.0": + version: 4.24.0 + resolution: "rollup@npm:4.24.0" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.24.0 + "@rollup/rollup-android-arm64": 4.24.0 + "@rollup/rollup-darwin-arm64": 4.24.0 + "@rollup/rollup-darwin-x64": 4.24.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.24.0 + "@rollup/rollup-linux-arm-musleabihf": 4.24.0 + "@rollup/rollup-linux-arm64-gnu": 4.24.0 + "@rollup/rollup-linux-arm64-musl": 4.24.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.24.0 + "@rollup/rollup-linux-riscv64-gnu": 4.24.0 + "@rollup/rollup-linux-s390x-gnu": 4.24.0 + "@rollup/rollup-linux-x64-gnu": 4.24.0 + "@rollup/rollup-linux-x64-musl": 4.24.0 + "@rollup/rollup-win32-arm64-msvc": 4.24.0 + "@rollup/rollup-win32-ia32-msvc": 4.24.0 + "@rollup/rollup-win32-x64-msvc": 4.24.0 + "@types/estree": 1.0.6 fsevents: ~2.3.2 dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-powerpc64le-gnu": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true fsevents: optional: true bin: rollup: dist/bin/rollup - checksum: dc88f337133228311c4d52f005310f2b23ad6d0765b8909698aede1eecde32057ef2ae84e244fd27a45ff944f66f3c120d0b5e163c4642356d2d501df531b798 + checksum: b7e915b0cc43749c2c71255ff58858496460b1a75148db2abecc8e9496af83f488517768593826715f610e20e480a5ae7f1132a1408eb1d364830d6b239325cf languageName: node linkType: hard @@ -2676,6 +3388,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^6.3.1": + version: 6.3.1 + resolution: "semver@npm:6.3.1" + bin: + semver: bin/semver.js + checksum: ae47d06de28836adb9d3e25f22a92943477371292d9b665fb023fae278d345d508ca1958232af086d85e0155aee22e313e100971898bbb8d5d89b8b1d4054ca2 + languageName: node + linkType: hard + "semver@npm:^7.3.5": version: 7.3.8 resolution: "semver@npm:7.3.8" @@ -2694,6 +3415,22 @@ __metadata: languageName: node linkType: hard +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: ^3.0.0 + checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -2701,6 +3438,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "smart-buffer@npm:^4.2.0": version: 4.2.0 resolution: "smart-buffer@npm:4.2.0" @@ -2729,10 +3473,10 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.0.2": - version: 1.0.2 - resolution: "source-map-js@npm:1.0.2" - checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c +"source-map-js@npm:^1.2.1": + version: 1.2.1 + resolution: "source-map-js@npm:1.2.1" + checksum: 4eb0cd997cdf228bc253bcaff9340afeb706176e64868ecd20efbe6efea931465f43955612346d6b7318789e5265bdc419bc7669c1cebe3db0eb255f57efa76b languageName: node linkType: hard @@ -2754,7 +3498,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -2765,6 +3509,17 @@ __metadata: languageName: node linkType: hard +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" + dependencies: + eastasianwidth: ^0.2.0 + emoji-regex: ^9.2.2 + strip-ansi: ^7.0.1 + checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -2774,7 +3529,7 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" dependencies: @@ -2783,6 +3538,15 @@ __metadata: languageName: node linkType: hard +"strip-ansi@npm:^7.0.1": + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" + dependencies: + ansi-regex: ^6.0.1 + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d + languageName: node + linkType: hard + "supports-color@npm:^5.3.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -2915,6 +3679,13 @@ __metadata: languageName: node linkType: hard +"unraw@npm:^3.0.0": + version: 3.0.0 + resolution: "unraw@npm:3.0.0" + checksum: 19eee0bc500ce197d262b79723a2c8c81c1d716baaa2a62c48a4d0d6b9e1fd9d350c5df86262e51343d591ab9c8a47ed150317d0b867b2b65795cdc17ef69873 + languageName: node + linkType: hard + "update-browserslist-db@npm:^1.0.10": version: 1.0.10 resolution: "update-browserslist-db@npm:1.0.10" @@ -2929,6 +3700,20 @@ __metadata: languageName: node linkType: hard +"update-browserslist-db@npm:^1.1.0": + version: 1.1.1 + resolution: "update-browserslist-db@npm:1.1.1" + dependencies: + escalade: ^3.2.0 + picocolors: ^1.1.0 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 2ea11bd2562122162c3e438d83a1f9125238c0844b6d16d366e3276d0c0acac6036822dc7df65fc5a89c699cdf9f174acf439c39bedf3f9a2f3983976e4b4c3e + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -2940,34 +3725,35 @@ __metadata: version: 0.0.0-use.local resolution: "vite-project@workspace:." dependencies: - "@lingui/cli": ^4.1.2 - "@lingui/macro": ^4.1.2 - "@lingui/react": ^4.1.2 - "@lingui/vite-plugin": ^4.1.2 + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/react": ^5.0.0-next.3 + "@lingui/vite-plugin": ^5.0.0-next.3 "@types/react": ^18.0.28 "@types/react-dom": ^18.0.11 - "@vitejs/plugin-react": ^3.1.0 - babel-plugin-macros: ^3.1.0 + "@vitejs/plugin-react": ^4.3.2 react: ^18.2.0 react-dom: ^18.2.0 typescript: ^4.9.3 - vite: ^4.2.0 + vite: ^5.4.9 languageName: unknown linkType: soft -"vite@npm:^4.2.0": - version: 4.2.1 - resolution: "vite@npm:4.2.1" +"vite@npm:^5.4.9": + version: 5.4.9 + resolution: "vite@npm:5.4.9" dependencies: - esbuild: ^0.17.5 - fsevents: ~2.3.2 - postcss: ^8.4.21 - resolve: ^1.22.1 - rollup: ^3.18.0 + esbuild: ^0.21.3 + fsevents: ~2.3.3 + postcss: ^8.4.43 + rollup: ^4.20.0 peerDependencies: - "@types/node": ">= 14" + "@types/node": ^18.0.0 || >=20.0.0 less: "*" + lightningcss: ^1.21.0 sass: "*" + sass-embedded: "*" stylus: "*" sugarss: "*" terser: ^5.4.0 @@ -2979,8 +3765,12 @@ __metadata: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true + sass-embedded: + optional: true stylus: optional: true sugarss: @@ -2989,7 +3779,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 70eb162ffc299017a3c310e3adc95e9661def6b17aafd1f8e5e02e516766060435590dbe3df1e4e95acc3583c728a76e91f07c546221d1e701f1b2b021293f45 + checksum: d3229e0618ece284af0478ec09c474a7a70ac369920716afdb6ebed8e320fd17a17c60afddba0d436698fe4837474cccd057c3e7d8270281b57506b78c5fbb8c languageName: node linkType: hard @@ -3020,7 +3810,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^2.0.2": +"which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" dependencies: @@ -3040,6 +3830,28 @@ __metadata: languageName: node linkType: hard +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + languageName: node + linkType: hard + +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" diff --git a/examples/vite-project-react-swc/package.json b/examples/vite-project-react-swc/package.json index 2f4819bb7..c17cd6c0c 100644 --- a/examples/vite-project-react-swc/package.json +++ b/examples/vite-project-react-swc/package.json @@ -10,22 +10,22 @@ "preview": "vite preview" }, "resolutions": { - "@swc/core": "1.3.56" + "@swc/core": "1.5.7" }, "dependencies": { - "@lingui/macro": "^4.2.0", - "@lingui/react": "^4.2.0", + "@lingui/core": "^5.0.0-next.3", + "@lingui/react": "^5.0.0-next.3", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@lingui/cli": "^4.2.0", - "@lingui/swc-plugin": "4.0.0", - "@lingui/vite-plugin": "^4.2.0", + "@lingui/cli": "^5.0.0-next.3", + "@lingui/swc-plugin": "5.0.0-next.2", + "@lingui/vite-plugin": "^5.0.0-next.3", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react-swc": "^3.0.0", + "@vitejs/plugin-react-swc": "3.7.0", "typescript": "^4.9.3", - "vite": "4.2.0" + "vite": "5.4.9" } } diff --git a/examples/vite-project-react-swc/src/App.tsx b/examples/vite-project-react-swc/src/App.tsx index 70b17c488..996e21c8e 100644 --- a/examples/vite-project-react-swc/src/App.tsx +++ b/examples/vite-project-react-swc/src/App.tsx @@ -3,7 +3,7 @@ import reactLogo from "./assets/react.svg" import linguiLogo from "./assets/lingui-logo.svg" import viteLogo from "/vite.svg" import "./App.css" -import { Plural, Trans } from "@lingui/macro" +import { Plural, Trans } from "@lingui/react/macro" import { I18nProvider } from "@lingui/react" import { i18n } from "@lingui/core" import { loadCatalog } from "./i18n" diff --git a/examples/vite-project-react-swc/yarn.lock b/examples/vite-project-react-swc/yarn.lock index f48bc572e..77a75456f 100644 --- a/examples/vite-project-react-swc/yarn.lock +++ b/examples/vite-project-react-swc/yarn.lock @@ -24,6 +24,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/code-frame@npm:7.25.7" + dependencies: + "@babel/highlight": ^7.25.7 + picocolors: ^1.0.0 + checksum: f235cdf9c5d6f172898a27949bd63731c5f201671f77bcf4c2ad97229bc462d89746c1a7f5671a132aecff5baf43f3d878b93a7ecc6aa71f9612d2b51270c53e + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.22.0": version: 7.22.3 resolution: "@babel/compat-data@npm:7.22.3" @@ -31,6 +41,36 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.25.7": + version: 7.25.8 + resolution: "@babel/compat-data@npm:7.25.8" + checksum: 7ac648b110ec0fcd3a3d3fc62c69c0325b536b3c97bafea8a4392dfc68d9ea9ab1f36d1b2f231d404473fc81f503b4a630425677fc9a3cce2ee33d74842ea109 + languageName: node + linkType: hard + +"@babel/core@npm:^7.20.12": + version: 7.25.8 + resolution: "@babel/core@npm:7.25.8" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/helper-compilation-targets": ^7.25.7 + "@babel/helper-module-transforms": ^7.25.7 + "@babel/helpers": ^7.25.7 + "@babel/parser": ^7.25.8 + "@babel/template": ^7.25.7 + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.8 + convert-source-map: ^2.0.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.3 + semver: ^6.3.1 + checksum: 77ddf693faf6997915e7bbe16e9f21ca1c0e58bc60ace9eac51c373b21d1b46ce50de650195c136a594b0e5fcb901ca17bb57c2d20bf175b3c325211138bcfde + languageName: node + linkType: hard + "@babel/core@npm:^7.21.0": version: 7.22.1 resolution: "@babel/core@npm:7.22.1" @@ -66,6 +106,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/generator@npm:7.25.7" + dependencies: + "@babel/types": ^7.25.7 + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.25 + jsesc: ^3.0.2 + checksum: f81cf9dc0191ae4411d82978114382ad6e047bfb678f9a95942bac5034a41719d88f047679f5e2f51ba7728b54ebd1cc32a10df7b556215d8a6ab9bdd4f11831 + languageName: node + linkType: hard + "@babel/helper-compilation-targets@npm:^7.22.1": version: 7.22.1 resolution: "@babel/helper-compilation-targets@npm:7.22.1" @@ -81,6 +133,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-compilation-targets@npm:7.25.7" + dependencies: + "@babel/compat-data": ^7.25.7 + "@babel/helper-validator-option": ^7.25.7 + browserslist: ^4.24.0 + lru-cache: ^5.1.1 + semver: ^6.3.1 + checksum: 5b57e7d4b9302c07510ad3318763c053c3d46f2d40a45c2ea0c59160ccf9061a34975ae62f36a32f15d8d03497ecd5ca43a96417c1fd83eb8c035e77a69840ef + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.22.1": version: 7.22.1 resolution: "@babel/helper-environment-visitor@npm:7.22.1" @@ -116,6 +181,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-imports@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a7255755e9799978de4bf72563b94b53cf955e5fc3d2acc67c783d3b84d5d34dd41691e473ecc124a94654483fff573deacd87eccd8bd16b47ac4455b5941b30 + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.22.1": version: 7.22.1 resolution: "@babel/helper-module-transforms@npm:7.22.1" @@ -132,6 +207,20 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-module-transforms@npm:7.25.7" + dependencies: + "@babel/helper-module-imports": ^7.25.7 + "@babel/helper-simple-access": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + "@babel/traverse": ^7.25.7 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: b1daeded78243da969d90b105a564ed918dcded66fba5cd24fe09cb13f7ee9e84d9b9dee789d60237b9a674582d9831a35dbaf6f0a92a3af5f035234a5422814 + languageName: node + linkType: hard + "@babel/helper-simple-access@npm:^7.21.5": version: 7.21.5 resolution: "@babel/helper-simple-access@npm:7.21.5" @@ -141,6 +230,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-simple-access@npm:7.25.7" + dependencies: + "@babel/traverse": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 684d0b0330c42d62834355f127df3ed78f16e6f1f66213c72adb7b3b0bcd6283ea8792f5b172868b3ca6518c479b54e18adac564219519072dda9053cca210bd + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-split-export-declaration@npm:7.18.6" @@ -157,6 +256,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-string-parser@npm:7.25.7" + checksum: 0835fda5efe02cdcb5144a939b639acc017ba4aa1cc80524b44032ddb714080d3e40e8f0d3240832b7bd86f5513f0b63d4fe77d8fc52d8c8720ae674182c0753 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.18.6, @babel/helper-validator-identifier@npm:^7.19.1": version: 7.19.1 resolution: "@babel/helper-validator-identifier@npm:7.19.1" @@ -164,6 +270,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-identifier@npm:7.25.7" + checksum: 062f55208deead4876eb474dc6fd55155c9eada8d0a505434de3b9aa06c34195562e0f3142b22a08793a38d740238efa2fe00ff42956cdcb8ac03f0b6c542247 + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.21.0": version: 7.21.0 resolution: "@babel/helper-validator-option@npm:7.21.0" @@ -171,6 +284,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helper-validator-option@npm:7.25.7" + checksum: 87b801fe7d8337699f2fba5323243dd974ea214d27cf51faf2f0063da6dc5bb67c9bb7867fd337573870f9ab498d2788a75bcf9685442bd9430611c62b0195d1 + languageName: node + linkType: hard + "@babel/helpers@npm:^7.22.0": version: 7.22.3 resolution: "@babel/helpers@npm:7.22.3" @@ -182,6 +302,16 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/helpers@npm:7.25.7" + dependencies: + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: a73242850915ef2956097431fbab3a840b7d6298555ad4c6f596db7d1b43cf769181716e7b65f8f7015fe48748b9c454d3b9c6cf4506cb840b967654463b0819 + languageName: node + linkType: hard + "@babel/highlight@npm:^7.18.6": version: 7.18.6 resolution: "@babel/highlight@npm:7.18.6" @@ -193,7 +323,19 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.21.2, @babel/parser@npm:^7.21.9, @babel/parser@npm:^7.22.0, @babel/parser@npm:^7.22.4": +"@babel/highlight@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/highlight@npm:7.25.7" + dependencies: + "@babel/helper-validator-identifier": ^7.25.7 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + picocolors: ^1.0.0 + checksum: b6aa45c5bf7ecc16b8204bbed90335706131ac6cacb0f1bfb1b862ada3741539c913b56c9d26beb56cece0c231ffab36f66aa36aac6b04b32669c314705203f2 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.21.9, @babel/parser@npm:^7.22.0, @babel/parser@npm:^7.22.4": version: 7.22.4 resolution: "@babel/parser@npm:7.22.4" bin: @@ -202,6 +344,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.7, @babel/parser@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/parser@npm:7.25.8" + dependencies: + "@babel/types": ^7.25.8 + bin: + parser: ./bin/babel-parser.js + checksum: c33f6d26542f156927c5dbe131265c791177d271e582338e960f803903086ec5c152bf25deae5f4c061b7bee14dc0b5fd2882ccb5a21c16ee0738d24fcc0406e + languageName: node + linkType: hard + "@babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.21.0": version: 7.22.3 resolution: "@babel/runtime@npm:7.22.3" @@ -222,6 +375,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/template@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/types": ^7.25.7 + checksum: 83f025a4a777103965ee41b7c0fa2bb1c847ea7ed2b9f2cb258998ea96dfc580206176b532edf6d723d85237bc06fca26be5c8772e2af7d9e4fe6927e3bed8a3 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.22.1": version: 7.22.4 resolution: "@babel/traverse@npm:7.22.4" @@ -240,6 +404,21 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.25.7": + version: 7.25.7 + resolution: "@babel/traverse@npm:7.25.7" + dependencies: + "@babel/code-frame": ^7.25.7 + "@babel/generator": ^7.25.7 + "@babel/parser": ^7.25.7 + "@babel/template": ^7.25.7 + "@babel/types": ^7.25.7 + debug: ^4.3.1 + globals: ^11.1.0 + checksum: 4d329b6e7a409a63f4815bbc0a08d0b0cb566c5a2fecd1767661fe1821ced213c554d7d74e6aca048672fed2c8f76071cb0d94f4bd5f120fba8d55a38af63094 + languageName: node + linkType: hard + "@babel/types@npm:^7.18.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.2, @babel/types@npm:^7.21.4, @babel/types@npm:^7.21.5, @babel/types@npm:^7.22.0, @babel/types@npm:^7.22.3, @babel/types@npm:^7.22.4, @babel/types@npm:^7.8.3": version: 7.22.4 resolution: "@babel/types@npm:7.22.4" @@ -251,156 +430,174 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/android-arm64@npm:0.17.19" +"@babel/types@npm:^7.25.7, @babel/types@npm:^7.25.8": + version: 7.25.8 + resolution: "@babel/types@npm:7.25.8" + dependencies: + "@babel/helper-string-parser": ^7.25.7 + "@babel/helper-validator-identifier": ^7.25.7 + to-fast-properties: ^2.0.0 + checksum: 93d84858e820dbfa0fc4882b3ba6a421544d224ee61455a58eed0af9fc3518b30dc2166b8ba48cdd2e91083c5885ed773c36acf46d177b7b1fad9c35b6eb7639 + languageName: node + linkType: hard + +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@esbuild/android-arm@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/android-arm@npm:0.17.19" +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@esbuild/android-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/android-x64@npm:0.17.19" +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" conditions: os=android & cpu=x64 languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/darwin-arm64@npm:0.17.19" +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/darwin-x64@npm:0.17.19" +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/freebsd-arm64@npm:0.17.19" +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/freebsd-x64@npm:0.17.19" +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-arm64@npm:0.17.19" +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-arm@npm:0.17.19" +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-ia32@npm:0.17.19" +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" conditions: os=linux & cpu=ia32 languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-loong64@npm:0.17.19" +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-mips64el@npm:0.17.19" +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" conditions: os=linux & cpu=mips64el languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-ppc64@npm:0.17.19" +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-riscv64@npm:0.17.19" +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-s390x@npm:0.17.19" +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" conditions: os=linux & cpu=s390x languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/linux-x64@npm:0.17.19" +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/netbsd-x64@npm:0.17.19" +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/openbsd-x64@npm:0.17.19" +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/sunos-x64@npm:0.17.19" +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" conditions: os=sunos & cpu=x64 languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/win32-arm64@npm:0.17.19" +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/win32-ia32@npm:0.17.19" +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.17.19": - version: 0.17.19 - resolution: "@esbuild/win32-x64@npm:0.17.19" +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -412,6 +609,20 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + "@jest/schemas@npm:^29.4.3": version: 29.4.3 resolution: "@jest/schemas@npm:29.4.3" @@ -446,6 +657,17 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": ^1.2.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.24 + checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:3.1.0": version: 3.1.0 resolution: "@jridgewell/resolve-uri@npm:3.1.0" @@ -453,6 +675,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.2 + resolution: "@jridgewell/resolve-uri@npm:3.1.2" + checksum: 83b85f72c59d1c080b4cbec0fef84528963a1b5db34e4370fa4bd1e3ff64a0d80e0cee7369d11d73c704e0286fb2865b530acac7a871088fbe92b5edf1000870 + languageName: node + linkType: hard + "@jridgewell/set-array@npm:^1.0.1": version: 1.1.2 resolution: "@jridgewell/set-array@npm:1.1.2" @@ -460,6 +689,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:1.4.14": version: 1.4.14 resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" @@ -474,6 +710,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.5.0 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" + checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec + languageName: node + linkType: hard + "@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.18 resolution: "@jridgewell/trace-mapping@npm:0.3.18" @@ -484,38 +727,68 @@ __metadata: languageName: node linkType: hard -"@lingui/babel-plugin-extract-messages@npm:4.2.0": - version: 4.2.0 - resolution: "@lingui/babel-plugin-extract-messages@npm:4.2.0" - checksum: fd10f77e9242a6e4d79a8027a68e3cb14f23749ea1770075c67742f509f7744c862416a103557ba7652e736ba50f50a05478ac8c779d347f3f674e3be8c258a6 +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 9d3c40d225e139987b50c48988f8717a54a8c994d8a948ee42e1412e08988761d0754d7d10b803061cc3aebf35f92a5dbbab493bd0e1a9ef9e89a2130e83ba34 languageName: node linkType: hard -"@lingui/cli@npm:4.2.0, @lingui/cli@npm:^4.2.0": - version: 4.2.0 - resolution: "@lingui/cli@npm:4.2.0" +"@lingui/babel-plugin-extract-messages@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-extract-messages@npm:5.0.0-next.3" + checksum: a0c7632295c4e07eab9b5754b0f3e2944a7b59dda8cbbdacb5ba5c500b7be9c73b44e114bd1323dc3a6fa4ff64657f7f6d9b8c981facd2c55c782577418f68d8 + languageName: node + linkType: hard + +"@lingui/babel-plugin-lingui-macro@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/babel-plugin-lingui-macro@npm:5.0.0-next.3" + dependencies: + "@babel/core": ^7.20.12 + "@babel/runtime": ^7.20.13 + "@babel/types": ^7.20.7 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + peerDependencies: + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: ac7ebe134c4c324a1945de6cbc1f28c9d821233fa3d5228134034fde420e5f38f9c240cd090de6cae905dfe910496462c304e73d25ecf6a91e23afc3458c6248 + languageName: node + linkType: hard + +"@lingui/cli@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/cli@npm:5.0.0-next.3" dependencies: "@babel/core": ^7.21.0 "@babel/generator": ^7.21.1 - "@babel/parser": ^7.21.2 + "@babel/parser": ^7.22.0 "@babel/runtime": ^7.21.0 "@babel/types": ^7.21.2 - "@lingui/babel-plugin-extract-messages": 4.2.0 - "@lingui/conf": 4.2.0 - "@lingui/core": 4.2.0 - "@lingui/format-po": 4.2.0 - "@lingui/message-utils": 4.2.0 + "@lingui/babel-plugin-extract-messages": ^5.0.0-next.3 + "@lingui/babel-plugin-lingui-macro": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/format-po": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 babel-plugin-macros: ^3.0.1 chalk: ^4.1.0 chokidar: 3.5.1 - cli-table: 0.3.6 + cli-table: ^0.3.11 commander: ^10.0.0 convert-source-map: ^2.0.0 - date-fns: ^2.16.1 - esbuild: ^0.17.10 - glob: ^7.1.4 + date-fns: ^3.6.0 + esbuild: ^0.21.5 + glob: ^11.0.0 inquirer: ^7.3.3 - micromatch: 4.0.2 + micromatch: ^4.0.7 normalize-path: ^3.0.0 ora: ^5.1.0 pathe: ^1.1.0 @@ -526,13 +799,13 @@ __metadata: source-map: ^0.8.0-beta.0 bin: lingui: dist/lingui.js - checksum: 80268fc87c24e41495a95a5477dc6451b242742c183574c94a0591da4159582e89fdc1e889e28821392d424e501ddb6319996d4de165ea0ad7307c014661c245 + checksum: eada44db8e4c16fa4de50e46cf98889d8b787cf5accfca3edbb8bad9e45f77054e54f2bfffcbbf64f35d2f8199d0349cde69f57a5da49f4b34deb509b065bfd9 languageName: node linkType: hard -"@lingui/conf@npm:4.2.0": - version: 4.2.0 - resolution: "@lingui/conf@npm:4.2.0" +"@lingui/conf@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/conf@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 chalk: ^4.1.0 @@ -540,87 +813,93 @@ __metadata: jest-validate: ^29.4.3 jiti: ^1.17.1 lodash.get: ^4.4.2 - checksum: baafb3b37f07ad83ac84427eb3400529a689982718a862ca375eb15c8553780051c46c3d8a9b7c921285046a2395b2e5fa36688cd1cea7336254fa5a11954c5c + checksum: c618ab075f96678fc1bb32326b5b0a2ff43e1ab3320b79493bf8f2525e2fa3fa85215d848eb7b4d2db816671c80c92c680868029c9fc34cceb9a3177fa9126ca languageName: node linkType: hard -"@lingui/core@npm:4.2.0": - version: 4.2.0 - resolution: "@lingui/core@npm:4.2.0" +"@lingui/core@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/core@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/message-utils": 4.2.0 - checksum: 116fc0f6f3554492733743f152ec790c03f18141c6319f7a5041dc65c0d3058ac73ba0b0cb83cd4ed093ea854bd38deaac4a6726ac27208db6a1fcb8b0f0bc8f + "@lingui/message-utils": ^5.0.0-next.3 + unraw: ^3.0.0 + peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: 4544ed44b2bc16ac6c0bf957b470608ba5ae4f62035030e706f9347225cefd0f845872658af728e758118f04cd65c1e7c851ebf6e7d1d7a660d30bf8404883df languageName: node linkType: hard -"@lingui/format-po@npm:4.2.0": - version: 4.2.0 - resolution: "@lingui/format-po@npm:4.2.0" +"@lingui/format-po@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/format-po@npm:5.0.0-next.3" dependencies: - "@lingui/conf": 4.2.0 - "@lingui/message-utils": 4.2.0 - date-fns: ^2.29.3 + "@lingui/conf": ^5.0.0-next.3 + "@lingui/message-utils": ^5.0.0-next.3 + date-fns: ^3.6.0 pofile: ^1.1.4 - checksum: 7a58f58f90a7f2b89f774c687e91814eca29e307e4e008d62f38daefb28eb6cd40b061def0366c060144fbae14ab7c1fe99a13b504bb83b49c9c7b21eda64c8e - languageName: node - linkType: hard - -"@lingui/macro@npm:^4.2.0": - version: 4.2.0 - resolution: "@lingui/macro@npm:4.2.0" - dependencies: - "@babel/runtime": ^7.20.13 - "@babel/types": ^7.20.7 - "@lingui/conf": 4.2.0 - "@lingui/core": 4.2.0 - "@lingui/message-utils": 4.2.0 - peerDependencies: - "@lingui/react": ^4.0.0 - babel-plugin-macros: 2 || 3 - checksum: c3a9167153876417516e2ec41c33559c7a3e584abc74854a32795e89ac8b5a501102053def551d60d3f1b1c478719aecd51abc3e336b1e5f8a5be0a65e6456ed + checksum: c73b4e2c4b95e4475e5c676817dc0299e9b46e5bf05f5c9204cc8b99fe65770072464aecdd0c93d4ae4492f384905469258b2786b5d546164e904d97019c9165 languageName: node linkType: hard -"@lingui/message-utils@npm:4.2.0": - version: 4.2.0 - resolution: "@lingui/message-utils@npm:4.2.0" +"@lingui/message-utils@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/message-utils@npm:5.0.0-next.3" dependencies: "@messageformat/parser": ^5.0.0 - checksum: 7a4ff9032e6735da8e08b0d2e50b9d15534e425d795173d422d273abe3852ce52aa7f8d72b65678f3bbb443de706141b1bef0665d2aed6e98e73659c00eb7354 + js-sha256: ^0.10.1 + checksum: 9aad0d2ae0829231b6683d2681aeb1703d06093bfc9a65037e58d2051496c1efe92f8d72edda85695c53aff5c075e28b4601bf10ad76d0883d74e662e1cdb02d languageName: node linkType: hard -"@lingui/react@npm:^4.2.0": - version: 4.2.0 - resolution: "@lingui/react@npm:4.2.0" +"@lingui/react@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/react@npm:5.0.0-next.3" dependencies: "@babel/runtime": ^7.20.13 - "@lingui/core": 4.2.0 + "@lingui/core": ^5.0.0-next.3 peerDependencies: + "@lingui/babel-plugin-lingui-macro": 5.0.0-next.3 + babel-plugin-macros: 2 || 3 react: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 9241c666ea9154e069c139ef97a6714c03ea75e445a6ac78d948fb67f1a965b5ace35a77fb400e4e4857f0622a01a4abf6c7073dd2bd973ec2abdc8437470737 + peerDependenciesMeta: + "@lingui/babel-plugin-lingui-macro": + optional: true + babel-plugin-macros: + optional: true + checksum: c02d01d11fe308718c7cb497811a3f4f7ee33ae0bbb217e1428ece9318d24d70c2649cb6dd4d430585fb8d8384e2f9e8ff7d1aa4cce0a1d2f49e23c28e3660dd languageName: node linkType: hard -"@lingui/swc-plugin@npm:4.0.0": - version: 4.0.0 - resolution: "@lingui/swc-plugin@npm:4.0.0" +"@lingui/swc-plugin@npm:5.0.0-next.2": + version: 5.0.0-next.2 + resolution: "@lingui/swc-plugin@npm:5.0.0-next.2" peerDependencies: "@lingui/macro": 4 - checksum: 50b104db7f77659d94d954466b0161cc06bc694e89b5a8315106324f886a18b1fc02c58e054c2e26ed51861ed82bea5889b31f671a60be28b31794975dca2d72 + peerDependenciesMeta: + "@swc/core": + optional: true + next: + optional: true + checksum: 4e5655f699577d22aa99099393d2e5bd7eaa94db011c1196d63c91cac5ea590796f1d1685aa19e2213195b55020350b9ac7d44a39051621da5e1a5cb3349bd74 languageName: node linkType: hard -"@lingui/vite-plugin@npm:^4.2.0": - version: 4.2.0 - resolution: "@lingui/vite-plugin@npm:4.2.0" +"@lingui/vite-plugin@npm:^5.0.0-next.3": + version: 5.0.0-next.3 + resolution: "@lingui/vite-plugin@npm:5.0.0-next.3" dependencies: - "@lingui/cli": 4.2.0 - "@lingui/conf": 4.2.0 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/conf": ^5.0.0-next.3 peerDependencies: - vite: 3 - 4 - checksum: 43576af82dda0db4897aae848dd73d1e0a54727f9e74e4ab7a359ac6717f72ae099f3f44c09511e58127451da0dfb55ae5e414991a49d24cf122a2f0b6367333 + vite: ^3 || ^4 || ^5.0.9 + checksum: 4ee7528765d45cbb60df868307d6f488b36f94afc7c9f64c2fac3c64c4ffa91c2dc730b4d9f56b244c14a0b09510a8be3cb455f907e439f1ce0748e7a3897655 languageName: node linkType: hard @@ -653,6 +932,118 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-android-arm-eabi@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.24.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-android-arm64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-android-arm64@npm:4.24.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.24.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.24.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-gnueabihf@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.24.0" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-musleabihf@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.24.0" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.24.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.24.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.24.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.24.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-s390x-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.24.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.24.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.24.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.24.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.24.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.24.0": + version: 4.24.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.24.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@sinclair/typebox@npm:^0.25.16": version: 0.25.24 resolution: "@sinclair/typebox@npm:0.25.24" @@ -660,90 +1051,92 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-darwin-arm64@npm:1.3.56" +"@swc/core-darwin-arm64@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-darwin-arm64@npm:1.5.7" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-darwin-x64@npm:1.3.56" +"@swc/core-darwin-x64@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-darwin-x64@npm:1.5.7" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.56" +"@swc/core-linux-arm-gnueabihf@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.5.7" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-linux-arm64-gnu@npm:1.3.56" +"@swc/core-linux-arm64-gnu@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-linux-arm64-gnu@npm:1.5.7" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-linux-arm64-musl@npm:1.3.56" +"@swc/core-linux-arm64-musl@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-linux-arm64-musl@npm:1.5.7" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-linux-x64-gnu@npm:1.3.56" +"@swc/core-linux-x64-gnu@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-linux-x64-gnu@npm:1.5.7" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-linux-x64-musl@npm:1.3.56" +"@swc/core-linux-x64-musl@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-linux-x64-musl@npm:1.5.7" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-win32-arm64-msvc@npm:1.3.56" +"@swc/core-win32-arm64-msvc@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-win32-arm64-msvc@npm:1.5.7" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-win32-ia32-msvc@npm:1.3.56" +"@swc/core-win32-ia32-msvc@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-win32-ia32-msvc@npm:1.5.7" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core-win32-x64-msvc@npm:1.3.56" +"@swc/core-win32-x64-msvc@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core-win32-x64-msvc@npm:1.5.7" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@swc/core@npm:1.3.56": - version: 1.3.56 - resolution: "@swc/core@npm:1.3.56" +"@swc/core@npm:1.5.7": + version: 1.5.7 + resolution: "@swc/core@npm:1.5.7" dependencies: - "@swc/core-darwin-arm64": 1.3.56 - "@swc/core-darwin-x64": 1.3.56 - "@swc/core-linux-arm-gnueabihf": 1.3.56 - "@swc/core-linux-arm64-gnu": 1.3.56 - "@swc/core-linux-arm64-musl": 1.3.56 - "@swc/core-linux-x64-gnu": 1.3.56 - "@swc/core-linux-x64-musl": 1.3.56 - "@swc/core-win32-arm64-msvc": 1.3.56 - "@swc/core-win32-ia32-msvc": 1.3.56 - "@swc/core-win32-x64-msvc": 1.3.56 + "@swc/core-darwin-arm64": 1.5.7 + "@swc/core-darwin-x64": 1.5.7 + "@swc/core-linux-arm-gnueabihf": 1.5.7 + "@swc/core-linux-arm64-gnu": 1.5.7 + "@swc/core-linux-arm64-musl": 1.5.7 + "@swc/core-linux-x64-gnu": 1.5.7 + "@swc/core-linux-x64-musl": 1.5.7 + "@swc/core-win32-arm64-msvc": 1.5.7 + "@swc/core-win32-ia32-msvc": 1.5.7 + "@swc/core-win32-x64-msvc": 1.5.7 + "@swc/counter": ^0.1.2 + "@swc/types": 0.1.7 peerDependencies: "@swc/helpers": ^0.5.0 dependenciesMeta: @@ -770,7 +1163,23 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 9e05f09450c9ba2851655faf2e139e965b36d80dc2862a688a716117d45883fc749d3bcfad755c7a6a04d9bada9b0eb569ff6872853d4a4f5a99e5e6d33f1a44 + checksum: 8e11626b782df914ee53dcb3e7f52e4bd2e1a896873c0e76ec674d19d05d87eec06e2223e0958d68ef1e0cdfb4cd505e3b1a297561e9506063738337f0c5409d + languageName: node + linkType: hard + +"@swc/counter@npm:^0.1.2, @swc/counter@npm:^0.1.3": + version: 0.1.3 + resolution: "@swc/counter@npm:0.1.3" + checksum: df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598 + languageName: node + linkType: hard + +"@swc/types@npm:0.1.7": + version: 0.1.7 + resolution: "@swc/types@npm:0.1.7" + dependencies: + "@swc/counter": ^0.1.3 + checksum: e251f6994de12a2a81ed79d902a521398feda346022e09567c758eee1cca606743c9bb296de74d6fbe339f953eaf69176202babc8ef9c911d5d538fc0790df28 languageName: node linkType: hard @@ -781,6 +1190,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:1.0.6": + version: 1.0.6 + resolution: "@types/estree@npm:1.0.6" + checksum: 8825d6e729e16445d9a1dd2fb1db2edc5ed400799064cd4d028150701031af012ba30d6d03fe9df40f4d7a437d0de6d2b256020152b7b09bde9f2e420afdffd9 + languageName: node + linkType: hard + "@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0": version: 2.0.4 resolution: "@types/istanbul-lib-coverage@npm:2.0.4" @@ -870,14 +1286,14 @@ __metadata: languageName: node linkType: hard -"@vitejs/plugin-react-swc@npm:^3.0.0": - version: 3.3.1 - resolution: "@vitejs/plugin-react-swc@npm:3.3.1" +"@vitejs/plugin-react-swc@npm:3.7.0": + version: 3.7.0 + resolution: "@vitejs/plugin-react-swc@npm:3.7.0" dependencies: - "@swc/core": ^1.3.56 + "@swc/core": ^1.5.7 peerDependencies: - vite: ^4 - checksum: 22756c76b699a51f8152a09e0c89a102de8d1fe2858d05012c46e2cf12539e3b16db319583f7e5f606fc6aa29dc87da0a5f695fa88bf4ab6bc4e06f2feb97533 + vite: ^4 || ^5 + checksum: 87ee71cc7d261a0047a1a080c81081cb163edd555e1c8c60ff3372d14b7d76a19a28a7a03334417f622e704abd67e39e89a59d45f4742ec7036ca2988ee6651f languageName: node linkType: hard @@ -934,6 +1350,13 @@ __metadata: languageName: node linkType: hard +"ansi-regex@npm:^6.0.1": + version: 6.1.0 + resolution: "ansi-regex@npm:6.1.0" + checksum: 495834a53b0856c02acd40446f7130cb0f8284f4a39afdab20d5dc42b2e198b1196119fe887beed8f9055c4ff2055e3b2f6d4641d0be018cdfb64fedf6fc1aac + languageName: node + linkType: hard + "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -943,7 +1366,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^4.1.0": +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": version: 4.3.0 resolution: "ansi-styles@npm:4.3.0" dependencies: @@ -959,6 +1382,13 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + "anymatch@npm:~3.1.1": version: 3.1.3 resolution: "anymatch@npm:3.1.3" @@ -1055,7 +1485,16 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1, braces@npm:~3.0.2": +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: ^7.1.1 + checksum: b95aa0b3bd909f6cd1720ffcf031aeaf46154dd88b4da01f9a1d3f7ea866a79eba76a6d01cbc3c422b2ee5cdc39a4f02491058d5df0d7bf6e6a162a832df1f69 + languageName: node + linkType: hard + +"braces@npm:~3.0.2": version: 3.0.2 resolution: "braces@npm:3.0.2" dependencies: @@ -1078,6 +1517,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.24.0": + version: 4.24.0 + resolution: "browserslist@npm:4.24.0" + dependencies: + caniuse-lite: ^1.0.30001663 + electron-to-chromium: ^1.5.28 + node-releases: ^2.0.18 + update-browserslist-db: ^1.1.0 + bin: + browserslist: cli.js + checksum: de200d3eb8d6ed819dad99719099a28fb6ebeb88016a5ac42fbdc11607e910c236a84ca1b0bbf232477d4b88ab64e8ab6aa67557cdd40a73ca9c2834f92ccce0 + languageName: node + linkType: hard + "buffer@npm:^5.5.0": version: 5.7.1 resolution: "buffer@npm:5.7.1" @@ -1135,7 +1588,14 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^2.0.0": +"caniuse-lite@npm:^1.0.30001663": + version: 1.0.30001669 + resolution: "caniuse-lite@npm:1.0.30001669" + checksum: 8ed0c69d0c6aa3b1cbc5ba4e5f5330943e7b7165e257f6955b8b73f043d07ad922265261f2b54d9bbaf02886bbdba5e6f5b16662310a13f91f17035af3212de1 + languageName: node + linkType: hard + +"chalk@npm:^2.0.0, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -1212,12 +1672,12 @@ __metadata: languageName: node linkType: hard -"cli-table@npm:0.3.6": - version: 0.3.6 - resolution: "cli-table@npm:0.3.6" +"cli-table@npm:^0.3.11": + version: 0.3.11 + resolution: "cli-table@npm:0.3.11" dependencies: colors: 1.0.3 - checksum: b0cd08578c810240920438cc2b3ffb4b4f5106b29f3362707f1d8cfc0c0440ad2afb70b96e30ce37f72f0ffe1e844ae7341dde4df17d51ad345eb186a5903af2 + checksum: 59fb61f992ac9bc8610ed98c72bf7f5d396c5afb42926b6747b46b0f8bb98a0dfa097998e77542ac334c1eb7c18dbf4f104d5783493273c5ec4c34084aa7c663 languageName: node linkType: hard @@ -1343,6 +1803,17 @@ __metadata: languageName: node linkType: hard +"cross-spawn@npm:^7.0.0": + version: 7.0.3 + resolution: "cross-spawn@npm:7.0.3" + dependencies: + path-key: ^3.1.0 + shebang-command: ^2.0.0 + which: ^2.0.1 + checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52 + languageName: node + linkType: hard + "csstype@npm:^3.0.2": version: 3.1.2 resolution: "csstype@npm:3.1.2" @@ -1350,12 +1821,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.16.1, date-fns@npm:^2.29.3": - version: 2.30.0 - resolution: "date-fns@npm:2.30.0" - dependencies: - "@babel/runtime": ^7.21.0 - checksum: f7be01523282e9bb06c0cd2693d34f245247a29098527d4420628966a2d9aad154bd0e90a6b1cf66d37adcb769cd108cf8a7bd49d76db0fb119af5cdd13644f4 +"date-fns@npm:^3.6.0": + version: 3.6.0 + resolution: "date-fns@npm:3.6.0" + checksum: 0daa1e9a436cf99f9f2ae9232b55e11f3dd46132bee10987164f3eebd29f245b2e066d7d7db40782627411ecf18551d8f4c9fcdf2226e48bb66545407d448ab7 languageName: node linkType: hard @@ -1371,6 +1840,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.3.1": + version: 4.3.7 + resolution: "debug@npm:4.3.7" + dependencies: + ms: ^2.1.3 + peerDependenciesMeta: + supports-color: + optional: true + checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 + languageName: node + linkType: hard + "defaults@npm:^1.0.3": version: 1.0.4 resolution: "defaults@npm:1.0.4" @@ -1394,6 +1875,13 @@ __metadata: languageName: node linkType: hard +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.4.411": version: 1.4.413 resolution: "electron-to-chromium@npm:1.4.413" @@ -1401,6 +1889,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.28": + version: 1.5.39 + resolution: "electron-to-chromium@npm:1.5.39" + checksum: cd3b644c20f30fc1c393168bafa0e42a3dde576129603266ab61248b76a36837084073895a845676f8fe90dbb31d385bbef53901b60381f3ae82b40a5bece352 + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -1408,6 +1903,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -1440,33 +1942,36 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.17.10, esbuild@npm:^0.17.5": - version: 0.17.19 - resolution: "esbuild@npm:0.17.19" - dependencies: - "@esbuild/android-arm": 0.17.19 - "@esbuild/android-arm64": 0.17.19 - "@esbuild/android-x64": 0.17.19 - "@esbuild/darwin-arm64": 0.17.19 - "@esbuild/darwin-x64": 0.17.19 - "@esbuild/freebsd-arm64": 0.17.19 - "@esbuild/freebsd-x64": 0.17.19 - "@esbuild/linux-arm": 0.17.19 - "@esbuild/linux-arm64": 0.17.19 - "@esbuild/linux-ia32": 0.17.19 - "@esbuild/linux-loong64": 0.17.19 - "@esbuild/linux-mips64el": 0.17.19 - "@esbuild/linux-ppc64": 0.17.19 - "@esbuild/linux-riscv64": 0.17.19 - "@esbuild/linux-s390x": 0.17.19 - "@esbuild/linux-x64": 0.17.19 - "@esbuild/netbsd-x64": 0.17.19 - "@esbuild/openbsd-x64": 0.17.19 - "@esbuild/sunos-x64": 0.17.19 - "@esbuild/win32-arm64": 0.17.19 - "@esbuild/win32-ia32": 0.17.19 - "@esbuild/win32-x64": 0.17.19 +"esbuild@npm:^0.21.3, esbuild@npm:^0.21.5": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": 0.21.5 + "@esbuild/android-arm": 0.21.5 + "@esbuild/android-arm64": 0.21.5 + "@esbuild/android-x64": 0.21.5 + "@esbuild/darwin-arm64": 0.21.5 + "@esbuild/darwin-x64": 0.21.5 + "@esbuild/freebsd-arm64": 0.21.5 + "@esbuild/freebsd-x64": 0.21.5 + "@esbuild/linux-arm": 0.21.5 + "@esbuild/linux-arm64": 0.21.5 + "@esbuild/linux-ia32": 0.21.5 + "@esbuild/linux-loong64": 0.21.5 + "@esbuild/linux-mips64el": 0.21.5 + "@esbuild/linux-ppc64": 0.21.5 + "@esbuild/linux-riscv64": 0.21.5 + "@esbuild/linux-s390x": 0.21.5 + "@esbuild/linux-x64": 0.21.5 + "@esbuild/netbsd-x64": 0.21.5 + "@esbuild/openbsd-x64": 0.21.5 + "@esbuild/sunos-x64": 0.21.5 + "@esbuild/win32-arm64": 0.21.5 + "@esbuild/win32-ia32": 0.21.5 + "@esbuild/win32-x64": 0.21.5 dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true "@esbuild/android-arm": optional: true "@esbuild/android-arm64": @@ -1513,7 +2018,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: ac11b1a5a6008e4e37ccffbd6c2c054746fc58d0ed4a2f9ee643bd030cfcea9a33a235087bc777def8420f2eaafb3486e76adb7bdb7241a9143b43a69a10afd8 + checksum: 2911c7b50b23a9df59a7d6d4cdd3a4f85855787f374dce751148dbb13305e0ce7e880dde1608c2ab7a927fc6cec3587b80995f7fc87a64b455f8b70b55fd8ec1 languageName: node linkType: hard @@ -1524,6 +2029,13 @@ __metadata: languageName: node linkType: hard +"escalade@npm:^3.2.0": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 47b029c83de01b0d17ad99ed766347b974b0d628e848de404018f3abee728e987da0d2d370ad4574aa3d5b5bfc368754fd085d69a30f8e75903486ec4b5b709e + languageName: node + linkType: hard + "escape-string-regexp@npm:^1.0.5": version: 1.0.5 resolution: "escape-string-regexp@npm:1.0.5" @@ -1560,6 +2072,15 @@ __metadata: languageName: node linkType: hard +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: ^5.0.1 + checksum: b4abfbca3839a3d55e4ae5ec62e131e2e356bf4859ce8480c64c4876100f4df292a63e5bb1618e1d7460282ca2b305653064f01654474aa35c68000980f17798 + languageName: node + linkType: hard + "find-up@npm:^3.0.0": version: 3.0.0 resolution: "find-up@npm:3.0.0" @@ -1569,6 +2090,16 @@ __metadata: languageName: node linkType: hard +"foreground-child@npm:^3.1.0": + version: 3.3.0 + resolution: "foreground-child@npm:3.3.0" + dependencies: + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 1989698488f725b05b26bc9afc8a08f08ec41807cd7b92ad85d96004ddf8243fd3e79486b8348c64a3011ae5cc2c9f0936af989e1f28339805d8bc178a75b451 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -1595,6 +2126,16 @@ __metadata: languageName: node linkType: hard +"fsevents@npm:~2.3.3": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" + dependencies: + node-gyp: latest + checksum: 11e6ea6fea15e42461fc55b4b0e4a0a3c654faa567f1877dbd353f39156f69def97a69936d1746619d656c4b93de2238bf731f6085a03a50cabf287c9d024317 + conditions: os=darwin + languageName: node + linkType: hard + "fsevents@patch:fsevents@~2.3.1#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": version: 2.3.2 resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" @@ -1604,6 +2145,15 @@ __metadata: languageName: node linkType: hard +"fsevents@patch:fsevents@~2.3.3#~builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" + dependencies: + node-gyp: latest + conditions: os=darwin + languageName: node + linkType: hard + "function-bind@npm:^1.1.1": version: 1.1.1 resolution: "function-bind@npm:1.1.1" @@ -1643,6 +2193,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.0": + version: 11.0.0 + resolution: "glob@npm:11.0.0" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^4.0.1 + minimatch: ^10.0.0 + minipass: ^7.1.2 + package-json-from-dist: ^1.0.0 + path-scurry: ^2.0.0 + bin: + glob: dist/esm/bin.mjs + checksum: 8a2dd914d5776987be5244624d9491bbcaf19f2387e06783737003ff696ebfd2264190c47014f8709c1c02d8bc892f17660cf986c587b107e194c0a3151ab333 + languageName: node + linkType: hard + "glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -1935,6 +2501,15 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.0.1": + version: 4.0.2 + resolution: "jackspeak@npm:4.0.2" + dependencies: + "@isaacs/cliui": ^8.0.2 + checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 + languageName: node + linkType: hard + "jest-get-type@npm:^29.4.3": version: 29.4.3 resolution: "jest-get-type@npm:29.4.3" @@ -1965,6 +2540,13 @@ __metadata: languageName: node linkType: hard +"js-sha256@npm:^0.10.1": + version: 0.10.1 + resolution: "js-sha256@npm:0.10.1" + checksum: 6eb5c9f95aa902cec1930f036deb3bc664024b75fede456c0ac74b855797776c18620f47efec36787077a56ba2f3b8d6aacc7733ff8a2b5bb9ce6b655a35c5e6 + languageName: node + linkType: hard + "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -1992,6 +2574,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: a36d3ca40574a974d9c2063bf68c2b6141c20da8f2a36bd3279fc802563f35f0527a6c828801295bdfb2803952cf2cf387786c2c90ed564f88d5782475abfe3c + languageName: node + linkType: hard + "json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" @@ -1999,7 +2590,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.2.2": +"json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: @@ -2074,6 +2665,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.0.1 + resolution: "lru-cache@npm:11.0.1" + checksum: 6056230a99fb399234e82368b99586bd4740079e80649102f681b19337b7d8c6bc8dd7f8b8c59377c31d26deb89f548b717ae932e139b4b795879d920fccf820 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -2123,13 +2721,13 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:4.0.2": - version: 4.0.2 - resolution: "micromatch@npm:4.0.2" +"micromatch@npm:^4.0.7": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" dependencies: - braces: ^3.0.1 - picomatch: ^2.0.5 - checksum: 39590a96d9ffad21f0afac044d0a5af4f33715a16fdd82c53a01c8f5ff6f70832a31b53e52972dac3deff8bf9f0bed0207d1c34e54ab3306a5e4c4efd5f7d249 + braces: ^3.0.3 + picomatch: ^2.3.1 + checksum: 79920eb634e6f400b464a954fcfa589c4e7c7143209488e44baf627f9affc8b1e306f41f4f0deedde97e69cb725920879462d3e750ab3bd3c1aed675bb3a8966 languageName: node linkType: hard @@ -2140,6 +2738,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.0.0": + version: 10.0.1 + resolution: "minimatch@npm:10.0.1" + dependencies: + brace-expansion: ^2.0.1 + checksum: f5b63c2f30606091a057c5f679b067f84a2cd0ffbd2dbc9143bda850afd353c7be81949ff11ae0c86988f07390eeca64efd7143ee05a0dab37f6c6b38a2ebb6c + languageName: node + linkType: hard + "minimatch@npm:^3.1.1": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -2225,6 +2832,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 2bfd325b95c555f2b4d2814d49325691c7bee937d753814861b0b49d5edcda55cbbf22b6b6a60bb91eddac8668771f03c5ff647dcd9d0f798e9548b9cdc46ee3 + languageName: node + linkType: hard + "minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -2258,7 +2872,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.0.0": +"ms@npm:^2.0.0, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: aa92de608021b242401676e35cfa5aa42dd70cbdc082b916da7fb925c542173e36bce97ea3e804923fe92c0ad991434e4a38327e15a1b5b5f945d66df615ae6d @@ -2272,12 +2886,12 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.6": - version: 3.3.6 - resolution: "nanoid@npm:3.3.6" +"nanoid@npm:^3.3.7": + version: 3.3.7 + resolution: "nanoid@npm:3.3.7" bin: nanoid: bin/nanoid.cjs - checksum: 7d0eda657002738aa5206107bd0580aead6c95c460ef1bdd0b1a87a9c7ae6277ac2e9b945306aaa5b32c6dcb7feaf462d0f552e7f8b5718abfc6ead5c94a71b3 + checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 languageName: node linkType: hard @@ -2315,6 +2929,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^2.0.18": + version: 2.0.18 + resolution: "node-releases@npm:2.0.18" + checksum: ef55a3d853e1269a6d6279b7692cd6ff3e40bc74947945101138745bfdc9a5edabfe72cb19a31a8e45752e1910c4c65c77d931866af6357f242b172b7283f5b3 + languageName: node + linkType: hard + "nopt@npm:^6.0.0": version: 6.0.0 resolution: "nopt@npm:6.0.0" @@ -2421,6 +3042,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -2456,6 +3084,13 @@ __metadata: languageName: node linkType: hard +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 + languageName: node + linkType: hard + "path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" @@ -2463,6 +3098,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.0 + resolution: "path-scurry@npm:2.0.0" + dependencies: + lru-cache: ^11.0.0 + minipass: ^7.1.2 + checksum: 9953ce3857f7e0796b187a7066eede63864b7e1dfc14bf0484249801a5ab9afb90d9a58fc533ebb1b552d23767df8aa6a2c6c62caf3f8a65f6ce336a97bbb484 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -2484,7 +3129,14 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.0.5, picomatch@npm:^2.2.1": +"picocolors@npm:^1.1.0": + version: 1.1.0 + resolution: "picocolors@npm:1.1.0" + checksum: a64d653d3a188119ff45781dfcdaeedd7625583f45280aea33fcb032c7a0d3959f2368f9b192ad5e8aade75b74dbd954ffe3106c158509a45e4c18ab379a2acd + languageName: node + linkType: hard + +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 050c865ce81119c4822c45d3c84f1ced46f93a0126febae20737bd05ca20589c564d6e9226977df859ed5e03dc73f02584a2b0faad36e896936238238b0446cf @@ -2507,14 +3159,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.21": - version: 8.4.24 - resolution: "postcss@npm:8.4.24" +"postcss@npm:^8.4.43": + version: 8.4.47 + resolution: "postcss@npm:8.4.47" dependencies: - nanoid: ^3.3.6 - picocolors: ^1.0.0 - source-map-js: ^1.0.2 - checksum: 814e2126dacfea313588eda09cc99a9b4c26ec55c059188aa7a916d20d26d483483106dc5ff9e560731b59f45c5bb91b945dfadc670aed875cc90ddbbf4e787d + nanoid: ^3.3.7 + picocolors: ^1.1.0 + source-map-js: ^1.2.1 + checksum: f78440a9d8f97431dd2ab1ab8e1de64f12f3eff38a3d8d4a33919b96c381046a314658d2de213a5fa5eb296b656de76a3ec269fdea27f16d5ab465b916a0f52c languageName: node linkType: hard @@ -2633,7 +3285,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.19.0, resolve@npm:^1.22.1": +"resolve@npm:^1.19.0": version: 1.22.3 resolution: "resolve@npm:1.22.3" dependencies: @@ -2646,7 +3298,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.19.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin": +"resolve@patch:resolve@^1.19.0#~builtin": version: 1.22.3 resolution: "resolve@patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d" dependencies: @@ -2687,17 +3339,66 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^3.18.0": - version: 3.23.0 - resolution: "rollup@npm:3.23.0" - dependencies: +"rollup@npm:^4.20.0": + version: 4.24.0 + resolution: "rollup@npm:4.24.0" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.24.0 + "@rollup/rollup-android-arm64": 4.24.0 + "@rollup/rollup-darwin-arm64": 4.24.0 + "@rollup/rollup-darwin-x64": 4.24.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.24.0 + "@rollup/rollup-linux-arm-musleabihf": 4.24.0 + "@rollup/rollup-linux-arm64-gnu": 4.24.0 + "@rollup/rollup-linux-arm64-musl": 4.24.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.24.0 + "@rollup/rollup-linux-riscv64-gnu": 4.24.0 + "@rollup/rollup-linux-s390x-gnu": 4.24.0 + "@rollup/rollup-linux-x64-gnu": 4.24.0 + "@rollup/rollup-linux-x64-musl": 4.24.0 + "@rollup/rollup-win32-arm64-msvc": 4.24.0 + "@rollup/rollup-win32-ia32-msvc": 4.24.0 + "@rollup/rollup-win32-x64-msvc": 4.24.0 + "@types/estree": 1.0.6 fsevents: ~2.3.2 dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-powerpc64le-gnu": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true fsevents: optional: true bin: rollup: dist/bin/rollup - checksum: 0721065cf725c5611815be61d2b01f20b4d0027e17035f6e76384d38396b56cf6ed21a3db78eb004d9db4d24c8a6a19da4563b4ff96b5dd36f0a0f7a3baf85e8 + checksum: b7e915b0cc43749c2c71255ff58858496460b1a75148db2abecc8e9496af83f488517768593826715f610e20e480a5ae7f1132a1408eb1d364830d6b239325cf languageName: node linkType: hard @@ -2749,6 +3450,15 @@ __metadata: languageName: node linkType: hard +"semver@npm:^6.3.1": + version: 6.3.1 + resolution: "semver@npm:6.3.1" + bin: + semver: bin/semver.js + checksum: ae47d06de28836adb9d3e25f22a92943477371292d9b665fb023fae278d345d508ca1958232af086d85e0155aee22e313e100971898bbb8d5d89b8b1d4054ca2 + languageName: node + linkType: hard + "semver@npm:^7.3.5": version: 7.5.1 resolution: "semver@npm:7.5.1" @@ -2767,6 +3477,22 @@ __metadata: languageName: node linkType: hard +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: ^3.0.0 + checksum: 6b52fe87271c12968f6a054e60f6bde5f0f3d2db483a1e5c3e12d657c488a15474121a1d55cd958f6df026a54374ec38a4a963988c213b7570e1d51575cea7fa + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 1a2bcae50de99034fcd92ad4212d8e01eedf52c7ec7830eedcf886622804fe36884278f2be8be0ea5fde3fd1c23911643a4e0f726c8685b61871c8908af01222 + languageName: node + linkType: hard + "signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -2774,6 +3500,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "smart-buffer@npm:^4.2.0": version: 4.2.0 resolution: "smart-buffer@npm:4.2.0" @@ -2802,10 +3535,10 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.0.2": - version: 1.0.2 - resolution: "source-map-js@npm:1.0.2" - checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c +"source-map-js@npm:^1.2.1": + version: 1.2.1 + resolution: "source-map-js@npm:1.2.1" + checksum: 4eb0cd997cdf228bc253bcaff9340afeb706176e64868ecd20efbe6efea931465f43955612346d6b7318789e5265bdc419bc7669c1cebe3db0eb255f57efa76b languageName: node linkType: hard @@ -2827,7 +3560,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -2838,6 +3571,17 @@ __metadata: languageName: node linkType: hard +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" + dependencies: + eastasianwidth: ^0.2.0 + emoji-regex: ^9.2.2 + strip-ansi: ^7.0.1 + checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -2847,7 +3591,7 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" dependencies: @@ -2856,6 +3600,15 @@ __metadata: languageName: node linkType: hard +"strip-ansi@npm:^7.0.1": + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" + dependencies: + ansi-regex: ^6.0.1 + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d + languageName: node + linkType: hard + "supports-color@npm:^5.3.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -2988,6 +3741,13 @@ __metadata: languageName: node linkType: hard +"unraw@npm:^3.0.0": + version: 3.0.0 + resolution: "unraw@npm:3.0.0" + checksum: 19eee0bc500ce197d262b79723a2c8c81c1d716baaa2a62c48a4d0d6b9e1fd9d350c5df86262e51343d591ab9c8a47ed150317d0b867b2b65795cdc17ef69873 + languageName: node + linkType: hard + "update-browserslist-db@npm:^1.0.11": version: 1.0.11 resolution: "update-browserslist-db@npm:1.0.11" @@ -3002,6 +3762,20 @@ __metadata: languageName: node linkType: hard +"update-browserslist-db@npm:^1.1.0": + version: 1.1.1 + resolution: "update-browserslist-db@npm:1.1.1" + dependencies: + escalade: ^3.2.0 + picocolors: ^1.1.0 + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 2ea11bd2562122162c3e438d83a1f9125238c0844b6d16d366e3276d0c0acac6036822dc7df65fc5a89c699cdf9f174acf439c39bedf3f9a2f3983976e4b4c3e + languageName: node + linkType: hard + "util-deprecate@npm:^1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -3013,34 +3787,35 @@ __metadata: version: 0.0.0-use.local resolution: "vite-project-react-swc@workspace:." dependencies: - "@lingui/cli": ^4.2.0 - "@lingui/macro": ^4.2.0 - "@lingui/react": ^4.2.0 - "@lingui/swc-plugin": 4.0.0 - "@lingui/vite-plugin": ^4.2.0 + "@lingui/cli": ^5.0.0-next.3 + "@lingui/core": ^5.0.0-next.3 + "@lingui/react": ^5.0.0-next.3 + "@lingui/swc-plugin": 5.0.0-next.2 + "@lingui/vite-plugin": ^5.0.0-next.3 "@types/react": ^18.0.28 "@types/react-dom": ^18.0.11 - "@vitejs/plugin-react-swc": ^3.0.0 + "@vitejs/plugin-react-swc": 3.7.0 react: ^18.2.0 react-dom: ^18.2.0 typescript: ^4.9.3 - vite: 4.2.0 + vite: 5.4.9 languageName: unknown linkType: soft -"vite@npm:4.2.0": - version: 4.2.0 - resolution: "vite@npm:4.2.0" +"vite@npm:5.4.9": + version: 5.4.9 + resolution: "vite@npm:5.4.9" dependencies: - esbuild: ^0.17.5 - fsevents: ~2.3.2 - postcss: ^8.4.21 - resolve: ^1.22.1 - rollup: ^3.18.0 + esbuild: ^0.21.3 + fsevents: ~2.3.3 + postcss: ^8.4.43 + rollup: ^4.20.0 peerDependencies: - "@types/node": ">= 14" + "@types/node": ^18.0.0 || >=20.0.0 less: "*" + lightningcss: ^1.21.0 sass: "*" + sass-embedded: "*" stylus: "*" sugarss: "*" terser: ^5.4.0 @@ -3052,8 +3827,12 @@ __metadata: optional: true less: optional: true + lightningcss: + optional: true sass: optional: true + sass-embedded: + optional: true stylus: optional: true sugarss: @@ -3062,7 +3841,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 1088cdc0c89ab835aab07a0a114397b749e8dfb20f4b94241ba179d9c371b72d31e13782b22893860c3d65da596e43b24fce5e023f79cfde427f42549f2e1844 + checksum: d3229e0618ece284af0478ec09c474a7a70ac369920716afdb6ebed8e320fd17a17c60afddba0d436698fe4837474cccd057c3e7d8270281b57506b78c5fbb8c languageName: node linkType: hard @@ -3093,7 +3872,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^2.0.2": +"which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" dependencies: @@ -3113,6 +3892,28 @@ __metadata: languageName: node linkType: hard +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + languageName: node + linkType: hard + +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" diff --git a/jest.config.js b/jest.config.js index d5c208170..a61696327 100644 --- a/jest.config.js +++ b/jest.config.js @@ -59,6 +59,7 @@ module.exports = { setupFilesAfterEnv: [require.resolve("./scripts/jest/env.js")], roots: [ "/packages/babel-plugin-extract-messages", + "/packages/babel-plugin-lingui-macro", "/packages/cli", "/packages/conf", "/packages/loader", diff --git a/lerna.json b/lerna.json index 7ec8daa75..760802738 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,9 @@ { - "version": "4.14.1", - "packages": ["packages/*"], + "version": "5.0.0", + "packages": [ + "packages/*" + ], "npmClient": "yarn", - "useWorkspaces": true, "command": { "version": { "message": "chore(release): published %s [skip ci]", @@ -17,7 +18,10 @@ ] }, "publish": { - "allowBranch": ["main", "next"], + "allowBranch": [ + "main", + "next" + ], "ignoreChanges": [ "**/CHANGELOG.md", "**/examples/*", @@ -28,5 +32,6 @@ "test/**" ] } - } -} + }, + "$schema": "node_modules/lerna/schemas/lerna-schema.json" +} \ No newline at end of file diff --git a/package.json b/package.json index bfac35896..a031253f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "js-lingui-workspaces", "private": true, - "version": "4.0.0", + "version": "5.0.0", "author": { "name": "Tomáš Ehrlich", "email": "tomas.ehrlich@gmail.com" @@ -35,7 +35,7 @@ "postinstall": "yarn stub:all" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "devDependencies": { "@babel/preset-env": "^7.20.2", @@ -46,7 +46,7 @@ "@tsd/typescript": "^4.9.5", "@types/jest": "^29.4.0", "@types/mock-fs": "^4.13.1", - "@types/node": "16.18.13", + "@types/node": "20.14.8", "@types/ramda": "^0.27.23", "@typescript-eslint/eslint-plugin": "^5.50.0", "@typescript-eslint/parser": "^5.50.0", @@ -65,7 +65,7 @@ "jest-environment-jsdom": "^29.7.0", "jest-environment-node-single-context": "^29.4.0", "jest-runner-tsd": "^4.0.0", - "lerna": "^6.5.1", + "lerna": "^8.1.9", "lint-staged": "^13.1.0", "memory-fs": "^0.5.0", "minimist": "^1.2.5", diff --git a/packages/babel-plugin-extract-messages/package.json b/packages/babel-plugin-extract-messages/package.json index 5743c497e..a64ede1bb 100644 --- a/packages/babel-plugin-extract-messages/package.json +++ b/packages/babel-plugin-extract-messages/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/babel-plugin-extract-messages", - "version": "4.14.1", + "version": "5.0.0", "description": "Babel plugin for collecting messages from source code for internationalization", "main": "./dist/index.cjs", "module": "./dist/index.mjs", @@ -37,13 +37,14 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "devDependencies": { "@babel/core": "^7.21.0", "@babel/traverse": "^7.20.12", "@babel/types": "^7.20.7", - "@lingui/jest-mocks": "*", + "@lingui/babel-plugin-lingui-macro": "workspace:*", + "@lingui/jest-mocks": "workspace:*", "unbuild": "2.0.0" } } diff --git a/packages/babel-plugin-extract-messages/src/index.ts b/packages/babel-plugin-extract-messages/src/index.ts index 0b937cb65..ac86bd871 100644 --- a/packages/babel-plugin-extract-messages/src/index.ts +++ b/packages/babel-plugin-extract-messages/src/index.ts @@ -2,14 +2,12 @@ import type * as BabelTypesNamespace from "@babel/types" import { Expression, Identifier, - ImportSpecifier, - JSXAttribute, Node, ObjectExpression, ObjectProperty, + isObjectExpression, } from "@babel/types" -import type { PluginObj, PluginPass } from "@babel/core" -import type { NodePath } from "@babel/core" +import type { PluginObj, PluginPass, NodePath } from "@babel/core" import type { Hub } from "@babel/traverse" type BabelTypes = typeof BabelTypesNamespace @@ -22,6 +20,7 @@ export type ExtractedMessage = { origin?: Origin comment?: string + placeholders?: Record } export type ExtractPluginOpts = { @@ -33,6 +32,7 @@ type RawMessage = { message?: string comment?: string context?: string + placeholders?: Record } export type Origin = [filename: string, line: number, column?: number] @@ -55,6 +55,7 @@ function collectMessage( message: props.message, context: props.context, comment: props.comment, + placeholders: props.placeholders || {}, origin: [ctx.file.opts.filename, line, column], }) } @@ -112,19 +113,67 @@ function getTextFromExpression( } } -function extractFromObjectExpression( +function getNodeSource(fileContents: string, node: Node) { + return fileContents.slice(node.start, node.end) +} + +function valuesObjectExpressionToPlaceholdersRecord( t: BabelTypes, exp: ObjectExpression, - hub: Hub, - keys: readonly string[] + hub: Hub ) { const props: Record = {} + ;(exp.properties as ObjectProperty[]).forEach(({ key, value }, i) => { + let name: string + + if (t.isStringLiteral(key) || t.isNumericLiteral(key)) { + name = key.value.toString() + } else if (t.isIdentifier(key)) { + name = key.name + } else { + console.warn( + hub.buildError( + exp, + `Could not extract values to placeholders. The key #${i} has unsupported syntax`, + SyntaxError + ).message + ) + } + + if (name) { + props[name] = getNodeSource(hub.getCode(), value) + } + }) + + return props +} + +function extractFromObjectExpression( + t: BabelTypes, + exp: ObjectExpression, + hub: Hub +) { + const props: RawMessage = {} + + const textKeys = ["id", "message", "comment", "context"] as const + ;(exp.properties as ObjectProperty[]).forEach(({ key, value }, i) => { const name = (key as Identifier).name - if (!keys.includes(name as any)) return - props[name] = getTextFromExpression(t, value as Expression, hub) + if (name === "values" && isObjectExpression(value)) { + props.placeholders = valuesObjectExpressionToPlaceholdersRecord( + t, + value, + hub + ) + } else if (textKeys.includes(name as any)) { + props[name as (typeof textKeys)[number]] = getTextFromExpression( + t, + value as Expression, + hub + ) + } }) return props @@ -148,14 +197,13 @@ function hasI18nComment(node: Node): boolean { } export default function ({ types: t }: { types: BabelTypes }): PluginObj { - let localTransComponentName: string - - function isTransComponent(node: Node) { + function isTransComponent(path: NodePath) { return ( - t.isJSXElement(node) && - t.isJSXIdentifier(node.openingElement.name, { - name: localTransComponentName, - }) + path.isJSXElement() && + path + .get("openingElement") + .get("name") + .referencesImport("@lingui/react", "Trans") ) } @@ -171,12 +219,7 @@ export default function ({ types: t }: { types: BabelTypes }): PluginObj { path: NodePath, ctx: PluginPass ) => { - const props = extractFromObjectExpression(t, path.node, ctx.file.hub, [ - "id", - "message", - "comment", - "context", - ]) + const props = extractFromObjectExpression(t, path.node, ctx.file.hub) if (!props.id) { console.warn( @@ -190,37 +233,27 @@ export default function ({ types: t }: { types: BabelTypes }): PluginObj { return { visitor: { - // Get the local name of Trans component. Usually it's just `Trans`, but - // it might be different when the import is aliased: - // import { Trans as T } from '@lingui/react'; - ImportDeclaration(path) { + // Extract translation from component. + JSXElement(path, ctx) { const { node } = path + if (!isTransComponent(path)) return - const moduleName = node.source.value - if (!["@lingui/react", "@lingui/core"].includes(moduleName)) return + const attrs = node.openingElement.attributes || [] - const importDeclarations: Record = {} - if (moduleName === "@lingui/react") { - node.specifiers.forEach((specifier) => { - specifier = specifier as ImportSpecifier - importDeclarations[(specifier.imported as Identifier).name] = - specifier.local.name - }) - - // Trans import might be missing if there's just Plural or similar macro. - // If there's no alias, consider it was imported as Trans. - localTransComponentName = importDeclarations["Trans"] || "Trans" + if ( + attrs.find( + (attr) => + t.isJSXSpreadAttribute(attr) && hasI18nComment(attr.argument) + ) + ) { + return } - }, - // Extract translation from component. - JSXElement(path, ctx) { - const { node } = path - if (!localTransComponentName || !isTransComponent(node)) return - - const attrs = (node.openingElement.attributes as JSXAttribute[]) || [] + const props = attrs.reduce((acc, item) => { + if (t.isJSXSpreadAttribute(item)) { + return acc + } - const props = attrs.reduce>((acc, item) => { const key = item.name.name if ( key === "id" || @@ -237,12 +270,27 @@ export default function ({ types: t }: { types: BabelTypes }): PluginObj { acc[key] = item.value.expression.value } } + + if ( + key === "values" && + t.isJSXExpressionContainer(item.value) && + isObjectExpression(item.value.expression) + ) { + acc.placeholders = valuesObjectExpressionToPlaceholdersRecord( + t, + item.value.expression, + ctx.file.hub + ) + } + return acc }, {}) if (!props.id) { // is valid, don't raise warning - const idProp = attrs.filter((item) => item.name.name === "id")[0] + const idProp = attrs.filter( + (item) => t.isJSXAttribute(item) && item.name.name === "id" + )[0] if (idProp === undefined || t.isLiteral(props.id as any)) { console.warn( path.buildCodeFrameError("Missing message ID, skipping.").message @@ -280,7 +328,7 @@ export default function ({ types: t }: { types: BabelTypes }): PluginObj { return } else { // i18n._(id, variables, descriptor) - let props = { + let props: RawMessage = { id: getTextFromExpression( t, firstArgument.node as Expression, @@ -293,16 +341,21 @@ export default function ({ types: t }: { types: BabelTypes }): PluginObj { return } + const secondArgument = path.node.arguments[1] + if (secondArgument && t.isObjectExpression(secondArgument)) { + props.placeholders = valuesObjectExpressionToPlaceholdersRecord( + t, + secondArgument, + ctx.file.hub + ) + } + const msgDescArg = path.node.arguments[2] if (t.isObjectExpression(msgDescArg)) { props = { ...props, - ...extractFromObjectExpression(t, msgDescArg, ctx.file.hub, [ - "message", - "comment", - "context", - ]), + ...extractFromObjectExpression(t, msgDescArg, ctx.file.hub), } } diff --git a/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap b/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap index 1e5fda52f..d01761246 100644 --- a/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap +++ b/packages/babel-plugin-extract-messages/test/__snapshots__/index.ts.snap @@ -11,6 +11,7 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 1, ], + placeholders: {}, }, { comment: description, @@ -21,6 +22,7 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 3, ], + placeholders: {}, }, { comment: undefined, @@ -31,6 +33,7 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 5, ], + placeholders: {}, }, { comment: undefined, @@ -41,6 +44,9 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 7, ], + placeholders: { + param: param, + }, }, { comment: undefined, @@ -51,6 +57,7 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 9, ], + placeholders: {}, }, { comment: My comment, @@ -61,6 +68,7 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 12, ], + placeholders: {}, }, { comment: undefined, @@ -71,6 +79,7 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 19, ], + placeholders: {}, }, { comment: My comment, @@ -81,6 +90,7 @@ exports[`@lingui/babel-plugin-extract-messages CallExpression i18n._() should ex js-call-expression.js, 22, ], + placeholders: {}, }, ] `; @@ -96,6 +106,7 @@ exports[`@lingui/babel-plugin-extract-messages MessageDescriptor should extract js-message-descriptor.js, 1, ], + placeholders: {}, }, { comment: description, @@ -106,6 +117,7 @@ exports[`@lingui/babel-plugin-extract-messages MessageDescriptor should extract js-message-descriptor.js, 3, ], + placeholders: {}, }, { comment: undefined, @@ -116,16 +128,36 @@ exports[`@lingui/babel-plugin-extract-messages MessageDescriptor should extract js-message-descriptor.js, 5, ], + placeholders: {}, }, { comment: undefined, context: undefined, - id: Values {param}, + id: Values {param} {0} {name} {value}, message: undefined, origin: [ js-message-descriptor.js, 7, ], + placeholders: { + 0: user.getName(), + name: "foo", + param: param, + value: user + ? user.name + : null, + }, + }, + { + comment: undefined, + context: undefined, + id: Values {param} {0}, + message: undefined, + origin: [ + js-message-descriptor.js, + 23, + ], + placeholders: {}, }, { comment: undefined, @@ -134,8 +166,9 @@ exports[`@lingui/babel-plugin-extract-messages MessageDescriptor should extract message: undefined, origin: [ js-message-descriptor.js, - 9, + 25, ], + placeholders: {}, }, ] `; @@ -149,8 +182,11 @@ exports[`@lingui/babel-plugin-extract-messages should extract Plural messages fr message: {count, plural, one {# book} other {# books}}, origin: [ jsx-without-trans.js, - 3, + 2, ], + placeholders: { + count: count, + }, }, { comment: undefined, @@ -159,8 +195,11 @@ exports[`@lingui/babel-plugin-extract-messages should extract Plural messages fr message: {count, plural, one {# book} other {# books}}, origin: [ jsx-without-trans.js, - 4, + 3, ], + placeholders: { + count: count, + }, }, ] `; @@ -174,8 +213,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: Message, origin: [ js-with-macros.js, - 3, + 4, ], + placeholders: {}, }, { comment: undefined, @@ -184,8 +224,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: Message, origin: [ js-with-macros.js, - 5, + 6, ], + placeholders: {}, }, { comment: description, @@ -194,8 +235,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: Description, origin: [ js-with-macros.js, - 7, + 8, ], + placeholders: {}, }, { comment: undefined, @@ -204,8 +246,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: Message with id, origin: [ js-with-macros.js, - 12, + 13, ], + placeholders: {}, }, { comment: undefined, @@ -214,8 +257,11 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: Values {param}, origin: [ js-with-macros.js, - 17, + 18, ], + placeholders: { + param: param, + }, }, { comment: undefined, @@ -224,8 +270,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: Message with id some, origin: [ js-with-macros.js, - 19, + 20, ], + placeholders: {}, }, { comment: undefined, @@ -234,8 +281,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: undefined, origin: [ js-with-macros.js, - 24, + 25, ], + placeholders: {}, }, { comment: undefined, @@ -244,8 +292,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: undefined, origin: [ js-with-macros.js, - 28, + 29, ], + placeholders: {}, }, { comment: undefined, @@ -254,8 +303,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: undefined, origin: [ js-with-macros.js, - 33, + 34, ], + placeholders: {}, }, { comment: undefined, @@ -264,8 +314,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: undefined, origin: [ js-with-macros.js, - 38, + 39, ], + placeholders: {}, }, { comment: undefined, @@ -274,8 +325,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: undefined, origin: [ js-with-macros.js, - 43, + 44, ], + placeholders: {}, }, { comment: undefined, @@ -284,8 +336,33 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from message: TplLiteral, origin: [ js-with-macros.js, - 48, + 49, + ], + placeholders: {}, + }, + { + comment: undefined, + context: undefined, + id: VO4BJY, + message: [useLingui]: TplLiteral, + origin: [ + js-with-macros.js, + 54, + ], + placeholders: {}, + }, + { + comment: undefined, + context: undefined, + id: ZxxjOE, + message: [useLingui]: Text {0, plural, offset:1 =0 {No books} =1 {1 book} other {# books}}, + origin: [ + js-with-macros.js, + 57, ], + placeholders: { + 0: users.length, + }, }, ] `; @@ -301,6 +378,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-with-macros.js, 3, ], + placeholders: { + name: name, + }, }, { comment: undefined, @@ -311,6 +391,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-with-macros.js, 4, ], + placeholders: {}, }, { comment: undefined, @@ -321,6 +402,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-with-macros.js, 5, ], + placeholders: {}, }, { comment: undefined, @@ -331,6 +413,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-with-macros.js, 6, ], + placeholders: {}, }, { comment: undefined, @@ -341,6 +424,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-with-macros.js, 7, ], + placeholders: {}, }, { comment: undefined, @@ -351,6 +435,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-with-macros.js, 9, ], + placeholders: { + count: count, + }, }, ] `; @@ -366,6 +453,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-without-macros.js, 5, ], + placeholders: {}, }, { comment: undefined, @@ -376,6 +464,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-without-macros.js, 6, ], + placeholders: {}, }, { comment: undefined, @@ -386,6 +475,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-without-macros.js, 7, ], + placeholders: {}, }, { comment: undefined, @@ -396,6 +486,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-without-macros.js, 8, ], + placeholders: {}, }, { comment: undefined, @@ -406,6 +497,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-without-macros.js, 9, ], + placeholders: {}, }, { comment: undefined, @@ -416,6 +508,7 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-without-macros.js, 10, ], + placeholders: {}, }, { comment: undefined, @@ -426,6 +519,9 @@ exports[`@lingui/babel-plugin-extract-messages should extract all messages from jsx-without-macros.js, 11, ], + placeholders: { + count: count, + }, }, ] `; diff --git a/packages/babel-plugin-extract-messages/test/fixtures/js-message-descriptor.js b/packages/babel-plugin-extract-messages/test/fixtures/js-message-descriptor.js index 70ab1e3b8..3761efca2 100644 --- a/packages/babel-plugin-extract-messages/test/fixtures/js-message-descriptor.js +++ b/packages/babel-plugin-extract-messages/test/fixtures/js-message-descriptor.js @@ -1,9 +1,25 @@ -const msg = /*i18n*/{id: 'Message'} +const msg = /*i18n*/ { id: "Message" } -const withDescription = /*i18n*/{id: 'Description', comment: "description"} +const withDescription = /*i18n*/ { id: "Description", comment: "description" } -const withId = /*i18n*/{id: 'ID', message: 'Message with id'} +const withId = /*i18n*/ { id: "ID", message: "Message with id" } -const withValues = /*i18n*/{id: 'Values {param}', values: { param: param }} +const withValues = /*i18n*/ { + id: "Values {param} {0} {name} {value}", + values: { + param: param, + 0: user.getName(), + ["name"]: "foo", + // prettier-ignore + value: user + ? user.name + : null, + }, +} +/** + * With values passed as variable + */ +const values = {} +const withValues2 = /*i18n*/ { id: "Values {param} {0}", values } -const withContext = /*i18n*/{id: 'Some id', context: 'Context1'} +const withContext = /*i18n*/ { id: "Some id", context: "Context1" } diff --git a/packages/babel-plugin-extract-messages/test/fixtures/js-with-macros.js b/packages/babel-plugin-extract-messages/test/fixtures/js-with-macros.js index 57083825a..564320d27 100644 --- a/packages/babel-plugin-extract-messages/test/fixtures/js-with-macros.js +++ b/packages/babel-plugin-extract-messages/test/fixtures/js-with-macros.js @@ -1,4 +1,5 @@ -import { t, defineMessage, msg } from "@lingui/macro" +import { t, defineMessage, msg, plural } from "@lingui/core/macro" +import { useLingui } from "@lingui/react/macro" t`Message` @@ -46,3 +47,17 @@ const defineMessageAlias = msg({ }) const defineMessageAlias2 = msg`TplLiteral` + +function MyComponent() { + const { t } = useLingui() + + t`[useLingui]: TplLiteral` + + // macro nesting + const a = t`[useLingui]: Text ${plural(users.length, { + offset: 1, + 0: "No books", + 1: "1 book", + other: "# books", + })}` +} diff --git a/packages/babel-plugin-extract-messages/test/fixtures/jsx-with-macros.js b/packages/babel-plugin-extract-messages/test/fixtures/jsx-with-macros.js index e9662b4e1..c14c5c394 100644 --- a/packages/babel-plugin-extract-messages/test/fixtures/jsx-with-macros.js +++ b/packages/babel-plugin-extract-messages/test/fixtures/jsx-with-macros.js @@ -1,5 +1,5 @@ -import { t, plural, Trans } from "@lingui/macro" - +import { Trans } from "@lingui/react/macro" +import { t, plural } from "@lingui/core/macro" ;Hi, my name is {name} ;Some message ;Some other message @@ -8,6 +8,6 @@ import { t, plural, Trans } from "@lingui/macro" ; diff --git a/packages/babel-plugin-extract-messages/test/fixtures/jsx-without-trans.js b/packages/babel-plugin-extract-messages/test/fixtures/jsx-without-trans.js index 1e9667701..6a6d0eecc 100644 --- a/packages/babel-plugin-extract-messages/test/fixtures/jsx-without-trans.js +++ b/packages/babel-plugin-extract-messages/test/fixtures/jsx-without-trans.js @@ -1,4 +1,3 @@ -import { Plural } from "@lingui/macro"; - +import { Plural } from "@lingui/react/macro" ; ; diff --git a/packages/babel-plugin-extract-messages/test/index.ts b/packages/babel-plugin-extract-messages/test/index.ts index 72832cd00..e3f749565 100644 --- a/packages/babel-plugin-extract-messages/test/index.ts +++ b/packages/babel-plugin-extract-messages/test/index.ts @@ -3,6 +3,9 @@ import fs from "fs" import { transform as babelTransform } from "@babel/core" import plugin, { ExtractedMessage, ExtractPluginOpts } from "../src/index" import { mockConsole } from "@lingui/jest-mocks" +import linguiMacroPlugin, { + type LinguiPluginOpts, +} from "@lingui/babel-plugin-lingui-macro" const transform = (filename: string) => { const rootDir = path.join(__dirname, "fixtures") @@ -42,15 +45,10 @@ const transformCode = ( plugins: [ "@babel/plugin-syntax-jsx", [ - "macros", + linguiMacroPlugin, { - lingui: { extract: true }, - // macro plugin uses package `resolve` to find a path of macro file - // this will not follow jest pathMapping and will resolve path from ./build - // instead of ./src which makes testing & developing hard. - // here we override resolve and provide correct path for testing - resolvePath: (source: string) => require.resolve(source), - }, + extract: true, + } satisfies LinguiPluginOpts, ], [plugin, pluginOpts], ], @@ -100,6 +98,20 @@ import { Trans } from "@lingui/react"; }) }) + it("Should not rise warning when `key` used with macro", () => { + const code = ` +import { Trans } from "@lingui/react/macro"; + + + Some message + + ` + expectNoConsole(() => { + const messages = transformCode(code) + expect(messages.length).toBe(1) + }) + }) + it("Should log error when no ID provided", () => { const code = ` import { Trans } from "@lingui/react"; diff --git a/packages/babel-plugin-lingui-macro/README.md b/packages/babel-plugin-lingui-macro/README.md new file mode 100644 index 000000000..733081af1 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/README.md @@ -0,0 +1,40 @@ +[![License][badge-license]][license] +[![Version][badge-version]][package] +[![Downloads][badge-downloads]][package] + +# @lingui/babel-plugin-lingui-macro + +> Babel plugin that does actual transforms of Lingui's Macros + +`@lingui/babel-plugin-lingui-macro` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. + +## Installation + +```sh +npm install --save-dev @lingui/babel-plugin-lingui-macro +# yarn add --dev @lingui/babel-plugin-lingui-macro +``` + +## Usage + +### Via `.babelrc` + +**.babelrc** + +```json +{ + "plugins": ["@lingui/babel-plugin-lingui-macro"] +} +``` + +## License + +[MIT][license] + +[license]: https://github.com/lingui/js-lingui/blob/main/LICENSE +[linguijs]: https://github.com/lingui/js-lingui +[documentation]: https://lingui.dev +[package]: https://www.npmjs.com/package/@lingui/babel-plugin-lingui-macro +[badge-downloads]: https://img.shields.io/npm/dw/@lingui/babel-plugin-lingui-macro.svg +[badge-version]: https://img.shields.io/npm/v/@lingui/babel-plugin-lingui-macro.svg +[badge-license]: https://img.shields.io/npm/l/@lingui/babel-plugin-lingui-macro.svg diff --git a/packages/babel-plugin-lingui-macro/package.json b/packages/babel-plugin-lingui-macro/package.json new file mode 100644 index 000000000..6140eb84c --- /dev/null +++ b/packages/babel-plugin-lingui-macro/package.json @@ -0,0 +1,106 @@ +{ + "name": "@lingui/babel-plugin-lingui-macro", + "version": "5.0.0", + "description": "Babel plugin for transforming Lingui Macros", + "main": "./dist/index.cjs", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "contributors": [ + { + "name": "Timofei Iatsenko", + "email": "timiatsenko@gmail.com" + } + ], + "author": { + "name": "Tomáš Ehrlich", + "email": "tomas.ehrlich@gmail.com" + }, + "publishConfig": { + "access": "public" + }, + "license": "MIT", + "keywords": [ + "babel-plugin", + "i18n", + "internationalization", + "i10n", + "localization", + "i9n", + "translation", + "multilingual" + ], + "scripts": { + "build": "rimraf ./dist && unbuild", + "stub": "unbuild --stub" + }, + "exports": { + ".": { + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + }, + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + } + }, + "./macro": { + "require": { + "types": "./dist/macro.d.cts", + "default": "./dist/macro.cjs" + }, + "import": { + "types": "./dist/macro.d.mts", + "default": "./dist/macro.mjs" + } + }, + "./ast": { + "require": { + "types": "./dist/ast.d.cts", + "default": "./dist/ast.cjs" + }, + "import": { + "types": "./dist/ast.d.mts", + "default": "./dist/ast.mjs" + } + } + }, + "files": [ + "LICENSE", + "README.md", + "dist/" + ], + "repository": { + "type": "git", + "url": "https://github.com/lingui/js-lingui.git" + }, + "bugs": { + "url": "https://github.com/lingui/js-lingui/issues" + }, + "engines": { + "node": ">=20.0.0" + }, + "dependencies": { + "@babel/core": "^7.20.12", + "@babel/runtime": "^7.20.13", + "@babel/types": "^7.20.7", + "@lingui/conf": "5.0.0", + "@lingui/core": "5.0.0", + "@lingui/message-utils": "5.0.0" + }, + "peerDependencies": { + "babel-plugin-macros": "2 || 3" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + }, + "devDependencies": { + "@babel/parser": "^7.20.15", + "@babel/traverse": "^7.20.12", + "@types/babel-plugin-macros": "^2.8.5", + "prettier": "2.8.3", + "unbuild": "2.0.0" + } +} diff --git a/packages/babel-plugin-lingui-macro/src/ast.ts b/packages/babel-plugin-lingui-macro/src/ast.ts new file mode 100644 index 000000000..35bdb76fc --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/ast.ts @@ -0,0 +1,19 @@ +export * from "./icu" +export * from "./messageDescriptorUtils" +export { JsMacroName } from "./constants" + +export { + isChoiceMethod, + isLinguiIdentifier, + isI18nMethod, + isDefineMessage, + tokenizeExpression, + tokenizeChoiceComponent, + tokenizeTemplateLiteral, + tokenizeNode, + processDescriptor, + createMacroJsContext, + type MacroJsContext, + tokenizeArg, + isArgDecorator, +} from "./macroJsAst" diff --git a/packages/babel-plugin-lingui-macro/src/constants.ts b/packages/babel-plugin-lingui-macro/src/constants.ts new file mode 100644 index 000000000..037150cf3 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/constants.ts @@ -0,0 +1,31 @@ +export const EXTRACT_MARK = "i18n" +export const MACRO_LEGACY_PACKAGE = "@lingui/macro" +export const MACRO_CORE_PACKAGE = "@lingui/core/macro" +export const MACRO_REACT_PACKAGE = "@lingui/react/macro" + +export enum MsgDescriptorPropKey { + id = "id", + message = "message", + comment = "comment", + values = "values", + components = "components", + context = "context", +} + +export enum JsMacroName { + t = "t", + plural = "plural", + select = "select", + selectOrdinal = "selectOrdinal", + msg = "msg", + defineMessage = "defineMessage", + arg = "arg", + useLingui = "useLingui", +} + +export enum JsxMacroName { + Trans = "Trans", + Plural = "Plural", + Select = "Select", + SelectOrdinal = "SelectOrdinal", +} diff --git a/packages/macro/src/icu.test.ts b/packages/babel-plugin-lingui-macro/src/icu.test.ts similarity index 95% rename from packages/macro/src/icu.test.ts rename to packages/babel-plugin-lingui-macro/src/icu.test.ts index 897803955..36be857ac 100644 --- a/packages/macro/src/icu.test.ts +++ b/packages/babel-plugin-lingui-macro/src/icu.test.ts @@ -1,4 +1,4 @@ -import ICUMessageFormat, { Token } from "./icu" +import { ICUMessageFormat, Token } from "./icu" import { Identifier } from "@babel/types" describe("ICU MessageFormat", function () { diff --git a/packages/macro/src/icu.ts b/packages/babel-plugin-lingui-macro/src/icu.ts similarity index 85% rename from packages/macro/src/icu.ts rename to packages/babel-plugin-lingui-macro/src/icu.ts index 02be076f1..ca3c425db 100644 --- a/packages/macro/src/icu.ts +++ b/packages/babel-plugin-lingui-macro/src/icu.ts @@ -1,9 +1,4 @@ -import { - Expression, - isJSXEmptyExpression, - JSXElement, - Node, -} from "@babel/types" +import { Expression, isJSXEmptyExpression, Node } from "@babel/types" const metaOptions = ["id", "comment", "props"] @@ -12,18 +7,20 @@ const escapedMetaOptionsRe = new RegExp(`^_(${metaOptions.join("|")})$`) export type ParsedResult = { message: string values?: Record - jsxElements?: Record + elements?: Record // JSXElement or ElementNode in Vue } export type TextToken = { type: "text" value: string } + export type ArgToken = { type: "arg" value: Expression name?: string + raw?: boolean /** * plural * select @@ -35,16 +32,17 @@ export type ArgToken = { [icuChoice: string]: string | Tokens } } + export type ElementToken = { type: "element" - value: JSXElement + value: any // JSXElement or ElementNode in Vue name?: string | number children?: Token[] } export type Tokens = Token | Token[] export type Token = TextToken | ArgToken | ElementToken -export default class ICUMessageFormat { +export class ICUMessageFormat { public fromTokens(tokens: Tokens): ParsedResult { return (Array.isArray(tokens) ? tokens : [tokens]) .map((token) => this.processToken(token)) @@ -54,18 +52,18 @@ export default class ICUMessageFormat { ...message, message: props.message + message.message, values: { ...props.values, ...message.values }, - jsxElements: { ...props.jsxElements, ...message.jsxElements }, + elements: { ...props.elements, ...message.elements }, }), { message: "", values: {}, - jsxElements: {}, + elements: {}, } ) } public processToken(token: Token): ParsedResult { - const jsxElements: ParsedResult["jsxElements"] = {} + const jsxElements: ParsedResult["elements"] = {} if (token.type === "text") { return { @@ -101,7 +99,7 @@ export default class ICUMessageFormat { const { message, values: childValues, - jsxElements: childJsxElements, + elements: childJsxElements, } = this.fromTokens(value) Object.assign(values, childValues) @@ -116,11 +114,11 @@ export default class ICUMessageFormat { return { message: `{${token.name}, ${token.format}, ${formatOptions}}`, values, - jsxElements, + elements: jsxElements, } default: return { - message: `{${token.name}}`, + message: token.raw ? `${token.name}` : `{${token.name}}`, values, } } @@ -132,7 +130,7 @@ export default class ICUMessageFormat { const { message: childMessage, values: childValues, - jsxElements: childJsxElements, + elements: childJsxElements, } = this.fromTokens(child) message += childMessage @@ -144,7 +142,7 @@ export default class ICUMessageFormat { ? `<${token.name}>${message}` : `<${token.name}/>`, values: elementValues, - jsxElements, + elements: jsxElements, } } diff --git a/packages/babel-plugin-lingui-macro/src/index.ts b/packages/babel-plugin-lingui-macro/src/index.ts new file mode 100644 index 000000000..6f5c9df5e --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/index.ts @@ -0,0 +1,271 @@ +import type { PluginObj, Visitor, PluginPass, BabelFile } from "@babel/core" +import type * as babelTypes from "@babel/types" +import { Program, Identifier } from "@babel/types" +import { MacroJSX } from "./macroJsx" +import { NodePath } from "@babel/traverse" +import { MacroJs } from "./macroJs" +import { + MACRO_CORE_PACKAGE, + MACRO_REACT_PACKAGE, + MACRO_LEGACY_PACKAGE, + JsMacroName, +} from "./constants" +import { + type LinguiConfigNormalized, + getConfig as loadConfig, +} from "@lingui/conf" + +let config: LinguiConfigNormalized + +export type LinguiPluginOpts = { + // explicitly set by CLI when running extraction process + extract?: boolean + stripMessageField?: boolean + linguiConfig?: LinguiConfigNormalized +} + +function getConfig(_config?: LinguiConfigNormalized) { + if (_config) { + config = _config + } + if (!config) { + config = loadConfig() + } + return config +} + +function reportUnsupportedSyntax(path: NodePath, e: Error) { + const codeFrameError = path.buildCodeFrameError( + `Unsupported macro usage. Please check the examples at https://lingui.dev/ref/macro#examples-of-js-macros. + If you think this is a bug, fill in an issue at https://github.com/lingui/js-lingui/issues + + Error: ${e.message}` + ) + + // show stack trace where error originally happened + codeFrameError.stack = codeFrameError.message + "\n" + e.stack + throw codeFrameError +} + +function shouldStripMessageProp(opts: LinguiPluginOpts) { + if (typeof opts.stripMessageField === "boolean") { + // if explicitly set in options, use it + return opts.stripMessageField + } + // default to strip message in production if no explicit option is set and not during extract + return process.env.NODE_ENV === "production" && !opts.extract +} + +type LinguiSymbol = "Trans" | "useLingui" | "i18n" + +const getIdentifierPath = ((path: NodePath, node: Identifier) => { + let foundPath: NodePath + + path.traverse({ + Identifier: (path) => { + if (path.node === node) { + foundPath = path + path.stop() + } + }, + }) + + return foundPath +}) as any + +export default function ({ + types: t, +}: { + types: typeof babelTypes +}): PluginObj { + function addImport(state: PluginPass, name: LinguiSymbol) { + const path = state.get( + "macroImport" + ) as NodePath + + const config = state.get("linguiConfig") as LinguiConfigNormalized + + if (!state.get("has_import_" + name)) { + state.set("has_import_" + name, true) + const [moduleSource, importName] = config.runtimeConfigModule[name] + + const [newPath] = path.insertAfter( + t.importDeclaration( + [ + t.importSpecifier( + getSymbolIdentifier(state, name), + t.identifier(importName) + ), + ], + t.stringLiteral(moduleSource) + ) + ) + + path.parentPath.scope.registerDeclaration(newPath) + } + + return path.parentPath.scope.getBinding( + getSymbolIdentifier(state, name).name + ) + } + + function getMacroImports(path: NodePath) { + return path.get("body").filter((statement) => { + return ( + statement.isImportDeclaration() && + [ + MACRO_CORE_PACKAGE, + MACRO_REACT_PACKAGE, + MACRO_LEGACY_PACKAGE, + ].includes(statement.get("source").node.value) + ) + }) + } + + function getSymbolIdentifier( + state: PluginPass, + name: LinguiSymbol + ): Identifier { + return state.get("linguiIdentifiers")[name] + } + + function isLinguiIdentifier( + path: NodePath, + node: Identifier, + macro: JsMacroName + ) { + let identPath = getIdentifierPath(path, node) + + if (macro === JsMacroName.useLingui) { + if ( + identPath.referencesImport( + MACRO_REACT_PACKAGE, + JsMacroName.useLingui + ) || + identPath.referencesImport(MACRO_LEGACY_PACKAGE, JsMacroName.useLingui) + ) { + return true + } + } else { + // useLingui might ask for identifiers which are not direct child of macro + identPath = identPath || getIdentifierPath(path.getFunctionParent(), node) + + if ( + identPath.referencesImport(MACRO_CORE_PACKAGE, macro) || + identPath.referencesImport(MACRO_LEGACY_PACKAGE, macro) + ) { + return true + } + } + return false + } + return { + name: "lingui-macro-plugin", + pre(file: BabelFile) { + file.hub + }, + visitor: { + Program: { + enter(path, state) { + const macroImports = getMacroImports(path) + + if (!macroImports.length) { + return + } + + state.set("macroImport", macroImports[0]) + + state.set( + "linguiConfig", + getConfig((state.opts as LinguiPluginOpts).linguiConfig) + ) + + state.set("linguiIdentifiers", { + i18n: path.scope.generateUidIdentifier("i18n"), + Trans: path.scope.generateUidIdentifier("Trans"), + useLingui: path.scope.generateUidIdentifier("useLingui"), + }) + + path.traverse( + { + JSXElement(path, state) { + const macro = new MacroJSX( + { types: t }, + { + transImportName: getSymbolIdentifier(state, "Trans").name, + stripNonEssentialProps: + process.env.NODE_ENV == "production" && + !(state.opts as LinguiPluginOpts).extract, + stripMessageProp: shouldStripMessageProp( + state.opts as LinguiPluginOpts + ), + } + ) + + let newNode: false | babelTypes.Node + + try { + newNode = macro.replacePath(path) + } catch (e) { + reportUnsupportedSyntax(path, e as Error) + } + + if (newNode) { + const [newPath] = path.replaceWith(newNode) + addImport(state, "Trans").reference(newPath) + } + }, + + "CallExpression|TaggedTemplateExpression"( + path: NodePath< + | babelTypes.CallExpression + | babelTypes.TaggedTemplateExpression + >, + state: PluginPass + ) { + const macro = new MacroJs({ + stripNonEssentialProps: + process.env.NODE_ENV == "production" && + !(state.opts as LinguiPluginOpts).extract, + stripMessageProp: shouldStripMessageProp( + state.opts as LinguiPluginOpts + ), + i18nImportName: getSymbolIdentifier(state, "i18n").name, + useLinguiImportName: getSymbolIdentifier(state, "useLingui") + .name, + + isLinguiIdentifier: (node: Identifier, macro) => + isLinguiIdentifier(path, node, macro), + }) + let newNode: false | babelTypes.Node + + try { + newNode = macro.replacePath(path) + } catch (e) { + reportUnsupportedSyntax(path, e as Error) + } + + if (newNode) { + const [newPath] = path.replaceWith(newNode) + + if (macro.needsUseLinguiImport) { + addImport(state, "useLingui").reference(newPath) + } + + if (macro.needsI18nImport) { + addImport(state, "i18n").reference(newPath) + } + } + }, + } as Visitor, + state + ) + }, + exit(path, state) { + const macroImports = getMacroImports(path) + macroImports.forEach((path) => path.remove()) + }, + }, + } as Visitor, + } +} diff --git a/packages/babel-plugin-lingui-macro/src/macro.ts b/packages/babel-plugin-lingui-macro/src/macro.ts new file mode 100644 index 000000000..13319d82f --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/macro.ts @@ -0,0 +1,57 @@ +import { createMacro, MacroParams } from "babel-plugin-macros" + +import { VisitNodeObject } from "@babel/traverse" +import { Program } from "@babel/types" + +import linguiPlugin from "./index" +import { JsMacroName, JsxMacroName } from "./constants" + +function macro({ state, babel, config }: MacroParams) { + if (!state.get("linguiProcessed")) { + state.opts = config + const plugin = linguiPlugin(babel) + + const { enter, exit } = plugin.visitor.Program as VisitNodeObject< + any, + Program + > + + enter(state.file.path, state) + state.file.path.traverse(plugin.visitor, state) + exit(state.file.path, state) + + state.set("linguiProcessed", true) + } + + return { keepImports: true } +} + +;[ + JsMacroName.defineMessage, + JsMacroName.msg, + JsMacroName.t, + JsMacroName.useLingui, + JsMacroName.plural, + JsMacroName.select, + JsMacroName.selectOrdinal, + + JsxMacroName.Trans, + JsxMacroName.Plural, + JsxMacroName.Select, + JsxMacroName.SelectOrdinal, +].forEach((name) => { + Object.defineProperty(module.exports, name, { + get() { + throw new Error( + `The macro you imported from "@lingui/core/macro" or "@lingui/react/macro" is being executed outside the context of compilation with babel-plugin-macros. ` + + `This indicates that you don't have the babel plugin "babel-plugin-macros" configured correctly. ` + + `Please see the documentation for how to configure babel-plugin-macros properly: ` + + "https://github.com/kentcdodds/babel-plugin-macros/blob/main/other/docs/user.md" + ) + }, + }) +}) + +export default createMacro(macro, { + configName: "lingui", +}) as { isBabelMacro: true } diff --git a/packages/babel-plugin-lingui-macro/src/macroJs.ts b/packages/babel-plugin-lingui-macro/src/macroJs.ts new file mode 100644 index 000000000..3d35d9842 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/macroJs.ts @@ -0,0 +1,322 @@ +import * as babelTypes from "@babel/types" +import * as t from "@babel/types" +import { + CallExpression, + Expression, + Identifier, + ObjectExpression, + ObjectProperty, +} from "@babel/types" +import { NodePath } from "@babel/traverse" + +import { Tokens } from "./icu" +import { JsMacroName } from "./constants" +import { createMessageDescriptorFromTokens } from "./messageDescriptorUtils" +import { + isLinguiIdentifier, + isDefineMessage, + tokenizeTemplateLiteral, + tokenizeNode, + processDescriptor, + createMacroJsContext, + MacroJsContext, +} from "./macroJsAst" + +export type MacroJsOpts = { + i18nImportName: string + useLinguiImportName: string + + stripNonEssentialProps: boolean + stripMessageProp: boolean + isLinguiIdentifier: (node: Identifier, macro: JsMacroName) => boolean +} + +export class MacroJs { + // Identifier of i18n object + i18nImportName: string + useLinguiImportName: string + + needsUseLinguiImport = false + needsI18nImport = false + + _ctx: MacroJsContext + + constructor(opts: MacroJsOpts) { + this.i18nImportName = opts.i18nImportName + this.useLinguiImportName = opts.useLinguiImportName + + this._ctx = createMacroJsContext( + opts.isLinguiIdentifier, + opts.stripNonEssentialProps, + opts.stripMessageProp + ) + } + + private replacePathWithMessage = ( + path: NodePath, + tokens: Tokens, + linguiInstance?: babelTypes.Expression + ) => { + return this.createI18nCall( + createMessageDescriptorFromTokens( + tokens, + path.node.loc, + this._ctx.stripNonEssentialProps, + this._ctx.stripMessageProp + ), + linguiInstance + ) + } + + replacePath = (path: NodePath): false | babelTypes.Expression => { + const ctx = this._ctx + + // defineMessage({ message: "Message", context: "My" }) -> {id: , message: "Message"} + if ( + // + path.isCallExpression() && + isDefineMessage(path.get("callee").node, ctx) + ) { + return processDescriptor( + path.get("arguments")[0].node as ObjectExpression, + ctx + ) + } + + // defineMessage`Message` -> {id: , message: "Message"} + if ( + path.isTaggedTemplateExpression() && + isDefineMessage(path.get("tag").node, ctx) + ) { + const tokens = tokenizeTemplateLiteral(path.get("quasi").node, ctx) + return createMessageDescriptorFromTokens( + tokens, + path.node.loc, + ctx.stripNonEssentialProps, + ctx.stripMessageProp + ) + } + + if (path.isTaggedTemplateExpression()) { + const tag = path.get("tag") + + // t(i18nInstance)`Message` -> i18nInstance._(messageDescriptor) + if ( + tag.isCallExpression() && + tag.get("arguments")[0]?.isExpression() && + isLinguiIdentifier(tag.get("callee").node, JsMacroName.t, ctx) + ) { + // Use the first argument as i18n instance instead of the default i18n instance + const i18nInstance = tag.get("arguments")[0].node as Expression + const tokens = tokenizeNode(path.node, false, ctx) + + return this.replacePathWithMessage(path, tokens, i18nInstance) + } + } + + // t(i18nInstance)(messageDescriptor) -> i18nInstance._(messageDescriptor) + if (path.isCallExpression()) { + const callee = path.get("callee") + + if ( + callee.isCallExpression() && + callee.get("arguments")[0]?.isExpression() && + isLinguiIdentifier(callee.get("callee").node, JsMacroName.t, ctx) + ) { + const i18nInstance = callee.node.arguments[0] as Expression + return this.replaceTAsFunction( + path.node as CallExpression, + ctx, + i18nInstance + ) + } + } + + // t({...}) + if ( + path.isCallExpression() && + isLinguiIdentifier(path.get("callee").node, JsMacroName.t, ctx) + ) { + this.needsI18nImport = true + return this.replaceTAsFunction(path.node, ctx) + } + + // { t } = useLingui() + if ( + path.isCallExpression() && + isLinguiIdentifier(path.get("callee").node, JsMacroName.useLingui, ctx) + ) { + this.needsUseLinguiImport = true + return this.processUseLingui(path, ctx) + } + + const tokens = tokenizeNode(path.node, true, ctx) + + if (tokens) { + this.needsI18nImport = true + return this.replacePathWithMessage(path, tokens) + } + + return false + } + + /** + * macro `t` is called with MessageDescriptor, after that + * we create a new node to append it to i18n._ + */ + private replaceTAsFunction = ( + node: CallExpression, + ctx: MacroJsContext, + linguiInstance?: babelTypes.Expression + ): babelTypes.CallExpression => { + let arg: Expression = node.arguments[0] as Expression + + if (t.isObjectExpression(arg)) { + arg = processDescriptor(arg, ctx) + } + + return this.createI18nCall(arg, linguiInstance) + } + + /** + * Receives reference to `useLingui()` call + * + * Finds every usage of { t } destructured from the call + * and process each reference as usual `t` macro. + * + * const { t } = useLingui() + * t`Message` + * + * ↓ ↓ ↓ ↓ ↓ ↓ + * + * const { _: _t } = useLingui() + * _t({id: , message: "Message"}) + */ + processUseLingui(path: NodePath, ctx: MacroJsContext) { + /* + * path is CallExpression eq: + * useLingui() + * + * path.parentPath should be a VariableDeclarator eq: + * const { t } = useLingui() + */ + if (!path.parentPath.isVariableDeclarator()) { + throw new Error( + `\`useLingui\` macro must be used in variable declaration. + + Example: + + const { t } = useLingui() + ` + ) + } + + // looking for `t` property in left side assigment + // in the declarator `const { t } = useLingui()` + const varDec = path.parentPath.node + + if (!t.isObjectPattern(varDec.id)) { + // Enforce destructuring `t` from `useLingui` macro to prevent misuse + throw new Error( + `You have to destructure \`t\` when using the \`useLingui\` macro, i.e: + const { t } = useLingui() + or + const { t: _ } = useLingui() + ` + ) + } + + const _property = t.isObjectPattern(varDec.id) + ? varDec.id.properties.find( + ( + property + ): property is ObjectProperty & { + value: Identifier + key: Identifier + } => + t.isObjectProperty(property) && + t.isIdentifier(property.key) && + t.isIdentifier(property.value) && + property.key.name == "t" + ) + : null + + const newNode = t.callExpression(t.identifier(this.useLinguiImportName), []) + + if (!_property) { + return newNode + } + + const uniqTIdentifier = path.scope.generateUidIdentifier("t") + + path.scope + .getBinding(_property.value.name) + ?.referencePaths.forEach((refPath) => { + // reference usually points to Identifier, + // parent would be an Expression with this identifier which we are interesting in + const currentPath = refPath.parentPath + + // { t } = useLingui() + // t`Hello!` + if (currentPath.isTaggedTemplateExpression()) { + const tokens = tokenizeTemplateLiteral(currentPath.node, ctx) + + const descriptor = createMessageDescriptorFromTokens( + tokens, + currentPath.node.loc, + ctx.stripNonEssentialProps, + ctx.stripMessageProp + ) + + const callExpr = t.callExpression( + t.identifier(uniqTIdentifier.name), + [descriptor] + ) + + return currentPath.replaceWith(callExpr) + } + + // { t } = useLingui() + // t(messageDescriptor) + if ( + currentPath.isCallExpression() && + currentPath.get("arguments")[0]?.isObjectExpression() + ) { + let descriptor = processDescriptor( + (currentPath.get("arguments")[0] as NodePath) + .node, + ctx + ) + const callExpr = t.callExpression( + t.identifier(uniqTIdentifier.name), + [descriptor] + ) + + return currentPath.replaceWith(callExpr) + } + + // for rest of cases just rename identifier for run-time counterpart + refPath.replaceWith(t.identifier(uniqTIdentifier.name)) + }) + + // assign uniq identifier for runtime `_` + // { t } = useLingui() -> { _ : _t } = useLingui() + _property.key.name = "_" + _property.value.name = uniqTIdentifier.name + + return t.callExpression(t.identifier(this.useLinguiImportName), []) + } + + private createI18nCall( + messageDescriptor: Expression | undefined, + linguiInstance?: Expression + ) { + return t.callExpression( + t.memberExpression( + linguiInstance ?? t.identifier(this.i18nImportName), + t.identifier("_") + ), + messageDescriptor ? [messageDescriptor] : [] + ) + } +} diff --git a/packages/macro/src/macroJs.test.ts b/packages/babel-plugin-lingui-macro/src/macroJsAst.test.ts similarity index 72% rename from packages/macro/src/macroJs.test.ts rename to packages/babel-plugin-lingui-macro/src/macroJsAst.test.ts index 3f746f123..3bf9464ab 100644 --- a/packages/macro/src/macroJs.test.ts +++ b/packages/babel-plugin-lingui-macro/src/macroJsAst.test.ts @@ -1,25 +1,54 @@ -import { parseExpression } from "@babel/parser" -import * as types from "@babel/types" -import MacroJs from "./macroJs" -import { CallExpression } from "@babel/types" +import { type CallExpression, type Expression } from "@babel/types" +import { + tokenizeTemplateLiteral, + tokenizeChoiceComponent, + createMacroJsContext, +} from "./macroJsAst" +import type { NodePath } from "@babel/traverse" +import { transformSync } from "@babel/core" +import { JsMacroName } from "./constants" -function createMacro() { - return new MacroJs( - { types }, - { - i18nImportName: "i18n", - stripNonEssentialProps: false, - nameMap: new Map(), - } +const parseExpression = (expression: string) => { + let path: NodePath + + const importExp = `import {t, plural, select, selectOrdinal} from "@lingui/core/macro"; \n` + transformSync(importExp + expression, { + filename: "unit-test.js", + configFile: false, + presets: [], + plugins: [ + "@babel/plugin-syntax-jsx", + { + visitor: { + "CallExpression|TaggedTemplateExpression": ( + d: NodePath + ) => { + path = d + d.stop() + }, + }, + }, + ], + }) + + return path +} + +function createMacroCtx() { + return createMacroJsContext( + (identifier, macro) => { + return identifier.name === macro + }, + false, // stripNonEssentialProps + false // stripMessageProp ) } describe("js macro", () => { describe("tokenizeTemplateLiteral", () => { it("simple message without arguments", () => { - const macro = createMacro() const exp = parseExpression("t`Message`") - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toEqual([ { type: "text", @@ -29,9 +58,8 @@ describe("js macro", () => { }) it("with custom lingui instance", () => { - const macro = createMacro() const exp = parseExpression("t(i18n)`Message`") - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toEqual([ { type: "text", @@ -41,9 +69,8 @@ describe("js macro", () => { }) it("message with named argument", () => { - const macro = createMacro() const exp = parseExpression("t`Message ${name}`") - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toEqual([ { type: "text", @@ -61,9 +88,8 @@ describe("js macro", () => { }) it("message with positional argument", () => { - const macro = createMacro() const exp = parseExpression("t`Message ${obj.name}`") - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toEqual([ { type: "text", @@ -80,9 +106,8 @@ describe("js macro", () => { }) it("message with plural", () => { - const macro = createMacro() const exp = parseExpression("t`Message ${plural(count, {})}`") - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toEqual([ { type: "text", @@ -101,9 +126,8 @@ describe("js macro", () => { }) it("message with unicode \\u chars is interpreted by babel", () => { - const macro = createMacro() const exp = parseExpression("t`Message \\u0020`") - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toEqual([ { type: "text", @@ -113,9 +137,8 @@ describe("js macro", () => { }) it("message with unicode \\x chars is interpreted by babel", () => { - const macro = createMacro() const exp = parseExpression("t`Bienvenue\\xA0!`") - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toEqual([ { type: "text", @@ -125,12 +148,11 @@ describe("js macro", () => { ]) }) - it("message with double scaped literals it's stripped", () => { - const macro = createMacro() + it("message with double escaped literals it's stripped", () => { const exp = parseExpression( "t`Passing \\`${argSet}\\` is not supported.`" ) - const tokens = macro.tokenizeTemplateLiteral(exp) + const tokens = tokenizeTemplateLiteral(exp.node, createMacroCtx()) expect(tokens).toMatchObject([ { type: "text", @@ -140,20 +162,10 @@ describe("js macro", () => { name: "argSet", type: "arg", value: { - end: 20, loc: { - end: { - column: 20, - line: 1, - }, identifierName: "argSet", - start: { - column: 14, - line: 1, - }, }, name: "argSet", - start: 14, type: "Identifier", }, }, @@ -165,13 +177,16 @@ describe("js macro", () => { }) }) - describe("tokenizeChoiceMethod", () => { + describe("tokenizeChoiceComponent", () => { it("plural", () => { - const macro = createMacro() const exp = parseExpression( "plural(count, { one: '# book', other: '# books'})" ) - const tokens = macro.tokenizeChoiceComponent(exp as CallExpression) + const tokens = tokenizeChoiceComponent( + (exp as NodePath).node, + JsMacroName.plural, + createMacroCtx() + ) expect(tokens).toEqual({ type: "arg", name: "count", @@ -188,7 +203,6 @@ describe("js macro", () => { }) it("plural with offset", () => { - const macro = createMacro() const exp = parseExpression( `plural(count, { offset: 1, @@ -197,7 +211,11 @@ describe("js macro", () => { other: '# books' })` ) - const tokens = macro.tokenizeChoiceComponent(exp as CallExpression) + const tokens = tokenizeChoiceComponent( + (exp as NodePath).node, + JsMacroName.plural, + createMacroCtx() + ) expect(tokens).toEqual({ type: "arg", name: "count", @@ -216,11 +234,14 @@ describe("js macro", () => { }) it("plural with template literal", () => { - const macro = createMacro() const exp = parseExpression( "plural(count, { one: `# glass of ${drink}`, other: `# glasses of ${drink}`})" ) - const tokens = macro.tokenizeChoiceComponent(exp as CallExpression) + const tokens = tokenizeChoiceComponent( + (exp as NodePath).node, + JsMacroName.plural, + createMacroCtx() + ) expect(tokens).toEqual({ type: "arg", name: "count", @@ -263,7 +284,6 @@ describe("js macro", () => { }) it("plural with select", () => { - const macro = createMacro() const exp = parseExpression( `plural(count, { one: select(gender, { @@ -274,7 +294,11 @@ describe("js macro", () => { other: otherText })` ) - const tokens = macro.tokenizeChoiceComponent(exp as CallExpression) + const tokens = tokenizeChoiceComponent( + (exp as NodePath).node, + JsMacroName.plural, + createMacroCtx() + ) expect(tokens).toEqual({ type: "arg", name: "count", @@ -320,7 +344,6 @@ describe("js macro", () => { }) it("select", () => { - const macro = createMacro() const exp = parseExpression( `select(gender, { male: "he", @@ -328,8 +351,12 @@ describe("js macro", () => { other: "they" })` ) - const tokens = macro.tokenizeChoiceComponent(exp as CallExpression) - expect(tokens).toEqual({ + const tokens = tokenizeChoiceComponent( + (exp as NodePath).node, + JsMacroName.select, + createMacroCtx() + ) + expect(tokens).toMatchObject({ format: "select", name: "gender", options: expect.objectContaining({ @@ -340,20 +367,7 @@ describe("js macro", () => { }), type: "arg", value: { - end: 13, - loc: { - end: expect.objectContaining({ - column: 13, - line: 1, - }), - identifierName: "gender", - start: expect.objectContaining({ - column: 7, - line: 1, - }), - }, name: "gender", - start: 7, type: "Identifier", }, }) diff --git a/packages/babel-plugin-lingui-macro/src/macroJsAst.ts b/packages/babel-plugin-lingui-macro/src/macroJsAst.ts new file mode 100644 index 000000000..8c7e942cc --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/macroJsAst.ts @@ -0,0 +1,332 @@ +import * as t from "@babel/types" +import { + ObjectExpression, + Expression, + TemplateLiteral, + Identifier, + Node, + CallExpression, + StringLiteral, + ObjectProperty, +} from "@babel/types" +import { MsgDescriptorPropKey, JsMacroName } from "./constants" +import { Token, TextToken, ArgToken } from "./icu" +import { createMessageDescriptorFromTokens } from "./messageDescriptorUtils" +import { makeCounter } from "./utils" + +export type MacroJsContext = { + // Positional expressions counter (e.g. for placeholders `Hello {0}, today is {1}`) + getExpressionIndex: () => number + stripNonEssentialProps: boolean + stripMessageProp: boolean + isLinguiIdentifier: (node: Identifier, macro: JsMacroName) => boolean +} + +export function createMacroJsContext( + isLinguiIdentifier: MacroJsContext["isLinguiIdentifier"], + stripNonEssentialProps: boolean, + stripMessageProp: boolean +): MacroJsContext { + return { + getExpressionIndex: makeCounter(), + isLinguiIdentifier, + stripNonEssentialProps, + stripMessageProp, + } +} + +/** + * `processDescriptor` expand macros inside message descriptor. + * Message descriptor is used in `defineMessage`. + * + * { + * comment: "Description", + * message: plural("value", { one: "book", other: "books" }) + * } + * + * ↓ ↓ ↓ ↓ ↓ ↓ + * + * { + * comment: "Description", + * id: + * message: "{value, plural, one {book} other {books}}" + * } + * + */ +export function processDescriptor( + descriptor: ObjectExpression, + ctx: MacroJsContext +) { + const messageProperty = getObjectPropertyByKey( + descriptor, + MsgDescriptorPropKey.message + ) + const idProperty = getObjectPropertyByKey(descriptor, MsgDescriptorPropKey.id) + const contextProperty = getObjectPropertyByKey( + descriptor, + MsgDescriptorPropKey.context + ) + const commentProperty = getObjectPropertyByKey( + descriptor, + MsgDescriptorPropKey.comment + ) + + let tokens: Token[] = [] + + // if there's `message` property, replace macros with formatted message + if (messageProperty) { + // Inside message descriptor the `t` macro in `message` prop is optional. + // Template strings are always processed as if they were wrapped by `t`. + const messageValue = messageProperty.value + + tokens = t.isTemplateLiteral(messageValue) + ? tokenizeTemplateLiteral(messageValue, ctx) + : tokenizeNode(messageValue, true, ctx) + } + + return createMessageDescriptorFromTokens( + tokens, + descriptor.loc, + ctx.stripNonEssentialProps, + ctx.stripMessageProp, + { + id: idProperty, + context: contextProperty, + comment: commentProperty, + } + ) +} + +export function tokenizeNode( + node: Node, + ignoreExpression = false, + ctx: MacroJsContext +): Token[] { + if (isI18nMethod(node, ctx)) { + // t + return tokenizeTemplateLiteral(node as Expression, ctx) + } + + if (t.isCallExpression(node) && isArgDecorator(node, ctx)) { + return [tokenizeArg(node, ctx)] + } + + const choiceMethod = isChoiceMethod(node, ctx) + // plural, select and selectOrdinal + if (choiceMethod) { + return [tokenizeChoiceComponent(node as CallExpression, choiceMethod, ctx)] + } + + if (t.isStringLiteral(node)) { + return [ + { + type: "text", + value: node.value, + } satisfies TextToken, + ] + } + // if (isFormatMethod(node.callee)) { + // // date, number + // return transformFormatMethod(node, file, props, root) + + if (!ignoreExpression) { + return [tokenizeExpression(node, ctx)] + } +} + +/** + * `node` is a TemplateLiteral. node.quasi contains + * text chunks and node.expressions contains expressions. + * Both arrays must be zipped together to get the final list of tokens. + */ +export function tokenizeTemplateLiteral( + node: Expression, + ctx: MacroJsContext +): Token[] { + const tpl = t.isTaggedTemplateExpression(node) + ? node.quasi + : (node as TemplateLiteral) + + const expressions = tpl.expressions as Expression[] + + return tpl.quasis.flatMap((text, i) => { + const value = text.value.cooked + + let argTokens: Token[] = [] + const currExp = expressions[i] + + if (currExp) { + argTokens = t.isCallExpression(currExp) + ? tokenizeNode(currExp, false, ctx) + : [tokenizeExpression(currExp, ctx)] + } + const textToken: TextToken = { + type: "text", + value, + } + return [...(value ? [textToken] : []), ...argTokens] + }) +} + +export function tokenizeChoiceComponent( + node: CallExpression, + componentName: string, + ctx: MacroJsContext +): ArgToken { + const format = componentName.toLowerCase() + + const token: ArgToken = { + ...tokenizeExpression(node.arguments[0], ctx), + format: format, + options: { + offset: undefined, + }, + } + + const props = (node.arguments[1] as ObjectExpression).properties + + for (const attr of props) { + if (!t.isObjectProperty(attr)) { + throw new Error("Expected an ObjectProperty") + } + + const key = attr.key + const attrValue = attr.value as Expression + + // name is either: + // NumericLiteral => convert to `={number}` + // StringLiteral => key.value + // Identifier => key.name + const name = t.isNumericLiteral(key) + ? `=${key.value}` + : (key as Identifier).name || (key as StringLiteral).value + + if (format !== "select" && name === "offset") { + token.options.offset = (attrValue as StringLiteral).value + } else { + let value: ArgToken["options"][string] + + if (t.isTemplateLiteral(attrValue)) { + value = tokenizeTemplateLiteral(attrValue, ctx) + } else if (t.isCallExpression(attrValue)) { + value = tokenizeNode(attrValue, false, ctx) + } else if (t.isStringLiteral(attrValue)) { + value = attrValue.value + } else if (t.isExpression(attrValue)) { + value = tokenizeExpression(attrValue, ctx) + } else { + value = (attrValue as unknown as StringLiteral).value + } + token.options[name] = value + } + } + + return token +} + +export function tokenizeExpression( + node: Node | Expression, + ctx: MacroJsContext +): ArgToken { + return { + type: "arg", + name: expressionToArgument(node as Expression, ctx), + value: node as Expression, + } +} + +export function tokenizeArg( + node: CallExpression, + ctx: MacroJsContext +): ArgToken { + const arg = node.arguments[0] as Expression + + return { + type: "arg", + name: expressionToArgument(arg, ctx), + raw: true, + value: arg, + } +} + +export function expressionToArgument( + exp: Expression, + ctx: MacroJsContext +): string { + if (t.isIdentifier(exp)) { + return exp.name + } else if (t.isStringLiteral(exp)) { + return exp.value + } else { + return String(ctx.getExpressionIndex()) + } +} + +export function isArgDecorator(node: Node, ctx: MacroJsContext): boolean { + return ( + t.isCallExpression(node) && + isLinguiIdentifier(node.callee, JsMacroName.arg, ctx) + ) +} + +export function isDefineMessage(node: Node, ctx: MacroJsContext): boolean { + return ( + isLinguiIdentifier(node, JsMacroName.defineMessage, ctx) || + isLinguiIdentifier(node, JsMacroName.msg, ctx) + ) +} + +export function isI18nMethod(node: Node, ctx: MacroJsContext) { + if (!t.isTaggedTemplateExpression(node)) { + return + } + + const tag = node.tag + + return ( + isLinguiIdentifier(tag, JsMacroName.t, ctx) || + (t.isCallExpression(tag) && + isLinguiIdentifier(tag.callee, JsMacroName.t, ctx)) + ) +} + +export function isLinguiIdentifier( + node: Node, + name: JsMacroName, + ctx: MacroJsContext +) { + if (!t.isIdentifier(node)) { + return false + } + + return ctx.isLinguiIdentifier(node, name) +} + +export function isChoiceMethod(node: Node, ctx: MacroJsContext) { + if (!t.isCallExpression(node)) { + return + } + + if (isLinguiIdentifier(node.callee, JsMacroName.plural, ctx)) { + return JsMacroName.plural + } + if (isLinguiIdentifier(node.callee, JsMacroName.select, ctx)) { + return JsMacroName.select + } + if (isLinguiIdentifier(node.callee, JsMacroName.selectOrdinal, ctx)) { + return JsMacroName.selectOrdinal + } +} + +function getObjectPropertyByKey( + objectExp: ObjectExpression, + key: string +): ObjectProperty { + return objectExp.properties.find( + (property) => + t.isObjectProperty(property) && + t.isIdentifier(property.key as Expression, { + name: key, + }) + ) as ObjectProperty +} diff --git a/packages/macro/src/macroJsx.test.ts b/packages/babel-plugin-lingui-macro/src/macroJsx.test.ts similarity index 73% rename from packages/macro/src/macroJsx.test.ts rename to packages/babel-plugin-lingui-macro/src/macroJsx.test.ts index 71bb6a464..b16b2b560 100644 --- a/packages/macro/src/macroJsx.test.ts +++ b/packages/babel-plugin-lingui-macro/src/macroJsx.test.ts @@ -1,15 +1,21 @@ +import type { JSXElement } from "@babel/types" import * as types from "@babel/types" -import MacroJSX, { normalizeWhitespace } from "./macroJsx" +import { MacroJSX } from "./macroJsx" import { transformSync } from "@babel/core" import type { NodePath } from "@babel/traverse" -import type { JSXElement } from "@babel/types" +import { JsxMacroName } from "./constants" const parseExpression = (expression: string) => { let path: NodePath - transformSync(expression, { + const importExp = `import {Trans, Plural, Select, SelectOrdinal} from "@lingui/react/macro";\n` + + transformSync(importExp + expression, { filename: "unit-test.js", + configFile: false, + presets: [], plugins: [ + "@babel/plugin-syntax-jsx", { visitor: { JSXElement: (d) => { @@ -27,92 +33,15 @@ const parseExpression = (expression: string) => { function createMacro() { return new MacroJSX( { types }, - { stripNonEssentialProps: false, nameMap: new Map() } + { + stripNonEssentialProps: false, + stripMessageProp: false, + transImportName: "Trans", + } ) } describe("jsx macro", () => { - describe("normalizeWhitespace", () => { - it("should remove whitespace before/after expression", () => { - const actual = normalizeWhitespace( - `You have - - {count, plural, one {Message} other {Messages}}` - ) - - expect(actual).toBe( - `You have{count, plural, one {Message} other {Messages}}` - ) - }) - - it("should remove whitespace before/after tag", () => { - const actual = normalizeWhitespace( - ` Hello World!
-

- My name is {{" "}} - {{name}} -

` - ) - - expect(actual).toBe( - `Hello World!

My name is {{" "}}{{name}}

` - ) - }) - - it("should remove whitespace before/after tag", () => { - const actual = normalizeWhitespace( - `Property {0}, - function {1}, - array {2}, - constant {3}, - object {4}, - everything {5}` - ) - - expect(actual).toBe( - `Property {0}, function {1}, array {2}, constant {3}, object {4}, everything {5}` - ) - }) - - it("should remove trailing whitespaces in icu expressions", () => { - const actual = normalizeWhitespace( - `{count, plural, one { - - <0># slot added - - } other { - - <1># slots added - - }} -` - ) - - expect(actual).toBe( - `{count, plural, one {<0># slot added} other {<1># slots added}}` - ) - }) - - it("should remove leading whitespaces in icu expressions", () => { - const actual = normalizeWhitespace( - `{count, plural, one { - - One hello - - } other { - - Other hello - - }} -` - ) - - expect(actual).toBe( - `{count, plural, one {One hello} other {Other hello}}` - ) - }) - }) - describe("tokenizeTrans", () => { it("simple message without arguments", () => { const macro = createMacro() @@ -195,7 +124,7 @@ describe("jsx macro", () => { const exp = parseExpression( "" ) - const tokens = macro.tokenizeChoiceComponent(exp) + const tokens = macro.tokenizeChoiceComponent(exp, JsxMacroName.Plural) expect(tokens).toEqual({ type: "arg", name: "count", @@ -222,7 +151,7 @@ describe("jsx macro", () => { other='# books' />` ) - const tokens = macro.tokenizeChoiceComponent(exp) + const tokens = macro.tokenizeChoiceComponent(exp, JsxMacroName.Plural) expect(tokens).toEqual({ type: "arg", name: "count", @@ -251,7 +180,7 @@ describe("jsx macro", () => { other='# books' />` ) - const tokens = macro.tokenizeChoiceComponent(exp) + const tokens = macro.tokenizeChoiceComponent(exp, JsxMacroName.Plural) expect(tokens).toEqual({ type: "arg", name: "count", @@ -273,7 +202,7 @@ describe("jsx macro", () => { const exp = parseExpression( "" ) - const tokens = macro.tokenizeChoiceComponent(exp) + const tokens = macro.tokenizeChoiceComponent(exp, JsxMacroName.Plural) expect(tokens).toEqual({ type: "arg", name: "count", @@ -330,7 +259,7 @@ describe("jsx macro", () => { } />` ) - const tokens = macro.tokenizeChoiceComponent(exp) + const tokens = macro.tokenizeChoiceComponent(exp, JsxMacroName.Plural) expect(tokens).toEqual({ type: "arg", name: "count", @@ -383,18 +312,6 @@ describe("jsx macro", () => { }, type: "arg", value: { - end: 31, - loc: { - end: { - column: 23, - line: 2, - }, - identifierName: "gender", - start: { - column: 17, - line: 2, - }, - }, name: "gender", type: "Identifier", }, diff --git a/packages/macro/src/macroJsx.ts b/packages/babel-plugin-lingui-macro/src/macroJsx.ts similarity index 56% rename from packages/macro/src/macroJsx.ts rename to packages/babel-plugin-lingui-macro/src/macroJsx.ts index 66046967a..a867bac01 100644 --- a/packages/macro/src/macroJsx.ts +++ b/packages/babel-plugin-lingui-macro/src/macroJsx.ts @@ -11,18 +11,20 @@ import { Node, StringLiteral, TemplateLiteral, + SourceLocation, } from "@babel/types" import { NodePath } from "@babel/traverse" -import ICUMessageFormat, { - ArgToken, - ElementToken, - TextToken, - Token, -} from "./icu" +import { ArgToken, ElementToken, TextToken, Token } from "./icu" import { makeCounter } from "./utils" -import { COMMENT, CONTEXT, ID, MESSAGE } from "./constants" -import { generateMessageId } from "@lingui/message-utils/generateMessageId" +import { + JsxMacroName, + MACRO_REACT_PACKAGE, + MACRO_LEGACY_PACKAGE, + MsgDescriptorPropKey, +} from "./constants" +import cleanJSXElementLiteralChild from "./utils/cleanJSXElementLiteralChild" +import { createMessageDescriptorFromTokens } from "./messageDescriptorUtils" const pluralRuleRe = /(_[\d\w]+|zero|one|two|few|many|other)/ const jsx2icuExactChoice = (value: string) => @@ -30,168 +32,74 @@ const jsx2icuExactChoice = (value: string) => type JSXChildPath = NodePath -// replace whitespace before/after newline with single space -const keepSpaceRe = /\s*(?:\r\n|\r|\n)+\s*/g -// remove whitespace before/after tag or expression -const stripAroundTagsRe = - /(?:([>}])(?:\r\n|\r|\n)+\s*|(?:\r\n|\r|\n)+\s*(?=[<{]))/g - -function maybeNodeValue(node: Node): string { +function maybeNodeValue(node: Node): { text: string; loc: SourceLocation } { if (!node) return null - if (node.type === "StringLiteral") return node.value + if (node.type === "StringLiteral") return { text: node.value, loc: node.loc } if (node.type === "JSXAttribute") return maybeNodeValue(node.value) if (node.type === "JSXExpressionContainer") return maybeNodeValue(node.expression) if (node.type === "TemplateLiteral" && node.expressions.length === 0) - return node.quasis[0].value.raw + return { text: node.quasis[0].value.raw, loc: node.loc } return null } -export function normalizeWhitespace(text: string): string { - return ( - text - .replace(stripAroundTagsRe, "$1") - .replace(keepSpaceRe, " ") - // keep escaped newlines - .replace(/\\n/g, "\n") - .replace(/\\s/g, " ") - // we remove trailing whitespace inside Plural - .replace(/(\s+})/gm, "}") - // we remove leading whitespace inside Plural - .replace(/({\s+)/gm, "{") - .trim() - ) -} - export type MacroJsxOpts = { stripNonEssentialProps: boolean - nameMap: Map + stripMessageProp: boolean + transImportName: string } -export default class MacroJSX { +export class MacroJSX { types: typeof babelTypes expressionIndex = makeCounter() elementIndex = makeCounter() stripNonEssentialProps: boolean - nameMap: Map - nameMapReversed: Map + stripMessageProp: boolean + transImportName: string constructor({ types }: { types: typeof babelTypes }, opts: MacroJsxOpts) { this.types = types this.stripNonEssentialProps = opts.stripNonEssentialProps - this.nameMap = opts.nameMap - this.nameMapReversed = Array.from(opts.nameMap.entries()).reduce( - (map, [key, value]) => map.set(value, key), - new Map() - ) - } - - createStringJsxAttribute = (name: string, value: string) => { - // This handles quoted JSX attributes and html entities. - return this.types.jsxAttribute( - this.types.jsxIdentifier(name), - this.types.jsxExpressionContainer(this.types.stringLiteral(value)) - ) + this.stripMessageProp = opts.stripMessageProp + this.transImportName = opts.transImportName } - replacePath = (path: NodePath) => { + replacePath = (path: NodePath): false | Node => { if (!path.isJSXElement()) { - return path + return false } - const tokens = this.tokenizeNode(path) + const tokens = this.tokenizeNode(path, true, true) - const messageFormat = new ICUMessageFormat() - const { - message: messageRaw, - values, - jsxElements, - } = messageFormat.fromTokens(tokens) - const message = normalizeWhitespace(messageRaw) + if (!tokens) { + return false + } const { attributes, id, comment, context } = this.stripMacroAttributes( path as NodePath ) - if (!id && !message) { - return + if (!tokens.length) { + throw new Error("Incorrect usage of Trans") } - if (id) { - attributes.push( - this.types.jsxAttribute( - this.types.jsxIdentifier(ID), - this.types.stringLiteral(id) - ) - ) - } else { - attributes.push( - this.createStringJsxAttribute(ID, generateMessageId(message, context)) - ) - } - - if (!this.stripNonEssentialProps) { - if (message) { - attributes.push(this.createStringJsxAttribute(MESSAGE, message)) - } - - if (comment) { - attributes.push( - this.types.jsxAttribute( - this.types.jsxIdentifier(COMMENT), - this.types.stringLiteral(comment) - ) - ) - } - - if (context) { - attributes.push( - this.types.jsxAttribute( - this.types.jsxIdentifier(CONTEXT), - this.types.stringLiteral(context) - ) - ) + const messageDescriptor = createMessageDescriptorFromTokens( + tokens, + path.node.loc, + this.stripNonEssentialProps, + this.stripMessageProp, + { + id, + context, + comment, } - } - - // Parameters for variable substitution - const valuesObject = Object.keys(values).map((key) => - this.types.objectProperty(this.types.identifier(key), values[key]) ) - if (valuesObject.length) { - attributes.push( - this.types.jsxAttribute( - this.types.jsxIdentifier("values"), - this.types.jsxExpressionContainer( - this.types.objectExpression(valuesObject) - ) - ) - ) - } - - // Inline elements - if (Object.keys(jsxElements).length) { - attributes.push( - this.types.jsxAttribute( - this.types.jsxIdentifier("components"), - this.types.jsxExpressionContainer( - this.types.objectExpression( - Object.keys(jsxElements).map((key) => - this.types.objectProperty( - this.types.identifier(key), - jsxElements[key] - ) - ) - ) - ) - ) - ) - } + attributes.push(this.types.jsxSpreadAttribute(messageDescriptor)) const newNode = this.types.jsxElement( this.types.jsxOpeningElement( - this.types.jsxIdentifier("Trans"), + this.types.jsxIdentifier(this.transImportName), attributes, true ), @@ -201,7 +109,7 @@ export default class MacroJSX { ) newNode.loc = path.node.loc - path.replaceWith(newNode) + return newNode } attrName = (names: string[], exclude = false) => { @@ -214,12 +122,23 @@ export default class MacroJSX { stripMacroAttributes = (path: NodePath) => { const { attributes } = path.node.openingElement - const id = attributes.find(this.attrName([ID])) - const message = attributes.find(this.attrName([MESSAGE])) - const comment = attributes.find(this.attrName([COMMENT])) - const context = attributes.find(this.attrName([CONTEXT])) + const id = attributes.find(this.attrName([MsgDescriptorPropKey.id])) + const message = attributes.find( + this.attrName([MsgDescriptorPropKey.message]) + ) + const comment = attributes.find( + this.attrName([MsgDescriptorPropKey.comment]) + ) + const context = attributes.find( + this.attrName([MsgDescriptorPropKey.context]) + ) - let reserved = [ID, MESSAGE, COMMENT, CONTEXT] + let reserved: string[] = [ + MsgDescriptorPropKey.id, + MsgDescriptorPropKey.message, + MsgDescriptorPropKey.comment, + MsgDescriptorPropKey.context, + ] if (this.isChoiceComponent(path)) { reserved = [ @@ -246,16 +165,33 @@ export default class MacroJSX { } } - tokenizeNode = (path: NodePath): Token[] => { + tokenizeNode = ( + path: NodePath, + ignoreExpression = false, + ignoreElement = false + ): Token[] => { if (this.isTransComponent(path)) { // t return this.tokenizeTrans(path) - } else if (this.isChoiceComponent(path)) { + } + + const componentName = this.isChoiceComponent(path) + + if (componentName) { // plural, select and selectOrdinal - return [this.tokenizeChoiceComponent(path)] - } else if (path.isJSXElement()) { + return [ + this.tokenizeChoiceComponent( + path as NodePath, + componentName + ), + ] + } + + if (path.isJSXElement() && !ignoreElement) { return [this.tokenizeElement(path)] - } else { + } + + if (!ignoreExpression) { return [this.tokenizeExpression(path)] } } @@ -272,8 +208,7 @@ export default class MacroJSX { const exp = path.get("expression") as NodePath if (exp.isStringLiteral()) { - // Escape forced newlines to keep them in message. - return [this.tokenizeText(exp.node.value.replace(/\n/g, "\\n"))] + return [this.tokenizeText(exp.node.value)] } if (exp.isTemplateLiteral()) { return this.tokenizeTemplateLiteral(exp) @@ -289,9 +224,11 @@ export default class MacroJSX { } else if (path.isJSXElement()) { return this.tokenizeNode(path) } else if (path.isJSXSpreadChild()) { - // just do nothing + throw new Error( + "Incorrect usage of Trans: Spread could not be used as Trans children" + ) } else if (path.isJSXText()) { - return [this.tokenizeText(path.node.value)] + return [this.tokenizeText(cleanJSXElementLiteralChild(path.node.value))] } else { // impossible path // return this.tokenizeText(node.value) @@ -302,12 +239,7 @@ export default class MacroJSX { const expressions = exp.get("expressions") as NodePath[] return exp.get("quasis").flatMap(({ node: text }, i) => { - // if it's an unicode we keep the cooked value because it's the parsed value by babel (without unicode chars) - // This regex will detect if a string contains unicode chars, when they're we should interpolate them - // why? because platforms like react native doesn't parse them, just doing a JSON.parse makes them UTF-8 friendly - const value = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g.test(text.value.raw) - ? text.value.cooked - : text.value.raw + const value = text.value.cooked let argTokens: Token[] = [] const currExp = expressions[i] @@ -318,25 +250,24 @@ export default class MacroJSX { : [this.tokenizeExpression(currExp)] } - return [ - ...(value ? [this.tokenizeText(this.clearBackslashes(value))] : []), - ...argTokens, - ] + return [...(value ? [this.tokenizeText(value)] : []), ...argTokens] }) } - tokenizeChoiceComponent = (path: NodePath): Token => { + tokenizeChoiceComponent = ( + path: NodePath, + componentName: JsxMacroName + ): Token => { const element = path.get("openingElement") - const name = this.getJsxTagName(path.node) - const format = (this.nameMapReversed.get(name) || name).toLowerCase() + const format = componentName.toLowerCase() const props = element.get("attributes").filter((attr) => { return this.attrName( [ - ID, - COMMENT, - MESSAGE, - CONTEXT, + MsgDescriptorPropKey.id, + MsgDescriptorPropKey.comment, + MsgDescriptorPropKey.message, + MsgDescriptorPropKey.context, "key", // we remove react props that are not useful for translation "render", @@ -399,6 +330,7 @@ export default class MacroJSX { } else { option = this.tokenizeChildren(value as JSXChildPath) } + if (pluralRuleRe.test(name)) { token.options[jsx2icuExactChoice(name)] = option } else { @@ -468,41 +400,35 @@ export default class MacroJSX { return path.isIdentifier() ? path.node.name : String(this.expressionIndex()) } - /** - * We clean '//\` ' to just '`' - **/ - clearBackslashes(value: string): string { - // if not we replace the extra scaped literals - return value.replace(/\\`/g, "`") - } - isLinguiComponent = ( path: NodePath, - name: string + name: JsxMacroName ): path is NodePath => { + if (!path.isJSXElement()) { + return false + } + + const identifier = path.get("openingElement").get("name") + return ( - path.isJSXElement() && - this.types.isJSXIdentifier(path.node.openingElement.name, { - name: this.nameMap.get(name) || name, - }) + identifier.referencesImport(MACRO_REACT_PACKAGE, name) || + identifier.referencesImport(MACRO_LEGACY_PACKAGE, name) ) } isTransComponent = (path: NodePath): path is NodePath => { - return this.isLinguiComponent(path, "Trans") + return this.isLinguiComponent(path, JsxMacroName.Trans) } - isChoiceComponent = (path: NodePath): path is NodePath => { - return ( - this.isLinguiComponent(path, "Plural") || - this.isLinguiComponent(path, "Select") || - this.isLinguiComponent(path, "SelectOrdinal") - ) - } - - getJsxTagName = (node: JSXElement): string => { - if (this.types.isJSXIdentifier(node.openingElement.name)) { - return node.openingElement.name.name + isChoiceComponent = (path: NodePath): JsxMacroName => { + if (this.isLinguiComponent(path, JsxMacroName.Plural)) { + return JsxMacroName.Plural + } + if (this.isLinguiComponent(path, JsxMacroName.Select)) { + return JsxMacroName.Select + } + if (this.isLinguiComponent(path, JsxMacroName.SelectOrdinal)) { + return JsxMacroName.SelectOrdinal } } } diff --git a/packages/babel-plugin-lingui-macro/src/messageDescriptorUtils.ts b/packages/babel-plugin-lingui-macro/src/messageDescriptorUtils.ts new file mode 100644 index 000000000..165c0032f --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/messageDescriptorUtils.ts @@ -0,0 +1,192 @@ +import { ICUMessageFormat, Tokens, ParsedResult } from "./icu" +import { + SourceLocation, + ObjectProperty, + ObjectExpression, + Expression, +} from "@babel/types" +import { EXTRACT_MARK, MsgDescriptorPropKey } from "./constants" +import * as types from "@babel/types" +import { generateMessageId } from "@lingui/message-utils/generateMessageId" + +function buildICUFromTokens(tokens: Tokens) { + const messageFormat = new ICUMessageFormat() + return messageFormat.fromTokens(tokens) +} + +type TextWithLoc = { + text: string + loc?: SourceLocation +} + +function isObjectProperty( + node: TextWithLoc | ObjectProperty +): node is ObjectProperty { + return "type" in node +} + +export function createMessageDescriptorFromTokens( + tokens: Tokens, + oldLoc: SourceLocation, + stripNonEssentialProps: boolean, + stripMessageProp: boolean, + defaults: { + id?: TextWithLoc | ObjectProperty + context?: TextWithLoc | ObjectProperty + comment?: TextWithLoc | ObjectProperty + } = {} +) { + return createMessageDescriptor( + buildICUFromTokens(tokens), + oldLoc, + stripNonEssentialProps, + stripMessageProp, + defaults + ) +} + +export function createMessageDescriptor( + result: Partial, + oldLoc: SourceLocation, + stripNonEssentialProps: boolean, + stripMessageProp: boolean, + defaults: { + id?: TextWithLoc | ObjectProperty + context?: TextWithLoc | ObjectProperty + comment?: TextWithLoc | ObjectProperty + } = {} +) { + const { message, values, elements } = result + + const properties: ObjectProperty[] = [] + + properties.push( + defaults.id + ? isObjectProperty(defaults.id) + ? defaults.id + : createStringObjectProperty( + MsgDescriptorPropKey.id, + defaults.id.text, + defaults.id.loc + ) + : createIdProperty( + message, + defaults.context + ? isObjectProperty(defaults.context) + ? getTextFromExpression(defaults.context.value as Expression) + : defaults.context.text + : null + ) + ) + + if (!stripMessageProp) { + if (message) { + properties.push( + createStringObjectProperty(MsgDescriptorPropKey.message, message) + ) + } + } + + if (!stripNonEssentialProps) { + if (defaults.comment) { + properties.push( + isObjectProperty(defaults.comment) + ? defaults.comment + : createStringObjectProperty( + MsgDescriptorPropKey.comment, + defaults.comment.text, + defaults.comment.loc + ) + ) + } + + if (defaults.context) { + properties.push( + isObjectProperty(defaults.context) + ? defaults.context + : createStringObjectProperty( + MsgDescriptorPropKey.context, + defaults.context.text, + defaults.context.loc + ) + ) + } + } + + if (values) { + properties.push(createValuesProperty(MsgDescriptorPropKey.values, values)) + } + + if (elements) { + properties.push( + createValuesProperty(MsgDescriptorPropKey.components, elements) + ) + } + + return createMessageDescriptorObjectExpression( + properties, + // preserve line numbers for extractor + oldLoc + ) +} + +function createIdProperty(message: string, context?: string) { + return createStringObjectProperty( + MsgDescriptorPropKey.id, + generateMessageId(message, context) + ) +} + +function createValuesProperty(key: string, values: Record) { + const valuesObject = Object.keys(values).map((key) => + types.objectProperty(types.identifier(key), values[key]) + ) + + if (!valuesObject.length) return + + return types.objectProperty( + types.identifier(key), + types.objectExpression(valuesObject) + ) +} + +export function createStringObjectProperty( + key: string, + value: string, + oldLoc?: SourceLocation +) { + const property = types.objectProperty( + types.identifier(key), + types.stringLiteral(value) + ) + if (oldLoc) { + property.loc = oldLoc + } + + return property +} + +function getTextFromExpression(exp: Expression): string { + if (types.isStringLiteral(exp)) { + return exp.value + } + + if (types.isTemplateLiteral(exp)) { + if (exp?.quasis.length === 1) { + return exp.quasis[0]?.value?.cooked + } + } +} + +function createMessageDescriptorObjectExpression( + properties: ObjectProperty[], + oldLoc?: SourceLocation +): ObjectExpression { + const newDescriptor = types.objectExpression(properties.filter(Boolean)) + types.addComment(newDescriptor, "leading", EXTRACT_MARK) + if (oldLoc) { + newDescriptor.loc = oldLoc + } + + return newDescriptor +} diff --git a/packages/macro/src/utils.ts b/packages/babel-plugin-lingui-macro/src/utils.ts similarity index 100% rename from packages/macro/src/utils.ts rename to packages/babel-plugin-lingui-macro/src/utils.ts diff --git a/packages/babel-plugin-lingui-macro/src/utils/cleanJSXElementLiteralChild.ts b/packages/babel-plugin-lingui-macro/src/utils/cleanJSXElementLiteralChild.ts new file mode 100644 index 000000000..4e44e6b37 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/src/utils/cleanJSXElementLiteralChild.ts @@ -0,0 +1,45 @@ +// taken from babel repo -> packages/babel-types/src/utils/react/cleanJSXElementLiteralChild.ts +export default function cleanJSXElementLiteralChild(value: string) { + const lines = value.split(/\r\n|\n|\r/) + + let lastNonEmptyLine = 0 + + for (let i = 0; i < lines.length; i++) { + if (lines[i].match(/[^ \t]/)) { + lastNonEmptyLine = i + } + } + + let str = "" + + for (let i = 0; i < lines.length; i++) { + const line = lines[i] + + const isFirstLine = i === 0 + const isLastLine = i === lines.length - 1 + const isLastNonEmptyLine = i === lastNonEmptyLine + + // replace rendered whitespace tabs with spaces + let trimmedLine = line.replace(/\t/g, " ") + + // trim whitespace touching a newline + if (!isFirstLine) { + trimmedLine = trimmedLine.replace(/^[ ]+/, "") + } + + // trim whitespace touching an endline + if (!isLastLine) { + trimmedLine = trimmedLine.replace(/[ ]+$/, "") + } + + if (trimmedLine) { + if (!isLastNonEmptyLine) { + trimmedLine += " " + } + + str += trimmedLine + } + } + + return str +} diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/js-defineMessage.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-defineMessage.test.ts.snap new file mode 100644 index 000000000..414de0c8c --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-defineMessage.test.ts.snap @@ -0,0 +1,203 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Production - only essential props are kept 1`] = ` +import { defineMessage } from "@lingui/core/macro"; +const msg = defineMessage({ + message: \`Hello \${name}\`, + id: "msgId", + comment: "description for translators", + context: "My Context", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const msg = + /*i18n*/ + { + id: "msgId", + values: { + name: name, + }, + }; + +`; + +exports[`Production - only essential props are kept, without id 1`] = ` +import { defineMessage } from "@lingui/core/macro"; +const msg = defineMessage({ + message: \`Hello \${name}\`, + comment: "description for translators", + context: "My Context", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const msg = + /*i18n*/ + { + id: "oT92lS", + values: { + name: name, + }, + }; + +`; + +exports[`defineMessage can be called by alias \`msg\` 1`] = ` +import { msg } from "@lingui/core/macro"; +const message1 = msg\`Message\`; +const message2 = msg({ message: "Message" }); + +↓ ↓ ↓ ↓ ↓ ↓ + +const message1 = + /*i18n*/ + { + id: "xDAtGP", + message: "Message", + }; +const message2 = + /*i18n*/ + { + id: "xDAtGP", + message: "Message", + }; + +`; + +exports[`defineMessage macro could be renamed 1`] = ` +import { + defineMessage as defineMessage2, + plural as plural2, +} from "@lingui/core/macro"; +const message = defineMessage2({ + comment: "Description", + message: plural2(value, { one: "book", other: "books" }), +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const message = + /*i18n*/ + { + id: "SlmyxX", + message: "{value, plural, one {book} other {books}}", + comment: "Description", + values: { + value: value, + }, + }; + +`; + +exports[`defineMessage should support template literal 1`] = ` +import { defineMessage } from "@lingui/core/macro"; +const message = defineMessage\`Message\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +const message = + /*i18n*/ + { + id: "xDAtGP", + message: "Message", + }; + +`; + +exports[`should expand macros in message property 1`] = ` +import { defineMessage, plural, arg } from "@lingui/core/macro"; +const message = defineMessage({ + comment: "Description", + message: plural(value, { one: "book", other: "books" }), +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const message = + /*i18n*/ + { + id: "SlmyxX", + message: "{value, plural, one {book} other {books}}", + comment: "Description", + values: { + value: value, + }, + }; + +`; + +exports[`should left string message intact 1`] = ` +import { defineMessage } from "@lingui/core/macro"; +const message = defineMessage({ + message: "Message", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const message = + /*i18n*/ + { + id: "xDAtGP", + message: "Message", + }; + +`; + +exports[`should preserve custom id 1`] = ` +import { defineMessage } from "@lingui/core/macro"; +const message = defineMessage({ + id: "msg.id", + message: "Message", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const message = + /*i18n*/ + { + id: "msg.id", + message: "Message", + }; + +`; + +exports[`should preserve values 1`] = ` +import { defineMessage, t } from "@lingui/core/macro"; +const message = defineMessage({ + message: t\`Hello \${name}\`, +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const message = + /*i18n*/ + { + id: "OVaF9k", + message: "Hello {name}", + values: { + name: name, + }, + }; + +`; + +exports[`should transform template literals 1`] = ` +import { defineMessage } from "@lingui/core/macro"; +const message = defineMessage({ + message: \`Message \${name}\`, +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +const message = + /*i18n*/ + { + id: "A2aVLF", + message: "Message {name}", + values: { + name: name, + }, + }; + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/js-plural.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-plural.test.ts.snap new file mode 100644 index 000000000..925fb504a --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-plural.test.ts.snap @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Macro is used in expression assignment 1`] = ` +import { plural } from "@lingui/core/macro"; +const a = plural(count, { + one: \`# book\`, + other: "# books", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const a = _i18n._( + /*i18n*/ + { + id: "esnaQO", + message: "{count, plural, one {# book} other {# books}}", + values: { + count: count, + }, + } +); + +`; + +exports[`Macro with expression only choice 1`] = ` +import { plural } from "@lingui/core/macro"; +plural(users.length, { + offset: 1, + 0: "No books", + 1: "1 book", + other: someOtherExp, +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "0mcXIe", + message: + "{0, plural, offset:1 =0 {No books} =1 {1 book} other {{someOtherExp}}}", + values: { + 0: users.length, + someOtherExp: someOtherExp, + }, + } +); + +`; + +exports[`Macro with offset and exact matches 1`] = ` +import { plural } from "@lingui/core/macro"; +plural(users.length, { + offset: 1, + 0: "No books", + 1: "1 book", + other: "# books", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "CF5t+7", + message: "{0, plural, offset:1 =0 {No books} =1 {1 book} other {# books}}", + values: { + 0: users.length, + }, + } +); + +`; + +exports[`plural macro could be renamed 1`] = ` +import { plural as plural2 } from "@lingui/core/macro"; +const a = plural2(count, { + one: \`# book\`, + other: "# books", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const a = _i18n._( + /*i18n*/ + { + id: "esnaQO", + message: "{count, plural, one {# book} other {# books}}", + values: { + count: count, + }, + } +); + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/js-select.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-select.test.ts.snap new file mode 100644 index 000000000..7130a5755 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-select.test.ts.snap @@ -0,0 +1,60 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Nested macros 1`] = ` +import { select, plural } from "@lingui/core/macro"; +select(gender, { + male: plural(numOfGuests, { + one: "He invites one guest", + other: "He invites # guests", + }), + female: \`She is \${gender}\`, + other: \`They is \${gender}\`, +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "G8xqGf", + message: + "{gender, select, male {{numOfGuests, plural, one {He invites one guest} other {He invites # guests}}} female {She is {gender}} other {They is {gender}}}", + values: { + gender: gender, + numOfGuests: numOfGuests, + }, + } +); + +`; + +exports[`Nested macros with pure expressions option 1`] = ` +import { select, plural } from "@lingui/core/macro"; +select(gender, { + male: plural(numOfGuests, { + one: "He invites one guest", + other: "He invites # guests", + }), + female: \`She is \${gender}\`, + other: someOtherExp, +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "j9PNNm", + message: + "{gender, select, male {{numOfGuests, plural, one {He invites one guest} other {He invites # guests}}} female {She is {gender}} other {{someOtherExp}}}", + values: { + gender: gender, + numOfGuests: numOfGuests, + someOtherExp: someOtherExp, + }, + } +); + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/js-selectOrdinal.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-selectOrdinal.test.ts.snap new file mode 100644 index 000000000..63ca7915d --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-selectOrdinal.test.ts.snap @@ -0,0 +1,26 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`#1 1`] = ` +import { t, selectOrdinal } from "@lingui/core/macro"; +t\`This is my \${selectOrdinal(count, { + one: "#st", + two: \`#nd\`, + other: "#rd", +})} cat\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "dJXd3T", + message: + "This is my {count, selectordinal, one {#st} two {#nd} other {#rd}} cat", + values: { + count: count, + }, + } +); + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/js-t.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-t.test.ts.snap new file mode 100644 index 000000000..fea76d46c --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-t.test.ts.snap @@ -0,0 +1,629 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Anything variables except simple identifiers are used as positional arguments 1`] = ` +import { t } from "@lingui/core/macro"; +t\` Property \${props.name}, function \${random()}, array \${ + array[index] +}, constant \${42}, object \${new Date()} anything \${props.messages[ + index +].value()}\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "vVZNZ5", + message: + " Property {0}, function {1}, array {2}, constant {3}, object {4} anything {5}", + values: { + 0: props.name, + 1: random(), + 2: array[index], + 3: 42, + 4: new Date(), + 5: props.messages[index].value(), + }, + } +); + +`; + +exports[`Context might be passed as template literal 1`] = ` +import { t } from "@lingui/core/macro"; +t({ message: "Hello", context: "my custom" }); +t({ message: "Hello", context: \`my custom\` }); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "BYqAaU", + message: "Hello", + context: "my custom", + } +); +_i18n._( + /*i18n*/ + { + id: "BYqAaU", + message: "Hello", + context: \`my custom\`, + } +); + +`; + +exports[`Macro is used in call expression 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = message.error(t({ message: "dasd" })); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = message.error( + _i18n._( + /*i18n*/ + { + id: "9ZMZjU", + message: "dasd", + } + ) +); + +`; + +exports[`Macro is used in expression assignment 1`] = ` +import { t } from "@lingui/core/macro"; +const a = t\`Expression assignment\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const a = _i18n._( + /*i18n*/ + { + id: "mjnlP0", + message: "Expression assignment", + } +); + +`; + +exports[`Macro is used in expression assignment, with custom lingui instance 1`] = ` +import { t } from "@lingui/core/macro"; +import { customI18n } from "./lingui"; +const a = t(customI18n)\`Expression assignment\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { customI18n } from "./lingui"; +const a = customI18n._( + /*i18n*/ + { + id: "mjnlP0", + message: "Expression assignment", + } +); + +`; + +exports[`Newlines are preserved 1`] = ` +import { t } from "@lingui/core/macro"; +t\`Multiline + string\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "+8iwDA", + message: "Multiline\\n string", + } +); + +`; + +exports[`Production - all props kept if extract: true 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t({ + message: \`Hello \${name}\`, + id: "msgId", + comment: "description for translators", + context: "My Context", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "msgId", + message: "Hello {name}", + comment: "description for translators", + context: "My Context", + values: { + name: name, + }, + } +); + +`; + +exports[`Production - message prop is kept if stripMessageField: false 1`] = ` +import { t } from "@lingui/macro"; +const msg = t({ + message: \`Hello \${name}\`, + id: "msgId", + comment: "description for translators", + context: "My Context", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "msgId", + message: "Hello {name}", + values: { + name: name, + }, + } +); + +`; + +exports[`Production - only essential props are kept 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t\`Message\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "xDAtGP", + } +); + +`; + +exports[`Production - only essential props are kept 2`] = ` +import { t } from "@lingui/core/macro"; +const msg = t({ + message: \`Hello \${name}\`, + id: "msgId", + comment: "description for translators", + context: "My Context", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "msgId", + values: { + name: name, + }, + } +); + +`; + +exports[`Production - only essential props are kept, with custom i18n instance 1`] = ` +import { t } from "@lingui/core/macro"; +import { i18n } from "./lingui"; +const msg = t(i18n)({ + message: \`Hello \${name}\`, + id: "msgId", + comment: "description for translators", + context: "My Context", +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n } from "./lingui"; +const msg = i18n._( + /*i18n*/ + { + id: "msgId", + values: { + name: name, + }, + } +); + +`; + +exports[`Production - only essential props are kept, with plural, with custom i18n instance 1`] = ` +import { t, plural } from "@lingui/core/macro"; +const msg = t({ + id: "msgId", + comment: "description for translators", + context: "some context", + message: plural(val, { one: "...", other: "..." }), +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "msgId", + values: { + val: val, + }, + } +); + +`; + +exports[`Should generate different id when context provided 1`] = ` +import { t } from "@lingui/core/macro"; +t({ message: "Hello" }); +t({ message: "Hello", context: "my custom" }); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "uzTaYi", + message: "Hello", + } +); +_i18n._( + /*i18n*/ + { + id: "BYqAaU", + message: "Hello", + context: "my custom", + } +); + +`; + +exports[`Should not crash when a variable passed 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t(msg); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._(msg); + +`; + +exports[`Support id and comment in t macro as callExpression 1`] = ` +import { t, plural } from "@lingui/core/macro"; +const msg = t({ + id: "msgId", + comment: "description for translators", + message: plural(val, { one: "...", other: "..." }), +}); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "msgId", + message: "{val, plural, one {...} other {...}}", + comment: "description for translators", + values: { + val: val, + }, + } +); + +`; + +exports[`Support id in template literal 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t({ id: \`msgId\` }); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: \`msgId\`, + } +); + +`; + +exports[`Support id with message interpolation 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t({ id: "msgId", message: \`Some \${value}\` }); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "msgId", + message: "Some {value}", + values: { + value: value, + }, + } +); + +`; + +exports[`Support t in t 1`] = ` +import { t } from "@lingui/core/macro"; +t\`Field \${t\`First Name\`} is required\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "O8dJMg", + message: "Field {0} is required", + values: { + 0: _i18n._( + /*i18n*/ + { + id: "kODvZJ", + message: "First Name", + } + ), + }, + } +); + +`; + +exports[`Support template strings in t macro message 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t({ message: \`Hello \${name}\` }); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "OVaF9k", + message: "Hello {name}", + values: { + name: name, + }, + } +); + +`; + +exports[`Support template strings in t macro message, with custom i18n instance 1`] = ` +import { t } from "@lingui/core/macro"; +import { i18n } from "./lingui"; +const msg = t(i18n)({ message: \`Hello \${name}\` }); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n } from "./lingui"; +const msg = i18n._( + /*i18n*/ + { + id: "OVaF9k", + message: "Hello {name}", + values: { + name: name, + }, + } +); + +`; + +exports[`Support template strings in t macro message, with custom i18n instance object property 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t(global.i18n)({ message: \`Hello \${name}\` }); + +↓ ↓ ↓ ↓ ↓ ↓ + +const msg = global.i18n._( + /*i18n*/ + { + id: "OVaF9k", + message: "Hello {name}", + values: { + name: name, + }, + } +); + +`; + +exports[`Variables are replaced with named arguments 1`] = ` +import { t } from "@lingui/core/macro"; +t\`Variable \${name}\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "xRRkAE", + message: "Variable {name}", + values: { + name: name, + }, + } +); + +`; + +exports[`Variables should be deduplicated 1`] = ` +import { t } from "@lingui/core/macro"; +t\`\${duplicate} variable \${duplicate}\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "+nhkwg", + message: "{duplicate} variable {duplicate}", + values: { + duplicate: duplicate, + }, + } +); + +`; + +exports[`Variables with escaped double quotes are correctly formatted 1`] = ` +import { t } from "@lingui/core/macro"; +t\`Variable "name"\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "CcPIZW", + message: 'Variable "name"', + } +); + +`; + +exports[`Variables with escaped template literals are correctly formatted 1`] = ` +import { t } from "@lingui/core/macro"; +t\`Variable \\\`\${name}\\\`\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "ICBco+", + message: "Variable \`{name}\`", + values: { + name: name, + }, + } +); + +`; + +exports[`should correctly process nested macro when referenced from different imports 1`] = ` +import { t } from "@lingui/core/macro"; +import { plural } from "@lingui/core/macro"; +t\`Ola! \${plural(count, { one: "1 user", many: "# users" })} is required\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "EUO+Gb", + message: "Ola! {count, plural, one {1 user} many {# users}} is required", + values: { + count: count, + }, + } +); + +`; + +exports[`should correctly process nested macro when referenced from different imports 2 1`] = ` +import { t as t1, plural as plural1 } from "@lingui/core/macro"; +import { plural as plural2, t as t2 } from "@lingui/core/macro"; +t1\`Ola! \${plural2(count, { one: "1 user", many: "# users" })} Ola!\`; +t2\`Ola! \${plural1(count, { one: "1 user", many: "# users" })} Ola!\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +_i18n._( + /*i18n*/ + { + id: "aui5Gr", + message: "Ola! {count, plural, one {1 user} many {# users}} Ola!", + values: { + count: count, + }, + } +); +_i18n._( + /*i18n*/ + { + id: "wJ7AD9", + message: "Ola! {count, plural, one {1 user} many {# users}} Ola!", + values: { + count: count, + }, + } +); + +`; + +exports[`should not crash when no params passed 1`] = ` +import { t } from "@lingui/core/macro"; +const msg = t(); + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._(); + +`; + +exports[`stripMessageField option - message prop is removed if stripMessageField: true 1`] = ` +import { t } from "@lingui/macro"; +const msg = t\`Message\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const msg = _i18n._( + /*i18n*/ + { + id: "xDAtGP", + } +); + +`; + +exports[`t\`\` macro could be renamed 1`] = ` +import { t as t2 } from "@lingui/core/macro"; +const a = t2\`Expression assignment\`; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +const a = _i18n._( + /*i18n*/ + { + id: "mjnlP0", + message: "Expression assignment", + } +); + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/js-useLingui.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-useLingui.test.ts.snap new file mode 100644 index 000000000..6fb9cb82c --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/js-useLingui.test.ts.snap @@ -0,0 +1,418 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`does not crash when no params 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = t(); +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t(); +} + +`; + +exports[`inserted statement should not clash with existing variables 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const _t = "i'm here"; + const { t: _ } = useLingui(); + const a = _\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const _t = "i'm here"; + const { _: _t2 } = _useLingui(); + const a = _t2( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; + +exports[`should not break on function currying 1`] = ` +import { useLingui } from "@lingui/core/macro"; +const result = curryingFoo()(); +console.log("curryingFoo", result); + +↓ ↓ ↓ ↓ ↓ ↓ + +const result = curryingFoo()(); +console.log("curryingFoo", result); + +`; + +exports[`should process macro with matching name in correct scopes 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = t\`Text\`; + + { + // here is child scope with own "t" binding, shouldn't be processed + const t = () => {}; + t\`Text\`; + } + { + // here is child scope which should be processed, since 't' relates to outer scope + t\`Text\`; + } +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); + { + // here is child scope with own "t" binding, shouldn't be processed + const t = () => {}; + t\`Text\`; + } + { + // here is child scope which should be processed, since 't' relates to outer scope + _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); + } +} + +`; + +exports[`support a variable 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = t(msg); +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t(msg); +} + +`; + +exports[`support configuring runtime module import using LinguiConfig.runtimeConfigModule 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = t\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { myUselingui as _useLingui } from "@my/lingui-react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; + +exports[`support i18n export 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { i18n } = useLingui(); + + console.log(i18n); +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { i18n } = _useLingui(); + console.log(i18n); +} + +`; + +exports[`support message descriptor 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = t({ message: "Hello", context: "my custom" }); +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "BYqAaU", + message: "Hello", + context: "my custom", + } + ); +} + +`; + +exports[`support nested macro 1`] = ` +import { useLingui } from "@lingui/react/macro"; +import { plural } from "@lingui/core/macro"; + +function MyComponent() { + const { t } = useLingui(); + const a = t\`Text \${plural(users.length, { + offset: 1, + 0: "No books", + 1: "1 book", + other: "# books", + })}\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "hJRCh6", + message: + "Text {0, plural, offset:1 =0 {No books} =1 {1 book} other {# books}}", + values: { + 0: users.length, + }, + } + ); +} + +`; + +exports[`support passing t variable as dependency 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = useMemo(() => t\`Text\`, [t]); +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = useMemo( + () => + _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ), + [_t] + ); +} + +`; + +exports[`support renamed destructuring 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t: _ } = useLingui(); + const a = _\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; + +exports[`tagged template literal style 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = t\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; + +exports[`transform to standard useLingui statement 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { i18n, t } = useLingui(); + + console.log(i18n); + const a = t\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { i18n, _: _t } = _useLingui(); + console.log(i18n); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; + +exports[`work with existing useLingui statement 1`] = ` +import { useLingui as useLinguiMacro } from "@lingui/react/macro"; +import { useLingui } from "@lingui/react"; + +function MyComponent() { + const { _ } = useLingui(); + + console.log(_); + const { t } = useLinguiMacro(); + const a = t\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +import { useLingui } from "@lingui/react"; +function MyComponent() { + const { _ } = useLingui(); + console.log(_); + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; + +exports[`work with multiple react components 1`] = ` +import { useLingui } from "@lingui/react/macro"; +function MyComponent() { + const { t } = useLingui(); + const a = t\`Text\`; +} + +function MyComponent2() { + const { t } = useLingui(); + const b = t\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} +function MyComponent2() { + const { _: _t2 } = _useLingui(); + const b = _t2( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; + +exports[`work with renamed existing useLingui statement 1`] = ` +import { useLingui as useLinguiRenamed } from "@lingui/react"; +import { useLingui as useLinguiMacro } from "@lingui/react/macro"; + +function MyComponent() { + const { _ } = useLinguiRenamed(); + + console.log(_); + const { t } = useLinguiMacro(); + const a = t\`Text\`; +} + +↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui as useLinguiRenamed } from "@lingui/react"; +import { useLingui as _useLingui } from "@lingui/react"; +function MyComponent() { + const { _ } = useLinguiRenamed(); + console.log(_); + const { _: _t } = _useLingui(); + const a = _t( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-plural.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-plural.test.ts.snap new file mode 100644 index 000000000..920ba58e5 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-plural.test.ts.snap @@ -0,0 +1,263 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`#1 1`] = ` +import { Plural } from "@lingui/react/macro"; +A lot of them} +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "tYX0sm", + message: + "{count, plural, offset:1 =0 {Zero items} few {{count} items} other {<0>A lot of them}}", + values: { + count: count, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`#4 1`] = ` +import { Trans, Plural } from "@lingui/react/macro"; + + # slot added + + } + other={ + + # slots added + + } +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "X8eyr1", + message: + "{count, plural, one {<0># slot added} other {<1># slots added}}", + values: { + count: count, + }, + components: { + 0: , + 1: , + }, + } + } +/>; + +`; + +exports[`#6 1`] = ` +import { Plural } from "@lingui/react/macro"; +A lot of them} +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + render="strong" + { + /*i18n*/ + ...{ + id: "msg.plural", + message: + "{count, plural, offset:1 =0 {Zero items} few {{count} items} other {<0>A lot of them}}", + values: { + count: count, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`#7 1`] = ` +import { Trans, Plural } from "@lingui/react/macro"; + + Looking for{" "} + a lot of them} + /> +
; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "inner-id-removed", + message: + "Looking for {0, plural, offset:1 =0 {zero items} few {{1} items {2}} other {<0>a lot of them}}", + values: { + 0: items.length, + 1: items.length, + 2: 42, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`#8 1`] = ` +import { Plural } from "@lingui/react/macro"; +A lot of them} +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "EQvNfC", + message: + "{count, plural, =0 {Zero items} one {{oneText}} other {<0>A lot of them}}", + values: { + count: count, + oneText: oneText, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`Plural macro could be renamed 1`] = ` +import { Plural as Plural2 } from "@lingui/react/macro"; +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "EMgKyP", + message: "{count, plural, one {...} other {...}}", + values: { + count: count, + }, + } + } +/>; + +`; + +exports[`Should preserve reserved props: \`comment\`, \`context\`, \`render\`, \`id\` 1`] = ` +import { Plural } from "@lingui/react/macro"; + {}} + value={count} + offset="1" + _0="Zero items" + few={\`\${count} items\`} + other={A lot of them} +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + render={() => {}} + { + /*i18n*/ + ...{ + id: "custom.id", + message: + "{count, plural, offset:1 =0 {Zero items} few {{count} items} other {<0>A lot of them}}", + comment: "Comment for translator", + context: "translation context", + values: { + count: count, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`Should return cases without leading or trailing spaces for nested Trans inside Plural 1`] = ` +import { Trans, Plural } from "@lingui/react/macro"; +One hello
} + other={Other hello} + value={count} +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "oukcm6", + message: "{count, plural, one {One hello} other {Other hello}}", + values: { + count: count, + }, + } + } +/>; + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-select.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-select.test.ts.snap new file mode 100644 index 000000000..de204cabc --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-select.test.ts.snap @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`#1 1`] = ` +import { Select } from "@lingui/react/macro"; +Other} +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + render="strong" + { + /*i18n*/ + ...{ + id: "msg.select", + message: "{0, select, male {He} female {She} other {<0>Other}}", + values: { + 0: user.gender, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`#4 1`] = ` +import { Select } from "@lingui/react/macro"; + + Hooray! +
+ } + _sad={ + + Oh no! + + } + other="Dunno" +/>; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "f1ZLwG", + message: + "{0, select, happy {Hooray! <0/>} sad {Oh no! <1/>} other {Dunno}}", + values: { + 0: "happy", + }, + components: { + 0: , + 1: , + }, + } + } +/>; + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-selectOrdinal.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-selectOrdinal.test.ts.snap new file mode 100644 index 000000000..9617b9c32 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-selectOrdinal.test.ts.snap @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`#1 1`] = ` +import { Trans, SelectOrdinal } from "@lingui/react/macro"; + + This is my{" "} + #rd} + />{" "} + cat. +
; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "3YEV8L", + message: + "This is my {count, selectordinal, one {#st} two {#nd} other {<0>#rd}} cat.", + values: { + count: count, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`#2 1`] = ` +import { Trans, SelectOrdinal } from "@lingui/react/macro"; + + This is my + #rd} + />{" "} + cat. +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "Dz3XK1", + message: + "This is my{count, selectordinal, one {#st} two {#nd} other {<0>#rd}} cat.", + values: { + count: count, + }, + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`#3 1`] = ` +import { Trans, SelectOrdinal } from "@lingui/react/macro"; + + This is my{" "} + #rd} + />{" "} + cat. +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "CDpzE+", + message: + "This is my {0, selectordinal, one {#st} two {#nd} other {<0>#rd}} cat.", + values: { + 0: user.numCats, + }, + components: { + 0: , + }, + } + } +/>; + +`; diff --git a/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-trans.test.ts.snap b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-trans.test.ts.snap new file mode 100644 index 000000000..87d5a5062 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-trans.test.ts.snap @@ -0,0 +1,832 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Elements are replaced with placeholders 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Hello World! +
+

+ My name is{" "} + + {" "} + {name} + +

+; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "k9gsHO", + message: "Hello <0>World!<1/><2>My name is <3> <4>{name}", + values: { + name: name, + }, + components: { + 0: , + 1:
, + 2:

, + 3: , + 4: , + }, + } + } +/>; + +`; + +exports[`Elements inside expression container 1`] = ` +import { Trans } from "@lingui/react/macro"; +{Component inside expression container}; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "1cZQQW", + message: "<0>Component inside expression container", + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`Elements without children 1`] = ` +import { Trans } from "@lingui/react/macro"; +{
}
; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "SCJtqt", + message: "<0/>", + components: { + 0:
, + }, + } + } +/>; + +`; + +exports[`Expressions are converted to positional arguments 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Property {props.name}, function {random()}, array {array[index]}, constant{" "} + {42}, object {new Date()}, everything {props.messages[index].value()} +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "HjKDmx", + message: + "Property {0}, function {1}, array {2}, constant {3}, object {4}, everything {5}", + values: { + 0: props.name, + 1: random(), + 2: array[index], + 3: 42, + 4: new Date(), + 5: props.messages[index].value(), + }, + } + } +/>; + +`; + +exports[`Generate ID from message 1`] = ` +import { Trans } from "@lingui/react/macro"; +Hello World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "mY42CM", + message: "Hello World", + } + } +/>; + +`; + +exports[`Generate different id when context provided 1`] = ` +import { Trans } from "@lingui/react/macro"; +Hello World; +Hello World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "mY42CM", + message: "Hello World", + } + } +/>; +<_Trans + { + /*i18n*/ + ...{ + id: "SO/WB8", + message: "Hello World", + context: "my context", + } + } +/>; + +`; + +exports[`HTML attributes are handled 1`] = ` +import { Trans } from "@lingui/react/macro"; + + This should work   +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "K/1Xpr", + message: "<0>This should work \\xA0", + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`Ignore JSXEmptyExpression 1`] = ` +import { Trans } from "@lingui/react/macro"; +Hello {/* and I cannot stress this enough */} World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "i0M2R8", + message: "Hello World", + } + } +/>; + +`; + +exports[`JSX Macro inside JSX conditional expressions 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Hello, {props.world ? world : guys} +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "UT5PlM", + message: "Hello, {0}", + values: { + 0: props.world ? ( + <_Trans + { + /*i18n*/ + ...{ + id: "ELi2P3", + message: "world", + } + } + /> + ) : ( + <_Trans + { + /*i18n*/ + ...{ + id: "39nd+2", + message: "guys", + } + } + /> + ), + }, + } + } +/>; + +`; + +exports[`JSX Macro inside JSX multiple nested conditional expressions 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Hello,{" "} + {props.world ? ( + world + ) : props.b ? ( + nested + ) : ( + guys + )} +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "UT5PlM", + message: "Hello, {0}", + values: { + 0: props.world ? ( + <_Trans + { + /*i18n*/ + ...{ + id: "ELi2P3", + message: "world", + } + } + /> + ) : props.b ? ( + <_Trans + { + /*i18n*/ + ...{ + id: "lV+268", + message: "nested", + } + } + /> + ) : ( + <_Trans + { + /*i18n*/ + ...{ + id: "39nd+2", + message: "guys", + } + } + /> + ), + }, + } + } +/>; + +`; + +exports[`Preserve custom ID (literal expression) 1`] = ` +import { Trans } from "@lingui/react/macro"; +Hello World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + message: "Hello World", + } + } +/>; + +`; + +exports[`Preserve custom ID (string literal) 1`] = ` +import { Trans } from "@lingui/react/macro"; +Hello World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + message: "Hello World", + } + } +/>; + +`; + +exports[`Preserve custom ID (template expression) 1`] = ` +import { Trans } from "@lingui/react/macro"; +Hello World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + message: "Hello World", + } + } +/>; + +`; + +exports[`Production - all props kept if extract: true 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Hello World +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + message: "Hello World", + comment: "Hello World", + } + } +/>; + +`; + +exports[`Production - import type doesn't interference on normal import 1`] = ` +import type { withI18nProps } from "@lingui/react"; +import { Trans } from "@lingui/react/macro"; + + Hello World +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + } + } +/>; + +`; + +exports[`Production - message prop is kept if stripMessageField: false 1`] = ` +import { Trans } from "@lingui/macro"; + + Hello World +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + message: "Hello World", + } + } +/>; + +`; + +exports[`Production - only essential props are kept 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Hello World +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + } + } +/>; + +`; + +exports[`Quoted JSX attributes are handled 1`] = ` +import { Trans } from "@lingui/react/macro"; +Speak "friend"!; +Speak "friend"!; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "NWmRwM", + message: 'Speak "friend"!', + } + } +/>; +<_Trans + { + /*i18n*/ + ...{ + id: "custom-id", + message: 'Speak "friend"!', + } + } +/>; + +`; + +exports[`Should not process non JSXElement nodes 1`] = ` +import { Trans } from "@lingui/react/macro"; +type X = typeof Trans; +const cmp = Hello; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +const cmp = ( + <_Trans + { + /*i18n*/ + ...{ + id: "uzTaYi", + message: "Hello", + } + } + /> +); + +`; + +exports[`Should preserve reserved props: \`comment\`, \`context\`, \`render\`, \`id\` 1`] = ` +import { Trans } from "@lingui/react/macro"; + {}} +> + Hello World +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + render={() => {}} + { + /*i18n*/ + ...{ + id: "custom.id", + message: "Hello World", + comment: "Comment for translator", + context: "translation context", + } + } +/>; + +`; + +exports[`Strings as children are preserved 1`] = ` +import { Trans } from "@lingui/react/macro"; +{"hello {count, plural, one {world} other {worlds}}"}; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "U8dd/d", + message: "hello {count, plural, one {world} other {worlds}}", + } + } +/>; + +`; + +exports[`Strip whitespace around arguments 1`] = ` +import { Trans } from "@lingui/react/macro"; +Strip whitespace around arguments: '{name}'; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "tRMgLt", + message: "Strip whitespace around arguments: '{name}'", + values: { + name: name, + }, + } + } +/>; + +`; + +exports[`Strip whitespace around tags but keep forced spaces 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Strip whitespace around tags, but keep forced spaces! +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "Ud4KOf", + message: "Strip whitespace around tags, but keep <0>forced spaces!", + components: { + 0: , + }, + } + } +/>; + +`; + +exports[`Strip whitespace around tags but keep whitespaces in JSX containers 1`] = ` +import { Trans } from "@lingui/react/macro"; + + {"Wonderful framework "} +
Next.js + {" say hi. And "} + Next.js + {" say hi."} +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "3YVd0H", + message: + "Wonderful framework <0>Next.js say hi. And <1>Next.js say hi.", + components: { + 0: , + 1: , + }, + } + } +/>; + +`; + +exports[`Template literals as children 1`] = ` +import { Trans } from "@lingui/react/macro"; +{\`How much is \${expression}? \${count}\`}; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "exe3kM", + message: "How much is {expression}? {count}", + values: { + expression: expression, + count: count, + }, + } + } +/>; + +`; + +exports[`Trans macro could be renamed 1`] = ` +import { Trans as Trans2 } from "@lingui/react/macro"; +Hello World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "mY42CM", + message: "Hello World", + } + } +/>; + +`; + +exports[`Use a js macro inside a JSX Attribute of a component handled by JSX macro 1`] = ` +import { Trans } from "@lingui/react/macro"; +import { t } from "@lingui/core/macro"; + + Read{" "} + + more + +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "QZyANg", + message: "Read <0>more", + components: { + 0: ( + + ), + }, + } + } +/>; + +`; + +exports[`Use a js macro inside a JSX Attribute of a non macro JSX component 1`] = ` +import { plural } from "@lingui/core/macro"; + + About +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { i18n as _i18n } from "@lingui/core"; + + About +; + +`; + +exports[`Use decoded html entities 1`] = ` +import { Trans } from "@lingui/react/macro"; +&; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "EwTON7", + message: "&", + } + } +/>; + +`; + +exports[`Variables are converted to named arguments 1`] = ` +import { Trans } from "@lingui/react/macro"; + + Hi {yourName}, my name is {myName} +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "y10VRI", + message: "Hi {yourName}, my name is {myName}", + values: { + yourName: yourName, + myName: myName, + }, + } + } +/>; + +`; + +exports[`Variables are deduplicated 1`] = ` +import { Trans } from "@lingui/react/macro"; + + {duplicate} variable {duplicate} +; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "+nhkwg", + message: "{duplicate} variable {duplicate}", + values: { + duplicate: duplicate, + }, + } + } +/>; + +`; + +exports[`stripMessageField option - message prop is removed if stripMessageField: true 1`] = ` +import { Trans } from "@lingui/macro"; +Hello World; + +↓ ↓ ↓ ↓ ↓ ↓ + +import { Trans as _Trans } from "@lingui/react"; +<_Trans + { + /*i18n*/ + ...{ + id: "msg.hello", + } + } +/>; + +`; diff --git a/packages/macro/test/fixtures/js-t-continuation-character.expected.js b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-continuation-character.expected.js similarity index 60% rename from packages/macro/test/fixtures/js-t-continuation-character.expected.js rename to packages/babel-plugin-lingui-macro/test/fixtures/js-t-continuation-character.expected.js index bb22822cd..5958cd9e9 100644 --- a/packages/macro/test/fixtures/js-t-continuation-character.expected.js +++ b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-continuation-character.expected.js @@ -1,5 +1,5 @@ -import { i18n } from "@lingui/core" -i18n._( +import { i18n as _i18n } from "@lingui/core" +_i18n._( /*i18n*/ { id: "LBYoFK", diff --git a/packages/babel-plugin-lingui-macro/test/fixtures/js-t-continuation-character.js b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-continuation-character.js new file mode 100644 index 000000000..ac0aa6a16 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-continuation-character.js @@ -0,0 +1,4 @@ +import { t } from "@lingui/core/macro" + +t`Multiline\ + with continuation` diff --git a/packages/macro/test/fixtures/js-t-var/js-t-var.expected.js b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-var/js-t-var.expected.js similarity index 70% rename from packages/macro/test/fixtures/js-t-var/js-t-var.expected.js rename to packages/babel-plugin-lingui-macro/test/fixtures/js-t-var/js-t-var.expected.js index 17a544413..abe4115a0 100644 --- a/packages/macro/test/fixtures/js-t-var/js-t-var.expected.js +++ b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-var/js-t-var.expected.js @@ -1,10 +1,8 @@ -"use strict" - -var _core = require("@lingui/core") +import { i18n as _i18n } from "@lingui/core" function scoped(foo) { if (foo) { - var bar = 50 - _core.i18n._( + const bar = 50 + _i18n._( /*i18n*/ { id: "EvVtyn", @@ -15,14 +13,14 @@ function scoped(foo) { } ) } else { - var _bar = 10 - _core.i18n._( + const bar = 10 + _i18n._( /*i18n*/ { id: "e6QGtZ", message: "This is a different bar {bar}", values: { - bar: _bar, + bar: bar, }, } ) diff --git a/packages/macro/test/fixtures/js-t-var/js-t-var.js b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-var/js-t-var.js similarity index 68% rename from packages/macro/test/fixtures/js-t-var/js-t-var.js rename to packages/babel-plugin-lingui-macro/test/fixtures/js-t-var/js-t-var.js index 0cb13358a..c0156daf3 100644 --- a/packages/macro/test/fixtures/js-t-var/js-t-var.js +++ b/packages/babel-plugin-lingui-macro/test/fixtures/js-t-var/js-t-var.js @@ -1,6 +1,6 @@ -import { t } from '@lingui/macro' +import { t } from "@lingui/core/macro" -function scoped (foo) { +function scoped(foo) { if (foo) { const bar = 50 t`This is bar ${bar}` diff --git a/packages/babel-plugin-lingui-macro/test/fixtures/jsx-keep-forced-newlines.expected.js b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-keep-forced-newlines.expected.js new file mode 100644 index 000000000..b6df26f95 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-keep-forced-newlines.expected.js @@ -0,0 +1,10 @@ +import { Trans as _Trans } from "@lingui/react" +;<_Trans + { + /*i18n*/ + ...{ + id: "9xE5pD", + message: "Keep multiple\nforced\nnewlines!", + } + } +/> diff --git a/packages/babel-plugin-lingui-macro/test/fixtures/jsx-keep-forced-newlines.js b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-keep-forced-newlines.js new file mode 100644 index 000000000..3727d9a4d --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-keep-forced-newlines.js @@ -0,0 +1,6 @@ +import { Trans } from "@lingui/react/macro" +; + Keep multiple{"\n"} + forced{"\n"} + newlines! + diff --git a/packages/babel-plugin-lingui-macro/test/fixtures/jsx-plural-select-nested.expected.js b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-plural-select-nested.expected.js new file mode 100644 index 000000000..0de8a73f1 --- /dev/null +++ b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-plural-select-nested.expected.js @@ -0,0 +1,17 @@ +import { Trans as _Trans } from "@lingui/react" +;<_Trans + { + /*i18n*/ + ...{ + id: "n0a/bN", + message: + "{genderOfHost, select, female {{numGuests, plural, offset:1 =0 {{host} does not give a party.} =1 {{host} invites {guest} to her party.} =2 {{host} invites {guest} and one other person to her party.} other {{host} invites {guest} and # other people to her party.}}} male {{numGuests, plural, offset:1 =0 {{host} does not give a party.} =1 {{host} invites {guest} to his party.} =2 {{host} invites {guest} and one other person to his party.} other {{host} invites {guest} and # other people to his party.}}} other {{numGuests, plural, offset:1 =0 {{host} does not give a party.} =1 {{host} invites {guest} to their party.} =2 {{host} invites {guest} and one other person to their party.} other {{host} invites {guest} and # other people to their party.}}}}", + values: { + genderOfHost: genderOfHost, + numGuests: numGuests, + host: host, + guest: guest, + }, + } + } +/> diff --git a/packages/macro/test/fixtures/jsx-plural-select-nested.js b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-plural-select-nested.js similarity index 94% rename from packages/macro/test/fixtures/jsx-plural-select-nested.js rename to packages/babel-plugin-lingui-macro/test/fixtures/jsx-plural-select-nested.js index a97a44685..07d3ac8f8 100644 --- a/packages/macro/test/fixtures/jsx-plural-select-nested.js +++ b/packages/babel-plugin-lingui-macro/test/fixtures/jsx-plural-select-nested.js @@ -1,6 +1,5 @@ -import { Select, Plural } from '@lingui/macro'; - -Not allowed") + ).toThrowErrorMatchingSnapshot() + expect( + transformCode("Not allowed") + ).toThrowErrorMatchingSnapshot() + }) + + it("value is missing", function () { + const code = `` + expect(transformCode(code)).toThrowErrorMatchingSnapshot() + }) + + it("offset must be number or string, not variable", function () { + const variable = `` + expect(transformCode(variable)).toThrowErrorMatchingSnapshot() + }) + + it("plural forms are missing", function () { + const plural = `` + expect(transformCode(plural)).toThrowErrorMatchingSnapshot() + + const select = `Other} + />; + `, + }, + { + code: ` + import { Select } from '@lingui/react/macro'; + Hooray! + } + _sad={ + Oh no! + } + other="Dunno" + /> + `, + }, + { + code: ` + import { Select } from '@lingui/react/macro'; + - Message - -) - -// @ts-expect-error: `value` could be string only -m = - -// @ts-expect-error: `value` required -m = - -// @ts-expect-error: exact cases should be prefixed with underscore -m = ...} - other={...} - /> -) diff --git a/packages/core/macro/__typetests__/tsconfig.json b/packages/core/macro/__typetests__/tsconfig.json new file mode 100644 index 000000000..d6980fa22 --- /dev/null +++ b/packages/core/macro/__typetests__/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "skipLibCheck": true + }, + "paths": {} +} diff --git a/packages/core/macro/index.d.ts b/packages/core/macro/index.d.ts new file mode 100644 index 000000000..72e590f4c --- /dev/null +++ b/packages/core/macro/index.d.ts @@ -0,0 +1,218 @@ +import type { I18n, MessageDescriptor } from "@lingui/core" + +export type ChoiceOptions = { + /** Offset of value when calculating plural forms */ + offset?: number + zero?: string + one?: string + two?: string + few?: string + many?: string + + /** Catch-all option */ + other: string + /** Exact match form, corresponds to =N rule */ + [digit: `${number}`]: string +} + +type MacroMessageDescriptor = ( + | { + id: string + message?: string + } + | { + id?: string + message: string + } +) & { + comment?: string + context?: string +} + +/** + * Translates a message descriptor + * + * @example + * ``` + * import { t } from "@lingui/core/macro"; + * const message = t({ + * id: "msg.hello", + * comment: "Greetings at the homepage", + * message: `Hello ${name}`, + * }); + * ``` + * + * @example + * ``` + * import { t } from "@lingui/core/macro"; + * const message = t({ + * id: "msg.plural", + * message: plural(value, { one: "...", other: "..." }), + * }); + * ``` + * + * @param descriptor The message descriptor to translate + */ +export function t(descriptor: MacroMessageDescriptor): string + +/** + * Translates a template string using the global I18n instance + * + * @example + * ``` + * import { t } from "@lingui/core/macro"; + * const message = t`Hello ${name}`; + * ``` + */ +export function t( + literals: TemplateStringsArray, + ...placeholders: any[] +): string + +/** + * Translates a template string or message descriptor using a given I18n instance + * + * @example + * ``` + * import { t } from "@lingui/core/macro"; + * import { I18n } from "@lingui/core"; + * const i18n = new I18n({ + * locale: "nl", + * messages: { "Hello {name}": "Hallo {name}" }, + * }); + * const message = t(i18n)`Hello ${name}`; + * ``` + * + * @example + * ``` + * import { t } from "@lingui/core/macro"; + * import { I18n } from "@lingui/core"; + * const i18n = new I18n({ + * locale: "nl", + * messages: { "Hello {name}": "Hallo {name}" }, + * }); + * const message = t(i18n)({ message: `Hello ${name}` }); + * ``` + * + * @deprecated in v5, would be removed in v6. + * Please use `` i18n._(msg`Hello ${name}`) `` instead + * + */ +export function t(i18n: I18n): { + (literals: TemplateStringsArray, ...placeholders: any[]): string + (descriptor: MacroMessageDescriptor): string +} + +/** + * Pluralize a message + * + * @example + * ``` + * import { plural } from "@lingui/core/macro"; + * const message = plural(count, { + * one: "# Book", + * other: "# Books", + * }); + * ``` + * + * @param value Determines the plural form + * @param options Object with available plural forms + */ +export function plural(value: number | string, options: ChoiceOptions): string + +/** + * Pluralize a message using ordinal forms + * + * Similar to `plural` but instead of using cardinal plural forms, + * it uses ordinal forms. + * + * @example + * ``` + * import { selectOrdinal } from "@lingui/core/macro"; + * const message = selectOrdinal(count, { + * one: "#st", + * two: "#nd", + * few: "#rd", + * other: "#th", + * }); + * ``` + * + * @param value Determines the plural form + * @param options Object with available plural forms + */ +export function selectOrdinal( + value: number | string, + options: ChoiceOptions +): string + +type SelectOptions = { + /** Catch-all option */ + other: string + [matches: string]: string +} + +/** + * Selects a translation based on a value + * + * Select works like a switch statement. It will + * select one of the forms in `options` object which + * key matches exactly `value`. + * + * @example + * ``` + * import { select } from "@lingui/core/macro"; + * const message = select(gender, { + * male: "he", + * female: "she", + * other: "they", + * }); + * ``` + * + * @param value The key of choices to use + * @param choices + */ +export function select(value: string, choices: SelectOptions): string + +/** + * Define a message for later use + * + * `defineMessage` can be used to add comments for translators, + * or to override the message ID. + * + * @example + * ``` + * import { defineMessage } from "@lingui/core/macro"; + * const message = defineMessage({ + * comment: "Greetings on the welcome page", + * message: `Welcome, ${name}!`, + * }); + * ``` + * + * @param descriptor The message descriptor + */ +export function defineMessage( + descriptor: MacroMessageDescriptor +): MessageDescriptor + +/** + * Define a message for later use + * + * @example + * ``` + * import { defineMessage, msg } from "@lingui/core/macro"; + * const message = defineMessage`Hello ${name}`; + * + * // or using shorter version + * const message = msg`Hello ${name}`; + * ``` + */ +export function defineMessage( + literals: TemplateStringsArray, + ...placeholders: any[] +): MessageDescriptor + +/** + * Define a message for later use + * Alias for {@link defineMessage} + */ +export const msg: typeof defineMessage diff --git a/packages/core/macro/index.js b/packages/core/macro/index.js new file mode 100644 index 000000000..fad7573b3 --- /dev/null +++ b/packages/core/macro/index.js @@ -0,0 +1 @@ +module.exports = require("@lingui/babel-plugin-lingui-macro/macro") diff --git a/packages/core/macro/index.test.ts b/packages/core/macro/index.test.ts new file mode 100644 index 000000000..d0f728d4f --- /dev/null +++ b/packages/core/macro/index.test.ts @@ -0,0 +1,7 @@ +import macro from "@lingui/core/macro" + +describe("react-macro", () => { + it("Should re-export Macro", () => { + expect((macro as any).isBabelMacro).toBeTruthy() + }) +}) diff --git a/packages/core/package.json b/packages/core/package.json index 07d7b464d..9567ab408 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/core", - "version": "4.14.1", + "version": "5.0.0", "sideEffects": false, "description": "I18n tools for javascript", "main": "./dist/index.cjs", @@ -32,7 +32,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "exports": { ".": { @@ -45,20 +45,39 @@ "default": "./dist/index.mjs" } }, + "./macro": { + "types": "./macro/index.d.ts", + "default": "./macro/index.js" + }, "./package.json": "./package.json" }, "files": [ "LICENSE", "README.md", - "dist/" + "dist/", + "macro/index.d.ts", + "macro/index.js" ], "dependencies": { "@babel/runtime": "^7.20.13", - "@lingui/message-utils": "4.14.1", + "@lingui/message-utils": "5.0.0", "unraw": "^3.0.0" }, "devDependencies": { "@lingui/jest-mocks": "*", + "tsd": "^0.26.1", "unbuild": "2.0.0" + }, + "peerDependencies": { + "@lingui/babel-plugin-lingui-macro": "5.0.0", + "babel-plugin-macros": "2 || 3" + }, + "peerDependenciesMeta": { + "@lingui/babel-plugin-lingui-macro": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } } } diff --git a/packages/core/src/i18n.test.ts b/packages/core/src/i18n.test.ts index 23964030a..4e64511e4 100644 --- a/packages/core/src/i18n.test.ts +++ b/packages/core/src/i18n.test.ts @@ -1,5 +1,6 @@ import { setupI18n } from "./i18n" import { mockConsole, mockEnv } from "@lingui/jest-mocks" +import { compileMessage } from "@lingui/message-utils/compileMessage" describe("I18n", () => { describe("I18n.load", () => { @@ -189,7 +190,6 @@ describe("I18n", () => { it("._ should format message from catalog", () => { const messages = { Hello: "Salut", - "My name is {name}": "Je m'appelle {name}", } const i18n = setupI18n({ @@ -198,15 +198,24 @@ describe("I18n", () => { }) expect(i18n._("Hello")).toEqual("Salut") - expect(i18n._("My name is {name}", { name: "Fred" })).toEqual( - "Je m'appelle Fred" - ) + expect( + i18n._({ + id: "My name is {name}", + message: "Je m'appelle {name}", + values: { name: "Fred" }, + }) + ).toEqual("Je m'appelle Fred") // alias expect(i18n.t("Hello")).toEqual("Salut") // missing { name } - expect(i18n._("My name is {name}")).toEqual("Je m'appelle") + expect( + i18n._({ + id: "My name is {name}", + message: "Je m'appelle {name}", + }) + ).toEqual("Je m'appelle") // Untranslated message expect(i18n._("Missing message")).toEqual("Missing message") @@ -239,19 +248,22 @@ describe("I18n", () => { }) it("._ allow escaping syntax characters", () => { - const messages = { - "My ''name'' is '{name}'": "Mi ''nombre'' es '{name}'", - } + const messages = {} const i18n = setupI18n({ locale: "es", messages: { es: messages }, }) - expect(i18n._("My ''name'' is '{name}'")).toEqual("Mi 'nombre' es {name}") + expect( + i18n._({ + id: "My ''name'' is '{name}'", + message: "Mi ''nombre'' es '{name}'", + }) + ).toEqual("Mi 'nombre' es {name}") }) - it("._ shouldn't compile messages in production", () => { + it("._ shouldn't compile uncompiled messages in production", () => { const messages = { Hello: "Salut", "My name is {name}": "Je m'appelle {name}", @@ -270,6 +282,82 @@ describe("I18n", () => { }) }) + it("._ should use compiled message in production", () => { + const messages = { + Hello: "Salut", + "My name is {name}": compileMessage("Je m'appelle {name}"), + } + + mockEnv("production", () => { + const { setupI18n } = require("@lingui/core") + const i18n = setupI18n({ + locale: "fr", + messages: { fr: messages }, + }) + + expect(i18n._("My name is {name}", { name: "Fred" })).toEqual( + "Je m'appelle Fred" + ) + }) + }) + + it("._ shouldn't double compile message in development", () => { + const messages = { + Hello: "Salut", + "My name is {name}": compileMessage("Je m'appelle '{name}'"), + } + + const { setupI18n } = require("@lingui/core") + const i18n = setupI18n({ + locale: "fr", + messages: { fr: messages }, + }) + + expect(i18n._("My name is {name}", { name: "Fred" })).toEqual( + "Je m'appelle {name}" + ) + }) + + it("setMessagesCompiler should register a message compiler for production", () => { + const messages = { + Hello: "Salut", + "My name is {name}": "Je m'appelle {name}", + } + + mockEnv("production", () => { + const { setupI18n } = require("@lingui/core") + const i18n = setupI18n({ + locale: "fr", + messages: { fr: messages }, + }) + + i18n.setMessagesCompiler(compileMessage) + expect(i18n._("My name is {name}", { name: "Fred" })).toEqual( + "Je m'appelle Fred" + ) + }) + }) + + it("should print warning if uncompiled message is used", () => { + expect.assertions(1) + + const messages = { + Hello: "Salut", + } + + mockEnv("production", () => { + mockConsole((console) => { + const { setupI18n } = require("@lingui/core") + const i18n = setupI18n({ + locale: "fr", + messages: { fr: messages }, + }) + + i18n._("Hello") + expect(console.warn).toBeCalled() + }) + }) + }) it("._ should emit missing event for missing translation", () => { const i18n = setupI18n({ locale: "en", diff --git a/packages/core/src/i18n.ts b/packages/core/src/i18n.ts index ed04e9368..afcb7b640 100644 --- a/packages/core/src/i18n.ts +++ b/packages/core/src/i18n.ts @@ -36,7 +36,8 @@ export type LocaleData = { */ export type AllLocaleData = Record -export type Messages = Record +export type UncompiledMessage = string +export type Messages = Record export type AllMessages = Record @@ -79,16 +80,23 @@ type LoadAndActivateOptions = { messages: Messages } +export type MessageCompiler = (message: string) => CompiledMessage + export class I18n extends EventEmitter { private _locale: Locale = "" private _locales?: Locales private _localeData: AllLocaleData = {} private _messages: AllMessages = {} private _missing?: MissingHandler + private _messageCompiler?: MessageCompiler constructor(params: I18nProps) { super() + if (process.env.NODE_ENV !== "production") { + this.setMessagesCompiler(compileMessage) + } + if (params.missing != null) this._missing = params.missing if (params.messages != null) this.load(params.messages) if (params.localeData != null) this.loadLocaleData(params.localeData) @@ -125,6 +133,26 @@ export class I18n extends EventEmitter { } } + /** + * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime. + * + * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size. + * By default, message catalogs should be precompiled during the build process. However, + * if you need to compile catalogs at runtime, you can use this method to set a message compiler. + * + * Example usage: + * + * ```ts + * import { compileMessage } from "@lingui/message-utils/compileMessage"; + * + * i18n.setMessagesCompiler(compileMessage); + * ``` + */ + setMessagesCompiler(compiler: MessageCompiler) { + this._messageCompiler = compiler + return this + } + /** * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4 */ @@ -239,10 +267,22 @@ export class I18n extends EventEmitter { let translation = messageForId || message || id - if (process.env.NODE_ENV !== "production") { - translation = isString(translation) - ? compileMessage(translation) - : translation + // Compiled message is always an array (`["Ola!"]`). + // If a message comes as string - it's not compiled, and we need to compile it beforehand. + if (isString(translation)) { + if (this._messageCompiler) { + translation = this._messageCompiler(translation) + } else { + console.warn(`Uncompiled message detected! Message: + +> ${translation} + +That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used. +ICU features such as interpolation and plurals will not work properly for that message. + +Please compile your catalog first. +`) + } } // hack for parsing unicode values inside a string to get parsed in react native environments diff --git a/packages/detect-locale/README.md b/packages/detect-locale/README.md new file mode 100644 index 000000000..269729900 --- /dev/null +++ b/packages/detect-locale/README.md @@ -0,0 +1,26 @@ +[![License][badge-license]][license] +[![Version][badge-version]][package] +[![Downloads][badge-downloads]][package] + +# @lingui/detect-locale + +> Detect the user's locale based on different strategies + +`@lingui/detect-locale` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. + +## Installation & Usage + +See the [reference][reference] documentation. + +## License + +This package is licensed under [MIT][license] license. + +[license]: https://github.com/lingui/js-lingui/blob/main/LICENSE +[linguijs]: https://github.com/lingui/js-lingui +[documentation]: https://lingui.dev +[reference]: https://lingui.dev/ref/locale-detector +[package]: https://www.npmjs.com/package/@lingui/detect-locale +[badge-downloads]: https://img.shields.io/npm/dw/@lingui/detect-locale.svg +[badge-version]: https://img.shields.io/npm/v/@lingui/detect-locale.svg +[badge-license]: https://img.shields.io/npm/l/@lingui/detect-locale.svg diff --git a/packages/detect-locale/package.json b/packages/detect-locale/package.json index d749cde8b..c4bed6e52 100644 --- a/packages/detect-locale/package.json +++ b/packages/detect-locale/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/detect-locale", - "version": "4.14.1", + "version": "5.0.0", "sideEffects": false, "description": "@Lingui package to help you find the correct browser/server locale", "main": "./dist/index.cjs", @@ -32,7 +32,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "exports": { ".": { diff --git a/packages/extractor-vue/README.md b/packages/extractor-vue/README.md index 617767569..61475cc50 100644 --- a/packages/extractor-vue/README.md +++ b/packages/extractor-vue/README.md @@ -2,41 +2,15 @@ [![Version][badge-version]][package] [![Downloads][badge-downloads]][package] -# @lingui/vue-extractor +# @lingui/extractor-vue -This package contains a custom extractor that handles Vue.js files. It supports extracting messages from script and setup scripts as well as Vue templates. +> This package contains a custom extractor that handles Vue.js files. It supports extracting messages from script and setup scripts as well as Vue templates. -`@lingui/vue-extractor` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. +`@lingui/extractor-vue` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. -## Installation +## Installation & Usage -```sh -npm install --save-dev @lingui/extractor-vue -``` - -## Usage - -This custom extractor requires that you use JavaScript or TypeScript for your Lingui configuration. - -```js -import { vueExtractor } from "@lingui/extractor-vue" -import { extractor as defaultExtractor } from "@lingui/cli/api" - -/** @type {import('@lingui/conf').LinguiConfig} */ -const linguiConfig = { - locales: ["en", "nb"], - sourceLocale: "en", - catalogs: [ - { - path: "/src/{locale}", - include: ["/src"], - }, - ], - extractors: [defaultExtractor, vueExtractor], -} - -export default linguiConfig -``` +See the [reference][reference] documentation. ## License @@ -45,6 +19,7 @@ This package is licensed under [MIT][license] license. [license]: https://github.com/lingui/js-lingui/blob/main/LICENSE [linguijs]: https://github.com/lingui/js-lingui [documentation]: https://lingui.dev/ref/extractor-vue +[reference]: https://lingui.dev/ref/extractor-vue [package]: https://www.npmjs.com/package/@lingui/extractor-vue [badge-downloads]: https://img.shields.io/npm/dw/@lingui/extractor-vue.svg [badge-version]: https://img.shields.io/npm/v/@lingui/extractor-vue.svg diff --git a/packages/extractor-vue/package.json b/packages/extractor-vue/package.json index b27272fdf..c1dfc28ea 100644 --- a/packages/extractor-vue/package.json +++ b/packages/extractor-vue/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/extractor-vue", - "version": "4.14.1", + "version": "5.0.0", "description": "Custom Vue.js extractor to be used with the CLI tool", "main": "./dist/index.cjs", "module": "./dist/index.mjs", @@ -30,7 +30,7 @@ "stub": "unbuild --stub" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "files": [ "LICENSE", @@ -38,12 +38,12 @@ "/dist" ], "dependencies": { - "@lingui/cli": "4.14.1", - "@lingui/conf": "4.14.1", + "@lingui/cli": "5.0.0", + "@lingui/conf": "5.0.0", "@vue/compiler-sfc": "^3.2.47" }, "devDependencies": { - "@lingui/babel-plugin-extract-messages": "4.14.1", + "@lingui/babel-plugin-extract-messages": "5.0.0", "unbuild": "2.0.0" } } diff --git a/packages/extractor-vue/src/__snapshots__/extractor.test.ts.snap b/packages/extractor-vue/src/__snapshots__/extractor.test.ts.snap index 646453824..04603b0c3 100644 --- a/packages/extractor-vue/src/__snapshots__/extractor.test.ts.snap +++ b/packages/extractor-vue/src/__snapshots__/extractor.test.ts.snap @@ -12,6 +12,7 @@ exports[`vue extractor should extract message from functional component 1`] = ` 10, 33, ], + placeholders: {}, }, ] `; @@ -28,6 +29,7 @@ exports[`vue extractor should extract message from vue file 1`] = ` 4, 0, ], + placeholders: {}, }, { comment: undefined, @@ -39,6 +41,7 @@ exports[`vue extractor should extract message from vue file 1`] = ` 19, 20, ], + placeholders: {}, }, { comment: undefined, @@ -50,6 +53,7 @@ exports[`vue extractor should extract message from vue file 1`] = ` 27, 11, ], + placeholders: {}, }, { comment: Message comment, @@ -61,6 +65,7 @@ exports[`vue extractor should extract message from vue file 1`] = ` 29, 10, ], + placeholders: {}, }, { comment: undefined, @@ -72,6 +77,7 @@ exports[`vue extractor should extract message from vue file 1`] = ` 35, 5, ], + placeholders: {}, }, { comment: undefined, @@ -83,6 +89,7 @@ exports[`vue extractor should extract message from vue file 1`] = ` 36, 11, ], + placeholders: {}, }, ] `; diff --git a/packages/format-csv/README.md b/packages/format-csv/README.md index d12b238d1..36a21adcd 100644 --- a/packages/format-csv/README.md +++ b/packages/format-csv/README.md @@ -6,29 +6,11 @@ > Read and write message catalogs in CSV -`@lingui/format-csv` is part of [LinguiJS][linguijs]. See the -[documentation][documentation] for all information, tutorials and examples. +`@lingui/format-csv` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. -## Installation +## Installation & Usage -```sh -npm install --save-dev @lingui/format-csv -# yarn add --dev @lingui/format-csv -``` - -## Usage - -```js -// lingui.config.{js,ts} -import {formatter} from "@lingui/format-csv" - -export default { - [...] - format: formatter(), -} -``` - -This formatter has no options. +See the [reference][reference] documentation. ## License @@ -37,6 +19,7 @@ This package is licensed under [MIT][license] license. [license]: https://github.com/lingui/js-lingui/blob/main/LICENSE [linguijs]: https://github.com/lingui/js-lingui [documentation]: https://lingui.dev +[reference]: https://lingui.dev/ref/catalog-formats#csv [package]: https://www.npmjs.com/package/@lingui/format-csv [badge-downloads]: https://img.shields.io/npm/dw/@lingui/format-csv.svg [badge-version]: https://img.shields.io/npm/v/@lingui/format-csv.svg diff --git a/packages/format-csv/package.json b/packages/format-csv/package.json index c96cd7967..ae61feace 100644 --- a/packages/format-csv/package.json +++ b/packages/format-csv/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/format-csv", - "version": "4.14.1", + "version": "5.0.0", "description": "CSV format for Lingui Catalogs", "main": "./dist/csv.cjs", "module": "./dist/csv.mjs", @@ -31,7 +31,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "files": [ "LICENSE", @@ -39,7 +39,7 @@ "dist/" ], "dependencies": { - "@lingui/conf": "4.14.1", + "@lingui/conf": "5.0.0", "papaparse": "^5.4.0" }, "devDependencies": { diff --git a/packages/format-json/README.md b/packages/format-json/README.md index a32c2aabd..922cf5228 100644 --- a/packages/format-json/README.md +++ b/packages/format-json/README.md @@ -6,88 +6,11 @@ > Read and write message catalogs in JSON -`@lingui/format-json` is part of [LinguiJS][linguijs]. See the -[documentation][documentation] for all information, tutorials and examples. +`@lingui/format-json` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. -## Installation +## Installation & Usage -```sh -npm install --save-dev @lingui/format-json -# yarn add --dev @lingui/format-json -``` - -## Usage - -```js -// lingui.config.{js,ts} -import {formatter} from "@lingui/format-json" - -export default { - [...] - format: formatter({style: "lingui"}), -} -``` - -Possible options: - -```ts -export type JsonFormatterOptions = { - /** - * Print places where message is used - * - * @default true - */ - origins?: boolean - - /** - * Print line numbers in origins - * - * @default true - */ - lineNumbers?: boolean - - /** - * Different styles of how information could be printed - * - * @default "lingui" - */ - style?: "lingui" | "minimal" - - /** - * Indentation of output JSON - * - * @default 2 - */ - indentation?: number -} -``` - - -### Style: minimal - -Simple JSON with message ID -> translation mapping. All metadata (default message, comments for translators, message origin, etc) are stripped: - -```json -{ -"MessageID": "Translated Message" -} -``` - -### Style: lingui - -Raw catalog data serialized to JSON: - -```json -{ -"MessageID": { - "translation": "Translated Message", - "message": "Default string (from source code)", - "origin": [ - ["path/to/src.js", 42] - ] -} -} -``` +See the [reference][reference] documentation. ## License @@ -96,6 +19,7 @@ This package is licensed under [MIT][license] license. [license]: https://github.com/lingui/js-lingui/blob/main/LICENSE [linguijs]: https://github.com/lingui/js-lingui [documentation]: https://lingui.dev +[reference]: https://lingui.dev/ref/catalog-formats#json [package]: https://www.npmjs.com/package/@lingui/format-json [badge-downloads]: https://img.shields.io/npm/dw/@lingui/format-json.svg [badge-version]: https://img.shields.io/npm/v/@lingui/format-json.svg diff --git a/packages/format-json/package.json b/packages/format-json/package.json index af57a64fd..1b1f0fdce 100644 --- a/packages/format-json/package.json +++ b/packages/format-json/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/format-json", - "version": "4.14.1", + "version": "5.0.0", "description": "JSON format for Lingui Catalogs", "main": "./dist/json.cjs", "module": "./dist/json.mjs", @@ -31,7 +31,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "files": [ "LICENSE", @@ -39,7 +39,7 @@ "dist/" ], "dependencies": { - "@lingui/conf": "4.14.1", + "@lingui/conf": "5.0.0", "ramda": "^0.28.0" }, "devDependencies": { diff --git a/packages/format-po-gettext/README.md b/packages/format-po-gettext/README.md index 30c6940c0..b6be69431 100644 --- a/packages/format-po-gettext/README.md +++ b/packages/format-po-gettext/README.md @@ -8,83 +8,16 @@ > > Converts ICU Plural expressions into native gettext plurals -`@lingui/format-po-gettext` is part of [LinguiJS][linguijs]. See the -[documentation][documentation] for all information, tutorials and examples. +`@lingui/format-po-gettext` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. + +## Installation & Usage + +See the [reference][reference] documentation. > **Warning** > This formatter is made for compatibility with translation management systems, which do not support ICU expressions in PO files. > > It does not support all features of LinguiJS and should be carefully considered over other formats. -> -> Not supported features (native gettext doesn't support this): -> - SelectOrdinal -> - Select -> - Nested ICU Expressions -> - Signed digits and fractions (-5, and 0.15) in plurals - -## Catalog example - -```po -#. js-lingui-id: WGI12K -#. js-lingui:icu=%7BanotherCount%2C+plural%2C+one+%7BSingular+case%7D+other+%7BCase+number+%7BanotherCount%7D%7D%7D&pluralize_on=anotherCount -msgid "Singular case" -msgid_plural "Case number {anotherCount}" -msgstr[0] "Singular case" -msgstr[1] "Case number {anotherCount}" -``` - -## Installation - -```sh -npm install --save-dev @lingui/format-po-gettext -# yarn add --dev @lingui/format-po-gettext -``` - -## Usage - -```js -// lingui.config.{js,ts} -import {formatter} from "@lingui/format-po-gettext" - -export default { - [...] - format: formatter({lineNumbers: false}), -} -``` - -Possible options: - -```ts -export type PoGettextFormatterOptions = { - /** - * Print places where message is used - * - * @default true - */ - origins?: boolean - - /** - * Print line numbers in origins - * - * @default true - */ - lineNumbers?: boolean - - /** - * Disable warning about unsupported `Select` feature encountered in catalogs - * - * @default false - */ - disableSelectWarning?: boolean - - /** - * Overrides the default prefix for icu and plural comments in the final PO catalog. - * - * @default "js-lingui:" - */ - customICUPrefix?: string -} -``` ## License @@ -93,6 +26,7 @@ This package is licensed under [MIT][license] license. [license]: https://github.com/lingui/js-lingui/blob/main/LICENSE [linguijs]: https://github.com/lingui/js-lingui [documentation]: https://lingui.dev +[reference]: https://lingui.dev/ref/catalog-formats#po-gettext [package]: https://www.npmjs.com/package/@lingui/format-po-gettext [badge-downloads]: https://img.shields.io/npm/dw/@lingui/format-po-gettext.svg [badge-version]: https://img.shields.io/npm/v/@lingui/format-po-gettext.svg diff --git a/packages/format-po-gettext/package.json b/packages/format-po-gettext/package.json index f061cd6b5..c48dec6ee 100644 --- a/packages/format-po-gettext/package.json +++ b/packages/format-po-gettext/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/format-po-gettext", - "version": "4.14.1", + "version": "5.0.0", "description": "Gettext PO format with gettext-style plurals for Lingui Catalogs", "main": "./dist/po-gettext.cjs", "module": "./dist/po-gettext.mjs", @@ -33,7 +33,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "files": [ "LICENSE", @@ -41,9 +41,9 @@ "dist/" ], "dependencies": { - "@lingui/conf": "4.14.1", - "@lingui/format-po": "4.14.1", - "@lingui/message-utils": "4.14.1", + "@lingui/conf": "5.0.0", + "@lingui/format-po": "5.0.0", + "@lingui/message-utils": "5.0.0", "@messageformat/parser": "^5.0.0", "cldr-core": "^45.0.0", "node-gettext": "^3.0.0", diff --git a/packages/format-po/README.md b/packages/format-po/README.md index fe2c20f5c..ebb81c9c4 100644 --- a/packages/format-po/README.md +++ b/packages/format-po/README.md @@ -6,85 +6,11 @@ > Read and write message catalogs in Gettext PO format with ICU plurals -`@lingui/format-po` is part of [LinguiJS][linguijs]. See the -[documentation][documentation] for all information, tutorials and examples. +`@lingui/format-po` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. -## Catalog example +## Installation & Usage -```po -#, Comment for translators -#: src/App.js:4, src/Component.js:2 -msgid "MessageID" -msgstr "Translated Message" -``` - -## Installation - -```sh -npm install --save-dev @lingui/format-po -# yarn add --dev @lingui/format-po -``` - -## Usage - -```js -// lingui.config.{js,ts} -import {formatter} from "@lingui/format-po" - -export default { - [...] - format: formatter({lineNumbers: false}), -} -``` - -Possible options: - -```ts -export type PoFormatterOptions = { - /** - * Print places where message is used - * - * @default true - */ - origins?: boolean - - /** - * Print line numbers in origins - * - * @default true - */ - lineNumbers?: boolean - - /** - * Print `js-lingui-id: Xs4as` statement in extracted comments section - * - * @default false - */ - printLinguiId?: boolean - - /** - * By default, the po-formatter treats the pair `msgid` + `msgctx` as the source - * for generating an ID by hashing its value. - * - * For messages with explicit IDs, the formatter adds a special comment `js-lingui-explicit-id` as a flag. - * When this flag is present, the formatter will use the `msgid` as-is without any additional processing. - * - * Set this option to true if you exclusively use explicit-ids in your project. - * - * https://lingui.dev/tutorials/explicit-vs-generated-ids#using-custom-id - * - * @default false - */ - explicitIdAsDefault?: boolean - - /** - * Custom attributes to append to the PO file header - * - * @default {} - */ - customHeaderAttributes?: { [key: string]: string } -} -``` +See the [reference][reference] documentation. ## License @@ -93,6 +19,7 @@ This package is licensed under [MIT][license] license. [license]: https://github.com/lingui/js-lingui/blob/main/LICENSE [linguijs]: https://github.com/lingui/js-lingui [documentation]: https://lingui.dev +[reference]: https://lingui.dev/ref/catalog-formats#po [package]: https://www.npmjs.com/package/@lingui/format-po [badge-downloads]: https://img.shields.io/npm/dw/@lingui/format-po.svg [badge-version]: https://img.shields.io/npm/v/@lingui/format-po.svg diff --git a/packages/format-po/package.json b/packages/format-po/package.json index 5376e04ec..d460b8efe 100644 --- a/packages/format-po/package.json +++ b/packages/format-po/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/format-po", - "version": "4.14.1", + "version": "5.0.0", "description": "Gettext PO format for Lingui Catalogs", "main": "./dist/po.cjs", "module": "./dist/po.mjs", @@ -33,7 +33,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "files": [ "LICENSE", @@ -41,8 +41,8 @@ "dist/" ], "dependencies": { - "@lingui/conf": "4.14.1", - "@lingui/message-utils": "4.14.1", + "@lingui/conf": "5.0.0", + "@lingui/message-utils": "5.0.0", "date-fns": "^3.6.0", "pofile": "^1.1.4" }, diff --git a/packages/format-po/src/__snapshots__/po.test.ts.snap b/packages/format-po/src/__snapshots__/po.test.ts.snap index aa06a36ce..e7a0b27c4 100644 --- a/packages/format-po/src/__snapshots__/po.test.ts.snap +++ b/packages/format-po/src/__snapshots__/po.test.ts.snap @@ -1,5 +1,75 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`pofile format printPlaceholdersInComments Should not print placeholders if printPlaceholdersInComments = false 1`] = ` +msgid "" +msgstr "" +"POT-Creation-Date: 2018-08-27 10:00+0000\\n" +"MIME-Version: 1.0\\n" +"Content-Type: text/plain; charset=utf-8\\n" +"Content-Transfer-Encoding: 8bit\\n" +"X-Generator: @lingui/cli\\n" +"Language: en\\n" + +#. js-lingui-explicit-id +msgid "static" +msgstr "Static message {0} {name}" + +`; + +exports[`pofile format printPlaceholdersInComments Should print printPlaceholdersInComments.limit amount of values for placeholder 1`] = ` +msgid "" +msgstr "" +"POT-Creation-Date: 2018-08-27 10:00+0000\\n" +"MIME-Version: 1.0\\n" +"Content-Type: text/plain; charset=utf-8\\n" +"Content-Transfer-Encoding: 8bit\\n" +"X-Generator: @lingui/cli\\n" +"Language: en\\n" + +#. js-lingui-explicit-id +#. placeholder {0}: userName +#. placeholder {1}: a +msgid "static" +msgstr "Static message {0} {1}" + +`; + +exports[`pofile format printPlaceholdersInComments should print unnamed placeholders as comments 1`] = ` +msgid "" +msgstr "" +"POT-Creation-Date: 2018-08-27 10:00+0000\\n" +"MIME-Version: 1.0\\n" +"Content-Type: text/plain; charset=utf-8\\n" +"Content-Transfer-Encoding: 8bit\\n" +"X-Generator: @lingui/cli\\n" +"Language: en\\n" + +#. js-lingui-explicit-id +#. placeholder {0}: getValue() +msgid "static" +msgstr "Static message {0} {name}" + +#. placeholder: {0} = getValue() +#. js-lingui-explicit-id +#. placeholder {0}: getValue() +msgid "static2" +msgstr "Static message {0} {name}" + +#. js-lingui-explicit-id +#. placeholder {0}: user ? user.name : null +#. placeholder {0}: userName +msgid "static3" +msgstr "Static message {0}" + +#. js-lingui-explicit-id +#. placeholder {0}: userName +#. placeholder {0}: user.name +#. placeholder {0}: profile.name +msgid "static4" +msgstr "Static message {0}" + +`; + exports[`pofile format should correct badly used comments 1`] = ` { withDescriptionAndComments: { diff --git a/packages/format-po/src/__snapshots__/utils.test.ts.snap b/packages/format-po/src/__snapshots__/utils.test.ts.snap new file mode 100644 index 000000000..d55e4c8f8 --- /dev/null +++ b/packages/format-po/src/__snapshots__/utils.test.ts.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`normalizePlaceholderValue Should normalize whitespaces 1`] = `user ? user.name : null`; + +exports[`normalizePlaceholderValue Should normalize whitespaces 2`] = `userName`; diff --git a/packages/format-po/src/po.test.ts b/packages/format-po/src/po.test.ts index 4cdee3002..f91872119 100644 --- a/packages/format-po/src/po.test.ts +++ b/packages/format-po/src/po.test.ts @@ -472,4 +472,91 @@ describe("pofile format", () => { `) }) + + describe("printPlaceholdersInComments", () => { + it("should print unnamed placeholders as comments", () => { + const format = createFormatter() + + const catalog: CatalogType = { + static: { + message: "Static message {0} {name}", + translation: "Static message {0} {name}", + placeholders: { + 0: ["getValue()"], + name: ["user.getName()"], + }, + }, + // should not push placeholder comment twice + static2: { + message: "Static message {0} {name}", + translation: "Static message {0} {name}", + comments: ["placeholder: {0} = getValue()"], + placeholders: { + 0: ["getValue()"], + name: ["user.getName()"], + }, + }, + // multiline placeholder value + multiple entries + static3: { + message: "Static message {0}", + translation: "Static message {0}", + placeholders: { + 0: ["user \n ? user.name \n : null", "userName"], + }, + }, + + // should limit to 3 by default + static4: { + message: "Static message {0}", + translation: "Static message {0}", + placeholders: { + 0: ["userName", "user.name", "profile.name", "authorName"], + }, + }, + } + + const actual = format.serialize(catalog, defaultSerializeCtx) + expect(actual).toMatchSnapshot() + }) + + it("Should not print placeholders if printPlaceholdersInComments = false", () => { + const format = createFormatter({ printPlaceholdersInComments: false }) + + const catalog: CatalogType = { + static: { + message: "Static message {0} {name}", + translation: "Static message {0} {name}", + placeholders: { + 0: ["getValue()"], + name: ["user.getName()"], + }, + }, + } + + const actual = format.serialize(catalog, defaultSerializeCtx) + expect(actual).toMatchSnapshot() + }) + + it("Should print printPlaceholdersInComments.limit amount of values for placeholder", () => { + const format = createFormatter({ + printPlaceholdersInComments: { + limit: 1, + }, + }) + + const catalog: CatalogType = { + static: { + message: "Static message {0} {1}", + translation: "Static message {0} {1}", + placeholders: { + 0: ["userName", "user.name", "profile.name", "authorName"], + 1: ["a", "b", "c", "d"], + }, + }, + } + + const actual = format.serialize(catalog, defaultSerializeCtx) + expect(actual).toMatchSnapshot() + }) + }) }) diff --git a/packages/format-po/src/po.ts b/packages/format-po/src/po.ts index 9ecc400d0..d2bd82e15 100644 --- a/packages/format-po/src/po.ts +++ b/packages/format-po/src/po.ts @@ -3,6 +3,7 @@ import PO from "pofile" import { CatalogFormatter, CatalogType, MessageType } from "@lingui/conf" import { generateMessageId } from "@lingui/message-utils/generateMessageId" +import { normalizePlaceholderValue } from "./utils" type POItem = InstanceType @@ -69,12 +70,37 @@ export type PoFormatterOptions = { * @default false */ explicitIdAsDefault?: boolean + /** * Custom attributes to append to the PO file header * * @default {} */ customHeaderAttributes?: { [key: string]: string } + + /** + * Print values for unnamed placeholders as comments for each message. + * + * This can give more context to translators for better translations. + * + * By default first 3 placeholders are shown. + * + * Example: + * + * ```js + * t`Hello ${user.name} ${value}` + * ``` + * + * This will be extracted as + * + * ```po + * #. placeholder {0}: user.name + * msgid "Hello {0} {value}" + * ``` + * + * @default true + */ + printPlaceholdersInComments?: boolean | { limit?: number } } function isGeneratedId(id: string, message: MessageType): boolean { @@ -146,6 +172,30 @@ const serialize = (catalog: CatalogType, options: PoFormatterOptions) => { item.msgid = id } + if (options.printPlaceholdersInComments !== false) { + item.extractedComments = item.extractedComments.filter( + (comment) => !comment.startsWith("placeholder ") + ) + + const limit = + typeof options.printPlaceholdersInComments === "object" && + options.printPlaceholdersInComments.limit + ? options.printPlaceholdersInComments.limit + : 3 + + if (message.placeholders) { + Object.entries(message.placeholders).forEach(([name, value]) => { + if (/^\d+$/.test(name)) { + value.slice(0, limit).forEach((entry) => { + item.extractedComments.push( + `placeholder {${name}}: ${normalizePlaceholderValue(entry)}` + ) + }) + } + }) + } + } + if (message.context) { item.msgctxt = message.context } diff --git a/packages/format-po/src/utils.test.ts b/packages/format-po/src/utils.test.ts new file mode 100644 index 000000000..58f0ae65e --- /dev/null +++ b/packages/format-po/src/utils.test.ts @@ -0,0 +1,12 @@ +import { normalizePlaceholderValue } from "./utils" + +describe("normalizePlaceholderValue", () => { + it.each([ + `user + ? user.name + : null`, + "userName", + ])("Should normalize whitespaces", (input) => { + expect(normalizePlaceholderValue(input)).toMatchSnapshot() + }) +}) diff --git a/packages/format-po/src/utils.ts b/packages/format-po/src/utils.ts new file mode 100644 index 000000000..525ba0853 --- /dev/null +++ b/packages/format-po/src/utils.ts @@ -0,0 +1,3 @@ +export function normalizePlaceholderValue(text: string) { + return text.replace(/\n/g, " ").replace(/\s{2,}/g, " ") +} diff --git a/packages/jest-mocks/package.json b/packages/jest-mocks/package.json index aedadb1e2..9a0bfd14f 100644 --- a/packages/jest-mocks/package.json +++ b/packages/jest-mocks/package.json @@ -22,7 +22,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=10.0" + "node": ">=20.0.0" }, "files": [ "LICENSE", diff --git a/packages/loader/README.md b/packages/loader/README.md index fdf5c986c..2a6a6e080 100644 --- a/packages/loader/README.md +++ b/packages/loader/README.md @@ -6,17 +6,9 @@ > webpack loader for compiling message catalog on the fly -`@lingui/loader` is part of [LinguiJS][linguijs]. See the -[documentation][documentation] for all information, tutorials and examples. +`@lingui/loader` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. -## Installation - -```sh -npm install --save-dev @lingui/loader -# yarn add --dev @lingui/loader -``` - -## Usage +## Installation & Usage See the [reference][reference] documentation. diff --git a/packages/loader/package.json b/packages/loader/package.json index d4d6d37b5..ad8d9e0b4 100644 --- a/packages/loader/package.json +++ b/packages/loader/package.json @@ -1,6 +1,6 @@ { "name": "@lingui/loader", - "version": "4.14.1", + "version": "5.0.0", "description": "webpack loader for lingui message catalogs", "types": "./dist/index.d.ts", "main": "./dist/index.cjs", @@ -34,7 +34,7 @@ "url": "https://github.com/lingui/js-lingui/issues" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" }, "files": [ "LICENSE", @@ -43,11 +43,11 @@ ], "dependencies": { "@babel/runtime": "^7.20.13", - "@lingui/cli": "4.14.1", - "@lingui/conf": "4.14.1" + "@lingui/cli": "5.0.0", + "@lingui/conf": "5.0.0" }, "devDependencies": { - "@lingui/format-json": "4.14.1", + "@lingui/format-json": "5.0.0", "unbuild": "2.0.0", "webpack": "^5.76.1" }, diff --git a/packages/loader/test/__snapshots__/loader.test.ts.snap b/packages/loader/test/__snapshots__/loader.test.ts.snap index 451f16e19..b5cdd2770 100644 --- a/packages/loader/test/__snapshots__/loader.test.ts.snap +++ b/packages/loader/test/__snapshots__/loader.test.ts.snap @@ -2,7 +2,9 @@ exports[`lingui-loader should compile catalog in json format 1`] = ` { - key: Message, + key: [ + Message, + ], key2: [ Hello , [ @@ -14,26 +16,34 @@ exports[`lingui-loader should compile catalog in json format 1`] = ` exports[`lingui-loader should compile catalog in po format 1`] = ` { - ED2Xk0: String from template, + ED2Xk0: [ + String from template, + ], mVmaLu: [ My name is , [ name, ], ], - mY42CM: Hello World, + mY42CM: [ + Hello World, + ], } `; exports[`lingui-loader should compile catalog with relative path with no warnings 1`] = ` { - ED2Xk0: String from template, + ED2Xk0: [ + String from template, + ], mVmaLu: [ My name is , [ name, ], ], - mY42CM: Hello World, + mY42CM: [ + Hello World, + ], } `; diff --git a/packages/loader/test/loader.test.ts b/packages/loader/test/loader.test.ts index 468e0a6d8..43e178049 100644 --- a/packages/loader/test/loader.test.ts +++ b/packages/loader/test/loader.test.ts @@ -4,9 +4,7 @@ import { build, watch } from "./compiler" import { mkdtempSync } from "fs" import os from "os" -const skipOnWindows = os.platform() === "win32" ? describe.skip : describe - -skipOnWindows("lingui-loader", () => { +describe("lingui-loader", () => { it("should compile catalog in po format", async () => { const built = await build(path.join(__dirname, "po-format/entrypoint.js")) @@ -62,14 +60,18 @@ skipOnWindows("lingui-loader", () => { expect((await res.loadBundle().then((m) => m.load())).messages) .toMatchInlineSnapshot(` { - ED2Xk0: String from template, + ED2Xk0: [ + String from template, + ], mVmaLu: [ My name is , [ name, ], ], - mY42CM: Hello World, + mY42CM: [ + Hello World, + ], } `) @@ -99,8 +101,12 @@ msgstr "" name, ], ], - mY42CM: Hello World, - wg2uwk: String from template changes!, + mY42CM: [ + Hello World, + ], + wg2uwk: [ + String from template changes!, + ], } `) diff --git a/packages/macro/README.md b/packages/macro/README.md index 8dfd2e450..2abe6b117 100644 --- a/packages/macro/README.md +++ b/packages/macro/README.md @@ -5,35 +5,14 @@ # @lingui/macro -> [Babel Macros](https://github.com/kentcdodds/babel-plugin-macros) which -> transforms tagged template literals and JSX components to ICU MessageFormat. +> [Babel Macros](https://github.com/kentcdodds/babel-plugin-macros) which transforms tagged template literals and JSX components to ICU MessageFormat. -`@lingui/macro` is part of [LinguiJS][linguijs]. See the [documentation][documentation] -for all information, tutorials and examples. +`@lingui/macro` is part of [LinguiJS][linguijs]. See the [documentation][documentation] for all information, tutorials and examples. -## Installation - -```sh -npm install --save-dev @lingui/macro -# yarn add --dev @lingui/macro -``` - -## Usage +## Installation & Usage See the [reference][reference] documentation. -```jsx -import { setupI18n } from "@lingui/core" -import { t } from "@lingui/macro" - -const i18n = setupI18n() - -const message = i18n._(t`Hello, my name is ${name} and today is ${date(now)}`) - -// line above is transformed using babel-plugin-macros to this -// const message = i18n._(/*i18n*/{ id: "Hello, my name is {name} and today is {now,date}", values: { name, now }}) -``` - ## License [MIT][license] diff --git a/packages/macro/build.config.ts b/packages/macro/build.config.ts deleted file mode 100644 index ab91d5fa3..000000000 --- a/packages/macro/build.config.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { defineBuildConfig } from "unbuild" - -export default defineBuildConfig({ - declaration: false, -}) diff --git a/packages/macro/global.d.ts b/packages/macro/global.d.ts deleted file mode 100644 index 3473c7249..000000000 --- a/packages/macro/global.d.ts +++ /dev/null @@ -1,225 +0,0 @@ -// read more about this file here -// https://github.com/lingui/js-lingui/issues/936 -// @ts-ignore -declare module "@lingui/macro" { - import type { MessageDescriptor, I18n } from "@lingui/core" - - type MacroMessageDescriptor = ( - | { - id: string - message?: string - } - | { - id?: string - message: string - } - ) & { - comment?: string - context?: string - } - - export type BasicType = { - id?: string - comment?: string - } - - /** - * Translates a message descriptor - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * const message = t({ - * id: "msg.hello", - * comment: "Greetings at the homepage", - * message: `Hello ${name}`, - * }); - * ``` - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * const message = t({ - * id: "msg.plural", - * message: plural(value, { one: "...", other: "..." }), - * }); - * ``` - * - * @param descriptor The message descriptor to translate - */ - export function t(descriptor: MacroMessageDescriptor): string - - /** - * Translates a template string using the global I18n instance - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * const message = t`Hello ${name}`; - * ``` - */ - export function t( - literals: TemplateStringsArray, - ...placeholders: any[] - ): string - - /** - * Translates a template string or message descriptor using a given I18n instance - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * import { I18n } from "@lingui/core"; - * const i18n = new I18n({ - * locale: "nl", - * messages: { "Hello {0}": "Hallo {0}" }, - * }); - * const message = t(i18n)`Hello ${name}`; - * ``` - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * import { I18n } from "@lingui/core"; - * const i18n = new I18n({ - * locale: "nl", - * messages: { "Hello {0}": "Hallo {0}" }, - * }); - * const message = t(i18n)({ message: `Hello ${name}` }); - * ``` - */ - export function t(i18n: I18n): { - (literals: TemplateStringsArray, ...placeholders: any[]): string - (descriptor: MacroMessageDescriptor): string - } - - export type UnderscoreDigit = { [digit: string]: T } - export type ChoiceOptions = { - offset?: number - zero?: T - one?: T - few?: T - many?: T - other?: T - } & UnderscoreDigit - - /** - * Pluralize a message - * - * @example - * ``` - * import { plural } from "@lingui/macro"; - * const message = plural(count, { - * one: "# Book", - * other: "# Books", - * }); - * ``` - * - * @param value Determines the plural form - * @param options Object with available plural forms - */ - export function plural( - value: number | string, - options: ChoiceOptions & BasicType - ): string - - /** - * Pluralize a message using ordinal forms - * - * Similar to `plural` but instead of using cardinal plural forms, - * it uses ordinal forms. - * - * @example - * ``` - * import { selectOrdinal } from "@lingui/macro"; - * const message = selectOrdinal(count, { - * one: "#st", - * two: "#nd", - * few: "#rd", - * other: "#th", - * }); - * ``` - * - * @param value Determines the plural form - * @param options Object with available plural forms - */ - export function selectOrdinal( - value: number | string, - options: ChoiceOptions & BasicType - ): string - - /** - * Selects a translation based on a value - * - * Select works like a switch statement. It will - * select one of the forms in `options` object which - * key matches exactly `value`. - * - * @example - * ``` - * import { select } from "@lingui/macro"; - * const message = select(gender, { - * male: "he", - * female: "she", - * other: "they", - * }); - * ``` - * - * @param value The key of choices to use - * @param choices - */ - export function select( - value: string, - choices: Record & BasicType - ): string - - /** - * Define a message for later use - * - * `defineMessage` can be used to add comments for translators, - * or to override the message ID. - * - * @example - * ``` - * import { defineMessage } from "@lingui/macro"; - * const message = defineMessage({ - * comment: "Greetings on the welcome page", - * message: `Welcome, ${name}!`, - * }); - * ``` - * - * @param descriptor The message descriptor - */ - export function defineMessage( - descriptor: MacroMessageDescriptor - ): MessageDescriptor - - export type ChoiceProps = { - value?: string | number - } & ChoiceOptions - - /** - * The types should be changed after this PR is merged - * https://github.com/Microsoft/TypeScript/pull/26797 - * - * then we should be able to specify that key of values is same type as value. - * We would be able to remove separate type Values = {...} definition - * eg. - * type SelectProps = { - * value?: Values - * [key: Values]: string - * } - * - */ - type Values = { [key: string]: string } - - export type SelectProps = { - value: string - other: any - } & Values - - export const Trans: any - export const Plural: any - export const Select: any - export const SelectOrdinal: any -} diff --git a/packages/macro/index.d.ts b/packages/macro/index.d.ts index dca81ea01..1fcb0d522 100644 --- a/packages/macro/index.d.ts +++ b/packages/macro/index.d.ts @@ -1,318 +1,98 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import type { ReactNode, VFC, FC } from "react" -import type { I18n, MessageDescriptor } from "@lingui/core" -import type { TransRenderCallbackOrComponent } from "@lingui/react" - -export type ChoiceOptions = { - /** Offset of value when calculating plural forms */ - offset?: number - zero?: string - one?: string - two?: string - few?: string - many?: string - - /** Catch-all option */ - other: string - /** Exact match form, corresponds to =N rule */ - [digit: `${number}`]: string -} - -type MacroMessageDescriptor = ( - | { - id: string - message?: string - } - | { - id?: string - message: string - } -) & { - comment?: string - context?: string -} +import { + t as _t, + plural as _plural, + defineMessage as _defineMessage, + msg as _msg, + select as _select, + selectOrdinal as _selectOrdinal, + SelectOptions as _SelectOptions, + ChoiceOptions as _ChoiceOptions, + MacroMessageDescriptor as _MacroMessageDescriptor, +} from "@lingui/core/macro" + +import { + Trans as _Trans, + Plural as _Plural, + Select as _Select, + SelectOrdinal as _SelectOrdinal, + PluralChoiceProps as _PluralChoiceProps, + SelectChoiceProps as _SelectChoiceProps, + CommonProps as _CommonProps, + TransProps as _TransProps, + useLingui as _useLingui, +} from "@lingui/react/macro" /** - * Translates a message descriptor - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * const message = t({ - * id: "msg.hello", - * comment: "Greetings at the homepage", - * message: `Hello ${name}`, - * }); - * ``` - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * const message = t({ - * id: "msg.plural", - * message: plural(value, { one: "...", other: "..." }), - * }); - * ``` - * - * @param descriptor The message descriptor to translate + * @deprecated please import from `@lingui/core/macro` directly */ -export function t(descriptor: MacroMessageDescriptor): string +declare const t: typeof _t /** - * Translates a template string using the global I18n instance - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * const message = t`Hello ${name}`; - * ``` + * @deprecated please import from `@lingui/core/macro` directly */ -export function t( - literals: TemplateStringsArray, - ...placeholders: any[] -): string - +declare const msg: typeof _msg /** - * Translates a template string or message descriptor using a given I18n instance - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * import { I18n } from "@lingui/core"; - * const i18n = new I18n({ - * locale: "nl", - * messages: { "Hello {0}": "Hallo {0}" }, - * }); - * const message = t(i18n)`Hello ${name}`; - * ``` - * - * @example - * ``` - * import { t } from "@lingui/macro"; - * import { I18n } from "@lingui/core"; - * const i18n = new I18n({ - * locale: "nl", - * messages: { "Hello {0}": "Hallo {0}" }, - * }); - * const message = t(i18n)({ message: `Hello ${name}` }); - * ``` + * @deprecated please import from `@lingui/core/macro` directly */ -export function t(i18n: I18n): { - (literals: TemplateStringsArray, ...placeholders: any[]): string - (descriptor: MacroMessageDescriptor): string -} - +declare const plural: typeof _plural /** - * Pluralize a message - * - * @example - * ``` - * import { plural } from "@lingui/macro"; - * const message = plural(count, { - * one: "# Book", - * other: "# Books", - * }); - * ``` - * - * @param value Determines the plural form - * @param options Object with available plural forms + * @deprecated please import from `@lingui/core/macro` directly */ -export function plural(value: number | string, options: ChoiceOptions): string - +declare const defineMessage: typeof _defineMessage /** - * Pluralize a message using ordinal forms - * - * Similar to `plural` but instead of using cardinal plural forms, - * it uses ordinal forms. - * - * @example - * ``` - * import { selectOrdinal } from "@lingui/macro"; - * const message = selectOrdinal(count, { - * one: "#st", - * two: "#nd", - * few: "#rd", - * other: "#th", - * }); - * ``` - * - * @param value Determines the plural form - * @param options Object with available plural forms + * @deprecated please import from `@lingui/core/macro` directly */ -export function selectOrdinal( - value: number | string, - options: ChoiceOptions -): string - -type SelectOptions = { - /** Catch-all option */ - other: string - [matches: string]: string -} - +declare const select: typeof _select /** - * Selects a translation based on a value - * - * Select works like a switch statement. It will - * select one of the forms in `options` object which - * key matches exactly `value`. - * - * @example - * ``` - * import { select } from "@lingui/macro"; - * const message = select(gender, { - * male: "he", - * female: "she", - * other: "they", - * }); - * ``` - * - * @param value The key of choices to use - * @param choices + * @deprecated please import from `@lingui/core/macro` directly */ -export function select(value: string, choices: SelectOptions): string - +declare const selectOrdinal: typeof _selectOrdinal /** - * Define a message for later use - * - * `defineMessage` can be used to add comments for translators, - * or to override the message ID. - * - * @example - * ``` - * import { defineMessage } from "@lingui/macro"; - * const message = defineMessage({ - * comment: "Greetings on the welcome page", - * message: `Welcome, ${name}!`, - * }); - * ``` - * - * @param descriptor The message descriptor + * @deprecated please import from `@lingui/core/macro` directly */ -export function defineMessage( - descriptor: MacroMessageDescriptor -): MessageDescriptor - +declare const SelectOptions: _SelectOptions /** - * Define a message for later use - * - * @example - * ``` - * import { defineMessage, msg } from "@lingui/macro"; - * const message = defineMessage`Hello ${name}`; - * - * // or using shorter version - * const message = msg`Hello ${name}`; - * ``` + * @deprecated please import from `@lingui/core/macro` directly */ -export function defineMessage( - literals: TemplateStringsArray, - ...placeholders: any[] -): MessageDescriptor - +declare const ChoiceOptions: _ChoiceOptions /** - * Define a message for later use - * Alias for {@see defineMessage} + * @deprecated please import from `@lingui/core/macro` directly */ -export const msg: typeof defineMessage - -type CommonProps = TransRenderCallbackOrComponent & { - id?: string - comment?: string - context?: string -} - -type TransProps = { - children: ReactNode -} & CommonProps - -type PluralChoiceProps = { - value: string | number - /** Offset of value when calculating plural forms */ - offset?: number - zero?: ReactNode - one?: ReactNode - two?: ReactNode - few?: ReactNode - many?: ReactNode - - /** Catch-all option */ - other: ReactNode - /** Exact match form, corresponds to =N rule */ - [digit: `_${number}`]: ReactNode -} & CommonProps - -type SelectChoiceProps = { - value: string - /** Catch-all option */ - other: ReactNode - [option: `_${string}`]: ReactNode -} & CommonProps +declare const MacroMessageDescriptor: _MacroMessageDescriptor /** - * Trans is the basic macro for static messages, - * messages with variables, but also for messages with inline markup - * - * @example - * ``` - * Hello {username}. Read the docs. - * ``` - * @example - * ``` - * Hello {username}. - * ``` + * @deprecated please import from `@lingui/react/macro` directly */ -export const Trans: FC - +declare const Trans: typeof _Trans /** - * Props of Plural macro are transformed into plural format. - * - * @example - * ``` - * import { Plural } from "@lingui/macro" - * - * - * // ↓ ↓ ↓ ↓ ↓ ↓ - * import { Trans } from "@lingui/react" - * - * ``` + * @deprecated please import from `@lingui/react/macro` directly */ -export const Plural: VFC +export const Plural: typeof _Plural /** - * Props of SelectOrdinal macro are transformed into selectOrdinal format. - * - * @example - * ``` - * // count == 1 -> 1st - * // count == 2 -> 2nd - * // count == 3 -> 3rd - * // count == 4 -> 4th - * - * ``` + * @deprecated please import from `@lingui/react/macro` directly */ -export const SelectOrdinal: VFC - +export const PluralChoiceProps: _PluralChoiceProps +/** + * @deprecated please import from `@lingui/react/macro` directly + */ +export const SelectChoiceProps: _SelectChoiceProps +/** + * @deprecated please import from `@lingui/react/macro` directly + */ +export const Select: typeof _Select +/** + * @deprecated please import from `@lingui/react/macro` directly + */ +export const CommonProps: _CommonProps +/** + * @deprecated please import from `@lingui/react/macro` directly + */ +export const SelectOrdinal: typeof _SelectOrdinal +/** + * @deprecated please import from `@lingui/react/macro` directly + */ +export const TransProps: _TransProps /** - * Props of Select macro are transformed into select format - * - * @example - * ``` - * // gender == "female" -> Her book - * // gender == "male" -> His book - * // gender == "non-binary" -> Their book - * - * Not allowed") - ).toThrowErrorMatchingSnapshot() - expect( - transformCode("Not allowed") - ).toThrowErrorMatchingSnapshot() - }) - - it("value is missing", function () { - const code = `` - expect(transformCode(code)).toThrowErrorMatchingSnapshot() - }) - - it("offset must be number or string, not variable", function () { - const variable = `` - expect(transformCode(variable)).toThrowErrorMatchingSnapshot() - }) - - it("plural forms are missing", function () { - const plural = `` - expect(transformCode(plural)).toThrowErrorMatchingSnapshot() - - const select = `Other
} - />; - `, - expected: ` - import { Trans } from "@lingui/react"; - "} - message={"{count, select, male {He} female {She} other {<0>Other}}"} values={{ - count: count - }} - components={{ - 0: - }} - />; - `, - }, - { - input: ` - import { Select } from '@lingui/macro'; - Hooray! - } - _sad={ - Oh no! - } - other="Dunno" - /> - `, - expected: ` - import { Trans } from "@lingui/react"; - "} - message={"{0, select, happy {Hooray! <0/>} sad {Oh no! <1/>} other {Dunno}}"} - values={{ - 0: "happy", - }} - components={{ - 0: , - 1: , - }} - />; - `, - }, - { - input: ` - import { Select } from '@lingui/macro'; - + Message + +) + +// @ts-expect-error: `value` could be string only +m = + +// @ts-expect-error: `value` required +m = + +// @ts-expect-error: exact cases should be prefixed with underscore +m = ...} + other={...} + /> +) + +//////////////////////// +//// React useLingui() +//////////////////////// +function MyComponent() { + const { t, i18n } = useLingui() + + expectType(t`Hello world`) + expectType(t({ message: "my message" })) + // @ts-expect-error: you could not pass a custom instance here + t(i18n)({ message: "my message" }) + + expectType(i18n) +} diff --git a/packages/macro/__typetests__/tsconfig.json b/packages/react/macro/__typetests__/tsconfig.json similarity index 100% rename from packages/macro/__typetests__/tsconfig.json rename to packages/react/macro/__typetests__/tsconfig.json diff --git a/packages/react/macro/index.d.ts b/packages/react/macro/index.d.ts new file mode 100644 index 000000000..ba564ebda --- /dev/null +++ b/packages/react/macro/index.d.ts @@ -0,0 +1,137 @@ +import type { ReactNode, VFC, FC } from "react" +import type { TransRenderCallbackOrComponent, I18nContext } from "@lingui/react" +import type { MacroMessageDescriptor } from "@lingui/core/macro" + +type CommonProps = TransRenderCallbackOrComponent & { + id?: string + comment?: string + context?: string +} + +type TransProps = { + children: ReactNode +} & CommonProps + +type PluralChoiceProps = { + value: string | number + /** Offset of value when calculating plural forms */ + offset?: number + zero?: ReactNode + one?: ReactNode + two?: ReactNode + few?: ReactNode + many?: ReactNode + + /** Catch-all option */ + other: ReactNode + /** Exact match form, corresponds to =N rule */ + [digit: `_${number}`]: ReactNode +} & CommonProps + +type SelectChoiceProps = { + value: string + /** Catch-all option */ + other: ReactNode + [option: `_${string}`]: ReactNode +} & CommonProps + +/** + * Trans is the basic macro for static messages, + * messages with variables, but also for messages with inline markup + * + * @example + * ``` + * Hello {username}. Read the docs. + * ``` + * @example + * ``` + * Hello {username}. + * ``` + */ +export const Trans: FC + +/** + * Props of Plural macro are transformed into plural format. + * + * @example + * ``` + * import { Plural } from "@lingui/core/macro" + * + * + * // ↓ ↓ ↓ ↓ ↓ ↓ + * import { Trans } from "@lingui/react" + * + * ``` + */ +export const Plural: VFC +/** + * Props of SelectOrdinal macro are transformed into selectOrdinal format. + * + * @example + * ``` + * // count == 1 -> 1st + * // count == 2 -> 2nd + * // count == 3 -> 3rd + * // count == 4 -> 4th + * + * ``` + */ +export const SelectOrdinal: VFC + +/** + * Props of Select macro are transformed into select format + * + * @example + * ``` + * // gender == "female" -> Her book + * // gender == "male" -> His book + * // gender == "non-binary" -> Their book + * + * ; +``` + +Available Props: -> MessageFormat: `{arg, select, ...forms}` +| Prop name | Type | Description | +| --------- | ------ | ------------------------------------------------------ | +| `value` | number | _(required)_ Value determines which form is output | +| `other` | number | _(required)_ Default, catch-all form | +| `_` | string | Form for specific case | +| `id` | string | Custom message ID | +| `comment` | string | Comment for translators | +| `context` | string | Allows to extract the same messages with different IDs | +| `render` | func | Custom render callback to render translation | -:::note The select cases except `other` should be prefixed with underscore: `_male` or `_female`. + +### `useLingui` + +The `useLingui` React macro gives access to a [`t`](/ref/macro#t) macro that is bound to the local `i18n` object passed from the React context. + +It returns an object with the following content: + +| Key | Type | Description | +| ------------------ | --------------------- | ----------------------------------------------------------------- | +| `i18n` | `I18n` | The `I18n` object instance passed to `I18nProvider` | +| `t` | `t` | Reference to the `t` macro described above | +| `defaultComponent` | `React.ComponentType` | the same `defaultComponent` passed to `I18nProvider`, if provided | + +Example usage: + +```jsx +import { useLingui } from "@lingui/react/macro"; + +function MyComponent() { + const { t } = useLingui(); + const a = t`Text`; +} + +// ↓ ↓ ↓ ↓ ↓ ↓ + +import { useLingui } from "@lingui/react"; + +function MyComponent() { + const { _ } = useLingui(); + const a = _( + /*i18n*/ + { + id: "xeiujy", + message: "Text", + } + ); +} +``` + +:::caution +The `useLingui` React macro is available from **Lingui v5**. ::: -Props of `Select` macro are transformed into [`select`](/docs/guides/message-format.md) format: +## Important Notes + +### Using Macros + +All Core Macros cannot be used at the module level: ```jsx -import { Select } from "@lingui/macro"; +import { t } from "@lingui/core/macro"; -// gender == "female" -> Her book -// gender == "male" -> His book -// gender == "non-binary" -> Their book -` inside `` macro if you want to provide `id`, `context` or `comment`. +```js +t(customI18n)`Attachment ${name} saved`; + +// ↓ ↓ ↓ ↓ ↓ ↓ + +customI18n._( + /*i18n*/ { + id: "nwR43V", + message: "Attachment {name} saved", + values: { name }, + } +); +``` + +```js +plural(count, { + one: "# Message", + other: "# Messages", +}); + +// ↓ ↓ ↓ ↓ ↓ ↓ + +i18n._( + /*i18n*/ { + id: "4w2nim", + message: "{count, plural, one {# Message} other {# Messages}}", + values: { count }, + } +); +``` + +```js +t({ + id: "msg.refresh", + message: "Refresh inbox", +}); + +// ↓ ↓ ↓ ↓ ↓ ↓ + +i18n._( + /*i18n*/ { + id: "msg.refresh", + message: "Refresh inbox", + } +); +``` + +```js +const msg = defineMessage`Refresh inbox`; + +// ↓ ↓ ↓ ↓ ↓ ↓ + +const msg = /*i18n*/ { + id: "EsCV2T", + message: "Refresh inbox", +}; +``` + +```js +const msg = defineMessage({ + id: "msg.refresh", + message: "Refresh inbox", +}); + +// ↓ ↓ ↓ ↓ ↓ ↓ + +const msg = /*i18n*/ { + id: "msg.refresh", + message: "Refresh inbox", +}; +``` + +```js +const msg = defineMessage({ + id: "msg.plural", + message: plural(count, { + one: "# Message", + other: "# Messages", + }), +}); + +// ↓ ↓ ↓ ↓ ↓ ↓ + +const msg = /*i18n*/ { + id: "msg.plural", + message: "{count, plural, one {# Message} other {# Messages}}", + values: { count }, +}; +``` + +### Examples of JSX macros + +```jsx +Attachment {name} saved + +// ↓ ↓ ↓ ↓ ↓ ↓ + + +``` + +```jsx + + +// ↓ ↓ ↓ ↓ ↓ ↓ + + +``` ```jsx - -