@vocab/cli
Advanced tools
Comparing version 0.0.16 to 1.0.0
# @vocab/cli | ||
## 1.0.0 | ||
### Major Changes | ||
- [`3031054`](https://github.com/seek-oss/vocab/commit/303105440851db6126f0606e1607745b27dd981c) [#51](https://github.com/seek-oss/vocab/pull/51) Thanks [@jahredhope](https://github.com/jahredhope)! - Release v1.0.0 | ||
Release Vocab as v1.0.0 to signify a stable API and support future [semver versioning](https://semver.org/) releases. | ||
Vocab has seen a lot of iteration and changes since it was first published on 20 November 2020. We are now confident with the API and believe Vocab is ready for common use. | ||
### Patch Changes | ||
- Updated dependencies [[`0074382`](https://github.com/seek-oss/vocab/commit/007438273ef70f5d5ded45777933651ad8df36f6), [`3031054`](https://github.com/seek-oss/vocab/commit/303105440851db6126f0606e1607745b27dd981c)]: | ||
- @vocab/core@1.0.0 | ||
- @vocab/phrase@1.0.0 | ||
## 0.0.16 | ||
@@ -4,0 +20,0 @@ |
{ | ||
"name": "@vocab/cli", | ||
"version": "0.0.16", | ||
"version": "1.0.0", | ||
"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.11", | ||
"@vocab/phrase": "^0.0.11", | ||
"@vocab/core": "^1.0.0", | ||
"@vocab/phrase": "^1.0.0", | ||
"env-ci": "^5.0.2", | ||
@@ -17,0 +17,0 @@ "fast-glob": "^3.2.4", |
@@ -5,30 +5,27 @@ # Vocab | ||
## Getting started | ||
Vocab helps you ship multiple languages without compromising the reliability of your site or slowing down delivery. | ||
### Step 1: Install Dependencies | ||
- Shareable translations | ||
Vocab is a monorepo with different packages you can install depending on your usage, the below list will get you started using the cli, React and webpack integrations. | ||
Translations are co-located with the components that use them. Vocab uses the module graph allowing shared components to be installed with package managers like npm, just like any other module. | ||
```bash | ||
$ npm i --save @vocab/cli @vocab/react @vocab/webpack | ||
``` | ||
- Loading translations dynamically | ||
### Step 2: Setup Webpack plugin | ||
Vocab only loads the current user's language. If the language changes Vocab can load the new language behind the scenes without reloading the page. | ||
Before starting to write code you'll need to setup webpack to understand how to use `translation.json` files. | ||
- Strongly typed with TypeScript | ||
This is done using the **VocabWebpackPlugin**. | ||
When using translations TypeScript will ensure code only accesses valid translations and translations are passed all required dynamic values. | ||
**webpack.config.js** | ||
## Getting started | ||
```js | ||
const VocabWebpackPlugin = require('@vocab/webpack').default; | ||
### Step 1: Install Dependencies | ||
module.exports = { | ||
..., | ||
plugins: [new VocabWebpackPlugin({})] | ||
} | ||
Vocab is a monorepo with different packages you can install depending on your usage, the below list will get you started using the cli, React and webpack integrations. | ||
```bash | ||
$ npm i --save @vocab/cli @vocab/react @vocab/webpack | ||
``` | ||
### Step 3: Configure Vocab | ||
### Step 2: Configure Vocab | ||
@@ -117,4 +114,21 @@ You can configure Vocab directly when calling the API or via a `vocab.config.js` file. | ||
### Step 6: Optimize for fast page loading | ||
### Step 6: [Optional] Setup Webpack plugin | ||
Right now every language is loaded into your web application all the time, which could lead to a large bundle size. Ideally you will want to switch out the Node/default runtime for web runtime that will load only the active language. | ||
This is done using the **VocabWebpackPlugin**. Applying this plugin to your client webpack configuration will replace all vocab files with a dynamic asynchronous chunks designed for the web. | ||
**webpack.config.js** | ||
```js | ||
const { VocabWebpackPlugin } = require('@vocab/webpack'); | ||
module.exports = { | ||
..., | ||
plugins: [new VocabWebpackPlugin()] | ||
} | ||
``` | ||
### Step 7: [Optional] Optimize for fast page loading | ||
Using the above method without optimizing what chunks webpack uses you may find the page needing to do an extra round trip to load languages on a page. | ||
@@ -121,0 +135,0 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
25656
1
299
+ Added@formatjs/ecma402-abstract@2.3.1(transitive)
+ Added@formatjs/fast-memoize@2.2.5(transitive)
+ Added@formatjs/icu-messageformat-parser@2.9.7(transitive)
+ Added@formatjs/icu-skeleton-parser@1.8.11(transitive)
+ Added@formatjs/intl-localematcher@0.5.9(transitive)
+ Added@vocab/core@1.6.3(transitive)
+ Added@vocab/phrase@1.3.3(transitive)
+ Addedcsv-stringify@6.5.2(transitive)
+ Addeddecimal.js@10.4.3(transitive)
+ Addedintl-messageformat@10.7.10(transitive)
+ Addedpicocolors@1.1.1(transitive)
- Removed@formatjs/ecma402-abstract@1.11.4(transitive)
- Removed@formatjs/fast-memoize@1.2.1(transitive)
- Removed@formatjs/icu-messageformat-parser@2.1.0(transitive)
- Removed@formatjs/icu-skeleton-parser@1.3.6(transitive)
- Removed@formatjs/intl-localematcher@0.2.25(transitive)
- Removed@vocab/core@0.0.11(transitive)
- Removed@vocab/phrase@0.0.11(transitive)
- Removed@vocab/types@0.0.9(transitive)
- Removedchalk@4.1.2(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedintl-messageformat@9.13.0(transitive)
- Removedsupports-color@7.2.0(transitive)
Updated@vocab/core@^1.0.0
Updated@vocab/phrase@^1.0.0