Skip to content

Commit

Permalink
chore: migrate to bun (#2139)
Browse files Browse the repository at this point in the history
  • Loading branch information
flagrede authored Dec 4, 2023
1 parent 06bffa7 commit 5da6b81
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 39,413 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1

- name: install
run: |
yarn install
yarn bootstrap
bun install
- name: build-app
run: yarn build
run: bun run build
env:
NODE_OPTIONS: '--openssl-legacy-provider --max-old-space-size=10216'

Expand Down
Binary file added bun.lockb
Binary file not shown.
59 changes: 32 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,30 @@
"type": "git",
"url": "https://github.com/regen-network/regen-web"
},
"workspaces": {
"packages": [
"web-marketplace",
"web-components",
"web-storybook",
"web-auth",
"web-www"
]
},
"workspaces": [
"web-marketplace",
"web-components",
"web-storybook",
"web-auth",
"web-www"
],
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "yarn build-components && lerna run --scope web-marketplace build --stream",
"build-www": "yarn build-components && lerna run --scope web-www build --stream",
"build-components": "lerna run --scope web-components build --stream",
"build-storybook": "yarn build-components && lerna run build-storybook --stream",
"build-auth": "yarn build-components && lerna run --scope web-auth build --stream",
"build": "bun run build-components && bun run --cwd web-marketplace build",
"build-www": "bun run build-components && bun run --cwd web-www build",
"build-components": "bun run --cwd web-components build",
"build-storybook": "bun run build-components && bun run --cwd web-storybook build-storybook",
"build-auth": "bun run build-components && bun run --cwd web-auth build",
"clean": "find . -iname 'node_modules' -maxdepth 2 | xargs rm -rf",
"format": "lerna run format",
"lint": "lerna run lint",
"format-and-fix": "lerna run format-and-fix",
"storybook": "lerna run --scope web-storybook storybook --stream",
"test": "lerna run --scope web-marketplace test-no-watch --stream",
"test-components": "lerna run --scope web-components test --stream",
"start": "lerna run --scope web-marketplace start --stream",
"start-auth": "lerna run --scope web-auth start --stream",
"watch": "lerna run watch --stream",
"test-update-snapshot": "lerna run --scope web-marketplace test-update-snapshot --stream",
"format": "bun run --cwd web-components format & bun run --cwd web-marketplace format & bun run --cwd web-www format",
"lint": "bun run --cwd web-components lint & bun run --cwd web-marketplace lint & bun run --cwd web-www lint",
"format-and-fix": "bun run --cwd web-components format-and-fix & bun run --cwd web-marketplace format-and-fix & bun run --cwd web-www format-and-fix",
"storybook": "bun run --cwd web-storybook storybook",
"test": "bun run --cwd web-marketplace test-no-watch",
"test-components": "bun run --cwd web-components test",
"start": "bun run --cwd web-marketplace start",
"start-auth": "bun run --cwd web-auth start",
"watch": "bun run --cwd web-components watch",
"test-update-snapshot": "bun run --cwd web-marketplace test-update-snapshot",
"bump": "lerna version --no-push --conventional-commits",
"bump-and-push": "lerna version --conventional-commits",
"postinstall": "patch-package"
Expand All @@ -60,15 +57,23 @@
"patch-package": "^8.0.0",
"prettier": "2.4.1",
"shx": "^0.3.2",
"typescript": "^5.2.2"
"typescript": "^5.2.2",
"storybook": "^7.3.2"
},
"resolutions": {
"eslint": "^8.42.0",
"formik-mui": "^5.0.0-alpha.0",
"formik": "2.2.9",
"@types/jest": "^29.0.0",
"@types/react": "^18.0.23",
"@types/react-dom": "^18.0.7",
"babel-eslint": "^10.1.0",
"**/@typescript-eslint/eslint-plugin": "^6.7.3",
"**/@typescript-eslint/parser": "^6.7.3",
"webpack": "4.44.2",
"react-error-overlay": "6.0.9",
"@emotion/react": "11.10.6"
"@emotion/react": "11.10.6",
"tss-react": "^4.8.2"
},
"husky": {
"hooks": {}
Expand Down
2 changes: 1 addition & 1 deletion web-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"react-google-recaptcha-v3": "^1.8.0",
"react-scripts": "4.0.3",
"tss-react": "^4.4.4",
"web-components": "^1.14.0",
"web-components": "workspace:*",
"web-vitals": "^1.0.1"
},
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"scripts": {
"remove-previous-files": "shx rm -rf ./lib/* ./tsconfig.tsbuildinfo",
"copy-assets": "cp ./src/theme/fonts.css ./lib/theme/fonts.css && cp -R ./src/theme/assets ./lib/theme/",
"watch": "yarn remove-previous-files && tsc --watch && yarn copy-assets",
"build": "yarn remove-previous-files && tsc && yarn copy-assets",
"watch": "bun run remove-previous-files && tsc --watch && bun run copy-assets",
"build": "bun run remove-previous-files && tsc && bun run copy-assets",
"lint": "eslint ./src -c .eslintrc.js --max-warnings 0 --ext .ts,.tsx",
"lint-fix": "eslint ./src --fix -c .eslintrc.js --ext .ts,.tsx",
"format": "prettier --write --loglevel warn --ignore-path=../.prettierignore './src/**/*.{ts,tsx,json,md,css}'",
"format-and-fix": "yarn format && yarn lint-fix",
"format-and-fix": "bun run format && bun run lint-fix",
"test": "jest"
},
"browserslist": [
Expand Down Expand Up @@ -44,7 +44,7 @@
"@types/react-helmet": "^6.1.0",
"@types/react-html-parser": "^2.0.1",
"@types/react-image-crop": "^8.1.3",
"@types/react-map-gl": "^5.2.0",
"@types/react-map-gl": "5.2.11",
"@types/react-slick": "^0.23.10",
"@types/zxcvbn": "^4.4.0",
"date-fns": "^2.25.0",
Expand All @@ -64,13 +64,13 @@
"react-helmet": "^6.0.0",
"react-image-crop": "^9.0.5",
"react-lazyload": "^3.2.0",
"react-map-gl": "^5.2.3",
"react-map-gl": "5.3.21",
"react-phone-input-2": "^2.13.9",
"react-player": "^2.11.1",
"react-remove-scroll": "^2.3.0",
"react-slick": "^0.29.0",
"slick-carousel": "^1.8.1",
"tss-react": "^4.4.1",
"tss-react": "4.4.1",
"victory": "^36.6.8",
"yup": "^0.32.11",
"zxcvbn": "^4.4.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Box, Card, CardMedia, SxProps } from '@mui/material';

import { Account } from 'src/components/user/UserInfoCard';

import { CardRibbon } from '../../../components/atoms/CardRibbon/CardRibbon';
import { Flex } from '../../../components/box';
import InfoTooltipWithIcon from '../../../components/tooltip/InfoTooltipWithIcon';
import { Account } from '../../../components/user/UserInfoCard';
import { Theme } from '../../../theme/muiTheme';
import { LinkType } from '../../../types/shared/linkType';
import { parseText } from '../../../utils/textParser';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Account } from 'src/components/user/UserInfoCard';

import { Account } from '../../../components/user/UserInfoCard';
import { ImageType } from '../../../types/shared/imageType';

export type EcologicalCreditTypeType = {
Expand Down
32 changes: 20 additions & 12 deletions web-components/src/theme/colors.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import { cn } from "src/utils/styles/cn";
import { cn } from '../utils/styles/cn';

const Swatch = ({bgColor, className}: {bgColor: string, className?: string}) =>
<div className={cn(bgColor, className, "p-10 rounded-md")}>
const Swatch = ({
bgColor,
className,
}: {
bgColor: string;
className?: string;
}) => (
<div className={cn(bgColor, className, 'p-10 rounded-md')}>
{bgColor.substring(3)}
</div>
);

const Row = ({children}: {children: React.ReactNode}) =>
<div className="flex flex-row gap-10">
{children}
</div>
const Row = ({ children }: { children: React.ReactNode }) => (
<div className="flex flex-row gap-10">{children}</div>
);

const Pallete = () =>
const Pallete = () => (
<div className="flex flex-col gap-30 bg-grey-0 text-grey-700 p-50">
<Row>
<Swatch bgColor="bg-brand-400" />
Expand Down Expand Up @@ -47,6 +53,7 @@ const Pallete = () =>
<Swatch bgColor="bg-blue-100" />
</Row>
</div>
);

export default {
title: 'Colors',
Expand All @@ -56,8 +63,9 @@ export default {
export const Light = {};

export const Dark = {
render: () => <div className="dark">
<Pallete />
</div>
render: () => (
<div className="dark">
<Pallete />
</div>
),
};

2 changes: 1 addition & 1 deletion web-marketplace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"url-search-params-polyfill": "^8.1.0",
"use-analytics": "^0.0.5",
"vite-plugin-require": "^1.1.10",
"web-components": "^1.14.0",
"web-components": "workspace:*",
"zod": "^3.20.2"
},
"scripts": {
Expand Down
7 changes: 0 additions & 7 deletions web-storybook/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ module.exports = {
'../../web-marketplace/src/**/*.svg',
),
}),
tsconfigPaths({
root: path.resolve(__dirname, '.'),
projects: [
path.resolve(__dirname, '../../web-components/tsconfig.json'),
path.resolve(__dirname, '../../web-marketplace/tsconfig.json'),
],
}),
],
optimizeDeps: {
esbuildOptions: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from 'react';
import { Box } from '@mui/material';
import { makeStyles } from '@mui/styles';
import clsx from 'clsx';
import { makeStyles } from 'tss-react/mui';

import { Title } from 'web-components/lib/components/typography';
import { Theme } from 'web-components/lib/theme/muiTheme';
Expand All @@ -11,7 +11,7 @@ interface SectionProps {
children: ReactNode;
}

const useStyles = makeStyles((theme: Theme) => ({
const useStyles = makeStyles()((theme: Theme) => ({
text: {
fontSize: theme.spacing(4.5),
[theme.breakpoints.down('md')]: {
Expand Down Expand Up @@ -68,7 +68,7 @@ export const MarkdownSection = ({
title,
children,
}: SectionProps): JSX.Element => {
const classes = useStyles();
const { classes } = useStyles();
return (
<Box
sx={{ m: '0 auto', maxWidth: 1400, px: [2.8, 38], pb: [18.25, 21.25] }}
Expand Down
2 changes: 1 addition & 1 deletion web-www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"react-dom": "18.2.0",
"tss-react": "^4.8.2",
"typescript": "5.0.3",
"web-components": "^1.14.0"
"web-components": "workspace:*"
},
"devDependencies": {
"@graphql-codegen/cli": "1.21.4",
Expand Down
Loading

0 comments on commit 5da6b81

Please sign in to comment.