mirror of
https://github.com/142vip/408CSFamily.git
synced 2026-04-24 02:30:36 +08:00
Merge branch 'next' into feat/add-permalink
# Conflicts: # .markdownlint.js
This commit is contained in:
@@ -1 +1,4 @@
|
||||
node_modules
|
||||
node_modules
|
||||
.idea
|
||||
.github
|
||||
.husky
|
||||
6
.github/workflows/CD.yaml
vendored
6
.github/workflows/CD.yaml
vendored
@@ -58,6 +58,12 @@ jobs:
|
||||
run: |
|
||||
./scripts/bundle build_proxy
|
||||
|
||||
# 将README.md同步,利于github pages分支展示
|
||||
- name: Add Readme.md To Dist
|
||||
run: |
|
||||
cp -f README.md docs/.vuepress/dist
|
||||
|
||||
|
||||
- name: Check GitHub Pages status
|
||||
uses: crazy-max/ghaction-github-status@v3
|
||||
with:
|
||||
|
||||
2
.github/workflows/CI.yml
vendored
2
.github/workflows/CI.yml
vendored
@@ -65,7 +65,7 @@ jobs:
|
||||
|
||||
- name: Code LintFix
|
||||
run: |
|
||||
./scripts/lint --fix
|
||||
./scripts/lint
|
||||
|
||||
- name: Build Site
|
||||
run: |
|
||||
|
||||
80
.gitignore
vendored
80
.gitignore
vendored
@@ -1,75 +1,39 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.vscode
|
||||
.vscode/*
|
||||
*/.DS_Store
|
||||
.DS_Store
|
||||
*/.vscode
|
||||
.idea
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# docs
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
*.lcov
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.git
|
||||
.vscode
|
||||
.env
|
||||
.DS_Store
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
# Next.js build output
|
||||
.next
|
||||
.nuxt
|
||||
dist
|
||||
lib
|
||||
es
|
||||
_site
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
/coverage
|
||||
|
||||
# useless files
|
||||
templete
|
||||
/docs/.vuepress/.temp/
|
||||
/docs/.vuepress/.cache/
|
||||
# Gatsby files
|
||||
.cache/
|
||||
# vuepress build output
|
||||
# .vuepress/dist
|
||||
docs/.vuepress/.cache/
|
||||
docs/.vuepress/.temp/
|
||||
docs/.vuepress/dist/
|
||||
# TernJS port file
|
||||
.tern-port
|
||||
/.husky/
|
||||
.vercel
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// 参考:https://github.com/updownpress/markdown-lint/tree/master/rules
|
||||
// 参考:<https://github.com/updownpress/markdown-lint/tree/master/rules>
|
||||
module.exports = {
|
||||
"default": true,
|
||||
"MD001": false,
|
||||
@@ -69,4 +69,4 @@ module.exports = {
|
||||
"MD042": false,
|
||||
"MD046": false,
|
||||
"MD049": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
**/node_modules/**
|
||||
CHANGELOG.md
|
||||
LICENSE
|
||||
.idea
|
||||
.husky
|
||||
.github
|
||||
20
CHANGELOG.md
20
CHANGELOG.md
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file. See [Conven
|
||||
|
||||
<!-- #region recent-alpha -->
|
||||
|
||||
## [0.0.1-alpha.8](https://github.com/142vip/408CSFamily/compare/v0.0.1-alpha.7...v0.0.1-alpha.8) (2023-10-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **CI:** 新增codeql流水线 ([9202226](https://github.com/142vip/408CSFamily/commit/92022260251fda3aa5458d9a35de0eca35f02d93))
|
||||
* **gh-pages:** 丰富pages站点的提交信息,实时同步next分支内容 ([1c8f54c](https://github.com/142vip/408CSFamily/commit/1c8f54cc34375792c63005d753ddadcb8603c8fe))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **CI:** 修复镜像构建时ci版本异常 ([b5be536](https://github.com/142vip/408CSFamily/commit/b5be53605a74249e6ddb0557774a18e1c220119e))
|
||||
* **CI:** 修改release执行条件,next分支触发 ([86f0594](https://github.com/142vip/408CSFamily/commit/86f0594c4e5ccec4906857cc9bdba822ecd6066f))
|
||||
* **scripts:** 优化deploy脚本,修复镜像构建异常 ([07f16f7](https://github.com/142vip/408CSFamily/commit/07f16f72cf63e443c25e3d07c19659c7daf917dc))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **CI:** 简化流水线校验流程 ([15a69a2](https://github.com/142vip/408CSFamily/commit/15a69a2c943f63b2b5f86acae599c9373c4c5ff6))
|
||||
|
||||
## [0.0.1-alpha.7](https://github.com/142vip/408CSFamily/compare/v0.0.1-alpha.6...v0.0.1-alpha.7) (2023-10-26)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "408CSFamily",
|
||||
"description": "专业代号408,计算机基础知识点合集",
|
||||
"version": "0.0.1-alpha.7",
|
||||
"version": "0.0.1-alpha.8",
|
||||
"packageManager": "pnpm@8.9.2",
|
||||
"engines": {
|
||||
"node": "^18.x",
|
||||
@@ -15,7 +15,7 @@
|
||||
"scripts": {
|
||||
"preinstall": "chmod +x ./scripts/*",
|
||||
"postinstall": "npm run build:mark-map",
|
||||
"prepare": "rm -f .husky/pre-commit && husky install && npx husky add .husky/pre-commit \"./scripts/lint --fix\" && chmod +x .husky/pre-commit",
|
||||
"prepare": "rm -f .husky/pre-commit && husky install && npx husky add .husky/pre-commit \"./scripts/lint\" && chmod +x .husky/pre-commit",
|
||||
"dev": "vuepress dev docs",
|
||||
"build": "./scripts/bundle build",
|
||||
"build:proxy": "./scripts/bundle build_proxy",
|
||||
|
||||
@@ -37,4 +37,3 @@ fi
|
||||
|
||||
# 安装项目依赖
|
||||
pnpm i --frozen-lockfile --registry https://registry.npmmirror.com
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* - ./scripts/deploy ali
|
||||
* - ./scripts/deploy github
|
||||
*/
|
||||
const { execShell } = require('./.exec')
|
||||
const {execShell} = require('./.exec')
|
||||
const packageVersion = require('../package.json').version
|
||||
|
||||
const dockerDeployInfo = {
|
||||
@@ -31,8 +31,8 @@ const SupportScripts = {
|
||||
cd -
|
||||
`,
|
||||
Ali: [
|
||||
// 容器存在即删除
|
||||
`
|
||||
// 容器存在即删除
|
||||
`
|
||||
if docker inspect --format='{{.State.Running}}' ${dockerDeployInfo.containerName} >/dev/null 2>&1;then
|
||||
docker rm -f ${dockerDeployInfo.containerName}
|
||||
exit 0;
|
||||
@@ -41,9 +41,9 @@ const SupportScripts = {
|
||||
exit 1;
|
||||
fi
|
||||
`,
|
||||
// 镜像存在即删除
|
||||
`
|
||||
if [[ "$(docker images -q ${imageName} 2> /dev/null)" != "" ]];then
|
||||
// 镜像存在即删除
|
||||
`
|
||||
if [ "$(docker images -q ${imageName} 2> /dev/null)" != "" ];then
|
||||
docker rmi ${imageName}
|
||||
exit 0;
|
||||
else
|
||||
@@ -51,8 +51,8 @@ const SupportScripts = {
|
||||
exit 1;
|
||||
fi
|
||||
`,
|
||||
// 运行容器
|
||||
`
|
||||
// 运行容器
|
||||
`
|
||||
docker run -d --name ${dockerDeployInfo.containerName} \
|
||||
-p 7000:80 \
|
||||
--network=${dockerDeployInfo.networkName} \
|
||||
@@ -82,7 +82,7 @@ function getDeployCommand() {
|
||||
|
||||
|
||||
// 执行
|
||||
;(async() => {
|
||||
;(async () => {
|
||||
const deployCommand = getDeployCommand()
|
||||
// console.log(deployCommand)
|
||||
await execShell(deployCommand)
|
||||
|
||||
37
scripts/lint
37
scripts/lint
@@ -1,25 +1,22 @@
|
||||
#!/usr/bin/env node
|
||||
#!/bin/bash
|
||||
|
||||
/**
|
||||
*
|
||||
* 格式化代码
|
||||
* 例如:
|
||||
* - ./scripts/lint
|
||||
* - ./scripts/lint --fix
|
||||
*/
|
||||
##
|
||||
## 自动格式化
|
||||
## - 代码
|
||||
## - markdown文档
|
||||
## 使用:
|
||||
# - ./scripts/lint
|
||||
## 参考链接:
|
||||
## - https://eslint.org/docs/latest/use/getting-started
|
||||
## - https://github.com/igorshubovych/markdownlint-cli
|
||||
##
|
||||
|
||||
const {execShell} = require('./.exec')
|
||||
const scriptName = process.argv[2]
|
||||
const fixed = scriptName != null ? '--fix' : '';
|
||||
# 设置 PATH 环境变量,避免command not found问题
|
||||
export PATH="$(pnpm bin):$PATH"
|
||||
|
||||
// 格式化代码
|
||||
const lintCode = `eslint ${fixed} --ext .js,.ts,.vue --ignore-path .gitignore .`;
|
||||
# ESLint格式化代码
|
||||
eslint --fix --ext .js,.ts,.vue --ignore-path .gitignore .
|
||||
|
||||
// 遍历格式化docs目录下的markdown 文档
|
||||
const lintMd = 'find docs -type f -name \"*.md\" -print0 | xargs -0 -I {} markdownlint -c .markdownlint.js --fix {}';
|
||||
# markdown-cli格式化markdown 文档
|
||||
markdownlint '**/*.md' -c .markdownlint.js -p .markdownlintignore --fix
|
||||
|
||||
// 可以在--fix后指定目录
|
||||
(async () => await execShell([
|
||||
lintCode,
|
||||
lintMd
|
||||
]))()
|
||||
|
||||
Reference in New Issue
Block a user