Skip to content

Commit 7929629

Browse files
docs: website tweaks (#1785)
* docs: fix builder readme links * docs: make "package does not exist yet" page use updated yarn commands * chore: apply lint autofixes to website * docs: add image to SEO component * docs: improved SEO description * docs: fix broken links * docs: fix gatsby-plugin-clipanion-cli description printing * docs: add missing description field to query * docs: don't make package search bar sticky * chore: versions * docs: only sticky search bar if viewport is tall enough * docs: hopefully fix build errors * docs: fix build errors * build: fix typecheck * build: fix TS errors * docs: fix indent level * docs: more media query madness * Revert "docs: more media query madness" This reverts commit 241c2df. * Revert "docs: fix build errors" This reverts commit 81ee3ca. * Revert "docs: hopefully fix build errors" This reverts commit 7e942ab. * Revert "docs: only sticky search bar if viewport is tall enough" This reverts commit 48a2138. * chore: unrevert partial change * Revert "docs: don't make package search bar sticky" This reverts commit 3de3dd3. Co-authored-by: Maël Nison <[email protected]>
1 parent 8fe214d commit 7929629

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+378
-296
lines changed

.pnp.js

+12-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

.yarn/versions/71681657.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declined:
2+
- "@yarnpkg/builder"

packages/gatsby/content/advanced/architecture.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/architecture
44
title: "Architecture"
5+
description: An overview of Yarn's architecture.
56
---
67

78
```toc

packages/gatsby/content/advanced/contributing.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/contributing
44
title: "Contributing"
5+
description: Yarn's contributing guide.
56
---
67

78
Thanks for being here! Yarn gives a lot of importance to being a community project, and we rely on your help as much as you rely on ours. In order to help you help us, we've invested in an infra and documentation that should make contributing to Yarn very easy. If you have any feedback on what we could improve, please open an issue to discuss it!
@@ -103,7 +104,7 @@ Constraints can be checked with `yarn constraints`, and fixed with `yarn constra
103104

104105
## Preparing your PR to be released
105106

106-
In order to track which packages need to be released, we use the workflow described in the [following document](https://yarnpkg.com/features/release-workflow). To summarize, you must run `yarn version check --interactive` on each PR you make, and select which packages should be released again for your changes to be effective (and to which version), if any.
107+
In order to track which packages need to be released, we use the workflow described in the [following document](/features/release-workflow). To summarize, you must run `yarn version check --interactive` on each PR you make, and select which packages should be released again for your changes to be effective (and to which version), if any.
107108

108109
You can check if you've set everything correctly with `yarn version check`.
109110

packages/gatsby/content/advanced/error-codes.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/error-codes
44
title: "Error Codes"
5+
description: A list of Yarn's error codes with detailed explanations.
56
---
67

78
<!-- Never remove the entries in this file, as we want to support older releases -->

packages/gatsby/content/advanced/lexicon.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/lexicon
44
title: "Lexicon"
5+
description: Definitions of common terms used throughout the documentation.
56
---
67

78
```toc

packages/gatsby/content/advanced/lifecycle-scripts.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/lifecycle-scripts
44
title: "Lifecycle Scripts"
5+
description: An overview of Yarn's supported lifecycle scripts.
56
---
67

78
Packages can define in the `scripts` field of their manifest various actions that should be executed when the package manager executes a particular workflow. Here they are:

packages/gatsby/content/advanced/plugin-tutorial.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/plugin-tutorial
44
title: "Plugin Tutorial"
5+
description: A basic plugin tutorial which shows how to work with Yarn's plugin API.
56
---
67

78
Starting from the Yarn 2, Yarn now supports plugins. For more information about what they are and in which case you'd want to use them, consult the [dedicated page](/features/plugins). We'll talk here about the exact steps needed to write one. It's quite simple, really!

packages/gatsby/content/advanced/pnp-api.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/pnpapi
44
title: "PnP API"
5+
description: In-depth documentation of the PnP API.
56
---
67

78
```toc

packages/gatsby/content/advanced/pnpify.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/pnpify
44
title: "PnPify"
5+
description: An overview of PnPify, one of the PnP compatibility layers which emulates virtual node_modules directories and provides IDE support.
56
---
67

78
```toc

packages/gatsby/content/advanced/rulebook.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/rulebook
44
title: "Rulebook"
5+
description: An in-depth rulebook of best-practices and recommendations regarding dependencies.
56
---
67

78
Writing portable packages is incredibly important, as it ensures that your users will benefit from an optimal experience regardless of their package manager.

packages/gatsby/content/advanced/sherlock.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/sherlock
44
title: "Sherlock"
5+
description: An overview of Yarn's GitHub Actions issue toolkit that helps users provide minimal reproductions.
56
hidden: true
67
---
78

packages/gatsby/content/advanced/telemetry.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: advanced
33
path: /advanced/telemetry
44
title: "Telemetry"
5+
description: An overview of Yarn's telemetry collection.
56
---
67

78
## Why does Yarn need some telemetry?

packages/gatsby/content/features/constraints.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/constraints
44
title: "Constraints"
5+
description: An in-depth guide to Yarn's constraints, a feature that provides an easy way to enforce common rules across a project.
56
---
67

78
> **Experimental**

packages/gatsby/content/features/offline-cache.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/offline-cache
44
title: "Offline Cache"
5+
description: An overview of Yarn's offline cache, a feature that allows Yarn to work just fine even should the network go down for any reason.
56
---
67

78
The offline cache is a feature that allows Yarn to work just fine even should the network go down for any reason - whether it's because your employer didn't pay the utility bill or because the place where your packages are hosted becomes unavailable. It's also a critical part of [Zero-Installs](/features/zero-installs) and doesn't store more than a single file for each package - making it suitable for being stored within a repository, [as we actually do in the Yarn repository itself](https://github.com/yarnpkg/berry/tree/master/.yarn/cache).

packages/gatsby/content/features/plugins.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/plugins
44
title: "Plugins"
5+
description: An overview of Yarn's plugin capabilities.
56
---
67

78
Ever since Yarn was created, our very essence has been about experimenting, evolving, pushing the status quo - rinse and repeat, each time one step further, each time paving the way for our next move.

packages/gatsby/content/features/plugnplay.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/pnp
44
title: "Plug'n'Play"
5+
description: An overview of Plug'n'Play, a powerful and innovative installation strategy for Node.
56
---
67

78
> **PnP API**

packages/gatsby/content/features/protocols.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/protocols
44
title: "Protocols"
5+
description: An in-depth guide to Yarn's various protocols.
56
---
67

78
```toc

packages/gatsby/content/features/release-workflow.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/release-workflow
44
title: "Release Workflow"
5+
description: An in-depth guide to Yarn's release workflow which helps with managing versions across a monorepo.
56
---
67

78
> **Experimental**

packages/gatsby/content/features/workspaces.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/workspaces
44
title: "Workspaces"
5+
description: An in-depth guide to Yarn's workspaces, a feature that provides an easy way to store multiple packages inside the same project.
56
---
67

78
The Yarn workspaces aim to make working with [monorepos](/advanced/lexicon#monorepository) easy, solving one of the main use cases for `yarn link` in a more declarative way. In short, they allow multiple of your projects to live together in the same repository AND to cross-reference each others - any modification to one's source code being instantly applied to the others.

packages/gatsby/content/features/zero-installs.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: features
33
path: /features/zero-installs
44
title: 'Zero-Installs'
5+
description: An overview of Yarn's Zero-Installs, a feature provided by PnP which enables storing all dependencies inside the project's repository.
56
---
67

78
While not a feature in itself, the term "Zero Install" encompasses a lot of Yarn features tailored around one specific goal - to make your projects as stable and fast as possible by removing the main source of entropy from the equation: Yarn itself.

packages/gatsby/content/getting-started/editor-sdks.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: getting-started
33
path: /getting-started/editor-sdks
44
title: "Editor SDKs"
5+
description: An overview of the editor SDKs used to bring PnP compatibility to editors.
56
---
67

78
Smart IDEs (such as VSCode or IntelliJ) require special configuration for TypeScript to work. This page intends to be a collection of settings for each editor we've worked with - please contribute to this list!

packages/gatsby/content/getting-started/install.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: getting-started
33
path: /getting-started/install
44
title: "2 - Installation"
5+
description: Yarn's in-depth installation guide.
56
---
67

78
> **Migrating from Yarn 1**

packages/gatsby/content/getting-started/intro.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: getting-started
33
path: /getting-started
44
title: "1 - Introduction"
5+
description: An introduction to Yarn, a package manager for your code.
56
---
67

78
Yarn is a package manager for your code. It allows you to use and share code with other developers from around the world. Yarn does this quickly, securely, and reliably so you don't ever have to worry.

packages/gatsby/content/getting-started/migration.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: getting-started
33
path: /getting-started/migration
44
title: "Migration"
5+
description: A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 (Berry).
56
---
67

78
Yarn v2 is a very different software from the v1. While one of our goals is to make the transition as easy as possible, some behaviors needed to be tweaked. To make things easier we've documented the most common problems that may arise when porting from one project to the other, along with suggestions to keep moving forward.

packages/gatsby/content/getting-started/questions-and-answers.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: getting-started
33
path: /getting-started/qa
44
title: "Questions & Answers"
5+
description: A list of answers to commonly asked questions.
56
---
67

78
```toc

packages/gatsby/content/getting-started/usage.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
category: getting-started
33
path: /getting-started/usage
44
title: "3 - Usage"
5+
description: A short overview of Yarn's most used commands.
56
---
67

78
Now that you have Yarn [installed](/getting-started/install), you can start using it! Here are some of the most common commands you'll need.

packages/gatsby/gatsby-browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See: https://www.gatsbyjs.org/docs/browser-apis/
55
*/
66

7-
require("prismjs/themes/prism-tomorrow.css");
7+
require(`prismjs/themes/prism-tomorrow.css`);

packages/gatsby/gatsby-plugin-clipanion-cli/gatsby-node.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ exports.sourceNodes = ({actions, createNodeId, createContentDigest}, opts) => {
2222

2323
const url = command.path.split(` `).slice(1).join(`/`);
2424

25+
const description = `${command.description[0].toUpperCase()}${command.description.slice(1, -1)}.`;
26+
2527
sections.push([
2628
`---\n`,
2729
`category: ${namespaceTrailingSlash}cli\n`,
2830
`path: ${namespaceLeadingSlash}/cli/${url}\n`,
2931
`title: "\`${command.path}\`"\n`,
32+
`description: ${JSON.stringify(description)}\n`,
3033
`---\n`,
3134
].join(``));
3235

@@ -42,7 +45,7 @@ exports.sourceNodes = ({actions, createNodeId, createContentDigest}, opts) => {
4245

4346
if (command.description) {
4447
sections.push([
45-
`${command.description[0].toUpperCase()}${command.description.slice(1, -1)}.\n`,
48+
`${description}\n`,
4649
].join(``));
4750
}
4851

packages/gatsby/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@strictsoftware/typedoc-plugin-monorepo": "patch:@strictsoftware/typedoc-plugin-monorepo@^0.2.2#./.patches/@strictsoftware/typedoc-plugin-monorepo.patch",
1717
"@types/marked": "^1.1.0",
1818
"@types/react": "^16.8.0",
19+
"@types/react-helmet": "^6.1.0",
1920
"algoliasearch": "^4.2.0",
2021
"ansi-html": "^0.0.7",
2122
"buffer": "^5.6.0",
@@ -86,6 +87,7 @@
8687
"scripts": {
8788
"build:doc": "rm -rf .cache public static/api && yarn build:api && gatsby build --prefix-paths \"$@\" && rsync -rtuc --delete public/ ../../docs/",
8889
"build:api": "typedoc",
90+
"develop:doc": "run develop",
8991
"develop": "gatsby develop",
9092
"serve": "gatsby serve",
9193
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\""
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export const algolia = {
2-
appId: 'OFCNCOG2CU',
3-
apiKey: 'f54e21fa3a2a0160595bb058179bfb1e',
4-
indexName: 'npm-search',
2+
appId: `OFCNCOG2CU`,
3+
apiKey: `f54e21fa3a2a0160595bb058179bfb1e`,
4+
indexName: `npm-search`,
55
};
66

77
export const docsearch = {
8-
apiKey: '3949f721e5d8ca1de8928152ff745b28',
9-
indexName: 'yarnpkg',
8+
apiKey: `3949f721e5d8ca1de8928152ff745b28`,
9+
indexName: `yarnpkg`,
1010
};

packages/gatsby/src/components/details/Aside.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const Aside = ({
6767
/>
6868
{repository &&
6969
isKnownRepositoryHost(repository.host) &&
70-
(repository.host === 'github.com' ? (
70+
(repository.host === `github.com` ? (
7171
<GithubActivity data={activity} repository={repository} />
7272
) : (
7373
<Activity {...activity} repository={repository} />

packages/gatsby/src/components/details/Copyable.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const CopyableContent = styled.section`
8585
}
8686
`;
8787

88-
export const Copyable = ({tag = 'div', pre, children}) => {
88+
export const Copyable = ({tag = `div`, pre, children}) => {
8989
const [statusImage, setImage] = useState(images.default);
9090

9191
const copy = (toCopy, timeout = 2000) => {
@@ -96,13 +96,13 @@ export const Copyable = ({tag = 'div', pre, children}) => {
9696
}, timeout);
9797
};
9898

99-
let range = document.createRange();
99+
const range = document.createRange();
100100
range.selectNode(toCopy);
101101
window.getSelection().removeAllRanges();
102102
window.getSelection().addRange(range);
103103
try {
104104
// Now that we've selected the anchor text, execute the copy command
105-
const copy = document.execCommand('copy');
105+
const copy = document.execCommand(`copy`);
106106
window.getSelection().removeAllRanges();
107107
if (copy === true) {
108108
setAndUnset({image: images.success, timeout});
@@ -129,7 +129,7 @@ export const Copyable = ({tag = 'div', pre, children}) => {
129129
<span ref={copyTextRef}>{children}</span>
130130
</Content>
131131
<object type="stop/styling">
132-
<Button onClick={(event) => {
132+
<Button onClick={event => {
133133
event.preventDefault();
134134
copy(copyTextRef.current);
135135
}}>

packages/gatsby/src/components/details/FileBrowser.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ const Directory = ({name, path, baseURL, expandedDirs, files, onToggleDir}) => {
191191
return SORT_ORDER[a.type] - SORT_ORDER[b.type];
192192

193193
// Then sort by filename, case insensitive
194-
return a.name.localeCompare(b.name, 'en', {sensitivity: 'base'});
194+
return a.name.localeCompare(b.name, `en`, {sensitivity: `base`});
195195
});
196196

197197
return (
198198
<FileList>
199199
{files.map(file => {
200-
if (file.type === 'directory') {
200+
if (file.type === `directory`) {
201201
return (
202202
<Directory
203203
baseURL={baseURL}
@@ -226,7 +226,7 @@ const Directory = ({name, path, baseURL, expandedDirs, files, onToggleDir}) => {
226226
};
227227

228228

229-
if (path === '/') {
229+
if (path === `/`) {
230230
// Special case for root - Only render the contents, not the outer
231231
// wrapper.
232232
return renderDirContents();

packages/gatsby/src/components/details/GithubActivity.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ const weeksAgoSinceLastCommit = ({weeklyData}) =>
2828

2929
const formatWeeksSinceLastCommit = weeks => {
3030
if (weeks === -1)
31-
return 'over a year ago';
31+
return `over a year ago`;
3232

3333
if (weeks < 1)
34-
return 'less than a week ago';
34+
return `less than a week ago`;
3535

3636
if (weeks === 1)
37-
return 'one week ago';
37+
return `one week ago`;
3838

3939
return `${weeks} weeks ago`;
4040
};

0 commit comments

Comments
 (0)