flashts 1.0.6 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to FlashTS will be documented in this file.
4
4
 
5
+ ## [1.0.7] - 2026-01-25
6
+
7
+ ### Fixed
8
+
9
+ - **Vite Preview Timeout**: Resolved the issue where the live preview would hang on "launching" in production by moving `vite` and `@vitejs/plugin-react` to core dependencies and using direct execution.
10
+ - **CLI Exit Responsiveness**: Optimized SIGINT/SIGTERM handling to ensure the CLI and all subprocesses close instantly with a single Ctrl+C, eliminating the previous 500ms delay.
11
+
5
12
  ## [1.0.6] - 2026-01-24
6
13
 
7
14
  ### Added
package/bin/cli.ts CHANGED
@@ -10,7 +10,7 @@ const program = new Command();
10
10
  program
11
11
  .name("flashts")
12
12
  .description("FlashTS: High-performance TypeScript Playground CLI")
13
- .version("1.0.6")
13
+ .version("1.0.7")
14
14
  .option("-p, --port <number>", "Port to run the server on", "3000")
15
15
  .option("-s, --share", "Generate a shareable public link")
16
16
  .option("--no-open", "Do not open the browser automatically")
@@ -45,7 +45,7 @@ program
45
45
 
46
46
  const packageRoot = join(import.meta.dir, "..");
47
47
 
48
- console.log(`\n⚡ ${pc.bold(pc.cyan("FlashTS"))} ${pc.dim("v1.0.6")}`);
48
+ console.log(`\n⚡ ${pc.bold(pc.cyan("FlashTS"))} ${pc.dim("v1.0.7")}`);
49
49
  console.log(`${pc.green("➜")} Local: ${pc.cyan(`http://localhost:${port}`)}`);
50
50
 
51
51
  // Start the server process
@@ -80,13 +80,14 @@ program
80
80
  }, 1000);
81
81
  }
82
82
 
83
- // Keep process alive and ensure total cleanup
84
- process.on("SIGINT", () => {
83
+ const handleExit = () => {
85
84
  console.log(pc.yellow("\nStopping FlashTS..."));
86
- // The server itself will handle killing vites on SIGINT
87
- serverProc.kill("SIGINT");
88
- setTimeout(() => process.exit(0), 500);
89
- });
85
+ serverProc.kill();
86
+ process.exit(0);
87
+ };
88
+
89
+ process.on("SIGINT", handleExit);
90
+ process.on("SIGTERM", handleExit);
90
91
  });
91
92
 
92
93
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flashts",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "High-performance TypeScript/JavaScript Playground powered by Bun",
5
5
  "main": "server/index.ts",
6
6
  "bin": {
@@ -43,14 +43,15 @@
43
43
  "react": "^19.2.3",
44
44
  "react-dom": "^19.2.0",
45
45
  "react-resizable-panels": "^4.4.1",
46
- "tailwind-merge": "^3.4.0"
46
+ "tailwind-merge": "^3.4.0",
47
+ "vite": "npm:rolldown-vite@7.2.5",
48
+ "@vitejs/plugin-react": "^5.1.1"
47
49
  },
48
50
  "devDependencies": {
49
51
  "@eslint/js": "^9.39.1",
50
52
  "@types/localtunnel": "^2.0.4",
51
53
  "@types/react": "^19.2.9",
52
54
  "@types/react-dom": "^19.2.3",
53
- "@vitejs/plugin-react": "^5.1.1",
54
55
  "autoprefixer": "^10.4.23",
55
56
  "eslint": "^9.39.1",
56
57
  "eslint-plugin-react-hooks": "^7.0.1",
package/server/index.ts CHANGED
@@ -62,21 +62,24 @@ const performGC = async () => {
62
62
  } catch (e) {}
63
63
  };
64
64
 
65
+ const killActiveProcesses = () => {
66
+ // Kill all vite processes
67
+ for (const [id, proc] of vites) {
68
+ try { proc.kill(); } catch (e) {}
69
+ }
70
+ vites.clear();
71
+
72
+ // Kill active execution
73
+ if (currentExecuteProc) {
74
+ try { currentExecuteProc.kill(); } catch (e) {}
75
+ currentExecuteProc = null;
76
+ }
77
+ };
78
+
65
79
  // GUARANTEED Cleanup on CLI exit
66
80
  const wipeTempSessions = async () => {
67
81
  try {
68
- // Kill all vite processes
69
- for (const [id, proc] of vites) {
70
- try { proc.kill(); } catch (e) {}
71
- }
72
- vites.clear();
73
-
74
- // Kill active execution
75
- if (currentExecuteProc) {
76
- try { currentExecuteProc.kill(); } catch (e) {}
77
- currentExecuteProc = null;
78
- }
79
-
82
+ killActiveProcesses();
80
83
  await performGC();
81
84
  } catch (e) {}
82
85
  };
@@ -84,12 +87,12 @@ const wipeTempSessions = async () => {
84
87
  // Start with a clean slate
85
88
  await wipeTempSessions();
86
89
 
87
- process.on("SIGINT", async () => {
88
- await wipeTempSessions();
90
+ process.on("SIGINT", () => {
91
+ killActiveProcesses();
89
92
  process.exit(0);
90
93
  });
91
- process.on("SIGTERM", async () => {
92
- await wipeTempSessions();
94
+ process.on("SIGTERM", () => {
95
+ killActiveProcesses();
93
96
  process.exit(0);
94
97
  });
95
98
 
@@ -423,7 +426,8 @@ export default defineConfig({
423
426
  // Install @vitejs/plugin-react in the temp dir might be needed or we use global
424
427
  // For simplicity, we assume vite-related plugins are available in PACKAGE_ROOT/node_modules
425
428
 
426
- const proc = Bun.spawn([process.execPath, "x", "vite", "--port", String(vitePort), "--strictPort", "--host"], {
429
+ const viteBin = join(PACKAGE_ROOT, "node_modules", "vite", "bin", "vite.js");
430
+ const proc = Bun.spawn([process.execPath, viteBin, "--port", String(vitePort), "--strictPort", "--host"], {
427
431
  cwd: sessionDir,
428
432
  stdout: "pipe",
429
433
  stderr: "pipe",