Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
9a54ee2
feat:暂存
Nov 12, 2025
d6670ab
feat: add Node and Graph classes for graph data structure implementation
DrugsZ Nov 4, 2025
4ac4688
Merge remote-tracking branch 'origin/feat-di' into refactor-tempGroup
DrugsZ Nov 12, 2025
ccb775f
refactor: move tempGroup to apps and packages
DrugsZ Dec 4, 2025
77340a6
feat: 1
DrugsZ Dec 4, 2025
a613f9f
chore: add Playwright and Vitest configuration for testing
DrugsZ Dec 8, 2025
52705f4
refactor: update package.json to use source files and improve exports…
DrugsZ Dec 9, 2025
ddd0dd2
feat: add ILatteFile interface and update NodeType enum for DOCUMENT
DrugsZ Dec 9, 2025
841cc2c
feat: add memory layout definitions and refactor SceneGraph to utiliz…
DrugsZ Dec 9, 2025
d56bf1b
refactor: rename initMemory to _initMemory and update related logic
DrugsZ Dec 10, 2025
9b5c8a2
refactor: update package.json to change main entry from .js to .ts fo…
DrugsZ Dec 11, 2025
1622fd7
feat: add BlendModeType enum and integrate it into fill and stroke sc…
DrugsZ Dec 13, 2025
f947b36
feat: implement HeapManager and transform operations,
DrugsZ Dec 15, 2025
103c299
feat: implement BlobManager for managing binary data with caching
DrugsZ Dec 16, 2025
869c2d2
feat: add MutationTracker and IGraphObserver for improved state manag…
DrugsZ Dec 17, 2025
068aa0c
feat: enhance style management with new properties and operations for…
DrugsZ Dec 18, 2025
f4f5bc8
feat: update .gitignore to include Turbo directories and upgrade pac…
DrugsZ Dec 18, 2025
355d1a1
refactor(io): code structure for improved readability and maintainabi…
DrugsZ Dec 19, 2025
c5eb5f0
chore: update project config & CI workflow
DrugsZ Dec 20, 2025
8d0ebb7
refactor(schema): unify node type definition and optimize type assert…
DrugsZ Dec 20, 2025
9cd1a96
test: add some unit test
DrugsZ Dec 20, 2025
31935df
build(package): configure the exports field uniformly and update the…
DrugsZ Dec 23, 2025
83157fd
feat(barista): implementing an IPC communication framework and a Bari…
DrugsZ Dec 23, 2025
ea940a3
feat(rpc): add transform and ipc modules and refactor channel registr…
DrugsZ Dec 25, 2025
8fccedc
refactor(rpc): refactor RPC service architecture and introduce the se…
DrugsZ Dec 28, 2025
aa416f6
build: centralize path aliases and simplify app configuration and rem…
DrugsZ Dec 29, 2025
2ef5490
feat(barista): add recursive dirty marking for transform and AABB states
DrugsZ Jan 5, 2026
2df7a49
feat(nodeCursor): implement mutation tracking for property changes an…
DrugsZ Jan 6, 2026
c747ace
feat(aabbSystem): update AABB calculation
DrugsZ Jan 6, 2026
3eb69c4
feat(barista): implement transform and node systems, enhance IPC init…
DrugsZ Jan 7, 2026
54f0102
feat: implement canvas2d render backend
DrugsZ Jan 12, 2026
a9b2638
feat: integrate Camera system and rendering pipeline
Jan 16, 2026
8932629
feat: remove unused event and linked list utilities
DrugsZ Jan 18, 2026
154e730
feat: integrate Camera system and rendering pipeline
DrugsZ Jan 16, 2026
539b268
refactor: standardize IPC events and extract node conversion logic
DrugsZ Jan 19, 2026
30697f3
Merge remote-tracking branch 'origin/feat-0.0.2' into feat-0.0.2
DrugsZ Jan 19, 2026
8815ec5
feat: add new dependencies and clean up console logs in rendering and…
DrugsZ Jan 19, 2026
53f8059
feat: add IDocumentService interface with getRootId method
DrugsZ Jan 19, 2026
fa48ec4
feat: add Document and Query services with associated systems
DrugsZ Jan 20, 2026
03e9182
feat: update service retrieval methods to use IServiceMap for better …
DrugsZ Jan 20, 2026
da4c68a
chore: add licenses for various packages
DrugsZ Jan 21, 2026
63bd582
Fix LICENSE file
DrugsZ Jan 21, 2026
5434925
feat: refactor rendering system and add new node renderers
DrugsZ Jan 22, 2026
6e95043
Merge remote-tracking branch 'origin/feat-0.0.2' into feat-0.0.2
DrugsZ Jan 24, 2026
f2e22b0
feat: add renderer registration and enhance DocumentService with UUID…
DrugsZ Jan 25, 2026
bfbaa9a
feat: add MatrixSystem class
DrugsZ Jan 26, 2026
4aa6325
feat: refactor service and system structure, enhance dirty tracking a…
DrugsZ Jan 28, 2026
ef5e159
feat: update pruning flags and enhance mutation tracking for AABB and…
DrugsZ Jan 28, 2026
84352ad
feat: enhance rendering of Ellipse and Rect with fill and stroke support
DrugsZ Jan 29, 2026
5d0d348
feat: refactor applyStretch function to use accumulated rotation for …
DrugsZ Jan 29, 2026
3742360
refactor(transform): refactor stretch transform using Deformation Ten…
DrugsZ Jan 29, 2026
3e15777
feat(core): refactor resize baking with World Space Mutation algorithm
DrugsZ Jan 29, 2026
b283051
refactor(input): centralize mouse event system and integrate with syrup
DrugsZ Jan 30, 2026
cd8b229
feat: add MatrixSystem class
DrugsZ Jan 31, 2026
dfcb968
Merge remote-tracking branch 'origin/feat-0.0.2' into feat-0.0.2
DrugsZ Jan 31, 2026
98d8152
feat: update package README files and enhance selection tool function…
DrugsZ Feb 4, 2026
34d9215
feat: implement selection tool and tool service with mouse event hand…
DrugsZ Feb 5, 2026
c0b1bec
test: add some unit test
DrugsZ Feb 6, 2026
dfe855b
chore: add unit test on commit
DrugsZ Feb 6, 2026
3d01546
feat: enhance Barista and Syrup services with session management and …
DrugsZ Feb 9, 2026
a4aad6e
refactor(render): improve rendering, hit testing, and AABB system arc…
DrugsZ Feb 9, 2026
7772412
Merge remote-tracking branch 'origin/feat-0.0.2' into feat-0.0.2
DrugsZ Feb 9, 2026
def5942
chore: refactor imports and reorganize code structure across multiple…
DrugsZ Feb 10, 2026
4d2d512
style: refactor code structure for improved readability and maintaina…
DrugsZ Feb 10, 2026
fe96f44
feat: restructure services and add keybinding tests; remove unused files
DrugsZ Feb 10, 2026
8c076f6
feat: reorganize input service structure and update imports; add serv…
DrugsZ Feb 10, 2026
fe768c5
feat: refactor BaristaEngine to initialize kernel session and improve…
DrugsZ Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 33 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
name: Deploy website
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write

jobs:
setup:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: latest
run_install: false
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- uses: actions/cache@v3
name: Setup pnpm cache
uses: actions/setup-node@v4
with:
path: node_modules
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

build-and-deploy:
runs-on: ubuntu-latest
needs: setup
steps:
- name: checkout
uses: actions/checkout@v3
- name: Lint
run: pnpm lint

- name: restore cache from node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Type Check
run: pnpm type-check

- name: build
run: npm run build
- name: Test
run: pnpm test:coverage

- name: Build
run: pnpm build

- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage
path: "**/coverage/"

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_dir: ./apps/cafe/dist
force_orphan: true
32 changes: 31 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,35 @@ node_modules/
package-lock.json

dist/
.vscode

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Turbo (turborepo)
.turbo/
**/.turbo/

coverage/
**/coverage/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
6 changes: 5 additions & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"src/**/*.{ts,js}": ["prettier --write", "eslint --fix --max-warnings 0"]
"**/*.{ts,tsx,js,jsx}": [
"prettier --write",
"eslint --fix --max-warnings 0",
"vitest related --run"
]
}
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=true
link-workspace-packages=true
160 changes: 129 additions & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,147 @@
# Contributing to Latte

First off, thank you for considering contributing to Latte.
First off, thanks for taking the time to contribute! 🎉

## Where to Start
Latte is a complex engineering project with a unique architecture. To maintain high performance and scalability, we follow strict **Data-Oriented Design (DOD)** principles.

1. **Issues**: The [issue list](https://github.com/DrugsZ/Latte/issues) is the best place to start. Issues tagged with `good first issue` are a good starting point.
2. **Discussions**: Join the discussions on the project's [Discussions](https://github.com/DrugsZ/Latte/discussions) page to connect with other community members.
Please read this guide carefully. Code that violates these rules will be rejected.

## How to Contribute
---

### Reporting Bugs
## Table of Contents

1. **Search**: Check if the issue has already been reported.
2. **Be clear**: Provide a clear and descriptive title for the issue.
3. **Include details**: Include as much information as possible, such as the version of Latte, your operating system, and steps to reproduce the issue.
- [Contributing to Latte](#contributing-to-latte)
- [Table of Contents](#table-of-contents)
- [🏗 Monorepo Setup](#-monorepo-setup)
- [📐 Architectural Constitution](#-architectural-constitution)
- [1. The Law of Dependency](#1-the-law-of-dependency)
- [2. The Law of Data (`@latte-js/espresso`)](#2-the-law-of-data-latte-jsespresso)
- [3. The Law of Rendering (`@latte-js/art`)](#3-the-law-of-rendering-latte-jsart)
- [4. The Law of Mutation](#4-the-law-of-mutation)
- [🛠 Development Workflow](#-development-workflow)
- [Example: Adding a New Feature ("Circle Tool")](#example-adding-a-new-feature-circle-tool)
- [🧪 Testing Strategy](#-testing-strategy)
- [🐛 Reporting Issues](#-reporting-issues)
- [Bug Reports](#bug-reports)
- [Feature Requests](#feature-requests)
- [🔀 Pull Request Guidelines](#-pull-request-guidelines)
- [📦 Project Structure](#-project-structure)

### Suggesting Enhancements
---

1. **Search**: Check if the enhancement has already been suggested.
2. **Be clear**: Provide a clear and descriptive title for the enhancement.
3. **Explain**: Explain why this enhancement would be useful and how it would work.
## 🏗 Monorepo Setup

### Your First Code Contribution
We use **pnpm** workspaces and **Turborepo**.

1. **Fork** the repository to your own GitHub account.
2. **Make your changes** and **add tests** if necessary.
3. **Commit** your changes
4. **Push** your branch to GitHub
5. **Open a pull request** against the `main` branch.
```bash
# 1. Install dependencies
pnpm install

### Pull Request Guidelines
# 2. Build all packages
pnpm build

1. **Update** the documentation if necessary.
2. **Follow** the coding style of the project.
3. **Write tests** for your changes.
4. **Keep your changes** focused on a single feature or fix.
5. **Rebase** your branch on the latest `main` before submitting a pull request.
# 3. Start the editor (Dev mode)
pnpm dev
```

## License
---

By contributing, you agree that your contributions will be licensed under the [Apache-2.0 license](https://github.com/DrugsZ/Latte?tab=Apache-2.0-1-ov-file) used within this project.
## 📐 Architectural Constitution

## Additional Notes
Latte is **NOT** a standard React application. We enforce the following laws to ensure performance.

- **Sign your work**: The sign-off is required for all contributions. It certifies that you wrote the patch or have the right to contribute it to the project.
- **Ask for help**: If you’re stuck, create a draft pull request or ask for help on the [Discussions](https://github.com/DrugsZ/Latte/discussions) page.
### 1. The Law of Dependency

Thank you for your interest in contributing to Latte!
Dependencies must flow **downwards**. Circular dependencies are strictly forbidden.

- ✅ `milk` -> `counter` -> `syrup` -> `barista` -> `espresso` -> `bean`
- ❌ `espresso` cannot import `milk`.
- ❌ `bean` cannot import anything.

### 2. The Law of Data (`@latte-js/espresso`)

- **No Objects**: Do not store state as JS objects in the kernel (e.g., `{x: 10}`). Use `TypedArray` indices.
- **No Classes in Buffer**: Data in `SharedArrayBuffer` must be flat numbers.
- **Use Cursors**: Business logic must use `NodeCursor` to read/write data. Direct buffer access is restricted to internal `Ops`.

### 3. The Law of Rendering (`@latte-js/art`)

- **Read-Only**: The renderer should **NEVER** modify business data.
- **No React**: Do not use React components inside the renderer logic.
- **Performance**: Always use WorldMatrix for flat rendering. Do not traverse the tree recursively if possible.

### 4. The Law of Mutation

- **Single Source of Truth**: All writes must go through `NodeCursor` to trigger:
1. Dirty Flags (for Renderer)
2. Observers (for History/Sync)
- **Transactions**: Complex operations must be wrapped in `history.startTransaction`.

---

## 🛠 Development Workflow

### Example: Adding a New Feature ("Circle Tool")

1. **Define Type (`bean`)**: Add `ELLIPSE` to `NodeType` enum.
2. **Update Kernel (`espresso`)**: Ensure `Allocator` and `Serializer` handle the new type.
3. **Implement Rendering (`art`)**: Add drawing logic (`ctx.ellipse`) to the `RendererRegistry`.
4. **Implement Logic (`counter`)**:
- Create `CircleTool` extending `BaseTool`.
- Register command: `latte.tool.circle`.
- Handle drag events to update kernel data via RPC.
5. **Update UI (`milk`)**: Add an icon to the toolbar component.

---

## 🧪 Testing Strategy

- **Unit Tests (`vitest`)**:
- **Required** for `espresso` (memory integrity) and `barista` (math logic).
- Run: `pnpm test`
- **E2E Tests (`playwright`)**:
- **Required** for `art` (Visual Regression).
- Run: `pnpm e2e`

---

## 🐛 Reporting Issues

### Bug Reports

1. **Search**: Check if the issue has already been reported.
2. **Be clear**: Provide a clear and descriptive title for the issue.
3. **Include details**: Include as much information as possible, such as the version of Latte, your operating system, and steps to reproduce the issue.

### Feature Requests

1. **Search**: Check if the enhancement has already been suggested.
2. **Explain**: Explain why this enhancement would be useful and how it would work.

---

## 🔀 Pull Request Guidelines

1. **Fork** the repository to your own GitHub account.
2. **Create a branch** for your feature or fix.
3. **Commit** your changes following the **Conventional Commits** specification (e.g., `feat: add circle tool`, `fix: memory leak in loader`).
4. **Write tests** for your changes.
5. **Rebase** your branch on the latest `main` before submitting.
6. **Sign your work**: The sign-off is required. It certifies that you wrote the patch or have the right to contribute it.

---

## 📦 Project Structure

```text
packages/
├── bean/ # Types (The Dictionary)
├── espresso/ # Data (The Database)
├── barista/ # Engine (The Worker)
├── art/ # Render (The Painter)
├── syrup/ # Infra (The OS)
├── counter/ # Logic (The App)
└── milk/ # UI (The Skin)
```

**Need Help?** If you’re stuck, create a draft pull request or ask for help on the [Discussions](https://github.com/DrugsZ/Latte/discussions) page.
Loading
Loading