@adonisjs/env 7.0.0-next.3 → 7.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/build/index.js +9 -9
- package/package.json +15 -15
package/build/index.js
CHANGED
|
@@ -6,16 +6,16 @@ import { Exception, RuntimeException, createError } from "@poppinss/utils/except
|
|
|
6
6
|
import { Secret } from "@poppinss/utils";
|
|
7
7
|
import { schema } from "@poppinss/validator-lite";
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
9
|
-
var
|
|
9
|
+
var __exportAll = (all, no_symbols) => {
|
|
10
10
|
let target = {};
|
|
11
11
|
for (var name in all) __defProp(target, name, {
|
|
12
12
|
get: all[name],
|
|
13
13
|
enumerable: true
|
|
14
14
|
});
|
|
15
|
-
if (
|
|
15
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
16
16
|
return target;
|
|
17
17
|
};
|
|
18
|
-
var errors_exports = /* @__PURE__ */
|
|
18
|
+
var errors_exports = /* @__PURE__ */ __exportAll({
|
|
19
19
|
E_IDENTIFIER_ALREADY_DEFINED: () => E_IDENTIFIER_ALREADY_DEFINED,
|
|
20
20
|
E_INVALID_ENV_VARIABLES: () => E_INVALID_ENV_VARIABLES
|
|
21
21
|
});
|
|
@@ -122,8 +122,8 @@ var EnvParser = class EnvParser {
|
|
|
122
122
|
var EnvValidator = class {
|
|
123
123
|
#schema;
|
|
124
124
|
#error;
|
|
125
|
-
constructor(schema
|
|
126
|
-
this.#schema = schema
|
|
125
|
+
constructor(schema) {
|
|
126
|
+
this.#schema = schema;
|
|
127
127
|
this.#error = new E_INVALID_ENV_VARIABLES();
|
|
128
128
|
}
|
|
129
129
|
validate(values) {
|
|
@@ -200,9 +200,9 @@ var Env = class Env {
|
|
|
200
200
|
constructor(values) {
|
|
201
201
|
this.#values = values;
|
|
202
202
|
}
|
|
203
|
-
static async create(appRoot, schema
|
|
203
|
+
static async create(appRoot, schema) {
|
|
204
204
|
const values = await new EnvProcessor(appRoot).process();
|
|
205
|
-
return new Env(this.rules(schema
|
|
205
|
+
return new Env(this.rules(schema).validate(values));
|
|
206
206
|
}
|
|
207
207
|
static identifier(name, callback) {
|
|
208
208
|
return EnvParser.defineIdentifier(name, callback);
|
|
@@ -217,8 +217,8 @@ var Env = class Env {
|
|
|
217
217
|
EnvParser.removeIdentifier(name);
|
|
218
218
|
}
|
|
219
219
|
static schema = schema$1;
|
|
220
|
-
static rules(schema
|
|
221
|
-
return new EnvValidator(schema
|
|
220
|
+
static rules(schema) {
|
|
221
|
+
return new EnvValidator(schema);
|
|
222
222
|
}
|
|
223
223
|
get(key, defaultValue) {
|
|
224
224
|
if (this.#values[key] !== void 0) return this.#values[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/env",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Environment variable manager for Node.js",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"pretest": "npm run lint",
|
|
23
|
-
"test": "cross-env NODE_DEBUG=adonisjs:env
|
|
23
|
+
"test": "cross-env NODE_DEBUG=adonisjs:env npm run quick:test",
|
|
24
24
|
"lint": "eslint .",
|
|
25
25
|
"format": "prettier --write .",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
@@ -34,28 +34,28 @@
|
|
|
34
34
|
"quick:test": "node --import=@poppinss/ts-exec --enable-source-maps bin/test.ts"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@adonisjs/eslint-config": "^3.0.0
|
|
37
|
+
"@adonisjs/eslint-config": "^3.0.0",
|
|
38
38
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
39
|
-
"@adonisjs/tsconfig": "^2.0.0
|
|
39
|
+
"@adonisjs/tsconfig": "^2.0.0",
|
|
40
40
|
"@japa/assert": "^4.2.0",
|
|
41
41
|
"@japa/expect-type": "^2.0.4",
|
|
42
42
|
"@japa/file-system": "^3.0.0",
|
|
43
|
-
"@japa/runner": "^5.
|
|
44
|
-
"@poppinss/ts-exec": "^1.4.
|
|
45
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
46
|
-
"@types/node": "^25.0
|
|
47
|
-
"c8": "^
|
|
43
|
+
"@japa/runner": "^5.3.0",
|
|
44
|
+
"@poppinss/ts-exec": "^1.4.4",
|
|
45
|
+
"@release-it/conventional-changelog": "^10.0.5",
|
|
46
|
+
"@types/node": "^25.3.0",
|
|
47
|
+
"c8": "^11.0.0",
|
|
48
48
|
"cross-env": "^10.1.0",
|
|
49
49
|
"del-cli": "^7.0.0",
|
|
50
|
-
"eslint": "^
|
|
51
|
-
"prettier": "^3.
|
|
52
|
-
"release-it": "^19.
|
|
53
|
-
"tsdown": "^0.
|
|
54
|
-
"typedoc": "^0.28.
|
|
50
|
+
"eslint": "^10.0.2",
|
|
51
|
+
"prettier": "^3.8.1",
|
|
52
|
+
"release-it": "^19.2.4",
|
|
53
|
+
"tsdown": "^0.20.3",
|
|
54
|
+
"typedoc": "^0.28.17",
|
|
55
55
|
"typescript": "^5.9.3"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@poppinss/utils": "^7.0.0
|
|
58
|
+
"@poppinss/utils": "^7.0.0",
|
|
59
59
|
"@poppinss/validator-lite": "^2.1.2",
|
|
60
60
|
"split-lines": "^3.0.0"
|
|
61
61
|
},
|