Closed sanketshevkar closed 1 week ago
I lean towards option one as well. Perhaps controlled by a new flag passed to DecoratorManager?
I lean towards option one as well. Perhaps controlled by a new flag passed to DecoratorManager?
Something like ENABLE_NAMESPACE_TARGET_FIX
?
I'll also like to propose the use of [process.emitWarning()](https://nodejs.org/api/process.html#processemitwarningwarning-type-code-ctor)
we can emit [DeprecationWarning](https://nodejs.org/api/process.html#nodejs-warning-names)
that can caught, handled or suppressed as needed by the consumer of our APIs.
Even NodeJS uses this to issue their deprecation warnings and we can create our own custom warnings. I was not able find if console.warn
supports similar features. It just outputs the warning to stderr
.
emitWarning(`Functionality for namespace targeted Decorator Command Sets has beed changed.`, {
type: 'DeprecationWarning',
code: 'concerto-dep:001',
detail: 'See https://concerto.accordproject.org/dcs-target-namespace'
});
I had an assumption that we could target decorators at Concept
, ConceptDeclaration
etc types, as well from the metamodel model. But that isn't the case, should we that add that functionality as well? That would be helpful for consumers who would be using the deprecated logic.
Bug Report 🐛
The following model definition is valid...
Current Behavior
When we apply decorator using dcs targeting the namespace,
We get the following output
Expected Behavior
We should get the following output:
Possible Solution
applyToAllDeclarationsInNamespace
or something better, which defaults to true. Can be set tofalse
if we don't want to apply to declaration and only at the top of the namespace. Validation could be tricky and would be confusing for users to pickup.target: "something-new"
, which would target only the namespace,I'm more inclined towards the first options if we are able check if the impact is minimal or null. Or else the 3rd option, but I feel we will have to come up with some property value for the target that signal that this is for applying decorator at the top of a namespace, which I feel
namespace
itself conveys the best.Steps to Reproduce
https://replit.com/@sanketshevkar/AccordProjectConcerto-Decorator-Command-Set
Context (Environment)
Desktop
Detailed Description
Possible Implementation