diff --git a/apps/docs/package.json b/apps/docs/package.json index f72f093..636a21b 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -7,25 +7,18 @@ "dev": "next dev", "build:apps": "next build" }, - "dependencies": { - "@meshsdk/midnight-react": "*", - "@radix-ui/react-dialog": "^1.1.6", - "@radix-ui/react-dropdown-menu": "^2.1.6", - "@radix-ui/react-slot": "^1.1.2", - "@radix-ui/react-tooltip": "^1.1.8", + "dependencies": { "next": "^14.1.1", "nextra": "^3.3.1", "nextra-theme-docs": "^3.3.1", - "pino": "^9.6.0", + "pino": "^9.6.0" , "react": "^18.3.1", "react-dom": "^18.3.1" }, "devDependencies": { "@eslint/eslintrc": "^3", "@graphql-eslint/eslint-plugin": "^4.4.0", - "@types/node": "^20", - "@types/react": "^18.3.1", - "@types/react-dom": "^18.3.1", + "@types/node": "^20", "eslint": "^9", "eslint-config-next": "15.1.3", "postcss": "^8", diff --git a/apps/playground/frontend/.gitignore b/apps/playground/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/apps/playground/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/apps/playground/frontend/README.md b/apps/playground/frontend/README.md new file mode 100644 index 0000000..7959ce4 --- /dev/null +++ b/apps/playground/frontend/README.md @@ -0,0 +1,69 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default tseslint.config([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + ...tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + ...tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + ...tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default tseslint.config([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/example-workspaces/wallet-examples/components.json b/apps/playground/frontend/components.json similarity index 78% rename from example-workspaces/wallet-examples/components.json rename to apps/playground/frontend/components.json index 09b0ba6..73afbdb 100644 --- a/example-workspaces/wallet-examples/components.json +++ b/apps/playground/frontend/components.json @@ -1,11 +1,11 @@ { "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", + "style": "new-york", "rsc": false, "tsx": true, "tailwind": { - "config": "tailwind.config.ts", - "css": "src/styles/globals.css", + "config": "", + "css": "src/index.css", "baseColor": "neutral", "cssVariables": true, "prefix": "" diff --git a/apps/playground/frontend/eslint.config.js b/apps/playground/frontend/eslint.config.js new file mode 100644 index 0000000..b32e446 --- /dev/null +++ b/apps/playground/frontend/eslint.config.js @@ -0,0 +1,29 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' +import { globalIgnores } from 'eslint/config' + +export default tseslint.config([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs['recommended-latest'], + { + ...reactRefresh.configs.vite, + rules: { + ...reactRefresh.configs.vite.rules, + 'react-refresh/only-export-components': 'off' + } + }, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]) diff --git a/apps/playground/frontend/index.html b/apps/playground/frontend/index.html new file mode 100644 index 0000000..e4b78ea --- /dev/null +++ b/apps/playground/frontend/index.html @@ -0,0 +1,13 @@ + + +
+ + + +{name}
-