diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json index 60f8701e9..4a5f141c6 100644 --- a/packages/vite-plugin/package.json +++ b/packages/vite-plugin/package.json @@ -47,7 +47,9 @@ }, "devDependencies": { "@lingui/format-json": "workspace:^", + "@lingui/macro": "workspace:^", "unbuild": "^1.1.2", - "vite": "4.1.4" + "vite": "4.1.4", + "vite-plugin-babel-macros": "^1.0.6" } } diff --git a/packages/vite-plugin/src/index.ts b/packages/vite-plugin/src/index.ts index 4575d2cc1..b34bcf149 100644 --- a/packages/vite-plugin/src/index.ts +++ b/packages/vite-plugin/src/index.ts @@ -16,64 +16,81 @@ type LinguiConfigOpts = { skipValidation?: boolean } -export function lingui(linguiConfig: LinguiConfigOpts = {}): Plugin { +export function lingui(linguiConfig: LinguiConfigOpts = {}): Plugin[] { const config = getConfig(linguiConfig) - return { - name: "vite-plugin-lingui", - - config: (config) => { - // https://github.com/lingui/js-lingui/issues/1464 - config.optimizeDeps.exclude = config.optimizeDeps.exclude || [] - config.optimizeDeps.exclude.push("@lingui/macro") + return [ + { + name: "vite-plugin-lingui-report-macro-error", + enforce: "pre", + resolveId(id) { + if (id.includes("@lingui/macro")) { + throw new Error( + `The macro you imported from "@lingui/macro" is being executed outside the context of compilation. \n` + + `This indicates that you don't have the "babel-plugin-macros" or "@lingui/swc-plugin" configured correctly. ` + + `Please see the documentation for how to configure Vite with Lingui correctly: ` + + "https://lingui.dev/tutorials/setup-vite" + ) + } + }, }, + { + name: "vite-plugin-lingui", + config: (config) => { + // https://github.com/lingui/js-lingui/issues/1464 + if (!config.optimizeDeps) { + config.optimizeDeps = {} + } + config.optimizeDeps.exclude = config.optimizeDeps.exclude || [] + config.optimizeDeps.exclude.push("@lingui/macro") + }, + async transform(src, id) { + if (fileRegex.test(id)) { + id = id.split("?")[0] + + const catalogRelativePath = path.relative(config.rootDir, id) + + const fileCatalog = getCatalogForFile( + catalogRelativePath, + await getCatalogs(config) + ) - async transform(src, id) { - if (fileRegex.test(id)) { - id = id.split("?")[0] - - const catalogRelativePath = path.relative(config.rootDir, id) - - const fileCatalog = getCatalogForFile( - catalogRelativePath, - await getCatalogs(config) - ) - - if (!fileCatalog) { - throw new Error( - `Requested resource ${catalogRelativePath} is not matched to any of your catalogs paths specified in "lingui.config". + if (!fileCatalog) { + throw new Error( + `Requested resource ${catalogRelativePath} is not matched to any of your catalogs paths specified in "lingui.config". Resource: ${id} Your catalogs: ${config.catalogs.map((c) => c.path).join("\n")} Please check that catalogs.path is filled properly.\n` - ) - } + ) + } - const { locale, catalog } = fileCatalog + const { locale, catalog } = fileCatalog - const dependency = await getCatalogDependentFiles(catalog, locale) - dependency.forEach((file) => this.addWatchFile(file)) + const dependency = await getCatalogDependentFiles(catalog, locale) + dependency.forEach((file) => this.addWatchFile(file)) - const messages = await catalog.getTranslations(locale, { - fallbackLocales: config.fallbackLocales, - sourceLocale: config.sourceLocale, - }) + const messages = await catalog.getTranslations(locale, { + fallbackLocales: config.fallbackLocales, + sourceLocale: config.sourceLocale, + }) - const compiled = createCompiledCatalog(locale, messages, { - strict: false, - namespace: "es", - pseudoLocale: config.pseudoLocale, - }) + const compiled = createCompiledCatalog(locale, messages, { + strict: false, + namespace: "es", + pseudoLocale: config.pseudoLocale, + }) - return { - code: compiled, - map: null, // provide source map if available + return { + code: compiled, + map: null, // provide source map if available + } } - } + }, }, - } + ] } export default lingui diff --git a/packages/vite-plugin/test/__snapshots__/index.ts.snap b/packages/vite-plugin/test/__snapshots__/index.ts.snap index 94af4a85d..8724ea0a8 100644 --- a/packages/vite-plugin/test/__snapshots__/index.ts.snap +++ b/packages/vite-plugin/test/__snapshots__/index.ts.snap @@ -1,5 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`vite-plugin should not report error when macro correctly used 1`] = `Ola`; + exports[`vite-plugin should return compiled catalog 1`] = ` { mVmaLu: [ diff --git a/packages/vite-plugin/test/index.ts b/packages/vite-plugin/test/index.ts index fb08b9846..acfd2a149 100644 --- a/packages/vite-plugin/test/index.ts +++ b/packages/vite-plugin/test/index.ts @@ -16,6 +16,27 @@ describe("vite-plugin", () => { expect((await mod.load()).messages).toMatchSnapshot() }) + + skipOnWindows( + "should report error when macro used without a plugin", + async () => { + expect.assertions(1) + try { + await runVite(`no-macro-error/vite.config.ts`) + } catch (e) { + expect(e.stderr).toContain( + 'The macro you imported from "@lingui/macro" is being executed outside the context of compilation.' + ) + } + } + ) + skipOnWindows( + "should not report error when macro correctly used", + async () => { + const mod = await runVite(`macro-usage/vite.config.ts`) + expect(await mod.load()).toMatchSnapshot() + } + ) }) async function runVite(configPath: string) { @@ -36,27 +57,29 @@ async function runVite(configPath: string) { ` build -c ` + path.resolve(__dirname, configPath) + ` --emptyOutDir --outDir ${outDir}` - await exec(command) + await exec(command, path.dirname(path.resolve(__dirname, configPath))) return await import(path.resolve(outDir, "bundle.js")) } -function exec(cmd: string) { - const _options = { - env: process.env, - } +function exec(cmd: string, cwd: string) { return new Promise((resolve, reject) => { - _exec(cmd, _options, (error, stdout, stderr) => { - stdout = stdout.trim() - stderr = stderr.trim() - - if (error === null) { - resolve({ stdout, stderr }) - } else { - reject({ error, stdout, stderr }) - console.error(stdout) - console.error(stderr) + _exec( + cmd, + { + env: process.env, + cwd, + }, + (error, stdout, stderr) => { + stdout = stdout.trim() + stderr = stderr.trim() + + if (error === null) { + resolve({ stdout, stderr }) + } else { + reject({ error, stdout, stderr }) + } } - }) + ) }) } diff --git a/packages/vite-plugin/test/macro-usage/.linguirc b/packages/vite-plugin/test/macro-usage/.linguirc new file mode 100644 index 000000000..67cebe732 --- /dev/null +++ b/packages/vite-plugin/test/macro-usage/.linguirc @@ -0,0 +1,10 @@ +{ + "locales": ["en"], + "catalogs": [{ + "path": "/locale/{locale}" + }], + "fallbackLocales": { + "default": "en" + }, + "format": "po" +} diff --git a/packages/vite-plugin/test/macro-usage/entrypoint.js b/packages/vite-plugin/test/macro-usage/entrypoint.js new file mode 100644 index 000000000..89c945333 --- /dev/null +++ b/packages/vite-plugin/test/macro-usage/entrypoint.js @@ -0,0 +1,5 @@ +import { t } from "@lingui/macro" + +export async function load() { + return t`Ola` +} diff --git a/packages/vite-plugin/test/macro-usage/locale/en.po b/packages/vite-plugin/test/macro-usage/locale/en.po new file mode 100644 index 000000000..b4612b13a --- /dev/null +++ b/packages/vite-plugin/test/macro-usage/locale/en.po @@ -0,0 +1,5 @@ +msgid "Hello World" +msgstr "Hello World" + +msgid "My name is {name}" +msgstr "My name is {name}" diff --git a/packages/vite-plugin/test/macro-usage/vite.config.ts b/packages/vite-plugin/test/macro-usage/vite.config.ts new file mode 100644 index 000000000..109143573 --- /dev/null +++ b/packages/vite-plugin/test/macro-usage/vite.config.ts @@ -0,0 +1,11 @@ +import { createDefaultViteConfig } from "../default-vite.config" +import { UserConfig } from "vite" +import macrosPlugin from "vite-plugin-babel-macros" + +const config: UserConfig = { + ...createDefaultViteConfig(__dirname), +} + +config.plugins.push(macrosPlugin()) + +export default config diff --git a/packages/vite-plugin/test/no-macro-error/.linguirc b/packages/vite-plugin/test/no-macro-error/.linguirc new file mode 100644 index 000000000..67cebe732 --- /dev/null +++ b/packages/vite-plugin/test/no-macro-error/.linguirc @@ -0,0 +1,10 @@ +{ + "locales": ["en"], + "catalogs": [{ + "path": "/locale/{locale}" + }], + "fallbackLocales": { + "default": "en" + }, + "format": "po" +} diff --git a/packages/vite-plugin/test/no-macro-error/entrypoint.js b/packages/vite-plugin/test/no-macro-error/entrypoint.js new file mode 100644 index 000000000..89c945333 --- /dev/null +++ b/packages/vite-plugin/test/no-macro-error/entrypoint.js @@ -0,0 +1,5 @@ +import { t } from "@lingui/macro" + +export async function load() { + return t`Ola` +} diff --git a/packages/vite-plugin/test/no-macro-error/locale/en.po b/packages/vite-plugin/test/no-macro-error/locale/en.po new file mode 100644 index 000000000..b4612b13a --- /dev/null +++ b/packages/vite-plugin/test/no-macro-error/locale/en.po @@ -0,0 +1,5 @@ +msgid "Hello World" +msgstr "Hello World" + +msgid "My name is {name}" +msgstr "My name is {name}" diff --git a/packages/vite-plugin/test/no-macro-error/vite.config.ts b/packages/vite-plugin/test/no-macro-error/vite.config.ts new file mode 100644 index 000000000..79c9d71c6 --- /dev/null +++ b/packages/vite-plugin/test/no-macro-error/vite.config.ts @@ -0,0 +1,3 @@ +import { createDefaultViteConfig } from "../default-vite.config" + +export default createDefaultViteConfig(__dirname) diff --git a/yarn.lock b/yarn.lock index e82109dd1..9142f9553 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,6 +33,15 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/code-frame@npm:7.22.5" + dependencies: + "@babel/highlight": ^7.22.5 + checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.17.7, @babel/compat-data@npm:^7.20.1, @babel/compat-data@npm:^7.20.5": version: 7.20.10 resolution: "@babel/compat-data@npm:7.20.10" @@ -40,6 +49,13 @@ __metadata: languageName: node linkType: hard +"@babel/compat-data@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/compat-data@npm:7.22.5" + checksum: eb1a47ebf79ae268b4a16903e977be52629339806e248455eb9973897c503a04b701f36a9de64e19750d6e081d0561e77a514c8dc470babbeba59ae94298ed18 + languageName: node + linkType: hard + "@babel/core@npm:7.20.12, @babel/core@npm:^7.12.3, @babel/core@npm:^7.20.12": version: 7.20.12 resolution: "@babel/core@npm:7.20.12" @@ -86,6 +102,29 @@ __metadata: languageName: node linkType: hard +"@babel/core@npm:^7.17.7": + version: 7.22.5 + resolution: "@babel/core@npm:7.22.5" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.22.5 + "@babel/generator": ^7.22.5 + "@babel/helper-compilation-targets": ^7.22.5 + "@babel/helper-module-transforms": ^7.22.5 + "@babel/helpers": ^7.22.5 + "@babel/parser": ^7.22.5 + "@babel/template": ^7.22.5 + "@babel/traverse": ^7.22.5 + "@babel/types": ^7.22.5 + convert-source-map: ^1.7.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.2 + semver: ^6.3.0 + checksum: 173ae426958c90c7bbd7de622c6f13fcab8aef0fac3f138e2d47bc466d1cd1f86f71ca82ae0acb9032fd8794abed8efb56fea55c031396337eaec0d673b69d56 + languageName: node + linkType: hard + "@babel/generator@npm:^7.20.7": version: 7.20.7 resolution: "@babel/generator@npm:7.20.7" @@ -109,6 +148,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/generator@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + "@jridgewell/gen-mapping": ^0.3.2 + "@jridgewell/trace-mapping": ^0.3.17 + jsesc: ^2.5.1 + checksum: efa64da70ca88fe69f05520cf5feed6eba6d30a85d32237671488cc355fdc379fe2c3246382a861d49574c4c2f82a317584f8811e95eb024e365faff3232b49d + 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" @@ -143,6 +194,21 @@ __metadata: languageName: node linkType: hard +"@babel/helper-compilation-targets@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-compilation-targets@npm:7.22.5" + dependencies: + "@babel/compat-data": ^7.22.5 + "@babel/helper-validator-option": ^7.22.5 + browserslist: ^4.21.3 + lru-cache: ^5.1.1 + semver: ^6.3.0 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: a479460615acffa0f4fd0a29b740eafb53a93694265207d23a6038ccd18d183a382cacca515e77b7c9b042c3ba80b0aca0da5f1f62215140e81660d2cf721b68 + languageName: node + linkType: hard + "@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.20.12, @babel/helper-create-class-features-plugin@npm:^7.20.5, @babel/helper-create-class-features-plugin@npm:^7.20.7": version: 7.20.12 resolution: "@babel/helper-create-class-features-plugin@npm:7.20.12" @@ -196,6 +262,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-environment-visitor@npm:7.22.5" + checksum: 248532077d732a34cd0844eb7b078ff917c3a8ec81a7f133593f71a860a582f05b60f818dc5049c2212e5baa12289c27889a4b81d56ef409b4863db49646c4b1 + languageName: node + linkType: hard + "@babel/helper-explode-assignable-expression@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-explode-assignable-expression@npm:7.18.6" @@ -225,6 +298,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-function-name@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-function-name@npm:7.22.5" + dependencies: + "@babel/template": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: 6b1f6ce1b1f4e513bf2c8385a557ea0dd7fa37971b9002ad19268ca4384bbe90c09681fe4c076013f33deabc63a53b341ed91e792de741b4b35e01c00238177a + languageName: node + linkType: hard + "@babel/helper-hoist-variables@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-hoist-variables@npm:7.18.6" @@ -234,6 +317,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-hoist-variables@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-hoist-variables@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 394ca191b4ac908a76e7c50ab52102669efe3a1c277033e49467913c7ed6f7c64d7eacbeabf3bed39ea1f41731e22993f763b1edce0f74ff8563fd1f380d92cc + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.20.7": version: 7.20.7 resolution: "@babel/helper-member-expression-to-functions@npm:7.20.7" @@ -252,6 +344,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-module-imports@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 9ac2b0404fa38b80bdf2653fbeaf8e8a43ccb41bd505f9741d820ed95d3c4e037c62a1bcdcb6c9527d7798d2e595924c4d025daed73283badc180ada2c9c49ad + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.18.6, @babel/helper-module-transforms@npm:^7.20.11": version: 7.20.11 resolution: "@babel/helper-module-transforms@npm:7.20.11" @@ -284,6 +385,22 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-module-transforms@npm:7.22.5" + dependencies: + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-module-imports": ^7.22.5 + "@babel/helper-simple-access": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.5 + "@babel/template": ^7.22.5 + "@babel/traverse": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: 8985dc0d971fd17c467e8b84fe0f50f3dd8610e33b6c86e5b3ca8e8859f9448bcc5c84e08a2a14285ef388351c0484797081c8f05a03770bf44fc27bf4900e68 + 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" @@ -300,6 +417,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-plugin-utils@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-plugin-utils@npm:7.22.5" + checksum: c0fc7227076b6041acd2f0e818145d2e8c41968cc52fb5ca70eed48e21b8fe6dd88a0a91cbddf4951e33647336eb5ae184747ca706817ca3bef5e9e905151ff5 + languageName: node + linkType: hard + "@babel/helper-remap-async-to-generator@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-remap-async-to-generator@npm:7.18.9" @@ -337,6 +461,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-simple-access@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: fe9686714caf7d70aedb46c3cce090f8b915b206e09225f1e4dbc416786c2fdbbee40b38b23c268b7ccef749dd2db35f255338fb4f2444429874d900dede5ad2 + 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" @@ -355,6 +488,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-split-export-declaration@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-split-export-declaration@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: d10e05a02f49c1f7c578cea63d2ac55356501bbf58856d97ac9bfde4957faee21ae97c7f566aa309e38a256eef58b58e5b670a7f568b362c00e93dfffe072650 + languageName: node + linkType: hard + "@babel/helper-string-parser@npm:^7.19.4": version: 7.19.4 resolution: "@babel/helper-string-parser@npm:7.19.4" @@ -362,6 +504,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-string-parser@npm:7.22.5" + checksum: 836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 + 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" @@ -369,6 +518,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-validator-identifier@npm:7.22.5" + checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.18.6": version: 7.18.6 resolution: "@babel/helper-validator-option@npm:7.18.6" @@ -376,6 +532,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-option@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-validator-option@npm:7.22.5" + checksum: bbeca8a85ee86990215c0424997438b388b8d642d69b9f86c375a174d3cdeb270efafd1ff128bc7a1d370923d13b6e45829ba8581c027620e83e3a80c5c414b3 + 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" @@ -410,6 +573,17 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helpers@npm:7.22.5" + dependencies: + "@babel/template": ^7.22.5 + "@babel/traverse": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: a96e785029dff72f171190943df895ab0f76e17bf3881efd630bc5fae91215042d1c2e9ed730e8e4adf4da6f28b24bd1f54ed93b90ffbca34c197351872a084e + 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" @@ -421,6 +595,17 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/highlight@npm:7.22.5" + dependencies: + "@babel/helper-validator-identifier": ^7.22.5 + chalk: ^2.0.0 + js-tokens: ^4.0.0 + checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 + languageName: node + linkType: hard + "@babel/parser@npm:7.20.15": version: 7.20.15 resolution: "@babel/parser@npm:7.20.15" @@ -457,6 +642,15 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/parser@npm:7.22.5" + bin: + parser: ./bin/babel-parser.js + checksum: 470ebba516417ce8683b36e2eddd56dcfecb32c54b9bb507e28eb76b30d1c3e618fd0cfeee1f64d8357c2254514e1a19e32885cfb4e73149f4ae875436a6d59c + 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" @@ -769,6 +963,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-jsx@npm:^7.16.7": + version: 7.22.5 + resolution: "@babel/plugin-syntax-jsx@npm:7.22.5" + dependencies: + "@babel/helper-plugin-utils": ^7.22.5 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 8829d30c2617ab31393d99cec2978e41f014f4ac6f01a1cecf4c4dd8320c3ec12fdc3ce121126b2d8d32f6887e99ca1a0bad53dedb1e6ad165640b92b24980ce + languageName: node + linkType: hard + "@babel/plugin-syntax-jsx@npm:^7.18.6, @babel/plugin-syntax-jsx@npm:^7.7.2": version: 7.18.6 resolution: "@babel/plugin-syntax-jsx@npm:7.18.6" @@ -868,6 +1073,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-typescript@npm:^7.16.7": + version: 7.22.5 + resolution: "@babel/plugin-syntax-typescript@npm:7.22.5" + dependencies: + "@babel/helper-plugin-utils": ^7.22.5 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 8ab7718fbb026d64da93681a57797d60326097fd7cb930380c8bffd9eb101689e90142c760a14b51e8e69c88a73ba3da956cb4520a3b0c65743aee5c71ef360a + languageName: node + linkType: hard + "@babel/plugin-syntax-typescript@npm:^7.20.0, @babel/plugin-syntax-typescript@npm:^7.7.2": version: 7.20.0 resolution: "@babel/plugin-syntax-typescript@npm:7.20.0" @@ -1485,6 +1701,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/template@npm:7.22.5" + dependencies: + "@babel/code-frame": ^7.22.5 + "@babel/parser": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: c5746410164039aca61829cdb42e9a55410f43cace6f51ca443313f3d0bdfa9a5a330d0b0df73dc17ef885c72104234ae05efede37c1cc8a72dc9f93425977a3 + languageName: node + linkType: hard + "@babel/traverse@npm:7.20.12": version: 7.20.12 resolution: "@babel/traverse@npm:7.20.12" @@ -1539,6 +1766,24 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/traverse@npm:7.22.5" + dependencies: + "@babel/code-frame": ^7.22.5 + "@babel/generator": ^7.22.5 + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-function-name": ^7.22.5 + "@babel/helper-hoist-variables": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.5 + "@babel/parser": ^7.22.5 + "@babel/types": ^7.22.5 + debug: ^4.1.0 + globals: ^11.1.0 + checksum: 560931422dc1761f2df723778dcb4e51ce0d02e560cf2caa49822921578f49189a5a7d053b78a32dca33e59be886a6b2200a6e24d4ae9b5086ca0ba803815694 + languageName: node + linkType: hard + "@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.19.0, @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.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.7.0": version: 7.20.7 resolution: "@babel/types@npm:7.20.7" @@ -1561,6 +1806,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/types@npm:7.22.5" + dependencies: + "@babel/helper-string-parser": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.5 + to-fast-properties: ^2.0.0 + checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892 + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^0.2.3": version: 0.2.3 resolution: "@bcoe/v8-coverage@npm:0.2.3" @@ -2817,7 +3073,7 @@ __metadata: languageName: unknown linkType: soft -"@lingui/macro@4.2.1, @lingui/macro@workspace:packages/macro": +"@lingui/macro@4.2.1, @lingui/macro@workspace:^, @lingui/macro@workspace:packages/macro": version: 0.0.0-use.local resolution: "@lingui/macro@workspace:packages/macro" dependencies: @@ -2895,8 +3151,10 @@ __metadata: "@lingui/cli": 4.2.1 "@lingui/conf": 4.2.1 "@lingui/format-json": "workspace:^" + "@lingui/macro": "workspace:^" unbuild: ^1.1.2 vite: 4.1.4 + vite-plugin-babel-macros: ^1.0.6 peerDependencies: vite: 3 - 4 languageName: unknown @@ -3807,6 +4065,19 @@ __metadata: languageName: node linkType: hard +"@types/babel__core@npm:^7.1.18": + version: 7.20.1 + resolution: "@types/babel__core@npm:7.20.1" + dependencies: + "@babel/parser": ^7.20.7 + "@babel/types": ^7.20.7 + "@types/babel__generator": "*" + "@types/babel__template": "*" + "@types/babel__traverse": "*" + checksum: 9fcd9691a33074802d9057ff70b0e3ff3778f52470475b68698a0f6714fbe2ccb36c16b43dc924eb978cd8a81c1f845e5ff4699e7a47606043b539eb8c6331a8 + languageName: node + linkType: hard + "@types/babel__generator@npm:*": version: 7.6.4 resolution: "@types/babel__generator@npm:7.6.4" @@ -5125,7 +5396,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-macros@npm:^3.0.1": +"babel-plugin-macros@npm:^3.0.1, babel-plugin-macros@npm:^3.1.0": version: 3.1.0 resolution: "babel-plugin-macros@npm:3.1.0" dependencies: @@ -14635,6 +14906,21 @@ __metadata: languageName: node linkType: hard +"vite-plugin-babel-macros@npm:^1.0.6": + version: 1.0.6 + resolution: "vite-plugin-babel-macros@npm:1.0.6" + dependencies: + "@babel/core": ^7.17.7 + "@babel/plugin-syntax-jsx": ^7.16.7 + "@babel/plugin-syntax-typescript": ^7.16.7 + "@types/babel__core": ^7.1.18 + babel-plugin-macros: ^3.1.0 + peerDependencies: + vite: ">=2" + checksum: 577d3d99b4b088b83adffab656461d0d00618afe7d2e64972077e6b15fd221df92c6278bdfce586a380954159e6c0886658d086df26a6748e65b28e1c9923a40 + languageName: node + linkType: hard + "vite@npm:4.1.4": version: 4.1.4 resolution: "vite@npm:4.1.4"