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: vuepress/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0-rc.1
Choose a base ref
...
head repository: vuepress/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.0-rc.2
Choose a head ref
  • 6 commits
  • 27 files changed
  • 2 contributors

Commits on Jan 24, 2024

  1. docs: fix changelog

    meteorlxy committed Jan 24, 2024
    Copy the full SHA
    8b5eed3 View commit details

Commits on Jan 25, 2024

  1. Copy the full SHA
    8518798 View commit details
  2. Copy the full SHA
    76dd90c View commit details

Commits on Jan 26, 2024

  1. fix(bundler-vite): add vuepress to client packages list (#1473)

    Co-authored-by: meteorlxy <meteor.lxy@foxmail.com>
    Mister-Hope and meteorlxy authored Jan 26, 2024
    Copy the full SHA
    5771dbb View commit details
  2. Copy the full SHA
    6f95b7a View commit details
  3. build: publish v2.0.0-rc.2

    meteorlxy committed Jan 26, 2024
    Copy the full SHA
    3b5ec7a View commit details
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@ module.exports = {
{
files: ['**/e2e/**/*.cy.ts', '**/e2e/cypress/**/*.ts'],
extends: 'plugin:cypress/recommended',
rules: {
'@typescript-eslint/no-namespace': 'off',
},
},
{
files: ['**/tests/**/*.ts', 'tsup.config.ts'],
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -64,13 +64,15 @@ jobs:
env:
E2E_BASE: ${{ matrix.base }}
E2E_BUNDLER: ${{ matrix.bundler }}
E2E_COMMAND: dev

- name: E2E build
working-directory: ./e2e
run: pnpm e2e:ci:build
env:
E2E_BASE: ${{ matrix.base }}
E2E_BUNDLER: ${{ matrix.bundler }}
E2E_COMMAND: build

e2e-result:
if: ${{ always() }}
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm commitlint --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# [2.0.0-rc.2](https://github.com/vuepress/core/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2024-01-26)


### Bug Fixes

* **bundler-vite:** add vuepress to client packages list ([#1473](https://github.com/vuepress/core/issues/1473)) ([5771dbb](https://github.com/vuepress/core/commit/5771dbbba5415d7da6c0344034f573a2b70fe66d))



# [2.0.0-rc.1](https://github.com/vuepress/core/compare/v2.0.0-rc.0...v2.0.0-rc.1) (2024-01-24)


@@ -6,7 +15,7 @@
* **bundler-vite:** serve assets with absolute path in dev server correctly (close [#1442](https://github.com/vuepress/core/issues/1442)) ([d0b4062](https://github.com/vuepress/core/commit/d0b4062d1975403f85504958bd9e87d9f35fb88e))
* **client:** avoid updating existing head tags (close [#1268](https://github.com/vuepress/core/issues/1268)) ([#1314](https://github.com/vuepress/core/issues/1314)) ([bfbab28](https://github.com/vuepress/core/commit/bfbab2803ec090f80a287484a037b1f6e4a9827b))
* **client:** merge locales head correctly ([2fe35bb](https://github.com/vuepress/core/commit/2fe35bb3a358b59d2b14b4bcae7eb644768e80ba))
* **markdown:** use non-greedy matching when parsing attributes [#1469](https://github.com/vuepress/core/issues/1469) ([91d8e3d](https://github.com/vuepress/core/commit/91d8e3d91962a8c06b648bdadbe239be113d5d42))
* **markdown:** use non-greedy matching when parsing attributes ([#1469](https://github.com/vuepress/core/issues/1469)) ([91d8e3d](https://github.com/vuepress/core/commit/91d8e3d91962a8c06b648bdadbe239be113d5d42))


### Features
@@ -25,8 +34,6 @@
### BREAKING CHANGES

* **vuepress:** `vuepress-vite` and `vuepress-webpack` packages have been removed, and the corresponding commands have been moved to `vuepress` package. With `vuepress` command, you need to install bundler package and set bundler in config file manually. With `vuepress-vite` and `vuepress-webpack` command, you still need to install bundler package, but you can omit bundler option in config file.

Co-authored-by: meteorlxy <meteor.lxy@foxmail.com>
* **markdown:** the default permalink function of markdown-it-anchor has been changed from `ariaHidden` to `headerLink` for better accessibility, which would be a potential breaking change for theme authors
* **markdown:** bump to markdown-it 14

1 change: 1 addition & 0 deletions e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -7,5 +7,6 @@ export default defineConfig({
},
env: {
E2E_BASE: process.env.E2E_BASE ?? '/',
E2E_COMMAND: process.env.E2E_COMMAND ?? 'dev',
},
})
34 changes: 30 additions & 4 deletions e2e/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
const URL_PREFIX = Cypress.env('E2E_BASE').replace(/\/$/, '')

// override the default cy.visit command to prepend base
// @ts-expect-error: could not type this method correctly
Cypress.Commands.overwrite('visit', (originalFn, url, options) =>
// @ts-expect-error: could not type this method correctly
originalFn(`${URL_PREFIX}${url}`, options),
Cypress.Commands.overwrite('visit', (originalFn, ...args) => {
// cy.visit(url, options)
if (typeof args[0] === 'string') {
// @ts-expect-error: could not type this correctly
return originalFn(`${URL_PREFIX}${args[0]}`, args[1])
}

// cy.visit(options)
return originalFn({
...args[0],
url: `${URL_PREFIX}${args[0].url}`,
})
})

// add a custom request command to prepend base
Cypress.Commands.add('requestWithBase', (url, options) =>
cy.request(`${URL_PREFIX}${url}`, options),
)

declare global {
namespace Cypress {
interface Chainable {
requestWithBase: <T = any>(
url: string,
options?: Partial<Cypress.RequestOptions>,
) => Chainable<Cypress.Response<T>>
}
}
}

export {}
5 changes: 5 additions & 0 deletions e2e/docs/imports/conditional-exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script setup>
import str from '@vuepress-e2e/conditional-exports'
</script>

{{ str }}
1 change: 1 addition & 0 deletions e2e/modules/conditional-exports/browser.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'browser-mjs'
1 change: 1 addition & 0 deletions e2e/modules/conditional-exports/node.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'node-cjs'
1 change: 1 addition & 0 deletions e2e/modules/conditional-exports/node.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 'node-mjs'
19 changes: 19 additions & 0 deletions e2e/modules/conditional-exports/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@vuepress-e2e/conditional-exports",
"type": "module",
"exports": {
".": {
"types": "./types.d.ts",
"browser": "./browser.mjs",
"node": "./node.mjs",
"module": "./node.mjs",
"import": "./node.mjs",
"require": "./node.cjs",
"default": "./node.cjs"
},
"./*": "./*"
},
"main": "cjs.js",
"module": "esm.js",
"types": "types.d.ts"
}
2 changes: 2 additions & 0 deletions e2e/modules/conditional-exports/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const str: string
export default str
12 changes: 7 additions & 5 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"name": "@vuepress/e2e",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"private": true,
"type": "module",
"scripts": {
"e2e:build": "vuepress build docs --clean-cache --clean-temp",
"e2e:build-webpack": "E2E_BUNDLER=webpack pnpm e2e:build",
"e2e:build": "cross-env E2E_COMMAND=build vuepress build docs --clean-cache --clean-temp",
"e2e:build-webpack": "cross-env E2E_BUNDLER=webpack pnpm e2e:build",
"e2e:ci:build": "pnpm e2e:build && start-server-and-test e2e:serve http-get://localhost:9080 e2e:run",
"e2e:ci:dev": "start-server-and-test e2e:dev http-get://127.0.0.1:9080 e2e:run",
"e2e:clean": "rimraf docs/.vuepress/.temp docs/.vuepress/.cache docs/.vuepress/dist",
"e2e:dev": "vuepress dev docs --clean-cache --clean-temp",
"e2e:dev-webpack": "E2E_BUNDLER=webpack pnpm e2e:dev",
"e2e:dev": "cross-env E2E_COMMAND=dev vuepress dev docs --clean-cache --clean-temp",
"e2e:dev-webpack": "cross-env E2E_BUNDLER=webpack pnpm e2e:dev",
"e2e:open": "cypress open",
"e2e:run": "cypress run",
"e2e:serve": "anywhere -s -h localhost -p 9080 -d docs/.vuepress/dist"
},
"dependencies": {
"@vuepress-e2e/conditional-exports": "file:./modules/conditional-exports",
"@vuepress/bundler-vite": "workspace:*",
"@vuepress/bundler-webpack": "workspace:*",
"sass": "^1.70.0",
@@ -25,6 +26,7 @@
},
"devDependencies": {
"anywhere": "^1.6.0",
"cross-env": "^7.0.3",
"cypress": "^13.6.3",
"process": "^0.11.10",
"start-server-and-test": "^2.0.3"
13 changes: 13 additions & 0 deletions e2e/tests/imports/conditional-exports.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
it('should support visiting non-ASCII paths directly', () => {
const E2E_COMMAND = Cypress.env('E2E_COMMAND')

cy.visit('/imports/conditional-exports.html')

cy.get('.e2e-theme-content p').should('have.text', 'browser-mjs')

if (E2E_COMMAND === 'build') {
cy.requestWithBase('/imports/conditional-exports.html')
.its('body')
.should('include', '<p>node-mjs</p>')
}
})
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/monorepo",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"private": true,
"type": "module",
"scripts": {
@@ -9,7 +9,7 @@
"format": "prettier --write .",
"lint": "eslint --ext .cjs,.js,.ts,.vue . && prettier --check .",
"lint:fix": "eslint --fix --ext .cjs,.js,.ts,.vue . && prettier --write .",
"prepare": "husky install",
"prepare": "husky",
"release": "pnpm release:check && pnpm release:e2e && pnpm release:version && pnpm release:publish",
"release:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"release:check": "pnpm lint && pnpm clean && pnpm build && pnpm test",
@@ -26,8 +26,8 @@
},
"prettier": "prettier-config-vuepress",
"devDependencies": {
"@commitlint/cli": "^18.5.0",
"@commitlint/config-conventional": "^18.5.0",
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@types/node": "^20.11.6",
"@types/webpack-env": "^1.18.4",
"@vitest/coverage-istanbul": "^1.2.1",
@@ -37,7 +37,7 @@
"eslint-config-vuepress": "^4.10.0",
"eslint-config-vuepress-typescript": "^4.10.0",
"eslint-plugin-cypress": "^2.15.1",
"husky": "^8.0.3",
"husky": "^9.0.6",
"lint-staged": "^15.2.0",
"prettier": "^3.2.4",
"prettier-config-vuepress": "^4.4.0",
2 changes: 1 addition & 1 deletion packages/bundler-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/bundler-vite",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Bundler vite package of VuePress",
"keywords": [
"vuepress-bundler",
2 changes: 2 additions & 0 deletions packages/bundler-vite/src/plugins/vuepressMainPlugin.ts
Original file line number Diff line number Diff line change
@@ -43,7 +43,9 @@ import 'vuepress/client-app'
// which should not be optimized in dev mode, and should not be
// externalized in build ssr mode
const clientPackages = [
// although discouraged, but users may still use `@vuepress/client` directly
'@vuepress/client',
'vuepress',
...app.pluginApi.plugins
// the 'user-config' plugin is created by cli internally
.filter(({ name }) => name !== 'user-config')
4 changes: 2 additions & 2 deletions packages/bundler-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/bundler-webpack",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Bundler webpack package of VuePress",
"keywords": [
"vuepress-bundler",
@@ -57,7 +57,7 @@
"vue": "^3.4.15",
"vue-loader": "^17.4.2",
"vue-router": "^4.2.5",
"webpack": "^5.89.0",
"webpack": "^5.90.0",
"webpack-chain": "^6.5.1",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0"
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/cli",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "CLI package of VuePress",
"keywords": [
"vuepress",
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/client",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Client package of VuePress",
"keywords": [
"vuepress",
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/core",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Core package of VuePress",
"keywords": [
"vuepress",
2 changes: 1 addition & 1 deletion packages/markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/markdown",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Markdown package of VuePress",
"keywords": [
"vuepress",
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/shared",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Utils that shared between VuePress node and client",
"keywords": [
"vuepress",
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vuepress/utils",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Utils package of VuePress",
"keywords": [
"vuepress",
2 changes: 1 addition & 1 deletion packages/vuepress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuepress",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.2",
"description": "Vue-powered Static Site Generator",
"keywords": [
"documentation",
Loading