Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump up all non-major dependencies #5499

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,7 @@ jobs:
- name: Run unit tests
if: ${{ matrix.spec.test }}
shell: bash
run: yarn vitest
working-directory: packages/frontend/electron
run: yarn workspace @affine/electron vitest

- name: Download core artifact
uses: ./.github/actions/download-core
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
"@vanilla-extract/vite-plugin": "^3.9.2",
"@vanilla-extract/webpack-plugin": "^2.3.1",
"@vitejs/plugin-react-swc": "^3.5.0",
"@vitest/coverage-istanbul": "1.1.1",
"@vitest/ui": "1.1.1",
"@vitest/coverage-istanbul": "1.1.2",
"@vitest/ui": "1.1.2",
"electron": "^27.1.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
Expand Down Expand Up @@ -107,7 +107,7 @@
"vite-plugin-istanbul": "^5.0.0",
"vite-plugin-static-copy": "^1.0.0",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "1.1.1",
"vitest": "1.1.2",
"vitest-fetch-mock": "^0.2.2",
"vitest-mock-extended": "^1.3.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@nestjs/websockets": "^10.2.10",
"@node-rs/argon2": "^1.5.2",
"@node-rs/crc32": "^1.7.2",
"@node-rs/jsonwebtoken": "^0.2.3",
"@node-rs/jsonwebtoken": "^0.3.0",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/core": "^1.19.0",
"@opentelemetry/exporter-prometheus": "^0.46.0",
Expand All @@ -47,7 +47,7 @@
"@opentelemetry/instrumentation-http": "^0.46.0",
"@opentelemetry/instrumentation-ioredis": "^0.36.0",
"@opentelemetry/instrumentation-nestjs-core": "^0.33.3",
"@opentelemetry/instrumentation-socket.io": "^0.34.4",
"@opentelemetry/instrumentation-socket.io": "^0.35.0",
"@opentelemetry/resources": "^1.19.0",
"@opentelemetry/sdk-metrics": "^1.19.0",
"@opentelemetry/sdk-node": "^0.46.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/backend/server/src/modules/auth/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class AuthService {
exp: now + this.config.auth.accessTokenExpiresIn,
iss: this.config.serverId,
sub: user.id,
aud: user.name,
aud: 'https://affine.pro',
jti: randomUUID({
disableEntropyCache: true,
}),
Expand Down Expand Up @@ -80,7 +80,7 @@ export class AuthService {
iat: now,
iss: this.config.serverId,
sub: user.id,
aud: user.name,
aud: 'https://affine.pro',
jti: randomUUID({
disableEntropyCache: true,
}),
Expand All @@ -100,6 +100,7 @@ export class AuthService {
iss: [this.config.serverId],
leeway: this.config.auth.leeway,
requiredSpecClaims: ['exp', 'iat', 'iss', 'sub'],
aud: ['https://affine.pro'],
})
).data as UserClaim;

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/server/src/modules/auth/utils/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const jwtEncode = async (
exp: now + (maxAge ?? config.auth.accessTokenExpiresIn),
iss: config.serverId,
sub: user.id,
aud: user.name,
aud: 'https://affine.pro',
jti: randomUUID({
disableEntropyCache: true,
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"version": "napi version"
},
"devDependencies": {
"@napi-rs/cli": "3.0.0-alpha.29",
"@napi-rs/cli": "3.0.0-alpha.30",
"lib0": "^0.2.87",
"nx": "^17.1.3",
"nx-cloud": "^16.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"devDependencies": {
"@types/debug": "^4.1.9",
"vitest": "1.1.1"
"vitest": "1.1.2"
},
"version": "0.11.0"
}
2 changes: 1 addition & 1 deletion packages/common/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
"react": "18.2.0",
"react-dom": "18.2.0",
"vitest": "1.1.1",
"vitest": "1.1.2",
"zod": "^3.22.4"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"rxjs": "^7.8.1",
"vite": "^5.0.6",
"vite-plugin-dts": "3.7.0",
"vitest": "1.1.1",
"vitest": "1.1.2",
"yjs": "^13.6.10"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"yjs": "^13.6.10"
},
"devDependencies": {
"vitest": "1.1.1"
"vitest": "1.1.2"
},
"version": "0.11.0"
}
2 changes: 1 addition & 1 deletion packages/common/y-indexeddb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"fake-indexeddb": "^5.0.0",
"vite": "^5.0.6",
"vite-plugin-dts": "3.7.0",
"vitest": "1.1.1",
"vitest": "1.1.2",
"y-indexeddb": "^9.0.11",
"yjs": "^13.6.10"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/common/y-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@blocksuite/store": "0.11.0-nightly-202401020419-752a5b8",
"vite": "^5.0.6",
"vite-plugin-dts": "3.7.0",
"vitest": "1.1.1",
"vitest": "1.1.2",
"yjs": "^13.6.10"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"storybook-dark-mode": "^3.0.1",
"typescript": "^5.3.2",
"vite": "^5.0.6",
"vitest": "1.1.1",
"vitest": "1.1.2",
"yjs": "^13.6.10"
},
"version": "0.11.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@aws-sdk/client-s3": "3.484.0",
"@aws-sdk/client-s3": "3.485.0",
"@perfsee/webpack": "^1.8.4",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@sentry/webpack-plugin": "^2.8.0",
Expand All @@ -114,7 +114,7 @@
"swc-loader": "^0.2.3",
"swc-plugin-coverage-instrument": "^0.0.20",
"thread-loader": "^4.0.2",
"vitest": "1.1.1",
"vitest": "1.1.2",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"ts-node": "^10.9.1",
"undici": "^6.0.0",
"uuid": "^9.0.1",
"vitest": "1.1.1",
"vitest": "1.1.2",
"which": "^4.0.0",
"zod": "^3.22.4"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/electron/test/db/ensure-db.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { setTimeout } from 'node:timers/promises';

import { removeWithRetry } from '@affine-test/kit/utils/utils';
import { v4 } from 'uuid';
import { afterEach, beforeEach, expect, test, vi } from 'vitest';
import { afterAll, afterEach, beforeEach, expect, test, vi } from 'vitest';

const tmpDir = path.join(__dirname, 'tmp');
const appDataPath = path.join(tmpDir, 'app-data');
Expand Down Expand Up @@ -48,6 +48,10 @@ afterEach(async () => {
vi.useRealTimers();
});

afterAll(() => {
vi.doUnmock('@affine/electron/helper/main-rpc');
});

test('can get a valid WorkspaceSQLiteDB', async () => {
const { ensureSQLiteDB } = await import(
'@affine/electron/helper/db/ensure-db'
Expand Down
37 changes: 27 additions & 10 deletions packages/frontend/electron/test/db/migration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
import path from 'node:path';

import {
copyToTemp,
migrateToSubdocAndReplaceDatabase,
} from '@affine/electron/helper/db/migration';
import { SqliteConnection } from '@affine/native';
import { removeWithRetry } from '@affine-test/kit/utils/utils';
import { afterEach, describe, expect, it, vi } from 'vitest';
import {
afterAll,
afterEach,
beforeAll,
describe,
expect,
it,
vi,
} from 'vitest';
import { applyUpdate, Doc as YDoc } from 'yjs';

const tmpDir = path.join(__dirname, 'tmp');
const testDBFilePath = path.resolve(__dirname, 'old-db.affine');

const appDataPath = path.join(tmpDir, 'app-data');

vi.mock('@affine/electron/helper/main-rpc', () => ({
mainRPC: {
getPath: async () => appDataPath,
},
}));
beforeAll(() => {
vi.doMock('@affine/electron/helper/main-rpc', () => ({
mainRPC: {
getPath: async () => appDataPath,
channel: {
on: () => {},
send: () => {},
},
},
}));
});

afterEach(async () => {
await removeWithRetry(tmpDir);
});

afterAll(() => {
vi.doUnmock('@affine/electron/helper/main-rpc');
});

describe('migrateToSubdocAndReplaceDatabase', () => {
it('should migrate and replace the database', async () => {
const { copyToTemp, migrateToSubdocAndReplaceDatabase } = await import(
'@affine/electron/helper/db/migration'
);
const copiedDbFilePath = await copyToTemp(testDBFilePath);
await migrateToSubdocAndReplaceDatabase(copiedDbFilePath);

Expand Down
18 changes: 12 additions & 6 deletions packages/frontend/electron/test/db/workspace-db-adapter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@ import { dbSubjects } from '@affine/electron/helper/db/subjects';
import { removeWithRetry } from '@affine-test/kit/utils/utils';
import fs from 'fs-extra';
import { v4 } from 'uuid';
import { afterEach, expect, test, vi } from 'vitest';
import { afterAll, afterEach, beforeAll, expect, test, vi } from 'vitest';
import { Doc as YDoc, encodeStateAsUpdate } from 'yjs';

const tmpDir = path.join(__dirname, 'tmp');
const appDataPath = path.join(tmpDir, 'app-data');

vi.doMock('@affine/electron/helper/main-rpc', () => ({
mainRPC: {
getPath: async () => appDataPath,
},
}));
beforeAll(() => {
vi.doMock('@affine/electron/helper/main-rpc', () => ({
mainRPC: {
getPath: async () => appDataPath,
},
}));
});

afterEach(async () => {
await removeWithRetry(tmpDir);
});

afterAll(() => {
vi.doUnmock('@affine/electron/helper/main-rpc');
});

let testYDoc: YDoc;
let testYSubDoc: YDoc;

Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/electron/test/workspace/handlers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';
import { removeWithRetry } from '@affine-test/kit/utils/utils';
import fs from 'fs-extra';
import { v4 } from 'uuid';
import { afterEach, describe, expect, test, vi } from 'vitest';
import { afterAll, afterEach, describe, expect, test, vi } from 'vitest';

const tmpDir = path.join(__dirname, 'tmp');
const appDataPath = path.join(tmpDir, 'app-data');
Expand All @@ -24,6 +24,10 @@ afterEach(async () => {
await removeWithRetry(tmpDir);
});

afterAll(() => {
vi.doUnmock('@affine/electron/helper/main-rpc');
});

describe('list workspaces', () => {
test('listWorkspaces (valid)', async () => {
const { listWorkspaces } = await import(
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"prettier": "^3.0.3",
"vitest": "1.1.1"
"vitest": "1.1.2"
},
"scripts": {
"postinstall": "gql-gen --errors-only"
Expand Down
44 changes: 44 additions & 0 deletions packages/frontend/native/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,35 @@ switch (platform) {
loadError = e
}
break
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'affine.linux-riscv64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./affine.linux-riscv64-musl.node')
} else {
nativeBinding = require('@affine/native-linux-riscv64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'affine.linux-riscv64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./affine.linux-riscv64-gnu.node')
} else {
nativeBinding = require('@affine/native-linux-riscv64-gnu')
}
} catch (e) {
loadError = e
}
}
break
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`)
}
Expand All @@ -277,6 +306,21 @@ switch (platform) {
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
}

if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
try {
nativeBinding = require('./affine.wasi.cjs')
} catch {
// ignore
}
if (!nativeBinding) {
try {
nativeBinding = require('@affine/native-wasm32-wasi')
} catch (err) {
console.error(err)
}
}
}

if (!nativeBinding) {
if (loadError) {
throw loadError
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
},
"devDependencies": {
"@napi-rs/cli": "3.0.0-alpha.29",
"@napi-rs/cli": "3.0.0-alpha.30",
"@types/node": "^20.9.3",
"@types/uuid": "^9.0.7",
"ava": "^6.0.0",
Expand Down
Loading
Loading