There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
refactor(storybook): move to `apps` folder (#2901)
Alex Yang91d3b76be59f
diff --git a/.commitlintrc.json b/.commitlintrc.jsonindex 11287fcbdf..e368393d5f 100644--- a/.commitlintrc.json+++ b/.commitlintrc.json@@ -9,6 +9,7 @@"server","web","docs",+ "storybook","component","workspace","env",@@ -20,8 +21,7 @@"native","templates","y-indexeddb",- "debug",- "theme"+ "debug"]]}diff --git a/.eslintrc.js b/.eslintrc.jsindex 8387eb09a6..2a7f180803 100644--- a/.eslintrc.js+++ b/.eslintrc.js@@ -41,6 +41,7 @@ const allPackages = ['apps/web','apps/server','apps/electron',+ 'apps/storybook','plugins/copilot','plugins/bookmark-block',];diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 9fb8f97131..2824188b18 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -78,7 +78,7 @@ jobs:uses: actions/upload-artifact@v3with:name: storybook- path: ./packages/storybook/storybook-static+ path: ./apps/storybook/storybook-staticif-no-files-found: errorbuild-web:@@ -191,9 +191,9 @@ jobs:uses: actions/download-artifact@v3with:name: storybook- path: ./packages/storybook/storybook-static+ path: ./apps/storybook/storybook-static- name: Run storybook tests- working-directory: ./packages/storybook+ working-directory: ./apps/storybookrun: |yarn exec concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "yarn exec serve ./storybook-static -l 6006" "yarn exec wait-on tcp:6006 && yarn test"@@ -232,7 +232,7 @@ jobs:uses: actions/download-artifact@v3with:name: storybook- path: ./packages/storybook/storybook-static+ path: ./apps/storybook/storybook-static- name: Wait for Octobase Readyrun: |diff --git a/packages/storybook/.storybook/main.ts b/apps/storybook/.storybook/main.tssimilarity index 100%rename from packages/storybook/.storybook/main.tsrename to apps/storybook/.storybook/main.tsdiff --git a/packages/storybook/.storybook/preview-head.html b/apps/storybook/.storybook/preview-head.htmlsimilarity index 100%rename from packages/storybook/.storybook/preview-head.htmlrename to apps/storybook/.storybook/preview-head.htmldiff --git a/packages/storybook/.storybook/preview.tsx b/apps/storybook/.storybook/preview.tsxsimilarity index 100%rename from packages/storybook/.storybook/preview.tsxrename to apps/storybook/.storybook/preview.tsxdiff --git a/packages/storybook/package.json b/apps/storybook/package.jsonsimilarity index 100%rename from packages/storybook/package.jsonrename to apps/storybook/package.jsondiff --git a/packages/storybook/src/stories/affine-banner.stories.tsx b/apps/storybook/src/stories/affine-banner.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/affine-banner.stories.tsxrename to apps/storybook/src/stories/affine-banner.stories.tsxdiff --git a/packages/storybook/src/stories/affine-loading.stories.tsx b/apps/storybook/src/stories/affine-loading.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/affine-loading.stories.tsxrename to apps/storybook/src/stories/affine-loading.stories.tsxdiff --git a/packages/storybook/src/stories/app-sidebar.stories.tsx b/apps/storybook/src/stories/app-sidebar.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/app-sidebar.stories.tsxrename to apps/storybook/src/stories/app-sidebar.stories.tsxdiff --git a/packages/storybook/src/stories/block-suite-editor.stories.tsx b/apps/storybook/src/stories/block-suite-editor.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/block-suite-editor.stories.tsxrename to apps/storybook/src/stories/block-suite-editor.stories.tsxdiff --git a/packages/storybook/src/stories/breadcrumbs.stories.tsx b/apps/storybook/src/stories/breadcrumbs.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/breadcrumbs.stories.tsxrename to apps/storybook/src/stories/breadcrumbs.stories.tsxdiff --git a/packages/storybook/src/stories/button.stories.tsx b/apps/storybook/src/stories/button.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/button.stories.tsxrename to apps/storybook/src/stories/button.stories.tsxdiff --git a/packages/storybook/src/stories/card.stories.tsx b/apps/storybook/src/stories/card.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/card.stories.tsxrename to apps/storybook/src/stories/card.stories.tsxdiff --git a/packages/storybook/src/stories/change-log.stories.tsx b/apps/storybook/src/stories/change-log.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/change-log.stories.tsxrename to apps/storybook/src/stories/change-log.stories.tsxdiff --git a/packages/storybook/src/stories/contact-modal.stories.tsx b/apps/storybook/src/stories/contact-modal.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/contact-modal.stories.tsxrename to apps/storybook/src/stories/contact-modal.stories.tsxdiff --git a/packages/storybook/src/stories/datepicker.stories.tsx b/apps/storybook/src/stories/datepicker.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/datepicker.stories.tsxrename to apps/storybook/src/stories/datepicker.stories.tsxdiff --git a/packages/storybook/src/stories/image-preview-modal.stories.tsx b/apps/storybook/src/stories/image-preview-modal.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/image-preview-modal.stories.tsxrename to apps/storybook/src/stories/image-preview-modal.stories.tsxdiff --git a/packages/storybook/src/stories/introduction.stories.mdx b/apps/storybook/src/stories/introduction.stories.mdxsimilarity index 100%rename from packages/storybook/src/stories/introduction.stories.mdxrename to apps/storybook/src/stories/introduction.stories.mdxdiff --git a/packages/storybook/src/stories/notification-center.stories.tsx b/apps/storybook/src/stories/notification-center.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/notification-center.stories.tsxrename to apps/storybook/src/stories/notification-center.stories.tsxdiff --git a/packages/storybook/src/stories/onboarding-modal.stories.tsx b/apps/storybook/src/stories/onboarding-modal.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/onboarding-modal.stories.tsxrename to apps/storybook/src/stories/onboarding-modal.stories.tsxdiff --git a/packages/storybook/src/stories/page-detail-skeleton.stories.tsx b/apps/storybook/src/stories/page-detail-skeleton.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/page-detail-skeleton.stories.tsxrename to apps/storybook/src/stories/page-detail-skeleton.stories.tsxdiff --git a/packages/storybook/src/stories/page-list.stories.tsx b/apps/storybook/src/stories/page-list.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/page-list.stories.tsxrename to apps/storybook/src/stories/page-list.stories.tsxdiff --git a/packages/storybook/src/stories/share-menu.stories.tsx b/apps/storybook/src/stories/share-menu.stories.tsxsimilarity index 98%rename from packages/storybook/src/stories/share-menu.stories.tsxrename to apps/storybook/src/stories/share-menu.stories.tsxindex ced478bbab..6e222a8884 100644--- a/packages/storybook/src/stories/share-menu.stories.tsx+++ b/apps/storybook/src/stories/share-menu.stories.tsx@@ -3,7 +3,7 @@ import {PublicLinkDisableModal,StyledDisableButton,} from '@affine/component/share-menu';-import { ShareMenu } from '@affine/component/share-menu/share-menu';+import { ShareMenu } from '@affine/component/share-menu';import type {AffineLegacyCloudWorkspace,LocalWorkspace,diff --git a/packages/storybook/src/stories/switch.stories.tsx b/apps/storybook/src/stories/switch.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/switch.stories.tsxrename to apps/storybook/src/stories/switch.stories.tsxdiff --git a/packages/storybook/src/stories/workspace-avatar.stories.tsx b/apps/storybook/src/stories/workspace-avatar.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/workspace-avatar.stories.tsxrename to apps/storybook/src/stories/workspace-avatar.stories.tsxdiff --git a/packages/storybook/src/stories/workspace-list.stories.tsx b/apps/storybook/src/stories/workspace-list.stories.tsxsimilarity index 100%rename from packages/storybook/src/stories/workspace-list.stories.tsxrename to apps/storybook/src/stories/workspace-list.stories.tsxdiff --git a/packages/storybook/tsconfig.json b/apps/storybook/tsconfig.jsonsimilarity index 50%rename from packages/storybook/tsconfig.jsonrename to apps/storybook/tsconfig.jsonindex fa67cb8cca..4f4ebce10d 100644--- a/packages/storybook/tsconfig.json+++ b/apps/storybook/tsconfig.json@@ -2,17 +2,22 @@"extends": "../../tsconfig.json","include": ["./src"],"compilerOptions": {+ // Workaround for storybook build+ "baseUrl": "../..","composite": true,"noEmit": false,"outDir": "lib",- "paths": {- "@affine/component": ["../component/src"],- "@affine/component/*": ["../component/src/components/*"]- }+ "types": ["react/experimental"]},"references": [{- "path": "../component"+ "path": "../../packages/component"+ },+ {+ "path": "../../packages/env"+ },+ {+ "path": "../../packages/workspace"},{"path": "./tsconfig.node.json"diff --git a/packages/storybook/tsconfig.node.json b/apps/storybook/tsconfig.node.jsonsimilarity index 83%rename from packages/storybook/tsconfig.node.jsonrename to apps/storybook/tsconfig.node.jsonindex 69d90ecad8..080da0ce30 100644--- a/packages/storybook/tsconfig.node.json+++ b/apps/storybook/tsconfig.node.json@@ -13,9 +13,9 @@"include": [".storybook/**/*"],"exclude": ["lib"],"references": [- { "path": "../i18n" },+ { "path": "../../packages/i18n" },{- "path": "../env"+ "path": "../../packages/env"}]}diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.jsonindex 447a319486..d33bf2be10 100644--- a/apps/web/tsconfig.json+++ b/apps/web/tsconfig.json@@ -15,7 +15,8 @@"jsx": "preserve","jsxImportSource": "@emotion/react","incremental": true,- "experimentalDecorators": true+ "experimentalDecorators": true,+ "types": ["react/experimental"]},"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "src/types/types.d.ts"],"exclude": ["node_modules"],diff --git a/nx.json b/nx.jsonindex ca3dad2165..a152d02631 100644--- a/nx.json+++ b/nx.json@@ -32,7 +32,7 @@"{projectRoot}/node_modules/.cache","{projectRoot}/target","{workspaceRoot}/apps/web/.next",- "{workspaceRoot}/packages/storybook/storybook-static",+ "{workspaceRoot}/apps/storybook/storybook-static","{workspaceRoot}/packages/i18n/src/i18n-generated.ts","{workspaceRoot}/packages/native/affine.*.node","{workspaceRoot}/affine.db",diff --git a/package.json b/package.jsonindex 3183da27f5..c5027b5b2d 100644--- a/package.json+++ b/package.json@@ -22,7 +22,7 @@"build:storybook": "nx build @affine/storybook","build:plugins": "./apps/electron/scripts/plugins/build-plugins.mjs","start:web": "yarn workspace @affine/web start",- "start:storybook": "yarn exec serve packages/storybook/storybook-static -l 6006",+ "start:storybook": "yarn exec serve apps/storybook/storybook-static -l 6006","serve:test-static": "yarn exec serve tests/fixtures --cors -p 8081","lint": "eslint . --ext .js,mjs,.ts,.tsx --cache","lint:fix": "yarn lint --fix",diff --git a/tsconfig.json b/tsconfig.jsonindex c472f93a2f..45d8ff2ecb 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -96,6 +96,9 @@{"path": "./apps/server"},+ {+ "path": "./apps/storybook"+ },// Top level packages{"path": "./packages/infra"diff --git a/yarn.lock b/yarn.lockindex de065ca34a..476c7cce41 100644--- a/yarn.lock+++ b/yarn.lock@@ -426,9 +426,9 @@ __metadata:languageName: unknownlinkType: soft-"@affine/storybook@workspace:packages/storybook":+"@affine/storybook@workspace:apps/storybook":version: 0.0.0-use.local- resolution: "@affine/storybook@workspace:packages/storybook"+ resolution: "@affine/storybook@workspace:apps/storybook"dependencies:"@affine/component": "workspace:*""@affine/i18n": "workspace:*"