stuff
This commit is contained in:
1
buildfiles/node_modules/read-config-file/out/deepAssign.d.ts
generated
vendored
Normal file
1
buildfiles/node_modules/read-config-file/out/deepAssign.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function deepAssign<T>(target: T, ...objects: Array<any>): T;
|
41
buildfiles/node_modules/read-config-file/out/deepAssign.js
generated
vendored
Normal file
41
buildfiles/node_modules/read-config-file/out/deepAssign.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
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
buildfiles/node_modules/read-config-file/out/deepAssign.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/read-config-file/out/deepAssign.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"deepAssign.js","sourceRoot":"","sources":["../src/deepAssign.ts"],"names":[],"mappings":";;AAAA,SAAS,QAAQ,CAAC,CAAM;IACtB,I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) {\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
buildfiles/node_modules/read-config-file/out/main.d.ts
generated
vendored
Normal file
20
buildfiles/node_modules/read-config-file/out/main.d.ts
generated
vendored
Normal file
@ -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>;
|
115
buildfiles/node_modules/read-config-file/out/main.js
generated
vendored
Normal file
115
buildfiles/node_modules/read-config-file/out/main.js
generated
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_1 = require("fs");
|
||||
const js_yaml_1 = require("js-yaml");
|
||||
const path = require("path");
|
||||
const dotenv_1 = require("dotenv");
|
||||
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")) {
|
||||
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(".toml")) {
|
||||
result = require("toml").parse(data);
|
||||
}
|
||||
else {
|
||||
result = js_yaml_1.safeLoad(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`]) {
|
||||
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
buildfiles/node_modules/read-config-file/out/main.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/read-config-file/out/main.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
68
buildfiles/node_modules/read-config-file/package.json
generated
vendored
Normal file
68
buildfiles/node_modules/read-config-file/package.json
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"_from": "read-config-file@6.0.0",
|
||||
"_id": "read-config-file@6.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-PHjROSdpceKUmqS06wqwP92VrM46PZSTubmNIMJ5DrMwg1OgenSTSEHIkCa6TiOJ+y/J0xnG1fFwG3M+Oi1aNA==",
|
||||
"_location": "/read-config-file",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "read-config-file@6.0.0",
|
||||
"name": "read-config-file",
|
||||
"escapedName": "read-config-file",
|
||||
"rawSpec": "6.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "6.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/app-builder-lib",
|
||||
"/electron-builder"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-6.0.0.tgz",
|
||||
"_shasum": "224b5dca6a5bdc1fb19e63f89f342680efdb9299",
|
||||
"_spec": "read-config-file@6.0.0",
|
||||
"_where": "/home/shihaam/www/freezer.shihaam.me/node_modules/electron-builder",
|
||||
"author": {
|
||||
"name": "Vladimir Krivosheev"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/develar/read-config-file/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"dotenv": "^8.2.0",
|
||||
"dotenv-expand": "^5.1.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"json5": "^2.1.2",
|
||||
"lazy-val": "^1.0.4"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Read configuration file in various formats:",
|
||||
"devDependencies": {
|
||||
"@types/dotenv": "^8.2.0",
|
||||
"@types/js-yaml": "^3.12.3",
|
||||
"@types/node": "^13.9.8",
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"files": [
|
||||
"out"
|
||||
],
|
||||
"homepage": "https://github.com/develar/read-config-file",
|
||||
"license": "MIT",
|
||||
"main": "out/main.js",
|
||||
"name": "read-config-file",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/develar/read-config-file.git"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "tsc",
|
||||
"release": "yarn compile && npm publish"
|
||||
},
|
||||
"typings": "./out/main.d.ts",
|
||||
"version": "6.0.0"
|
||||
}
|
8
buildfiles/node_modules/read-config-file/readme.md
generated
vendored
Normal file
8
buildfiles/node_modules/read-config-file/readme.md
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
## read-config-file
|
||||
|
||||
Read configuration file in various formats:
|
||||
|
||||
* yml
|
||||
* json5
|
||||
* json
|
||||
* toml (if installed, `yarn add toml`).
|
Reference in New Issue
Block a user