@regardio/js 0.7.2 → 0.7.4

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.
Files changed (2) hide show
  1. package/dist/intl/index.d.mts +25 -25
  2. package/package.json +21 -22
@@ -3,11 +3,10 @@ import { Cookie, SessionStorage } from "react-router";
3
3
  //#region src/intl/language-detector.d.ts
4
4
  interface LanguageDetectorOption {
5
5
  /**
6
- * Define the list of supported languages, this is used to determine if one of
7
- * the languages requested by the user is supported by the application.
8
- * This should be be same as the supportedLngs in the i18next options.
6
+ * If you want to use a cookie to store the user preferred language, you can
7
+ * pass the Cookie object here.
9
8
  */
10
- supportedLanguages: string[];
9
+ cookie?: Cookie;
11
10
  /**
12
11
  * Define the fallback language that it's going to be used in the case user
13
12
  * expected language is not supported.
@@ -15,16 +14,23 @@ interface LanguageDetectorOption {
15
14
  */
16
15
  fallbackLanguage: string;
17
16
  /**
18
- * If you want to use a cookie to store the user preferred language, you can
19
- * pass the Cookie object here.
17
+ * The order the library will use to detect the user preferred language.
18
+ * By default the order is
19
+ * - urlPath (first segment like /de/ or /en/)
20
+ * - cookie
21
+ * - session
22
+ * - searchParams
23
+ * - header
24
+ * And finally the fallback language.
20
25
  */
21
- cookie?: Cookie;
26
+ order?: Array<"urlPath" | "searchParams" | "cookie" | "session" | "header">;
22
27
  /**
23
- * If you want to use a session to store the user preferred language, you can
24
- * pass the SessionStorage object here.
25
- * When this is not defined, getting the locale will ignore the session.
28
+ * If you want to use search parameters for language detection and want to
29
+ * change the default key used to for the parameter name,
30
+ * you can pass the key here.
31
+ * @default "lng"
26
32
  */
27
- sessionStorage?: SessionStorage;
33
+ searchParamKey?: string;
28
34
  /**
29
35
  * If defined a sessionStorage and want to change the default key used to
30
36
  * store the user preferred language, you can pass the key here.
@@ -32,23 +38,17 @@ interface LanguageDetectorOption {
32
38
  */
33
39
  sessionKey?: string;
34
40
  /**
35
- * If you want to use search parameters for language detection and want to
36
- * change the default key used to for the parameter name,
37
- * you can pass the key here.
38
- * @default "lng"
41
+ * If you want to use a session to store the user preferred language, you can
42
+ * pass the SessionStorage object here.
43
+ * When this is not defined, getting the locale will ignore the session.
39
44
  */
40
- searchParamKey?: string;
45
+ sessionStorage?: SessionStorage;
41
46
  /**
42
- * The order the library will use to detect the user preferred language.
43
- * By default the order is
44
- * - urlPath (first segment like /de/ or /en/)
45
- * - cookie
46
- * - session
47
- * - searchParams
48
- * - header
49
- * And finally the fallback language.
47
+ * Define the list of supported languages, this is used to determine if one of
48
+ * the languages requested by the user is supported by the application.
49
+ * This should be be same as the supportedLngs in the i18next options.
50
50
  */
51
- order?: Array<"urlPath" | "searchParams" | "cookie" | "session" | "header">;
51
+ supportedLanguages: string[];
52
52
  }
53
53
  interface LanguageDetectorLinguiOptions {
54
54
  detection: LanguageDetectorOption;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "@regardio/js",
4
- "version": "0.7.2",
4
+ "version": "0.7.4",
5
5
  "private": false,
6
6
  "description": "Regardio JavaScript utilities",
7
7
  "keywords": [
@@ -28,42 +28,40 @@
28
28
  "type": "module",
29
29
  "exports": {
30
30
  "./assert": {
31
- "types": "./dist/assert/index.d.mts",
32
- "import": "./dist/assert/index.mjs"
31
+ "import": "./dist/assert/index.mjs",
32
+ "types": "./dist/assert/index.d.mts"
33
33
  },
34
34
  "./encoding": {
35
- "types": "./dist/encoding/index.d.mts",
36
- "import": "./dist/encoding/index.mjs"
35
+ "import": "./dist/encoding/index.mjs",
36
+ "types": "./dist/encoding/index.d.mts"
37
37
  },
38
38
  "./http": {
39
- "types": "./dist/http/index.d.mts",
40
- "import": "./dist/http/index.mjs"
39
+ "import": "./dist/http/index.mjs",
40
+ "types": "./dist/http/index.d.mts"
41
41
  },
42
42
  "./intl": {
43
- "types": "./dist/intl/index.d.mts",
44
- "import": "./dist/intl/index.mjs"
43
+ "import": "./dist/intl/index.mjs",
44
+ "types": "./dist/intl/index.d.mts"
45
45
  },
46
46
  "./text": {
47
- "types": "./dist/text/index.d.mts",
48
- "import": "./dist/text/index.mjs"
47
+ "import": "./dist/text/index.mjs",
48
+ "types": "./dist/text/index.d.mts"
49
49
  },
50
50
  "./time": {
51
- "types": "./dist/time/index.d.mts",
52
- "import": "./dist/time/index.mjs"
51
+ "import": "./dist/time/index.mjs",
52
+ "types": "./dist/time/index.d.mts"
53
53
  }
54
54
  },
55
- "files": [
56
- "dist"
57
- ],
55
+ "files": ["dist"],
58
56
  "scripts": {
59
- "build": "tsdown && pnpm fix",
57
+ "build": "exec-s tsdown fix",
60
58
  "clean": "exec-clean .turbo dist",
61
59
  "dev": "tsdown --watch",
62
- "fix": "exec-p fix:*",
60
+ "fix": "exec-s fix:pkg fix:md fix:biome",
63
61
  "fix:biome": "lint-biome check --write --unsafe .",
64
62
  "fix:md": "lint-md --fix",
65
63
  "fix:pkg": "lint-package --fix",
66
- "lint": "exec-p lint:*",
64
+ "lint": "exec-s lint:md lint:biome",
67
65
  "lint:biome": "lint-biome check .",
68
66
  "lint:md": "lint-md",
69
67
  "lint:pkg": "lint-package",
@@ -72,6 +70,7 @@
72
70
  "report": "vitest run --coverage",
73
71
  "test": "exec-s test:*",
74
72
  "test:unit": "vitest run",
73
+ "tsdown": "tsdown",
75
74
  "typecheck": "exec-tsc --noEmit",
76
75
  "version": "flow-changeset version"
77
76
  },
@@ -80,12 +79,12 @@
80
79
  "react-router": "7.13.0"
81
80
  },
82
81
  "devDependencies": {
83
- "@regardio/dev": "1.13.2",
82
+ "@regardio/dev": "1.13.8",
84
83
  "@total-typescript/ts-reset": "0.6.1",
85
- "@types/node": "25.1.0",
84
+ "@types/node": "25.3.0",
86
85
  "@vitest/coverage-v8": "4.0.18",
87
86
  "@vitest/ui": "4.0.18",
88
- "tsdown": "0.20.1",
87
+ "tsdown": "0.20.3",
89
88
  "vitest": "4.0.18"
90
89
  },
91
90
  "publishConfig": {