@adviser/cement 0.3.3 → 0.3.4
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/{base-sys-abstraction-CR_Z-Ceg.d.ts → base-sys-abstraction-B-PcaG0B.d.ts} +1 -1
- package/{base-sys-abstraction-DWtPI7Kg.d.cts → base-sys-abstraction-CLlfCI2Q.d.cts} +1 -1
- package/cf/index.cjs +100 -280
- package/cf/index.cjs.map +1 -1
- package/cf/index.d.cts +3 -17
- package/cf/index.d.ts +3 -17
- package/cf/index.js +39 -6
- package/cf/index.js.map +1 -1
- package/{chunk-PRCFKZR7.js → chunk-5GJADB3C.js} +8 -6
- package/{chunk-PRCFKZR7.js.map → chunk-5GJADB3C.js.map} +1 -1
- package/chunk-MFC4AD5O.js +88 -0
- package/chunk-MFC4AD5O.js.map +1 -0
- package/{chunk-P6LDM7PY.js → chunk-OQ4NGEJR.js} +46 -497
- package/chunk-OQ4NGEJR.js.map +1 -0
- package/deno/index.cjs +74 -160
- package/deno/index.cjs.map +1 -1
- package/deno/index.d.cts +3 -23
- package/deno/index.d.ts +3 -23
- package/deno/index.js +174 -8
- package/deno/index.js.map +1 -1
- package/{index-BfZxTAe_.d.cts → index-CI2cJ0-W.d.cts} +1 -1
- package/{index-CfSl8Gmj.d.ts → index-ChpAZoUE.d.ts} +1 -1
- package/index.cjs +90 -260
- package/index.cjs.map +1 -1
- package/index.d.cts +5 -5
- package/index.d.ts +5 -5
- package/index.js +7 -6
- package/index.js.map +1 -1
- package/node/index.cjs +43 -129
- package/node/index.cjs.map +1 -1
- package/node/index.d.cts +3 -16
- package/node/index.d.ts +3 -16
- package/node/index.js +179 -8
- package/node/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cf/cf-env-actions.ts +53 -0
- package/src/cf/cf-sys-abstraction.ts +1 -53
- package/src/deno/deno-env-actions.ts +57 -0
- package/src/deno/deno-sys-abstraction.ts +1 -57
- package/src/jsr.json +1 -1
- package/src/node/node-env-actions.ts +45 -0
- package/src/node/node-sys-abstraction.ts +1 -45
- package/src/sys-env.ts +4 -4
- package/src/web/web-env-actions.ts +41 -0
- package/src/web/web-sys-abstraction.ts +1 -41
- package/{sys-abstraction-GNnBj2sz.d.cts → sys-abstraction-Coxu8BjZ.d.cts} +1 -1
- package/{sys-abstraction-GNnBj2sz.d.ts → sys-abstraction-Coxu8BjZ.d.ts} +1 -1
- package/test/index.cjs +60 -230
- package/test/index.cjs.map +1 -1
- package/test/index.d.cts +2 -2
- package/test/index.d.ts +2 -2
- package/test/index.js +3 -2
- package/ts/cf/cf-env-actions.d.ts +16 -0
- package/ts/cf/cf-env-actions.d.ts.map +1 -0
- package/ts/cf/cf-env-actions.js +51 -0
- package/ts/cf/cf-env-actions.js.map +1 -0
- package/ts/cf/cf-sys-abstraction.d.ts +1 -15
- package/ts/cf/cf-sys-abstraction.d.ts.map +1 -1
- package/ts/cf/cf-sys-abstraction.js +0 -50
- package/ts/cf/cf-sys-abstraction.js.map +1 -1
- package/ts/crypto.test.js +8 -1
- package/ts/crypto.test.js.map +1 -1
- package/ts/deno/deno-env-actions.d.ts +23 -0
- package/ts/deno/deno-env-actions.d.ts.map +1 -0
- package/ts/deno/deno-env-actions.js +46 -0
- package/ts/deno/deno-env-actions.js.map +1 -0
- package/ts/deno/deno-sys-abstraction.d.ts +1 -22
- package/ts/deno/deno-sys-abstraction.d.ts.map +1 -1
- package/ts/deno/deno-sys-abstraction.js +0 -45
- package/ts/deno/deno-sys-abstraction.js.map +1 -1
- package/ts/node/node-env-actions.d.ts +15 -0
- package/ts/node/node-env-actions.d.ts.map +1 -0
- package/ts/node/node-env-actions.js +44 -0
- package/ts/node/node-env-actions.js.map +1 -0
- package/ts/node/node-sys-abstraction.d.ts +1 -14
- package/ts/node/node-sys-abstraction.d.ts.map +1 -1
- package/ts/node/node-sys-abstraction.js +0 -43
- package/ts/node/node-sys-abstraction.js.map +1 -1
- package/ts/sys-env.js +4 -4
- package/ts/sys-env.js.map +1 -1
- package/ts/sys-env.test.js +2 -2
- package/ts/sys-env.test.js.map +1 -1
- package/ts/web/web-env-actions.d.ts +14 -0
- package/ts/web/web-env-actions.d.ts.map +1 -0
- package/ts/web/web-env-actions.js +35 -0
- package/ts/web/web-env-actions.js.map +1 -0
- package/ts/web/web-sys-abstraction.d.ts +0 -13
- package/ts/web/web-sys-abstraction.d.ts.map +1 -1
- package/ts/web/web-sys-abstraction.js +0 -34
- package/ts/web/web-sys-abstraction.js.map +1 -1
- package/web/index.cjs +51 -233
- package/web/index.cjs.map +1 -1
- package/web/index.d.cts +3 -15
- package/web/index.d.ts +3 -15
- package/web/index.js +2 -3
- package/chunk-P6LDM7PY.js.map +0 -1
package/test/index.cjs
CHANGED
@@ -80,8 +80,8 @@ var Future = class {
|
|
80
80
|
__privateAdd(this, _rejectFn, () => {
|
81
81
|
throw new Error("This Promise is not working as expected.");
|
82
82
|
});
|
83
|
-
__privateSet(this, _promise, new Promise((
|
84
|
-
__privateSet(this, _resolveFn,
|
83
|
+
__privateSet(this, _promise, new Promise((resolve, reject) => {
|
84
|
+
__privateSet(this, _resolveFn, resolve);
|
85
85
|
__privateSet(this, _rejectFn, reject);
|
86
86
|
}));
|
87
87
|
}
|
@@ -513,9 +513,9 @@ var SysTime = class extends Time {
|
|
513
513
|
return /* @__PURE__ */ new Date();
|
514
514
|
}
|
515
515
|
Sleep(duration) {
|
516
|
-
return new Promise((
|
516
|
+
return new Promise((resolve) => {
|
517
517
|
setTimeout(() => {
|
518
|
-
|
518
|
+
resolve();
|
519
519
|
}, duration);
|
520
520
|
});
|
521
521
|
}
|
@@ -842,12 +842,7 @@ function runtimeFn() {
|
|
842
842
|
};
|
843
843
|
}
|
844
844
|
|
845
|
-
// src/deno/deno-
|
846
|
-
var path = __toESM(require("path"), 1);
|
847
|
-
var Deno = globalThis.Deno;
|
848
|
-
|
849
|
-
// src/deno/deno-sys-abstraction.ts
|
850
|
-
var Deno2 = globalThis.Deno;
|
845
|
+
// src/deno/deno-env-actions.ts
|
851
846
|
var once = new ResolveOnce();
|
852
847
|
var _deno;
|
853
848
|
var _DenoEnvActions = class _DenoEnvActions {
|
@@ -887,95 +882,8 @@ var _DenoEnvActions = class _DenoEnvActions {
|
|
887
882
|
};
|
888
883
|
_deno = new WeakMap();
|
889
884
|
var DenoEnvActions = _DenoEnvActions;
|
890
|
-
var DenoExitServiceImpl = class {
|
891
|
-
constructor() {
|
892
|
-
this._exitHandlers = [];
|
893
|
-
this.invoked = false;
|
894
|
-
this._handleExit = async () => {
|
895
|
-
if (this.invoked) {
|
896
|
-
return;
|
897
|
-
}
|
898
|
-
this.invoked = true;
|
899
|
-
for (const h of this._exitHandlers) {
|
900
|
-
try {
|
901
|
-
const ret = h.hdl();
|
902
|
-
if (typeof ret.then === "function") {
|
903
|
-
await ret;
|
904
|
-
}
|
905
|
-
} finally {
|
906
|
-
}
|
907
|
-
}
|
908
|
-
};
|
909
|
-
globalThis.addEventListener("unhandledrejection", (e) => {
|
910
|
-
e.preventDefault();
|
911
|
-
this.exit(19);
|
912
|
-
});
|
913
|
-
globalThis.addEventListener("error", () => {
|
914
|
-
this.exit(19);
|
915
|
-
});
|
916
|
-
globalThis.addEventListener("uncaughtException", () => {
|
917
|
-
this.exit(19);
|
918
|
-
});
|
919
|
-
globalThis.addEventListener("unload", () => {
|
920
|
-
this.exit(0);
|
921
|
-
});
|
922
|
-
Deno2.addSignalListener("SIGQUIT", () => {
|
923
|
-
this.exit(3);
|
924
|
-
});
|
925
|
-
Deno2.addSignalListener("SIGINT", () => {
|
926
|
-
this.exit(2);
|
927
|
-
});
|
928
|
-
Deno2.addSignalListener("SIGTERM", () => {
|
929
|
-
this.exit(9);
|
930
|
-
});
|
931
|
-
}
|
932
|
-
injectExitHandlers(hdls) {
|
933
|
-
this._exitHandlers = hdls;
|
934
|
-
}
|
935
|
-
exit(code) {
|
936
|
-
this._handleExit().then(() => {
|
937
|
-
Deno2.exit(code);
|
938
|
-
}).catch((err) => {
|
939
|
-
console.error("ExitService: failed to handle exit", err);
|
940
|
-
Deno2.exit(code);
|
941
|
-
});
|
942
|
-
}
|
943
|
-
};
|
944
|
-
var _DenoSystemService = class _DenoSystemService {
|
945
|
-
constructor() {
|
946
|
-
this._exitService = new DenoExitServiceImpl();
|
947
|
-
this._exitService.injectExitHandlers(_DenoSystemService._exitHandlers);
|
948
|
-
}
|
949
|
-
Env() {
|
950
|
-
return envFactory();
|
951
|
-
}
|
952
|
-
Args() {
|
953
|
-
return Deno2.args;
|
954
|
-
}
|
955
|
-
OnExit(hdl) {
|
956
|
-
const id = crypto.randomUUID();
|
957
|
-
_DenoSystemService._exitHandlers.push({ hdl, id });
|
958
|
-
return () => {
|
959
|
-
const idx = _DenoSystemService._exitHandlers.findIndex((h) => h.id === id);
|
960
|
-
if (idx >= 0) {
|
961
|
-
_DenoSystemService._exitHandlers.splice(idx, 1);
|
962
|
-
}
|
963
|
-
};
|
964
|
-
}
|
965
|
-
Exit(code) {
|
966
|
-
this._exitService.exit(code);
|
967
|
-
}
|
968
|
-
};
|
969
|
-
_DenoSystemService._exitHandlers = [];
|
970
|
-
var DenoSystemService = _DenoSystemService;
|
971
|
-
|
972
|
-
// src/node/node-file-service.ts
|
973
|
-
var import_node_path = __toESM(require("path"), 1);
|
974
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
975
|
-
var import_node_process = __toESM(require("process"), 1);
|
976
885
|
|
977
|
-
// src/node/node-
|
978
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
886
|
+
// src/node/node-env-actions.ts
|
979
887
|
var once2 = new ResolveOnce();
|
980
888
|
var _node;
|
981
889
|
var _NodeEnvActions = class _NodeEnvActions {
|
@@ -1013,96 +921,51 @@ var _NodeEnvActions = class _NodeEnvActions {
|
|
1013
921
|
};
|
1014
922
|
_node = new WeakMap();
|
1015
923
|
var NodeEnvActions = _NodeEnvActions;
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
}
|
1024
|
-
this.invoked = true;
|
1025
|
-
for (const h of this._exitHandlers) {
|
1026
|
-
try {
|
1027
|
-
const ret = h.hdl();
|
1028
|
-
if (typeof ret.then === "function") {
|
1029
|
-
await ret;
|
1030
|
-
}
|
1031
|
-
} finally {
|
1032
|
-
}
|
1033
|
-
}
|
1034
|
-
};
|
1035
|
-
import_node_process2.default.on("unhandledRejection", (reason, p) => {
|
1036
|
-
this.exit(19);
|
1037
|
-
});
|
1038
|
-
import_node_process2.default.on("uncaughtException", (error) => {
|
1039
|
-
this.exit(18);
|
1040
|
-
});
|
1041
|
-
import_node_process2.default.on("close", () => {
|
1042
|
-
this.exit(0);
|
1043
|
-
});
|
1044
|
-
import_node_process2.default.on("exit", () => {
|
1045
|
-
this.exit(0);
|
1046
|
-
});
|
1047
|
-
import_node_process2.default.on("SIGQUIT", () => {
|
1048
|
-
this.exit(3);
|
1049
|
-
});
|
1050
|
-
import_node_process2.default.on("SIGINT", () => {
|
1051
|
-
this.exit(2);
|
1052
|
-
});
|
1053
|
-
import_node_process2.default.on("SIGTERM", () => {
|
1054
|
-
this.exit(9);
|
1055
|
-
});
|
924
|
+
|
925
|
+
// src/web/web-env-actions.ts
|
926
|
+
var once3 = new ResolveOnce();
|
927
|
+
var BrowserEnvActions = class _BrowserEnvActions {
|
928
|
+
constructor(opts) {
|
929
|
+
this.env = /* @__PURE__ */ new Map();
|
930
|
+
this.opts = opts;
|
1056
931
|
}
|
1057
|
-
|
1058
|
-
|
932
|
+
static new(opts) {
|
933
|
+
return once3.once(() => new _BrowserEnvActions(opts));
|
1059
934
|
}
|
1060
|
-
|
1061
|
-
this.
|
1062
|
-
import_node_process2.default.exit(code);
|
1063
|
-
}).catch((err) => {
|
1064
|
-
console.error("ExitService: failed to handle exit", err);
|
1065
|
-
import_node_process2.default.exit(code);
|
1066
|
-
});
|
935
|
+
get(key2) {
|
936
|
+
return this.env.get(key2);
|
1067
937
|
}
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
this._exitService.injectExitHandlers(_NodeSystemService._exitHandlers);
|
938
|
+
set(key2, value) {
|
939
|
+
if (value) {
|
940
|
+
this.env.set(key2, value);
|
941
|
+
}
|
1073
942
|
}
|
1074
|
-
|
1075
|
-
|
943
|
+
delete(key2) {
|
944
|
+
this.env.delete(key2);
|
1076
945
|
}
|
1077
|
-
|
1078
|
-
return
|
946
|
+
keys() {
|
947
|
+
return Array.from(this.env.keys());
|
1079
948
|
}
|
1080
|
-
|
1081
|
-
|
1082
|
-
_NodeSystemService._exitHandlers.push({ hdl, id });
|
1083
|
-
return () => {
|
1084
|
-
const idx = _NodeSystemService._exitHandlers.findIndex((h) => h.id === id);
|
1085
|
-
if (idx >= 0) {
|
1086
|
-
_NodeSystemService._exitHandlers.splice(idx, 1);
|
1087
|
-
}
|
1088
|
-
};
|
949
|
+
active() {
|
950
|
+
return true;
|
1089
951
|
}
|
1090
|
-
|
1091
|
-
this.
|
952
|
+
register(env) {
|
953
|
+
const sym = Symbol.for(this.opts.symbol || "CP_ENV");
|
954
|
+
const browser = globalThis;
|
955
|
+
browser[sym] = env;
|
956
|
+
return env;
|
1092
957
|
}
|
1093
958
|
};
|
1094
|
-
_NodeSystemService._exitHandlers = [];
|
1095
|
-
var NodeSystemService = _NodeSystemService;
|
1096
959
|
|
1097
|
-
// src/cf/cf-
|
1098
|
-
var
|
960
|
+
// src/cf/cf-env-actions.ts
|
961
|
+
var once4 = new ResolveOnce();
|
1099
962
|
var CFEnvActions = class _CFEnvActions {
|
1100
963
|
constructor(env) {
|
1101
964
|
this.injectOnRegister = {};
|
1102
965
|
this.cfEnv = new Map(Object.entries(env.presetEnv || {}));
|
1103
966
|
}
|
1104
967
|
static new(opts) {
|
1105
|
-
return
|
968
|
+
return once4.once(() => new _CFEnvActions(opts));
|
1106
969
|
}
|
1107
970
|
static inject(o) {
|
1108
971
|
const env = _CFEnvActions.new({});
|
@@ -1158,12 +1021,12 @@ function envFactory(opts = {}) {
|
|
1158
1021
|
}
|
1159
1022
|
return _envFactories.get(found.id).once(() => {
|
1160
1023
|
const action = found.fn(opts);
|
1161
|
-
const ret = new
|
1024
|
+
const ret = new EnvImpl(action, opts);
|
1162
1025
|
action.register(ret);
|
1163
1026
|
return ret;
|
1164
1027
|
});
|
1165
1028
|
}
|
1166
|
-
var
|
1029
|
+
var EnvImpl = class {
|
1167
1030
|
constructor(map, opts = {}) {
|
1168
1031
|
this._onSet = [];
|
1169
1032
|
this._map = map;
|
@@ -1232,39 +1095,6 @@ var EnvImpl2 = class {
|
|
1232
1095
|
};
|
1233
1096
|
|
1234
1097
|
// src/web/web-sys-abstraction.ts
|
1235
|
-
var once4 = new ResolveOnce();
|
1236
|
-
var BrowserEnvActions = class _BrowserEnvActions {
|
1237
|
-
constructor(opts) {
|
1238
|
-
this.env = /* @__PURE__ */ new Map();
|
1239
|
-
this.opts = opts;
|
1240
|
-
}
|
1241
|
-
static new(opts) {
|
1242
|
-
return once4.once(() => new _BrowserEnvActions(opts));
|
1243
|
-
}
|
1244
|
-
get(key2) {
|
1245
|
-
return this.env.get(key2);
|
1246
|
-
}
|
1247
|
-
set(key2, value) {
|
1248
|
-
if (value) {
|
1249
|
-
this.env.set(key2, value);
|
1250
|
-
}
|
1251
|
-
}
|
1252
|
-
delete(key2) {
|
1253
|
-
this.env.delete(key2);
|
1254
|
-
}
|
1255
|
-
keys() {
|
1256
|
-
return Array.from(this.env.keys());
|
1257
|
-
}
|
1258
|
-
active() {
|
1259
|
-
return true;
|
1260
|
-
}
|
1261
|
-
register(env) {
|
1262
|
-
const sym = Symbol.for(this.opts.symbol || "CP_ENV");
|
1263
|
-
const browser = globalThis;
|
1264
|
-
browser[sym] = env;
|
1265
|
-
return env;
|
1266
|
-
}
|
1267
|
-
};
|
1268
1098
|
var WebFileService = class {
|
1269
1099
|
get baseDir() {
|
1270
1100
|
throw new Error("basedir-Method not implemented.");
|
@@ -1475,23 +1305,23 @@ var Path = class {
|
|
1475
1305
|
this.parts.push(part);
|
1476
1306
|
}
|
1477
1307
|
};
|
1478
|
-
function splitPath(
|
1308
|
+
function splitPath(path) {
|
1479
1309
|
const p = new Path();
|
1480
|
-
if (
|
1310
|
+
if (path === "") {
|
1481
1311
|
return p;
|
1482
1312
|
}
|
1483
|
-
for (let count = 0;
|
1484
|
-
if (
|
1313
|
+
for (let count = 0; path.length; count++) {
|
1314
|
+
if (path.match(/^\/+/)) {
|
1485
1315
|
if (count === 0) {
|
1486
1316
|
p.add(3 /* Root */);
|
1487
1317
|
} else {
|
1488
1318
|
p.add(1 /* Slash */);
|
1489
1319
|
}
|
1490
|
-
|
1320
|
+
path = path.replace(/^\/+/, "");
|
1491
1321
|
} else {
|
1492
|
-
const part =
|
1322
|
+
const part = path.replace(/\/.*$/, "");
|
1493
1323
|
p.add(part);
|
1494
|
-
|
1324
|
+
path = path.replace(/^[^/]+/, "");
|
1495
1325
|
}
|
1496
1326
|
}
|
1497
1327
|
return p;
|
@@ -1500,29 +1330,29 @@ function pathJoin(...paths) {
|
|
1500
1330
|
let prev = "";
|
1501
1331
|
const res = [];
|
1502
1332
|
for (let i = 0; i < paths.length; i++) {
|
1503
|
-
const
|
1504
|
-
if (
|
1333
|
+
const path = paths[i];
|
1334
|
+
if (path === "") {
|
1505
1335
|
continue;
|
1506
1336
|
}
|
1507
|
-
if (!(prev.endsWith("/") ||
|
1337
|
+
if (!(prev.endsWith("/") || path.startsWith("/"))) {
|
1508
1338
|
if (prev !== "") {
|
1509
1339
|
res.push("/");
|
1510
1340
|
}
|
1511
|
-
res.push(
|
1341
|
+
res.push(path);
|
1512
1342
|
} else {
|
1513
|
-
res.push(
|
1343
|
+
res.push(path);
|
1514
1344
|
}
|
1515
|
-
prev =
|
1345
|
+
prev = path;
|
1516
1346
|
}
|
1517
1347
|
return res.join("");
|
1518
1348
|
}
|
1519
|
-
function relativePath(
|
1520
|
-
const relativeParts = splitPath(
|
1349
|
+
function relativePath(path, relative) {
|
1350
|
+
const relativeParts = splitPath(relative);
|
1521
1351
|
let result;
|
1522
1352
|
if (relativeParts.parts[0] === 3 /* Root */) {
|
1523
|
-
result =
|
1353
|
+
result = relative;
|
1524
1354
|
} else {
|
1525
|
-
result = pathJoin(
|
1355
|
+
result = pathJoin(path, relative);
|
1526
1356
|
}
|
1527
1357
|
const unoptPath = splitPath(result);
|
1528
1358
|
const out = [];
|
@@ -1574,12 +1404,12 @@ function stripper(strip, obj) {
|
|
1574
1404
|
});
|
1575
1405
|
return localStripper(void 0, restrips, obj);
|
1576
1406
|
}
|
1577
|
-
function localStripper(
|
1407
|
+
function localStripper(path, restrips, obj) {
|
1578
1408
|
if (typeof obj !== "object" || obj === null) {
|
1579
1409
|
return obj;
|
1580
1410
|
}
|
1581
1411
|
if (Array.isArray(obj)) {
|
1582
|
-
return obj.map((i) => localStripper(
|
1412
|
+
return obj.map((i) => localStripper(path, restrips, i));
|
1583
1413
|
}
|
1584
1414
|
const ret = { ...obj };
|
1585
1415
|
const matcher = (key2, nextPath) => {
|
@@ -1593,8 +1423,8 @@ function localStripper(path3, restrips, obj) {
|
|
1593
1423
|
for (const key2 in ret) {
|
1594
1424
|
if (Object.prototype.hasOwnProperty.call(ret, key2)) {
|
1595
1425
|
let nextPath;
|
1596
|
-
if (
|
1597
|
-
nextPath = [
|
1426
|
+
if (path) {
|
1427
|
+
nextPath = [path, key2].join(".");
|
1598
1428
|
} else {
|
1599
1429
|
nextPath = key2;
|
1600
1430
|
}
|
@@ -2475,8 +2305,8 @@ var LoggerImpl = class _LoggerImpl {
|
|
2475
2305
|
return this.Uint64(key2, value);
|
2476
2306
|
}
|
2477
2307
|
async Flush() {
|
2478
|
-
return new Promise((
|
2479
|
-
this._logWriter._flush(void 0,
|
2308
|
+
return new Promise((resolve) => {
|
2309
|
+
this._logWriter._flush(void 0, resolve);
|
2480
2310
|
});
|
2481
2311
|
}
|
2482
2312
|
With() {
|