Skip to content

Commit dab6e1c

Browse files
authored
Merge branch 'develop' into update-routerMode-docs
2 parents 61c9e4b + 4d560c0 commit dab6e1c

File tree

115 files changed

+18639
-31230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+18639
-31230
lines changed

.codesandbox/ci.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ build
44
docs
55
lib
66
node_modules
7-
packages/docsify-server-renderer/build.js
87
server.js
98
themes

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const prettierConfig = require('./.prettierrc');
1+
const prettierConfig = require('./.prettierrc.json');
22

33
module.exports = {
44
root: true,
@@ -63,7 +63,6 @@ module.exports = {
6363
yoda: ['error', 'never'],
6464

6565
// Import rules
66-
// Search way how integrate with `lerna`
6766
'import/imports-first': ['error'],
6867
'import/newline-after-import': ['error'],
6968
'import/no-duplicates': ['error'],

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: npm # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
open-pull-requests-limit: 10
11+
schedule:
12+
interval: "weekly"
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
open-pull-requests-limit: 10
16+
schedule:
17+
interval: monthly

.github/workflows/test.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Build & Test
22

3-
on:
4-
push:
5-
branches: [master, develop]
6-
pull_request:
7-
branches: [master, develop]
3+
on: [push]
84

95
jobs:
106
lint:
@@ -13,9 +9,9 @@ jobs:
139
matrix:
1410
node-version: ['lts/*']
1511
steps:
16-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1713
- name: Setup Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v2
14+
uses: actions/setup-node@v3
1915
with:
2016
node-version: ${{ matrix.node-version }}
2117
cache: 'npm'
@@ -26,10 +22,6 @@ jobs:
2622
- name: Lint
2723
run: npm run lint
2824

29-
- name: Verify dependencies [server-renderer]
30-
working-directory: ./packages/docsify-server-renderer
31-
run: npm ci --ignore-scripts
32-
3325
test-jest:
3426
runs-on: ${{ matrix.os }}
3527
strategy:
@@ -38,9 +30,9 @@ jobs:
3830
node-version: ['lts/*']
3931
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
4032
steps:
41-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v3
4234
- name: Setup Node.js ${{ matrix.node-version }}
43-
uses: actions/setup-node@v2
35+
uses: actions/setup-node@v3
4436
with:
4537
node-version: ${{ matrix.node-version }}
4638
cache: 'npm'
@@ -59,9 +51,9 @@ jobs:
5951
matrix:
6052
node-version: ['lts/*']
6153
steps:
62-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
6355
- name: Setup Node.js ${{ matrix.node-version }}
64-
uses: actions/setup-node@v2
56+
uses: actions/setup-node@v3
6557
with:
6658
node-version: ${{ matrix.node-version }}
6759
cache: 'npm'
@@ -74,7 +66,7 @@ jobs:
7466
- name: E2E Tests (Playwright)
7567
run: npm run test:e2e
7668
- name: Store artifacts
77-
uses: actions/upload-artifact@v2
69+
uses: actions/upload-artifact@v3
7870
if: failure()
7971
with:
8072
name: ${{ matrix.os }}-${{ matrix.node-version }}-artifacts

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.eslintignore
2-
.eslintrc
2+
.eslintrc.cjs
33
.github
44
.gitignore
5-
.travis.yml

.prettierrc.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"arrowParens": "avoid",
3+
"singleQuote": true
4+
}

.vscode/launch.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
{
88
"type": "node",
99
"request": "launch",
10-
"name": "Run tests",
10+
"name": "Run unit tests",
1111
"runtimeExecutable": "npm",
12-
"runtimeArgs": ["run-script", "test"],
12+
"runtimeArgs": ["test"],
1313
"console": "integratedTerminal"
1414
},
1515
{
1616
"type": "node",
1717
"request": "launch",
1818
"name": "Run current test file",
19-
"runtimeExecutable": "npm",
20-
"runtimeArgs": ["run-script", "test"],
21-
"args": ["--", "-i", "${relativeFile}", "--testPathIgnorePatterns"],
19+
"runtimeExecutable": "npx",
20+
"runtimeArgs": ["jest"],
21+
"args": ["-i", "${relativeFile}", "--testPathIgnorePatterns"],
2222
"console": "integratedTerminal"
2323
},
2424
{
@@ -41,10 +41,9 @@
4141
"type": "node",
4242
"request": "launch",
4343
"name": "Update current test file snapshot(s)",
44-
"runtimeExecutable": "npm",
45-
"runtimeArgs": ["run-script", "test"],
44+
"runtimeExecutable": "npx",
45+
"runtimeArgs": ["jest"],
4646
"args": [
47-
"--",
4847
"-i",
4948
"${relativeFile}",
5049
"--updateSnapshot",
@@ -56,8 +55,8 @@
5655
"type": "node",
5756
"request": "launch",
5857
"name": "Update selected test name snapshot(s)",
59-
"runtimeExecutable": "npm",
60-
"runtimeArgs": ["run-script", "test"],
58+
"runtimeExecutable": "npx",
59+
"runtimeArgs": ["jest"],
6160
"args": [
6261
"--",
6362
"-i",

CONTRIBUTING.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
First, thank you for considering contributing to docsify! It's people like you that make the open source community such a great community! 😊
66

7-
We welcome any type of contribution, not only code. You can help with
7+
We welcome any type of contribution, not only code. You can help with
8+
89
- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
910
- **Marketing**: writing blog posts, howto's, printing stickers, ...
1011
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
@@ -13,12 +14,50 @@ We welcome any type of contribution, not only code. You can help with
1314

1415
## Your First Contribution
1516

16-
Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
17+
Working on your first Pull Request ever? You can learn how from this _free_ series, [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
18+
19+
## Online one-click setup for Contributing
20+
21+
You can use Gitpod (a free online VS Code-like IDE) for contributing. With a single click it'll launch a workspace and automatically:
22+
23+
- clone the docsify repo.
24+
- install the dependencies.
25+
- start `npm run dev`.
26+
27+
```bash
28+
npm install && npm run dev
29+
```
30+
31+
So that you can start straight away.
32+
33+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/docsifyjs/docsify)
34+
35+
- Fork it!
36+
- Create your feature branch: `git checkout -b my-new-feature`
37+
- Commit your changes: `git add . && git commit -m 'Add some feature'`
38+
- Push to the branch: `git push origin my-new-feature`
39+
- Submit a pull request
1740

1841
## Submitting code
1942

2043
Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.
2144

45+
## Testing
46+
47+
Ensure that things work by running:
48+
49+
```sh
50+
npm test
51+
```
52+
53+
## Test Snapshots
54+
55+
If a snapshot fails, or to add new snapshots, run:
56+
57+
```sh
58+
npx jest --updateSnapshot
59+
```
60+
2261
## Code review process
2362

2463
The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge.
@@ -41,14 +80,12 @@ You can also reach us at hello@docsify.opencollective.com.
4180
Thank you to all the people who have already contributed to docsify!
4281
<a href="graphs/contributors"><img src="https://opencollective.com/docsify/contributors.svg?width=890" /></a>
4382

44-
4583
### Backers
4684

4785
Thank you to all our backers! [[Become a backer](https://opencollective.com/docsify#backer)]
4886

4987
<a href="https://opencollective.com/docsify#backers" target="_blank"><img src="https://opencollective.com/docsify/backers.svg?width=890"></a>
5088

51-
5289
### Sponsors
5390

5491
Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/docsify#sponsor))

README.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
- [`develop` branch preview](https://docsify-preview.vercel.app/)
3333
- [Documentation](https://docsify.js.org)
3434
- [CLI](https://github.com/docsifyjs/docsify-cli)
35-
- CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify)
35+
- CDN:
36+
- [UNPKG](https://unpkg.com/docsify/)
37+
- [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/)
38+
- [cdnjs](https://cdnjs.com/libraries/docsify)
3639
- [Awesome docsify](https://github.com/docsifyjs/awesome-docsify)
3740
- [Community chat](https://discord.gg/3NwKFyR)
3841

@@ -44,7 +47,6 @@
4447
- Multiple themes
4548
- Useful plugin API
4649
- Compatible with IE11
47-
- Experimental SSR support ([example](https://github.com/docsifyjs/docsify-ssr-demo))
4850
- Support embedded files
4951

5052
## Quick start
@@ -63,34 +65,14 @@ Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify#showcase)
6365

6466
| Project | Description |
6567
| ------------------------------------------------ | ---------------------------------------- |
66-
| [docute](https://github.com/egoist/docute) | 📜 Effortlessly documentation done right |
67-
| [docpress](https://github.com/docpress/docpress) | Documentation website generator |
68+
| [Docusaurus](https://docusaurus.io) | Docusaurus makes it easy to maintain Open Source documentation websites |
69+
| [GitBook](https://www.gitbook.com) | Where technical teams document |
70+
| [MkDocs](https://www.mkdocs.org) | Project documentation with Markdown |
71+
| [VuePress](https://vuepress.vuejs.org) | Vue-powered Static Site Generator |
6872

6973
## Contributing
7074

71-
### Online one-click setup for Contributing
72-
73-
You can use Gitpod (a free online VS Code-like IDE) for contributing. With a single click it'll launch a workspace and automatically:
74-
75-
- clone the docsify repo.
76-
- install the dependencies.
77-
- start `npm run dev`.
78-
79-
So that you can start straight away.
80-
81-
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/docsifyjs/docsify)
82-
83-
- Fork it!
84-
- Create your feature branch: `git checkout -b my-new-feature`
85-
- Commit your changes: `git add . && git commit -m 'Add some feature'`
86-
- Push to the branch: `git push origin my-new-feature`
87-
- Submit a pull request
88-
89-
## Development
90-
91-
```bash
92-
npm run bootstrap && npm run dev
93-
```
75+
See [CONTRIBUTING.md](./CONTRIBUTING.md).
9476

9577
## Backers
9678

babel.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

babel.config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"node": "current"
8+
}
9+
}
10+
]
11+
]
12+
}

build/build.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
const rollup = require('rollup')
2-
const buble = require('rollup-plugin-buble')
3-
const commonjs = require('rollup-plugin-commonjs')
4-
const nodeResolve = require('rollup-plugin-node-resolve')
5-
const { uglify } = require('rollup-plugin-uglify')
6-
const replace = require('rollup-plugin-replace')
7-
const isProd = process.env.NODE_ENV === 'production'
8-
const version = process.env.VERSION || require('../package.json').version
9-
const chokidar = require('chokidar')
10-
const path = require('path')
1+
import * as rollup from 'rollup';
2+
import commonjs from '@rollup/plugin-commonjs';
3+
import nodeResolve from '@rollup/plugin-node-resolve';
4+
import uglify from '@rollup/plugin-terser';
5+
import replace from '@rollup/plugin-replace';
6+
import chokidar from 'chokidar';
7+
import path from 'path';
8+
import { relative } from './util.js';
9+
import { promises as fs } from 'fs';
10+
11+
const pkgPath = relative(import.meta, '..', 'package.json');
12+
const pkgString = (await fs.readFile(pkgPath)).toString();
13+
const pkg = JSON.parse(pkgString);
14+
const isProd = process.env.NODE_ENV === 'production';
15+
const version = process.env.VERSION || pkg.version;
1116

1217
/**
1318
* @param {{
@@ -22,15 +27,10 @@ async function build(opts) {
2227
.rollup({
2328
input: opts.input,
2429
plugins: (opts.plugins || []).concat([
25-
buble({
26-
transforms: {
27-
dangerousForOf: true
28-
}}),
2930
commonjs(),
3031
nodeResolve(),
3132
replace({
3233
__VERSION__: version,
33-
'process.env.SSR': false
3434
})
3535
]),
3636
onwarn: function (message) {
@@ -80,6 +80,7 @@ async function buildAllPlugin() {
8080
var plugins = [
8181
{name: 'search', input: 'search/index.js'},
8282
{name: 'ga', input: 'ga.js'},
83+
{name: 'gtag', input: 'gtag.js'},
8384
{name: 'matomo', input: 'matomo.js'},
8485
{name: 'emoji', input: 'emoji.js'},
8586
{name: 'external-script', input: 'external-script.js'},

0 commit comments

Comments
 (0)