@alwatr/env 5.5.28 → 5.5.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.5.30](https://github.com/Alwatr/nanolib/compare/@alwatr/env@5.5.29...@alwatr/env@5.5.30) (2026-03-18)
7
+
8
+ **Note:** Version bump only for package @alwatr/env
9
+
10
+ ## [5.5.29](https://github.com/Alwatr/nanolib/compare/@alwatr/env@5.5.28...@alwatr/env@5.5.29) (2026-03-16)
11
+
12
+ ### 🔨 Code Refactoring
13
+
14
+ * migrate build scripts from yarn to bun across multiple packages ([d90e962](https://github.com/Alwatr/nanolib/commit/d90e962f15e5c951e191d5f02341279b6472abc3))
15
+
16
+ ### 🔗 Dependencies update
17
+
18
+ * bump the npm-dependencies group with 10 updates ([c48d9ba](https://github.com/Alwatr/nanolib/commit/c48d9baa1cd7c2dc144b3e01e0fda60bf87c074c))
19
+
6
20
  ## [5.5.28](https://github.com/Alwatr/nanolib/compare/@alwatr/env@5.5.27...@alwatr/env@5.5.28) (2026-02-18)
7
21
 
8
22
  ### 🔗 Dependencies update
package/dist/main.cjs CHANGED
@@ -1,4 +1,3 @@
1
- /** 📦 @alwatr/env v5.5.28 */
2
- __dev_mode__: console.debug("📦 @alwatr/env v5.5.28");
1
+ /** 📦 @alwatr/env v5.5.30 */
3
2
  "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{getEnv:()=>getEnv});module.exports=__toCommonJS(main_exports);var import_platform_info=require("@alwatr/platform-info");function getEnv(option){let value=process.env[option.name];if(value==="")value=void 0;if(import_platform_info.platformInfo.development===true){value??=option.developmentValue??option.defaultValue}else{value??=option.defaultValue}if(value===void 0){throw new Error(`Environment variable "${option.name}" is required.`)}return value}0&&(module.exports={getEnv});
4
3
  //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import {platformInfo} from '@alwatr/platform-info';\n\n/**\n * Parameters for retrieving an environment variable value.\n */\nexport type GetEnvOption = {\n /**\n * The name of the environment variable.\n */\n name: string;\n\n /**\n * The default value to use if the environment variable is not set.\n * If not provided, the environment variable is required and an error will be thrown if it is not set.\n * Except in development mode, where the development value will be used instead if provided.\n */\n defaultValue?: string;\n\n /**\n * The value to use in a development environment.\n * It will be overwrite the default value in development mode and completely ignored in production mode.\n */\n developmentValue?: string;\n};\n\nexport function getEnv(option: GetEnvOption): string {\n let value = process.env[option.name];\n if (value === '') value = undefined; // empty string is considered as undefined in environment variables\n\n if (platformInfo.development === true) {\n value ??= option.developmentValue ?? option.defaultValue;\n }\n else {\n value ??= option.defaultValue;\n }\n\n if (value === undefined) {\n throw new Error(`Environment variable \"${option.name}\" is required.`);\n }\n\n return value;\n}\n"],
5
- "mappings": ";;qqBAAA,kIAA2B,iCAyBpB,SAAS,OAAO,OAA8B,CACnD,IAAI,MAAQ,QAAQ,IAAI,OAAO,IAAI,EACnC,GAAI,QAAU,GAAI,MAAQ,OAE1B,GAAI,kCAAa,cAAgB,KAAM,CACrC,QAAU,OAAO,kBAAoB,OAAO,YAC9C,KACK,CACH,QAAU,OAAO,YACnB,CAEA,GAAI,QAAU,OAAW,CACvB,MAAM,IAAI,MAAM,yBAAyB,OAAO,IAAI,gBAAgB,CACtE,CAEA,OAAO,KACT",
5
+ "mappings": ";qqBAAA,kIAA2B,iCAyBpB,SAAS,OAAO,OAA8B,CACnD,IAAI,MAAQ,QAAQ,IAAI,OAAO,IAAI,EACnC,GAAI,QAAU,GAAI,MAAQ,OAE1B,GAAI,kCAAa,cAAgB,KAAM,CACrC,QAAU,OAAO,kBAAoB,OAAO,YAC9C,KACK,CACH,QAAU,OAAO,YACnB,CAEA,GAAI,QAAU,OAAW,CACvB,MAAM,IAAI,MAAM,yBAAyB,OAAO,IAAI,gBAAgB,CACtE,CAEA,OAAO,KACT",
6
6
  "names": []
7
7
  }
package/dist/main.mjs CHANGED
@@ -1,4 +1,3 @@
1
- /** 📦 @alwatr/env v5.5.28 */
2
- __dev_mode__: console.debug("📦 @alwatr/env v5.5.28");
1
+ /** 📦 @alwatr/env v5.5.30 */
3
2
  import{platformInfo}from"@alwatr/platform-info";function getEnv(option){let value=process.env[option.name];if(value==="")value=void 0;if(platformInfo.development===true){value??=option.developmentValue??option.defaultValue}else{value??=option.defaultValue}if(value===void 0){throw new Error(`Environment variable "${option.name}" is required.`)}return value}export{getEnv};
4
3
  //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import {platformInfo} from '@alwatr/platform-info';\n\n/**\n * Parameters for retrieving an environment variable value.\n */\nexport type GetEnvOption = {\n /**\n * The name of the environment variable.\n */\n name: string;\n\n /**\n * The default value to use if the environment variable is not set.\n * If not provided, the environment variable is required and an error will be thrown if it is not set.\n * Except in development mode, where the development value will be used instead if provided.\n */\n defaultValue?: string;\n\n /**\n * The value to use in a development environment.\n * It will be overwrite the default value in development mode and completely ignored in production mode.\n */\n developmentValue?: string;\n};\n\nexport function getEnv(option: GetEnvOption): string {\n let value = process.env[option.name];\n if (value === '') value = undefined; // empty string is considered as undefined in environment variables\n\n if (platformInfo.development === true) {\n value ??= option.developmentValue ?? option.defaultValue;\n }\n else {\n value ??= option.defaultValue;\n }\n\n if (value === undefined) {\n throw new Error(`Environment variable \"${option.name}\" is required.`);\n }\n\n return value;\n}\n"],
5
- "mappings": ";;AAAA,OAAQ,iBAAmB,wBAyBpB,SAAS,OAAO,OAA8B,CACnD,IAAI,MAAQ,QAAQ,IAAI,OAAO,IAAI,EACnC,GAAI,QAAU,GAAI,MAAQ,OAE1B,GAAI,aAAa,cAAgB,KAAM,CACrC,QAAU,OAAO,kBAAoB,OAAO,YAC9C,KACK,CACH,QAAU,OAAO,YACnB,CAEA,GAAI,QAAU,OAAW,CACvB,MAAM,IAAI,MAAM,yBAAyB,OAAO,IAAI,gBAAgB,CACtE,CAEA,OAAO,KACT",
5
+ "mappings": ";AAAA,OAAQ,iBAAmB,wBAyBpB,SAAS,OAAO,OAA8B,CACnD,IAAI,MAAQ,QAAQ,IAAI,OAAO,IAAI,EACnC,GAAI,QAAU,GAAI,MAAQ,OAE1B,GAAI,aAAa,cAAgB,KAAM,CACrC,QAAU,OAAO,kBAAoB,OAAO,YAC9C,KACK,CACH,QAAU,OAAO,YACnB,CAEA,GAAI,QAAU,OAAW,CACvB,MAAM,IAAI,MAAM,yBAAyB,OAAO,IAAI,gBAAgB,CACtE,CAEA,OAAO,KACT",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@alwatr/env",
3
3
  "description": "A tiny and tree-shakable TypeScript library to get environment variables with type-safe and fallback value for development and production.",
4
- "version": "5.5.28",
4
+ "version": "5.5.30",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "bugs": "https://github.com/Alwatr/nanolib/issues",
7
7
  "dependencies": {
8
- "@alwatr/platform-info": "5.5.28"
8
+ "@alwatr/platform-info": "5.5.29"
9
9
  },
10
10
  "devDependencies": {
11
- "@alwatr/nano-build": "6.4.1",
11
+ "@alwatr/nano-build": "6.4.2",
12
12
  "@alwatr/prettier-config": "6.0.2",
13
13
  "@alwatr/tsconfig-base": "6.0.4",
14
- "@alwatr/type-helper": "7.0.1",
15
- "@types/node": "^24.10.13",
14
+ "@alwatr/type-helper": "7.0.2",
15
+ "@types/node": "^24.12.0",
16
16
  "typescript": "^5.9.3"
17
17
  },
18
18
  "exports": {
@@ -59,23 +59,23 @@
59
59
  "directory": "packages/env"
60
60
  },
61
61
  "scripts": {
62
- "b": "yarn run build",
63
- "build": "yarn run build:ts && yarn run build:es",
62
+ "b": "bun run build",
63
+ "build": "bun run build:ts && bun run build:es",
64
64
  "build:es": "nano-build --preset=module",
65
65
  "build:ts": "tsc --build",
66
- "c": "yarn run clean",
67
- "cb": "yarn run clean && yarn run build",
66
+ "c": "bun run clean",
67
+ "cb": "bun run clean && bun run build",
68
68
  "clean": "rm -rfv dist *.tsbuildinfo",
69
- "d": "yarn run build:es && yarn node --enable-source-maps --trace-warnings",
70
- "t": "yarn run test",
71
- "test": "NODE_OPTIONS=\"$NODE_OPTIONS --enable-source-maps --experimental-vm-modules\" jest",
72
- "w": "yarn run watch",
73
- "watch": "yarn run watch:ts & yarn run watch:es",
74
- "watch:es": "yarn run build:es --watch",
75
- "watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
69
+ "d": "bun run build:es && bun --enable-source-maps --trace-warnings",
70
+ "t": "bun run test",
71
+ "test": "bun test",
72
+ "w": "bun run watch",
73
+ "watch": "bun run watch:ts & bun run watch:es",
74
+ "watch:es": "bun run build:es --watch",
75
+ "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
76
76
  },
77
77
  "sideEffects": false,
78
78
  "type": "module",
79
79
  "types": "./dist/main.d.ts",
80
- "gitHead": "f9f9ba54b319ce8ccc6968059b222e89f4b5d149"
80
+ "gitHead": "def1decf8f496f4b0d3d3ab952c346c689c30160"
81
81
  }