From e653c3532144b3287d97ab1e073a0960fd99f815 Mon Sep 17 00:00:00 2001 From: lvisei Date: Thu, 2 Jun 2022 17:39:24 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=89=93=E5=8C=85=E6=96=B9=E5=BC=8F=20(#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .browserslistrc | 2 ++ .eslintignore | 2 ++ .fatherrc.ts | 15 +++++++++------ .github/ISSUE_TEMPLATE/----bug-report.md | 2 +- .github/ISSUE_TEMPLATE/---ask-for-question.md | 2 +- .gitignore | 2 ++ package.json | 18 ++++++++---------- .../CustomControl/{demo => demos}/default.tsx | 0 src/components/CustomControl/index.md | 2 +- .../LarkMap/{demo => demos}/default.tsx | 0 .../{demo => demos}/mapbox-instance.tsx | 0 .../use-layer/{demo => demos}/default.tsx | 0 .../LarkMap/hooks/use-layer/use-layer.md | 2 +- .../use-scene/{demo => demos}/default.tsx | 0 .../LarkMap/hooks/use-scene/use-scene.md | 2 +- src/components/LarkMap/index.md | 4 ++-- .../BubbleLayer/{demo => demos}/default.tsx | 0 src/components/Layers/BubbleLayer/index.md | 2 +- .../{demo => demos}/default.tsx | 0 .../{demo => demos}/xihu-district.json | 0 src/components/Layers/ChoroplethLayer/index.md | 2 +- src/version.ts | 2 +- tsconfig.build.json | 8 -------- tsconfig.json | 3 +-- 24 files changed, 34 insertions(+), 36 deletions(-) create mode 100644 .browserslistrc rename src/components/CustomControl/{demo => demos}/default.tsx (100%) rename src/components/LarkMap/{demo => demos}/default.tsx (100%) rename src/components/LarkMap/{demo => demos}/mapbox-instance.tsx (100%) rename src/components/LarkMap/hooks/use-layer/{demo => demos}/default.tsx (100%) rename src/components/LarkMap/hooks/use-scene/{demo => demos}/default.tsx (100%) rename src/components/Layers/BubbleLayer/{demo => demos}/default.tsx (100%) rename src/components/Layers/ChoroplethLayer/{demo => demos}/default.tsx (100%) rename src/components/Layers/ChoroplethLayer/{demo => demos}/xihu-district.json (100%) delete mode 100644 tsconfig.build.json diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 00000000..27b46ab2 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,2 @@ +IE 11 +last 2 versions diff --git a/.eslintignore b/.eslintignore index 537b7fae..18022ca3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,5 +2,7 @@ node_modules # don't lint build output (make sure it's set to your correct build folder name) dist +es +lib # don't lint nyc coverage output coverage diff --git a/.fatherrc.ts b/.fatherrc.ts index ad2cc84f..409b8ecb 100644 --- a/.fatherrc.ts +++ b/.fatherrc.ts @@ -1,9 +1,12 @@ export default { entry: 'src/index.ts', - umd: { - file: 'umd/larkmap', - name: 'LarkMap', - minFile: true, - sourcemap: true, - }, + esm: 'babel', + cjs: 'babel', + // https://github.com/umijs/father#umd + // umd: { + // file: 'larkmap', + // name: 'LarkMap', + // minFile: true, + // sourcemap: true, + // }, }; diff --git a/.github/ISSUE_TEMPLATE/----bug-report.md b/.github/ISSUE_TEMPLATE/----bug-report.md index cd86e11f..129c415d 100644 --- a/.github/ISSUE_TEMPLATE/----bug-report.md +++ b/.github/ISSUE_TEMPLATE/----bug-report.md @@ -10,7 +10,7 @@ assignees: '' ### 🐛 Bug description [Please make everyone to understand it] -> Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/l7plot-issue-template-ckpvq?file=/src/index.ts) or GitHub repo, a minimal reproduction. +> Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/larkmap-issue-template-c9m1hr) or GitHub repo, a minimal reproduction. - _Required_ **Link to minimal reproduction**: diff --git a/.github/ISSUE_TEMPLATE/---ask-for-question.md b/.github/ISSUE_TEMPLATE/---ask-for-question.md index 73b51ecf..b20c5f88 100644 --- a/.github/ISSUE_TEMPLATE/---ask-for-question.md +++ b/.github/ISSUE_TEMPLATE/---ask-for-question.md @@ -10,7 +10,7 @@ assignees: '' ### 💻 Link to minimal reproduction -Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/l7plot-issue-template-ckpvq?file=/src/index.ts) or GitHub repo. What is a minimal reproduction, and why is it required? +Please provide a link by forking these links [LarkMap](https://codesandbox.io/s/larkmap-issue-template-c9m1hr) or GitHub repo. What is a minimal reproduction, and why is it required? ### 🏞 Expected result diff --git a/.gitignore b/.gitignore index d76ee95d..383612ee 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ lerna-debug.log* node_modules/ # Build +lib +es dist docs-dist diff --git a/package.json b/package.json index 9df7ba4c..fcf1491b 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,14 @@ { "name": "@antv/larkmap", - "version": "0.0.1-alpha.1", + "version": "0.0.1-alpha.2", "description": "A React toolkit for geospatial visualization based on L7", "license": "MIT", - "main": "dist/lib/index.js", - "module": "dist/esm/index.js", - "types": "dist/lib/index.d.ts", + "main": "lib/index.js", + "module": "es/index.js", + "types": "es/index.d.ts", "files": [ - "dist" + "lib", + "es" ], "scripts": { "prepare": "husky install", @@ -21,10 +22,7 @@ "test-cover": "jest --coverage", "clean": "rimraf dist", "size": "limit-size", - "build:cjs": "tsc -p tsconfig.build.json --module commonjs --outDir dist/lib", - "build:esm": "tsc -p tsconfig.build.json --module ESNext --outDir dist/esm", - "build:umd": "father-build --clean=false && npm run size", - "build": "npm run clean && run-p build:cjs build:esm", + "build": "father-build", "docs:build": "dumi build", "docs:build-analyze": "ANALYZE=1 dumi build", "docs:deploy": "gh-pages -d docs-dist", @@ -76,7 +74,7 @@ }, "limit-size": [ { - "path": "dist/umd/larkmap.min.js", + "path": "dist/larkmap.min.js", "limit": "100 Kb" } ], diff --git a/src/components/CustomControl/demo/default.tsx b/src/components/CustomControl/demos/default.tsx similarity index 100% rename from src/components/CustomControl/demo/default.tsx rename to src/components/CustomControl/demos/default.tsx diff --git a/src/components/CustomControl/index.md b/src/components/CustomControl/index.md index 9e594d77..910b63a0 100644 --- a/src/components/CustomControl/index.md +++ b/src/components/CustomControl/index.md @@ -18,6 +18,6 @@ nav: ### 默认示例 - + diff --git a/src/components/LarkMap/demo/default.tsx b/src/components/LarkMap/demos/default.tsx similarity index 100% rename from src/components/LarkMap/demo/default.tsx rename to src/components/LarkMap/demos/default.tsx diff --git a/src/components/LarkMap/demo/mapbox-instance.tsx b/src/components/LarkMap/demos/mapbox-instance.tsx similarity index 100% rename from src/components/LarkMap/demo/mapbox-instance.tsx rename to src/components/LarkMap/demos/mapbox-instance.tsx diff --git a/src/components/LarkMap/hooks/use-layer/demo/default.tsx b/src/components/LarkMap/hooks/use-layer/demos/default.tsx similarity index 100% rename from src/components/LarkMap/hooks/use-layer/demo/default.tsx rename to src/components/LarkMap/hooks/use-layer/demos/default.tsx diff --git a/src/components/LarkMap/hooks/use-layer/use-layer.md b/src/components/LarkMap/hooks/use-layer/use-layer.md index 48c5b254..96eca851 100644 --- a/src/components/LarkMap/hooks/use-layer/use-layer.md +++ b/src/components/LarkMap/hooks/use-layer/use-layer.md @@ -14,7 +14,7 @@ group: ### 默认示例 - + ### API diff --git a/src/components/LarkMap/hooks/use-scene/demo/default.tsx b/src/components/LarkMap/hooks/use-scene/demos/default.tsx similarity index 100% rename from src/components/LarkMap/hooks/use-scene/demo/default.tsx rename to src/components/LarkMap/hooks/use-scene/demos/default.tsx diff --git a/src/components/LarkMap/hooks/use-scene/use-scene.md b/src/components/LarkMap/hooks/use-scene/use-scene.md index 31e9aed3..87f88e86 100644 --- a/src/components/LarkMap/hooks/use-scene/use-scene.md +++ b/src/components/LarkMap/hooks/use-scene/use-scene.md @@ -14,7 +14,7 @@ group: ### 默认示例 - + ### API diff --git a/src/components/LarkMap/index.md b/src/components/LarkMap/index.md index 42ad945e..10ee3c72 100644 --- a/src/components/LarkMap/index.md +++ b/src/components/LarkMap/index.md @@ -18,11 +18,11 @@ LarkMap 是地图容器组件,相关地图组件与 Hooks 需放到容器组 ### 通过配置项生成 - + ### 通过实例生成 - + ## API diff --git a/src/components/Layers/BubbleLayer/demo/default.tsx b/src/components/Layers/BubbleLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/BubbleLayer/demo/default.tsx rename to src/components/Layers/BubbleLayer/demos/default.tsx diff --git a/src/components/Layers/BubbleLayer/index.md b/src/components/Layers/BubbleLayer/index.md index d2ece4a5..fe39aa54 100644 --- a/src/components/Layers/BubbleLayer/index.md +++ b/src/components/Layers/BubbleLayer/index.md @@ -19,7 +19,7 @@ BubbleLayer 用于点数据展示,支持文本标注。 ### 默认示例 - + ## API diff --git a/src/components/Layers/ChoroplethLayer/demo/default.tsx b/src/components/Layers/ChoroplethLayer/demos/default.tsx similarity index 100% rename from src/components/Layers/ChoroplethLayer/demo/default.tsx rename to src/components/Layers/ChoroplethLayer/demos/default.tsx diff --git a/src/components/Layers/ChoroplethLayer/demo/xihu-district.json b/src/components/Layers/ChoroplethLayer/demos/xihu-district.json similarity index 100% rename from src/components/Layers/ChoroplethLayer/demo/xihu-district.json rename to src/components/Layers/ChoroplethLayer/demos/xihu-district.json diff --git a/src/components/Layers/ChoroplethLayer/index.md b/src/components/Layers/ChoroplethLayer/index.md index f0fc77ab..39c6cfa8 100644 --- a/src/components/Layers/ChoroplethLayer/index.md +++ b/src/components/Layers/ChoroplethLayer/index.md @@ -19,7 +19,7 @@ ChoroplethLayer 用于面数据展示,支持文本标注。 ### 默认示例 - + ## API diff --git a/src/version.ts b/src/version.ts index bc7a9437..6d51bd43 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export default '0.0.1-alpha.1'; +export default '0.0.1-alpha.2'; diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index f13095bf..00000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "rootDir": "src" - }, - "include": ["src/**/*"], - "exclude": ["src/.umi/*", "src/**/demo/*"] -} diff --git a/tsconfig.json b/tsconfig.json index 338e84dd..d7516213 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,10 +14,9 @@ "pretty": true, "lib": ["dom", "esnext"], "skipLibCheck": true, - "sourceRoot": "src", "baseUrl": "src", "outDir": "dist" }, "include": ["src/**/*", "__tests__/*", "typings.d.ts"], - "exclude": ["node_modules", "dist", "src/.umi/*"] + "exclude": ["node_modules", "es", "lib", "dist", "src/.umi/*"] }