diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..f80d334591 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +**/project.json @darkskygit +**/pnpm-lock.yaml @darkskygit diff --git a/packages/app/next.config.js b/packages/app/next.config.js index 20f12e5770..6d7225864c 100644 --- a/packages/app/next.config.js +++ b/packages/app/next.config.js @@ -4,6 +4,11 @@ const { dependencies } = require('./package.json'); const path = require('node:path'); const printer = require('./scripts/printer').printer; +const enableDebugLocal = path.isAbsolute(process.env.LOCAL_BLOCK_SUITE ?? ''); +const EDITOR_VERSION = enableDebugLocal + ? 'local-version' + : dependencies['@blocksuite/editor']; + /** @type {import('next').NextConfig} */ const nextConfig = { productionBrowserSourceMaps: true, @@ -16,7 +21,7 @@ const nextConfig = { CI: process.env.CI || null, VERSION: getGitVersion(), COMMIT_HASH: getCommitHash(), - EDITOR_VERSION: dependencies['@blocksuite/editor'], + EDITOR_VERSION, }, webpack: config => { config.experiments = { ...config.experiments, topLevelAwait: true }; @@ -63,11 +68,25 @@ const baseDir = process.env.LOCAL_BLOCK_SUITE ?? '/'; const withDebugLocal = require('next-debug-local')( { '@blocksuite/editor': path.resolve(baseDir, 'packages', 'editor'), + '@blocksuite/blocks/models': path.resolve( + baseDir, + 'packages', + 'blocks', + 'src', + 'models' + ), + '@blocksuite/blocks/std': path.resolve( + baseDir, + 'packages', + 'blocks', + 'src', + 'std' + ), '@blocksuite/blocks': path.resolve(baseDir, 'packages', 'blocks'), '@blocksuite/store': path.resolve(baseDir, 'packages', 'store'), }, { - enable: path.isAbsolute(process.env.LOCAL_BLOCK_SUITE ?? ''), + enable: enableDebugLocal, } ); diff --git a/packages/app/package.json b/packages/app/package.json index 00b96a7fd1..ab9571a953 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -45,7 +45,7 @@ "@types/react": "18.0.20", "@types/react-dom": "18.0.6", "@types/wicg-file-system-access": "^2020.9.5", - "chalk-next": "^6.1.5", + "chalk": "^4.1.2", "eslint": "8.22.0", "eslint-config-next": "12.3.1", "eslint-config-prettier": "^8.5.0", diff --git a/packages/app/src/components/404/index.tsx b/packages/app/src/components/404/index.tsx index e2f828ad9f..7df644bbfe 100644 --- a/packages/app/src/components/404/index.tsx +++ b/packages/app/src/components/404/index.tsx @@ -1,9 +1,10 @@ import { NotFoundTitle, PageContainer } from './styles'; - +import { useTranslation } from 'react-i18next'; export const NotfoundPage = () => { + const { t } = useTranslation(); return ( - 404 - Page Not Found + {t('404 - Page Not Found')} ); }; diff --git a/packages/app/src/components/contact-modal/index.tsx b/packages/app/src/components/contact-modal/index.tsx index a182f3e047..921b34ba65 100644 --- a/packages/app/src/components/contact-modal/index.tsx +++ b/packages/app/src/components/contact-modal/index.tsx @@ -23,7 +23,7 @@ import { StyledModalFooter, } from './style'; import bg from '@/components/contact-modal/bg.png'; - +import { useTranslation } from 'react-i18next'; const linkList = [ { icon: , @@ -51,27 +51,31 @@ const linkList = [ link: 'https://discord.gg/Arn7TqJBvG', }, ]; -const rightLinkList = [ - { - icon: , - title: 'Official Website ', - subTitle: 'AFFiNE.pro', - link: 'https://affine.pro', - }, - { - icon: , - title: 'AFFiNE Community', - subTitle: 'community.affine.pro', - link: 'https://community.affine.pro', - }, -]; type TransitionsModalProps = { open: boolean; onClose: () => void; }; -export const ContactModal = ({ open, onClose }: TransitionsModalProps) => { +export const ContactModal = ({ + open, + onClose, +}: TransitionsModalProps): JSX.Element => { + const { t } = useTranslation(); + const rightLinkList = [ + { + icon: , + title: t('Official Website'), + subTitle: 'AFFiNE.pro', + link: 'https://affine.pro', + }, + { + icon: , + title: t('AFFiNE Community'), + subTitle: 'community.affine.pro', + link: 'https://community.affine.pro', + }, + ]; return ( { })} - Get in touch! + {t('Get in touch!')} {linkList.map(({ icon, title, link }) => { return ( @@ -128,7 +132,7 @@ export const ContactModal = ({ open, onClose }: TransitionsModalProps) => { target="_blank" rel="noreferrer" > - How is AFFiNE Alpha different? + {t('How is AFFiNE Alpha different?')}

Copyright © 2022 Toeverything

diff --git a/packages/app/src/components/editor-mode-switch/index.tsx b/packages/app/src/components/editor-mode-switch/index.tsx index 8a219e4757..86a54d8606 100644 --- a/packages/app/src/components/editor-mode-switch/index.tsx +++ b/packages/app/src/components/editor-mode-switch/index.tsx @@ -15,7 +15,7 @@ import { useTheme } from '@/providers/themeProvider'; import { EdgelessIcon, PaperIcon } from './icons'; import useCurrentPageMeta from '@/hooks/use-current-page-meta'; import { usePageHelper } from '@/hooks/use-page-helper'; - +import { useTranslation } from 'react-i18next'; const PaperItem = ({ active }: { active?: boolean }) => { const { theme: { @@ -96,7 +96,7 @@ export const EditorModeSwitch = ({ setRadioItemStatus(modifyRadioItemStatus()); // eslint-disable-next-line react-hooks/exhaustive-deps }, [isHover, mode]); - + const { t } = useTranslation(); return ( } active={mode === 'page'} status={radioItemStatus.left} @@ -126,7 +126,7 @@ export const EditorModeSwitch = ({