Skip to content

Commit 665d0de

Browse files
authored
chore: update readme (#9)
* chore: update readme * fix: dependence warning * chore: upgrade typedoc * chore: update badge
1 parent a759533 commit 665d0de

File tree

5 files changed

+68
-43
lines changed

5 files changed

+68
-43
lines changed

.github/workflows/build.yml

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Build
4+
name: build
55

66
on:
77
push:
@@ -24,12 +24,21 @@ jobs:
2424
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2525

2626
steps:
27-
- uses: actions/checkout@v2
28-
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v2
30-
with:
31-
node-version: ${{ matrix.node-version }}
32-
- run: npm install -g yarn
33-
- run: yarn
34-
- run: yarn build
35-
- run: yarn test
27+
- name: Checkout
28+
uses: actions/[email protected]
29+
30+
- name: Setup Node.js environment
31+
uses: actions/[email protected]
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
35+
- name: Run ci
36+
run: |
37+
npm install
38+
npm run test
39+
npm run build
40+
- name: coverall
41+
if: success()
42+
uses: coverallsapp/github-action@master
43+
with:
44+
github-token: ${{ secrets.GITHUB_TOKEN }}

README.md

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
1-
# Graphlib
1+
<h1 align="center">
2+
<b>@antv/graphlib</b>
3+
</h1>
24

3-
> a lib containing multible usages for graph structure, graph algorithm, and other graph ops.
5+
<div align="center">
6+
7+
> A library containing multible usages for graph structure, graph algorithm, and other graph ops.
48
>
5-
> 一个包含方便的图结构,图算法,以及其他操作图的方法的图库,为 antv 上层提供相应的图基础能力
9+
> 一个包含方便的图结构,图算法,以及其他操作图的方法的图库,为 AntV 上层提供相应的图基础能力。
10+
11+
[![Build Status](https://github.com/antvis/graphlib/workflows/build/badge.svg?branch=master)](https://github.com/antvis/graphlib/actions)
12+
[![Coverage Status](https://coveralls.io/repos/github/antvis/graphlib/badge.svg?branch=master)](https://coveralls.io/github/antvis/graphlib?branch=master)
13+
[![npm Version](https://img.shields.io/npm/v/@antv/graphlib.svg)](https://www.npmjs.com/package/@antv/graphlib)
14+
[![npm Download](https://img.shields.io/npm/dm/@antv/graphlib.svg)](https://www.npmjs.com/package/@antv/graphlib)
15+
[![npm License](https://img.shields.io/npm/l/@antv/graphlib.svg)](https://www.npmjs.com/package/@antv/graphlib)
616

7-
![build status](https://img.shields.io/github/workflow/status/antvis/graphlib/Build) ![coverage status](https://img.shields.io/codecov/c/github/antvis/graphlib)
17+
</div>
818

9-
## Features
19+
## Features
1020

1121
- Manage graph structure data with simple APIs.
1222
- Easily batch multiple changes for performance optimization.
1323
- GraphView for efficient data transformation.
1424

15-
## API
25+
## 📖 API
1626

1727
### Classes
1828

1929
- [Graph](docs/classes/Graph.md)
2030
- [GraphView](docs/classes/GraphView.md)
2131

22-
## Change Log
32+
## 🗂 Change Log
2333

2434
#### 2.0.2
2535

@@ -28,3 +38,7 @@
2838
#### 2.0
2939

3040
- 🎉 Release new version
41+
42+
## 📄 License
43+
44+
MIT@[AntV](https://github.com/antvis).

jest.config.json

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
{
22
"testTimeout": 30000,
3-
"preset": "ts-jest",
4-
"globals": {
5-
"ts-jest": {
6-
"tsconfig": {
7-
"target": "esnext",
8-
"allowJs": true,
9-
"sourceMap": true
10-
}
11-
}
12-
},
133
"collectCoverage": false,
144
"testRegex": "(/__tests__/.*\\.(test|spec))\\.ts$",
155
"collectCoverageFrom": [
166
"src/**/*.ts"
17-
]
7+
],
8+
"transform": {
9+
"^.+\\.ts$": [
10+
"ts-jest",
11+
{
12+
"tsconfig": {
13+
"target": "esnext",
14+
"allowJs": true,
15+
"sourceMap": true
16+
}
17+
}
18+
]
19+
}
1820
}

package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "@antv/graphlib",
33
"version": "2.0.2",
4+
"main": "lib/index.js",
5+
"module": "esm/index.js",
6+
"types": "lib/index.d.ts",
7+
"unpkg": "dist/index.umd.min.js",
48
"sideEffects": false,
59
"scripts": {
610
"clean": "rimraf lib esm dist",
@@ -16,17 +20,14 @@
1620
"build": "run-p build:*",
1721
"bundle-vis": "cross-env BUNDLE_VIS=1 run-p build:umd"
1822
},
19-
"license": "MIT",
20-
"main": "lib/index.js",
21-
"module": "esm/index.js",
22-
"types": "lib/index.d.ts",
23-
"unpkg": "dist/index.umd.min.js",
2423
"dependencies": {
2524
"@antv/event-emitter": "^0.1.3"
2625
},
2726
"devDependencies": {
2827
"@commitlint/cli": "^11.0.0",
2928
"@rollup/plugin-commonjs": "^21.0.2",
29+
"@rollup/plugin-node-resolve": "^15.2.1",
30+
"@rollup/plugin-terser": "^0.4.3",
3031
"@types/jest": "^29.2.4",
3132
"@typescript-eslint/eslint-plugin": "^5.46.1",
3233
"@typescript-eslint/parser": "^5.46.1",
@@ -41,14 +42,12 @@
4142
"prettier": "^2.8.1",
4243
"rimraf": "^3.0.2",
4344
"rollup": "^2.39.0",
44-
"rollup-plugin-node-resolve": "^5.2.0",
4545
"rollup-plugin-polyfill-node": "^0.8.0",
46-
"rollup-plugin-typescript": "^1.0.1",
47-
"rollup-plugin-uglify": "^6.0.4",
46+
"rollup-plugin-typescript2": "^0.35.0",
4847
"rollup-plugin-visualizer": "^5.6.0",
4948
"ts-jest": "^29.0.3",
5049
"tslib": "^2.4.1",
51-
"typedoc": "^0.23.24",
50+
"typedoc": "^0.25.2",
5251
"typedoc-plugin-markdown": "^3.14.0",
5352
"typescript": "^4.9.4"
5453
},
@@ -62,7 +61,7 @@
6261
"limit-size": [
6362
{
6463
"path": "dist/index.umd.min.js",
65-
"limit": "10 Kb",
64+
"limit": "5 Kb",
6665
"gzip": true
6766
}
6867
],
@@ -77,5 +76,6 @@
7776
"publishConfig": {
7877
"access": "public",
7978
"registry": "https://registry.npmjs.org"
80-
}
79+
},
80+
"license": "MIT"
8181
}

rollup.config.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { uglify } from 'rollup-plugin-uglify';
2-
import resolve from 'rollup-plugin-node-resolve';
3-
import typescript from 'rollup-plugin-typescript';
1+
import terser from '@rollup/plugin-terser';
2+
import resolve from '@rollup/plugin-node-resolve';
3+
import typescript from 'rollup-plugin-typescript2';
44
import commonjs from '@rollup/plugin-commonjs';
55
import nodePolyfills from 'rollup-plugin-polyfill-node';
66
import { visualizer } from 'rollup-plugin-visualizer';
@@ -21,7 +21,7 @@ export default [
2121
resolve(),
2222
commonjs(),
2323
typescript(),
24-
uglify(),
24+
terser(),
2525
...(isBundleVis ? [visualizer({ open: true })] : []),
2626
],
2727
},

0 commit comments

Comments
 (0)