Skip to content

Commit

Permalink
feat: implement features demo component
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowusr committed May 13, 2024
1 parent 6d2ca8a commit 6bedb07
Show file tree
Hide file tree
Showing 103 changed files with 6,273 additions and 2,932 deletions.
58 changes: 38 additions & 20 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-webpack5-compiler-swc",
"@storybook/addon-onboarding",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
Expand All @@ -29,6 +28,34 @@ const config: StorybookConfig = {
},
}),
webpackFinal: config => {
if (config.module && config.module.rules) {
const { rules } = config.module;

const fileLoaderRule = rules.find(rule => rule?.test && rule.test.test(".svg")) as
| { exclude: RegExp }
| undefined;
if (fileLoaderRule) {
fileLoaderRule.exclude = /\.svg$/;
}

const cssLoaderIndex = rules.findIndex(rule => rule?.test && rule.test.test(".css"));
rules.splice(cssLoaderIndex, 1);
}

const postCssLoader = {
loader: "postcss-loader",
options: {
postcssOptions: {
ident: "postcss",
plugins: [
require("postcss-import"),
require("tailwindcss"),
require("autoprefixer"),
],
},
},
};

return {
...config,
resolve: {
Expand All @@ -43,25 +70,16 @@ const config: StorybookConfig = {
rules: [
...(config.module?.rules as Record<string, any>[]),
{
test: /\.(sa|sc|c)ss$/,
use: [
"style-loader",
"css-loader",
{
loader: "postcss-loader",
options: {
postcssOptions: {
ident: "postcss",
plugins: [
require("postcss-import"),
require("tailwindcss"),
require("autoprefixer"),
],
},
},
},
"sass-loader",
],
test: /\.(sa|sc)ss$/,
use: ["style-loader", "css-loader", postCssLoader, "sass-loader"],
},
{
test: /\.css$/,
use: ["style-loader", "css-loader", postCssLoader],
},
{
test: /\.svg$/,
use: ["@svgr/webpack"],
},
],
},
Expand Down
6 changes: 6 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100..900;1,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap"
rel="stylesheet"
/>
2 changes: 1 addition & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Preview } from "@storybook/react";

import "../src/scss/custom.scss";
import "../src/scss/custom.css";

const preview: Preview = {
parameters: {
Expand Down
12 changes: 10 additions & 2 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ const config: Config = {
defaultLocale: "en",
locales: ["en"],
},

headTags: [
{
tagName: "link",
attributes: {
href: "https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100..900;1,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",
rel: "stylesheet",
},
},
],
presets: [
[
"classic",
Expand All @@ -39,7 +47,7 @@ const config: Config = {
editUrl: "https://github.com/gemini-testing/testplane-docs/tree/main/blog/",
},
theme: {
customCss: "./src/scss/custom.scss",
customCss: "./src/scss/custom.css",
},
} satisfies Preset.Options,
],
Expand Down
7 changes: 6 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import geminiTesting from "eslint-config-gemini-testing";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import reactJsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js";
import prettier from "eslint-config-prettier";
import _ from "lodash";
import tseslint from "typescript-eslint";

export default tseslint.config(
Expand Down Expand Up @@ -47,7 +48,11 @@ export default tseslint.config(
reactRecommended,
reactJsxRuntime,
{
rules: geminiTesting.rules,
rules: _.omit(geminiTesting.rules, [
// Rules that conflict with typescript-eslint.
"no-undef",
"no-unused-vars",
]),
},
prettier,
);
Loading

0 comments on commit 6bedb07

Please sign in to comment.