@vocab/cli
Advanced tools
Comparing version 0.0.11 to 0.0.12
# @vocab/cli | ||
## 0.0.12 | ||
### Patch Changes | ||
- Updated dependencies [[`283bcad`](https://github.com/seek-oss/vocab/commit/283bcada06e622ab14ed891743ed3f55cf09e245), [`ad0d240`](https://github.com/seek-oss/vocab/commit/ad0d2404545ded8e11621eae8f29467ff3352366), [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb), [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb)]: | ||
- @vocab/core@0.0.7 | ||
- @vocab/phrase@0.0.7 | ||
## 0.0.11 | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "@vocab/cli", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"main": "dist/vocab-cli.cjs.js", | ||
@@ -13,4 +13,4 @@ "module": "dist/vocab-cli.esm.js", | ||
"@types/env-ci": "^3.1.0", | ||
"@vocab/core": "^0.0.6", | ||
"@vocab/phrase": "^0.0.6", | ||
"@vocab/core": "^0.0.7", | ||
"@vocab/phrase": "^0.0.7", | ||
"env-ci": "^5.0.2", | ||
@@ -17,0 +17,0 @@ "fast-glob": "^3.2.4", |
@@ -71,5 +71,5 @@ # Vocab | ||
**Note:** Currently, to create a new translation it must be placed inside a **`__translations__`** folder, this folder name can be configured with `translationsDirname` configuration. | ||
**Note:** Currently, to create a new translation it must be placed inside a folder ending in **`.vocab`**, this folder suffix can be configured with the `translationsDirectorySuffix` configuration value. | ||
**`./__translations__/translations.json`** | ||
**`./example.vocab/translations.json`** | ||
@@ -86,3 +86,3 @@ ```json | ||
Then run `vocab compile`. Or `vocab compile --watch`. | ||
This will create new `translation.ts` files for each `translation.json` file. | ||
This will create a new `index.ts` file for each folder ending in **`.vocab`**. | ||
@@ -95,3 +95,3 @@ You can then import these translations into your React components. Translations can be used by calling the `t` function returned by `useTranslation`. | ||
import { useTranslation } from '@vocab/react'; | ||
import translations from './translations'; | ||
import translations from './example.vocab'; | ||
@@ -106,5 +106,5 @@ function MyComponent({ children }) { | ||
So far your app will run, but you're missing any translations other than the initial language. The below file can be created manually; however, you can also integrate with a remote translation platform to push and pull translations automatically. | ||
So far your app will run, but you're missing any translations other than the initial language. The below file can be created manually; however, you can also integrate with a remote translation platform to push and pull translations automatically. See [Externeral translation tooling](#external-translation-tooling) for more information. | ||
**./\_\_translations\_\_/translations.fr-FR.json** | ||
**./example.vocab/fr-FR.translations.json** | ||
@@ -156,3 +156,17 @@ ```json | ||
{ name: 'fr-FR' } | ||
] | ||
], | ||
/** | ||
* The root directory to compile and validate translations | ||
* Default: Current working directory | ||
*/ | ||
projectRoot: ['./example/']; | ||
/** | ||
* A custom suffix to name vocab translation directories | ||
* Default: '.vocab' | ||
*/ | ||
translationsDirectorySuffix: '.vocab', | ||
/** | ||
* An array of glob paths to ignore from compilation and validation | ||
*/ | ||
ignore: ['**/ignored_directory/**'] | ||
}; | ||
@@ -163,5 +177,5 @@ ``` | ||
Vocab generates custom `translation.ts` files that give your React components strongly typed translations to work with. | ||
Vocab generates custom `index.ts` files that give your React components strongly typed translations to work with. | ||
To generate these types run: | ||
To generate these files run: | ||
@@ -172,3 +186,3 @@ ```bash | ||
Or to rerun the compiler when files change use: | ||
Or to re-run the compiler when files change use: | ||
@@ -175,0 +189,0 @@ ```bash |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19584
202
+ Added@vocab/core@0.0.7(transitive)
+ Added@vocab/phrase@0.0.7(transitive)
+ Added@vocab/types@0.0.7(transitive)
- Removed@vocab/core@0.0.6(transitive)
- Removed@vocab/phrase@0.0.6(transitive)
- Removed@vocab/types@0.0.6(transitive)
Updated@vocab/core@^0.0.7
Updated@vocab/phrase@^0.0.7