Compare commits

..

No commits in common. "master" and "v6.0.8" have entirely different histories.

5 changed files with 3894 additions and 7711 deletions

View File

@ -1,11 +1,5 @@
# Changelog # Changelog
## 2024-11-22 - 6.1.0 - feat(core)
Added new method getEnvVarOnDemandStrict to throw error for unset env vars
- Introduced getEnvVarOnDemandStrict method in Qenv class for strict retrieval of environment variables.
- Upgraded various @git.zone and @push.rocks dependencies for improved functionality and security.
## 2024-11-18 - 6.0.8 - fix(Qenv) ## 2024-11-18 - 6.0.8 - fix(Qenv)
Fix environment file path initialization logic. Fix environment file path initialization logic.

View File

@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/qenv", "name": "@push.rocks/qenv",
"version": "6.1.0", "version": "6.0.8",
"private": false, "private": false,
"description": "A module for easily handling environment variables in Node.js projects with support for .yml and .json configuration.", "description": "A module for easily handling environment variables in Node.js projects with support for .yml and .json configuration.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -31,18 +31,18 @@
}, },
"homepage": "https://code.foss.global/push.rocks/qenv", "homepage": "https://code.foss.global/push.rocks/qenv",
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.2.0", "@git.zone/tsbuild": "^2.1.72",
"@git.zone/tsrun": "^1.3.3", "@git.zone/tsrun": "^1.2.44",
"@git.zone/tstest": "^1.0.90", "@git.zone/tstest": "^1.0.86",
"@push.rocks/tapbundle": "^5.5.0", "@push.rocks/tapbundle": "^5.0.15",
"@types/node": "^22.9.1" "@types/node": "^20.11.17"
}, },
"dependencies": { "dependencies": {
"@api.global/typedrequest": "^3.1.10", "@api.global/typedrequest": "^3.0.4",
"@configvault.io/interfaces": "^1.0.17", "@configvault.io/interfaces": "^1.0.17",
"@push.rocks/smartfile": "^11.0.21", "@push.rocks/smartfile": "^11.0.4",
"@push.rocks/smartlog": "^3.0.7", "@push.rocks/smartlog": "^3.0.3",
"@push.rocks/smartpath": "^5.0.18" "@push.rocks/smartpath": "^5.0.11"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

11562
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/qenv', name: '@push.rocks/qenv',
version: '6.1.0', version: '6.0.8',
description: 'A module for easily handling environment variables in Node.js projects with support for .yml and .json configuration.' description: 'A module for easily handling environment variables in Node.js projects with support for .yml and .json configuration.'
} }

View File

@ -111,21 +111,6 @@ export class Qenv {
} }
} }
/**
* Like getEnvVarOnDemand, but throws an error if the env var is not set.
* @param envVarNameOrNames
* @returns
*/
public async getEnvVarOnDemandStrict(
envVarNameOrNames: TEnvVarRef | TEnvVarRef[]
): Promise<string> {
const value = await this.getEnvVarOnDemand(envVarNameOrNames);
if (!value) {
throw new Error(`Env var ${envVarNameOrNames} is not set!`);
}
return value;
}
public getEnvVarOnDemandSync(envVarNameOrNames: string | string[]): string | undefined { public getEnvVarOnDemandSync(envVarNameOrNames: string | string[]): string | undefined {
console.warn('requesting env var sync leaves out potentially important async env sources.'); console.warn('requesting env var sync leaves out potentially important async env sources.');