Skip to content

Commit c7b9244

Browse files
committed
tada: init
0 parents  commit c7b9244

Some content is hidden

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

58 files changed

+15745
-0
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
coverage
3+
.vscode
4+
.circleci

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true
6+
},
7+
extends: [
8+
"eslint-config-2o3t"
9+
],
10+
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @zyao89

.github/workflows/coveralls.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Coveralls
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- develop
7+
jobs:
8+
install-and-coveralls:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
15+
- name: Cache node modules
16+
uses: actions/cache@v1
17+
with:
18+
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
19+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
20+
restore-keys: |
21+
${{ runner.os }}-build-${{ env.cache-name }}-
22+
${{ runner.os }}-build-
23+
${{ runner.os }}-
24+
25+
- name: install
26+
run: yarn --network-timeout 600000
27+
28+
- name: yarn add coveralls
29+
run: |
30+
yarn add -D coveralls
31+
yarn run test --coverage && cat ./coverage/lcov.info
32+
33+
- name: Coveralls
34+
uses: coverallsapp/github-action@master
35+
with:
36+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build and Deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build-and-deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@master
12+
13+
- name: Install
14+
run: npm install
15+
16+
- name: Build
17+
run: npm run-script build
18+
env:
19+
GAID: ${{ secrets.GAID }}
20+
GITHUB_CLIENT_ID: ${{ secrets.GITHUB_CLIENT_ID }}
21+
GITHUB_CLIENT_SECRET: ${{ secrets.GITHUB_CLIENT_SECRET }}
22+
23+
- name: Deploy
24+
run: npm run-script deploy
25+
env:
26+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

.gitignore

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# TypeScript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
62+
# parcel-bundler cache (https://parceljs.org/)
63+
.cache
64+
65+
# next.js build output
66+
.next
67+
68+
# nuxt.js build output
69+
.nuxt
70+
71+
# Nuxt generate
72+
dist
73+
74+
# vuepress build output
75+
.vuepress/dist
76+
77+
# Serverless directories
78+
.serverless
79+
80+
# IDE
81+
.idea
82+
83+
.vscode
84+
*.suo
85+
*.ntvs*
86+
*.njsproj
87+
*.sln
88+
*.sw*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019-present, Zyao89
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Micro APP - VuePress
2+
3+
[CLI] adapter vuepress.
4+
5+
[![Github Actions Coveralls][Github-Actions-Coveralls]][Github-Actions-Coveralls-url]
6+
[![Coverage Status][Coverage-img]][Coverage-url]
7+
[![NPM Version][npm-img]][npm-url]
8+
[![NPM Download][download-img]][download-url]
9+
10+
[Github-Actions-Coveralls]: https://github.com/MicroAppJS/vuepress/workflows/Coveralls/badge.svg
11+
[Github-Actions-Coveralls-url]: https://github.com/MicroAppJS/vuepress
12+
[Coverage-img]: https://coveralls.io/repos/github/MicroAppJS/vuepress/badge.svg?branch=master
13+
[Coverage-url]: https://coveralls.io/github/MicroAppJS/vuepress?branch=master
14+
[npm-img]: https://img.shields.io/npm/v/@micro-app/vuepress.svg?style=flat-square
15+
[npm-url]: https://npmjs.org/package/@micro-app/vuepress
16+
[download-img]: https://img.shields.io/npm/dm/@micro-app/vuepress.svg?style=flat-square
17+
[download-url]: https://npmjs.org/package/@micro-app/vuepress
18+
19+
## Install
20+
21+
```sh
22+
yarn add @micro-app/vuepress
23+
```
24+
25+
or
26+
27+
```sh
28+
npm install -D @micro-app/vuepress
29+
```
30+
31+
## Usage
32+
33+
### 在项目 `根目录``micro-app.config.js` 文件中配置
34+
35+
> 请确保你的 Node.js 版本 >= 8.6。
36+
37+
```bash
38+
# 安装 vuepress plugin
39+
yarn add -D @micro-app/vuepress # 或者:npm install -D @micro-app/vuepress
40+
41+
# 新建一个 docs 文件夹
42+
mkdir docs
43+
44+
# 新建一个 markdown 文件
45+
echo '# Hello MicroApp VuePress!' > docs/README.md
46+
47+
# 开始写作
48+
npx micro-app-vuepress dev docs
49+
```
50+
51+
### 创建 `micro-app.vuepress.config.js` 文件, 并如下配置
52+
53+
```js
54+
{ // temp demo
55+
title: 'Micro App',
56+
sourceDir: 'docs',
57+
sidebar: {
58+
...
59+
},
60+
nav: [],
61+
locales: {
62+
'/': {
63+
lang: 'zh-CN',
64+
description: '🔌 多模块可插拔插件的微应用框架',
65+
label: '简体中文',
66+
selectText: '选择语言',
67+
lastUpdated: '上次编辑时间',
68+
repoLabel: '查看源码',
69+
editLinkText: '在 GitHub 上编辑此页',
70+
},
71+
'/en/': {
72+
lang: 'en-US',
73+
description: '🔌 Pluggable Micro Application Framework',
74+
label: 'English',
75+
selectText: 'Languages',
76+
lastUpdated: 'Last Updated',
77+
repoLabel: 'View Code',
78+
editLinkText: 'Edit this page on GitHub',
79+
},
80+
},
81+
// 假定是 GitHub. 同时也可以是一个完整的 GitLab URL
82+
repo: 'MicroAppJS/MicroApp-Core',
83+
// 自定义仓库链接文字。默认从 `themeConfig.repo` 中自动推断为
84+
// "GitHub"/"GitLab"/"Bitbucket" 其中之一,或是 "Source"。
85+
// repoLabel: '查看源码',
86+
// 假如你的文档仓库和项目本身不在一个仓库:
87+
// docsRepo: 'MicroAppJS/MicroApp-Core',
88+
// 假如文档不是放在仓库的根目录下:
89+
docsDir: 'docs',
90+
// 假如文档放在一个特定的分支下:
91+
docsBranch: 'master',
92+
// 默认是 false, 设置为 true 来启用
93+
editLinks: true,
94+
// 默认为 "Edit this page"
95+
// editLinkText: '帮助我们改善此页面!',
96+
sidebarDepth: 3,
97+
// algolia: {
98+
// indexName: "cli_vuejs",
99+
// apiKey: "f6df220f7d246aff64a56300b7f19f21"
100+
// },
101+
// search: false,
102+
// searchMaxSuggestions: 10,
103+
// displayAllHeaders: true // 默认值:false
104+
}
105+
```

bin/micro-app-vuepress

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
const yParser = require('yargs-parser');
5+
const argv = yParser(process.argv.slice(2));
6+
7+
const { createService } = require('@micro-app/cli');
8+
const service = createService(argv);
9+
service.registerPlugin({
10+
id: '@micro-app/plugin-vuepress',
11+
});
12+
13+
service.run('vuepress', argv);

0 commit comments

Comments
 (0)