Skip to content

Commit

Permalink
chore: move packages
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed Dec 2, 2024
1 parent 30aaa1e commit 67892b2
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 59 deletions.
2 changes: 2 additions & 0 deletions packages/backend/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"start": "node --loader ts-node/esm/transpile-only.mjs ./src/index.ts",
"dev": "nodemon ./src/index.ts",
"test": "ava --concurrency 1 --serial",
"test:copilot:e2e": "ava \"e2e/copilot.e2e.ts\"",
"test:copilot:spec": "ava \"tests/**/copilot-*.spec.ts\"",
"test:coverage": "c8 ava --concurrency 1 --serial",
"test:copilot:e2e:coverage": "c8 ava --timeout=5m \"e2e/copilot.e2e.ts\"",
"test:copilot:spec:coverage": "c8 ava --timeout=5m \"tests/**/copilot-*.spec.ts\"",
"postinstall": "prisma generate",
"data-migration": "node --loader ts-node/esm/transpile-only.mjs ./src/data/index.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { randomUUID } from 'node:crypto';

import { createWorkspace } from '@affine/server/tests/utils';
import { createRandomAIUser } from '@affine-test/kit/utils/cloud';
import type { ExecutionContext, TestFn } from 'ava';
import ava from 'ava';

import { createWorkspace } from './utils';
import {
chatWithImages,
chatWithText,
Expand All @@ -10,10 +14,7 @@ import {
ProviderActionTestCase,
ProviderWorkflowTestCase,
sse2array,
} from '@affine/server/tests/utils/copilot';
import { createRandomAIUser } from '@affine-test/kit/utils/cloud';
import type { ExecutionContext, TestFn } from 'ava';
import ava from 'ava';
} from './utils/copilot';

type Tester = {
app: any;
Expand Down Expand Up @@ -50,15 +51,15 @@ export const runPrisma = async <T>(
cb: (
prisma: InstanceType<
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
typeof import('../../../packages/backend/server/node_modules/@prisma/client').PrismaClient
typeof import('../../../../packages/backend/server/node_modules/@prisma/client').PrismaClient
>
) => Promise<T>
): Promise<T> => {
const {
PrismaClient,
// eslint-disable-next-line @typescript-eslint/no-var-requires
} = await import(
'../../../packages/backend/server/node_modules/@prisma/client'
'../../../../packages/backend/server/node_modules/@prisma/client'
);
const client = new PrismaClient();
await client.$connect();
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/server/tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"path": "../../../../tests/kit/tsconfig.json"
}
],
"include": ["."],
"include": [".", "utils"],
"exclude": []
}
21 changes: 0 additions & 21 deletions tests/affine-cloud-copilot/tsconfig.json

This file was deleted.

File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"extends": "../../tsconfig.json",
"extends": "../../../tsconfig.json",
"compilerOptions": {
"esModuleInterop": true,
"outDir": "lib"
},
"include": ["e2e"],
"references": [
{
"path": "../../tests/kit"
"path": "../../../tests/kit"
},
{
"path": "../../tests/fixtures"
"path": "../../../tests/fixtures"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{
"name": "@affine-test/affine-cloud-copilot",
"private": true,
"type": "module",
"scripts": {
"test:e2e": "yarn playwright test",
"test:api": "ava \"e2e/copilot.e2e.ts\"",
"test:api:coverage": "c8 ava --timeout=5m \"e2e/copilot.e2e.ts\""
"test:e2e": "yarn playwright test"
},
"devDependencies": {
"@affine-test/kit": "workspace:*",
"@affine/server": "workspace:*",
"@playwright/test": "=1.49.0",
"ava": "^6.1.2"
},
"version": "0.18.0"
"version": "0.17.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {

const config: PlaywrightTestConfig = {
testDir: './e2e',
testMatch: '**/*.spec.ts',
fullyParallel: !process.env.CI,
timeout: 120_000,
outputDir: testResultDir,
Expand Down
16 changes: 16 additions & 0 deletions tests/affine-cloud/copilot/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"esModuleInterop": true,
"outDir": "lib"
},
"include": ["e2e"],
"references": [
{
"path": "../../../tests/kit"
},
{
"path": "../../../tests/fixtures"
}
]
}
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@
"path": "./tests/affine-legacy/0.8.0-canary.7"
},
{
"path": "./tests/affine-cloud"
"path": "./tests/affine-cloud/cloud"
},
{
"path": "./tests/affine-cloud/copilot"
},
{
"path": "./tests/affine-desktop"
Expand Down
22 changes: 1 addition & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,6 @@ __metadata:
languageName: unknown
linkType: soft

"@affine-test/affine-cloud-copilot@workspace:tests/affine-cloud-copilot":
version: 0.0.0-use.local
resolution: "@affine-test/affine-cloud-copilot@workspace:tests/affine-cloud-copilot"
dependencies:
"@affine-test/kit": "workspace:*"
"@affine/server": "workspace:*"
"@playwright/test": "npm:=1.49.0"
ava: "npm:^6.1.2"
languageName: unknown
linkType: soft

"@affine-test/affine-cloud@workspace:tests/affine-cloud":
version: 0.0.0-use.local
resolution: "@affine-test/affine-cloud@workspace:tests/affine-cloud"
dependencies:
"@affine-test/kit": "workspace:*"
"@playwright/test": "npm:=1.49.0"
languageName: unknown
linkType: soft

"@affine-test/affine-desktop-cloud@workspace:tests/affine-desktop-cloud":
version: 0.0.0-use.local
resolution: "@affine-test/affine-desktop-cloud@workspace:tests/affine-desktop-cloud"
Expand Down Expand Up @@ -757,7 +737,7 @@ __metadata:
languageName: unknown
linkType: soft

"@affine/server@workspace:*, @affine/server@workspace:packages/backend/server":
"@affine/server@workspace:packages/backend/server":
version: 0.0.0-use.local
resolution: "@affine/server@workspace:packages/backend/server"
dependencies:
Expand Down

0 comments on commit 67892b2

Please sign in to comment.