@maplibre/maplibre-react-native 10.0.0-alpha.26 → 10.0.0-alpha.27

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 (47) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/android/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleFactory.java +1 -1
  3. package/docs/Annotation.md +1 -1
  4. package/docs/BackgroundLayer.md +1 -1
  5. package/docs/Callout.md +1 -1
  6. package/docs/Camera.md +1 -1
  7. package/docs/CircleLayer.md +1 -1
  8. package/docs/FillExtrusionLayer.md +1 -1
  9. package/docs/FillLayer.md +1 -1
  10. package/docs/HeadingIndicator.md +1 -1
  11. package/docs/HeatmapLayer.md +1 -1
  12. package/docs/ImageSource.md +1 -1
  13. package/docs/Images.md +1 -1
  14. package/docs/Light.md +1 -1
  15. package/docs/LineLayer.md +1 -1
  16. package/docs/MapView.md +1 -1
  17. package/docs/MarkerView.md +1 -1
  18. package/docs/NativeUserLocation.md +1 -1
  19. package/docs/PointAnnotation.md +1 -1
  20. package/docs/RasterLayer.md +1 -1
  21. package/docs/RasterSource.md +1 -1
  22. package/docs/ShapeSource.md +1 -1
  23. package/docs/Style.md +1 -1
  24. package/docs/SymbolLayer.md +1 -1
  25. package/docs/UserLocation.md +1 -1
  26. package/docs/VectorSource.md +1 -1
  27. package/docs/coordinates.md +1 -1
  28. package/docs/location.md +1 -1
  29. package/docs/offlineManager.md +1 -1
  30. package/docs/snapshotManager.md +1 -1
  31. package/ios/RCTMLN/RCTMLNStyle.h +1 -1
  32. package/ios/RCTMLN/RCTMLNStyle.m +1 -1
  33. package/javascript/utils/MaplibreStyles.d.ts +3 -1
  34. package/javascript/utils/index.ts +8 -7
  35. package/javascript/utils/styleMap.ts +1 -1
  36. package/package.json +1 -1
  37. package/scripts/codegen.ts +12 -8
  38. package/scripts/templates/MaplibreStyles.ts.ejs +3 -1
  39. package/scripts/templates/RCTMLNStyle.h.ejs +2 -2
  40. package/scripts/templates/RCTMLNStyle.m.ejs +2 -2
  41. package/scripts/templates/RCTMLNStyleFactory.java.ejs +2 -2
  42. package/scripts/templates/component.md.ejs +2 -2
  43. package/scripts/templates/styleMap.ts.ejs +2 -2
  44. package/scripts/utils/MarkdownBuilder.ts +4 -4
  45. package/scripts/utils/TemplateHelpers.ts +6 -0
  46. package/ios/RCTMLN/index.d.ts +0 -1183
  47. package/scripts/templates/index.d.ts.ejs +0 -86
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ PR Title ([#123](link to my pr))
6
6
 
7
7
  ```
8
8
 
9
+ ## 10.0.0-alpha.27
10
+
11
+ fix: use UIManager exported from react-native ([#511](https://github.com/maplibre/maplibre-react-native/pull/511))
12
+
9
13
  ## 10.0.0-alpha.26
10
14
 
11
15
  chore: upgrade Expo SDK 52 ([489](https://github.com/maplibre/maplibre-react-native/pull/489))
@@ -1,5 +1,5 @@
1
1
  // DO NOT MODIFY
2
- // THIS FILE IS AUTOGENERATED
2
+ // This file is auto-generated from scripts/templates/RCTMLNStyleFactory.java.ejs
3
3
 
4
4
  package com.maplibre.rctmln.components.styles;
5
5
 
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/Annotation.tsx -->
3
3
  # `<MapLibreGL.Annotation />`
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/BackgroundLayer.tsx -->
3
3
  # `<MapLibreGL.BackgroundLayer />`
4
4
 
package/docs/Callout.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/Callout.tsx -->
3
3
  # `<MapLibreGL.Callout />`
4
4
  Callout that displays information about a selected annotation near the annotation.
package/docs/Camera.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/Camera.tsx -->
3
3
  # `<MapLibreGL.Camera />`
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/CircleLayer.tsx -->
3
3
  # `<MapLibreGL.CircleLayer />`
4
4
  CircleLayer is a style layer that renders one or more filled circles on the map.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/FillExtrusionLayer.tsx -->
3
3
  # `<MapLibreGL.FillExtrusionLayer />`
4
4
  FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map.
package/docs/FillLayer.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/FillLayer.tsx -->
3
3
  # `<MapLibreGL.FillLayer />`
4
4
  FillLayer is a style layer that renders one or more filled (and optionally stroked) polygons on the map.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/HeadingIndicator.tsx -->
3
3
  # `<MapLibreGL.HeadingIndicator />`
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/HeatmapLayer.tsx -->
3
3
  # `<MapLibreGL.HeatmapLayer />`
4
4
  HeatmapLayer is a style layer that renders one or more filled circles on the map.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/ImageSource.tsx -->
3
3
  # `<MapLibreGL.ImageSource />`
4
4
  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
package/docs/Images.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/Images.tsx -->
3
3
  # `<MapLibreGL.Images />`
4
4
  Images defines the images used in Symbol etc layers
package/docs/Light.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/Light.tsx -->
3
3
  # `<MapLibreGL.Light />`
4
4
  Light represents the light source for extruded geometries
package/docs/LineLayer.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/LineLayer.tsx -->
3
3
  # `<MapLibreGL.LineLayer />`
4
4
  LineLayer is a style layer that renders one or more stroked polylines on the map.
package/docs/MapView.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/MapView.tsx -->
3
3
  # `<MapLibreGL.MapView />`
4
4
  MapView backed by MapLibre Native
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/MarkerView.tsx -->
3
3
  # `<MapLibreGL.MarkerView />`
4
4
  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.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/NativeUserLocation.tsx -->
3
3
  # `<MapLibreGL.NativeUserLocation />`
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/PointAnnotation.tsx -->
3
3
  # `<MapLibreGL.PointAnnotation />`
4
4
  PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.<br/><br/>Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,<br/>they'll offer much better performance<br/><br/>.<br/>If you need interctive views please use MarkerView,<br/>as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/RasterLayer.tsx -->
3
3
  # `<MapLibreGL.RasterLayer />`
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/RasterSource.tsx -->
3
3
  # `<MapLibreGL.RasterSource />`
4
4
  RasterSource is a map content source that supplies raster image tiles to be shown on the map.<br/>The location of and metadata about the tiles are defined either by an option dictionary<br/>or by an external file that conforms to the TileJSON specification.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/ShapeSource.tsx -->
3
3
  # `<MapLibreGL.ShapeSource />`
4
4
  ShapeSource is a map content source that supplies vector shapes to be shown on the map.<br/>The shape may be a url or a GeoJSON object
package/docs/Style.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/Style.tsx -->
3
3
  # `<MapLibreGL.Style />`
4
4
  Style is a component that automatically adds sources / layers to the map using MapLibre Style Spec.<br/>Only [`sources`](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/) & [`layers`](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/) are supported.<br/>Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/maplibre/maplibre-react-native/tree/main/docs.<br/><br/>TODO: Maintainer forking this project does not understand the above comment regarding what is supported.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/SymbolLayer.tsx -->
3
3
  # `<MapLibreGL.SymbolLayer />`
4
4
  SymbolLayer is a style layer that renders icon and text labels at points or along lines on the map.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/UserLocation.tsx -->
3
3
  # `<MapLibreGL.UserLocation />`
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/components/VectorSource.tsx -->
3
3
  # `<MapLibreGL.VectorSource />`
4
4
  VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map.<br/>The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/modules/location/locationManager.ts -->
3
3
  # `<MapLibreGL.coordinates />`
4
4
  Coorinates sent by locationManager
package/docs/location.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/modules/location/locationManager.ts -->
3
3
  # `<MapLibreGL.location />`
4
4
  Location sent by locationManager
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/modules/offline/offlineManager.ts -->
3
3
  # `<MapLibreGL.offlineManager />`
4
4
  OfflineManager implements a singleton (shared object) that manages offline packs.<br/>All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database.<br/>The shared object maintains a canonical collection of offline packs.
@@ -1,4 +1,4 @@
1
- <!-- DO NOT MODIFY! -->
1
+ <!-- DO NOT MODIFY -->
2
2
  <!-- This file is auto-generated from javascript/modules/snapshot/snapshotManager.ts -->
3
3
  # `<MapLibreGL.snapshotManager />`
4
4
  The snapshotManager generates static raster images of the map.<br/>Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide.<br/>The snapshotter generates the snapshot asynchronous.
@@ -1,5 +1,5 @@
1
1
  // DO NOT MODIFY
2
- // THIS FILE IS AUTOGENERATED
2
+ // This file is auto-generated from scripts/templates/RCTMLNStyle.h.ejs
3
3
 
4
4
  #import "RCTMLNStyle.h"
5
5
  #import "RCTMLNStyleValue.h"
@@ -1,5 +1,5 @@
1
1
  // DO NOT MODIFY
2
- // THIS FILE IS AUTOGENERATED
2
+ // This file is auto-generated from scripts/templates/RCTMLNStyle.m.ejs
3
3
 
4
4
  #import "RCTMLNStyle.h"
5
5
  #import "RCTMLNUtils.h"
@@ -1,4 +1,6 @@
1
- /* This file was generated from MapboxStyle.ts.ejs do not modify */
1
+ // DO NOT MODIFY
2
+ // This file is auto-generated from scripts/templates/MaplibreStyles.ts.ejs
3
+
2
4
  import { type ImageSourcePropType } from "react-native";
3
5
 
4
6
  export type Translation = { x: number; y: number } | [number, number];
@@ -5,14 +5,11 @@ import {
5
5
  findNodeHandle,
6
6
  Platform,
7
7
  ImageSourcePropType,
8
+ UIManager,
8
9
  } from "react-native";
9
10
 
10
- function getAndroidManagerInstance(module: string): any {
11
- const haveViewManagerConfig =
12
- NativeModules.UIManager && NativeModules.UIManager.getViewManagerConfig;
13
- return haveViewManagerConfig
14
- ? NativeModules.UIManager.getViewManagerConfig(module)
15
- : NativeModules.UIManager[module];
11
+ function getAndroidManagerInstance(module: string) {
12
+ return UIManager.getViewManagerConfig(module);
16
13
  }
17
14
 
18
15
  function getIosManagerInstance(module: string): any {
@@ -84,11 +81,14 @@ export function runNativeCommand<ReturnType = NativeArg>(
84
81
  }
85
82
 
86
83
  if (isAndroid()) {
87
- return NativeModules.UIManager.dispatchViewManagerCommand(
84
+ UIManager.dispatchViewManagerCommand(
88
85
  handle,
89
86
  managerInstance.Commands[name],
90
87
  args,
91
88
  );
89
+
90
+ // Android uses callback instead of return
91
+ return null as ReturnType;
92
92
  }
93
93
 
94
94
  return managerInstance[name](handle, ...args);
@@ -125,6 +125,7 @@ export function getIOSModuleName(moduleName: string): string {
125
125
  if (moduleName.startsWith("RCT")) {
126
126
  return moduleName.substring(3);
127
127
  }
128
+
128
129
  return moduleName;
129
130
  }
130
131
 
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
2
  // DO NOT MODIFY
3
- // THIS FILE IS AUTOGENERATED
3
+ // This file is auto-generated from scripts/templates/styleMap.ts.ejs
4
4
 
5
5
  import { isAndroid } from "./index";
6
6
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maplibre/maplibre-react-native",
3
3
  "description": "React Native library for creating maps with MapLibre Native for Android & iOS",
4
- "version": "10.0.0-alpha.26",
4
+ "version": "10.0.0-alpha.27",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -15,7 +15,7 @@ import {
15
15
  isVersionGTE,
16
16
  } from "./utils/getNativeVersion";
17
17
 
18
- const TMPL_PATH = path.join(__dirname, "templates");
18
+ const TEMPLATES_PATH = path.join(__dirname, "templates");
19
19
 
20
20
  const IOS_OUTPUT_PATH = path.join(__dirname, "..", "ios", "RCTMLN");
21
21
  const ANDROID_OUTPUT_PATH = path.join(
@@ -36,23 +36,23 @@ const JS_OUTPUT_PATH = path.join(__dirname, "..", "javascript", "utils");
36
36
 
37
37
  const TEMPLATE_MAPPINGS = [
38
38
  {
39
- input: path.join(TMPL_PATH, "RCTMLNStyle.h.ejs"),
39
+ input: path.join(TEMPLATES_PATH, "RCTMLNStyle.h.ejs"),
40
40
  output: path.join(IOS_OUTPUT_PATH, "RCTMLNStyle.h"),
41
41
  },
42
42
  {
43
- input: path.join(TMPL_PATH, "MaplibreStyles.ts.ejs"),
43
+ input: path.join(TEMPLATES_PATH, "MaplibreStyles.ts.ejs"),
44
44
  output: path.join(JS_OUTPUT_PATH, "MaplibreStyles.d.ts"),
45
45
  },
46
46
  {
47
- input: path.join(TMPL_PATH, "RCTMLNStyle.m.ejs"),
47
+ input: path.join(TEMPLATES_PATH, "RCTMLNStyle.m.ejs"),
48
48
  output: path.join(IOS_OUTPUT_PATH, "RCTMLNStyle.m"),
49
49
  },
50
50
  {
51
- input: path.join(TMPL_PATH, "RCTMLNStyleFactory.java.ejs"),
51
+ input: path.join(TEMPLATES_PATH, "RCTMLNStyleFactory.java.ejs"),
52
52
  output: path.join(ANDROID_OUTPUT_PATH, "RCTMLNStyleFactory.java"),
53
53
  },
54
54
  {
55
- input: path.join(TMPL_PATH, "styleMap.ts.ejs"),
55
+ input: path.join(TEMPLATES_PATH, "styleMap.ts.ejs"),
56
56
  output: path.join(JS_OUTPUT_PATH, "styleMap.ts"),
57
57
  },
58
58
  ];
@@ -295,11 +295,15 @@ async function generate() {
295
295
  const filename = path.parse(output).base;
296
296
 
297
297
  console.log(`Generating ${filename}`);
298
- const tmpl = ejs.compile(await fs.readFile(input, "utf8"), {
298
+ const template = ejs.compile(await fs.readFile(input, "utf8"), {
299
299
  strict: true,
300
300
  async: true,
301
301
  });
302
- let results = await tmpl({ layers, helpers: TemplateHelpers });
302
+ let results = await template({
303
+ layers,
304
+ filePath: path.relative(path.join(__dirname, ".."), input),
305
+ helpers: TemplateHelpers,
306
+ });
303
307
  if (filename.endsWith("ts")) {
304
308
  results = await prettier.format(results, {
305
309
  filepath: filename,
@@ -2,7 +2,9 @@
2
2
  const layers = locals.layers;
3
3
  const helpers = locals.helpers;
4
4
  -%>
5
- /* This file was generated from MapboxStyle.ts.ejs do not modify */
5
+ // <%= helpers.autoGeneratedHeader.doNotModify %>
6
+ // <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
7
+
6
8
  import { type ImageSourcePropType } from 'react-native';
7
9
 
8
10
  export type Translation = { x: number; y: number } | [number, number];
@@ -2,8 +2,8 @@
2
2
  const layers = locals.layers;
3
3
  const helpers = locals.helpers;
4
4
  -%>
5
- // DO NOT MODIFY
6
- // THIS FILE IS AUTOGENERATED
5
+ // <%= helpers.autoGeneratedHeader.doNotModify %>
6
+ // <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
7
7
 
8
8
  #import "RCTMLNStyle.h"
9
9
  #import "RCTMLNStyleValue.h"
@@ -2,8 +2,8 @@
2
2
  const layers = locals.layers;
3
3
  const helpers = locals.helpers;
4
4
  -%>
5
- // DO NOT MODIFY
6
- // THIS FILE IS AUTOGENERATED
5
+ // <%= helpers.autoGeneratedHeader.doNotModify %>
6
+ // <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
7
7
 
8
8
  #import "RCTMLNStyle.h"
9
9
  #import "RCTMLNUtils.h"
@@ -2,8 +2,8 @@
2
2
  const layers = locals.layers;
3
3
  const helpers = locals.helpers;
4
4
  -%>
5
- // DO NOT MODIFY
6
- // THIS FILE IS AUTOGENERATED
5
+ // <%= helpers.autoGeneratedHeader.doNotModify %>
6
+ // <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
7
7
 
8
8
  package com.maplibre.rctmln.components.styles;
9
9
 
@@ -2,8 +2,8 @@
2
2
  const component = locals.component;
3
3
  const helpers = locals.helpers;
4
4
  -%>
5
- <!-- DO NOT MODIFY! -->
6
- <!-- This file is auto-generated from <%- component.filePath %> -->
5
+ <!-- <%= helpers.autoGeneratedHeader.doNotModify %> -->
6
+ <!-- <%= helpers.autoGeneratedHeader.generatedFrom(component.filePath) %> -->
7
7
  # `<MapLibreGL.<%- component.name %> />`
8
8
  <%- helpers.replaceNewLine(component.description) %>
9
9
 
@@ -3,8 +3,8 @@
3
3
  const helpers = locals.helpers;
4
4
  -%>
5
5
  /* eslint-disable */
6
- // DO NOT MODIFY
7
- // THIS FILE IS AUTOGENERATED
6
+ // <%= helpers.autoGeneratedHeader.doNotModify %>
7
+ // <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
8
8
 
9
9
  import { isAndroid } from './index';
10
10
 
@@ -4,18 +4,18 @@ import path from "node:path";
4
4
 
5
5
  import * as TemplateHelpers from "./TemplateHelpers";
6
6
 
7
- const TMPL_PATH = path.join(__dirname, "..", "templates");
7
+ const TEMPLATE_PATH = path.join(__dirname, "..", "templates");
8
8
 
9
9
  export class MarkdownBuilder {
10
10
  async generateComponentFile(docJSON: any, componentName: string) {
11
- const tmpl = ejs.compile(
12
- await fs.readFile(path.join(TMPL_PATH, "component.md.ejs"), "utf8"),
11
+ const template = ejs.compile(
12
+ await fs.readFile(path.join(TEMPLATE_PATH, "component.md.ejs"), "utf8"),
13
13
  {
14
14
  async: true,
15
15
  strict: true,
16
16
  },
17
17
  );
18
- const fileContents = await tmpl({
18
+ const fileContents = await template({
19
19
  component: docJSON[componentName],
20
20
  helpers: TemplateHelpers,
21
21
  });
@@ -40,6 +40,12 @@ const iosSpecOverrides: Record<string, string> = {
40
40
  "text-writing-mode": "text-writing-modes",
41
41
  };
42
42
 
43
+ export const autoGeneratedHeader = {
44
+ doNotModify: "DO NOT MODIFY",
45
+ generatedFrom: (filePath: string) =>
46
+ `This file is auto-generated from ${filePath}`,
47
+ };
48
+
43
49
  export function exists<T>(value: T): value is NonNullable<T> {
44
50
  return typeof value !== "undefined" && value !== null;
45
51
  }