pack: separate documentation build script from root package.json to docs directory root
This commit is contained in:
1 parent
47d27ee7ca
commit
a3b554fa8f
19 files changed
+1145
-28
No files matched your search
@@ -1,7 +1,6 @@
|
||||
node_modules/
|
||||
buildAssets/
|
||||
dist/
|
||||
distDocs/
|
||||
release/
|
||||
docs/
|
||||
|
||||
|
||||
@@ -15,18 +15,21 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
working_directory: ./docs
|
||||
with:
|
||||
# fetch all commits to get last updated time or other git log info
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
working_directory: ./docs
|
||||
with:
|
||||
node-version: '18'
|
||||
|
||||
# cache node_modules
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
working_directory: ./docs
|
||||
id: npm-cache
|
||||
with:
|
||||
path: |
|
||||
@@ -37,19 +40,16 @@ jobs:
|
||||
# install dependencies if the cache did not hit
|
||||
- name: Install dependencies
|
||||
if: steps.npm-cache.outputs.cache-hit != 'true'
|
||||
working_directory: ./docs
|
||||
run: npm i
|
||||
|
||||
# install for document build
|
||||
- name: Install for document dependencies
|
||||
run: npm run docs:install
|
||||
|
||||
# copy and replace string index.md file
|
||||
- name: Copy and replace string index.md file
|
||||
run: cp README.md docs/index.md
|
||||
run: cp README.md docs/src/index.md
|
||||
- name: Copy image asset (logo)
|
||||
run: cp src/renderer/public/images/vutron-logo.webp docs/public
|
||||
run: cp src/renderer/public/images/vutron-logo.webp docs/src/public
|
||||
- name: Copy image asset (sample)
|
||||
run: cp .github/resources/vutron-sample.webp docs/public
|
||||
run: cp .github/resources/vutron-sample.webp docs/src/public
|
||||
|
||||
- name: Find and Replace (logo)
|
||||
uses: jacobtomlinson/gha-find-replace@v2
|
||||
@@ -67,7 +67,8 @@ jobs:
|
||||
|
||||
# run build script
|
||||
- name: Build VitePress site
|
||||
run: npm run docs:build
|
||||
working_directory: ./docs
|
||||
run: npm run build
|
||||
|
||||
# please check out the docs of the workflow for more details
|
||||
# @see https://github.com/crazy-max/ghaction-github-pages
|
||||
@@ -77,7 +78,7 @@ jobs:
|
||||
# deploy to gh-pages branch
|
||||
target_branch: gh-pages
|
||||
# deploy the default output dir of VitePress
|
||||
build_dir: distDocs
|
||||
build_dir: docs/dist
|
||||
jekyll: false
|
||||
fqdn: 'vutron.jooy2.com'
|
||||
env:
|
||||
|
||||
@@ -28,14 +28,6 @@ TEST*.xml
|
||||
# Generated by Windows
|
||||
Thumbs.db
|
||||
|
||||
# VitePress files
|
||||
/distDocs
|
||||
/distDocs/*
|
||||
/docs/.vitepress/.temp
|
||||
/docs/.vitepress/.temp/*
|
||||
/docs/.vitepress/.cache
|
||||
/docs/.vitepress/.cache/*
|
||||
|
||||
# Applications
|
||||
*.app
|
||||
*.exe
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@
|
||||
.github/
|
||||
buildAssets/
|
||||
dist/
|
||||
distDocs/
|
||||
docs/dist/
|
||||
release/
|
||||
@@ -0,0 +1,10 @@
|
||||
# Node artifact files
|
||||
node_modules/
|
||||
|
||||
# VitePress files
|
||||
dist
|
||||
dist/*
|
||||
src/.vitepress/.temp
|
||||
src/.vitepress/.temp/*
|
||||
src/.vitepress/cache
|
||||
src/.vitepress/cache/*
|
||||
Generated
+1103
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "docs",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"install": "npm i --no-save vitepress vitepress-sidebar",
|
||||
"dev": "vitepress dev src",
|
||||
"build": "vitepress build src",
|
||||
"serve": "vitepress serve src"
|
||||
},
|
||||
"author": "jooy2 <jooy2.contact@gmail.com>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"vitepress": "^1.0.0-alpha.50",
|
||||
"vitepress-sidebar": "^1.2.0",
|
||||
"vue": "^3.2.47"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,20 @@
|
||||
// @ts-ignore
|
||||
import { generateSidebar } from 'vitepress-sidebar'
|
||||
import { name, description, repository } from '../../package.json'
|
||||
import { name, description, repository } from '../../../package.json'
|
||||
|
||||
const capitalizeFirst = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1)
|
||||
|
||||
export default {
|
||||
title: capitalizeFirst(name),
|
||||
description,
|
||||
outDir: '../distDocs',
|
||||
outDir: '../dist',
|
||||
head: [
|
||||
['link', { rel: 'icon', href: '/logo.png' }],
|
||||
['link', { rel: 'shortcut icon', href: '/favicon.ico' }]
|
||||
],
|
||||
themeConfig: {
|
||||
sidebar: generateSidebar({
|
||||
root: 'docs',
|
||||
collapsible: false,
|
||||
root: 'src',
|
||||
collapsed: false,
|
||||
useTitleFromFileHeading: true,
|
||||
sortByFileName: [
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-5
@@ -27,11 +27,7 @@
|
||||
"lint": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter src",
|
||||
"lint:fix": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
|
||||
"format": "prettier .",
|
||||
"format:fix": "prettier . --write",
|
||||
"docs:install": "npm i --no-save vitepress vitepress-sidebar",
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "npm run format:fix && vitepress build docs",
|
||||
"docs:serve": "npm run docs:build && vitepress serve docs"
|
||||
"format:fix": "prettier . --write"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|
||||
Reference in new issue
Block a user