intor-cli 0.0.16 → 0.0.18

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
@@ -6,59 +6,56 @@
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-%E2%9C%94-blue?style=flat&colorA=000000&colorB=000000)](https://www.typescriptlang.org/)
7
7
  [![License](https://img.shields.io/npm/l/intor-cli?style=flat&colorA=000000&colorB=000000)](LICENSE)
8
8
 
9
- <table>
10
- <tr>
11
- <td align="center">
12
- <img src="generate-demo.gif" />
13
- </td>
14
- <td align="center">
15
- <img src="check-demo.gif" />
16
- </td>
17
- </tr>
18
- </table>
19
9
  </div>
20
10
 
21
11
  ## Overview
22
12
 
23
- - **generate** — message schema & types
24
- - **check** — usage analysis
25
- - **validate** — locale completeness
13
+ - **discover** — config discovery
14
+ - **generate** — schema and type generation
15
+ - **check** — static usage analysis
16
+ - **validate** — locale completeness validation
17
+
18
+ <img src='demo.gif' />
26
19
 
27
20
  ## Commands
28
21
 
29
- #### generate
22
+ Running `intor-cli` without a command launches the interactive menu.
23
+
24
+ ### Discover
25
+
26
+ ```bash
27
+ npx intor-cli discover
28
+ ```
29
+
30
+ Discovers Intor configs in the current workspace.
31
+
32
+ ### Generate
30
33
 
31
34
  ```bash
32
35
  npx intor-cli generate
33
36
  ```
34
37
 
35
- - Generates TypeScript types and schema artifacts
36
- - Uses the default locale as the single source of truth
37
- - Reports message override behavior during generation
38
+ Generates schemas and TypeScript types from the default locale.
38
39
 
39
- #### check
40
+ ### Check
40
41
 
41
42
  ```bash
42
43
  npx intor-cli check
43
44
  ```
44
45
 
45
- - Statistically analyzes translator usage in your codebase
46
- - Detects incorrect keys, replacements, and rich tag usage
47
- - Reports diagnostics with precise source locations
46
+ Analyzes translator usage and reports diagnostics.
48
47
 
49
- #### validate
48
+ ### Validate
50
49
 
51
50
  ```bash
52
51
  npx intor-cli validate
53
52
  ```
54
53
 
55
- - Validates locale message completeness against schemas
56
- - Checks missing keys, replacements, and rich tags
57
- - Reports issues grouped by config and locale
54
+ Validates locale messages against generated schemas.
55
+
56
+ ---
58
57
 
59
58
  ## Design Guarantees
60
59
 
61
- - Message types are inferred from the **_default locale_** only.
60
+ - Schemas and types are inferred **only from the default locale**.
62
61
  - All locales are expected to share the same message shape.
63
- - Locale is treated strictly as a runtime dimension, not a structural one.
64
- - Generated types are intentionally conservative and do not enforce locale completeness.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intor-cli",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "The Intor CLI",
5
5
  "author": "Yiming Liao",
6
6
  "homepage": "https://github.com/yiming-liao/intor-cli#readme",
@@ -46,7 +46,7 @@
46
46
  "@intor/reader-yaml": "^0.1.1",
47
47
  "cac": "6.7.14",
48
48
  "fast-glob": "3.3.3",
49
- "intor": "2.3.26",
49
+ "intor": "^2.3.35",
50
50
  "logry": "2.1.6",
51
51
  "ora": "9.0.0",
52
52
  "picocolors": "1.1.1",
@@ -2,7 +2,7 @@ import type { CliOption } from "./options";
2
2
  import type { CAC } from "cac";
3
3
  import { features } from "../../constants";
4
4
  import { generate } from "../../features";
5
- import { version } from "../version";
5
+ import { VERSION } from "../version";
6
6
  import { options } from "./options";
7
7
  import { normalizeMessageFiles } from "./utils/normalize-message-files";
8
8
  import { normalizeReaderOptions } from "./utils/normalize-reader-options";
@@ -44,7 +44,7 @@ export function registerGenerateCommand(cli: CAC) {
44
44
  messageSource: result,
45
45
  exts,
46
46
  customReaders,
47
- toolVersion: version,
47
+ toolVersion: VERSION,
48
48
  });
49
49
  } catch (error) {
50
50
  console.error(error instanceof Error ? error.message : error);
package/src/cli/index.ts CHANGED
@@ -8,8 +8,7 @@ import {
8
8
  registerValidateCommand,
9
9
  } from "./commands";
10
10
  import { run } from "./menu";
11
-
12
- const VERSION = "0.1.10";
11
+ import { VERSION } from "./version";
13
12
 
14
13
  async function main() {
15
14
  // argv = [node, script, ...args]
@@ -4,7 +4,7 @@ import pc from "picocolors";
4
4
  import { features } from "../../constants";
5
5
  import { check, discover, generate, validate } from "../../features";
6
6
  import { bold, italic } from "../../render";
7
- import { version } from "../version";
7
+ import { VERSION } from "../version";
8
8
  import { promptCheck } from "./prompts/prompt-check";
9
9
  import { promptDiscover } from "./prompts/prompt-discover";
10
10
  import { promptGenerate } from "./prompts/prompt-generate";
@@ -58,7 +58,7 @@ export async function run() {
58
58
  }
59
59
  case "generate": {
60
60
  await runAction(promptGenerate, (options) =>
61
- generate({ ...options, toolVersion: version }),
61
+ generate({ ...options, toolVersion: VERSION }),
62
62
  );
63
63
  break;
64
64
  }
@@ -1,3 +1,3 @@
1
1
  import package_ from "../../package.json" with { type: "json" };
2
2
 
3
- export const version = package_.version;
3
+ export const VERSION = package_.version;
@@ -50,6 +50,7 @@ export async function collectRuntimeMessages(
50
50
  config: { ...config, loader: serverLoader },
51
51
  locale,
52
52
  readers,
53
+ fetch: globalThis.fetch,
53
54
  });
54
55
  }
55
56
  }
@@ -62,6 +63,7 @@ export async function collectRuntimeMessages(
62
63
  config: { ...config, loader: clientLoader },
63
64
  locale,
64
65
  readers,
66
+ fetch: globalThis.fetch,
65
67
  });
66
68
  }
67
69
  }