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.9.0
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.9.1
Choose a head ref
  • 6 commits
  • 27 files changed
  • 1 contributor

Commits on Dec 22, 2021

  1. chore(all): 1.9.0 changelog

    ulivz committed Dec 22, 2021
    Copy the full SHA
    b25ffe3 View commit details
  2. chore: changelog

    ulivz committed Dec 22, 2021
    Copy the full SHA
    0bb97b3 View commit details
  3. chore: changelog image

    ulivz committed Dec 22, 2021
    Copy the full SHA
    9897be0 View commit details
  4. Copy the full SHA
    eab6741 View commit details
  5. Copy the full SHA
    dd6e3ef View commit details
  6. build: release version 1.9.1

    ulivz committed Dec 22, 2021
    Copy the full SHA
    2ffd506 View commit details
Showing with 74 additions and 50 deletions.
  1. +1 −0 .commitlintrc.js
  2. +10 −0 CHANGELOG.md
  3. BIN {changelog-unpublished → changelog}/1.9/assets/1.9-lang.png
  4. BIN {changelog-unpublished → changelog}/1.9/assets/1.9-official-plugin-options.png
  5. BIN {changelog-unpublished → changelog}/1.9/assets/1.9-official-plugin-tuple-usage.png
  6. BIN {changelog-unpublished → changelog}/1.9/assets/1.9-overview.png
  7. +14 −8 {changelog-unpublished → changelog}/1.9/index.md
  8. +1 −1 lerna.json
  9. +6 −6 packages/@vuepress/core/package.json
  10. +2 −2 packages/@vuepress/markdown-loader/package.json
  11. +2 −2 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. +1 −1 packages/@vuepress/plugin-last-updated/package.json
  16. +1 −1 packages/@vuepress/plugin-medium-zoom/package.json
  17. +1 −1 packages/@vuepress/plugin-nprogress/package.json
  18. +2 −2 packages/@vuepress/plugin-pwa/package.json
  19. +2 −2 packages/@vuepress/plugin-register-components/package.json
  20. +1 −1 packages/@vuepress/plugin-search/package.json
  21. +1 −1 packages/@vuepress/shared-utils/package.json
  22. +3 −3 packages/@vuepress/test-utils/package.json
  23. +4 −4 packages/@vuepress/theme-default/package.json
  24. +2 −2 packages/@vuepress/theme-vue/package.json
  25. +7 −7 packages/docs/package.json
  26. +3 −3 packages/vuepress/package.json
  27. +7 −0 packages/vuepress/types/plugin.ts
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ const availableScopes = [
'all',
'cli',
'zh',
'types',
...vuepressPackages
]

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# [1.9.0](https://github.com/vuejs/vuepress/compare/v1.8.3...v1.9.0) (2021-12-22)


### Features

* Typescript Support for Config File ([#2973](https://github.com/vuejs/vuepress/issues/2973)) ([daa6404](https://github.com/vuejs/vuepress/commit/daa6404)) [@ULIVZ](https://github.com/ULIVZ)

> For more information please head [VuePress 1.9](./changelog/1.9/index.md).

## [1.8.3](https://github.com/vuejs/vuepress/compare/v1.8.2...v1.8.3) (2021-12-20)


File renamed without changes
File renamed without changes
22 changes: 14 additions & 8 deletions changelog-unpublished/1.9/index.md → changelog/1.9/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# TypeScript Support for Config file
# VuePress 1.9

## Overview

VuePress 1.9 introduced full TypeScript Support for Config File:

![](./assets/1.9-overview.png)

## Features
@@ -30,7 +32,7 @@ export default defineConfig({
});
```

### `Typed` Theme Config
### Type Inferences for `Theme`

By default, `defineConfig` helper leverages the theme config type from default theme:

@@ -65,18 +67,18 @@ export default defineConfig4CustomTheme<MyThemeConfig>(
},
```
### Type Inferences for Official Plugins
### Type Inferences for `Official Plugins`
From now, you’ll be able to enjoy the type prompt of the official plugins:
![](./assets/1.9-official-plugin-tuple-usage.png)
<p align="center">
<img src="./assets/1.9-official-plugin-tuple-usage.png" width="700">
</p>
Options of the official plugins certainly have type prompts, **Both [Tuple Style](https://vuepress.vuejs.org/plugin/using-a-plugin.html#plugin-options) and [Object Style](https://vuepress.vuejs.org/plugin/using-a-plugin.html#plugin-options), and [Plugin Shorthand](https://vuepress.vuejs.org/plugin/using-a-plugin.html#plugin-shorthand) support type inference**:
- Tuple Style:
![](./assets/1.9-official-plugin-options.png)
```ts
import { defineConfig } from 'vuepress/config'

@@ -92,6 +94,8 @@ export default defineConfig({
})
```
![](./assets/1.9-official-plugin-options.png)
- Object Style:
```ts
@@ -113,7 +117,9 @@ The illustration snapshot is omitted here, you can try it yourself.
Type inference supports [ISO Language Code](http://www.lingoes.net/en/translator/langcode.htm)
![](./assets/1.9-lang.png)
<p align="center">
<img src="./assets/1.9-lang.png" width="600">
</p>
### Context API
@@ -140,4 +146,4 @@ By default, only officially maintained and plugins under [VuePress Community](ht
## Credits
- [bundle-require](https://github.com/egoist/bundle-require) (by [@egoist](https://github.com/egoist)): we leverage it under the hood to resolve user's config, which is powered by `esbuild`.
- [vscode-ts-in-markdown](https://github.com/Amour1688/vscode-ts-in-markdown) (by [@Amour1688](https://github.com/Amour1688)): this documentation is powered by this plugin, which make type checking possible in markdown.
- [vscode-ts-in-markdown](https://github.com/Amour1688/vscode-ts-in-markdown) (by [@Amour1688](https://github.com/Amour1688)): this documentation is powered by this plugin, which makes type checking possible in markdown.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "1.9.0",
"version": "1.9.1",
"command": {
"version": {
"allowBranch": "master",
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.9.0",
"version": "1.9.1",
"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.9.0",
"@vuepress/markdown-loader": "1.9.0",
"@vuepress/plugin-last-updated": "1.9.0",
"@vuepress/plugin-register-components": "1.9.0",
"@vuepress/shared-utils": "1.9.0",
"@vuepress/markdown": "1.9.1",
"@vuepress/markdown-loader": "1.9.1",
"@vuepress/plugin-last-updated": "1.9.1",
"@vuepress/plugin-register-components": "1.9.1",
"@vuepress/shared-utils": "1.9.1",
"autoprefixer": "^9.5.1",
"babel-loader": "^8.0.4",
"bundle-require": "2.1.8",
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.9.0",
"version": "1.9.1",
"description": "markdown-loader for vuepress",
"keywords": [
"documentation",
@@ -21,7 +21,7 @@
"author": "Evan You",
"main": "index.js",
"dependencies": {
"@vuepress/markdown": "1.9.0",
"@vuepress/markdown": "1.9.1",
"loader-utils": "^1.1.0",
"lru-cache": "^5.1.1"
},
4 changes: 2 additions & 2 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.9.0",
"version": "1.9.1",
"description": "markdown for vuepress",
"keywords": [
"documentation",
@@ -22,7 +22,7 @@
"author": "Evan You",
"main": "index.js",
"dependencies": {
"@vuepress/shared-utils": "1.9.0",
"@vuepress/shared-utils": "1.9.1",
"markdown-it": "^8.4.1",
"markdown-it-anchor": "^5.0.2",
"markdown-it-chain": "^1.3.0",
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.9.0",
"version": "1.9.1",
"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.9.0",
"version": "1.9.1",
"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.9.0",
"version": "1.9.1",
"description": "google-analytics plugin for vuepress",
"keywords": [
"documentation",
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.9.0",
"version": "1.9.1",
"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.9.0",
"version": "1.9.1",
"description": "medium-zoom plugin for vuepress",
"keywords": [
"documentation",
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-nprogress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-nprogress",
"version": "1.9.0",
"version": "1.9.1",
"description": "nprogress plugin for vuepress",
"keywords": [
"documentation",
4 changes: 2 additions & 2 deletions packages/@vuepress/plugin-pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-pwa",
"version": "1.9.0",
"version": "1.9.1",
"description": "pwa plugin for vuepress",
"keywords": [
"documentation",
@@ -21,7 +21,7 @@
"author": "ULIVZ <chl814@foxmail.com>",
"main": "index.js",
"dependencies": {
"@vuepress/shared-utils": "1.9.0",
"@vuepress/shared-utils": "1.9.1",
"register-service-worker": "^1.7.0",
"workbox-build": "^4.3.1"
},
4 changes: 2 additions & 2 deletions packages/@vuepress/plugin-register-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-register-components",
"version": "1.9.0",
"version": "1.9.1",
"description": "register-global-components plugin for vuepress",
"keywords": [
"documentation",
@@ -21,7 +21,7 @@
"author": "ULIVZ <chl814@foxmail.com>",
"main": "index.js",
"dependencies": {
"@vuepress/shared-utils": "1.9.0"
"@vuepress/shared-utils": "1.9.1"
},
"publishConfig": {
"access": "public"
2 changes: 1 addition & 1 deletion packages/@vuepress/plugin-search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/plugin-search",
"version": "1.9.0",
"version": "1.9.1",
"description": "search plugin for vuepress",
"keywords": [
"documentation",
2 changes: 1 addition & 1 deletion packages/@vuepress/shared-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/shared-utils",
"version": "1.9.0",
"version": "1.9.1",
"description": "shared-utils for vuepress",
"keywords": [
"documentation",
6 changes: 3 additions & 3 deletions packages/@vuepress/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/test-utils",
"version": "1.9.0",
"version": "1.9.1",
"description": "test-utils for vuepress",
"keywords": [
"documentation",
@@ -25,8 +25,8 @@
"@babel/preset-env": "^7.0.0",
"@types/jest": "^24.0.9",
"@vue/test-utils": "^1.0.0-beta.29",
"@vuepress/core": "1.9.0",
"@vuepress/shared-utils": "1.9.0",
"@vuepress/core": "1.9.1",
"@vuepress/shared-utils": "1.9.1",
"babel-jest": "^24.7.1",
"execa": "^1.0.0",
"jest": "^24.7.1",
8 changes: 4 additions & 4 deletions packages/@vuepress/theme-default/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/theme-default",
"version": "1.9.0",
"version": "1.9.1",
"description": "Default theme for VuePress",
"keywords": [
"documentation",
@@ -21,9 +21,9 @@
"author": "Evan You",
"main": "index.js",
"dependencies": {
"@vuepress/plugin-active-header-links": "1.9.0",
"@vuepress/plugin-nprogress": "1.9.0",
"@vuepress/plugin-search": "1.9.0",
"@vuepress/plugin-active-header-links": "1.9.1",
"@vuepress/plugin-nprogress": "1.9.1",
"@vuepress/plugin-search": "1.9.1",
"docsearch.js": "^2.5.2",
"lodash": "^4.17.15",
"stylus": "^0.54.8",
4 changes: 2 additions & 2 deletions packages/@vuepress/theme-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/theme-vue",
"version": "1.9.0",
"version": "1.9.1",
"description": "VuePress theme for official Vue projects",
"keywords": [
"documentation",
@@ -21,7 +21,7 @@
"author": "Evan You",
"main": "index.js",
"dependencies": {
"@vuepress/theme-default": "1.9.0"
"@vuepress/theme-default": "1.9.1"
},
"publishConfig": {
"access": "public"
14 changes: 7 additions & 7 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "1.9.0",
"version": "1.9.1",
"private": true,
"description": "docs of VuePress",
"keywords": [
@@ -29,11 +29,11 @@
},
"devDependencies": {
"@textlint-rule/textlint-rule-no-unmatched-pair": "^1.0.7",
"@vuepress/plugin-back-to-top": "1.9.0",
"@vuepress/plugin-google-analytics": "1.9.0",
"@vuepress/plugin-medium-zoom": "1.9.0",
"@vuepress/plugin-pwa": "1.9.0",
"@vuepress/theme-vue": "1.9.0",
"@vuepress/plugin-back-to-top": "1.9.1",
"@vuepress/plugin-google-analytics": "1.9.1",
"@vuepress/plugin-medium-zoom": "1.9.1",
"@vuepress/plugin-pwa": "1.9.1",
"@vuepress/theme-vue": "1.9.1",
"remark-cli": "^9.0.0",
"remark-lint": "^6.0.5",
"remark-preset-lint-consistent": "^2.0.3",
@@ -48,7 +48,7 @@
"textlint-rule-terminology": "^2.1.4",
"textlint-rule-write-good": "^1.6.2",
"vue-toasted": "^1.1.25",
"vuepress": "1.9.0",
"vuepress": "1.9.1",
"vuepress-plugin-flowchart": "^1.4.2"
}
}
6 changes: 3 additions & 3 deletions packages/vuepress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuepress",
"version": "1.9.0",
"version": "1.9.1",
"description": "Minimalistic doc generator with Vue component based layout system",
"keywords": [
"documentation",
@@ -29,8 +29,8 @@
">1%"
],
"dependencies": {
"@vuepress/core": "1.9.0",
"@vuepress/theme-default": "1.9.0",
"@vuepress/core": "1.9.1",
"@vuepress/theme-default": "1.9.1",
"cac": "^6.5.6",
"envinfo": "^7.2.0",
"opencollective-postinstall": "^2.0.2",
7 changes: 7 additions & 0 deletions packages/vuepress/types/plugin.ts
Original file line number Diff line number Diff line change
@@ -42,13 +42,20 @@ export type KnownThirdPartyPluginTuple = {
[K in KnownThirdPartyPlugins]?: [K | ShortcutName4ThirdPartyPluginName<K>, AllowBoolean<Record<string, any>>?]
}[KnownThirdPartyPlugins];

/**
* Final plugin tuple
*/
export type PluginTuple =
| OfficialPluginName
| KnownThirdPartyPlugins
| ShortcutName4ThirdPartyPluginName<KnownThirdPartyPlugins>
| OfficialPluginTuple
| ThirdPartyPluginTuple
| KnownThirdPartyPluginTuple;

/**
* Object config
*/
export type PluginObject = Partial<PluginConfigMap>
& {
[T in OfficialPluginName as ShortcutName4OfficialPluginName<T>]?: PluginConfigMap[T]