@tanstack/react-devtools 0.0.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/LICENSE +21 -0
- package/dist/cjs/devtools.cjs +20 -0
- package/dist/cjs/devtools.cjs.map +1 -0
- package/dist/cjs/devtools.d.cts +3 -0
- package/dist/cjs/index.cjs +12 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +5 -0
- package/dist/esm/devtools.d.ts +3 -0
- package/dist/esm/devtools.js +20 -0
- package/dist/esm/devtools.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +77 -0
- package/src/devtools.tsx +19 -0
- package/src/index.ts +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 TanStack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const devtools = require("@tanstack/devtools");
|
|
6
|
+
const Devtools = (opts) => {
|
|
7
|
+
const devToolRef = react.useRef(null);
|
|
8
|
+
const [devtools$1] = react.useState(() => new devtools.TanStackRouterDevtoolsCore(opts));
|
|
9
|
+
react.useEffect(() => {
|
|
10
|
+
if (devToolRef.current) {
|
|
11
|
+
devtools$1.mount(devToolRef.current);
|
|
12
|
+
}
|
|
13
|
+
return () => {
|
|
14
|
+
devtools$1.unmount();
|
|
15
|
+
};
|
|
16
|
+
}, [devtools$1]);
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: devToolRef });
|
|
18
|
+
};
|
|
19
|
+
exports.Devtools = Devtools;
|
|
20
|
+
//# sourceMappingURL=devtools.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools.cjs","sources":["../../src/devtools.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport { TanStackRouterDevtoolsCore } from '@tanstack/devtools'\nimport type { DevtoolsOptions } from '@tanstack/devtools'\n\nexport const Devtools = (opts: DevtoolsOptions) => {\n const devToolRef = useRef<HTMLDivElement>(null)\n const [devtools] = useState(() => new TanStackRouterDevtoolsCore(opts))\n useEffect(() => {\n if (devToolRef.current) {\n devtools.mount(devToolRef.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div ref={devToolRef} />\n}\n"],"names":["useRef","devtools","useState","TanStackRouterDevtoolsCore","useEffect","jsx"],"mappings":";;;;;AAIa,MAAA,WAAW,CAAC,SAA0B;AAC3C,QAAA,aAAaA,aAAuB,IAAI;AACxC,QAAA,CAACC,UAAQ,IAAIC,MAAAA,SAAS,MAAM,IAAIC,SAAAA,2BAA2B,IAAI,CAAC;AACtEC,QAAAA,UAAU,MAAM;AACd,QAAI,WAAW,SAAS;AACbH,iBAAA,MAAM,WAAW,OAAO;AAAA,IAAA;AAGnC,WAAO,MAAM;AACXA,iBAAS,QAAQ;AAAA,IACnB;AAAA,EAAA,GACC,CAACA,UAAQ,CAAC;AAEN,SAAAI,2BAAA,IAAC,OAAI,EAAA,KAAK,WAAY,CAAA;AAC/B;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const devtools$1 = require("@tanstack/devtools");
|
|
4
|
+
const devtools = require("./devtools.cjs");
|
|
5
|
+
exports.Devtools = devtools.Devtools;
|
|
6
|
+
Object.keys(devtools$1).forEach((k) => {
|
|
7
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: () => devtools$1[k]
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from "react";
|
|
3
|
+
import { TanStackRouterDevtoolsCore } from "@tanstack/devtools";
|
|
4
|
+
const Devtools = (opts) => {
|
|
5
|
+
const devToolRef = useRef(null);
|
|
6
|
+
const [devtools] = useState(() => new TanStackRouterDevtoolsCore(opts));
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (devToolRef.current) {
|
|
9
|
+
devtools.mount(devToolRef.current);
|
|
10
|
+
}
|
|
11
|
+
return () => {
|
|
12
|
+
devtools.unmount();
|
|
13
|
+
};
|
|
14
|
+
}, [devtools]);
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { ref: devToolRef });
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
Devtools
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=devtools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools.js","sources":["../../src/devtools.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport { TanStackRouterDevtoolsCore } from '@tanstack/devtools'\nimport type { DevtoolsOptions } from '@tanstack/devtools'\n\nexport const Devtools = (opts: DevtoolsOptions) => {\n const devToolRef = useRef<HTMLDivElement>(null)\n const [devtools] = useState(() => new TanStackRouterDevtoolsCore(opts))\n useEffect(() => {\n if (devToolRef.current) {\n devtools.mount(devToolRef.current)\n }\n\n return () => {\n devtools.unmount()\n }\n }, [devtools])\n\n return <div ref={devToolRef} />\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,WAAW,CAAC,SAA0B;AAC3C,QAAA,aAAa,OAAuB,IAAI;AACxC,QAAA,CAAC,QAAQ,IAAI,SAAS,MAAM,IAAI,2BAA2B,IAAI,CAAC;AACtE,YAAU,MAAM;AACd,QAAI,WAAW,SAAS;AACb,eAAA,MAAM,WAAW,OAAO;AAAA,IAAA;AAGnC,WAAO,MAAM;AACX,eAAS,QAAQ;AAAA,IACnB;AAAA,EAAA,GACC,CAAC,QAAQ,CAAC;AAEN,SAAA,oBAAC,OAAI,EAAA,KAAK,WAAY,CAAA;AAC/B;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tanstack/react-devtools",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Headless UI for creating advanced custom devtools, autocomplete, and dropdown components in React.",
|
|
5
|
+
"author": "Tanner Linsley",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/TanStack/devtools.git",
|
|
10
|
+
"directory": "packages/react-devtools"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://tanstack.com/devtools",
|
|
13
|
+
"funding": {
|
|
14
|
+
"type": "github",
|
|
15
|
+
"url": "https://github.com/sponsors/tannerlinsley"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"react",
|
|
19
|
+
"devtools",
|
|
20
|
+
"autocomplete",
|
|
21
|
+
"dropdown",
|
|
22
|
+
"menu",
|
|
23
|
+
"headless-ui",
|
|
24
|
+
"nested"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"types": "dist/esm/index.d.ts",
|
|
28
|
+
"main": "dist/cjs/index.cjs",
|
|
29
|
+
"module": "dist/esm/index.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/esm/index.d.ts",
|
|
34
|
+
"default": "./dist/esm/index.js"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./dist/cjs/index.d.cts",
|
|
38
|
+
"default": "./dist/cjs/index.cjs"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"sideEffects": false,
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dist",
|
|
49
|
+
"src"
|
|
50
|
+
],
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@tanstack/devtools": "0.0.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@eslint-react/eslint-plugin": "^1.48.5",
|
|
56
|
+
"@types/react": "^19.1.2",
|
|
57
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
58
|
+
"eslint-plugin-react-compiler": "19.1.0-rc.1",
|
|
59
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
60
|
+
"react": "^19.1.0"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"@types/react": ">=16.8",
|
|
64
|
+
"@types/react-dom": ">=16.8",
|
|
65
|
+
"react": ">=16.8",
|
|
66
|
+
"react-dom": ">=16.8"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"clean": "premove ./build ./dist",
|
|
70
|
+
"test:eslint": "eslint ./src",
|
|
71
|
+
"test:lib": "vitest --passWithNoTests",
|
|
72
|
+
"test:lib:dev": "pnpm test:lib --watch",
|
|
73
|
+
"test:types": "tsc",
|
|
74
|
+
"test:build": "publint --strict",
|
|
75
|
+
"build": "vite build"
|
|
76
|
+
}
|
|
77
|
+
}
|
package/src/devtools.tsx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { TanStackRouterDevtoolsCore } from '@tanstack/devtools'
|
|
3
|
+
import type { DevtoolsOptions } from '@tanstack/devtools'
|
|
4
|
+
|
|
5
|
+
export const Devtools = (opts: DevtoolsOptions) => {
|
|
6
|
+
const devToolRef = useRef<HTMLDivElement>(null)
|
|
7
|
+
const [devtools] = useState(() => new TanStackRouterDevtoolsCore(opts))
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (devToolRef.current) {
|
|
10
|
+
devtools.mount(devToolRef.current)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return () => {
|
|
14
|
+
devtools.unmount()
|
|
15
|
+
}
|
|
16
|
+
}, [devtools])
|
|
17
|
+
|
|
18
|
+
return <div ref={devToolRef} />
|
|
19
|
+
}
|