@lingui/conf
Advanced tools
Comparing version 3.16.1 to 3.17.0
@@ -22,2 +22,4 @@ "use strict"; | ||
var _cosmiconfigTypescriptLoader = require("cosmiconfig-typescript-loader"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -81,3 +83,3 @@ | ||
loaders: { | ||
".ts": TypeScriptLoader | ||
".ts": (0, _cosmiconfigTypescriptLoader.TypeScriptLoader)() | ||
} | ||
@@ -178,3 +180,3 @@ }); | ||
deprecatedConfig, | ||
comment: "Documentation: https://lingui.js.org/ref/conf.html" | ||
comment: "Documentation: https://lingui.dev/ref/conf" | ||
}; | ||
@@ -186,3 +188,3 @@ exports.configValidation = configValidation; | ||
console.error("No locales defined!\n"); | ||
console.error(`Add ${_chalk.default.yellow("'locales'")} to your configuration. See ${_chalk.default.underline("https://lingui.js.org/ref/conf.html#locales")}`); | ||
console.error(`Add ${_chalk.default.yellow("'locales'")} to your configuration. See ${_chalk.default.underline("https://lingui.dev/ref/conf#locales")}`); | ||
} | ||
@@ -470,20 +472,2 @@ | ||
const pipe = (...functions) => args => functions.reduce((arg, fn) => fn(arg), args); | ||
/** Typescript loader using just typescript API and eval(), instead of using ts-node/register which is slower */ | ||
function TypeScriptLoader(filePath) { | ||
const tsc = require("typescript"); | ||
const fileContent = _fs.default.readFileSync(filePath, "utf-8"); | ||
const { | ||
outputText | ||
} = tsc.transpileModule(fileContent, { | ||
compilerOptions: { | ||
module: tsc.ModuleKind.CommonJS | ||
} | ||
}); | ||
const configFileParsed = eval(outputText); | ||
return configFileParsed; | ||
} | ||
const pipe = (...functions) => args => functions.reduce((arg, fn) => fn(arg), args); |
@@ -6,2 +6,13 @@ # Change Log | ||
# [3.17.0](https://github.com/lingui/js-lingui/compare/v3.16.1...v3.17.0) (2023-02-01) | ||
### Bug Fixes | ||
* **conf:** proper typescript cosmiconfig loader ([#1386](https://github.com/lingui/js-lingui/issues/1386)) ([8da122d](https://github.com/lingui/js-lingui/commit/8da122d7ee65846993a1f3b5f2091d194abef521)) | ||
## [3.16.1](https://github.com/lingui/js-lingui/compare/v3.16.0...v3.16.1) (2023-01-24) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@lingui/conf", | ||
"version": "3.16.1", | ||
"version": "3.17.0", | ||
"sideEffects": false, | ||
@@ -24,4 +24,4 @@ "description": "Get lingui configuration from package.json", | ||
"chalk": "^4.1.0", | ||
"cosmiconfig": "^7.0.0", | ||
"cosmiconfig-typescript-loader": "^2.0.1", | ||
"cosmiconfig": "^8.0.0", | ||
"cosmiconfig-typescript-loader": "^4.3.0", | ||
"jest-validate": "^26.5.2", | ||
@@ -36,3 +36,6 @@ "lodash.get": "^4.4.2" | ||
], | ||
"gitHead": "bae762a1ef15d0a4d883bc8c1837603b4e79175e" | ||
"devDependencies": { | ||
"ts-node": "^10.9.1" | ||
}, | ||
"gitHead": "1c8bc46213b35b25da8fe7a80ddcf6f6a5d9d539" | ||
} |
@@ -26,3 +26,3 @@ [![License][badge-license]][license] | ||
See the [reference][reference] documenation of `lingui-cli` for all options. | ||
See the [reference][reference] documentation of `lingui-cli` for all options. | ||
@@ -35,4 +35,4 @@ ## License | ||
[linguijs]: https://github.com/lingui/js-lingui | ||
[documentation]: https://lingui.js.org/ | ||
[reference]: https://lingui.js.org/ref/conf.html | ||
[documentation]: https://lingui.dev | ||
[reference]: https://lingui.dev/ref/conf | ||
[package]: https://www.npmjs.com/package/@lingui/conf | ||
@@ -39,0 +39,0 @@ [badge-downloads]: https://img.shields.io/npm/dw/@lingui/conf.svg |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
34629
0
1
646
+ Addedargparse@2.0.1(transitive)
+ Addedcosmiconfig@8.3.6(transitive)
+ Addedcosmiconfig-typescript-loader@4.4.0(transitive)
+ Addedjs-yaml@4.1.0(transitive)
- Removed@types/parse-json@4.0.2(transitive)
- Removedcosmiconfig@7.1.0(transitive)
- Removedcosmiconfig-typescript-loader@2.0.2(transitive)
- Removedyaml@1.10.2(transitive)
Updatedcosmiconfig@^8.0.0