Skip to content

Commit

Permalink
docs: update scripts to TypeScript (#484)
Browse files Browse the repository at this point in the history
* chore: move doc generation to ts
* refactor: move Annotation component
* chore: replace node-dir
* style: ignore unused catch error
* refactor: rename generate to codegen
* chore: remove unused @tsconfig/node14
* docs: add filePath to generated hint
* docs: fix TypeScript problems
* docs: add do not modify header
* docs: pass TemplateHelpders as local
* docs: codegen
* fix: update @maplibre/maplibre-gl-style-spec
* fix: getMarkdownMethodSignature optional formatting
  • Loading branch information
KiwiKilian authored Nov 8, 2024
1 parent 0af99fb commit bf685f3
Show file tree
Hide file tree
Showing 57 changed files with 1,200 additions and 7,771 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Added `your feature` that allows ...
- [ ] I have tested this on a device/simulator for each compatible OS
- [ ] I formatted JS and TS files with running `yarn lint:eslint:fix` in the root folder
- [ ] I have run tests via `yarn test` in the root folder
- [ ] I updated the documentation with running `yarn generate` in the root folder
- [ ] I updated the documentation with running `yarn codegen` in the root folder
- [ ] I mentioned this change in `CHANGELOG.md`
- [ ] I added/updated a sample (`/packages/examples`)

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Run test with Jest
run: yarn test

- name: Generate
run: yarn generate
- name: Codegen
run: yarn codegen

- name: Pack (to ensure the plugin builds)
run: yarn pack
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
yarn generate
yarn codegen
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ can mitigate some of the pain with this.

Documentation is generated from code blocks and comments. It will be auto-generated when you commit changes. If any
changes are generated from your edits, the changed files will need to be added using `git add` before attempting the
commit again. To manually generate the changes, run `yarn generate`.
commit again. To manually generate the changes, run `yarn codegen`.

Notice, that changing the documentation in the individual <COMPONENT>.md within `/docs` will not suffice. The correct
way is the above described
13 changes: 2 additions & 11 deletions docs/Annotation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from Annotation.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/Annotation.tsx -->
## <MapLibreGL.Annotation />
###

Expand All @@ -25,14 +26,4 @@
| `event` | `OnPressEvent` | `Yes` | undefined |


#### symbolStyle()



##### arguments
| Name | Type | Required | Description |
| ---- | :--: | :------: | :----------: |




3 changes: 2 additions & 1 deletion docs/BackgroundLayer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from BackgroundLayer.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/BackgroundLayer.tsx -->
## <MapLibreGL.BackgroundLayer />
###

Expand Down
3 changes: 2 additions & 1 deletion docs/Callout.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from Callout.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/Callout.tsx -->
## <MapLibreGL.Callout />
### Callout that displays information about a selected annotation near the annotation.

Expand Down
11 changes: 6 additions & 5 deletions docs/Camera.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from Camera.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/Camera.tsx -->
## <MapLibreGL.Camera />
###

Expand Down Expand Up @@ -27,7 +28,7 @@
| onUserTrackingModeChange | `func` | `none` | `false` | FIX ME NO DESCRIPTION<br/>*signature:*`(event:MaplibreGLEvent) => void` |

### methods
#### fitBounds(northEastCoordinates, southWestCoordinates[, padding][, animationDuration])
#### fitBounds(northEastCoordinates, southWestCoordinates, [padding], [animationDuration])

Map camera transitions to fit provided bounds

Expand All @@ -49,7 +50,7 @@ this.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)
```


#### flyTo(coordinates[, animationDuration])
#### flyTo(coordinates, [animationDuration])

Map camera will fly to new coordinate

Expand All @@ -67,7 +68,7 @@ this.camera.flyTo([lng, lat], 12000)
```


#### moveTo(coordinates[, animationDuration])
#### moveTo(coordinates, [animationDuration])

Map camera will move to new coordinate at the same zoom level

Expand All @@ -85,7 +86,7 @@ this.camera.moveTo([lng, lat]) // snaps camera to new location without any easin
```


#### zoomTo(zoomLevel[, animationDuration])
#### zoomTo(zoomLevel, [animationDuration])

Map camera will zoom to specified level

Expand Down
3 changes: 2 additions & 1 deletion docs/CircleLayer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from CircleLayer.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/CircleLayer.tsx -->
## <MapLibreGL.CircleLayer />
### CircleLayer is a style layer that renders one or more filled circles on the map.

Expand Down
3 changes: 2 additions & 1 deletion docs/FillExtrusionLayer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from FillExtrusionLayer.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/FillExtrusionLayer.tsx -->
## <MapLibreGL.FillExtrusionLayer />
### FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map.

Expand Down
3 changes: 2 additions & 1 deletion docs/FillLayer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from FillLayer.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/FillLayer.tsx -->
## <MapLibreGL.FillLayer />
### FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map.

Expand Down
3 changes: 2 additions & 1 deletion docs/HeadingIndicator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from HeadingIndicator.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/HeadingIndicator.tsx -->
## <MapLibreGL.HeadingIndicator />
###

Expand Down
3 changes: 2 additions & 1 deletion docs/HeatmapLayer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from HeatmapLayer.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/HeatmapLayer.tsx -->
## <MapLibreGL.HeatmapLayer />
### HeatmapLayer is a style layer that renders one or more filled circles on the map.

Expand Down
3 changes: 2 additions & 1 deletion docs/ImageSource.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from ImageSource.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/ImageSource.tsx -->
## <MapLibreGL.ImageSource />
### ImageSource is a content source that is used for a georeferenced raster image to be shown on the map.<br/>The georeferenced image scales and rotates as the user zooms and rotates the map

Expand Down
3 changes: 2 additions & 1 deletion docs/Images.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from Images.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/Images.tsx -->
## <MapLibreGL.Images />
### Images defines the images used in Symbol etc layers

Expand Down
3 changes: 2 additions & 1 deletion docs/Light.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from Light.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/Light.tsx -->
## <MapLibreGL.Light />
### Light represents the light source for extruded geometries

Expand Down
3 changes: 2 additions & 1 deletion docs/LineLayer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from LineLayer.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/LineLayer.tsx -->
## <MapLibreGL.LineLayer />
### LineLayer is a style layer that renders one or more stroked polylines on the map.

Expand Down
9 changes: 5 additions & 4 deletions docs/MapView.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from MapView.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/MapView.tsx -->
## <MapLibreGL.MapView />
### MapView backed by MapLibre Native

Expand Down Expand Up @@ -78,7 +79,7 @@ const visibleBounds = await this._map.getVisibleBounds();
```


#### queryRenderedFeaturesAtPoint(point[, filter][, layerIDs])
#### queryRenderedFeaturesAtPoint(point, [filter], [layerIDs])

Returns an array of rendered map features that intersect with a given point.

Expand All @@ -96,7 +97,7 @@ this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1'
```


#### queryRenderedFeaturesInRect(bbox[, filter][, layerIDs])
#### queryRenderedFeaturesInRect(bbox, [filter], [layerIDs])

Returns an array of rendered map features that intersect with the given rectangle,<br/>restricted to the given style layers and filtered by the given predicate.

Expand Down Expand Up @@ -166,7 +167,7 @@ const center = await this._map.getCenter();
```


#### setSourceVisibility(visible, sourceId[, sourceLayerId])
#### setSourceVisibility(visible, sourceId, [sourceLayerId])

Sets the visibility of all the layers referencing the specified `sourceLayerId` and/or `sourceId`

Expand Down
3 changes: 2 additions & 1 deletion docs/MarkerView.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from MarkerView.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/MarkerView.tsx -->
## <MapLibreGL.MarkerView />
### MarkerView allows you to place a interactive react native marker to the map.<br/><br/>If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance<br/>.<br/>This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android<br/>and PointAnnotation on iOS.

Expand Down
3 changes: 2 additions & 1 deletion docs/NativeUserLocation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- This file was autogenerated from NativeUserLocation.js do not modify -->
<!-- DO NOT MODIFY! -->
<!-- This file is auto-generated from javascript/components/NativeUserLocation.tsx -->
## <MapLibreGL.NativeUserLocation />
###

Expand Down
Loading

0 comments on commit bf685f3

Please sign in to comment.