@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.
Files changed (96) hide show
  1. package/{base-sys-abstraction-CR_Z-Ceg.d.ts → base-sys-abstraction-B-PcaG0B.d.ts} +1 -1
  2. package/{base-sys-abstraction-DWtPI7Kg.d.cts → base-sys-abstraction-CLlfCI2Q.d.cts} +1 -1
  3. package/cf/index.cjs +100 -280
  4. package/cf/index.cjs.map +1 -1
  5. package/cf/index.d.cts +3 -17
  6. package/cf/index.d.ts +3 -17
  7. package/cf/index.js +39 -6
  8. package/cf/index.js.map +1 -1
  9. package/{chunk-PRCFKZR7.js → chunk-5GJADB3C.js} +8 -6
  10. package/{chunk-PRCFKZR7.js.map → chunk-5GJADB3C.js.map} +1 -1
  11. package/chunk-MFC4AD5O.js +88 -0
  12. package/chunk-MFC4AD5O.js.map +1 -0
  13. package/{chunk-P6LDM7PY.js → chunk-OQ4NGEJR.js} +46 -497
  14. package/chunk-OQ4NGEJR.js.map +1 -0
  15. package/deno/index.cjs +74 -160
  16. package/deno/index.cjs.map +1 -1
  17. package/deno/index.d.cts +3 -23
  18. package/deno/index.d.ts +3 -23
  19. package/deno/index.js +174 -8
  20. package/deno/index.js.map +1 -1
  21. package/{index-BfZxTAe_.d.cts → index-CI2cJ0-W.d.cts} +1 -1
  22. package/{index-CfSl8Gmj.d.ts → index-ChpAZoUE.d.ts} +1 -1
  23. package/index.cjs +90 -260
  24. package/index.cjs.map +1 -1
  25. package/index.d.cts +5 -5
  26. package/index.d.ts +5 -5
  27. package/index.js +7 -6
  28. package/index.js.map +1 -1
  29. package/node/index.cjs +43 -129
  30. package/node/index.cjs.map +1 -1
  31. package/node/index.d.cts +3 -16
  32. package/node/index.d.ts +3 -16
  33. package/node/index.js +179 -8
  34. package/node/index.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/cf/cf-env-actions.ts +53 -0
  37. package/src/cf/cf-sys-abstraction.ts +1 -53
  38. package/src/deno/deno-env-actions.ts +57 -0
  39. package/src/deno/deno-sys-abstraction.ts +1 -57
  40. package/src/jsr.json +1 -1
  41. package/src/node/node-env-actions.ts +45 -0
  42. package/src/node/node-sys-abstraction.ts +1 -45
  43. package/src/sys-env.ts +4 -4
  44. package/src/web/web-env-actions.ts +41 -0
  45. package/src/web/web-sys-abstraction.ts +1 -41
  46. package/{sys-abstraction-GNnBj2sz.d.cts → sys-abstraction-Coxu8BjZ.d.cts} +1 -1
  47. package/{sys-abstraction-GNnBj2sz.d.ts → sys-abstraction-Coxu8BjZ.d.ts} +1 -1
  48. package/test/index.cjs +60 -230
  49. package/test/index.cjs.map +1 -1
  50. package/test/index.d.cts +2 -2
  51. package/test/index.d.ts +2 -2
  52. package/test/index.js +3 -2
  53. package/ts/cf/cf-env-actions.d.ts +16 -0
  54. package/ts/cf/cf-env-actions.d.ts.map +1 -0
  55. package/ts/cf/cf-env-actions.js +51 -0
  56. package/ts/cf/cf-env-actions.js.map +1 -0
  57. package/ts/cf/cf-sys-abstraction.d.ts +1 -15
  58. package/ts/cf/cf-sys-abstraction.d.ts.map +1 -1
  59. package/ts/cf/cf-sys-abstraction.js +0 -50
  60. package/ts/cf/cf-sys-abstraction.js.map +1 -1
  61. package/ts/crypto.test.js +8 -1
  62. package/ts/crypto.test.js.map +1 -1
  63. package/ts/deno/deno-env-actions.d.ts +23 -0
  64. package/ts/deno/deno-env-actions.d.ts.map +1 -0
  65. package/ts/deno/deno-env-actions.js +46 -0
  66. package/ts/deno/deno-env-actions.js.map +1 -0
  67. package/ts/deno/deno-sys-abstraction.d.ts +1 -22
  68. package/ts/deno/deno-sys-abstraction.d.ts.map +1 -1
  69. package/ts/deno/deno-sys-abstraction.js +0 -45
  70. package/ts/deno/deno-sys-abstraction.js.map +1 -1
  71. package/ts/node/node-env-actions.d.ts +15 -0
  72. package/ts/node/node-env-actions.d.ts.map +1 -0
  73. package/ts/node/node-env-actions.js +44 -0
  74. package/ts/node/node-env-actions.js.map +1 -0
  75. package/ts/node/node-sys-abstraction.d.ts +1 -14
  76. package/ts/node/node-sys-abstraction.d.ts.map +1 -1
  77. package/ts/node/node-sys-abstraction.js +0 -43
  78. package/ts/node/node-sys-abstraction.js.map +1 -1
  79. package/ts/sys-env.js +4 -4
  80. package/ts/sys-env.js.map +1 -1
  81. package/ts/sys-env.test.js +2 -2
  82. package/ts/sys-env.test.js.map +1 -1
  83. package/ts/web/web-env-actions.d.ts +14 -0
  84. package/ts/web/web-env-actions.d.ts.map +1 -0
  85. package/ts/web/web-env-actions.js +35 -0
  86. package/ts/web/web-env-actions.js.map +1 -0
  87. package/ts/web/web-sys-abstraction.d.ts +0 -13
  88. package/ts/web/web-sys-abstraction.d.ts.map +1 -1
  89. package/ts/web/web-sys-abstraction.js +0 -34
  90. package/ts/web/web-sys-abstraction.js.map +1 -1
  91. package/web/index.cjs +51 -233
  92. package/web/index.cjs.map +1 -1
  93. package/web/index.d.cts +3 -15
  94. package/web/index.d.ts +3 -15
  95. package/web/index.js +2 -3
  96. 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((resolve2, reject) => {
84
- __privateSet(this, _resolveFn, resolve2);
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((resolve2) => {
516
+ return new Promise((resolve) => {
517
517
  setTimeout(() => {
518
- resolve2();
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-file-service.ts
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-sys-abstraction.ts
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
- var NodeExitServiceImpl = class {
1017
- constructor() {
1018
- this._exitHandlers = [];
1019
- this.invoked = false;
1020
- this._handleExit = async () => {
1021
- if (this.invoked) {
1022
- return;
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
- injectExitHandlers(hdls) {
1058
- this._exitHandlers = hdls;
932
+ static new(opts) {
933
+ return once3.once(() => new _BrowserEnvActions(opts));
1059
934
  }
1060
- exit(code) {
1061
- this._handleExit().then(() => {
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
- var _NodeSystemService = class _NodeSystemService {
1070
- constructor() {
1071
- this._exitService = new NodeExitServiceImpl();
1072
- this._exitService.injectExitHandlers(_NodeSystemService._exitHandlers);
938
+ set(key2, value) {
939
+ if (value) {
940
+ this.env.set(key2, value);
941
+ }
1073
942
  }
1074
- Env() {
1075
- return envFactory();
943
+ delete(key2) {
944
+ this.env.delete(key2);
1076
945
  }
1077
- Args() {
1078
- return import_node_process2.default.argv;
946
+ keys() {
947
+ return Array.from(this.env.keys());
1079
948
  }
1080
- OnExit(hdl) {
1081
- const id = crypto.randomUUID();
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
- Exit(code) {
1091
- this._exitService.exit(code);
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-sys-abstraction.ts
1098
- var once3 = new ResolveOnce();
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 once3.once(() => new _CFEnvActions(opts));
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 EnvImpl2(action, opts);
1024
+ const ret = new EnvImpl(action, opts);
1162
1025
  action.register(ret);
1163
1026
  return ret;
1164
1027
  });
1165
1028
  }
1166
- var EnvImpl2 = class {
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(path3) {
1308
+ function splitPath(path) {
1479
1309
  const p = new Path();
1480
- if (path3 === "") {
1310
+ if (path === "") {
1481
1311
  return p;
1482
1312
  }
1483
- for (let count = 0; path3.length; count++) {
1484
- if (path3.match(/^\/+/)) {
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
- path3 = path3.replace(/^\/+/, "");
1320
+ path = path.replace(/^\/+/, "");
1491
1321
  } else {
1492
- const part = path3.replace(/\/.*$/, "");
1322
+ const part = path.replace(/\/.*$/, "");
1493
1323
  p.add(part);
1494
- path3 = path3.replace(/^[^/]+/, "");
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 path3 = paths[i];
1504
- if (path3 === "") {
1333
+ const path = paths[i];
1334
+ if (path === "") {
1505
1335
  continue;
1506
1336
  }
1507
- if (!(prev.endsWith("/") || path3.startsWith("/"))) {
1337
+ if (!(prev.endsWith("/") || path.startsWith("/"))) {
1508
1338
  if (prev !== "") {
1509
1339
  res.push("/");
1510
1340
  }
1511
- res.push(path3);
1341
+ res.push(path);
1512
1342
  } else {
1513
- res.push(path3);
1343
+ res.push(path);
1514
1344
  }
1515
- prev = path3;
1345
+ prev = path;
1516
1346
  }
1517
1347
  return res.join("");
1518
1348
  }
1519
- function relativePath(path3, relative2) {
1520
- const relativeParts = splitPath(relative2);
1349
+ function relativePath(path, relative) {
1350
+ const relativeParts = splitPath(relative);
1521
1351
  let result;
1522
1352
  if (relativeParts.parts[0] === 3 /* Root */) {
1523
- result = relative2;
1353
+ result = relative;
1524
1354
  } else {
1525
- result = pathJoin(path3, relative2);
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(path3, restrips, obj) {
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(path3, restrips, i));
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 (path3) {
1597
- nextPath = [path3, key2].join(".");
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((resolve2) => {
2479
- this._logWriter._flush(void 0, resolve2);
2308
+ return new Promise((resolve) => {
2309
+ this._logWriter._flush(void 0, resolve);
2480
2310
  });
2481
2311
  }
2482
2312
  With() {