game-data-gen 1.0.0 → 1.0.1
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/README.md +6 -2
- package/dist/main.js +130 -122
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,8 @@ Supported field types:
|
|
|
70
70
|
|
|
71
71
|
Supported array field types:
|
|
72
72
|
|
|
73
|
+
- string
|
|
74
|
+
- boolean
|
|
73
75
|
- number
|
|
74
76
|
- int8
|
|
75
77
|
- int16
|
|
@@ -88,7 +90,9 @@ In case of a Structure of Arrays data structure (type=soa), setting the length o
|
|
|
88
90
|
|
|
89
91
|
## Example
|
|
90
92
|
|
|
91
|
-
Create a plain text file somewhere in your source code (
|
|
93
|
+
Create a plain text file somewhere in your source code (without a file extension).
|
|
94
|
+
|
|
95
|
+
For example `src/data/game`:
|
|
92
96
|
|
|
93
97
|
```
|
|
94
98
|
Game
|
|
@@ -167,4 +171,4 @@ export function zeroEntityData() {
|
|
|
167
171
|
}
|
|
168
172
|
```
|
|
169
173
|
|
|
170
|
-
Then import the data and its functions from `src/data/game.ts`
|
|
174
|
+
Then import the data and its functions from `src/data/game.ts` in your code.
|
package/dist/main.js
CHANGED
|
@@ -141,14 +141,14 @@ var require_polyfills = __commonJS({
|
|
|
141
141
|
fs2.fstatSync = statFixSync(fs2.fstatSync);
|
|
142
142
|
fs2.lstatSync = statFixSync(fs2.lstatSync);
|
|
143
143
|
if (fs2.chmod && !fs2.lchmod) {
|
|
144
|
-
fs2.lchmod = function(
|
|
144
|
+
fs2.lchmod = function(path, mode, cb) {
|
|
145
145
|
if (cb) process.nextTick(cb);
|
|
146
146
|
};
|
|
147
147
|
fs2.lchmodSync = function() {
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
if (fs2.chown && !fs2.lchown) {
|
|
151
|
-
fs2.lchown = function(
|
|
151
|
+
fs2.lchown = function(path, uid, gid, cb) {
|
|
152
152
|
if (cb) process.nextTick(cb);
|
|
153
153
|
};
|
|
154
154
|
fs2.lchownSync = function() {
|
|
@@ -215,9 +215,9 @@ var require_polyfills = __commonJS({
|
|
|
215
215
|
};
|
|
216
216
|
}(fs2.readSync);
|
|
217
217
|
function patchLchmod(fs3) {
|
|
218
|
-
fs3.lchmod = function(
|
|
218
|
+
fs3.lchmod = function(path, mode, callback) {
|
|
219
219
|
fs3.open(
|
|
220
|
-
|
|
220
|
+
path,
|
|
221
221
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
222
222
|
mode,
|
|
223
223
|
function(err, fd) {
|
|
@@ -233,8 +233,8 @@ var require_polyfills = __commonJS({
|
|
|
233
233
|
}
|
|
234
234
|
);
|
|
235
235
|
};
|
|
236
|
-
fs3.lchmodSync = function(
|
|
237
|
-
var fd = fs3.openSync(
|
|
236
|
+
fs3.lchmodSync = function(path, mode) {
|
|
237
|
+
var fd = fs3.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
238
238
|
var threw = true;
|
|
239
239
|
var ret;
|
|
240
240
|
try {
|
|
@@ -255,8 +255,8 @@ var require_polyfills = __commonJS({
|
|
|
255
255
|
}
|
|
256
256
|
function patchLutimes(fs3) {
|
|
257
257
|
if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) {
|
|
258
|
-
fs3.lutimes = function(
|
|
259
|
-
fs3.open(
|
|
258
|
+
fs3.lutimes = function(path, at, mt, cb) {
|
|
259
|
+
fs3.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
260
260
|
if (er) {
|
|
261
261
|
if (cb) cb(er);
|
|
262
262
|
return;
|
|
@@ -268,8 +268,8 @@ var require_polyfills = __commonJS({
|
|
|
268
268
|
});
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
|
-
fs3.lutimesSync = function(
|
|
272
|
-
var fd = fs3.openSync(
|
|
271
|
+
fs3.lutimesSync = function(path, at, mt) {
|
|
272
|
+
var fd = fs3.openSync(path, constants.O_SYMLINK);
|
|
273
273
|
var ret;
|
|
274
274
|
var threw = true;
|
|
275
275
|
try {
|
|
@@ -387,11 +387,11 @@ var require_legacy_streams = __commonJS({
|
|
|
387
387
|
ReadStream,
|
|
388
388
|
WriteStream
|
|
389
389
|
};
|
|
390
|
-
function ReadStream(
|
|
391
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
390
|
+
function ReadStream(path, options) {
|
|
391
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
|
392
392
|
Stream.call(this);
|
|
393
393
|
var self = this;
|
|
394
|
-
this.path =
|
|
394
|
+
this.path = path;
|
|
395
395
|
this.fd = null;
|
|
396
396
|
this.readable = true;
|
|
397
397
|
this.paused = false;
|
|
@@ -436,10 +436,10 @@ var require_legacy_streams = __commonJS({
|
|
|
436
436
|
self._read();
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
function WriteStream(
|
|
440
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
439
|
+
function WriteStream(path, options) {
|
|
440
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
|
441
441
|
Stream.call(this);
|
|
442
|
-
this.path =
|
|
442
|
+
this.path = path;
|
|
443
443
|
this.fd = null;
|
|
444
444
|
this.writable = true;
|
|
445
445
|
this.flags = "w";
|
|
@@ -582,14 +582,14 @@ var require_graceful_fs = __commonJS({
|
|
|
582
582
|
fs3.createWriteStream = createWriteStream;
|
|
583
583
|
var fs$readFile = fs3.readFile;
|
|
584
584
|
fs3.readFile = readFile;
|
|
585
|
-
function readFile(
|
|
585
|
+
function readFile(path, options, cb) {
|
|
586
586
|
if (typeof options === "function")
|
|
587
587
|
cb = options, options = null;
|
|
588
|
-
return go$readFile(
|
|
589
|
-
function go$readFile(
|
|
590
|
-
return fs$readFile(
|
|
588
|
+
return go$readFile(path, options, cb);
|
|
589
|
+
function go$readFile(path2, options2, cb2, startTime) {
|
|
590
|
+
return fs$readFile(path2, options2, function(err) {
|
|
591
591
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
592
|
-
enqueue([go$readFile, [
|
|
592
|
+
enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
593
593
|
else {
|
|
594
594
|
if (typeof cb2 === "function")
|
|
595
595
|
cb2.apply(this, arguments);
|
|
@@ -599,14 +599,14 @@ var require_graceful_fs = __commonJS({
|
|
|
599
599
|
}
|
|
600
600
|
var fs$writeFile = fs3.writeFile;
|
|
601
601
|
fs3.writeFile = writeFile;
|
|
602
|
-
function writeFile(
|
|
602
|
+
function writeFile(path, data, options, cb) {
|
|
603
603
|
if (typeof options === "function")
|
|
604
604
|
cb = options, options = null;
|
|
605
|
-
return go$writeFile(
|
|
606
|
-
function go$writeFile(
|
|
607
|
-
return fs$writeFile(
|
|
605
|
+
return go$writeFile(path, data, options, cb);
|
|
606
|
+
function go$writeFile(path2, data2, options2, cb2, startTime) {
|
|
607
|
+
return fs$writeFile(path2, data2, options2, function(err) {
|
|
608
608
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
609
|
-
enqueue([go$writeFile, [
|
|
609
|
+
enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
610
610
|
else {
|
|
611
611
|
if (typeof cb2 === "function")
|
|
612
612
|
cb2.apply(this, arguments);
|
|
@@ -617,14 +617,14 @@ var require_graceful_fs = __commonJS({
|
|
|
617
617
|
var fs$appendFile = fs3.appendFile;
|
|
618
618
|
if (fs$appendFile)
|
|
619
619
|
fs3.appendFile = appendFile;
|
|
620
|
-
function appendFile(
|
|
620
|
+
function appendFile(path, data, options, cb) {
|
|
621
621
|
if (typeof options === "function")
|
|
622
622
|
cb = options, options = null;
|
|
623
|
-
return go$appendFile(
|
|
624
|
-
function go$appendFile(
|
|
625
|
-
return fs$appendFile(
|
|
623
|
+
return go$appendFile(path, data, options, cb);
|
|
624
|
+
function go$appendFile(path2, data2, options2, cb2, startTime) {
|
|
625
|
+
return fs$appendFile(path2, data2, options2, function(err) {
|
|
626
626
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
627
|
-
enqueue([go$appendFile, [
|
|
627
|
+
enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
628
628
|
else {
|
|
629
629
|
if (typeof cb2 === "function")
|
|
630
630
|
cb2.apply(this, arguments);
|
|
@@ -655,31 +655,31 @@ var require_graceful_fs = __commonJS({
|
|
|
655
655
|
var fs$readdir = fs3.readdir;
|
|
656
656
|
fs3.readdir = readdir;
|
|
657
657
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
658
|
-
function readdir(
|
|
658
|
+
function readdir(path, options, cb) {
|
|
659
659
|
if (typeof options === "function")
|
|
660
660
|
cb = options, options = null;
|
|
661
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
662
|
-
return fs$readdir(
|
|
663
|
-
|
|
661
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) {
|
|
662
|
+
return fs$readdir(path2, fs$readdirCallback(
|
|
663
|
+
path2,
|
|
664
664
|
options2,
|
|
665
665
|
cb2,
|
|
666
666
|
startTime
|
|
667
667
|
));
|
|
668
|
-
} : function go$readdir2(
|
|
669
|
-
return fs$readdir(
|
|
670
|
-
|
|
668
|
+
} : function go$readdir2(path2, options2, cb2, startTime) {
|
|
669
|
+
return fs$readdir(path2, options2, fs$readdirCallback(
|
|
670
|
+
path2,
|
|
671
671
|
options2,
|
|
672
672
|
cb2,
|
|
673
673
|
startTime
|
|
674
674
|
));
|
|
675
675
|
};
|
|
676
|
-
return go$readdir(
|
|
677
|
-
function fs$readdirCallback(
|
|
676
|
+
return go$readdir(path, options, cb);
|
|
677
|
+
function fs$readdirCallback(path2, options2, cb2, startTime) {
|
|
678
678
|
return function(err, files) {
|
|
679
679
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
680
680
|
enqueue([
|
|
681
681
|
go$readdir,
|
|
682
|
-
[
|
|
682
|
+
[path2, options2, cb2],
|
|
683
683
|
err,
|
|
684
684
|
startTime || Date.now(),
|
|
685
685
|
Date.now()
|
|
@@ -750,7 +750,7 @@ var require_graceful_fs = __commonJS({
|
|
|
750
750
|
enumerable: true,
|
|
751
751
|
configurable: true
|
|
752
752
|
});
|
|
753
|
-
function ReadStream(
|
|
753
|
+
function ReadStream(path, options) {
|
|
754
754
|
if (this instanceof ReadStream)
|
|
755
755
|
return fs$ReadStream.apply(this, arguments), this;
|
|
756
756
|
else
|
|
@@ -770,7 +770,7 @@ var require_graceful_fs = __commonJS({
|
|
|
770
770
|
}
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
|
-
function WriteStream(
|
|
773
|
+
function WriteStream(path, options) {
|
|
774
774
|
if (this instanceof WriteStream)
|
|
775
775
|
return fs$WriteStream.apply(this, arguments), this;
|
|
776
776
|
else
|
|
@@ -788,22 +788,22 @@ var require_graceful_fs = __commonJS({
|
|
|
788
788
|
}
|
|
789
789
|
});
|
|
790
790
|
}
|
|
791
|
-
function createReadStream(
|
|
792
|
-
return new fs3.ReadStream(
|
|
791
|
+
function createReadStream(path, options) {
|
|
792
|
+
return new fs3.ReadStream(path, options);
|
|
793
793
|
}
|
|
794
|
-
function createWriteStream(
|
|
795
|
-
return new fs3.WriteStream(
|
|
794
|
+
function createWriteStream(path, options) {
|
|
795
|
+
return new fs3.WriteStream(path, options);
|
|
796
796
|
}
|
|
797
797
|
var fs$open = fs3.open;
|
|
798
798
|
fs3.open = open;
|
|
799
|
-
function open(
|
|
799
|
+
function open(path, flags, mode, cb) {
|
|
800
800
|
if (typeof mode === "function")
|
|
801
801
|
cb = mode, mode = null;
|
|
802
|
-
return go$open(
|
|
803
|
-
function go$open(
|
|
804
|
-
return fs$open(
|
|
802
|
+
return go$open(path, flags, mode, cb);
|
|
803
|
+
function go$open(path2, flags2, mode2, cb2, startTime) {
|
|
804
|
+
return fs$open(path2, flags2, mode2, function(err, fd) {
|
|
805
805
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
806
|
-
enqueue([go$open, [
|
|
806
|
+
enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
807
807
|
else {
|
|
808
808
|
if (typeof cb2 === "function")
|
|
809
809
|
cb2.apply(this, arguments);
|
|
@@ -986,10 +986,10 @@ var require_fs = __commonJS({
|
|
|
986
986
|
var require_utils = __commonJS({
|
|
987
987
|
"node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
988
988
|
"use strict";
|
|
989
|
-
var
|
|
989
|
+
var path = require("path");
|
|
990
990
|
module2.exports.checkPath = function checkPath(pth) {
|
|
991
991
|
if (process.platform === "win32") {
|
|
992
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
992
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ""));
|
|
993
993
|
if (pathHasInvalidWinCharacters) {
|
|
994
994
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
995
995
|
error.code = "EINVAL";
|
|
@@ -1053,8 +1053,8 @@ var require_path_exists = __commonJS({
|
|
|
1053
1053
|
"use strict";
|
|
1054
1054
|
var u = require_universalify().fromPromise;
|
|
1055
1055
|
var fs2 = require_fs();
|
|
1056
|
-
function pathExists(
|
|
1057
|
-
return fs2.access(
|
|
1056
|
+
function pathExists(path) {
|
|
1057
|
+
return fs2.access(path).then(() => true).catch(() => false);
|
|
1058
1058
|
}
|
|
1059
1059
|
module2.exports = {
|
|
1060
1060
|
pathExists: u(pathExists),
|
|
@@ -1069,9 +1069,9 @@ var require_utimes = __commonJS({
|
|
|
1069
1069
|
"use strict";
|
|
1070
1070
|
var fs2 = require_fs();
|
|
1071
1071
|
var u = require_universalify().fromPromise;
|
|
1072
|
-
function utimesMillis(
|
|
1072
|
+
function utimesMillis(path, atime, mtime) {
|
|
1073
1073
|
return __async(this, null, function* () {
|
|
1074
|
-
const fd = yield fs2.open(
|
|
1074
|
+
const fd = yield fs2.open(path, "r+");
|
|
1075
1075
|
let closeErr = null;
|
|
1076
1076
|
try {
|
|
1077
1077
|
yield fs2.futimes(fd, atime, mtime);
|
|
@@ -1087,8 +1087,8 @@ var require_utimes = __commonJS({
|
|
|
1087
1087
|
}
|
|
1088
1088
|
});
|
|
1089
1089
|
}
|
|
1090
|
-
function utimesMillisSync(
|
|
1091
|
-
const fd = fs2.openSync(
|
|
1090
|
+
function utimesMillisSync(path, atime, mtime) {
|
|
1091
|
+
const fd = fs2.openSync(path, "r+");
|
|
1092
1092
|
fs2.futimesSync(fd, atime, mtime);
|
|
1093
1093
|
return fs2.closeSync(fd);
|
|
1094
1094
|
}
|
|
@@ -1104,7 +1104,7 @@ var require_stat = __commonJS({
|
|
|
1104
1104
|
"node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
1105
1105
|
"use strict";
|
|
1106
1106
|
var fs2 = require_fs();
|
|
1107
|
-
var
|
|
1107
|
+
var path = require("path");
|
|
1108
1108
|
var u = require_universalify().fromPromise;
|
|
1109
1109
|
function getStats(src, dest, opts) {
|
|
1110
1110
|
const statFunc = opts.dereference ? (file) => fs2.stat(file, { bigint: true }) : (file) => fs2.lstat(file, { bigint: true });
|
|
@@ -1133,8 +1133,8 @@ var require_stat = __commonJS({
|
|
|
1133
1133
|
const { srcStat, destStat } = yield getStats(src, dest, opts);
|
|
1134
1134
|
if (destStat) {
|
|
1135
1135
|
if (areIdentical(srcStat, destStat)) {
|
|
1136
|
-
const srcBaseName =
|
|
1137
|
-
const destBaseName =
|
|
1136
|
+
const srcBaseName = path.basename(src);
|
|
1137
|
+
const destBaseName = path.basename(dest);
|
|
1138
1138
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1139
1139
|
return { srcStat, destStat, isChangingCase: true };
|
|
1140
1140
|
}
|
|
@@ -1157,8 +1157,8 @@ var require_stat = __commonJS({
|
|
|
1157
1157
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1158
1158
|
if (destStat) {
|
|
1159
1159
|
if (areIdentical(srcStat, destStat)) {
|
|
1160
|
-
const srcBaseName =
|
|
1161
|
-
const destBaseName =
|
|
1160
|
+
const srcBaseName = path.basename(src);
|
|
1161
|
+
const destBaseName = path.basename(dest);
|
|
1162
1162
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1163
1163
|
return { srcStat, destStat, isChangingCase: true };
|
|
1164
1164
|
}
|
|
@@ -1178,9 +1178,9 @@ var require_stat = __commonJS({
|
|
|
1178
1178
|
}
|
|
1179
1179
|
function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1180
1180
|
return __async(this, null, function* () {
|
|
1181
|
-
const srcParent =
|
|
1182
|
-
const destParent =
|
|
1183
|
-
if (destParent === srcParent || destParent ===
|
|
1181
|
+
const srcParent = path.resolve(path.dirname(src));
|
|
1182
|
+
const destParent = path.resolve(path.dirname(dest));
|
|
1183
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root) return;
|
|
1184
1184
|
let destStat;
|
|
1185
1185
|
try {
|
|
1186
1186
|
destStat = yield fs2.stat(destParent, { bigint: true });
|
|
@@ -1195,9 +1195,9 @@ var require_stat = __commonJS({
|
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
1197
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1198
|
-
const srcParent =
|
|
1199
|
-
const destParent =
|
|
1200
|
-
if (destParent === srcParent || destParent ===
|
|
1198
|
+
const srcParent = path.resolve(path.dirname(src));
|
|
1199
|
+
const destParent = path.resolve(path.dirname(dest));
|
|
1200
|
+
if (destParent === srcParent || destParent === path.parse(destParent).root) return;
|
|
1201
1201
|
let destStat;
|
|
1202
1202
|
try {
|
|
1203
1203
|
destStat = fs2.statSync(destParent, { bigint: true });
|
|
@@ -1214,8 +1214,8 @@ var require_stat = __commonJS({
|
|
|
1214
1214
|
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1215
1215
|
}
|
|
1216
1216
|
function isSrcSubdir(src, dest) {
|
|
1217
|
-
const srcArr =
|
|
1218
|
-
const destArr =
|
|
1217
|
+
const srcArr = path.resolve(src).split(path.sep).filter((i) => i);
|
|
1218
|
+
const destArr = path.resolve(dest).split(path.sep).filter((i) => i);
|
|
1219
1219
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
1220
1220
|
}
|
|
1221
1221
|
function errMsg(src, dest, funcName) {
|
|
@@ -1240,7 +1240,7 @@ var require_copy = __commonJS({
|
|
|
1240
1240
|
"node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
1241
1241
|
"use strict";
|
|
1242
1242
|
var fs2 = require_fs();
|
|
1243
|
-
var
|
|
1243
|
+
var path = require("path");
|
|
1244
1244
|
var { mkdirs } = require_mkdirs();
|
|
1245
1245
|
var { pathExists } = require_path_exists();
|
|
1246
1246
|
var { utimesMillis } = require_utimes();
|
|
@@ -1263,7 +1263,7 @@ var require_copy = __commonJS({
|
|
|
1263
1263
|
yield stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1264
1264
|
const include = yield runFilter(src, dest, opts);
|
|
1265
1265
|
if (!include) return;
|
|
1266
|
-
const destParent =
|
|
1266
|
+
const destParent = path.dirname(dest);
|
|
1267
1267
|
const dirExists = yield pathExists(destParent);
|
|
1268
1268
|
if (!dirExists) {
|
|
1269
1269
|
yield mkdirs(destParent);
|
|
@@ -1329,8 +1329,8 @@ var require_copy = __commonJS({
|
|
|
1329
1329
|
try {
|
|
1330
1330
|
for (var iter = __forAwait(yield fs2.opendir(src)), more, temp, error; more = !(temp = yield iter.next()).done; more = false) {
|
|
1331
1331
|
const item = temp.value;
|
|
1332
|
-
const srcItem =
|
|
1333
|
-
const destItem =
|
|
1332
|
+
const srcItem = path.join(src, item.name);
|
|
1333
|
+
const destItem = path.join(dest, item.name);
|
|
1334
1334
|
promises.push(
|
|
1335
1335
|
runFilter(srcItem, destItem, opts).then((include) => {
|
|
1336
1336
|
if (include) {
|
|
@@ -1361,7 +1361,7 @@ var require_copy = __commonJS({
|
|
|
1361
1361
|
return __async(this, null, function* () {
|
|
1362
1362
|
let resolvedSrc = yield fs2.readlink(src);
|
|
1363
1363
|
if (opts.dereference) {
|
|
1364
|
-
resolvedSrc =
|
|
1364
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
|
1365
1365
|
}
|
|
1366
1366
|
if (!destStat) {
|
|
1367
1367
|
return fs2.symlink(resolvedSrc, dest);
|
|
@@ -1374,7 +1374,7 @@ var require_copy = __commonJS({
|
|
|
1374
1374
|
throw e;
|
|
1375
1375
|
}
|
|
1376
1376
|
if (opts.dereference) {
|
|
1377
|
-
resolvedDest =
|
|
1377
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
|
1378
1378
|
}
|
|
1379
1379
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1380
1380
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -1395,7 +1395,7 @@ var require_copy_sync = __commonJS({
|
|
|
1395
1395
|
"node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
1396
1396
|
"use strict";
|
|
1397
1397
|
var fs2 = require_graceful_fs();
|
|
1398
|
-
var
|
|
1398
|
+
var path = require("path");
|
|
1399
1399
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1400
1400
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1401
1401
|
var stat = require_stat();
|
|
@@ -1416,7 +1416,7 @@ var require_copy_sync = __commonJS({
|
|
|
1416
1416
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1417
1417
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1418
1418
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1419
|
-
const destParent =
|
|
1419
|
+
const destParent = path.dirname(dest);
|
|
1420
1420
|
if (!fs2.existsSync(destParent)) mkdirsSync(destParent);
|
|
1421
1421
|
return getStats(destStat, src, dest, opts);
|
|
1422
1422
|
}
|
|
@@ -1485,8 +1485,8 @@ var require_copy_sync = __commonJS({
|
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
function copyDirItem(item, src, dest, opts) {
|
|
1488
|
-
const srcItem =
|
|
1489
|
-
const destItem =
|
|
1488
|
+
const srcItem = path.join(src, item);
|
|
1489
|
+
const destItem = path.join(dest, item);
|
|
1490
1490
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1491
1491
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1492
1492
|
return getStats(destStat, srcItem, destItem, opts);
|
|
@@ -1494,7 +1494,7 @@ var require_copy_sync = __commonJS({
|
|
|
1494
1494
|
function onLink(destStat, src, dest, opts) {
|
|
1495
1495
|
let resolvedSrc = fs2.readlinkSync(src);
|
|
1496
1496
|
if (opts.dereference) {
|
|
1497
|
-
resolvedSrc =
|
|
1497
|
+
resolvedSrc = path.resolve(process.cwd(), resolvedSrc);
|
|
1498
1498
|
}
|
|
1499
1499
|
if (!destStat) {
|
|
1500
1500
|
return fs2.symlinkSync(resolvedSrc, dest);
|
|
@@ -1507,7 +1507,7 @@ var require_copy_sync = __commonJS({
|
|
|
1507
1507
|
throw err;
|
|
1508
1508
|
}
|
|
1509
1509
|
if (opts.dereference) {
|
|
1510
|
-
resolvedDest =
|
|
1510
|
+
resolvedDest = path.resolve(process.cwd(), resolvedDest);
|
|
1511
1511
|
}
|
|
1512
1512
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1513
1513
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -1544,11 +1544,11 @@ var require_remove = __commonJS({
|
|
|
1544
1544
|
"use strict";
|
|
1545
1545
|
var fs2 = require_graceful_fs();
|
|
1546
1546
|
var u = require_universalify().fromCallback;
|
|
1547
|
-
function remove(
|
|
1548
|
-
fs2.rm(
|
|
1547
|
+
function remove(path, callback) {
|
|
1548
|
+
fs2.rm(path, { recursive: true, force: true }, callback);
|
|
1549
1549
|
}
|
|
1550
|
-
function removeSync(
|
|
1551
|
-
fs2.rmSync(
|
|
1550
|
+
function removeSync(path) {
|
|
1551
|
+
fs2.rmSync(path, { recursive: true, force: true });
|
|
1552
1552
|
}
|
|
1553
1553
|
module2.exports = {
|
|
1554
1554
|
remove: u(remove),
|
|
@@ -1563,7 +1563,7 @@ var require_empty = __commonJS({
|
|
|
1563
1563
|
"use strict";
|
|
1564
1564
|
var u = require_universalify().fromPromise;
|
|
1565
1565
|
var fs2 = require_fs();
|
|
1566
|
-
var
|
|
1566
|
+
var path = require("path");
|
|
1567
1567
|
var mkdir = require_mkdirs();
|
|
1568
1568
|
var remove = require_remove();
|
|
1569
1569
|
var emptyDir = u(function emptyDir2(dir) {
|
|
@@ -1574,7 +1574,7 @@ var require_empty = __commonJS({
|
|
|
1574
1574
|
} catch (e) {
|
|
1575
1575
|
return mkdir.mkdirs(dir);
|
|
1576
1576
|
}
|
|
1577
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
1577
|
+
return Promise.all(items.map((item) => remove.remove(path.join(dir, item))));
|
|
1578
1578
|
});
|
|
1579
1579
|
});
|
|
1580
1580
|
function emptyDirSync(dir) {
|
|
@@ -1585,7 +1585,7 @@ var require_empty = __commonJS({
|
|
|
1585
1585
|
return mkdir.mkdirsSync(dir);
|
|
1586
1586
|
}
|
|
1587
1587
|
items.forEach((item) => {
|
|
1588
|
-
item =
|
|
1588
|
+
item = path.join(dir, item);
|
|
1589
1589
|
remove.removeSync(item);
|
|
1590
1590
|
});
|
|
1591
1591
|
}
|
|
@@ -1603,7 +1603,7 @@ var require_file = __commonJS({
|
|
|
1603
1603
|
"node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
1604
1604
|
"use strict";
|
|
1605
1605
|
var u = require_universalify().fromPromise;
|
|
1606
|
-
var
|
|
1606
|
+
var path = require("path");
|
|
1607
1607
|
var fs2 = require_fs();
|
|
1608
1608
|
var mkdir = require_mkdirs();
|
|
1609
1609
|
function createFile(file) {
|
|
@@ -1614,7 +1614,7 @@ var require_file = __commonJS({
|
|
|
1614
1614
|
} catch (e) {
|
|
1615
1615
|
}
|
|
1616
1616
|
if (stats && stats.isFile()) return;
|
|
1617
|
-
const dir =
|
|
1617
|
+
const dir = path.dirname(file);
|
|
1618
1618
|
let dirStats = null;
|
|
1619
1619
|
try {
|
|
1620
1620
|
dirStats = yield fs2.stat(dir);
|
|
@@ -1641,7 +1641,7 @@ var require_file = __commonJS({
|
|
|
1641
1641
|
} catch (e) {
|
|
1642
1642
|
}
|
|
1643
1643
|
if (stats && stats.isFile()) return;
|
|
1644
|
-
const dir =
|
|
1644
|
+
const dir = path.dirname(file);
|
|
1645
1645
|
try {
|
|
1646
1646
|
if (!fs2.statSync(dir).isDirectory()) {
|
|
1647
1647
|
fs2.readdirSync(dir);
|
|
@@ -1664,7 +1664,7 @@ var require_link = __commonJS({
|
|
|
1664
1664
|
"node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
1665
1665
|
"use strict";
|
|
1666
1666
|
var u = require_universalify().fromPromise;
|
|
1667
|
-
var
|
|
1667
|
+
var path = require("path");
|
|
1668
1668
|
var fs2 = require_fs();
|
|
1669
1669
|
var mkdir = require_mkdirs();
|
|
1670
1670
|
var { pathExists } = require_path_exists();
|
|
@@ -1684,7 +1684,7 @@ var require_link = __commonJS({
|
|
|
1684
1684
|
throw err;
|
|
1685
1685
|
}
|
|
1686
1686
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1687
|
-
const dir =
|
|
1687
|
+
const dir = path.dirname(dstpath);
|
|
1688
1688
|
const dirExists = yield pathExists(dir);
|
|
1689
1689
|
if (!dirExists) {
|
|
1690
1690
|
yield mkdir.mkdirs(dir);
|
|
@@ -1705,7 +1705,7 @@ var require_link = __commonJS({
|
|
|
1705
1705
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1706
1706
|
throw err;
|
|
1707
1707
|
}
|
|
1708
|
-
const dir =
|
|
1708
|
+
const dir = path.dirname(dstpath);
|
|
1709
1709
|
const dirExists = fs2.existsSync(dir);
|
|
1710
1710
|
if (dirExists) return fs2.linkSync(srcpath, dstpath);
|
|
1711
1711
|
mkdir.mkdirsSync(dir);
|
|
@@ -1722,13 +1722,13 @@ var require_link = __commonJS({
|
|
|
1722
1722
|
var require_symlink_paths = __commonJS({
|
|
1723
1723
|
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
1724
1724
|
"use strict";
|
|
1725
|
-
var
|
|
1725
|
+
var path = require("path");
|
|
1726
1726
|
var fs2 = require_fs();
|
|
1727
1727
|
var { pathExists } = require_path_exists();
|
|
1728
1728
|
var u = require_universalify().fromPromise;
|
|
1729
1729
|
function symlinkPaths(srcpath, dstpath) {
|
|
1730
1730
|
return __async(this, null, function* () {
|
|
1731
|
-
if (
|
|
1731
|
+
if (path.isAbsolute(srcpath)) {
|
|
1732
1732
|
try {
|
|
1733
1733
|
yield fs2.lstat(srcpath);
|
|
1734
1734
|
} catch (err) {
|
|
@@ -1740,8 +1740,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1740
1740
|
toDst: srcpath
|
|
1741
1741
|
};
|
|
1742
1742
|
}
|
|
1743
|
-
const dstdir =
|
|
1744
|
-
const relativeToDst =
|
|
1743
|
+
const dstdir = path.dirname(dstpath);
|
|
1744
|
+
const relativeToDst = path.join(dstdir, srcpath);
|
|
1745
1745
|
const exists = yield pathExists(relativeToDst);
|
|
1746
1746
|
if (exists) {
|
|
1747
1747
|
return {
|
|
@@ -1757,12 +1757,12 @@ var require_symlink_paths = __commonJS({
|
|
|
1757
1757
|
}
|
|
1758
1758
|
return {
|
|
1759
1759
|
toCwd: srcpath,
|
|
1760
|
-
toDst:
|
|
1760
|
+
toDst: path.relative(dstdir, srcpath)
|
|
1761
1761
|
};
|
|
1762
1762
|
});
|
|
1763
1763
|
}
|
|
1764
1764
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1765
|
-
if (
|
|
1765
|
+
if (path.isAbsolute(srcpath)) {
|
|
1766
1766
|
const exists2 = fs2.existsSync(srcpath);
|
|
1767
1767
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
1768
1768
|
return {
|
|
@@ -1770,8 +1770,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1770
1770
|
toDst: srcpath
|
|
1771
1771
|
};
|
|
1772
1772
|
}
|
|
1773
|
-
const dstdir =
|
|
1774
|
-
const relativeToDst =
|
|
1773
|
+
const dstdir = path.dirname(dstpath);
|
|
1774
|
+
const relativeToDst = path.join(dstdir, srcpath);
|
|
1775
1775
|
const exists = fs2.existsSync(relativeToDst);
|
|
1776
1776
|
if (exists) {
|
|
1777
1777
|
return {
|
|
@@ -1783,7 +1783,7 @@ var require_symlink_paths = __commonJS({
|
|
|
1783
1783
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
1784
1784
|
return {
|
|
1785
1785
|
toCwd: srcpath,
|
|
1786
|
-
toDst:
|
|
1786
|
+
toDst: path.relative(dstdir, srcpath)
|
|
1787
1787
|
};
|
|
1788
1788
|
}
|
|
1789
1789
|
module2.exports = {
|
|
@@ -1833,7 +1833,7 @@ var require_symlink = __commonJS({
|
|
|
1833
1833
|
"node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
1834
1834
|
"use strict";
|
|
1835
1835
|
var u = require_universalify().fromPromise;
|
|
1836
|
-
var
|
|
1836
|
+
var path = require("path");
|
|
1837
1837
|
var fs2 = require_fs();
|
|
1838
1838
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1839
1839
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
@@ -1857,7 +1857,7 @@ var require_symlink = __commonJS({
|
|
|
1857
1857
|
const relative = yield symlinkPaths(srcpath, dstpath);
|
|
1858
1858
|
srcpath = relative.toDst;
|
|
1859
1859
|
const toType = yield symlinkType(relative.toCwd, type);
|
|
1860
|
-
const dir =
|
|
1860
|
+
const dir = path.dirname(dstpath);
|
|
1861
1861
|
if (!(yield pathExists(dir))) {
|
|
1862
1862
|
yield mkdirs(dir);
|
|
1863
1863
|
}
|
|
@@ -1878,7 +1878,7 @@ var require_symlink = __commonJS({
|
|
|
1878
1878
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1879
1879
|
srcpath = relative.toDst;
|
|
1880
1880
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
1881
|
-
const dir =
|
|
1881
|
+
const dir = path.dirname(dstpath);
|
|
1882
1882
|
const exists = fs2.existsSync(dir);
|
|
1883
1883
|
if (exists) return fs2.symlinkSync(srcpath, dstpath, type);
|
|
1884
1884
|
mkdirsSync(dir);
|
|
@@ -2032,12 +2032,12 @@ var require_output_file = __commonJS({
|
|
|
2032
2032
|
"use strict";
|
|
2033
2033
|
var u = require_universalify().fromPromise;
|
|
2034
2034
|
var fs2 = require_fs();
|
|
2035
|
-
var
|
|
2035
|
+
var path = require("path");
|
|
2036
2036
|
var mkdir = require_mkdirs();
|
|
2037
2037
|
var pathExists = require_path_exists().pathExists;
|
|
2038
2038
|
function outputFile2(file, data, encoding = "utf-8") {
|
|
2039
2039
|
return __async(this, null, function* () {
|
|
2040
|
-
const dir =
|
|
2040
|
+
const dir = path.dirname(file);
|
|
2041
2041
|
if (!(yield pathExists(dir))) {
|
|
2042
2042
|
yield mkdir.mkdirs(dir);
|
|
2043
2043
|
}
|
|
@@ -2045,7 +2045,7 @@ var require_output_file = __commonJS({
|
|
|
2045
2045
|
});
|
|
2046
2046
|
}
|
|
2047
2047
|
function outputFileSync(file, ...args) {
|
|
2048
|
-
const dir =
|
|
2048
|
+
const dir = path.dirname(file);
|
|
2049
2049
|
if (!fs2.existsSync(dir)) {
|
|
2050
2050
|
mkdir.mkdirsSync(dir);
|
|
2051
2051
|
}
|
|
@@ -2111,7 +2111,7 @@ var require_move = __commonJS({
|
|
|
2111
2111
|
"node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
2112
2112
|
"use strict";
|
|
2113
2113
|
var fs2 = require_fs();
|
|
2114
|
-
var
|
|
2114
|
+
var path = require("path");
|
|
2115
2115
|
var { copy } = require_copy2();
|
|
2116
2116
|
var { remove } = require_remove();
|
|
2117
2117
|
var { mkdirp } = require_mkdirs();
|
|
@@ -2122,8 +2122,8 @@ var require_move = __commonJS({
|
|
|
2122
2122
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2123
2123
|
const { srcStat, isChangingCase = false } = yield stat.checkPaths(src, dest, "move", opts);
|
|
2124
2124
|
yield stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2125
|
-
const destParent =
|
|
2126
|
-
const parsedParentPath =
|
|
2125
|
+
const destParent = path.dirname(dest);
|
|
2126
|
+
const parsedParentPath = path.parse(destParent);
|
|
2127
2127
|
if (parsedParentPath.root !== destParent) {
|
|
2128
2128
|
yield mkdirp(destParent);
|
|
2129
2129
|
}
|
|
@@ -2169,7 +2169,7 @@ var require_move_sync = __commonJS({
|
|
|
2169
2169
|
"node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
2170
2170
|
"use strict";
|
|
2171
2171
|
var fs2 = require_graceful_fs();
|
|
2172
|
-
var
|
|
2172
|
+
var path = require("path");
|
|
2173
2173
|
var copySync = require_copy2().copySync;
|
|
2174
2174
|
var removeSync = require_remove().removeSync;
|
|
2175
2175
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2179,12 +2179,12 @@ var require_move_sync = __commonJS({
|
|
|
2179
2179
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2180
2180
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2181
2181
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2182
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2182
|
+
if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest));
|
|
2183
2183
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2184
2184
|
}
|
|
2185
2185
|
function isParentRoot(dest) {
|
|
2186
|
-
const parent =
|
|
2187
|
-
const parsedPath =
|
|
2186
|
+
const parent = path.dirname(dest);
|
|
2187
|
+
const parsedPath = path.parse(parent);
|
|
2188
2188
|
return parsedPath.root === parent;
|
|
2189
2189
|
}
|
|
2190
2190
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2239,9 +2239,8 @@ var require_lib = __commonJS({
|
|
|
2239
2239
|
|
|
2240
2240
|
// src/main.ts
|
|
2241
2241
|
var import_fs_extra = __toESM(require_lib(), 1);
|
|
2242
|
-
var import_path = __toESM(require("path"), 1);
|
|
2243
2242
|
var inputFile = process.argv[2];
|
|
2244
|
-
var outputFile = process.argv[3] ||
|
|
2243
|
+
var outputFile = process.argv[3] || `${inputFile}.ts`;
|
|
2245
2244
|
var input = import_fs_extra.default.readFileSync(inputFile, "utf-8");
|
|
2246
2245
|
var output = [];
|
|
2247
2246
|
output.push("/*");
|
|
@@ -2291,6 +2290,15 @@ for (const block of blocks) {
|
|
|
2291
2290
|
case "float64" /* FLOAT64 */:
|
|
2292
2291
|
output.push(`export const ${fieldName} = new Float64Array(${length})`);
|
|
2293
2292
|
break;
|
|
2293
|
+
case "string" /* STRING */:
|
|
2294
|
+
output.push(`export const ${fieldName} = new Array<string>(${length})${length ? '.fill("")' : ""}`);
|
|
2295
|
+
break;
|
|
2296
|
+
case "boolean" /* BOOLEAN */:
|
|
2297
|
+
output.push(`export const ${fieldName} = new Array<boolean>(${length})${length ? ".fill(false)" : ""}`);
|
|
2298
|
+
break;
|
|
2299
|
+
case "number" /* NUMBER */:
|
|
2300
|
+
output.push(`export const ${fieldName} = new Array<number>(${length})${length ? ".fill(0)" : ""}`);
|
|
2301
|
+
break;
|
|
2294
2302
|
default:
|
|
2295
2303
|
output.push(`export const ${fieldName} = new Array<${fieldArrayType}>(${length})`);
|
|
2296
2304
|
}
|