Initial Commit

This commit is contained in:
2026-01-15 21:52:12 +01:00
committed by erik
parent 3ed42cdeb6
commit 5a70f775f1
6702 changed files with 1389544 additions and 0 deletions

21
node_modules/read-config-file/LICENSE generated vendored Normal file
View File

@@ -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
node_modules/read-config-file/out/deepAssign.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function deepAssign<T>(target: T, ...objects: Array<any>): T;

42
node_modules/read-config-file/out/deepAssign.js generated vendored Normal file
View File

@@ -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
node_modules/read-config-file/out/deepAssign.js.map generated vendored Normal file
View File

@@ -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
node_modules/read-config-file/out/main.d.ts generated vendored Normal file
View 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>;

124
node_modules/read-config-file/out/main.js generated vendored Normal file
View File

@@ -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
node_modules/read-config-file/out/main.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

34
node_modules/read-config-file/package.json generated vendored Normal file
View File

@@ -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
node_modules/read-config-file/readme.md generated vendored Normal file
View File

@@ -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