ci: speedup ci by reduce installation packages in certain job (#4457)

This commit is contained in:
LongYinan 2023-09-29 11:02:26 +08:00 committed by GitHub
parent b012e615ba
commit dd94ea5b45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
84 changed files with 2954 additions and 2271 deletions

View File

@ -34,7 +34,7 @@ runs:
if: ${{ inputs.target != 'x86_64-unknown-linux-gnu' && inputs.target != 'aarch64-unknown-linux-gnu' }}
shell: bash
run: |
yarn nx build ${{ inputs.package }} --target ${{ inputs.target }}
yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }}
env:
NX_CLOUD_ACCESS_TOKEN: ${{ inputs.nx_token }}
@ -48,7 +48,7 @@ runs:
export CC=x86_64-unknown-linux-gnu-gcc
export CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc
export RUSTFLAGS="-C debuginfo=1"
yarn nx build ${{ inputs.package }} --target ${{ inputs.target }}
yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }}
chmod -R 777 node_modules/.cache
chmod -R 777 target
@ -60,6 +60,6 @@ runs:
options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build -e NX_CLOUD_ACCESS_TOKEN=${{ inputs.nx_token }}
run: |
export RUSTFLAGS="-C debuginfo=1"
yarn nx build ${{ inputs.package }} --target ${{ inputs.target }}
yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }}
chmod -R 777 node_modules/.cache
chmod -R 777 target

View File

@ -7,8 +7,7 @@ runs:
- name: 'Install @electron-forge/maker-dmg'
if: runner.os == 'macos'
shell: bash
working-directory: ./apps/electron
run: yarn add @electron-forge/maker-dmg --dev
run: yarn workspace @affine/electron add @electron-forge/maker-dmg --dev
env:
HUSKY: '0'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'

View File

@ -21,6 +21,14 @@ inputs:
description: 'set nmMode to hardlinks-local in .yarnrc.yml'
required: false
default: 'true'
build-infra:
description: 'Build infra'
required: false
default: 'true'
build-plugins:
description: 'Build plugins'
required: false
default: 'true'
runs:
using: 'composite'
@ -42,7 +50,7 @@ runs:
if: ${{ inputs.package-install == 'true' }}
continue-on-error: true
shell: bash
run: yarn install ${{ inputs.extra-flags }}
run: yarn ${{ inputs.extra-flags }}
env:
HUSKY: '0'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
@ -52,7 +60,7 @@ runs:
- name: yarn install (try again)
if: ${{ steps.install.outcome == 'failure' }}
shell: bash
run: yarn install ${{ inputs.extra-flags }}
run: yarn ${{ inputs.extra-flags }}
env:
HUSKY: '0'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
@ -89,11 +97,11 @@ runs:
${{ runner.os }}-${{ runner.arch }}-playwright-
# If the Playwright browser binaries weren't able to be restored, we tell
# paywright to install everything for us.
# playwright to install everything for us.
- name: Install Playwright's dependencies
shell: bash
if: inputs.playwright-install == 'true' && steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
if: inputs.playwright-install == 'true'
run: yarn playwright install --with-deps chromium
- name: Get installed Electron version
id: electron-version
@ -114,14 +122,16 @@ runs:
- name: Install Electron binary
shell: bash
if: inputs.electron-install == 'true'
run: node apps/electron/node_modules/electron/install.js
run: node ./node_modules/electron/install.js
env:
ELECTRON_OVERRIDE_DIST_PATH: ./node_modules/.cache/electron
- name: Build Infra
shell: bash
if: inputs.build-infra == 'true'
run: yarn run build:infra
- name: Build Plugins
if: inputs.build-plugins == 'true'
shell: bash
run: yarn run build:plugins

View File

@ -41,11 +41,11 @@ jobs:
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build Plugins
run: yarn run build:plugins
with:
electron-install: false
- name: Build Core
run: yarn nx build @affine/core
- name: Upload core artifact
@ -94,11 +94,12 @@ jobs:
}
needs: build-core
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
timeout-minutes: 10
with:
extra-flags: workspaces focus @affine/electron @affine/monorepo @affine-test/affine-desktop
playwright-install: true
hard-link-nm: false
@ -111,8 +112,7 @@ jobs:
- name: Run unit tests
if: ${{ matrix.spec.test }}
shell: bash
run: yarn vitest
working-directory: ./apps/electron
run: yarn workspace @affine/electron vitest
- name: Download core artifact
uses: actions/download-artifact@v3
@ -120,9 +120,6 @@ jobs:
name: core
path: apps/electron/resources/web-static
- name: Build Plugins
run: yarn run build:plugins
- name: Build Desktop Layers
run: yarn workspace @affine/electron build
@ -142,13 +139,13 @@ jobs:
if: ${{ matrix.spec.os == 'macos-latest' && matrix.spec.arch == 'arm64' }}
env:
SKIP_BUNDLE: true
SKIP_WEB_BUILD: true
run: yarn workspace @affine/electron make --platform=darwin --arch=arm64
- name: Output check
if: ${{ matrix.spec.os == 'macos-latest' && matrix.spec.arch == 'arm64' }}
run: |
yarn ts-node-esm ./scripts/macos-arm64-output-check.mts
working-directory: apps/electron
yarn workspace @affine/electron ts-node-esm ./scripts/macos-arm64-output-check.mts
- name: Collect code coverage report
if: ${{ matrix.spec.test }}

View File

@ -42,10 +42,15 @@ jobs:
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup Rust
with:
extra-flags: workspaces focus @affine/storage
electron-install: false
build-infra: false
build-plugins: false
- name: Build Rust
uses: ./.github/actions/build-rust
with:
target: 'x86_64-unknown-linux-gnu'
@ -81,10 +86,12 @@ jobs:
- 1025:1025
- 8025:8025
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
electron-install: false
- name: Initialize database
run: |
@ -150,7 +157,7 @@ jobs:
- 1025:1025
- 8025:8025
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@ -232,7 +239,7 @@ jobs:
- 1025:1025
- 8025:8025
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
@ -257,15 +264,13 @@ jobs:
- name: Generate prisma client
run: |
yarn exec prisma generate
yarn exec prisma db push
working-directory: apps/server
yarn workspace @affine/server exec prisma generate
yarn workspace @affine/server prisma db push
env:
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine
- name: Run init-db script
run: yarn exec ts-node-esm ./scripts/init-db.ts
working-directory: apps/server
run: yarn workspace @affine/server exec ts-node-esm ./scripts/init-db.ts
env:
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine

View File

@ -42,7 +42,7 @@ jobs:
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
@ -66,7 +66,7 @@ jobs:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run check
run: |
yarn set version $(node -e "console.log(require('./package.json').packageManager.split('@')[1])")
@ -77,7 +77,7 @@ jobs:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
@ -117,7 +117,7 @@ jobs:
shard: [1, 2, 3, 4, 5]
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
@ -159,9 +159,9 @@ jobs:
spec:
- { package: 0.7.0-canary.18 }
- { package: 0.8.0-canary.7 }
- { package: 0.8.3 }
- { package: 0.8.4 }
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
@ -169,12 +169,10 @@ jobs:
electron-install: false
- name: Unzip
run: yarn unzip
working-directory: ./tests/affine-legacy/${{ matrix.spec.package }}
run: yarn workspace @affine-legacy/${{ matrix.spec.package }} unzip
- name: Run playwright tests
run: yarn e2e --forbid-only
working-directory: ./tests/affine-legacy/${{ matrix.spec.package }}
run: yarn workspace @affine-legacy/${{ matrix.spec.package }} e2e --forbid-only
- name: Upload test results
if: ${{ failure() }}
@ -189,7 +187,7 @@ jobs:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:

View File

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cleanup
run: |

View File

@ -37,7 +37,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.flavor }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
@ -43,7 +43,7 @@ jobs:
environment: production
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build Plugins
@ -70,7 +70,7 @@ jobs:
environment: ${{ github.event.inputs.flavor }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup Rust
@ -95,7 +95,7 @@ jobs:
- build-core
- build-storage
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download core artifact
uses: actions/download-artifact@v3
with:
@ -180,7 +180,7 @@ jobs:
- build-docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Deploy to dev
uses: ./.github/actions/deploy
with:

View File

@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout Helm chart repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: toeverything/helm-charts
path: .helm-chart-repo

View File

@ -19,7 +19,7 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Check Language Key

View File

@ -36,7 +36,7 @@ jobs:
outputs:
version: 0.0.0-internal.${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: toeverything/set-build-version@latest
- id: version
run: echo ::set-output name=version::${{ env.BUILD_VERSION }}
@ -47,7 +47,7 @@ jobs:
needs:
- set-build-version
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup @sentry/cli
@ -103,7 +103,7 @@ jobs:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
SKIP_GENERATE_ASSETS: 1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
@ -174,7 +174,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download Artifacts (macos-x64)
uses: actions/download-artifact@v3
with:

View File

@ -17,7 +17,9 @@ jobs:
name: Check pull request title
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- run: echo "${{ github.event.pull_request.title }}" | npx commitlint -g ./.commitlintrc.json
with:
electron-install: false
- run: echo "${{ github.event.pull_request.title }}" | yarn dlx commitlint -g ./.commitlintrc.json

View File

@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
# This is required to fetch all commits for chromatic

View File

@ -44,7 +44,7 @@ jobs:
outputs:
RELEASE_VERSION: ${{ steps.get-canary-version.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup @sentry/cli
@ -101,7 +101,7 @@ jobs:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
SKIP_GENERATE_ASSETS: 1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
@ -119,9 +119,6 @@ jobs:
name: core
path: apps/electron/resources/web-static
- name: Build Plugins
run: yarn run build:plugins
- name: Build Desktop Layers
run: yarn workspace @affine/electron build
@ -172,7 +169,7 @@ jobs:
env:
SKIP_GENERATE_ASSETS: 1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
@ -240,7 +237,7 @@ jobs:
outputs:
FILES_TO_BE_SIGNED: ${{ steps.get_files_to_be_signed.outputs.FILES_TO_BE_SIGNED }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
timeout-minutes: 10
uses: ./.github/actions/setup-node
@ -318,7 +315,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: core
path: web-static
- name: Zip web-static
run: zip -r web-static.zip web-static
- name: Download Artifacts (macos-x64)
uses: actions/download-artifact@v3
with:

View File

@ -17,7 +17,7 @@ jobs:
name: Try publishing npm@latest release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Try publishing to NPM
@ -31,7 +31,7 @@ jobs:
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build Plugins
@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
@ -72,7 +72,7 @@ jobs:
environment: development
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup Rust
@ -97,7 +97,7 @@ jobs:
- build-core
- build-storage
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download core artifact
uses: actions/download-artifact@v3
with:

View File

@ -0,0 +1,15 @@
diff --git a/package.json b/package.json
index b64804360e64896c2eafde5e976dde0db480b4e3..63566d9e2725630827daefeeb211b950d329521b 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,10 @@
"types": "./index.d.ts",
"default": "./index.js"
},
+ "./core": {
+ "types": "./core/index.d.ts",
+ "default": "./core/index.js"
+ },
"./adapters": {
"types": "./adapters.d.ts"
},

View File

@ -266,7 +266,6 @@ export const createConfiguration: (
useDefineForClassFields: false,
},
experimental: {
keepImportAssertions: true,
plugins: [
buildFlags.coverage && [
'swc-plugin-coverage-instrument',

View File

@ -44,14 +44,14 @@
"async-call-rpc": "^6.3.1",
"css-spring": "^4.1.0",
"cssnano": "^6.0.1",
"graphql": "^16.8.0",
"graphql": "^16.8.1",
"intl-segmenter-polyfill-rs": "^0.1.6",
"jotai": "^2.4.1",
"jotai": "^2.4.2",
"jotai-devtools": "^0.6.2",
"lit": "^2.8.0",
"lottie-web": "^5.12.2",
"mini-css-extract-plugin": "^2.7.6",
"next-auth": "^4.22.1",
"next-auth": "^4.23.1",
"next-themes": "^0.2.1",
"postcss-loader": "^7.3.3",
"react": "18.2.0",
@ -63,17 +63,17 @@
"ses": "^0.18.8",
"swr": "2.2.0",
"valtio": "^1.11.2",
"y-protocols": "^1.0.5",
"y-protocols": "^1.0.6",
"yjs": "^13.6.8",
"zod": "^3.22.2"
},
"devDependencies": {
"@aws-sdk/client-s3": "3.400.0",
"@aws-sdk/client-s3": "3.418.0",
"@perfsee/webpack": "^1.8.4",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@sentry/webpack-plugin": "^2.7.0",
"@sentry/webpack-plugin": "^2.7.1",
"@svgr/webpack": "^8.1.0",
"@swc/core": "^1.3.81",
"@swc/core": "^1.3.87",
"@types/lodash-es": "^4.17.9",
"@types/webpack-env": "^1.18.1",
"copy-webpack-plugin": "^11.0.0",

View File

@ -1,11 +1,12 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('node:path');
const { rm, symlink } = require('node:fs/promises');
const {
utils: { fromBuildIdentifier },
} = require('@electron-forge/core');
const path = require('node:path');
const {
arch,
buildType,
@ -25,7 +26,7 @@ const makers = [
icon: icnsPath,
name: 'AFFiNE',
'icon-size': 128,
background: path.resolve(
background: path.join(
__dirname,
'./resources/icons/dmg-background.png'
),
@ -34,7 +35,7 @@ const makers = [
x: 176,
y: 192,
type: 'file',
path: path.resolve(
path: path.join(
__dirname,
'out',
buildType,
@ -45,7 +46,7 @@ const makers = [
{ x: 432, y: 192, type: 'link', path: '/Applications' },
],
iconSize: 118,
file: path.resolve(
file: path.join(
__dirname,
'out',
buildType,
@ -129,35 +130,14 @@ module.exports = {
packageJson.productName = productName;
},
prePackage: async () => {
const { rm, cp } = require('node:fs/promises');
const { resolve } = require('node:path');
await rm(resolve(__dirname, './node_modules/@toeverything/infra'), {
await rm(path.join(__dirname, 'node_modules'), {
recursive: true,
force: true,
});
await cp(
resolve(__dirname, '../../packages/infra'),
resolve(__dirname, './node_modules/@toeverything/infra'),
{
recursive: true,
force: true,
}
);
await rm(resolve(__dirname, './node_modules/@affine/sdk'), {
recursive: true,
force: true,
});
await cp(
resolve(__dirname, '../../packages/sdk'),
resolve(__dirname, './node_modules/@affine/sdk'),
{
recursive: true,
force: true,
}
await symlink(
path.join(__dirname, '..', '..', 'node_modules'),
path.join(__dirname, 'node_modules')
);
},
generateAssets: async (_, platform, arch) => {

View File

@ -26,46 +26,53 @@
"main": "./dist/main.js",
"devDependencies": {
"@affine-test/kit": "workspace:*",
"@affine/bookmark-plugin": "workspace:*",
"@affine/copilot-plugin": "workspace:*",
"@affine/env": "workspace:*",
"@affine/hello-world-plugin": "workspace:*",
"@affine/image-preview-plugin": "workspace:*",
"@affine/native": "workspace:*",
"@affine/outline-plugin": "workspace:*",
"@affine/sdk": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/vue-hello-world-plugin": "workspace:*",
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"@electron-forge/cli": "^6.4.1",
"@electron-forge/core": "^6.4.1",
"@electron-forge/core-utils": "^6.4.1",
"@electron-forge/maker-deb": "^6.4.1",
"@electron-forge/maker-squirrel": "^6.4.1",
"@electron-forge/maker-zip": "^6.4.1",
"@electron-forge/shared-types": "^6.4.1",
"@electron-forge/cli": "^6.4.2",
"@electron-forge/core": "^6.4.2",
"@electron-forge/core-utils": "^6.4.2",
"@electron-forge/maker-deb": "^6.4.2",
"@electron-forge/maker-squirrel": "^6.4.2",
"@electron-forge/maker-zip": "^6.4.2",
"@electron-forge/shared-types": "^6.4.2",
"@electron/remote": "2.0.11",
"@reforged/maker-appimage": "^3.3.1",
"@toeverything/infra": "workspace:*",
"@types/uuid": "^9.0.3",
"@types/uuid": "^9.0.4",
"cross-env": "7.0.3",
"electron": "^26.2.1",
"electron-log": "^5.0.0-beta.28",
"electron": "^26.2.2",
"electron-log": "^5.0.0-beta.29",
"electron-squirrel-startup": "1.0.0",
"electron-window-state": "^5.0.3",
"esbuild": "^0.19.2",
"esbuild": "^0.19.3",
"fs-extra": "^11.1.1",
"glob": "^10.3.4",
"jotai": "^2.4.1",
"glob": "^10.3.5",
"jotai": "^2.4.2",
"lodash-es": "^4.17.21",
"rxjs": "^7.8.1",
"tinykeys": "^2.1.0",
"ts-node": "^10.9.1",
"undici": "^5.23.0",
"uuid": "^9.0.0",
"vitest": "0.33.0",
"undici": "^5.25.2",
"uuid": "^9.0.1",
"vitest": "0.34.5",
"which": "^4.0.0",
"zx": "^7.2.3"
},
"dependencies": {
"async-call-rpc": "^6.3.1",
"electron-updater": "^6.1.4",
"electron-updater": "^6.1.5",
"link-preview-js": "^3.0.5",
"nanoid": "^4.0.2",
"yjs": "^13.6.8"
@ -81,9 +88,6 @@
]
},
"stableVersion": "0.5.3",
"installConfig": {
"hoistingLimits": "workspaces"
},
"peerDependencies": {
"ts-node": "*"
}

View File

@ -46,13 +46,21 @@ export async function getWorkspaceMeta(
try {
const basePath = await getWorkspaceBasePath(workspaceId);
const metaPath = await getWorkspaceMetaPath(workspaceId);
if (!(await fs.exists(metaPath))) {
if (
!(await fs
.access(metaPath)
.then(() => true)
.catch(() => false))
) {
// since not meta is found, we will migrate symlinked db file if needed
await fs.ensureDir(basePath);
const dbPath = await getWorkspaceDBPath(workspaceId);
// todo: remove this after migration (in stable version)
const realDBPath = (await fs.exists(dbPath))
const realDBPath = (await fs
.access(dbPath)
.then(() => true)
.catch(() => false))
? await fs.realpath(dbPath)
: dbPath;
const isLink = realDBPath !== dbPath;

View File

@ -17,76 +17,76 @@
},
"dependencies": {
"@apollo/server": "^4.9.3",
"@auth/prisma-adapter": "^1.0.1",
"@aws-sdk/client-s3": "^3.400.0",
"@auth/prisma-adapter": "^1.0.2",
"@aws-sdk/client-s3": "^3.418.0",
"@google-cloud/opentelemetry-cloud-monitoring-exporter": "^0.17.0",
"@google-cloud/opentelemetry-cloud-trace-exporter": "^2.1.0",
"@keyv/redis": "^2.7.0",
"@nestjs/apollo": "^12.0.7",
"@nestjs/common": "^10.2.4",
"@nestjs/core": "^10.2.4",
"@nestjs/graphql": "^12.0.8",
"@nestjs/platform-express": "^10.2.4",
"@nestjs/platform-socket.io": "^10.2.4",
"@nestjs/throttler": "^4.2.1",
"@nestjs/websockets": "^10.2.4",
"@keyv/redis": "^2.7.1",
"@nestjs/apollo": "^12.0.9",
"@nestjs/common": "^10.2.6",
"@nestjs/core": "^10.2.6",
"@nestjs/graphql": "^12.0.9",
"@nestjs/platform-express": "^10.2.6",
"@nestjs/platform-socket.io": "^10.2.6",
"@nestjs/throttler": "^5.0.0",
"@nestjs/websockets": "^10.2.6",
"@node-rs/argon2": "^1.5.2",
"@node-rs/crc32": "^1.7.2",
"@node-rs/jsonwebtoken": "^0.2.3",
"@opentelemetry/api": "^1.4.1",
"@opentelemetry/instrumentation": "^0.41.2",
"@opentelemetry/api": "^1.6.0",
"@opentelemetry/instrumentation": "^0.43.0",
"@opentelemetry/instrumentation-graphql": "^0.35.1",
"@opentelemetry/instrumentation-http": "^0.41.2",
"@opentelemetry/instrumentation-http": "^0.43.0",
"@opentelemetry/instrumentation-ioredis": "^0.35.1",
"@opentelemetry/instrumentation-nestjs-core": "^0.33.1",
"@opentelemetry/instrumentation-socket.io": "^0.34.1",
"@opentelemetry/sdk-metrics": "^1.15.2",
"@opentelemetry/sdk-node": "^0.41.2",
"@opentelemetry/sdk-trace-node": "^1.15.2",
"@prisma/client": "^5.2.0",
"@prisma/instrumentation": "^5.2.0",
"@opentelemetry/sdk-metrics": "^1.17.0",
"@opentelemetry/sdk-node": "^0.43.0",
"@opentelemetry/sdk-trace-node": "^1.17.0",
"@prisma/client": "^5.3.1",
"@prisma/instrumentation": "^5.3.1",
"@socket.io/redis-adapter": "^8.2.1",
"cookie-parser": "^1.4.6",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"file-type": "^18.5.0",
"get-stream": "^8.0.1",
"graphql": "^16.8.0",
"graphql": "^16.8.1",
"graphql-type-json": "^0.3.2",
"graphql-upload": "^16.0.2",
"ioredis": "^5.3.2",
"keyv": "^4.5.3",
"lodash-es": "^4.17.21",
"nanoid": "^4.0.2",
"nestjs-throttler-storage-redis": "^0.4.0",
"next-auth": "4.22.5",
"nodemailer": "^6.9.4",
"nestjs-throttler-storage-redis": "^0.4.1",
"next-auth": "4.23.1",
"nodemailer": "^6.9.5",
"on-headers": "^1.0.2",
"parse-duration": "^1.1.0",
"pretty-time": "^1.1.0",
"prisma": "^5.2.0",
"prisma": "^5.3.1",
"prom-client": "^14.2.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"semver": "^7.5.4",
"socket.io": "^4.7.2",
"ws": "^8.13.0",
"ws": "^8.14.2",
"yjs": "^13.6.8"
},
"devDependencies": {
"@affine-test/kit": "workspace:*",
"@affine/storage": "workspace:*",
"@napi-rs/image": "^1.6.1",
"@nestjs/testing": "^10.2.4",
"@nestjs/testing": "^10.2.6",
"@types/cookie-parser": "^1.4.4",
"@types/engine.io": "^3.1.7",
"@types/express": "^4.17.17",
"@types/graphql-upload": "^16.0.1",
"@types/graphql-upload": "^16.0.2",
"@types/keyv": "^4.2.0",
"@types/lodash-es": "^4.17.9",
"@types/node": "^18.17.12",
"@types/nodemailer": "^6.4.9",
"@types/on-headers": "^1.0.0",
"@types/node": "^18.17.18",
"@types/nodemailer": "^6.4.10",
"@types/on-headers": "^1.0.1",
"@types/pretty-time": "^1.1.2",
"@types/sinon": "^10.0.16",
"@types/supertest": "^2.0.12",
@ -103,7 +103,9 @@
"extensions": {
"ts": "module"
},
"workerThreads": false,
"nodeArguments": [
"--trace-sigint",
"--loader",
"ts-node/esm/transpile-only.mjs",
"--es-module-specifier-resolution",

View File

@ -81,7 +81,6 @@ export const NextAuthOptionsProvider: FactoryProvider<NextAuthOptions> = {
sendVerificationRequest(config, logger, mailer, session, params),
}),
],
// @ts-expect-error Third part library type mismatch
adapter: prismaAdapter,
debug: !config.node.prod,
session: {

View File

@ -50,7 +50,12 @@ export class NextAuthController {
}
@UseGuards(AuthThrottlerGuard)
@Throttle(60, 60)
@Throttle({
default: {
limit: 60,
ttl: 60,
},
})
@All('*')
async auth(
@Req() req: Request,

View File

@ -50,7 +50,12 @@ export class AuthResolver {
private readonly session: SessionService
) {}
@Throttle(20, 60)
@Throttle({
default: {
limit: 20,
ttl: 60,
},
})
@ResolveField(() => TokenType)
async token(
@Context() ctx: { req: Request },
@ -82,7 +87,12 @@ export class AuthResolver {
};
}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Mutation(() => UserType)
async signUp(
@Context() ctx: { req: Request },
@ -95,7 +105,12 @@ export class AuthResolver {
return user;
}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Mutation(() => UserType)
async signIn(
@Context() ctx: { req: Request },
@ -107,7 +122,12 @@ export class AuthResolver {
return user;
}
@Throttle(5, 60)
@Throttle({
default: {
limit: 5,
ttl: 60,
},
})
@Mutation(() => UserType)
@Auth()
async changePassword(
@ -126,7 +146,12 @@ export class AuthResolver {
return user;
}
@Throttle(5, 60)
@Throttle({
default: {
limit: 5,
ttl: 60,
},
})
@Mutation(() => UserType)
@Auth()
async changeEmail(
@ -147,7 +172,12 @@ export class AuthResolver {
return user;
}
@Throttle(5, 60)
@Throttle({
default: {
limit: 5,
ttl: 60,
},
})
@Mutation(() => Boolean)
@Auth()
async sendChangePasswordEmail(
@ -165,7 +195,12 @@ export class AuthResolver {
return !res.rejected.length;
}
@Throttle(5, 60)
@Throttle({
default: {
limit: 5,
ttl: 60,
},
})
@Mutation(() => Boolean)
@Auth()
async sendSetPasswordEmail(
@ -190,7 +225,12 @@ export class AuthResolver {
// 4. user open confirm email page from new email
// 5. user click confirm button
// 6. send notification email
@Throttle(5, 60)
@Throttle({
default: {
limit: 5,
ttl: 60,
},
})
@Mutation(() => Boolean)
@Auth()
async sendChangeEmail(
@ -208,7 +248,12 @@ export class AuthResolver {
return !res.rejected.length;
}
@Throttle(5, 60)
@Throttle({
default: {
limit: 5,
ttl: 60,
},
})
@Mutation(() => Boolean)
@Auth()
async sendVerifyChangeEmail(

View File

@ -91,7 +91,12 @@ export class UserResolver {
private readonly users: UsersService
) {}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Query(() => UserType, {
name: 'currentUser',
description: 'Get current user',
@ -112,7 +117,12 @@ export class UserResolver {
};
}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Query(() => UserType, {
name: 'user',
description: 'Get user by email',
@ -140,7 +150,12 @@ export class UserResolver {
return user;
}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Mutation(() => UserType, {
name: 'uploadAvatar',
description: 'Upload user avatar',
@ -160,7 +175,12 @@ export class UserResolver {
});
}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Mutation(() => RemoveAvatar, {
name: 'removeAvatar',
description: 'Remove user avatar',
@ -176,14 +196,24 @@ export class UserResolver {
return { success: true };
}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Mutation(() => DeleteAccount)
async deleteAccount(@CurrentUser() user: UserType): Promise<DeleteAccount> {
await this.users.deleteUser(user.id);
return { success: true };
}
@Throttle(10, 60)
@Throttle({
default: {
limit: 10,
ttl: 60,
},
})
@Mutation(() => AddToNewFeaturesWaitingList)
async addToNewFeaturesWaitingList(
@CurrentUser() user: UserType,

View File

@ -282,7 +282,12 @@ export class WorkspaceResolver {
});
}
@Throttle(10, 30)
@Throttle({
default: {
limit: 10,
ttl: 30,
},
})
@Public()
@Query(() => WorkspaceType, {
description: 'Get public workspace by id',
@ -515,7 +520,12 @@ export class WorkspaceResolver {
}
}
@Throttle(10, 30)
@Throttle({
default: {
limit: 10,
ttl: 30,
},
})
@Public()
@Query(() => InvitationType, {
description: 'Update workspace',

View File

@ -20,8 +20,12 @@ import { getRequestResponseFromContext } from './utils/nestjs';
inject: [Config],
useFactory: (config: Config): ThrottlerModuleOptions => {
const options: ThrottlerModuleOptions = {
ttl: config.rateLimiter.ttl,
limit: config.rateLimiter.limit,
throttlers: [
{
ttl: config.rateLimiter.ttl,
limit: config.rateLimiter.limit,
},
],
skipIf: () => {
return !config.node.prod || config.affine.canary;
},
@ -49,8 +53,10 @@ export class CloudThrottlerGuard extends ThrottlerGuard {
return getRequestResponseFromContext(context) as any;
}
protected override getTracker(req: Record<string, any>): string {
return req?.get('CF-Connecting-IP') ?? req?.get('CF-ray') ?? req?.ip;
protected override getTracker(req: Record<string, any>): Promise<string> {
return Promise.resolve(
req?.get('CF-Connecting-IP') ?? req?.get('CF-ray') ?? req?.ip
);
}
}
@ -65,10 +71,16 @@ export class AuthThrottlerGuard extends CloudThrottlerGuard {
if (req?.url === '/api/auth/session') {
// relax throttle for session auto renew
return super.handleRequest(context, limit * 20, ttl);
return super.handleRequest(context, limit * 20, ttl, {
ttl: ttl * 20,
limit: limit * 20,
});
}
return super.handleRequest(context, limit, ttl);
return super.handleRequest(context, limit, ttl, {
ttl,
limit,
});
}
}

View File

@ -5,9 +5,9 @@ import { Transformer } from '@napi-rs/image';
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { hashSync } from '@node-rs/argon2';
import { User } from '@prisma/client';
import ava, { TestFn } from 'ava';
import { Express } from 'express';
import { type User } from '@prisma/client';
import ava, { type TestFn } from 'ava';
import type { Express } from 'express';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
import request from 'supertest';

View File

@ -5,7 +5,7 @@ import {
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { PrismaClient } from '@prisma/client';
import ava, { TestFn } from 'ava';
import ava, { type TestFn } from 'ava';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
import { AppModule } from '../src/app';

View File

@ -1,6 +1,6 @@
import { mock } from 'node:test';
import { INestApplication } from '@nestjs/common';
import type { INestApplication } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import test from 'ava';
import { register } from 'prom-client';

View File

@ -1,4 +1,4 @@
import { Controller, Get, INestApplication } from '@nestjs/common';
import { Controller, Get, type INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import test from 'ava';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';

View File

@ -8,7 +8,7 @@ import {
} from '@affine-test/kit/utils/cloud';
import { Test, TestingModule } from '@nestjs/testing';
import { PrismaClient } from '@prisma/client';
import ava, { TestFn } from 'ava';
import ava, { type TestFn } from 'ava';
import { ConfigModule } from '../src/config';
import { GqlModule } from '../src/graphql.module';

View File

@ -3,8 +3,8 @@ import { randomUUID } from 'node:crypto';
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { hashSync } from '@node-rs/argon2';
import { User } from '@prisma/client';
import ava, { TestFn } from 'ava';
import { type User } from '@prisma/client';
import ava, { type TestFn } from 'ava';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
import { AppModule } from '../src/app';

View File

@ -1,7 +1,7 @@
/// <reference types="../src/global.d.ts" />
import { Test, TestingModule } from '@nestjs/testing';
import ava, { TestFn } from 'ava';
import ava, { type TestFn } from 'ava';
import { ConfigModule } from '../src/config';
import { SessionModule, SessionService } from '../src/session';

View File

@ -1,5 +1,5 @@
{
"extends": "../tsconfig.json",
"extends": "../../../tsconfig.json",
"compilerOptions": {
"composite": true,
"target": "ESNext",
@ -7,6 +7,7 @@
"experimentalDecorators": true,
"rootDir": ".",
"outDir": "../lib/tests",
"verbatimModuleSyntax": false,
"tsBuildInfoFile": "../lib/tests/.tsbuildinfo"
},
"references": [

View File

@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto';
import type { INestApplication } from '@nestjs/common';
import { hashSync } from '@node-rs/argon2';
import { PrismaClient, User } from '@prisma/client';
import { PrismaClient, type User } from '@prisma/client';
import request from 'supertest';
import type { TokenType } from '../src/modules/auth';

View File

@ -5,7 +5,7 @@ import {
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { PrismaClient } from '@prisma/client';
import ava, { TestFn } from 'ava';
import ava, { type TestFn } from 'ava';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
import { AppModule } from '../src/app';

View File

@ -1,6 +1,6 @@
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import ava, { TestFn } from 'ava';
import ava, { type TestFn } from 'ava';
import { stub } from 'sinon';
import { AppModule } from '../src/app';

View File

@ -1,7 +1,7 @@
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { PrismaClient } from '@prisma/client';
import ava, { TestFn } from 'ava';
import ava, { type TestFn } from 'ava';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
import request from 'supertest';

View File

@ -13,7 +13,6 @@
"types": ["node"],
"outDir": "dist",
"noEmit": false,
"tsBuildInfoFile": "./dist/.tsbuildinfo",
"verbatimModuleSyntax": false,
"rootDir": "./src"
},

View File

@ -9,21 +9,21 @@
"dependencies": {
"@affine/component": "workspace:*",
"@affine/i18n": "workspace:*",
"@storybook/addon-actions": "^7.4.0",
"@storybook/addon-essentials": "^7.4.0",
"@storybook/addon-interactions": "^7.4.0",
"@storybook/addon-links": "^7.4.0",
"@storybook/addon-storysource": "^7.4.0",
"@storybook/blocks": "^7.4.0",
"@storybook/builder-vite": "^7.4.0",
"@storybook/addon-actions": "^7.4.4",
"@storybook/addon-essentials": "^7.4.4",
"@storybook/addon-interactions": "^7.4.4",
"@storybook/addon-links": "^7.4.4",
"@storybook/addon-storysource": "^7.4.4",
"@storybook/blocks": "^7.4.4",
"@storybook/builder-vite": "^7.4.4",
"@storybook/jest": "^0.2.2",
"@storybook/react": "^7.4.0",
"@storybook/react-vite": "^7.4.0",
"@storybook/react": "^7.4.4",
"@storybook/react-vite": "^7.4.4",
"@storybook/test-runner": "^0.13.0",
"@storybook/testing-library": "^0.2.0",
"@storybook/testing-library": "^0.2.1",
"@vitejs/plugin-react": "^4.0.4",
"concurrently": "^8.2.1",
"jest-mock": "^29.6.3",
"jest-mock": "^29.7.0",
"serve": "^14.2.1",
"ses": "^0.18.8",
"storybook": "^7.4.0",
@ -39,7 +39,7 @@
"@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"@tomfreudenberg/next-auth-mock": "^0.5.6",
"chromatic": "^6.24.1",
"chromatic": "^7.2.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"storybook-addon-react-router-v6": "^2.0.7"

View File

@ -66,28 +66,28 @@
"@affine/plugin-cli": "workspace:*",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@faker-js/faker": "^8.0.2",
"@faker-js/faker": "^8.1.0",
"@istanbuljs/schema": "^0.1.3",
"@magic-works/i18n-codegen": "^0.5.0",
"@nx/vite": "16.8.1",
"@nx/vite": "16.9.0",
"@perfsee/sdk": "^1.9.0",
"@playwright/test": "^1.37.1",
"@playwright/test": "^1.38.1",
"@taplo/cli": "^0.5.2",
"@testing-library/react": "^14.0.0",
"@toeverything/infra": "workspace:*",
"@types/affine__env": "workspace:*",
"@types/eslint": "^8.44.2",
"@types/node": "^18.17.12",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"@types/node": "^18.17.18",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"@vanilla-extract/vite-plugin": "^3.9.0",
"@vanilla-extract/webpack-plugin": "^2.3.0",
"@vanilla-extract/webpack-plugin": "^2.3.1",
"@vitejs/plugin-react-swc": "^3.3.2",
"@vitest/coverage-istanbul": "0.33.0",
"@vitest/ui": "0.33.0",
"eslint": "^8.48.0",
"@vitest/coverage-istanbul": "0.34.5",
"@vitest/ui": "0.34.5",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-i": "^2.28.0",
"eslint-plugin-i": "^2.28.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
@ -101,21 +101,22 @@
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"madge": "^6.1.0",
"msw": "^1.2.5",
"msw": "^1.3.1",
"nanoid": "^4.0.2",
"nx": "16.8.1",
"nx-cloud": "latest",
"nx": "^16.9.0",
"nx-cloud": "^16.4.0",
"nyc": "^15.1.0",
"prettier": "^3.0.3",
"semver": "^7.5.4",
"serve": "^14.2.1",
"string-width": "^5.1.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vite-plugin-istanbul": "^5.0.0",
"vite-plugin-static-copy": "^0.17.0",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "0.33.0",
"vitest": "0.34.5",
"vitest-fetch-mock": "^0.2.2",
"vitest-mock-extended": "^1.2.1"
},
@ -175,6 +176,8 @@
"typed-array-length": "npm:@nolyfill/typed-array-length@latest",
"unbox-primitive": "npm:@nolyfill/unbox-primitive@latest",
"which-boxed-primitive": "npm:@nolyfill/which-boxed-primitive@latest",
"which-typed-array": "npm:@nolyfill/which-typed-array@latest"
"which-typed-array": "npm:@nolyfill/which-typed-array@latest",
"next-auth@^4.23.1": "patch:next-auth@npm%3A4.23.1#./.yarn/patches/next-auth-npm-4.23.1-6ed6a0f727.patch",
"next-auth@4.23.1": "patch:next-auth@npm%3A4.23.1#./.yarn/patches/next-auth-npm-4.23.1-6ed6a0f727.patch"
}
}

View File

@ -36,17 +36,18 @@
"@radix-ui/react-scroll-area": "^1.0.4",
"@radix-ui/react-toast": "^1.1.4",
"@toeverything/hooks": "workspace:*",
"@toeverything/infra": "workspace:*",
"@toeverything/theme": "^0.7.18",
"@vanilla-extract/dynamic": "^2.0.3",
"check-password-strength": "^2.0.7",
"clsx": "^2.0.0",
"dayjs": "^1.11.9",
"jotai": "^2.4.1",
"dayjs": "^1.11.10",
"jotai": "^2.4.2",
"lit": "^2.8.0",
"lottie-react": "^2.4.0",
"lottie-web": "^5.12.2",
"react": "18.2.0",
"react-datepicker": "^4.16.0",
"react-datepicker": "^4.18.0",
"react-dom": "18.2.0",
"react-error-boundary": "^4.0.11",
"react-is": "^18.2.0",
@ -60,7 +61,7 @@
"@blocksuite/icons": "^2.1.33",
"@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"@types/react": "^18.2.21",
"@types/react": "^18.2.22",
"@types/react-datepicker": "^4.15.0",
"@types/react-dnd": "^3.0.2",
"@types/react-dom": "^18.2.7",

View File

@ -6,7 +6,7 @@
"debug": "^4.3.4"
},
"devDependencies": {
"@types/debug": "^4.1.8"
"@types/debug": "^4.1.9"
},
"version": "0.9.0-canary.13"
}

View File

@ -23,7 +23,10 @@
},
"dependencies": {
"@affine/env": "workspace:*",
"graphql": "^16.8.0",
"graphql": "^16.8.1",
"nanoid": "^4.0.2"
},
"installConfig": {
"hoistingLimits": "workspaces"
}
}

View File

@ -27,11 +27,11 @@
"url": "git+https://github.com/toeverything/AFFiNE.git"
},
"dependencies": {
"i18next": "^23.4.6",
"i18next": "^23.5.1",
"react-i18next": "^13.1.2"
},
"devDependencies": {
"@types/node": "^18.17.12",
"@types/node": "^18.17.18",
"@types/prettier": "^3.0.0",
"prettier": "^3.0.3",
"ts-node": "^10.9.1",

View File

@ -58,7 +58,7 @@
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"jotai": "^2.4.1",
"jotai": "^2.4.2",
"tinykeys": "^2.1.0",
"zod": "^3.22.2"
},
@ -69,7 +69,7 @@
"electron": "link:../../apps/electron/node_modules/electron",
"react": "^18.2.0",
"vite": "^4.4.9",
"vite-plugin-dts": "3.5.3",
"vite-plugin-dts": "3.5.4",
"yjs": "^13.6.8"
},
"peerDependencies": {

View File

@ -19,13 +19,15 @@
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "^2.16.2",
"@types/node": "^18.17.12",
"@types/uuid": "^9.0.3",
"@types/node": "^18.17.18",
"@types/uuid": "^9.0.4",
"cross-env": "^7.0.3",
"nx": "^16.9.0",
"nx-cloud": "^16.4.0",
"rxjs": "^7.8.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"uuid": "^9.0.0"
"uuid": "^9.0.1"
},
"engines": {
"node": ">= 10"

View File

@ -10,8 +10,9 @@
"tsconfig.json"
],
"dependencies": {
"@endo/static-module-record": "^0.8.2",
"@plugxjs/vite-plugin": "0.0.3",
"@swc/core": "^1.3.81",
"@swc/core": "^1.3.87",
"@toeverything/infra": "workspace:^",
"@vanilla-extract/rollup-plugin": "^1.3.0",
"@vitejs/plugin-vue": "^4.3.4",

View File

@ -22,14 +22,15 @@
"dist"
],
"dependencies": {
"@blocksuite/block-std": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"jotai": "^2.4.1",
"jotai": "^2.4.2",
"zod": "^3.22.2"
},
"devDependencies": {
"vite": "^4.4.9",
"vite-plugin-dts": "3.5.3"
"vite-plugin-dts": "3.5.4"
}
}

View File

@ -37,7 +37,9 @@
},
"devDependencies": {
"@napi-rs/cli": "^3.0.0-alpha.5",
"lib0": "^0.2.83",
"lib0": "^0.2.85",
"nx": "^16.9.0",
"nx-cloud": "^16.4.0",
"yjs": "^13.6.8"
}
}

View File

@ -6,6 +6,6 @@
"dev": "wrangler dev"
},
"devDependencies": {
"wrangler": "^3.6.0"
"wrangler": "^3.9.0"
}
}

View File

@ -24,21 +24,21 @@
"@toeverything/hooks": "workspace:*",
"@toeverything/y-indexeddb": "workspace:*",
"async-call-rpc": "^6.3.1",
"jotai": "^2.4.1",
"jotai": "^2.4.2",
"js-base64": "^3.7.5",
"ky": "^1.0.1",
"lib0": "^0.2.83",
"lib0": "^0.2.85",
"react": "18.2.0",
"react-dom": "18.2.0",
"socket.io-client": "^4.7.2",
"swr": "2.2.0",
"y-protocols": "^1.0.5",
"y-protocols": "^1.0.6",
"yjs": "^13.6.8",
"zod": "^3.22.2"
},
"devDependencies": {
"@types/ws": "^8.5.5",
"ws": "^8.13.0"
"ws": "^8.14.2"
},
"version": "0.9.0-canary.13"
}

View File

@ -41,7 +41,7 @@
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"vite": "^4.4.9",
"vite-plugin-dts": "3.5.3",
"vite-plugin-dts": "3.5.4",
"y-indexeddb": "^9.0.11"
},
"peerDependencies": {

View File

@ -21,13 +21,13 @@
"langchain": "^0.0.138",
"marked": "^7.0.5",
"marked-gfm-heading-id": "^3.1.0",
"marked-mangle": "^1.1.2",
"marked-mangle": "^1.1.4",
"zod": "^3.22.2"
},
"devDependencies": {
"@affine/plugin-cli": "workspace:*",
"@types/marked": "^5.0.1",
"jotai": "^2.4.1",
"jotai": "^2.4.2",
"react": "18.2.0",
"react-dom": "18.2.0"
},

View File

@ -22,7 +22,7 @@
},
"devDependencies": {
"@affine/plugin-cli": "workspace:*",
"jotai": "^2.4.1",
"jotai": "^2.4.2",
"react": "18.2.0",
"react-dom": "18.2.0"
}

View File

@ -17,7 +17,7 @@
"dependencies": {
"@affine/component": "workspace:*",
"@affine/sdk": "workspace:*",
"element-plus": "^2.3.12",
"element-plus": "^2.3.14",
"vue": "^3.3.4"
},
"devDependencies": {

View File

@ -1,4 +1,6 @@
const semver = await import('../apps/server/node_modules/semver/index.js');
const semver = await import('semver').catch(() =>
import('../apps/server/node_modules/semver/index.js')
);
import packageJson from '../package.json' assert { type: 'json' };

View File

@ -1,3 +1,4 @@
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { runCli } from '@magic-works/i18n-codegen';
@ -7,9 +8,7 @@ beforeAll(async () => {
await runCli(
{
watch: false,
cwd: fileURLToPath(
new URL('../../../.i18n-codegen.json', import.meta.url)
),
cwd: join(fileURLToPath(import.meta.url), '../../../.i18n-codegen.json'),
},
error => {
console.error(error);

View File

@ -7,7 +7,7 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@playwright/test": "^1.37.1"
"@playwright/test": "^1.38.1"
},
"version": "0.9.0-canary.13"
}

View File

@ -7,8 +7,8 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@playwright/test": "^1.37.1",
"@types/fs-extra": "^11.0.1",
"@playwright/test": "^1.38.1",
"@types/fs-extra": "^11.0.2",
"fs-extra": "^11.1.1"
},
"version": "0.9.0-canary.13"

View File

@ -7,9 +7,10 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@playwright/test": "^1.37.1",
"@types/fs-extra": "^11.0.1",
"fs-extra": "^11.1.1"
"@playwright/test": "^1.38.1",
"@types/fs-extra": "^11.0.2",
"fs-extra": "^11.1.1",
"playwright": "^1.38.1"
},
"version": "0.9.0-canary.13"
}

View File

@ -1,3 +1,4 @@
static
fixtures/*.ydoc
test-results
*.zip

View File

@ -2,7 +2,7 @@
"name": "@affine-legacy/0.7.0-canary.18",
"description": "AFFiNE 0.7.0-canary.18 static output",
"scripts": {
"unzip": "unzip affine-web -d static",
"unzip": "wget -O static.zip https://github.com/toeverything/AFFiNE/releases/download/v0.7.0-canary.18/web-static.zip && unzip static.zip -d static",
"start": "yarn exec serve -s static -l 8082",
"e2e": "yarn playwright test",
"test": "vitest --run"
@ -14,7 +14,7 @@
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"@playwright/test": "^1.37.1",
"@playwright/test": "^1.38.1",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1",
"serve": "^14.2.1"

View File

@ -1,3 +1,5 @@
static
web-static
fixtures/*.ydoc
test-results
*.zip

View File

@ -1,4 +1,4 @@
import { resolve } from 'node:path';
import { join } from 'node:path';
import { clickEdgelessModeButton } from '@affine-test/kit/utils/editor';
import { waitForEditorLoad } from '@affine-test/kit/utils/page-logic';
@ -10,7 +10,7 @@ import { expect, test } from '@playwright/test';
const { switchToNext } = setupProxyServer(
test,
resolve(__dirname, '..', 'static')
join(__dirname, '..', 'web-static')
);
test('database migration', async ({ page, context }) => {

View File

@ -2,8 +2,8 @@
"name": "@affine-legacy/0.8.0-canary.7",
"description": "AFFiNE 0.8.0-canary.7 static output",
"scripts": {
"unzip": "unzip affine-core -d static",
"start": "yarn exec serve -s static -l 8082",
"unzip": "wget -O static.zip https://github.com/toeverything/AFFiNE/releases/download/v0.8.0-canary.7/web-static.zip && unzip static.zip",
"start": "yarn exec serve -s web-static -l 8082",
"e2e": "yarn playwright test"
},
"devDependencies": {

View File

@ -1,3 +1,5 @@
static
fixtures/*.ydoc
test-results
*.zip
web-static

View File

@ -1,4 +1,4 @@
import { resolve } from 'node:path';
import { join } from 'node:path';
import { clickEdgelessModeButton } from '@affine-test/kit/utils/editor';
import {
@ -13,7 +13,7 @@ import { expect, test } from '@playwright/test';
const { switchToNext } = setupProxyServer(
test,
resolve(__dirname, '..', 'static')
join(__dirname, '..', 'web-static')
);
test('surface migration', async ({ page, context }) => {

View File

@ -1,9 +1,9 @@
{
"name": "@affine-legacy/0.8.3",
"description": "AFFiNE 0.8.3 static output",
"name": "@affine-legacy/0.8.4",
"description": "AFFiNE 0.8.4 static output",
"scripts": {
"unzip": "unzip affine-core -d static",
"start": "yarn exec serve -s static -l 8082",
"unzip": "wget -O static.zip https://github.com/toeverything/AFFiNE/releases/download/v0.8.4/web-static.zip && unzip static.zip",
"start": "yarn exec serve -s web-static -l 8082",
"e2e": "yarn playwright test"
},
"devDependencies": {
@ -13,7 +13,7 @@
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/global": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"@playwright/test": "^1.37.1",
"@playwright/test": "^1.38.1",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1",
"serve": "^14.2.1"

View File

@ -5,7 +5,7 @@ import type {
const config: PlaywrightTestConfig = {
testDir: './e2e',
fullyParallel: true,
fullyParallel: !process.env.CI,
timeout: process.env.CI ? 50_000 : 30_000,
use: {
baseURL: 'http://localhost:8081/',
@ -20,7 +20,7 @@ const config: PlaywrightTestConfig = {
video: 'on-first-retry',
},
forbidOnly: !!process.env.CI,
workers: 4,
workers: process.env.CI ? 1 : 4,
retries: 1,
reporter: process.env.CI ? 'github' : 'list',
webServer: [
@ -39,7 +39,6 @@ const config: PlaywrightTestConfig = {
if (process.env.CI) {
config.retries = 3;
config.workers = '50%';
}
export default config;

View File

@ -7,7 +7,7 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@playwright/test": "^1.37.1"
"@playwright/test": "^1.38.1"
},
"version": "0.9.0-canary.13"
}

View File

@ -7,7 +7,7 @@
"devDependencies": {
"@affine-test/fixtures": "workspace:*",
"@affine-test/kit": "workspace:*",
"@playwright/test": "^1.37.1"
"@playwright/test": "^1.38.1"
},
"version": "0.9.0-canary.13"
}

View File

@ -14,8 +14,8 @@ import {
} from './playwright';
import { removeWithRetry } from './utils/utils';
const projectRoot = resolve(__dirname, '..', '..');
const electronRoot = resolve(projectRoot, 'apps', 'electron');
const projectRoot = join(__dirname, '..', '..');
const electronRoot = join(projectRoot, 'apps', 'electron');
function generateUUID() {
return crypto.randomUUID();
@ -99,7 +99,7 @@ export const test = base.extend<{
args: [clonedDist],
env,
executablePath: resolve(
electronRoot,
projectRoot,
'node_modules',
'.bin',
`electron${ext}`

View File

@ -10,7 +10,7 @@
},
"devDependencies": {
"@node-rs/argon2": "^1.5.2",
"@playwright/test": "^1.37.1",
"@playwright/test": "^1.38.1",
"express": "^4.18.2",
"http-proxy-middleware": "^3.0.0-beta.1"
},

View File

@ -178,6 +178,9 @@
{
"path": "./tests/affine-legacy/0.7.0-canary.18"
},
{
"path": "./tests/affine-legacy/0.8.0-canary.7"
},
{
"path": "./tests/affine-cloud"
},
@ -185,10 +188,7 @@
"path": "./tests/affine-desktop"
},
{
"path": "./tests/affine-legacy/0.8.0-canary.7"
},
{
"path": "./tests/affine-legacy/0.8.3"
"path": "./tests/affine-legacy/0.8.4"
}
],
"files": [],

4493
yarn.lock

File diff suppressed because it is too large Load Diff