Skip to content

Commit 72a3e31

Browse files
committed
Add npm2yarn
1 parent e2cdfaa commit 72a3e31

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

docs/getting-started/create-your-first-plugin.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ In this section, you'll build the source code for the plugin.
4949

5050
1. Install dependencies.
5151

52-
```bash
52+
```bash npm2yarn
5353
npm install
5454
```
5555

5656
1. Compile the source code. The following command generates a `main.js` that contains the compiled version of your plugin.
5757

58-
```bash
58+
```bash npm2yarn
5959
npm run dev
6060
```
6161

docs/publishing/release-your-plugin-with-github-actions.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ The GitHub Action workflow was originally created and shared by [argentum](https
3333
- name: Build
3434
id: build
3535
run: |
36-
yarn install
37-
yarn run build
36+
npm install
37+
npm run build
3838
mkdir ${{ env.PLUGIN_NAME }}
3939
cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}
4040
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
@@ -143,7 +143,7 @@ To enable standard-version for your plugin:
143143

144144
1. Install standard-version.
145145

146-
```bash
146+
```bash npm2yarn
147147
npm install --save-dev standard-version
148148
```
149149

@@ -173,14 +173,14 @@ To make a release:
173173

174174
1. Create a release and update the changelog.
175175

176-
```bash
176+
```bash npm2yarn
177177
npm run release
178178
```
179179

180180
:::note
181181
By default, if the major version is below **1**, for example in 0.3.4, `feat:` and `BREAKING CHANGE:` bump the patch and minor versions, respectively, rather than the minor and major versions. To bump the minor and major version:
182182

183-
```bash
183+
```bash npm2yarn
184184
# Release as minor
185185
npm run release -- --release-as minor
186186
# Release as major

docusaurus.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ const darkCodeTheme = require("prism-react-renderer/themes/dracula");
4848
editUrl:
4949
"https://github.com/marcusolsson/obsidian-plugin-docs/edit/main/",
5050
routeBasePath: "/",
51-
remarkPlugins: [require("mdx-mermaid")],
51+
remarkPlugins: [
52+
require("mdx-mermaid"),
53+
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
54+
],
5255
},
5356
theme: {
5457
customCss: require.resolve("./src/css/custom.css"),

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@docusaurus/core": "2.0.0-beta.6",
1818
"@docusaurus/plugin-client-redirects": "^2.0.0-beta.6",
1919
"@docusaurus/preset-classic": "2.0.0-beta.6",
20+
"@docusaurus/remark-plugin-npm2yarn": "^2.0.0-beta.8",
2021
"@mdx-js/react": "^1.6.21",
2122
"@svgr/webpack": "^5.5.0",
2223
"clsx": "^1.1.1",

yarn.lock

+12
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,13 @@
14281428
dependencies:
14291429
prop-types "^15.6.2"
14301430

1431+
"@docusaurus/remark-plugin-npm2yarn@^2.0.0-beta.8":
1432+
version "2.0.0-beta.8"
1433+
resolved "https://registry.yarnpkg.com/@docusaurus/remark-plugin-npm2yarn/-/remark-plugin-npm2yarn-2.0.0-beta.8.tgz#21a0f64269388996b227b9e29f8f1a71f78036f9"
1434+
integrity sha512-fo9hsCKMlawuAGZHXlFzIDuFY6PP0toj804o2sVhxIjIvfs79hkCRvWqOaPSkREOygjbo7QRQSZfxFHCmGsXWQ==
1435+
dependencies:
1436+
npm-to-yarn "^1.0.1"
1437+
14311438
"@docusaurus/[email protected]":
14321439
version "2.0.0-beta.6"
14331440
resolved "https://registry.yarnpkg.com/@docusaurus/theme-classic/-/theme-classic-2.0.0-beta.6.tgz#4ae476e90cf875bb13eba5daedbd71d0cfdd8194"
@@ -6447,6 +6454,11 @@ npm-run-path@^4.0.1:
64476454
dependencies:
64486455
path-key "^3.0.0"
64496456

6457+
npm-to-yarn@^1.0.1:
6458+
version "1.0.1"
6459+
resolved "https://registry.yarnpkg.com/npm-to-yarn/-/npm-to-yarn-1.0.1.tgz#6cdb95114c4ff0be50a7a2381d4d16131a5f52df"
6460+
integrity sha512-bp8T8oNMfLW+N/fE0itFfSu7RReytwhqNd9skbkfHfzGYC+5CCdzS2HnaXz6JiG4AlK2eA0qlT6NJN1SoFvcWQ==
6461+
64506462
nprogress@^0.2.0:
64516463
version "0.2.0"
64526464
resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"

0 commit comments

Comments
 (0)