whet 0.0.28 → 0.0.30

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/List.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import {List as List__1} from "./haxe/ds/List"
2
+
3
+ export type List<T> = List__1<T>
package/bin/whet/Whet.js CHANGED
@@ -12,7 +12,7 @@ const $global = Register.$global
12
12
  export const Whet_Fields_ = Register.global("$hxClasses")["whet._Whet.Whet_Fields_"] =
13
13
  class Whet_Fields_ {
14
14
  static main() {
15
- Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.28", "-v, --version").allowUnknownOption(true).showSuggestionAfterError(true).option("-p, --project <file>", "project to run", "Project.mjs").option("-l, --log-level <level>", "log level, a string/number", "info").option("--no-pretty", "disable pretty logging").exitOverride();
15
+ Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.29", "-v, --version").allowUnknownOption(true).showSuggestionAfterError(true).option("-p, --project <file>", "project to run", "Project.mjs").option("-l, --log-level <level>", "log level, a string/number", "info").option("--no-pretty", "disable pretty logging").exitOverride();
16
16
  try {
17
17
  Whet_Fields_.program.parse();
18
18
  }catch (_g) {
@@ -13,19 +13,25 @@ class Files extends Register.inherits(Stone) {
13
13
  super.new(config);
14
14
  }
15
15
  initConfig() {
16
- this.config.recursive = true;
16
+ this.config.recursive = (this.config.recursive != null) ? this.config.recursive : true;
17
17
  }
18
18
  list() {
19
19
  let _gthis = this;
20
20
  let onDirFile = function (dir, dirFile) {
21
21
  let pathId = IdUtils.fromCwdPath(dirFile, RootDir.fromProject(_gthis.project));
22
- if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
23
- throw new Error("\"" + dir + "\" is not a directory.");
24
- };
25
22
  let inlobj_id;
26
- let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
27
- inlobj_id = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
28
- return (inlobj_id) ? pathId.substring(dir.length) : null;
23
+ if (dir == "/") {
24
+ inlobj_id = pathId;
25
+ } else {
26
+ if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
27
+ throw new Error("\"" + dir + "\" is not a directory.");
28
+ };
29
+ let inlobj_id1;
30
+ let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
31
+ inlobj_id1 = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
32
+ inlobj_id = (inlobj_id1) ? pathId.substring(dir.length) : null;
33
+ };
34
+ return inlobj_id;
29
35
  };
30
36
  let files = [];
31
37
  let dirs = [];
@@ -51,14 +57,20 @@ class Files extends Register.inherits(Stone) {
51
57
  generate(hash) {
52
58
  let _gthis = this;
53
59
  let onDirFile = function (dir, dirFile) {
60
+ let p_id;
54
61
  let pathId = IdUtils.fromCwdPath(dirFile, RootDir.fromProject(_gthis.project));
55
- if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
56
- throw new Error("\"" + dir + "\" is not a directory.");
62
+ if (dir == "/") {
63
+ p_id = pathId;
64
+ } else {
65
+ if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
66
+ throw new Error("\"" + dir + "\" is not a directory.");
67
+ };
68
+ let p_id1;
69
+ let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
70
+ p_id1 = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
71
+ p_id = (p_id1) ? pathId.substring(dir.length) : null;
57
72
  };
58
- let p_id;
59
- let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
60
- p_id = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
61
- return SourceData.fromFile((p_id) ? pathId.substring(dir.length) : null, dirFile, pathId);
73
+ return SourceData.fromFile(p_id, dirFile, pathId);
62
74
  };
63
75
  let files = [];
64
76
  let dirs = [];
@@ -106,13 +118,19 @@ class Files extends Register.inherits(Stone) {
106
118
  }
107
119
  fromCwd(file, dir) {
108
120
  let pathId = IdUtils.fromCwdPath(file, RootDir.fromProject(this.project));
109
- if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
110
- throw new Error("\"" + dir + "\" is not a directory.");
111
- };
112
121
  let tmp;
113
- let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
114
- tmp = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
115
- return {"pathId": pathId, "id": (tmp) ? pathId.substring(dir.length) : null};
122
+ if (dir == "/") {
123
+ tmp = pathId;
124
+ } else {
125
+ if (!(dir.length == 0 || dir.charCodeAt(dir.length - 1) == 47)) {
126
+ throw new Error("\"" + dir + "\" is not a directory.");
127
+ };
128
+ let tmp1;
129
+ let dir1 = pathId.substring(0, pathId.lastIndexOf("/") + 1);
130
+ tmp1 = ((dir1.length == 0) ? "./" : dir1).indexOf(dir) == 0;
131
+ tmp = (tmp1) ? pathId.substring(dir.length) : null;
132
+ };
133
+ return {"pathId": pathId, "id": tmp};
116
134
  }
117
135
  static get __name__() {
118
136
  return "whet.stones.Files"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whet",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "NodeJS based assets management and project tooling library.",
5
5
  "scripts": {
6
6
  "devinit": "npx dts2hx commander pino-pretty --modular --noLibWrap",