Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vuepress
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.1
Choose a base ref
...
head repository: vuejs/vuepress
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.4.0
Choose a head ref
  • 15 commits
  • 46 files changed
  • 10 contributors

Commits on Feb 20, 2020

  1. chore: 1.3.1 changelog

    kefranabg committed Feb 20, 2020
    Copy the full SHA
    de64e81 View commit details

Commits on Feb 23, 2020

  1. Copy the full SHA
    8d9968d View commit details
  2. Copy the full SHA
    a9759c0 View commit details

Commits on Feb 25, 2020

  1. Copy the full SHA
    369c315 View commit details

Commits on Feb 29, 2020

  1. docs: update CONTRIBUTING and README (#2052)

    Sun Haoran authored Feb 29, 2020
    Copy the full SHA
    3abe265 View commit details

Commits on Mar 6, 2020

  1. docs: refine cli documentation (#2151)

    Sun Haoran authored Mar 6, 2020
    Copy the full SHA
    4c6fbcc View commit details

Commits on Mar 8, 2020

  1. Copy the full SHA
    e9fde5c View commit details

Commits on Mar 10, 2020

  1. Copy the full SHA
    0aadf05 View commit details
  2. 1
    Copy the full SHA
    76da780 View commit details

Commits on Mar 18, 2020

  1. Copy the full SHA
    27275ee View commit details
  2. Copy the full SHA
    c3a943c View commit details
  3. Copy the full SHA
    3551e69 View commit details
  4. Copy the full SHA
    f7a78b4 View commit details
  5. Copy the full SHA
    604052b View commit details
  6. v1.4.0

    billyyyyy3320 committed Mar 18, 2020
    Copy the full SHA
    58ed07f View commit details
Showing with 351 additions and 161 deletions.
  1. +41 −21 .github/CONTRIBUTING.md
  2. +1 −1 .gitpod.yml
  3. +21 −0 CHANGELOG.md
  4. +4 −4 README.md
  5. +1 −1 lerna.json
  6. +12 −8 packages/@vuepress/core/lib/node/Page.js
  7. +7 −6 packages/@vuepress/core/lib/node/__tests__/prepare/Page.spec.js
  8. +3 −7 packages/@vuepress/core/lib/node/build/index.js
  9. +6 −6 packages/@vuepress/core/package.json
  10. +2 −2 packages/@vuepress/markdown-loader/package.json
  11. +3 −3 packages/@vuepress/markdown/package.json
  12. +1 −1 packages/@vuepress/plugin-active-header-links/package.json
  13. +1 −1 packages/@vuepress/plugin-back-to-top/package.json
  14. +1 −1 packages/@vuepress/plugin-google-analytics/package.json
  15. +4 −4 packages/@vuepress/plugin-last-updated/index.js
  16. +1 −1 packages/@vuepress/plugin-last-updated/package.json
  17. +1 −1 packages/@vuepress/plugin-medium-zoom/package.json
  18. +1 −1 packages/@vuepress/plugin-nprogress/package.json
  19. +9 −9 packages/@vuepress/plugin-pwa/lib/enhanceAppFile.js
  20. +3 −3 packages/@vuepress/plugin-pwa/package.json
  21. +2 −2 packages/@vuepress/plugin-register-components/package.json
  22. +5 −8 packages/@vuepress/plugin-search/SearchBox.vue
  23. +42 −0 packages/@vuepress/plugin-search/__tests__/matchQuery.spec.js
  24. +42 −0 packages/@vuepress/plugin-search/match-query.js
  25. +1 −1 packages/@vuepress/plugin-search/package.json
  26. +1 −1 packages/@vuepress/shared-utils/package.json
  27. +1 −1 packages/@vuepress/shared-utils/src/slugify.ts
  28. +12 −6 packages/@vuepress/test-utils/lib/createJestRunner.js
  29. +3 −3 packages/@vuepress/test-utils/package.json
  30. +4 −4 packages/@vuepress/theme-default/package.json
  31. +0 −5 packages/@vuepress/theme-default/util/index.js
  32. +2 −2 packages/@vuepress/theme-vue/package.json
  33. +43 −15 packages/docs/docs/api/cli.md
  34. +7 −0 packages/docs/docs/guide/frontmatter.md
  35. +2 −4 packages/docs/docs/miscellaneous/local-development.md
  36. +23 −0 packages/docs/docs/plugin/official/plugin-last-updated.md
  37. +12 −3 packages/docs/docs/theme/default-theme-config.md
  38. +2 −2 packages/docs/docs/zh/config/README.md
  39. +2 −4 packages/docs/docs/zh/miscellaneous/local-development.md
  40. +1 −1 packages/docs/docs/zh/theme/default-theme-config.md
  41. +7 −7 packages/docs/package.json
  42. +1 −1 packages/vuepress/README.md
  43. +1 −1 packages/vuepress/lib/checkEnv.js
  44. +4 −4 packages/vuepress/package.json
  45. +4 −2 scripts/test.js
  46. +4 −3 yarn.lock
62 changes: 41 additions & 21 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -3,26 +3,30 @@
This project uses a monorepo setup that requires using [Yarn](https://yarnpkg.com) because it relies on [Yarn workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/).

``` sh
# Install dependencies & compile TypeScript utilities.
yarn bootstrap
# Install all dependencies.
yarn install

# Clean dependencies.
yarn clean

# Useful when creating new submodules.
yarn boot

# Serve the docs.
# Serves VuePress' own docs with itself.
yarn dev

# Build the docs.
# Build VuePress' own docs with itself.
yarn build

# Execute all the test suites.
yarn test

# Clean dependencies.
yarn clean

# Useful when creating new a package.
yarn boot
```

## Core packages
## Testing Setup

> TODO
## Core Packages

- **docs**: Docs of VuePress (do not publish to npm).
- **vuepress**: VuePress CLI.
@@ -42,21 +46,23 @@ yarn test
- `theme-default`: default theme.
- `theme-vue`: a theme tweak from default theme, used for the official Vue project.

## Core packages not in main project
## Core Packages not in Main Project

> Previously, for quick iteration, these projects were kept in ULIVZ's workspace. In the future, we may want to build an independent GitHub group.
These projects are now available under [VuePress](https://github.com/vuepressjs) group, contribution welcome!

- [awesome-vuepress](https://github.com/ulivz/awesome-vuepress)
- [@vuepress/plugin-blog](https://github.com/ulivz/vuepress-plugin-blog)
- [@vuepress/theme-blog](https://github.com/ulivz/vuepress-theme-blog)
- [awesome-vuepress](https://github.com/vuepressjs/awesome-vuepress)
- [@vuepress/plugin-blog](https://github.com/vuepressjs/vuepress-plugin-blog)
- [@vuepress/theme-blog](https://github.com/vuepressjs/vuepress-theme-blog)

## Workflow

### Issue

> TODO
Use one of the [issues templates](https://github.com/vuejs/vuepress/issues/new/choose) when you open a issue. And please ask questions on the [StackOverflow](https://stackoverflow.com/questions/ask?tags=vuepress).

### Pull requests
We'll close your issue if you delete the template or it contains questions.

### Pull Requests

- Create a feature branch from the default branch (`master`) and merge back against that branch.
- It's OK to have multiple small commits as you work on the PR - GitHub automatically squashes them before merging.
@@ -71,12 +77,26 @@ yarn test

### Substantial Changes

> RFC flow, TODO
Check out [RFC flow](https://github.com/vuejs/vuepress/tree/master/rfcs) for more detail.

## Code Specification

> TODO
## Commit specification
## Commit Specification

Commit messages should follow the [commit message convention](https://www.conventionalcommits.org) so that changelogs can be automatically generated.

Check out the availalbe types at [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional#type-enum). And the scopes should be one of the followings:

``` sh
cli

# Core Packages/packages:
core
markdown
...
theme-vue
```

Commit messages should follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated.
Correct examples would be: `fix($core): some message` or `feat: some message`
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -2,5 +2,5 @@ ports:
- port: 8080
onOpen: open-preview
tasks:
- init: yarn bootstrap
- init: yarn
command: yarn dev
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# [](https://github.com/vuejs/vuepress/compare/v1.3.1...v) (2020-02-20)



## [1.3.1](https://github.com/vuejs/vuepress/compare/v1.3.0...v1.3.1) (2020-02-20)


### Bug Fixes

* **$core:** resolve jsx files by default (close [#2058](https://github.com/vuejs/vuepress/issues/2058)) ([#2059](https://github.com/vuejs/vuepress/issues/2059)) ([f083d8d](https://github.com/vuejs/vuepress/commit/f083d8d))
* **$core:** transpile vuepress packages and md files (close [#1606](https://github.com/vuejs/vuepress/issues/1606), [#1990](https://github.com/vuejs/vuepress/issues/1990)) ([#2064](https://github.com/vuejs/vuepress/issues/2064)) ([0ca620f](https://github.com/vuejs/vuepress/commit/0ca620f))
* **$plugin-pwa:** popup component does not work (close [#2172](https://github.com/vuejs/vuepress/issues/2172)) ([#2187](https://github.com/vuejs/vuepress/issues/2187)) ([560b3c6](https://github.com/vuejs/vuepress/commit/560b3c6))
* **$theme-default:** non-ASCII hash causes wrong sidebar highlight (close [#2078](https://github.com/vuejs/vuepress/issues/2078))([#2166](https://github.com/vuejs/vuepress/issues/2166)) ([ca3679c](https://github.com/vuejs/vuepress/commit/ca3679c))


### Features

* **$core:** support async enhanceApp (close [#2074](https://github.com/vuejs/vuepress/issues/2074)) ([#2075](https://github.com/vuejs/vuepress/issues/2075)) ([2d53fbb](https://github.com/vuejs/vuepress/commit/2d53fbb))



# [](https://github.com/vuejs/vuepress/compare/v1.3.0...v) (2020-01-30)


8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -23,16 +23,16 @@ Check out our docs at https://vuepress.vuejs.org/.

## Showcase

- [Awesome VuePress](https://github.com/ulivz/awesome-vuepress)
- [Awesome VuePress](https://github.com/vuepressjs/awesome-vuepress)
- [vuepress.gallery](https://vuepress.gallery) (by [@vicbergquist](https://twitter.com/vicbergquist))
- [vuepress.tools](https://vuepress.tools/) (By [Ahmad Mostafa](https://ahmadmostafa.com))

## Contribution

Want to contribute? Check our [issues for beginners](https://github.com/vuejs/vuepress/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)!
Want to contribute? Check our [Contributing Guide](.github/CONTRIBUTING.md) and [issues for beginners](https://github.com/vuejs/vuepress/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)!

```bash
yarn bootstrap # Install and link dependencies for this lerna repo
yarn install # install all dependencies
yarn dev # serves VuePress' own docs with itself
yarn test # make sure your code change pass the test
```
@@ -41,7 +41,7 @@ If you don't have a local checkout, you can also open [VuePress in Gitpod](https

If you intend to make `"substantial"` changes to VuePress or its documentation, please checkout [VuePress RFCs](./rfcs/README.md).

If you have a VuePress-related project/component/tool, add it with a pull request to [this curated list](https://github.com/ulivz/awesome-vuepress)!
If you have a VuePress-related project/component/tool, add it with a pull request to [this curated list](https://github.com/vuepressjs/awesome-vuepress)!

## Contributors

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "1.3.1"
"version": "1.4.0"
}
20 changes: 12 additions & 8 deletions packages/@vuepress/core/lib/node/Page.js
Original file line number Diff line number Diff line change
@@ -286,13 +286,17 @@ module.exports = class Page {
*/

async enhance (enhancers) {
for (const { name: pluginName, value: enhancer } of enhancers) {
try {
await enhancer(this)
} catch (error) {
console.log(error)
throw new Error(`[${pluginName}] execute extendPageData failed.`)
}
}
return Promise.all(
enhancers.map(
async ({ value: enhancer, name: pluginName }) => {
try {
await enhancer(this)
} catch (error) {
console.log(error)
throw new Error(`[${pluginName}] execute extendPageData failed.`)
}
}
)
)
}
}
13 changes: 7 additions & 6 deletions packages/@vuepress/core/lib/node/__tests__/prepare/Page.spec.js
Original file line number Diff line number Diff line change
@@ -111,11 +111,11 @@ describe('Page', () => {
page = new Page({ path: '/' }, app)
enhancers = [
{
pluginName: 'foo',
name: 'foo',
value: jest.fn()
},
{
pluginName: 'foo',
name: 'bar',
value: jest.fn()
}
]
@@ -130,21 +130,22 @@ describe('Page', () => {

test('should loop over sync and async enhancers', async () => {
const mixedEnhancers = [...enhancers, {
pluginName: 'blog',
name: 'blog',
value: jest.fn().mockResolvedValue({})
}]
await page.enhance(mixedEnhancers)

return mixedEnhancers.map(enhancer => expect(enhancer.value).toHaveBeenCalled())
})

test('should log when enhancing when failing', async () => {
test('should log and throw an error when enhancing fails', async () => {
const error = { errorMessage: 'this is an error message' }
const pluginName = 'error-plugin'

await expect(page.enhance([{
pluginName: 'error-plugin',
name: pluginName,
value: jest.fn().mockRejectedValue(error)
}])).rejects.toThrow()
}])).rejects.toThrowError(`[${pluginName}] execute extendPageData failed.`)

expect(console.log).toHaveBeenCalledWith(error)
})
10 changes: 3 additions & 7 deletions packages/@vuepress/core/lib/node/build/index.js
Original file line number Diff line number Diff line change
@@ -89,10 +89,9 @@ module.exports = class Build extends EventEmitter {
// render pages
logger.wait('Rendering static HTML...')

const pagePaths = []
for (const page of this.context.pages) {
pagePaths.push(await this.renderPage(page))
}
const pagePaths = await Promise.all(
this.context.pages.map(page => this.renderPage(page))
)

readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0)
@@ -134,9 +133,6 @@ module.exports = class Build extends EventEmitter {

async renderPage (page) {
const pagePath = decodeURIComponent(page.path)
readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0)
process.stdout.write(`Rendering page: ${pagePath}`)

// #565 Avoid duplicate description meta at SSR.
const meta = (page.frontmatter && page.frontmatter.meta || []).filter(item => item.name !== 'description')
12 changes: 6 additions & 6 deletions packages/@vuepress/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/core",
"version": "1.3.1",
"version": "1.4.0",
"description": "Minimalistic doc generator with Vue component based layout system",
"keywords": [
"documentation",
@@ -25,11 +25,11 @@
"dependencies": {
"@babel/core": "^7.8.4",
"@vue/babel-preset-app": "^4.1.2",
"@vuepress/markdown": "^1.3.1",
"@vuepress/markdown-loader": "^1.3.1",
"@vuepress/plugin-last-updated": "^1.3.1",
"@vuepress/plugin-register-components": "^1.3.1",
"@vuepress/shared-utils": "^1.3.1",
"@vuepress/markdown": "^1.4.0",
"@vuepress/markdown-loader": "^1.4.0",
"@vuepress/plugin-last-updated": "^1.4.0",
"@vuepress/plugin-register-components": "^1.4.0",
"@vuepress/shared-utils": "^1.4.0",
"autoprefixer": "^9.5.1",
"babel-loader": "^8.0.4",
"cache-loader": "^3.0.0",
4 changes: 2 additions & 2 deletions packages/@vuepress/markdown-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/markdown-loader",
"version": "1.3.1",
"version": "1.4.0",
"description": "markdown-loader for vuepress",
"keywords": [
"documentation",
@@ -21,7 +21,7 @@
"author": "Evan You",
"main": "index.js",
"dependencies": {
"@vuepress/markdown": "^1.3.1",
"@vuepress/markdown": "^1.4.0",
"loader-utils": "^1.1.0",
"lru-cache": "^5.1.1"
},
6 changes: 3 additions & 3 deletions packages/@vuepress/markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/markdown",
"version": "1.3.1",
"version": "1.4.0",
"description": "markdown for vuepress",
"keywords": [
"documentation",
@@ -22,7 +22,7 @@
"author": "Evan You",
"main": "index.js",
"dependencies": {
"@vuepress/shared-utils": "^1.3.1",
"@vuepress/shared-utils": "^1.4.0",
"markdown-it": "^8.4.1",
"markdown-it-anchor": "^5.0.2",
"markdown-it-chain": "^1.3.0",
@@ -31,7 +31,7 @@
"prismjs": "^1.13.0"
},
"devDependencies": {
"@vuepress/test-utils": "^1.3.1"
"@vuepress/test-utils": "^1.4.0"
},
"publishConfig": {
"access": "public"
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-active-header-links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-active-header-links",
"version": "1.3.1",
"version": "1.4.0",
"description": "active-header-links plugin for vuepress",
"keywords": [
"documentation",
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-back-to-top/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-back-to-top",
"version": "1.3.1",
"version": "1.4.0",
"description": "back-to-top plugin for vuepress",
"keywords": [
"documentation",
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-google-analytics",
"version": "1.3.1",
"version": "1.4.0",
"description": "google-analytics plugin for vuepress",
"keywords": [
"documentation",
8 changes: 4 additions & 4 deletions packages/@vuepress/plugin-last-updated/index.js
Original file line number Diff line number Diff line change
@@ -3,20 +3,20 @@ const spawn = require('cross-spawn')

module.exports = (options = {}, context) => ({
extendPageData ($page) {
const { transformer } = options
const { transformer, dateOptions } = options
const timestamp = getGitLastUpdatedTimeStamp($page._filePath)
const $lang = $page._computed.$lang
if (timestamp) {
const lastUpdated = typeof transformer === 'function'
? transformer(timestamp, $lang)
: defaultTransformer(timestamp, $lang)
: defaultTransformer(timestamp, $lang, dateOptions)
$page.lastUpdated = lastUpdated
}
}
})

function defaultTransformer (timestamp, lang) {
return new Date(timestamp).toLocaleString(lang)
function defaultTransformer (timestamp, lang, dateOptions) {
return new Date(timestamp).toLocaleString(lang, dateOptions)
}

function getGitLastUpdatedTimeStamp (filePath) {
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-last-updated/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-last-updated",
"version": "1.3.1",
"version": "1.4.0",
"description": "last-updated plugin for vuepress",
"keywords": [
"documentation",
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-medium-zoom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-medium-zoom",
"version": "1.3.1",
"version": "1.4.0",
"description": "medium-zoom plugin for vuepress",
"keywords": [
"documentation",
Loading