fix(core): update
This commit is contained in:
parent
b644ca0c1a
commit
754ffa6cac
12
package.json
12
package.json
@ -27,16 +27,16 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/qenv#README",
|
"homepage": "https://gitlab.com/pushrocks/qenv#README",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.66",
|
"@git.zone/tsbuild": "^2.1.72",
|
||||||
"@git.zone/tsrun": "^1.2.44",
|
"@git.zone/tsrun": "^1.2.44",
|
||||||
"@git.zone/tstest": "^1.0.77",
|
"@git.zone/tstest": "^1.0.86",
|
||||||
"@push.rocks/tapbundle": "^5.0.15",
|
"@push.rocks/tapbundle": "^5.0.15",
|
||||||
"@types/node": "^20.8.7"
|
"@types/node": "^20.11.17"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@api.global/typedrequest": "^3.0.2",
|
"@api.global/typedrequest": "^3.0.4",
|
||||||
"@configvault.io/interfaces": "^1.0.13",
|
"@configvault.io/interfaces": "^1.0.17",
|
||||||
"@push.rocks/smartfile": "^10.0.33",
|
"@push.rocks/smartfile": "^11.0.4",
|
||||||
"@push.rocks/smartlog": "^3.0.3",
|
"@push.rocks/smartlog": "^3.0.3",
|
||||||
"@push.rocks/smartpath": "^5.0.11"
|
"@push.rocks/smartpath": "^5.0.11"
|
||||||
},
|
},
|
||||||
|
948
pnpm-lock.yaml
generated
948
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/qenv',
|
name: '@push.rocks/qenv',
|
||||||
version: '6.0.4',
|
version: '6.0.5',
|
||||||
description: 'easy promised environments'
|
description: 'easy promised environments'
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as plugins from './qenv.plugins.js';
|
import * as plugins from './qenv.plugins.js';
|
||||||
|
|
||||||
export class ConfigVaultAdapter {
|
export class CloudlyAdapter {
|
||||||
public configVaultUrl: string;
|
public configVaultUrl: string;
|
||||||
|
|
||||||
constructor(configVaultUrl?: string) {
|
constructor(configVaultUrl?: string) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ConfigVaultAdapter } from './qenv.classes.configvaultadapter.js';
|
import { CloudlyAdapter } from './qenv.classes.configvaultadapter.js';
|
||||||
import * as plugins from './qenv.plugins.js';
|
import * as plugins from './qenv.plugins.js';
|
||||||
|
|
||||||
export type TEnvVarRef = string | (() => Promise<string>);
|
export type TEnvVarRef = string | (() => Promise<string>);
|
||||||
@ -10,17 +10,17 @@ export class Qenv {
|
|||||||
public keyValueObject: { [key: string]: any } = {};
|
public keyValueObject: { [key: string]: any } = {};
|
||||||
public logger = new plugins.smartlog.ConsoleLog();
|
public logger = new plugins.smartlog.ConsoleLog();
|
||||||
|
|
||||||
public configVaultAdapter: ConfigVaultAdapter;
|
public cloudlyAdapter: CloudlyAdapter;
|
||||||
|
|
||||||
public qenvFilePathAbsolute: string;
|
public qenvFilePathAbsolute: string;
|
||||||
public envFilePathAbsolute: string;
|
public envFilePathAbsolute: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
qenvFileBasePathArg: string = process.cwd(),
|
qenvFileBasePathArg: string = process.cwd(),
|
||||||
envFileBasePathArg: string,
|
envFileBasePathArg?: string,
|
||||||
failOnMissing: boolean = true
|
failOnMissing: boolean = true
|
||||||
) {
|
) {
|
||||||
this.configVaultAdapter = new ConfigVaultAdapter();
|
this.cloudlyAdapter = new CloudlyAdapter();
|
||||||
this.initializeFilePaths(qenvFileBasePathArg, envFileBasePathArg);
|
this.initializeFilePaths(qenvFileBasePathArg, envFileBasePathArg);
|
||||||
this.loadRequiredEnvVars();
|
this.loadRequiredEnvVars();
|
||||||
this.loadAvailableEnvVars();
|
this.loadAvailableEnvVars();
|
||||||
@ -32,10 +32,12 @@ export class Qenv {
|
|||||||
plugins.path.resolve(qenvFileBasePathArg),
|
plugins.path.resolve(qenvFileBasePathArg),
|
||||||
'qenv.yml'
|
'qenv.yml'
|
||||||
);
|
);
|
||||||
this.envFilePathAbsolute = plugins.path.join(
|
if (envFileBasePathArg) {
|
||||||
plugins.path.resolve(envFileBasePathArg),
|
this.envFilePathAbsolute = plugins.path.join(
|
||||||
'env.json'
|
plugins.path.resolve(envFileBasePathArg),
|
||||||
);
|
'env.json'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadRequiredEnvVars() {
|
private loadRequiredEnvVars() {
|
||||||
@ -144,6 +146,9 @@ export class Qenv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getFromEnvJsonFile(envVarName: string): string | undefined {
|
private getFromEnvJsonFile(envVarName: string): string | undefined {
|
||||||
|
if (!plugins.smartfile.fs.fileExistsSync(this.envFilePathAbsolute)) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const envJson = plugins.smartfile.fs.toObjectSync(this.envFilePathAbsolute);
|
const envJson = plugins.smartfile.fs.toObjectSync(this.envFilePathAbsolute);
|
||||||
const value = envJson[envVarName];
|
const value = envJson[envVarName];
|
||||||
|
Loading…
Reference in New Issue
Block a user