whet 0.0.3 → 0.0.6
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/StringBuf.d.ts +13 -0
- package/bin/StringBuf.js +25 -0
- package/bin/haxe/CallStack.d.ts +41 -0
- package/bin/haxe/CallStack.js +96 -0
- package/bin/haxe/Log.d.ts +33 -0
- package/bin/haxe/Log.js +61 -0
- package/bin/haxe/NativeStackTrace.js +147 -0
- package/bin/whet/Log.js +3 -0
- package/bin/whet/Project.d.ts +1 -0
- package/bin/whet/Project.js +13 -8
- package/bin/whet/Source.d.ts +2 -2
- package/bin/whet/Source.js +20 -5
- package/bin/whet/SourceHash.d.ts +8 -1
- package/bin/whet/SourceHash.js +105 -7
- package/bin/whet/SourceId.d.ts +1 -0
- package/bin/whet/SourceId.js +37 -28
- package/bin/whet/Stone.d.ts +12 -2
- package/bin/whet/Stone.js +25 -13
- package/bin/whet/Utils.d.ts +8 -1
- package/bin/whet/Utils.js +56 -3
- package/bin/whet/Whet.js +5 -1
- package/bin/whet/cache/BaseCache.js +23 -20
- package/bin/whet/cache/CacheManager.d.ts +5 -0
- package/bin/whet/cache/CacheManager.js +22 -14
- package/bin/whet/cache/FileCache.js +89 -35
- package/bin/whet/magic/RoutePathType.js +10 -5
- package/bin/whet/magic/RouteType.d.ts +2 -2
- package/bin/whet/magic/RouteType.js +28 -14
- package/bin/whet/magic/StoneId.d.ts +1 -0
- package/bin/whet/magic/StoneId.js +11 -1
- package/bin/whet/route/Route.d.ts +5 -1
- package/bin/whet/route/Route.js +33 -14
- package/bin/whet/route/Router.js +27 -37
- package/bin/whet/stones/Files.js +25 -17
- package/bin/whet/stones/JsonStone.js +7 -7
- package/bin/whet/stones/RemoteFile.js +5 -8
- package/bin/whet/stones/Server.js +28 -19
- package/bin/whet/stones/Zip.js +17 -12
- package/bin/whet/stones/haxe/HaxeBuild.d.ts +3 -0
- package/bin/whet/stones/haxe/HaxeBuild.js +58 -16
- package/bin/whet/stones/haxe/Hxml.js +56 -34
- package/bin/whet.d.ts +2 -0
- package/bin/whet.js +2 -0
- package/package.json +1 -1
|
@@ -3,12 +3,13 @@ import {StoneId_Fields_} from "../../magic/StoneId.js"
|
|
|
3
3
|
import {MaybeArray_Fields_} from "../../magic/MaybeArray.js"
|
|
4
4
|
import {CacheStrategy, CacheDurability} from "../../cache/Cache.js"
|
|
5
5
|
import {Stone} from "../../Stone.js"
|
|
6
|
-
import {SourceId} from "../../SourceId.js"
|
|
6
|
+
import {SourceId, SourceId_Fields_} from "../../SourceId.js"
|
|
7
7
|
import {SourceHash} from "../../SourceHash.js"
|
|
8
8
|
import {SourceData} from "../../Source.js"
|
|
9
9
|
import {Log} from "../../Log.js"
|
|
10
|
-
import
|
|
10
|
+
import * as Path from "path"
|
|
11
11
|
import {Register} from "../../../genes/Register.js"
|
|
12
|
+
import {StringTools} from "../../../StringTools.js"
|
|
12
13
|
import {HxOverrides} from "../../../HxOverrides.js"
|
|
13
14
|
|
|
14
15
|
const $global = Register.$global
|
|
@@ -26,7 +27,7 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
26
27
|
}
|
|
27
28
|
clone(id) {
|
|
28
29
|
var configClone = this.cloneConfig(this.config);
|
|
29
|
-
configClone.id = StoneId_Fields_.makeStoneId(id);
|
|
30
|
+
configClone.id = StoneId_Fields_.makeStoneId((id == null) ? this.id : id);
|
|
30
31
|
return new Hxml(configClone);
|
|
31
32
|
}
|
|
32
33
|
mergeConfig(additionalConfig) {
|
|
@@ -88,18 +89,23 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
88
89
|
};
|
|
89
90
|
var args1 = args.concat(result);
|
|
90
91
|
if (this.config.dce != null) {
|
|
92
|
+
var _g = this.config.dce;
|
|
91
93
|
var tmp;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
if (_g == null) {
|
|
95
|
+
throw new Error("Invalid DCE value.");
|
|
96
|
+
} else {
|
|
97
|
+
switch (_g._hx_index) {
|
|
98
|
+
case 0:
|
|
99
|
+
tmp = "std";
|
|
100
|
+
break
|
|
101
|
+
case 1:
|
|
102
|
+
tmp = "full";
|
|
103
|
+
break
|
|
104
|
+
case 2:
|
|
105
|
+
tmp = "no";
|
|
106
|
+
break
|
|
107
|
+
|
|
108
|
+
};
|
|
103
109
|
};
|
|
104
110
|
args1.push(["-dce", tmp]);
|
|
105
111
|
};
|
|
@@ -142,18 +148,25 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
142
148
|
if (this.isSingleFile()) {
|
|
143
149
|
var filename;
|
|
144
150
|
if (this.build.config.filename != null) {
|
|
145
|
-
|
|
151
|
+
var s = this.build.config.filename;
|
|
152
|
+
s = Path.posix.normalize(s);
|
|
153
|
+
s = StringTools.replace(s, "\\", "/");
|
|
154
|
+
filename = (SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s;
|
|
146
155
|
} else {
|
|
147
|
-
var
|
|
148
|
-
|
|
156
|
+
var s = "build";
|
|
157
|
+
s = Path.posix.normalize("build");
|
|
158
|
+
s = StringTools.replace(s, "\\", "/");
|
|
159
|
+
filename = (SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s;
|
|
149
160
|
};
|
|
150
|
-
if (Path.
|
|
161
|
+
if (Path.posix.extname(filename) == "") {
|
|
151
162
|
var v = this.getBuildExtension();
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var
|
|
156
|
-
|
|
163
|
+
if (v.length > 0 && HxOverrides.cca(v, 0) != 46) {
|
|
164
|
+
v = "." + v;
|
|
165
|
+
};
|
|
166
|
+
var s = filename.substring(0, filename.lastIndexOf("/") + 1);
|
|
167
|
+
s = Path.posix.normalize(s);
|
|
168
|
+
s = StringTools.replace(s, "\\", "/");
|
|
169
|
+
filename = ((SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s) + Path.posix.parse(filename.substring(filename.lastIndexOf("/"))).name + v;
|
|
157
170
|
};
|
|
158
171
|
return filename;
|
|
159
172
|
} else {
|
|
@@ -162,9 +175,14 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
162
175
|
}
|
|
163
176
|
getPlatform() {
|
|
164
177
|
var this1 = this.getBuildExportPath();
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
var s = "/";
|
|
179
|
+
s = Path.posix.normalize("/");
|
|
180
|
+
s = StringTools.replace(s, "\\", "/");
|
|
181
|
+
var root = (SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s;
|
|
182
|
+
if (this1.charAt(0) != "/") {
|
|
183
|
+
throw new Error("Badly formed SourceId.");
|
|
184
|
+
};
|
|
185
|
+
var path = Path.posix.join(".", root, ".", this1);
|
|
168
186
|
var _g = this.config.platform;
|
|
169
187
|
if (_g == null) {
|
|
170
188
|
return [];
|
|
@@ -264,14 +282,18 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
264
282
|
}
|
|
265
283
|
filename() {
|
|
266
284
|
var s = this.id;
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
285
|
+
s = Path.posix.normalize(s);
|
|
286
|
+
s = StringTools.replace(s, "\\", "/");
|
|
287
|
+
var fn = (SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s;
|
|
288
|
+
if (Path.posix.extname(fn) == "") {
|
|
289
|
+
var v = "hxml";
|
|
290
|
+
if ("hxml".length > 0 && HxOverrides.cca("hxml", 0) != 46) {
|
|
291
|
+
v = "." + "hxml";
|
|
292
|
+
};
|
|
293
|
+
var s = fn.substring(0, fn.lastIndexOf("/") + 1);
|
|
294
|
+
s = Path.posix.normalize(s);
|
|
295
|
+
s = StringTools.replace(s, "\\", "/");
|
|
296
|
+
fn = ((SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s) + Path.posix.parse(fn.substring(fn.lastIndexOf("/"))).name + v;
|
|
275
297
|
};
|
|
276
298
|
return fn;
|
|
277
299
|
}
|
package/bin/whet.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
export {ZipStone} from "./whet/stones/Zip"
|
|
3
3
|
export {ZipConfig} from "./whet/stones/Zip"
|
|
4
|
+
export {Utils} from "./whet/Utils"
|
|
4
5
|
export {Stone} from "./whet/Stone"
|
|
5
6
|
export {ServerConfig} from "./whet/stones/Server"
|
|
6
7
|
export {Server} from "./whet/stones/Server"
|
|
7
8
|
export {Router} from "./whet/route/Router"
|
|
9
|
+
export {Route} from "./whet/route/Route"
|
|
8
10
|
export {RemoteFileConfig} from "./whet/stones/RemoteFile"
|
|
9
11
|
export {RemoteFile} from "./whet/stones/RemoteFile"
|
|
10
12
|
export {Project} from "./whet/Project"
|
package/bin/whet.js
CHANGED
|
@@ -6,9 +6,11 @@ const $global = Register.$global
|
|
|
6
6
|
|
|
7
7
|
Whet_Fields_.main()
|
|
8
8
|
export {ZipStone} from "./whet/stones/Zip.js"
|
|
9
|
+
export {Utils} from "./whet/Utils.js"
|
|
9
10
|
export {Stone} from "./whet/Stone.js"
|
|
10
11
|
export {Server} from "./whet/stones/Server.js"
|
|
11
12
|
export {Router} from "./whet/route/Router.js"
|
|
13
|
+
export {Route} from "./whet/route/Route.js"
|
|
12
14
|
export {RemoteFile} from "./whet/stones/RemoteFile.js"
|
|
13
15
|
export {Project} from "./whet/Project.js"
|
|
14
16
|
export {Log} from "./whet/Log.js"
|