Skip to content

Exclude import-only files from Sassdoc#616

Merged
domoscargin merged 1 commit into
feature/sass-modulesfrom
sassdoc-no-import-only-files
Apr 29, 2026
Merged

Exclude import-only files from Sassdoc#616
domoscargin merged 1 commit into
feature/sass-modulesfrom
sassdoc-no-import-only-files

Conversation

@romaricpascal
Copy link
Copy Markdown
Member

v6.2.0 adds import only files in GOV.UK Frontend, some of which have duplicate the Sass documentation from their corresponding Sass module. To avoid duplicating entries in the Sass API, we use a sassdoc.config.json file to exclude the .import.scss file.

Unfortunately, there's no flag for Sassdoc's CLI to exclude files and working out a glob pattern would make things a little cryptic.

@romaricpascal romaricpascal requested a review from a team as a code owner April 24, 2026 09:54
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 24, 2026

Deploy Preview for govuk-frontend-docs-preview ready!

Name Link
🔨 Latest commit 23762b8
🔍 Latest deploy log https://app.netlify.com/projects/govuk-frontend-docs-preview/deploys/69eb414998d4750008ea8ea7
😎 Deploy Preview https://deploy-preview-616--govuk-frontend-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread package.json Outdated
"start": "bundle exec middleman server",
"postinstall": "npm run build:sassdoc && npm run build:sassdocv5 && npm run build:sassdocv4",
"build:sassdoc": "sassdoc --no-update-notifier --parse node_modules/govuk-frontend/dist/govuk/ > data/sassdoc.json",
"build:sassdoc": "sassdoc --no-update-notifier --parse node_modules/govuk-frontend/dist/govuk/ -c sassdoc.config.json > data/sassdoc.json",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note Only the v6 sassdoc needs to exclude the import only files, so I've only added the configuration there. Happy to extend it to the rest of the build:sassdoc commands if we prefer consistency.

Copy link
Copy Markdown
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if it'd be worth:

  • moving no-update-notifier into the config file, so we pass all the non input/output config the same way
  • updating all the build:sassdoc* scripts to use the config – this'd mean v4 and v5 would also exclude import-only files, but there shouldn't be any, so that's OK?

@romaricpascal romaricpascal linked an issue Apr 24, 2026 that may be closed by this pull request
1 task
@romaricpascal romaricpascal force-pushed the sassdoc-no-import-only-files branch from 65d2b2f to 8b512e6 Compare April 24, 2026 10:09
v6.2.0 adds import only files in GOV.UK Frontend, some of which have duplicate the Sass documentation from their corresponding Sass module. To avoid duplicating entries in the Sass API, we use a `sassdoc.config.json` file to exclude the `.import.scss` file.

Unfortunately, there's [no flag for Sassdoc's CLI to exclude files](http://sassdoc.com/getting-started/#options) and working out a glob pattern would make things a little cryptic.
@romaricpascal romaricpascal force-pushed the sassdoc-no-import-only-files branch from 8b512e6 to 23762b8 Compare April 24, 2026 10:09
@romaricpascal romaricpascal requested a review from 36degrees April 24, 2026 10:09
@domoscargin domoscargin merged commit eb17bdf into feature/sass-modules Apr 29, 2026
5 checks passed
@domoscargin domoscargin deleted the sassdoc-no-import-only-files branch April 29, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a preview release for use with Frontend Docs and audit sassdoc output

3 participants