From 29ea4d109452367b01282ee45e8476358d4a8e72 Mon Sep 17 00:00:00 2001 From: William Kelley Date: Thu, 16 May 2024 15:46:27 -0400 Subject: [PATCH] chore: remove src/lib directories; add fonts to all storybooks --- libs/storybook-host/.storybook/main.ts | 2 +- libs/storybook-host/.storybook/preview-head.html | 6 ++++++ libs/storybook-host/src/{lib => }/README.mdx | 0 libs/storybook-host/src/index.ts | 2 +- .../src/{lib => }/sample.stories.tsx | 0 packages/components/.storybook/main.ts | 2 +- packages/components/.storybook/preview-head.html | 6 ++++++ packages/components/src/README.mdx | 9 +++++++++ packages/components/src/index.ts | 2 +- packages/components/src/lib/components.spec.tsx | 10 ---------- packages/components/src/lib/components.stories.tsx | 13 ------------- packages/components/src/lib/components.tsx | 12 ------------ packages/components/src/sample.stories.tsx | 14 ++++++++++++++ packages/icons/.storybook/main.ts | 2 +- packages/icons/.storybook/preview-head.html | 6 ++++++ packages/icons/src/README.mdx | 9 +++++++++ packages/icons/src/index.ts | 2 +- packages/icons/src/lib/icons.spec.tsx | 10 ---------- packages/icons/src/lib/icons.stories.tsx | 13 ------------- packages/icons/src/lib/icons.tsx | 12 ------------ packages/icons/src/sample.stories.tsx | 14 ++++++++++++++ 21 files changed, 70 insertions(+), 76 deletions(-) create mode 100644 libs/storybook-host/.storybook/preview-head.html rename libs/storybook-host/src/{lib => }/README.mdx (100%) rename libs/storybook-host/src/{lib => }/sample.stories.tsx (100%) create mode 100644 packages/components/.storybook/preview-head.html create mode 100644 packages/components/src/README.mdx delete mode 100644 packages/components/src/lib/components.spec.tsx delete mode 100644 packages/components/src/lib/components.stories.tsx delete mode 100644 packages/components/src/lib/components.tsx create mode 100644 packages/components/src/sample.stories.tsx create mode 100644 packages/icons/.storybook/preview-head.html create mode 100644 packages/icons/src/README.mdx delete mode 100644 packages/icons/src/lib/icons.spec.tsx delete mode 100644 packages/icons/src/lib/icons.stories.tsx delete mode 100644 packages/icons/src/lib/icons.tsx create mode 100644 packages/icons/src/sample.stories.tsx diff --git a/libs/storybook-host/.storybook/main.ts b/libs/storybook-host/.storybook/main.ts index 224b3a0f5..64ceef869 100644 --- a/libs/storybook-host/.storybook/main.ts +++ b/libs/storybook-host/.storybook/main.ts @@ -3,7 +3,7 @@ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; import { mergeConfig } from 'vite'; const config: StorybookConfig = { - stories: ['../src/lib/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'], + stories: ['../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'], addons: [ '@storybook/addon-essentials', '@storybook/addon-mdx-gfm', diff --git a/libs/storybook-host/.storybook/preview-head.html b/libs/storybook-host/.storybook/preview-head.html new file mode 100644 index 000000000..110d6fb20 --- /dev/null +++ b/libs/storybook-host/.storybook/preview-head.html @@ -0,0 +1,6 @@ + + + diff --git a/libs/storybook-host/src/lib/README.mdx b/libs/storybook-host/src/README.mdx similarity index 100% rename from libs/storybook-host/src/lib/README.mdx rename to libs/storybook-host/src/README.mdx diff --git a/libs/storybook-host/src/index.ts b/libs/storybook-host/src/index.ts index 2dcd213af..cb0ff5c3b 100644 --- a/libs/storybook-host/src/index.ts +++ b/libs/storybook-host/src/index.ts @@ -1 +1 @@ -export * from './lib/storybook-host'; +export {}; diff --git a/libs/storybook-host/src/lib/sample.stories.tsx b/libs/storybook-host/src/sample.stories.tsx similarity index 100% rename from libs/storybook-host/src/lib/sample.stories.tsx rename to libs/storybook-host/src/sample.stories.tsx diff --git a/packages/components/.storybook/main.ts b/packages/components/.storybook/main.ts index 1b66f930b..96e16986f 100644 --- a/packages/components/.storybook/main.ts +++ b/packages/components/.storybook/main.ts @@ -1,7 +1,7 @@ import type { StorybookConfig } from '@storybook/react-vite'; const config: StorybookConfig = { - stories: ['../src/lib/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'], + stories: ['../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'], addons: ['@storybook/addon-essentials', '@chromatic-com/storybook'], framework: { name: '@storybook/react-vite', diff --git a/packages/components/.storybook/preview-head.html b/packages/components/.storybook/preview-head.html new file mode 100644 index 000000000..110d6fb20 --- /dev/null +++ b/packages/components/.storybook/preview-head.html @@ -0,0 +1,6 @@ + + + diff --git a/packages/components/src/README.mdx b/packages/components/src/README.mdx new file mode 100644 index 000000000..4894c3d81 --- /dev/null +++ b/packages/components/src/README.mdx @@ -0,0 +1,9 @@ +{/* README.mdx */} + +import { Meta } from '@storybook/blocks'; + + + +# `@prenda/components` + +The package for Prenda Design System (PDS) components. diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts index bb4b80226..cb0ff5c3b 100644 --- a/packages/components/src/index.ts +++ b/packages/components/src/index.ts @@ -1 +1 @@ -export * from './lib/components'; +export {}; diff --git a/packages/components/src/lib/components.spec.tsx b/packages/components/src/lib/components.spec.tsx deleted file mode 100644 index 553796b39..000000000 --- a/packages/components/src/lib/components.spec.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { render } from '@testing-library/react'; - -import Components from './components'; - -describe('Components', () => { - it('should render successfully', () => { - const { baseElement } = render(); - expect(baseElement).toBeTruthy(); - }); -}); diff --git a/packages/components/src/lib/components.stories.tsx b/packages/components/src/lib/components.stories.tsx deleted file mode 100644 index 4ddbd8ea0..000000000 --- a/packages/components/src/lib/components.stories.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { Components } from './components'; - -const meta: Meta = { - component: Components, - title: 'Components', -}; -export default meta; -type Story = StoryObj; - -export const Primary: Story = { - args: {}, -}; diff --git a/packages/components/src/lib/components.tsx b/packages/components/src/lib/components.tsx deleted file mode 100644 index f6af6e8f9..000000000 --- a/packages/components/src/lib/components.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-disable-next-line */ -export interface ComponentsProps {} - -export function Components(props: ComponentsProps) { - return ( -
-

Welcome to Components!

-
- ); -} - -export default Components; diff --git a/packages/components/src/sample.stories.tsx b/packages/components/src/sample.stories.tsx new file mode 100644 index 000000000..2f081fdc3 --- /dev/null +++ b/packages/components/src/sample.stories.tsx @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +const Sample = () => null; + +const meta: Meta = { + component: Sample, + title: 'Sample', +}; +export default meta; +type Story = StoryObj; + +export const Primary: Story = { + args: {}, +}; diff --git a/packages/icons/.storybook/main.ts b/packages/icons/.storybook/main.ts index 23f9d37c2..5fbc97049 100644 --- a/packages/icons/.storybook/main.ts +++ b/packages/icons/.storybook/main.ts @@ -1,7 +1,7 @@ import type { StorybookConfig } from '@storybook/react-vite'; const config: StorybookConfig = { - stories: ['../src/lib/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'], + stories: ['../src/**/*.@(mdx|stories.@(js|jsx|ts|tsx))'], addons: ['@storybook/addon-essentials', '@chromatic-com/storybook'], framework: { name: '@storybook/react-vite', diff --git a/packages/icons/.storybook/preview-head.html b/packages/icons/.storybook/preview-head.html new file mode 100644 index 000000000..110d6fb20 --- /dev/null +++ b/packages/icons/.storybook/preview-head.html @@ -0,0 +1,6 @@ + + + diff --git a/packages/icons/src/README.mdx b/packages/icons/src/README.mdx new file mode 100644 index 000000000..64184d203 --- /dev/null +++ b/packages/icons/src/README.mdx @@ -0,0 +1,9 @@ +{/* README.mdx */} + +import { Meta } from '@storybook/blocks'; + + + +# `@prenda/icons` + +The package for Prenda Design System (PDS) icons. diff --git a/packages/icons/src/index.ts b/packages/icons/src/index.ts index 7fa8d75d7..cb0ff5c3b 100644 --- a/packages/icons/src/index.ts +++ b/packages/icons/src/index.ts @@ -1 +1 @@ -export * from './lib/icons'; +export {}; diff --git a/packages/icons/src/lib/icons.spec.tsx b/packages/icons/src/lib/icons.spec.tsx deleted file mode 100644 index 05316922a..000000000 --- a/packages/icons/src/lib/icons.spec.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { render } from '@testing-library/react'; - -import Icons from './icons'; - -describe('Icons', () => { - it('should render successfully', () => { - const { baseElement } = render(); - expect(baseElement).toBeTruthy(); - }); -}); diff --git a/packages/icons/src/lib/icons.stories.tsx b/packages/icons/src/lib/icons.stories.tsx deleted file mode 100644 index 228a830d0..000000000 --- a/packages/icons/src/lib/icons.stories.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react'; -import { Icons } from './icons'; - -const meta: Meta = { - component: Icons, - title: 'Icons', -}; -export default meta; -type Story = StoryObj; - -export const Primary: Story = { - args: {}, -}; diff --git a/packages/icons/src/lib/icons.tsx b/packages/icons/src/lib/icons.tsx deleted file mode 100644 index f023933d5..000000000 --- a/packages/icons/src/lib/icons.tsx +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-disable-next-line */ -export interface IconsProps {} - -export function Icons(props: IconsProps) { - return ( -
-

Welcome to Icons!

-
- ); -} - -export default Icons; diff --git a/packages/icons/src/sample.stories.tsx b/packages/icons/src/sample.stories.tsx new file mode 100644 index 000000000..2f081fdc3 --- /dev/null +++ b/packages/icons/src/sample.stories.tsx @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/react'; + +const Sample = () => null; + +const meta: Meta = { + component: Sample, + title: 'Sample', +}; +export default meta; +type Story = StoryObj; + +export const Primary: Story = { + args: {}, +};