-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
some thought on the package, systems, capabilities, apps etc
- Loading branch information
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "fastn-package" | ||
version = "0.1.0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
description.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
homepage.workspace = true | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#![allow(clippy::derive_partial_eq_without_eq, clippy::get_first)] | ||
#![deny(unused_crate_dependencies)] | ||
#![warn(clippy::used_underscore_binding)] | ||
#![allow(dead_code)] | ||
|
||
extern crate self as fastn_package; | ||
|
||
pub struct Package { | ||
name: String, | ||
systems: Vec<System>, | ||
dependencies: Vec<Dependency>, | ||
auto_imports: AutoImport, | ||
apps: Vec<App>, | ||
} | ||
|
||
pub type AutoImport = Vec<(String, String)>; | ||
|
||
// -- system: design-system.com | ||
// via: amitu.com/ds | ||
// alias: some alias ;; if alias is not provided, this is globally passed | ||
pub struct System { | ||
via: String, | ||
sensitive: bool, | ||
alias: Option<SystemAlias>, | ||
} | ||
|
||
pub struct SystemAlias(String); | ||
|
||
pub struct Dependency { | ||
name: String, | ||
// vector of alias of the systems this dependency and everything downstream | ||
capabilities: Vec<SystemAlias>, | ||
dependencies: Vec<Dependency>, | ||
auto_imports: AutoImport, | ||
} | ||
|
||
// -- path: /blog/ | ||
// allow: colorful-ds | ||
pub struct CapabilityOverride { | ||
// capabilities for any url prefix can be overridden using this | ||
path: String, | ||
// if this is set, the global capabilities will be merged into .capabilities, else only | ||
// .capabilities will be used. | ||
inherit_global: bool, | ||
capabilities: Vec<SystemAlias>, | ||
} | ||
|
||
pub struct App { | ||
// this must already be added as a Dependency (not a system) and is its name | ||
name: String, | ||
mount_point: String, | ||
apps: Vec<App>, | ||
// Dependency.capabilities will be merged with this when serving these routes | ||
capabilities: Vec<SystemAlias>, | ||
} |