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.
- package/CHANGELOG.md +25 -0
- package/CONTRIBUTING.md +60 -0
- package/README.md +36 -66
- package/bin/cli.ts +2 -2
- package/client/dist/assets/index-BAlIRq-u.css +1 -0
- package/client/dist/assets/index-DM0EVhuB.js +21 -0
- package/client/{index.html → dist/index.html} +2 -1
- package/package.json +76 -66
- package/server/index.ts +11 -9
- package/client/README.md +0 -73
- package/client/bun.lock +0 -613
- package/client/eslint.config.js +0 -23
- package/client/package-lock.json +0 -3174
- package/client/package.json +0 -43
- package/client/postcss.config.js +0 -6
- package/client/src/App.css +0 -42
- package/client/src/App.tsx +0 -247
- package/client/src/assets/react.svg +0 -1
- package/client/src/components/CodeEditor.tsx +0 -206
- package/client/src/components/Console.tsx +0 -52
- package/client/src/components/FileTabs.tsx +0 -195
- package/client/src/components/LightningLogo.tsx +0 -33
- package/client/src/components/PackageInstaller.tsx +0 -300
- package/client/src/components/WelcomeScreen.tsx +0 -171
- package/client/src/index.css +0 -142
- package/client/src/main.tsx +0 -10
- package/client/tailwind.config.js +0 -32
- package/client/tsconfig.app.json +0 -28
- package/client/tsconfig.json +0 -7
- package/client/tsconfig.node.json +0 -26
- package/client/vite.config.ts +0 -7
- package/tmp/e656e349-2c39-4bc3-b334-6b5eb957e306/main.ts +0 -2
- /package/client/{public → dist}/favicon.svg +0 -0
|
@@ -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.
|
|
4
|
-
"description": "High-performance TypeScript/JavaScript Playground powered by Bun",
|
|
5
|
-
"main": "server/index.ts",
|
|
6
|
-
"bin": {
|
|
7
|
-
"flashts": "./bin/cli.ts"
|
|
8
|
-
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"react": "^
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"eslint
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
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(
|
|
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: "
|
|
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:
|
|
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(
|
|
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:
|
|
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(
|
|
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(
|
|
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
|
-
```
|