showpane 0.4.0 → 0.4.1

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 CHANGED
@@ -21,3 +21,11 @@ This is auth only — org creation and billing happen in the Showpane Cloud web
21
21
 
22
22
  - Node.js 20+
23
23
  - Claude Code (for portal creation)
24
+
25
+ ## Local Smoke Test
26
+
27
+ ```bash
28
+ npm run smoke:test-local
29
+ ```
30
+
31
+ Builds the local CLI, packs it, and runs the full `npx` scaffold flow in a temp directory with a deliberately conflicting parent `DATABASE_URL`.
package/dist/index.js CHANGED
@@ -70,8 +70,12 @@ function findFreePort(startPort) {
70
70
  });
71
71
  });
72
72
  }
73
- function run(cmd, cwd) {
74
- execSync(cmd, { cwd, stdio: "inherit" });
73
+ function run(cmd, cwd, env) {
74
+ execSync(cmd, {
75
+ cwd,
76
+ stdio: "inherit",
77
+ env: env ? { ...process.env, ...env } : process.env
78
+ });
75
79
  }
76
80
  function openBrowser(url) {
77
81
  const platform = process.platform;
@@ -114,20 +118,25 @@ async function main() {
114
118
  process.exit(1);
115
119
  }
116
120
  const authSecret = randomBytes(32).toString("hex");
117
- const envContent = `DATABASE_URL="file:./dev.db"
121
+ const databaseUrl = "file:./dev.db";
122
+ const envContent = `DATABASE_URL="${databaseUrl}"
118
123
  AUTH_SECRET="${authSecret}"
119
124
  `;
120
125
  writeFileSync(resolve(appDir, ".env"), envContent);
121
126
  green("Environment configured");
122
127
  try {
123
- run("npx prisma db push --schema prisma/schema.local.prisma", appDir);
128
+ run("npx prisma db push --schema prisma/schema.local.prisma", appDir, {
129
+ DATABASE_URL: databaseUrl
130
+ });
124
131
  green("Database ready");
125
132
  } catch {
126
133
  error("Failed to set up the database. Check Prisma schema and try again.");
127
134
  process.exit(1);
128
135
  }
129
136
  try {
130
- run("npx tsx prisma/seed.ts", appDir);
137
+ run("npx tsx prisma/seed.ts", appDir, {
138
+ DATABASE_URL: databaseUrl
139
+ });
131
140
  green("Example portal seeded");
132
141
  } catch {
133
142
  blue("Skipped example portal (seed failed \u2014 not a problem)");
@@ -194,7 +203,7 @@ AUTH_SECRET="${authSecret}"
194
203
  const devServer = spawn("npm", ["run", "dev"], {
195
204
  cwd: appDir,
196
205
  stdio: "inherit",
197
- env: { ...process.env, PORT: String(port) }
206
+ env: { ...process.env, PORT: String(port), DATABASE_URL: databaseUrl }
198
207
  });
199
208
  setTimeout(() => {
200
209
  openBrowser(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "showpane",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "CLI for Showpane — AI-generated client portals",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,6 +14,7 @@
14
14
  "scripts": {
15
15
  "build": "tsup src/index.ts --format esm --dts --clean",
16
16
  "dev": "tsx src/index.ts",
17
+ "smoke:test-local": "node scripts/smoke-test-local.mjs",
17
18
  "prepublishOnly": "npm run build"
18
19
  },
19
20
  "keywords": [