terra-draw 0.0.1-alpha.2 → 0.0.1-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/README.md +27 -2
  3. package/dist/adapters/common/adapter-listener.d.ts +14 -0
  4. package/dist/adapters/google-maps.adapter.d.ts +7 -14
  5. package/dist/adapters/leaflet.adapter.d.ts +7 -12
  6. package/dist/adapters/mapbox-gl.adapter.d.ts +7 -9
  7. package/dist/adapters/maplibre-gl.adapter.d.ts +20 -0
  8. package/dist/adapters/openlayers.adapter.d.ts +55 -0
  9. package/dist/common.d.ts +23 -22
  10. package/dist/geometry/get-midpoints.d.ts +3 -2
  11. package/dist/geometry/midpoint-coordinate.d.ts +2 -1
  12. package/dist/geometry/shape/create-circle.d.ts +1 -0
  13. package/dist/geometry/shape/great-circle-line.d.ts +12 -0
  14. package/dist/modes/base.behavior.d.ts +1 -1
  15. package/dist/modes/base.mode.d.ts +12 -8
  16. package/dist/modes/circle/circle.mode.d.ts +27 -6
  17. package/dist/modes/freehand/freehand.mode.d.ts +34 -9
  18. package/dist/modes/great-circle-snapping.behavior.d.ts +13 -0
  19. package/dist/modes/greatcircle/great-circle.mode.d.ts +57 -0
  20. package/dist/modes/linestring/linestring.mode.d.ts +32 -6
  21. package/dist/modes/point/point.mode.d.ts +23 -3
  22. package/dist/modes/polygon/behaviors/closing-points.behavior.d.ts +19 -0
  23. package/dist/modes/polygon/polygon.mode.d.ts +34 -8
  24. package/dist/modes/rectangle/rectangle.mode.d.ts +48 -0
  25. package/dist/modes/render/render.mode.d.ts +34 -0
  26. package/dist/modes/select/select.mode.d.ts +36 -9
  27. package/dist/modes/static/static.mode.d.ts +18 -1
  28. package/dist/store/spatial-index/quickselect.d.ts +1 -1
  29. package/dist/store/spatial-index/rbush.d.ts +1 -1
  30. package/dist/store/store.d.ts +11 -9
  31. package/dist/terra-draw.cjs +1 -1
  32. package/dist/terra-draw.cjs.map +1 -1
  33. package/dist/terra-draw.d.ts +90 -8
  34. package/dist/terra-draw.modern.js +1 -1
  35. package/dist/terra-draw.modern.js.map +1 -1
  36. package/dist/terra-draw.module.js +1 -1
  37. package/dist/terra-draw.module.js.map +1 -1
  38. package/dist/terra-draw.umd.js +1 -1
  39. package/dist/terra-draw.umd.js.map +1 -1
  40. package/jest.config.ts +22 -22
  41. package/logo.png +0 -0
  42. package/package.json +151 -86
  43. package/scratch/release.sh +5 -0
  44. package/tsconfig.json +21 -12
package/jest.config.ts CHANGED
@@ -1,27 +1,27 @@
1
-
2
- let options = {}
1
+ let options = {};
3
2
 
4
3
  if (process.env.NO_CHECK) {
5
- options = {
6
- "transform": {
7
- "^.+\\.(t|j)sx?$": "@swc/jest"
8
- },
9
- "setupFilesAfterEnv": ["<rootDir>/src/test/jest.matchers.ts"],
10
- }
4
+ options = {
5
+ transform: {
6
+ "^.+\\.(t|j)sx?$": "@swc/jest",
7
+ },
8
+ coveragePathIgnorePatterns: ["<rootDir>/src/test/"],
9
+ setupFilesAfterEnv: ["<rootDir>/src/test/jest.matchers.ts"],
10
+ };
11
11
  } else {
12
- options = {
13
- "preset": "ts-jest",
14
- "testEnvironment": "node",
15
- "coveragePathIgnorePatterns": ["<rootDir>/src/test/"],
16
- "setupFilesAfterEnv": ["<rootDir>/src/test/jest.matchers.ts"],
17
- "collectCoverage": true,
18
- "collectCoverageFrom": ["./src/**"],
19
- "coverageThreshold": {
20
- "global": {
21
- "lines": 65
22
- }
23
- }
24
- }
12
+ options = {
13
+ preset: "ts-jest",
14
+ testEnvironment: "node",
15
+ coveragePathIgnorePatterns: ["<rootDir>/src/test/"],
16
+ setupFilesAfterEnv: ["<rootDir>/src/test/jest.matchers.ts"],
17
+ collectCoverage: true,
18
+ collectCoverageFrom: ["./src/**"],
19
+ coverageThreshold: {
20
+ global: {
21
+ lines: 65,
22
+ },
23
+ },
24
+ };
25
25
  }
26
26
 
27
- module.exports = options
27
+ module.exports = options;
package/logo.png ADDED
Binary file
package/package.json CHANGED
@@ -1,87 +1,152 @@
1
1
  {
2
- "name": "terra-draw",
3
- "version": "0.0.1-alpha.2",
4
- "description": "Frictionless map drawing across mapping provider",
5
- "scripts": {
6
- "build": "microbundle",
7
- "watch": "microbundle --watch --format modern",
8
- "test": "jest --config jest.config.ts",
9
- "test:coverage": "jest --config jest.config.ts --coverage",
10
- "test:nocheck": "NO_CHECK=true jest --config jest.config.ts",
11
- "test:nocheck:coverage": "NO_CHECK=true jest --config jest.config.ts --coverage",
12
- "lint": "eslint --ext .ts src/",
13
- "lint:quiet": "eslint --ext .ts --quiet src/",
14
- "lint:fix": "eslint --fix --ext .ts src/",
15
- "lint:fix:quiet": "eslint --fix --quiet --ext .ts src/",
16
- "prepare": "husky install"
17
- },
18
- "type": "module",
19
- "source": "src/terra-draw.ts",
20
- "exports": {
21
- "require": "./dist/terra-draw.cjs",
22
- "default": "./dist/terra-draw.modern.js",
23
- "types": "./dist/terra-draw.d.ts"
24
- },
25
- "main": "./dist/terra-draw.cjs",
26
- "module": "./dist/terra-draw.module.js",
27
- "unpkg": "./dist/terra-draw.umd.js",
28
- "author": "James Milner",
29
- "license": "MIT",
30
- "repository": "JamesLMilner/terra-draw",
31
- "devDependencies": {
32
- "@commitlint/cli": "^17.1.2",
33
- "@commitlint/config-conventional": "^17.1.0",
34
- "@googlemaps/js-api-loader": "^1.14.3",
35
- "@swc/jest": "^0.2.22",
36
- "@types/geojson": "^7946.0.8",
37
- "@types/google.maps": "^3.49.2",
38
- "@types/jest": "^28.1.5",
39
- "@types/leaflet": "^1.7.11",
40
- "@types/mapbox-gl": "^2.7.3",
41
- "@types/rbush": "^3.0.0",
42
- "@typescript-eslint/eslint-plugin": "^5.38.1",
43
- "@typescript-eslint/parser": "^5.38.1",
44
- "eslint": "^8.24.0",
45
- "eslint-config-prettier": "^8.5.0",
46
- "eslint-plugin-prettier": "^4.2.1",
47
- "husky": "^7.0.0",
48
- "jest": "^28.1.2",
49
- "leaflet": "^1.8.0",
50
- "mapbox-gl": "^2.9.1",
51
- "microbundle": "^0.15.0",
52
- "serve": "^13.0.4",
53
- "ts-jest": "^28.0.5",
54
- "ts-loader": "^9.3.1",
55
- "typescript": "^4.7.4"
56
- },
57
- "commitlint": {
58
- "extends": [
59
- "@commitlint/config-conventional"
60
- ]
61
- },
62
- "eslintConfig": {
63
- "parser": "@typescript-eslint/parser",
64
- "plugins": [
65
- "@typescript-eslint"
66
- ],
67
- "rules": {
68
- "indent": [
69
- "error",
70
- 4
71
- ],
72
- "semi": [
73
- "error",
74
- "always"
75
- ],
76
- "@typescript-eslint/no-empty-function": "warn"
77
- },
78
- "extends": [
79
- "plugin:@typescript-eslint/recommended",
80
- "prettier"
81
- ]
82
- },
83
- "prettier": {
84
- "printWidth": 80,
85
- "semi": true
86
- }
87
- }
2
+ "name": "terra-draw",
3
+ "version": "0.0.1-alpha.21",
4
+ "description": "Frictionless map drawing across mapping provider",
5
+ "scripts": {
6
+ "docs": "typedoc",
7
+ "docs:serve": "serve ./docs",
8
+ "release": "standard-version",
9
+ "build": "microbundle",
10
+ "watch": "microbundle --watch --format modern",
11
+ "test": "jest --config jest.config.ts",
12
+ "test:coverage": "jest --config jest.config.ts --coverage",
13
+ "test:nocheck": "NO_CHECK=true jest --config jest.config.ts",
14
+ "test:nocheck:coverage": "NO_CHECK=true jest --config jest.config.ts --coverage",
15
+ "lint": "eslint --ext .ts src/",
16
+ "lint:quiet": "eslint --ext .ts --quiet src/",
17
+ "lint:fix": "eslint --fix --ext .ts src/",
18
+ "lint:fix:quiet": "eslint --fix --quiet --ext .ts src/",
19
+ "format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
20
+ "format:quiet": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\" --loglevel=silent",
21
+ "prepare": "husky install"
22
+ },
23
+ "type": "module",
24
+ "source": "src/terra-draw.ts",
25
+ "exports": {
26
+ "types": "./dist/terra-draw.d.ts",
27
+ "require": "./dist/terra-draw.cjs",
28
+ "default": "./dist/terra-draw.modern.js"
29
+ },
30
+ "types": "./dist/terra-draw.d.ts",
31
+ "main": "./dist/terra-draw.cjs",
32
+ "module": "./dist/terra-draw.module.js",
33
+ "unpkg": "./dist/terra-draw.umd.js",
34
+ "author": "James Milner",
35
+ "license": "MIT",
36
+ "repository": "JamesLMilner/terra-draw",
37
+ "keywords": [
38
+ "map",
39
+ "drawing",
40
+ "draw",
41
+ "map drawing",
42
+ "geometry",
43
+ "leaflet",
44
+ "leafletjs",
45
+ "mapbox",
46
+ "mapboxgl",
47
+ "google maps",
48
+ "openlayers",
49
+ "maplibre"
50
+ ],
51
+ "devDependencies": {
52
+ "@commitlint/cli": "^17.1.2",
53
+ "@commitlint/config-conventional": "^17.1.0",
54
+ "@googlemaps/js-api-loader": "^1.14.3",
55
+ "@swc/jest": "^0.2.24",
56
+ "@types/geojson": "^7946.0.8",
57
+ "@types/google.maps": "^3.49.2",
58
+ "@types/jest": "^28.1.5",
59
+ "@types/leaflet": "^1.7.11",
60
+ "@types/mapbox-gl": "^2.7.3",
61
+ "@types/rbush": "^3.0.0",
62
+ "@typescript-eslint/eslint-plugin": "^5.48.0",
63
+ "@typescript-eslint/parser": "^5.48.0",
64
+ "eslint": "^8.24.0",
65
+ "eslint-config-prettier": "^8.5.0",
66
+ "eslint-plugin-prettier": "^4.2.1",
67
+ "husky": "^7.0.0",
68
+ "jest": "^29.3.1",
69
+ "leaflet": "^1.8.0",
70
+ "mapbox-gl": "^2.9.1",
71
+ "maplibre-gl": "^2.4.0",
72
+ "microbundle": "^0.15.0",
73
+ "ol": "^7.1.0",
74
+ "serve": "^14.1.2",
75
+ "standard-version": "^9.5.0",
76
+ "ts-jest": "^29.0.3",
77
+ "ts-loader": "^9.4.2",
78
+ "typedoc": "^0.23.21",
79
+ "typescript": "^4.9.4"
80
+ },
81
+ "commitlint": {
82
+ "extends": [
83
+ "@commitlint/config-conventional"
84
+ ]
85
+ },
86
+ "eslintConfig": {
87
+ "parser": "@typescript-eslint/parser",
88
+ "plugins": [
89
+ "@typescript-eslint"
90
+ ],
91
+ "rules": {
92
+ "@typescript-eslint/no-empty-function": "warn"
93
+ },
94
+ "extends": [
95
+ "plugin:@typescript-eslint/recommended",
96
+ "prettier"
97
+ ]
98
+ },
99
+ "prettier": {
100
+ "printWidth": 80,
101
+ "semi": true,
102
+ "useTabs": true
103
+ },
104
+ "standard-version": {
105
+ "types": [
106
+ {
107
+ "type": "feat",
108
+ "section": "Features"
109
+ },
110
+ {
111
+ "type": "fix",
112
+ "section": "Bug Fixes"
113
+ },
114
+ {
115
+ "type": "docs",
116
+ "section": "Documentation"
117
+ },
118
+ {
119
+ "type": "style",
120
+ "section": "Styling"
121
+ },
122
+ {
123
+ "type": "refactor",
124
+ "section": "Refactors"
125
+ },
126
+ {
127
+ "type": "perf",
128
+ "section": "Performance"
129
+ },
130
+ {
131
+ "type": "test",
132
+ "section": "Tests"
133
+ },
134
+ {
135
+ "type": "build",
136
+ "section": "Build System"
137
+ },
138
+ {
139
+ "type": "ci",
140
+ "section": "CI"
141
+ },
142
+ {
143
+ "type": "chore",
144
+ "section": "Chore"
145
+ },
146
+ {
147
+ "type": "revert",
148
+ "section": "Reverts"
149
+ }
150
+ ]
151
+ }
152
+ }
@@ -0,0 +1,5 @@
1
+ npm run build
2
+ npm run docs
3
+ npm run release -- --prerelease --release-as 0.0.1-alpha.21
4
+ git push origin main --tags
5
+ npm publish
package/tsconfig.json CHANGED
@@ -1,14 +1,23 @@
1
1
  {
2
- "compilerOptions": {
3
- "outDir": "./dist/",
4
- "strict": true,
5
- "noImplicitAny": true,
6
- "module": "es6",
7
- "target": "es6",
8
- "jsx": "react",
9
- "sourceMap": true,
10
- "allowJs": true,
11
- "moduleResolution": "node",
12
- "allowSyntheticDefaultImports": true
13
- }
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "strict": true,
5
+ "noImplicitAny": true,
6
+ "module": "es6",
7
+ "target": "es6",
8
+ "jsx": "react",
9
+ "sourceMap": true,
10
+ "allowJs": true,
11
+ "moduleResolution": "node",
12
+ "allowSyntheticDefaultImports": true
13
+ },
14
+ "typedocOptions": {
15
+ "entryPoints": ["src/terra-draw.ts"],
16
+ "exclude": ["src/geometry/**/*.ts", "src/test/**/*.ts", "src/util/**/*.ts"],
17
+ "out": "docs",
18
+ "skipErrorChecking": true
19
+ // "compilerOptions": {
20
+ // "skipLibCheck": true
21
+ // }
22
+ }
14
23
  }