Skip to content

Commit

Permalink
revert: Refactor packages and add test (#4704)
Browse files Browse the repository at this point in the history
Revert "refactor: Add more packages and add test (#4691)"

This reverts commit 3ec12d9.
  • Loading branch information
chefilip authored Sep 10, 2022
1 parent 8b19133 commit f124260
Show file tree
Hide file tree
Showing 60 changed files with 2,100 additions and 2,162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
run: yarn install --frozen-lockfile

- name: Run tests
run: yarn test
run: yarn test --watchAll=false
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"test": "jest && yarn turbo run test",
"test": "jest",
"test:watch": "jest --watch",
"test:config": "jest src/config/__tests__/ --testPathIgnorePatterns",
"integration-test": "start-server-and-test start http://localhost:3000 'turbo run integration-test --filter=test'",
Expand Down Expand Up @@ -141,7 +141,6 @@
"ts-node": "^10.9.1",
"tsconfig": "*",
"turbo": "^1.4.5",
"typechain": "^6.1.0",
"vitest": "^0.23.1"
"typechain": "^6.1.0"
}
}
2 changes: 0 additions & 2 deletions packages/hooks/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
export { default as usePreviousValue } from './usePreviousValue'
export { default as useLastUpdated } from './useLastUpdated'
export { default as useInterval } from './useInterval'
export { default as useIsWindowVisible } from './useIsWindowVisible'
9 changes: 0 additions & 9 deletions packages/token-lists/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/token-lists/src/index.ts

This file was deleted.

56 changes: 0 additions & 56 deletions packages/token-lists/src/lists.ts

This file was deleted.

201 changes: 0 additions & 201 deletions packages/token-lists/src/reducer.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/uikit/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { vanillaExtractPlugin } = require("@vanilla-extract/vite-plugin");

module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
Expand All @@ -14,8 +12,4 @@ module.exports = {
"themeprovider-storybook/register",
],
core: { builder: "@storybook/builder-vite" },
async viteFinal(config) {
config.plugins.push(vanillaExtractPlugin());
return config;
},
};
33 changes: 4 additions & 29 deletions packages/uikit/.storybook/preview.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, { useEffect } from "react";
import React from "react";
import { withThemesProvider } from "themeprovider-storybook";
import { ThemeProvider as NextThemeProvider, useTheme as useNextTheme } from "next-themes";
import light from "../src/theme/light";
import dark from "../src/theme/dark";
import ResetCSS from "../src/ResetCSS";
import { ModalProvider } from "../src/widgets/Modal";
import { MatchBreakpointsProvider } from "../src";
import { ThemeProvider } from "styled-components";

const globalDecorator = (StoryFn) => (
<MatchBreakpointsProvider>
Expand All @@ -17,45 +15,22 @@ const globalDecorator = (StoryFn) => (
</MatchBreakpointsProvider>
);

const StyledThemeProvider = (props) => {
const { setTheme } = useNextTheme();

useEffect(() => {
setTheme(props.theme.name);
}, [props.theme.name]);

return <ThemeProvider {...props}>{props.children}</ThemeProvider>;
};

const StorybookThemeProvider = (props) => {
return (
<NextThemeProvider>
<StyledThemeProvider {...props} />
</NextThemeProvider>
);
};

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
layout: "fullscreen",
};

const themes = [
{
name: "light",
name: "Light",
backgroundColor: light.colors.background,
...light,
},
{
name: "dark",
name: "Dark",
backgroundColor: dark.colors.background,
...dark,
},
];

export const decorators = [
globalDecorator,
withThemesProvider(themes, {
CustomThemeProvider: StorybookThemeProvider,
}),
];
export const decorators = [globalDecorator, withThemesProvider(themes)];
2 changes: 1 addition & 1 deletion packages/uikit/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
presets: ["@babel/preset-env", ["@babel/preset-react", { runtime: "automatic" }]],
plugins: ["styled-components", "@vanilla-extract/babel-plugin"],
plugins: ["styled-components"],
};
7 changes: 0 additions & 7 deletions packages/uikit/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@ module.exports = {
"\\.(js|jsx)?$": "babel-jest",
"^.+\\.svg$": "<rootDir>/svgTransform.js",
},
globals: {
"ts-jest": {
babelConfig: {
plugins: ["@vanilla-extract/babel-plugin"],
},
},
},
testEnvironment: "jsdom",
};
Loading

1 comment on commit f124260

@vercel
Copy link

@vercel vercel bot commented on f124260 Sep 10, 2022

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.