vibedgames 0.6.3 → 0.8.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 +14 -9
- package/dist/THIRD_PARTY_NOTICES.txt +383 -0
- package/dist/chunk-2QBYTIMH.js +511 -0
- package/dist/chunk-6FZPPUQH.js +107 -0
- package/dist/chunk-AZGENOOR.js +22 -0
- package/dist/chunk-CAKBGDCY.js +47 -0
- package/dist/chunk-CU7UY5YJ.js +1108 -0
- package/dist/chunk-CZPKN32Z.js +257 -0
- package/dist/chunk-FL6IFBUF.js +22 -0
- package/dist/chunk-FNYBZNW2.js +165 -0
- package/dist/chunk-GUF6ADBF.js +273 -0
- package/dist/chunk-H4NBRFBY.js +79 -0
- package/dist/chunk-HASKWB6B.js +111 -0
- package/dist/chunk-I6O4HIDY.js +1063 -0
- package/dist/chunk-IO6OM6WM.js +466 -0
- package/dist/chunk-J6PKNPI2.js +26 -0
- package/dist/chunk-JT2AU24K.js +759 -0
- package/dist/chunk-K5SC6SXO.js +172 -0
- package/dist/chunk-MBXCVCC4.js +478 -0
- package/dist/chunk-PEUP4MZR.js +59 -0
- package/dist/chunk-PQDBCZRT.js +2017 -0
- package/dist/chunk-RIGKOLNN.js +1360 -0
- package/dist/chunk-RNBUX5VF.js +68 -0
- package/dist/chunk-RYFO3ZPO.js +71 -0
- package/dist/chunk-RZ4DIJQW.js +68 -0
- package/dist/chunk-SAANBZ25.js +118 -0
- package/dist/chunk-TMK6V5FV.js +395 -0
- package/dist/chunk-TYVYWBY6.js +69 -0
- package/dist/chunk-VFFOT7KD.js +2980 -0
- package/dist/chunk-W5XP4ZVU.js +159 -0
- package/dist/chunk-X4ZABSCN.js +415 -0
- package/dist/chunk-XDC7QGOF.js +32 -0
- package/dist/chunk-XK5RZQMX.js +1780 -0
- package/dist/chunk-Y552BNFZ.js +41 -0
- package/dist/chunk-Z4Z24FWO.js +39 -0
- package/dist/chunk-ZI6PKVXG.js +64 -0
- package/dist/chunk-ZYCSYJWX.js +87 -0
- package/dist/index.js +67 -60
- package/package.json +13 -16
- package/templates/none/_gitignore +3 -0
- package/templates/none/index.html +29 -0
- package/templates/none/package.json +16 -0
- package/templates/none/src/main.ts +16 -0
- package/templates/none/tsconfig.json +18 -0
- package/templates/none/vite.config.ts +8 -0
- package/templates/phaser/_gitignore +3 -0
- package/templates/phaser/index.html +24 -0
- package/templates/phaser/package.json +19 -0
- package/templates/phaser/src/main.ts +16 -0
- package/templates/phaser/src/scenes/game-scene.ts +65 -0
- package/templates/phaser/tsconfig.json +18 -0
- package/templates/phaser/vite.config.ts +8 -0
- package/templates/react-r3f/_gitignore +3 -0
- package/templates/react-r3f/index.html +24 -0
- package/templates/react-r3f/package.json +27 -0
- package/templates/react-r3f/src/app.tsx +33 -0
- package/templates/react-r3f/src/main.tsx +15 -0
- package/templates/react-r3f/tsconfig.json +19 -0
- package/templates/react-r3f/vite.config.ts +10 -0
- package/templates/threejs/_gitignore +3 -0
- package/templates/threejs/index.html +36 -0
- package/templates/threejs/package.json +20 -0
- package/templates/threejs/src/main.ts +44 -0
- package/templates/threejs/tsconfig.json +18 -0
- package/templates/threejs/vite.config.ts +8 -0
- package/dist/commands/completions.d.ts +0 -7
- package/dist/commands/completions.js +0 -145
- package/dist/commands/credits.d.ts +0 -10
- package/dist/commands/credits.js +0 -136
- package/dist/commands/deploy.d.ts +0 -26
- package/dist/commands/deploy.js +0 -257
- package/dist/commands/factory.d.ts +0 -3
- package/dist/commands/factory.js +0 -73
- package/dist/commands/fork.d.ts +0 -29
- package/dist/commands/fork.js +0 -124
- package/dist/commands/generate.d.ts +0 -1
- package/dist/commands/generate.js +0 -565
- package/dist/commands/init.d.ts +0 -20
- package/dist/commands/init.js +0 -105
- package/dist/commands/login.d.ts +0 -1
- package/dist/commands/login.js +0 -45
- package/dist/commands/logout.d.ts +0 -1
- package/dist/commands/logout.js +0 -13
- package/dist/commands/new.d.ts +0 -26
- package/dist/commands/new.js +0 -318
- package/dist/commands/playtest-run.d.ts +0 -66
- package/dist/commands/playtest-run.js +0 -268
- package/dist/commands/playtest.d.ts +0 -76
- package/dist/commands/playtest.js +0 -372
- package/dist/commands/update.d.ts +0 -13
- package/dist/commands/update.js +0 -82
- package/dist/commands/whoami.d.ts +0 -10
- package/dist/commands/whoami.js +0 -44
- package/dist/index.d.ts +0 -2
- package/dist/lib/api.d.ts +0 -18
- package/dist/lib/api.js +0 -27
- package/dist/lib/archive.d.ts +0 -17
- package/dist/lib/archive.js +0 -228
- package/dist/lib/codex.d.ts +0 -117
- package/dist/lib/codex.js +0 -426
- package/dist/lib/config-file.d.ts +0 -16
- package/dist/lib/config-file.js +0 -54
- package/dist/lib/config.d.ts +0 -11
- package/dist/lib/config.js +0 -54
- package/dist/lib/manifest.d.ts +0 -10
- package/dist/lib/manifest.js +0 -91
- package/dist/lib/media-args.d.ts +0 -30
- package/dist/lib/media-args.js +0 -219
- package/dist/lib/media-download.d.ts +0 -37
- package/dist/lib/media-download.js +0 -268
- package/dist/lib/media-poll.d.ts +0 -18
- package/dist/lib/media-poll.js +0 -86
- package/dist/lib/media-upload.d.ts +0 -12
- package/dist/lib/media-upload.js +0 -52
- package/dist/lib/output.d.ts +0 -68
- package/dist/lib/output.js +0 -102
- package/dist/lib/package-manager.d.ts +0 -25
- package/dist/lib/package-manager.js +0 -77
- package/dist/lib/playtest/agent.d.ts +0 -192
- package/dist/lib/playtest/agent.js +0 -652
- package/dist/lib/playtest/browser.d.ts +0 -109
- package/dist/lib/playtest/browser.js +0 -219
- package/dist/lib/playtest/controls.d.ts +0 -47
- package/dist/lib/playtest/controls.js +0 -218
- package/dist/lib/playtest/errors.d.ts +0 -9
- package/dist/lib/playtest/errors.js +0 -12
- package/dist/lib/playtest/keys.d.ts +0 -41
- package/dist/lib/playtest/keys.js +0 -157
- package/dist/lib/playtest/run.d.ts +0 -195
- package/dist/lib/playtest/run.js +0 -409
- package/dist/lib/run.d.ts +0 -19
- package/dist/lib/run.js +0 -23
- package/dist/lib/strict-args.d.ts +0 -27
- package/dist/lib/strict-args.js +0 -78
- package/dist/lib/types.d.ts +0 -16
- package/dist/lib/types.js +0 -10
- package/dist/lib/update.d.ts +0 -10
- package/dist/lib/update.js +0 -110
- package/dist/lib/upload.d.ts +0 -16
- package/dist/lib/upload.js +0 -41
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
bareTokens,
|
|
9
|
+
bootstrap,
|
|
10
|
+
ensureAgentBrowser,
|
|
11
|
+
ensureMinimum,
|
|
12
|
+
expandGameFlag,
|
|
13
|
+
playtestCommand,
|
|
14
|
+
projectSessionId,
|
|
15
|
+
resolveBinary,
|
|
16
|
+
resolveGameUrl,
|
|
17
|
+
runPlaytest,
|
|
18
|
+
withScopedSession
|
|
19
|
+
} from "./chunk-CZPKN32Z.js";
|
|
20
|
+
import "./chunk-2QBYTIMH.js";
|
|
21
|
+
import "./chunk-SAANBZ25.js";
|
|
22
|
+
import "./chunk-6FZPPUQH.js";
|
|
23
|
+
import "./chunk-ZI6PKVXG.js";
|
|
24
|
+
import "./chunk-RYFO3ZPO.js";
|
|
25
|
+
import "./chunk-J6PKNPI2.js";
|
|
26
|
+
import "./chunk-CU7UY5YJ.js";
|
|
27
|
+
import "./chunk-MBXCVCC4.js";
|
|
28
|
+
import "./chunk-CAKBGDCY.js";
|
|
29
|
+
export {
|
|
30
|
+
bareTokens,
|
|
31
|
+
bootstrap,
|
|
32
|
+
ensureAgentBrowser,
|
|
33
|
+
ensureMinimum,
|
|
34
|
+
expandGameFlag,
|
|
35
|
+
playtestCommand,
|
|
36
|
+
projectSessionId,
|
|
37
|
+
resolveBinary,
|
|
38
|
+
resolveGameUrl,
|
|
39
|
+
runPlaytest,
|
|
40
|
+
withScopedSession
|
|
41
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
PKG_NAME
|
|
9
|
+
} from "./chunk-PEUP4MZR.js";
|
|
10
|
+
import {
|
|
11
|
+
isJsonObject,
|
|
12
|
+
isJsonString
|
|
13
|
+
} from "./chunk-J6PKNPI2.js";
|
|
14
|
+
|
|
15
|
+
// src/lib/package-root.ts
|
|
16
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
var findPackage = (dir) => {
|
|
19
|
+
const manifestPath = path.join(dir, "package.json");
|
|
20
|
+
if (existsSync(manifestPath)) {
|
|
21
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
|
|
22
|
+
if (isJsonObject(manifest) && manifest.name === PKG_NAME && isJsonString(manifest.version)) {
|
|
23
|
+
return { root: dir, version: manifest.version };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const parent = path.dirname(dir);
|
|
27
|
+
if (parent === dir) {
|
|
28
|
+
throw new Error(`No ${PKG_NAME} package.json above ${import.meta.filename}.`);
|
|
29
|
+
}
|
|
30
|
+
return findPackage(parent);
|
|
31
|
+
};
|
|
32
|
+
var found = findPackage(import.meta.dirname);
|
|
33
|
+
var PACKAGE_ROOT = found.root;
|
|
34
|
+
var PACKAGE_VERSION = found.version;
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
PACKAGE_ROOT,
|
|
38
|
+
PACKAGE_VERSION
|
|
39
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
isJsonObject,
|
|
9
|
+
isJsonString
|
|
10
|
+
} from "./chunk-J6PKNPI2.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/config-file.ts
|
|
13
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
var FILENAME = "vibedgames.json";
|
|
16
|
+
var SLUG_RE = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/u;
|
|
17
|
+
var findConfigPath = (dir) => {
|
|
18
|
+
let current = path.resolve(dir);
|
|
19
|
+
while (true) {
|
|
20
|
+
const candidate = path.join(current, FILENAME);
|
|
21
|
+
if (existsSync(candidate)) {
|
|
22
|
+
return candidate;
|
|
23
|
+
}
|
|
24
|
+
const parent = path.dirname(current);
|
|
25
|
+
if (parent === current) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
current = parent;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var findProjectRoot = (dir) => {
|
|
32
|
+
const found = findConfigPath(dir);
|
|
33
|
+
return found ? path.dirname(found) : null;
|
|
34
|
+
};
|
|
35
|
+
var readProjectConfig = (dir) => {
|
|
36
|
+
const file = findConfigPath(dir);
|
|
37
|
+
if (!file) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const raw = readFileSync(file, "utf-8");
|
|
41
|
+
const parsed = JSON.parse(raw);
|
|
42
|
+
if (!isJsonObject(parsed) || !isJsonString(parsed.slug)) {
|
|
43
|
+
throw new Error(`${FILENAME} is malformed \u2014 missing "slug".`);
|
|
44
|
+
}
|
|
45
|
+
const config = { slug: parsed.slug };
|
|
46
|
+
if (isJsonString(parsed.name)) {
|
|
47
|
+
config.name = parsed.name;
|
|
48
|
+
}
|
|
49
|
+
return config;
|
|
50
|
+
};
|
|
51
|
+
var writeProjectConfig = (dir, config) => {
|
|
52
|
+
const file = path.join(dir, FILENAME);
|
|
53
|
+
writeFileSync(file, `${JSON.stringify(config, null, 2)}
|
|
54
|
+
`);
|
|
55
|
+
};
|
|
56
|
+
var projectConfigPath = (dir) => path.join(dir, FILENAME);
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
SLUG_RE,
|
|
60
|
+
findProjectRoot,
|
|
61
|
+
readProjectConfig,
|
|
62
|
+
writeProjectConfig,
|
|
63
|
+
projectConfigPath
|
|
64
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
|
|
8
|
+
// src/lib/output.ts
|
|
9
|
+
var isOutputObject = (value) => (
|
|
10
|
+
// Object() is the identity only on objects; arrays are split off explicitly.
|
|
11
|
+
Object(value) === value && !Array.isArray(value)
|
|
12
|
+
);
|
|
13
|
+
var isJsonOutput = (args) => Boolean(args.json) || process.env.VG_JSON_OUTPUT === "1";
|
|
14
|
+
var writeJson = (value) => {
|
|
15
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}
|
|
16
|
+
`);
|
|
17
|
+
};
|
|
18
|
+
var selectField = (value, path) => {
|
|
19
|
+
const segments = path.replaceAll(/\[(?<index>-?\d+)\]/gu, ".$<index>").split(".").filter(Boolean);
|
|
20
|
+
let current = value;
|
|
21
|
+
for (const segment of segments) {
|
|
22
|
+
if (current === null || current === void 0) {
|
|
23
|
+
return void 0;
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(current)) {
|
|
26
|
+
const index = Number(segment);
|
|
27
|
+
if (!Number.isInteger(index)) {
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
current = current.at(index);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (!isOutputObject(current)) {
|
|
34
|
+
return void 0;
|
|
35
|
+
}
|
|
36
|
+
current = current[segment];
|
|
37
|
+
}
|
|
38
|
+
return current;
|
|
39
|
+
};
|
|
40
|
+
var isScalarEntry = (value) => value === null || value !== void 0 && Object(value) !== value;
|
|
41
|
+
var formatField = (value) => {
|
|
42
|
+
if (value === null || value === void 0) {
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
if (value.every(isScalarEntry)) {
|
|
47
|
+
return value.map((v) => v === null ? "" : String(v)).join("\n");
|
|
48
|
+
}
|
|
49
|
+
return JSON.stringify(value, null, 2);
|
|
50
|
+
}
|
|
51
|
+
if (isOutputObject(value)) {
|
|
52
|
+
return JSON.stringify(value, null, 2);
|
|
53
|
+
}
|
|
54
|
+
return String(value);
|
|
55
|
+
};
|
|
56
|
+
var writeStructured = (value, args) => {
|
|
57
|
+
if (args.field) {
|
|
58
|
+
const selected = selectField(value, args.field);
|
|
59
|
+
if (selected === void 0) {
|
|
60
|
+
process.stderr.write(`No such field: ${args.field}
|
|
61
|
+
`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
process.stdout.write(`${formatField(selected)}
|
|
65
|
+
`);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
if (isJsonOutput(args)) {
|
|
69
|
+
writeJson(value);
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
};
|
|
74
|
+
var outputArgs = {
|
|
75
|
+
field: {
|
|
76
|
+
description: "Print a single value from the JSON result, e.g. --field request_id or --field images[0].url. Prints scalars bare for shell capture.",
|
|
77
|
+
type: "string"
|
|
78
|
+
},
|
|
79
|
+
json: { description: "Print structured JSON to stdout.", type: "boolean" }
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
isJsonOutput,
|
|
84
|
+
writeJson,
|
|
85
|
+
writeStructured,
|
|
86
|
+
outputArgs
|
|
87
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,69 +1,76 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
import { createRequire as __createRequire } from "node:module";
|
|
3
|
+
import { dirname as __pathDirname } from "node:path";
|
|
4
|
+
import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
var __dirname = __pathDirname(__filename);
|
|
8
|
+
import {
|
|
9
|
+
PACKAGE_VERSION
|
|
10
|
+
} from "./chunk-Z4Z24FWO.js";
|
|
11
|
+
import "./chunk-PEUP4MZR.js";
|
|
12
|
+
import "./chunk-J6PKNPI2.js";
|
|
13
|
+
import {
|
|
14
|
+
defineCommand,
|
|
15
|
+
runMain
|
|
16
|
+
} from "./chunk-MBXCVCC4.js";
|
|
17
|
+
import "./chunk-CAKBGDCY.js";
|
|
18
|
+
|
|
19
|
+
// src/index.ts
|
|
20
|
+
var lazy = (load, key) => async () => {
|
|
21
|
+
const module = await load();
|
|
22
|
+
return module[key];
|
|
23
|
+
};
|
|
24
|
+
var main = defineCommand({
|
|
25
|
+
meta: {
|
|
26
|
+
description: "vibedgames CLI \u2014 agent-native game deploy & asset tooling (use --json for machine-readable output)",
|
|
27
|
+
name: "vg",
|
|
28
|
+
version: PACKAGE_VERSION
|
|
29
|
+
},
|
|
30
|
+
// Each command is imported when it runs, so a call loads that command's code
|
|
31
|
+
// and dependencies alone. `vg --help` loads them all, for their descriptions.
|
|
32
|
+
subCommands: {
|
|
33
|
+
completions: lazy(() => import("./chunk-FNYBZNW2.js"), "completionsCommand"),
|
|
34
|
+
config: lazy(() => import("./chunk-K5SC6SXO.js"), "configCommand"),
|
|
35
|
+
credits: lazy(() => import("./chunk-GUF6ADBF.js"), "creditsCommand"),
|
|
36
|
+
deploy: lazy(() => import("./chunk-X4ZABSCN.js"), "deployCommand"),
|
|
37
|
+
factory: lazy(() => import("./chunk-H4NBRFBY.js"), "factoryCommand"),
|
|
38
|
+
fork: lazy(() => import("./chunk-W5XP4ZVU.js"), "forkCommand"),
|
|
39
|
+
generate: lazy(() => import("./chunk-RIGKOLNN.js"), "generateCommand"),
|
|
40
|
+
init: lazy(() => import("./chunk-AZGENOOR.js"), "initCommand"),
|
|
41
|
+
login: lazy(() => import("./chunk-RNBUX5VF.js"), "loginCommand"),
|
|
42
|
+
logout: lazy(() => import("./chunk-XDC7QGOF.js"), "logoutCommand"),
|
|
43
|
+
new: lazy(() => import("./chunk-TMK6V5FV.js"), "newCommand"),
|
|
44
|
+
// `run` is the one `vg playtest` verb that is ours rather than
|
|
45
|
+
// agent-browser's: the model-driven playtest. index.ts routes every other
|
|
46
|
+
// `vg playtest …` straight to the binary below. Only the meta is reused:
|
|
47
|
+
// citty runs a parent's `run` AFTER its subcommand, so carrying the
|
|
48
|
+
// passthrough here would forward `run …` to agent-browser once the
|
|
49
|
+
// playtest had finished and turn every passing run into an exit 1.
|
|
50
|
+
playtest: async () => {
|
|
51
|
+
const { playtestCommand } = await import("./chunk-Y552BNFZ.js");
|
|
52
|
+
return defineCommand({
|
|
53
|
+
meta: playtestCommand.meta,
|
|
54
|
+
subCommands: {
|
|
55
|
+
run: lazy(() => import("./chunk-XK5RZQMX.js"), "playtestRunCommand")
|
|
56
|
+
}
|
|
57
|
+
});
|
|
51
58
|
},
|
|
59
|
+
update: lazy(() => import("./chunk-HASKWB6B.js"), "updateCommand"),
|
|
60
|
+
whoami: lazy(() => import("./chunk-TYVYWBY6.js"), "whoamiCommand")
|
|
61
|
+
}
|
|
52
62
|
});
|
|
53
|
-
|
|
54
|
-
// startup — must stay side-effect free).
|
|
55
|
-
const subcommand = process.argv.at(2);
|
|
63
|
+
var subcommand = process.argv.at(2);
|
|
56
64
|
if (subcommand && !["update", "init", "completions"].includes(subcommand)) {
|
|
57
|
-
|
|
65
|
+
const { maybeScheduleAutoUpdate } = await import("./chunk-FL6IFBUF.js");
|
|
66
|
+
maybeScheduleAutoUpdate();
|
|
58
67
|
}
|
|
59
|
-
// `vg factory` and `vg playtest` are pure passthroughs to their binaries —
|
|
60
|
-
// route them before citty runs so flags like --help/--version reach the binary
|
|
61
|
-
// instead of being intercepted here. (The registered commands keep them in
|
|
62
|
-
// `vg --help`.)
|
|
63
68
|
if (subcommand === "factory") {
|
|
64
|
-
|
|
69
|
+
const { runFactory } = await import("./chunk-H4NBRFBY.js");
|
|
70
|
+
runFactory(process.argv.slice(3));
|
|
65
71
|
}
|
|
66
72
|
if (subcommand === "playtest" && process.argv.at(3) !== "run") {
|
|
67
|
-
|
|
73
|
+
const { runPlaytest } = await import("./chunk-Y552BNFZ.js");
|
|
74
|
+
runPlaytest(process.argv.slice(3));
|
|
68
75
|
}
|
|
69
|
-
runMain(main);
|
|
76
|
+
await runMain(main);
|
package/package.json
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibedgames",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"vg": "./dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
9
|
+
"dist",
|
|
10
|
+
"templates"
|
|
10
11
|
],
|
|
11
12
|
"type": "module",
|
|
12
|
-
"
|
|
13
|
-
"@
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@kyh/tsconfig": "^1.2.0",
|
|
15
|
+
"@orpc/client": "2.0.0-beta.42",
|
|
16
|
+
"@repo/contract": "^0.1.0",
|
|
17
|
+
"@types/cross-spawn": "^6.0.6",
|
|
18
|
+
"@types/node": "^26.6.4",
|
|
14
19
|
"citty": "^0.2.2",
|
|
15
20
|
"consola": "^3.4.2",
|
|
16
21
|
"cross-spawn": "^7.0.6",
|
|
17
|
-
"
|
|
22
|
+
"esbuild": "^0.28.2",
|
|
23
|
+
"ignore": "^7.0.12",
|
|
18
24
|
"tar": "^7.5.22",
|
|
19
|
-
"tiged": "^2.12.8"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@cloudflare/workers-types": "^5.20260922.1",
|
|
23
|
-
"@kyh/tsconfig": "^1.2.0",
|
|
24
|
-
"@orpc/server": "2.0.0-beta.31",
|
|
25
|
-
"@repo/api": "^0.1.0",
|
|
26
|
-
"@types/cross-spawn": "^6.0.6",
|
|
27
|
-
"@types/node": "^26.6.2",
|
|
28
25
|
"typescript": "^7.0.2"
|
|
29
26
|
},
|
|
30
27
|
"scripts": {
|
|
31
|
-
"build": "
|
|
32
|
-
"dev": "
|
|
28
|
+
"build": "node scripts/build.mjs",
|
|
29
|
+
"dev": "node scripts/build.mjs --watch",
|
|
33
30
|
"clean": "rm -rf .turbo dist node_modules",
|
|
34
31
|
"test": "node --import tsx --test test/*.test.ts",
|
|
35
32
|
"typecheck": "tsc --noEmit"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>__VG_SLUG__</title>
|
|
7
|
+
<!-- no favicon request, so a fresh game logs no 404 -->
|
|
8
|
+
<link rel="icon" href="data:," />
|
|
9
|
+
<style>
|
|
10
|
+
html,
|
|
11
|
+
body {
|
|
12
|
+
margin: 0;
|
|
13
|
+
background: #0f1020;
|
|
14
|
+
color: #fff;
|
|
15
|
+
font-family: system-ui, sans-serif;
|
|
16
|
+
}
|
|
17
|
+
#game {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
height: 100vh;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
<div id="game"></div>
|
|
27
|
+
<script type="module" src="/src/main.ts"></script>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__VG_SLUG__",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"typescript": "^7.0.2",
|
|
14
|
+
"vite": "^8.3.3"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const host = document.querySelector("#game");
|
|
2
|
+
const canvas = document.createElement("canvas");
|
|
3
|
+
canvas.width = 800;
|
|
4
|
+
canvas.height = 600;
|
|
5
|
+
host?.append(canvas);
|
|
6
|
+
|
|
7
|
+
const ctx = canvas.getContext("2d");
|
|
8
|
+
if (ctx) {
|
|
9
|
+
ctx.fillStyle = "#fff";
|
|
10
|
+
ctx.textAlign = "center";
|
|
11
|
+
ctx.font = "28px system-ui";
|
|
12
|
+
ctx.fillText("__VG_SLUG__", canvas.width / 2, canvas.height / 2 - 8);
|
|
13
|
+
ctx.font = "14px system-ui";
|
|
14
|
+
ctx.fillStyle = "#aaa";
|
|
15
|
+
ctx.fillText("Edit src/main.ts to start building.", canvas.width / 2, canvas.height / 2 + 22);
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "Preserve",
|
|
6
|
+
"moduleResolution": "Bundler",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"isolatedModules": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noUncheckedIndexedAccess": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"types": ["vite/client"]
|
|
16
|
+
},
|
|
17
|
+
"include": ["src", "vite.config.ts"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
|
|
3
|
+
// A relative base keeps built asset URLs relative, so the bundle works wherever it is
|
|
4
|
+
// hosted — including {slug}.vibedgames.com after `vg deploy ./dist`.
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
base: "./",
|
|
7
|
+
server: { port: 5173 },
|
|
8
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>__VG_SLUG__</title>
|
|
7
|
+
<!-- no favicon request, so a fresh game logs no 404 -->
|
|
8
|
+
<link rel="icon" href="data:," />
|
|
9
|
+
<style>
|
|
10
|
+
html,
|
|
11
|
+
body,
|
|
12
|
+
#game {
|
|
13
|
+
margin: 0;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
background: #0e1020;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="game"></div>
|
|
22
|
+
<script type="module" src="/src/main.ts"></script>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__VG_SLUG__",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"typecheck": "tsc --noEmit"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"phaser": "^4.2.1"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"typescript": "^7.0.2",
|
|
17
|
+
"vite": "^8.3.3"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Types } from "phaser";
|
|
2
|
+
import { AUTO, Game, Scale } from "phaser";
|
|
3
|
+
|
|
4
|
+
import { GameScene } from "./scenes/game-scene";
|
|
5
|
+
|
|
6
|
+
const config: Types.Core.GameConfig = {
|
|
7
|
+
backgroundColor: "#0e1020",
|
|
8
|
+
parent: "game",
|
|
9
|
+
physics: { arcade: { debug: false }, default: "arcade" },
|
|
10
|
+
// A fixed 960×540 world, letterboxed to fit any window.
|
|
11
|
+
scale: { autoCenter: Scale.CENTER_BOTH, height: 540, mode: Scale.FIT, width: 960 },
|
|
12
|
+
scene: [GameScene],
|
|
13
|
+
type: AUTO,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const game = new Game(config);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { GameObjects, Input } from "phaser";
|
|
2
|
+
import { Scene } from "phaser";
|
|
3
|
+
|
|
4
|
+
// World pixels per second.
|
|
5
|
+
const SPEED = 240;
|
|
6
|
+
const SIZE = 48;
|
|
7
|
+
|
|
8
|
+
type Direction = "up" | "down" | "left" | "right";
|
|
9
|
+
|
|
10
|
+
const clamp = (value: number, min: number, max: number): number =>
|
|
11
|
+
Math.min(max, Math.max(min, value));
|
|
12
|
+
|
|
13
|
+
/** A square you drive with the arrow keys or WASD. Replace it with your game. */
|
|
14
|
+
export class GameScene extends Scene {
|
|
15
|
+
private player?: GameObjects.Rectangle;
|
|
16
|
+
private keys?: Record<Direction, Input.Keyboard.Key[]>;
|
|
17
|
+
|
|
18
|
+
constructor() {
|
|
19
|
+
super("game");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
create(): void {
|
|
23
|
+
const { width, height } = this.scale;
|
|
24
|
+
const font = { color: "#ffffff", fontFamily: "system-ui, sans-serif" };
|
|
25
|
+
this.add.text(width / 2, 48, "__VG_SLUG__", { ...font, fontSize: "32px" }).setOrigin(0.5);
|
|
26
|
+
this.add
|
|
27
|
+
.text(width / 2, height - 40, "Arrows / WASD to move · edit src/scenes/game-scene.ts", {
|
|
28
|
+
...font,
|
|
29
|
+
color: "#9aa0c0",
|
|
30
|
+
fontSize: "16px",
|
|
31
|
+
})
|
|
32
|
+
.setOrigin(0.5);
|
|
33
|
+
|
|
34
|
+
this.player = this.add.rectangle(width / 2, height / 2, SIZE, SIZE, 0x5b_e3_ff);
|
|
35
|
+
|
|
36
|
+
const { keyboard } = this.input;
|
|
37
|
+
if (keyboard) {
|
|
38
|
+
this.keys = {
|
|
39
|
+
down: [keyboard.addKey("DOWN"), keyboard.addKey("S")],
|
|
40
|
+
left: [keyboard.addKey("LEFT"), keyboard.addKey("A")],
|
|
41
|
+
right: [keyboard.addKey("RIGHT"), keyboard.addKey("D")],
|
|
42
|
+
up: [keyboard.addKey("UP"), keyboard.addKey("W")],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
override update(_time: number, delta: number): void {
|
|
48
|
+
const { keys, player } = this;
|
|
49
|
+
if (!keys || !player) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const held = (direction: Direction): number =>
|
|
53
|
+
keys[direction].some((key) => key.isDown) ? 1 : 0;
|
|
54
|
+
const dx = held("right") - held("left");
|
|
55
|
+
const dy = held("down") - held("up");
|
|
56
|
+
if (dx === 0 && dy === 0) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
// Normalised so a diagonal is no faster than a straight line.
|
|
60
|
+
const step = (SPEED * delta) / 1000 / Math.hypot(dx, dy);
|
|
61
|
+
const half = SIZE / 2;
|
|
62
|
+
player.x = clamp(player.x + dx * step, half, this.scale.width - half);
|
|
63
|
+
player.y = clamp(player.y + dy * step, half, this.scale.height - half);
|
|
64
|
+
}
|
|
65
|
+
}
|