vibedgames 0.9.0 → 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 +3 -2
- 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 +2 -2
- package/dist/chunk-2KVQJKIZ.js +6495 -0
- package/dist/{chunk-56OY4TEP.js → chunk-2SBBKY5C.js} +1361 -4493
- package/dist/{chunk-FC233UKH.js → chunk-2ZKS7V72.js} +16 -16
- package/dist/{chunk-BMTHAVMS.js → chunk-3HGBIUM5.js} +22 -19
- package/dist/chunk-3UGGMFJJ.js +22 -0
- package/dist/{chunk-3HUWAJQH.js → chunk-42K3BJJH.js} +93 -76
- package/dist/{chunk-ST5FC2W3.js → chunk-43P4U7CB.js} +20 -11
- package/dist/chunk-4FJXCS3K.js +741 -0
- package/dist/{chunk-WSRIF6K4.js → chunk-4UU622RK.js} +5 -4
- package/dist/chunk-5YPLKGY3.js +87 -0
- package/dist/chunk-6KXXZXSO.js +475 -0
- package/dist/chunk-7RPLQWR2.js +91 -0
- package/dist/{chunk-ZCYWDKYP.js → chunk-A556KALN.js} +14 -13
- package/dist/{chunk-UFR6G6BL.js → chunk-ABTUEIRC.js} +554 -254
- package/dist/{chunk-PEUP4MZR.js → chunk-AWJNAGPE.js} +6 -3
- package/dist/{chunk-HNRVSBRK.js → chunk-BN3Q7UEC.js} +20 -17
- package/dist/chunk-BZOMEG3X.js +412 -0
- package/dist/{chunk-ZYCSYJWX.js → chunk-COSLGSVO.js} +14 -24
- package/dist/{chunk-KZBZNTM4.js → chunk-CTY2WZQK.js} +9 -13
- package/dist/chunk-DB7WVFS7.js +80 -0
- package/dist/chunk-DOOQUFPG.js +73 -0
- package/dist/{chunk-K2U7L4RU.js → chunk-E3FJUPLT.js} +15 -21
- package/dist/chunk-E7NDOZ27.js +428 -0
- package/dist/{chunk-TBQ5BU3Q.js → chunk-F42QKWBB.js} +18 -18
- package/dist/chunk-FXXVXDTW.js +168 -0
- package/dist/{chunk-VFFOT7KD.js → chunk-G66HRVDW.js} +1 -1
- package/dist/chunk-GLEW7VJQ.js +45 -0
- package/dist/{chunk-AXTLPJ2F.js → chunk-H2C4QUTG.js} +8 -7
- package/dist/{chunk-H3IPLBXQ.js → chunk-HRKVAXNN.js} +17 -14
- package/dist/{chunk-UXCWSWWX.js → chunk-HSMG6U7J.js} +8 -7
- package/dist/chunk-HX5Q63UA.js +48 -0
- package/dist/chunk-HYOXGNWS.js +53 -0
- package/dist/chunk-I5LELJSK.js +22 -0
- package/dist/{chunk-7CXMMC5S.js → chunk-JN4WZCR7.js} +5 -4
- package/dist/{chunk-7QZSDU52.js → chunk-K36EOII3.js} +5 -4
- package/dist/chunk-KAGVI3CE.js +62 -0
- package/dist/chunk-KJK5CB6E.js +58 -0
- package/dist/chunk-KLFBAFXD.js +25 -0
- package/dist/{chunk-355VG7EO.js → chunk-LONQWRTR.js} +107 -77
- package/dist/{chunk-Z5TFZQ5U.js → chunk-LORGE2NB.js} +68 -62
- package/dist/{chunk-LY2GQ32S.js → chunk-MEAO33XW.js} +22 -20
- package/dist/{chunk-OD2MNYXD.js → chunk-MR5KIFI7.js} +23 -22
- package/dist/{chunk-2VUUMXAQ.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-NDHXM4PL.js → chunk-Q3XQPNF6.js} +12 -12
- package/dist/{chunk-RXHTGX7C.js → chunk-Q5NZNXJE.js} +6 -10
- package/dist/chunk-QLCVLCPM.js +126 -0
- package/dist/chunk-R2WVORGD.js +91 -0
- package/dist/chunk-RKS7SI5L.js +64 -0
- package/dist/{chunk-US6QZICZ.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-6EWHKL7Z.js → chunk-SXYQL4GK.js} +7 -6
- 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-UZM6OSW5.js → chunk-UPHB5HWO.js} +15 -13
- package/dist/chunk-UQ7VO6B3.js +91 -0
- package/dist/chunk-VB4WLJR2.js +47 -0
- package/dist/{chunk-25BAMW5X.js → chunk-VIEKOGKG.js} +18 -2
- package/dist/{chunk-LXS3NJYD.js → chunk-VZEJ2ZHE.js} +14 -15
- package/dist/{chunk-Z4Z24FWO.js → chunk-YNCYMWER.js} +8 -5
- package/dist/chunk-ZHLPE6LI.js +71 -0
- package/dist/index.js +39 -36
- package/package.json +31 -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-J6PKNPI2.js +0 -26
|
@@ -30,7 +30,23 @@ var SUBCOMMANDS = [
|
|
|
30
30
|
"completions",
|
|
31
31
|
"whoami"
|
|
32
32
|
];
|
|
33
|
-
var GENERATE_SUBCOMMANDS = [
|
|
33
|
+
var GENERATE_SUBCOMMANDS = [
|
|
34
|
+
"run",
|
|
35
|
+
"status",
|
|
36
|
+
"models",
|
|
37
|
+
"schema",
|
|
38
|
+
"pricing",
|
|
39
|
+
"docs",
|
|
40
|
+
"upload",
|
|
41
|
+
"image",
|
|
42
|
+
"video",
|
|
43
|
+
"3d",
|
|
44
|
+
"animate-3d",
|
|
45
|
+
"music",
|
|
46
|
+
"sound",
|
|
47
|
+
"speech",
|
|
48
|
+
"remove-background"
|
|
49
|
+
];
|
|
34
50
|
var COMMON_FLAGS = ["--help", "--version"];
|
|
35
51
|
var GENERATE_FLAGS = [
|
|
36
52
|
"--async",
|
|
@@ -146,7 +162,7 @@ var completionsCommand = defineCommand({
|
|
|
146
162
|
name: "completions"
|
|
147
163
|
},
|
|
148
164
|
run: ({ args }) => {
|
|
149
|
-
const shell =
|
|
165
|
+
const shell = args.shell ?? "";
|
|
150
166
|
if (!isShell(shell)) {
|
|
151
167
|
process.stderr.write(
|
|
152
168
|
`Unsupported shell "${shell}". Expected: ${[...SUPPORTED].join(", ")}
|
|
@@ -4,30 +4,31 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
assertKnownFlags
|
|
9
|
+
} from "./chunk-RZ4DIJQW.js";
|
|
7
10
|
import {
|
|
8
11
|
authErrorCode,
|
|
9
12
|
createClient
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-Z4Z24FWO.js";
|
|
13
|
-
import "./chunk-PEUP4MZR.js";
|
|
13
|
+
} from "./chunk-CTY2WZQK.js";
|
|
14
|
+
import "./chunk-E3FJUPLT.js";
|
|
14
15
|
import {
|
|
15
16
|
getToken
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-Q5NZNXJE.js";
|
|
17
18
|
import {
|
|
18
19
|
outputArgs,
|
|
19
20
|
writeStructured
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-COSLGSVO.js";
|
|
21
22
|
import {
|
|
22
|
-
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
defineCommand
|
|
24
|
+
} from "./chunk-MBXCVCC4.js";
|
|
24
25
|
import {
|
|
25
26
|
consola
|
|
26
27
|
} from "./chunk-D2RF35HJ.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
import "./chunk-YNCYMWER.js";
|
|
29
|
+
import "./chunk-AWJNAGPE.js";
|
|
30
|
+
import "./chunk-RPSUFZAG.js";
|
|
31
|
+
import "./chunk-2SBBKY5C.js";
|
|
31
32
|
import "./chunk-GKDUYJ7R.js";
|
|
32
33
|
|
|
33
34
|
// src/commands/credits.ts
|
|
@@ -95,7 +96,7 @@ var formatWhen = (date, now) => {
|
|
|
95
96
|
return date.toLocaleDateString("en-US", opts);
|
|
96
97
|
};
|
|
97
98
|
var requireLogin = () => {
|
|
98
|
-
if (
|
|
99
|
+
if ((getToken() ?? "") === "") {
|
|
99
100
|
consola.warn("Not logged in. Run `vg login` to authenticate.");
|
|
100
101
|
process.exit(1);
|
|
101
102
|
}
|
|
@@ -124,7 +125,6 @@ var balanceCommand = defineCommand({
|
|
|
124
125
|
note: e.note,
|
|
125
126
|
request_id: e.requestId
|
|
126
127
|
})),
|
|
127
|
-
// Whether `vg credits buy` can take a card payment; false means codes only.
|
|
128
128
|
purchases_enabled: purchasesEnabled
|
|
129
129
|
};
|
|
130
130
|
if (writeStructured(payload, args)) {
|
|
@@ -256,7 +256,6 @@ var buyCommand = defineCommand({
|
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
var creditsCommand = defineCommand({
|
|
259
|
-
// Declared so citty skips `--field <value>` when looking for a subcommand.
|
|
260
259
|
args: outputArgs,
|
|
261
260
|
default: "balance",
|
|
262
261
|
meta: {
|
|
@@ -6,11 +6,12 @@ var __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
PKG_NAME
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AWJNAGPE.js";
|
|
10
10
|
import {
|
|
11
11
|
isJsonObject,
|
|
12
|
-
isJsonString
|
|
13
|
-
|
|
12
|
+
isJsonString,
|
|
13
|
+
parseJson
|
|
14
|
+
} from "./chunk-RPSUFZAG.js";
|
|
14
15
|
|
|
15
16
|
// src/lib/package-root.ts
|
|
16
17
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -18,7 +19,7 @@ import path from "node:path";
|
|
|
18
19
|
var findPackage = (dir) => {
|
|
19
20
|
const manifestPath = path.join(dir, "package.json");
|
|
20
21
|
if (existsSync(manifestPath)) {
|
|
21
|
-
const manifest =
|
|
22
|
+
const manifest = parseJson(readFileSync(manifestPath, "utf-8"));
|
|
22
23
|
if (isJsonObject(manifest) && manifest.name === PKG_NAME && isJsonString(manifest.version)) {
|
|
23
24
|
return { root: dir, version: manifest.version };
|
|
24
25
|
}
|
|
@@ -32,8 +33,10 @@ var findPackage = (dir) => {
|
|
|
32
33
|
var found = findPackage(import.meta.dirname);
|
|
33
34
|
var PACKAGE_ROOT = found.root;
|
|
34
35
|
var PACKAGE_VERSION = found.version;
|
|
36
|
+
var ASSETS_DIR = path.join(PACKAGE_ROOT, "assets");
|
|
35
37
|
|
|
36
38
|
export {
|
|
37
39
|
PACKAGE_ROOT,
|
|
38
|
-
PACKAGE_VERSION
|
|
40
|
+
PACKAGE_VERSION,
|
|
41
|
+
ASSETS_DIR
|
|
39
42
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
getFlag,
|
|
9
|
+
getInt,
|
|
10
|
+
inspectAseprite,
|
|
11
|
+
main,
|
|
12
|
+
parseArgs
|
|
13
|
+
} from "./chunk-2KVQJKIZ.js";
|
|
14
|
+
import "./chunk-2SBBKY5C.js";
|
|
15
|
+
import "./chunk-GKDUYJ7R.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/asset/aseprite-inspect.ts
|
|
18
|
+
import { readFileSync } from "node:fs";
|
|
19
|
+
var USAGE = `usage: vg asset aseprite-inspect [-h] [--json] [--pretty] [--decode-cels]
|
|
20
|
+
[--max-decompress-mib MAX_DECOMPRESS_MIB]
|
|
21
|
+
[--palette-entries PALETTE_ENTRIES]
|
|
22
|
+
[--treat-index0-transparent]
|
|
23
|
+
file
|
|
24
|
+
|
|
25
|
+
Inspect an Aseprite .ase/.aseprite file and emit JSON.
|
|
26
|
+
|
|
27
|
+
positional arguments:
|
|
28
|
+
file Path to .ase/.aseprite (sometimes typo .aes).
|
|
29
|
+
|
|
30
|
+
options:
|
|
31
|
+
--json Emit JSON to stdout (default).
|
|
32
|
+
--pretty Pretty-print JSON.
|
|
33
|
+
--decode-cels Zlib-decompress cel/tilemap data for extra inference
|
|
34
|
+
(bounds/summaries).
|
|
35
|
+
--max-decompress-mib MAX_DECOMPRESS_MIB
|
|
36
|
+
Safety limit for decompressed bytes (MiB). Default 64.
|
|
37
|
+
--palette-entries PALETTE_ENTRIES
|
|
38
|
+
How many palette entries to include per palette chunk
|
|
39
|
+
preview. Default 16.
|
|
40
|
+
--treat-index0-transparent
|
|
41
|
+
For indexed sprites, also treat palette index 0 as
|
|
42
|
+
transparent when inferring bounds (heuristic; off by
|
|
43
|
+
default).`;
|
|
44
|
+
var run = (argv) => {
|
|
45
|
+
main(() => {
|
|
46
|
+
const args = parseArgs([...argv], {
|
|
47
|
+
booleans: ["decode-cels", "json", "pretty", "treat-index0-transparent"],
|
|
48
|
+
values: ["max-decompress-mib", "palette-entries"]
|
|
49
|
+
});
|
|
50
|
+
const [file] = args.positionals;
|
|
51
|
+
if (file === void 0) {
|
|
52
|
+
process.stderr.write(`${USAGE}
|
|
53
|
+
|
|
54
|
+
error: the following arguments are required: file
|
|
55
|
+
`);
|
|
56
|
+
process.exit(2);
|
|
57
|
+
}
|
|
58
|
+
const report = inspectAseprite(file, readFileSync(file), {
|
|
59
|
+
decodeCels: getFlag(args, "decode-cels"),
|
|
60
|
+
maxDecompressMib: getInt(args, "max-decompress-mib", 64),
|
|
61
|
+
paletteEntries: getInt(args, "palette-entries", 16),
|
|
62
|
+
treatIndex0Transparent: getFlag(args, "treat-index0-transparent")
|
|
63
|
+
});
|
|
64
|
+
const json = getFlag(args, "pretty") ? JSON.stringify(report, null, 2) : JSON.stringify(report);
|
|
65
|
+
process.stdout.write(`${json}
|
|
66
|
+
`);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
run
|
|
71
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -5,15 +5,16 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
var __filename = __fileURLToPath(import.meta.url);
|
|
7
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
8
|
import {
|
|
14
9
|
defineCommand,
|
|
15
10
|
runMain
|
|
16
11
|
} from "./chunk-MBXCVCC4.js";
|
|
12
|
+
import {
|
|
13
|
+
PACKAGE_VERSION
|
|
14
|
+
} from "./chunk-YNCYMWER.js";
|
|
15
|
+
import "./chunk-AWJNAGPE.js";
|
|
16
|
+
import "./chunk-RPSUFZAG.js";
|
|
17
|
+
import "./chunk-2SBBKY5C.js";
|
|
17
18
|
import "./chunk-GKDUYJ7R.js";
|
|
18
19
|
|
|
19
20
|
// src/index.ts
|
|
@@ -35,53 +36,55 @@ var main = defineCommand({
|
|
|
35
36
|
name: "vg",
|
|
36
37
|
version: PACKAGE_VERSION
|
|
37
38
|
},
|
|
38
|
-
// Each command is imported when it runs, so a call loads that command's code
|
|
39
|
-
// and dependencies alone. `vg --help` loads them all, for their descriptions.
|
|
40
39
|
subCommands: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// `vg playtest …` straight to the binary below. Only the meta is reused:
|
|
57
|
-
// citty runs a parent's `run` AFTER its subcommand, so carrying the
|
|
58
|
-
// passthrough here would forward `run …` to agent-browser once the
|
|
59
|
-
// playtest had finished and turn every passing run into an exit 1.
|
|
40
|
+
asset: lazy(async () => await import("./chunk-Q2QC6KAZ.js"), "assetCommand"),
|
|
41
|
+
check: lazy(async () => await import("./chunk-SBXCK2I2.js"), "checkCommand"),
|
|
42
|
+
completions: lazy(async () => await import("./chunk-VIEKOGKG.js"), "completionsCommand"),
|
|
43
|
+
config: lazy(async () => await import("./chunk-Q3XQPNF6.js"), "configCommand"),
|
|
44
|
+
credits: lazy(async () => await import("./chunk-VZEJ2ZHE.js"), "creditsCommand"),
|
|
45
|
+
deploy: lazy(async () => await import("./chunk-E7NDOZ27.js"), "deployCommand"),
|
|
46
|
+
deployments: lazy(async () => await import("./chunk-2ZKS7V72.js"), "deploymentsCommand"),
|
|
47
|
+
distribute: lazy(async () => await import("./chunk-LORGE2NB.js"), "distributeCommand"),
|
|
48
|
+
factory: lazy(async () => await import("./chunk-K36EOII3.js"), "factoryCommand"),
|
|
49
|
+
fork: lazy(async () => await import("./chunk-MEAO33XW.js"), "forkCommand"),
|
|
50
|
+
generate: lazy(async () => await import("./chunk-ABTUEIRC.js"), "generateCommand"),
|
|
51
|
+
init: lazy(async () => await import("./chunk-H2C4QUTG.js"), "initCommand"),
|
|
52
|
+
login: lazy(async () => await import("./chunk-43P4U7CB.js"), "loginCommand"),
|
|
53
|
+
logout: lazy(async () => await import("./chunk-SXYQL4GK.js"), "logoutCommand"),
|
|
54
|
+
new: lazy(async () => await import("./chunk-BN3Q7UEC.js"), "newCommand"),
|
|
60
55
|
playtest: async () => {
|
|
61
|
-
const { playtestCommand } = await import("./chunk-
|
|
56
|
+
const { playtestCommand } = await import("./chunk-HSMG6U7J.js");
|
|
62
57
|
return defineCommand({
|
|
63
58
|
meta: playtestCommand.meta,
|
|
64
59
|
subCommands: {
|
|
65
|
-
run: lazy(() => import("./chunk-
|
|
60
|
+
run: lazy(async () => await import("./chunk-LONQWRTR.js"), "playtestRunCommand")
|
|
66
61
|
}
|
|
67
62
|
});
|
|
68
63
|
},
|
|
69
|
-
skills: lazy(() => import("./chunk-
|
|
70
|
-
update: lazy(() => import("./chunk-
|
|
71
|
-
whoami: lazy(() => import("./chunk-
|
|
64
|
+
skills: lazy(async () => await import("./chunk-UPHB5HWO.js"), "skillsCommand"),
|
|
65
|
+
update: lazy(async () => await import("./chunk-MR5KIFI7.js"), "updateCommand"),
|
|
66
|
+
whoami: lazy(async () => await import("./chunk-HRKVAXNN.js"), "whoamiCommand")
|
|
72
67
|
}
|
|
73
68
|
});
|
|
74
69
|
var subcommand = process.argv.at(2);
|
|
75
|
-
if (subcommand && !["update", "init", "completions"].includes(subcommand)) {
|
|
76
|
-
const { maybeScheduleAutoUpdate } = await import("./chunk-
|
|
70
|
+
if (subcommand !== void 0 && subcommand !== "" && !["update", "init", "completions"].includes(subcommand)) {
|
|
71
|
+
const { maybeScheduleAutoUpdate } = await import("./chunk-4UU622RK.js");
|
|
77
72
|
maybeScheduleAutoUpdate();
|
|
78
73
|
}
|
|
79
74
|
if (subcommand === "factory") {
|
|
80
|
-
const { runFactory } = await import("./chunk-
|
|
75
|
+
const { runFactory } = await import("./chunk-K36EOII3.js");
|
|
81
76
|
runFactory(process.argv.slice(3));
|
|
82
77
|
}
|
|
83
78
|
if (subcommand === "playtest" && process.argv.at(3) !== "run") {
|
|
84
|
-
const { runPlaytest } = await import("./chunk-
|
|
79
|
+
const { runPlaytest } = await import("./chunk-HSMG6U7J.js");
|
|
85
80
|
runPlaytest(process.argv.slice(3));
|
|
86
81
|
}
|
|
87
|
-
|
|
82
|
+
if (subcommand === "asset") {
|
|
83
|
+
const { runAsset } = await import("./chunk-Q2QC6KAZ.js");
|
|
84
|
+
await runAsset(process.argv.slice(3));
|
|
85
|
+
} else if (subcommand === "check") {
|
|
86
|
+
const { runCheck } = await import("./chunk-SBXCK2I2.js");
|
|
87
|
+
await runCheck(process.argv.slice(3));
|
|
88
|
+
} else {
|
|
89
|
+
await runMain(main);
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -1,35 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibedgames",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"vg": "./dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
|
+
"assets",
|
|
9
10
|
"dist",
|
|
10
11
|
"templates"
|
|
11
12
|
],
|
|
12
13
|
"type": "module",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "node scripts/build.ts",
|
|
16
|
+
"dev": "node scripts/build.ts --watch",
|
|
17
|
+
"clean": "rm -rf .turbo dist node_modules",
|
|
18
|
+
"test": "node --import tsx --test \"test/*.test.ts\" \"src/**/*.test.ts\"",
|
|
19
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p templates/none && tsc --noEmit -p templates/phaser && tsc --noEmit -p templates/react-r3f && tsc --noEmit -p templates/threejs"
|
|
20
|
+
},
|
|
13
21
|
"devDependencies": {
|
|
14
|
-
"@kyh/tsconfig": "
|
|
15
|
-
"@orpc/client": "
|
|
16
|
-
"@
|
|
22
|
+
"@kyh/tsconfig": "catalog:",
|
|
23
|
+
"@orpc/client": "catalog:",
|
|
24
|
+
"@react-three/drei": "^10.7.9",
|
|
25
|
+
"@react-three/fiber": "^9.8.2",
|
|
26
|
+
"@repo/asset-tools": "workspace:^",
|
|
27
|
+
"@repo/contract": "workspace:^",
|
|
17
28
|
"@types/cross-spawn": "^6.0.6",
|
|
18
|
-
"@types/node": "
|
|
29
|
+
"@types/node": "catalog:",
|
|
30
|
+
"@types/react": "catalog:",
|
|
31
|
+
"@types/react-dom": "catalog:",
|
|
32
|
+
"@types/three": "^0.186.0",
|
|
33
|
+
"@vitejs/plugin-react": "catalog:",
|
|
19
34
|
"citty": "^0.2.2",
|
|
20
35
|
"consola": "^3.4.2",
|
|
21
36
|
"cross-spawn": "^7.0.6",
|
|
22
37
|
"esbuild": "^0.28.2",
|
|
23
38
|
"fflate": "^0.8.3",
|
|
24
|
-
"ignore": "^7.0.
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
39
|
+
"ignore": "^7.0.16",
|
|
40
|
+
"msw": "2.11.3",
|
|
41
|
+
"phaser": "^4.2.1",
|
|
42
|
+
"react": "catalog:",
|
|
43
|
+
"react-dom": "catalog:",
|
|
44
|
+
"tar": "^7.5.23",
|
|
45
|
+
"three": "^0.186.1",
|
|
46
|
+
"typescript": "catalog:",
|
|
47
|
+
"vite": "catalog:",
|
|
48
|
+
"zod": "catalog:"
|
|
34
49
|
}
|
|
35
|
-
}
|
|
50
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
const host = document.querySelector("#game");
|
|
2
2
|
const canvas = document.createElement("canvas");
|
|
3
|
+
|
|
3
4
|
canvas.width = 800;
|
|
5
|
+
|
|
4
6
|
canvas.height = 600;
|
|
7
|
+
|
|
5
8
|
host?.append(canvas);
|
|
6
9
|
|
|
7
10
|
const ctx = canvas.getContext("2d");
|
|
11
|
+
|
|
8
12
|
if (ctx) {
|
|
9
13
|
ctx.fillStyle = "#fff";
|
|
10
14
|
ctx.textAlign = "center";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "vite";
|
|
2
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
3
|
export default defineConfig({
|
|
6
4
|
base: "./",
|
|
7
5
|
server: { port: 5173 },
|
|
@@ -7,7 +7,6 @@ const config: Types.Core.GameConfig = {
|
|
|
7
7
|
backgroundColor: "#0e1020",
|
|
8
8
|
parent: "game",
|
|
9
9
|
physics: { arcade: { debug: false }, default: "arcade" },
|
|
10
|
-
// A fixed 960×540 world, letterboxed to fit any window.
|
|
11
10
|
scale: { autoCenter: Scale.CENTER_BOTH, height: 540, mode: Scale.FIT, width: 960 },
|
|
12
11
|
scene: [GameScene],
|
|
13
12
|
type: AUTO,
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { GameObjects, Input } from "phaser";
|
|
2
2
|
import { Scene } from "phaser";
|
|
3
3
|
|
|
4
|
-
// World pixels per second.
|
|
5
4
|
const SPEED = 240;
|
|
6
5
|
const SIZE = 48;
|
|
7
6
|
|
|
8
7
|
type Direction = "up" | "down" | "left" | "right";
|
|
9
8
|
|
|
10
|
-
const clamp = (value: number, min: number, max: number)
|
|
11
|
-
Math.min(max, Math.max(min, value));
|
|
9
|
+
const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value));
|
|
12
10
|
|
|
13
11
|
/** A square you drive with the arrow keys or WASD. Replace it with your game. */
|
|
14
12
|
export class GameScene extends Scene {
|
|
@@ -19,7 +17,7 @@ export class GameScene extends Scene {
|
|
|
19
17
|
super("game");
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
create()
|
|
20
|
+
create() {
|
|
23
21
|
const { width, height } = this.scale;
|
|
24
22
|
const font = { color: "#ffffff", fontFamily: "system-ui, sans-serif" };
|
|
25
23
|
this.add.text(width / 2, 48, "__VG_SLUG__", { ...font, fontSize: "32px" }).setOrigin(0.5);
|
|
@@ -34,6 +32,7 @@ export class GameScene extends Scene {
|
|
|
34
32
|
this.player = this.add.rectangle(width / 2, height / 2, SIZE, SIZE, 0x5b_e3_ff);
|
|
35
33
|
|
|
36
34
|
const { keyboard } = this.input;
|
|
35
|
+
|
|
37
36
|
if (keyboard) {
|
|
38
37
|
this.keys = {
|
|
39
38
|
down: [keyboard.addKey("DOWN"), keyboard.addKey("S")],
|
|
@@ -44,19 +43,22 @@ export class GameScene extends Scene {
|
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
override update(_time: number, delta: number)
|
|
46
|
+
override update(_time: number, delta: number) {
|
|
48
47
|
const { keys, player } = this;
|
|
48
|
+
|
|
49
49
|
if (!keys || !player) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
|
|
53
|
+
const held = (direction: Direction) => (keys[direction].some((key) => key.isDown) ? 1 : 0);
|
|
54
|
+
|
|
54
55
|
const dx = held("right") - held("left");
|
|
55
56
|
const dy = held("down") - held("up");
|
|
57
|
+
|
|
56
58
|
if (dx === 0 && dy === 0) {
|
|
57
59
|
return;
|
|
58
60
|
}
|
|
59
|
-
|
|
61
|
+
|
|
60
62
|
const step = (SPEED * delta) / 1000 / Math.hypot(dx, dy);
|
|
61
63
|
const half = SIZE / 2;
|
|
62
64
|
player.x = clamp(player.x + dx * step, half, this.scale.width - half);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "vite";
|
|
2
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
3
|
export default defineConfig({
|
|
6
4
|
base: "./",
|
|
7
5
|
server: { port: 5173 },
|
|
@@ -3,17 +3,19 @@ import { Canvas, useFrame } from "@react-three/fiber";
|
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import type { Mesh } from "three";
|
|
5
5
|
|
|
6
|
-
// Replace the cube with your game.
|
|
7
6
|
const SpinningCube = () => {
|
|
8
7
|
const ref = useRef<Mesh>(null);
|
|
9
8
|
useFrame((_state, delta) => {
|
|
10
9
|
const mesh = ref.current;
|
|
10
|
+
|
|
11
11
|
if (!mesh) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
+
|
|
14
15
|
mesh.rotation.x += delta * 0.5;
|
|
15
16
|
mesh.rotation.y += delta;
|
|
16
17
|
});
|
|
18
|
+
|
|
17
19
|
return (
|
|
18
20
|
<mesh ref={ref}>
|
|
19
21
|
<boxGeometry args={[1, 1, 1]} />
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import react from "@vitejs/plugin-react";
|
|
2
2
|
import { defineConfig } from "vite";
|
|
3
3
|
|
|
4
|
-
// A relative base keeps built asset URLs relative, so the bundle works wherever it is
|
|
5
|
-
// hosted — including {slug}.vibedgames.com after `vg deploy ./dist`.
|
|
6
4
|
export default defineConfig({
|
|
7
5
|
base: "./",
|
|
8
6
|
plugins: [react()],
|
|
@@ -11,24 +11,33 @@ import {
|
|
|
11
11
|
} from "three";
|
|
12
12
|
|
|
13
13
|
const scene = new Scene();
|
|
14
|
+
|
|
14
15
|
scene.background = new Color("#0e1020");
|
|
15
16
|
|
|
16
17
|
const camera = new PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 100);
|
|
18
|
+
|
|
17
19
|
camera.position.set(0, 1.5, 4);
|
|
20
|
+
|
|
18
21
|
camera.lookAt(0, 0, 0);
|
|
19
22
|
|
|
20
23
|
const renderer = new WebGLRenderer({ antialias: true });
|
|
24
|
+
|
|
21
25
|
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
|
26
|
+
|
|
22
27
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
28
|
+
|
|
23
29
|
document.body.append(renderer.domElement);
|
|
24
30
|
|
|
25
31
|
scene.add(new AmbientLight(0xff_ff_ff, 0.4));
|
|
32
|
+
|
|
26
33
|
const sun = new DirectionalLight(0xff_ff_ff, 2);
|
|
34
|
+
|
|
27
35
|
sun.position.set(3, 5, 2);
|
|
36
|
+
|
|
28
37
|
scene.add(sun);
|
|
29
38
|
|
|
30
|
-
// Replace the cube with your game.
|
|
31
39
|
const cube = new Mesh(new BoxGeometry(1, 1, 1), new MeshStandardMaterial({ color: "#5be3ff" }));
|
|
40
|
+
|
|
32
41
|
scene.add(cube);
|
|
33
42
|
|
|
34
43
|
window.addEventListener("resize", () => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "vite";
|
|
2
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
3
|
export default defineConfig({
|
|
6
4
|
base: "./",
|
|
7
5
|
server: { port: 5173 },
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Kaiyu Hsu
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/dist/chunk-J6PKNPI2.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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/types.ts
|
|
9
|
-
var isJsonObject = (value) => (
|
|
10
|
-
// Object() is the identity only on objects; arrays are split off explicitly.
|
|
11
|
-
Object(value) === value && !Array.isArray(value)
|
|
12
|
-
);
|
|
13
|
-
var isJsonString = (value) => (
|
|
14
|
-
// String() is the identity only on strings.
|
|
15
|
-
String(value) === value
|
|
16
|
-
);
|
|
17
|
-
var isJsonNumber = (value) => (
|
|
18
|
-
// JSON cannot encode NaN/Infinity, so isFinite matches every JSON number.
|
|
19
|
-
Number.isFinite(value)
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
isJsonObject,
|
|
24
|
-
isJsonString,
|
|
25
|
-
isJsonNumber
|
|
26
|
-
};
|