shallok 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +72 -2
- package/dist/index.js +52324 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -4
- package/skills/astro-localization-and-translation-i18n/SKILL.md +164 -0
- package/skills/astro-localization-and-translation-i18n/references/astro-i18n.md +40 -0
- package/skills/astro-localization-and-translation-i18n/references/extraction.md +29 -0
- package/skills/astro-localization-and-translation-i18n/references/translation.md +45 -0
- package/skills/astro-localization-and-translation-i18n/references/versioning.md +57 -0
- package/skills/expo-localization-and-translation-i18n/SKILL.md +169 -0
- package/skills/expo-localization-and-translation-i18n/references/expo-localization.md +46 -0
- package/skills/expo-localization-and-translation-i18n/references/extraction.md +29 -0
- package/skills/expo-localization-and-translation-i18n/references/translation.md +45 -0
- package/skills/expo-localization-and-translation-i18n/references/versioning.md +57 -0
- package/skills/localization-and-translation-i18n/SKILL.md +173 -0
- package/skills/localization-and-translation-i18n/references/extraction.md +29 -0
- package/skills/localization-and-translation-i18n/references/frameworks.md +40 -0
- package/skills/localization-and-translation-i18n/references/translation.md +45 -0
- package/skills/localization-and-translation-i18n/references/versioning.md +57 -0
- package/skills/localize-app/SKILL.md +80 -0
- package/skills/localize-app/references/extraction.md +29 -0
- package/skills/localize-app/references/frameworks.md +25 -0
- package/skills/localize-app/references/translation.md +45 -0
- package/skills/localize-app/references/versioning.md +57 -0
- package/skills/nextjs-localization-and-translation-i18n/SKILL.md +166 -0
- package/skills/nextjs-localization-and-translation-i18n/references/extraction.md +29 -0
- package/skills/nextjs-localization-and-translation-i18n/references/next-intl.md +63 -0
- package/skills/nextjs-localization-and-translation-i18n/references/translation.md +45 -0
- package/skills/nextjs-localization-and-translation-i18n/references/versioning.md +57 -0
- package/skills/react-localization-and-translation-i18n/SKILL.md +266 -0
- package/skills/react-localization-and-translation-i18n/references/extraction.md +29 -0
- package/skills/react-localization-and-translation-i18n/references/react-i18next.md +47 -0
- package/skills/react-localization-and-translation-i18n/references/translation.md +45 -0
- package/skills/react-localization-and-translation-i18n/references/versioning.md +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shallok 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/README.md
CHANGED
|
@@ -1,3 +1,73 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Shallok (`shallok`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> AI-Powered, Versioned Localization Tool for Developers & AI Coding Agents.
|
|
4
|
+
|
|
5
|
+
Shallok is a developer tool and AI agent skill system that enables developers and AI coding agents (Antigravity, Cursor, Claude Code, GitHub Copilot) to add, configure, extract, translate, and maintain localization across existing codebases.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **AST-Based Extraction**: Deterministic AST parsing (Babel) safely extracts user-facing text and attributes into stable semantic keys.
|
|
10
|
+
- **Agent-Native Translation**: **Zero external API keys required**. AI coding agents translate missing and stale keys directly with natural cultural fluency.
|
|
11
|
+
- **AI-Enriched Semantic Context**: Context notes are enriched by AI agents and strictly preserved across extractions.
|
|
12
|
+
- **Per-Key Versioning & Content Hashing**: SHA-256 content hashes detect source modifications and mark translations stale on a granular, per-key basis.
|
|
13
|
+
- **Framework Adapters**:
|
|
14
|
+
- **React**: `react-i18next` with `src/i18n.ts`
|
|
15
|
+
- **Next.js**: `next-intl` (App Router `routing.ts`, `request.ts`, `middleware.ts`)
|
|
16
|
+
- **Expo / React Native**: `expo-localization` + `i18next` with native device locale detection
|
|
17
|
+
- **Astro**: `astro:i18n` with dynamic message compilation
|
|
18
|
+
- **Placeholder & Integrity Validation**: Validates 0 missing keys, 0 stale versions, and 0 corrupted placeholder tokens (`{count}`, `{name}`).
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
### 1. Developer CLI Quickstart
|
|
25
|
+
Run in any React, Next.js, Expo, or Astro project:
|
|
26
|
+
```bash
|
|
27
|
+
npx shallok init
|
|
28
|
+
```
|
|
29
|
+
This command automatically:
|
|
30
|
+
1. Analyzes project architecture, detected framework, and router.
|
|
31
|
+
2. Scaffolds `localization.json`, `localization_base/`, `messages/`, and framework files.
|
|
32
|
+
3. Installs `shallok` into `devDependencies` using your project's package manager.
|
|
33
|
+
4. Installs AI agent skills directly into `.agents/skills/` and `skills/`.
|
|
34
|
+
|
|
35
|
+
### 2. Direct AI Agent Skill Usage
|
|
36
|
+
Copy any of the skills from `skills/` into your AI agent's skills directory (e.g. `.agents/skills/`), then tell your agent:
|
|
37
|
+
> *"Add localization to this application with Kannada and Hindi"*
|
|
38
|
+
|
|
39
|
+
The agent automatically verifies `shallok` is present, installs it if needed, and executes the complete 6-phase localization workflow.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## CLI Commands
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Analyze project architecture
|
|
47
|
+
shallok analyze --json
|
|
48
|
+
|
|
49
|
+
# Initialize configuration and framework files
|
|
50
|
+
shallok init --source en --locales kn,hi,fr --framework react --yes
|
|
51
|
+
|
|
52
|
+
# Extract strings and preview changes
|
|
53
|
+
shallok extract --dry-run
|
|
54
|
+
shallok extract
|
|
55
|
+
|
|
56
|
+
# Apply AST transformations to source code
|
|
57
|
+
shallok extract --apply
|
|
58
|
+
|
|
59
|
+
# Check localization status
|
|
60
|
+
shallok status
|
|
61
|
+
|
|
62
|
+
# Compile runtime message bundles
|
|
63
|
+
shallok build
|
|
64
|
+
|
|
65
|
+
# Validate placeholder and catalog integrity
|
|
66
|
+
shallok validate
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT © Shallok Contributors
|