Upgrade TypeScript, Vite, Storybook, Tamagui (#373)
* upgrade deps * update storybook configs * add required tamagui token :/
This commit is contained in:
parent
558faa9725
commit
e586de1890
|
@ -17,11 +17,11 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "^1.2.2",
|
||||
"@types/node": "^18.15.2",
|
||||
"@types/react": "^18.0.28",
|
||||
"@types/node": "^18.15.11",
|
||||
"@types/react": "^18.0.33",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@vitejs/plugin-react": "^3.1.0",
|
||||
"typescript": "^4.9.5",
|
||||
"vite": "^4.1.4"
|
||||
"typescript": "^5.0.3",
|
||||
"vite": "^4.2.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
"devDependencies": {
|
||||
"@babel/core": "^7.17.9",
|
||||
"@expo/metro-config": "^0.3.21",
|
||||
"@tamagui/babel-plugin": "1.7.7",
|
||||
"@tamagui/babel-plugin": "1.11.1",
|
||||
"@types/react-native": "~0.70.6",
|
||||
"babel-plugin-module-resolver": "^4.1.0",
|
||||
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
||||
"typescript": "^4.9.5"
|
||||
"typescript": "^5.0.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
<script type="module" src="./src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,18 +12,18 @@
|
|||
"dependencies": {
|
||||
"@status-im/components": "*",
|
||||
"@status-im/icons": "*",
|
||||
"@tamagui/core": "1.7.7",
|
||||
"@tamagui/core": "1.11.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-native-web": "^0.18.12",
|
||||
"use-resize-observer": "^9.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tamagui/vite-plugin": "1.7.7",
|
||||
"@types/react": "^18.0.28",
|
||||
"@tamagui/vite-plugin": "1.11.1",
|
||||
"@types/react": "^18.0.33",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@vitejs/plugin-react-swc": "^3.2.0",
|
||||
"typescript": "^4.9.5",
|
||||
"vite": "^4.1.4"
|
||||
"typescript": "^5.0.3",
|
||||
"vite": "^4.2.1"
|
||||
}
|
||||
}
|
||||
|
|
30
package.json
30
package.json
|
@ -17,7 +17,7 @@
|
|||
"build": "turbo run build --filter=@status-im/*",
|
||||
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint/.eslint-cache .",
|
||||
"typecheck": "turbo run typecheck",
|
||||
"format": "prettier --ignore-path .gitignore --cache --write .",
|
||||
"format": "prettier --ignore-path .gitignore --write .",
|
||||
"clean": "turbo run clean && rimraf node_modules",
|
||||
"web": "yarn workspace web dev",
|
||||
"mobile": "yarn workspace mobile dev",
|
||||
|
@ -25,18 +25,18 @@
|
|||
"storybook": "yarn workspace @status-im/components storybook"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/react": "18.0.28",
|
||||
"@types/react": "18.0.33",
|
||||
"@types/react-dom": "18.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.23.0",
|
||||
"@tsconfig/strictest": "^1.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
||||
"@typescript-eslint/parser": "^5.55.0",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-config-prettier": "^8.7.0",
|
||||
"@tsconfig/strictest": "^2.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.57.1",
|
||||
"@typescript-eslint/parser": "^5.57.1",
|
||||
"eslint": "^8.37.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-import-resolver-node": "^0.3.7",
|
||||
"eslint-import-resolver-typescript": "^3.5.3",
|
||||
"eslint-import-resolver-typescript": "^3.5.5",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jsx-a11y": "^6.7.1",
|
||||
|
@ -45,13 +45,13 @@
|
|||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^13.2.0",
|
||||
"prettier": "^2.8.4",
|
||||
"rimraf": "^4.4.0",
|
||||
"turbo": "^1.8.3",
|
||||
"typescript": "^4.9.5",
|
||||
"vite": "^4.1.4",
|
||||
"vite-node": "^0.29.2",
|
||||
"vitest": "^0.29.2"
|
||||
"prettier": "^2.8.7",
|
||||
"rimraf": "^4.4.1",
|
||||
"turbo": "^1.8.8",
|
||||
"typescript": "^5.0.3",
|
||||
"vite": "^4.2.1",
|
||||
"vite-node": "^0.29.8",
|
||||
"vitest": "^0.29.8"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx,js,jsx}": [
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { StorybookConfig } from '@storybook/types'
|
||||
import type { StorybookConfig } from '@storybook/react-vite'
|
||||
|
||||
const config: StorybookConfig = {
|
||||
framework: '@storybook/react-vite',
|
||||
|
||||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
addons: [
|
||||
'@storybook/addon-links',
|
||||
|
@ -9,10 +11,7 @@ const config: StorybookConfig = {
|
|||
'storybook-addon-designs',
|
||||
'storybook-dark-mode',
|
||||
],
|
||||
framework: {
|
||||
name: '@storybook/react-vite',
|
||||
options: {},
|
||||
},
|
||||
|
||||
docs: {
|
||||
autodocs: 'tag',
|
||||
},
|
||||
|
|
|
@ -1,26 +1,35 @@
|
|||
import React from 'react'
|
||||
import type { Preview } from '@storybook/react'
|
||||
|
||||
import { Provider, ToastContainer } from '../src'
|
||||
import { Parameters, Decorator } from '@storybook/react'
|
||||
|
||||
import './reset.css'
|
||||
import './components.css'
|
||||
|
||||
export const parameters: Parameters = {
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
// export const parameters: Parameters = {
|
||||
// actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
// controls: {
|
||||
// matchers: {
|
||||
// color: /(background|color)$/i,
|
||||
// date: /Date$/,
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
|
||||
const preview: Preview = {
|
||||
parameters: {
|
||||
// layout: 'centered',
|
||||
},
|
||||
decorators: [
|
||||
Story => {
|
||||
return (
|
||||
<Provider>
|
||||
<Story />
|
||||
<ToastContainer />
|
||||
</Provider>
|
||||
)
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const withThemeProvider: Decorator = (Story, _context) => {
|
||||
return (
|
||||
<Provider>
|
||||
<Story />
|
||||
<ToastContainer />
|
||||
</Provider>
|
||||
)
|
||||
}
|
||||
export const decorators = [withThemeProvider]
|
||||
export default preview
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"clean": "rimraf node_modules dist .turbo storybook-static"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react-native-web": "^0.18.0"
|
||||
"react": "^18.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-accordion": "^1.1.1",
|
||||
|
@ -37,35 +37,35 @@
|
|||
"@radix-ui/react-toast": "^1.1.3",
|
||||
"@radix-ui/react-tooltip": "^1.0.5",
|
||||
"@status-im/icons": "*",
|
||||
"@tamagui/animations-css": "1.7.7",
|
||||
"@tamagui/animations-react-native": "1.7.7",
|
||||
"@tamagui/core": "1.7.7",
|
||||
"@tamagui/font-inter": "1.7.7",
|
||||
"@tamagui/react-native-media-driver": "1.7.7",
|
||||
"@tamagui/shorthands": "1.7.7",
|
||||
"@tamagui/theme-base": "1.7.7",
|
||||
"@tamagui/animations-css": "1.11.1",
|
||||
"@tamagui/animations-react-native": "1.11.1",
|
||||
"@tamagui/core": "1.11.1",
|
||||
"@tamagui/font-inter": "1.11.1",
|
||||
"@tamagui/react-native-media-driver": "1.11.1",
|
||||
"@tamagui/shorthands": "1.11.1",
|
||||
"@tamagui/theme-base": "1.11.1",
|
||||
"expo-blur": "^12.2.2",
|
||||
"expo-linear-gradient": "^12.1.2",
|
||||
"tamagui": "1.7.7",
|
||||
"zustand": "^4.3.6"
|
||||
"tamagui": "1.11.1",
|
||||
"zustand": "^4.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-essentials": "7.0.0-beta.21",
|
||||
"@storybook/addon-interactions": "7.0.0-beta.21",
|
||||
"@storybook/addon-links": "7.0.0-beta.21",
|
||||
"@storybook/blocks": "7.0.0-beta.21",
|
||||
"@storybook/react": "7.0.0-beta.21",
|
||||
"@storybook/react-vite": "7.0.0-beta.21",
|
||||
"@storybook/testing-library": "^0.0.13",
|
||||
"@tamagui/vite-plugin": "1.7.7",
|
||||
"@storybook/addon-essentials": "7.0.2",
|
||||
"@storybook/addon-interactions": "7.0.2",
|
||||
"@storybook/addon-links": "7.0.2",
|
||||
"@storybook/blocks": "7.0.2",
|
||||
"@storybook/react": "7.0.2",
|
||||
"@storybook/react-vite": "7.0.2",
|
||||
"@storybook/testing-library": "^0.1.0",
|
||||
"@tamagui/vite-plugin": "^1.11.1",
|
||||
"@vitejs/plugin-react-swc": "^3.2.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-native-svg": "^13.8.0",
|
||||
"react-native-web": "^0.18.12",
|
||||
"storybook": "7.0.0-beta.21",
|
||||
"storybook": "7.0.2",
|
||||
"storybook-addon-designs": "7.0.0-beta.2",
|
||||
"storybook-dark-mode": "^2.1.1",
|
||||
"vite": "^4.1.4"
|
||||
"storybook-dark-mode": "^3.0.0",
|
||||
"vite": "^4.2.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,8 @@ export const config = createTamagui({
|
|||
size: {},
|
||||
lineHeight: {},
|
||||
}),
|
||||
// Tamagui requires this... weird
|
||||
body: createInterFont({}),
|
||||
},
|
||||
themes,
|
||||
tokens: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base",
|
||||
"include": ["src"],
|
||||
"include": ["src", ".storybook"],
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"declarationDir": "dist/types"
|
||||
|
|
|
@ -35,11 +35,9 @@ export default defineConfig(({ mode }) => {
|
|||
},
|
||||
|
||||
plugins: [
|
||||
react({
|
||||
// jsxRuntime: 'classic',
|
||||
}),
|
||||
react(),
|
||||
tamaguiPlugin(tamaguiConfig),
|
||||
// tamaguiExtractPlugin(tamaguiConfig)
|
||||
// tamaguiExtractPlugin(tamaguiConfig),
|
||||
],
|
||||
|
||||
test: {
|
||||
|
|
Loading…
Reference in New Issue