beast-devtools 0.0.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.
Files changed (47) hide show
  1. package/.claude/launch.json +11 -0
  2. package/CHANGELOG.md +37 -0
  3. package/README.md +87 -0
  4. package/devtools/CHANGELOG.md +26 -0
  5. package/devtools/LICENSE +15 -0
  6. package/devtools/README.md +164 -0
  7. package/devtools/client/BeastDevtools.btsx +185 -0
  8. package/devtools/client/CodeView.btsx +61 -0
  9. package/devtools/client/ComponentsPanel.btsx +212 -0
  10. package/devtools/client/FileList.btsx +35 -0
  11. package/devtools/client/InspectorPanel.btsx +131 -0
  12. package/devtools/client/RefactorPanel.btsx +304 -0
  13. package/devtools/client/api.ts +69 -0
  14. package/devtools/client/compile.test.ts +22 -0
  15. package/devtools/client/devtools.css +1279 -0
  16. package/devtools/client/highlight.ts +210 -0
  17. package/devtools/client/mount.ts +16 -0
  18. package/devtools/client/runtime.ts +168 -0
  19. package/devtools/client/util.ts +136 -0
  20. package/devtools/package.json +73 -0
  21. package/devtools/server/analyze.test.ts +148 -0
  22. package/devtools/server/analyze.ts +737 -0
  23. package/devtools/server/diff.ts +82 -0
  24. package/devtools/server/line-map.ts +63 -0
  25. package/devtools/server/octane-bundler.d.ts +17 -0
  26. package/devtools/server/project.ts +369 -0
  27. package/devtools/server/refactor.test.ts +224 -0
  28. package/devtools/server/refactor.ts +224 -0
  29. package/devtools/server/source-scan.ts +377 -0
  30. package/devtools/shared/types.ts +208 -0
  31. package/devtools/test/fixtures/App.btsx +193 -0
  32. package/devtools/tsconfig.build.json +17 -0
  33. package/devtools/vite.ts +159 -0
  34. package/favicon.ico +0 -0
  35. package/index.html +14 -0
  36. package/package.json +34 -0
  37. package/public/beast.svg +1 -0
  38. package/src/App.btsx +144 -0
  39. package/src/AppHeader.btsx +24 -0
  40. package/src/LeftArticle.btsx +22 -0
  41. package/src/RightArticle.btsx +19 -0
  42. package/src/env.d.ts +8 -0
  43. package/src/lib/utils.ts +6 -0
  44. package/src/main.ts +8 -0
  45. package/src/style.css +44 -0
  46. package/tsconfig.json +39 -0
  47. package/vite.config.ts +19 -0
package/src/main.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { createRoot } from 'octane'
2
+ import App from './App.btsx'
3
+ import './style.css'
4
+
5
+ const container = document.getElementById('app')
6
+ if (container === null) throw new Error('Missing #app container.')
7
+
8
+ createRoot(container).render(App, { docsUrl: 'https://beast-docs.vercel.app' })
package/src/style.css ADDED
@@ -0,0 +1,44 @@
1
+ @import 'tailwindcss';
2
+ /* The Beast DevTools overlay ships its own prefixed styles. */
3
+ @source not "../devtools";
4
+
5
+ @theme {
6
+ --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
7
+ }
8
+
9
+ :root {
10
+ color: #161616;
11
+ background: #ececeb;
12
+ font-family: var(--font-sans);
13
+ font-synthesis: none;
14
+ text-rendering: optimizeLegibility;
15
+ }
16
+
17
+ * {
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ html {
22
+ -webkit-font-smoothing: antialiased;
23
+ }
24
+
25
+ body {
26
+ min-width: 320px;
27
+ min-height: 100vh;
28
+ margin: 0;
29
+ background: radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.92), transparent 34rem), #ececeb;
30
+ }
31
+
32
+ button,
33
+ a {
34
+ font: inherit;
35
+ }
36
+
37
+ @media (prefers-reduced-motion: reduce) {
38
+ *,
39
+ *::before,
40
+ *::after {
41
+ scroll-behavior: auto !important;
42
+ transition-duration: 0.01ms !important;
43
+ }
44
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "Bundler",
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "allowImportingTsExtensions": true,
10
+ "skipLibCheck": true,
11
+ "jsx": "preserve",
12
+ "types": [
13
+ "vite/client",
14
+ "node"
15
+ ],
16
+ "baseUrl": ".",
17
+ "paths": {
18
+ "@/*": [
19
+ "./src/*"
20
+ ]
21
+ },
22
+ "plugins": [
23
+ {
24
+ "name": "@tsrx/typescript-plugin"
25
+ }
26
+ ]
27
+ },
28
+ "include": [
29
+ "src",
30
+ "devtools",
31
+ "vite.config.ts"
32
+ ],
33
+ "tsrx": {
34
+ "compiler": "octane"
35
+ },
36
+ "exclude": [
37
+ "devtools/**/*.test.ts"
38
+ ]
39
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import tailwindcss from "@tailwindcss/vite";
3
+ import { beastOctane } from "beast-tsrx/vite";
4
+ import { defineConfig } from "vite";
5
+ import { beastDevtools } from "@beastjs/devtools";
6
+
7
+ export default defineConfig({
8
+ resolve: {
9
+ alias: {
10
+ "@": fileURLToPath(new URL("./src", import.meta.url)),
11
+ },
12
+ },
13
+ plugins: [
14
+ tailwindcss(),
15
+ // `profile: 'auto'` compiles Octane's runtime inspection hook into dev builds only.
16
+ beastOctane({ octane: { profile: "auto" } }),
17
+ beastDevtools(),
18
+ ],
19
+ });