Skip to content

Commit

Permalink
website: build a document website using vite.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 20, 2023
1 parent 6b77c1b commit 4a01890
Show file tree
Hide file tree
Showing 23 changed files with 366 additions and 203 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ on:

jobs:
build-deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14

- run: npm i npm@7 -g
# - run: npm ci
node-version: 18
registry-url: 'https://registry.npmjs.org'

- run: npm install
# - run: npm run hoist
- run: npm run bootstrap
- run: npm run build
- run: npm run build:website
- run: npm run doc

- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@v1.3.4
uses: jaywcjlove/create-tag-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
package-path: ./core/package.json

- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@v1.4.8
uses: jaywcjlove/changelog-generator@main
if: steps.create_tag.outputs.successful
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -39,7 +39,7 @@ jobs:
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'

- name: Create Release
uses: jaywcjlove/create-tag-action@v1.3.4
uses: jaywcjlove/create-tag-action@main
with:
package-path: ./core/package.json
release: true
Expand All @@ -54,7 +54,10 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/dist

- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./core/package.json
- run: npm publish --access public --provenance
name: 📦 @vue-monorepo-template/base publish to NPM
continue-on-error: true
working-directory: packages/base
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

./node_modules/.bin/pretty-quick --staged
npx --no-install lint-staged
5 changes: 5 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
}
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@
"private": true,
"scripts": {
"prepare": "husky install",
"start": "lerna exec \"npm run serve\" --scope website",
"build:website": "lerna exec \"npm run build\" --scope website",
"build": "lerna exec \"tsbb build --use-vue\" --scope @uivjs/*",
"watch": "lerna exec \"tsbb watch --use-vue\" --scope @uivjs/vue-layout",
"start": "lerna exec \"npm run dev\" --scope website",
"doc": "lerna exec \"npm run build\" --scope website",
"preview": "lerna exec \"npm run preview\" --scope website",
"build": "lerna exec \"tsbb build \"src/*.{tsx,ts}\" --use-babel --use-vue\" --scope @uivjs/*",
"watch": "lerna exec \"tsbb watch \"src/*.{tsx,ts}\" --use-babel --use-vue\" --scope @uivjs/vue-layout",
"prettier": "prettier --write \"**/*.{js,jsx,vue,tsx,ts,less,md,json}\"",
"version": "lerna version --exact --force-publish --no-push --no-git-tag-version",
"clean": "lerna clean --yes",
"hoist": "lerna bootstrap --hoist",
"bootstrap": "lerna bootstrap --force-local --no-ci"
"clean": "lerna clean --yes"
},
"author": "jaywcjlove",
"license": "MIT",
"devDependencies": {
"husky": "7.0.4",
"prettier": "2.5.1",
"pretty-quick": "3.1.2",
"lerna": "4.0.0",
"tsbb": "^3.5.0"
}
"husky": "^8.0.3",
"lerna": "^7.4.1",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"tsbb": "^4.2.3"
},
"workspaces": [
"website",
"packages/*"
]
}
2 changes: 0 additions & 2 deletions website/.eslintignore

This file was deleted.

23 changes: 12 additions & 11 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.vscode
.DS_Store
*.suo
*.ntvs*
*.njsproj
Expand Down
19 changes: 18 additions & 1 deletion website/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
Documentation site for [@uivjs/vue-layout](https://uivjs.github.io/vue-layout).
# Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support For `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
1. Run `Extensions: Show Built-in Extensions` from VSCode's command palette
2. Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
3 changes: 0 additions & 3 deletions website/babel.config.js

This file was deleted.

21 changes: 21 additions & 0 deletions website/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Monorepo Template</title>
<link rel="icon" type="image/svg+xml" href="/src/assets/vue.svg" />
<meta
name="keywords"
content="uivjs,vue,monorepo,template,react.js,react,component,components,ui,framework,toolkit"
/>
<meta
name="description"
content="Simple Vue 3 package development project example template."
/>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
62 changes: 15 additions & 47 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,25 @@
"name": "website",
"version": "1.1.0",
"private": true,
"type": "module",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"map": "source-map-explorer dist/js/*.js --html dist/dependencies.html"
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@uivjs/vue-github-corners": "1.0.0",
"@uivjs/vue-layout": "1.1.0",
"@uivjs/vue-markdown-preview": "0.2.1",
"core-js": "^3.6.5",
"vue": "^3.0.0"
"@uivjs/vue-github-corners": "^1.0.0",
"@uivjs/vue-markdown-preview": "^1.0.4",
"vue": "^3.3.4"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
"raw-loader": "4.0.2",
"source-map-explorer": "2.5.2"
},
"keywords": [
"layout",
"vue-layout",
"uivjs",
"vue",
"vue3"
],
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {
"no-debugger": "off"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
"@vitejs/plugin-vue": "^4.2.3",
"rollup-plugin-visualizer": "^5.9.2",
"typescript": "^5.0.2",
"vite": "^4.4.5",
"vite-plugin-md": "^0.22.5",
"vite-raw-plugin": "^1.0.2",
"vue-tsc": "^1.8.5"
}
}
Binary file removed website/public/favicon.ico
Binary file not shown.
25 changes: 0 additions & 25 deletions website/public/index.html

This file was deleted.

1 change: 1 addition & 0 deletions website/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4a01890

Please sign in to comment.