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

[apps/www] Add storybook back #93

Merged
merged 66 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
f4bb394
wip
54nd10 Jan 4, 2024
2d256bf
avatar stories
54nd10 Jan 4, 2024
36b452d
badge stories
54nd10 Jan 4, 2024
3a315dc
dynamic images stories
54nd10 Jan 4, 2024
51c13da
icon stories
54nd10 Jan 4, 2024
dfbf2e6
checkbox stories
54nd10 Jan 4, 2024
906cccc
input stories
54nd10 Jan 4, 2024
072e4c1
textarea stories
54nd10 Jan 4, 2024
03eca1c
content-section stories
54nd10 Jan 4, 2024
d8718e0
wip
54nd10 Jan 4, 2024
d67619e
[apps/www/src/components/ui/molecules] Add molecules stories
54nd10 Jan 5, 2024
9538159
[apps/www/src/components/ui/organisms] Add organisms stories
54nd10 Jan 5, 2024
78eab5e
wip
54nd10 Jan 5, 2024
9216777
Update storybook.yml
54nd10 Jan 5, 2024
ab34387
wip
54nd10 Jan 5, 2024
fbe7b9d
Update storybook.yml
54nd10 Jan 5, 2024
ed356e7
Update storybook.yml
54nd10 Jan 5, 2024
084d680
Update storybook.yml
54nd10 Jan 5, 2024
3ec574a
wip
54nd10 Jan 5, 2024
f2f0c77
wip
54nd10 Jan 5, 2024
d403a44
Update storybook.yml
54nd10 Jan 5, 2024
c8e1914
Update storybook-checker.ts
54nd10 Jan 5, 2024
784a200
wip
54nd10 Jan 5, 2024
16255a5
Update storybook.yml
54nd10 Jan 5, 2024
538aa5c
Update storybook.yml
54nd10 Jan 5, 2024
54e4198
Update storybook-checker.ts
54nd10 Jan 5, 2024
41a23eb
wip
54nd10 Jan 5, 2024
b7c3d56
wip
54nd10 Jan 5, 2024
3b49cf7
Update storybook.yml
54nd10 Jan 5, 2024
dcde992
Update storybook.yml
54nd10 Jan 5, 2024
d539213
Update storybook-checker.ts
54nd10 Jan 5, 2024
96d13fd
wip
54nd10 Jan 5, 2024
c9f6905
Delete index.tsx
54nd10 Jan 5, 2024
1eb2ea4
Update storybook-checker.ts
54nd10 Jan 5, 2024
6bb2e8b
wip
54nd10 Jan 7, 2024
9089973
wip
54nd10 Jan 7, 2024
02048d4
Update storybook.yml
54nd10 Jan 7, 2024
303082e
wip
54nd10 Jan 7, 2024
fa1be62
Update storybook.yml
54nd10 Jan 7, 2024
bd82666
Update linter.yml
54nd10 Jan 7, 2024
1d11f6e
Update storybook.yml
54nd10 Jan 7, 2024
24e4fe1
wip
54nd10 Jan 7, 2024
b131c02
Update storybook-checker.ts
54nd10 Jan 7, 2024
56291d4
Update storybook-checker.ts
54nd10 Jan 7, 2024
6cb1f25
Update storybook.yml
54nd10 Jan 7, 2024
8162384
Update storybook-checker.ts
54nd10 Jan 7, 2024
090345a
wip
54nd10 Jan 7, 2024
00b48d2
Update storybook.yml
54nd10 Jan 7, 2024
5f77733
wip
54nd10 Jan 7, 2024
1bd2e84
wip
54nd10 Jan 7, 2024
ba2559d
Update storybook-checker.ts
54nd10 Jan 7, 2024
c377000
Update storybook.yml
54nd10 Jan 7, 2024
d88800f
wip
54nd10 Jan 7, 2024
761f196
Update storybook-checker.ts
54nd10 Jan 7, 2024
ec8fba0
[www/components/ui/svgs] Add svgs stories
54nd10 Jan 7, 2024
4220383
Create diagram-full-width.stories.tsx
54nd10 Jan 7, 2024
87fa75e
wip
54nd10 Jan 7, 2024
60406b7
Update ci.yml
54nd10 Jan 7, 2024
bcac80d
Update ci.yml
54nd10 Jan 7, 2024
0ea196d
[.workflows/ci] Should fail if missing stories
54nd10 Jan 8, 2024
1f6da4e
[.workflows/ci] Should fail if missing stories test
54nd10 Jan 8, 2024
16b0cb3
wip
54nd10 Jan 8, 2024
520b8bd
Update ci.yml
54nd10 Jan 8, 2024
8916480
Delete index.tsx
54nd10 Jan 8, 2024
d0d6fe1
wip
54nd10 Jan 8, 2024
9231dae
wip
54nd10 Jan 9, 2024
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
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on: pull_request

jobs:
linter:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: true
- name: Run linter
run: pnpm run lint
build:
name: Build Code Base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: true
- name: Build cms
run: pnpm run build
# Already done by vercel
# - name: Build www
# run: pnpm run build:www
component-check:
name: Storybook
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: 'Install Node'
uses: actions/setup-node@v3
with:
node-version: '20.x'
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Install dependencies
run: pnpm install -w www
- name: Check for missing stories
id: check
run: pnpm run storybook:check
- name: Comment PR
if: ${{failure() || success()}}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: './storybook-check.md'
- name: Fail if stories are missing
if: ${{failure()}}
run: exit 1
18 changes: 0 additions & 18 deletions .github/workflows/linter.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@ public/blog
.env
.vscode
*.dump
storybook-check.md
18 changes: 9 additions & 9 deletions apps/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
"strapi": "strapi"
},
"dependencies": {
"@strapi/plugin-i18n": "^4.15.5",
"@strapi/plugin-users-permissions": "4.15.5",
"@strapi/provider-upload-aws-s3": "^4.15.5",
"@strapi/strapi": "4.15.5",
"@strapi/typescript-utils": "^4.15.5",
"better-sqlite3": "9.1.1",
"@strapi/plugin-i18n": "^4.16.2",
"@strapi/plugin-users-permissions": "4.16.2",
"@strapi/provider-upload-aws-s3": "^4.16.2",
"@strapi/strapi": "4.16.2",
"@strapi/typescript-utils": "^4.16.2",
"better-sqlite3": "9.2.2",
"glob": "^10.3.10",
"pg": "^8.11.3",
"pg-connection-string": "^2.6.2",
"react": "^x",
"react-dom": "^x",
"react-router-dom": "^5.2.0",
"strapi-plugin-multi-select": "^1.2.2",
"react-router-dom": "x",
"strapi-plugin-multi-select": "^1.2.3",
"strapi-plugin-placeholder": "^4.4.0",
"strapi-plugin-populate-deep": "^3.0.1",
"strapi-plugin-preview-button": "^2.2.1",
Expand All @@ -39,7 +39,7 @@
"devDependencies": {
"@types/pg": "^8.10.9",
"dotenv": "^16.3.1",
"tsx": "^4.3.0"
"tsx": "^x"
},
"engines": {
"node": "18.x",
Expand Down
13 changes: 6 additions & 7 deletions apps/cms/src/plugins/revalidate-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@
"develop": "tsc -p tsconfig.server.json -w"
},
"dependencies": {
"@strapi/design-system": "^1.6.3",
"@strapi/helper-plugin": "^4.6.0",
"@strapi/icons": "^1.6.3",
"prop-types": "^15.7.2"
"@strapi/design-system": "^1.13.1",
"@strapi/helper-plugin": "^4.16.2",
"@strapi/icons": "^1.13.0",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@strapi/typescript-utils": "^4.6.0",
"@strapi/typescript-utils": "^4.16.2",
"@types/react": "x",
"@types/react-dom": "x",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.26",
"@types/styled-components": "^5.1.34",
"react": "x",
"react-dom": "x",
"react-router-dom": "^x",
"styled-components": "^5.3.6",
"typescript": "x"
},
"peerDependencies": {
Expand Down
71 changes: 71 additions & 0 deletions apps/cms/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,75 @@ export interface PluginUploadFolder extends Schema.CollectionType {
}
}

export interface PluginContentReleasesRelease extends Schema.CollectionType {
collectionName: 'strapi_releases'
info: {
singularName: 'release'
pluralName: 'releases'
displayName: 'Release'
}
options: {
draftAndPublish: false
}
pluginOptions: {
'content-manager': {
visible: false
}
'content-type-builder': {
visible: false
}
}
attributes: {
name: Attribute.String & Attribute.Required
releasedAt: Attribute.DateTime
actions: Attribute.Relation<
'plugin::content-releases.release',
'oneToMany',
'plugin::content-releases.release-action'
>
createdAt: Attribute.DateTime
updatedAt: Attribute.DateTime
createdBy: Attribute.Relation<'plugin::content-releases.release', 'oneToOne', 'admin::user'> & Attribute.Private
updatedBy: Attribute.Relation<'plugin::content-releases.release', 'oneToOne', 'admin::user'> & Attribute.Private
}
}

export interface PluginContentReleasesReleaseAction extends Schema.CollectionType {
collectionName: 'strapi_release_actions'
info: {
singularName: 'release-action'
pluralName: 'release-actions'
displayName: 'Release Action'
}
options: {
draftAndPublish: false
}
pluginOptions: {
'content-manager': {
visible: false
}
'content-type-builder': {
visible: false
}
}
attributes: {
type: Attribute.Enumeration<['publish', 'unpublish']> & Attribute.Required
entry: Attribute.Relation<'plugin::content-releases.release-action', 'morphToOne'>
contentType: Attribute.String & Attribute.Required
release: Attribute.Relation<
'plugin::content-releases.release-action',
'manyToOne',
'plugin::content-releases.release'
>
createdAt: Attribute.DateTime
updatedAt: Attribute.DateTime
createdBy: Attribute.Relation<'plugin::content-releases.release-action', 'oneToOne', 'admin::user'> &
Attribute.Private
updatedBy: Attribute.Relation<'plugin::content-releases.release-action', 'oneToOne', 'admin::user'> &
Attribute.Private
}
}

export interface PluginTranslateBatchTranslateJob extends Schema.CollectionType {
collectionName: 'translate_batch_translate_jobs'
info: {
Expand Down Expand Up @@ -1249,6 +1318,8 @@ declare module '@strapi/types' {
'admin::transfer-token-permission': AdminTransferTokenPermission
'plugin::upload.file': PluginUploadFile
'plugin::upload.folder': PluginUploadFolder
'plugin::content-releases.release': PluginContentReleasesRelease
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction
'plugin::translate.batch-translate-job': PluginTranslateBatchTranslateJob
'plugin::i18n.locale': PluginI18NLocale
'plugin::users-permissions.permission': PluginUsersPermissionsPermission
Expand Down
37 changes: 37 additions & 0 deletions apps/www/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type {StorybookConfig} from '@storybook/nextjs'

import {join, dirname, resolve} from 'path'
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'
/**
* 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): any {
return dirname(require.resolve(join(value, 'package.json')))
}
const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-interactions')
],
framework: {
name: getAbsolutePath('@storybook/nextjs'),
options: {}
},
docs: {
autodocs: 'tag'
},
webpackFinal: async (config) => {
config.resolve.plugins = [
new TsconfigPathsPlugin({
configFile: resolve(__dirname, '../tsconfig.json')
})
]

return config
}
}
export default config
24 changes: 24 additions & 0 deletions apps/www/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type {Preview} from '@storybook/react'
import '../src/styles/global.css'
import config from '../tailwind.config'

const preview: Preview = {
parameters: {
backgrounds: {
default: '56kcloud',
values: [{name: '56kcloud', value: config.theme.extend.colors.background}]
},
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i
}
},
nextjs: {
appDirectory: true
}
}
}

export default preview
68 changes: 35 additions & 33 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,68 @@
"storybook": "storybook dev -p 6006"
},
"dependencies": {
"@faker-js/faker": "^8.2.0",
"@heroicons/react": "^2.0.18",
"@heroicons/react": "^2.1.1",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@slack/web-api": "^6.11.0",
"@types/luxon": "^3.3.3",
"child_process": "^1.0.2",
"clsx": "^2.0.0",
"date-fns": "^2.30.0",
"clsx": "^2.1.0",
"date-fns": "^3.1.0",
"dotenv": "^16.3.1",
"framer-motion": "^10.16.4",
"humanize-duration": "^3.30.0",
"lucide-react": "0.298.0",
"luxon": "^3.4.3",
"markdown-to-jsx": "^7.3.2",
"next": "^14.0.1",
"next-translate": "^2.6.1",
"next-translate-plugin": "^2.6.1",
"framer-motion": "^10.17.9",
"humanize-duration": "^3.31.0",
"lucide-react": "0.307.0",
"luxon": "^3.4.4",
"markdown-to-jsx": "^7.4.0",
"next": "^14.0.4",
"notion-to-tailwind": "0.0.12",
"open-graph-scraper": "^6.3.2",
"plaiceholder": "^3.0.0",
"react": "x",
"react-confetti-explosion": "^2.1.2",
"react-dom": "x",
"react-hook-form": "^7.47.0",
"react-image-size": "^2.0.2",
"react-hook-form": "^7.49.2",
"react-image-size": "^2.3.2",
"react-responsive-masonry": "^2.1.7",
"react-twitter-widgets": "^1.11.0",
"slugify": "^1.6.6",
"tailwind-merge": "^2.0.0",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.22.4"
},
"devDependencies": {
"@faker-js/faker": "^x",
"@headlessui/react": "^1.7.17",
"@storybook/addon-essentials": "^7.5.2",
"@storybook/addon-interactions": "^7.5.2",
"@storybook/addon-links": "^7.5.2",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-interactions": "^7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/addon-onboarding": "^1.0.10",
"@storybook/addon-styling": "^1.3.7",
"@storybook/blocks": "^7.5.2",
"@storybook/nextjs": "^7.5.2",
"@storybook/react": "^7.5.2",
"@storybook/react-webpack5": "^7.5.2",
"@storybook/blocks": "^7.6.7",
"@storybook/nextjs": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/react-webpack5": "^7.6.7",
"@storybook/test": "^7.6.7",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.6",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.10",
"@types/humanize-duration": "^3.27.2",
"@types/node": "^20.8.10",
"@types/humanize-duration": "^3.27.4",
"@types/luxon": "^3.4.0",
"@types/node": "^x",
"@types/react": "^x",
"@types/react-responsive-masonry": "^2.1.2",
"@types/react-responsive-masonry": "^2.1.3",
"autoprefixer": "^10.4.16",
"buffer-image-size": "^0.6.4",
"eslint-config-next": "14.0.1",
"eslint-config-next": "14.0.4",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-storybook": "^0.6.15",
"postcss": "^8.4.31",
"storybook": "^7.5.2",
"tailwindcss": "^3.3.5",
"typescript": "^5.2.2"
"fast-glob": "^3.3.2",
"postcss": "^8.4.33",
"storybook": "^7.6.7",
"tailwindcss": "^3.4.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"tsx": "x",
"typescript": "^5.3.3"
}
}
Loading
Loading