mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 15:35:22 +02:00
Fix .babelrc issue and readd Storybook support in client
This commit is contained in:
parent
2d3eae7351
commit
c6c529e18c
7 changed files with 79 additions and 3 deletions
4
apps/client/.babelrc.json
Normal file
4
apps/client/.babelrc.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"presets": ["next/babel"],
|
||||||
|
"plugins": []
|
||||||
|
}
|
18
apps/client/.storybook/main.js
Normal file
18
apps/client/.storybook/main.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
const rootMain = require('../../../.storybook/main')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
...rootMain,
|
||||||
|
core: { ...rootMain.core, builder: 'webpack5' },
|
||||||
|
stories: ['../**/*.stories.@(js|jsx|ts|tsx)'],
|
||||||
|
addons: [...rootMain.addons, '@nrwl/react/plugins/storybook'],
|
||||||
|
webpackFinal: async (config, { configType }) => {
|
||||||
|
// apply any global webpack configs that might have been specified in .storybook/main.js
|
||||||
|
if (rootMain.webpackFinal) {
|
||||||
|
config = await rootMain.webpackFinal(config, { configType })
|
||||||
|
}
|
||||||
|
|
||||||
|
// add your own webpack tweaks if needed
|
||||||
|
|
||||||
|
return config
|
||||||
|
},
|
||||||
|
}
|
7
apps/client/.storybook/tsconfig.json
Normal file
7
apps/client/.storybook/tsconfig.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowImportingTsExtensions": true
|
||||||
|
},
|
||||||
|
"include": ["**/*.ts", "**/*.tsx", "**/**/*.ts", "**/**/*.tsx"]
|
||||||
|
}
|
18
apps/client/components/Maintenance.stories.tsx
Normal file
18
apps/client/components/Maintenance.stories.tsx
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import type { Story, Meta } from '@storybook/react'
|
||||||
|
import Maintenance from './Maintenance.tsx'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'components/Maintenance.tsx',
|
||||||
|
component: Maintenance,
|
||||||
|
} as Meta
|
||||||
|
|
||||||
|
const Template: Story = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Maintenance />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Base = Template.bind({})
|
|
@ -1,4 +1,4 @@
|
||||||
import { Badge, BadgeVariant } from '@maybe-finance/design-system'
|
import { Badge, type BadgeVariant as BadgeVariantType } from '@maybe-finance/design-system'
|
||||||
import type { SharedType } from '@maybe-finance/shared'
|
import type { SharedType } from '@maybe-finance/shared'
|
||||||
import { NumberUtil } from '@maybe-finance/shared'
|
import { NumberUtil } from '@maybe-finance/shared'
|
||||||
import cn from 'classnames'
|
import cn from 'classnames'
|
||||||
|
@ -12,7 +12,9 @@ type TrendBadgeProps = {
|
||||||
displayAmount?: boolean
|
displayAmount?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const BadgeVariant = (negative: boolean): Record<SharedType.Trend['direction'], BadgeVariant> => ({
|
const BadgeVariant = (
|
||||||
|
negative: boolean
|
||||||
|
): Record<SharedType.Trend['direction'], BadgeVariantType> => ({
|
||||||
down: negative ? 'teal' : 'red',
|
down: negative ? 'teal' : 'red',
|
||||||
up: negative ? 'red' : 'teal',
|
up: negative ? 'red' : 'teal',
|
||||||
flat: 'gray',
|
flat: 'gray',
|
||||||
|
|
|
@ -66,6 +66,33 @@
|
||||||
"options": {
|
"options": {
|
||||||
"command": "node tools/scripts/triggerClientDeploy.js"
|
"command": "node tools/scripts/triggerClientDeploy.js"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"storybook": {
|
||||||
|
"executor": "@nrwl/storybook:storybook",
|
||||||
|
"options": {
|
||||||
|
"uiFramework": "@storybook/react",
|
||||||
|
"port": 4400,
|
||||||
|
"configDir": "apps/client/.storybook"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"ci": {
|
||||||
|
"quiet": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"build-storybook": {
|
||||||
|
"executor": "@nrwl/storybook:build",
|
||||||
|
"outputs": ["{options.outputDir}"],
|
||||||
|
"options": {
|
||||||
|
"uiFramework": "@storybook/react",
|
||||||
|
"outputDir": "dist/storybook/client",
|
||||||
|
"configDir": "apps/client/.storybook"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"ci": {
|
||||||
|
"quiet": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tags": ["scope:app"]
|
"tags": ["scope:app"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue