flashts 1.0.0 → 1.0.2

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.
@@ -5,9 +5,10 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>FlashTS Playground</title>
8
+ <script type="module" crossorigin src="/assets/index-DM0EVhuB.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-BAlIRq-u.css">
8
10
  </head>
9
11
  <body>
10
12
  <div id="root"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
13
  </body>
13
14
  </html>
package/package.json CHANGED
@@ -1,66 +1,76 @@
1
- {
2
- "name": "flashts",
3
- "version": "1.0.0",
4
- "description": "High-performance TypeScript/JavaScript Playground powered by Bun",
5
- "main": "server/index.ts",
6
- "bin": {
7
- "flashts": "./bin/cli.ts"
8
- },
9
- "type": "module",
10
- "scripts": {
11
- "dev:client": "cd client && vite",
12
- "dev:server": "cd server && bun index.ts",
13
- "build": "cd client && bun run build",
14
- "start": "bun bin/cli.ts"
15
- },
16
- "dependencies": {
17
- "@hono/node-server": "^1.13.8",
18
- "@monaco-editor/react": "^4.7.0",
19
- "clsx": "^2.1.1",
20
- "commander": "^13.1.0",
21
- "framer-motion": "^12.29.0",
22
- "hono": "^4.11.5",
23
- "localtunnel": "^2.0.2",
24
- "lucide-react": "^0.562.0",
25
- "monaco-editor": "^0.55.1",
26
- "open": "^10.1.0",
27
- "picocolors": "^1.1.1",
28
- "react": "^19.2.3",
29
- "react-dom": "^19.2.0",
30
- "react-resizable-panels": "^4.4.1",
31
- "tailwind-merge": "^3.4.0"
32
- },
33
- "devDependencies": {
34
- "@eslint/js": "^9.39.1",
35
- "@types/bun": "latest",
36
- "@types/localtunnel": "^2.0.4",
37
- "@types/node": "^24.10.1",
38
- "@types/react": "^19.2.9",
39
- "@types/react-dom": "^19.2.3",
40
- "@vitejs/plugin-react": "^5.1.1",
41
- "autoprefixer": "^10.4.23",
42
- "eslint": "^9.39.1",
43
- "eslint-plugin-react-hooks": "^7.0.1",
44
- "eslint-plugin-react-refresh": "^0.4.24",
45
- "globals": "^16.5.0",
46
- "postcss": "^8.5.6",
47
- "tailwindcss": "3.4.17",
48
- "typescript": "~5.9.3",
49
- "typescript-eslint": "^8.46.4",
50
- "vite": "npm:rolldown-vite@7.2.5"
51
- },
52
- "overrides": {
53
- "vite": "npm:rolldown-vite@7.2.5"
54
- },
55
- "keywords": [
56
- "typescript",
57
- "playground",
58
- "bun",
59
- "hono",
60
- "react",
61
- "ide",
62
- "cli"
63
- ],
64
- "author": "FlashTS Team",
65
- "license": "MIT"
66
- }
1
+ {
2
+ "name": "flashts",
3
+ "version": "1.0.2",
4
+ "description": "High-performance TypeScript/JavaScript Playground powered by Bun",
5
+ "main": "server/index.ts",
6
+ "bin": {
7
+ "flashts": "./bin/cli.ts"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "server",
12
+ "client/dist",
13
+ "README.md",
14
+ "LICENSE",
15
+ "CHANGELOG.md",
16
+ "CONTRIBUTING.md"
17
+ ],
18
+ "readme": "README.md",
19
+ "type": "module",
20
+ "scripts": {
21
+ "dev:client": "cd client && vite",
22
+ "dev:server": "cd server && bun index.ts",
23
+ "build": "cd client && bun run build",
24
+ "start": "bun bin/cli.ts"
25
+ },
26
+ "dependencies": {
27
+ "@hono/node-server": "^1.13.8",
28
+ "@monaco-editor/react": "^4.7.0",
29
+ "clsx": "^2.1.1",
30
+ "commander": "^13.1.0",
31
+ "framer-motion": "^12.29.0",
32
+ "hono": "^4.11.5",
33
+ "localtunnel": "^2.0.2",
34
+ "lucide-react": "^0.562.0",
35
+ "monaco-editor": "^0.55.1",
36
+ "open": "^10.1.0",
37
+ "picocolors": "^1.1.1",
38
+ "react": "^19.2.3",
39
+ "react-dom": "^19.2.0",
40
+ "react-resizable-panels": "^4.4.1",
41
+ "tailwind-merge": "^3.4.0"
42
+ },
43
+ "devDependencies": {
44
+ "@eslint/js": "^9.39.1",
45
+ "@types/bun": "latest",
46
+ "@types/localtunnel": "^2.0.4",
47
+ "@types/node": "^24.10.1",
48
+ "@types/react": "^19.2.9",
49
+ "@types/react-dom": "^19.2.3",
50
+ "@vitejs/plugin-react": "^5.1.1",
51
+ "autoprefixer": "^10.4.23",
52
+ "eslint": "^9.39.1",
53
+ "eslint-plugin-react-hooks": "^7.0.1",
54
+ "eslint-plugin-react-refresh": "^0.4.24",
55
+ "globals": "^16.5.0",
56
+ "postcss": "^8.5.6",
57
+ "tailwindcss": "3.4.17",
58
+ "typescript": "~5.9.3",
59
+ "typescript-eslint": "^8.46.4",
60
+ "vite": "npm:rolldown-vite@7.2.5"
61
+ },
62
+ "overrides": {
63
+ "vite": "npm:rolldown-vite@7.2.5"
64
+ },
65
+ "keywords": [
66
+ "typescript",
67
+ "playground",
68
+ "bun",
69
+ "hono",
70
+ "react",
71
+ "ide",
72
+ "cli"
73
+ ],
74
+ "author": "FlashTS Team",
75
+ "license": "MIT"
76
+ }
package/server/index.ts CHANGED
@@ -6,15 +6,17 @@ import { serveStatic } from "hono/bun";
6
6
 
7
7
  const app = new Hono();
8
8
 
9
+ const PACKAGE_ROOT = join(import.meta.dir, "..");
10
+
9
11
  // Enable CORS for the frontend
10
12
  app.use("/*", cors());
11
13
 
12
- // Ensure tmp directory exists
13
- const TMP_DIR = join(process.cwd(), "tmp");
14
+ // Ensure tmp directory exists in the package root or system temp
15
+ const TMP_DIR = join(PACKAGE_ROOT, "tmp");
14
16
  await mkdir(TMP_DIR, { recursive: true });
15
17
 
16
- // Serve static files from the client/dist directory
17
- app.use("/*", serveStatic({ root: "./client/dist" }));
18
+ // Serve static files from the client/dist directory relative to package root
19
+ app.use("/*", serveStatic({ root: join(PACKAGE_ROOT, "client/dist") }));
18
20
 
19
21
  app.get("/api/health", (c) => c.text("FlashTS API Active"));
20
22
 
@@ -86,7 +88,7 @@ app.post("/install", async (c) => {
86
88
 
87
89
  try {
88
90
  const proc = Bun.spawn(["bun", "add", pkgName], {
89
- cwd: process.cwd(),
91
+ cwd: PACKAGE_ROOT,
90
92
  stdout: "pipe",
91
93
  stderr: "pipe",
92
94
  });
@@ -107,7 +109,7 @@ app.post("/install", async (c) => {
107
109
 
108
110
  app.get("/dependencies", async (c) => {
109
111
  try {
110
- const pkgPath = join(process.cwd(), "package.json");
112
+ const pkgPath = join(PACKAGE_ROOT, "package.json");
111
113
  const pkgData = JSON.parse(await readFile(pkgPath, "utf-8"));
112
114
  return c.json(pkgData.dependencies || {});
113
115
  } catch (e) {
@@ -123,7 +125,7 @@ app.post("/uninstall", async (c) => {
123
125
 
124
126
  try {
125
127
  const proc = Bun.spawn(["bun", "remove", pkgName], {
126
- cwd: process.cwd(),
128
+ cwd: PACKAGE_ROOT,
127
129
  stdout: "pipe",
128
130
  stderr: "pipe",
129
131
  });
@@ -143,7 +145,7 @@ app.post("/uninstall", async (c) => {
143
145
  });
144
146
 
145
147
  async function getPackageTypeTree(pkgName: string) {
146
- const pkgDir = join(process.cwd(), "node_modules", pkgName);
148
+ const pkgDir = join(PACKAGE_ROOT, "node_modules", pkgName);
147
149
  const files: Record<string, string> = {};
148
150
 
149
151
  async function scan(dir: string, relativePath: string = "") {
@@ -172,7 +174,7 @@ async function getPackageTypeTree(pkgName: string) {
172
174
  const typesPkgName = pkgName.startsWith('@')
173
175
  ? pkgName.slice(1).replace('/', '__')
174
176
  : pkgName;
175
- const atTypesDir = join(process.cwd(), "node_modules", "@types", typesPkgName);
177
+ const atTypesDir = join(PACKAGE_ROOT, "node_modules", "@types", typesPkgName);
176
178
  await scan(atTypesDir);
177
179
  return files;
178
180
  } catch (e2) {
package/client/README.md DELETED
@@ -1,73 +0,0 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## React Compiler
11
-
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
-
14
- ## Expanding the ESLint configuration
15
-
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
17
-
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
25
-
26
- // Remove tseslint.configs.recommended and replace with this
27
- tseslint.configs.recommendedTypeChecked,
28
- // Alternatively, use this for stricter rules
29
- tseslint.configs.strictTypeChecked,
30
- // Optionally, add this for stylistic rules
31
- tseslint.configs.stylisticTypeChecked,
32
-
33
- // Other configs...
34
- ],
35
- languageOptions: {
36
- parserOptions: {
37
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
- tsconfigRootDir: import.meta.dirname,
39
- },
40
- // other options...
41
- },
42
- },
43
- ])
44
- ```
45
-
46
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
-
48
- ```js
49
- // eslint.config.js
50
- import reactX from 'eslint-plugin-react-x'
51
- import reactDom from 'eslint-plugin-react-dom'
52
-
53
- export default defineConfig([
54
- globalIgnores(['dist']),
55
- {
56
- files: ['**/*.{ts,tsx}'],
57
- extends: [
58
- // Other configs...
59
- // Enable lint rules for React
60
- reactX.configs['recommended-typescript'],
61
- // Enable lint rules for React DOM
62
- reactDom.configs.recommended,
63
- ],
64
- languageOptions: {
65
- parserOptions: {
66
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
- tsconfigRootDir: import.meta.dirname,
68
- },
69
- // other options...
70
- },
71
- },
72
- ])
73
- ```