From 02d448aedbc458537711fa35ace225568f4d17e4 Mon Sep 17 00:00:00 2001
From: Sh1-5 <1101646169@qq.com>
Date: Fri, 1 Dec 2023 17:55:08 +0800
Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=A9=BA?=
=?UTF-8?q?=E9=97=B4=E5=88=86=E6=9E=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../sites/main/groups/geospatial_analysis.ts | 19 +++++++++++++++++++
src/data/sites/main/index.ts | 6 +++---
2 files changed, 22 insertions(+), 3 deletions(-)
create mode 100644 src/data/sites/main/groups/geospatial_analysis.ts
diff --git a/src/data/sites/main/groups/geospatial_analysis.ts b/src/data/sites/main/groups/geospatial_analysis.ts
new file mode 100644
index 0000000..9a70466
--- /dev/null
+++ b/src/data/sites/main/groups/geospatial_analysis.ts
@@ -0,0 +1,19 @@
+import { IGroup } from '../../../types'
+export const GeospatialAnalysis: IGroup = {
+ icon: 'icon-a-shujuchuli1',
+ name: '空间分析',
+ en_name: 'data process',
+ order: 12,
+ children: [
+ {
+ icon: 'https://raw.githubusercontent.com/Turfjs/turf/9a1d5e8d99564d4080f1e2bf1517ed41d18012fa/logo.png',
+ name: 'Turf.js',
+ en_name: 'Turf.js',
+ description: '高级地理空间分析库',
+ en_description: 'Advanced geospatial analysis for browsers and Node.js',
+ site_url: 'https://turfjs.org/',
+ order: 1,
+ tags: ['GIS', 'Geospatial', 'Analysis']
+ }
+ ]
+}
diff --git a/src/data/sites/main/index.ts b/src/data/sites/main/index.ts
index a836a0b..0c95787 100644
--- a/src/data/sites/main/index.ts
+++ b/src/data/sites/main/index.ts
@@ -9,11 +9,10 @@ import { DataSource } from "./groups/data_source";
import { GeoCoding } from "./groups/geocoding";
import { OnlineMap } from "./groups/onlinemap";
import { RSPlatform } from "./groups/rs_platform";
-
+import { GeospatialAnalysis } from "./groups/geospatial_analysis";
import { Visulization } from "./groups/visualization";
-
export const MainConfig: ISiteConfig = {
name: "主站",
en_name: "main",
@@ -28,6 +27,7 @@ export const MainConfig: ISiteConfig = {
OnlineMap,
GeoCoding,
DataSource,
- RSPlatform
+ RSPlatform,
+ GeospatialAnalysis
].sort((a, b) => a.order - b.order),
};
From e8ff5dea49291598f5201b89ff48d0709aa24d0f Mon Sep 17 00:00:00 2001
From: Sh1-5 <1101646169@qq.com>
Date: Fri, 1 Dec 2023 18:30:54 +0800
Subject: [PATCH 2/2] =?UTF-8?q?build:=20=E4=BB=A3=E7=A0=81=E6=A0=A1?=
=?UTF-8?q?=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.editorconfig | 16 ++
.eslintrc.cjs | 42 +++++
.github/ISSUE_TEMPLATE/oscp.yml | 11 +-
.github/ISSUE_TEMPLATE/site_report.yml | 6 +-
.husky/commit-msg | 4 +
.husky/pre-commit | 4 +
.prettierignore | 3 +
.prettierrc | 7 +
README.md | 10 +-
commitlint.config.cjs | 3 +
package.json | 31 +++-
src/App.test.tsx | 14 +-
src/App.tsx | 50 +++---
src/components/app-content/index.tsx | 36 ++--
src/components/app-header/index.tsx | 32 ++--
src/components/app-search/index.css | 20 +--
src/components/app-search/index.tsx | 119 +++++++------
src/components/app-sider/index.tsx | 52 +++---
src/constants/index.ts | 6 +-
src/data/searchConfig.ts | 156 +++++++++---------
src/data/sites/index.ts | 8 +-
src/data/sites/main/groups/color_map.ts | 28 ++--
src/data/sites/main/groups/coord_convert.ts | 71 ++++----
.../sites/main/groups/data_collaboration.ts | 52 +++---
src/data/sites/main/groups/data_edit.ts | 53 +++---
.../sites/main/groups/data_format_convert.ts | 56 +++----
src/data/sites/main/groups/data_process.ts | 32 ++--
src/data/sites/main/groups/data_source.ts | 55 +++---
src/data/sites/main/groups/geocoding.ts | 11 +-
src/data/sites/main/groups/onlinemap.ts | 134 ++++++++-------
src/data/sites/main/groups/rs_platform.ts | 128 +++++++-------
src/data/sites/main/groups/visualization.ts | 51 +++---
src/data/sites/main/groups/weather.ts | 34 ++--
src/data/sites/main/index.ts | 61 ++++---
src/data/sites/tech/groups/3d_tiles.ts | 11 +-
src/data/sites/tech/groups/comand_tools.ts | 11 +-
src/data/sites/tech/groups/data_spec.ts | 11 +-
src/data/sites/tech/groups/frontEnd_tool.ts | 11 +-
src/data/sites/tech/groups/map_server.ts | 11 +-
src/data/sites/tech/groups/map_vis_lib.ts | 11 +-
src/data/sites/tech/groups/render_enigne.ts | 11 +-
.../sites/tech/groups/spatial_database.ts | 11 +-
src/data/sites/tech/groups/vector_tile.ts | 11 +-
src/data/sites/tech/index.ts | 11 +-
src/data/types.ts | 42 ++---
src/index.tsx | 18 +-
src/reportWebVitals.ts | 18 +-
src/setupTests.ts | 2 +-
tsconfig.json | 10 +-
49 files changed, 845 insertions(+), 751 deletions(-)
create mode 100644 .editorconfig
create mode 100644 .eslintrc.cjs
create mode 100755 .husky/commit-msg
create mode 100755 .husky/pre-commit
create mode 100644 .prettierignore
create mode 100644 .prettierrc
create mode 100644 commitlint.config.cjs
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..7100590
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+# EditorConfig is awesome: https://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+max_line_length = off
+trim_trailing_whitespace = false
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
new file mode 100644
index 0000000..6aa0f68
--- /dev/null
+++ b/.eslintrc.cjs
@@ -0,0 +1,42 @@
+module.exports = {
+ env: {
+ browser: true,
+ es2021: true,
+ node: true
+ },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:react/recommended',
+ 'plugin:react/jsx-runtime'
+ ],
+ overrides: [
+ {
+ env: {
+ node: true
+ },
+ files: ['.eslintrc.{js,cjs}'],
+ parserOptions: {
+ sourceType: 'script'
+ }
+ },
+ {
+ files: ['**/*.tsx'],
+ rules: {
+ 'react/prop-types': 'off'
+ }
+ }
+ ],
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ ecmaVersion: 'latest',
+ sourceType: 'module'
+ },
+ plugins: ['@typescript-eslint', 'react'],
+ rules: {
+ indent: ['error', 2],
+ 'linebreak-style': ['error', 'unix'],
+ quotes: ['error', 'single'],
+ semi: ['error', 'never']
+ }
+}
diff --git a/.github/ISSUE_TEMPLATE/oscp.yml b/.github/ISSUE_TEMPLATE/oscp.yml
index 017efd9..3287b14 100644
--- a/.github/ISSUE_TEMPLATE/oscp.yml
+++ b/.github/ISSUE_TEMPLATE/oscp.yml
@@ -1,5 +1,5 @@
name: 'AntV OSCP 计划'
-description: AntV 开源共建计划(AntV Open Source Contribution Plan,简称 AntV OSCP)
+description: AntV 开源共建计划(AntV Open Source Contribution Plan,简称 AntV OSCP)
body:
- type: checkboxes
id: AntV_OSCP_program
@@ -8,7 +8,7 @@ body:
description: |
AntV 开源共建计划(AntV Open Source Contribution Plan,简称 AntV OSCP) 期望可以基于 AntV 的开源 Roadmap 开放具体开发任务到社区,以社区共建任务的形式推动“AntV” 的开源发展,也期望有更多社区伙伴各各种形式参与到 AntV 的开源共建中,共同参与数据可视化开源生态的持续建设。
若有感兴趣想要认领的任务,可直接回复认领,如果你是首次认领可先完成[新手任务](https://www.yuque.com/antv/cyggvg/cwc9kacfvd9aivsp)
-
+
options:
- label: 我同意将这个 Issue 参与 OSCP 计划
validations:
@@ -28,7 +28,7 @@ body:
id: oscp_task_description
attributes:
label: 任务介绍
- description: |
+ description: |
简单描述任务背景信息,为了解决哪些问题
validations:
required: false
@@ -36,8 +36,7 @@ body:
id: oscp_task_info_description_2
attributes:
label: 参考说明
- description: |
- 提供一些可参考的demo,相关教程辅助用户解决问题
+ description: |
+ 提供一些可参考的demo,相关教程辅助用户解决问题
validations:
required: false
-
diff --git a/.github/ISSUE_TEMPLATE/site_report.yml b/.github/ISSUE_TEMPLATE/site_report.yml
index 552dd6a..596a368 100644
--- a/.github/ISSUE_TEMPLATE/site_report.yml
+++ b/.github/ISSUE_TEMPLATE/site_report.yml
@@ -8,7 +8,7 @@ body:
description: |
输入站点名称
placeholder: |
- https://l7editor.antv.antgroup.com/
+ https://l7editor.antv.antgroup.com/
validations:
required: true
- type: input
@@ -18,7 +18,7 @@ body:
description: |
输入站点 URL
placeholder: |
- https://l7editor.antv.antgroup.com/
+ https://l7editor.antv.antgroup.com/
validations:
required: true
- type: textarea
@@ -52,7 +52,7 @@ body:
- type: textarea
id: logo
attributes:
- label: 图标
+ label: 图标
description: 站点 logo 或 icon 图标, URL 地址或者复制图片
placeholder: |
可以将你的图片拖拽到此处↓
diff --git a/.husky/commit-msg b/.husky/commit-msg
new file mode 100755
index 0000000..1a089f4
--- /dev/null
+++ b/.husky/commit-msg
@@ -0,0 +1,4 @@
+#!/usr/bin/env 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 0000000..75fac8e
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+npm run lint
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..a032a61
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,3 @@
+build
+node_modules
+public
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..2944819
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,7 @@
+{
+ "useTabs": false,
+ "tabWidth": 2,
+ "singleQuote": true,
+ "trailingComma": "none",
+ "semi": false
+}
diff --git a/README.md b/README.md
index 0492724..f87d969 100644
--- a/README.md
+++ b/README.md
@@ -12,25 +12,27 @@ Inspired by [larkmap](https://larkmap.com/)
[点击提交站点信息](https://github.com/DipperMap/dippermap/issues/new?assignees=&labels=&projects=&template=site_report.yml)
-#### 方式二 提交 PR
+#### 方式二 提交 PR
直接修改站点配置文件,通过 PR 的方式,合并代码,代码合并后站点生效
-[点击修改配置文件](https://github.com/DipperMap/dippermap/edit/main/src/data/config.ts)
-
## 本地开发
### clone 代码
```bash
git clone https://github.com/DipperMap/dippermap.git
-````
+```
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+### `npm commit`
+
+Submit your code this way.
+
## 👬 Contributors
![https://github.com/DipperMap/dippermap/graphs/contributors](https://contrib.rocks/image?repo=DipperMap/dippermap)
diff --git a/commitlint.config.cjs b/commitlint.config.cjs
new file mode 100644
index 0000000..a4f4369
--- /dev/null
+++ b/commitlint.config.cjs
@@ -0,0 +1,3 @@
+module.exports = {
+ extends: ['@commitlint/config-conventional']
+}
diff --git a/package.json b/package.json
index 111ed83..73a562c 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,21 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
- "eject": "react-scripts eject"
+ "eject": "react-scripts eject",
+ "prettier": "prettier --write .",
+ "lint": "lint-staged",
+ "commit": "cz"
+ },
+ "lint-staged": {
+ "src/*.{js,ts,jsx,tsx,vue}": [
+ "node_modules/.bin/prettier --write .",
+ "node_modules/.bin/eslint --fix .",
+ "git add ."
+ ],
+ "src/*.{css,scss,less,json,html,md}": [
+ "node_modules/.bin/prettier --write .",
+ "git add ."
+ ]
},
"eslintConfig": {
"extends": [
@@ -43,6 +57,19 @@
]
},
"devDependencies": {
- "antd": "^5.11.5"
+ "@commitlint/cli": "^18.4.3",
+ "@commitlint/config-conventional": "^18.4.3",
+ "antd": "^5.11.5",
+ "commitizen": "^4.3.0",
+ "cz-conventional-changelog": "^3.3.0",
+ "eslint": "^8.54.0",
+ "husky": "^8.0.3",
+ "lint-staged": "^15.1.0",
+ "prettier": "^3.1.0"
+ },
+ "config": {
+ "commitizen": {
+ "path": "./node_modules/cz-conventional-changelog"
+ }
}
}
diff --git a/src/App.test.tsx b/src/App.test.tsx
index 2a68616..3a7a8cc 100644
--- a/src/App.test.tsx
+++ b/src/App.test.tsx
@@ -1,9 +1,9 @@
-import React from 'react';
-import { render, screen } from '@testing-library/react';
-import App from './App';
+import React from 'react'
+import { render, screen } from '@testing-library/react'
+import App from './App'
test('renders learn react link', () => {
- render(