feat: use nx to manage monorepo (#2748)

This commit is contained in:
Himself65
2023-06-10 00:46:24 +08:00
committed by GitHub
parent 1e6e0336c3
commit eeb536d460
14 changed files with 519 additions and 182 deletions
+15 -15
View File
@@ -1,10 +1,11 @@
{
"name": "AFFiNE",
"name": "@affine/monorepo",
"version": "0.7.0-canary.11",
"private": true,
"author": "toeverything",
"license": "MPL-2.0",
"workspaces": [
".",
"apps/*",
"plugins/*",
"packages/*",
@@ -13,30 +14,26 @@
],
"scripts": {
"dev": "dev-web",
"dev:ac": "API_SERVER_PROFILE=ac yarn workspace @affine/web dev",
"dev:local": "PORT=8080 API_SERVER_PROFILE=local yarn workspace @affine/web dev",
"dev:electron": "yarn workspace @affine/electron dev:app",
"dev:plugins": "./apps/electron/scripts/plugins/dev-plugins.mjs",
"build": "yarn build:infra && yarn workspace @affine/web build",
"build": "nx build @affine/web",
"build:infra": "yarn workspace @toeverything/plugin-infra build && yarn workspace @toeverything/infra build",
"build:storybook": "yarn build:infra && yarn workspace @affine/storybook build-storybook",
"build:storybook": "nx build @affine/storybook",
"build:plugins": "./apps/electron/scripts/plugins/build-plugins.mjs",
"bump:nightly": "./scripts/bump-blocksuite.sh",
"circular": "madge --circular --ts-config ./tsconfig.json ./apps/web/src/pages/**/*.tsx",
"export": "yarn workspace @affine/web export",
"start": "yarn workspace @affine/web start",
"start:web": "yarn workspace @affine/web start",
"start:storybook": "yarn exec serve packages/storybook/storybook-static -l 6006",
"serve:test-static": "yarn exec serve tests/fixtures --cors -p 8081",
"start:e2e": "yar dlx run-p start start:storybook",
"lint": "eslint . --ext .js,mjs,.ts,.tsx --cache",
"lint:fix": "yarn lint --fix",
"test": "playwright test",
"test:coverage": "COVERAGE=true yarn test --forbid-only",
"test:unit": "ENABLE_PRELOADING=false vitest --run",
"test:unit:ui": "ENABLE_PRELOADING=false vitest --ui",
"test:unit:coverage": "ENABLE_PRELOADING=false vitest run --coverage",
"e2e": "playwright test",
"e2e:coverage": "COVERAGE=true yarn e2e --forbid-only",
"start:e2e": "yar dlx run-p start start:storybook",
"test": "ENABLE_PRELOADING=false vitest --run",
"test:ui": "ENABLE_PRELOADING=false vitest --ui",
"test:coverage": "ENABLE_PRELOADING=false vitest run --coverage",
"postinstall": "i18n-codegen gen && husky install",
"notify": "node scripts/notify.mjs",
"circular": "madge --circular --ts-config ./tsconfig.json ./apps/web/src/pages/**/*.tsx",
"typecheck": "tsc -b tsconfig.json --diagnostics"
},
"lint-staged": {
@@ -58,6 +55,8 @@
"@playwright/test": "=1.33.0",
"@taplo/cli": "^0.5.2",
"@testing-library/react": "^14.0.0",
"@toeverything/infra": "workspace:*",
"@toeverything/plugin-infra": "workspace:*",
"@types/eslint": "^8.40.0",
"@types/node": "^18.16.16",
"@typescript-eslint/eslint-plugin": "^5.59.8",
@@ -82,6 +81,7 @@
"madge": "^6.1.0",
"msw": "^1.2.1",
"nanoid": "^4.0.2",
"nx": "16.3.2",
"nyc": "^15.1.0",
"prettier": "^2.8.8",
"react": "18.3.0-canary-16d053d59-20230506",