veryfront 0.1.694 → 0.1.695
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/esm/deno.js +1 -1
- package/esm/src/platform/compat/process/env.d.ts.map +1 -1
- package/esm/src/platform/compat/process/env.js +0 -7
- package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -1
- package/esm/src/platform/compat/process/lifecycle.js +6 -3
- package/esm/src/server/project-env/storage.d.ts.map +1 -1
- package/esm/src/server/project-env/storage.js +0 -98
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/env.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC;AAoBF,oDAAoD;AACpD,wBAAgB,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmB5C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS1D;AAqCD,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAWtD;AAKD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAUD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;AAOpE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9D,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;AAUpE,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,UAAQ,EAChB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAmBT;AAED,gBAAgB;AAChB,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAgBvD;AAED,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAgB3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAS/D"}
|
|
@@ -13,10 +13,6 @@ function getOverlayEnvValue(store, key) {
|
|
|
13
13
|
const value = store.get(key);
|
|
14
14
|
return { hasValue: true, value: value ?? undefined };
|
|
15
15
|
}
|
|
16
|
-
function getHostProcessEnvFromProjectProxy(key) {
|
|
17
|
-
const getter = dntShim.dntGlobalThis.__vfHostProcessEnvGetter;
|
|
18
|
-
return typeof getter === "function" ? getter(key) : undefined;
|
|
19
|
-
}
|
|
20
16
|
/** Read and write process environment variables. */
|
|
21
17
|
export function env() {
|
|
22
18
|
const base = IS_DENO
|
|
@@ -47,9 +43,6 @@ export function getHostEnv(key) {
|
|
|
47
43
|
}
|
|
48
44
|
if (IS_DENO)
|
|
49
45
|
return dntShim.Deno.env.get(key);
|
|
50
|
-
const projectProxyHostValue = getHostProcessEnvFromProjectProxy(key);
|
|
51
|
-
if (projectProxyHostValue !== undefined)
|
|
52
|
-
return projectProxyHostValue;
|
|
53
46
|
if (runtimeProcess)
|
|
54
47
|
return runtimeProcess.env[key];
|
|
55
48
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/process/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAIrD,6EAA6E;AAC7E,wBAAgB,OAAO,IAAI,MAAM,EAAE,CAIlC;AAED,yFAAyF;AACzF,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAIzC;AAED,4CAA4C;AAC5C,wBAAgB,GAAG,IAAI,MAAM,CAI5B;AAED,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAU7C;AAED,wBAAgB,GAAG,IAAI,MAAM,CAI5B;AAED,wBAAgB,WAAW,IAAI;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAYA;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAIvC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAIrC;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAoBnE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAO1C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAQlC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,QAAQ,GAAG,SAAS,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MAAM,CAQlC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,QAAQ,GAAG,SAAS,EAC5B,OAAO,EAAE,MAAM,IAAI,GAClB,IAAI,CAMN;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,GAAG,oBAAoB,KAAK,OAAO,GAAG,IAAI,GAC1F,IAAI,CAiDN;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAYhF;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAIjC;AAED;;;GAGG;AACH,wBAAgB,MAAM,IAAI,MAAM,CAU/B;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI;IAAE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAAG,IAAI,CAUpE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAcxE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAsBjD"}
|
|
@@ -193,12 +193,15 @@ export function onGlobalError(onError) {
|
|
|
193
193
|
* Unreference a timer to prevent it from keeping the process alive
|
|
194
194
|
*/
|
|
195
195
|
export function unrefTimer(timerId) {
|
|
196
|
-
if (IS_DENO && typeof dntShim.Deno.unrefTimer === "function") {
|
|
196
|
+
if (IS_DENO && typeof dntShim.Deno.unrefTimer === "function" && typeof timerId === "number") {
|
|
197
197
|
dntShim.Deno.unrefTimer(timerId);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
if (timerId && typeof timerId === "object"
|
|
201
|
-
timerId.unref
|
|
200
|
+
if (timerId && typeof timerId === "object") {
|
|
201
|
+
const unref = timerId.unref;
|
|
202
|
+
if (typeof unref === "function") {
|
|
203
|
+
unref.call(timerId);
|
|
204
|
+
}
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
207
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/src/server/project-env/storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/src/server/project-env/storage.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAEjF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAE1E"}
|
|
@@ -9,108 +9,11 @@
|
|
|
9
9
|
import * as dntShim from "../../../_dnt.shims.js";
|
|
10
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11
11
|
const projectEnvStorage = new AsyncLocalStorage();
|
|
12
|
-
const PROCESS_ENV_PROXY_FLAG = "__vfProjectEnvProcessProxyInstalled";
|
|
13
|
-
const PROCESS_ENV_PROXY_REF = "__vfProjectEnvProcessProxy";
|
|
14
|
-
const PROCESS_ENV_HOST_GETTER = "__vfHostProcessEnvGetter";
|
|
15
|
-
function getGlobalProcess() {
|
|
16
|
-
const candidate = dntShim.dntGlobalThis.process;
|
|
17
|
-
return candidate && typeof candidate === "object" ? candidate : undefined;
|
|
18
|
-
}
|
|
19
|
-
function getActiveStore() {
|
|
20
|
-
return projectEnvStorage.getStore();
|
|
21
|
-
}
|
|
22
|
-
function installProcessEnvProxy() {
|
|
23
|
-
const globals = dntShim.dntGlobalThis;
|
|
24
|
-
const processLike = getGlobalProcess();
|
|
25
|
-
if (!processLike?.env)
|
|
26
|
-
return;
|
|
27
|
-
if (globals[PROCESS_ENV_PROXY_FLAG] && globals[PROCESS_ENV_PROXY_REF] === processLike.env)
|
|
28
|
-
return;
|
|
29
|
-
const hostEnv = processLike.env;
|
|
30
|
-
globals[PROCESS_ENV_HOST_GETTER] = (key) => hostEnv[key];
|
|
31
|
-
const proxy = new Proxy(hostEnv, {
|
|
32
|
-
get(target, property, receiver) {
|
|
33
|
-
if (typeof property !== "string") {
|
|
34
|
-
return Reflect.get(target, property, receiver);
|
|
35
|
-
}
|
|
36
|
-
const store = getActiveStore();
|
|
37
|
-
if (store !== undefined) {
|
|
38
|
-
return Object.prototype.hasOwnProperty.call(store, property) ? store[property] : undefined;
|
|
39
|
-
}
|
|
40
|
-
return target[property];
|
|
41
|
-
},
|
|
42
|
-
set(target, property, value, receiver) {
|
|
43
|
-
if (typeof property !== "string") {
|
|
44
|
-
return Reflect.set(target, property, value, receiver);
|
|
45
|
-
}
|
|
46
|
-
const normalized = String(value);
|
|
47
|
-
const store = getActiveStore();
|
|
48
|
-
if (store !== undefined) {
|
|
49
|
-
store[property] = normalized;
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
target[property] = normalized;
|
|
53
|
-
return true;
|
|
54
|
-
},
|
|
55
|
-
deleteProperty(target, property) {
|
|
56
|
-
if (typeof property !== "string") {
|
|
57
|
-
return Reflect.deleteProperty(target, property);
|
|
58
|
-
}
|
|
59
|
-
const store = getActiveStore();
|
|
60
|
-
if (store !== undefined) {
|
|
61
|
-
delete store[property];
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
return Reflect.deleteProperty(target, property);
|
|
65
|
-
},
|
|
66
|
-
has(target, property) {
|
|
67
|
-
if (typeof property !== "string") {
|
|
68
|
-
return Reflect.has(target, property);
|
|
69
|
-
}
|
|
70
|
-
const store = getActiveStore();
|
|
71
|
-
if (store !== undefined) {
|
|
72
|
-
return Object.prototype.hasOwnProperty.call(store, property);
|
|
73
|
-
}
|
|
74
|
-
return property in target;
|
|
75
|
-
},
|
|
76
|
-
ownKeys(target) {
|
|
77
|
-
const store = getActiveStore();
|
|
78
|
-
return store !== undefined ? Reflect.ownKeys(store) : Reflect.ownKeys(target);
|
|
79
|
-
},
|
|
80
|
-
getOwnPropertyDescriptor(target, property) {
|
|
81
|
-
if (typeof property !== "string") {
|
|
82
|
-
return Reflect.getOwnPropertyDescriptor(target, property);
|
|
83
|
-
}
|
|
84
|
-
const store = getActiveStore();
|
|
85
|
-
if (store !== undefined) {
|
|
86
|
-
if (!Object.prototype.hasOwnProperty.call(store, property)) {
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
configurable: true,
|
|
91
|
-
enumerable: true,
|
|
92
|
-
writable: true,
|
|
93
|
-
value: store[property],
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return Reflect.getOwnPropertyDescriptor(target, property);
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(processLike, "env", {
|
|
100
|
-
configurable: true,
|
|
101
|
-
enumerable: true,
|
|
102
|
-
writable: true,
|
|
103
|
-
value: proxy,
|
|
104
|
-
});
|
|
105
|
-
globals[PROCESS_ENV_PROXY_FLAG] = true;
|
|
106
|
-
globals[PROCESS_ENV_PROXY_REF] = proxy;
|
|
107
|
-
}
|
|
108
12
|
/**
|
|
109
13
|
* Run a function with project-specific environment variables.
|
|
110
14
|
* Within the callback, `getProjectEnv()` will return values from `vars`.
|
|
111
15
|
*/
|
|
112
16
|
export function runWithProjectEnv(vars, fn) {
|
|
113
|
-
installProcessEnvProxy();
|
|
114
17
|
return projectEnvStorage.run(vars, fn);
|
|
115
18
|
}
|
|
116
19
|
/**
|
|
@@ -141,4 +44,3 @@ export function getProjectEnvSnapshot() {
|
|
|
141
44
|
dntShim.dntGlobalThis.__vfProjectEnvGetter = getProjectEnv;
|
|
142
45
|
dntShim.dntGlobalThis.__vfProjectEnvActiveChecker = isProjectEnvActive;
|
|
143
46
|
dntShim.dntGlobalThis.__vfProjectEnvSnapshotGetter = getProjectEnvSnapshot;
|
|
144
|
-
installProcessEnvProxy();
|