-
Notifications
You must be signed in to change notification settings - Fork 332
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
Migrate component data to ES modules #3812
Conversation
a5beef0
to
b5e5519
Compare
b5e5519
to
7793d63
Compare
7793d63
to
24d52cd
Compare
Would appreciate your non-urgent thoughts on this one @36degrees Using ES modules found some issues to fix so far:
That's before we've picked up: |
Just rebasing since #2261 and |
24d52cd
to
7b70c54
Compare
7b70c54
to
aa2f38c
Compare
aa2f38c
to
fb131c4
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.
Sounds a neat way to catch errors, and gives us some nice way to catch which component options use specific fields (like isComponent
). 😍
No qualms on the naming which sounds fine to me (and nice to separate the params from the examples in different files as well).
Besides fixing the tests, Ollie suggested it could be good to present this to the whole team to take the temperature on not using YAML anymore, as it's a quite different authoring experience (especially for examples) 😊
fb131c4
to
70f36d8
Compare
cb2624b
to
11ec0f1
Compare
70f36d8
to
748e8c5
Compare
174f0e0
to
b7ab6e5
Compare
b7ab6e5
to
bb90443
Compare
bb90443
to
706925b
Compare
706925b
to
28fc70a
Compare
28fc70a
to
1af3b12
Compare
1af3b12
to
c59b763
Compare
c59b763
to
a3553b5
Compare
a3553b5
to
b2a6d0f
Compare
b2a6d0f
to
d599d59
Compare
d599d59
to
931a2d7
Compare
Allows component data to run through ESLint and type checks
Component helpers like `getComponentNames()` use directory listings so we need to make sure the directory structure is created first
We now store component params as key/value objects just as we do for Nunjucks options, this improves access to values by param name
Component data YAML has now been replaced with ES modules
931a2d7
to
238fcf6
Compare
Closing for housekeeping and because there doesn't seem to be much appetite to pursue this at the moment. |
This PR migrates our component data YAML into ES modules to:
This is important because we've accidentally missed things in the past:
But makes it a lot easier to add automated tests for:
Migration script
See branch
component-migrator
to convert YAML to ES modules via:npm exec --workspace packages/govuk-frontend -- gulp fixtures