Skip to content

Commit

Permalink
Merge pull request #721 from alleslabs/feat/storybook-init
Browse files Browse the repository at this point in the history
feat: Migrate to pnpm
  • Loading branch information
songwongtp committed Jan 18, 2024
2 parents 73f5e38 + 449808f commit ffe9c74
Show file tree
Hide file tree
Showing 43 changed files with 19,639 additions and 12,876 deletions.
14 changes: 11 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"rules": {
"react/jsx-no-useless-fragment": ["error", { "allowExpressions": true }]
"react/jsx-no-useless-fragment": [
"error",
{
"allowExpressions": true
}
]
},
"extends": [
"sznm/react",
"plugin:react/jsx-runtime",
"plugin:@next/next/recommended"
"plugin:@next/next/recommended",
"plugin:storybook/recommended"
],
"parserOptions": {
"project": ["./tsconfig.json"]
"project": [
"./tsconfig.json"
]
}
}
11 changes: 8 additions & 3 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ jobs:
Jest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Run Tests
run: |
yarn
yarn test
pnpm i
pnpm test
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,3 @@ next.config.original.js
.sentryclirc
next.config.original.js
next.config.wizardcopy.js

# yarn
/.yarn
.yarnrc.yml
4 changes: 2 additions & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
pnpm commitlint --edit "$1"
6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
yarn type-check
pnpm lint-staged
pnpm type-check
4 changes: 2 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname -- "$0")/_/husky.sh"

yarn lint
pnpm lint
4 changes: 2 additions & 2 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
[[ "$(uname -a)" = *"MINGW64"* ]] && exit 0
. "$(dirname "$0")/_/husky.sh"
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty && yarn cz --hook || true
exec < /dev/tty && pnpm cz --hook || true
25 changes: 25 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { StorybookConfig } from "@storybook/nextjs";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-storysource",
"@chakra-ui/storybook-addon",
],
framework: {
name: "@storybook/nextjs",
options: {},
},
docs: {
autodocs: "tag",
},
refs: {
"@chakra-ui/react": {
disable: true,
},
},
};
export default config;
19 changes: 19 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Preview } from "@storybook/react";
import customTheme from "../src/lib/styles/theme";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
chakra: {
theme: customTheme,
},
},
};

export default preview;
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev",
"command": "pnpm dev",
"console": "integratedTerminal",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
Expand All @@ -27,4 +27,4 @@
}
}
]
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#721](https://github.com/alleslabs/celatone-frontend/pull/721) Migrate to pnpm
- [#727](https://github.com/alleslabs/celatone-frontend/pull/727) Add amp nft pages
- [#720](https://github.com/alleslabs/celatone-frontend/pull/720) Add delegations for contract detail
- [#684](https://github.com/alleslabs/celatone-frontend/pull/684) Add nft page
Expand Down
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ module.exports = {
testPathIgnorePatterns: ["/node_modules/"],
testRegex: ".test.(tsx?)$",

transformIgnorePatterns: [`/node_modules/(?!(map-obj|camelcase|plur))`],
transformIgnorePatterns: [
`/node_modules/(?!.pnpm/)(?!(map-obj|camelcase|plur))`,
],
};
95 changes: 55 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
"name": "Kanisorn",
"email": "kanisorn@alleslabs.com"
},
{
"name": "Songwong",
"email": "songwong@alleslabs.com"
},
{
"name": "Beeb",
"email": "beeb@alleslabs.com"
},
{
"name": "Pakin",
"email": "pakin@alleslabs.com"
},
{
"name": "Songwong",
"email": "songwong@alleslabs.com"
}
],
"scripts": {
Expand All @@ -27,14 +27,15 @@
"postbuild": "next-sitemap --config next-sitemap.config.js",
"start": "next start",
"lint": "next lint",
"lint:fix": "eslint src --fix && yarn format",
"lint:fix": "eslint src --fix && pnpm format",
"type-check": "tsc --noEmit",
"format": "prettier --write src",
"up": "yarn upgrade-interactive",
"up-latest": "yarn up --latest",
"release": "cross-env HUSKY=0 standard-version",
"up": "pnpm upgrade-interactive",
"up-latest": "pnpm up --latest",
"push-release": "git push --follow-tags origin main",
"prepare": "husky install"
"prepare": "husky install",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"resolutions": {
"@interchain-ui/react": "1.11.4",
Expand All @@ -45,26 +46,29 @@
"@amplitude/analytics-types": "^2.3.0",
"@amplitude/plugin-user-agent-enrichment-browser": "^1.0.0",
"@chain-registry/types": "0.17.0",
"@chakra-ui/anatomy": "^2.1.0",
"@chakra-ui/card": "^2.1.1",
"@chakra-ui/icons": "^2.0.11",
"@chakra-ui/react": "2.3.6",
"@chakra-ui/styled-system": "^2.3.5",
"@cosmjs/cosmwasm-stargate": "0.31.3",
"@cosmjs/crypto": "0.31.3",
"@cosmjs/encoding": "0.31.3",
"@cosmjs/proto-signing": "0.31.3",
"@cosmjs/stargate": "0.31.3",
"@cosmos-kit/compass": "2.5.1",
"@cosmos-kit/core": "2.7.11",
"@cosmos-kit/initia": "0.1.0",
"@cosmos-kit/keplr": "2.5.1",
"@cosmos-kit/react": "2.9.15",
"@cosmos-kit/station": "2.4.11",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@graphql-codegen/cli": "^2.13.12",
"@graphql-codegen/client-preset": "^1.1.4",
"@chakra-ui/anatomy": "^2.2.2",
"@chakra-ui/card": "^2.2.0",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "2.8.2",
"@chakra-ui/styled-system": "^2.9.2",
"@cosmjs/amino": "0.32.2",
"@cosmjs/cosmwasm-stargate": "0.32.2",
"@cosmjs/crypto": "0.32.2",
"@cosmjs/encoding": "0.32.2",
"@cosmjs/proto-signing": "0.32.2",
"@cosmjs/stargate": "0.32.2",
"@cosmos-kit/compass": "2.6.2",
"@cosmos-kit/core": "2.8.2",
"@cosmos-kit/initia": "0.2.2",
"@cosmos-kit/keplr": "2.6.2",
"@cosmos-kit/keplr-extension": "2.7.2",
"@cosmos-kit/react": "2.10.2",
"@cosmos-kit/station": "2.5.2",
"@cosmos-kit/station-extension": "2.6.2",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@initia/initia.js": "0.1.12",
"@initia/initia.proto": "0.1.12",
"@interchain-ui/react": "1.11.4",
Expand All @@ -78,6 +82,8 @@
"@sentry/nextjs": "7.81.1",
"@tanstack/react-query": "^4.16.1",
"@types/big.js": "^6.1.6",
"@types/jest": "^29.5.11",
"@types/lodash": "^4.14.202",
"@types/numeral": "^2.0.2",
"@types/react-dom": "^18.0.8",
"@vercel/analytics": "^1.1.1",
Expand All @@ -88,7 +94,7 @@
"camelcase": "^7.0.0",
"chain-registry": "1.20.0",
"chakra-react-select": "^4.7.0",
"cosmjs-types": "^0.7.2",
"cosmjs-types": "^0.9.0",
"dayjs": "^1.11.6",
"file-saver": "^2.0.5",
"framer-motion": "^7.6.12",
Expand All @@ -104,8 +110,8 @@
"mobx-persist-store": "^1.1.2",
"mobx-react-lite": "^3.4.0",
"monaco-editor": "^0.44.0",
"next": "^13.0.0",
"next-seo": "^5.8.0",
"next": "^14.0.0",
"next-seo": "^6.4.0",
"node-gzip": "^1.1.2",
"plur": "^5.1.0",
"react": "^18.2.0",
Expand All @@ -119,33 +125,42 @@
"rxjs": "^7.5.7",
"snake-case": "^3.0.4",
"use-clamp-text": "^1.1.0",
"uuid": "^9.0.0",
"uuid": "^9.0.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@chakra-ui/storybook-addon": "^5.1.0",
"@commitlint/config-conventional": "^18.1.0",
"@commitlint/cz-commitlint": "^18.2.0",
"@storybook/addon-essentials": "^7.6.9",
"@storybook/addon-interactions": "^7.6.9",
"@storybook/addon-links": "^7.6.9",
"@storybook/addon-storysource": "^7.6.9",
"@storybook/blocks": "^7.6.9",
"@storybook/nextjs": "^7.6.9",
"@storybook/react": "^7.6.9",
"@storybook/test": "^7.6.9",
"@types/file-saver": "^2.0.5",
"@types/jest": "^29.4.0",
"@types/node-gzip": "^1.1.0",
"@types/react": "^18.0.21",
"@types/react": "^18.2",
"@types/react-linkify": "^1.0.1",
"@types/uuid": "^9.0.0",
"@types/uuid": "^9.0.7",
"commitizen": "^4.2.5",
"commitlint": "^17.1.2",
"cross-env": "^7.0.3",
"eslint": "^8.52.0",
"eslint-config-next": "^14.0.0",
"eslint-config-sznm": "^2.0.2",
"eslint-plugin-storybook": "^0.6.15",
"husky": "^8.0.1",
"jest": "^29.5.0",
"lint-staged": "^13.0.3",
"jest": "^29.7.0",
"lint-staged": "^13.3.0",
"mockdate": "^3.0.5",
"next-sitemap": "^3.1.25",
"prettier": "^3.0.3",
"standard-version": "^9.5.0",
"storybook": "^7.6.9",
"ts-jest": "^29.0.5",
"typescript": "^5.1.6"
},
"packageManager": "yarn@1.22.19"
"packageManager": "pnpm@8.14.1"
}
Loading

2 comments on commit ffe9c74

@vercel
Copy link

@vercel vercel bot commented on ffe9c74 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ffe9c74 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.