Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make the model key a tuple and simplified models code #28

Merged
merged 48 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0513a32
Moved the code templates into files so they are nicer to work with
bengineer42 Oct 4, 2024
7fa8954
Made the model attributes into a separate trait
bengineer42 Oct 4, 2024
19bcb58
implemented the attributes in the Model impl and contract
bengineer42 Oct 4, 2024
0948491
check this
bengineer42 Oct 5, 2024
3f1b349
check this
bengineer42 Oct 5, 2024
e715a5b
stash
bengineer42 Oct 5, 2024
8a722aa
stash
bengineer42 Oct 5, 2024
69f9678
Stash
bengineer42 Oct 5, 2024
f5d28fe
Merge branch 'reduce-model-code/2a' into reduce-model-code/3
bengineer42 Oct 5, 2024
2e40797
stash
bengineer42 Oct 5, 2024
bb40f3f
stash
bengineer42 Oct 6, 2024
35085c5
stash
bengineer42 Oct 6, 2024
fd0c0ec
fixing tests
bengineer42 Oct 6, 2024
0132dc5
fixing tests
bengineer42 Oct 6, 2024
fcab67f
stash
bengineer42 Oct 9, 2024
0952ea3
Merge branch 'main' into make-key-tuple/0
bengineer42 Oct 9, 2024
54d7347
Sorry Glihm
bengineer42 Oct 9, 2024
599a6bb
debugging
bengineer42 Oct 10, 2024
4181120
debugging
bengineer42 Oct 10, 2024
f724768
working, now moving to tests
bengineer42 Oct 10, 2024
f78f475
Fixed members
bengineer42 Oct 10, 2024
241c14e
fixed
bengineer42 Oct 10, 2024
fdf2aba
fixed
bengineer42 Oct 10, 2024
3e760e6
fixed worl.delete_entity
bengineer42 Oct 10, 2024
b3dd5a0
removed printing of models debug
bengineer42 Oct 10, 2024
49e3306
removed printing of models debug
bengineer42 Oct 10, 2024
b86d2b1
Merge branch 'main' into make-key-tuple/2
bengineer42 Oct 10, 2024
c985faf
Merge branch 'main' into make-key-tuple/2
bengineer42 Oct 10, 2024
565e828
formatting
bengineer42 Oct 10, 2024
5772c92
fixing tests
bengineer42 Oct 10, 2024
d5f0781
fixing tests
bengineer42 Oct 11, 2024
556311f
fixing tests
bengineer42 Oct 11, 2024
e3c3870
Fixed tests
bengineer42 Oct 11, 2024
434766a
Update crates/compiler/src/plugin/attribute_macros/model.rs
bengineer42 Oct 11, 2024
03bbb75
Update crates/compiler/src/plugin/attribute_macros/templates/model_st…
bengineer42 Oct 11, 2024
99d2d04
Renamings
bengineer42 Oct 11, 2024
3811770
Addressing PR comments
bengineer42 Oct 11, 2024
21e2e01
Added more exples ty simple and added some docs
bengineer42 Oct 11, 2024
684de69
addressing comments
bengineer42 Oct 14, 2024
86deb57
addressing comments
bengineer42 Oct 15, 2024
3fc7d92
Merge branch 'main' into make-key-tuple/2
bengineer42 Oct 16, 2024
74a4a39
Made the model contract a component
bengineer42 Oct 16, 2024
e58d828
Made the model contract a component
bengineer42 Oct 16, 2024
e8ba30a
test fixed
bengineer42 Oct 16, 2024
910c158
Added struct to model tests to test infernce
bengineer42 Oct 16, 2024
a82ba69
fmting
bengineer42 Oct 17, 2024
c928ff5
fix: homogeneize the patches
glihm Oct 17, 2024
94cf66c
docs: update comments
glihm Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/compiler/src/plugin/attribute_macros/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ use crate::namespace_config::NamespaceConfig;
use crate::plugin::syntax::world_param::{self, WorldParamInjectionKind};
use crate::plugin::syntax::{self_param, utils as syntax_utils};

use super::patches::{CONTRACT_PATCH, DEFAULT_INIT_PATCH};
use super::DOJO_CONTRACT_ATTR;

const CONTRACT_PATCH: &str = include_str!("./patches/contract.patch.cairo");
const DEFAULT_INIT_PATCH: &str = include_str!("./patches/default_init.patch.cairo");
const CONSTRUCTOR_FN: &str = "constructor";
const DOJO_INIT_FN: &str = "dojo_init";
const CONTRACT_NAMESPACE: &str = "namespace";
Expand Down
2 changes: 1 addition & 1 deletion crates/compiler/src/plugin/attribute_macros/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use super::element::{
StructParameterParser,
};

use super::patches::EVENT_PATCH;
const EVENT_PATCH: &str = include_str!("./patches/event.patch.cairo");
use super::DOJO_EVENT_ATTR;

pub const PARAMETER_HISTORICAL: &str = "historical";
Expand Down
1 change: 0 additions & 1 deletion crates/compiler/src/plugin/attribute_macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub mod element;
pub mod event;
pub mod interface;
pub mod model;
pub mod patches;

pub use contract::DojoContract;
pub use event::DojoEvent;
Expand Down
Loading
Loading