Skip to content

Commit c11623f

Browse files
authored
docs: add notes about external packages (#3962)
* docs: add notes about external packages * docs: fix link
1 parent 0139d8b commit c11623f

File tree

12 files changed

+78
-11
lines changed

12 files changed

+78
-11
lines changed

.yarn/versions/5f57d7bd.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
releases:
2+
"@yarnpkg/builder": patch
3+
"@yarnpkg/pnpify": patch
4+
"@yarnpkg/sdks": patch
5+
6+
declined:
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-exec"
9+
- "@yarnpkg/plugin-interactive-tools"
10+
- "@yarnpkg/plugin-stage"
11+
- "@yarnpkg/plugin-typescript"
12+
- "@yarnpkg/plugin-version"
13+
- "@yarnpkg/plugin-workspace-tools"
14+
- "@yarnpkg/cli"

packages/gatsby/gatsby-config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ module.exports = {
112112
options: {
113113
binaries: [
114114
{
115-
namespace: null,
115+
package: null,
116116
binary: `${__dirname}/../../scripts/run-yarn.js`,
117117
},
118118
{
119-
namespace: `pnpify`,
119+
package: `@yarnpkg/pnpify`,
120120
binary: `${__dirname}/../../scripts/run-pnpify.js`,
121121
},
122122
{
123-
namespace: `sdks`,
123+
package: `@yarnpkg/sdks`,
124124
binary: `${__dirname}/../../scripts/run-sdks.js`,
125125
},
126126
{
127-
namespace: `builder`,
127+
package: `@yarnpkg/builder`,
128128
binary: `${__dirname}/../../scripts/run-builder.js`,
129129
},
130130
],

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

+18-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ const {execFileSync} = require(`child_process`);
33
exports.sourceNodes = ({actions, createNodeId, createContentDigest}, opts) => {
44
const {createNode} = actions;
55

6-
for (const {binary, namespace} of opts.binaries) {
7-
const namespaceLeadingSlash = namespace ? `/${namespace}` : ``;
8-
const namespaceTrailingSlash = namespace ? `${namespace}/` : ``;
6+
for (const {binary, package} of opts.binaries) {
7+
const packageParts = package?.match(/^(?:@([^/]+?)\/)?([^/]+)$/);
8+
9+
const [, scope, name] = packageParts ?? [];
10+
11+
const namespaceLeadingSlash = name ? `/${name}` : ``;
12+
const namespaceTrailingSlash = name ? `${name}/` : ``;
913

1014
const output = execFileSync(`node`, [binary, `--clipanion=definitions`]);
1115

@@ -39,7 +43,17 @@ exports.sourceNodes = ({actions, createNodeId, createContentDigest}, opts) => {
3943
sections.push([
4044
`> **Plugin**\n`,
4145
`>\n`,
42-
`> To use this command, first install the \`${pluginName}\` plugin: \`yarn plugin import ${pluginName}\`\n`,
46+
`> To use this command, first install the [\`${pluginName}\`](https://github.com/yarnpkg/berry/blob/HEAD/packages/plugin-${pluginName}/README.md) plugin: \`yarn plugin import ${pluginName}\`\n`,
47+
].join(``));
48+
}
49+
50+
if (package) {
51+
sections.push([
52+
`> **External Package**\n`,
53+
`>\n`,
54+
`> To use this command, you need to use the [\`${package}\`](https://github.com/yarnpkg/berry/blob/HEAD/packages/${scope}-${name}/README.md) package either:\n`,
55+
`> - By installing it locally using [\`yarn add\`](/cli/add) and running it using [\`yarn run\`](/cli/run)\n`,
56+
`> - By downloading and running it in a temporary environment using [\`yarn dlx\`](/cli/dlx)\n`,
4357
].join(``));
4458
}
4559

packages/gatsby/src/components/markdown.js

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ const Content = styled.div`
4848
background-color: #fff3e2;
4949
}
5050
51+
blockquote > ul {
52+
margin: 0;
53+
padding: 0.5em 2em;
54+
}
55+
5156
blockquote > p {
5257
margin: 0;
5358
}

packages/yarnpkg-builder/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ A CLI tool designed for creating, building, and managing complex plugins.
1717

1818
## Commands
1919

20-
- [`build bundle`](https://yarnpkg.com/builder/cli/build/bundle) - Build the local bundle.
20+
- [`builder build bundle`](https://yarnpkg.com/builder/cli/build/bundle) - Build the local bundle.
2121

22-
- [`build plugin`](https://yarnpkg.com/builder/cli/build/plugin) - Build a local plugin.
22+
- [`builder build plugin`](https://yarnpkg.com/builder/cli/build/plugin) - Build a local plugin.
2323

24-
- [`new plugin`](https://yarnpkg.com/builder/cli/new/plugin) - Create a new plugin.
24+
- [`builder new plugin`](https://yarnpkg.com/builder/cli/new/plugin) - Create a new plugin.

packages/yarnpkg-builder/sources/commands/build/bundle.ts

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export default class BuildBundleCommand extends Command {
3939
description: `build the local bundle`,
4040
details: `
4141
This command builds the local bundle - the Yarn binary file that is installed in projects.
42+
43+
For more details about the build process, please consult the \`@yarnpkg/builder\` README: https://github.com/yarnpkg/berry/blob/HEAD/packages/yarnpkg-builder/README.md.
4244
`,
4345
examples: [[
4446
`Build the local bundle`,

packages/yarnpkg-builder/sources/commands/build/plugin.ts

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export default class BuildPluginCommand extends Command {
3434
description: `build a local plugin`,
3535
details: `
3636
This command builds a local plugin.
37+
38+
For more details about the build process, please consult the \`@yarnpkg/builder\` README: https://github.com/yarnpkg/berry/blob/HEAD/packages/yarnpkg-builder/README.md.
3739
`,
3840
examples: [[
3941
`Build a local plugin`,

packages/yarnpkg-builder/sources/commands/new/plugin.ts

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export default class NewPluginCommand extends Command {
1313
description: `generate the template for a new plugin`,
1414
details: `
1515
This command generates a new plugin based on the template.
16+
17+
For more details about the build process, please consult the \`@yarnpkg/builder\` README: https://github.com/yarnpkg/berry/blob/HEAD/packages/yarnpkg-builder/README.md.
1618
`,
1719
examples: [[
1820
`Create a new plugin`,

packages/yarnpkg-pnpify/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @yarnpkg/pnpify
2+
3+
A CLI tool designed for running commands with a virtual node_modules folder.
4+
5+
[**Documentation**](https://yarnpkg.com/advanced/pnpify)
6+
7+
## Installation
8+
9+
`yarn add -D @yarnpkg/pnpify`
10+
11+
## Commands
12+
13+
- [`pnpify run`](https://yarnpkg.com/pnpify/cli/run) - Run a command with a virtual node_modules folder.

packages/yarnpkg-pnpify/sources/commands/RunCommand.ts

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default class RunCommand extends Command {
1717
When a non-PnP-compliant project tries to access the \`node_modules\` directories (for example through \`readdir\` or \`readFile\`), PnPify intercepts those calls and converts them into calls to the PnP API. Then, based on the result, it simulates the existence of a virtual \`node_modules\` folder that the underlying tool will then consume - still unaware that the files are extracted from a virtual filesystem.
1818
1919
The \`run\` keyword can be omitted if the executed command doesn't conflict with built-in commands.
20+
21+
For more details on PnPify, please consult the dedicated page from our website: https://yarnpkg.com/advanced/pnpify.
2022
`,
2123
examples: [[
2224
`Run Angular using PnPify`,

packages/yarnpkg-sdks/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# @yarnpkg/sdks
2+
3+
A CLI tool designed for generating and updating [Editor SDKs](https://yarnpkg.com/getting-started/editor-sdks) and settings.
4+
5+
## Installation
6+
7+
`yarn add -D @yarnpkg/sdks`
8+
9+
## Commands
10+
11+
- [`sdks`](https://yarnpkg.com/sdks/cli/default) - Generate editor SDKs and settings.

packages/yarnpkg-sdks/sources/commands/SdkCommand.ts

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export default class SdkCommand extends Command {
3232
The supported integrations at this time are: ${[...SUPPORTED_INTEGRATIONS.keys()].map(integration => `\`${integration}\``).join(`, `)}.
3333
3434
**Note:** This command always updates the already-installed SDKs and editor settings, no matter which arguments are passed.
35+
36+
For more details on Editor SDKs, please consult the dedicated page from our website: https://yarnpkg.com/getting-started/editor-sdks.
3537
`,
3638
examples: [[
3739
`Generate the base SDKs`,

0 commit comments

Comments
 (0)