typeslayer 0.0.0 → 0.1.0
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 +53 -0
- package/bin/typeslayer.js +69 -0
- package/package.json +96 -7
- package/index.js +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="./src/assets/typeslayer-nightmare.png">
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<p align="center">
|
|
7
|
+
a tool for diagnosing and fixing TypeScript performance problems
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
## Quickstart
|
|
11
|
+
|
|
12
|
+
run:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx typeslayer
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
in the root package you want to inspect (i.e. colocated to your package.json). The tool will:
|
|
19
|
+
|
|
20
|
+
1. start a local web UI,
|
|
21
|
+
2. run TypeScript tooling to produce traces and CPU profiles
|
|
22
|
+
3. provide interactive visualizations (treemaps, force graphs, speedscope/perfetto views) that you can use to identify problems
|
|
23
|
+
|
|
24
|
+
## Frequently Asked Questions
|
|
25
|
+
|
|
26
|
+
- will this ever get CI support for analysis file generation?
|
|
27
|
+
- yeah prolly eventually.
|
|
28
|
+
- will this support monorepos?
|
|
29
|
+
- that's the hope. one step at a time.
|
|
30
|
+
- why isn't this just a CLI tool?
|
|
31
|
+
- A goal of the project is show intuitive/beautiful interactive visualizations like treemaps and force graphs, inherently not something a terminal can provide.
|
|
32
|
+
- I don't like CLI tools. I view them as a last resort, at this point in engineering history. If you're someone that stays up late into the night staring at your dotfiles from neovim... I'm happy for you. Be happy for me too?
|
|
33
|
+
|
|
34
|
+
## Data / Security
|
|
35
|
+
|
|
36
|
+
TypeSlayer supports Linux x64, macOS x64 (Intel), macOS ARM64 (Apple Silicon), and Windows x64. Please note that next year is the year of the Linux desktop.
|
|
37
|
+
|
|
38
|
+
TypeSlayer currently does not collect any analytics - although it probably will try to collect "someone somewhere ran it at XYZ timestamp" data in the future. All data is stored:
|
|
39
|
+
|
|
40
|
+
- Linux: `~/.local/share/typeslayer/`
|
|
41
|
+
- macOS: `~/Library/Application Support/typeslayer/`
|
|
42
|
+
- Windows: `%APPDATA%\typeslayer\`
|
|
43
|
+
|
|
44
|
+
This tool can read any file the running user can read and it can run package.json scripts (so treat it as you would your terminal).
|
|
45
|
+
|
|
46
|
+
## Contributing
|
|
47
|
+
|
|
48
|
+
1. all commits (and therefor PR merges) must be the next bar from "My Name Is" by Eminem, until further notice
|
|
49
|
+
2. no further requirements
|
|
50
|
+
|
|
51
|
+
## Thank You
|
|
52
|
+
|
|
53
|
+
This app is built with Tauri, TanStack, Vite, React, MUI, and of course, TypeScript.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { arch, platform } from "node:os";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
|
|
12
|
+
// Store the original directory where the user ran the command
|
|
13
|
+
const userCwd = process.cwd();
|
|
14
|
+
|
|
15
|
+
// Get the binary path based on platform
|
|
16
|
+
const getBinaryInfo = () => {
|
|
17
|
+
const plat = platform();
|
|
18
|
+
const architecture = arch();
|
|
19
|
+
|
|
20
|
+
let platformDir, binaryName;
|
|
21
|
+
|
|
22
|
+
if (plat === "linux" && architecture === "x64") {
|
|
23
|
+
platformDir = "linux-x64";
|
|
24
|
+
binaryName = "typeslayer";
|
|
25
|
+
} else if (plat === "darwin" && architecture === "x64") {
|
|
26
|
+
platformDir = "darwin-x64";
|
|
27
|
+
binaryName = "typeslayer";
|
|
28
|
+
} else if (plat === "darwin" && architecture === "arm64") {
|
|
29
|
+
platformDir = "darwin-arm64";
|
|
30
|
+
binaryName = "typeslayer";
|
|
31
|
+
} else if (plat === "win32" && architecture === "x64") {
|
|
32
|
+
platformDir = "win32-x64";
|
|
33
|
+
binaryName = "typeslayer.exe";
|
|
34
|
+
} else {
|
|
35
|
+
throw new Error(`Unsupported platform: ${plat}-${architecture}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
path: join(__dirname, "..", "binaries", platformDir, binaryName),
|
|
40
|
+
platform: `${plat}-${architecture}`,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const binaryInfo = getBinaryInfo();
|
|
46
|
+
|
|
47
|
+
if (!existsSync(binaryInfo.path)) {
|
|
48
|
+
console.error(`\n❌ Binary not available for ${binaryInfo.platform}`);
|
|
49
|
+
console.error(
|
|
50
|
+
`\nYour platform (${binaryInfo.platform}) is not yet supported.`,
|
|
51
|
+
);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const proc = spawn(binaryInfo.path, [], {
|
|
56
|
+
stdio: "inherit",
|
|
57
|
+
env: {
|
|
58
|
+
...process.env,
|
|
59
|
+
USER_CWD: userCwd,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
proc.on("exit", (code) => {
|
|
64
|
+
process.exit(code || 0);
|
|
65
|
+
});
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error("Error:", error.message);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,98 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"name": "typeslayer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Slay your TypeScript types",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"typescript",
|
|
9
|
+
"ts",
|
|
10
|
+
"tauri",
|
|
11
|
+
"desktop",
|
|
12
|
+
"benchmarking",
|
|
13
|
+
"performance"
|
|
14
|
+
],
|
|
15
|
+
"author": "Dimitri Mitropoulos",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/dimitropoulos/typeslayer.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/dimitropoulos/typeslayer/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/dimitropoulos/typeslayer#readme",
|
|
25
|
+
"bin": {
|
|
26
|
+
"typeslayer": "bin/typeslayer.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"bin",
|
|
30
|
+
"binaries"
|
|
31
|
+
],
|
|
32
|
+
"os": [
|
|
33
|
+
"linux",
|
|
34
|
+
"darwin",
|
|
35
|
+
"win32"
|
|
36
|
+
],
|
|
37
|
+
"cpu": [
|
|
38
|
+
"x64",
|
|
39
|
+
"arm64"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=24.0.0",
|
|
43
|
+
"pnpm": ">=10.0.0"
|
|
44
|
+
},
|
|
45
|
+
"packageManager": "pnpm@10.6.5",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "vite",
|
|
48
|
+
"build": "tsc && vite build",
|
|
49
|
+
"preview": "vite preview",
|
|
50
|
+
"tauri": "tauri"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@tauri-apps/api": "2.9.0",
|
|
54
|
+
"@tauri-apps/plugin-clipboard-manager": "~2",
|
|
55
|
+
"@tauri-apps/plugin-dialog": "2.4.2",
|
|
56
|
+
"@tauri-apps/plugin-opener": "2.5.2",
|
|
57
|
+
"@tauri-apps/plugin-upload": "^2.3.2",
|
|
58
|
+
"react": "19.2.0",
|
|
59
|
+
"react-dom": "19.2.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@emotion/react": "11.14.0",
|
|
63
|
+
"@emotion/styled": "11.14.1",
|
|
64
|
+
"@fastify/cors": "11.1.0",
|
|
65
|
+
"@fastify/static": "8.3.0",
|
|
66
|
+
"@fontsource/roboto": "5.2.9",
|
|
67
|
+
"@mui/icons-material": "7.3.5",
|
|
68
|
+
"@mui/material": "7.3.5",
|
|
69
|
+
"@mui/x-tree-view": "8.19.0",
|
|
70
|
+
"@tanstack/react-query": "5.90.10",
|
|
71
|
+
"@tanstack/react-router": "1.139.3",
|
|
72
|
+
"@tauri-apps/cli": "2.9.4",
|
|
73
|
+
"@types/mime-types": "3.0.1",
|
|
74
|
+
"@types/node": "24.10.1",
|
|
75
|
+
"@types/ramda": "0.31.1",
|
|
76
|
+
"@types/react": "19.2.6",
|
|
77
|
+
"@types/react-dom": "19.2.3",
|
|
78
|
+
"@typeslayer/analyze-trace": "workspace:*",
|
|
79
|
+
"@typeslayer/validate": "workspace:*",
|
|
80
|
+
"@vitejs/plugin-react": "5.1.1",
|
|
81
|
+
"concurrently": "9.2.1",
|
|
82
|
+
"fastify": "5.6.2",
|
|
83
|
+
"mime-types": "3.0.2",
|
|
84
|
+
"ramda": "0.32.0",
|
|
85
|
+
"ramda-adjunct": "5.1.0",
|
|
86
|
+
"react": "19.2.0",
|
|
87
|
+
"react-dom": "19.2.0",
|
|
88
|
+
"tsx": "4.20.6",
|
|
89
|
+
"typescript": "5.9.3",
|
|
90
|
+
"vite": "7.2.4",
|
|
91
|
+
"zod": "4.1.12"
|
|
92
|
+
},
|
|
93
|
+
"pnpm": {
|
|
94
|
+
"onlyBuiltDependencies": [
|
|
95
|
+
"esbuild"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
9
98
|
}
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log('typeslayer');
|