@lingui/conf 3.16.1 → 3.17.0
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/CHANGELOG.md +11 -0
- package/LICENSE +1 -1
- package/README.md +3 -3
- package/build/LICENSE +1 -1
- package/build/index.js +6 -22
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.17.0](https://github.com/lingui/js-lingui/compare/v3.16.1...v3.17.0) (2023-02-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **conf:** proper typescript cosmiconfig loader ([#1386](https://github.com/lingui/js-lingui/issues/1386)) ([8da122d](https://github.com/lingui/js-lingui/commit/8da122d7ee65846993a1f3b5f2091d194abef521))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [3.16.1](https://github.com/lingui/js-lingui/compare/v3.16.0...v3.16.1) (2023-01-24)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @lingui/conf
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017 Tomáš Ehrlich
|
|
3
|
+
Copyright (c) 2017-2022 Tomáš Ehrlich, (c) 2022-2023 Crowdin.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ const config = getConfig()
|
|
|
23
23
|
// config.localeDir === '/app/locale'
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
See the [reference][reference]
|
|
26
|
+
See the [reference][reference] documentation of `lingui-cli` for all options.
|
|
27
27
|
|
|
28
28
|
## License
|
|
29
29
|
|
|
@@ -31,8 +31,8 @@ This package is licensed under [MIT][license] license.
|
|
|
31
31
|
|
|
32
32
|
[license]: https://github.com/lingui/js-lingui/blob/main/LICENSE
|
|
33
33
|
[linguijs]: https://github.com/lingui/js-lingui
|
|
34
|
-
[documentation]: https://lingui.
|
|
35
|
-
[reference]: https://lingui.
|
|
34
|
+
[documentation]: https://lingui.dev
|
|
35
|
+
[reference]: https://lingui.dev/ref/conf
|
|
36
36
|
[package]: https://www.npmjs.com/package/@lingui/conf
|
|
37
37
|
[badge-downloads]: https://img.shields.io/npm/dw/@lingui/conf.svg
|
|
38
38
|
[badge-version]: https://img.shields.io/npm/v/@lingui/conf.svg
|
package/build/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017 Tomáš Ehrlich
|
|
3
|
+
Copyright (c) 2017-2022 Tomáš Ehrlich, (c) 2022-2023 Crowdin.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/build/index.js
CHANGED
|
@@ -19,6 +19,8 @@ var _cosmiconfig = require("cosmiconfig");
|
|
|
19
19
|
|
|
20
20
|
var _jestValidate = require("jest-validate");
|
|
21
21
|
|
|
22
|
+
var _cosmiconfigTypescriptLoader = require("cosmiconfig-typescript-loader");
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
24
26
|
// Enforce posix path delimiters internally
|
|
@@ -77,7 +79,7 @@ function getConfig({
|
|
|
77
79
|
const configExplorer = (0, _cosmiconfig.cosmiconfigSync)(moduleName, {
|
|
78
80
|
searchPlaces: ["package.json", `.${moduleName}rc`, `.${moduleName}rc.json`, `.${moduleName}rc.yaml`, `.${moduleName}rc.yml`, `.${moduleName}rc.ts`, `.${moduleName}rc.js`, `${moduleName}.config.ts`, `${moduleName}.config.js`],
|
|
79
81
|
loaders: {
|
|
80
|
-
".ts": TypeScriptLoader
|
|
82
|
+
".ts": (0, _cosmiconfigTypescriptLoader.TypeScriptLoader)()
|
|
81
83
|
}
|
|
82
84
|
});
|
|
83
85
|
const result = configExists(configPath) ? configExplorer.load(configPath) : configExplorer.search(defaultRootDir);
|
|
@@ -173,14 +175,14 @@ const deprecatedConfig = {
|
|
|
173
175
|
const configValidation = {
|
|
174
176
|
exampleConfig,
|
|
175
177
|
deprecatedConfig,
|
|
176
|
-
comment: "Documentation: https://lingui.
|
|
178
|
+
comment: "Documentation: https://lingui.dev/ref/conf"
|
|
177
179
|
};
|
|
178
180
|
exports.configValidation = configValidation;
|
|
179
181
|
|
|
180
182
|
function validateLocales(config) {
|
|
181
183
|
if (!Array.isArray(config.locales) || !config.locales.length) {
|
|
182
184
|
console.error("No locales defined!\n");
|
|
183
|
-
console.error(`Add ${_chalk.default.yellow("'locales'")} to your configuration. See ${_chalk.default.underline("https://lingui.
|
|
185
|
+
console.error(`Add ${_chalk.default.yellow("'locales'")} to your configuration. See ${_chalk.default.underline("https://lingui.dev/ref/conf#locales")}`);
|
|
184
186
|
}
|
|
185
187
|
|
|
186
188
|
return config;
|
|
@@ -463,22 +465,4 @@ function catalogMigration(config) {
|
|
|
463
465
|
return newConfig;
|
|
464
466
|
}
|
|
465
467
|
|
|
466
|
-
const pipe = (...functions) => args => functions.reduce((arg, fn) => fn(arg), args);
|
|
467
|
-
/** Typescript loader using just typescript API and eval(), instead of using ts-node/register which is slower */
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
function TypeScriptLoader(filePath) {
|
|
471
|
-
const tsc = require("typescript");
|
|
472
|
-
|
|
473
|
-
const fileContent = _fs.default.readFileSync(filePath, "utf-8");
|
|
474
|
-
|
|
475
|
-
const {
|
|
476
|
-
outputText
|
|
477
|
-
} = tsc.transpileModule(fileContent, {
|
|
478
|
-
compilerOptions: {
|
|
479
|
-
module: tsc.ModuleKind.CommonJS
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
const configFileParsed = eval(outputText);
|
|
483
|
-
return configFileParsed;
|
|
484
|
-
}
|
|
468
|
+
const pipe = (...functions) => args => functions.reduce((arg, fn) => fn(arg), args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/conf",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "Get lingui configuration from package.json",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.11.2",
|
|
23
23
|
"chalk": "^4.1.0",
|
|
24
|
-
"cosmiconfig": "^
|
|
25
|
-
"cosmiconfig-typescript-loader": "^
|
|
24
|
+
"cosmiconfig": "^8.0.0",
|
|
25
|
+
"cosmiconfig-typescript-loader": "^4.3.0",
|
|
26
26
|
"jest-validate": "^26.5.2",
|
|
27
27
|
"lodash.get": "^4.4.2"
|
|
28
28
|
},
|
|
@@ -32,5 +32,8 @@
|
|
|
32
32
|
"index.js",
|
|
33
33
|
"index.d.ts"
|
|
34
34
|
],
|
|
35
|
-
"
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"ts-node": "^10.9.1"
|
|
37
|
+
},
|
|
38
|
+
"gitHead": "1c8bc46213b35b25da8fe7a80ddcf6f6a5d9d539"
|
|
36
39
|
}
|