@prosopo/dotenv 3.0.7 → 3.0.26

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
@@ -1,5 +1,163 @@
1
1
  # @prosopo/dotenv
2
2
 
3
+ ## 3.0.26
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [c9d8fdf]
7
+ - Updated dependencies [b8185a4]
8
+ - @prosopo/common@3.1.21
9
+ - @prosopo/config@3.1.21
10
+
11
+ ## 3.0.25
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [1e3a838]
15
+ - @prosopo/config@3.1.20
16
+ - @prosopo/common@3.1.20
17
+
18
+ ## 3.0.24
19
+ ### Patch Changes
20
+
21
+ - 5659b24: Release 3.4.4
22
+ - Updated dependencies [f912439]
23
+ - Updated dependencies [5659b24]
24
+ - @prosopo/common@3.1.19
25
+ - @prosopo/config@3.1.19
26
+
27
+ ## 3.0.23
28
+ ### Patch Changes
29
+
30
+ - c72ecbd: Reduce noisy logs
31
+ - 50c4120: Release 3.4.3
32
+ - Updated dependencies [50c4120]
33
+ - @prosopo/common@3.1.18
34
+ - @prosopo/config@3.1.18
35
+
36
+ ## 3.0.22
37
+ ### Patch Changes
38
+
39
+ - 618703f: Release 3.4.2
40
+ - Updated dependencies [618703f]
41
+ - @prosopo/common@3.1.17
42
+ - @prosopo/config@3.1.17
43
+
44
+ ## 3.0.21
45
+ ### Patch Changes
46
+
47
+ - 11303d9: Release 3.4.0
48
+ - 18cb28b: Release 3.4.1
49
+ - Updated dependencies [11303d9]
50
+ - Updated dependencies [18cb28b]
51
+ - @prosopo/common@3.1.16
52
+ - @prosopo/config@3.1.16
53
+
54
+ ## 3.0.20
55
+ ### Patch Changes
56
+
57
+ - f3f7aec: Release 3.4.0
58
+ - Updated dependencies [f3f7aec]
59
+ - @prosopo/common@3.1.15
60
+ - @prosopo/config@3.1.15
61
+
62
+ ## 3.0.19
63
+ ### Patch Changes
64
+
65
+ - Release 3.3.1
66
+ - 0824221: Release 3.2.4
67
+ - Updated dependencies
68
+ - Updated dependencies [0824221]
69
+ - @prosopo/common@3.1.14
70
+ - @prosopo/config@3.1.14
71
+
72
+ ## 3.0.18
73
+ ### Patch Changes
74
+
75
+ - 008d112: Release 3.3.0
76
+ - Updated dependencies [008d112]
77
+ - @prosopo/common@3.1.13
78
+ - @prosopo/config@3.1.13
79
+
80
+ ## 3.0.17
81
+ ### Patch Changes
82
+
83
+ - 0824221: Release 3.2.4
84
+ - Updated dependencies [0824221]
85
+ - @prosopo/common@3.1.12
86
+ - @prosopo/config@3.1.12
87
+
88
+ ## 3.0.16
89
+ ### Patch Changes
90
+
91
+ - 1a23649: Release 3.2.3
92
+ - Updated dependencies [1a23649]
93
+ - @prosopo/common@3.1.11
94
+ - @prosopo/config@3.1.11
95
+
96
+ ## 3.0.15
97
+ ### Patch Changes
98
+
99
+ - 657a827: Release 3.2.2
100
+ - Updated dependencies [657a827]
101
+ - @prosopo/common@3.1.10
102
+ - @prosopo/config@3.1.10
103
+
104
+ ## 3.0.14
105
+ ### Patch Changes
106
+
107
+ - 4440947: fix type-only tsc compilation
108
+ - 7bdaca6: Release 3.2.1
109
+ - Updated dependencies [4440947]
110
+ - Updated dependencies [7bdaca6]
111
+ - Updated dependencies [809b984]
112
+ - Updated dependencies [809b984]
113
+ - @prosopo/common@3.1.9
114
+ - @prosopo/config@3.1.9
115
+
116
+ ## 3.0.13
117
+ ### Patch Changes
118
+
119
+ - 6fe8570: Release 3.2.0
120
+ - Updated dependencies [6fe8570]
121
+ - @prosopo/common@3.1.8
122
+ - @prosopo/config@3.1.8
123
+
124
+ ## 3.0.12
125
+ ### Patch Changes
126
+
127
+ - f304be9: Release 3.1.13
128
+ - Updated dependencies [f304be9]
129
+ - @prosopo/common@3.1.7
130
+ - @prosopo/config@3.1.7
131
+
132
+ ## 3.0.11
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [9eed772]
136
+ - @prosopo/config@3.1.6
137
+ - @prosopo/common@3.1.6
138
+
139
+ ## 3.0.10
140
+ ### Patch Changes
141
+
142
+ - 6960643: lint detect missing and unneccessary imports
143
+ - Updated dependencies [6960643]
144
+ - @prosopo/common@3.1.5
145
+
146
+ ## 3.0.9
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies [30e7d4d]
150
+ - @prosopo/config@3.1.5
151
+ - @prosopo/common@3.1.4
152
+
153
+ ## 3.0.8
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies [44ffda2]
157
+ - Updated dependencies [a49b538]
158
+ - @prosopo/config@3.1.4
159
+ - @prosopo/common@3.1.3
160
+
3
161
  ## 3.0.7
4
162
  ### Patch Changes
5
163
 
package/dist/cjs/env.cjs CHANGED
@@ -5,11 +5,12 @@ const path = require("node:path");
5
5
  const node_url = require("node:url");
6
6
  const common = require("@prosopo/common");
7
7
  const dotenv = require("dotenv");
8
- const __filename$1 = node_url.fileURLToPath(module);
8
+ var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
9
+ const __filename$1 = node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("env.cjs", document.baseURI).href);
9
10
  const __dirname$1 = path.dirname(__filename$1);
10
11
  const logger = common.getLogger(
11
12
  common.parseLogLevel(process.env.PROSOPO_LOG_LEVEL, common.LogLevel.enum.info),
12
- module
13
+ typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("env.cjs", document.baseURI).href
13
14
  );
14
15
  function getEnv() {
15
16
  if (process.env.NODE_ENV) {
@@ -25,7 +26,7 @@ function loadEnv(rootDir, filename, filePath, nodeEnv, override = false) {
25
26
  nodeEnv
26
27
  );
27
28
  const args = { path: envPath, override };
28
- logger.info(() => ({
29
+ logger.debug(() => ({
29
30
  data: { envPath },
30
31
  msg: "Loading env"
31
32
  }));
@@ -36,7 +37,7 @@ function getEnvFile(rootDir, filename = ".env", filepath = path.join(__dirname$1
36
37
  const env = nodeEnv || getEnv();
37
38
  const fileNameFull = `${filename}.${env}`;
38
39
  let searchPath = path.resolve(rootDir || ".");
39
- logger.info(() => ({
40
+ logger.debug(() => ({
40
41
  data: { fileName: fileNameFull, searchPath },
41
42
  msg: "Searching"
42
43
  }));
@@ -47,7 +48,7 @@ function getEnvFile(rootDir, filename = ".env", filepath = path.join(__dirname$1
47
48
  fs.readFileSync(path.join(searchPath, "package.json"), "utf8")
48
49
  );
49
50
  if (pkgJson.name === "@prosopo/captcha-private") {
50
- logger.info(() => ({
51
+ logger.debug(() => ({
51
52
  data: { fileName: fileNameFull },
52
53
  msg: "Reached the workspace root package.json, stopping search."
53
54
  }));
@@ -57,7 +58,7 @@ function getEnvFile(rootDir, filename = ".env", filepath = path.join(__dirname$1
57
58
  searchPath = path.resolve(searchPath, "..");
58
59
  levelCount += 1;
59
60
  if (levelCount > 10) {
60
- logger.warn(() => ({
61
+ logger.debug(() => ({
61
62
  data: { fileName: fileNameFull, levelCount },
62
63
  msg: "Checked directories above, stopping search."
63
64
  }));
package/dist/env.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export declare function getEnv(): string;
2
+ export declare function loadEnv(rootDir?: string, filename?: string, filePath?: string, nodeEnv?: string, override?: boolean): string;
3
+ export declare function getEnvFile(rootDir?: string, filename?: string, filepath?: string, nodeEnv?: string): string;
4
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AA2BA,wBAAgB,MAAM,WAKrB;AAED,wBAAgB,OAAO,CACtB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,UAAQ,GACd,MAAM,CAcR;AAUD,wBAAgB,UAAU,CACzB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,SAAS,EACjB,QAAQ,SAAgC,EACxC,OAAO,CAAC,EAAE,MAAM,UA0ChB"}
package/dist/env.js CHANGED
@@ -23,7 +23,7 @@ function loadEnv(rootDir, filename, filePath, nodeEnv, override = false) {
23
23
  nodeEnv
24
24
  );
25
25
  const args = { path: envPath, override };
26
- logger.info(() => ({
26
+ logger.debug(() => ({
27
27
  data: { envPath },
28
28
  msg: "Loading env"
29
29
  }));
@@ -34,7 +34,7 @@ function getEnvFile(rootDir, filename = ".env", filepath = path.join(__dirname,
34
34
  const env = nodeEnv || getEnv();
35
35
  const fileNameFull = `${filename}.${env}`;
36
36
  let searchPath = path.resolve(rootDir || ".");
37
- logger.info(() => ({
37
+ logger.debug(() => ({
38
38
  data: { fileName: fileNameFull, searchPath },
39
39
  msg: "Searching"
40
40
  }));
@@ -45,7 +45,7 @@ function getEnvFile(rootDir, filename = ".env", filepath = path.join(__dirname,
45
45
  fs.readFileSync(path.join(searchPath, "package.json"), "utf8")
46
46
  );
47
47
  if (pkgJson.name === "@prosopo/captcha-private") {
48
- logger.info(() => ({
48
+ logger.debug(() => ({
49
49
  data: { fileName: fileNameFull },
50
50
  msg: "Reached the workspace root package.json, stopping search."
51
51
  }));
@@ -55,7 +55,7 @@ function getEnvFile(rootDir, filename = ".env", filepath = path.join(__dirname,
55
55
  searchPath = path.resolve(searchPath, "..");
56
56
  levelCount += 1;
57
57
  if (levelCount > 10) {
58
- logger.warn(() => ({
58
+ logger.debug(() => ({
59
59
  data: { fileName: fileNameFull, levelCount },
60
60
  msg: "Checked directories above, stopping search."
61
61
  }));
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE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AAC;QAChB,IAAI,UAAU,GAAG,EAAE,EAAE,CAAC;YACrB,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;gBACnB,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE;gBAC5C,GAAG,EAAE,6CAA6C;aAClD,CAAC,CAAC,CAAC;YACJ,MAAM;QACP,CAAC;IACF,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IACtD,OAAO,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;QAC9B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./env.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/dotenv",
3
- "version": "3.0.7",
3
+ "version": "3.0.26",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -14,39 +14,34 @@
14
14
  "license": "Apache-2.0",
15
15
  "private": false,
16
16
  "engines": {
17
- "node": "20",
18
- "npm": "10.8.2"
17
+ "node": ">=v20.0.0",
18
+ "npm": ">=10.6.0"
19
19
  },
20
20
  "scripts": {
21
21
  "clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
22
22
  "build": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
23
23
  "build:tsc": "tsc --build --verbose",
24
24
  "build:cjs": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
25
- "typecheck": "tsc --build --declaration --emitDeclarationOnly",
25
+ "typecheck": "tsc --project tsconfig.types.json",
26
26
  "cli": "node ./dist/js/cli.js"
27
27
  },
28
28
  "type": "module",
29
29
  "dependencies": {
30
- "@prosopo/common": "3.1.2",
31
- "@prosopo/config": "3.1.3",
32
- "@typegoose/auto-increment": "4.13.0",
33
- "axios": "1.10.0",
34
- "dotenv": "16.4.5",
35
- "esbuild": "0.25.6",
36
- "express": "4.21.2",
37
- "openpgp": "5.11.3",
38
- "webpack-dev-server": "5.2.2"
30
+ "@prosopo/common": "3.1.21",
31
+ "@prosopo/config": "3.1.21",
32
+ "dotenv": "16.4.5"
39
33
  },
40
34
  "devDependencies": {
41
- "@vitest/coverage-v8": "3.0.9",
35
+ "@types/node": "22.10.2",
36
+ "@vitest/coverage-v8": "3.2.4",
42
37
  "concurrently": "9.0.1",
43
38
  "del-cli": "6.0.0",
44
39
  "npm-run-all": "4.1.5",
45
40
  "tslib": "2.7.0",
46
41
  "tsx": "4.20.3",
47
42
  "typescript": "5.6.2",
48
- "vite": "6.3.5",
49
- "vitest": "3.0.9"
43
+ "vite": "6.4.1",
44
+ "vitest": "3.2.4"
50
45
  },
51
46
  "repository": {
52
47
  "type": "git",