Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update storybook monorepo to v8 (major) #4792

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions apps/hashdotdesign/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
import { dirname, join } from "path";
module.exports = {
stories: [
"../../../libs/@hashintel/design-system/src/**/*.mdx",
"../../../libs/@hashintel/design-system/src/**/*.stories.@(js|jsx|ts|tsx)",
"../../../libs/@hashintel/block-design-system/src/**/*.mdx",
"../../../libs/@hashintel/block-design-system/src/**/*.stories.@(js|jsx|ts|tsx)",
],

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

babel: async (options) => {
return {
...options,
presets: [...options.presets, "@babel/preset-react"],
};
},

framework: {
name: "@storybook/react-webpack5",
name: getAbsolutePath("@storybook/react-webpack5"),
options: {},
},

core: {
disableTelemetry: true,
},

docs: {
docsPage: true,
},

typescript: {
reactDocgen: "react-docgen-typescript",
},
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, "package.json")));
Copy link

Choose a reason for hiding this comment

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

Detected possible user input going into a path.join or path.resolve function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first.

View Dataflow Graph
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>apps/hashdotdesign/.storybook/main.js</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0["<a href=https://github.com/hashintel/hash/blob/726e5712a27dc56fc57d382121f14fd5e1715e74/apps/hashdotdesign/.storybook/main.js#L35 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 35] value</a>"]
        end
        %% Intermediate

        subgraph Traces0[Traces]
            direction TB

            v2["<a href=https://github.com/hashintel/hash/blob/726e5712a27dc56fc57d382121f14fd5e1715e74/apps/hashdotdesign/.storybook/main.js#L35 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 35] value</a>"]
        end
        %% Sink

        subgraph Sink
            direction LR

            v1["<a href=https://github.com/hashintel/hash/blob/726e5712a27dc56fc57d382121f14fd5e1715e74/apps/hashdotdesign/.storybook/main.js#L36 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 36] value</a>"]
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    Traces0:::invis
    File0:::invis

    %% Connections

    Source --> Traces0
    Traces0 --> Sink

Loading
Ignore this finding from path-join-resolve-traversal.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal Warning

Detected possible user input going into a path.join or path.resolve function. This could possibly lead to a path traversal vulnerability, where the attacker can access arbitrary files stored in the file system. Instead, be sure to sanitize or validate user input first.
}
18 changes: 10 additions & 8 deletions apps/hashdotdesign/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@
},
"devDependencies": {
"@babel/preset-env": "7.23.9",
"@babel/preset-react": "7.24.7",
"@babel/preset-typescript": "7.23.3",
"@hashintel/block-design-system": "0.0.2",
"@hashintel/design-system": "0.0.8",
"@local/eslint-config": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@storybook/addon-essentials": "7.0.5",
"@storybook/addon-interactions": "7.0.5",
"@storybook/addon-links": "7.0.5",
"@storybook/blocks": "7.0.5",
"@storybook/react": "7.0.5",
"@storybook/react-webpack5": "7.0.5",
"@storybook/testing-library": "0.1.0",
"@storybook/addon-essentials": "^8.2.7",
"@storybook/addon-interactions": "^8.2.7",
"@storybook/addon-links": "^8.2.7",
"@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/blocks": "^8.2.7",
"@storybook/react": "^8.2.7",
"@storybook/react-webpack5": "^8.2.7",
"@storybook/test": "^8.2.7",
"@types/react": "18.2.68",
"@types/react-dom": "18.2.25",
"storybook": "7.0.5"
"storybook": "^8.2.7"
},
"peerDependencies": {
"@emotion/cache": "11.11.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/plugin-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@babel/eslint-parser": "7.23.10",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/preset-env": "7.23.9",
"@babel/preset-react": "7.23.3",
"@babel/preset-react": "7.24.7",
"@blockprotocol/core": "0.1.3",
"@graphql-codegen/cli": "5.0.0",
"@local/eslint-config": "0.0.0-private",
Expand Down
2 changes: 1 addition & 1 deletion libs/@hashintel/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@local/tsconfig": "0.0.0-private",
"@mui/material": "5.14.11",
"@mui/system": "5.14.11",
"@storybook/react": "7.0.5",
"@storybook/react": "^8.2.7",
"@types/react": "18.2.68",
"@types/react-dom": "18.2.25",
"eslint": "8.57.0",
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@babel/core": "7.23.9",
"@babel/eslint-parser": "7.23.10",
"@babel/preset-react": "7.23.3",
"@babel/preset-react": "7.24.7",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"eslint": "8.57.0",
Expand Down
Loading
Loading