mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[I18n] Remove JSON5 dependency from kbn-i18n (#26634)
This commit is contained in:
parent
0b6e8af1c5
commit
c50e6418f0
5 changed files with 5 additions and 20 deletions
|
@ -21,7 +21,6 @@
|
|||
"@babel/preset-typescript": "^7.1.0",
|
||||
"@kbn/dev-utils": "1.0.0",
|
||||
"@types/intl-relativeformat": "^2.1.0",
|
||||
"@types/json5": "^0.0.30",
|
||||
"@types/react-intl": "^2.3.11",
|
||||
"del": "^3.0.0",
|
||||
"getopts": "^2.2.3",
|
||||
|
@ -32,7 +31,6 @@
|
|||
"intl-format-cache": "^2.1.0",
|
||||
"intl-messageformat": "^2.2.0",
|
||||
"intl-relativeformat": "^2.1.0",
|
||||
"json5": "^2.0.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react": "^16.3.0",
|
||||
"react-intl": "^2.7.0"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
messages: {
|
||||
test: 'test' // JSON5 test
|
||||
"messages": {
|
||||
"test": "test"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ describe('I18n loader', () => {
|
|||
});
|
||||
});
|
||||
|
||||
test('should return translation messages from JSON5 file', async () => {
|
||||
test('should return translation messages from JSON file', async () => {
|
||||
i18nLoader.registerTranslationFile(
|
||||
join(__dirname, './__fixtures__/test_plugin_2/translations/fr.json')
|
||||
);
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
|
||||
import { readFile } from 'fs';
|
||||
import * as JSON5 from 'json5';
|
||||
import * as path from 'path';
|
||||
import { promisify } from 'util';
|
||||
|
||||
|
@ -65,12 +64,12 @@ function getLocaleFromFileName(fullFileName: string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Loads file and parses it as JSON5
|
||||
* Loads file and parses it as JSON
|
||||
* @param pathToFile
|
||||
* @returns
|
||||
*/
|
||||
async function loadFile(pathToFile: string): Promise<Translation> {
|
||||
return JSON5.parse(await asyncReadFile(pathToFile, 'utf8'));
|
||||
return JSON.parse(await asyncReadFile(pathToFile, 'utf8'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
12
yarn.lock
12
yarn.lock
|
@ -1299,11 +1299,6 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e"
|
||||
integrity sha512-q9Q6+eUEGwQkv4Sbst3J4PNgDOvpuVuKj79Hl/qnmBMEIPzB5QoFRUtjcgcg2xNUZyYUGXBk5wYIBKHt0A+Mxw==
|
||||
|
||||
"@types/json5@^0.0.30":
|
||||
version "0.0.30"
|
||||
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818"
|
||||
integrity sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA==
|
||||
|
||||
"@types/jsonwebtoken@^7.2.7":
|
||||
version "7.2.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-7.2.8.tgz#8d199dab4ddb5bba3234f8311b804d2027af2b3a"
|
||||
|
@ -12456,13 +12451,6 @@ json5@^1.0.1:
|
|||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
|
||||
json5@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json5/-/json5-2.0.1.tgz#3d6d0d1066039eb50984e66a7840e4f4b7a2c660"
|
||||
integrity sha512-t6N/86QDIRYvOL259jR5c5TbtMnekl2Ib314mGeMh37zAwjgbWHieqijPH7pWaogmJq1F2I4Sphg19U1s+ZnXQ==
|
||||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
|
||||
jsonfile@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue