From 56044c7851d583d498f919e9546caddf8f80a72f Mon Sep 17 00:00:00 2001 From: Rizky Date: Wed, 30 Jan 2019 01:09:08 +1100 Subject: [PATCH] install polyfill & runtime to dependency instead of devDependency [skip ci] (#9409) --- .../babel-helper-create-class-features-plugin/README.md | 8 ++++---- packages/babel-polyfill/README.md | 4 ++-- packages/babel-runtime/README.md | 4 ++-- scripts/generators/readmes.js | 7 +++++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/babel-helper-create-class-features-plugin/README.md b/packages/babel-helper-create-class-features-plugin/README.md index 567c8ae908..5ce5e8c6b5 100644 --- a/packages/babel-helper-create-class-features-plugin/README.md +++ b/packages/babel-helper-create-class-features-plugin/README.md @@ -1,19 +1,19 @@ -# @babel/plugin-class-features +# @babel/helper-create-class-features-plugin > Compile class public and private fields, private methods and decorators to ES6 -See our website [@babel/plugin-class-features](https://babeljs.io/docs/en/next/babel-plugin-class-features.html) for more information. +See our website [@babel/helper-create-class-features-plugin](https://babeljs.io/docs/en/next/babel-helper-create-class-features-plugin.html) for more information. ## Install Using npm: ```sh -npm install --save-dev @babel/plugin-class-features +npm install --save-dev @babel/helper-create-class-features-plugin ``` or using yarn: ```sh -yarn add @babel/plugin-class-features --dev +yarn add @babel/helper-create-class-features-plugin --dev ``` diff --git a/packages/babel-polyfill/README.md b/packages/babel-polyfill/README.md index 5f29e0f5a7..5b1b77aaa1 100644 --- a/packages/babel-polyfill/README.md +++ b/packages/babel-polyfill/README.md @@ -9,11 +9,11 @@ See our website [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill Using npm: ```sh -npm install --save-dev @babel/polyfill +npm install --save @babel/polyfill ``` or using yarn: ```sh -yarn add @babel/polyfill --dev +yarn add @babel/polyfill ``` diff --git a/packages/babel-runtime/README.md b/packages/babel-runtime/README.md index 75087e3560..72e8daa318 100644 --- a/packages/babel-runtime/README.md +++ b/packages/babel-runtime/README.md @@ -9,11 +9,11 @@ See our website [@babel/runtime](https://babeljs.io/docs/en/next/babel-runtime.h Using npm: ```sh -npm install --save-dev @babel/runtime +npm install --save @babel/runtime ``` or using yarn: ```sh -yarn add @babel/runtime --dev +yarn add @babel/runtime ``` diff --git a/scripts/generators/readmes.js b/scripts/generators/readmes.js index 1ab0b25214..fd0cc7f3c4 100644 --- a/scripts/generators/readmes.js +++ b/scripts/generators/readmes.js @@ -13,12 +13,15 @@ const cwd = process.cwd(); const packageDir = join(cwd, "packages"); const packages = readdirSync(packageDir); +const packagesInstalledToDep = ["@babel/polyfill", "@babel/runtime"]; const getWebsiteLink = n => `https://babeljs.io/docs/en/next/${n}.html`; const getPackageJson = pkg => require(join(packageDir, pkg, "package.json")); const getIssueLabelLink = l => `https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22${encodeURIComponent( l )}%22+is%3Aopen`; +const getNpmInstall = name => `npm install ${packagesInstalledToDep.includes(name) ? "--save" : "--save-dev"} ${name}`; +const getYarnAdd = name => `yarn add ${name} ${packagesInstalledToDep.includes(name) ? "" : "--dev"}`; const labels = { "babel-preset-flow": getIssueLabelLink("area: flow"), @@ -54,13 +57,13 @@ See our website [${name}](${websiteLink}) for more information${ Using npm: \`\`\`sh -npm install --save-dev ${name} +${getNpmInstall(name)} \`\`\` or using yarn: \`\`\`sh -yarn add ${name} --dev +${getYarnAdd(name)} \`\`\` `;