Skip to content

Commit 37d8bd2

Browse files
committed
chore: initial commit for umi@3's offical plugins
1 parent 967db5b commit 37d8bd2

Some content is hidden

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

101 files changed

+13341
-1534
lines changed

.circleci/config.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/node:latest-browsers
6+
7+
working_directory: ~/repo
8+
9+
steps:
10+
- checkout
11+
12+
- restore_cache:
13+
key: node-modules-{{ checksum "yarn.json" }}
14+
15+
- run:
16+
name: Install Dependencies
17+
command: yarn --frozen-lockfile
18+
19+
- save_cache:
20+
key: node-modules-{{ checksum "yarn.lock" }}
21+
paths:
22+
- ./node_modules
23+
- ~/.cache/yarn
24+
25+
- run:
26+
name: Run Build
27+
command: yarn build
28+
29+
- run:
30+
name: Run Tests
31+
command: yarn test:coverage -- --forceExit --detectOpenHandles --runInBand --maxWorkers=2
32+
no_output_timeout: 300m
33+
34+
- run:
35+
name: Generate coverage
36+
command: bash <(curl -s https://codecov.io/bash)

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
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
14+
15+
[Makefile]
16+
indent_style = tab

.fatherrc.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { readdirSync } from 'fs';
2+
import { join } from 'path';
3+
4+
// utils must build before core
5+
// runtime must build before renderer-react
6+
const headPkgs = ['utils', 'runtime', 'core', 'server'];
7+
const tailPkgs = readdirSync(join(__dirname, 'packages')).filter(
8+
pkg => pkg.charAt(0) !== '.' && !headPkgs.includes(pkg),
9+
);
10+
11+
export default {
12+
target: 'node',
13+
cjs: { type: 'babel', lazy: true },
14+
disableTypeCheck: true,
15+
pkgs: [...headPkgs, ...tailPkgs],
16+
};

.github/workflows/ci.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
node_version: [8.x, 10.x, 12.x]
11+
os: [ubuntu-latest, macos-latest, windows-latest]
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Use Node.js ${{ matrix.node_version }}
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: ${{ matrix.node_version }}
18+
- run: yarn --ignore-engines
19+
- run: yarn build
20+
- run: yarn test --forceExit
21+
env:
22+
CI: true
23+
HEADLESS: false
24+
PROGRESS: none
25+
NODE_ENV: test
26+
NODE_OPTIONS: --max_old_space_size=4096
27+

.gitignore

-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
/.nyc_output
2-
/.changelog
3-
/packages/@umijs/*/lib
4-
/coverage
51
/node_modules
6-
/packages/@umijs/*/node_modules
7-
/packages/@umijs/*/test/fixtures/*/node_modules
8-
/yarn.lock
9-
/packages/@umijs/*/yarn.lock
10-
.DS_Store
11-
**/dist
12-
.umi
13-
.umi-production

.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**/node_modules/**
2+
package.json
3+
4+
# fixtures
5+
**/fixtures/**
6+
7+
# templates
8+
**/templates/**

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 80,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"proseWrap": "never",
6+
"overrides": [
7+
{ "files": ".prettierrc", "options": { "parser": "json" } }
8+
]
9+
}

.travis.yml

-20
This file was deleted.

coverage/clover.xml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<coverage generated="1561538466507" clover="3.2.0">
3+
<project timestamp="1561538466507" name="All files">
4+
<metrics statements="59" coveredstatements="58" conditionals="23" coveredconditionals="19" methods="13" coveredmethods="13" elements="95" coveredelements="90" complexity="0" loc="59" ncloc="59" packages="3" files="4" classes="4"/>
5+
<package name="src">
6+
<metrics statements="37" coveredstatements="36" conditionals="13" coveredconditionals="12" methods="6" coveredmethods="6"/>
7+
<file name="index.ts" path="/Users/chencheng/Code/github.com/umijs/plugins/packages/@umijs/plugin-prerender/src/index.ts">
8+
<metrics statements="37" coveredstatements="36" conditionals="13" coveredconditionals="12" methods="6" coveredmethods="6"/>
9+
<line num="7" count="1" type="stmt"/>
10+
<line num="8" count="6" type="stmt"/>
11+
<line num="11" count="10" type="cond" truecount="4" falsecount="0"/>
12+
<line num="12" count="9" type="stmt"/>
13+
<line num="13" count="9" type="cond" truecount="2" falsecount="0"/>
14+
<line num="14" count="3" type="stmt"/>
15+
<line num="17" count="10" type="stmt"/>
16+
<line num="30" count="1" type="stmt"/>
17+
<line num="31" count="2" type="stmt"/>
18+
<line num="32" count="2" type="stmt"/>
19+
<line num="33" count="2" type="stmt"/>
20+
<line num="34" count="2" type="stmt"/>
21+
<line num="35" count="2" type="stmt"/>
22+
<line num="39" count="3" type="stmt"/>
23+
<line num="40" count="3" type="cond" truecount="3" falsecount="0"/>
24+
<line num="41" count="3" type="stmt"/>
25+
<line num="42" count="3" type="cond" truecount="2" falsecount="0"/>
26+
<line num="43" count="1" type="stmt"/>
27+
<line num="47" count="2" type="stmt"/>
28+
<line num="48" count="2" type="stmt"/>
29+
<line num="50" count="2" type="stmt"/>
30+
<line num="53" count="2" type="stmt"/>
31+
<line num="54" count="2" type="cond" truecount="1" falsecount="1"/>
32+
<line num="55" count="0" type="stmt"/>
33+
<line num="57" count="2" type="stmt"/>
34+
<line num="59" count="2" type="stmt"/>
35+
<line num="62" count="4" type="stmt"/>
36+
<line num="63" count="2" type="stmt"/>
37+
<line num="65" count="2" type="stmt"/>
38+
<line num="66" count="3" type="stmt"/>
39+
<line num="76" count="3" type="stmt"/>
40+
<line num="77" count="3" type="stmt"/>
41+
<line num="78" count="3" type="stmt"/>
42+
<line num="79" count="3" type="stmt"/>
43+
<line num="81" count="3" type="stmt"/>
44+
<line num="82" count="3" type="stmt"/>
45+
<line num="83" count="3" type="stmt"/>
46+
</file>
47+
</package>
48+
<package name="test.examples">
49+
<metrics statements="11" coveredstatements="11" conditionals="6" coveredconditionals="4" methods="2" coveredmethods="2"/>
50+
<file name="umi.server.js" path="/Users/chencheng/Code/github.com/umijs/plugins/packages/@umijs/plugin-prerender/test/examples/umi.server.js">
51+
<metrics statements="11" coveredstatements="11" conditionals="6" coveredconditionals="4" methods="2" coveredmethods="2"/>
52+
<line num="5" count="1" type="stmt"/>
53+
<line num="6" count="3" type="stmt"/>
54+
<line num="10" count="3" type="stmt"/>
55+
<line num="13" count="1" type="stmt"/>
56+
<line num="14" count="3" type="stmt"/>
57+
<line num="15" count="3" type="cond" truecount="1" falsecount="1"/>
58+
<line num="16" count="3" type="stmt"/>
59+
<line num="17" count="3" type="cond" truecount="3" falsecount="1"/>
60+
<line num="18" count="3" type="stmt"/>
61+
<line num="20" count="3" type="stmt"/>
62+
<line num="25" count="1" type="stmt"/>
63+
</file>
64+
</package>
65+
<package name="test.src">
66+
<metrics statements="11" coveredstatements="11" conditionals="4" coveredconditionals="3" methods="5" coveredmethods="5"/>
67+
<file name="index.js" path="/Users/chencheng/Code/github.com/umijs/plugins/packages/@umijs/plugin-prerender/test/src/index.js">
68+
<metrics statements="5" coveredstatements="5" conditionals="2" coveredconditionals="2" methods="2" coveredmethods="2"/>
69+
<line num="3" count="1" type="stmt"/>
70+
<line num="8" count="2" type="stmt"/>
71+
<line num="16" count="1" type="stmt"/>
72+
<line num="17" count="2" type="stmt"/>
73+
<line num="18" count="2" type="stmt"/>
74+
</file>
75+
<file name="users.js" path="/Users/chencheng/Code/github.com/umijs/plugins/packages/@umijs/plugin-prerender/test/src/users.js">
76+
<metrics statements="6" coveredstatements="6" conditionals="2" coveredconditionals="1" methods="3" coveredmethods="3"/>
77+
<line num="2" count="1" type="stmt"/>
78+
<line num="7" count="1" type="stmt"/>
79+
<line num="13" count="2" type="stmt"/>
80+
<line num="20" count="1" type="stmt"/>
81+
<line num="21" count="1" type="stmt"/>
82+
<line num="22" count="1" type="stmt"/>
83+
</file>
84+
</package>
85+
</project>
86+
</coverage>

0 commit comments

Comments
 (0)