@lingui/conf
Advanced tools
Comparing version 2.7.4 to 2.8.0
18
index.js
@@ -18,2 +18,3 @@ "use strict"; | ||
var path = require("path"); | ||
var fs = require("fs"); | ||
var chalk = require("chalk"); | ||
@@ -84,2 +85,12 @@ var cosmiconfig = require("cosmiconfig"); | ||
function configFilePathFromArgs() { | ||
var configIndex = process.argv.indexOf("--config"); | ||
if (configIndex >= 0 && process.argv.length > configIndex && fs.existsSync(process.argv[configIndex + 1])) { | ||
return process.argv[configIndex + 1]; | ||
} | ||
return null; | ||
} | ||
function getConfig() { | ||
@@ -89,5 +100,8 @@ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
var configExplorer = cosmiconfig("lingui"); | ||
var defaultRootDir = cwd || process.cwd(); | ||
var configExplorer = cosmiconfig("lingui"); | ||
var result = configExplorer.searchSync(defaultRootDir); | ||
var configPath = configFilePathFromArgs(); | ||
var result = configPath == null ? configExplorer.searchSync(defaultRootDir) : configExplorer.loadSync(configPath); | ||
var raw = (0, _extends3.default)({}, defaultConfig, result ? result.config : {}); | ||
@@ -94,0 +108,0 @@ |
{ | ||
"name": "@lingui/conf", | ||
"version": "2.7.4", | ||
"version": "2.8.0", | ||
"description": "Get lingui configuration from package.json", | ||
@@ -22,6 +22,6 @@ "keywords": [ | ||
"chalk": "^2.3.0", | ||
"cosmiconfig": "^5.0.6", | ||
"jest-regex-util": "^23.3.0", | ||
"jest-validate": "^23.5.0", | ||
"pkg-conf": "^2.1.0" | ||
"cosmiconfig": "^5.2.1", | ||
"jest-regex-util": "^24.3.0", | ||
"jest-validate": "^24.8.0", | ||
"pkg-conf": "^3.1.0" | ||
}, | ||
@@ -28,0 +28,0 @@ "files": [ |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
6515
87
2
+ Added@jest/types@24.9.0(transitive)
+ Added@types/istanbul-lib-coverage@2.0.6(transitive)
+ Added@types/istanbul-lib-report@3.0.3(transitive)
+ Added@types/istanbul-reports@1.1.2(transitive)
+ Added@types/yargs@13.0.12(transitive)
+ Added@types/yargs-parser@21.0.3(transitive)
+ Addedansi-regex@4.1.1(transitive)
+ Addedcamelcase@5.3.1(transitive)
+ Addedfind-up@3.0.0(transitive)
+ Addedjest-get-type@24.9.0(transitive)
+ Addedjest-regex-util@24.9.0(transitive)
+ Addedjest-validate@24.9.0(transitive)
+ Addedleven@3.1.0(transitive)
+ Addedload-json-file@5.3.0(transitive)
+ Addedlocate-path@3.0.0(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpify@4.0.1(transitive)
+ Addedpkg-conf@3.1.0(transitive)
+ Addedpretty-format@24.9.0(transitive)
+ Addedreact-is@16.13.1(transitive)
+ Addedtype-fest@0.3.1(transitive)
- Removedansi-regex@3.0.1(transitive)
- Removedfind-up@2.1.0(transitive)
- Removedjest-get-type@22.4.3(transitive)
- Removedjest-regex-util@23.3.0(transitive)
- Removedjest-validate@23.6.0(transitive)
- Removedleven@2.1.0(transitive)
- Removedload-json-file@4.0.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedpkg-conf@2.1.0(transitive)
- Removedpretty-format@23.6.0(transitive)
Updatedcosmiconfig@^5.2.1
Updatedjest-regex-util@^24.3.0
Updatedjest-validate@^24.8.0
Updatedpkg-conf@^3.1.0