@ooneex/app-env 0.0.18 → 1.0.0

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/README.md CHANGED
@@ -1,10 +1,8 @@
1
1
  # @ooneex/app-env
2
2
 
3
- A lightweight application environment configuration and management utility for TypeScript applications. This package provides type-safe environment detection with boolean flags for all common deployment environments, making it easy to write environment-specific logic.
3
+ Environment detection and configuration management for Ooneex applications supports development, staging, production, and testing environments.
4
4
 
5
5
  ![Bun](https://img.shields.io/badge/Bun-Compatible-orange?style=flat-square&logo=bun)
6
- ![Deno](https://img.shields.io/badge/Deno-Compatible-blue?style=flat-square&logo=deno)
7
- ![Node.js](https://img.shields.io/badge/Node.js-Compatible-green?style=flat-square&logo=node.js)
8
6
  ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square&logo=typescript)
9
7
  ![MIT License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)
10
8
 
@@ -24,26 +22,10 @@ A lightweight application environment configuration and management utility for T
24
22
 
25
23
  ## Installation
26
24
 
27
- ### Bun
28
25
  ```bash
29
26
  bun add @ooneex/app-env
30
27
  ```
31
28
 
32
- ### pnpm
33
- ```bash
34
- pnpm add @ooneex/app-env
35
- ```
36
-
37
- ### Yarn
38
- ```bash
39
- yarn add @ooneex/app-env
40
- ```
41
-
42
- ### npm
43
- ```bash
44
- npm install @ooneex/app-env
45
- ```
46
-
47
29
  ## Usage
48
30
 
49
31
  ### Basic Usage
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type AppEnvClassType = new (env: EnvType) => IAppEnv;
1
+ type AppEnvClassType = new (env: EnvironmentNameType) => IAppEnv;
2
2
  declare enum Environment {
3
3
  LOCAL = "local",
4
4
  DEVELOPMENT = "development",
@@ -16,9 +16,9 @@ declare enum Environment {
16
16
  HOTFIX = "hotfix",
17
17
  PRODUCTION = "production"
18
18
  }
19
- type EnvType = `${Environment}`;
19
+ type EnvironmentNameType = `${Environment}`;
20
20
  interface IAppEnv {
21
- readonly env: EnvType;
21
+ readonly env: EnvironmentNameType;
22
22
  readonly isLocal: boolean;
23
23
  readonly isDevelopment: boolean;
24
24
  readonly isStaging: boolean;
@@ -36,7 +36,7 @@ interface IAppEnv {
36
36
  readonly isProduction: boolean;
37
37
  }
38
38
  declare class AppEnv implements IAppEnv {
39
- readonly env: EnvType;
39
+ readonly env: EnvironmentNameType;
40
40
  readonly isLocal: boolean;
41
41
  readonly isDevelopment: boolean;
42
42
  readonly isStaging: boolean;
@@ -52,10 +52,10 @@ declare class AppEnv implements IAppEnv {
52
52
  readonly isCanary: boolean;
53
53
  readonly isHotfix: boolean;
54
54
  readonly isProduction: boolean;
55
- constructor(env: EnvType);
55
+ constructor(env: EnvironmentNameType);
56
56
  }
57
57
  import { Exception } from "@ooneex/exception";
58
58
  declare class AppEnvException extends Exception {
59
59
  constructor(message: string, data?: Record<string, unknown>);
60
60
  }
61
- export { IAppEnv, Environment, EnvType, AppEnvException, AppEnvClassType, AppEnv };
61
+ export { IAppEnv, EnvironmentNameType, Environment, AppEnvException, AppEnvClassType, AppEnv };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import{Exception as t}from"@ooneex/exception";import{HttpStatus as s}from"@ooneex/http-status";class o extends t{constructor(i,a={}){super(i,{status:s.Code.InternalServerError,data:a});this.name="AppEnvException"}}class n{env;isLocal;isDevelopment;isStaging;isTesting;isTest;isQa;isUat;isIntegration;isPreview;isDemo;isSandbox;isBeta;isCanary;isHotfix;isProduction;constructor(i){if(this.env=i,!this.env)throw new o("APP_ENV is not set");this.isLocal=this.env==="local",this.isDevelopment=this.env==="development",this.isStaging=this.env==="staging",this.isTesting=this.env==="testing",this.isTest=this.env==="test",this.isQa=this.env==="qa",this.isUat=this.env==="uat",this.isIntegration=this.env==="integration",this.isPreview=this.env==="preview",this.isDemo=this.env==="demo",this.isSandbox=this.env==="sandbox",this.isBeta=this.env==="beta",this.isCanary=this.env==="canary",this.isHotfix=this.env==="hotfix",this.isProduction=this.env==="production"}}var l;((e)=>{e.LOCAL="local";e.DEVELOPMENT="development";e.STAGING="staging";e.TESTING="testing";e.TEST="test";e.QA="qa";e.UAT="uat";e.INTEGRATION="integration";e.PREVIEW="preview";e.DEMO="demo";e.SANDBOX="sandbox";e.BETA="beta";e.CANARY="canary";e.HOTFIX="hotfix";e.PRODUCTION="production"})(l||={});export{l as Environment,o as AppEnvException,n as AppEnv};
1
+ import{Exception as t}from"@ooneex/exception";import{HttpStatus as s}from"@ooneex/http-status";class i extends t{constructor(o,a={}){super(o,{status:s.Code.InternalServerError,data:a});this.name="AppEnvException"}}class n{env;isLocal;isDevelopment;isStaging;isTesting;isTest;isQa;isUat;isIntegration;isPreview;isDemo;isSandbox;isBeta;isCanary;isHotfix;isProduction;constructor(o){if(!o)throw new i("APP_ENV is not set");this.env=o,this.isLocal=this.env==="local",this.isDevelopment=this.env==="development",this.isStaging=this.env==="staging",this.isTesting=this.env==="testing",this.isTest=this.env==="test",this.isQa=this.env==="qa",this.isUat=this.env==="uat",this.isIntegration=this.env==="integration",this.isPreview=this.env==="preview",this.isDemo=this.env==="demo",this.isSandbox=this.env==="sandbox",this.isBeta=this.env==="beta",this.isCanary=this.env==="canary",this.isHotfix=this.env==="hotfix",this.isProduction=this.env==="production"}}var l;((e)=>{e.LOCAL="local";e.DEVELOPMENT="development";e.STAGING="staging";e.TESTING="testing";e.TEST="test";e.QA="qa";e.UAT="uat";e.INTEGRATION="integration";e.PREVIEW="preview";e.DEMO="demo";e.SANDBOX="sandbox";e.BETA="beta";e.CANARY="canary";e.HOTFIX="hotfix";e.PRODUCTION="production"})(l||={});export{l as Environment,i as AppEnvException,n as AppEnv};
2
2
 
3
- //# debugId=BB5FB3BC5D59A11664756E2164756E21
3
+ //# debugId=7277D6B6EF1A17E064756E2164756E21
package/dist/index.js.map CHANGED
@@ -3,10 +3,10 @@
3
3
  "sources": ["src/AppEnvException.ts", "src/AppEnv.ts", "src/types.ts"],
4
4
  "sourcesContent": [
5
5
  "import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class AppEnvException extends Exception {\n constructor(message: string, data: Record<string, unknown> = {}) {\n super(message, {\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n this.name = \"AppEnvException\";\n }\n}\n",
6
- "import { AppEnvException } from \"./AppEnvException\";\nimport type { EnvType, IAppEnv } from \"./types\";\n\nexport class AppEnv implements IAppEnv {\n public readonly env: EnvType;\n public readonly isLocal: boolean;\n public readonly isDevelopment: boolean;\n public readonly isStaging: boolean;\n public readonly isTesting: boolean;\n public readonly isTest: boolean;\n public readonly isQa: boolean;\n public readonly isUat: boolean;\n public readonly isIntegration: boolean;\n public readonly isPreview: boolean;\n public readonly isDemo: boolean;\n public readonly isSandbox: boolean;\n public readonly isBeta: boolean;\n public readonly isCanary: boolean;\n public readonly isHotfix: boolean;\n public readonly isProduction: boolean;\n\n public constructor(env: EnvType) {\n this.env = env;\n\n if (!this.env) {\n throw new AppEnvException(\"APP_ENV is not set\");\n }\n\n this.isLocal = this.env === \"local\";\n this.isDevelopment = this.env === \"development\";\n this.isStaging = this.env === \"staging\";\n this.isTesting = this.env === \"testing\";\n this.isTest = this.env === \"test\";\n this.isQa = this.env === \"qa\";\n this.isUat = this.env === \"uat\";\n this.isIntegration = this.env === \"integration\";\n this.isPreview = this.env === \"preview\";\n this.isDemo = this.env === \"demo\";\n this.isSandbox = this.env === \"sandbox\";\n this.isBeta = this.env === \"beta\";\n this.isCanary = this.env === \"canary\";\n this.isHotfix = this.env === \"hotfix\";\n this.isProduction = this.env === \"production\";\n }\n}\n",
7
- "export type AppEnvClassType = new (env: EnvType) => IAppEnv;\n\nexport enum Environment {\n LOCAL = \"local\",\n DEVELOPMENT = \"development\",\n STAGING = \"staging\",\n TESTING = \"testing\",\n TEST = \"test\",\n QA = \"qa\",\n UAT = \"uat\",\n INTEGRATION = \"integration\",\n PREVIEW = \"preview\",\n DEMO = \"demo\",\n SANDBOX = \"sandbox\",\n BETA = \"beta\",\n CANARY = \"canary\",\n HOTFIX = \"hotfix\",\n PRODUCTION = \"production\",\n}\n\nexport type EnvType = `${Environment}`;\n\nexport interface IAppEnv {\n readonly env: EnvType;\n readonly isLocal: boolean;\n readonly isDevelopment: boolean;\n readonly isStaging: boolean;\n readonly isTesting: boolean;\n readonly isTest: boolean;\n readonly isQa: boolean;\n readonly isUat: boolean;\n readonly isIntegration: boolean;\n readonly isPreview: boolean;\n readonly isDemo: boolean;\n readonly isSandbox: boolean;\n readonly isBeta: boolean;\n readonly isCanary: boolean;\n readonly isHotfix: boolean;\n readonly isProduction: boolean;\n}\n"
6
+ "import { AppEnvException } from \"./AppEnvException\";\nimport type { EnvironmentNameType, IAppEnv } from \"./types\";\n\nexport class AppEnv implements IAppEnv {\n public readonly env: EnvironmentNameType;\n public readonly isLocal: boolean;\n public readonly isDevelopment: boolean;\n public readonly isStaging: boolean;\n public readonly isTesting: boolean;\n public readonly isTest: boolean;\n public readonly isQa: boolean;\n public readonly isUat: boolean;\n public readonly isIntegration: boolean;\n public readonly isPreview: boolean;\n public readonly isDemo: boolean;\n public readonly isSandbox: boolean;\n public readonly isBeta: boolean;\n public readonly isCanary: boolean;\n public readonly isHotfix: boolean;\n public readonly isProduction: boolean;\n\n public constructor(env: EnvironmentNameType) {\n if (!env) {\n throw new AppEnvException(\"APP_ENV is not set\");\n }\n\n this.env = env;\n this.isLocal = this.env === \"local\";\n this.isDevelopment = this.env === \"development\";\n this.isStaging = this.env === \"staging\";\n this.isTesting = this.env === \"testing\";\n this.isTest = this.env === \"test\";\n this.isQa = this.env === \"qa\";\n this.isUat = this.env === \"uat\";\n this.isIntegration = this.env === \"integration\";\n this.isPreview = this.env === \"preview\";\n this.isDemo = this.env === \"demo\";\n this.isSandbox = this.env === \"sandbox\";\n this.isBeta = this.env === \"beta\";\n this.isCanary = this.env === \"canary\";\n this.isHotfix = this.env === \"hotfix\";\n this.isProduction = this.env === \"production\";\n }\n}\n",
7
+ "export type AppEnvClassType = new (env: EnvironmentNameType) => IAppEnv;\n\nexport enum Environment {\n LOCAL = \"local\",\n DEVELOPMENT = \"development\",\n STAGING = \"staging\",\n TESTING = \"testing\",\n TEST = \"test\",\n QA = \"qa\",\n UAT = \"uat\",\n INTEGRATION = \"integration\",\n PREVIEW = \"preview\",\n DEMO = \"demo\",\n SANDBOX = \"sandbox\",\n BETA = \"beta\",\n CANARY = \"canary\",\n HOTFIX = \"hotfix\",\n PRODUCTION = \"production\",\n}\n\nexport type EnvironmentNameType = `${Environment}`;\n\nexport interface IAppEnv {\n readonly env: EnvironmentNameType;\n readonly isLocal: boolean;\n readonly isDevelopment: boolean;\n readonly isStaging: boolean;\n readonly isTesting: boolean;\n readonly isTest: boolean;\n readonly isQa: boolean;\n readonly isUat: boolean;\n readonly isIntegration: boolean;\n readonly isPreview: boolean;\n readonly isDemo: boolean;\n readonly isSandbox: boolean;\n readonly isBeta: boolean;\n readonly isCanary: boolean;\n readonly isHotfix: boolean;\n readonly isProduction: boolean;\n}\n"
8
8
  ],
9
- "mappings": "AAAA,oBAAS,0BACT,qBAAS,4BAEF,MAAM,UAAwB,CAAU,CAC7C,WAAW,CAAC,EAAiB,EAAgC,CAAC,EAAG,CAC/D,MAAM,EAAS,CACb,OAAQ,EAAW,KAAK,oBACxB,MACF,CAAC,EACD,KAAK,KAAO,kBAEhB,CCRO,MAAM,CAA0B,CACrB,IACA,QACA,cACA,UACA,UACA,OACA,KACA,MACA,cACA,UACA,OACA,UACA,OACA,SACA,SACA,aAET,WAAW,CAAC,EAAc,CAG/B,GAFA,KAAK,IAAM,EAEP,CAAC,KAAK,IACR,MAAM,IAAI,EAAgB,oBAAoB,EAGhD,KAAK,QAAU,KAAK,MAAQ,QAC5B,KAAK,cAAgB,KAAK,MAAQ,cAClC,KAAK,UAAY,KAAK,MAAQ,UAC9B,KAAK,UAAY,KAAK,MAAQ,UAC9B,KAAK,OAAS,KAAK,MAAQ,OAC3B,KAAK,K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AQ,UAC9B,KAAK,OAAS,KAAK,MAAQ,OAC3B,KAAK,UAAY,KAAK,MAAQ,UAC9B,KAAK,OAAS,KAAK,MAAQ,OAC3B,KAAK,SAAW,KAAK,MAAQ,SAC7B,KAAK,SAAW,KAAK,MAAQ,SAC7B,KAAK,aAAe,KAAK,MAAQ,aAErC,CCzCO,IAAK,GAAL,CAAK,IAAL,CACL,QAAQ,QACR,cAAc,cACd,UAAU,UACV,UAAU,UACV,OAAO,OACP,KAAK,KACL,MAAM,MACN,cAAc,cACd,UAAU,UACV,OAAO,OACP,UAAU,UACV,OAAO,OACP,SAAS,SACT,SAAS,SACT,aAAa,eAfH",
10
+ "debugId": "7277D6B6EF1A17E064756E2164756E21",
11
11
  "names": []
12
12
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ooneex/app-env",
3
- "description": "Application environment configuration and management utilities for Ooneex framework",
4
- "version": "0.0.18",
3
+ "description": "Environment detection and configuration management for Ooneex applications — supports development, staging, production, and testing environments",
4
+ "version": "1.0.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -28,8 +28,8 @@
28
28
  "npm:publish": "bun publish --tolerate-republish --access public"
29
29
  },
30
30
  "dependencies": {
31
- "@ooneex/exception": "0.0.17",
32
- "@ooneex/http-status": "0.0.17"
31
+ "@ooneex/exception": "0.0.18",
32
+ "@ooneex/http-status": "0.0.18"
33
33
  },
34
34
  "devDependencies": {},
35
35
  "keywords": [