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

upgrade to docusaurus-v2 #233

Merged
merged 29 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6b2f736
test
slorber May 28, 2020
372a8de
revert test
slorber May 28, 2020
02e499c
add .idea to gitignore
slorber May 28, 2020
355dd14
Docusaurus v2 initial commit
slorber May 28, 2020
14b6c1f
fix md parsing error
slorber May 29, 2020
26e9325
fix navbar items
slorber May 29, 2020
0e8ed15
migrate help page
slorber May 29, 2020
c0128a5
migrate useless users page
slorber May 29, 2020
4a677a1
migrate homepage
slorber May 29, 2020
1e45720
Typescript => TypeScript
slorber May 29, 2020
192257b
migrate footer + some details
slorber May 29, 2020
13bd741
fix site tagline
slorber May 29, 2020
d7d7213
replace some inline styles with infima
slorber May 29, 2020
c1a6429
add primary color
slorber May 29, 2020
8b01dcc
update readme to v2 readme
slorber May 29, 2020
aa9286b
addUserUrl
slorber May 29, 2020
7f63050
temporarily disable the github star button
slorber May 29, 2020
6fe2328
add some space between <detail><summary> etc
slorber May 29, 2020
6e1973a
prism: default to TS
slorber May 29, 2020
1e68366
Update docusaurus.config.js
swyxio May 31, 2020
f00dcc7
Update help.js
swyxio May 31, 2020
e0dafad
remove FB copyrights
slorber Jun 1, 2020
864a062
useless comments
slorber Jun 1, 2020
2c0e4a0
useless mediaqueries
slorber Jun 1, 2020
47978d1
larger buttons
slorber Jun 1, 2020
fc38197
put back github star button in footer
slorber Jun 1, 2020
9d97bc1
use <code> instead of md syntax in summaries
slorber Jun 2, 2020
bf3d320
add github star footer item as badge
slorber Jun 3, 2020
f1dcb87
remove useless global script
slorber Jun 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ dist
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# Idea / Jetbrains IDE
.idea

# yarn v2

.yarn/cache
Expand All @@ -116,6 +119,11 @@ dist

# Miscellaneous
.history

# Docusaurus files
website/build
website/.docusaurus
website/.cache-loader

# Local Netlify folder
.netlify
.netlify
2 changes: 1 addition & 1 deletion docs/advanced/guides/extract-props.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: extract_props
title: Props: Extracting Prop Types of a Component
title: "Props: Extracting Prop Types of a Component"
---

_(Contributed by [@ferdaber](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/issues/63))_
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/handling-exceptions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: handling_exception
id: handling_exceptions
title: Handling Exceptions
---

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/props-must-pass-both.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: props_one_other_not_both
title: Props: Must Pass Both
title: "Props: Must Pass Both"
---

```tsx
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/props-one-other-not-both.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: props_one_other_not_both
title: Props: One or the Other but not Both
title: "Props: One or the Other but not Both"
---

Use the `in` keyword, function overloading, and union types to make components that take either one or another sets of props, but not both:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/props-optionally-pass-one.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: props_optionally_pass_one
title: Props: Can Optionally Pass One Only If the Other Is Passed
title: "Props: Can Optionally Pass One Only If the Other Is Passed"
---

Say you want a Text component that gets truncated if `truncate` prop is passed but expands to show the full text when `expanded` prop is passed (e.g. when the user clicks the text).
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/guides/third-party-libs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: third_party_libs
title: Props: Third Party Libraries
title: "Props: Third Party Libraries"
---

Sometimes DefinitelyTyped can get it wrong, or isn't quite addressing your use case. You can declare your own file with the same interface name. TypeScript will merge interfaces with the same name.
2 changes: 1 addition & 1 deletion docs/advanced/misc-concerns.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: misc_concerns
title: Section 3: Misc. Concerns
title: "Section 3: Misc. Concerns"
sidebar_label: Misc. Concerns
---

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/patterns.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: patterns
title: Section 2: Useful Patterns by TypeScript Version
title: "Section 2: Useful Patterns by TypeScript Version"
sidebar_label: Useful Patterns by TypeScript Version
---

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/types-react-ap.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: types_react_api
title: Section 4: @types/react and @types/react-dom APIs
sidebar_label: @types/react and @types/react-dom APIs
title: "Section 4: @types/react and @types/react-dom APIs"
swyxio marked this conversation as resolved.
Show resolved Hide resolved
sidebar_label: "@types/react and @types/react-dom APIs"
---

The `@types` typings export both "public" types meant for your use as well as "private" types that are for internal use.
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/utility-types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: utility_types
title: Section 0: Utility Types
title: "Section 0: Utility Types"
sidebar_label: Utility Types
---

Expand Down
3 changes: 2 additions & 1 deletion docs/basic/getting-started/react-prop-type-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Quote [@ferdaber](https://github.com/typescript-cheatsheets/react-typescript-che

- `JSX.Element` -> Return value of `React.createElement`
- `React.ReactNode` -> Return value of a component
</details>

</details>

[More discussion: Where ReactNode does not overlap with JSX.Element](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/issues/129)

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/non-ts-files.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: non_ts_files
title: Troubleshooting Handbook: Images and other non-TS/TSX files
title: "Troubleshooting Handbook: Images and other non-TS/TSX files"
sidebar_label: Images and other non-TS/TSX files
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/operators.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: operators
title: Troubleshooting Handbook: Operators
title: "Troubleshooting Handbook: Operators"
sidebar_label: Operators
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/ts-config.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: tsconfig
title: Troubleshooting Handbook: tsconfig.json
title: "Troubleshooting Handbook: tsconfig.json"
sidebar_label: tsconfig.json
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: types
title: Troubleshooting Handbook: Types
title: "Troubleshooting Handbook: Types"
sidebar_label: Types
---

Expand Down
2 changes: 1 addition & 1 deletion docs/basic/troubleshooting/utilities.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: utilities
title: Troubleshooting Handbook: Utilities
title: "Troubleshooting Handbook: Utilities"
sidebar_label: Utilities
---

Expand Down
2 changes: 1 addition & 1 deletion docs/hoc/excluding-props.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: excluding_props
sidebar_label: Excluding Props
title: Section 2: Excluding Props
title: "Section 2: Excluding Props"
---

This is covered in passing in Section 1 but we focus on it here as it is such a common issue. HOCs often inject props to premade components. The problem we want to solve is having the HOC-wrapped-component exposing a type that reflects the reduced surface area of props - without manually retyping the HOC every time. This involves some generics, fortunately with some helper utilities.
Expand Down
2 changes: 1 addition & 1 deletion docs/hoc/full-example.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: full_example
sidebar_label: Full HOC Example
title: Section 0: Full HOC Example
title: "Section 0: Full HOC Example"
---

> This is an HOC example for you to copy and paste. If you certain pieces don't make sense for you, head to [Section 1](#section-1-react-hoc-docs-in-typescript) to get a detailed walkthrough via a complete translation of the React docs in TypeScript.
Expand Down
2 changes: 1 addition & 1 deletion docs/hoc/react-hoc-docs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: react_hoc_docs
sidebar_label: React HOC docs in TypeScript
title: Section 1: React HOC docs in TypeScript
title: "Section 1: React HOC docs in TypeScript"
---

In this first section we refer closely to [the React docs on HOCs](https://reactjs.org/docs/higher-order-components.html) and offer direct TypeScript parallels.
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# 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.
publish = "build/react-typescript-cheatsheet"
publish = "build"

# Default build command.
command = "yarn build"

# Directory with the serverless Lambda functions to deploy to AWS.
# functions = "project/functions/"
# functions = "project/functions/"
Loading