ai-localize-config 2.0.5 → 2.0.6

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,12 @@
1
1
  # ai-localize-config
2
2
 
3
+ ## 2.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Add per-package README.md files so each package displays documentation on npmjs.com
8
+ - Update README version badge to 2.0.6
9
+
3
10
  ## 2.0.3
4
11
 
5
12
  ### Minor Changes
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # ai-localize-config
2
+
3
+ > Configuration loader and Zod schema validator for the [ai-localize-core](https://github.com/ai-localize/ai-localize-core) platform.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/ai-localize-config.svg)](https://www.npmjs.com/package/ai-localize-config)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+
8
+ ---
9
+
10
+ ## What it does
11
+
12
+ - Loads `ai-localize.config.json` (or `.js` / `.mjs` / `.cjs`) using **cosmiconfig**
13
+ - Validates the config against a **Zod schema** with full type inference
14
+ - Applies sensible defaults for all optional fields
15
+ - Exports typed `LocalizationConfig` for use across the platform
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install ai-localize-config
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```ts
26
+ import { loadConfig } from 'ai-localize-config';
27
+
28
+ const { config } = await loadConfig(process.cwd());
29
+ // config is a fully-validated, defaults-applied LocalizationConfig
30
+ ```
31
+
32
+ ## Config file formats
33
+
34
+ Any of these are auto-discovered:
35
+
36
+ ```
37
+ ai-localize.config.json
38
+ ai-localize.config.js
39
+ ai-localize.config.mjs
40
+ ai-localize.config.cjs
41
+ .ai-localizerc
42
+ .ai-localizerc.json
43
+ ```
44
+
45
+ ## Full config reference
46
+
47
+ ```json
48
+ {
49
+ "framework": "react-vite",
50
+ "defaultLanguage": "en",
51
+ "targetLanguages": ["fr", "de"],
52
+ "sourceDir": "src",
53
+ "localesDir": "locales",
54
+ "localeStructure": "nested",
55
+ "keyStyle": "path",
56
+ "staticKeys": {
57
+ "MAX_COUNT": "Max Count",
58
+ "ALLOWED": "Allowed"
59
+ },
60
+ "ignorePatterns": ["node_modules", "dist"],
61
+ "incrementalCache": true,
62
+ "cacheDir": ".ai-localize-cache",
63
+ "codemods": {
64
+ "importPackage": "react-i18next",
65
+ "hookName": "useTranslation",
66
+ "translationFunction": "t",
67
+ "accessorStyle": "function"
68
+ },
69
+ "aws": {
70
+ "region": "us-east-1",
71
+ "bucket": "my-bucket",
72
+ "distributionId": "E1ABCDEFGHIJKL"
73
+ }
74
+ }
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Part of ai-localize-core
80
+
81
+ Install the CLI for the complete toolset: `npm install -g ai-localize-cli`
82
+
83
+ MIT © ai-localize-core contributors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-localize-config",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "Configuration loader and schema validator for ai-localize-core",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -35,7 +35,7 @@
35
35
  "zod": "^3.22.4",
36
36
  "cosmiconfig": "^9.0.0",
37
37
  "dotenv": "^16.4.1",
38
- "ai-localize-shared": "2.0.5"
38
+ "ai-localize-shared": "2.0.6"
39
39
  },
40
40
  "devDependencies": {
41
41
  "tsup": "^8.0.1",