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

feat(dcs): optimize decorate models #857

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/concerto-core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DecoratorManager {
+ void validateCommand(ModelManager,command)
+ Boolean falsyOrEqual(string||,string[])
+ void applyDecorator(decorated,string,newDecorator)
+ void executeCommand(string,declaration,command,boolean?)
+ void executeCommand(string,declaration,command,property,object?,boolean?)
+ void executePropertyCommand(property,command)
}
+ string[] intersect()
Expand Down
4 changes: 4 additions & 0 deletions packages/concerto-core/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
# Note that the latest public API is documented using JSDocs and is available in api.txt.
#

Version 3.17.2 {b6919ecdae27724aba58a13f63e9407d} 2024-07-17
- Added new optimized methods for decorating models with decorator commandsets
- fixed other decorator command set bugs

Version 3.17.1 {ddc91ebd1ff660b421b60302d1e92271} 2024-06-21
- Added 'enableAliasedType' option to BaseModelManager
- Aliased types mapped to FQN in modelfile
Expand Down
244 changes: 203 additions & 41 deletions packages/concerto-core/lib/decoratormanager.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
namespace [email protected]

@Declaration()
@NamespaceDeclaration()
@NamespaceDeprecated()
@Namespace()
scalar SSN extends String

@Editable
@NamespaceDeprecated()
@Namespace()
concept Person {
@Custom
@Type("Property")
o String firstName
@Type("Property")
o String lastName
@Type("Property")
o String bio
o SSN ssn
@Type("Property")
o String address1
@Type("Property")
o String address2
@Type("Property")
o String city
@Property()
@DeclarationProperty()
@NamespaceDeclarationProperty()
@NamespaceProperty()
@NamespaceDeclarationPropertyType()
@NamespacePropertyType()
@DeclarationPropertyType()
@PropertyType()
@Type("Property")
@NamespaceDeclarationTypeProperties()
@Properties()
@DeclarationProperties()
@NamespaceDeclarationProperties()
@NamespaceProperties()
@NamespaceTypeProperties()
o String country
@Properties()
@DeclarationProperties()
@NamespaceDeclarationProperties()
@NamespaceProperties()
@DeclarationTypeProperties()
o Integer zip
o Dictionary dictionary
}

@NamespaceDeprecated()
@Namespace()
map Dictionary {
@MapElement()
@DeclarationMapElement()
@NamespaceDeclarationMapElement()
@NamespaceMapElement()
o String
@NamespaceDeclarationTypeMapElement()
@MapElement()
@NamespaceTypeMapElement()
@DeclarationTypeMapElement()
@Type("MapValue")
o String
}

@NamespaceDeprecated()
@Namespace()
map Rolodex {
@MapElement()
@NamespaceMapElement()
o String
@MapElement()
@NamespaceTypeMapElement()
@Type("MapValue")
o String
}

@NamespaceDeprecated()
@Namespace()
enum Miscellaneous {
@Property()
@NamespaceProperty()
@Properties()
@NamespaceProperties()
@PropertiesType()
o country
o USA
@Properties()
@NamespaceProperties()
@PropertiesType()
o zip
o dictionary
}
89 changes: 89 additions & 0 deletions packages/concerto-core/test/data/decoratorcommands/normal.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
namespace [email protected]

@Declaration()
@NamespaceDeclaration()
@NamespaceDeprecated()
@MapElement()
@NamespaceMapElement()
@Namespace()
scalar SSN extends String

@Editable
@NamespaceDeprecated()
@MapElement()
@NamespaceMapElement()
@Namespace()
concept Person {
@Custom
@Type("Property")
o String firstName
@Type("Property")
o String lastName
@Type("Property")
o String bio
o SSN ssn
@Type("Property")
o String address1
@Type("Property")
@NamespaceDeclarationTypeProperties()
@Properties()
@DeclarationProperties()
@NamespaceDeclarationProperties()
@NamespaceProperties()
@NamespaceTypeProperties()
@DeclarationTypeProperties()
@PropertiesType()
o String address2
@Type("Property")
o String city
@Property()
@DeclarationProperty()
@NamespaceDeclarationProperty()
@NamespaceProperty()
@NamespaceDeclarationPropertyType()
@NamespacePropertyType()
@DeclarationPropertyType()
@PropertyType()
@Type("Property")
o String country
o Integer zip
o Dictionary dictionary
}

@NamespaceDeprecated()
@Property()
@NamespaceProperty()
@Properties()
@NamespaceProperties()
@Namespace()
map Dictionary {
@MapElement()
@DeclarationMapElement()
@NamespaceDeclarationMapElement()
@NamespaceMapElement()
o String
@NamespaceDeclarationTypeMapElement()
@MapElement()
@NamespaceTypeMapElement()
@DeclarationTypeMapElement()
@TypeMapElement()
@Type("MapValue")
o String
}

@NamespaceDeprecated()
@Property()
@NamespaceProperty()
@Properties()
@NamespaceProperties()
@Namespace()
map Rolodex {
@MapElement()
@NamespaceMapElement()
o String
@MapElement()
@NamespaceTypeMapElement()
@TypeMapElement()
@Type("MapValue")
o String
}
Loading
Loading