@havelaer/msgs 0.0.10 → 0.0.12

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.
@@ -5,7 +5,7 @@ import { MessageFormatOptions, MessagePart, Model } from "messageformat";
5
5
  /**
6
6
  * Valid argument values for message formatting.
7
7
  */
8
- type ArgValue = string | number | boolean | null | undefined;
8
+ type ArgValue<T = never> = string | number | boolean | T;
9
9
  /**
10
10
  * Represents a nested structure of messages for different locales.
11
11
  * Can be either a nested object with string keys or a flat object with locale keys.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { ArgValue, Formatter, Messages, createFormatter } from "./index-ChgITPMW.js";
1
+ import { ArgValue, Formatter, Messages, createFormatter } from "./index-CFo6Y2QT.js";
2
2
  export { ArgValue, Formatter, Messages, createFormatter };
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ArgValue, Formatter } from "./index-ChgITPMW.js";
2
- import { ReactNode } from "react";
1
+ import { ArgValue, Formatter } from "./index-CFo6Y2QT.js";
2
+ import { JSX, ReactNode } from "react";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/react/index.d.ts
@@ -12,7 +12,7 @@ type Translator = {
12
12
  /** Format a message to a string */
13
13
  (msg: any, args?: Record<string, ArgValue>): string;
14
14
  /** Format a message to JSX elements, used for messages with markup */
15
- jsx(msg: any, args?: Record<string, ArgValue>): ReactNode;
15
+ jsx(msg: any, args?: Record<string, ArgValue<JSX.ElementType>>): ReactNode;
16
16
  /** Current locale string */
17
17
  locale: string;
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@havelaer/msgs",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
24
- "url": "https://github.com/havelaer/msgs.git"
24
+ "url": "git+https://github.com/havelaer/msgs.git"
25
25
  },
26
26
  "keywords": [
27
27
  "messageformat",
@@ -34,10 +34,9 @@
34
34
  ],
35
35
  "scripts": {
36
36
  "check": "biome check .",
37
- "prepublishOnly": "npm run check && npm run build && npm version patch -m 'chore: publishing version %s'",
37
+ "release": "npm run check && tsc && npm version patch -m 'chore: bump version %s'",
38
38
  "build": "tsdown",
39
- "test": "vitest run",
40
- "test:watch": "vitest watch"
39
+ "test": "vitest"
41
40
  },
42
41
  "files": [
43
42
  "dist"
@@ -54,7 +53,7 @@
54
53
  "@types/react": "^19.1.13",
55
54
  "@types/react-dom": "^19.1.9",
56
55
  "@vitest/coverage-v8": "^3.2.4",
57
- "happy-dom": "^18.0.1",
56
+ "happy-dom": "^19.0.1",
58
57
  "react": "^19.1.1",
59
58
  "react-dom": "^19.1.1",
60
59
  "tsdown": "^0.15.1",