Skip to content

Commit 44a7b52

Browse files
authored
doc: generate documentation from examples (#3108)
* generate example docs with images * generate example docs * fix: fix icons size and scale * doc: update doc generation
1 parent 15dd01f commit 44a7b52

File tree

84 files changed

+3824
-1727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3824
-1727
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ module.exports = {
9090
project: [
9191
'./tsconfig.json',
9292
'./example/tsconfig.json',
93+
'./scripts/tsconfig.json',
9394
'./fabricexample/tsconfig.json',
9495
'./plugin/src/__tests__/tsconfig.eslint.json',
9596
],

.github/workflows/ios-actions.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ jobs:
9191
brew install xcbeautify
9292
9393
- name: Build for detox
94-
run: set -o pipefail && NSUnbufferedIO=YES yarn detox build --configuration ios.debug 2>&1 | xcbeautify -qq
94+
run: set -o pipefail && NSUnbufferedIO=YES yarn detox build --configuration ios.debug.ci 2>&1 | xcbeautify -qq --renderer github-actions
9595

9696
- name: Test with detox
9797
if: inputs.NEW_ARCH != 1
9898
run: |
9999
npx detox --version
100-
yarn detox test --configuration ios.debug --debug-synchronization 500 --loglevel trace --record-logs all --take-screenshots all
100+
yarn detox test --configuration ios.debug.ci --debug-synchronization 500 --loglevel trace --record-logs all --take-screenshots all | xcbeautify -qq --renderer github-actions
101101
env:
102102
SKIP_TESTS_NO_METAL: ${{ inputs.MAP_IMPL == 'mapbox' || inputs.MAP_IMPL == 'mapbox11' }}
103103

__tests__/__mocks__/react-native.mock.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ jest.mock('react-native/Libraries/Image/resolveAssetSource', () => {
22
return () => ({ uri: 'asset://test.png' });
33
});
44

5+
jest.mock('../../src/assets/heading.png', () => 'heading.png');
6+
57
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter', () => {
68
function MockEventEmitter() {}
79
MockEventEmitter.prototype.addListener = jest.fn(() => ({

__tests__/components/BackgroundLayer.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import BackgroundLayer from '../../src/components/BackgroundLayer';
55

66
describe('BackgroundLayer', () => {
77
test('renders correctly with default props', () => {
8-
const { container: backgroundLayer } = render(
8+
const { UNSAFE_root: backgroundLayer } = render(
99
<BackgroundLayer id="requiredBackgroundLayerID" />,
1010
);
1111

@@ -28,7 +28,7 @@ describe('BackgroundLayer', () => {
2828
style: { visibility: 'none' },
2929
};
3030

31-
const { container: backgroundLayer } = render(
31+
const { UNSAFE_root: backgroundLayer } = render(
3232
<BackgroundLayer {...testProps} />,
3333
);
3434
const { props } = backgroundLayer;

__tests__/components/CircleLayer.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import CircleLayer from '../../src/components/CircleLayer';
55

66
describe('CircleLayer', () => {
77
test('renders correctly with default props', () => {
8-
const { container: circleLayer } = render(
8+
const { UNSAFE_root: circleLayer } = render(
99
<CircleLayer id="requiredCircleLayerID" />,
1010
);
1111
const { props } = circleLayer;
@@ -27,7 +27,9 @@ describe('CircleLayer', () => {
2727
style: { visibility: 'none' },
2828
};
2929

30-
const { container: circleLayer } = render(<CircleLayer {...customProps} />);
30+
const { UNSAFE_root: circleLayer } = render(
31+
<CircleLayer {...customProps} />,
32+
);
3133
const { props } = circleLayer;
3234

3335
expect(props.id).toStrictEqual(customProps.id);

__tests__/components/HeatmapLayer.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import HeatmapLayer from '../../src/components/HeatmapLayer';
55

66
describe('HeatmapLayer', () => {
77
test('renders correctly with default props', () => {
8-
const { container: heatmapLayer } = render(
8+
const { UNSAFE_root: heatmapLayer } = render(
99
<HeatmapLayer id="requiredHeatmapLayerID" />,
1010
);
1111
const { props } = heatmapLayer;
@@ -25,7 +25,9 @@ describe('HeatmapLayer', () => {
2525
maxZoomLevel: 8,
2626
style: { visibility: 'none' },
2727
};
28-
const { container: heatmapLayer } = render(<HeatmapLayer {...testProps} />);
28+
const { UNSAFE_root: heatmapLayer } = render(
29+
<HeatmapLayer {...testProps} />,
30+
);
2931
const { props } = heatmapLayer;
3032

3133
expect(props.id).toStrictEqual(testProps.id);

android/src/main/mapbox-v11-compat/v11/com/mapbox/rnmbx/v11compat/Image.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ fun emptyImage(width: Int, height: Int): Image {
6565
return Image(
6666
width, height, DataRef.allocateNative(width * height * 4)
6767
)
68-
}
68+
}

docs/Annotation.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<!-- This file was autogenerated from Annotation.tsx do not modify -->
22

3+
4+
35
```tsx
46
import { Annotation } from '@rnmapbox/maps';
57

68
Annotation
9+
710
```
811

912

@@ -46,7 +49,7 @@ FIX ME NO DESCRIPTION
4649
func
4750
```
4851
FIX ME NO DESCRIPTION
49-
*signature:*`(x:number) => number`
52+
*signature:*`(x:number) =&gt; number`
5053

5154
_defaults to:_ `Easing.linear`
5255

@@ -67,7 +70,7 @@ FIX ME NO DESCRIPTION
6770
func
6871
```
6972
FIX ME NO DESCRIPTION
70-
*signature:*`(event:OnPressEvent) => void`
73+
*signature:*`(event:OnPressEvent) =&gt; void`
7174

7275

7376

0 commit comments

Comments
 (0)