anylang-dev 0.1.2 → 0.1.3

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
@@ -86,7 +86,7 @@ anylang translate
86
86
  "exclude": ["node_modules", ".git", "dist", "build", ".next"],
87
87
  "outDir": "locales",
88
88
  "runtime": {
89
- "output": "anylang.ts",
89
+ "output": "src/anylang.ts",
90
90
  "importFrom": "anylang-dev/runtime"
91
91
  },
92
92
  "functionName": "$tr",
@@ -151,7 +151,8 @@ locales/
151
151
  en.json
152
152
  hi.json
153
153
  anylang.lock.json
154
- anylang.ts
154
+ src/
155
+ anylang.ts
155
156
  ```
156
157
 
157
158
  The lock file stores SHA-256 fingerprints so unchanged strings are skipped on later runs.
@@ -171,7 +172,7 @@ anylang scan
171
172
  ```
172
173
 
173
174
  This writes keyed source entries to `locales/en.json` and creates placeholder entries in each target locale.
174
- It also generates `anylang.ts`, which imports all locale JSON files and exports runtime helpers.
175
+ It also generates `src/anylang.ts`, which imports all locale JSON files and exports runtime helpers.
175
176
 
176
177
  3. Translate with Gemini:
177
178
 
@@ -220,7 +221,7 @@ import {
220
221
  useLanguage,
221
222
  useTr,
222
223
  type LanguageCode
223
- } from "./anylang";
224
+ } from "@/anylang";
224
225
  ```
225
226
 
226
227
  You do not manually import `en.json`, `hi.json`, `ja.json`, etc. The generated file does that for you based on `sourceLocale` and `targetLocales`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anylang-dev",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Bring-your-own-key website translation JSON generator.",
5
5
  "type": "module",
6
6
  "files": [
package/src/config.js CHANGED
@@ -8,7 +8,7 @@ export const DEFAULT_CONFIG = {
8
8
  exclude: ["node_modules", ".git", "dist", "build", ".next"],
9
9
  outDir: "locales",
10
10
  runtime: {
11
- output: "anylang.ts",
11
+ output: "src/anylang.ts",
12
12
  importFrom: "anylang-dev/runtime"
13
13
  },
14
14
  functionName: "$tr",
package/src/pipeline.js CHANGED
@@ -131,7 +131,7 @@ function normalizeTargetEntry(entry) {
131
131
  async function writeGeneratedRuntime(config) {
132
132
  if (config.runtime === false) return;
133
133
 
134
- const output = path.resolve(config.runtime?.output || "anylang.ts");
134
+ const output = path.resolve(config.runtime?.output || "src/anylang.ts");
135
135
  const outDir = path.resolve(config.outDir);
136
136
  const locales = [config.sourceLocale, ...config.targetLocales.filter((locale) => locale !== config.sourceLocale)];
137
137
  const importFrom = config.runtime?.importFrom || "anylang-dev/runtime";