-
Notifications
You must be signed in to change notification settings - Fork 727
Netlify config fixes #598
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
Merged
Merged
Netlify config fixes #598
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4866ca1
Remove default status
nickserv 363b612
Remove default force
nickserv 24f713f
Remove default base
nickserv c5335b2
Remove irrelevant comments
nickserv 6b863c7
Use Yarn to make prod builds consistent with dev
nickserv 9aae986
Launch Netlify Dev by default (like Docusaurus)
nickserv 5f64fcf
Support redirects in development and previews
nickserv dd7f1ba
Explicitly install Yarn for Netlify
nickserv 4201eec
Install Yarn via netlify.toml (not package.json)
nickserv 4285ee2
Fix React Redux redirect
nickserv 4d86beb
Only force domain-level redirects
nickserv 9820595
Consistent comment formatting
nickserv b833e62
Reorganize redirects for safety and readability
nickserv ce4ccb2
fix(docs): revert yarn back to npm
alexkrolick 7cd9951
Merge branch 'master' into netlify-config
kentcdodds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,147 +1,123 @@ | ||
# Settings in the [build] context are global and are applied to all contexts | ||
# unless otherwise overridden by more specific contexts. | ||
[build] | ||
# Directory to change to before starting a build. | ||
# This is where we will look for package.json/.nvmrc/etc. | ||
base = "" | ||
|
||
# Directory (relative to root of your repo) that contains the deploy-ready | ||
# HTML files and assets generated by the build. If a base directory has | ||
# been specified, include it in the publish directory path. | ||
# HTML files and assets generated by the build. | ||
publish = "website/build/testing-library-docs" | ||
|
||
# Default build command. | ||
command = "cd website; npm install; npm run format-docs; npm run build" | ||
command = "npm i -g yarn; cd website; yarn; yarn format-docs; yarn build" | ||
alexkrolick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[dev] | ||
autoLaunch = true # a Boolean value that determines if Netlify Dev launches the local server address in your browser | ||
|
||
# Shortcut to discord server invite | ||
[[redirects]] | ||
from = "https://testing-library.com/discord" | ||
from = "/discord" | ||
to = "https://discord.gg/c6JN9fM" | ||
status = 301 | ||
force = true | ||
|
||
# React root to React landing page | ||
[[redirects]] | ||
from = "https://react-testing-library.com/" | ||
to = "https://testing-library.com/react/" | ||
status = 301 | ||
to = "/react/" | ||
force = true | ||
|
||
# React to main domain | ||
[[redirects]] | ||
from = "https://react-testing-library.com/*" | ||
to = "https://testing-library.com/:splat" | ||
status = 301 | ||
to = "/:splat" | ||
force = true | ||
|
||
# Netlify subdomain to main domain | ||
[[redirects]] | ||
from = "https://testing-library.netlify.com/*" | ||
to = "https://testing-library.com/:splat" | ||
status = 301 | ||
to = "/:splat" | ||
force = true | ||
|
||
# React Redux recipe to Redux's recipe | ||
[[redirects]] | ||
from = "/docs/example-react-redux" | ||
to = "https://redux.js.org/recipes/writing-tests#connected-components" | ||
force = true | ||
|
||
# Redirects due to reorganization | ||
# Redirects due to reorganization (do not redirect if route is not 404) | ||
[[redirects]] | ||
from = "/docs/*" | ||
to = "/docs/dom-testing-library/:splat" | ||
status = 301 | ||
force = false # do not redirect if route is not 404 | ||
|
||
# Support page to help page | ||
[[redirects]] | ||
from = "/support" | ||
to = "/help" | ||
status = 301 | ||
force = true | ||
|
||
# DOM landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/dom/" | ||
to = "https://testing-library.com/docs/dom-testing-library/intro" | ||
status = 301 | ||
from = "/dom/" | ||
to = "/docs/dom-testing-library/intro" | ||
force = true | ||
|
||
# React landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/react/" | ||
to = "https://testing-library.com/docs/react-testing-library/intro" | ||
status = 301 | ||
from = "/react/" | ||
to = "/docs/react-testing-library/intro" | ||
force = true | ||
|
||
# React Native landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/react-native/" | ||
to = "https://testing-library.com/docs/react-native-testing-library/intro" | ||
status = 301 | ||
from = "/react-native/" | ||
to = "/docs/react-native-testing-library/intro" | ||
force = true | ||
|
||
# Cypress landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/cypress/" | ||
to = "https://testing-library.com/docs/cypress-testing-library/intro" | ||
status = 301 | ||
from = "/cypress/" | ||
to = "/docs/cypress-testing-library/intro" | ||
force = true | ||
|
||
# Vue landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/vue/" | ||
to = "https://testing-library.com/docs/vue-testing-library/intro" | ||
status = 301 | ||
from = "/vue/" | ||
to = "/docs/vue-testing-library/intro" | ||
force = true | ||
|
||
# Angular landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/angular/" | ||
to = "https://testing-library.com/docs/angular-testing-library/intro" | ||
status = 301 | ||
from = "/angular/" | ||
to = "/docs/angular-testing-library/intro" | ||
force = true | ||
|
||
# Puppeteer landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/pptr/" | ||
to = "https://testing-library.com/docs/pptr-testing-library/intro" | ||
status = 301 | ||
from = "/pptr/" | ||
to = "/docs/pptr-testing-library/intro" | ||
force = true | ||
|
||
# Svelte landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/svelte/" | ||
to = "https://testing-library.com/docs/svelte-testing-library/intro" | ||
status = 301 | ||
from = "/svelte/" | ||
to = "/docs/svelte-testing-library/intro" | ||
force = true | ||
|
||
# Preact landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/preact/" | ||
to = "https://testing-library.com/docs/preact-testing-library/intro" | ||
status = 301 | ||
from = "/preact/" | ||
to = "/docs/preact-testing-library/intro" | ||
force = true | ||
|
||
# jest-dom landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/jest-dom/" | ||
to = "https://testing-library.com/docs/ecosystem-jest-dom" | ||
status = 301 | ||
from = "/jest-dom/" | ||
to = "/docs/ecosystem-jest-dom" | ||
force = true | ||
|
||
# Testcafe landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/testcafe/" | ||
to = "https://testing-library.com/docs/testcafe-testing-library/intro" | ||
status = 301 | ||
from = "/testcafe/" | ||
to = "/docs/testcafe-testing-library/intro" | ||
force = true | ||
|
||
# Nightwatch landing page to home page | ||
[[redirects]] | ||
from = "https://testing-library.com/nightwatch/" | ||
to = "https://testing-library.com/docs/nightwatch-testing-library/intro" | ||
status = 301 | ||
force = true | ||
|
||
# React Redux recipe to Redux's recipe | ||
[[redirects]] | ||
from = "https://testing-library.com/docs/example-react-redux" | ||
to = "https://redux.js.org/recipes/writing-tests#connected-components" | ||
status = 301 | ||
from = "/nightwatch/" | ||
to = "/docs/nightwatch-testing-library/intro" | ||
force = true |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.