mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 10:58:04 +08:00
Restructure node crates (#3384)
* Restructure node-graph folder * Fix wasm compilation * Move node definitions out of *-types crates * Cleanup * Fix warnings * Fix warnings * Start adding migrations * Add migrations and move memo nodes to gcore * Move nodes/gsvg-render -> rendering * Replace some hard coded identifiers and fix automatic conversion * Fix Vec2Value node migration * Fix formatting * Add more migrations * Cleanup features * Fix core_types::raster import * Update demo artwork (to make profile ci work) * Move *-types to node-graph/libraries folder * Add missing node migrations * Migrate more nodes * Remove impure memo node * More fixes and remove warning * Migrate context and add a few missing migrations --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -5,6 +5,7 @@ use quote::{format_ident, quote};
|
||||
pub struct CrateIdent {
|
||||
gcore: syn::Result<TokenStream>,
|
||||
gcore_shaders: syn::Result<TokenStream>,
|
||||
raster_types: syn::Result<TokenStream>,
|
||||
wgpu_executor: syn::Result<TokenStream>,
|
||||
}
|
||||
|
||||
@@ -17,6 +18,10 @@ impl CrateIdent {
|
||||
self.gcore_shaders.as_ref().map_err(Clone::clone)
|
||||
}
|
||||
|
||||
pub fn raster_types(&self) -> syn::Result<&TokenStream> {
|
||||
self.raster_types.as_ref().map_err(Clone::clone)
|
||||
}
|
||||
|
||||
pub fn wgpu_executor(&self) -> syn::Result<&TokenStream> {
|
||||
self.wgpu_executor.as_ref().map_err(Clone::clone)
|
||||
}
|
||||
@@ -33,9 +38,15 @@ impl Default for CrateIdent {
|
||||
Err(e) => Err(syn::Error::new(Span::call_site(), format!("Could not find dependency on `{orig_name}`:\n{e}"))),
|
||||
};
|
||||
|
||||
let gcore = find_crate("graphene-core");
|
||||
let gcore_shaders = find_crate("graphene-core-shaders").or_else(|eshaders| gcore.clone().map_err(|ecore| syn::Error::new(Span::call_site(), format!("{ecore}\n\nFallback: {eshaders}"))));
|
||||
let gcore = find_crate("core-types");
|
||||
let gcore_shaders = find_crate("no-std-types").or_else(|eshaders| gcore.clone().map_err(|ecore| syn::Error::new(Span::call_site(), format!("{ecore}\n\nFallback: {eshaders}"))));
|
||||
let raster_types = find_crate("raster-types");
|
||||
let wgpu_executor = find_crate("wgpu-executor");
|
||||
Self { gcore, gcore_shaders, wgpu_executor }
|
||||
Self {
|
||||
gcore,
|
||||
gcore_shaders,
|
||||
raster_types,
|
||||
wgpu_executor,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user