@react-spot/kit 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.
package/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # @react-spot/kit
2
+
3
+ `@react-spot/kit` is the batteries-included package for adding the React Trace inspector to an app without wiring plugins manually.
4
+
5
+ It ships a default `Trace` export that wraps `@react-spot/core` and preconfigures all official plugins.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pnpm add --dev @react-spot/kit
11
+ ```
12
+
13
+ Peer requirements:
14
+
15
+ - `react >= 18`
16
+ - `react-dom >= 18`
17
+
18
+ ## When to use this package
19
+
20
+ Use `@react-spot/kit` when you want the standard inspector setup with all official plugins already enabled.
21
+
22
+ If you need granular control over plugin composition, use `@react-spot/core` with individual `@react-spot/plugin-*` packages instead.
23
+
24
+ ## Default export
25
+
26
+ The package exports a default `Trace` component:
27
+
28
+ ```tsx
29
+ import Trace from '@react-spot/kit'
30
+
31
+ function AppShell() {
32
+ return <Trace root={import.meta.env.VITE_ROOT} />
33
+ }
34
+ ```
35
+
36
+ `root` should be the absolute path to your project root. The wrapper forwards it to `@react-spot/core` so bundled plugins can resolve files for preview, comments, copy-to-clipboard, and open-in-editor flows.
37
+
38
+ ## Bundled plugins
39
+
40
+ `@react-spot/kit` currently wires these official plugins in this order:
41
+
42
+ 1. `@react-spot/plugin-preview` — adds the source preview panel with inline Monaco-based file preview and editing support.
43
+ 2. `@react-spot/plugin-copy-to-clipboard` — adds an action-panel item for copying the selected source location.
44
+ 3. `@react-spot/plugin-open-editor` — adds an action-panel item for opening the selected source in your editor.
45
+ 4. `@react-spot/plugin-comments` — adds inline comments UI, including the comments toolbar and comment actions.
46
+
47
+ ## Props
48
+
49
+ The default export supports the following props today:
50
+
51
+ | Prop | Type | Default | Description |
52
+ | ----------------- | -------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------ |
53
+ | `root` | `string` | — | Required absolute path to the project root. |
54
+ | `position` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'bottom-right'` | Controls where the Trace widget is placed on screen. |
55
+ | `minimized` | `boolean` | `false` | Controls whether the widget starts minimized or not. |
56
+ | `editingDisabled` | `boolean` | `false` | Disables inline editing in the preview panel and hides the Save and expand controls. |
57
+ | `editor` | `EditorPreset` | `'vscode'` | Sets the default editor used by the Open in Editor action. |
58
+
59
+ `EditorPreset` currently supports these values:
60
+
61
+ - `vscode`
62
+ - `cursor`
63
+ - `windsurf`
64
+ - `zed`
65
+ - `webstorm`
66
+ - `intellij`
67
+
68
+ ## Example
69
+
70
+ Change your dev script to export the project root e.g.:
71
+
72
+ ```diff
73
+ - "dev": "vite"
74
+ + "dev": "VITE_ROOT=$(pwd) vite",
75
+ ```
76
+
77
+ Then add it next to your app:
78
+
79
+ ```tsx
80
+ import Trace from '@react-spot/kit'
81
+
82
+ import App from './App'
83
+
84
+ export function Root() {
85
+ return (
86
+ <>
87
+ <App />
88
+ <Trace
89
+ root={import.meta.env.VITE_ROOT}
90
+ position="bottom-left"
91
+ minimized
92
+ editor="cursor"
93
+ editingDisabled
94
+ />
95
+ </>
96
+ )
97
+ }
98
+ ```
99
+
100
+ ### Next.js with Turbopack
101
+
102
+ Expose the project root in your dev script:
103
+
104
+ ```diff
105
+ - "dev": "next dev --turbopack"
106
+ + "dev": "NEXT_PUBLIC_REACT_TRACE_ROOT=$(pwd) next dev --turbopack",
107
+ ```
108
+
109
+ Then mount Trace from a client component:
110
+
111
+ ```tsx
112
+ 'use client'
113
+
114
+ import Trace from '@react-spot/kit'
115
+
116
+ export function ReactTrace() {
117
+ return <Trace root={process.env.NEXT_PUBLIC_REACT_TRACE_ROOT ?? ''} />
118
+ }
119
+ ```
120
+
121
+ ## Exposed types
122
+
123
+ In addition to the default export, the package exports `TraceAllInOneProps` and re-exports `EditorPreset` for convenience.
package/dist/index.cjs ADDED
@@ -0,0 +1,21 @@
1
+ let _react_spot_core = require("@react-spot/core");
2
+ let react_jsx_runtime = require("react/jsx-runtime");
3
+
4
+ //#region src/index.tsx
5
+ /**
6
+ * Batteries-included Trace wrapper.
7
+ * Click any component to jump straight to its source in your editor.
8
+ *
9
+ * For granular control, use the individual `@react-spot/*` packages instead.
10
+ */
11
+ function Trace({ editor = "vscode", plugins = [], ...rest }) {
12
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_spot_core.Trace, {
13
+ ...rest,
14
+ editor,
15
+ plugins
16
+ });
17
+ }
18
+
19
+ //#endregion
20
+ module.exports = Trace;
21
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["CoreTrace"],"sources":["../src/index.tsx"],"sourcesContent":["import { Trace as CoreTrace } from '@react-spot/core'\nimport type { EditorPreset, TraceProps } from '@react-spot/core'\n\nexport interface TraceAllInOneProps extends TraceProps {\n /**\n * The editor to open files in when clicking a component.\n * @default 'vscode'\n */\n editor?: EditorPreset\n}\n\n/**\n * Batteries-included Trace wrapper.\n * Click any component to jump straight to its source in your editor.\n *\n * For granular control, use the individual `@react-spot/*` packages instead.\n */\nexport default function Trace({\n editor = 'vscode',\n plugins = [],\n ...rest\n}: TraceAllInOneProps) {\n return <CoreTrace {...rest} editor={editor} plugins={plugins} />\n}\n\nexport type { EditorPreset }\n"],"mappings":";;;;;;;;;;AAiBA,SAAwB,MAAM,EAC5B,SAAS,UACT,UAAU,EAAE,EACZ,GAAG,QACkB;AACrB,QAAO,2CAACA,wBAAD;EAAW,GAAI;EAAc;EAAiB;EAAW"}
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { EditorPreset, TraceProps } from "@react-spot/core";
3
+
4
+ //#region src/index.d.ts
5
+ interface TraceAllInOneProps extends TraceProps {
6
+ /**
7
+ * The editor to open files in when clicking a component.
8
+ * @default 'vscode'
9
+ */
10
+ editor?: EditorPreset;
11
+ }
12
+ /**
13
+ * Batteries-included Trace wrapper.
14
+ * Click any component to jump straight to its source in your editor.
15
+ *
16
+ * For granular control, use the individual `@react-spot/*` packages instead.
17
+ */
18
+ declare function Trace({
19
+ editor,
20
+ plugins,
21
+ ...rest
22
+ }: TraceAllInOneProps): react_jsx_runtime0.JSX.Element;
23
+ //#endregion
24
+ export { type EditorPreset, TraceAllInOneProps, Trace as default };
25
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;UAGiB,kBAAA,SAA2B,UAAA;;;AAA5C;;EAKE,MAAA,GAAS,YAAA;AAAA;;;;;;AACV;iBAQuB,KAAA,CAAA;EACtB,MAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,kBAAA,GAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -0,0 +1,25 @@
1
+ import { EditorPreset, TraceProps } from "@react-spot/core";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/index.d.ts
5
+ interface TraceAllInOneProps extends TraceProps {
6
+ /**
7
+ * The editor to open files in when clicking a component.
8
+ * @default 'vscode'
9
+ */
10
+ editor?: EditorPreset;
11
+ }
12
+ /**
13
+ * Batteries-included Trace wrapper.
14
+ * Click any component to jump straight to its source in your editor.
15
+ *
16
+ * For granular control, use the individual `@react-spot/*` packages instead.
17
+ */
18
+ declare function Trace({
19
+ editor,
20
+ plugins,
21
+ ...rest
22
+ }: TraceAllInOneProps): react_jsx_runtime0.JSX.Element;
23
+ //#endregion
24
+ export { type EditorPreset, TraceAllInOneProps, Trace as default };
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;UAGiB,kBAAA,SAA2B,UAAA;;;AAA5C;;EAKE,MAAA,GAAS,YAAA;AAAA;;;;;;AACV;iBAQuB,KAAA,CAAA;EACtB,MAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,kBAAA,GAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ import { Trace as Trace$1 } from "@react-spot/core";
2
+ import { jsx } from "react/jsx-runtime";
3
+
4
+ //#region src/index.tsx
5
+ /**
6
+ * Batteries-included Trace wrapper.
7
+ * Click any component to jump straight to its source in your editor.
8
+ *
9
+ * For granular control, use the individual `@react-spot/*` packages instead.
10
+ */
11
+ function Trace({ editor = "vscode", plugins = [], ...rest }) {
12
+ return /* @__PURE__ */ jsx(Trace$1, {
13
+ ...rest,
14
+ editor,
15
+ plugins
16
+ });
17
+ }
18
+
19
+ //#endregion
20
+ export { Trace as default };
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["CoreTrace"],"sources":["../src/index.tsx"],"sourcesContent":["import { Trace as CoreTrace } from '@react-spot/core'\nimport type { EditorPreset, TraceProps } from '@react-spot/core'\n\nexport interface TraceAllInOneProps extends TraceProps {\n /**\n * The editor to open files in when clicking a component.\n * @default 'vscode'\n */\n editor?: EditorPreset\n}\n\n/**\n * Batteries-included Trace wrapper.\n * Click any component to jump straight to its source in your editor.\n *\n * For granular control, use the individual `@react-spot/*` packages instead.\n */\nexport default function Trace({\n editor = 'vscode',\n plugins = [],\n ...rest\n}: TraceAllInOneProps) {\n return <CoreTrace {...rest} editor={editor} plugins={plugins} />\n}\n\nexport type { EditorPreset }\n"],"mappings":";;;;;;;;;;AAiBA,SAAwB,MAAM,EAC5B,SAAS,UACT,UAAU,EAAE,EACZ,GAAG,QACkB;AACrB,QAAO,oBAACA,SAAD;EAAW,GAAI;EAAc;EAAiB;EAAW"}
@@ -0,0 +1,11 @@
1
+
2
+ //#region src/index.prod.ts
3
+ /**
4
+ * Production stub — Trace renders nothing in production builds.
5
+ * Zero runtime cost, zero bundle size impact.
6
+ */
7
+ const Trace = () => null;
8
+
9
+ //#endregion
10
+ module.exports = Trace;
11
+ //# sourceMappingURL=index.prod.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.cjs","names":[],"sources":["../src/index.prod.ts"],"sourcesContent":["/**\n * Production stub — Trace renders nothing in production builds.\n * Zero runtime cost, zero bundle size impact.\n */\nconst Trace = () => null\nexport default Trace\n\nexport type { TraceAllInOneProps, EditorPreset } from './index'\n"],"mappings":";;;;;;AAIA,MAAM,cAAc"}
@@ -0,0 +1,11 @@
1
+ import { EditorPreset, TraceAllInOneProps } from "./index.cjs";
2
+
3
+ //#region src/index.prod.d.ts
4
+ /**
5
+ * Production stub — Trace renders nothing in production builds.
6
+ * Zero runtime cost, zero bundle size impact.
7
+ */
8
+ declare const Trace: () => null;
9
+ //#endregion
10
+ export { type EditorPreset, type TraceAllInOneProps, Trace as default };
11
+ //# sourceMappingURL=index.prod.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.d.cts","names":[],"sources":["../src/index.prod.ts"],"mappings":";;;;;;;cAIM,KAAA"}
@@ -0,0 +1,11 @@
1
+ import { EditorPreset, TraceAllInOneProps } from "./index.js";
2
+
3
+ //#region src/index.prod.d.ts
4
+ /**
5
+ * Production stub — Trace renders nothing in production builds.
6
+ * Zero runtime cost, zero bundle size impact.
7
+ */
8
+ declare const Trace: () => null;
9
+ //#endregion
10
+ export { type EditorPreset, type TraceAllInOneProps, Trace as default };
11
+ //# sourceMappingURL=index.prod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.d.ts","names":[],"sources":["../src/index.prod.ts"],"mappings":";;;;;;;cAIM,KAAA"}
@@ -0,0 +1,10 @@
1
+ //#region src/index.prod.ts
2
+ /**
3
+ * Production stub — Trace renders nothing in production builds.
4
+ * Zero runtime cost, zero bundle size impact.
5
+ */
6
+ const Trace = () => null;
7
+
8
+ //#endregion
9
+ export { Trace as default };
10
+ //# sourceMappingURL=index.prod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.prod.js","names":[],"sources":["../src/index.prod.ts"],"sourcesContent":["/**\n * Production stub — Trace renders nothing in production builds.\n * Zero runtime cost, zero bundle size impact.\n */\nconst Trace = () => null\nexport default Trace\n\nexport type { TraceAllInOneProps, EditorPreset } from './index'\n"],"mappings":";;;;;AAIA,MAAM,cAAc"}
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "@react-spot/kit",
3
+ "version": "0.0.1",
4
+ "description": "Batteries-included React visual inspector — all official plugins pre-wired.",
5
+ "keywords": [
6
+ "react-find",
7
+ "react-find-source",
8
+ "react-grab",
9
+ "react-inspect",
10
+ "react-inspector",
11
+ "react-trace"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "Vitor Buzinaro",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/buzinas/react-trace",
18
+ "directory": "packages/react-trace"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "type": "module",
24
+ "main": "./dist/index.cjs",
25
+ "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "development": {
30
+ "import": {
31
+ "types": "./dist/index.d.ts",
32
+ "default": "./dist/index.js"
33
+ },
34
+ "require": {
35
+ "types": "./dist/index.d.cts",
36
+ "default": "./dist/index.cjs"
37
+ }
38
+ },
39
+ "production": {
40
+ "import": {
41
+ "types": "./dist/index.d.ts",
42
+ "default": "./dist/index.prod.js"
43
+ },
44
+ "require": {
45
+ "types": "./dist/index.d.cts",
46
+ "default": "./dist/index.prod.cjs"
47
+ }
48
+ },
49
+ "default": {
50
+ "import": {
51
+ "types": "./dist/index.d.ts",
52
+ "default": "./dist/index.js"
53
+ },
54
+ "require": {
55
+ "types": "./dist/index.d.cts",
56
+ "default": "./dist/index.cjs"
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "publishConfig": {
62
+ "access": "public"
63
+ },
64
+ "scripts": {
65
+ "build": "tsdown",
66
+ "dev": "tsdown --watch --no-clean",
67
+ "typecheck": "tsc --noEmit",
68
+ "lint": "oxlint src",
69
+ "prepublishOnly": "pnpm build"
70
+ },
71
+ "dependencies": {
72
+ "@react-spot/core": "^0.0.1",
73
+ "@react-spot/plugin-comments": "^0.0.1",
74
+ "@react-spot/plugin-copy-to-clipboard": "^0.0.1",
75
+ "@react-spot/plugin-open-editor": "^0.0.1",
76
+ "@react-spot/plugin-preview": "^0.0.1"
77
+ },
78
+ "devDependencies": {
79
+ "@types/react": "^19",
80
+ "@types/react-dom": "^19",
81
+ "oxlint": "latest",
82
+ "react": "^19",
83
+ "react-dom": "^19",
84
+ "tsdown": "^0.21.0-beta.2",
85
+ "typescript": "^5"
86
+ },
87
+ "peerDependencies": {
88
+ "react": ">=18",
89
+ "react-dom": ">=18"
90
+ }
91
+ }