vibe-coding-master 0.0.5 → 0.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-coding-master",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Local GUI session cockpit for Claude Code role sessions.",
5
5
  "type": "module",
6
6
  "files": [
@@ -24,6 +24,8 @@
24
24
  "clean": "node scripts/clean-build.mjs",
25
25
  "fix:node-pty": "node scripts/fix-node-pty-spawn-helper.mjs",
26
26
  "postinstall": "node scripts/fix-node-pty-spawn-helper.mjs",
27
+ "verify:package": "node scripts/verify-package.mjs",
28
+ "prepack": "npm run build && npm run verify:package",
27
29
  "dev": "tsx src/main.ts --dev",
28
30
  "build": "npm run clean && tsc -p tsconfig.node.json && vite build",
29
31
  "start": "node dist/main.js",
@@ -0,0 +1,113 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+
4
+ const appRoot = process.cwd();
5
+ const requiredFiles = [
6
+ "README.md",
7
+ "package.json",
8
+ "scripts/fix-node-pty-spawn-helper.mjs",
9
+ "dist/main.js",
10
+ "dist/cli/vcmctl.js",
11
+ "dist/backend/server.js",
12
+ "dist/backend/runtime/node-pty-runtime.js",
13
+ "dist/backend/ws/terminal-ws.js",
14
+ "dist/backend/services/session-service.js",
15
+ "dist/backend/services/project-service.js",
16
+ "dist/backend/services/message-service.js",
17
+ "dist/shared/constants.js",
18
+ "dist/shared/validation/slug-check.js",
19
+ "dist/shared/validation/artifact-check.js",
20
+ "dist-frontend/index.html"
21
+ ];
22
+
23
+ const requiredFileEntries = [
24
+ "dist",
25
+ "dist-frontend",
26
+ "docs",
27
+ "scripts",
28
+ "README.md"
29
+ ];
30
+
31
+ async function main() {
32
+ const pkg = JSON.parse(await readText("package.json"));
33
+ assertArrayIncludes(pkg.files, requiredFileEntries, "package.json files");
34
+ assertEqual(pkg.bin?.vcm, "dist/main.js", "package.json bin.vcm");
35
+ assertEqual(pkg.bin?.vcmctl, "dist/cli/vcmctl.js", "package.json bin.vcmctl");
36
+
37
+ for (const file of requiredFiles) {
38
+ await assertFile(file);
39
+ }
40
+
41
+ await assertStartsWith("dist/main.js", "#!/usr/bin/env node", "vcm bin shebang");
42
+ await assertStartsWith("dist/cli/vcmctl.js", "#!/usr/bin/env node", "vcmctl bin shebang");
43
+
44
+ const server = await readText("dist/backend/server.js");
45
+ assertIncludes(server, 'path.join(getAppRoot(), "dist-frontend")', "packaged static dir must resolve from app root");
46
+ assertNotIncludes(server, 'path.resolve("dist-frontend")', "packaged static dir must not resolve from caller cwd");
47
+
48
+ const indexHtml = await readText("dist-frontend/index.html");
49
+ const assetPaths = [...indexHtml.matchAll(/(?:src|href)="\/([^"]+)"/g)].map((match) => match[1]);
50
+ if (assetPaths.length === 0) {
51
+ fail("dist-frontend/index.html does not reference any built assets");
52
+ }
53
+ for (const assetPath of assetPaths) {
54
+ await assertFile(path.join("dist-frontend", assetPath));
55
+ }
56
+
57
+ console.log(`Package verification passed: ${requiredFiles.length + assetPaths.length} required files checked.`);
58
+ }
59
+
60
+ async function readText(relativePath) {
61
+ return fs.readFile(path.join(appRoot, relativePath), "utf8");
62
+ }
63
+
64
+ async function assertFile(relativePath) {
65
+ const absolutePath = path.join(appRoot, relativePath);
66
+ const stat = await fs.stat(absolutePath).catch(() => null);
67
+ if (!stat?.isFile()) {
68
+ fail(`Missing required package file: ${relativePath}`);
69
+ }
70
+ }
71
+
72
+ async function assertStartsWith(relativePath, expected, label) {
73
+ const content = await readText(relativePath);
74
+ if (!content.startsWith(expected)) {
75
+ fail(`${label} failed for ${relativePath}`);
76
+ }
77
+ }
78
+
79
+ function assertArrayIncludes(actual, expectedEntries, label) {
80
+ if (!Array.isArray(actual)) {
81
+ fail(`${label} must be an array`);
82
+ }
83
+ for (const entry of expectedEntries) {
84
+ if (!actual.includes(entry)) {
85
+ fail(`${label} missing ${entry}`);
86
+ }
87
+ }
88
+ }
89
+
90
+ function assertEqual(actual, expected, label) {
91
+ if (actual !== expected) {
92
+ fail(`${label} expected ${expected}, got ${actual}`);
93
+ }
94
+ }
95
+
96
+ function assertIncludes(content, expected, label) {
97
+ if (!content.includes(expected)) {
98
+ fail(`${label}: missing ${expected}`);
99
+ }
100
+ }
101
+
102
+ function assertNotIncludes(content, unexpected, label) {
103
+ if (content.includes(unexpected)) {
104
+ fail(`${label}: found ${unexpected}`);
105
+ }
106
+ }
107
+
108
+ function fail(message) {
109
+ console.error(`Package verification failed: ${message}`);
110
+ process.exit(1);
111
+ }
112
+
113
+ await main();