-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
a bit of type checking #27097
a bit of type checking #27097
Conversation
I don't think we should make
|
This is why I kept the Please change your mind: it's definitely hard to introduce (or fix) the current codebase for not near full time contributors, and setting type checking would definitely help in that regard (at least). Finally, i'm also pretty sure that moving these types and default values to their respective generators (i.e. moving |
adec1ed
to
0d764fc
Compare
Command has evolved as somewhat source of truth. A storage scoped config:
Probably will allow jdl definitions in the future. |
Thanks for the tips, seems to be a very nice approach Still, Doing it step by step just to avoid breaking change and hardcore peer review. Pretty sure the code refactor will lead to breeze and awesome ease to scale again (again ;-)). Anyway, this PR doesn't harm much and help overall (blueprints should not even need |
2e5d5f1
to
863f887
Compare
Is it correct? simplifies a bit the default value code |
I think we should generate Types from command instead of reworking types see #27133. |
I got it already: command act as the single source of truth.
I know it's far from being finished yet and that it is quite an adventure to get rid of the current pains related:
But we have to start from something and this is a small step to start from. PS: Ah, and BTW, I have a bit of time due to my current situation to contribute in the mid term to this kind of rework. I just don't want to push big stuff with hundreds of conflicts and make it step by step with this objective in mind until it happens |
863f887
to
6bd66aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test needs a minimum reproduction, if we provide a complete sample it may break with unrelated changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test needs a minimum reproduction, if we provide a complete sample it may break with unrelated changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These properties are available in app/command.
We should extract from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, at one point it has to be materialized to an object
@@ -10,12 +10,17 @@ type ClientFrameworkType = ['no', 'angular', 'react', 'vue', 'svelte']; | |||
|
|||
type ClientFrameworkApplication = OptionWithDerivedProperties<'clientFramework', ClientFrameworkType>; | |||
|
|||
export type PersistedClientApplication = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Persisted types are the ExportStoragePropertiesFromCommand types.
@@ -10,12 +10,17 @@ type ClientFrameworkType = ['no', 'angular', 'react', 'vue', 'svelte']; | |||
|
|||
type ClientFrameworkApplication = OptionWithDerivedProperties<'clientFramework', ClientFrameworkType>; | |||
|
|||
export type PersistedClientApplication = { | |||
withAdminUi: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s already available in the bellow type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default types should be dropped from converters and replaced with generics.
We should not try to export or integrate them.
@@ -68,6 +68,7 @@ import { getGradleLibsVersionsProperties } from '../gradle/support/dependabot-gr | |||
import { dockerPlaceholderGenerator } from '../docker/utils.js'; | |||
import { getConfigWithDefaults } from '../../jdl/index.js'; | |||
import { extractArgumentsFromConfigs } from '../base/internal/command.js'; | |||
import { JSONGeneratorJhipsterContent } from '../../jdl/converters/types.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not mix jdl with generator types.
To add a type to jhipsterConfig a new type should be created join storage types from every generator.
Gonna retry with a smaller scope |
Move yo-rc definition to a typescript object.
Further PR will try to narrow the amount of fields filled at each step of generator phases and move the types to their respective generators. Not perfect yet and waiting for advices
contribute to #26114
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (below reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.