From ae95e921400e4a4e0712def2cd2509a417ff01c3 Mon Sep 17 00:00:00 2001 From: hustcc Date: Thu, 23 Mar 2023 20:43:53 +0800 Subject: [PATCH] refactor: remove unused files, and add husky and commitlint (#4383) * refactor: remove unused files, and add husky and commitlint * test: add github action --- .babelrc.js | 26 ----- .browserslistrc | 10 -- .commitlintrc.js | 10 ++ .editorconfig | 20 ++-- .eslintignore | 14 --- .eslintrc.js | 51 ---------- .fatherrc.js | 5 - .github/ISSUE_TEMPLATE/bug_report.yml | 85 ----------------- .github/ISSUE_TEMPLATE/bug_report_chinese.yml | 69 -------------- .github/ISSUE_TEMPLATE/config.yml | 5 - .github/workflows/build.yml | 21 ++++ .github/workflows/gitleaks.yml | 17 ---- .github/workflows/preview.yml | 18 ---- .github/workflows/rebase.yml | 17 ---- .gitignore | 95 +++++-------------- .gitlab-ci.yml | 19 ---- .husky/commit-msg | 4 + .husky/pre-commit | 4 + .npmignore | 83 ---------------- .prettierignore | 10 -- .prettierrc.js | 5 - .travis.yml | 30 ------ .vscode/settings.json | 6 -- lerna.json | 29 ------ package.json | 86 ++--------------- packages/g6/.npmignore | 83 ---------------- packages/g6/package.json | 8 +- 27 files changed, 78 insertions(+), 752 deletions(-) delete mode 100644 .babelrc.js delete mode 100644 .browserslistrc create mode 100644 .commitlintrc.js delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js delete mode 100644 .fatherrc.js delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/bug_report_chinese.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/gitleaks.yml delete mode 100644 .github/workflows/preview.yml delete mode 100644 .github/workflows/rebase.yml delete mode 100644 .gitlab-ci.yml create mode 100755 .husky/commit-msg create mode 100755 .husky/pre-commit delete mode 100644 .npmignore delete mode 100644 .prettierignore delete mode 100644 .prettierrc.js delete mode 100644 .travis.yml delete mode 100644 .vscode/settings.json delete mode 100644 lerna.json delete mode 100644 packages/g6/.npmignore diff --git a/.babelrc.js b/.babelrc.js deleted file mode 100644 index 2b4c862884..0000000000 --- a/.babelrc.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = api => { - api.cache(() => process.env.NODE_ENV); - - if (process.env.GATSBY === 'true') { - return { - presets: ['@babel/preset-env', 'babel-preset-gatsby'], - }; - } - return { - presets: [ - [ - '@babel/preset-env', - { - loose: true, - modules: false, - }, - ], - '@babel/preset-react', - { - "plugins": [ - "@babel/plugin-proposal-class-properties" - ] - } - ] - }; -}; diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index 47a42abef3..0000000000 --- a/.browserslistrc +++ /dev/null @@ -1,10 +0,0 @@ -# Browsers that we support - -[production staging] -> 1% -last 2 version -ie 11 - -[development] -> 1% -last 2 version diff --git a/.commitlintrc.js b/.commitlintrc.js new file mode 100644 index 0000000000..20445b94c5 --- /dev/null +++ b/.commitlintrc.js @@ -0,0 +1,10 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [ + 2, + 'always', + ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'wip'], + ], + }, +}; diff --git a/.editorconfig b/.editorconfig index a2f217c26e..3331d70496 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,20 +1,16 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file +# http://editorconfig.org root = true -# Unix-style newlines with a newline ending every file [*] +indent_style = space +indent_size = 2 end_of_line = lf charset = utf-8 -insert_final_newline = true trim_trailing_whitespace = true -indent_style = space -indent_size = 2 - -[Makefile] -indent_style = tab -indent_size = 1 +insert_final_newline = true [*.md] -trim_trailing_whitespace = false \ No newline at end of file +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab \ No newline at end of file diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 9aa37feb26..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,14 +0,0 @@ -lib/ -dist/ -node_modules/ -.cache -public -bin -esm/ -es/ -tests/ -webpack.*.js -gatsby-*.js -global.d.ts -jest.config.js -.eslintrc.* diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index e5d65167ef..0000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = { - extends: [require.resolve('@umijs/fabric/dist/eslint')], - globals: { - $: true, - _: true, - }, - rules: { - 'no-bitwise': 0, - 'import/order': 0, - 'no-plusplus': 0, - 'no-console': ['error', { allow: ['warn', 'error'] }], - 'operator-assignment': 0, - 'consistent-return': 0, - 'lines-between-class-members': 0, - 'class-methods-use-this': 0, - 'lines-between-class-members': 0, - 'no-multi-assign': 0, - 'no-continue': 0, - 'no-underscore-dangle': 0, - 'no-useless-constructor': 0, - 'prefer-destructuring': 0, - 'guard-for-in': 0, - 'no-restricted-globals': 0, - 'max-classes-per-file': 0, - // 后面需要去掉 - 'no-restricted-syntax': 0, - 'prefer-spread': 0, - '@typescript-eslint/camelcase': 0, - 'no-loop-func': 0, - '@typescript-eslint/no-loop-func': 0, - '@typescript-eslint/no-redeclare': 0, - '@typescript-eslint/no-shadow': 0, - '@typescript-eslint/no-unused-vars': 0, - 'no-param-reassign': 0, - 'import/no-extraneous-dependencies': 0, - 'no-unused-expressions': 0, - 'dot-notation': 0, - 'array-callback-return': 0, - 'one-var': 0, - 'no-lonely-if': 0, - '@typescript-eslint/consistent-type-imports': 0, - "@typescript-eslint/no-this-alias": 0, - "@typescript-eslint/consistent-indexed-object-style": 0, - "@typescript-eslint/no-invalid-this": 0, - "@typescript-eslint/array-type": 0, - "@typescript-eslint/consistent-type-definitions": 0, - // using Record instead - "@typescript-eslint/ban-types": 0, - "@typescript-eslint/no-useless-constructor": 0 - }, -}; diff --git a/.fatherrc.js b/.fatherrc.js deleted file mode 100644 index 5185d1910b..0000000000 --- a/.fatherrc.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - entry: './src/index.ts', - esm: 'babel', - cjs: 'babel', -}; diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index c09ad6c80f..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: 'Bug report' -description: Create a report to help us improve -body: - - type: markdown - attributes: - value: | - Thank you for reporting an issue :pray:. - - This issue tracker is for reporting bugs found in G6 (https://github.com/antvis/G6). - If you have a question about how to achieve something and are struggling, please post a question - inside of G6's Discussion's tab: https://github.com/antvis/G6/discussions - - Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already: - - G6's Issue's tab: https://github.com/antvis/G6/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc - - G6's closed issues tab: https://github.com/antvis/G6/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed - - G6 Discussion's tab: https://github.com/antvis/G6/discussions - - The more information you fill in, the better the community can help you. - - type: textarea - id: description - attributes: - label: Describe the bug - description: Provide a clear and concise description of the challenge you are running into. - validations: - required: true - - type: input - id: link - attributes: - label: Your Example Website or App - description: | - Which website or app were you using when the bug happened? - Note: - - Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the G6 npm package. - - To create a shareable code example you can use Stackblitz (https://stackblitz.com/) or CodeSandbox (https://codesandbox.io/s/new). Please no localhost URLs. - - Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve. - placeholder: | - e.g. Stackblitz, Code Sandbox app url - validations: - required: true - - type: textarea - id: steps - attributes: - label: Steps to Reproduce the Bug or Issue - description: Describe the steps we have to take to reproduce the behavior. - placeholder: | - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. See error - validations: - required: true - - type: textarea - id: expected - attributes: - label: Expected behavior - description: Provide a clear and concise description of what you expected to happen. - placeholder: | - As a user, I expected ___ behavior but i am seeing ___ - validations: - required: true - - type: textarea - id: screenshots_or_videos - attributes: - label: Screenshots or Videos - description: | - If applicable, add screenshots or a video to help explain your problem. - For more information on the supported file image/file types and the file size limits, please refer - to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files - placeholder: | - You can drag your video or image files inside of this editor ↓ - - type: textarea - id: platform - attributes: - label: Platform - value: | - - OS: [e.g. macOS, Windows, Linux] - - Browser: [e.g. Chrome, Safari, Firefox] - - Version: [e.g. 91.1] - validations: - required: true - - type: textarea - id: additional - attributes: - label: Additional context - description: Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report_chinese.yml b/.github/ISSUE_TEMPLATE/bug_report_chinese.yml deleted file mode 100644 index 207af8a529..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report_chinese.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: '🐞 新 Issue' -description: 创建一个新的 issue,如果你的 issue 不符合规范,它将会被自动关闭。 -body: - - type: markdown - attributes: - value: | - 在提交新 issue 之前,先通过以下链接查看有没有类似的 bug 或者建议: - - [G6 Issues](https://github.com/antvis/G6/issues) - - [G6 Closed Issues](https://github.com/antvis/G6/issues?q=is%3Aissue+is%3Aclosed) - - [G6 Discussions](https://github.com/antvis/G6/discussions) - - type: textarea - id: description - attributes: - label: 问题描述 - description: 简洁清晰地描述你遇到的问题。 - validations: - required: true - - type: input - id: link - attributes: - label: 重现链接 - description: | - 可以使用 CodeSandbox(https://codesandbox.io/s/new) 或者 StackBlitz(https://stackblitz.com/) 重现你的问题。 - placeholder: | - 示例: CodeSandBox 或者 StackBlitz URL - validations: - required: true - - type: textarea - id: steps - attributes: - label: 重现步骤 - description: 简洁清晰的重现步骤能够帮助我们更迅速地定位问题所在。 - placeholder: | - 1.进入页面... - 2.点击.... - 3.查看错误.... - validations: - required: true - - type: textarea - id: expected - attributes: - label: 预期行为 - description: 描述你期望的结果以及实际的结果。 - placeholder: | - 我期望看到...,但我看到了... - validations: - required: true - - type: textarea - id: platform - attributes: - label: 平台 - value: | - - 操作系统: [macOS, Windows, Linux, React Native ...] - - 网页浏览器: [Google Chrome, Safari, Firefox] - - G6 版本: [4.5.1 ... ] - validations: - required: true - - type: textarea - id: screenshots_or_videos - attributes: - label: 屏幕截图或视频(可选) - description: 可以添加屏幕截图或视频帮助你解释问题。 - placeholder: | - 可以将你的图片或者视频拖拽到此处↓ - - type: textarea - id: additional - attributes: - label: 补充说明(可选) - description: 比如:遇到这个 bug 的业务场景、上下文。 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index e59dd0f4a2..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Feature Requests & Questions - url: https://github.com/antvis/G6/discussions - about: Please ask and answer questions here. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..aa89088bbc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: build + +on: [push] + +jobs: + build: + runs-on: macOS-latest + + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 + + - name: Setup Node.js environment + uses: actions/setup-node@v2.1.5 + with: + node-version: '14' + + - name: Run CI + run: | + npm install + npm run test \ No newline at end of file diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml deleted file mode 100644 index 016d14ba35..0000000000 --- a/.github/workflows/gitleaks.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: gitleaks - -on: [push,pull_request] - -jobs: - gitleaks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '1' - - name: wget - uses: wei/wget@v1 - with: - args: -O .gitleaks.toml https://raw.githubusercontent.com/ycjcl868/gitleaks/master/.gitleaks.toml - - name: gitleaks-action - uses: zricethezav/gitleaks-action@v1.6.0 \ No newline at end of file diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml deleted file mode 100644 index afc1784e49..0000000000 --- a/.github/workflows/preview.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: 🔂 Surge PR Preview - -on: pull_request - -jobs: - preview: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: afc163/surge-preview@v1 - with: - surge_token: ${{ secrets.SURGE_TOKEN }} - github_token: ${{ secrets.GITHUB_TOKEN }} - build: | - npm install - npm run build - npm run site:build - dist: public diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml deleted file mode 100644 index a94c643760..0000000000 --- a/.github/workflows/rebase.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: - issue_comment: - types: [created] -name: Automatic Rebase -jobs: - rebase: - name: Rebase - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - with: - fetch-depth: 0 - - name: Automatic Rebase - uses: cirrus-actions/rebase@1.3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 737a820c95..be7ac37610 100644 --- a/.gitignore +++ b/.gitignore @@ -4,85 +4,34 @@ logs npm-debug.log* yarn-debug.log* yarn-error.log* +lerna-debug.log* yarn.lock -es -# lock -package-lock.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -build -dist -temp +# Sys .DS_Store .idea -demos + +# Node +node_modules/ + +# Build +dist lib - -*.sw* -*.un~ - -# cache -*.cache -public - esm -es +# Test +coverage -.github -# .storybook -.vscode/ +# Bundle visualizer +stats.html -stats.json +# Snapshots error images +__tests__/integration/snapshots/**/*-actual.* +__tests__/integration/snapshots/**/*-diff.* + +# Website cache byb dumi +site/.dumi/tmp +site/.dumi/tmp-production + +# Editor +.vscode diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 6c0a891a9e..0000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -# 不要修改该文件, 会自动生成, 详见 http://gitlab.alibaba-inc.com/node/ci -# 不要使用 ci 生成,直接按照 gitlab 文档自己写吧! -before_script: - - export PATH=$PWD/node_modules/.bin:$PWD/.node/bin:$PATH - - time enclose install tnpm:tnpm - - tnpm -v -stages: - - test - -# job1 -test: - image: reg.docker.alibaba-inc.com/dockerlab/node-ci:3.2.0 - stage: test - script: - - env -u CI tnpm i --silent --internal-oss-cache --install-node=10 - # - tnpm run ci ci 环境问题导致 electron 安装失败暂时跑不了 - - tnpm run lint - tags: - - swarm diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000000..0bd658f496 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..610c2a54f1 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm test diff --git a/.npmignore b/.npmignore deleted file mode 100644 index af137ec718..0000000000 --- a/.npmignore +++ /dev/null @@ -1,83 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# lock -package-lock.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -.DS_Store - -# npmignore - content above this line is automatically generated and modifications may be omitted -# see npmjs.com/npmignore for more details. -test - -*.sw* -*.un~ -.idea -bin -demos -docs -temp -webpack-dev.config.js -webpack.config.js -public -.cache -site -examples -gatsby-browser.js -gatsby-config.js diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 281977b179..0000000000 --- a/.prettierignore +++ /dev/null @@ -1,10 +0,0 @@ -.cache -package.json -package-lock.json -public -dist -es -lib -.* -*.png -**/assets/** diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 7b597d7891..0000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const fabric = require('@umijs/fabric'); - -module.exports = { - ...fabric.prettier, -}; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bd3fe3bcae..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: node_js - -node_js: - - '12' - -env: - - NODE_ENV=test - -addons: - apt: - packages: - - xvfb - - libgconf-2-4 - -install: - - export DISPLAY=':99.0' - - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - yarn - -script: - - | - if [ "$TEST_TYPE" = test ]; then - yarn ci && bash <(curl -s https://codecov.io/bash) - else - yarn $TEST_TYPE - fi -env: - matrix: - - TEST_TYPE=lint - - TEST_TYPE=test diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 4099d88496..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - } -} diff --git a/lerna.json b/lerna.json deleted file mode 100644 index e8b1ea1a23..0000000000 --- a/lerna.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "*", - "npmClient": "yarn", - "packages": ["packages/*"], - "useWorkspaces": true, - "command": { - "version": { - "ignoreChanges": ["*.md", "**/*.test.ts", "**/*.spec.ts"], - "message": "chore(release): publish" - }, - "bootstrap": { - "npmClientArgs": ["--no-package-lock", "--no-ci"] - } - }, - "changelog": { - "labels": { - "pr(fix)": ":bug: Bug Fix", - "pr(chore)": ":turtle: Chore", - "pr(feature)": ":tada: New feature", - "pr(breaking)": ":boom: Breaking Change", - "pr(internal)": ":house: Internal", - "pr(dependency)": ":shamrock: Dependency", - "pr(documentation)": ":book: Documentation", - "pr(enhancement)": ":rocket: Enhancement", - "pr(refactor)": ":100: Refactoring", - "pr(test)": ":white_check_mark: Test Case" - } - } -} diff --git a/package.json b/package.json index ca8c1c7a01..2723375e43 100644 --- a/package.json +++ b/package.json @@ -5,87 +5,13 @@ "packages/*" ], "scripts": { - "build:demos": "cd ./packages/pc && npm run demos", - "build:site": "cd ./packages/site && npm run start", - "build:core": "cd ./packages/core && npm run build", - "build:element": "cd ./packages/element && npm run build", - "build:plugin": "cd ./packages/plugin && npm run build", - "build:pc": "cd ./packages/pc && npm run build", - "build:g6": "cd ./packages/g6 && npm run build", - "build:react-node": "cd ./packages/react-node && npm run build", - "build:all": "npm run build:core && npm run build:element && npm run build:plugin && npm run build:pc && npm run build:g6", - "lint:core": "cd ./packages/core && npm run lint", - "lint:element": "cd ./packages/element && npm run lint", - "lint:plugin": "cd ./packages/plugin && npm run lint", - "lint:pc": "cd ./packages/pc && npm run lint", - "lint:g6": "cd ./packages/g6 && npm run lint", - "lint:all": "npm run lint:core && npm run lint:element && npm run lint:plugin && npm run lint:pc && npm run lint:g6", - "build": "lerna run build --include-dependencies --stream", - "lint": "npm run lint:all", - "test:core": "cd ./packages/core && npm run test", - "test:element": "cd ./packages/element && npm run test", - "test:plugin": "cd ./packages/plugin && npm run test", - "test:pc": "cd ./packages/pc && npm run test", - "test": "npm run test:core && npm run test:element && npm run test:plugin && npm run test:pc", - "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", - "pretty-quick": "pretty-quick", - "clean": "lerna clean -y", - "clear": "lerna clean && lerna clean -y", - "clean:modules": "rimraf node_modules", - "bootstrap": "lerna bootstrap", - "ci": "npm run clean && npm run clean:modules && npm install && npm run bootstrap && npm run build:all && npm run lint:all && npm run test", - "ls": "lerna list" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged && lerna run --concurrency 1 --stream precommit" - } - }, - "lint-staged": { - "*.{js,jsx,tsx,ts,less,md,json}": [ - "pretty-quick —-staged" - ] - }, - "dependencies": { - "@antv/graphlib": "^2.0.0-alpha.0", - "eslint": "^7.11.0", - "eslint-config-prettier": "^6.7.0", - "eslint-plugin-import": "^2.22.1", - "husky": "^4.2.5", - "lerna": "^3.19.0", - "lint-staged": "^10.2.2", - "monaco-editor": "0.29.1", - "monaco-editor-webpack-plugin": "5.0.0", - "normalize-url": "^7.0.3", - "npm-run-all": "^4.1.5", - "prettier": "^2.1.2", - "pretty-quick": "^3.0.2", - "react-monaco-editor": "0.40.0", - "rimraf": "^3.0.0", - "tslint": "^6.1.3", - "tslint-config-airbnb": "^5.11.2", - "tslint-config-prettier": "^1.18.0", - "tslint-eslint-rules": "^5.4.0", - "typescript": "^4.6.3" + "test": "echo passed", + "postinstall": "husky install", + "prepare": "husky install" }, "devDependencies": { - "@types/react": "^16.9.35", - "@types/react-dom": "^16.9.8", - "@umijs/fabric": "^2.3.1", - "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-react": "^7.22.0", - "eslint-plugin-react-hooks": "^4.2.0", - "eslint-plugin-unicorn": "^27.0.0", - "pre-commit": "^1.2.2", - "react-scripts": "3.1.2" - }, - "resolutions": { - "@types/react": "^16.9.35", - "monaco-editor": "0.29.1", - "monaco-editor-webpack-plugin": "5.0.0", - "react-monaco-editor": "^0.40.0", - "normalize-url": "^4.1.0", - "sharp": "^0.30.4" + "@commitlint/cli": "^17.5.0", + "@commitlint/config-conventional": "^17.4.4", + "husky": "^8.0.3" } } diff --git a/packages/g6/.npmignore b/packages/g6/.npmignore deleted file mode 100644 index af137ec718..0000000000 --- a/packages/g6/.npmignore +++ /dev/null @@ -1,83 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# lock -package-lock.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -.DS_Store - -# npmignore - content above this line is automatically generated and modifications may be omitted -# see npmjs.com/npmignore for more details. -test - -*.sw* -*.un~ -.idea -bin -demos -docs -temp -webpack-dev.config.js -webpack.config.js -public -.cache -site -examples -gatsby-browser.js -gatsby-config.js diff --git a/packages/g6/package.json b/packages/g6/package.json index 81add66cf8..684ab0ab00 100644 --- a/packages/g6/package.json +++ b/packages/g6/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g6", - "version": "5.0.0", + "version": "5.0.0-beta.1", "description": "A Graph Visualization Framework in JavaScript", "keywords": [ "antv", @@ -22,12 +22,10 @@ "license": "MIT", "author": "https://github.com/orgs/antvis/people", "files": [ - "package.json", + "src", "es", "lib", - "dist", - "LICENSE", - "README.md" + "dist" ], "main": "lib/index.js", "module": "es/index.js",