Restructure project directories (#333)

`/client/web` -> `/frontend`
`/client/cli` -> *delete for now*
`/client/native` -> *delete for now*
`/core/editor` -> `/editor`
`/core/document` -> `/graphene`
`/core/renderer` -> `/charcoal`
`/core/proc-macro` -> `/proc-macros` *(now plural)*
This commit is contained in:
Keavon Chambers
2021-08-07 05:17:18 -07:00
parent 434695d578
commit 53ad105f57
239 changed files with 197 additions and 224 deletions

34
docs/codebase/README.md Normal file
View File

@@ -0,0 +1,34 @@
# Graphite codebase docs
This is a great place to start learning about the Graphite codebase and its architecture and code structure.
## Core libraries
Graphite's core rust codebase is split into three reusable libraries:
- Editor
- Graphene
- Charcoal
Each depends on its successor in the list. These are used internally but also intended for usage by third parties through Rust or linked by a project in C, C++, or another language.
## Code structure
The main modules of the project architecture are outlined below. Some parts describe future features and the directories don't exist yet. **Bold** modules are required for Graphite 0.1 which is purely an SVG editor.
- **Web frontend**: `/frontend/`
Initial GUI for Graphite that will eventually be replaced by a native GUI implementation
- **Vue web app**: `src/`
Imports the WASM code and uses Vue props to customize and reuse most GUI components
- **Rust WebAssembly translation layer**: `wasm/`
Wraps the editor client backend and provides an API for the web app to use unburdened by Rust's complex data types that are not supported by JS
- **Editor Client Backend**: `/editor/`
Used by a frontend editor client to maintain GUI state and dispatch user events. The official Graphite editor is the primary user, but others software like game engines could embed their own customized editor implementations. Depends on Graphene.
- **Graphene Document Graph Engine**: `/graphene/`
A stateless library for updating Graphite design document (GDD) files. The official Graphite CLI and editor client backend are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of updating GDD files by sending edit operations. Optionally depends on Charcoal if rendering is required.
- **Charcoal Asset Render Engine**: `/charcoal/`
A stateless library (with the help of in-memory and/or on-disk caches for performance) for rendering Graphite's render graph (GRD) files. The official Graphite CLI and Graphene are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of rendering Graphite's render graphs. For example, games can link the library and render procedural textures with customizable parametric input values.
## Architecture diagram
Take this [Architecture Overview](architecture-overview.nomnoml) diagram and paste it into the [Nomnoml](https://nomnoml.com/) diagram editor. We'll set up a better way to render Nomnoml diagrams when we have a proper home for this documentation.

View File

@@ -1,38 +0,0 @@
# Graphite codebase docs
This is a great place to start learning about the Graphite codebase and its architecture and code structure.
## Core libraries
Graphite's core rust codebase is split into three reusable libraries:
- Graphite Editor Core Library
- Graphite Document Core Library
- Graphite Renderer Core Library
Each depends on its successor in the list. These are used internally but also intended for usage by third parties through Rust or linked by a project in C, C++, or another language.
## Code structure
The main modules of the project architecture are outlined below. Some parts describe future features and the directories don't exist yet. **Bold** modules are required for Graphite 0.1 which is purely an SVG editor.
- **Web frontend**: `/client/web/`
Initial GUI for Graphite that will eventually be replaced by a native GUI implementation
- **Vue web app**: `src/`
Imports the WASM code and uses Vue props to customize and reuse most GUI components
- **Rust WebAssembly wrapper**: `wasm/`
Wraps the Editor Core Library and provides an API for the web app to use unburdened by Rust's complex data types that are not supported by WASM
- Native frontend: `/client/native/`
The future official desktop client. Blocked on Rust's GUI ecosystem improving or dedicating the time to build a custom system that can nicely support editor extensions. The whole GUI should use WGPU for rendering and compile to WASM to make those calls to the WebGPU API.
- CLI: `/client/cli/`
A future headless, stateless, command line GDD document editor (using the Document Core Library) and GRD render graph renderer (using the Renderer Core Library).
- **Graphite Editor Core Library**: `/core/editor/`
Used by a frontend editor client to maintain GUI state and dispatch user events. The official Graphite editor is the primary user, but others software like game engines could embed their own customized editor implementations. Depends on the Document Core Library.
- Graphite Document Core Library: `/core/document/`
A stateless library for updating Graphite design document (GDD) files. The official Graphite CLI and Editor Core Library are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of updating GDD files by sending edit operations. Optionally depends on the Renderer Core Library if rendering is required.
- Graphite Renderer Core Library: `/core/renderer/`
A stateless library (with the help of in-memory and/or on-disk caches for performance) for rendering Graphite's render graph (GRD) files. The official Graphite CLI and Document Core Library are the primary users, but this library is intended to be useful to any application that wants to link the library for the purpose of rendering Graphite's render graphs. For example, games can link the library and render procedural textures with customizable parametric input values.
## Architecture diagram
Take this [Architecture Overview](architecture-overview.nomnoml) diagram and paste it into the [Nomnoml](https://nomnoml.com/) diagram editor. We'll set up a better way to render Nomnoml diagrams when we have a proper home for this documentation.

View File

@@ -57,7 +57,7 @@ Contributions welcome! If you think of something Graphite would be great for, su
- Removing translucent watermarks that were applied in the same location to a batch of photos by finding their shared similarities and differences and using that as a subtraction diff
## Game development
- Design a GUI for the game and use the Graphite Renderer Core Library to render the in-game GUI textures at runtime at the desired resolution without scaling problems, or even render it live as data updates its state
- Design a GUI for the game and use Charcoal to render the in-game GUI textures at runtime at the desired resolution without scaling problems, or even render it live as data updates its state
- Authoring procedural noise-based textures and PBR materials
## Data visualization

View File

@@ -17,7 +17,7 @@ TODO: Add more to make a comprehensive list, finish writing definitions, separat
- GDD file
Graphite Design Document. A binary serialization of a *document* source file. The format includes a chain of *operations* that describe changes to the *layer graph* and the *properties* of *layers* throughout the history of the document since its creation. It also stores certain metadata and *embedded* file data. GDD files, along with *GRD files*, represent *assets* when shared. Because GDD files are editable (unlike *GRD files*), the *layers* of GDD *assets* may be expanded in the layer graph to reveal and modify their contents using a copy-on-write scheme stored to the *asset's* *layer*.
- GRD file
Graphite Render Data. A binary serialization of a *render graph* file. The format includes a single directed acyclic graph (DAG) compiled from the *layer graph* of a *document* as well as certain *properties* of set *data types* that are *imported* and *exported*. GRD files, along with *GDD files*, represent *assets* when shared. Because GRD files are read-only and can't be edited (unlike *GDD files*), the *layers* of GRD *assets* do not offer an ability to be expanded in the layer graph. GRD files are useful for sharing *assets* when their authors do not wish to provide the source *documents* used for their authoring. They are also the input format included in games that utilize the *Graphite Renderer Core Library* to render graphical content at runtime, as well as similar applications like headless renderers on web servers and image processing pipelines.
Graphite Render Data. A binary serialization of a *render graph* file. The format includes a single directed acyclic graph (DAG) compiled from the *layer graph* of a *document* as well as certain *properties* of set *data types* that are *imported* and *exported*. GRD files, along with *GDD files*, represent *assets* when shared. Because GRD files are read-only and can't be edited (unlike *GDD files*), the *layers* of GRD *assets* do not offer an ability to be expanded in the layer graph. GRD files are useful for sharing *assets* when their authors do not wish to provide the source *documents* used for their authoring. They are also the input format included in games that utilize *Charcoal* to render graphical content at runtime, as well as similar applications like headless renderers on web servers and image processing pipelines.
- Window
- Main window
- Popout window
@@ -63,9 +63,9 @@ TODO: Add more to make a comprehensive list, finish writing definitions, separat
- Port
- Connection
- Core Libraries
- Editor Core Library
- Document Core Library
- Renderer Core Library
- Editor client backend
- Graphene
- Charcoal
- Trace
- Path
- Shape