whet 0.6.0 → 0.6.2

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/bin/whet/Whet.js CHANGED
@@ -26,7 +26,7 @@ class Whet_Fields_ {
26
26
  if (entryUrl != thisUrl) {
27
27
  return;
28
28
  };
29
- Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.6.0", "-v, --version").allowUnknownOption(true).allowExcessArguments(true).showSuggestionAfterError(true).helpOption(false).option("-p, --project <file>", "project to run", "Project.mjs").addOption(new Option("-l, --log-level <level>", "log level, a string/number")["default"]("info").env("WHET_LOG_LEVEL")).option("--no-pretty", "disable pretty logging").option("-q, --quiet", "quiet output: warn level + no color (the default when stdout is not a TTY)").option("--profile <format>", "enable profiling, export to whet-profile.json on exit (format: json or trace, default: json)").exitOverride();
29
+ Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.6.2", "-v, --version").allowUnknownOption(true).allowExcessArguments(true).showSuggestionAfterError(true).helpOption(false).option("-p, --project <file>", "project to run", "Project.mjs").addOption(new Option("-l, --log-level <level>", "log level, a string/number")["default"]("info").env("WHET_LOG_LEVEL")).option("--no-pretty", "disable pretty logging").option("-q, --quiet", "quiet output: warn level + no color (the default when stdout is not a TTY)").option("--profile <format>", "enable profiling, export to whet-profile.json on exit (format: json or trace, default: json)").exitOverride();
30
30
  try {
31
31
  Whet_Fields_.program.parse();
32
32
  }catch (_g) {
@@ -79,6 +79,7 @@ class Whet_Fields_ {
79
79
  if (((e) instanceof Error)) {
80
80
  Log.log(50, ...[e.stack]);
81
81
  };
82
+ process.exitCode = 1;
82
83
  };
83
84
  try {
84
85
  Whet_Fields_.program.help();
@@ -159,6 +160,7 @@ class Whet_Fields_ {
159
160
  return;
160
161
  };
161
162
  Log.log(50, ...["Error while executing command.", {"error": err}]);
163
+ process.exitCode = 1;
162
164
  });
163
165
  };
164
166
  initProm.then(function (_) {
@@ -211,8 +211,13 @@ class CacheManager extends Register.inherits() {
211
211
  * The path is not reserved. Caching depends on stone's `cacheStrategy` and success of source generation.
212
212
  */
213
213
  getDir(stone, hash) {
214
- let _this_r = new RegExp("[^a-zA-Z0-9_\\-.]", "g".split("u").join(""));
215
- let baseDir = stone.id.replace(_this_r, "_") + "/";
214
+ let _this_r = new RegExp("[^a-zA-Z0-9_\\-./]", "g".split("u").join(""));
215
+ let safeId = stone.id.replace(_this_r, "_");
216
+ let _this_r1 = new RegExp("/+", "g".split("u").join(""));
217
+ safeId = safeId.replace(_this_r1, "/");
218
+ let _this_r2 = new RegExp("^/|/$", "g".split("u").join(""));
219
+ safeId = safeId.replace(_this_r2, "");
220
+ let baseDir = safeId + "/";
216
221
  let tmp;
217
222
  switch (stone.cacheStrategy._hx_index) {
218
223
  case 0:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whet",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "NodeJS based assets management and project tooling library.",
5
5
  "scripts": {
6
6
  "devinit": "npx dts2hx commander pino-pretty minimatch --modular --noLibWrap",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "homepage": "https://github.com/Antriel/whet#readme",
28
28
  "dependencies": {
29
- "commander": "^14.0.3",
29
+ "commander": "^15.0.0",
30
30
  "minimatch": "^10.2.5",
31
31
  "pino-pretty": "^13.1.3"
32
32
  },