showpane 0.3.1 → 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
@@ -9,7 +9,7 @@ import { createServer } from "net";
9
9
  import path from "path";
10
10
  import os from "os";
11
11
  import { fileURLToPath } from "url";
12
- var { mkdirSync, readFileSync, writeFileSync } = fs;
12
+ var { chmodSync, mkdirSync, readFileSync, writeFileSync } = fs;
13
13
  var { resolve, dirname, join } = path;
14
14
  var { homedir } = os;
15
15
  var RESET = "\x1B[0m";
@@ -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);
@@ -251,6 +260,7 @@ async function login() {
251
260
  JSON.stringify(
252
261
  {
253
262
  accessToken: data.accessToken,
263
+ accessTokenExpiresAt: data.tokenExpiresAt,
254
264
  orgSlug: data.orgSlug,
255
265
  portalUrl: data.portalUrl,
256
266
  vercelProjectId: data.vercelProjectId,
@@ -261,6 +271,7 @@ async function login() {
261
271
  2
262
272
  )
263
273
  );
274
+ chmodSync(configPath, 384);
264
275
  console.log();
265
276
  green(`Authenticated! Connected to ${BOLD}${data.orgSlug}${RESET}`);
266
277
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "showpane",
3
- "version": "0.3.1",
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": [