@maplibre/maplibre-react-native 10.0.0-alpha.21 → 10.0.0-alpha.23

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 (49) hide show
  1. package/.eslintrc.js +5 -0
  2. package/.git-blame-ignore-revs +3 -0
  3. package/CHANGELOG.md +21 -0
  4. package/CONTRIBUTING.md +20 -14
  5. package/README.md +12 -13
  6. package/android/install.md +3 -2
  7. package/app.plugin.js +1 -1
  8. package/babel.config.js +6 -3
  9. package/docs/Camera.md +1 -1
  10. package/docs/GettingStarted.md +3 -4
  11. package/docs/MapView.md +1 -1
  12. package/docs/ShapeSource.md +3 -3
  13. package/docs/docs.json +15 -15
  14. package/ios/RCTMLN.xcodeproj/project.pbxproj +1 -775
  15. package/ios/install.md +1 -1
  16. package/javascript/components/Camera.tsx +8 -8
  17. package/javascript/components/MapView.tsx +4 -6
  18. package/javascript/components/MarkerView.tsx +2 -2
  19. package/javascript/components/PointAnnotation.tsx +2 -2
  20. package/javascript/components/ShapeSource.tsx +29 -28
  21. package/javascript/components/Style.tsx +1 -1
  22. package/javascript/modules/offline/OfflineCreatePackOptions.ts +2 -9
  23. package/javascript/modules/snapshot/SnapshotOptions.ts +4 -5
  24. package/javascript/utils/StyleValue.ts +3 -1
  25. package/javascript/utils/makeNativeBounds.ts +5 -0
  26. package/jest-setup.ts +113 -0
  27. package/jest.config.js +8 -0
  28. package/maplibre-react-native.podspec +7 -7
  29. package/package.json +30 -73
  30. package/plugin/build/withMapLibre.js +16 -1
  31. package/plugin/install.md +1 -8
  32. package/react-native.config.js +1 -1
  33. package/scripts/.eslintrc.js +3 -0
  34. package/scripts/{autogenerate.js → generate-docs.js} +144 -137
  35. package/scripts/templates/MaplibreStyles.ts.ejs +5 -5
  36. package/scripts/templates/RCTMLNStyle.h.ejs +2 -2
  37. package/scripts/templates/RCTMLNStyle.m.ejs +6 -6
  38. package/scripts/templates/RCTMLNStyleFactory.java.ejs +8 -8
  39. package/scripts/{autogenHelpers → utils}/DocJSONBuilder.js +70 -70
  40. package/scripts/{autogenHelpers → utils}/JSDocNodeTree.js +33 -30
  41. package/scripts/utils/MarkdownBuilder.js +37 -0
  42. package/scripts/utils/template-globals.js +528 -0
  43. package/style-spec/v8.json +32 -1
  44. package/tsconfig.json +2 -2
  45. package/assets/mapbox_logo.png +0 -0
  46. package/javascript/utils/geoUtils.ts +0 -79
  47. package/scripts/autogenHelpers/MarkdownBuilder.js +0 -29
  48. package/scripts/autogenHelpers/globals.js +0 -508
  49. package/setup-jest.js +0 -108
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maplibre/maplibre-react-native",
3
- "description": "A MapLibre GL Native plugin for creating maps in React Native",
4
- "version": "10.0.0-alpha.21",
3
+ "description": "React Native library for creating maps with MapLibre Native for Android & iOS",
4
+ "version": "10.0.0-alpha.23",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -21,20 +21,19 @@
21
21
  "url": "https://github.com/maplibre/maplibre-react-native"
22
22
  },
23
23
  "scripts": {
24
- "fetch:style:spec": "./scripts/download-style-spec.sh",
25
- "generate": "yarn fetch:style:spec && yarn node ./scripts/autogenerate",
26
- "test": "yarn lint && yarn unittest",
27
- "unittest": "jest",
28
- "unittest:single": "jest --testNamePattern",
29
- "lint": "eslint .",
30
- "lint:fix": "eslint . --fix",
31
- "lint:single": "eslint",
32
- "prepack": "pinst --disable && yarn build:plugin",
33
- "test:plugin": "jest plugin",
34
- "build:plugin": "tsc --build plugin",
35
- "lint:plugin": "eslint plugin/src/*",
36
- "postpack": "pinst --enable",
37
- "typescript:check": "tsc -p ./tsconfig.json --noEmit"
24
+ "generate": "yarn generate:fetch-style-spec && yarn generate:docs",
25
+ "generate:fetch-style-spec": "./scripts/download-style-spec.sh",
26
+ "generate:docs": "yarn node ./scripts/generate-docs",
27
+ "test": "jest",
28
+ "lint": "yarn lint:eslint && yarn lint:tsc",
29
+ "lint:eslint": "eslint .",
30
+ "lint:eslint:fix": "eslint . --fix",
31
+ "lint:tsc": "tsc --project . --noEmit && tsc --project ./packages/examples",
32
+ "plugin:build": "tsc --build plugin",
33
+ "plugin:lint": "eslint plugin/src/*",
34
+ "plugin:test": "jest plugin",
35
+ "prepack": "pinst --disable && yarn plugin:build",
36
+ "postpack": "pinst --enable"
38
37
  },
39
38
  "peerDependenciesMeta": {
40
39
  "@expo/config-plugins": {
@@ -47,18 +46,15 @@
47
46
  "react-native": ">=0.59.9"
48
47
  },
49
48
  "dependencies": {
50
- "@mapbox/geo-viewport": ">= 0.4.0",
51
- "@turf/along": "6.5.0",
52
- "@turf/distance": "6.5.0",
53
- "@turf/helpers": "6.5.0",
54
- "@turf/length": "6.5.0",
55
- "@turf/nearest-point-on-line": "6.5.0",
49
+ "@turf/distance": "^7.1.0",
50
+ "@turf/helpers": "^7.1.0",
51
+ "@turf/length": "^7.1.0",
52
+ "@turf/nearest-point-on-line": "^7.1.0",
56
53
  "@types/debounce": "^1.2.1",
57
- "@types/geojson": "^7946.0.10",
54
+ "@types/geojson": "^7946.0.14",
58
55
  "@types/jest": "^29.5.12",
59
- "@types/mapbox__geo-viewport": "^0.4.1",
60
56
  "@types/node": "^18.11.18",
61
- "@types/react": "^18.2.15",
57
+ "@types/react": "^18.2.79",
62
58
  "@types/react-native": "0.67.8",
63
59
  "debounce": "^2.0.0"
64
60
  },
@@ -68,78 +64,39 @@
68
64
  "@babel/plugin-proposal-class-properties": "7.18.6",
69
65
  "@babel/runtime": "7.17.2",
70
66
  "@expo/config-plugins": "^7.2.5",
71
- "@react-native/eslint-config": "^0.73.2",
72
- "@react-native/eslint-plugin": "^0.74.0",
73
- "@react-native/metro-config": "^0.72.7",
67
+ "@react-native/babel-preset": "^0.74.88",
68
+ "@react-native/metro-config": "^0.74.88",
74
69
  "@sinonjs/fake-timers": "^11.2.2",
75
70
  "@testing-library/react-native": "^12.4.3",
76
71
  "@tsconfig/node14": "^14.1.0",
77
- "@typescript-eslint/eslint-plugin": "^7.16.0",
78
- "@typescript-eslint/parser": "^7.16.0",
72
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
73
+ "@typescript-eslint/parser": "^7.18.0",
79
74
  "babel-jest": "^29.6.0",
80
75
  "documentation": "^14.0.0",
81
76
  "ejs": "^3.1.3",
82
77
  "ejs-lint": "^2.0.0",
83
- "eslint": "^8.57.0",
84
- "eslint-config-prettier": "^9.1.0",
78
+ "eslint": "^8.57.1",
85
79
  "eslint-config-universe": "13.0.0",
86
- "eslint-plugin-import": "^2.29.1",
87
- "eslint-plugin-prettier": "^5.1.3",
88
80
  "expo-module-scripts": "^3.1.0",
89
81
  "husky": "^9.0.10",
90
82
  "jest": "^29.7.0",
91
83
  "jest-cli": "^29.7.0",
92
84
  "lint-staged": "^15.2.2",
93
- "metro-react-native-babel-preset": "^0.76.7",
94
85
  "node-dir": "0.1.17",
95
86
  "pinst": "^3.0.0",
96
- "prettier": "^3.3.3",
97
- "react": "^18.2.0",
87
+ "prettier": "3.3.3",
88
+ "react": "18.2.0",
98
89
  "react-docgen": "rnmapbox/react-docgen#rnmapbox-dist",
99
- "react-native": "0.72.1",
100
- "react-test-renderer": "^18.2.0",
90
+ "react-native": "^0.74.6",
91
+ "react-test-renderer": "18.2.0",
101
92
  "typescript": "^5.3.3"
102
93
  },
103
94
  "resolutions": {
104
95
  "typescript": "5.5.3"
105
96
  },
106
- "jest": {
107
- "preset": "react-native",
108
- "collectCoverageFrom": [
109
- "javascript/**/*.js"
110
- ],
111
- "setupFiles": [
112
- "./setup-jest.js",
113
- "./__tests__/__mocks__/react-native.mock.js"
114
- ],
115
- "modulePathIgnorePatterns": [
116
- "example",
117
- "__tests__/__mocks__",
118
- "fixtures"
119
- ]
120
- },
121
97
  "lint-staged": {
122
98
  "*.{js,jsx,ts,tsx}": "yarn lint"
123
99
  },
124
- "eslintConfig": {
125
- "root": true,
126
- "extends": [
127
- "prettier",
128
- "universe/native"
129
- ],
130
- "ignorePatterns": [
131
- "node_modules/*",
132
- "*.js",
133
- "**/dist/*.js",
134
- "/plugin/build"
135
- ],
136
- "plugins": [
137
- "prettier"
138
- ],
139
- "rules": {
140
- "prettier/prettier": "error"
141
- }
142
- },
143
100
  "packageManager": "yarn@4.1.0",
144
101
  "workspaces": [
145
102
  "apps/*",
@@ -120,6 +120,21 @@ const withoutSignatures = (config) => {
120
120
  return config;
121
121
  });
122
122
  };
123
+ /**
124
+ * Set the Debug Information Format to DWARF with dSYM File during EAS Build for Managed App
125
+ * https://github.com/expo/eas-cli/issues/968
126
+ * // Set artifactPath in eas.json
127
+ * "ios": {
128
+ * "artifactPath": "ios/build/*"
129
+ * }
130
+ */
131
+ const withDwarfDsym = (config) => {
132
+ return (0, config_plugins_1.withXcodeProject)(config, async (config) => {
133
+ const xcodeProject = config.modResults;
134
+ xcodeProject.debugInformationFormat = "dwarf-with-dsym";
135
+ return config;
136
+ });
137
+ };
123
138
  const withExcludedSimulatorArchitectures = (c) => {
124
139
  return (0, config_plugins_1.withXcodeProject)(c, (config) => {
125
140
  config.modResults = setExcludedArchitectures(config.modResults);
@@ -127,7 +142,7 @@ const withExcludedSimulatorArchitectures = (c) => {
127
142
  });
128
143
  };
129
144
  const withMapLibre = (config) => {
130
- config = withoutSignatures(withExcludedSimulatorArchitectures(config));
145
+ config = withoutSignatures(withDwarfDsym(withExcludedSimulatorArchitectures(config)));
131
146
  return withCocoaPodsInstallerBlocks(config);
132
147
  };
133
148
  exports.default = (0, config_plugins_1.createRunOncePlugin)(withMapLibre, pkg.name, pkg.version);
package/plugin/install.md CHANGED
@@ -1,4 +1,4 @@
1
- # Expo installation
1
+ # Expo Installation
2
2
 
3
3
  NOTE: This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
4
4
 
@@ -23,10 +23,3 @@ Next, rebuild your app as described in the ["Adding custom native code"](https:/
23
23
  ## API
24
24
 
25
25
  This plugin doesn't currently provide any additional properties for customization. The plugin simply generates the pre-install block in the `ios/Podfile` (the post-install block is not required for Expo support). No additional changes are done on Android.
26
-
27
- ## Manual Setup
28
-
29
- For bare workflow projects, you can follow the manual setup guides:
30
-
31
- - [iOS](/ios/install.md)
32
- - [Android](/android/install.md)
@@ -3,7 +3,7 @@ module.exports = {
3
3
  platforms: {
4
4
  ios: {},
5
5
  android: {
6
- sourceDir: './android/rctmln',
6
+ sourceDir: "./android/rctmln",
7
7
  },
8
8
  },
9
9
  },
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: ["universe/node"],
3
+ };