@react-trace-enhancer/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-trace-enhancer/kit
2
+
3
+ `@react-trace-enhancer/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-trace-enhancer/core` and preconfigures all official plugins.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pnpm add --dev @react-trace-enhancer/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-trace-enhancer/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-trace-enhancer/core` with individual `@react-trace-enhancer/plugin-*` packages instead.
23
+
24
+ ## Default export
25
+
26
+ The package exports a default `Trace` component:
27
+
28
+ ```tsx
29
+ import Trace from '@react-trace-enhancer/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-trace-enhancer/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-trace-enhancer/kit` currently wires these official plugins in this order:
41
+
42
+ 1. `@react-trace-enhancer/plugin-preview` — adds the source preview panel with inline Monaco-based file preview and editing support.
43
+ 2. `@react-trace-enhancer/plugin-copy-to-clipboard` — adds an action-panel item for copying the selected source location.
44
+ 3. `@react-trace-enhancer/plugin-open-editor` — adds an action-panel item for opening the selected source in your editor.
45
+ 4. `@react-trace-enhancer/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-trace-enhancer/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-trace-enhancer/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,33 @@
1
+ let _react_trace_enhancer_core = require("@react-trace-enhancer/core");
2
+ let _react_trace_enhancer_plugin_comments = require("@react-trace-enhancer/plugin-comments");
3
+ let _react_trace_enhancer_plugin_copy_to_clipboard = require("@react-trace-enhancer/plugin-copy-to-clipboard");
4
+ let _react_trace_enhancer_plugin_open_editor = require("@react-trace-enhancer/plugin-open-editor");
5
+ let _react_trace_enhancer_plugin_preview = require("@react-trace-enhancer/plugin-preview");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+
8
+ //#region src/index.tsx
9
+ /**
10
+ * Batteries-included Trace with all official plugins pre-wired:
11
+ * - preview (inline Monaco editor)
12
+ * - copy-to-clipboard
13
+ * - open-editor
14
+ * - comments (with Send to OpenCode)
15
+ *
16
+ * For granular control, use the individual `@react-trace-enhancer/*` packages instead.
17
+ */
18
+ function Trace({ editingDisabled = false, editor = "vscode", plugins = [], ...rest }) {
19
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_trace_enhancer_core.Trace, {
20
+ ...rest,
21
+ plugins: [
22
+ (0, _react_trace_enhancer_plugin_preview.PreviewPlugin)({ disabled: editingDisabled }),
23
+ (0, _react_trace_enhancer_plugin_copy_to_clipboard.CopyToClipboardPlugin)(),
24
+ (0, _react_trace_enhancer_plugin_open_editor.OpenEditorPlugin)({ editor }),
25
+ (0, _react_trace_enhancer_plugin_comments.CommentsPlugin)(),
26
+ ...plugins
27
+ ]
28
+ });
29
+ }
30
+
31
+ //#endregion
32
+ module.exports = Trace;
33
+ //# 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-trace-enhancer/core'\nimport type { TraceProps } from '@react-trace-enhancer/core'\nimport { CommentsPlugin } from '@react-trace-enhancer/plugin-comments'\nimport { CopyToClipboardPlugin } from '@react-trace-enhancer/plugin-copy-to-clipboard'\nimport { OpenEditorPlugin } from '@react-trace-enhancer/plugin-open-editor'\nimport type { EditorPreset } from '@react-trace-enhancer/plugin-open-editor'\nimport { PreviewPlugin } from '@react-trace-enhancer/plugin-preview'\n\nexport interface TraceAllInOneProps extends TraceProps {\n /**\n * Disable inline file editing in the preview panel.\n * Hides the Save button (⌘S) and the expand button.\n * @default false\n */\n editingDisabled?: boolean\n /**\n * The editor to open files in via the \"Open in Editor\" action.\n * @default 'vscode'\n */\n editor?: EditorPreset\n}\n\n/**\n * Batteries-included Trace with all official plugins pre-wired:\n * - preview (inline Monaco editor)\n * - copy-to-clipboard\n * - open-editor\n * - comments (with Send to OpenCode)\n *\n * For granular control, use the individual `@react-trace-enhancer/*` packages instead.\n */\nexport default function Trace({\n editingDisabled = false,\n editor = 'vscode',\n plugins = [],\n ...rest\n}: TraceAllInOneProps) {\n return (\n <CoreTrace\n {...rest}\n plugins={[\n PreviewPlugin({ disabled: editingDisabled }),\n CopyToClipboardPlugin(),\n OpenEditorPlugin({ editor }),\n CommentsPlugin(),\n ...plugins,\n ]}\n />\n )\n}\n\n// Re-export useful types for consumers\nexport type { EditorPreset }\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,SAAwB,MAAM,EAC5B,kBAAkB,OAClB,SAAS,UACT,UAAU,EAAE,EACZ,GAAG,QACkB;AACrB,QACE,2CAACA,kCAAD;EACE,GAAI;EACJ,SAAS;2DACO,EAAE,UAAU,iBAAiB,CAAC;8EACrB;kEACN,EAAE,QAAQ,CAAC;8DACZ;GAChB,GAAG;GACJ;EACD"}
@@ -0,0 +1,36 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { TraceProps } from "@react-trace-enhancer/core";
3
+ import { EditorPreset } from "@react-trace-enhancer/plugin-open-editor";
4
+
5
+ //#region src/index.d.ts
6
+ interface TraceAllInOneProps extends TraceProps {
7
+ /**
8
+ * Disable inline file editing in the preview panel.
9
+ * Hides the Save button (⌘S) and the expand button.
10
+ * @default false
11
+ */
12
+ editingDisabled?: boolean;
13
+ /**
14
+ * The editor to open files in via the "Open in Editor" action.
15
+ * @default 'vscode'
16
+ */
17
+ editor?: EditorPreset;
18
+ }
19
+ /**
20
+ * Batteries-included Trace with all official plugins pre-wired:
21
+ * - preview (inline Monaco editor)
22
+ * - copy-to-clipboard
23
+ * - open-editor
24
+ * - comments (with Send to OpenCode)
25
+ *
26
+ * For granular control, use the individual `@react-trace-enhancer/*` packages instead.
27
+ */
28
+ declare function Trace({
29
+ editingDisabled,
30
+ editor,
31
+ plugins,
32
+ ...rest
33
+ }: TraceAllInOneProps): react_jsx_runtime0.JSX.Element;
34
+ //#endregion
35
+ export { type EditorPreset, TraceAllInOneProps, Trace as default };
36
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;UAQiB,kBAAA,SAA2B,UAAA;;;AAA5C;;;EAME,eAAA;EAN0C;;;;EAW1C,MAAA,GAAS,YAAA;AAAA;AACV;;;;;;;;;AAAA,iBAWuB,KAAA,CAAA;EACtB,eAAA;EACA,MAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,kBAAA,GAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -0,0 +1,36 @@
1
+ import { TraceProps } from "@react-trace-enhancer/core";
2
+ import { EditorPreset } from "@react-trace-enhancer/plugin-open-editor";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/index.d.ts
6
+ interface TraceAllInOneProps extends TraceProps {
7
+ /**
8
+ * Disable inline file editing in the preview panel.
9
+ * Hides the Save button (⌘S) and the expand button.
10
+ * @default false
11
+ */
12
+ editingDisabled?: boolean;
13
+ /**
14
+ * The editor to open files in via the "Open in Editor" action.
15
+ * @default 'vscode'
16
+ */
17
+ editor?: EditorPreset;
18
+ }
19
+ /**
20
+ * Batteries-included Trace with all official plugins pre-wired:
21
+ * - preview (inline Monaco editor)
22
+ * - copy-to-clipboard
23
+ * - open-editor
24
+ * - comments (with Send to OpenCode)
25
+ *
26
+ * For granular control, use the individual `@react-trace-enhancer/*` packages instead.
27
+ */
28
+ declare function Trace({
29
+ editingDisabled,
30
+ editor,
31
+ plugins,
32
+ ...rest
33
+ }: TraceAllInOneProps): react_jsx_runtime0.JSX.Element;
34
+ //#endregion
35
+ export { type EditorPreset, TraceAllInOneProps, Trace as default };
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;UAQiB,kBAAA,SAA2B,UAAA;;;AAA5C;;;EAME,eAAA;EAN0C;;;;EAW1C,MAAA,GAAS,YAAA;AAAA;AACV;;;;;;;;;AAAA,iBAWuB,KAAA,CAAA;EACtB,eAAA;EACA,MAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,kBAAA,GAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ import { Trace as Trace$1 } from "@react-trace-enhancer/core";
2
+ import { CommentsPlugin } from "@react-trace-enhancer/plugin-comments";
3
+ import { CopyToClipboardPlugin } from "@react-trace-enhancer/plugin-copy-to-clipboard";
4
+ import { OpenEditorPlugin } from "@react-trace-enhancer/plugin-open-editor";
5
+ import { PreviewPlugin } from "@react-trace-enhancer/plugin-preview";
6
+ import { jsx } from "react/jsx-runtime";
7
+
8
+ //#region src/index.tsx
9
+ /**
10
+ * Batteries-included Trace with all official plugins pre-wired:
11
+ * - preview (inline Monaco editor)
12
+ * - copy-to-clipboard
13
+ * - open-editor
14
+ * - comments (with Send to OpenCode)
15
+ *
16
+ * For granular control, use the individual `@react-trace-enhancer/*` packages instead.
17
+ */
18
+ function Trace({ editingDisabled = false, editor = "vscode", plugins = [], ...rest }) {
19
+ return /* @__PURE__ */ jsx(Trace$1, {
20
+ ...rest,
21
+ plugins: [
22
+ PreviewPlugin({ disabled: editingDisabled }),
23
+ CopyToClipboardPlugin(),
24
+ OpenEditorPlugin({ editor }),
25
+ CommentsPlugin(),
26
+ ...plugins
27
+ ]
28
+ });
29
+ }
30
+
31
+ //#endregion
32
+ export { Trace as default };
33
+ //# 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-trace-enhancer/core'\nimport type { TraceProps } from '@react-trace-enhancer/core'\nimport { CommentsPlugin } from '@react-trace-enhancer/plugin-comments'\nimport { CopyToClipboardPlugin } from '@react-trace-enhancer/plugin-copy-to-clipboard'\nimport { OpenEditorPlugin } from '@react-trace-enhancer/plugin-open-editor'\nimport type { EditorPreset } from '@react-trace-enhancer/plugin-open-editor'\nimport { PreviewPlugin } from '@react-trace-enhancer/plugin-preview'\n\nexport interface TraceAllInOneProps extends TraceProps {\n /**\n * Disable inline file editing in the preview panel.\n * Hides the Save button (⌘S) and the expand button.\n * @default false\n */\n editingDisabled?: boolean\n /**\n * The editor to open files in via the \"Open in Editor\" action.\n * @default 'vscode'\n */\n editor?: EditorPreset\n}\n\n/**\n * Batteries-included Trace with all official plugins pre-wired:\n * - preview (inline Monaco editor)\n * - copy-to-clipboard\n * - open-editor\n * - comments (with Send to OpenCode)\n *\n * For granular control, use the individual `@react-trace-enhancer/*` packages instead.\n */\nexport default function Trace({\n editingDisabled = false,\n editor = 'vscode',\n plugins = [],\n ...rest\n}: TraceAllInOneProps) {\n return (\n <CoreTrace\n {...rest}\n plugins={[\n PreviewPlugin({ disabled: editingDisabled }),\n CopyToClipboardPlugin(),\n OpenEditorPlugin({ editor }),\n CommentsPlugin(),\n ...plugins,\n ]}\n />\n )\n}\n\n// Re-export useful types for consumers\nexport type { EditorPreset }\n"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,SAAwB,MAAM,EAC5B,kBAAkB,OAClB,SAAS,UACT,UAAU,EAAE,EACZ,GAAG,QACkB;AACrB,QACE,oBAACA,SAAD;EACE,GAAI;EACJ,SAAS;GACP,cAAc,EAAE,UAAU,iBAAiB,CAAC;GAC5C,uBAAuB;GACvB,iBAAiB,EAAE,QAAQ,CAAC;GAC5B,gBAAgB;GAChB,GAAG;GACJ;EACD"}
@@ -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-trace-enhancer/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-trace-enhancer/core": "^0.0.1",
73
+ "@react-trace-enhancer/plugin-comments": "^0.0.1",
74
+ "@react-trace-enhancer/plugin-copy-to-clipboard": "^0.0.1",
75
+ "@react-trace-enhancer/plugin-open-editor": "^0.0.1",
76
+ "@react-trace-enhancer/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
+ }