vibedgames 0.8.1 → 0.10.0
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 +17 -8
- package/assets/align-framing.py +242 -0
- package/assets/render-model.py +406 -0
- package/assets/tilemap-editor.html +630 -0
- package/dist/THIRD_PARTY_NOTICES.txt +59 -7
- package/dist/chunk-2KVQJKIZ.js +6495 -0
- package/dist/chunk-2SBBKY5C.js +16993 -0
- package/dist/chunk-2ZKS7V72.js +170 -0
- package/dist/{chunk-RAUJA3OY.js → chunk-3HGBIUM5.js} +21 -18
- package/dist/chunk-3UGGMFJJ.js +22 -0
- package/dist/{chunk-I6O4HIDY.js → chunk-42K3BJJH.js} +163 -131
- package/dist/chunk-43P4U7CB.js +104 -0
- package/dist/chunk-4FJXCS3K.js +741 -0
- package/dist/{chunk-NC5XCGYU.js → chunk-4UU622RK.js} +6 -5
- package/dist/{chunk-2QBYTIMH.js → chunk-5535KDYI.js} +1 -1
- package/dist/chunk-5YPLKGY3.js +87 -0
- package/dist/chunk-6KXXZXSO.js +475 -0
- package/dist/chunk-7RPLQWR2.js +91 -0
- package/dist/{chunk-C2IRIRAA.js → chunk-A556KALN.js} +15 -14
- package/dist/{chunk-N3XAUFKH.js → chunk-ABTUEIRC.js} +576 -301
- package/dist/{chunk-PEUP4MZR.js → chunk-AWJNAGPE.js} +6 -3
- package/dist/{chunk-QGEITHUP.js → chunk-BN3Q7UEC.js} +22 -19
- package/dist/chunk-BZOMEG3X.js +412 -0
- package/dist/{chunk-ZYCSYJWX.js → chunk-COSLGSVO.js} +14 -24
- package/dist/{chunk-PQDBCZRT.js → chunk-CTY2WZQK.js} +204 -158
- package/dist/{chunk-CU7UY5YJ.js → chunk-D2RF35HJ.js} +1 -1
- package/dist/chunk-DB7WVFS7.js +80 -0
- package/dist/chunk-DOOQUFPG.js +73 -0
- package/dist/chunk-E3FJUPLT.js +177 -0
- package/dist/chunk-E7NDOZ27.js +428 -0
- package/dist/chunk-F42QKWBB.js +39 -0
- package/dist/chunk-FXXVXDTW.js +168 -0
- package/dist/{chunk-VFFOT7KD.js → chunk-G66HRVDW.js} +1 -1
- package/dist/{chunk-CAKBGDCY.js → chunk-GKDUYJ7R.js} +5 -0
- package/dist/chunk-GLEW7VJQ.js +45 -0
- package/dist/{chunk-MGIASPED.js → chunk-H2C4QUTG.js} +9 -8
- package/dist/{chunk-HCMTSR7E.js → chunk-HRKVAXNN.js} +21 -17
- package/dist/{chunk-TLRL6FHW.js → chunk-HSMG6U7J.js} +10 -9
- package/dist/chunk-HX5Q63UA.js +48 -0
- package/dist/chunk-HYOXGNWS.js +53 -0
- package/dist/chunk-I5LELJSK.js +22 -0
- package/dist/{chunk-6FZPPUQH.js → chunk-JN4WZCR7.js} +5 -4
- package/dist/{chunk-QJZ72MSY.js → chunk-K36EOII3.js} +7 -6
- package/dist/chunk-KAGVI3CE.js +62 -0
- package/dist/chunk-KJK5CB6E.js +58 -0
- package/dist/chunk-KLFBAFXD.js +25 -0
- package/dist/{chunk-7MKUR7Y3.js → chunk-LONQWRTR.js} +112 -81
- package/dist/chunk-LORGE2NB.js +2484 -0
- package/dist/{chunk-HKA5LBYW.js → chunk-MEAO33XW.js} +22 -19
- package/dist/{chunk-PM5UOIKR.js → chunk-MR5KIFI7.js} +22 -21
- package/dist/{chunk-GCX5KQ6A.js → chunk-N2UHAQXC.js} +18 -11
- package/dist/chunk-NCX6LYNJ.js +117 -0
- package/dist/chunk-OGX4DKIS.js +215 -0
- package/dist/chunk-OPUCUUID.js +41 -0
- package/dist/chunk-Q2QC6KAZ.js +132 -0
- package/dist/{chunk-2GL2WJZX.js → chunk-Q3XQPNF6.js} +14 -14
- package/dist/{chunk-RYFO3ZPO.js → chunk-Q5NZNXJE.js} +15 -12
- package/dist/{chunk-JT2AU24K.js → chunk-QARXJGI5.js} +1 -1
- package/dist/chunk-QLCVLCPM.js +126 -0
- package/dist/chunk-R2WVORGD.js +91 -0
- package/dist/chunk-RKS7SI5L.js +64 -0
- package/dist/{chunk-4BGCA3W7.js → chunk-RPJR3S5S.js} +32 -18
- package/dist/chunk-RPSUFZAG.js +3307 -0
- package/dist/chunk-RRI23NK2.js +40 -0
- package/dist/chunk-S7HYWITX.js +57 -0
- package/dist/chunk-SBXCK2I2.js +48 -0
- package/dist/chunk-SUSX3QIA.js +62 -0
- package/dist/{chunk-PHEDW6C7.js → chunk-SXYQL4GK.js} +16 -7
- package/dist/{chunk-ZI6PKVXG.js → chunk-TMPBGXT4.js} +6 -5
- package/dist/chunk-TXOE5UY5.js +72 -0
- package/dist/chunk-U6DTE5IX.js +124 -0
- package/dist/chunk-UPHB5HWO.js +115 -0
- package/dist/chunk-UQ7VO6B3.js +91 -0
- package/dist/chunk-VB4WLJR2.js +47 -0
- package/dist/{chunk-FNYBZNW2.js → chunk-VIEKOGKG.js} +21 -3
- package/dist/{chunk-QIVCBUYD.js → chunk-VZEJ2ZHE.js} +18 -18
- package/dist/chunk-X75Y7LUW.js +126 -0
- package/dist/{chunk-Z4Z24FWO.js → chunk-YNCYMWER.js} +8 -5
- package/dist/chunk-ZHLPE6LI.js +71 -0
- package/dist/index.js +48 -34
- package/package.json +32 -16
- package/templates/none/src/main.ts +4 -0
- package/templates/none/vite.config.ts +0 -2
- package/templates/phaser/src/main.ts +0 -1
- package/templates/phaser/src/scenes/game-scene.ts +10 -8
- package/templates/phaser/vite.config.ts +0 -2
- package/templates/react-r3f/src/app.tsx +3 -1
- package/templates/react-r3f/src/main.tsx +1 -0
- package/templates/react-r3f/vite.config.ts +0 -2
- package/templates/threejs/src/main.ts +10 -1
- package/templates/threejs/vite.config.ts +0 -2
- package/LICENSE +0 -21
- package/dist/chunk-AYJQVZXY.js +0 -39
- package/dist/chunk-J6PKNPI2.js +0 -26
- package/dist/chunk-MJQSHP3Y.js +0 -415
- package/dist/chunk-MYFLYNPO.js +0 -68
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module";
|
|
2
|
+
import { dirname as __pathDirname } from "node:path";
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
assertKnownFlags
|
|
9
|
+
} from "./chunk-RZ4DIJQW.js";
|
|
10
|
+
import {
|
|
11
|
+
authErrorCode,
|
|
12
|
+
createClient
|
|
13
|
+
} from "./chunk-CTY2WZQK.js";
|
|
14
|
+
import "./chunk-E3FJUPLT.js";
|
|
15
|
+
import {
|
|
16
|
+
getToken
|
|
17
|
+
} from "./chunk-Q5NZNXJE.js";
|
|
18
|
+
import {
|
|
19
|
+
outputArgs,
|
|
20
|
+
writeStructured
|
|
21
|
+
} from "./chunk-COSLGSVO.js";
|
|
22
|
+
import {
|
|
23
|
+
defineCommand
|
|
24
|
+
} from "./chunk-MBXCVCC4.js";
|
|
25
|
+
import {
|
|
26
|
+
consola
|
|
27
|
+
} from "./chunk-D2RF35HJ.js";
|
|
28
|
+
import "./chunk-YNCYMWER.js";
|
|
29
|
+
import "./chunk-AWJNAGPE.js";
|
|
30
|
+
import "./chunk-RPSUFZAG.js";
|
|
31
|
+
import "./chunk-2SBBKY5C.js";
|
|
32
|
+
import "./chunk-GKDUYJ7R.js";
|
|
33
|
+
|
|
34
|
+
// src/commands/deployments.ts
|
|
35
|
+
var requireLogin = () => {
|
|
36
|
+
if ((getToken() ?? "") === "") {
|
|
37
|
+
consola.warn("Not logged in. Run `vg login` to authenticate.");
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var fail = (doing, code, message) => {
|
|
42
|
+
if (code === "UNAUTHORIZED") {
|
|
43
|
+
consola.warn("Not authenticated. Run `vg login`, or check your VG_TOKEN / API key.");
|
|
44
|
+
} else {
|
|
45
|
+
consola.error(`${doing}: ${message}`);
|
|
46
|
+
}
|
|
47
|
+
process.exit(1);
|
|
48
|
+
};
|
|
49
|
+
var listGames = async () => {
|
|
50
|
+
try {
|
|
51
|
+
const { games } = await createClient().deploy.list();
|
|
52
|
+
return games;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
return fail(
|
|
55
|
+
"Could not list your games",
|
|
56
|
+
authErrorCode(error),
|
|
57
|
+
error instanceof Error ? error.message : String(error)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var formatBytes = (n) => {
|
|
62
|
+
if (n < 1024 * 1024) {
|
|
63
|
+
return `${(n / 1024).toFixed(1)} KB`;
|
|
64
|
+
}
|
|
65
|
+
return `${(n / (1024 * 1024)).toFixed(1)} MB`;
|
|
66
|
+
};
|
|
67
|
+
var listArgs = { ...outputArgs };
|
|
68
|
+
var listCommand = defineCommand({
|
|
69
|
+
args: listArgs,
|
|
70
|
+
meta: {
|
|
71
|
+
description: "List your games and their live deployments (the default).",
|
|
72
|
+
name: "list"
|
|
73
|
+
},
|
|
74
|
+
run: async ({ args, rawArgs }) => {
|
|
75
|
+
assertKnownFlags(rawArgs, listArgs);
|
|
76
|
+
requireLogin();
|
|
77
|
+
const games = await listGames();
|
|
78
|
+
const rows = games.map((g) => ({
|
|
79
|
+
bytes: g.deployment?.totalBytes ?? null,
|
|
80
|
+
deployed_at: g.deployment?.createdAt.toISOString() ?? null,
|
|
81
|
+
files: g.deployment?.fileCount ?? null,
|
|
82
|
+
id: g.id,
|
|
83
|
+
name: g.name,
|
|
84
|
+
slug: g.slug,
|
|
85
|
+
status: g.deployment?.status ?? null
|
|
86
|
+
}));
|
|
87
|
+
if (writeStructured({ games: rows }, args)) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (rows.length === 0) {
|
|
91
|
+
consola.log("No games yet. Ship one with `vg deploy`.");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
for (const row of rows) {
|
|
95
|
+
const live = row.files === null || row.bytes === null ? "not deployed" : `${row.files} files, ${formatBytes(row.bytes)}, ${row.deployed_at ?? ""}`;
|
|
96
|
+
consola.log(`${row.slug} ${live}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
var deleteArgs = {
|
|
101
|
+
slug: {
|
|
102
|
+
description: "Slug of the game to delete.",
|
|
103
|
+
required: true,
|
|
104
|
+
type: "positional"
|
|
105
|
+
},
|
|
106
|
+
yes: {
|
|
107
|
+
description: "Delete without asking. Required when there is no TTY (e.g. a coding agent).",
|
|
108
|
+
type: "boolean"
|
|
109
|
+
},
|
|
110
|
+
...outputArgs
|
|
111
|
+
};
|
|
112
|
+
var deleteCommand = defineCommand({
|
|
113
|
+
args: deleteArgs,
|
|
114
|
+
meta: {
|
|
115
|
+
description: "Permanently delete one of your games and all of its deployed files.",
|
|
116
|
+
name: "delete"
|
|
117
|
+
},
|
|
118
|
+
run: async ({ args, rawArgs }) => {
|
|
119
|
+
assertKnownFlags(rawArgs, deleteArgs);
|
|
120
|
+
requireLogin();
|
|
121
|
+
const games = await listGames();
|
|
122
|
+
const game = games.find((g) => g.slug === args.slug);
|
|
123
|
+
if (!game) {
|
|
124
|
+
consola.error(`You have no game "${args.slug}". List yours with \`vg deployments\`.`);
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
if (args.yes !== true) {
|
|
128
|
+
if (!process.stdin.isTTY) {
|
|
129
|
+
consola.error(`Deleting is permanent: pass --yes to delete ${args.slug}.`);
|
|
130
|
+
process.exit(2);
|
|
131
|
+
}
|
|
132
|
+
const confirmed = await consola.prompt(
|
|
133
|
+
`Permanently delete ${args.slug} and all of its files?`,
|
|
134
|
+
{ type: "confirm" }
|
|
135
|
+
);
|
|
136
|
+
if (!confirmed) {
|
|
137
|
+
consola.info("Nothing deleted.");
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
try {
|
|
142
|
+
await createClient().deploy.delete({ gameId: game.id });
|
|
143
|
+
} catch (error) {
|
|
144
|
+
fail(
|
|
145
|
+
`Could not delete ${args.slug}`,
|
|
146
|
+
authErrorCode(error),
|
|
147
|
+
error instanceof Error ? error.message : String(error)
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
if (writeStructured({ deleted: true, slug: args.slug }, args)) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
consola.success(`Deleted ${args.slug}.`);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
var deploymentsCommand = defineCommand({
|
|
157
|
+
args: outputArgs,
|
|
158
|
+
default: "list",
|
|
159
|
+
meta: {
|
|
160
|
+
description: "List your games, or delete one.",
|
|
161
|
+
name: "deployments"
|
|
162
|
+
},
|
|
163
|
+
subCommands: {
|
|
164
|
+
delete: deleteCommand,
|
|
165
|
+
list: listCommand
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
export {
|
|
169
|
+
deploymentsCommand
|
|
170
|
+
};
|
|
@@ -7,29 +7,30 @@ var __dirname = __pathDirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
isMissingCommand,
|
|
9
9
|
run
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F42QKWBB.js";
|
|
11
11
|
import {
|
|
12
12
|
So
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
PKG_NAME,
|
|
16
|
-
detectPackageManager,
|
|
17
|
-
globalInstallArgs,
|
|
18
|
-
globalInstallCommand
|
|
19
|
-
} from "./chunk-PEUP4MZR.js";
|
|
13
|
+
} from "./chunk-G66HRVDW.js";
|
|
20
14
|
import {
|
|
21
15
|
assertKnownFlags
|
|
22
16
|
} from "./chunk-RZ4DIJQW.js";
|
|
17
|
+
import {
|
|
18
|
+
defineCommand
|
|
19
|
+
} from "./chunk-MBXCVCC4.js";
|
|
23
20
|
import {
|
|
24
21
|
consola
|
|
25
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-D2RF35HJ.js";
|
|
26
23
|
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
PKG_NAME,
|
|
25
|
+
detectPackageManager,
|
|
26
|
+
globalInstallArgs,
|
|
27
|
+
globalInstallCommand
|
|
28
|
+
} from "./chunk-AWJNAGPE.js";
|
|
30
29
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
isJsonObject,
|
|
31
|
+
isJsonString,
|
|
32
|
+
parseJson
|
|
33
|
+
} from "./chunk-RPSUFZAG.js";
|
|
33
34
|
|
|
34
35
|
// src/commands/init.ts
|
|
35
36
|
import path2 from "node:path";
|
|
@@ -132,16 +133,18 @@ var SKILL_NAME = /^[a-z0-9][a-z0-9-]*$/u;
|
|
|
132
133
|
var SKIPPED_ENTRIES = /* @__PURE__ */ new Set([".DS_Store", ".git", "__pycache__", "node_modules"]);
|
|
133
134
|
var fetchSkillsSource = async (env = process.env) => {
|
|
134
135
|
const override = env.VG_SKILLS_SOURCE?.trim();
|
|
135
|
-
if (override && !/^https?:\/\//iu.test(override)) {
|
|
136
|
+
if (override !== void 0 && override !== "" && !/^https?:\/\//iu.test(override)) {
|
|
136
137
|
const root = path.resolve(override);
|
|
137
138
|
if (!existsSync(path.join(root, "plugins"))) {
|
|
138
139
|
throw new Error(`VG_SKILLS_SOURCE=${override} has no plugins/ directory.`);
|
|
139
140
|
}
|
|
140
141
|
return { origin: root, root };
|
|
141
142
|
}
|
|
142
|
-
const url = override || SKILLS_TARBALL;
|
|
143
|
+
const url = override === void 0 || override === "" ? SKILLS_TARBALL : override;
|
|
143
144
|
const work = mkdtempSync(path.join(tmpdir(), "vg-skills-"));
|
|
144
|
-
const cleanup = () =>
|
|
145
|
+
const cleanup = () => {
|
|
146
|
+
rmSync(work, { force: true, recursive: true });
|
|
147
|
+
};
|
|
145
148
|
try {
|
|
146
149
|
let res;
|
|
147
150
|
try {
|
|
@@ -192,7 +195,7 @@ var readJson = (file) => {
|
|
|
192
195
|
return null;
|
|
193
196
|
}
|
|
194
197
|
try {
|
|
195
|
-
const value =
|
|
198
|
+
const value = parseJson(readFileSync(file, "utf-8"));
|
|
196
199
|
return value;
|
|
197
200
|
} catch {
|
|
198
201
|
return null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module";
|
|
2
|
+
import { dirname as __pathDirname } from "node:path";
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
pythonScript
|
|
9
|
+
} from "./chunk-RRI23NK2.js";
|
|
10
|
+
import "./chunk-5535KDYI.js";
|
|
11
|
+
import "./chunk-D2RF35HJ.js";
|
|
12
|
+
import "./chunk-YNCYMWER.js";
|
|
13
|
+
import "./chunk-AWJNAGPE.js";
|
|
14
|
+
import "./chunk-RPSUFZAG.js";
|
|
15
|
+
import "./chunk-2SBBKY5C.js";
|
|
16
|
+
import "./chunk-GKDUYJ7R.js";
|
|
17
|
+
|
|
18
|
+
// src/commands/asset/align-framing.ts
|
|
19
|
+
var run = pythonScript("align-framing.py");
|
|
20
|
+
export {
|
|
21
|
+
run
|
|
22
|
+
};
|