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

@ -9,3 +9,4 @@ demos/
public public
bin 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-debug.log*
yarn-error.log* yarn-error.log*
yarn.lock yarn.lock
lib
es
# lock # lock
package-lock.json 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", "name": "@antv/g6",
"version": "3.3.0", "version": "3.3.0",
"description": "A Graph Visualization Framework in JavaScript", "description": "A Graph Visualization Framework in JavaScript",
"main": "dist/g6.js", "keywords": [
"module": "dist/g6.esm.js", "antv",
"types": "dist/types/index.d.ts", "g6",
"browser": "dist/g6.min.js", "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": [ "files": [
"package.json", "package.json",
"esm", "esm",
@ -14,25 +29,43 @@
"LICENSE", "LICENSE",
"README.md" "README.md"
], ],
"main": "dist/g6.js",
"module": "dist/g6.esm.js",
"browser": "dist/g6.min.js",
"types": "dist/types/index.d.ts",
"scripts": { "scripts": {
"start": "npm run site:develop", "build": "father build && npm run build:declaration && npm run build:umd",
"site:develop": "GATSBY=true gatsby develop --open", "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:build": "npm run site:clean && GATSBY=true gatsby build --prefix-paths",
"site:clean": "gatsby clean", "site:clean": "gatsby clean",
"watch": "father-build --esm --file g6 --watch src/index.ts", "site:develop": "GATSBY=true gatsby develop --open",
"build": "father-build --esm --cjs --file g6 src/index.ts && npm run build:declaration && npm run build:umd", "start": "npm run site:develop",
"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'",
"test": "jest", "test": "jest",
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/plugins/menu-spec.ts", "test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/plugins/menu-spec.ts",
"coverage": "jest --coverage", "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx",
"ci": "run-s build coverage", "watch": "father build -w"
"doc": "rimraf apis && typedoc", },
"dist": "webpack --config webpack.config.js --mode production", "husky": {
"demos": "start-storybook -p 8080 -c .storybook" "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": { "dependencies": {
"@antv/dom-util": "^2.0.1", "@antv/dom-util": "^2.0.1",
@ -44,8 +77,7 @@
"@antv/path-util": "^2.0.3", "@antv/path-util": "^2.0.3",
"@antv/scale": "^0.2.0", "@antv/scale": "^0.2.0",
"@antv/util": "~2.0.5", "@antv/util": "~2.0.5",
"lodash": "^4.17.15", "lodash": "^4.17.15"
"tslib": "^1.10.0"
}, },
"devDependencies": { "devDependencies": {
"@antv/gatsby-theme-antv": "^0.9.25", "@antv/gatsby-theme-antv": "^0.9.25",
@ -57,10 +89,11 @@
"@storybook/react": "^5.2.8", "@storybook/react": "^5.2.8",
"@types/jest": "^24.0.18", "@types/jest": "^24.0.18",
"@types/node": "^12.12.22", "@types/node": "^12.12.22",
"@umijs/fabric": "^2.0.0",
"awesome-typescript-loader": "^5.2.1", "awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"event-simulate": "~1.0.0", "event-simulate": "~1.0.0",
"father-build": "^1.17.1", "father": "^2.29.1",
"gatsby": "^2.17.9", "gatsby": "^2.17.9",
"gh-pages": "^2.1.1", "gh-pages": "^2.1.1",
"husky": "^3.0.4", "husky": "^3.0.4",
@ -69,7 +102,6 @@
"jest-electron": "^0.1.7", "jest-electron": "^0.1.7",
"jest-extended": "^0.11.2", "jest-extended": "^0.11.2",
"lint-staged": "^9.2.3", "lint-staged": "^9.2.3",
"npm-run-all": "^4.1.5",
"pre-commit": "^1.2.2", "pre-commit": "^1.2.2",
"prettier": "^1.18.2", "prettier": "^1.18.2",
"react": "^16.12.0", "react": "^16.12.0",
@ -78,8 +110,6 @@
"rimraf": "^3.0.0", "rimraf": "^3.0.0",
"ts-jest": "^24.1.0", "ts-jest": "^24.1.0",
"ts-loader": "^6.2.1", "ts-loader": "^6.2.1",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"ttypescript": "^1.5.8", "ttypescript": "^1.5.8",
"typedoc": "^0.15.0", "typedoc": "^0.15.0",
"typedoc-plugin-markdown": "^2.2.11", "typedoc-plugin-markdown": "^2.2.11",
@ -87,40 +117,5 @@
"typescript-transform-paths": "^1.1.14", "typescript-transform-paths": "^1.1.14",
"webpack": "^4.41.4", "webpack": "^4.41.4",
"webpack-cli": "^3.3.10" "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": { "compilerOptions": {
"rootDir": "./",
"module": "esnext", "module": "esnext",
"declaration": true, "declaration": true,
"sourceMap": true, "sourceMap": true,
"target": "es5", "target": "es5",
"outDir": "lib",
"jsx": "react",
"importHelpers": true, "importHelpers": true,
"moduleResolution": "node", "moduleResolution": "node",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["esnext", "dom"], "lib": ["esnext", "dom"],
"types": ["jest"],
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@g6/*": ["./src/*"], "@g6/*": ["./src/*"],
@ -25,7 +23,6 @@
} }
] ]
}, },
"include": ["src"],
"typedocOptions": { "typedocOptions": {
"mode": "modules", "mode": "modules",
"out": "docs/api-ts", "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": []
}