8000 Move core plugins docs to documentation website by NataliaTepluhina · Pull Request #4120 · vuejs/vue-cli · GitHub
[go: up one dir, main page]

Skip to content

Move core plugins docs to documentation website #4120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: created a script to generate docs
  • Loading branch information
NataliaTepluhina committed Jun 11, 2019
commit 3ccc64feb38f96254bb020829adc09de1c382723
8 changes: 4 additions & 4 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ module.exports = {
'/core-plugins/typescript.md',
'/core-plugins/eslint.md',
'/core-plugins/pwa.md',
'/core-plugins/jest.md',
'/core-plugins/mocha.md',
'/core-plugins/cypress.md',
'/core-plugins/nightwatch.md'
'/core-plugins/unit-jest.md',
'/core-plugins/unit-mocha.md',
'/core-plugins/e2e-cypress.md',
'/core-plugins/e2e-nightwatch.md'
]
}],

Expand Down
8 changes: 4 additions & 4 deletions docs/core-plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This section contains documentation for core Vue CLI plugins:
- [TypeScript](typescript.md)
- [ESLint](eslint.md)
- [PWA](pwa.md)
- [Jest](jest.md)
- [Mocha](mocha.md)
- [Cypress](cypress.md)
- [Nightwatch](nightwatch.md)
- [Jest](unit-jest.md)
- [Mocha](unit-mocha.md)
- [Cypress](e2e-cypress.md)
- [Nightwatch](e2e-nightwatch.md)
2 changes: 1 addition & 1 deletion docs/core-plugins/babel.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-babel

> Babel plugin for Vue CLI
> babel plugin for vue-cli

## Configuration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-e2e-cypress

> e2e-cypress plugin for Vue CLI
> e2e-cypress plugin for vue-cli

This adds E2E testing support using [Cypress](https://www.cypress.io/).

Expand Down Expand Up @@ -29,7 +29,7 @@ Cypress offers a rich interactive interface for running E2E tests, but currently

- In GUI mode, [all Cypress CLI options for `cypress open` are also supported](https://docs.cypress.io/guides/guides/command-line.html#cypress-open);
- In `--headless` mode, [all Cypress CLI options for `cypress run` are also supported](https://docs.cypress.io/guides/guides/command-line.html#cypress-run).

Examples :
- Run Cypress in headless mode for a specific file: `vue-cli-service test:e2e --headless --spec tests/e2e/specs/actions.spec.js`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-e2e-nightwatch

> e2e-nightwatch plugin for Vue CLI
> e2e-nightwatch plugin for vue-cli

## Injected Commands

Expand Down
2 changes: 1 addition & 1 deletion docs/core-plugins/eslint.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-eslint

> ESLint plugin for Vue CLI
> eslint plugin for vue-cli

## Injected Commands

Expand Down
18 changes: 16 additions & 2 deletions docs/core-plugins/pwa.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-pwa

> Progressive Web Application plugin for Vue CLI
> pwa plugin for vue-cli

The service worker added with this plugin is only enabled in the production environment (e.g. only if you run `npm run build` or `yarn build`). Enabling service worker in a development mode is not a recommended practice, because it can lead to the situation when previously cached assets are used and the latest local changes are not included.

Expand All @@ -10,7 +10,8 @@ If you need to test a service worker locally, build the application and run a si

## Configuration

Configuration is handled via the `pwa` property of either the `vue.config.js` file, or the `"vue"` field in `package.json`.
Configuration is handled via the `pwa` property of either the `vue.config.js`
file, or the `"vue"` field in `package.json`.

- **pwa.workboxPluginMode**

Expand Down Expand Up @@ -70,6 +71,19 @@ Configuration is handled via the `pwa` property of either the `vue.config.js` fi

The path of app’s manifest.

- **pwa.manifestOptions**

- Default: `{}`

The object will be used to generate the `manifest.json`

If the following attributes are not defined in the object, the options of `pwa` or default options will be used instead.
- name: `pwa.name`
- short_name: `pwa.name`
- start_url: `'.'`
- display: `'standalone'`
- theme_color: `pwa.themeColor`

- **pwa.iconPaths**

- Defaults:
Expand Down
2 changes: 1 addition & 1 deletion docs/core-plugins/typescript.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-typescript

> TypeScript plugin for Vue CLI
> typescript plugin for vue-cli

Uses TypeScript + `ts-loader` + [fork-ts-checker-webpack-plugin](https://github.com/Realytics/fork-ts-checker-webpack-plugin) for faster off-thread type checking.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-unit-jest

> unit-jest plugin for Vue CLI
> unit-jest plugin for vue-cli

## Injected Commands

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @vue/cli-plugin-unit-mocha

> unit-mocha plugin for Vue CLI
> unit-mocha plugin for vue-cli

## Injected Commands

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"version": "node scripts/genChangelog.js && git add CHANGELOG.md",
"docs": "vuepress dev docs",
"docs:build": "vuepress build docs",
"patch-chromedriver": "node scripts/patchChromedriver.js"
"patch-chromedriver": "node scripts/patchChromedriver.js",
"gen-docs": "node scripts/genDocs.js"
},
"gitHooks": {
"pre-commit": "lint-staged",
Expand Down
18 changes: 18 additions & 0 deletions scripts/genDocs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const fs = require('fs')
const path = require('path')

const plugins = ['babel', 'e2e-cypress', 'e2e-nightwatch', 'eslint', 'pwa', 'typescript', 'unit-jest', 'unit-mocha']

const genDocs = (module.exports = async () => {
plugins.forEach(plugin => {
const entryPath = path.resolve(__dirname, '../packages', '@vue', `cli-plugin-${plugin}`, 'README.md')
const entryContent = fs.readFileSync(entryPath)
const docPath = path.resolve(__dirname, '../docs', 'core-plugins', `${plugin}.md`)
fs.writeFile(docPath, entryContent, () => {})
})
})

genDocs().catch(err => {
console.error(err)
process.exit(1)
})
0