Merge branch 'main' into fix/editlink

pull/697/head
Percy Ma 3 years ago committed by GitHub
commit 73c24bc06b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,7 @@
# [1.0.0-alpha.1](https://github.com/vuejs/vitepress/compare/v0.22.4...v1.0.0-alpha.1) (2022-06-01)
Complete rewrite on default theme, with bunch of features added. Please refer to the docs for the new feature and changes.
## [0.22.4](https://github.com/vuejs/vitepress/compare/v0.22.3...v0.22.4) (2022-05-06) ## [0.22.4](https://github.com/vuejs/vitepress/compare/v0.22.3...v0.22.4) (2022-05-06)
### Bug Fixes ### Bug Fixes

@ -16,9 +16,7 @@ export default defineConfig({
}, },
editLink: { editLink: {
domain: 'gitlab.com',
repo: 'vuejs/vitepress', repo: 'vuejs/vitepress',
branch: 'main',
dir: 'docs', dir: 'docs',
text: 'Edit this page on GitHub' text: 'Edit this page on GitHub'
}, },

@ -15,12 +15,12 @@ The essential file for configuring a VitePress site is `.vitepress/config.js`, w
```js ```js
export default { export default {
title: 'Hello VitePress', title: 'VitePress',
description: 'Just playing around.' description: 'Just playing around.'
} }
``` ```
In the above example, the site will have the title of `VitePress`, and `Just playing around` as description meta tag. In the above example, the site will have the title of `VitePress`, and `Just playing around.` as the description meta tag.
Learn everything about VitePress features at [Theme: Introduction](./theme-introduction) to find how to configure specific features with in this config file. Learn everything about VitePress features at [Theme: Introduction](./theme-introduction) to find how to configure specific features with in this config file.

@ -1,6 +1,6 @@
{ {
"name": "vitepress", "name": "vitepress",
"version": "1.0.0-draft.8", "version": "1.0.0-alpha.1",
"description": "Vite & Vue powered static site generator", "description": "Vite & Vue powered static site generator",
"type": "module", "type": "module",
"packageManager": "pnpm@7.1.7", "packageManager": "pnpm@7.1.7",

@ -1,15 +1,20 @@
import { readFileSync, writeFileSync } from 'fs' import { readFileSync, writeFileSync } from 'fs'
import { resolve } from 'path' import { resolve } from 'path'
import { fileURLToPath } from 'url'
import c from 'picocolors' import c from 'picocolors'
import { inc as _inc, valid } from 'semver'
import prompts from 'prompts' import prompts from 'prompts'
import { execa } from 'execa' import { execa } from 'execa'
import { version as currentVersion } from '../package.json' import semver from 'semver'
import { fileURLToPath } from 'url' import pkg from '../package.json' assert { type: 'json' }
const { version: currentVersion } = pkg
const { inc: _inc, valid } = semver
const versionIncrements = ['patch', 'minor', 'major'] const versionIncrements = ['patch', 'minor', 'major']
const dir = dirname(fileURLToPath(import.meta.url)) const tags = ['latest', 'next']
const dir = fileURLToPath(new URL('.', import.meta.url))
const inc = (i) => _inc(currentVersion, i) const inc = (i) => _inc(currentVersion, i)
const run = (bin, args, opts = {}) => const run = (bin, args, opts = {}) =>
execa(bin, args, { stdio: 'inherit', ...opts }) execa(bin, args, { stdio: 'inherit', ...opts })
@ -18,34 +23,45 @@ const step = (msg) => console.log(c.cyan(msg))
async function main() { async function main() {
let targetVersion let targetVersion
const versions = versionIncrements
.map((i) => `${i} (${inc(i)})`)
.concat(['custom'])
const { release } = await prompts({ const { release } = await prompts({
type: 'select', type: 'select',
name: 'release', name: 'release',
message: 'Select release type', message: 'Select release type',
choices: versionIncrements.map((i) => `${i} (${inc(i)})`).concat(['custom']) choices: versions
}) })
console.log(release, release === 3)
if (release === 'custom') { if (release === 3) {
targetVersion = ( targetVersion = (
await prompts({ await prompts({
type: 'input', type: 'text',
name: 'version', name: 'version',
message: 'Input custom version', message: 'Input custom version',
initial: currentVersion initial: currentVersion
}) })
).version ).version
} else { } else {
targetVersion = release.match(/\((.*)\)/)[1] targetVersion = versions[release].match(/\((.*)\)/)[1]
} }
if (!valid(targetVersion)) { if (!valid(targetVersion)) {
throw new Error(`Invalid target version: ${targetVersion}`) throw new Error(`Invalid target version: ${targetVersion}`)
} }
const { tag } = await prompts({
type: 'select',
name: 'tag',
message: 'Select tag type',
choices: tags
})
const { yes: tagOk } = await prompts({ const { yes: tagOk } = await prompts({
type: 'confirm', type: 'confirm',
name: 'yes', name: 'yes',
message: `Releasing v${targetVersion}. Confirm?` message: `Releasing v${targetVersion} on ${tags[tag]}. Confirm?`
}) })
if (!tagOk) { if (!tagOk) {
@ -83,7 +99,13 @@ async function main() {
// Publish the package. // Publish the package.
step('\nPublishing the package...') step('\nPublishing the package...')
await run('pnpm', ['publish', '--ignore-scripts', '--no-git-checks']) await run('pnpm', [
'publish',
'--tag',
tags[tag],
'--ignore-scripts',
'--no-git-checks'
])
// Push to GitHub. // Push to GitHub.
step('\nPushing to GitHub...') step('\nPushing to GitHub...')

Loading…
Cancel
Save