diff --git a/packages/create-docusaurus/templates/shared/docs/intro.md b/packages/create-docusaurus/templates/shared/docs/intro.md index 500260230bfc..28377d226864 100644 --- a/packages/create-docusaurus/templates/shared/docs/intro.md +++ b/packages/create-docusaurus/templates/shared/docs/intro.md @@ -23,7 +23,7 @@ Generate a new Docusaurus site using the **classic template**. The classic template will automatically be added to your project after you run the command: -```bash +```bash npm2yarn npm init docusaurus@latest my-website classic ``` @@ -35,7 +35,7 @@ The command also installs all necessary dependencies you need to run Docusaurus. Run the development server: -```bash +```bash npm2yarn cd my-website npm run start ``` diff --git a/packages/docusaurus-remark-plugin-npm2yarn/package.json b/packages/docusaurus-remark-plugin-npm2yarn/package.json index a47e1de9c9e0..ee7b30b6f307 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/package.json +++ b/packages/docusaurus-remark-plugin-npm2yarn/package.json @@ -17,7 +17,7 @@ }, "license": "MIT", "dependencies": { - "npm-to-yarn": "^1.0.1", + "@armano/npm-to-yarn": "^1.1.2", "tslib": "^2.4.0", "unist-util-visit": "^2.0.3" }, diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index 0764763e9540..891ca4a6a603 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -9,19 +9,16 @@ import type {Code, Content, Literal} from 'mdast'; import type {Plugin} from 'unified'; import type {Node, Parent} from 'unist'; import visit from 'unist-util-visit'; -import npmToYarn from 'npm-to-yarn'; +import {convertToYarn} from '@armano/npm-to-yarn'; type PluginOptions = { sync?: boolean; }; -// E.g. global install: 'npm i' -> 'yarn' -const convertNpmToYarn = (npmCode: string) => npmToYarn(npmCode, 'yarn'); - const transformNode = (node: Code, isSync: boolean) => { const groupIdProp = isSync ? ' groupId="npm2yarn"' : ''; const npmCode = node.value; - const yarnCode = convertNpmToYarn(node.value); + const yarnCode = convertToYarn(node.value); return [ { type: 'jsx', diff --git a/project-words.txt b/project-words.txt index 341e85f935db..faa7a60a494c 100644 --- a/project-words.txt +++ b/project-words.txt @@ -11,6 +11,7 @@ apos appinstalled applanga architecting +armano astro atrule autoconverted diff --git a/yarn.lock b/yarn.lock index b7f0f09e30d1..fa7413e42895 100644 --- a/yarn.lock +++ b/yarn.lock @@ -147,6 +147,11 @@ jsonpointer "^5.0.0" leven "^3.1.0" +"@armano/npm-to-yarn@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@armano/npm-to-yarn/-/npm-to-yarn-1.1.2.tgz#3518758123bf1bdb447949053721d283fc8bf2ae" + integrity sha512-rDxYtk9LEZqZkLth/sIZLmC4boUgSKY/8/zgd+OA9x8W2s2MAPAcxGlfvBpIkXloEFKt3OLgfHVSWTFR1f3YpA== + "@babel/cli@^7.17.10": version "7.17.10" resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.17.10.tgz#5ea0bf6298bb78f3b59c7c06954f9bd1c79d5943" @@ -11153,11 +11158,6 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -npm-to-yarn@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/npm-to-yarn/-/npm-to-yarn-1.0.1.tgz#6cdb95114c4ff0be50a7a2381d4d16131a5f52df" - integrity sha512-bp8T8oNMfLW+N/fE0itFfSu7RReytwhqNd9skbkfHfzGYC+5CCdzS2HnaXz6JiG4AlK2eA0qlT6NJN1SoFvcWQ== - npmlog@^4.0.1, npmlog@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"