create-cubeforge-game 0.1.2 → 0.1.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/bin/index.js +33 -14
- package/package.json +2 -2
package/bin/index.js
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
#!/usr/bin/env node
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
2
26
|
|
|
3
27
|
// bin/index.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
28
|
+
var fs = __toESM(require("fs"));
|
|
29
|
+
var path = __toESM(require("path"));
|
|
30
|
+
var readline = __toESM(require("readline"));
|
|
31
|
+
var import_meta = {};
|
|
7
32
|
function prompt(question) {
|
|
8
33
|
return new Promise((resolve2) => {
|
|
9
34
|
const rl = readline.createInterface({
|
|
@@ -40,8 +65,7 @@ async function main() {
|
|
|
40
65
|
projectName = await prompt("Project name: ");
|
|
41
66
|
}
|
|
42
67
|
if (!projectName) {
|
|
43
|
-
process.stderr.write(
|
|
44
|
-
`);
|
|
68
|
+
process.stderr.write("Error: project name is required.\n");
|
|
45
69
|
process.exit(1);
|
|
46
70
|
}
|
|
47
71
|
const targetDir = path.resolve(process.cwd(), projectName);
|
|
@@ -50,7 +74,7 @@ async function main() {
|
|
|
50
74
|
`);
|
|
51
75
|
process.exit(1);
|
|
52
76
|
}
|
|
53
|
-
const templatesDir = path.join(
|
|
77
|
+
const templatesDir = path.join(import_meta.dirname, "..", "templates", "default");
|
|
54
78
|
process.stdout.write(`
|
|
55
79
|
Creating new Cubeforge game in ${targetDir}...
|
|
56
80
|
`);
|
|
@@ -58,16 +82,11 @@ Creating new Cubeforge game in ${targetDir}...
|
|
|
58
82
|
process.stdout.write(`
|
|
59
83
|
Done! Your project "${projectName}" is ready.
|
|
60
84
|
`);
|
|
61
|
-
process.stdout.write(
|
|
62
|
-
Next steps:
|
|
63
|
-
`);
|
|
85
|
+
process.stdout.write("\nNext steps:\n");
|
|
64
86
|
process.stdout.write(` cd ${projectName}
|
|
65
87
|
`);
|
|
66
|
-
process.stdout.write(
|
|
67
|
-
|
|
68
|
-
process.stdout.write(` npm run dev # or bun dev
|
|
69
|
-
|
|
70
|
-
`);
|
|
88
|
+
process.stdout.write(" npm install # or bun install\n");
|
|
89
|
+
process.stdout.write(" npm run dev # or bun dev\n\n");
|
|
71
90
|
}
|
|
72
91
|
main().catch((err) => {
|
|
73
92
|
process.stderr.write(`Unexpected error: ${String(err)}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cubeforge-game",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Scaffold a new Cubeforge game project",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-cubeforge-game": "./bin/index.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "
|
|
9
|
+
"build": "esbuild bin/index.ts --bundle --platform=node --target=node18 --outfile=bin/index.js \"--banner:js=#!/usr/bin/env node\""
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"bin": {
|