whet 0.0.5 → 0.0.8
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/NativeStackTrace.js +147 -0
- package/bin/whet/Log.js +3 -0
- package/bin/whet/Project.d.ts +5 -2
- package/bin/whet/Project.js +32 -9
- package/bin/whet/Source.d.ts +2 -2
- package/bin/whet/Source.js +21 -5
- package/bin/whet/SourceHash.d.ts +7 -1
- package/bin/whet/SourceHash.js +93 -7
- package/bin/whet/SourceId.d.ts +1 -0
- package/bin/whet/SourceId.js +37 -28
- package/bin/whet/Stone.d.ts +21 -5
- package/bin/whet/Stone.js +63 -18
- package/bin/whet/Utils.d.ts +8 -2
- package/bin/whet/Utils.js +25 -5
- package/bin/whet/Whet.js +4 -1
- package/bin/whet/cache/BaseCache.js +18 -17
- package/bin/whet/cache/CacheManager.d.ts +5 -0
- package/bin/whet/cache/CacheManager.js +21 -12
- package/bin/whet/cache/FileCache.js +83 -43
- package/bin/whet/magic/RoutePathType.js +10 -4
- package/bin/whet/magic/RouteType.d.ts +4 -3
- package/bin/whet/magic/RouteType.js +31 -13
- 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 -13
- package/bin/whet/route/Router.js +27 -36
- package/bin/whet/stones/Files.js +25 -16
- package/bin/whet/stones/JsonStone.js +7 -6
- package/bin/whet/stones/RemoteFile.js +5 -7
- package/bin/whet/stones/Server.d.ts +1 -2
- package/bin/whet/stones/Server.js +29 -22
- package/bin/whet/stones/Zip.js +17 -11
- package/bin/whet/stones/haxe/HaxeBuild.d.ts +2 -2
- package/bin/whet/stones/haxe/HaxeBuild.js +42 -69
- package/bin/whet/stones/haxe/Hxml.js +39 -24
- package/bin/whet.d.ts +3 -0
- package/bin/whet.js +3 -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) {
|
|
@@ -148,19 +149,24 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
148
149
|
var filename;
|
|
149
150
|
if (this.build.config.filename != null) {
|
|
150
151
|
var s = this.build.config.filename;
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
s = Path.posix.normalize((s.length > 1 && SourceId_Fields_.startsWithSlash(s)) ? HxOverrides.substr(s, 1, null) : s);
|
|
153
|
+
s = StringTools.replace(s, "\\", "/");
|
|
154
|
+
filename = (SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s;
|
|
153
155
|
} else {
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
+
var s = "build";
|
|
157
|
+
s = Path.posix.normalize(("build".length > 1 && SourceId_Fields_.startsWithSlash("build")) ? HxOverrides.substr("build", 1, null) : "build");
|
|
158
|
+
s = StringTools.replace(s, "\\", "/");
|
|
159
|
+
filename = (SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s;
|
|
156
160
|
};
|
|
157
|
-
if (Path.
|
|
161
|
+
if (Path.posix.extname(filename) == "") {
|
|
158
162
|
var v = this.getBuildExtension();
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
var
|
|
163
|
-
|
|
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.length > 1 && SourceId_Fields_.startsWithSlash(s)) ? HxOverrides.substr(s, 1, null) : s);
|
|
168
|
+
s = StringTools.replace(s, "\\", "/");
|
|
169
|
+
filename = ((SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s) + Path.posix.parse(filename.substring(filename.lastIndexOf("/"))).name + v;
|
|
164
170
|
};
|
|
165
171
|
return filename;
|
|
166
172
|
} else {
|
|
@@ -169,9 +175,14 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
169
175
|
}
|
|
170
176
|
getPlatform() {
|
|
171
177
|
var this1 = this.getBuildExportPath();
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
var s = "/";
|
|
179
|
+
s = Path.posix.normalize(("/".length > 1 && SourceId_Fields_.startsWithSlash("/")) ? HxOverrides.substr("/", 1, null) : "/");
|
|
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);
|
|
175
186
|
var _g = this.config.platform;
|
|
176
187
|
if (_g == null) {
|
|
177
188
|
return [];
|
|
@@ -271,14 +282,18 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
271
282
|
}
|
|
272
283
|
filename() {
|
|
273
284
|
var s = this.id;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
285
|
+
s = Path.posix.normalize((s.length > 1 && SourceId_Fields_.startsWithSlash(s)) ? HxOverrides.substr(s, 1, null) : 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.length > 1 && SourceId_Fields_.startsWithSlash(s)) ? HxOverrides.substr(s, 1, null) : s);
|
|
295
|
+
s = StringTools.replace(s, "\\", "/");
|
|
296
|
+
fn = ((SourceId_Fields_.startsWithSlash(s)) ? s : "/" + s) + Path.posix.parse(fn.substring(fn.lastIndexOf("/"))).name + v;
|
|
282
297
|
};
|
|
283
298
|
return fn;
|
|
284
299
|
}
|
package/bin/whet.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
export {addOption} from "./whet/Project"
|
|
2
3
|
export {ZipStone} from "./whet/stones/Zip"
|
|
3
4
|
export {ZipConfig} from "./whet/stones/Zip"
|
|
5
|
+
export {Utils} from "./whet/Utils"
|
|
4
6
|
export {Stone} from "./whet/Stone"
|
|
5
7
|
export {ServerConfig} from "./whet/stones/Server"
|
|
6
8
|
export {Server} from "./whet/stones/Server"
|
|
7
9
|
export {Router} from "./whet/route/Router"
|
|
10
|
+
export {Route} from "./whet/route/Route"
|
|
8
11
|
export {RemoteFileConfig} from "./whet/stones/RemoteFile"
|
|
9
12
|
export {RemoteFile} from "./whet/stones/RemoteFile"
|
|
10
13
|
export {Project} from "./whet/Project"
|
package/bin/whet.js
CHANGED
|
@@ -5,10 +5,13 @@ import {Register} from "./genes/Register.js"
|
|
|
5
5
|
const $global = Register.$global
|
|
6
6
|
|
|
7
7
|
Whet_Fields_.main()
|
|
8
|
+
export {addOption} from "./whet/Project.js"
|
|
8
9
|
export {ZipStone} from "./whet/stones/Zip.js"
|
|
10
|
+
export {Utils} from "./whet/Utils.js"
|
|
9
11
|
export {Stone} from "./whet/Stone.js"
|
|
10
12
|
export {Server} from "./whet/stones/Server.js"
|
|
11
13
|
export {Router} from "./whet/route/Router.js"
|
|
14
|
+
export {Route} from "./whet/route/Route.js"
|
|
12
15
|
export {RemoteFile} from "./whet/stones/RemoteFile.js"
|
|
13
16
|
export {Project} from "./whet/Project.js"
|
|
14
17
|
export {Log} from "./whet/Log.js"
|