Merge branch 'feat/cloud-sync-saika' into feat/poc

This commit is contained in:
DiamondThree
2023-01-09 14:55:12 +08:00
90 changed files with 135 additions and 172 deletions
-1
View File
@@ -1,5 +1,4 @@
**/webpack.config.js
**/jest.config.js
**/scripts/*.js
**/node_modules/**
.github/**
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
scope: '@toeverything'
cache: 'pnpm'
- run: node scripts/module-resolve/ci.js
- run: node scripts/module-resolve/ci.cjs
- name: Restore cache
uses: actions/cache@v3
+1 -1
View File
@@ -244,7 +244,7 @@ jobs:
scope: '@toeverything'
cache: 'pnpm'
- run: node scripts/module-resolve/ci.js
- run: node scripts/module-resolve/ci.cjs
- name: Restore cache
uses: actions/cache@v3
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
scope: '@toeverything'
cache: 'pnpm'
- run: node scripts/module-resolve/ci.js
- run: node scripts/module-resolve/ci.cjs
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
+1
View File
@@ -48,6 +48,7 @@ Thumbs.db
out/
module-resolve.js
module-resolve.cjs
/test-results/
/playwright-report/
/playwright/.cache/
+2 -2
View File
@@ -1,11 +1,11 @@
const fs = require('fs');
function getCustomize() {
const customed = fs.existsSync('./module-resolve.js');
const customed = fs.existsSync('./module-resolve.cjs');
if (!customed) {
return null;
}
const script = require('./module-resolve.js');
const script = require('./module-resolve.cjs');
return script && script.resolve;
}
+6 -1
View File
@@ -1,3 +1,8 @@
{
"recommendations": ["ms-playwright.playwright", "esbenp.prettier-vscode"]
"recommendations": [
"ms-playwright.playwright",
"esbenp.prettier-vscode",
"deepscan.vscode-deepscan",
"streetsidesoftware.code-spell-checker"
]
}
+1
View File
@@ -4,6 +4,7 @@
"private": true,
"author": "toeverything",
"license": "MPL-2.0",
"type": "module",
"scripts": {
"dev": "pnpm --filter=!@affine/app build && pnpm --filter @affine/app dev",
"dev:ac": "pnpm --filter=!@affine/app build && NODE_API_SERVER=ac pnpm --filter @affine/app dev",
-5
View File
@@ -1,5 +0,0 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
@@ -8,7 +8,7 @@ import {
TelegramIcon,
RedditIcon,
LinkIcon,
} from './icons';
} from './Icons';
import logo from './affine-text-logo.png';
import {
StyledBigLink,
@@ -13,7 +13,7 @@ import {
ConnectorIcon,
UndoIcon,
RedoIcon,
} from './icons';
} from './Icons';
import { Tooltip } from '@/ui/tooltip';
import Slide from '@mui/material/Slide';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
@@ -11,8 +11,8 @@ import type {
AnimateRadioProps,
AnimateRadioItemProps,
} from './type';
import { useTheme } from '@/providers/themeProvider';
import { EdgelessIcon, PaperIcon } from './icons';
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';
@@ -8,8 +8,8 @@ import {
import { Content } from '@/ui/layout';
import { useAppState } from '@/providers/app-state-provider/context';
import EditorModeSwitch from '@/components/editor-mode-switch';
import QuickSearchButton from './quick-search-button';
import Header from './header';
import QuickSearchButton from './QuickSearchButton';
import Header from './Header';
import usePropsUpdated from '@/hooks/use-props-updated';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
@@ -8,10 +8,10 @@ import {
} from './styles';
import CloseIcon from '@mui/icons-material/Close';
import { getWarningMessage, shouldShowWarning } from './utils';
import EditorOptionMenu from './header-right-items/editor-option-menu';
import TrashButtonGroup from './header-right-items/trash-button-group';
import EditorOptionMenu from './header-right-items/EditorOptionMenu';
import TrashButtonGroup from './header-right-items/TrashButtonGroup';
import ThemeModeSwitch from './header-right-items/theme-mode-switch';
import SyncUser from './header-right-items/sync-user';
import SyncUser from './header-right-items/SyncUser';
const BrowserWarning = ({
show,
@@ -1,7 +1,7 @@
import { PropsWithChildren, ReactNode } from 'react';
import Header from './header';
import Header from './Header';
import { StyledPageListTittleWrapper } from './styles';
import QuickSearchButton from './quick-search-button';
import QuickSearchButton from './QuickSearchButton';
export type PageListHeaderProps = PropsWithChildren<{
icon?: ReactNode;
@@ -2,7 +2,7 @@ import React from 'react';
import { IconButton, IconButtonProps } from '@/ui/button';
import { Tooltip } from '@/ui/tooltip';
import { ArrowDownIcon } from '@blocksuite/icons';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useTranslation } from 'react-i18next';
export const QuickSearchButton = ({
onClick,
@@ -13,7 +13,7 @@ import {
} from '@blocksuite/icons';
import { useAppState } from '@/providers/app-state-provider';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useConfirm } from '@/providers/confirm-provider';
import { useConfirm } from '@/providers/ConfirmProvider';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
import { toast } from '@/ui/toast';
import { useTranslation } from 'react-i18next';
@@ -1,5 +1,5 @@
import { CloudUnsyncedIcon, CloudInsyncIcon } from '@blocksuite/icons';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useAppState } from '@/providers/app-state-provider/context';
import { IconButton } from '@/ui/button';
@@ -1,7 +1,7 @@
import { Button } from '@/ui/button';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useAppState } from '@/providers/app-state-provider';
import { useConfirm } from '@/providers/confirm-provider';
import { useConfirm } from '@/providers/ConfirmProvider';
import { useRouter } from 'next/router';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
import { useTranslation } from 'react-i18next';
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { useTheme } from '@/providers/themeProvider';
import { MoonIcon, SunIcon } from './icons';
import { useTheme } from '@/providers/ThemeProvider';
import { MoonIcon, SunIcon } from './Icons';
import { StyledThemeModeSwitch, StyledSwitchItem } from './style';
export const ThemeModeSwitch = () => {
+3 -3
View File
@@ -1,3 +1,3 @@
export * from './header';
export * from './editor-header';
export * from './page-list-header';
export * from './Header';
export * from './EditorHeader';
export * from './PageListHeader';
@@ -5,12 +5,12 @@ import {
StyledIslandWrapper,
StyledTransformIcon,
} from './style';
import { CloseIcon, ContactIcon, HelpIcon, KeyboardIcon } from './icons';
import { CloseIcon, ContactIcon, HelpIcon, KeyboardIcon } from './Icons';
import Grow from '@mui/material/Grow';
import { Tooltip } from '@/ui/tooltip';
import { useTranslation } from 'react-i18next';
import { useModal } from '@/providers/global-modal-provider';
import { useTheme } from '@/providers/themeProvider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useTheme } from '@/providers/ThemeProvider';
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
export type IslandItemNames = 'contact' | 'shortcuts';
export const HelpIsland = ({
@@ -1,5 +1,5 @@
import { styled } from '@/styles';
import Loading from './loading';
import Loading from './Loading';
// Used for the full page loading
const StyledLoadingContainer = styled('div')(() => {
@@ -1,3 +1,3 @@
import Loading from './loading';
export * from './page-loading';
import Loading from './Loading';
export * from './PageLoading';
export default Loading;
@@ -1,8 +1,8 @@
import { getDataCenter } from '@affine/datacenter';
import { styled } from '@/styles';
import { Button } from '@/ui/button';
import { useModal } from '@/providers/global-modal-provider';
import { GoogleIcon, StayLogOutIcon } from './icons';
import { useModal } from '@/providers/GlobalModalProvider';
import { GoogleIcon, StayLogOutIcon } from './Icons';
export const GoogleLoginButton = () => {
const { triggerLoginModal } = useModal();
@@ -1,4 +1,4 @@
import { useConfirm } from '@/providers/confirm-provider';
import { useConfirm } from '@/providers/ConfirmProvider';
import { PageMeta } from '@/providers/app-state-provider';
import { Menu, MenuItem } from '@/ui/menu';
import { Wrapper } from '@/ui/layout';
@@ -12,18 +12,18 @@ import {
StyledTitleWrapper,
} from './styles';
import { Table, TableBody, TableCell, TableHead, TableRow } from '@/ui/table';
import { OperationCell, TrashOperationCell } from './operation-cell';
import Empty from './empty';
import { OperationCell, TrashOperationCell } from './OperationCell';
import Empty from './Empty';
import { Content } from '@/ui/layout';
import React from 'react';
import DateCell from '@/components/page-list/date-cell';
import DateCell from '@/components/page-list/DateCell';
import { IconButton } from '@/ui/button';
import { Tooltip } from '@/ui/tooltip';
import { useRouter } from 'next/router';
import { useAppState } from '@/providers/app-state-provider/context';
import { toast } from '@/ui/toast';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useTheme } from '@/providers/themeProvider';
import { useTheme } from '@/providers/ThemeProvider';
import { useTranslation } from 'react-i18next';
const FavoriteTag = ({
pageMeta: { favorite, id },
@@ -1,7 +1,7 @@
import React from 'react';
import { AddIcon } from '@blocksuite/icons';
import { StyledModalFooterContent } from './style';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { Command } from 'cmdk';
import { usePageHelper } from '@/hooks/use-page-helper';
import { useTranslation } from 'react-i18next';
@@ -1,12 +1,12 @@
import { Command } from 'cmdk';
import { StyledListItem, StyledNotFound } from './style';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { PaperIcon, EdgelessIcon } from '@blocksuite/icons';
import { Dispatch, SetStateAction, useEffect, useState } from 'react';
import { useAppState } from '@/providers/app-state-provider';
import { useRouter } from 'next/router';
import { useSwitchToConfig } from './config';
import { NoResultSVG } from './noResultSVG';
import { NoResultSVG } from './NoResultSVG';
import { useTranslation } from 'react-i18next';
import usePageHelper from '@/hooks/use-page-helper';
import usePageMetaList from '@/hooks/use-page-meta-list';
@@ -6,12 +6,12 @@ import {
StyledModalDivider,
StyledShortcut,
} from './style';
import { Input } from './input';
import { Results } from './results';
import { Footer } from './footer';
import { Input } from './Input';
import { Results } from './Results';
import { Footer } from './Footer';
import { Command } from 'cmdk';
import { useEffect, useState } from 'react';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { getUaHelper } from '@/utils';
import { useAppState } from '@/providers/app-state-provider';
type TransitionsModalProps = {
@@ -13,7 +13,8 @@ export const useMacKeyboardShortcuts = (): ShortcutTip => {
[t('Strikethrough')]: '⌘+⇧+S',
[t('Inline code')]: ' ⌘+E',
[t('Code block')]: '⌘+⌥+C',
[t('Link')]: '⌘+K',
[t('Hyperlink(with selected text)')]: '⌘+K',
[t('Quick search')]: '⌘+K',
[t('Body text')]: '⌘+⌥+0',
[t('Heading', { number: '1' })]: '⌘+⌥+1',
[t('Heading', { number: '2' })]: '⌘+⌥+2',
@@ -56,7 +57,8 @@ export const useWindowsKeyboardShortcuts = (): ShortcutTip => {
[t('Strikethrough')]: 'Ctrl+Shift+S',
[t('Inline code')]: ' Ctrl+E',
[t('Code block')]: 'Ctrl+Alt+C',
[t('Link')]: 'Ctrl+K',
[t('Hyperlink(with selected text)')]: 'Ctrl+K',
[t('Quick search')]: 'Ctrl+K',
[t('Body text')]: 'Ctrl+Shift+0',
[t('Heading', { number: '1' })]: 'Ctrl+Shift+1',
[t('Heading', { number: '2' })]: 'Ctrl+Shift+2',
@@ -1,5 +1,5 @@
import { createPortal } from 'react-dom';
import { KeyboardIcon } from './icons';
import { KeyboardIcon } from './Icons';
import {
StyledListItem,
StyledModalHeader,
@@ -1 +1 @@
export * from './delete';
export * from './Delete';
@@ -1 +1 @@
export * from './general';
export * from './General';
@@ -1 +1 @@
export * from './leave';
export * from './Leave';
@@ -1 +1 @@
export * from './workspace-setting';
export * from './WorkspaceSetting';
@@ -13,7 +13,7 @@ import {
import { WorkspaceSetting } from '@/components/workspace-setting';
import { useCallback, useEffect, useState } from 'react';
import { getDataCenter, WorkspaceType } from '@affine/datacenter';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
export type WorkspaceDetails = Record<
string,
@@ -1 +1 @@
export * from './workspace-create';
export * from './WorkspaceCreate';
@@ -1,6 +1,6 @@
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { styled } from '@/styles';
import { AffineIcon } from '../../icons/icons';
import { AffineIcon } from '../../icons/Icons';
import {
WorkspaceItemAvatar,
LoginItemWrapper,
@@ -25,7 +25,7 @@ import {
} from '@blocksuite/icons';
import Link from 'next/link';
import { Tooltip } from '@/ui/tooltip';
import { useModal } from '@/providers/global-modal-provider';
import { useModal } from '@/providers/GlobalModalProvider';
import { useAppState } from '@/providers/app-state-provider/context';
import { IconButton } from '@/ui/button';
import useLocalStorage from '@/hooks/use-local-storage';
+1 -1
View File
@@ -54,7 +54,7 @@
"Strikethrough": "Strikethrough",
"Inline code": "Inline code",
"Code block": "Code block",
"Link": "Link",
"Hyperlink(with selected text)": "Hyperlink(with selected text)",
"Body text": "Body text",
"Heading": "Heading {{number}}",
"Increase indent": "Increase indent",
+5 -5
View File
@@ -10,18 +10,18 @@ import '../utils/print-build-info';
import ProviderComposer from '@/components/provider-composer';
import type { PropsWithChildren, ReactElement, ReactNode } from 'react';
import type { NextPage } from 'next';
import { AppStateProvider } from '@/providers/app-state-provider/provider';
import ConfirmProvider from '@/providers/confirm-provider';
import TemporaryHelperProvider from '@/providers/temporary-helper-provider';
import { ModalProvider } from '@/providers/global-modal-provider';
import { AppStateProvider } from '@/providers/app-state-provider/Provider';
import ConfirmProvider from '@/providers/ConfirmProvider';
import { ModalProvider } from '@/providers/GlobalModalProvider';
import { useRouter } from 'next/router';
import { useEffect } from 'react';
import { useAppState } from '@/providers/app-state-provider';
import { PageLoading } from '@/components/loading';
import Head from 'next/head';
import '@/libs/i18n';
import TemporaryHelperProvider from '@/providers/temporary-helper-provider';
const ThemeProvider = dynamic(() => import('@/providers/themeProvider'), {
const ThemeProvider = dynamic(() => import('@/providers/ThemeProvider'), {
ssr: false,
});
@@ -10,7 +10,7 @@ import type {
} from './context';
import { Page } from '@blocksuite/store';
import { EditorContainer } from '@blocksuite/editor';
const DynamicBlocksuite = dynamic(() => import('./dynamic-blocksuite'), {
const DynamicBlocksuite = dynamic(() => import('./DynamicBlocksuite'), {
ssr: false,
});
@@ -13,7 +13,7 @@ Let us know what you think of this latest version.
5. You can self-host locally with Docker.
```basic
docker run -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/toeverything/affine-self-hosted:alpha-abbey-wood
docker run -it --name affine -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/toeverything/affine-self-hosted:alpha-abbey-wood
```
**Looking for Markdown syntax or keyboard shortcuts?**
@@ -24,6 +24,9 @@ docker run -d -v [YOUR_PATH]:/app/data -p 3000:3000 ghcr.io/toeverything/affine-
- Manage your pages from the collapsible **sidebar**, which allows you to add **favourites** and restore deleted files from the **trash**
- Search through all your content with the quick search - activate with `Ctrl/⌘ + K`
- A friendly Reminder:
- In the case of unselected text, `Ctrl/⌘ + K` activates quick search;
- In the case of selected text, `Ctrl/⌘ + K` will firstly ask to add a hyperlink, and then using `Ctrl/⌘ + K` again activates the quick search
- Quickly format text with the **pop-up toolbar** (highlight any text to give it a try)
- Copy and paste **images** into your pages, resize them and add captions
- Add horizontal line dividers to your text with `---` and `***`
+4 -4
View File
@@ -10,8 +10,8 @@
".": "./dist/src/index.js"
},
"scripts": {
"build": "tsc --project ./tsconfig.json",
"test": "playwright test"
"dev": "tsc --project ./tsconfig.json -w",
"build": "tsc --project ./tsconfig.json"
},
"keywords": [],
"author": "",
@@ -26,8 +26,8 @@
"typescript": "^4.8.4"
},
"dependencies": {
"@blocksuite/blocks": "=0.3.1-20230106060050-1aad55d",
"@blocksuite/store": "=0.3.1-20230106060050-1aad55d",
"@blocksuite/blocks": "^0.3.1-20230109032243-37ad3ba",
"@blocksuite/store": "^0.3.1-20230109032243-37ad3ba",
"debug": "^4.3.4",
"encoding": "^0.1.13",
"firebase": "^9.15.0",
@@ -1,7 +1,10 @@
/**
* For unit tests.
*/
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
testDir: './tests',
testDir: './packages/',
timeout: 30 * 1000,
expect: {
/**
+4 -53
View File
@@ -133,8 +133,8 @@ importers:
packages/data-center:
specifiers:
'@blocksuite/blocks': '=0.3.1-20230106060050-1aad55d'
'@blocksuite/store': '=0.3.1-20230106060050-1aad55d'
'@blocksuite/blocks': ^0.3.1-20230109032243-37ad3ba
'@blocksuite/store': ^0.3.1-20230109032243-37ad3ba
'@playwright/test': ^1.29.1
'@types/debug': ^4.1.7
debug: ^4.3.4
@@ -151,8 +151,8 @@ importers:
y-protocols: ^1.0.5
yjs: ^13.5.44
dependencies:
'@blocksuite/blocks': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@blocksuite/blocks': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
debug: 4.3.4
encoding: 0.1.13
firebase: 9.15.0_encoding@0.1.13
@@ -1493,26 +1493,6 @@ packages:
/@blocksuite/blocks/0.3.1-20230106060050-1aad55d_yjs@13.5.44:
resolution: {integrity: sha512-qRNXmhjw+GAGsV1mI2XXPxYTlHfsFHv9ttTCNQ6IIcxvc5Hh6lWmdwVibxvlpYUkgEc1zv3/GxOEsR/ngpZXzQ==}
dependencies:
'@blocksuite/phasor': 0.3.1_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230106060050-1aad55d_yjs@13.5.44
'@tldraw/intersect': 1.8.0
autosize: 5.0.2
highlight.js: 11.7.0
hotkeys-js: 3.10.1
lit: 2.5.0
perfect-freehand: 1.2.0
quill: 1.3.7
quill-cursors: 4.0.0
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
- yjs
dev: false
/@blocksuite/blocks/0.3.1-20230109032243-37ad3ba_yjs@13.5.44:
resolution: {integrity: sha512-UTlbk0Is7TMRBbvUyM2nivbqM/TLwRj1qArMYbOmvDGUNYadWo68cTwv/Ej2WwiKn22q4/4JHryGsv3gTCRz1Q==}
dependencies:
'@blocksuite/phasor': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
'@blocksuite/store': 0.3.1-20230109032243-37ad3ba_yjs@13.5.44
@@ -1564,35 +1544,6 @@ packages:
yjs: 13.5.44
dev: false
/@blocksuite/phasor/0.3.1_yjs@13.5.44:
resolution: {integrity: sha512-aJmAQn2qoF6HxFZWgq7xa/pWVyzg3MmD6dynIHAKdfN7rBdKk3PNA+lRX919QkD2e270N/zgHEGFFQI1Nj5xrA==}
peerDependencies:
yjs: ^13
dependencies:
yjs: 13.5.44
dev: false
/@blocksuite/store/0.3.1-20230106060050-1aad55d_yjs@13.5.44:
resolution: {integrity: sha512-dRy+YzlWMwiYq0Im9NogK/NTkV+NKK+lgejYq56m6nH2m16/G9AMODqP0oQy/XeYFevUpL9i9RdV0rHsJ2gc0Q==}
peerDependencies:
yjs: ^13
dependencies:
'@types/flexsearch': 0.7.3
'@types/quill': 1.3.10
buffer: 6.0.3
flexsearch: 0.7.21
idb-keyval: 6.2.0
ky: 0.33.1
lib0: 0.2.58
y-protocols: 1.0.5
y-webrtc: 10.2.3
yjs: 13.5.44
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
/@blocksuite/store/0.3.1-20230109032243-37ad3ba_yjs@13.5.44:
resolution: {integrity: sha512-zOUz19jfhuhsUkx9BGEQPZWbPyD/AgX0LB7ShVRdd3YM73x25hD6tPLLz1HEV2b69XokC0P9oSru4aNomm4jkg==}
peerDependencies:
@@ -2,12 +2,9 @@ const fs = require('fs');
const path = require('path');
const templatePath = path.resolve(__dirname, 'module-resolve.tmpl.js');
const destinationPath = path.resolve(__dirname, '../../module-resolve.js');
const destinationPath = path.resolve(__dirname, '../../module-resolve.cjs');
console.log('template path', templatePath);
console.log('destination path', destinationPath);
fs.copyFileSync(
templatePath,
destinationPath
);
fs.copyFileSync(templatePath, destinationPath);
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Change page mode(Paper or Edgeless)', () => {
+9 -3
View File
@@ -1,11 +1,17 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import pkg from './../packages/app/package.json';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('web console', () => {
test('editor version', async ({ page }) => {
// TODO: playwright need to support json import in esm
test.skip('editor version', async ({ page }) => {
// TODO: playwright need to support json import in esm
// const pkg = await import('./../packages/app/package.json', {
// assert: { type: 'json' },
// });
const pkg = {} as any;
// https://playwright.dev/docs/evaluating
// https://github.com/microsoft/playwright/issues/13059
// Get the handle to a specific function.
+2 -2
View File
@@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('Open contact us', () => {
test('Click about us', async ({ page }) => {
test.skip('Click about us', async ({ page }) => {
const currentWorkspace = page.getByTestId('current-workspace');
await currentWorkspace.click();
// await page.waitForTimeout(1000);
+1 -1
View File
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
+1 -1
View File
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
+1 -1
View File
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first export page', () => {
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first favorite and cancel favorite page', () => {
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first favorite items ui', () => {
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('local first new page', () => {
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('local first new page', () => {
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('Local first delete page', () => {
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage, clickPageMoreActions } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage, clickPageMoreActions } from './libs/page-logic.js';
loadPage();
test.describe('Local first delete page', () => {
+2 -2
View File
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { newPage } from './libs/page-logic.js';
loadPage();
test.describe('Local first trash page', () => {
+2 -2
View File
@@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('Local first default workspace', () => {
test('Default workspace name', async ({ page }) => {
test.skip('Default workspace name', async ({ page }) => {
const workspaceName = page.getByTestId('workspace-name');
expect(await workspaceName.textContent()).toBe('AFFiNE');
});
+2 -2
View File
@@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
test.describe('Login Flow', () => {
test('Open login modal by click current workspace', async ({ page }) => {
test.skip('Open login modal by click current workspace', async ({ page }) => {
await page.getByTestId('current-workspace').click();
await page.waitForTimeout(800);
// why don't we use waitForSelector, It seems that waitForSelector not stable?
+3 -3
View File
@@ -1,7 +1,7 @@
import { test, expect, type Page } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { withCtrlOrMeta } from './libs/keyboard';
import { newPage } from './libs/page-logic';
import { loadPage } from './libs/load-page.js';
import { withCtrlOrMeta } from './libs/keyboard.js';
import { newPage } from './libs/page-logic.js';
loadPage();
const openQuickSearchByShortcut = async (page: Page) =>
+1 -1
View File
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();
+1 -1
View File
@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { loadPage } from './libs/load-page';
import { loadPage } from './libs/load-page.js';
loadPage();