Skip to content
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

feat(preset-classic): guard against unknown keys in options #5831

Merged
merged 1 commit into from Oct 30, 2021

Conversation

Josh-Cena
Copy link
Collaborator

Motivation

Resolve #4239. After 8 months with no updates, let's do it ourselves

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Add an unknown key in the website's config and yarn start fails

Error stack
$ docusaurus start
Starting the development server...
Error: Unrecognized keys badOption found in preset-classic configuration. The allowed keys are debug, docs, blog, pages, sitemap, theme. Check the documentation: https://docusaurus.io/docs/presets#docusauruspreset-classic for more information.
    at preset (/Users/joshcena/Desktop/work/Tech/Projects/docusaurus/packages/docusaurus-preset-classic/lib/index.js:49:15)
    at /Users/joshcena/Desktop/work/Tech/Projects/docusaurus/packages/docusaurus/lib/server/presets/index.js:32:62
    at Array.forEach (<anonymous>)
    at loadPresets (/Users/joshcena/Desktop/work/Tech/Projects/docusaurus/packages/docusaurus/lib/server/presets/index.js:19:13)
    at loadPluginConfigs (/Users/joshcena/Desktop/work/Tech/Projects/docusaurus/packages/docusaurus/lib/server/index.js:85:84)
    at load (/Users/joshcena/Desktop/work/Tech/Projects/docusaurus/packages/docusaurus/lib/server/index.js:185:27)
    at async start (/Users/joshcena/Desktop/work/Tech/Projects/docusaurus/packages/docusaurus/lib/commands/start.js:40:19)
error Command failed with exit code 1.

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 30, 2021
@netlify
Copy link

netlify bot commented Oct 30, 2021

✔️ [V2]

🔨 Explore the source changes: 34ba281

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/617cbe78210f7b0007aa0ba6

😎 Browse the preview: https://deploy-preview-5831--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 96
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5831--docusaurus-2.netlify.app/

@github-actions
Copy link

Size Change: -12 B (0%)

Total Size: 847 kB

ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 38 kB 0 B
website/build/assets/css/styles.********.css 94 kB 0 B
website/build/assets/js/main.********.js 425 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 68.2 kB 0 B
website/build/blog/index.html 39 kB 0 B
website/build/docs/index.html 46.1 kB -6 B (0%)
website/build/docs/installation/index.html 53.6 kB -6 B (0%)
website/build/index.html 31.6 kB 0 B
website/build/tests/docs/index.html 27.3 kB 0 B
website/build/tests/docs/standalone/index.html 23.8 kB 0 B

compressed-size-action

@Josh-Cena Josh-Cena added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label Oct 30, 2021
@Josh-Cena
Copy link
Collaborator Author

Merging because we have more changes introduced in #5832 and we don't want two competing PRs.

@Josh-Cena Josh-Cena merged commit 9247332 into main Oct 30, 2021
@Josh-Cena Josh-Cena deleted the jc/preset-validation branch October 30, 2021 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Presets allow illegal option attributes
2 participants