game-data-gen 1.0.2 → 1.0.3
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/dist/main.js +4 -26
- package/package.json +3 -2
package/dist/main.js
CHANGED
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
1
|
+
#!/usr/bin/env node
|
|
24
2
|
|
|
25
3
|
// src/main.ts
|
|
26
|
-
|
|
4
|
+
import fs from "fs";
|
|
27
5
|
var inputFile = process.argv[2];
|
|
28
6
|
var outputFile = process.argv[3] || `${inputFile}.ts`;
|
|
29
|
-
var input =
|
|
7
|
+
var input = fs.readFileSync(inputFile, "utf-8");
|
|
30
8
|
var output = [];
|
|
31
9
|
output.push("/*");
|
|
32
10
|
output.push(` * Generated with game-data-gen on ${(/* @__PURE__ */ new Date()).toLocaleString()}. DO NOT MODIFY THIS FILE!`);
|
|
@@ -167,4 +145,4 @@ function getTypeName(type) {
|
|
|
167
145
|
function capitalize(str) {
|
|
168
146
|
return `${str.substring(0, 1).toUpperCase()}${str.substring(1)}`;
|
|
169
147
|
}
|
|
170
|
-
|
|
148
|
+
fs.writeFileSync(outputFile, output.join("\n"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "game-data-gen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"bin": "dist/main.js",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "tsx watch src/main.ts tests/data",
|
|
11
|
-
"build": "tsc && esbuild src/main.ts --bundle --platform=node --target=es6 --outdir=dist"
|
|
11
|
+
"build": "tsc && esbuild src/main.ts --bundle --platform=node --format=esm --target=es6 --outdir=dist --banner:js='#!/usr/bin/env node'",
|
|
12
|
+
"test": "npx game-data-gen src/tests/data"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|