Skip to content
Open
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
84 changes: 84 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,90 @@ Before submitting your contribution, please ensure the following:

Happy translating! 🌍✨

## Troubleshooting development environment

### Common issues and solutions

#### Module resolution errors during `pnpm dev`

**Symptom:**
```
[vite] Internal server error: Failed to resolve import "@plane/utils"
or
Cannot find module '@plane/hooks' or its corresponding type declarations
```

**Root Cause:**
This happens when workspace package build artifacts are missing or corrupted, usually after:
- Interrupting builds with `Ctrl+C`
- Switching git branches without rebuilding
- Package updates without reinstalling dependencies

**Solutions:**

1. **Automatic fix** (rebuilds packages during install):
```bash
pnpm install
pnpm dev
```
The `prepare` npm hook automatically builds all workspace packages after install.

2. **Quick manual rebuild** (rebuilds only workspace packages):
```bash
pnpm build:packages
pnpm dev
```

3. **Nuclear option** (cleans everything and rebuilds):
```bash
pnpm dev:clean
```

#### Understanding workspace package builds

Plane uses an **artifact-based** monorepo architecture. Most workspace packages (`@plane/utils`, `@plane/hooks`, `@plane/types`, etc.) must be built to `dist/` folders before apps can import them.

**Key packages requiring builds:**
- `@plane/constants` → `packages/constants/dist/`
- `@plane/decorators` → `packages/decorators/dist/`
- `@plane/editor` → `packages/editor/dist/`
- `@plane/hooks` → `packages/hooks/dist/`
- `@plane/i18n` → `packages/i18n/dist/`
- `@plane/logger` → `packages/logger/dist/`
- `@plane/propel` → `packages/propel/dist/`
- `@plane/services` → `packages/services/dist/`
- `@plane/types` → `packages/types/dist/`
- `@plane/ui` → `packages/ui/dist/`
- `@plane/utils` → `packages/utils/dist/`

**Exception:** `@plane/shared-state` uses source resolution (no build required).

#### How the automatic fix works

The `prepare` npm lifecycle hook in the root [package.json](package.json) automatically builds all workspace packages after `pnpm install` completes. This ensures:
- Fresh clones have packages built immediately
- Interrupted builds are repaired on next install
- Branch switches followed by install rebuild packages
- No manual intervention required in most cases

Additionally, Turbo's dependency graph (configured in [turbo.json](turbo.json)) ensures that when you run `pnpm dev`, it checks if upstream packages need building and builds them first if necessary.

#### Commands for workspace management

| Command | Purpose | Use When |
|---------|---------|----------|
| `pnpm build:packages` | Build only workspace packages (fast) | After git branch switch |
| `pnpm clean:packages` | Remove package dist/ folders | Clearing corrupted builds |
| `pnpm dev:clean` | Full cleanup + rebuild + dev | Nuclear reset option |

#### Preventing future issues

After running `pnpm install`, all workspace packages are automatically built via the `prepare` hook. If you still encounter issues:

1. Ensure you've run `pnpm install` after interrupting dev with Ctrl+C
2. If packages are corrupted mid-build, run `pnpm clean:packages && pnpm build:packages`
3. For persistent issues, use the nuclear option: `pnpm dev:clean`

## Need help? Questions and suggestions

Questions, suggestions, and thoughts are most welcome. We can also be reached in our [Discord Server](https://discord.com/invite/A92xrEGCge).
61 changes: 16 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,32 @@
"name": "plane",
"description": "Open-source project management that unlocks customer value",
"repository": "https://github.com/makeplane/plane.git",
"version": "1.2.0",
"version": "1.1.0",
"license": "AGPL-3.0",
"private": true,
"scripts": {
"prepare": "turbo run build --filter='./packages/*'",
"build": "turbo run build",
"build:packages": "turbo run build --filter='./packages/*'",
"clean:packages": "rm -rf packages/*/dist",
"dev": "turbo run dev --concurrency=18",
"dev:clean": "pnpm clean:packages && pnpm dev",
"start": "turbo run start",
"clean": "turbo run clean && rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist",
"fix": "turbo run fix",
"fix:format": "turbo run fix:format",
"fix:lint": "turbo run fix:lint",
"check": "turbo run check",
"check:lint": "turbo run check:lint",
"check:format": "turbo run check:format",
"check:types": "turbo run check:types",
"prepare": "husky"
"check:types": "turbo run check:types"
},
"devDependencies": {
"@eslint/js": "9.39.1",
"@prettier/plugin-oxc": "0.1.3",
"@vitest/eslint-plugin": "1.5.1",
"eslint": "9.39.1",
"eslint-config-prettier": "10.1.8",
"eslint-import-resolver-node": "0.3.9",
"eslint-import-resolver-typescript": "4.4.4",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-n": "17.23.1",
"eslint-plugin-promise": "7.2.1",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-refresh": "0.4.24",
"eslint-plugin-storybook": "10.1.4",
"eslint-plugin-turbo": "2.6.3",
"globals": "16.5.0",
"husky": "9.1.7",
"lint-staged": "16.2.7",
"prettier": "3.7.4",
"turbo": "2.6.3",
"typescript-eslint": "8.48.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,cjs,mjs,cts,mts,json,css,md}": [
"pnpm exec prettier --write --ignore-unknown"
],
"*.{js,jsx,ts,tsx,cjs,mjs,cts,mts}": [
"pnpm exec eslint --fix --max-warnings=0 --no-warn-ignored"
]
"prettier": "latest",
"prettier-plugin-tailwindcss": "^0.6.14",
"turbo": "2.6.1"
},
"pnpm": {
"overrides": {
"express": "catalog:",
"mdast-util-to-hast": "13.2.1",
"valibot": "1.2.0",
"glob": "11.1.0",
"js-yaml": "4.1.1",
"brace-expansion": "2.0.2",
Expand All @@ -69,18 +41,17 @@
"prosemirror-view": "1.40.0",
"@types/express": "4.17.23",
"typescript": "catalog:",
"vite": "catalog:",
"qs": "6.14.1"
"vite": "catalog:"
},
"onlyBuiltDependencies": [
"@sentry/cli",
"turbo"
],
"ignoredBuiltDependencies": [
"sharp"
"@swc/core",
"core-js",
"esbuild",
"turbo",
"unrs-resolver"
]
},
"packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a",
"packageManager": "pnpm@10.21.0",
"engines": {
"node": ">=22.18.0"
}
Expand Down
21 changes: 12 additions & 9 deletions packages/constants/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
{
"name": "@plane/constants",
"version": "1.2.0",
"version": "1.1.0",
"private": true,
"license": "AGPL-3.0",
"type": "module",
"scripts": {
"dev": "tsdown --watch",
"build": "tsdown",
"check:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --max-warnings=30",
"check:lint": "eslint . --max-warnings 0",
"check:types": "tsc --noEmit",
"check:format": "prettier . --cache --check",
"fix:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --fix --max-warnings=30",
"fix:format": "prettier . --cache --write",
"check:format": "prettier --check \"**/*.{ts,tsx,md,json,css,scss}\"",
"fix:lint": "eslint . --fix",
"fix:format": "prettier --write \"**/*.{ts,tsx,md,json,css,scss}\"",
"clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist"
},
"dependencies": {
"@plane/types": "workspace:*"
},
"devDependencies": {
"@plane/eslint-config": "workspace:*",
"@plane/typescript-config": "workspace:*",
"@types/node": "catalog:",
"@types/react": "catalog:",
"tsdown": "catalog:",
"typescript": "catalog:"
},
"main": "./dist/index.mjs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"types": "./dist/index.d.cts",
"exports": {
".": "./dist/index.mjs",
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
}
}
19 changes: 11 additions & 8 deletions packages/decorators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
"description": "Controller and route decorators for Express.js applications",
"license": "AGPL-3.0",
"private": true,
"type": "module",
"exports": {
".": "./dist/index.mjs",
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsdown",
"dev": "tsdown --watch",
"check:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --max-warnings=29",
"check:lint": "eslint . --max-warnings 2",
"check:types": "tsc --noEmit",
"check:format": "prettier . --cache --check",
"fix:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --fix --max-warnings=29",
"fix:format": "prettier . --cache --write",
"check:format": "prettier --check \"**/*.{ts,tsx,md,json,css,scss}\"",
"fix:lint": "eslint . --fix",
"fix:format": "prettier --write \"**/*.{ts,tsx,md,json,css,scss}\"",
"clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist"
},
"devDependencies": {
"@plane/eslint-config": "workspace:*",
"@plane/typescript-config": "workspace:*",
"@types/express": "4.17.23",
"@types/node": "catalog:",
Expand All @@ -28,7 +31,7 @@
"tsdown": "catalog:",
"typescript": "catalog:"
},
"main": "./dist/index.mjs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts"
"types": "./dist/index.d.cts"
}
36 changes: 19 additions & 17 deletions packages/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
{
"name": "@plane/editor",
"version": "1.2.0",
"version": "1.1.0",
"description": "Core Editor that powers Plane",
"license": "AGPL-3.0",
"private": true,
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.cts",
"exports": {
".": "./dist/index.js",
"./lib": "./dist/lib.js",
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./lib": {
"import": "./dist/lib.mjs",
"require": "./dist/lib.cjs"
},
"./package.json": "./package.json",
"./styles.css": "./dist/styles/index.css",
"./styles": "./dist/styles/index.css"
},
"scripts": {
"build": "tsc && tsdown",
"dev": "tsdown --watch",
"check:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --max-warnings=1435",
"check:lint": "eslint . --max-warnings 30",
"check:types": "tsc --noEmit",
"check:format": "prettier . --cache --check",
"fix:lint": "eslint . --cache --cache-location node_modules/.cache/eslint/ --fix --max-warnings=1435",
"fix:format": "prettier . --cache --write",
"check:format": "prettier --check \"**/*.{ts,tsx,md,json,css,scss}\"",
"fix:lint": "eslint . --fix",
"fix:format": "prettier --write \"**/*.{ts,tsx,md,json,css,scss}\"",
"clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist"
},
"peerDependencies": {
Expand All @@ -36,24 +42,22 @@
"@hocuspocus/provider": "2.15.2",
"@plane/constants": "workspace:*",
"@plane/hooks": "workspace:*",
"@plane/propel": "workspace:*",
"@plane/types": "workspace:*",
"@plane/ui": "workspace:*",
"@plane/propel": "workspace:*",
"@plane/utils": "workspace:*",
"@tiptap/core": "catalog:",
"@tiptap/extension-blockquote": "^2.22.3",
"@tiptap/extension-character-count": "^2.22.3",
"buffer": "^6.0.3",
"@tiptap/extension-collaboration": "^2.22.3",
"@tiptap/extension-document": "^2.22.3",
"@tiptap/extension-emoji": "^2.22.3",
"@tiptap/extension-heading": "^2.22.3",
"@tiptap/extension-image": "^2.22.3",
"@tiptap/extension-list-item": "^2.22.3",
"@tiptap/extension-mention": "^2.22.3",
"@tiptap/extension-placeholder": "^2.22.3",
"@tiptap/extension-task-item": "^2.22.3",
"@tiptap/extension-task-list": "^2.22.3",
"@tiptap/extension-text": "^2.22.3",
"@tiptap/extension-text-align": "^2.22.3",
"@tiptap/extension-text-style": "^2.22.3",
"@tiptap/extension-underline": "^2.22.3",
Expand All @@ -62,8 +66,6 @@
"@tiptap/react": "^2.22.3",
"@tiptap/starter-kit": "^2.22.3",
"@tiptap/suggestion": "^2.22.3",
"lodash-es": "catalog:",
"buffer": "^6.0.3",
"emoji-regex": "^10.3.0",
"highlight.js": "^11.8.0",
"is-emoji-supported": "^0.0.5",
Expand All @@ -81,12 +83,12 @@
"yjs": "^13.6.20"
},
"devDependencies": {
"@plane/eslint-config": "workspace:*",
"@plane/tailwind-config": "workspace:*",
"@plane/typescript-config": "workspace:*",
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@types/lodash-es": "catalog:",
"postcss": "^8.4.38",
"tsdown": "catalog:",
"typescript": "catalog:"
Expand Down
Loading