@lingui/swc-plugin 6.4.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # <div align="center">A SWC Plugin For LinguiJS</div>
1
+ # <div align="center">SWC Plugin For Lingui</div>
2
2
 
3
3
  <div align="center">
4
4
 
5
- A Rust version of [LinguiJS Macro](https://lingui.dev/ref/macro) [<img src="https://img.shields.io/badge/beta-yellow"/>](https://github.com/lingui/swc-plugin)
5
+ A Rust version of [Lingui Macro](https://lingui.dev/ref/macro) [<img src="https://img.shields.io/badge/beta-yellow"/>](https://github.com/lingui/swc-plugin)
6
6
 
7
7
  [![npm](https://img.shields.io/npm/v/@lingui/swc-plugin?logo=npm&cacheSeconds=1800)](https://www.npmjs.com/package/@lingui/swc-plugin)
8
8
  [![npm](https://img.shields.io/npm/dt/@lingui/swc-plugin?cacheSeconds=500)](https://www.npmjs.com/package/@lingui/swc-plugin)
9
- [![CI](https://github.com/lingui/swc-plugin/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/lingui/swc-plugin/actions/workflows/ci.yml)
9
+ [![CI](https://github.com/lingui/swc-plugin/actions/workflows/ci-macro.yml/badge.svg?branch=main)](https://github.com/lingui/swc-plugin/actions/workflows/ci-macro.yml)
10
10
  [![codecov](https://codecov.io/gh/lingui/swc-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/lingui/swc-plugin)
11
11
  [![GitHub contributors](https://img.shields.io/github/contributors/lingui/swc-plugin?cacheSeconds=1000)](https://github.com/lingui/swc-plugin/graphs/contributors)
12
12
  [![GitHub](https://img.shields.io/github/license/lingui/swc-plugin)](https://github.com/lingui/swc-plugin/blob/main/LICENSE)
@@ -11,10 +11,10 @@ export type LinguiMacroOptions = {
11
11
  /** Default placeholder names for JSX tags when no explicit placeholder attribute is present. */
12
12
  jsxPlaceholderDefaults?: Record<string, string>;
13
13
  /** Overrides the runtime imports used by the plugin. Unlike the Babel macro configuration, must be passed as an object. */
14
- runtimeModules: {
15
- i18n: RuntimeModuleConfig;
16
- Trans: RuntimeModuleConfig;
17
- useLingui: RuntimeModuleConfig;
14
+ runtimeModules?: {
15
+ i18n?: RuntimeModuleConfig;
16
+ Trans?: RuntimeModuleConfig;
17
+ useLingui?: RuntimeModuleConfig;
18
18
  };
19
19
  /**
20
20
  * Compatibility option for using the v6 SWC plugin with `@lingui/cli@5.*`.
@@ -34,6 +34,14 @@ export type LinguiMacroOptions = {
34
34
  descriptorFields?: 'auto' | 'all' | 'id-only' | 'message';
35
35
  /** Restricts directive-based `idPrefix` to explicit ids starting with this leader string. When omitted, `idPrefix` is prepended to all explicit static ids. */
36
36
  idPrefixLeader?: string;
37
+ /**
38
+ * Emits the extraction marker as a JSDoc comment (`/** i18n *\/`) instead of a regular block comment (`/* i18n *\/`).
39
+ * JSDoc comments survive bundler code generation (e.g. Rolldown), ensuring the extractor can still locate messages in bundled output.
40
+ *
41
+ * - `false` (default) — `/* i18n *\/` (compatible with all `@lingui/cli` versions).
42
+ * - `true` — `/** i18n *\/` (requires `@lingui/cli` >= 6.4.0).
43
+ */
44
+ useJsdocI18nComment?: boolean;
37
45
  };
38
46
  /** Makes all properties in `T` optional, recursing into nested objects but preserving tuples/arrays as-is. */
39
47
  export type DeepPartial<T> = {
package/dist/options.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { DeepPartial, LinguiMacroOptions } from "./map-options";
2
- export type { RuntimeModuleConfig, LinguiMacroOptions } from "./map-options";
3
- export { mapOptions } from "./map-options";
1
+ import { DeepPartial, LinguiMacroOptions } from "./map-options.js";
2
+ export type { RuntimeModuleConfig, LinguiMacroOptions } from "./map-options.js";
3
+ export { mapOptions } from "./map-options.js";
4
4
  /** Controls how the Lingui config is located and loaded. */
5
5
  export type GetConfigOptions = {
6
6
  /** Working directory for config discovery. Defaults to `process.cwd()`. */
package/dist/options.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getConfig } from "@lingui/conf";
2
- import { mapOptions } from "./map-options";
3
- export { mapOptions } from "./map-options";
2
+ import { mapOptions } from "./map-options.js";
3
+ export { mapOptions } from "./map-options.js";
4
4
  /**
5
5
  * Loads the Lingui config, maps relevant options to the SWC plugin format,
6
6
  * and returns a ready-to-use `["@lingui/swc-plugin", options]` tuple.
package/lingui_macro.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@lingui/swc-plugin",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "description": "A SWC Plugin for LinguiJS",
5
5
  "author": {
6
6
  "name": "Timofei Iatsenko",
7
7
  "email": "timiatsenko@gmail.com"
8
8
  },
9
- "repository": "lingui/swc-plugin",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/lingui/swc-plugin.git",
12
+ "directory": "packages/lingui-macro"
13
+ },
10
14
  "type": "module",
11
15
  "bugs": "https://github.com/lingui/swc-plugin/issues",
12
16
  "license": "MIT",