Initial commit
This commit is contained in:
commit
f1548f10cc
7585 files changed
+1411120
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Vladimir Krivosheev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function deepAssign<T>(target: T, ...objects: Array<any>): T;
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.deepAssign = void 0;
|
||||
function isObject(x) {
|
||||
if (Array.isArray(x)) {
|
||||
return false;
|
||||
}
|
||||
const type = typeof x;
|
||||
return type === "object" || type === "function";
|
||||
}
|
||||
function assignKey(target, from, key) {
|
||||
const value = from[key];
|
||||
// https://github.com/electron-userland/electron-builder/pull/562
|
||||
if (value === undefined) {
|
||||
return;
|
||||
}
|
||||
const prevValue = target[key];
|
||||
if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {
|
||||
target[key] = value;
|
||||
}
|
||||
else {
|
||||
target[key] = assign(prevValue, value);
|
||||
}
|
||||
}
|
||||
function assign(to, from) {
|
||||
if (to !== from) {
|
||||
for (const key of Object.getOwnPropertyNames(from)) {
|
||||
assignKey(to, from, key);
|
||||
}
|
||||
}
|
||||
return to;
|
||||
}
|
||||
function deepAssign(target, ...objects) {
|
||||
for (const o of objects) {
|
||||
if (o != null) {
|
||||
assign(target, o);
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
exports.deepAssign = deepAssign;
|
||||
//# sourceMappingURL=deepAssign.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"deepAssign.js","sourceRoot":"","sources":["../src/deepAssign.ts"],"names":[],"mappings":";;;AAAA,SAAS,QAAQ,CAAC,CAAM;IACtB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACpB,OAAO,KAAK,CAAA;KACb;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,CAAA;IACrB,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAA;AACjD,CAAC;AAED,SAAS,SAAS,CAAC,MAAW,EAAE,IAAS,EAAE,GAAW;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACvB,iEAAiE;IACjE,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAM;KACP;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;IAC7B,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAClF,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;KACpB;SACI;QACH,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;KACvC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,EAAO,EAAE,IAAS;IAChC,IAAI,EAAE,KAAK,IAAI,EAAE;QACf,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE;YAClD,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;SACzB;KACF;IACD,OAAO,EAAE,CAAA;AACX,CAAC;AAED,SAAgB,UAAU,CAAI,MAAS,EAAE,GAAG,OAAmB;IAC7D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,CAAC,IAAI,IAAI,EAAE;YACb,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;SAClB;KACF;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAPD,gCAOC","sourcesContent":["function isObject(x: any) {\n if (Array.isArray(x)) {\n return false\n }\n\n const type = typeof x\n return type === \"object\" || type === \"function\"\n}\n\nfunction assignKey(target: any, from: any, key: string) {\n const value = from[key]\n // https://github.com/electron-userland/electron-builder/pull/562\n if (value === undefined) {\n return\n }\n\n const prevValue = target[key]\n if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {\n target[key] = value\n }\n else {\n target[key] = assign(prevValue, value)\n }\n}\n\nfunction assign(to: any, from: any) {\n if (to !== from) {\n for (const key of Object.getOwnPropertyNames(from)) {\n assignKey(to, from, key)\n }\n }\n return to\n}\n\nexport function deepAssign<T>(target: T, ...objects: Array<any>): T {\n for (const o of objects) {\n if (o != null) {\n assign(target, o)\n }\n }\n return target\n}"]}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import { Lazy } from "lazy-val";
|
||||
export interface ReadConfigResult<T> {
|
||||
readonly result: T;
|
||||
readonly configFile: string | null;
|
||||
}
|
||||
export declare function findAndReadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
|
||||
export declare function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null>;
|
||||
export declare function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T>;
|
||||
export interface ReadConfigRequest {
|
||||
packageKey: string;
|
||||
configFilename: string;
|
||||
projectDir: string;
|
||||
packageMetadata: Lazy<{
|
||||
[key: string]: any;
|
||||
} | null> | null;
|
||||
}
|
||||
export declare function loadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
|
||||
export declare function getConfig<T>(request: ReadConfigRequest, configPath?: string | null): Promise<ReadConfigResult<T> | null>;
|
||||
export declare function loadParentConfig<T>(request: ReadConfigRequest, spec: string): Promise<ReadConfigResult<T>>;
|
||||
export declare function loadEnv(envFile: string): Promise<import("dotenv").DotenvParseOutput | null>;
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.loadEnv = exports.loadParentConfig = exports.getConfig = exports.loadConfig = exports.orIfFileNotExist = exports.orNullIfFileNotExist = exports.findAndReadConfig = void 0;
|
||||
const fs_1 = require("fs");
|
||||
const js_yaml_1 = require("js-yaml");
|
||||
const path = require("path");
|
||||
const dotenv_1 = require("dotenv");
|
||||
const config_file_ts_1 = require("config-file-ts");
|
||||
async function readConfig(configFile, request) {
|
||||
const data = await fs_1.promises.readFile(configFile, "utf8");
|
||||
let result;
|
||||
if (configFile.endsWith(".json5") || configFile.endsWith(".json")) {
|
||||
result = require("json5").parse(data);
|
||||
}
|
||||
else if (configFile.endsWith(".js") || configFile.endsWith(".cjs")) {
|
||||
result = require(configFile);
|
||||
if (result.default != null) {
|
||||
result = result.default;
|
||||
}
|
||||
if (typeof result === "function") {
|
||||
result = result(request);
|
||||
}
|
||||
result = await Promise.resolve(result);
|
||||
}
|
||||
else if (configFile.endsWith(".ts")) {
|
||||
result = config_file_ts_1.loadTsConfig(configFile);
|
||||
if (typeof result === "function") {
|
||||
result = result(request);
|
||||
}
|
||||
result = await Promise.resolve(result);
|
||||
}
|
||||
else if (configFile.endsWith(".toml")) {
|
||||
result = require("toml").parse(data);
|
||||
}
|
||||
else {
|
||||
result = js_yaml_1.load(data);
|
||||
}
|
||||
return { result, configFile };
|
||||
}
|
||||
async function findAndReadConfig(request) {
|
||||
const prefix = request.configFilename;
|
||||
for (const configFile of [`${prefix}.yml`, `${prefix}.yaml`, `${prefix}.json`, `${prefix}.json5`, `${prefix}.toml`, `${prefix}.js`, `${prefix}.cjs`, `${prefix}.ts`]) {
|
||||
const data = await orNullIfFileNotExist(readConfig(path.join(request.projectDir, configFile), request));
|
||||
if (data != null) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
exports.findAndReadConfig = findAndReadConfig;
|
||||
function orNullIfFileNotExist(promise) {
|
||||
return orIfFileNotExist(promise, null);
|
||||
}
|
||||
exports.orNullIfFileNotExist = orNullIfFileNotExist;
|
||||
function orIfFileNotExist(promise, fallbackValue) {
|
||||
return promise
|
||||
.catch(e => {
|
||||
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
|
||||
return fallbackValue;
|
||||
}
|
||||
throw e;
|
||||
});
|
||||
}
|
||||
exports.orIfFileNotExist = orIfFileNotExist;
|
||||
async function loadConfig(request) {
|
||||
let packageMetadata = request.packageMetadata == null ? null : await request.packageMetadata.value;
|
||||
if (packageMetadata == null) {
|
||||
const json = await orNullIfFileNotExist(fs_1.promises.readFile(path.join(request.projectDir, "package.json"), "utf8"));
|
||||
packageMetadata = json == null ? null : JSON.parse(json);
|
||||
}
|
||||
const data = packageMetadata == null ? null : packageMetadata[request.packageKey];
|
||||
return data == null ? findAndReadConfig(request) : { result: data, configFile: null };
|
||||
}
|
||||
exports.loadConfig = loadConfig;
|
||||
function getConfig(request, configPath) {
|
||||
if (configPath == null) {
|
||||
return loadConfig(request);
|
||||
}
|
||||
else {
|
||||
return readConfig(path.resolve(request.projectDir, configPath), request);
|
||||
}
|
||||
}
|
||||
exports.getConfig = getConfig;
|
||||
async function loadParentConfig(request, spec) {
|
||||
let isFileSpec;
|
||||
if (spec.startsWith("file:")) {
|
||||
spec = spec.substring("file:".length);
|
||||
isFileSpec = true;
|
||||
}
|
||||
let parentConfig = await orNullIfFileNotExist(readConfig(path.resolve(request.projectDir, spec), request));
|
||||
if (parentConfig == null && isFileSpec !== true) {
|
||||
let resolved = null;
|
||||
try {
|
||||
resolved = require.resolve(spec);
|
||||
}
|
||||
catch (e) {
|
||||
// ignore
|
||||
}
|
||||
if (resolved != null) {
|
||||
parentConfig = await readConfig(resolved, request);
|
||||
}
|
||||
}
|
||||
if (parentConfig == null) {
|
||||
throw new Error(`Cannot find parent config file: ${spec}`);
|
||||
}
|
||||
return parentConfig;
|
||||
}
|
||||
exports.loadParentConfig = loadParentConfig;
|
||||
async function loadEnv(envFile) {
|
||||
const data = await orNullIfFileNotExist(fs_1.promises.readFile(envFile, "utf8"));
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
const parsed = dotenv_1.parse(data);
|
||||
for (const key of Object.keys(parsed)) {
|
||||
if (!process.env.hasOwnProperty(key)) {
|
||||
process.env[key] = parsed[key];
|
||||
}
|
||||
}
|
||||
require("dotenv-expand")(parsed);
|
||||
return parsed;
|
||||
}
|
||||
exports.loadEnv = loadEnv;
|
||||
//# sourceMappingURL=main.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAAA,2BAAmC;AACnC,qCAA8B;AAC9B,6BAA4B;AAE5B,mCAA0C;AAC1C,mDAA6C;AAO7C,KAAK,UAAU,UAAU,CAAI,UAAkB,EAAE,OAA0B;IACzE,MAAM,IAAI,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAClD,IAAI,MAAM,CAAA;IACV,IAAI,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjE,MAAM,GAAG,OAAO,CAAC,OA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pB,YAAY,GAAG,MAAM,UAAU,CAAI,QAAQ,EAAE,OAAO,CAAC,CAAA;SACtD;KACF;IAED,IAAI,YAAY,IAAI,IAAI,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,EAAE,CAAC,CAAA;KAC3D;IAED,OAAO,YAAY,CAAA;AACrB,CAAC;AA3BD,4CA2BC;AAEM,KAAK,UAAU,OAAO,CAAC,OAAe;IAC3C,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,aAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;IACrE,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,MAAM,GAAG,cAAQ,CAAC,IAAI,CAAC,CAAA;IAC7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACrC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YACpC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;SAC/B;KACF;IACD,OAAO,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;IAChC,OAAO,MAAM,CAAA;AACf,CAAC;AAdD,0BAcC","sourcesContent":["import { promises as fs } from \"fs\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { Lazy } from \"lazy-val\"\nimport { parse as parseEnv } from \"dotenv\"\nimport { loadTsConfig } from \"config-file-ts\"\n\nexport interface ReadConfigResult<T> {\n readonly result: T\n readonly configFile: string | null\n}\n\nasync function readConfig<T>(configFile: string, request: ReadConfigRequest): Promise<ReadConfigResult<T>> {\n const data = await fs.readFile(configFile, \"utf8\")\n let result\n if (configFile.endsWith(\".json5\") || configFile.endsWith(\".json\")) {\n result = require(\"json5\").parse(data)\n }\n else if (configFile.endsWith(\".js\") || configFile.endsWith(\".cjs\")) {\n result = Line truncated
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "read-config-file",
|
||||
"version": "6.3.2",
|
||||
"main": "out/main.js",
|
||||
"author": "Vladimir Krivosheev",
|
||||
"license": "MIT",
|
||||
"repository": "develar/read-config-file",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"bugs": "https://github.com/develar/read-config-file/issues",
|
||||
"homepage": "https://github.com/develar/read-config-file",
|
||||
"files": [
|
||||
"out"
|
||||
],
|
||||
"dependencies": {
|
||||
"config-file-ts": "^0.2.4",
|
||||
"dotenv": "^9.0.2",
|
||||
"dotenv-expand": "^5.1.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json5": "^2.2.0",
|
||||
"lazy-val": "^1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^4.0.1",
|
||||
"@types/node": "^15.0.2",
|
||||
"typescript": "^4.2.4"
|
||||
},
|
||||
"typings": "./out/main.d.ts",
|
||||
"scripts": {
|
||||
"compile": "tsc",
|
||||
"release": "pnpm compile && pnpm publish --no-git-checks"
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
## read-config-file
|
||||
|
||||
Read configuration file in various formats:
|
||||
|
||||
* yml
|
||||
* json5
|
||||
* json
|
||||
* js
|
||||
* cjs
|
||||
* toml (if installed, `yarn add toml`).
|
||||
* ts
|
||||
Reference in new issue
Block a user