Skip to content

Commit

Permalink
fix(packages/ui): Storybook deploy fix (#15252)
Browse files Browse the repository at this point in the history
* update build config

* update build config

* update build config

* optimise build command

* update ui package build script

* optimise vecel build config

* update entry

* update entry

* remove custom entry html

* tidy package.json

* improve config typings

* update yarn.lock

* update config

* update readme
  • Loading branch information
0xTxbi authored Dec 12, 2024
1 parent 9889b9a commit e754e99
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 42 deletions.
10 changes: 8 additions & 2 deletions packages/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { mergeConfig } from 'vite'
import type { StorybookConfig } from '@storybook/react-vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import svgr from 'vite-plugin-svgr'
export default {

const config: StorybookConfig = {
stories: ['../lib/**/*.stories.mdx', '../lib/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
staticDirs: ['../public'],
framework: '@storybook/react-vite',
core: {
builder: '@storybook/builder-vite',
},
async viteFinal(config) {
// Merge custom configuration into the default config
return mergeConfig(config, {
Expand All @@ -18,4 +23,5 @@ export default {
})
},
}
export const framework = '@storybook/react'

export default config
2 changes: 1 addition & 1 deletion packages/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This package includes React Components used across our products.

## Component Playground

Explore the components at [storybook.unlock-protocol.com](https://storybook.unlock-protocol.com) – an interactive playground for testing and previewing.
Explore the components at [ui.unlock-protocol.com](https://ui.unlock-protocol.com) – an interactive playground for testing and previewing.

## Using the package

Expand Down
7 changes: 2 additions & 5 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@
"build": "yarn build:lib && yarn build:cdn && tsup ./lib/index.tsx --dts-only",
"build:lib": "vite build",
"build:cdn": "IS_CDN=1 && vite build",
"storybook": "storybook dev -p 6006 -s public",
"build-storybook": "storybook build -s public",
"serve-storybook": "serve storybook-static"
"storybook": "storybook dev -p 6006",
"build-storybook": "STORYBOOK=true storybook build"
},
"dependencies": {
"@headlessui/react": "2.2.0",
"@radix-ui/react-tooltip": "1.1.4",
"@tailwindcss/aspect-ratio": "0.4.2",
"@tailwindcss/forms": "0.5.9",
Expand Down Expand Up @@ -61,7 +59,6 @@
"directory": "packages/ui"
},
"devDependencies": {
"@headlessui/react": "2.2.0",
"@mdx-js/preact": "3.1.0",
"@mdx-js/react": "3.1.0",
"@storybook/addon-actions": "8.4.6",
Expand Down
30 changes: 0 additions & 30 deletions packages/ui/public/index.html

This file was deleted.

6 changes: 3 additions & 3 deletions packages/ui/vercel.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"buildCommand": "npm run build-storybook",
"devCommand": "npm run storybook",
"installCommand": "npm install",
"buildCommand": "cd .. && yarn build && yarn workspace @unlock-protocol/networks build && yarn workspace @unlock-protocol/ui build-storybook",
"devCommand": "yarn storybook",
"installCommand": "yarn install",
"framework": null,
"outputDirectory": "./storybook-static"
}
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18355,7 +18355,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@unlock-protocol/ui@workspace:packages/ui"
dependencies:
"@headlessui/react": "npm:2.2.0"
"@mdx-js/preact": "npm:3.1.0"
"@mdx-js/react": "npm:3.1.0"
"@radix-ui/react-tooltip": "npm:1.1.4"
Expand Down

0 comments on commit e754e99

Please sign in to comment.