-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[WIP] feat: add start devtools #5247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b961381
2599dc3
7c3ad0c
31f11bb
50bbb01
ebb82f0
dac6459
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// @ts-check | ||
|
||
import pluginReact from '@eslint-react/eslint-plugin' | ||
import pluginReactCompiler from 'eslint-plugin-react-compiler' | ||
import pluginReactHooks from 'eslint-plugin-react-hooks' | ||
import rootConfig from '../../eslint.config.js' | ||
|
||
export default [ | ||
...rootConfig, | ||
{ | ||
files: ['**/*.{ts,tsx}'], | ||
...pluginReact.configs.recommended, | ||
}, | ||
{ | ||
plugins: { | ||
'react-hooks': pluginReactHooks, | ||
'react-compiler': pluginReactCompiler, | ||
}, | ||
rules: { | ||
'@eslint-react/dom/no-missing-button-type': 'off', | ||
'react-compiler/react-compiler': 'error', | ||
'react-hooks/exhaustive-deps': 'error', | ||
'react-hooks/rules-of-hooks': 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['**/__tests__/**'], | ||
rules: { | ||
// 'react-compiler/react-compiler': 'off', | ||
}, | ||
}, | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"name": "@tanstack/react-start-devtools", | ||
"version": "0.0.1", | ||
"description": "React adapter for devtools for Start.", | ||
"author": "Tanner Linsley", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/TanStack/router.git", | ||
"directory": "packages/react-start-devtools" | ||
}, | ||
"homepage": "https://tanstack.com/start", | ||
"funding": { | ||
"type": "github", | ||
"url": "https://github.com/sponsors/tannerlinsley" | ||
}, | ||
"keywords": [], | ||
"type": "module", | ||
"types": "dist/esm/index.d.ts", | ||
"module": "dist/esm/index.js", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/esm/index.d.ts", | ||
"default": "./dist/esm/index.js" | ||
} | ||
}, | ||
"./production": { | ||
"import": { | ||
"types": "./dist/esm/production.d.ts", | ||
"default": "./dist/esm/production.js" | ||
} | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"files": [ | ||
"dist/", | ||
"src" | ||
], | ||
"scripts": { | ||
"clean": "rimraf ./build ./dist", | ||
"lint:fix": "eslint ./src --fix", | ||
"test:eslint": "eslint ./src", | ||
"test:lib": "vitest", | ||
"test:lib:dev": "pnpm test:lib --watch", | ||
"test:types": "tsc", | ||
"test:build": "publint --strict", | ||
"build": "vite build" | ||
}, | ||
"peerDependencies": { | ||
"@types/react": ">=16.8", | ||
"@types/react-dom": ">=16.8", | ||
"react": ">=16.8", | ||
"react-dom": ">=16.8" | ||
}, | ||
"dependencies": { | ||
"@tanstack/devtools-utils": "^0.0.3", | ||
"@tanstack/start-devtools": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@eslint-react/eslint-plugin": "^1.53.1", | ||
"@vitejs/plugin-react": "^5.0.2", | ||
"eslint-plugin-react-compiler": "19.1.0-rc.2", | ||
"eslint-plugin-react-hooks": "^5.2.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
import { createReactPanel } from '@tanstack/devtools-utils/react' | ||
import { StartDevtoolsCore } from "@tanstack/start-devtools" | ||
import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/react'; | ||
|
||
export interface StartDevtoolsReactInit extends DevtoolsPanelProps { } | ||
|
||
const [StartDevtoolsPanel, StartDevtoolsPanelNoOp] = createReactPanel(StartDevtoolsCore) | ||
|
||
export { StartDevtoolsPanel, StartDevtoolsPanelNoOp } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use client' | ||
|
||
import * as Devtools from './ReactStartDevtools' | ||
import * as plugin from './plugin' | ||
|
||
export const StartDevtoolsPanel = | ||
process.env.NODE_ENV !== 'development' | ||
? Devtools.StartDevtoolsPanelNoOp | ||
: Devtools.StartDevtoolsPanel | ||
|
||
export const startDevtoolsPlugin = | ||
process.env.NODE_ENV !== 'development' | ||
? plugin.startDevtoolsNoOpPlugin | ||
: plugin.startDevtoolsPlugin | ||
|
||
export type { StartDevtoolsReactInit } from './ReactStartDevtools' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { createReactPlugin } from '@tanstack/devtools-utils/react' | ||
import { StartDevtoolsPanel } from './ReactStartDevtools' | ||
|
||
const [startDevtoolsPlugin, startDevtoolsNoOpPlugin] = createReactPlugin("TanStack Start", StartDevtoolsPanel) | ||
|
||
export { startDevtoolsPlugin, startDevtoolsNoOpPlugin } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use client' | ||
|
||
export { StartDevtoolsPanel } from './ReactStartDevtools' | ||
|
||
export type { StartDevtoolsReactInit } from './ReactStartDevtools' | ||
|
||
export { startDevtoolsPlugin } from './plugin' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { describe, expect, it } from 'vitest' | ||
|
||
describe('test suite', () => { | ||
it('should work', () => { | ||
expect(true).toBe(true) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '@testing-library/jest-dom/vitest' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["tests", "src"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["src", "eslint.config.js", "vite.config.ts", "tests"], | ||
"compilerOptions": { | ||
"jsx": "react" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { defineConfig, mergeConfig } from 'vitest/config' | ||
import { tanstackViteConfig } from '@tanstack/config/vite' | ||
import react from '@vitejs/plugin-react' | ||
import packageJson from './package.json' | ||
|
||
const config = defineConfig({ | ||
plugins: [react()], | ||
test: { | ||
name: packageJson.name, | ||
dir: './', | ||
watch: false, | ||
environment: 'jsdom', | ||
setupFiles: ['./tests/test-setup.ts'], | ||
globals: true, | ||
}, | ||
}) | ||
|
||
export default mergeConfig( | ||
config, | ||
tanstackViteConfig({ | ||
entry: ['./src/index.ts', './src/production.ts'], | ||
srcDir: './src', | ||
cjs: false, | ||
}), | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// @ts-check | ||
|
||
import rootConfig from '../../eslint.config.js' | ||
|
||
export default [ | ||
...rootConfig, | ||
{ | ||
rules: {}, | ||
}, | ||
] |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,64 @@ | ||||||||||||||
{ | ||||||||||||||
"name": "@tanstack/solid-start-devtools", | ||||||||||||||
"version": "0.0.1", | ||||||||||||||
"description": "Solid adapter for devtools for Start.", | ||||||||||||||
"author": "Tanner Linsley", | ||||||||||||||
"license": "MIT", | ||||||||||||||
"repository": { | ||||||||||||||
"type": "git", | ||||||||||||||
"url": "https://github.com/TanStack/router.git", | ||||||||||||||
"directory": "packages/solid-start-devtools" | ||||||||||||||
}, | ||||||||||||||
"homepage": "https://tanstack.com/start", | ||||||||||||||
"funding": { | ||||||||||||||
"type": "github", | ||||||||||||||
"url": "https://github.com/sponsors/tannerlinsley" | ||||||||||||||
}, | ||||||||||||||
"keywords": [], | ||||||||||||||
"type": "module", | ||||||||||||||
"types": "dist/esm/index.d.ts", | ||||||||||||||
"module": "dist/esm/index.js", | ||||||||||||||
"exports": { | ||||||||||||||
".": { | ||||||||||||||
"import": { | ||||||||||||||
"types": "./dist/esm/index.d.ts", | ||||||||||||||
"default": "./dist/esm/index.js" | ||||||||||||||
} | ||||||||||||||
}, | ||||||||||||||
"./production": { | ||||||||||||||
"import": { | ||||||||||||||
"types": "./dist/esm/production.d.ts", | ||||||||||||||
"default": "./dist/esm/production.js" | ||||||||||||||
} | ||||||||||||||
}, | ||||||||||||||
"./package.json": "./package.json" | ||||||||||||||
}, | ||||||||||||||
"sideEffects": false, | ||||||||||||||
"engines": { | ||||||||||||||
"node": ">=18" | ||||||||||||||
}, | ||||||||||||||
"files": [ | ||||||||||||||
"dist/", | ||||||||||||||
"src" | ||||||||||||||
], | ||||||||||||||
"scripts": { | ||||||||||||||
"clean": "rimraf ./build ./dist", | ||||||||||||||
"lint:fix": "eslint ./src --fix", | ||||||||||||||
"test:eslint": "eslint ./src", | ||||||||||||||
"test:lib": "vitest", | ||||||||||||||
"test:lib:dev": "pnpm test:lib --watch", | ||||||||||||||
"test:types": "tsc", | ||||||||||||||
"test:build": "publint --strict", | ||||||||||||||
"build": "vite build" | ||||||||||||||
}, | ||||||||||||||
"peerDependencies": { | ||||||||||||||
"solid-js": ">=1.9.7" | ||||||||||||||
}, | ||||||||||||||
"dependencies": { | ||||||||||||||
"@tanstack/devtools-utils": "^0.0.3", | ||||||||||||||
"@tanstack/start-devtools": "workspace:*" | ||||||||||||||
}, | ||||||||||||||
Comment on lines
+58
to
+60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Use workspace protocol for internal utils dependency.
- "@tanstack/devtools-utils": "^0.0.3",
+ "@tanstack/devtools-utils": "workspace:*", As per coding guidelines 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||
"devDependencies": { | ||||||||||||||
"vite-plugin-solid": "^2.11.8" | ||||||||||||||
} | ||||||||||||||
} |
Uh oh!
There was an error while loading. Please reload this page.