Skip to content

Commit bc37edb

Browse files
release: v1.2.0 #8283
2 parents 443f8b7 + 7451d5e commit bc37edb

File tree

3,455 files changed

+66229
-42402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,455 files changed

+66229
-42402
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ temp/
6666
.react-router/
6767
build/
6868
node_modules/
69-
README.md
69+
README.md
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
description: Guidelines for bash commands and tooling in the monorepo
3+
applyTo: "**/*.sh"
4+
---
5+
6+
# Bash & Tooling Instructions
7+
8+
This document outlines the standard tools and commands used in this monorepo.
9+
10+
## Package Manager
11+
12+
We use **pnpm** for package management.
13+
- **Do not use `npm` or `yarn`.**
14+
- Lockfile: `pnpm-lock.yaml`
15+
- Workspace configuration: `pnpm-workspace.yaml`
16+
17+
### Common Commands
18+
- Install dependencies: `pnpm install`
19+
- Run a script in a specific package: `pnpm --filter <package_name> run <script>`
20+
- Run a script in all packages: `pnpm -r run <script>`
21+
22+
## Monorepo Tooling
23+
24+
We use **Turbo** for build system orchestration.
25+
- Configuration: `turbo.json`
26+
27+
## Project Structure
28+
29+
- `apps/`: Contains application services (admin, api, live, proxy, space, web).
30+
- `packages/`: Contains shared packages and libraries.
31+
- `deployments/`: Deployment configurations.
32+
33+
## Running Tests
34+
35+
- To run tests in a specific package (e.g., codemods):
36+
```bash
37+
cd packages/codemods
38+
pnpm run test
39+
```
40+
- Or from root:
41+
```bash
42+
pnpm --filter @plane/codemods run test
43+
```
44+
45+
## Docker
46+
47+
- Local development uses `docker-compose-local.yml`.
48+
- Production/Staging uses `docker-compose.yml`.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
description: Guidelines for using modern TypeScript features (v5.0-v5.8)
3+
applyTo: "**/*.{ts,tsx,mts,cts}"
4+
---
5+
6+
# TypeScript Coding Guidelines & Modern Features (v5.0 - v5.8)
7+
8+
When writing TypeScript code, prioritize using modern features and best practices introduced in recent versions (up to 5.8).
9+
10+
## Global Themes Across 5.x
11+
12+
1. **Standard decorators are here; legacy decorators are legacy.**
13+
New TC39-compliant decorators landed in 5.0 and were extended in 5.2 (metadata). Old `experimentalDecorators`-style behavior is still supported but should be treated as legacy.
14+
15+
2. **Type system is more precise and less noisy.**
16+
Major work went into narrowing, control flow analysis, error messages, and new helpers like `NoInfer`, inferred predicates, and better `undefined`/`never`/uninitialized checks.
17+
18+
3. **Module / runtime interop has been modernized.**
19+
Options like `--moduleResolution bundler`, `--module nodenext`/`node18`, `--rewriteRelativeImportExtensions`, `--erasableSyntaxOnly`, and `--verbatimModuleSyntax` are about playing nicely with ESM, Node 18+/22+, direct TypeScript execution, and bundlers.
20+
21+
4. **The standard library keeps tracking modern JS.**
22+
Support for new ES features (iterator helpers, `Object.groupBy`/`Map.groupBy`, new Set/ES2024 APIs) shows up as type declarations and sometimes extra checks (regex syntax checking, etc.).
23+
24+
When generating or refactoring code, prefer these newer idioms, and avoid patterns that conflict with updated checks.
25+
26+
## Modern Features to Utilize
27+
28+
### Type System & Inference
29+
- **`const` Type Parameters (5.0)**: Use `const` type parameters for more precise literal inference.
30+
```typescript
31+
declare function names<const T extends string[]>(...names: T): void;
32+
```
33+
- **`@satisfies` Operator (5.0)**: Use `satisfies` to validate types without widening them.
34+
- **Inferred Type Predicates (5.5)**: Allow TypeScript to infer type predicates for functions that filter arrays or check types, reducing the need for explicit `is` return types.
35+
- **`NoInfer` Utility (5.4)**: Use `NoInfer<T>` to block inference for specific type arguments when you want them to be determined by other arguments.
36+
- **Narrowing**:
37+
- **Switch(true) (5.3)**: Utilize narrowing in `switch(true)` blocks.
38+
- **Boolean Comparisons (5.3)**: Rely on narrowing from direct boolean comparisons.
39+
- **Closures (5.4)**: Trust preserved narrowing in closures when variables aren't modified after the check.
40+
- **Constant Indexed Access (5.5)**: Use constant indices to narrow object/array properties.
41+
42+
### Syntax & Control Flow
43+
- **Decorators (5.0)**: Use standard ECMAScript decorators (Stage 3).
44+
- **`using` Declarations (5.2)**: Use `using` for explicit resource management (Disposable pattern) instead of manual cleanup.
45+
```typescript
46+
using resource = new Resource();
47+
```
48+
- **Import Attributes (5.3/5.8)**: Use `with { type: "json" }` for import attributes. Avoid the deprecated `assert` syntax.
49+
- **`switch` Exhaustiveness**: Rely on TypeScript's exhaustiveness checking in switch statements.
50+
51+
### Modules & Imports
52+
- **`verbatimModuleSyntax` (5.0)**: Respect this flag by using `import type` explicitly when importing types to ensure they are erased during compilation.
53+
- **Type-Only Imports with Extensions (5.2)**: You can use `.ts`, `.mts`, `.cts` extensions in `import type` statements.
54+
- **`resolution-mode` (5.3)**: Use `import type { Type } from "mod" with { "resolution-mode": "import" }` if needed for specific module resolution contexts.
55+
- **JSDoc `@import` (5.5)**: Use `@import` tags in JSDoc for cleaner type imports in JS files if working in a mixed codebase.
56+
57+
### Standard Library & Built-ins
58+
- **Iterator Helpers (5.6)**: Use new iterator methods (map, filter, etc.) if targeting modern environments.
59+
- **Set Methods (5.5)**: Utilize new `Set` methods like `union`, `intersection`, etc., when available.
60+
- **`Object.groupBy` / `Map.groupBy` (5.4)**: Use these standard methods for grouping instead of external libraries like Lodash when appropriate.
61+
- **`Promise.withResolvers` (5.7)**: Use `Promise.withResolvers()` for creating promises with exposed resolve/reject functions.
62+
63+
### Configuration & Tooling
64+
- **`--moduleResolution bundler` (5.0)**: Assume this resolution strategy for modern web projects (Vite, Next.js, etc.).
65+
- **`--erasableSyntaxOnly` (5.8)**: Be aware of this flag; avoid TypeScript-specific syntax that cannot be simply erased (like `enum`s or `namespaces`) if the project aims for maximum compatibility with tools like Node.js's `--strip-types`. Prefer `const` objects or unions over `enum`s if requested.
66+
67+
## Specific Coding Patterns
68+
69+
### Arrays & Collections
70+
- Use **Copying Array Methods (5.2)** (`toSorted`, `toSpliced`, `with`) for immutable array operations.
71+
- **TypedArrays (5.7)**: Be aware that TypedArrays are now generic over `ArrayBufferLike`.
72+
73+
### Classes
74+
- **Parameter Decorators (5.0/5.2)**: Use modern standard decorators.
75+
- **`super` Property Access (5.3)**: Avoid accessing instance fields via `super`.
76+
77+
### Error Handling
78+
- **Checks for Never-Initialized Variables (5.7)**: Ensure variables are initialized before use to avoid new errors.
79+
80+
## Deprecations to Avoid
81+
- Avoid `import ... assert` (use `with`).
82+
- Avoid implicit `any` returns in `undefined`-returning functions (though 5.1 makes this easier, explicit is better).
83+
- Avoid `enum`s if the project prefers erasable syntax (5.8).
84+
85+
## Version-Specific Highlights
86+
87+
### TypeScript 5.0
88+
- **Decorators**: Use standard decorators unless `experimentalDecorators` is explicitly enabled.
89+
- **`const` Type Parameters**: Use for literal inference.
90+
- **Enums**: All enums are union enums.
91+
- **Modules**: `--moduleResolution bundler` and `--verbatimModuleSyntax` are key for modern bundlers.
92+
93+
### TypeScript 5.1
94+
- **Returns**: `undefined`-returning functions don't need explicit returns.
95+
- **Getters/Setters**: Can have unrelated types with explicit annotations.
96+
97+
### TypeScript 5.2
98+
- **Resource Management**: `using` declarations for `Symbol.dispose`.
99+
- **Decorator Metadata**: Use `context.metadata` for design-time metadata.
100+
101+
### TypeScript 5.3
102+
- **Import Attributes**: Use `with { type: "json" }`.
103+
- **Switch(true)**: Narrowing works in `switch(true)`.
104+
105+
### TypeScript 5.4
106+
- **Closures**: Narrowing preserved in closures if last assignment is before creation.
107+
- **`NoInfer`**: Block inference for specific arguments.
108+
- **Grouping**: `Object.groupBy` / `Map.groupBy`.
109+
110+
### TypeScript 5.5
111+
- **Inferred Predicates**: Functions checking types often don't need explicit `is` return types.
112+
- **Constant Index Access**: Better narrowing for constant keys.
113+
- **Regex**: Syntax checking for regex literals.
114+
115+
### TypeScript 5.6
116+
- **Truthiness Checks**: Errors on always-truthy/falsy conditions (e.g., `if (/regex/)`).
117+
- **Iterator Helpers**: `.map`, `.filter` on iterators.
118+
119+
### TypeScript 5.7
120+
- **Uninitialized Variables**: Stricter checks for never-initialized variables.
121+
- **Relative Imports**: `--rewriteRelativeImportExtensions` for `.ts` imports in output.
122+
- **ES2024**: Support for `Promise.withResolvers`, `Atomics.waitAsync`.
123+
124+
### TypeScript 5.8
125+
- **Return Checks**: Granular checks for conditional returns.
126+
- **Node Modules**: `--module node18` stable; `require()` of ESM allowed in `nodenext`.
127+
- **Erasable Syntax**: `--erasableSyntaxOnly` forbids enums, namespaces, etc.
128+
129+
When generating code, always prefer the most modern, standard, and type-safe approach available in TypeScript 5.8.

.github/workflows/pull-request-build-lint-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Set up Python
3232
uses: actions/setup-python@v5
3333
with:
34-
python-version: "3.x"
34+
python-version: "3.12.x"
3535
- name: Install Pylint
3636
run: python -m pip install ruff
3737
- name: Install API Dependencies

.github/workflows/pull-request-build-lint-web-apps.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ jobs:
4343
- name: Install dependencies
4444
run: pnpm install --frozen-lockfile
4545

46+
- name: Build Affected
47+
run: pnpm turbo run build --affected
48+
4649
- name: Lint Affected
4750
run: pnpm turbo run check:lint --affected
4851

4952
- name: Check Affected format
5053
run: pnpm turbo run check:format --affected
5154

52-
- name: Build Affected
53-
run: pnpm turbo run build --affected
55+
- name: Check Affected types
56+
run: pnpm turbo run check:types --affected

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,13 @@ dev-editor
102102
storybook-static
103103

104104
CLAUDE.md
105+
106+
build/
107+
.react-router/
108+
AGENTS.md
109+
110+
build/
111+
.react-router/
112+
AGENTS.md
113+
temp/
114+
scripts/

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

.npmrc

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,54 @@
1-
# Enforce pnpm workspace behavior and allow Turbo's lifecycle hooks if scripts are disabled
2-
# This repo uses pnpm with workspaces.
1+
# ------------------------------
2+
# Core Workspace Behavior
3+
# ------------------------------
34

4-
# Prefer linking local workspace packages when available
5-
prefer-workspace-packages=true
6-
link-workspace-packages=true
7-
shared-workspace-lockfile=true
5+
# Always prefer using local workspace packages when available
6+
prefer-workspace-packages = true
87

9-
# Make peer installs smoother across the monorepo
10-
auto-install-peers=true
11-
strict-peer-dependencies=false
8+
# Symlink workspace packages instead of duplicating them
9+
link-workspace-packages = true
1210

13-
# If scripts are disabled (e.g., CI with --ignore-scripts), allowlisted packages can still run their hooks
14-
# Turbo occasionally performs postinstall tasks for optimal performance
15-
# moved to pnpm-workspace.yaml: onlyBuiltDependencies (e.g., allow turbo)
11+
# Use a single lockfile across the whole monorepo
12+
shared-workspace-lockfile = true
1613

17-
public-hoist-pattern[]=*eslint*
18-
public-hoist-pattern[]=prettier
19-
public-hoist-pattern[]=typescript
14+
# Ensure packages added from workspace save using workspace: protocol
15+
save-workspace-protocol = true
2016

21-
# Reproducible installs across CI and dev
22-
prefer-frozen-lockfile=true
2317

24-
# Prefer resolving to highest versions in monorepo to reduce duplication
25-
resolution-mode=highest
18+
# ------------------------------
19+
# Dependency Resolution
20+
# ------------------------------
2621

27-
# Speed up native module builds by caching side effects
28-
side-effects-cache=true
22+
# Choose the highest compatible version across the workspace
23+
# → reduces fragmentation & node_modules bloat
24+
resolution-mode = highest
2925

30-
# Speed up local dev by reusing local store when possible
31-
prefer-offline=true
26+
# Automatically install peer dependencies instead of forcing every package to declare them
27+
auto-install-peers = true
3228

33-
# Ensure workspace protocol is used when adding internal deps
34-
save-workspace-protocol=true
29+
# Don't break the install if peers are missing
30+
strict-peer-dependencies = false
31+
32+
33+
# ------------------------------
34+
# Performance Optimizations
35+
# ------------------------------
36+
37+
# Use cached artifacts for native modules (sharp, esbuild, etc.)
38+
side-effects-cache = true
39+
40+
# Prefer local cached packages rather than hitting network
41+
prefer-offline = true
42+
43+
# In CI, refuse to modify lockfile (prevents drift)
44+
prefer-frozen-lockfile = true
45+
46+
# Use isolated linker (best compatibility with Node ecosystem tools)
47+
node-linker = isolated
48+
49+
# Hoist commonly used tools to the root to prevent duplicates and speed up resolution
50+
public-hoist-pattern[] = typescript
51+
public-hoist-pattern[] = eslint
52+
public-hoist-pattern[] = *@plane/*
53+
public-hoist-pattern[] = vite
54+
public-hoist-pattern[] = turbo

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.next/
2+
.react-router/
3+
.turbo/
4+
.vite/
5+
build/
6+
dist/
7+
node_modules/
8+
out/
9+
pnpm-lock.yaml
10+
storybook-static/

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"overrides": [
4+
{
5+
"files": ["packages/codemods/**/*"],
6+
"options": {
7+
"printWidth": 80
8+
}
9+
}
10+
],
11+
"plugins": ["@prettier/plugin-oxc"],
12+
"printWidth": 120,
13+
"tabWidth": 2,
14+
"trailingComma": "es5"
15+
}

0 commit comments

Comments
 (0)