@lingui/conf
Advanced tools
Comparing version 3.3.0 to 3.4.0
@@ -0,1 +1,3 @@ | ||
import type { GeneratorOptions } from "@babel/core"; | ||
export declare type CatalogFormat = "lingui" | "minimal" | "po" | "csv" | "po-gettext"; | ||
@@ -25,5 +27,5 @@ export type CatalogFormatOptions = { | ||
catalogs: CatalogConfig[]; | ||
compileNamespace: string; | ||
compileNamespace: "es" | "cjs" | "ts" | string; | ||
extractBabelOptions: Record<string, unknown>; | ||
compilerBabelOptions: Record<string, unknown>; | ||
compilerBabelOptions: GeneratorOptions; | ||
fallbackLocales: FallbackLocales; | ||
@@ -56,5 +58,5 @@ format: CatalogFormat; | ||
}; | ||
compilerBabelOptions: Record<string, unknown>; | ||
compilerBabelOptions: GeneratorOptions; | ||
catalogs: CatalogConfig[]; | ||
compileNamespace: string; | ||
compileNamespace: "es" | "ts" | "cjs" | string; | ||
fallbackLocales: FallbackLocales; | ||
@@ -61,0 +63,0 @@ format: CatalogFormat; |
36
index.js
@@ -30,2 +30,4 @@ "use strict"; | ||
var _lodash = _interopRequireDefault(require("lodash.get")); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
@@ -50,3 +52,8 @@ | ||
compileNamespace: "cjs", | ||
compilerBabelOptions: {}, | ||
compilerBabelOptions: { | ||
minified: true, | ||
jsescOption: { | ||
minimal: true | ||
} | ||
}, | ||
extractBabelOptions: { | ||
@@ -82,3 +89,9 @@ plugins: [], | ||
var defaultRootDir = cwd || process.cwd(); | ||
var configExplorer = (0, _cosmiconfig.cosmiconfigSync)("lingui"); | ||
var moduleName = "lingui"; | ||
var configExplorer = (0, _cosmiconfig.cosmiconfigSync)(moduleName, { | ||
searchPlaces: ["package.json", ".".concat(moduleName, "rc"), ".".concat(moduleName, "rc.json"), ".".concat(moduleName, "rc.yaml"), ".".concat(moduleName, "rc.yml"), ".".concat(moduleName, "rc.ts"), ".".concat(moduleName, "rc.js"), "".concat(moduleName, ".config.ts"), "".concat(moduleName, ".config.js")], | ||
loaders: { | ||
".ts": TypeScriptLoader | ||
} | ||
}); | ||
var result = configExists(configPath) ? configExplorer.load(configPath) : configExplorer.search(defaultRootDir); | ||
@@ -432,2 +445,19 @@ var userConfig = result ? result.config : {}; | ||
}; | ||
}; | ||
}; // copied from @EndemolShineGroup/cosmiconfig-typescript-loader | ||
// to support sync operations | ||
// if this PR gets merged and published, this piece of code can be thrown away | ||
// https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader/pull/132 | ||
function TypeScriptLoader(filePath) { | ||
try { | ||
require("ts-node/register"); | ||
var result = require(filePath); | ||
return (0, _lodash.default)(result, "default", result); | ||
} catch (error) { | ||
// Replace with logger class OR throw a more specific error | ||
throw require("@endemolshinegroup/cosmiconfig-typescript-loader/dist/Errors/TypeScriptCompileError").fromError(error); | ||
} | ||
} |
{ | ||
"name": "@lingui/conf", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "Get lingui configuration from package.json", | ||
@@ -22,2 +22,3 @@ "keywords": [ | ||
"@babel/runtime": "^7.11.2", | ||
"@endemolshinegroup/cosmiconfig-typescript-loader": "^3.0.2", | ||
"chalk": "^4.1.0", | ||
@@ -24,0 +25,0 @@ "cosmiconfig": "^7.0.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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
21357
516
5
3
+ Added@endemolshinegroup/cosmiconfig-typescript-loader@^3.0.2
+ Added@endemolshinegroup/cosmiconfig-typescript-loader@3.0.2(transitive)
+ Addedarg@4.1.3(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcreate-require@1.1.1(transitive)
+ Addeddiff@4.0.2(transitive)
+ Addedlodash.get@4.4.2(transitive)
+ Addedmake-error@1.3.6(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-support@0.5.21(transitive)
+ Addedts-node@9.1.1(transitive)
+ Addedtslib@2.7.0(transitive)
+ Addedtypescript@5.6.2(transitive)
+ Addedyn@3.1.1(transitive)