Compare commits
309 Commits
@antv/x6@2
...
@antv/x6@1
Author | SHA1 | Date | |
---|---|---|---|
f7bf8219c3 | |||
4ffb61912b | |||
59fb1d2e3a | |||
6b85512a25 | |||
c7269af2ef | |||
e3d6d5e694 | |||
8dde11951f | |||
c90ede231e | |||
ae51381992 | |||
b10ef693e8 | |||
f5c5537650 | |||
ccf44c1732 | |||
5a865db99e | |||
c472648ae1 | |||
6351a5064d | |||
e02aefdc4f | |||
922c98632c | |||
dc59ce1d85 | |||
8db399f6fc | |||
edd1b36abc | |||
794df7f497 | |||
35774995b7 | |||
d67bcc104d | |||
de80eb588b | |||
b9906c9fa5 | |||
c4b10e38a5 | |||
4b104eb73e | |||
aee252f5d7 | |||
b3c2adb4b8 | |||
7eac6c4645 | |||
67df6722ae | |||
438e394b99 | |||
4422d2099a | |||
df4bcf653f | |||
206f589bb3 | |||
b27a3ff9ef | |||
06702ce221 | |||
02579cb1c1 | |||
6a2a59b1cb | |||
1fbba70e7e | |||
df7a0ee73c | |||
3dcafac5ac | |||
8b4192bd5f | |||
829406e81b | |||
f907d37cb1 | |||
3b4aab93a6 | |||
ce3e1fc6be | |||
9bda76514a | |||
58b2921bfb | |||
608f61c3cd | |||
b43b8f028a | |||
6cf6d31998 | |||
b3edfc7590 | |||
045499511d | |||
1f5d5d1aca | |||
7c513e7af1 | |||
1444b16222 | |||
c89f8599ce | |||
d622db6d6b | |||
ceead471ff | |||
0696064480 | |||
0d2318605e | |||
0416d0af4e | |||
a60e8f1653 | |||
e4f38cd9e8 | |||
8cb9085dc1 | |||
997430abba | |||
166b9346b3 | |||
2750d0e69e | |||
3e5189c2b7 | |||
6045888e6a | |||
933c6ed8e0 | |||
df47d90889 | |||
1648f12e83 | |||
815b044618 | |||
7e39cf1374 | |||
8b75ee89a4 | |||
5a24508334 | |||
b259afc9f2 | |||
992d664c53 | |||
8ce480c6b9 | |||
e978b8d0e5 | |||
a335e1c52f | |||
3e4481063d | |||
50d21787c4 | |||
32cae56c40 | |||
667720efb9 | |||
76d98ded26 | |||
3302c56bd4 | |||
3dba62a858 | |||
9befb7d8db | |||
e1e295b64e | |||
06fdf6315b | |||
bc6e8bcb28 | |||
892d74e56b | |||
bf9f6f1947 | |||
4304dd9322 | |||
4381a8a339 | |||
fc2fccaee0 | |||
a5c75d3e0f | |||
049090e009 | |||
2da5b71540 | |||
37875b8245 | |||
cd4c142da1 | |||
f86d935f05 | |||
992b0b8366 | |||
8a4a677b77 | |||
da55ef7a60 | |||
54b9debbce | |||
eef4a6df4c | |||
bf7540c1f9 | |||
eb98529391 | |||
0e5ff9204a | |||
6115dbbd75 | |||
3f786136b4 | |||
431116f629 | |||
cbbe1b6b54 | |||
d02ad4cb3b | |||
a9f0dd35b9 | |||
484df66d36 | |||
0d691c61cd | |||
5849eb9a88 | |||
c285ce6e0f | |||
817d08ff41 | |||
d63f26023f | |||
a56182ee06 | |||
51819712e7 | |||
92db8470a1 | |||
3e512b92b7 | |||
4f72b0d5c1 | |||
045412de6d | |||
4b7c565305 | |||
d2056dbc21 | |||
a555693442 | |||
dc5f606edb | |||
bba7307bd1 | |||
07794dc611 | |||
e1c0a99458 | |||
0c25aedd12 | |||
6ef7f55334 | |||
c97de2c807 | |||
dc62dd9390 | |||
56234ae8d7 | |||
eb81f1b856 | |||
2fd1033009 | |||
a654adf88f | |||
8633398149 | |||
4afc9df1ed | |||
e1bb9289b0 | |||
3ee97bef65 | |||
4015bb6667 | |||
586eb49032 | |||
52b7b51b45 | |||
852843ba59 | |||
01444b4677 | |||
76e0f973e6 | |||
619a6df36e | |||
082c5e04cf | |||
5b2020d4d0 | |||
12e3e8969f | |||
cde133781a | |||
fdb7563d21 | |||
ffe8306851 | |||
96ad752ccc | |||
0dcb61262a | |||
2e91808200 | |||
8cc9c3f257 | |||
fa34253f0a | |||
78f1f534a1 | |||
3c7c06ac30 | |||
5036dca96d | |||
ec419f8845 | |||
2d4ca77d46 | |||
c3fd2a2441 | |||
082d1f875b | |||
4efdb3660d | |||
fc06ff66d4 | |||
372d5f3031 | |||
d87b2a7eaf | |||
78a2a0bfe0 | |||
ac56327b41 | |||
26ce96f7a2 | |||
cfb77ae4cf | |||
c7a335177b | |||
692a4ee1b0 | |||
5d6f4fe15e | |||
a4411d0f88 | |||
b8c217572a | |||
48b3577023 | |||
20f68caa3a | |||
ae4ed52b69 | |||
fe41710467 | |||
0d34cdd0cc | |||
a9c0decd14 | |||
de59617532 | |||
89da6b32cc | |||
bb07735f36 | |||
88f04625ed | |||
74d3b24c6f | |||
f43edba970 | |||
cd006184c3 | |||
322dec6a4a | |||
47e7e67574 | |||
60954137d3 | |||
61c7d7f015 | |||
c7c3415300 | |||
7e64838e00 | |||
7c18c7d5ff | |||
7ea2ab1141 | |||
0115917836 | |||
b184f8ca1c | |||
1abb62e14a | |||
ed5cdfb384 | |||
7a0f33c5a2 | |||
1de788cfaa | |||
4d016760c7 | |||
47487fe604 | |||
6711d06fa1 | |||
83e4bd96e9 | |||
2a340936a0 | |||
3967110b6e | |||
66b2a44845 | |||
be52637c60 | |||
1e513adfde | |||
38857171ed | |||
88e0222422 | |||
63254bbf79 | |||
d6242db65c | |||
0efe5c5145 | |||
18780ddddd | |||
45d45de9e0 | |||
4a8ce47c46 | |||
c1e0d5afed | |||
1a57746c36 | |||
a49d004b03 | |||
b4641440b6 | |||
e9332a74a9 | |||
04e98cfe9b | |||
69615f92ab | |||
a7e7add2a8 | |||
af281c4a48 | |||
c2efaaf71c | |||
73880a47d0 | |||
b91869655d | |||
0879a143f9 | |||
56ba335afb | |||
5020e92ce8 | |||
93f0adaf96 | |||
248846731b | |||
b8e2d52f9a | |||
8ae13da838 | |||
446f433648 | |||
f3d5c30ee7 | |||
94cf18e5f8 | |||
314fee4606 | |||
7816a8fd47 | |||
5d597f5809 | |||
b389b5654f | |||
cd6514abef | |||
5b24ec1cee | |||
822310ecfa | |||
2d053f1bf6 | |||
fe0a81f6f2 | |||
86362513e7 | |||
624838fe23 | |||
214b92704d | |||
9594778ddb | |||
761f1b9144 | |||
e6de6363ae | |||
7f90fcf3b1 | |||
05f86b52b2 | |||
35a9531254 | |||
5c084bf8f0 | |||
34c82a1b45 | |||
c3d54ad2e5 | |||
a1dbd1095e | |||
a30d850c0f | |||
c3134d5fd6 | |||
85be9ec734 | |||
5c00e45d37 | |||
3ec0d432a3 | |||
ea4ea45e46 | |||
45cdd0980c | |||
40f6496aea | |||
12ab1057fe | |||
bd33449b2d | |||
96271dc298 | |||
5f2b46b34c | |||
bfd48e644e | |||
7440903281 | |||
769186b043 | |||
b2dce8e69f | |||
6614e4f83c | |||
c51043d468 | |||
0a0cbf9f50 | |||
09a4cf3f8b | |||
a9ccf98bf1 | |||
3cafa37292 | |||
99e42a95b1 | |||
f79151abd0 | |||
6a006f3dcd | |||
e42f4fe2d4 | |||
9f342b68d0 | |||
6eb4e4fafd | |||
fba8cf0ce6 | |||
a7b7f0bc43 | |||
157b2072f3 | |||
bdf7d7b628 | |||
eff14baca7 |
@ -11,10 +11,11 @@ coverage:
|
||||
threshold: 1%
|
||||
flags:
|
||||
- x6
|
||||
x6-common:
|
||||
x6-vector:
|
||||
threshold: 1%
|
||||
target: 80% # will fail a Pull Request if coverage is less than 80%
|
||||
flags:
|
||||
- x6-common
|
||||
- x6-vector
|
||||
x6-geometry:
|
||||
threshold: 1%
|
||||
flags:
|
||||
@ -25,9 +26,9 @@ flags:
|
||||
paths:
|
||||
# filter the folder(s) you wish to measure by that flag
|
||||
- packages/x6
|
||||
x6-common:
|
||||
x6-vector:
|
||||
paths:
|
||||
- packages/x6-common
|
||||
- packages/x6-vector
|
||||
x6-geometry:
|
||||
paths:
|
||||
- packages/x6-geometry
|
||||
|
155
.eslintrc
155
.eslintrc
@ -1,156 +1,3 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"eslint-comments",
|
||||
"import",
|
||||
"flowtype",
|
||||
"jest",
|
||||
"jsx-a11y",
|
||||
"prettier",
|
||||
"promise",
|
||||
"react",
|
||||
"react-hooks",
|
||||
"unicorn"
|
||||
],
|
||||
"extends": [
|
||||
"airbnb-base",
|
||||
"eslint:recommended",
|
||||
"prettier",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
"plugin:import/errors",
|
||||
"plugin:import/warnings",
|
||||
"plugin:promise/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react-hooks/recommended"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es6": true,
|
||||
"jest": true,
|
||||
"node": true,
|
||||
"mocha": true,
|
||||
"jasmine": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"requireConfigFile": false
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-bitwise": 0,
|
||||
"no-continue": 0,
|
||||
"no-lonely-if": 0,
|
||||
"no-multi-assign": 0,
|
||||
"no-nested-ternary": 0,
|
||||
"no-inner-declarations": 0,
|
||||
"no-unused-expressions": 0,
|
||||
"max-classes-per-file": 0,
|
||||
"prefer-destructuring": 0,
|
||||
"class-methods-use-this": 0,
|
||||
"implicit-arrow-linebreak": 0,
|
||||
"lines-between-class-members": 0,
|
||||
"@typescript-eslint/lines-between-class-members": 0,
|
||||
"consistent-return": 0,
|
||||
"no-return-assign": [2, "except-parens"],
|
||||
"no-param-reassign": [
|
||||
2,
|
||||
{
|
||||
"props": false
|
||||
}
|
||||
],
|
||||
"no-cond-assign": [2, "except-parens"],
|
||||
"no-console": [
|
||||
2,
|
||||
{
|
||||
"allow": ["warn", "error"]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-unused-expressions": [
|
||||
2,
|
||||
{
|
||||
"allowShortCircuit": true,
|
||||
"allowTernary": true
|
||||
}
|
||||
],
|
||||
"eqeqeq": [
|
||||
2,
|
||||
"always",
|
||||
{
|
||||
"null": "ignore"
|
||||
}
|
||||
],
|
||||
"func-names": [
|
||||
1,
|
||||
"never",
|
||||
{
|
||||
"generators": "as-needed"
|
||||
}
|
||||
],
|
||||
"import/export": 0,
|
||||
"import/no-cycle": 0,
|
||||
"import/extensions": 0,
|
||||
"import/no-unresolved": 0,
|
||||
"import/prefer-default-export": 0,
|
||||
"import/no-extraneous-dependencies": 0,
|
||||
"promise/always-return": 0,
|
||||
"promise/catch-or-return": 0,
|
||||
"@typescript-eslint/no-namespace": 0,
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/no-non-null-assertion": 0,
|
||||
"@typescript-eslint/no-empty-function": 0,
|
||||
"@typescript-eslint/no-empty-interface": 0,
|
||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||
"no-shadow": 0,
|
||||
"@typescript-eslint/no-shadow": 0,
|
||||
"camelcase": 0,
|
||||
"@typescript-eslint/camelcase": 0,
|
||||
"no-use-before-define": 0,
|
||||
"@typescript-eslint/no-use-before-define": 0,
|
||||
"no-useless-constructor": 0,
|
||||
"@typescript-eslint/no-useless-constructor": 0,
|
||||
"no-unused-vars": 0,
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
2,
|
||||
{
|
||||
"vars": "all",
|
||||
"args": "after-used",
|
||||
"ignoreRestSiblings": true
|
||||
}
|
||||
],
|
||||
"no-redeclare": 0,
|
||||
"@typescript-eslint/no-redeclare": [
|
||||
2,
|
||||
{
|
||||
"ignoreDeclarationMerge": true
|
||||
}
|
||||
],
|
||||
"react/sort-comp": 0,
|
||||
"react/prop-types": 0,
|
||||
"react/jsx-props-no-spreading": 0,
|
||||
"react/destructuring-assignment": 0,
|
||||
"react/no-access-state-in-setstate": 0
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.js"],
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"global-require": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
"extends": "@antv/eslint-config"
|
||||
}
|
||||
|
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
@ -1,5 +1,5 @@
|
||||
# This action will automatically close issues fixed in
|
||||
# pull requests that doesn't target the default branch.
|
||||
# Automatically close issues fixed in pull requests that doesn't target the default branch.
|
||||
|
||||
name: 🚫 Auto Close Fixed Issues
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -8,12 +8,13 @@ jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/auto-close-fixed-issues@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
comment: |
|
||||
This issue was closed by #{{ pr }}.
|
||||
|
7
.github/workflows/auto-comment.yml
vendored
7
.github/workflows/auto-comment.yml
vendored
@ -1,13 +1,16 @@
|
||||
# Comment on issues/PRs on certain events (currently not used at all.)
|
||||
|
||||
name: 💬 Auto Comment
|
||||
on: [issues, pull_request_target]
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/auto-comment@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
|
6
.github/workflows/backup/auto-assign.yml
vendored
6
.github/workflows/backup/auto-assign.yml
vendored
@ -8,12 +8,12 @@ jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/auto-assign@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
CONFIG_FILE: .github/workflows/config/auto-assign.yml
|
||||
|
@ -1,48 +0,0 @@
|
||||
name: 🚫 Delete Stale Releases
|
||||
# on:
|
||||
# repository_dispatch:
|
||||
# types: [released]
|
||||
# jobs:
|
||||
# clean:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: wow-actions/use-app-token@v2
|
||||
# with:
|
||||
# app_id: ${{ secrets.APP_ID }}
|
||||
# private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
#
|
||||
# - uses: wow-actions/delete-stale-releases@v1
|
||||
# with:
|
||||
# GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
# delete_tags: true
|
||||
# keep_latest_count: 3
|
||||
# group: '(?!^)@.*$'
|
||||
# exclude: |
|
||||
# @antv/x6@**
|
||||
# @antv/x6-common@**
|
||||
# @antv/x6-geometry@**
|
||||
# @antv/x6-plugin-**@**
|
||||
# @antv/x6-vue-shape@**
|
||||
# @antv/x6-react-shape@**
|
||||
# @antv/x6-angular-shape@**
|
||||
# @antv/x6-react-components@**
|
||||
|
||||
# delete all releases and tag
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
clean:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
- uses: wow-actions/delete-stale-releases@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
delete_tags: true
|
||||
keep_latest_count: -1
|
99
.github/workflows/ci.yml
vendored
99
.github/workflows/ci.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Continuous integration.
|
||||
|
||||
name: 👷 CI
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -10,82 +12,59 @@ on:
|
||||
- beta
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
codecov: [x6, x6-common, x6-geometry]
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
node-version: [16.x]
|
||||
steps:
|
||||
- name: ⤵️ Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 🎉 Setup nodejs
|
||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: 🎉 Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: 🌱 Get pnpm store directory
|
||||
id: pnpm-cache
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 🚸 Setup pnpm cache
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: 🌱 Get Cache Directory
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- name: 🚸 Setup Cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: 🚧 Install
|
||||
run: pnpm install --no-frozen-lockfile --ignore-scripts
|
||||
|
||||
- name: 🚀 Build
|
||||
run: pnpm run build
|
||||
|
||||
${{ runner.os }}-yarn-
|
||||
- name: 🚧 Prepare
|
||||
run: yarn global add lerna
|
||||
- name: 🚀 Bootstrap
|
||||
run: yarn bootstrap
|
||||
- name: ✅ Test
|
||||
run: pnpm run test
|
||||
|
||||
run: yarn test
|
||||
- name: 🔑 Generate Token
|
||||
uses: wow-actions/use-app-token@v2
|
||||
uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
|
||||
- name: 💡 Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
env_name: bot_token
|
||||
- name: 💡 Coveralls
|
||||
uses: coverallsapp/github-action@master
|
||||
with:
|
||||
github-token: ${{ env.bot_token }}
|
||||
path-to-lcov: ./packages/x6/test/coverage/lcov.info
|
||||
- name: 💡 Codecov(x6)
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./packages/${{ matrix.codecov }}/test/coverage/lcov.info
|
||||
flags: ${{ matrix.codecov }}
|
||||
|
||||
- name: 🔀 Dispatch(ci_passed)
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
files: ./packages/x6/test/coverage/lcov.info
|
||||
flags: x6
|
||||
- name: 💡 Codecov(x6-vector)
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ env.BOT_TOKEN }}
|
||||
event-type: ci_passed
|
||||
|
||||
- name: 🔀 Dispatch(ci_pr_passed)
|
||||
if: github.event_name == 'pull_request_target'
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./packages/x6-vector/test/coverage/lcov.info
|
||||
flags: x6-vector
|
||||
- name: 💡 Codecov(x6-geometry)
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ env.BOT_TOKEN }}
|
||||
event-type: ci_pr_passed
|
||||
|
||||
- name: 🔀 Dispatch(ci_master_passed)
|
||||
if: github.event_name == 'push'
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ env.BOT_TOKEN }}
|
||||
event-type: ci_master_passed
|
||||
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./packages/x6-geometry/test/coverage/lcov.info
|
||||
flags: x6-geometry
|
||||
|
3
.github/workflows/config/labels.yml
vendored
3
.github/workflows/config/labels.yml
vendored
@ -138,6 +138,9 @@
|
||||
- name: pkg:x6
|
||||
color: eeeeee
|
||||
description: Denotes a PR that changes packages/x6
|
||||
- name: pkg:x6-react
|
||||
color: eeeeee
|
||||
description: Denotes a PR that changes packages/x6-react
|
||||
- name: pkg:x6-react-shape
|
||||
color: eeeeee
|
||||
description: Denotes a PR that changes packages/x6-react-shape
|
||||
|
10
.github/workflows/create-issue-branch.yml
vendored
10
.github/workflows/create-issue-branch.yml
vendored
@ -1,3 +1,6 @@
|
||||
# Create a new branch dedicated to a specific issue
|
||||
# (may be superseded by GitHub functionalities)
|
||||
|
||||
name: 🚧 Create Issue Branch
|
||||
on:
|
||||
issue_comment:
|
||||
@ -6,11 +9,12 @@ jobs:
|
||||
cib:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: robvanderleek/create-issue-branch@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
|
29
.github/workflows/delete-stale-releases.yml
vendored
Normal file
29
.github/workflows/delete-stale-releases.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
# Delete all but the last x GitHub releases for certain packages.
|
||||
|
||||
name: 🚫 Delete Stale Releases
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [released]
|
||||
jobs:
|
||||
clean:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/delete-stale-releases@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
delete_tags: true
|
||||
keep_latest_count: 3
|
||||
group: '(?!^)@.*$'
|
||||
exclude: |
|
||||
@antv/x6@**
|
||||
@antv/x6-react@**
|
||||
@antv/x6-vue-shape@**
|
||||
@antv/x6-react-shape@**
|
||||
@antv/x6-angular-shape@**
|
||||
@antv/x6-react-components@**
|
16
.github/workflows/deploy-sites.yml
vendored
16
.github/workflows/deploy-sites.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Build and deploy updated official site to GitHub pages.
|
||||
|
||||
name: 🚀 Deploy Sites
|
||||
on:
|
||||
repository_dispatch:
|
||||
@ -12,7 +14,7 @@ jobs:
|
||||
- name: ⤵️ Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
@ -21,7 +23,7 @@ jobs:
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- name: 🚸 Setup Cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
@ -30,7 +32,7 @@ jobs:
|
||||
|
||||
## cache webpack(babel-loader, eslint-loader)
|
||||
- name: 💩 Setup Webpack Cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@ -41,7 +43,7 @@ jobs:
|
||||
|
||||
## cache sites
|
||||
- name: 💩 Setup Sites Cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: sites/x6-sites/static/demos
|
||||
key: ${{ runner.os }}-sites-${{ hashFiles('./packages/x6/package.json', './sites/x6-sites-demos/**/src') }}
|
||||
@ -64,15 +66,15 @@ jobs:
|
||||
run: yarn build:sites
|
||||
|
||||
- name: 🔑 Generate Token
|
||||
uses: wow-actions/use-app-token@v2
|
||||
uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
|
||||
- name: ✅ Deploy sites
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ env.BOT_TOKEN }}
|
||||
github_token: ${{ env.bot_token }}
|
||||
publish_dir: ./sites/x6-sites/public
|
||||
publish_branch: gh-pages
|
||||
|
@ -1,6 +1,8 @@
|
||||
# https://github.com/gitleaks/gitleaks-action
|
||||
|
||||
name: 🥤 GitLeaks
|
||||
on:
|
||||
pull_request:
|
||||
pull_request_target:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
@ -18,4 +20,4 @@ jobs:
|
||||
with:
|
||||
args: -O .gitleaks.toml https://raw.githubusercontent.com/ycjcl868/gitleaks/master/.gitleaks.toml
|
||||
- name: gitleaks-action
|
||||
uses: zricethezav/gitleaks-action@master
|
||||
uses: zricethezav/gitleaks-action@v1.6.0
|
11
.github/workflows/label-commands.yml
vendored
11
.github/workflows/label-commands.yml
vendored
@ -1,3 +1,8 @@
|
||||
# Perform certain actions when labels are added to
|
||||
# or removed from issues.
|
||||
#
|
||||
# See .github/workflows/config/label-commands.yml
|
||||
|
||||
name: 👾 Label Commands
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -8,12 +13,12 @@ jobs:
|
||||
cmd:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/label-commands@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
CONFIG_FILE: .github/workflows/config/label-commands.yml
|
||||
|
11
.github/workflows/lock.yml
vendored
11
.github/workflows/lock.yml
vendored
@ -1,3 +1,6 @@
|
||||
# Locks closed issues and pull requests after a period of inactivity.
|
||||
# https://github.com/dessant/lock-threads
|
||||
|
||||
name: ⛔️ Lock Threads
|
||||
on:
|
||||
schedule:
|
||||
@ -6,14 +9,14 @@ jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
- uses: dessant/lock-threads@v2
|
||||
env_name: bot_token
|
||||
- uses: dessant/lock-threads@v3
|
||||
with:
|
||||
github-token: ${{ env.BOT_TOKEN }}
|
||||
github-token: ${{ env.bot_token }}
|
||||
issue-lock-inactive-days: 365
|
||||
issue-lock-comment: |
|
||||
This thread has been automatically locked because it has not had recent activity.
|
||||
|
9
.github/workflows/needs-more-info.yml
vendored
9
.github/workflows/needs-more-info.yml
vendored
@ -1,3 +1,6 @@
|
||||
# Request more info from newly opened issues/PRs that contain either default title/body or whose body is left blank
|
||||
# https://github.com/wow-actions/needs-more-info
|
||||
|
||||
name: 🚨 Needs More Info
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -8,13 +11,13 @@ jobs:
|
||||
evaluate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/needs-more-info@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
CONFIG_FILE: .github/workflows/config/needs-more-info.yml
|
||||
|
||||
|
9
.github/workflows/potential-duplicates.yml
vendored
9
.github/workflows/potential-duplicates.yml
vendored
@ -1,3 +1,6 @@
|
||||
# Search for potential issue duplicates using Damerau–Levenshtein algorithm
|
||||
# https://github.com/wow-actions/potential-duplicates
|
||||
|
||||
name: 🆖 Potential Duplicates
|
||||
on:
|
||||
issues:
|
||||
@ -6,11 +9,11 @@ jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/potential-duplicates@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
|
9
.github/workflows/pr-label-branch-name.yml
vendored
9
.github/workflows/pr-label-branch-name.yml
vendored
@ -1,3 +1,6 @@
|
||||
# Automatically apply labels to your PRs based on branch name patterns like feature/* or fix/*
|
||||
# https://github.com/TimonVS/pr-labeler-action
|
||||
|
||||
name: 🏷️ Label(Branch Name)
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -6,13 +9,13 @@ jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: TimonVS/pr-labeler-action@v3
|
||||
with:
|
||||
configuration-path: .github/workflows/config/pr-label-branch-name.yml
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
|
11
.github/workflows/pr-label-file-paths.yml
vendored
11
.github/workflows/pr-label-file-paths.yml
vendored
@ -1,15 +1,18 @@
|
||||
# Label a PR according to the packages it involves, based on changed files
|
||||
# and the rules defined in .github/workflows/config/pr-label-file-paths.yml
|
||||
|
||||
name: 🏷️ Label(File Paths)
|
||||
on: pull_request_target
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
- uses: actions/labeler@v2
|
||||
env_name: bot_token
|
||||
- uses: actions/labeler@v4
|
||||
with:
|
||||
repo-token: ${{ env.BOT_TOKEN }}
|
||||
repo-token: ${{ env.bot_token }}
|
||||
configuration-path: .github/workflows/config/pr-label-file-paths.yml
|
||||
|
11
.github/workflows/pr-label-patch-size.yml
vendored
11
.github/workflows/pr-label-patch-size.yml
vendored
@ -1,15 +1,18 @@
|
||||
# Assign labels based on pull request change sizes.
|
||||
|
||||
name: 🏷️ Label(Patch Size)
|
||||
on: pull_request_target
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: pascalgn/size-label-action@v0.4.3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
IGNORED: "!.gitignore\nyarn.lock\npnpm-lock.yaml"
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
IGNORED: "!.gitignore\nyarn.lock"
|
||||
|
7
.github/workflows/pr-label-status-dummy.yml
vendored
7
.github/workflows/pr-label-status-dummy.yml
vendored
@ -1,9 +1,16 @@
|
||||
# Automatically label a PR depending on the PR's status (springboard)
|
||||
|
||||
name: 🏷️ Label(Status) Dummy
|
||||
on:
|
||||
pull_request_review:
|
||||
types: [submitted, dismissed]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dummy:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "this is a dummy workflow that triggers a workflow_run; it's necessary because otherwise the repo secrets will not be in scope for externally forked pull requests"
|
||||
|
10
.github/workflows/pr-label-status.yml
vendored
10
.github/workflows/pr-label-status.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Automatically label a PR depending on the PR's status
|
||||
|
||||
name: 🏷️ Label(Status)
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -9,12 +11,12 @@ jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/pr-triage@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
WORKFLOW-ID: ${{ github.event.workflow_run.id }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
WORKFLOW_ID: ${{ github.event.workflow_run.id }}
|
||||
|
13
.github/workflows/pr-label-title-body.yml
vendored
13
.github/workflows/pr-label-title-body.yml
vendored
@ -1,5 +1,6 @@
|
||||
# Github action for automatically adding label or setting assignee when a new
|
||||
# Issue or PR is opened. https://github.com/marketplace/actions/issue-labeler
|
||||
# Automatically add labels or setting assignees when a new issue or PR is opened,
|
||||
# based on its title and body.
|
||||
# https://github.com/marketplace/actions/issue-labeler
|
||||
|
||||
name: 🏷️ Label(Title and Body)
|
||||
on:
|
||||
@ -11,15 +12,15 @@ jobs:
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
- uses: Naturalclar/issue-action@v2.0.1
|
||||
env_name: bot_token
|
||||
- uses: Naturalclar/issue-action@v2.0.2
|
||||
with:
|
||||
title-or-body: title
|
||||
github-token: ${{ env.BOT_TOKEN }}
|
||||
github-token: ${{ env.bot_token }}
|
||||
parameters: >
|
||||
[
|
||||
{
|
||||
|
16
.github/workflows/preview.yml
vendored
16
.github/workflows/preview.yml
vendored
@ -1,3 +1,5 @@
|
||||
# https://github.com/afc163/surge-preview
|
||||
|
||||
name: 🔂 Surge PR Preview
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -20,7 +22,7 @@ jobs:
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- name: 🚸 Setup yarn cacha
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
@ -29,7 +31,7 @@ jobs:
|
||||
|
||||
## cache webpack(babel-loader, eslint-loader)
|
||||
- name: 💩 Setup webpack cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
@ -40,7 +42,7 @@ jobs:
|
||||
|
||||
## cache sites
|
||||
- name: 💩 Setup sites cache
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: sites/x6-sites/static/demos
|
||||
key: ${{ runner.os }}-sites-${{ hashFiles('./packages/x6/package.json', './sites/x6-sites-demos/**/src') }}
|
||||
@ -48,7 +50,7 @@ jobs:
|
||||
${{ runner.os }}-sites-
|
||||
|
||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
@ -69,17 +71,17 @@ jobs:
|
||||
run: yarn build:sites
|
||||
|
||||
- name: 🔑 Generate Token
|
||||
uses: wow-actions/use-app-token@v2
|
||||
uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
|
||||
- name: ✅ Deploy Sites
|
||||
uses: afc163/surge-preview@v1
|
||||
with:
|
||||
surge_token: ${{ secrets.SURGE_TOKEN }}
|
||||
github_token: ${{ env.BOT_TOKEN }}
|
||||
github_token: ${{ env.bot_token }}
|
||||
build: |
|
||||
echo Create sites preview
|
||||
dist: sites/x6-sites/public
|
||||
|
10
.github/workflows/rebase.yml
vendored
10
.github/workflows/rebase.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Automatically rebase PRs via the /rebase command
|
||||
|
||||
name: 🎉 Rebase
|
||||
on:
|
||||
issue_comment:
|
||||
@ -7,14 +9,14 @@ jobs:
|
||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: cirrus-actions/rebase@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
|
73
.github/workflows/release.yml
vendored
73
.github/workflows/release.yml
vendored
@ -1,4 +1,8 @@
|
||||
# @see: https://dev.to/antongolub/the-chronicles-of-semantic-release-and-monorepos-5cfc
|
||||
# Create new GitHub releases using scripts/monorepo-semantic-release
|
||||
# and the semantic-release package.
|
||||
#
|
||||
# See https://www.npmjs.com/package/semantic-release
|
||||
# See https://dev.to/antongolub/the-chronicles-of-semantic-release-and-monorepos-5cfc
|
||||
|
||||
name: 🚀 Release
|
||||
on:
|
||||
@ -12,64 +16,55 @@ on:
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
steps:
|
||||
- name: ⤵️ Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 🎉 Setup nodejs
|
||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- name: 🎉 Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 7
|
||||
run_install: false
|
||||
|
||||
- name: 🌱 Get pnpm store directory
|
||||
id: pnpm-cache
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 🚸 Setup pnpm cache
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: 🌱 Get Cache Directory
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- name: 🚸 Setup Cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: 🚧 Install dependencies
|
||||
run: pnpm install --no-frozen-lockfile --ignore-scripts
|
||||
|
||||
- name: 📦 build
|
||||
run: pnpm run build
|
||||
|
||||
# - name: ✅ Test
|
||||
# run: pnpm run test
|
||||
${{ runner.os }}-yarn-
|
||||
- name: 🚧 Prepare
|
||||
run: yarn global add lerna
|
||||
- name: 🚀 Bootstrap
|
||||
run: yarn bootstrap
|
||||
- name: ✅ Test
|
||||
run: yarn test
|
||||
|
||||
- name: 🔑 Generate Token
|
||||
uses: wow-actions/use-app-token@v2
|
||||
uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
env_name: bot_token
|
||||
|
||||
- name: 📦 Semantic Release
|
||||
run: pnpm srm --debug --comment-footer 'Thanks for being a part of the [AntV](https://github.com/antvis) community! 💪💯'
|
||||
run: |
|
||||
sh ./scripts/release
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GIT_AUTHOR_NAME: ${{ env.BOT_NAME }}
|
||||
GIT_AUTHOR_EMAIL: ${{ env.BOT_NAME }}@users.noreply.github.com
|
||||
GIT_COMMITTER_NAME: ${{ env.BOT_NAME }}
|
||||
GIT_COMMITTER_EMAIL: ${{ env.BOT_NAME }}@users.noreply.github.com
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
ACTION_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GIT_AUTHOR_NAME: x6-bot
|
||||
GIT_AUTHOR_EMAIL: x6-bot@users.noreply.github.com
|
||||
GIT_COMMITTER_NAME: x6-bot
|
||||
GIT_COMMITTER_EMAIL: x6-bot@users.noreply.github.com
|
||||
|
||||
- name: 🔀 Repository Dispatch
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ env.BOT_TOKEN }}
|
||||
token: ${{ env.bot_token }}
|
||||
event-type: released
|
||||
|
6
.github/workflows/report-monthly.yml
vendored
6
.github/workflows/report-monthly.yml
vendored
@ -6,11 +6,11 @@ jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/activity-report@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
|
6
.github/workflows/report-weekly.yml
vendored
6
.github/workflows/report-weekly.yml
vendored
@ -6,11 +6,11 @@ jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/activity-report@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
|
8
.github/workflows/slash-commands.yml
vendored
8
.github/workflows/slash-commands.yml
vendored
@ -1,3 +1,5 @@
|
||||
# https://github.com/wow-actions/slash-commands
|
||||
|
||||
name: 🔱 Slash Commands
|
||||
on:
|
||||
issue_comment:
|
||||
@ -6,12 +8,12 @@ jobs:
|
||||
cmd:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/slash-commands@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
CONFIG_FILE: .github/workflows/config/slash-commands.yml
|
||||
|
10
.github/workflows/stale.yml
vendored
10
.github/workflows/stale.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Warn and then close issues and PRs that have had no activity for a specified amount of time.
|
||||
|
||||
name: 👻 Stale
|
||||
on:
|
||||
schedule:
|
||||
@ -6,14 +8,14 @@ jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
- uses: actions/stale@v3
|
||||
env_name: bot_token
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
repo-token: ${{ env.BOT_TOKEN }}
|
||||
repo-token: ${{ env.bot_token }}
|
||||
stale-issue-message: |
|
||||
Hiya!
|
||||
|
||||
|
9
.github/workflows/sync-labels.yml
vendored
9
.github/workflows/sync-labels.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Update issue labels in repo as defined in /.github/workflows/config/labels.yml
|
||||
|
||||
name: 🔄 Sync Labels
|
||||
on:
|
||||
push:
|
||||
@ -9,13 +11,14 @@ jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: micnncim/action-label-syncer@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
with:
|
||||
manifest: .github/workflows/config/labels.yml
|
||||
|
2
.github/workflows/sync-to-gitee.yml
vendored
2
.github/workflows/sync-to-gitee.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Sync repo to https://gitee.com/
|
||||
#
|
||||
# https://github.com/marketplace/actions/gitee-pages-action
|
||||
# 配置步骤如下
|
||||
# 1. 在命令行终端或 Git Bash 使用命令 ssh-keygen -t rsa -C "youremail@example.com" 生成 SSH Key,注意替换为自己的邮箱。生成的 id_rsa 是私钥,id_rsa.pub 是公钥。(⚠️注意此处不要设置密码)
|
||||
|
12
.github/workflows/update-authors.yml
vendored
12
.github/workflows/update-authors.yml
vendored
@ -1,10 +1,10 @@
|
||||
# Automatically generate and update AUTHORS.txt.
|
||||
|
||||
name: 🎗 Update Authors
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
- next-major
|
||||
- alpha
|
||||
- beta
|
||||
jobs:
|
||||
@ -14,14 +14,12 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/update-authors@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
bots: false
|
||||
path: CONTRIBUTORS
|
||||
commit: 'chore: update CONTRIBUTORS [skip ci]'
|
||||
|
43
.github/workflows/update-cache.yaml
vendored
Normal file
43
.github/workflows/update-cache.yaml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
# Cache dependencies and build outputs to improve workflow execution time.
|
||||
# https://github.com/actions/cache
|
||||
|
||||
name: 🌈 Update Cache
|
||||
on:
|
||||
pull_request_target:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
- next-major
|
||||
- alpha
|
||||
- beta
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cache:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
steps:
|
||||
- name: ⤵️ Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: 🎉 Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: 🌱 Get Cache Directory
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- name: 🚸 Setup Cache
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: 🚧 Update Cache
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
yarn global add lerna
|
||||
lerna bootstrap
|
10
.github/workflows/update-contributors.yml
vendored
10
.github/workflows/update-contributors.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Update /CONTRIBUTORS.svg to include new contributors' avatars.
|
||||
|
||||
name: 🤝 Update Contributors
|
||||
on:
|
||||
schedule:
|
||||
@ -5,20 +7,18 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
- next-major
|
||||
- alpha
|
||||
- beta
|
||||
jobs:
|
||||
contributors:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/contributors-list@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
excludeUsers: semantic-release-bot ImgBotApp
|
||||
|
8
.github/workflows/update-license.yml
vendored
8
.github/workflows/update-license.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Renew the copyright notice in LICENSE at the beginning of every year.
|
||||
|
||||
name: 🔑 Update License
|
||||
on:
|
||||
schedule:
|
||||
@ -9,11 +11,11 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: FantasticFiasco/action-update-license-year@v2
|
||||
with:
|
||||
token: ${{ env.BOT_TOKEN }}
|
||||
token: ${{ env.bot_token }}
|
||||
|
8
.github/workflows/welcome.yml
vendored
8
.github/workflows/welcome.yml
vendored
@ -1,3 +1,5 @@
|
||||
# Comment a welcome message on an issue if it's the reporter's first issue.
|
||||
|
||||
name: 👋 Welcome
|
||||
on:
|
||||
pull_request_target:
|
||||
@ -8,14 +10,14 @@ jobs:
|
||||
welcome:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: wow-actions/use-app-token@v2
|
||||
- uses: wow-actions/use-app-token@v1
|
||||
with:
|
||||
app_id: ${{ secrets.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
|
||||
env_name: bot_token
|
||||
- uses: wow-actions/welcome@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ env.BOT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ env.bot_token }}
|
||||
FIRST_ISSUE: |
|
||||
👋 @{{ author }}
|
||||
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
.DS_Store
|
||||
.vscode
|
||||
.idea
|
||||
.turbo
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
lerna-debug.log
|
||||
@ -12,6 +11,3 @@ es
|
||||
dist
|
||||
*.pem
|
||||
!mock-cert.pem
|
||||
tmp
|
||||
test/coverage
|
||||
packages/**/src/style/raw.ts
|
||||
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx @commitlint/cli --edit "$1"
|
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
user="$(git config user.name)"
|
||||
whitelist=("bubkoo" "NewByVector")
|
||||
|
||||
if [[ ! " ${whitelist[@]} " =~ " ${user} " ]]; then
|
||||
if [ "$branch" = "master" ]; then
|
||||
echo "Push to master branch is forbidden."
|
||||
echo "Checkout your owne branch then submit a pr."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
@ -9,7 +9,6 @@
|
||||
"overrides": [
|
||||
{ "files": ".eslintrc", "options": { "parser": "json" } },
|
||||
{ "files": ".prettierrc", "options": { "parser": "json" } },
|
||||
{ "files": ".releaserc", "options": { "parser": "json" } },
|
||||
{ "files": ".stylelintrc", "options": { "parser": "json" } }
|
||||
]
|
||||
}
|
||||
|
56
.releaserc
56
.releaserc
@ -1,56 +0,0 @@
|
||||
{
|
||||
"branches": [
|
||||
"+([0-9])?(.{+([0-9]),x}).x",
|
||||
"master",
|
||||
"next",
|
||||
"next-major",
|
||||
{ "name": "beta", "prerelease": true },
|
||||
{ "name": "alpha", "prerelease": true }
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"@semantic-release/commit-analyzer",
|
||||
{
|
||||
"preset": "angular",
|
||||
"parserOpts": {
|
||||
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
|
||||
},
|
||||
"releaseRules": [
|
||||
{ "breaking": true, "release": "major" },
|
||||
{ "revert": true, "release": "patch" },
|
||||
{ "type": "feat", "release": "minor" },
|
||||
{ "type": "ci", "release": "patch" },
|
||||
{ "type": "build", "release": "patch" },
|
||||
{ "type": "chore", "release": "patch" },
|
||||
{ "type": "docs", "release": "patch" },
|
||||
{ "type": "perf", "release": "patch" },
|
||||
{ "type": "style", "release": "patch" },
|
||||
{ "type": "test", "release": "patch" },
|
||||
{ "type": "refactor", "release": "patch" },
|
||||
{ "scope": "no-release", "release": false }
|
||||
]
|
||||
}
|
||||
],
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/changelog",
|
||||
[
|
||||
"@semantic-release/npm",
|
||||
{
|
||||
"npmPublish": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
"addReleases": "bottom"
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": ["package.json", "CHANGELOG.md"],
|
||||
"message": "chore(release): ${nextRelease.gitTag} [skip ci]"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
19
.stylelintrc
19
.stylelintrc
@ -1,20 +1,3 @@
|
||||
{
|
||||
"extends": [
|
||||
"stylelint-config-standard",
|
||||
"stylelint-config-rational-order",
|
||||
"stylelint-config-prettier"
|
||||
],
|
||||
"plugins": [
|
||||
"stylelint-order",
|
||||
"stylelint-declaration-block-no-ignored-properties"
|
||||
],
|
||||
"rules": {
|
||||
"block-no-empty": null,
|
||||
"function-name-case": "lower",
|
||||
"comment-empty-line-before": null,
|
||||
"no-invalid-double-slash-comments": null,
|
||||
"no-descending-specificity": null,
|
||||
"declaration-empty-line-before": null,
|
||||
"no-duplicate-selectors": null
|
||||
}
|
||||
"extends": ["@antv/stylelint-config"]
|
||||
}
|
||||
|
19
.travis.yml
Normal file
19
.travis.yml
Normal file
@ -0,0 +1,19 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 12
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
install:
|
||||
- npm install -g yarn
|
||||
- npm install -g lerna
|
||||
- yarn bootstrap
|
||||
script:
|
||||
- yarn build:dev
|
||||
# - yarn test
|
||||
# after_script:
|
||||
# - yarn coveralls
|
@ -1,5 +1,4 @@
|
||||
BARM <284942955@qq.com>
|
||||
Candy <563378816@qq.com>
|
||||
Chaoqi <HAN>
|
||||
Clifford <ajard>
|
||||
DaiGang <42136433+daigang666@users.noreply.github.com>
|
||||
@ -13,11 +12,9 @@ Indomi <indomi126@gmail.com>
|
||||
James <san>
|
||||
Jógvan <lse>
|
||||
Ken <ei>
|
||||
Limbo <49612796+JUST-Limbo@users.noreply.github.com>
|
||||
Lixu <37231473+wflixu@users.noreply.github.com>
|
||||
Lloyd <ho>
|
||||
Lyn <47809781+lyn-boyu@users.noreply.github.com>
|
||||
MOMO <329053928@qq.com>
|
||||
Mingfei <az8641683@163.com>
|
||||
MrMengJ <2646973632@qq.com>
|
||||
Naveen <172697+naveensrinivasan@users.noreply.github.com>
|
||||
@ -29,7 +26,6 @@ RuiLin <on>
|
||||
SSC <273702440@qq.com>
|
||||
Sindori <441933726@qq.com>
|
||||
Susan <527971893@qq.com>
|
||||
Thomas <eugne>
|
||||
Tony <>
|
||||
Utopia <greatauk11@gmail.com>
|
||||
XLZY <1017866168@qq.com>
|
||||
@ -46,7 +42,6 @@ daigang <1210242662@qq.com>
|
||||
doublewu <592581554@qq.com>
|
||||
iceytea <liyunheasap@yeah.net>
|
||||
jiqili <43718732+jiqili@users.noreply.github.com>
|
||||
kelin.zrh <34393362+AricZhu@users.noreply.github.com>
|
||||
kingshuaishuai <ken.wang@mrs.ai>
|
||||
kio <1421104933@qq.com>
|
||||
lijing666 <lijing241@yeah.net>
|
||||
@ -54,7 +49,6 @@ lopn <lopnxrp@126.com>
|
||||
luchunwei <luchunwei@gmail.com>
|
||||
luzhuang <364439895@qq.com>
|
||||
lvhuiyang <ilvhuiyang@gmail.com>
|
||||
myzxlin <myzxlin@163.com>
|
||||
newbyvector <vectorse@126.com>
|
||||
niexq <1879633916@qq.com>
|
||||
niexq <niexq@firstgrid.cn>
|
||||
@ -65,27 +59,22 @@ qu <33251372+Qujh97@users.noreply.github.com>
|
||||
sallen450 <qinghua10199@gmail.com>
|
||||
semantic-release-bot <semantic-release-bot@martynus.net>
|
||||
vector <vectorse@126.com>
|
||||
wenbei <38773084+wb-wenbei@users.noreply.github.com>
|
||||
wgf <34190465+evelope@users.noreply.github.com>
|
||||
wind <>
|
||||
wjqsummer <52412389+wjqsummer@users.noreply.github.com>
|
||||
wtzeng1 <wtzeng1@gmail.com>
|
||||
x6-bot <x6-bot@users.noreply.github.com>
|
||||
xrkffgg <xrkffgg@gmail.com>
|
||||
yaojin2070 <48686959+yaojin2070@users.noreply.github.com>
|
||||
zdc1111 <39116292+zdc1111@users.noreply.github.com>
|
||||
€alix <qq287649920@gmail.com>
|
||||
九思⚡⚡⚡ <2228429150@qq.com>
|
||||
何腾飞 <avrin.live.cn@outlook.com>
|
||||
偏右 <afc163@gmail.com>
|
||||
小耀 <jinyue.gjy@antfin.com>
|
||||
崖 <bubkoo.wy@gmail.com>
|
||||
崖崖崖 <bubkoo.wy@gmail.com>
|
||||
文瑀 <wenyu.jqq@antfin.com>
|
||||
杨凌 <89915256@qq.com>
|
||||
柏愚 <boyu.zlj@antfin.com>
|
||||
粑粑超 <842486229@qq.com>
|
||||
诸岳 <dengfuping_private@163.com>
|
||||
金强强 <wenyu.jqq@antfin.com>
|
||||
问崖 <bubkoo.wy@gmail.com>
|
||||
问崖 <pengxingjian.pxj@antfin.com>
|
@ -41,7 +41,7 @@ No one can guarantee how much will be remembered about certain PR after some tim
|
||||
|
||||
### Style Guide
|
||||
|
||||
eslint can help to identify styling issues that may exist in your code. Your code is required to pass the test from eslint. Run the test locally by `$ npm run lint`.
|
||||
eslint can help to identify styling issues that may exist in your code. Your code is required to pass the test from eslint. Run the test locally by `$ yarn lint`.
|
||||
|
||||
### Commit Message Format
|
||||
|
||||
@ -110,8 +110,8 @@ Look at [these files](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJyg
|
||||
|
||||
X6 uses semantic versioning in release process based on [semver](https://semver.org/).
|
||||
|
||||
- [Publishing maintenance releases](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/release-workflow/maintenance-releases.md)
|
||||
- [Publishing pre-releases](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/release-workflow/pre-releases.md)
|
||||
- [Publishing maintenance releases](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/maintenance-releases.md)
|
||||
- [Publishing pre-releases](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/pre-releases.md)
|
||||
|
||||
### Branch Strategy
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 代码贡献规范
|
||||
|
||||
如果你有任何疑问,欢迎提交 [issue](https://github.com/antvis/x6/issues) 或 [PR](https://github.com/antvis/x6/pulls)!
|
||||
有任何疑问,欢迎提交 [issue](https://github.com/antvis/x6/issues) 或 [PR](https://github.com/antvis/x6/pulls)!
|
||||
|
||||
## 提交 issue
|
||||
|
||||
@ -41,7 +41,7 @@ $ git push origin branch-name
|
||||
|
||||
### 代码风格
|
||||
|
||||
你的代码风格必须通过 eslint,你可以运行 `$ npm run lint` 本地测试。
|
||||
你的代码风格必须通过 eslint,你可以运行 `$ yarn lint` 本地测试。
|
||||
|
||||
### Commit 提交规范
|
||||
|
||||
@ -109,8 +109,8 @@ BREAKING CHANGE:
|
||||
|
||||
## 发布管理
|
||||
|
||||
- [发布维护版本](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/release-workflow/maintenance-releases.md)
|
||||
- [发布预发版本](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/release-workflow/pre-releases.md)
|
||||
- [Publishing maintenance releases](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/maintenance-releases.md)
|
||||
- [Publishing pre-releases](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/pre-releases.md)
|
||||
|
||||
X6 基于 [semver](http://semver.org/lang/zh-CN/) 语义化版本号进行发布。
|
||||
|
||||
@ -121,7 +121,7 @@ X6 基于 [semver](http://semver.org/lang/zh-CN/) 语义化版本号进行发布
|
||||
|
||||
### 发布策略
|
||||
|
||||
在每个大版本的发布中,都会有一个PM,他在发布的不同阶段负有以下职责:
|
||||
每个大版本都有一个发布经理管理(PM),他/她要做的事情
|
||||
|
||||
#### 准备工作:
|
||||
|
||||
@ -135,6 +135,6 @@ X6 基于 [semver](http://semver.org/lang/zh-CN/) 语义化版本号进行发布
|
||||
|
||||
#### 发布时:
|
||||
|
||||
- 将老的稳定版本(master)备份到以当前大版本为名字的分支上(例如 `1.x`),并设置 tag 为 {v}.x( v 为当前版本,例如 `1.x`)。
|
||||
- 将老的稳定版本(master)备份到以当前大版本为名字的分支上(例如 `1.x`),并设置 tag 为 {v}.x`( v 为当前版本,例如 `1.x`)。
|
||||
- 发布新的稳定版本到 [npm](http://npmjs.com),并通知上层框架进行更新。
|
||||
- `npm publish` 之前,请先阅读[『我是如何发布一个 npm 包的』](https://fengmk2.com/blog/2016/how-i-publish-a-npm-package)。
|
||||
|
243
CONTRIBUTORS.svg
243
CONTRIBUTORS.svg
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 10 MiB After Width: | Height: | Size: 12 MiB |
179
README.en-us.md
179
README.en-us.md
@ -2,9 +2,10 @@
|
||||
|
||||
<p align="center"><img src="/flow.svg"></p>
|
||||
|
||||
<p align="center"><strong>Graph Editing Engine Of AntV</strong></p>
|
||||
<p align="center"><strong>JavaScript diagramming library that uses SVG and HTML for rendering</strong></p>
|
||||
|
||||
<p align="center"><a href="https://x6.antv.vision/en/docs/tutorial/about">Tutorials</a> · <a href="https://x6.antv.vision/en/examples/gallery">Examples</a> · <a href="https://x6.antv.vision/en/docs/api/graph">API</a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/antvis/X6/actions/workflows/ci.yml"><img alt="build" src="https://img.shields.io/github/workflow/status/antvis/x6/%F0%9F%91%B7%E3%80%80CI/master?logo=github&style=flat-square"></a>
|
||||
<a href="https://app.codecov.io/gh/antvis/X6"><img alt="coverage" src="https://img.shields.io/codecov/c/gh/antvis/x6?logo=codecov&style=flat-square&token=15CO54WYUV"></a>
|
||||
@ -22,22 +23,15 @@
|
||||
|
||||
## Features
|
||||
|
||||
- 🌱 Easy-to-customize: based on well known SVG/HTML/CSS or React/Vue/Angular to custom nodes and edges
|
||||
- 🚀 Out-of-the-box: built-in 10+ plugins, such as selection, dnd, redo/undo, snapline, minimap, etc.
|
||||
- 🧲 Data-driven: base on MVC architecture, you can focus on data logic and business logic
|
||||
- 💯 Highly-event-driven: you can react on any event that happens inside the graph
|
||||
|
||||
## Environment Support
|
||||
|
||||
- Modern browsers and Internet Explorer 11 (with polyfills)
|
||||
- Server-side Rendering
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
|
||||
- 🌱 easy-to-customize: based on well known SVG/HTML/CSS or React/Vue to custom nodes and edges
|
||||
- 🚀 out-of-the-box: built-in 10+ plugins, such as selection, dnd, redo/undo, snapline, minimap, etc.
|
||||
- 🧲 data-driven: base on MVC architecture, you can focus on data logic and business logic
|
||||
- 💯 highly-event-driven: you can react on any event that happens inside the graph
|
||||
|
||||
## Installation
|
||||
|
||||
### NPM/Yarn
|
||||
|
||||
```shell
|
||||
# npm
|
||||
$ npm install @antv/x6 --save
|
||||
@ -46,20 +40,51 @@ $ npm install @antv/x6 --save
|
||||
$ yarn add @antv/x6
|
||||
```
|
||||
|
||||
### CDNs
|
||||
|
||||
For learning purposes, you can use the latest version with one of the CDN:
|
||||
|
||||
- https://unpkg.com/@antv/x6/dist/x6.js
|
||||
- https://cdn.jsdelivr.net/npm/@antv/x6/dist/x6.js
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/antv-x6/1.3.20/x6.js
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/@antv/x6/dist/x6.js"></script>
|
||||
```
|
||||
|
||||
For production, we recommend linking to a specific version number to avoid unexpected breakage from newer versions:
|
||||
|
||||
- https://unpkg.com/@antv/x6@1.1.1/dist/x6.js
|
||||
- https://cdn.jsdelivr.net/npm/@antv/x6@1.1.1/dist/x6.js
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/antv-x6/1.1.1/x6.js
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/@antv/x6@1.1.1/dist/x6.js"></script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
**Step 1**: specify a container the render the diagram.
|
||||
|
||||
```html
|
||||
<div id="container" style="width: 600px; height: 400px"></div>
|
||||
```
|
||||
|
||||
```ts
|
||||
import { Graph } from '@antv/x6'
|
||||
**Step 2**: render nodes and edges.
|
||||
|
||||
```ts
|
||||
// import from node_modules
|
||||
import { Graph } from '@antv/x6'
|
||||
// or use the global variable `X6` exported from CDN links
|
||||
// const { Graph } = X6
|
||||
|
||||
// Create an instance of Graph.
|
||||
const graph = new Graph({
|
||||
container: document.getElementById('container'),
|
||||
grid: true
|
||||
})
|
||||
|
||||
// Render source node.
|
||||
const source = graph.addNode({
|
||||
x: 300,
|
||||
y: 40,
|
||||
@ -68,6 +93,7 @@ const source = graph.addNode({
|
||||
label: 'Hello',
|
||||
})
|
||||
|
||||
// Render target node.
|
||||
const target = graph.addNode({
|
||||
x: 420,
|
||||
y: 180,
|
||||
@ -76,39 +102,132 @@ const target = graph.addNode({
|
||||
label: 'World',
|
||||
})
|
||||
|
||||
// Render edge from source to target.
|
||||
graph.addEdge({
|
||||
source,
|
||||
target,
|
||||
})
|
||||
```
|
||||
|
||||
## Links
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*o4W3RLZicagAAAAAAAAAAAAAARQnAQ" alt="HelloWorld" />
|
||||
|
||||
- [Documents](https://x6.antv.vision/zh/docs/tutorial/about)
|
||||
- [Samples](https://x6.antv.vision/zh/examples/gallery)
|
||||
- [Blog](https://www.yuque.com/antv/x6/gcinvi)
|
||||
- [Versioning Release Note](https://www.yuque.com/antv/x6/bbfu6r)
|
||||
- [FAQ](https://www.yuque.com/antv/x6/be9pfx)
|
||||
- [CodeSanbox Template](https://codesandbox.io/s/qosj0?file=/src/app.tsx)
|
||||
## Documentation
|
||||
|
||||
- [About](https://x6.antv.vision/en/docs/tutorial/about)
|
||||
- [Getting Started](https://x6.antv.vision/en/docs/tutorial/getting-started)
|
||||
- [Basic Usage](https://x6.antv.vision/en/docs/tutorial/basic/graph)
|
||||
- [Advanced Practice](https://x6.antv.vision/en/docs/tutorial/intermediate/serialization)
|
||||
- [Senior Guidance](https://x6.antv.vision/en/docs/tutorial/advanced/animation)
|
||||
- [ChangeLog](https://x6.antv.vision/en/docs/tutorial/log)
|
||||
|
||||
## App Demos Build with X6
|
||||
|
||||
<center>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#flowchart" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*JSr-RbwCgmcAAAAAAAAAAAAAARQnAQ" alt="Flow"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#dag" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*RPiGRaSus3UAAAAAAAAAAAAAARQnAQ" alt="Dag"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#mindmap" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="200" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*GsEGSaBkc84AAAAAAAAAAAAAARQnAQ" alt="MindMap"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#bpmn" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="200" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*aPSySa8oz4sAAAAAAAAAAAAAARQnAQ" alt="BPMN"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#class" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*OaCpR7t_mVoAAAAAAAAAAAAAARQnAQ" alt="Class"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#org" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*FWx5SYDzLw4AAAAAAAAAAAAAARQnAQ" alt="ORG"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#er" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*7yVJQoM6-9AAAAAAAAAAAAAAARQnAQ" alt="ER"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#swimlane" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*mUVrSJMkP1UAAAAAAAAAAAAAARQnAQ" alt="SwimLane"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#tree" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*XDnNRqnj4WkAAAAAAAAAAAAAARQnAQ" alt="Tree"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#elk" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Z3ebTKy0w9cAAAAAAAAAAAAAARQnAQ" alt="ELK"/>
|
||||
</a>
|
||||
</center>
|
||||
|
||||
## Communication
|
||||
|
||||
Welcome to join the **X6 Communication Group** (Scan the QR Code to Join us). We also welcome the github [issues](https://github.com/antvis/x6/issues).
|
||||
|
||||
<a href="https://qr.dingtalk.com/action/joingroup?code=v1,k1,rOHuvgq5s0EHDktyyQJffDE3ZAmHnbB2e6iwn/w4BKs=&_dt_no_comment=1&origin=11" target="_blank" rel="noopener noreferrer">
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Up-4S4v8H-0AAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群1" width="375" />
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*4Y_5S7i26LAAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群2" width="375" />
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*KHB4QJAsW4QAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群3" width="375" />
|
||||
</a>
|
||||
|
||||
## Development
|
||||
|
||||
This repo is based on [lerna](https://github.com/lerna/lerna) with the following structure:
|
||||
|
||||
```
|
||||
.
|
||||
├── examples
|
||||
│ ├── x6-app-dag # example of dag graph
|
||||
│ ├── x6-app-draw # example of flowchart
|
||||
│ ├── x6-app-er # example of ER chart
|
||||
│ └── x6-example-features # example of basic features
|
||||
├── packages
|
||||
│ ├── x6 # X6
|
||||
│ ├── x6-react # wrap X6 with react(reserved)
|
||||
│ ├── x6-react-components # react componets to build graph apps
|
||||
│ ├── x6-react-shape # support render node with react
|
||||
│ └── x6-vue-shape # support render node with vue
|
||||
└── sites
|
||||
├── x6-sites # sites and documents
|
||||
├── x6-sites-demos # demos in documents
|
||||
└── x6-sites-demos-helper # tools to build demos
|
||||
```
|
||||
|
||||
We need to install some necessary global tools before getting started.
|
||||
|
||||
```shell
|
||||
# install yarn and lerna
|
||||
$ npm install yarn -g
|
||||
$ npm install lerna -g
|
||||
|
||||
# install deps and build
|
||||
$ pnpm install
|
||||
$ yarn bootstrap
|
||||
```
|
||||
|
||||
# enter the specified project development and debugging
|
||||
cd packages/x6
|
||||
pnpm run build:watch
|
||||
Then we can `cd` to dirs to development and debugging.
|
||||
|
||||
# start example to see the effect
|
||||
Such as, we can start `examples/x6-example-features` locally:
|
||||
|
||||
```shell
|
||||
cd examples/x6-example-features
|
||||
pnpm run start
|
||||
|
||||
yarn start
|
||||
```
|
||||
|
||||
When need to fix some bugs of X6, we can start with **watch** mode:
|
||||
|
||||
```shell
|
||||
cd packages/x6
|
||||
|
||||
// build esm to "em" dir
|
||||
yarn build:watch:esm
|
||||
|
||||
// build commonjs to "lib" dir
|
||||
yarn build:watch:cjs
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
To become a contributor, please follow our [contributing guide](/CONTRIBUTING.md). If you are an active contributor, you can apply to be a outside collaborator.
|
||||
Please let us know how can we help. Do check out [issues](https://github.com/antvis/x6/issues) for bug reports or suggestions first.
|
||||
|
||||
To become a contributor, please follow our [contributing guide](/CONTRIBUTING.md).
|
||||
|
||||
## Contributors
|
||||
|
||||
<a href="https://github.com/antvis/x6/graphs/contributors">
|
||||
<img src="/CONTRIBUTORS.svg" alt="Contributors" width="740" />
|
||||
|
193
README.md
193
README.md
@ -1,9 +1,10 @@
|
||||
简体中文 | [English](/README.en-us.md)
|
||||
|
||||
<p align="center"><img alt="flow" src="/flow.svg"></p>
|
||||
<p align="center"><img src="/flow.svg"></p>
|
||||
|
||||
<p align="center"><strong>X6 是 AntV 旗下的图编辑引擎</strong></p>
|
||||
<p align="center"><strong>提供简单易用的节点定制能力和开箱即用的交互组件,方便我们快速搭建流程图、DAG 图、ER 图等图应用</strong></p>
|
||||
<p align="center"><a href="https://x6.antv.vision/zh/docs/tutorial/about">教程</a> • <a href="https://x6.antv.vision/zh/examples/gallery">示例</a> • <a href="https://x6.antv.vision/zh/docs/api/graph">API</a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/antvis/X6/actions/workflows/ci.yml"><img alt="build" src="https://img.shields.io/github/workflow/status/antvis/x6/%F0%9F%91%B7%E3%80%80CI/master?logo=github&style=flat-square"></a>
|
||||
@ -20,24 +21,18 @@
|
||||
<a href="https://x6.antv.vision"><img alt="website" src="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=0076D6&style=flat-square&logo=google-chrome&logoColor=0076D6"></a>
|
||||
</p>
|
||||
|
||||
|
||||
## 特性
|
||||
|
||||
- 🌱 极易定制:支持使用 SVG/HTML/React/Vue/Angular 定制节点样式和交互
|
||||
- 🌱 极易定制:支持使用 SVG/HTML/React/Vue 定制节点样式和交互
|
||||
- 🚀 开箱即用:内置 10+ 图编辑配套扩展,如框选、对齐线、小地图等
|
||||
- 🧲 数据驱动:基于 MVC 架构,用户更加专注于数据逻辑和业务逻辑
|
||||
- 💯 事件驱动:完备的事件系统,可以监听图表内发生的任何事件
|
||||
|
||||
## 兼容环境
|
||||
|
||||
- 现代浏览器和 IE11(需要 polyfills)
|
||||
- 支持服务端渲染。
|
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br>Safari |
|
||||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| IE11, Edge | last 2 versions | last 2 versions | last 2 versions |
|
||||
|
||||
## 安装
|
||||
|
||||
### 使用 NPM/Yarn
|
||||
|
||||
```shell
|
||||
# npm
|
||||
$ npm install @antv/x6 --save
|
||||
@ -46,20 +41,51 @@ $ npm install @antv/x6 --save
|
||||
$ yarn add @antv/x6
|
||||
```
|
||||
|
||||
## 示例
|
||||
### 使用 CDN
|
||||
|
||||
可以使用下面任意一个最新版本的 CDN 地址:
|
||||
|
||||
- https://unpkg.com/@antv/x6/dist/x6.js
|
||||
- https://cdn.jsdelivr.net/npm/@antv/x6/dist/x6.js
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/antv-x6/1.3.20/x6.js
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/@antv/x6/dist/x6.js"></script>
|
||||
```
|
||||
|
||||
在生产环境中,建议使用指定版本号的链接,以避免版本更新带来的意外破坏:
|
||||
|
||||
- https://unpkg.com/@antv/x6@1.1.1/dist/x6.js
|
||||
- https://cdn.jsdelivr.net/npm/@antv/x6@1.1.1/dist/x6.js
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/antv-x6/1.1.1/x6.js
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/@antv/x6@1.1.1/dist/x6.js"></script>
|
||||
```
|
||||
|
||||
## 快速使用
|
||||
|
||||
**Step 1**: 指定渲染图的容器。
|
||||
|
||||
```html
|
||||
<div id="container" style="width: 600px; height: 400px"></div>
|
||||
```
|
||||
|
||||
```ts
|
||||
import { Graph } from '@antv/x6'
|
||||
**Step 2**: 渲染节点和边。
|
||||
|
||||
```ts
|
||||
// 从 node_modules 引入
|
||||
import { Graph } from '@antv/x6'
|
||||
// 从 CDN 引入时,我们暴露了 X6 这个全局变量
|
||||
// const { Graph } = X6
|
||||
|
||||
// 创建 Graph 的实例
|
||||
const graph = new Graph({
|
||||
container: document.getElementById('container'),
|
||||
grid: true
|
||||
})
|
||||
|
||||
// 渲染源节点
|
||||
const source = graph.addNode({
|
||||
x: 300,
|
||||
y: 40,
|
||||
@ -68,6 +94,7 @@ const source = graph.addNode({
|
||||
label: 'Hello',
|
||||
})
|
||||
|
||||
// 渲染目标节点
|
||||
const target = graph.addNode({
|
||||
x: 420,
|
||||
y: 180,
|
||||
@ -76,44 +103,138 @@ const target = graph.addNode({
|
||||
label: 'World',
|
||||
})
|
||||
|
||||
// 渲染边
|
||||
graph.addEdge({
|
||||
source,
|
||||
target,
|
||||
})
|
||||
```
|
||||
|
||||
## 链接
|
||||
渲染结果如下。
|
||||
|
||||
- [文档](https://x6.antv.vision/zh/docs/tutorial/about)
|
||||
- [示例](https://x6.antv.vision/zh/examples/gallery)
|
||||
- [博客](https://www.yuque.com/antv/x6/gcinvi)
|
||||
- [更新日志](https://www.yuque.com/antv/x6/bbfu6r)
|
||||
- [常见问题](https://www.yuque.com/antv/x6/be9pfx)
|
||||
- [CodeSanbox 模板](https://codesandbox.io/s/qosj0?file=/src/app.tsx)
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*o4W3RLZicagAAAAAAAAAAAAAARQnAQ" alt="HelloWorld" />
|
||||
|
||||
## 本地开发
|
||||
## 使用文档
|
||||
|
||||
```shell
|
||||
# 安装项目依赖和初始化构建
|
||||
$ pnpm install
|
||||
- [简介](https://x6.antv.vision/zh/docs/tutorial/about)
|
||||
- [快速上手](https://x6.antv.vision/zh/docs/tutorial/getting-started)
|
||||
- [基础教程](https://x6.antv.vision/zh/docs/tutorial/basic/graph)
|
||||
- [进阶实践](https://x6.antv.vision/zh/docs/tutorial/intermediate/serialization)
|
||||
- [高级指引](https://x6.antv.vision/zh/docs/tutorial/advanced/animation)
|
||||
- [更新日志](https://x6.antv.vision/zh/docs/tutorial/log)
|
||||
|
||||
# 进入到指定项目开发和调试
|
||||
cd packages/x6
|
||||
pnpm run build:watch
|
||||
## 应用案例
|
||||
|
||||
# 启动 example 查看效果
|
||||
cd examples/x6-example-features
|
||||
pnpm run start
|
||||
```
|
||||
<center>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#flowchart" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*JSr-RbwCgmcAAAAAAAAAAAAAARQnAQ" alt="Flow"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#dag" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*RPiGRaSus3UAAAAAAAAAAAAAARQnAQ" alt="Dag"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#mindmap" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="200" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*GsEGSaBkc84AAAAAAAAAAAAAARQnAQ" alt="MindMap"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#bpmn" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="200" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*aPSySa8oz4sAAAAAAAAAAAAAARQnAQ" alt="BPMN"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#class" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*OaCpR7t_mVoAAAAAAAAAAAAAARQnAQ" alt="Class"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#org" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*FWx5SYDzLw4AAAAAAAAAAAAAARQnAQ" alt="ORG"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#er" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*7yVJQoM6-9AAAAAAAAAAAAAAARQnAQ" alt="ER"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#swimlane" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*mUVrSJMkP1UAAAAAAAAAAAAAARQnAQ" alt="SwimLane"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#tree" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*XDnNRqnj4WkAAAAAAAAAAAAAARQnAQ" alt="Tree"/>
|
||||
</a>
|
||||
<a href="https://x6.antv.vision/zh/examples/showcase/practices#elk" target="_blank" rel="noopener noreferrer">
|
||||
<img width="400" height="250" style="margin-bottom: 20px" src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Z3ebTKy0w9cAAAAAAAAAAAAAARQnAQ" alt="ELK"/>
|
||||
</a>
|
||||
</center>
|
||||
|
||||
## 参与共建
|
||||
## 如何交流
|
||||
|
||||
如果希望参与到 X6 的开发中,请遵从我们的[贡献指南](/CONTRIBUTING.zh-CN.md)。如果你贡献度足够活跃,你可以申请成为社区协作者。
|
||||
如果你在使用的过程中碰到问题,可以先通过 [issues](https://github.com/antvis/x6/issues) 看看有没有类似的 bug 或者建议。欢迎提 [issues](https://github.com/antvis/x6/issues/new) 交流,也可以使用[钉钉](https://m.dingtalk.com/)扫描下面二维码加入**X6 交流群**。
|
||||
|
||||
<a href="https://github.com/antvis/x6/graphs/contributors">
|
||||
<img src="https://raw.githubusercontent.com/antvis/X6/master/CONTRIBUTORS.svg" alt="Contributors" />
|
||||
需要注意的是,提问题时请配上 [CodeSandbox](https://codesandbox.io/s/pensive-sound-f4nhc) 的复现代码,方便快速定位和解决问题。
|
||||
|
||||
<a href="https://qr.dingtalk.com/action/joingroup?code=v1,k1,rOHuvgq5s0EHDktyyQJffDE3ZAmHnbB2e6iwn/w4BKs=&_dt_no_comment=1&origin=11" target="_blank" rel="noopener noreferrer">
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*Up-4S4v8H-0AAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群1" width="260" />
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*4Y_5S7i26LAAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群2" width="260" />
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_43231b/afts/img/A*KHB4QJAsW4QAAAAAAAAAAAAAARQnAQ" alt="X6 图可视化交流群3" width="260" />
|
||||
</a>
|
||||
|
||||
## 如何开发
|
||||
|
||||
我们使用了 [lerna](https://github.com/lerna/lerna) 来管理项目,目录结构如下:
|
||||
|
||||
```
|
||||
.
|
||||
├── examples
|
||||
│ ├── x6-app-dag # dag 图示例
|
||||
│ ├── x6-app-draw # 流程图示例
|
||||
│ ├── x6-app-er # ER 图示例
|
||||
│ └── x6-example-features # 特性演示示例
|
||||
├── packages
|
||||
│ ├── x6 # X6
|
||||
│ ├── x6-react # X6 的 React 封装(预留)
|
||||
│ ├── x6-react-components # 配套 React 组件库
|
||||
│ ├── x6-react-shape # 支持使用 React 渲染节点
|
||||
│ └── x6-vue-shape # 支持使用 Vue 渲染节点
|
||||
└── sites
|
||||
├── x6-sites # 官网和文档
|
||||
├── x6-sites-demos # 文档中嵌入的 DEMO
|
||||
└── x6-sites-demos-helper # 构建文档 DEMO 的工具
|
||||
```
|
||||
|
||||
开始之前需要安装必要的全局依赖和初始化:
|
||||
|
||||
```shell
|
||||
# 全局安装 yarn 和 lerna 工具
|
||||
$ npm install yarn -g
|
||||
$ npm install lerna -g
|
||||
|
||||
# 安装项目依赖和初始化构建
|
||||
$ yarn bootstrap
|
||||
```
|
||||
|
||||
然后可以进入到指定项目开发和调试。
|
||||
|
||||
如本地启动 `examples/x6-example-features` 示例:
|
||||
|
||||
```shell
|
||||
cd examples/x6-example-features
|
||||
|
||||
yarn start
|
||||
```
|
||||
|
||||
修复 X6 的 BUG 时可以开启 watch 模式,配合上面启动的本地 DEMO,实时查看修复效果:
|
||||
|
||||
```shell
|
||||
cd packages/x6
|
||||
|
||||
// esm 模式,动态构建 es 产物
|
||||
yarn build:watch:esm
|
||||
|
||||
// commonjs 模式,动态构建 lib 产物
|
||||
yarn build:watch:cjs
|
||||
```
|
||||
|
||||
## 如何贡献
|
||||
|
||||
如果你在使用的过程中碰到问题,可以先通过 [issues](https://github.com/antvis/x6/issues) 看看有没有类似的 bug 或者建议。
|
||||
|
||||
如需提交代码,请遵从我们的[贡献指南](/CONTRIBUTING.zh-CN.md)。我们会收集贡献者的 Github 头像到下面贡献者清单中。
|
||||
|
||||
<a href="https://github.com/antvis/x6/graphs/contributors">
|
||||
<img src="/CONTRIBUTORS.svg" alt="Contributors" width="740" />
|
||||
</a>
|
||||
|
||||
## 开源协议
|
||||
|
||||
|
21
SECURITY.md
21
SECURITY.md
@ -1,21 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Use this section to tell people about which versions of your project are
|
||||
currently being supported with security updates.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 5.1.x | :white_check_mark: |
|
||||
| 5.0.x | :x: |
|
||||
| 4.0.x | :white_check_mark: |
|
||||
| < 4.0 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Use this section to tell people how to report a vulnerability.
|
||||
|
||||
Tell them where to go, how often they can expect to get an update on a
|
||||
reported vulnerability, what to expect if the vulnerability is accepted or
|
||||
declined, etc.
|
113
configs/eslint-config/CHANGELOG.md
Normal file
113
configs/eslint-config/CHANGELOG.md
Normal file
@ -0,0 +1,113 @@
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-11-14)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-11-08)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-11-08)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-11-07)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-11-05)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-11-03)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-11-01)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-22)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-19)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-12)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-12)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-08)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-02)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-02)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-09-30)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-09-22)
|
||||
|
||||
## @antv/eslint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/eslint-config@1.0.0...@antv/eslint-config@1.0.1) (2021-09-13)
|
||||
|
||||
# @antv/eslint-config 1.0.0 (2021-06-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix eslint errors ([06ba121](https://github.com/antvis/x6/commit/06ba121e3b937c5aeebbbe2b24e6db67fc141cb9))
|
||||
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add lint rules for *.js files ([21f5436](https://github.com/antvis/x6/commit/21f54366776a304e8abb9df087c645653fb22ed5))
|
||||
* ✨ add unicorn plugin ([3e8515b](https://github.com/antvis/x6/commit/3e8515bedf0da8ca10119c8a00ffd972f3a1e3aa))
|
||||
* ✨ support bitwise ([d9bc9d9](https://github.com/antvis/x6/commit/d9bc9d92e8bec74e780a44364f9e21da5f34096b))
|
||||
|
||||
# @antv/eslint-config 1.0.0 (2021-06-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix eslint errors ([06ba121](https://github.com/antvis/x6/commit/06ba121e3b937c5aeebbbe2b24e6db67fc141cb9))
|
||||
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add lint rules for *.js files ([21f5436](https://github.com/antvis/x6/commit/21f54366776a304e8abb9df087c645653fb22ed5))
|
||||
* ✨ add unicorn plugin ([3e8515b](https://github.com/antvis/x6/commit/3e8515bedf0da8ca10119c8a00ffd972f3a1e3aa))
|
||||
* ✨ support bitwise ([d9bc9d9](https://github.com/antvis/x6/commit/d9bc9d92e8bec74e780a44364f9e21da5f34096b))
|
||||
|
||||
# @antv/eslint-config 1.0.0 (2021-06-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix eslint errors ([06ba121](https://github.com/antvis/x6/commit/06ba121e3b937c5aeebbbe2b24e6db67fc141cb9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add lint rules for *.js files ([21f5436](https://github.com/antvis/x6/commit/21f54366776a304e8abb9df087c645653fb22ed5))
|
||||
* ✨ add unicorn plugin ([3e8515b](https://github.com/antvis/x6/commit/3e8515bedf0da8ca10119c8a00ffd972f3a1e3aa))
|
||||
* ✨ support bitwise ([d9bc9d9](https://github.com/antvis/x6/commit/d9bc9d92e8bec74e780a44364f9e21da5f34096b))
|
||||
|
||||
# @antv/eslint-config 1.0.0 (2021-06-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix eslint errors ([06ba121](https://github.com/antvis/x6/commit/06ba121e3b937c5aeebbbe2b24e6db67fc141cb9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add lint rules for *.js files ([21f5436](https://github.com/antvis/x6/commit/21f54366776a304e8abb9df087c645653fb22ed5))
|
||||
* ✨ add unicorn plugin ([3e8515b](https://github.com/antvis/x6/commit/3e8515bedf0da8ca10119c8a00ffd972f3a1e3aa))
|
||||
* ✨ support bitwise ([d9bc9d9](https://github.com/antvis/x6/commit/d9bc9d92e8bec74e780a44364f9e21da5f34096b))
|
||||
|
||||
# @antv/eslint-config 1.0.0 (2021-06-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix eslint errors ([06ba121](https://github.com/antvis/x6/commit/06ba121e3b937c5aeebbbe2b24e6db67fc141cb9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add lint rules for *.js files ([21f5436](https://github.com/antvis/x6/commit/21f54366776a304e8abb9df087c645653fb22ed5))
|
||||
* ✨ add unicorn plugin ([3e8515b](https://github.com/antvis/x6/commit/3e8515bedf0da8ca10119c8a00ffd972f3a1e3aa))
|
||||
* ✨ support bitwise ([d9bc9d9](https://github.com/antvis/x6/commit/d9bc9d92e8bec74e780a44364f9e21da5f34096b))
|
55
configs/eslint-config/package.json
Normal file
55
configs/eslint-config/package.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@antv/eslint-config",
|
||||
"version": "1.0.1",
|
||||
"main": "./lib/index.js",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "rimraf lib",
|
||||
"lint": "eslint 'src/**/*.{js,ts}?(x)' --fix",
|
||||
"build": "tsc --outDir ./lib",
|
||||
"build:watch": "yarn build --w",
|
||||
"prebuild": "run-s clean",
|
||||
"postinstall": "run-s build",
|
||||
"prepare": "run-s build",
|
||||
"precommit": "lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"eslint --fix"
|
||||
]
|
||||
},
|
||||
"inherits": [
|
||||
"@antv/x6-package-json/cli.json",
|
||||
"@antv/x6-package-json/eslint.json"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||
"@typescript-eslint/parser": "^4.31.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-jest": "^24.4.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"eslint-plugin-react": "^7.25.1",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-unicorn": "^36.0.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"lint-staged": "^11.1.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.4.0",
|
||||
"pretty-quick": "^3.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "^10.2.1",
|
||||
"typescript": "^4.4.3",
|
||||
"watch": "^1.0.2"
|
||||
}
|
||||
}
|
133
configs/eslint-config/src/index.ts
Normal file
133
configs/eslint-config/src/index.ts
Normal file
@ -0,0 +1,133 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
'eslint-comments',
|
||||
'import',
|
||||
'flowtype',
|
||||
'jest',
|
||||
'jsx-a11y',
|
||||
'prettier',
|
||||
'promise',
|
||||
'react',
|
||||
'react-hooks',
|
||||
'unicorn',
|
||||
],
|
||||
extends: [
|
||||
'airbnb-base',
|
||||
'eslint:recommended',
|
||||
'prettier',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:jsx-a11y/recommended',
|
||||
'plugin:import/errors',
|
||||
'plugin:import/warnings',
|
||||
'plugin:promise/recommended',
|
||||
'plugin:prettier/recommended',
|
||||
'plugin:react/recommended',
|
||||
'plugin:react-hooks/recommended',
|
||||
],
|
||||
env: {
|
||||
browser: true,
|
||||
commonjs: true,
|
||||
es6: true,
|
||||
jest: true,
|
||||
node: true,
|
||||
mocha: true,
|
||||
jasmine: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
// project: './tsconfig.json',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
requireConfigFile: false,
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'no-bitwise': 0,
|
||||
'no-continue': 0,
|
||||
'no-lonely-if': 0,
|
||||
'no-multi-assign': 0,
|
||||
'no-nested-ternary': 0,
|
||||
'no-inner-declarations': 0,
|
||||
'no-unused-expressions': 0,
|
||||
'max-classes-per-file': 0,
|
||||
'prefer-destructuring': 0,
|
||||
'class-methods-use-this': 0,
|
||||
'implicit-arrow-linebreak': 0,
|
||||
'lines-between-class-members': 0,
|
||||
'@typescript-eslint/lines-between-class-members': 0,
|
||||
'consistent-return': 0,
|
||||
'no-return-assign': [2, 'except-parens'],
|
||||
'no-param-reassign': [2, { props: false }],
|
||||
'no-cond-assign': [2, 'except-parens'],
|
||||
'no-console': [2, { allow: ['warn', 'error'] }],
|
||||
'@typescript-eslint/no-unused-expressions': [
|
||||
2,
|
||||
{ allowShortCircuit: true, allowTernary: true },
|
||||
],
|
||||
eqeqeq: [2, 'always', { null: 'ignore' }],
|
||||
'func-names': [1, 'never', { generators: 'as-needed' }],
|
||||
|
||||
'import/export': 0,
|
||||
'import/no-cycle': 0,
|
||||
'import/extensions': 0,
|
||||
'import/no-unresolved': 0,
|
||||
'import/prefer-default-export': 0,
|
||||
'import/no-extraneous-dependencies': 0,
|
||||
|
||||
'promise/always-return': 0,
|
||||
'promise/catch-or-return': 0,
|
||||
|
||||
'@typescript-eslint/no-namespace': 0,
|
||||
'@typescript-eslint/no-var-requires': 0,
|
||||
'@typescript-eslint/no-explicit-any': 0,
|
||||
'@typescript-eslint/no-non-null-assertion': 0,
|
||||
'@typescript-eslint/no-empty-function': 0,
|
||||
'@typescript-eslint/no-empty-interface': 0,
|
||||
'@typescript-eslint/explicit-module-boundary-types': 0,
|
||||
|
||||
'no-shadow': 0,
|
||||
'@typescript-eslint/no-shadow': 0,
|
||||
|
||||
camelcase: 0,
|
||||
'@typescript-eslint/camelcase': 0,
|
||||
|
||||
'no-use-before-define': 0,
|
||||
'@typescript-eslint/no-use-before-define': 0,
|
||||
|
||||
'no-useless-constructor': 0,
|
||||
'@typescript-eslint/no-useless-constructor': 0,
|
||||
|
||||
'no-unused-vars': 0,
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
2,
|
||||
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
|
||||
],
|
||||
|
||||
'no-redeclare': 0,
|
||||
'@typescript-eslint/no-redeclare': [2, { ignoreDeclarationMerge: true }],
|
||||
|
||||
'react/sort-comp': 0,
|
||||
'react/prop-types': 0,
|
||||
'react/jsx-props-no-spreading': 0,
|
||||
'react/destructuring-assignment': 0,
|
||||
'react/no-access-state-in-setstate': 0,
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.js'],
|
||||
rules: {
|
||||
'no-console': 0,
|
||||
'global-require': 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
5
configs/husky-config/commit-msg
Executable file
5
configs/husky-config/commit-msg
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
. "$(dirname "$0")/common.sh"
|
||||
|
||||
yarn commitlint --edit "$1"
|
1
configs/husky-config/common.sh
Normal file
1
configs/husky-config/common.sh
Normal file
@ -0,0 +1 @@
|
||||
echo
|
5
configs/husky-config/pre-commit
Executable file
5
configs/husky-config/pre-commit
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
. "$(dirname "$0")/common.sh"
|
||||
|
||||
yarn precommit
|
5
configs/husky-config/prepare-commit-msg
Executable file
5
configs/husky-config/prepare-commit-msg
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
. "$(dirname "$0")/common.sh"
|
||||
|
||||
npx devmoji -e --lint
|
5
configs/husky-config/prepush
Executable file
5
configs/husky-config/prepush
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
. "$(dirname "$0")/common.sh"
|
||||
|
||||
./scripts/pre-push-check
|
@ -10,19 +10,9 @@ module.exports = function (config, base, karmaTypescriptConfig) {
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: '.',
|
||||
|
||||
files: [{ pattern: './src/**/*.ts' }],
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [],
|
||||
|
||||
plugins: [
|
||||
'jasmine-core',
|
||||
'karma-jasmine',
|
||||
'karma-typescript',
|
||||
'karma-spec-reporter',
|
||||
'karma-chrome-launcher',
|
||||
],
|
||||
|
||||
frameworks: ['jasmine', 'karma-typescript'],
|
||||
|
||||
preprocessors: {
|
||||
@ -84,8 +74,7 @@ module.exports = function (config, base, karmaTypescriptConfig) {
|
||||
config.set(
|
||||
Object.assign(common, base, {
|
||||
karmaTypescriptConfig: {
|
||||
tsconfig: 'tsconfig.json',
|
||||
include: ['./src/**/*.ts'],
|
||||
tsconfig: './tsconfig.json',
|
||||
bundlerOptions: {
|
||||
sourceMap: true,
|
||||
transforms: [
|
159
configs/package-json/CHANGELOG.md
Normal file
159
configs/package-json/CHANGELOG.md
Normal file
@ -0,0 +1,159 @@
|
||||
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-06-07)
|
||||
|
||||
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-06-06)
|
||||
|
||||
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-06-05)
|
||||
|
||||
## @antv/x6-package-json [1.0.2](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.1...@antv/x6-package-json@1.0.2) (2022-05-31)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-14)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-08)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-08)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-07)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-05)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-03)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-11-01)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-22)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-19)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-12)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-12)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-08)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-02)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-02)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-09-30)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-09-22)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-09-13)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-31)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-24)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-18)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-17)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-16)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-06)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-06)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-08-03)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-07-27)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-07-22)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-07-21)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-07-21)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-07-10)
|
||||
|
||||
## @antv/x6-package-json [1.0.1](https://github.com/antvis/x6/compare/@antv/x6-package-json@1.0.0...@antv/x6-package-json@1.0.1) (2021-07-09)
|
||||
|
||||
# @antv/x6-package-json 1.0.0 (2021-06-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix karma can not process lodash-es ([f7ae6b1](https://github.com/antvis/x6/commit/f7ae6b1f6b961a01c58d8827a9aaa2d5a984a6e0))
|
||||
* 🐛 should only read json files ([af9d87f](https://github.com/antvis/x6/commit/af9d87fedccf4ba791db5570ca73228520107e2a))
|
||||
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add deps for jest ([4c831b8](https://github.com/antvis/x6/commit/4c831b84d032cc92f1c914143f4182772202620d))
|
||||
* ✨ add package inherit, compare commands ([d494b9f](https://github.com/antvis/x6/commit/d494b9f92e4e98816fb00acc02296bf5aa63f1b4))
|
||||
* ✨ sharing partial(devDependencies, peerDependencies, dependencies, scripts) package.json ([95c1112](https://github.com/antvis/x6/commit/95c1112c4e226c060dd94019f6ce5530a922a92f))
|
||||
* ✨ update vue deps ([37eae0b](https://github.com/antvis/x6/commit/37eae0b12502fba373d30153e0d1ac2085e843e8))
|
||||
|
||||
# @antv/x6-package-json 1.0.0 (2021-06-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix karma can not process lodash-es ([f7ae6b1](https://github.com/antvis/x6/commit/f7ae6b1f6b961a01c58d8827a9aaa2d5a984a6e0))
|
||||
* 🐛 should only read json files ([af9d87f](https://github.com/antvis/x6/commit/af9d87fedccf4ba791db5570ca73228520107e2a))
|
||||
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add deps for jest ([4c831b8](https://github.com/antvis/x6/commit/4c831b84d032cc92f1c914143f4182772202620d))
|
||||
* ✨ add package inherit, compare commands ([d494b9f](https://github.com/antvis/x6/commit/d494b9f92e4e98816fb00acc02296bf5aa63f1b4))
|
||||
* ✨ sharing partial(devDependencies, peerDependencies, dependencies, scripts) package.json ([95c1112](https://github.com/antvis/x6/commit/95c1112c4e226c060dd94019f6ce5530a922a92f))
|
||||
* ✨ update vue deps ([37eae0b](https://github.com/antvis/x6/commit/37eae0b12502fba373d30153e0d1ac2085e843e8))
|
||||
|
||||
# @antv/x6-package-json 1.0.0 (2021-06-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix karma can not process lodash-es ([f7ae6b1](https://github.com/antvis/x6/commit/f7ae6b1f6b961a01c58d8827a9aaa2d5a984a6e0))
|
||||
* 🐛 should only read json files ([af9d87f](https://github.com/antvis/x6/commit/af9d87fedccf4ba791db5570ca73228520107e2a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add deps for jest ([4c831b8](https://github.com/antvis/x6/commit/4c831b84d032cc92f1c914143f4182772202620d))
|
||||
* ✨ add package inherit, compare commands ([d494b9f](https://github.com/antvis/x6/commit/d494b9f92e4e98816fb00acc02296bf5aa63f1b4))
|
||||
* ✨ sharing partial(devDependencies, peerDependencies, dependencies, scripts) package.json ([95c1112](https://github.com/antvis/x6/commit/95c1112c4e226c060dd94019f6ce5530a922a92f))
|
||||
* ✨ update vue deps ([37eae0b](https://github.com/antvis/x6/commit/37eae0b12502fba373d30153e0d1ac2085e843e8))
|
||||
|
||||
# @antv/x6-package-json 1.0.0 (2021-06-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix karma can not process lodash-es ([f7ae6b1](https://github.com/antvis/x6/commit/f7ae6b1f6b961a01c58d8827a9aaa2d5a984a6e0))
|
||||
* 🐛 should only read json files ([af9d87f](https://github.com/antvis/x6/commit/af9d87fedccf4ba791db5570ca73228520107e2a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add deps for jest ([4c831b8](https://github.com/antvis/x6/commit/4c831b84d032cc92f1c914143f4182772202620d))
|
||||
* ✨ add package inherit, compare commands ([d494b9f](https://github.com/antvis/x6/commit/d494b9f92e4e98816fb00acc02296bf5aa63f1b4))
|
||||
* ✨ sharing partial(devDependencies, peerDependencies, dependencies, scripts) package.json ([95c1112](https://github.com/antvis/x6/commit/95c1112c4e226c060dd94019f6ce5530a922a92f))
|
||||
* ✨ update vue deps ([37eae0b](https://github.com/antvis/x6/commit/37eae0b12502fba373d30153e0d1ac2085e843e8))
|
||||
|
||||
# @antv/x6-package-json 1.0.0 (2021-06-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 fix karma can not process lodash-es ([f7ae6b1](https://github.com/antvis/x6/commit/f7ae6b1f6b961a01c58d8827a9aaa2d5a984a6e0))
|
||||
* 🐛 should only read json files ([af9d87f](https://github.com/antvis/x6/commit/af9d87fedccf4ba791db5570ca73228520107e2a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ add deps for jest ([4c831b8](https://github.com/antvis/x6/commit/4c831b84d032cc92f1c914143f4182772202620d))
|
||||
* ✨ add package inherit, compare commands ([d494b9f](https://github.com/antvis/x6/commit/d494b9f92e4e98816fb00acc02296bf5aa63f1b4))
|
||||
* ✨ sharing partial(devDependencies, peerDependencies, dependencies, scripts) package.json ([95c1112](https://github.com/antvis/x6/commit/95c1112c4e226c060dd94019f6ce5530a922a92f))
|
||||
* ✨ update vue deps ([37eae0b](https://github.com/antvis/x6/commit/37eae0b12502fba373d30153e0d1ac2085e843e8))
|
12
configs/package-json/angular.json
Normal file
12
configs/package-json/angular.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"peerDependencies": {
|
||||
"@angular/core": ">=10.2.3",
|
||||
"@angular/cdk": ">=10.2.3",
|
||||
"@angular/common": "^10.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/core": "^10.2.3",
|
||||
"@angular/cdk": "^10.2.3",
|
||||
"@angular/common": "^10.2.3"
|
||||
}
|
||||
}
|
8
configs/package-json/antd.json
Normal file
8
configs/package-json/antd.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"peerDependencies": {
|
||||
"antd": ">=4.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"antd": "^4.4.2"
|
||||
}
|
||||
}
|
3
configs/package-json/bin/package-compare.js
Executable file
3
configs/package-json/bin/package-compare.js
Executable file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
require('../lib/compare/cli')
|
5
configs/package-json/bin/package-inherit.js
Executable file
5
configs/package-json/bin/package-inherit.js
Executable file
@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// @see https://github.com/microsoft/package-inherit
|
||||
|
||||
require('../lib/inherit/cli')
|
14
configs/package-json/cli.json
Normal file
14
configs/package-json/cli.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.9.1",
|
||||
"fs-extra": "^10.0.0",
|
||||
"lint-staged": "^11.1.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.4.0",
|
||||
"pretty-quick": "^3.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "^10.2.1",
|
||||
"typescript": "^4.4.3",
|
||||
"release-it": "^14.0.1"
|
||||
}
|
||||
}
|
18
configs/package-json/eslint.json
Normal file
18
configs/package-json/eslint.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||
"@typescript-eslint/parser": "^4.31.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-jest": "^24.4.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"eslint-plugin-react": "^7.25.1",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-unicorn": "^36.0.0"
|
||||
}
|
||||
}
|
8
configs/package-json/jest.json
Normal file
8
configs/package-json/jest.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.1",
|
||||
"coveralls": "^3.1.1",
|
||||
"jest": "^27.1.1",
|
||||
"ts-jest": "^27.0.5"
|
||||
}
|
||||
}
|
16
configs/package-json/karma.json
Normal file
16
configs/package-json/karma.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "^3.9.0",
|
||||
"@types/sinon": "^10.0.2",
|
||||
"coveralls": "^3.1.1",
|
||||
"jasmine-core": "^3.9.0",
|
||||
"karma": "^6.3.4",
|
||||
"karma-chrome-launcher": "^3.1.0",
|
||||
"karma-cli": "^2.0.0",
|
||||
"karma-jasmine": "^4.0.1",
|
||||
"karma-spec-reporter": "^0.0.32",
|
||||
"karma-typescript": "5.3.0",
|
||||
"karma-typescript-es6-transform": "5.3.0",
|
||||
"sinon": "^11.1.2"
|
||||
}
|
||||
}
|
3
configs/package-json/karma.md
Normal file
3
configs/package-json/karma.md
Normal file
@ -0,0 +1,3 @@
|
||||
保持下面两个模块的版本,不然 x6 主包的测试跑步起来
|
||||
- "karma-typescript": "^5.3.0"
|
||||
- "karma-typescript-es6-transform": "^5.3.0"
|
11
configs/package-json/less.json
Normal file
11
configs/package-json/less.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"less": "^4.1.1",
|
||||
"stylelint": "^13.13.1",
|
||||
"stylelint-config-prettier": "^8.0.2",
|
||||
"stylelint-config-rational-order": "^0.1.2",
|
||||
"stylelint-config-standard": "^22.0.0",
|
||||
"stylelint-declaration-block-no-ignored-properties": "^2.4.0",
|
||||
"stylelint-order": "^4.1.0"
|
||||
}
|
||||
}
|
79
configs/package-json/package.json
Normal file
79
configs/package-json/package.json
Normal file
@ -0,0 +1,79 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@antv/x6-package-json",
|
||||
"version": "1.0.2",
|
||||
"bin": {
|
||||
"package-compare": "./bin/package-compare.js",
|
||||
"package-inherit": "./bin/package-inherit.js"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"bin"
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "rimraf lib",
|
||||
"lint": "eslint 'src/**/*.{js,ts}?(x)' --fix",
|
||||
"build": "tsc --outDir ./lib",
|
||||
"build:watch": "yarn build --w",
|
||||
"prebuild": "run-s clean",
|
||||
"postinstall": "run-s build",
|
||||
"prepare": "run-s build",
|
||||
"precommit": "lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"eslint --fix"
|
||||
]
|
||||
},
|
||||
"inherits": [
|
||||
"@antv/x6-package-json/cli.json",
|
||||
"@antv/x6-package-json/eslint.json",
|
||||
"@antv/x6-package-json/rollup.json"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^20.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||
"@rollup/plugin-replace": "^3.0.0",
|
||||
"@rollup/plugin-typescript": "^8.2.5",
|
||||
"@types/node": "^16.9.1",
|
||||
"@types/parse-package-name": "^0.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||
"@typescript-eslint/parser": "^4.31.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-jest": "^24.4.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"eslint-plugin-react": "^7.25.1",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-unicorn": "^36.0.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"lint-staged": "^11.1.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8.3.6",
|
||||
"prettier": "^2.4.0",
|
||||
"pretty-quick": "^3.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.56.3",
|
||||
"rollup-plugin-auto-external": "^2.0.0",
|
||||
"rollup-plugin-filesize": "^9.1.1",
|
||||
"rollup-plugin-postcss": "^4.0.1",
|
||||
"rollup-plugin-progress": "^1.1.2",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"ts-node": "^10.2.1",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"latest-version": "^5.1.0",
|
||||
"chalk": "^4.1.0",
|
||||
"detect-newline": "^3.1.0",
|
||||
"parse-package-name": "^0.1.0",
|
||||
"workspace-tools": "^0.18.4",
|
||||
"yargs-parser": "^20.2.7"
|
||||
}
|
||||
}
|
11
configs/package-json/react.json
Normal file
11
configs/package-json/react.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.6 || >=17.0.0",
|
||||
"react-dom": ">=16.8.6 || >=17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^16.9.13",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0"
|
||||
}
|
||||
}
|
16
configs/package-json/rollup.json
Normal file
16
configs/package-json/rollup.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^20.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||
"@rollup/plugin-replace": "^3.0.0",
|
||||
"@rollup/plugin-typescript": "^8.2.5",
|
||||
"postcss": "^8.3.6",
|
||||
"rollup": "^2.56.3",
|
||||
"rollup-plugin-auto-external": "^2.0.0",
|
||||
"rollup-plugin-filesize": "^9.1.1",
|
||||
"rollup-plugin-postcss": "^4.0.1",
|
||||
"rollup-plugin-progress": "^1.1.2",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"tslib": "^2.3.1"
|
||||
}
|
||||
}
|
6
configs/package-json/src/.eslintrc
Normal file
6
configs/package-json/src/.eslintrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../../../.eslintrc",
|
||||
"rules": {
|
||||
"no-console": 0
|
||||
}
|
||||
}
|
102
configs/package-json/src/compare/cli.ts
Normal file
102
configs/package-json/src/compare/cli.ts
Normal file
@ -0,0 +1,102 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import chalk from 'chalk'
|
||||
import latestVersion from 'latest-version'
|
||||
|
||||
const root = path.resolve(__dirname, '../../')
|
||||
const reserved = 'package.json'
|
||||
const sections = ['dependencies', 'devDependencies']
|
||||
const pad = (str: string, max: number) => {
|
||||
return str.length < max
|
||||
? `${str}${Array(max - str.length).join(' ')}`
|
||||
: `${str.substr(0, max - 4)}...`
|
||||
}
|
||||
|
||||
const pkgs = []
|
||||
const files = fs.readdirSync(root)
|
||||
files.forEach((name: string) => {
|
||||
const file = path.join(root, name)
|
||||
const stat = fs.statSync(file)
|
||||
if (stat.isFile() && path.extname(file) === '.json' && name !== reserved) {
|
||||
pkgs.push(file)
|
||||
}
|
||||
})
|
||||
|
||||
pkgs.unshift(path.resolve(__dirname, '../../../../', reserved))
|
||||
|
||||
const moduleNames: string[] = []
|
||||
pkgs.forEach((file) => {
|
||||
const content = fs.readFileSync(file, { encoding: 'utf-8' })
|
||||
const pkgJSON = JSON.parse(content)
|
||||
sections.forEach((section) => {
|
||||
const deps = pkgJSON[section]
|
||||
if (deps) {
|
||||
moduleNames.push(...Object.keys(deps))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
const paths = pkgs.map((file) => path.relative(process.cwd(), file))
|
||||
const maxFileLength = Math.max(...paths.map((item) => item.length)) + 2
|
||||
const maxNameLength = Math.min(
|
||||
Math.max(...moduleNames.map((item) => item.length)) + 2,
|
||||
40,
|
||||
)
|
||||
const maxSectionLength = Math.max(...sections.map((item) => item.length)) + 2
|
||||
const log = (
|
||||
pkg: string,
|
||||
section: string,
|
||||
name: string,
|
||||
local: string,
|
||||
remote: string,
|
||||
highlight?: boolean,
|
||||
) => {
|
||||
const line = `${pad(pkg, maxFileLength)} ${pad(
|
||||
section,
|
||||
maxSectionLength,
|
||||
)} ${pad(name, maxNameLength)} ${pad(local, 10)} ${remote}`
|
||||
console.log(highlight ? chalk.gray(line) : line)
|
||||
}
|
||||
|
||||
console.log()
|
||||
console.log(
|
||||
'Comapre packages local version with latest version on npm registry.',
|
||||
)
|
||||
console.log()
|
||||
|
||||
log('file', 'section', 'name', 'local', 'remote')
|
||||
console.log(
|
||||
Array(maxFileLength + maxSectionLength + maxNameLength + 21).join('-'),
|
||||
)
|
||||
|
||||
pkgs.forEach((file) => {
|
||||
const content = fs.readFileSync(file, { encoding: 'utf-8' })
|
||||
const pkgJSON = JSON.parse(content)
|
||||
const defers: Promise<any>[] = []
|
||||
sections.forEach((section) => {
|
||||
const deps = pkgJSON[section]
|
||||
if (deps) {
|
||||
Object.keys(deps).forEach(async (name) => {
|
||||
const pkg = path.relative(process.cwd(), file)
|
||||
const local = deps[name]
|
||||
const defer = latestVersion(name).then((remote) => {
|
||||
return {
|
||||
pkg,
|
||||
section,
|
||||
name,
|
||||
local,
|
||||
remote,
|
||||
}
|
||||
})
|
||||
defers.push(defer)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Promise.all(defers).then((arr) => {
|
||||
arr.forEach(({ pkg, section, name, local, remote }) => {
|
||||
const localv = local.replace(/^[\^~]|>=/, '')
|
||||
log(pkg, section, name, local, remote, localv !== remote)
|
||||
})
|
||||
})
|
||||
})
|
21
configs/package-json/src/inherit/check.ts
Normal file
21
configs/package-json/src/inherit/check.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { collect } from './collect'
|
||||
|
||||
export function check(cwd: string, args: any) {
|
||||
const updatedInfo = collect(cwd)
|
||||
if (updatedInfo.modifiedPackages.length > 0) {
|
||||
const recoveryCommand = args.recovery || 'package-inherit update'
|
||||
console.error(
|
||||
`
|
||||
The inheritance of package.json is in an inconsistent state.
|
||||
These packages are inconsistent:
|
||||
|
||||
${updatedInfo.modifiedPackages.sort().join('\n')}
|
||||
|
||||
Please run the following command:
|
||||
> ${recoveryCommand}
|
||||
`,
|
||||
)
|
||||
} else {
|
||||
console.log('Nothing needs to be updated.')
|
||||
}
|
||||
}
|
42
configs/package-json/src/inherit/cli.ts
Normal file
42
configs/package-json/src/inherit/cli.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import yargsParser from 'yargs-parser'
|
||||
import { update } from './update'
|
||||
import { check } from './check'
|
||||
|
||||
const args = yargsParser(process.argv.slice(2))
|
||||
|
||||
const command = args._[0]
|
||||
|
||||
switch (command) {
|
||||
case 'update':
|
||||
update(process.cwd())
|
||||
break
|
||||
|
||||
case 'check':
|
||||
check(process.cwd(), args)
|
||||
break
|
||||
|
||||
default:
|
||||
console.log(`
|
||||
Usage: package-inherit [command] [--recovery]
|
||||
|
||||
This utility will update package.json in a monorepo to inherit from another
|
||||
package.json template. Currently, support the following sections to merge
|
||||
into the package.json
|
||||
|
||||
- scripts
|
||||
- dependencies
|
||||
- devDependencies
|
||||
- peerDependencies
|
||||
|
||||
Commands:
|
||||
|
||||
update updates the package.json for all packages in a monorepo to
|
||||
match inheritance.
|
||||
check checks all the package.json inheritance are consistent.
|
||||
|
||||
Options:
|
||||
|
||||
--recovery custom recovery command to show developers when the check has failed
|
||||
`)
|
||||
break
|
||||
}
|
102
configs/package-json/src/inherit/collect.ts
Normal file
102
configs/package-json/src/inherit/collect.ts
Normal file
@ -0,0 +1,102 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import parsePackageName from 'parse-package-name'
|
||||
import { PackageInfos } from 'workspace-tools/lib/types/PackageInfo'
|
||||
import { getPackageInfos } from 'workspace-tools/lib/getPackageInfos'
|
||||
|
||||
type KeyValue = { [key: string]: string }
|
||||
|
||||
export function collect(cwd: string) {
|
||||
const allPackages = getPackageInfos(cwd)
|
||||
const modifiedPackages: string[] = []
|
||||
const sections = [
|
||||
'devDependencies',
|
||||
'peerDependencies',
|
||||
'dependencies',
|
||||
'scripts',
|
||||
]
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const [pkg, pkgInfo] of Object.entries(allPackages)) {
|
||||
// workspace-tools typings are not comprehensive about what is possible,
|
||||
// so we force cast it
|
||||
const inherits = pkgInfo.inherits as string[]
|
||||
if (inherits) {
|
||||
const merged: { [section: string]: KeyValue } = {}
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const inherit of inherits) {
|
||||
const file = resolveInRepo(pkg, inherit, allPackages)
|
||||
if (!file) {
|
||||
throw new Error(`${file} does not exist`)
|
||||
}
|
||||
const inheritInfo = JSON.parse(fs.readFileSync(file, 'utf-8'))
|
||||
|
||||
// Merge inherit infos for given package together before checking
|
||||
// shouldUpdate. This will allows inherit check behavior to be
|
||||
// symmetric with update behavior, which updates packages defined
|
||||
// in multiple inherit files to their last occurrence.
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const section of sections) {
|
||||
merged[section] = {
|
||||
...merged[section],
|
||||
...inheritInfo[section],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const section of sections) {
|
||||
const prev = pkgInfo[section] as KeyValue
|
||||
const next = merged[section]
|
||||
|
||||
if (shouldUpdate(prev, next)) {
|
||||
const combined = { ...prev, ...next }
|
||||
const sorted: KeyValue = {}
|
||||
Object.keys(combined)
|
||||
.sort()
|
||||
.forEach(function (name) {
|
||||
sorted[name] = combined[name]
|
||||
})
|
||||
|
||||
pkgInfo[section] = sorted
|
||||
modifiedPackages.push(pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { allPackages, modifiedPackages }
|
||||
}
|
||||
|
||||
function resolveInRepo(
|
||||
pkg: string,
|
||||
inherit: string,
|
||||
allPackages: PackageInfos,
|
||||
) {
|
||||
const parsedInfo = parsePackageName(inherit)
|
||||
|
||||
if (parsedInfo.name === '.') {
|
||||
parsedInfo.name = pkg
|
||||
}
|
||||
|
||||
const info = allPackages[parsedInfo.name]
|
||||
if (info) {
|
||||
return path.join(path.dirname(info.packageJsonPath), parsedInfo.path)
|
||||
}
|
||||
}
|
||||
|
||||
function shouldUpdate(mine: KeyValue, theirs?: KeyValue) {
|
||||
if (!theirs) {
|
||||
return false
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const [key, value] of Object.entries(theirs)) {
|
||||
if (mine[key] !== value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
6
configs/package-json/src/inherit/index.ts
Normal file
6
configs/package-json/src/inherit/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
// Please see: https://github.com/microsoft/package-inherit
|
||||
|
||||
import { update } from './update'
|
||||
import { check } from './check'
|
||||
|
||||
export { update, check }
|
27
configs/package-json/src/inherit/update.ts
Normal file
27
configs/package-json/src/inherit/update.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import fs from 'fs'
|
||||
import os from 'os'
|
||||
import detectNewline from 'detect-newline'
|
||||
import { collect } from './collect'
|
||||
|
||||
export function update(cwd: string) {
|
||||
const updatedInfo = collect(cwd)
|
||||
if (updatedInfo.modifiedPackages.length > 0) {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const pkg of updatedInfo.modifiedPackages) {
|
||||
const info = updatedInfo.allPackages[pkg]
|
||||
const { packageJsonPath, ...output } = info
|
||||
|
||||
const newLine =
|
||||
detectNewline(fs.readFileSync(info.packageJsonPath, 'utf-8')) || os.EOL
|
||||
|
||||
fs.writeFileSync(
|
||||
info.packageJsonPath,
|
||||
JSON.stringify(output, null, 2).replace(/\n/g, newLine) + newLine,
|
||||
)
|
||||
}
|
||||
console.log(`Updated these packages: `)
|
||||
console.log(updatedInfo.modifiedPackages.sort().join('\n'))
|
||||
} else {
|
||||
console.log('Nothing needs to be updated.')
|
||||
}
|
||||
}
|
13
configs/package-json/vue.json
Normal file
13
configs/package-json/vue.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"vue-demi": "^0.7.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vue/composition-api": "^1.0.0-rc.6",
|
||||
"vue": "^2.6.12 || ^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/composition-api": "^1.0.0-rc.6",
|
||||
"vue": "^2.6.12"
|
||||
}
|
||||
}
|
26
configs/rollup-config.js
Normal file
26
configs/rollup-config.js
Normal file
@ -0,0 +1,26 @@
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
import replace from '@rollup/plugin-replace'
|
||||
import resolve from '@rollup/plugin-node-resolve'
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
import filesize from 'rollup-plugin-filesize'
|
||||
import typescript from '@rollup/plugin-typescript'
|
||||
|
||||
export default (config) => {
|
||||
const { plugins = [], ...others } = config
|
||||
return {
|
||||
input: './src/index.ts',
|
||||
plugins: [
|
||||
typescript({ declaration: false }),
|
||||
resolve(),
|
||||
commonjs(),
|
||||
replace({
|
||||
preventAssignment: true,
|
||||
'process.env.NODE_ENV': JSON.stringify('production'),
|
||||
}),
|
||||
terser(),
|
||||
filesize(),
|
||||
...plugins,
|
||||
],
|
||||
...others,
|
||||
}
|
||||
}
|
86
configs/stylelint-config/CHANGELOG.md
Normal file
86
configs/stylelint-config/CHANGELOG.md
Normal file
@ -0,0 +1,86 @@
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-11-14)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-11-08)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-11-08)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-11-07)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-11-05)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-11-03)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-11-01)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-22)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-19)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-12)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-12)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-08)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-02)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-02)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-10-01)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-09-30)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-09-22)
|
||||
|
||||
## @antv/stylelint-config [1.0.1](https://github.com/antvis/x6/compare/@antv/stylelint-config@1.0.0...@antv/stylelint-config@1.0.1) (2021-09-13)
|
||||
|
||||
# @antv/stylelint-config 1.0.0 (2021-06-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ sharing stylelint configurations ([5061c5d](https://github.com/antvis/x6/commit/5061c5ddf875f43578e8f0f81801151f80c51ee9))
|
||||
|
||||
# @antv/stylelint-config 1.0.0 (2021-06-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update dependencies and fix type errors ([#1103](https://github.com/antvis/x6/issues/1103)) ([056b862](https://github.com/antvis/x6/commit/056b862b4efe7dbdc559cac7194c2453996acc07))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ sharing stylelint configurations ([5061c5d](https://github.com/antvis/x6/commit/5061c5ddf875f43578e8f0f81801151f80c51ee9))
|
||||
|
||||
# @antv/stylelint-config 1.0.0 (2021-06-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ sharing stylelint configurations ([5061c5d](https://github.com/antvis/x6/commit/5061c5ddf875f43578e8f0f81801151f80c51ee9))
|
||||
|
||||
# @antv/stylelint-config 1.0.0 (2021-06-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ sharing stylelint configurations ([5061c5d](https://github.com/antvis/x6/commit/5061c5ddf875f43578e8f0f81801151f80c51ee9))
|
||||
|
||||
# @antv/stylelint-config 1.0.0 (2021-06-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* ✨ sharing stylelint configurations ([5061c5d](https://github.com/antvis/x6/commit/5061c5ddf875f43578e8f0f81801151f80c51ee9))
|
63
configs/stylelint-config/package.json
Normal file
63
configs/stylelint-config/package.json
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@antv/stylelint-config",
|
||||
"version": "1.0.1",
|
||||
"main": "./lib/index.js",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "rimraf lib",
|
||||
"lint": "eslint 'src/**/*.{js,ts}?(x)' --fix",
|
||||
"build": "tsc --outDir ./lib",
|
||||
"build:watch": "yarn build --w",
|
||||
"prebuild": "run-s clean",
|
||||
"postinstall": "run-s build",
|
||||
"prepare": "run-s build",
|
||||
"precommit": "lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"eslint --fix"
|
||||
]
|
||||
},
|
||||
"inherits": [
|
||||
"@antv/x6-package-json/cli.json",
|
||||
"@antv/x6-package-json/less.json",
|
||||
"@antv/x6-package-json/eslint.json"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||
"@typescript-eslint/parser": "^4.31.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb-base": "^14.2.1",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"eslint-plugin-jest": "^24.4.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"eslint-plugin-react": "^7.25.1",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-unicorn": "^36.0.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"less": "^4.1.1",
|
||||
"lint-staged": "^11.1.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.4.0",
|
||||
"pretty-quick": "^3.1.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"stylelint": "^13.13.1",
|
||||
"stylelint-config-prettier": "^8.0.2",
|
||||
"stylelint-config-rational-order": "^0.1.2",
|
||||
"stylelint-config-standard": "^22.0.0",
|
||||
"stylelint-declaration-block-no-ignored-properties": "^2.4.0",
|
||||
"stylelint-order": "^4.1.0",
|
||||
"ts-node": "^10.2.1",
|
||||
"typescript": "^4.4.3",
|
||||
"watch": "^1.0.2"
|
||||
}
|
||||
}
|
20
configs/stylelint-config/src/index.ts
Normal file
20
configs/stylelint-config/src/index.ts
Normal file
@ -0,0 +1,20 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'stylelint-config-standard',
|
||||
'stylelint-config-rational-order',
|
||||
'stylelint-config-prettier',
|
||||
],
|
||||
plugins: [
|
||||
'stylelint-order',
|
||||
'stylelint-declaration-block-no-ignored-properties',
|
||||
],
|
||||
rules: {
|
||||
'block-no-empty': null,
|
||||
'function-name-case': 'lower',
|
||||
'comment-empty-line-before': null,
|
||||
'no-invalid-double-slash-comments': null,
|
||||
'no-descending-specificity': null,
|
||||
'declaration-empty-line-before': null,
|
||||
'no-duplicate-selectors': null,
|
||||
},
|
||||
}
|
16
examples/x6-app-dag/.editorconfig
Executable file
16
examples/x6-app-dag/.editorconfig
Executable file
@ -0,0 +1,16 @@
|
||||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
3
examples/x6-app-dag/.eslintrc
Executable file
3
examples/x6-app-dag/.eslintrc
Executable file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "eslint-config-umi"
|
||||
}
|
20
examples/x6-app-dag/.gitignore
vendored
Normal file
20
examples/x6-app-dag/.gitignore
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/npm-debug.log*
|
||||
/yarn-error.log
|
||||
/yarn.lock
|
||||
/package-lock.json
|
||||
|
||||
# production
|
||||
/dist
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
|
||||
# umi
|
||||
/src/.umi
|
||||
/src/.umi-production
|
||||
/src/.umi-test
|
||||
/.env.local
|
8
examples/x6-app-dag/.prettierignore
Normal file
8
examples/x6-app-dag/.prettierignore
Normal file
@ -0,0 +1,8 @@
|
||||
**/*.md
|
||||
**/*.svg
|
||||
**/*.ejs
|
||||
**/*.html
|
||||
package.json
|
||||
.umi
|
||||
.umi-production
|
||||
.umi-test
|
14
examples/x6-app-dag/.prettierrc
Normal file
14
examples/x6-app-dag/.prettierrc
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"semi": false,
|
||||
"printWidth": 80,
|
||||
"overrides": [
|
||||
{
|
||||
"files": ".prettierrc",
|
||||
"options": {
|
||||
"parser": "json"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
24
examples/x6-app-dag/.umirc.ts
Normal file
24
examples/x6-app-dag/.umirc.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { defineConfig } from 'umi'
|
||||
|
||||
export default defineConfig({
|
||||
publicPath: './',
|
||||
routes: [
|
||||
{ path: '/', component: '@/pages/index' },
|
||||
{ path: '/apps/dag', component: '@/pages/index' },
|
||||
],
|
||||
theme: {
|
||||
'@ant-prefix': 'ant',
|
||||
'@menu-item-active-bg': '#f0f5ff',
|
||||
},
|
||||
extraBabelPlugins: [
|
||||
[
|
||||
'import',
|
||||
{
|
||||
libraryName: '@antv/x6-react-components',
|
||||
libraryDirectory: 'es',
|
||||
transformToDefaultImport: false,
|
||||
style: true,
|
||||
},
|
||||
],
|
||||
],
|
||||
})
|
3365
examples/x6-app-dag/CHANGELOG.md
Normal file
3365
examples/x6-app-dag/CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
15
examples/x6-app-dag/README.md
Normal file
15
examples/x6-app-dag/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# X6 DAG React demo project
|
||||
|
||||
## Getting Started
|
||||
|
||||
Install dependencies,
|
||||
|
||||
```bash
|
||||
$ yarn
|
||||
```
|
||||
|
||||
Start the dev server,
|
||||
|
||||
```bash
|
||||
$ yarn start
|
||||
```
|
0
examples/x6-app-dag/mock/.gitkeep
Normal file
0
examples/x6-app-dag/mock/.gitkeep
Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user