ai-localize-config 2.0.6 → 2.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # ai-localize-config
2
2
 
3
+ ## 2.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Added `ignoreTextPatterns: z.array(z.string()).default([])` to `LocalizationConfigSchema`.
8
+ - Added `repository`, `homepage`, `bugs`, `author` fields to `package.json` for npm registry display.
9
+ - Added `sideEffects: false` to enable tree-shaking in bundlers.
10
+ - Added `prepublishOnly` script to ensure the package is built before publishing.
11
+
3
12
  ## 2.0.6
4
13
 
5
14
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 ai-localize-core contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.mts CHANGED
@@ -124,6 +124,15 @@ declare const LocalizationConfigSchema: z.ZodObject<{
124
124
  * top level of the single per-language file.
125
125
  */
126
126
  staticKeys: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
127
+ /**
128
+ * Additional regex patterns (as strings) that mark a text value as
129
+ * non-translatable during scanning. Matched strings are excluded from
130
+ * locale extraction.
131
+ *
132
+ * Example:
133
+ * "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
134
+ */
135
+ ignoreTextPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
127
136
  }, "strip", z.ZodTypeAny, {
128
137
  framework: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown";
129
138
  defaultLanguage: string;
@@ -136,6 +145,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
136
145
  plugins: string[];
137
146
  localeStructure: "flat" | "nested";
138
147
  keyStyle: "path" | "screaming_snake";
148
+ ignoreTextPatterns: string[];
139
149
  keyPrefix?: string | undefined;
140
150
  namespaces?: string[] | undefined;
141
151
  includePatterns?: string[] | undefined;
@@ -188,6 +198,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
188
198
  localeStructure?: "flat" | "nested" | undefined;
189
199
  keyStyle?: "path" | "screaming_snake" | undefined;
190
200
  staticKeys?: Record<string, string> | undefined;
201
+ ignoreTextPatterns?: string[] | undefined;
191
202
  }>;
192
203
  type LocalizationConfigInput = z.input<typeof LocalizationConfigSchema>;
193
204
  type LocalizationConfigOutput = z.output<typeof LocalizationConfigSchema>;
package/dist/index.d.ts CHANGED
@@ -124,6 +124,15 @@ declare const LocalizationConfigSchema: z.ZodObject<{
124
124
  * top level of the single per-language file.
125
125
  */
126
126
  staticKeys: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
127
+ /**
128
+ * Additional regex patterns (as strings) that mark a text value as
129
+ * non-translatable during scanning. Matched strings are excluded from
130
+ * locale extraction.
131
+ *
132
+ * Example:
133
+ * "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
134
+ */
135
+ ignoreTextPatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
127
136
  }, "strip", z.ZodTypeAny, {
128
137
  framework: "react" | "react-cra" | "react-vite" | "react-nextjs" | "angular" | "angular-ngx" | "angular-i18n" | "vue" | "vue-i18n" | "jquery" | "vanilla-js" | "jsp" | "unknown";
129
138
  defaultLanguage: string;
@@ -136,6 +145,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
136
145
  plugins: string[];
137
146
  localeStructure: "flat" | "nested";
138
147
  keyStyle: "path" | "screaming_snake";
148
+ ignoreTextPatterns: string[];
139
149
  keyPrefix?: string | undefined;
140
150
  namespaces?: string[] | undefined;
141
151
  includePatterns?: string[] | undefined;
@@ -188,6 +198,7 @@ declare const LocalizationConfigSchema: z.ZodObject<{
188
198
  localeStructure?: "flat" | "nested" | undefined;
189
199
  keyStyle?: "path" | "screaming_snake" | undefined;
190
200
  staticKeys?: Record<string, string> | undefined;
201
+ ignoreTextPatterns?: string[] | undefined;
191
202
  }>;
192
203
  type LocalizationConfigInput = z.input<typeof LocalizationConfigSchema>;
193
204
  type LocalizationConfigOutput = z.output<typeof LocalizationConfigSchema>;
package/dist/index.js CHANGED
@@ -150,7 +150,16 @@ var LocalizationConfigSchema = import_zod.z.object({
150
150
  * (translation.json / common.json). In flat mode they are merged at the
151
151
  * top level of the single per-language file.
152
152
  */
153
- staticKeys: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional()
153
+ staticKeys: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional(),
154
+ /**
155
+ * Additional regex patterns (as strings) that mark a text value as
156
+ * non-translatable during scanning. Matched strings are excluded from
157
+ * locale extraction.
158
+ *
159
+ * Example:
160
+ * "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
161
+ */
162
+ ignoreTextPatterns: import_zod.z.array(import_zod.z.string()).default([])
154
163
  });
155
164
 
156
165
  // src/loader.ts
package/dist/index.mjs CHANGED
@@ -111,7 +111,16 @@ var LocalizationConfigSchema = z.object({
111
111
  * (translation.json / common.json). In flat mode they are merged at the
112
112
  * top level of the single per-language file.
113
113
  */
114
- staticKeys: z.record(z.string(), z.string()).optional()
114
+ staticKeys: z.record(z.string(), z.string()).optional(),
115
+ /**
116
+ * Additional regex patterns (as strings) that mark a text value as
117
+ * non-translatable during scanning. Matched strings are excluded from
118
+ * locale extraction.
119
+ *
120
+ * Example:
121
+ * "ignoreTextPatterns": ["^MyBrand", "^theme-", "^data-"]
122
+ */
123
+ ignoreTextPatterns: z.array(z.string()).default([])
115
124
  });
116
125
 
117
126
  // src/loader.ts
package/package.json CHANGED
@@ -1,10 +1,22 @@
1
1
  {
2
2
  "name": "ai-localize-config",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "Configuration loader and schema validator for ai-localize-core",
5
+ "author": "ai-localize-core contributors",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/ai-localize/ai-localize-core.git",
10
+ "directory": "packages/config"
11
+ },
12
+ "homepage": "https://github.com/ai-localize/ai-localize-core/tree/main/packages/config#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/ai-localize/ai-localize-core/issues"
15
+ },
5
16
  "main": "./dist/index.js",
6
17
  "module": "./dist/index.mjs",
7
18
  "types": "./dist/index.d.ts",
19
+ "sideEffects": false,
8
20
  "files": [
9
21
  "dist",
10
22
  "README.md",
@@ -35,14 +47,13 @@
35
47
  "zod": "^3.22.4",
36
48
  "cosmiconfig": "^9.0.0",
37
49
  "dotenv": "^16.4.1",
38
- "ai-localize-shared": "2.0.6"
50
+ "ai-localize-shared": "2.0.7"
39
51
  },
40
52
  "devDependencies": {
41
53
  "tsup": "^8.0.1",
42
54
  "typescript": "^5.3.3",
43
55
  "vitest": "^1.2.1"
44
56
  },
45
- "license": "MIT",
46
57
  "publishConfig": {
47
58
  "access": "public"
48
59
  },