whet 0.0.7 → 0.0.10
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/Project.js +21 -10
- package/bin/whet/Source.d.ts +8 -1
- package/bin/whet/Source.js +26 -11
- package/bin/whet/SourceId.d.ts +1 -0
- package/bin/whet/SourceId.js +46 -20
- package/bin/whet/Stone.js +16 -8
- package/bin/whet/Whet.js +1 -1
- package/bin/whet/cache/BaseCache.js +16 -8
- package/bin/whet/cache/CacheManager.js +29 -13
- package/bin/whet/cache/FileCache.js +64 -29
- package/bin/whet/magic/RoutePathType.js +7 -4
- package/bin/whet/magic/RouteType.js +29 -13
- package/bin/whet/route/Route.js +27 -7
- package/bin/whet/route/Router.js +34 -17
- package/bin/whet/stones/Files.d.ts +7 -2
- package/bin/whet/stones/Files.js +54 -59
- package/bin/whet/stones/JsonStone.js +7 -4
- package/bin/whet/stones/RemoteFile.js +7 -4
- package/bin/whet/stones/Server.js +53 -31
- package/bin/whet/stones/Zip.js +14 -7
- package/bin/whet/stones/haxe/HaxeBuild.js +17 -7
- package/bin/whet/stones/haxe/Hxml.js +43 -19
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {MaybeArray_Fields_} from "../../magic/MaybeArray.js"
|
|
2
2
|
import {Utils} from "../../Utils.js"
|
|
3
3
|
import {Stone} from "../../Stone.js"
|
|
4
|
-
import {
|
|
4
|
+
import {RootDir} from "../../SourceId.js"
|
|
5
5
|
import {SourceHash} from "../../SourceHash.js"
|
|
6
6
|
import {SourceData} from "../../Source.js"
|
|
7
7
|
import {Log} from "../../Log.js"
|
|
@@ -34,9 +34,13 @@ class HaxeBuild extends Register.inherits(Stone) {
|
|
|
34
34
|
var cwd = process.cwd();
|
|
35
35
|
var this1 = _gthis.project.rootDir;
|
|
36
36
|
var s = "/";
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
var str = ("/".length > 1 && HxOverrides.cca("/", 0) == 47) ? "/".substring(1) : "/";
|
|
38
|
+
if (str.length > 0) {
|
|
39
|
+
str = Path.posix.normalize(str);
|
|
40
|
+
str = StringTools.replace(str, "\\", "/");
|
|
41
|
+
};
|
|
42
|
+
s = str;
|
|
43
|
+
var root = (HxOverrides.cca(s, 0) == 47) ? s : "/" + s;
|
|
40
44
|
if (this1.charAt(0) != "/") {
|
|
41
45
|
throw new Error("Badly formed SourceId.");
|
|
42
46
|
};
|
|
@@ -57,8 +61,10 @@ class HaxeBuild extends Register.inherits(Stone) {
|
|
|
57
61
|
};
|
|
58
62
|
ChildProcess.exec(result.join(" "), {"cwd": cwd1, "windowsHide": true}, function (err, stdout, stderr) {
|
|
59
63
|
if (err != null) {
|
|
64
|
+
Log.log(30, ...["Haxe build failed."]);
|
|
60
65
|
rej(err);
|
|
61
66
|
} else {
|
|
67
|
+
Log.log(30, ...["Haxe build successful."]);
|
|
62
68
|
res(null);
|
|
63
69
|
};
|
|
64
70
|
});
|
|
@@ -105,9 +111,13 @@ class HaxeBuild extends Register.inherits(Stone) {
|
|
|
105
111
|
while (_g < _g1) {
|
|
106
112
|
var i = _g++;
|
|
107
113
|
var s = _this[i];
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
var str = (s.length > 1 && HxOverrides.cca(s, 0) == 47) ? s.substring(1) : s;
|
|
115
|
+
if (str.length > 0) {
|
|
116
|
+
str = Path.posix.normalize(str);
|
|
117
|
+
str = StringTools.replace(str, "\\", "/");
|
|
118
|
+
};
|
|
119
|
+
s = str;
|
|
120
|
+
var this1 = (HxOverrides.cca(s, 0) == 47) ? s : "/" + s;
|
|
111
121
|
var root = RootDir.fromProject(this.config.hxml.project);
|
|
112
122
|
if (this1.charAt(0) != "/") {
|
|
113
123
|
throw new Error("Badly formed SourceId.");
|
|
@@ -3,7 +3,7 @@ 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
|
|
6
|
+
import {SourceId} from "../../SourceId.js"
|
|
7
7
|
import {SourceHash} from "../../SourceHash.js"
|
|
8
8
|
import {SourceData} from "../../Source.js"
|
|
9
9
|
import {Log} from "../../Log.js"
|
|
@@ -149,14 +149,22 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
149
149
|
var filename;
|
|
150
150
|
if (this.build.config.filename != null) {
|
|
151
151
|
var s = this.build.config.filename;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
var str = (s.length > 1 && HxOverrides.cca(s, 0) == 47) ? s.substring(1) : s;
|
|
153
|
+
if (str.length > 0) {
|
|
154
|
+
str = Path.posix.normalize(str);
|
|
155
|
+
str = StringTools.replace(str, "\\", "/");
|
|
156
|
+
};
|
|
157
|
+
s = str;
|
|
158
|
+
filename = (HxOverrides.cca(s, 0) == 47) ? s : "/" + s;
|
|
155
159
|
} else {
|
|
156
160
|
var s = "build";
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
var str = ("build".length > 1 && HxOverrides.cca("build", 0) == 47) ? "build".substring(1) : "build";
|
|
162
|
+
if (str.length > 0) {
|
|
163
|
+
str = Path.posix.normalize(str);
|
|
164
|
+
str = StringTools.replace(str, "\\", "/");
|
|
165
|
+
};
|
|
166
|
+
s = str;
|
|
167
|
+
filename = (HxOverrides.cca(s, 0) == 47) ? s : "/" + s;
|
|
160
168
|
};
|
|
161
169
|
if (Path.posix.extname(filename) == "") {
|
|
162
170
|
var v = this.getBuildExtension();
|
|
@@ -164,9 +172,13 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
164
172
|
v = "." + v;
|
|
165
173
|
};
|
|
166
174
|
var s = filename.substring(0, filename.lastIndexOf("/") + 1);
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
175
|
+
var str = (s.length > 1 && HxOverrides.cca(s, 0) == 47) ? s.substring(1) : s;
|
|
176
|
+
if (str.length > 0) {
|
|
177
|
+
str = Path.posix.normalize(str);
|
|
178
|
+
str = StringTools.replace(str, "\\", "/");
|
|
179
|
+
};
|
|
180
|
+
s = str;
|
|
181
|
+
filename = ((HxOverrides.cca(s, 0) == 47) ? s : "/" + s) + Path.posix.parse(filename.substring(filename.lastIndexOf("/"))).name + v;
|
|
170
182
|
};
|
|
171
183
|
return filename;
|
|
172
184
|
} else {
|
|
@@ -176,9 +188,13 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
176
188
|
getPlatform() {
|
|
177
189
|
var this1 = this.getBuildExportPath();
|
|
178
190
|
var s = "/";
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
191
|
+
var str = ("/".length > 1 && HxOverrides.cca("/", 0) == 47) ? "/".substring(1) : "/";
|
|
192
|
+
if (str.length > 0) {
|
|
193
|
+
str = Path.posix.normalize(str);
|
|
194
|
+
str = StringTools.replace(str, "\\", "/");
|
|
195
|
+
};
|
|
196
|
+
s = str;
|
|
197
|
+
var root = (HxOverrides.cca(s, 0) == 47) ? s : "/" + s;
|
|
182
198
|
if (this1.charAt(0) != "/") {
|
|
183
199
|
throw new Error("Badly formed SourceId.");
|
|
184
200
|
};
|
|
@@ -282,18 +298,26 @@ class Hxml extends Register.inherits(Stone) {
|
|
|
282
298
|
}
|
|
283
299
|
filename() {
|
|
284
300
|
var s = this.id;
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
301
|
+
var str = (s.length > 1 && HxOverrides.cca(s, 0) == 47) ? s.substring(1) : s;
|
|
302
|
+
if (str.length > 0) {
|
|
303
|
+
str = Path.posix.normalize(str);
|
|
304
|
+
str = StringTools.replace(str, "\\", "/");
|
|
305
|
+
};
|
|
306
|
+
s = str;
|
|
307
|
+
var fn = (HxOverrides.cca(s, 0) == 47) ? s : "/" + s;
|
|
288
308
|
if (Path.posix.extname(fn) == "") {
|
|
289
309
|
var v = "hxml";
|
|
290
310
|
if ("hxml".length > 0 && HxOverrides.cca("hxml", 0) != 46) {
|
|
291
311
|
v = "." + "hxml";
|
|
292
312
|
};
|
|
293
313
|
var s = fn.substring(0, fn.lastIndexOf("/") + 1);
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
314
|
+
var str = (s.length > 1 && HxOverrides.cca(s, 0) == 47) ? s.substring(1) : s;
|
|
315
|
+
if (str.length > 0) {
|
|
316
|
+
str = Path.posix.normalize(str);
|
|
317
|
+
str = StringTools.replace(str, "\\", "/");
|
|
318
|
+
};
|
|
319
|
+
s = str;
|
|
320
|
+
fn = ((HxOverrides.cca(s, 0) == 47) ? s : "/" + s) + Path.posix.parse(fn.substring(fn.lastIndexOf("/"))).name + v;
|
|
297
321
|
};
|
|
298
322
|
return fn;
|
|
299
323
|
}
|