Skip to content

Commit df9cd41

Browse files
committed
feat: upgrade to chakra v3
1 parent 2561428 commit df9cd41

File tree

491 files changed

+8559
-9395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

491 files changed

+8559
-9395
lines changed

.storybook/preview.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { ChakraProvider } from '@chakra-ui/react';
2+
import { withThemeByClassName } from '@storybook/addon-themes';
23
import type { Preview } from '@storybook/react';
34
import React from 'react';
45

5-
import { theme } from '../src/ui/theme/theme';
6+
import { system } from '../src/ui/theme/theme';
67

78
const preview: Preview = {
89
parameters: {
@@ -16,10 +17,14 @@ const preview: Preview = {
1617
},
1718
decorators: [
1819
Story => (
19-
<ChakraProvider theme={theme}>
20+
<ChakraProvider value={system}>
2021
<Story />
2122
</ChakraProvider>
2223
),
24+
withThemeByClassName({
25+
defaultTheme: 'light',
26+
themes: { light: '', dark: 'dark' },
27+
}),
2328
],
2429
};
2530

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ COPY . .
1515

1616
RUN npm install -g [email protected]
1717
RUN pnpm i
18+
RUN pnpm chakra typegen src/ui/theme/theme.ts
1819
RUN pnpm build
1920

2021
# This stage creates the final Docker image that will be used in production. It only contains the necessary runtime environment and the built application files from the first stage.

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ const customJestConfig = {
2121
coveragePathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/.next/'],
2222
testPathIgnorePatterns: ['<rootDir>/e2e/', '<rootDir>/node_modules/', '<rootDir>/.next/'],
2323
setupFiles: ['<rootDir>/setup-jest.js'],
24+
// transformIgnorePatterns: [
25+
// // Change the default pattern to transform react-leaflet
26+
// '/node_modules/(?!(react-leaflet|@react-leaflet|leaflet)/)'
27+
// ],
28+
// transform: {
29+
// '^.+\\.(ts|tsx)$': 'ts-jest',
30+
// },
2431
};
2532

2633
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async

jest.setup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
import '@testing-library/jest-dom';
2+
import structuredClone from '@ungap/structured-clone';
3+
4+
global.structuredClone = structuredClone;

next.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ const nextConfig = {
2727
},
2828
];
2929
},
30+
experimental: {
31+
optimizePackageImports: ['@chakra-ui/react'],
32+
},
33+
images: {
34+
domains: ['assets.hiro.so'],
35+
},
3036
};
3137

3238
module.exports = withSentryConfig(withBundleAnalyzer(nextConfig), {

package.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "The source code for the Stacks Blockchain explorer.",
44
"scripts": {
55
"preinstall": "npx only-allow pnpm",
6-
"build": "next build",
6+
"build": "pnpm chakra-types && next build",
77
"build:analyze": "next telemetry disable && ANALYZE=true next build",
88
"dev": "next dev",
99
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
@@ -20,24 +20,24 @@
2020
"test:unit": "jest --forceExit ./src",
2121
"prepare": "husky install",
2222
"storybook": "storybook dev -p 6006",
23-
"build-storybook": "storybook build"
23+
"build-storybook": "storybook build",
24+
"chakra-types": "pnpm chakra typegen ./src/ui/theme/theme.ts"
2425
},
2526
"version": "1.0.0",
2627
"author": "Hiro Systems PBC (formerly Blockstack PBC)",
2728
"dependencies": {
28-
"@chakra-ui/anatomy": "2.2.2",
29-
"@chakra-ui/next-js": "2.2.0",
30-
"@chakra-ui/react": "2.8.2",
29+
"@chakra-ui/anatomy": "2.3.4",
30+
"@chakra-ui/react": "3.3.1",
3131
"@chakra-ui/theme-tools": "2.1.2",
3232
"@contentful/rich-text-react-renderer": "15.21.2",
3333
"@contentful/rich-text-types": "16.5.2",
3434
"@date-fns/utc": "1.2.0",
3535
"@emotion/cache": "11.11.0",
3636
"@emotion/core": "11.0.0",
3737
"@emotion/css": "11.11.2",
38-
"@emotion/react": "11.11.1",
38+
"@emotion/react": "11.13.3",
3939
"@emotion/server": "11.11.0",
40-
"@emotion/styled": "11.11.0",
40+
"@emotion/styled": "11.13.0",
4141
"@hirosystems/token-metadata-api-client": "1.2.0",
4242
"@monaco-editor/react": "4.5.2",
4343
"@next/bundle-analyzer": "14.2.0",
@@ -56,6 +56,7 @@
5656
"@stacks/connect-ui": "6.4.1",
5757
"@stacks/network": "6.13.0",
5858
"@stacks/transactions": "6.15.1-pr.0bcf867e.0+0bcf867e",
59+
"@storybook/addon-themes": "^8.4.7",
5960
"@tanstack/react-query": "5.8.4",
6061
"@tippyjs/react": "4.2.6",
6162
"@types/cookie": "0.5.2",
@@ -66,11 +67,11 @@
6667
"c32check": "2.0.0",
6768
"contentful": "10.12.0",
6869
"cookie": "0.5.0",
70+
"cookies-next": "^4.3.0",
6971
"dayjs": "1.11.9",
7072
"eslint-plugin-import": "2.29.0",
7173
"express": "4.19.2",
7274
"formik": "2.4.3",
73-
"framer-motion": "10.16.4",
7475
"http-status-codes": "2.3.0",
7576
"husky": "8.0.3",
7677
"ioredis": "5.3.2",
@@ -83,6 +84,7 @@
8384
"monacode": "0.3.1",
8485
"morgan": "1.10.0",
8586
"next": "14.2.13",
87+
"next-themes": "0.4.4",
8688
"nookies": "2.5.2",
8789
"onigasm": "2.2.5",
8890
"openapi-fetch": "0.13.0",
@@ -99,6 +101,7 @@
99101
"react-dom": "18.2.0",
100102
"react-error-boundary": "4.0.11",
101103
"react-hot-toast": "2.4.1",
104+
"react-icons": "^5.3.0",
102105
"react-leaflet": "4.2.1",
103106
"react-loading-skeleton": "3.3.1",
104107
"react-redux": "8.1.2",
@@ -116,6 +119,7 @@
116119
"yup": "1.2.0"
117120
},
118121
"devDependencies": {
122+
"@chakra-ui/cli": "3.1.0",
119123
"@chromatic-com/storybook": "1.9.0",
120124
"@commitlint/config-conventional": "12.1.4",
121125
"@next/eslint-plugin-next": "14.0.3",
@@ -151,6 +155,7 @@
151155
"@types/styled-system__theme-get": "5.0.1",
152156
"@types/testing-library__jest-dom": "5.14.8",
153157
"@types/valid-url": "1.0.3",
158+
"@ungap/structured-clone": "^1.2.1",
154159
"commitlint": "12.1.4",
155160
"eslint": "8.54.0",
156161
"eslint-config-next": "14.0.3",

0 commit comments

Comments
 (0)