Skip to content

Commit

Permalink
feat: split package
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfu1 committed Jul 28, 2021
1 parent 8804e2c commit 80b09d6
Show file tree
Hide file tree
Showing 178 changed files with 2,629 additions and 2,935 deletions.
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
node_modules
/npm-debug.log*
/yarn-error.log
/yarn.lock
/package-lock.json

# production
/dist
/lib
/es
dist
lib
es
# misc
.DS_Store

Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ package.json
.umi
.umi-production
.umi-test
lib
es
dist
node_modules
15 changes: 15 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "*",
"npmClient": "npm",
"command": {
"publish": {
"ignoreChanges": ["*.md", "**/**/*.test.js"],
"message": "chore(release): publish",
"registry": "https://npm.pkg.github.com"
},
"bootstrap": {
"npmClientArgs": ["--no-package-lock", "--no-ci"]
}
},
"packages": ["packages/*"]
}
55 changes: 12 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,19 @@
{
"name": "@ant-design/charts",
"version": "1.2.4",
"description": "React translate g2plot",
"bugs": {
"url": "https://github.com/ant-design/ant-design-charts/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ant-design/ant-design-charts.git"
},
"main": "lib/index.js",
"unpkg": "dist/charts.min.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"files": [
"/lib",
"/es",
"/dist"
"name": "charts",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "run-s clean lib dist",
"ci": "npm run build && npm run test:coverage",
"clean": "rimraf lib es dist",
"chart": "node ./scripts/chart.js",
"deploy": "gh-pages -d dist",
"dev": "dumi dev",
"dist": "webpack --config webpack.config.js --mode production",
"start": "dumi dev",
"build": "npm-run-all --parallel build:*",
"build:plots": "tnpm run build --prefix ./packages/plots",
"build:graphs": "tnpm run build --prefix ./packages/graphs",
"build:flowchart": "tnpm run build --prefix ./packages/flowchart",
"build:charts": "tnpm run build --prefix ./packages/charts",
"profile": "webpack --config webpack.config.js --mode production --profile --json > stats.json",
"docs:build": "dumi build",
"lib": "run-p lib:*",
"lib:cjs": "tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib",
"lib:es": "tsc -p tsconfig.json --target ES5 --module ESNext --outDir es",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx --fix --format=pretty ./src && npm run lint:prettier",
"lint:prettier": "npm run prettier && git diff && prettier --version && prettier --check \"src/**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
"prettier": "prettier --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
"pub": "npm run build && np",
"start": "npm run dev",
"test": "umi-test",
"test:coverage": "umi-test --coverage"
},
"dependencies": {
"@antv/g2plot": "^2.2.11",
"@antv/g6": "^4.2.4",
"@antv/util": "^2.0.9",
"react-content-loader": "^5.0.4"
"bootstrap": "lerna bootstrap"
},
"devDependencies": {
"@antv/data-set": "^0.11.7",
Expand Down Expand Up @@ -93,8 +63,7 @@
"webpack-bundle-analyzer": "^3.9.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"whatwg-fetch": "^3.0.0",
"yorkie": "^2.0.0"
"whatwg-fetch": "^3.0.0"
},
"peerDependencies": {
"react": ">=16.8.4",
Expand Down
49 changes: 49 additions & 0 deletions packages/charts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@ant-design/charts",
"version": "2.0.0-beta.0",
"description": "AntV upper level visual component library",
"bugs": {
"url": "https://github.com/ant-design/ant-design-charts/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ant-design/ant-design-charts.git"
},
"main": "lib/index.js",
"unpkg": "dist/charts.min.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"files": [
"/lib",
"/es",
"/dist"
],
"scripts": {
"build": "run-s clean lib dist",
"ci": "npm run build && npm run test:coverage",
"clean": "rimraf lib es dist",
"dist": "webpack --config webpack.config.js --mode production",
"profile": "webpack --config webpack.config.js --mode production --profile --json > stats.json",
"lib": "run-p lib:*",
"lib:cjs": "tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib",
"lib:es": "tsc -p tsconfig.json --target ES5 --module ESNext --outDir es"
},
"dependencies": {
"@ant-design/plots": "^0.0.1",
"@ant-design/graphs": "^0.0.1",
"@ant-design/flowchart": "^0.0.1"
},
"peerDependencies": {
"react": ">=16.8.4",
"react-dom": ">=16.8.4"
},
"publishConfig": {
"access": "public"
},
"np": {
"yarn": false,
"contents": "dist"
},
"sideEffects": false,
"license": "MIT"
}
4 changes: 4 additions & 0 deletions packages/charts/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @ts-nocheck
export * from '@ant-design/plots';
export * from '@ant-design/flowchart';
export * from '@ant-design/graphs';
52 changes: 52 additions & 0 deletions packages/charts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"lib": ["esnext", "dom"],
"sourceMap": false,
"baseUrl": ".",
"jsx": "react",
"allowJs": false,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"experimentalDecorators": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "node",
"esModuleInterop": true,
"outDir": "dist",
"declaration": true
},
"exclude": [
"node_modules",
"build",
"dist",
"lib",
"es",
"config",
"scripts",
"webpack",
"jest",
"tslint:latest",
"tslint-config-prettier",
"example",
"_test_"
],
"include": [
"**/src/**/*",
"**/docs/**/*",
"scripts/**/*",
"**/demos",
".eslintrc.js",
"tests",
"jest.config.js",
"**/fixtures",
"./tests/no-duplicated.ts"
],
"paths": {
"@@/*": ["src/.umi/*"]
}
}
6 changes: 1 addition & 5 deletions webpack.config.js → packages/charts/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ process.env.NODE_ENV = 'production';

module.exports = {
entry: {
// charts: ['@babel/polyfill', './src/index.ts'],
charts: './src/index.charts.ts', // G2Plot 相关图表
charts_g6: './src/index.g6.ts', // 兼容旧代码
graphs: './src/index.g6.ts', // 关系图相关图表
charts_all: './src/index.ts', // 全量图表
charts: './src/index.ts', // G2Plot 相关图表
},
output: {
filename: '[name].min.js',
Expand Down
12 changes: 12 additions & 0 deletions packages/flowchart/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": ["last 1 version", "> 1%", "IE 9"]
}
}
]
]
}
52 changes: 52 additions & 0 deletions packages/flowchart/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@ant-design/flowchart",
"version": "0.0.1",
"description": "Flowchart",
"bugs": {
"url": "https://github.com/ant-design/ant-design-charts/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ant-design/ant-design-charts.git"
},
"main": "lib/index.js",
"unpkg": "dist/flowChart.min.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"files": [
"/lib",
"/es",
"/dist"
],
"scripts": {
"build": "run-s clean lib dist",
"ci": "npm run build && npm run test:coverage",
"clean": "rimraf lib es dist",
"dist": "webpack --config webpack.config.js --mode production",
"profile": "webpack --config webpack.config.js --mode production --profile --json > stats.json",
"lib": "run-p lib:*",
"lib:cjs": "tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib",
"lib:es": "tsc -p tsconfig.json --target ES5 --module ESNext --outDir es",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx --fix --format=pretty ./src && npm run lint:prettier",
"lint:prettier": "npm run prettier && git diff && prettier --version && prettier --check \"src/**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
"prettier": "prettier --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
"test": "umi-test",
"test:coverage": "umi-test --coverage"
},
"dependencies": {
"@antv/x6": "^1.25.0"
},
"peerDependencies": {
"react": ">=16.8.4",
"react-dom": ">=16.8.4"
},
"publishConfig": {
"access": "public"
},
"np": {
"yarn": false,
"contents": "dist"
},
"sideEffects": false,
"license": "MIT"
}
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions packages/flowchart/src/flowChart/graph/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React, { useEffect } from 'react';
import { Graph } from '@antv/x6';

const X6Graph: React.FC = (props) => {
const container = React.useRef(null);

useEffect(() => {
new Graph({
container: container.current as any,
width: 800,
height: 600,
});
}, []);

return <div ref={container} />;
};

export default X6Graph;
3 changes: 3 additions & 0 deletions packages/flowchart/src/flowChart/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import X6Graph from './graph';

export { X6Graph };
4 changes: 4 additions & 0 deletions packages/flowchart/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// X6
import { X6Graph } from './flowChart';

export { X6Graph };
3 changes: 3 additions & 0 deletions packages/flowchart/src/util/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { isType, clone, hasPath, setPath, deepClone } from './utils';

export { isType, clone, hasPath, setPath, deepClone };
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions packages/flowchart/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"lib": ["esnext", "dom"],
"sourceMap": false,
"baseUrl": ".",
"jsx": "react",
"allowJs": false,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"experimentalDecorators": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "node",
"esModuleInterop": true,
"outDir": "dist",
"declaration": true
},
"exclude": [
"node_modules",
"build",
"dist",
"lib",
"es",
"config",
"scripts",
"webpack",
"jest",
"tslint:latest",
"tslint-config-prettier",
"example",
"_test_"
],
"include": [
"**/src/**/*",
"**/docs/**/*",
"scripts/**/*",
"**/demos",
".eslintrc.js",
"tests",
"jest.config.js",
"**/fixtures",
"./tests/no-duplicated.ts"
],
"paths": {
"@@/*": ["src/.umi/*"]
}
}
Loading

0 comments on commit 80b09d6

Please sign in to comment.