Skip to content

Commit

Permalink
lint + fix storybook ci bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherChudzicki committed Dec 16, 2024
1 parent e398438 commit cec8a5c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@ import { join, dirname } from "path"
import { StorybookConfig } from "@storybook/react-webpack5"
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin"
import { exec as execCb } from "child_process"
const promisify = require("util").promisify
import { promisify } from "util"

const exec = promisify(execCb)
const getGitSha = async (): Promise<string> => {
const { stdout } = await exec("git rev-parse HEAD")
return stdout.trim()
}

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string) {
return dirname(require.resolve(join(value, "package.json")))
}

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.tsx"],

Expand All @@ -26,10 +18,10 @@ const config: StorybookConfig = {
staticDirs: ["./public"],

addons: [
getAbsolutePath("@storybook/addon-links"),
getAbsolutePath("@storybook/addon-essentials"),
getAbsolutePath("@storybook/addon-interactions"),
getAbsolutePath("@storybook/addon-webpack5-compiler-swc"),
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-webpack5-compiler-swc",
],

webpackFinal: async (config) => {
Expand Down

0 comments on commit cec8a5c

Please sign in to comment.