docs: split docs package for vuepress (#12382)

* docs: split docs package for vuepress

* fix: yarn lock changes gha

* fix: remove npm script at top level

* docs: update oneclick link

refs: https://github.blog/changelog/2023-04-24-one-click-into-github-codespaces
This commit is contained in:
Tony 2023-04-25 18:20:56 +04:00 committed by GitHub
parent 71f65a51fe
commit b0ff4a0fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 10006 additions and 7453 deletions

View File

@ -39,10 +39,10 @@
"onCreateCommand": "sudo apt-get update && export DEBIAN_FRONTEND=noninteractive && sudo apt-get -y install --no-install-recommends ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 wget xdg-utils redis-server && sudo apt-get autoremove -y && sudo apt-get clean -y && sudo rm -rf /var/lib/apt/lists/*",
"updateContentCommand": "yarn",
"updateContentCommand": "yarn && yarn --cwd docs",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn",
"postCreateCommand": "yarn && yarn --cwd docs",
// Disable auto start dev env since codespaces sometimes fails to attach to the terminal
// "postAttachCommand": {

View File

@ -37,6 +37,31 @@ updates:
- dependency-name: unified
versions: ['>=10.0.0']
- package-ecosystem: npm
directory: '/docs'
schedule:
interval: daily
time: '21:00'
open-pull-requests-limit: 10
labels:
- dependencies
ignore:
# ESM only packages
- dependency-name: remark
versions: ['>=14.0.0']
- dependency-name: remark-frontmatter
versions: ['>=4.0.0']
- dependency-name: remark-gfm
versions: ['>=2.0.0']
- dependency-name: remark-parse
versions: ['>=10.0.0']
- dependency-name: remark-preset-prettier
versions: ['>=1.0.0']
- dependency-name: remark-stringify
versions: ['>=10.0.0']
- dependency-name: string-width
versions: ['>=5.0.0']
- package-ecosystem: 'github-actions'
directory: '/'
schedule:

View File

@ -1,8 +1,11 @@
on:
pull_request: {}
pull_request_target:
branches:
- master
paths:
- .github/workflows/semgrep.yml
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
@ -13,7 +16,7 @@ name: Semgrep
jobs:
semgrep:
name: Scan
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:

View File

@ -118,6 +118,9 @@ jobs:
fail-fast: false
matrix:
node-version: [ 16, 18 ]
defaults:
run:
working-directory: docs
name: Build docs on Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
@ -125,14 +128,15 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: docs/yarn.lock
- run: yarn
- name: Set environment variable for Node v18
if: ${{ matrix.node-version == '18' }}
- name: Set environment variable for Node v16 above
if: ${{ matrix.node-version > '16' }}
run: echo "NODE_OPTIONS=--openssl-legacy-provider" >> $GITHUB_ENV
- name: Build docs
run: npm run docs:build
- name: Unset environment variable for Node v18
if: ${{ matrix.node-version == '18' }}
- name: Unset environment variable for Node v16 above
if: ${{ matrix.node-version > '16' }}
run: echo "NODE_OPTIONS=''" >> $GITHUB_ENV
all:

View File

@ -4,6 +4,7 @@ on:
paths:
- '.github/workflows/yarn-lock-changes.yml'
- 'yarn.lock'
- 'docs/yarn.lock'
jobs:
yarn_lock_changes:

View File

@ -14,7 +14,7 @@ tasks:
sudo apt update
sudo apt install -y ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 wget xdg-util
sudo apt install -y redis-server
init: yarn
init: yarn && yarn --cwd docs
- name: app
command: yarn dev
openMode: tab-after

View File

@ -32,7 +32,7 @@ To speed up the development process and make it easier to keep your code clean,
If you don't want to install Node.js and a code editor on your computer, you can use a cloud-hosted development environment. You may use [GitHub Codespaces](https://codespace.new/) or [Gitpod](https://www.gitpod.io). Just click one of the buttons below to start a new workspace:
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=master&repo=127769231&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=SouthEastAsia)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/DIYgod/RSSHub?quickstart=1)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/DIYgod/RSSHub)

View File

@ -134,7 +134,7 @@ All templates should be placed in the namespace's `templates` folder with the `.
Here's an example taken from the [furstar](https://github.com/DIYgod/RSSHub/blob/master/lib/v2/furstar) namespace:
<<< @/lib/v2/furstar/templates/author.art
<<< @/../lib/v2/furstar/templates/author.art
```js
const path = require('path');

View File

@ -32,7 +32,7 @@
如果您不想在计算机上安装 Node.js 和代码编辑器,您可以使用云托管的开发环境。您可以使用 [GitHub Codespaces](https://codespace.new) 或 [Gitpod](https://www.gitpod.io)。只需点击以下按钮即可启动新的工作区:
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=master&repo=127769231&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=SouthEastAsia)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/DIYgod/RSSHub?quickstart=1)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/DIYgod/RSSHub)

View File

@ -133,7 +133,7 @@ RSSHub 会将所有路由命名空间的文件夹名附加到路由前面。路
下面是在 [furstar](https://github.com/DIYgod/RSSHub/blob/master/lib/v2/furstar) 命名空间中示例:
<<< @/lib/v2/furstar/templates/author.art
<<< @/../lib/v2/furstar/templates/author.art
<!-- markdownlint-disable MD046 -->

38
docs/package.json Normal file
View File

@ -0,0 +1,38 @@
{
"name": "docs.rsshub.app",
"version": "1.0.0",
"private": true,
"description": "docs for rsshub",
"homepage": "https://github.com/DIYgod/RSSHub#readme",
"bugs": {
"url": "https://github.com/DIYgod/RSSHub/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/DIYgod/RSSHub/tree/master/docs"
},
"license": "MIT",
"author": "DIYgod",
"scripts": {
"docs:build": "vuepress build .",
"docs:dev": "vuepress dev ."
},
"dependencies": {
"@napi-rs/pinyin": "1.7.1",
"@vuepress/plugin-back-to-top": "1.9.9",
"@vuepress/plugin-google-analytics": "1.9.9",
"@vuepress/plugin-pwa": "1.9.9",
"@vuepress/shared-utils": "1.9.9",
"markdown-it": "13.0.1",
"remark": "13.0.0",
"remark-frontmatter": "3.0.0",
"remark-gfm": "1.0.0",
"remark-pangu": "2.2.0",
"remark-preset-prettier": "0.5.1",
"remark-stringify": "9.0.1",
"string-width": "4.2.3",
"vuepress": "1.9.9",
"vuepress-plugin-meilisearch": "0.13.0",
"vuepress-plugin-sitemap": "2.3.1"
}
}

9532
docs/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,92 +2,76 @@
"name": "rsshub",
"version": "1.0.0",
"description": "Make RSS Great Again!",
"main": "lib/pkg.js",
"files": [
"lib"
"keywords": [
"RSS"
],
"scripts": {
"start": "node lib/index.js",
"dev": "cross-env NODE_ENV=dev nodemon --inspect lib/index.js",
"profiling": "NODE_ENV=production node --prof lib/index.js",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"build:all": "npm run build:radar && npm run build:maintainer",
"build:radar": "node scripts/workflow/build-radar.js",
"build:maintainer": "node scripts/workflow/build-maintainer.js",
"lint": "eslint .",
"format": "eslint \"**/*.{js,yml}\" --fix && node docs/.format/format.js && prettier \"**/*.{js,json}\" --write",
"format:staged": "eslint \"**/*.{js,yml}\" --fix && node docs/.format/format.js --staged && pretty-quick --staged --verbose --pattern \"**/*.{js,json}\"",
"format:check": "eslint \"**/*.{js,yml}\" && prettier-check \"**/*.{js,json}\"",
"jest": "cross-env NODE_ENV=test jest --runInBand --forceExit --detectOpenHandles",
"jest:coverage": "cross-env NODE_ENV=test jest --coverage --reporters=default --reporters=jest-junit --runInBand --forceExit --detectOpenHandles",
"jest:watch": "cross-env NODE_ENV=test jest --watch",
"test": "npm run format:check && npm run jest:coverage"
},
"reporters": [
"default",
"jest-junit"
],
"jest-junit": {
"outputDirectory": "coverage"
"homepage": "https://github.com/DIYgod/RSSHub#readme",
"bugs": {
"url": "https://github.com/DIYgod/RSSHub/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/DIYgod/RSSHub.git"
},
"keywords": [
"RSS"
],
"gitHooks": {
"pre-commit": "npm run format:staged"
},
"author": "DIYgod",
"license": "MIT",
"bugs": {
"url": "https://github.com/DIYgod/RSSHub/issues"
"author": "DIYgod",
"main": "lib/pkg.js",
"files": [
"lib"
],
"scripts": {
"build:all": "npm run build:radar && npm run build:maintainer",
"build:maintainer": "node scripts/workflow/build-maintainer.js",
"build:radar": "node scripts/workflow/build-radar.js",
"dev": "cross-env NODE_ENV=dev nodemon --inspect lib/index.js",
"format": "eslint \"**/*.{js,yml}\" --fix && node docs/.format/format.js && prettier \"**/*.{js,json}\" --write",
"format:check": "eslint \"**/*.{js,yml}\" && prettier-check \"**/*.{js,json}\"",
"format:staged": "eslint \"**/*.{js,yml}\" --fix && node docs/.format/format.js --staged && pretty-quick --staged --verbose --pattern \"**/*.{js,json}\"",
"jest": "cross-env NODE_ENV=test jest --runInBand --forceExit --detectOpenHandles",
"jest:coverage": "cross-env NODE_ENV=test jest --coverage --reporters=default --reporters=jest-junit --runInBand --forceExit --detectOpenHandles",
"jest:watch": "cross-env NODE_ENV=test jest --watch",
"lint": "eslint .",
"profiling": "NODE_ENV=production node --prof lib/index.js",
"start": "node lib/index.js",
"test": "npm run format:check && npm run jest:coverage"
},
"homepage": "https://github.com/DIYgod/RSSHub#readme",
"devDependencies": {
"@microsoft/eslint-formatter-sarif": "3.0.0",
"@napi-rs/pinyin": "1.7.1",
"@types/koa": "2.13.6",
"@vercel/nft": "0.22.6",
"@vuepress/plugin-back-to-top": "1.9.9",
"@vuepress/plugin-google-analytics": "1.9.9",
"@vuepress/plugin-pwa": "1.9.9",
"@vuepress/shared-utils": "1.9.9",
"cross-env": "7.0.3",
"eslint": "8.39.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-yml": "1.5.0",
"fs-extra": "11.1.1",
"jest": "29.5.0",
"jest-junit": "16.0.0",
"meilisearch": "0.32.3",
"mockdate": "3.0.5",
"nock": "13.3.0",
"nodemon": "2.0.22",
"prettier": "2.8.8",
"prettier-check": "2.0.0",
"pretty-quick": "3.1.3",
"remark": "13.0.0",
"remark-frontmatter": "3.0.0",
"remark-gfm": "1.0.0",
"remark-pangu": "2.2.0",
"remark-parse": "9.0.0",
"remark-preset-prettier": "0.5.1",
"remark-stringify": "9.0.1",
"request-promise-native": "1.0.9",
"staged-git-files": "1.3.0",
"string-width": "4.2.3",
"supertest": "6.3.3",
"tosource": "2.0.0-alpha.3",
"unified": "9.2.2",
"vuepress": "1.9.9",
"vuepress-plugin-meilisearch": "0.13.0",
"vuepress-plugin-sitemap": "2.3.1",
"yorkie": "2.0.0"
"nodemonConfig": {
"ext": "art,js,mjs,json",
"watch": [
".env",
"lib",
"test"
]
},
"jest": {
"bail": true,
"collectCoverageFrom": [
"lib/**/*.js",
"!lib/routes/**/*.js",
"!lib/v2/**/*.js",
"!lib/router.js",
"!lib/maintainer.js",
"!lib/radar.js",
"!lib/radar-rules.js"
],
"coverageReporters": [
"text-summary",
"lcov"
],
"moduleNameMapper": {
"@/(.*)": "<rootDir>/lib/$1"
},
"testEnvironment": "node",
"testMatch": [
"**/test/**/*.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/lib/"
]
},
"jest-junit": {
"outputDirectory": "coverage"
},
"dependencies": {
"@koa/router": "12.0.0",
@ -150,42 +134,47 @@
"winston": "3.8.2",
"xml2js": "0.5.0"
},
"jest": {
"testMatch": [
"**/test/**/*.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/lib/"
],
"coverageReporters": [
"text-summary",
"lcov"
],
"collectCoverageFrom": [
"lib/**/*.js",
"!lib/routes/**/*.js",
"!lib/v2/**/*.js",
"!lib/router.js",
"!lib/maintainer.js",
"!lib/radar.js",
"!lib/radar-rules.js"
],
"bail": true,
"testEnvironment": "node",
"moduleNameMapper": {
"@/(.*)": "<rootDir>/lib/$1"
}
},
"nodemonConfig": {
"watch": [
".env",
"lib",
"test"
],
"ext": "art,js,mjs,json"
"devDependencies": {
"@microsoft/eslint-formatter-sarif": "3.0.0",
"@types/koa": "2.13.6",
"@vercel/nft": "0.22.6",
"cross-env": "7.0.3",
"eslint": "8.39.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-yml": "1.5.0",
"fs-extra": "11.1.1",
"jest": "29.5.0",
"jest-junit": "16.0.0",
"mockdate": "3.0.5",
"nock": "13.3.0",
"nodemon": "2.0.22",
"prettier": "2.8.7",
"prettier-check": "2.0.0",
"pretty-quick": "3.1.3",
"remark": "13.0.0",
"remark-frontmatter": "3.0.0",
"remark-gfm": "1.0.0",
"remark-pangu": "2.2.0",
"remark-parse": "9.0.0",
"remark-preset-prettier": "0.5.1",
"remark-stringify": "9.0.1",
"request-promise-native": "1.0.9",
"staged-git-files": "1.3.0",
"string-width": "4.2.3",
"supertest": "6.3.3",
"tosource": "2.0.0-alpha.3",
"unified": "9.2.2",
"yorkie": "2.0.0"
},
"engines": {
"node": ">=16"
}
},
"gitHooks": {
"pre-commit": "npm run format:staged"
},
"reporters": [
"default",
"jest-junit"
]
}

7613
yarn.lock

File diff suppressed because it is too large Load Diff