-
Notifications
You must be signed in to change notification settings - Fork 333
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
Read component data from built fixtures.json
#4042
Conversation
We no longer need to watch source YAML files
81beb25
to
6487f9e
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.
Looks neat, just need to confirm why we've moved to reading the list of components from dist
rather than src
(as it's a bit of a hidden requirement for that function that you need to have built the package before it can be run and may cause some confusion).
@@ -124,7 +124,7 @@ const getComponentFiles = (componentName = '') => | |||
getListing( | |||
join( | |||
packageNameToPath('govuk-frontend'), | |||
`src/govuk/components/${componentName}/**/*` | |||
`dist/govuk/components/${componentName}/**/*` |
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.
Just to confirm: are we're adding the requirement of reading from dist
rather than src
to ensure we read the list that's inside the package itself (and avoid potential missing components from older versions)?
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.
Yeah that's the one, added an example in #4042 (comment)
@@ -94,7 +94,7 @@ params: | |||
|
|||
examples: | |||
- name: default | |||
data: | |||
options: |
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.
Makes sense given we talk of macro "options" all around 🙌🏻
Thanks @romaricpascal
Yeah it was one of your future suggestions from #3498 (comment)
It came up again whilst looking at stats for legacy releases, for example:
But you'll notice that our helpers:
We were looping directories in |
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.
Good to go! ⛵
Read component data from built `fixtures.json`
We currently build two JSON files for the GOV.UK Design System
These are generated from component YAML files but aren't currently tested:
fixtures.json
from${componentName}.yaml
macro-options.json
from${componentName}.yaml
This PR updates all "component data" helpers to read from
fixtures.json
instead of YAMLThe Review app no longer needs to access
govuk-frontend/src
YAML files