chore: update scaffold

This commit is contained in:
chenshuai2144 2020-01-02 21:04:40 +08:00
parent aa9249d2fd
commit 29248e3473
10 changed files with 80 additions and 132 deletions

View File

@ -8,4 +8,5 @@ demos/
.cache
public
bin
esm/
esm/
es

View File

@ -1,43 +0,0 @@
{
"extends": [
"egg"
],
"globals": {
"$": true,
"_": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"html"
],
"rules": {
"no-console": [
"error",
{
"allow": [
"warn",
"error"
]
}
],
"no-bitwise": [
0
],
"experimentalDecorators": [
0
],
"comma-dangle": [
"error",
"never"
],
"linebreak-style": [
0
],
"no-loop-func": [
0
]
}
}

10
.eslintrc.js Normal file
View File

@ -0,0 +1,10 @@
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')],
globals: {
$: true,
_: true,
},
rules: {
'no-bitwise': 0,
},
};

5
.fatherrc.js Normal file
View File

@ -0,0 +1,5 @@
export default {
entry: 'plugins/index.ts',
esm: 'babel',
cjs: 'babel',
};

2
.gitignore vendored
View File

@ -5,6 +5,8 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock
lib
es
# lock
package-lock.json

View File

@ -1,8 +0,0 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"printWidth": 120,
"arrowParens": "always"
}

5
.prettierrc.js Normal file
View File

@ -0,0 +1,5 @@
const fabric = require('@umijs/fabric');
module.exports = {
...fabric.prettier,
};

View File

@ -2,10 +2,25 @@
"name": "@antv/g6",
"version": "3.3.0",
"description": "A Graph Visualization Framework in JavaScript",
"main": "dist/g6.js",
"module": "dist/g6.esm.js",
"types": "dist/types/index.d.ts",
"browser": "dist/g6.min.js",
"keywords": [
"antv",
"g6",
"graph",
"graph analysis",
"graph editor",
"graph visualization",
"relational data"
],
"homepage": "https://github.com/antvis/g6",
"bugs": {
"url": "https://github.com/antvis/g6/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/antvis/g6"
},
"license": "MIT",
"author": "https://github.com/orgs/antvis/people",
"files": [
"package.json",
"esm",
@ -14,25 +29,43 @@
"LICENSE",
"README.md"
],
"main": "dist/g6.js",
"module": "dist/g6.esm.js",
"browser": "dist/g6.min.js",
"types": "dist/types/index.d.ts",
"scripts": {
"start": "npm run site:develop",
"site:develop": "GATSBY=true gatsby develop --open",
"build": "father build && npm run build:declaration && npm run build:umd",
"build:declaration": "ttsc --emitDeclarationOnly --outDir ./dist",
"build:umd": "webpack --config webpack.config.js --mode production",
"ci": "npm run build && npm run coverage",
"clean": "rimraf esm lib dist",
"coverage": "jest --coverage",
"demos": "start-storybook -p 8080 -c .storybook",
"dist": "webpack --config webpack.config.js --mode production",
"doc": "rimraf apis && typedoc",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty \"./\"",
"prettier": "prettier -c --write \"**/*\"",
"site:build": "npm run site:clean && GATSBY=true gatsby build --prefix-paths",
"site:clean": "gatsby clean",
"watch": "father-build --esm --file g6 --watch src/index.ts",
"build": "father-build --esm --cjs --file g6 src/index.ts && npm run build:declaration && npm run build:umd",
"build:umd": "webpack --config webpack.config.js --mode production",
"build:declaration": "ttsc --emitDeclarationOnly --outDir ./dist",
"clean": "rimraf esm lib dist",
"lint": "lint-staged",
"tslint": "tslint -c tslint.json 'src/**/*.ts'",
"site:develop": "GATSBY=true gatsby develop --open",
"start": "npm run site:develop",
"test": "jest",
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/plugins/menu-spec.ts",
"coverage": "jest --coverage",
"ci": "run-s build coverage",
"doc": "rimraf apis && typedoc",
"dist": "webpack --config webpack.config.js --mode production",
"demos": "start-storybook -p 8080 -c .storybook"
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx",
"watch": "father build -w"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint"
}
},
"lint-staged": {
"**/*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write",
"git add"
],
"**/*.{js,jsx}": "npm run lint-staged:js",
"**/*.{js,ts,tsx}": "npm run lint-staged:js"
},
"dependencies": {
"@antv/dom-util": "^2.0.1",
@ -44,8 +77,7 @@
"@antv/path-util": "^2.0.3",
"@antv/scale": "^0.2.0",
"@antv/util": "~2.0.5",
"lodash": "^4.17.15",
"tslib": "^1.10.0"
"lodash": "^4.17.15"
},
"devDependencies": {
"@antv/gatsby-theme-antv": "^0.9.25",
@ -57,10 +89,11 @@
"@storybook/react": "^5.2.8",
"@types/jest": "^24.0.18",
"@types/node": "^12.12.22",
"@umijs/fabric": "^2.0.0",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.0.6",
"event-simulate": "~1.0.0",
"father-build": "^1.17.1",
"father": "^2.29.1",
"gatsby": "^2.17.9",
"gh-pages": "^2.1.1",
"husky": "^3.0.4",
@ -69,7 +102,6 @@
"jest-electron": "^0.1.7",
"jest-extended": "^0.11.2",
"lint-staged": "^9.2.3",
"npm-run-all": "^4.1.5",
"pre-commit": "^1.2.2",
"prettier": "^1.18.2",
"react": "^16.12.0",
@ -78,8 +110,6 @@
"rimraf": "^3.0.0",
"ts-jest": "^24.1.0",
"ts-loader": "^6.2.1",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"ttypescript": "^1.5.8",
"typedoc": "^0.15.0",
"typedoc-plugin-markdown": "^2.2.11",
@ -87,40 +117,5 @@
"typescript-transform-paths": "^1.1.14",
"webpack": "^4.41.4",
"webpack-cli": "^3.3.10"
},
"husky": {
"hooks": {
"pre-commit": "run-s lint"
}
},
"lint-staged": {
"*.{js,css,json,md}": [
"prettier --write",
"git add"
],
"*.{ts}": [
"tslint -c tslint.json --fix",
"prettier --write",
"git add"
]
},
"repository": {
"type": "git",
"url": "https://github.com/antvis/g6"
},
"bugs": {
"url": "https://github.com/antvis/g6/issues"
},
"keywords": [
"antv",
"g6",
"graph",
"relational data",
"graph visualization",
"graph editor",
"graph analysis"
],
"homepage": "https://github.com/antvis/g6",
"author": "https://github.com/orgs/antvis/people",
"license": "MIT"
}
}

View File

@ -1,18 +1,16 @@
{
"compilerOptions": {
"rootDir": "./",
"module": "esnext",
"declaration": true,
"sourceMap": true,
"target": "es5",
"outDir": "lib",
"jsx": "react",
"importHelpers": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["jest"],
"baseUrl": ".",
"paths": {
"@g6/*": ["./src/*"],
@ -25,7 +23,6 @@
}
]
},
"include": ["src"],
"typedocOptions": {
"mode": "modules",
"out": "docs/api-ts",

View File

@ -1,16 +0,0 @@
{
"defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-config-prettier"],
"jsRules": {},
"rules": {
"interface-name": false,
"variable-name": false,
"no-bitwise": false,
"only-arrow-functions": false,
"object-literal-sort-keys": false,
"no-empty": false,
"no-console": false,
"member-ordering": false
},
"rulesDirectory": []
}