mvcds / hubi Goto Github PK
View Code? Open in Web Editor NEWHumanitarian ubiquitous language helper
Home Page: https://mvcds.github.io/hubi/
License: MIT License
Humanitarian ubiquitous language helper
Home Page: https://mvcds.github.io/hubi/
License: MIT License
DomainFile is an entity which may have its data to the token and therefore be removed as sourc file i.e. it will still exist as an ubiquitous language's concept (the YAML file for DomainFile is not removed)
Being able to generate GraphQL types automatically seems fun!
Setting a string as non-required don't allow to use null
s as its value
name: Foo
attributes:
- name: optionalString
required: false
default: null
let success = false
try {
Joi.attempt({ optionalString: null }, Foo.SCHEMA);
success = true
} catch(e) {
}
assert.ok(success, 'optionalString should be possible to be set to null')
In the code above the assert.ok
should not fail
It fails with the message "[1] "optionalString" must be a string"
Having default values exported would allow other code to reference them, making easy to not repeat writing code
Values could be limited to a certain amount of enumerated values
Keep in mind that in some languages, those values are like tokens themselves, while in others they are just like strings
And that some languages associate their "keys" to specific numbers in an orderly manner and others allow you to freely associate values
It is possible to make flags using enums
Allow a file where users may tweak how hubi behaves in order to attend their needs.
In order to have more than one client, Hubi would benefit to have an adapter layer between the external world and its use cases
Sometimes we duplicate tokens themselves - by repeating their names
Maybe give users an option about how to deal with duplication: do they consider it an error or a warning?
This could be React client where a server some documents are read in order to create the client's domain model
Configuring Sequelize models is a nice MVP, but being able to generate migrations would be awesome
What about using Yoman or alike to scaffold Translators?
Though we should learn better what a Translator really does
Diffs two git tags' domain files trying to suggest how things have changed.
In order to speed things up, implement a mechanism to cache domain files
Use hubi to generate hubi
It is the best proof of concept ever
Mark a token as extending another, so users don't have to repeat themselves.
This differs from Inhiritance because this one may allow a translator to "only" copy-and-past attributes around while other ones may benefit of explicitly marking their source files as using an interface.
Add a way to annotate over tokens and attributes
Currently, deprecation may be used to signalize something which is not a good fit for description.
With a simple validation as a decorator for attribute, it is possible to be sure of consistent values across the different domains using Hubi
Allow functions to be used as attributes.
Allow hubi to use decorators (from #106) which are not in this same repository.
For instance, configuring a required string to have a max length of 30 digits in a lot of domain files is boring, so allowing users to create a AlphanumericWithFixedLengthTo30 just for that project would avoid a lot of repeatition.
Useful link: nodejs.org/en/blog/npm/peer-dependencies
Joi uses the same type of number for both integer and floats, but hubi is generating two
All
Create a domain file of type integer or type float
It was supposed to yield Joi.number()
flagged with "integer" when appropriated
Generates Joi.integer()
and Joi.float()
when both do not exist
A hubi context means that tokens and attributes may yield different generated source files.
There are 4 kinds of contextual changes I can think of: add, delete, change and referential.
Givin a token User, I can think in the following contexts, which exist in different repositories of an App
At the moment a translator yields exactly what is described by a domain file.
Some people may prefer to use JSON as domain files to configure their ubiquitous language
At the moment only the HTML is generated, and it is ugly.
Non-provided attributes end up using a default value.
By adding a PropType Translator, people would React nicely.
There should be a clear layer separation between what's part of Hubi's domain and what is part of its use cases
Allows users to create fixture factories easily using Rosie.
The first library Translator will allow who uses joi to create ubiquitous source files.
Some tokens have aliases
Mark attributes as deprecated in order to make people stop using them.
Make an interactive hubi start
(or init) which tries to help you installing translators for you
It should be done after externalizing translators #25 as a complement to it. Or maybe as its first version.
Helps "lazy" people to find some translators and start projects
Allow injecting its own pug, CSS and/or js
Some Translators allow to have multiple attribute types together and do something about it, for instance, having a field marked as required when another one field is provided.
The domain file guide states the following about decorators
Each attribute type may have some decorators associated with it, enhancing how they are translated.
But the only decorator in place is range
, because decorators were a late concept.
This issue aims to include of
, return
, arguments
and any other that may appear, as decorators.
For that, decorators should be considerated part of the domain language.
Arrays having arrays that have arrays filled with arrays should be okayish
Some configurations require centralizing files into a single folder but others may want to allow a better control where to save files.
For instance, I personally would like to output some source files in the same folder as their domain file.
Add a watch flag to rerun hubi on file changes
Users do not need to pollute their packages with a watcher solution
Allow hubi to use attribute types which are not in this same repository.
For instance, configuring a required string to have a max length of 30 digits in a lot of domain files is boring, so allowing users to create a AlphanumericWithFixedLengthTo30 just for that project would avoid a lot of repeatition.
Useful link: https://nodejs.org/en/blog/npm/peer-dependencies/
Migrate the current CLI to the correct layer (according to Clean Architecture)
Sometimes we duplicate duplicate token's attributes.
Maybe give users an option about how to deal with duplication: do they consider it an error or a warning?
It would be nice to have a search, to use name anchors, sorting, prioritizing, etc.
The first non-js Translator I could come up with (as it was my previous fluent language).
I thought about generating C# partial classes where hubi's half is the one with the getters/setters variables the class public allows people to poke with.
Allow scanning a source file in order to output a domain file
Allow hubi to use Translators which are not in this same repository.
Mark a token as inheriting from another, so users don't have to repeat themselves.
This differs from Interface || Extension because some translators may benefit from having it explicitly.
Include generated translations on their files, instead of creating a file apart.
Preferentially something users can interact with
Some attributes may have their own configuration, for instance, strings can have min and max length but booleans cannot.
What about adding the ones you need the most?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.