@agrid/agrid-react-native 4.12.11

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 (151) hide show
  1. package/README.md +691 -0
  2. package/dist/AgridContext.d.ts +5 -0
  3. package/dist/AgridContext.js +1 -0
  4. package/dist/AgridContext.js.map +1 -0
  5. package/dist/AgridProvider.d.ts +86 -0
  6. package/dist/AgridProvider.js +1 -0
  7. package/dist/AgridProvider.js.map +1 -0
  8. package/dist/agrid-rn.d.ts +612 -0
  9. package/dist/agrid-rn.js +1 -0
  10. package/dist/agrid-rn.js.map +1 -0
  11. package/dist/autocapture.d.ts +4 -0
  12. package/dist/autocapture.js +1 -0
  13. package/dist/autocapture.js.map +1 -0
  14. package/dist/error-tracking/index.d.ts +27 -0
  15. package/dist/error-tracking/index.js +1 -0
  16. package/dist/error-tracking/index.js.map +1 -0
  17. package/dist/error-tracking/utils.d.ts +5 -0
  18. package/dist/error-tracking/utils.js +1 -0
  19. package/dist/error-tracking/utils.js.map +1 -0
  20. package/dist/frameworks/wix-navigation.d.ts +3 -0
  21. package/dist/frameworks/wix-navigation.js +1 -0
  22. package/dist/frameworks/wix-navigation.js.map +1 -0
  23. package/dist/hooks/useAgrid.d.ts +2 -0
  24. package/dist/hooks/useAgrid.js +1 -0
  25. package/dist/hooks/useAgrid.js.map +1 -0
  26. package/dist/hooks/useFeatureFlag.d.ts +5 -0
  27. package/dist/hooks/useFeatureFlag.js +1 -0
  28. package/dist/hooks/useFeatureFlag.js.map +1 -0
  29. package/dist/hooks/useFeatureFlags.d.ts +3 -0
  30. package/dist/hooks/useFeatureFlags.js +1 -0
  31. package/dist/hooks/useFeatureFlags.js.map +1 -0
  32. package/dist/hooks/useNavigationTracker.d.ts +6 -0
  33. package/dist/hooks/useNavigationTracker.js +1 -0
  34. package/dist/hooks/useNavigationTracker.js.map +1 -0
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/native-deps.d.ts +4 -0
  39. package/dist/native-deps.js +1 -0
  40. package/dist/native-deps.js.map +1 -0
  41. package/dist/optional/OptionalAsyncStorage.d.ts +2 -0
  42. package/dist/optional/OptionalAsyncStorage.js +1 -0
  43. package/dist/optional/OptionalAsyncStorage.js.map +1 -0
  44. package/dist/optional/OptionalExpoApplication.d.ts +2 -0
  45. package/dist/optional/OptionalExpoApplication.js +1 -0
  46. package/dist/optional/OptionalExpoApplication.js.map +1 -0
  47. package/dist/optional/OptionalExpoDevice.d.ts +2 -0
  48. package/dist/optional/OptionalExpoDevice.js +1 -0
  49. package/dist/optional/OptionalExpoDevice.js.map +1 -0
  50. package/dist/optional/OptionalExpoFileSystem.d.ts +2 -0
  51. package/dist/optional/OptionalExpoFileSystem.js +1 -0
  52. package/dist/optional/OptionalExpoFileSystem.js.map +1 -0
  53. package/dist/optional/OptionalExpoFileSystemLegacy.d.ts +2 -0
  54. package/dist/optional/OptionalExpoFileSystemLegacy.js +1 -0
  55. package/dist/optional/OptionalExpoFileSystemLegacy.js.map +1 -0
  56. package/dist/optional/OptionalExpoLocalization.d.ts +2 -0
  57. package/dist/optional/OptionalExpoLocalization.js +1 -0
  58. package/dist/optional/OptionalExpoLocalization.js.map +1 -0
  59. package/dist/optional/OptionalReactNativeDeviceInfo.d.ts +2 -0
  60. package/dist/optional/OptionalReactNativeDeviceInfo.js +1 -0
  61. package/dist/optional/OptionalReactNativeDeviceInfo.js.map +1 -0
  62. package/dist/optional/OptionalReactNativeLocalize.d.ts +13 -0
  63. package/dist/optional/OptionalReactNativeLocalize.js +1 -0
  64. package/dist/optional/OptionalReactNativeLocalize.js.map +1 -0
  65. package/dist/optional/OptionalReactNativeNavigation.d.ts +2 -0
  66. package/dist/optional/OptionalReactNativeNavigation.js +1 -0
  67. package/dist/optional/OptionalReactNativeNavigation.js.map +1 -0
  68. package/dist/optional/OptionalReactNativeNavigationWix.d.ts +2 -0
  69. package/dist/optional/OptionalReactNativeNavigationWix.js +1 -0
  70. package/dist/optional/OptionalReactNativeNavigationWix.js.map +1 -0
  71. package/dist/optional/OptionalReactNativeSafeArea.d.ts +2 -0
  72. package/dist/optional/OptionalReactNativeSafeArea.js +1 -0
  73. package/dist/optional/OptionalReactNativeSafeArea.js.map +1 -0
  74. package/dist/optional/OptionalSessionReplay.d.ts +2 -0
  75. package/dist/optional/OptionalSessionReplay.js +1 -0
  76. package/dist/optional/OptionalSessionReplay.js.map +1 -0
  77. package/dist/storage.d.ts +21 -0
  78. package/dist/storage.js +1 -0
  79. package/dist/storage.js.map +1 -0
  80. package/dist/surveys/AgridSurveyProvider.d.ts +16 -0
  81. package/dist/surveys/AgridSurveyProvider.js +1 -0
  82. package/dist/surveys/AgridSurveyProvider.js.map +1 -0
  83. package/dist/surveys/components/BottomSection.d.ts +8 -0
  84. package/dist/surveys/components/BottomSection.js +1 -0
  85. package/dist/surveys/components/BottomSection.js.map +1 -0
  86. package/dist/surveys/components/Cancel.d.ts +5 -0
  87. package/dist/surveys/components/Cancel.js +1 -0
  88. package/dist/surveys/components/Cancel.js.map +1 -0
  89. package/dist/surveys/components/ConfirmationMessage.d.ts +12 -0
  90. package/dist/surveys/components/ConfirmationMessage.js +1 -0
  91. package/dist/surveys/components/ConfirmationMessage.js.map +1 -0
  92. package/dist/surveys/components/QuestionHeader.d.ts +6 -0
  93. package/dist/surveys/components/QuestionHeader.js +1 -0
  94. package/dist/surveys/components/QuestionHeader.js.map +1 -0
  95. package/dist/surveys/components/QuestionTypes.d.ts +26 -0
  96. package/dist/surveys/components/QuestionTypes.js +1 -0
  97. package/dist/surveys/components/QuestionTypes.js.map +1 -0
  98. package/dist/surveys/components/SurveyModal.d.ts +9 -0
  99. package/dist/surveys/components/SurveyModal.js +1 -0
  100. package/dist/surveys/components/SurveyModal.js.map +1 -0
  101. package/dist/surveys/components/Surveys.d.ts +13 -0
  102. package/dist/surveys/components/Surveys.js +1 -0
  103. package/dist/surveys/components/Surveys.js.map +1 -0
  104. package/dist/surveys/getActiveMatchingSurveys.d.ts +2 -0
  105. package/dist/surveys/getActiveMatchingSurveys.js +1 -0
  106. package/dist/surveys/getActiveMatchingSurveys.js.map +1 -0
  107. package/dist/surveys/icons.d.ts +8 -0
  108. package/dist/surveys/icons.js +1 -0
  109. package/dist/surveys/icons.js.map +1 -0
  110. package/dist/surveys/index.d.ts +6 -0
  111. package/dist/surveys/index.js +1 -0
  112. package/dist/surveys/index.js.map +1 -0
  113. package/dist/surveys/surveys-utils.d.ts +30 -0
  114. package/dist/surveys/surveys-utils.js +1 -0
  115. package/dist/surveys/surveys-utils.js.map +1 -0
  116. package/dist/surveys/useActivatedSurveys.d.ts +3 -0
  117. package/dist/surveys/useActivatedSurveys.js +1 -0
  118. package/dist/surveys/useActivatedSurveys.js.map +1 -0
  119. package/dist/surveys/useSurveyStorage.d.ts +8 -0
  120. package/dist/surveys/useSurveyStorage.js +1 -0
  121. package/dist/surveys/useSurveyStorage.js.map +1 -0
  122. package/dist/tooling/agridMetroSerializer.d.ts +17 -0
  123. package/dist/tooling/agridMetroSerializer.js +1 -0
  124. package/dist/tooling/agridMetroSerializer.js.map +1 -0
  125. package/dist/tooling/metroconfig.d.ts +15 -0
  126. package/dist/tooling/metroconfig.js +1 -0
  127. package/dist/tooling/metroconfig.js.map +1 -0
  128. package/dist/tooling/utils.d.ts +58 -0
  129. package/dist/tooling/utils.js +1 -0
  130. package/dist/tooling/utils.js.map +1 -0
  131. package/dist/tooling/vendor/expo/expoconfig.d.ts +23 -0
  132. package/dist/tooling/vendor/expo/expoconfig.js +1 -0
  133. package/dist/tooling/vendor/expo/expoconfig.js.map +1 -0
  134. package/dist/tooling/vendor/metro/countLines.d.ts +2 -0
  135. package/dist/tooling/vendor/metro/countLines.js +1 -0
  136. package/dist/tooling/vendor/metro/countLines.js.map +1 -0
  137. package/dist/tooling/vendor/metro/utils.d.ts +22 -0
  138. package/dist/tooling/vendor/metro/utils.js +1 -0
  139. package/dist/tooling/vendor/metro/utils.js.map +1 -0
  140. package/dist/types.d.ts +150 -0
  141. package/dist/types.js +1 -0
  142. package/dist/types.js.map +1 -0
  143. package/dist/utils.d.ts +20 -0
  144. package/dist/utils.js +1 -0
  145. package/dist/utils.js.map +1 -0
  146. package/dist/version.d.ts +1 -0
  147. package/dist/version.js +1 -0
  148. package/dist/version.js.map +1 -0
  149. package/package.json +134 -0
  150. package/tooling/agrid-xcode.sh +111 -0
  151. package/tooling/agrid.gradle +312 -0
@@ -0,0 +1,58 @@
1
+ import type { MixedOutput, Module, ReadOnlyGraph, SerializerOptions } from 'metro';
2
+ import type CountingSet from 'metro/src/lib/CountingSet';
3
+ export type VirtualJSOutput = {
4
+ type: 'js/script/virtual';
5
+ data: {
6
+ code: string;
7
+ lineCount: number;
8
+ map: [];
9
+ };
10
+ };
11
+ export type Bundle = {
12
+ modules: Array<[id: number, code: string]>;
13
+ post: string;
14
+ pre: string;
15
+ };
16
+ export type SerializedBundle = {
17
+ code: string;
18
+ map: string;
19
+ };
20
+ export type MetroSerializerOutput = string | SerializedBundle | Promise<string | SerializedBundle>;
21
+ export type MetroSerializer = (entryPoint: string, premodules: ReadonlyArray<Module>, graph: ReadOnlyGraph, options: SerializerOptions) => MetroSerializerOutput;
22
+ /**
23
+ * Returns minified Chunk ID code snippet.
24
+ */
25
+ export declare function createDebugIdSnippet(debugId: string): string;
26
+ /**
27
+ * Deterministically hashes a string and turns the hash into a uuid.
28
+ *
29
+ * https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/58271f1af2ade6b3e64d393d70376ae53bc5bd2f/packages/bundler-plugin-core/src/utils.ts#L174
30
+ */
31
+ export declare function stringToUUID(str: string): string;
32
+ /**
33
+ * Looks for an injected `_agridChunkIds[n] = "debugId"` pattern
34
+ * in the bundle source and extracts the `debugId` value from it.
35
+ *
36
+ * Matches both string and numeric keys for `n`, e.g.:
37
+ * _agridChunkIds["abc"] = "1234"
38
+ * _agridChunkIds[42] = "1234"
39
+ */
40
+ export declare function determineDebugIdFromBundleSource(code: string): string | undefined;
41
+ export declare const createSet: () => CountingSet<string>;
42
+ /**
43
+ * Prepends the module after default required prelude modules.
44
+ */
45
+ export declare function prependModule(modules: readonly Module<MixedOutput>[], module: Module<VirtualJSOutput>): Module<MixedOutput>[];
46
+ /**
47
+ * Creates a virtual JS module with the given path and code.
48
+ */
49
+ export declare function createVirtualJSModule(modulePath: string, moduleCode: string): Module<VirtualJSOutput> & {
50
+ setSource: (code: string) => void;
51
+ };
52
+ /**
53
+ * Tries to load Expo config using `@expo/config` package.
54
+ */
55
+ export declare function getExpoConfig(projectRoot: string): Partial<{
56
+ name: string;
57
+ version: string;
58
+ }>;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.createDebugIdSnippet=createDebugIdSnippet;exports.createSet=void 0;exports.createVirtualJSModule=createVirtualJSModule;exports.determineDebugIdFromBundleSource=determineDebugIdFromBundleSource;exports.getExpoConfig=getExpoConfig;exports.prependModule=prependModule;exports.stringToUUID=stringToUUID;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var crypto=_interopRequireWildcard(require("crypto"));var _countLines=_interopRequireDefault(require("./vendor/metro/countLines"));function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function createDebugIdSnippet(debugId){return"!function(){try{var e=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._agridChunkIds=e._agridChunkIds||{},e._agridChunkIds[n]=\"".concat(debugId,"\")}catch(e){}}();");}function stringToUUID(str){var md5sum=crypto.createHash('md5');md5sum.update(str);var md5Hash=md5sum.digest('hex');var v4variant=['8','9','a','b'][md5Hash.substring(16,17).charCodeAt(0)%4];return"".concat(md5Hash.substring(0,8),"-").concat(md5Hash.substring(8,12),"-4").concat(md5Hash.substring(13,16),"-").concat(v4variant).concat(md5Hash.substring(17,20),"-").concat(md5Hash.substring(20)).toLowerCase();}function determineDebugIdFromBundleSource(code){var match=code.match(/_agridChunkIds\[\s*(?:(?:"[^"]*")|(?:'[^']*')|\d+)\s*\]\s*=\s*"([^"]+)"/);return match?match[1]:undefined;}function resolveSetCreator(){var CountingSetFromPrivate=safeRequireCountingSetFromPrivate();if(CountingSetFromPrivate){return function(){return new CountingSetFromPrivate["default"]();};}var CountingSetFromSrc=safeRequireCountingSetFromSrc();if(CountingSetFromSrc){return function(){return new CountingSetFromSrc["default"]();};}return function(){return new Set();};}function safeRequireCountingSetFromSrc(){try{return require('metro/src/lib/CountingSet');}catch(e){return undefined;}}function safeRequireCountingSetFromPrivate(){try{return require('metro/private/lib/CountingSet');}catch(e){return undefined;}}var createSet=exports.createSet=resolveSetCreator();var PRELUDE_MODULE_PATH='__prelude__';function prependModule(modules,module){var modifiedPremodules=(0,_toConsumableArray2["default"])(modules);if(modifiedPremodules.length>0&&modifiedPremodules[0]!==undefined&&modifiedPremodules[0].path===PRELUDE_MODULE_PATH){modifiedPremodules.unshift(modules[0]);modifiedPremodules[1]=module;}else{modifiedPremodules.unshift(module);}return modifiedPremodules;}function createVirtualJSModule(modulePath,moduleCode){var sourceCode=moduleCode;return{setSource:function setSource(code){sourceCode=code;},dependencies:new Map(),getSource:function getSource(){return Buffer.from(sourceCode);},inverseDependencies:createSet(),path:modulePath,output:[{type:'js/script/virtual',data:{code:sourceCode,lineCount:(0,_countLines["default"])(sourceCode),map:[]}}]};}function getExpoConfig(projectRoot){try{var expoConfig=require('@expo/config');if(expoConfig.getConfig){var _expoConfig$getConfig=expoConfig.getConfig(projectRoot),exp=_expoConfig$getConfig.exp;return{name:typeof exp.name==='string'&&exp.name?exp.name:undefined,version:typeof exp.version==='string'&&exp.version?exp.version:undefined};}}catch(_a){}return{};}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tooling/utils.ts"],"names":[],"mappings":"AAAA,iJAAiJ;AAEjJ,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAIhC,OAAO,UAAU,MAAM,2BAA2B,CAAA;AA8BlD;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,6PAA6P,OAAO,mBAAmB,CAAA;AAChS,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClB,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAEpC,oFAAoF;IACpF,uBAAuB;IACvB,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAW,CAAA;IAE7F,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,SAAS,CACjF,EAAE,EACF,EAAE,CACH,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,EAAE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AAc,CAExC,CAAA;QACD,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;YACzB,MAAM,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;YACjD,OAAO;gBACL,IAAI,EAAE,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;gBACrE,OAAO,EAAE,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;aAClF,CAAA;QACH,CAAC;IACH,CAAC;IAAC,WAAM,CAAC;QACP,yCAAyC;IAC3C,CAAC;IAED,OAAO,EAAE,CAAA;AACX,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { MixedOutput, Module, ReadOnlyGraph } from 'metro';
2
+ export interface DefaultConfigOptions {
3
+ /** @deprecated */
4
+ mode?: 'exotic';
5
+ /**
6
+ * **Experimental:** Enable CSS support for Metro web, and shim on native.
7
+ *
8
+ * This is an experimental feature and may change in the future. The underlying implementation
9
+ * is subject to change, and native support for CSS Modules may be added in the future during a non-major SDK release.
10
+ */
11
+ isCSSEnabled?: boolean;
12
+ /**
13
+ * **Experimental:** Modify premodules before a code asset is serialized
14
+ *
15
+ * This is an experimental feature and may change in the future. The underlying implementation
16
+ * is subject to change.
17
+ */
18
+ unstable_beforeAssetSerializationPlugins?: ((serializationInput: {
19
+ graph: ReadOnlyGraph<MixedOutput>;
20
+ premodules: Module[];
21
+ debugId?: string;
22
+ }) => Module[])[];
23
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expoconfig.js","sourceRoot":"","sources":["../../../../src/tooling/vendor/expo/expoconfig.ts"],"names":[],"mappings":"AAAA,wBAAwB"}
@@ -0,0 +1,2 @@
1
+ declare const _default: (string: string) => number;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var newline=/\r\n?|\n|\u2028|\u2029/g;var _default=exports["default"]=function _default(string){return(string.match(newline)||[]).length+1;};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countLines.js","sourceRoot":"","sources":["../../../../src/tooling/vendor/metro/countLines.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,uHAAuH;AAEvH,cAAc;AAEd,qDAAqD;AAErD,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAE3D,iFAAiF;AACjF,kDAAkD;AAElD,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;AAEZ,4FAA4F;AAC5F,oGAAoG;AACpG,8CAA8C;AAE9C,MAAM,OAAO,GAAG,yBAAyB,CAAA;AAEzC,eAAe,CAAC,MAAc,EAAU,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { Module, ReadOnlyGraph } from 'metro';
2
+ import type { MetroSerializer } from '../../utils';
3
+ /**
4
+ * This function ensures that modules in source maps are sorted in the same
5
+ * order as in a plain JS bundle.
6
+ *
7
+ * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L984
8
+ */
9
+ export declare const getSortedModules: (graph: ReadOnlyGraph, { createModuleId, }: {
10
+ createModuleId: (file: string) => number;
11
+ }) => readonly Module[];
12
+ /**
13
+ * Creates the default Metro plain bundle serializer.
14
+ * Because Metro exports only the intermediate serializer functions, we need to
15
+ * assemble the final serializer ourselves. We have to work with the modules the same as Metro does
16
+ * to avoid unexpected changes in the final bundle.
17
+ *
18
+ * This is used when the user does not provide a custom serializer.
19
+ *
20
+ * https://github.com/facebook/metro/blob/9b85f83c9cc837d8cd897aa7723be7da5b296067/packages/metro/src/Server.js#L244-L277
21
+ */
22
+ export declare const createDefaultMetroSerializer: () => MetroSerializer;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getSortedModules=exports.createDefaultMetroSerializer=void 0;var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _a,_b;var baseJSBundleModule;try{baseJSBundleModule=require('metro/private/DeltaBundler/Serializers/baseJSBundle');}catch(_c){baseJSBundleModule=require('metro/src/DeltaBundler/Serializers/baseJSBundle');}var baseJSBundle=typeof baseJSBundleModule==='function'?baseJSBundleModule:(_a=baseJSBundleModule===null||baseJSBundleModule===void 0?void 0:baseJSBundleModule.baseJSBundle)!==null&&_a!==void 0?_a:baseJSBundleModule===null||baseJSBundleModule===void 0?void 0:baseJSBundleModule["default"];var sourceMapString;try{var sourceMapStringModule=require('metro/private/DeltaBundler/Serializers/sourceMapString');sourceMapString=sourceMapStringModule.sourceMapString;}catch(e){sourceMapString=require('metro/src/DeltaBundler/Serializers/sourceMapString');if('sourceMapString'in sourceMapString){sourceMapString=sourceMapString.sourceMapString;}}var bundleToStringModule;try{bundleToStringModule=require('metro/private/lib/bundleToString');}catch(_d){bundleToStringModule=require('metro/src/lib/bundleToString');}var bundleToString=typeof bundleToStringModule==='function'?bundleToStringModule:(_b=bundleToStringModule===null||bundleToStringModule===void 0?void 0:bundleToStringModule.bundleToString)!==null&&_b!==void 0?_b:bundleToStringModule===null||bundleToStringModule===void 0?void 0:bundleToStringModule["default"];var getSortedModules=exports.getSortedModules=function getSortedModules(graph,_ref){var createModuleId=_ref.createModuleId;var modules=(0,_toConsumableArray2["default"])(graph.dependencies.values());return modules.sort(function(a,b){return createModuleId(a.path)-createModuleId(b.path);});};var createDefaultMetroSerializer=exports.createDefaultMetroSerializer=function createDefaultMetroSerializer(){return function(entryPoint,premodules,graph,options){var bundle=(baseJSBundle["default"]||baseJSBundle)(entryPoint,premodules,graph,options);var _ref2=(bundleToString["default"]||bundleToString)(bundle),code=_ref2.code;if(graph.transformOptions.hot){return code;}var sourceMapStringFunction;if(typeof sourceMapString==='function'){sourceMapStringFunction=sourceMapString;}else if((0,_typeof2["default"])(sourceMapString)==='object'&&sourceMapString!=null&&'sourceMapString'in sourceMapString&&typeof sourceMapString['sourceMapString']==='function'){sourceMapStringFunction=sourceMapString.sourceMapString;}else{throw new Error("\n[agrid-react-native/metro] Can't find sourceMapString function in 'metro/src/DeltaBundler/Serializers/sourceMapString'.\nPlease check the version of Metro you are using and report the issue at https://github.com/postHog/agrid-js\n");}var map=(sourceMapStringFunction["default"]||sourceMapStringFunction)([].concat((0,_toConsumableArray2["default"])(premodules),(0,_toConsumableArray2["default"])(getSortedModules(graph,options))),{processModuleFilter:options.processModuleFilter,shouldAddToIgnoreList:options.shouldAddToIgnoreList||function(){return false;}});return{code:code,map:map};};};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/tooling/vendor/metro/utils.ts"],"names":[],"mappings":"AAAA,2CAA2C;;AAiC3C,IAAI,kBAAuB,CAAA;AAC3B,IAAI,CAAC;IACH,iEAAiE;IACjE,kBAAkB,GAAG,OAAO,CAAC,qDAAqD,CAAC,CAAA;AACrF,CAAC;AAAC,WAAM,CAAC;IACP,iEAAiE;IACjE,kBAAkB,GAAG,OAAO,CAAC,iDAAiD,CAAC,CAAA;AACjF,CAAC;AAED,MAAM,YAAY,GAChB,OAAO,kBAAkB,KAAK,UAAU;IACtC,CAAC,CAAC,kBAAkB;IACpB,CAAC,CAAC,sEAAsE;QACtE,CAAC,MAAA,kBAAkB,aAAlB,kBAAkB,uB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IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;SACtE,CACF,CAAA;QACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAA;IACtB,CAAC,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,150 @@
1
+ export type AgridAutocaptureNavigationTrackerOptions = {
2
+ routeToName?: (name: string, params: any) => string;
3
+ routeToProperties?: (name: string, params: any) => Record<string, any>;
4
+ };
5
+ /**
6
+ * @deprecated
7
+ */
8
+ export type AgridNavigationRef = {
9
+ getCurrentRoute(): any | undefined;
10
+ isReady: () => boolean;
11
+ current?: AgridNavigationRef | any | undefined;
12
+ };
13
+ export type AgridAutocaptureOptions = {
14
+ captureTouches?: boolean;
15
+ customLabelProp?: string;
16
+ noCaptureProp?: string;
17
+ maxElementsCaptured?: number;
18
+ ignoreLabels?: string[];
19
+ propsToCapture?: string[];
20
+ /**
21
+ * Capture the screen name (or route name) and properties
22
+ *
23
+ * Only used for expo-router, @react-navigation/native and react-native-navigation
24
+ *
25
+ * For react-native-navigation, you need to call initReactNativeNavigation before using this option
26
+ * See example: https://agrid.com/docs/libraries/react-native#with-react-native-navigation-and-autocapture
27
+ *
28
+ * For @react-navigation/native v6 and below, you need to wrap the AgridProvider within the NavigationContainer
29
+ * See example: https://agrid.com/docs/libraries/react-native#with-react-navigationnative-and-autocapture
30
+ *
31
+ * For @react-navigation/native v7 and above, because of a library change, you'll need to capture the screens manually and disable this option
32
+ * You can use the onStateChange callback from the NavigationContainer to capture the screens automatically using the screen capture method
33
+ * You can use the 'useAgrid()' hook or your own agrid instance to capture the screens
34
+ * Since captureScreens is disabled, you don't need to pass the navigationRef, the navigation mutation object is also ignored
35
+ * See example: https://reactnavigation.org/docs/screen-tracking/ and https://agrid.com/docs/libraries/react-native#manually-capturing-screen-capture-events
36
+ *
37
+ * For expo-router, expo-router uses @react-navigation/native, but does not expose the NavigationContainer, you'll need to capture the screens manually and disable this option
38
+ * expo-router always has access to a URL, you can use the URL to capture the screens automatically using the screen capture method
39
+ * You can use the 'useAgrid()' hook or your own agrid instance to capture the screens
40
+ * Since captureScreens is disabled, you don't need to pass the navigationRef, the navigation mutation object is also ignored
41
+ * See example: https://docs.expo.dev/router/reference/screen-tracking/ and https://agrid.com/docs/libraries/react-native#manually-capturing-screen-capture-events
42
+ *
43
+ * @default true
44
+ */
45
+ captureScreens?: boolean;
46
+ /**
47
+ * Used for mutating the screen name and properties
48
+ * Only used if captureScreens is true
49
+ *
50
+ * @default Default to the route name and params
51
+ */
52
+ navigation?: AgridAutocaptureNavigationTrackerOptions;
53
+ /**
54
+ * If you create a navigation ref with createNavigationContainerRef, you need to pass the navigation ref
55
+ * Only used for expo-router and @react-navigation/native if captureScreens is true
56
+ *
57
+ * @deprecated this is deprecated since it didn't work as expected, check out the `captureScreens` comments for capturing screen views semi-automatically
58
+ */
59
+ navigationRef?: AgridNavigationRef;
60
+ };
61
+ export interface AgridCustomAppProperties {
62
+ /** Build number like "1.2.2" or "122" */
63
+ $app_build?: string | null;
64
+ /** Name of the app as displayed below the icon like "Agrid" */
65
+ $app_name?: string | null;
66
+ /** Namespace of the app usually like "com.agrid.app" */
67
+ $app_namespace?: string | null;
68
+ /** Human friendly app version like what a user would see in the app store like "1.2.2" */
69
+ $app_version?: string | null;
70
+ /** Manufacturer like "Apple", "Samsung" or "Android" */
71
+ $device_manufacturer?: string | null;
72
+ /** Readable model name like "iPhone 12" or "Samsung Galaxy S24" */
73
+ $device_name?: string | null;
74
+ /** Model identifier like "iPhone13,2" or "SM-S921B" */
75
+ $device_model?: string | null;
76
+ /** Device type ("Mobile" | "Desktop" | "Web") */
77
+ $device_type?: string | null;
78
+ /** Operating system name like iOS or Android */
79
+ $os_name?: string | null;
80
+ /** Operating system version "14.0" */
81
+ $os_version?: string | null;
82
+ /** Locale (language) of the device like "en-US" */
83
+ $locale?: string | null;
84
+ /** Timezone of the device like "Europe/Berlin" */
85
+ $timezone?: string | null;
86
+ }
87
+ export type AgridSessionReplayConfig = {
88
+ /**
89
+ * Enable masking of all text and text input fields
90
+ * Default: true
91
+ */
92
+ maskAllTextInputs?: boolean;
93
+ /**
94
+ * Enable masking of all images to a placeholder
95
+ * Default: true
96
+ */
97
+ maskAllImages?: boolean;
98
+ /**
99
+ * Enable masking of all sandboxed system views
100
+ * These may include UIImagePickerController, PHPickerViewController and CNContactPickerViewController
101
+ * iOS only
102
+ * Experimental support
103
+ * Default: true
104
+ */
105
+ maskAllSandboxedViews?: boolean;
106
+ /**
107
+ * Enable capturing of logcat as console events
108
+ * Android only
109
+ * Default: true
110
+ */
111
+ captureLog?: boolean;
112
+ /**
113
+ * Deboucer delay used to reduce the number of snapshots captured and reduce performance impact
114
+ * This is used for capturing the view as a screenshot
115
+ * The lower the number more snapshots will be captured but higher the performance impact
116
+ * Defaults to 1s on iOS
117
+ * @deprecated please use throttleDelayMs instead
118
+ */
119
+ iOSdebouncerDelayMs?: number;
120
+ /**
121
+ * Deboucer delay used to reduce the number of snapshots captured and reduce performance impact
122
+ * This is used for capturing the view as a screenshot
123
+ * The lower the number more snapshots will be captured but higher the performance impact
124
+ * Defaults to 1000ms (1s)
125
+ * Ps: it was 500ms (0.5s) by default until version 3.3.7
126
+ * @deprecated please use throttleDelayMs instead
127
+ */
128
+ androidDebouncerDelayMs?: number;
129
+ /**
130
+ * Throttling delay used to reduce the number of snapshots captured and reduce performance impact
131
+ * This is used for capturing the view as a wireframe or screenshot
132
+ * The lower the number more snapshots will be captured but higher the performance impact
133
+ *
134
+ * This value has precedence over iOSdebouncerDelayMs and androidDebouncerDelayMs
135
+ * If this is not set, we will take the max number between iOSdebouncerDelayMs and androidDebouncerDelayMs for back compatibility
136
+ *
137
+ * Defaults to 1000ms = 1s
138
+ */
139
+ throttleDelayMs?: number;
140
+ /**
141
+ * Enable capturing network telemetry
142
+ * iOS only
143
+ * Default: true
144
+ */
145
+ captureNetworkTelemetry?: boolean;
146
+ };
147
+ export interface AgridCustomStorage {
148
+ getItem: (key: string) => string | null | Promise<string | null>;
149
+ setItem: (key: string, value: string) => void | Promise<void>;
150
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ type ReactNativeGlobal = {
2
+ HermesInternal?: {
3
+ enablePromiseRejectionTracker?: (args: {
4
+ allRejections: boolean;
5
+ onUnhandled?: (id: string, error: any) => void;
6
+ onHandled?: (id: string, error: any) => void;
7
+ }) => void;
8
+ hasPromise?: () => boolean;
9
+ };
10
+ ErrorUtils?: {
11
+ getGlobalHandler?: () => (error: Error, isFatal: boolean) => void;
12
+ setGlobalHandler?: (handler: (error: Error, isFatal: boolean) => void) => void;
13
+ };
14
+ onunhandledrejection?: (event: unknown) => void;
15
+ };
16
+ export declare const GLOBAL_OBJ: ReactNativeGlobal;
17
+ /** Checks if the current platform is web */
18
+ export declare function isWeb(): boolean;
19
+ export declare const isHermes: () => boolean;
20
+ export {};
package/dist/utils.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isHermes=exports.GLOBAL_OBJ=void 0;exports.isWeb=isWeb;var _reactNative=require("react-native");var _global=typeof global!=='undefined'?global:undefined;var _globalThis=typeof globalThis!=='undefined'?globalThis:undefined;var GLOBAL_OBJ=exports.GLOBAL_OBJ=_globalThis!==null&&_globalThis!==void 0?_globalThis:_global;function isWeb(){return _reactNative.Platform.OS==='web';}var isHermes=exports.isHermes=function isHermes(){return!!GLOBAL_OBJ.HermesInternal;};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAkBvC,kCAAkC;AAClC,MAAM,OAAO,GAA8B,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AAE7F,yDAAyD;AACzD,MAAM,WAAW,GAAkC,OAAO,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAA;AAE7G,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,OAAO,CAAiC,CAAA;AAElF,4CAA4C;AAC5C,MAAM,UAAU,KAAK;IACnB,OAAO,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAA;AAC9B,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const version = "4.12.11";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.12.11";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAA"}
package/package.json ADDED
@@ -0,0 +1,134 @@
1
+ {
2
+ "name": "@agrid/agrid-react-native",
3
+ "version": "4.12.11",
4
+ "description": "Thư viện Agrid React Native cho phép bạn tích hợp analytics vào ứng dụng React Native của mình. Thư viện này được xây dựng dựa trên PostHog và hỗ trợ đầy đủ cho ứng dụng React Native.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Agrid",
8
+ "email": "info@agrid.vn",
9
+ "url": "https://agrid.vn"
10
+ },
11
+ "keywords": [
12
+ "agrid",
13
+ "agrid-react-native",
14
+ "analytics",
15
+ "react-native",
16
+ "advn"
17
+ ],
18
+ "main": "dist/index.js",
19
+ "types": "dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./metro": {
26
+ "types": "./dist/tooling/metroconfig.d.ts",
27
+ "default": "./dist/tooling/metroconfig.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist/",
32
+ "tooling/"
33
+ ],
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/agridvn/agrid-react-native.git"
37
+ },
38
+ "scripts": {
39
+ "clean": "rimraf dist",
40
+ "lint": "eslint src test",
41
+ "lint:fix": "eslint src test --fix",
42
+ "test:unit": "jest -c jest.config.js",
43
+ "prepublishOnly": "pnpm build",
44
+ "prebuild": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts",
45
+ "build": "tsc -b && babel ./dist --out-dir dist --extensions '.js'",
46
+ "package": "pnpm pack --out $PACKAGE_DEST/%s.tgz",
47
+ "generate-references": "pnpm exec api-extractor run --config ./api-extractor.json --local && node scripts/generate-docs.js"
48
+ },
49
+ "dependencies": {
50
+ "@babel/runtime": "^7.28.4",
51
+ "@agrid/core": "^1.5.3"
52
+ },
53
+ "devDependencies": {
54
+ "@babel/preset-react": "^7.28.5",
55
+ "@react-native/assets-registry": "^0.82.1",
56
+ "@babel/cli": "^7.19.3",
57
+ "@babel/plugin-transform-private-property-in-object": "^7.27.1",
58
+ "@expo/metro-config": "~0.20.0",
59
+ "@react-native-async-storage/async-storage": "^1.17.10",
60
+ "@react-native/babel-preset": "^0.80.1",
61
+ "@react-navigation/native": "^5.0.10",
62
+ "@types/jest": "^29.5.0",
63
+ "@types/react": "^17.0.87",
64
+ "@types/react-native": "^0.69.1",
65
+ "expo": "^45.0.6",
66
+ "expo-application": "^4.0.0",
67
+ "expo-device": "^4.0.0",
68
+ "expo-file-system": "^13.0.0",
69
+ "expo-localization": "^11.0.0",
70
+ "jest": "^29.5.0",
71
+ "jest-environment-node": "^29.5.0",
72
+ "jest-expo": "^50.0.0",
73
+ "metro": "0.83.1",
74
+ "posthog-react-native-session-replay": "^1.2.0",
75
+ "react": "18.2.0",
76
+ "react-native": "^0.69.1",
77
+ "react-native-device-info": "^10.3.0",
78
+ "react-native-localize": "^3.0.0",
79
+ "react-native-navigation": "^6.0.0",
80
+ "react-native-safe-area-context": "^4.10.1",
81
+ "react-native-svg": "^15.0.0",
82
+ "ts-jest": "^29.1.0",
83
+ "typescript": "^5.0.0"
84
+ },
85
+ "peerDependencies": {
86
+ "@react-native-async-storage/async-storage": ">=1.0.0",
87
+ "@react-navigation/native": ">= 5.0.0",
88
+ "expo-application": ">= 4.0.0",
89
+ "expo-device": ">= 4.0.0",
90
+ "expo-file-system": ">= 13.0.0",
91
+ "expo-localization": ">= 11.0.0",
92
+ "posthog-react-native-session-replay": ">= 1.2.0",
93
+ "react-native-device-info": ">= 10.0.0",
94
+ "react-native-localize": ">= 3.0.0",
95
+ "react-native-navigation": ">= 6.0.0",
96
+ "react-native-safe-area-context": ">= 4.0.0",
97
+ "react-native-svg": ">= 15.0.0"
98
+ },
99
+ "peerDependenciesMeta": {
100
+ "@react-native-async-storage/async-storage": {
101
+ "optional": true
102
+ },
103
+ "@react-navigation/native": {
104
+ "optional": true
105
+ },
106
+ "expo-application": {
107
+ "optional": true
108
+ },
109
+ "expo-device": {
110
+ "optional": true
111
+ },
112
+ "expo-file-system": {
113
+ "optional": true
114
+ },
115
+ "expo-localization": {
116
+ "optional": true
117
+ },
118
+ "react-native-device-info": {
119
+ "optional": true
120
+ },
121
+ "react-native-navigation": {
122
+ "optional": true
123
+ },
124
+ "react-native-localize": {
125
+ "optional": true
126
+ },
127
+ "posthog-react-native-session-replay": {
128
+ "optional": true
129
+ },
130
+ "react-native-safe-area-context": {
131
+ "optional": true
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,111 @@
1
+ # adapted from https://github.com/getsentry/sentry-react-native/blob/e76d0d388228437e82f235546de00f4e748fcbda/packages/core/scripts/sentry-xcode.sh
2
+
3
+ #!/bin/bash
4
+ # Bundle React Native code and images
5
+ # PWD=ios
6
+
7
+ # print commands before executing them and stop on first error
8
+ set -x -e
9
+
10
+ # WITH_ENVIRONMENT is executed by React Native
11
+
12
+ REACT_NATIVE_XCODE_DEFAULT="../node_modules/react-native/scripts/react-native-xcode.sh"
13
+ REACT_NATIVE_XCODE="${1:-$REACT_NATIVE_XCODE_DEFAULT}"
14
+
15
+ # Check if DERIVED_FILE_DIR exists, defined by Xcode
16
+ if [ ! -d "$DERIVED_FILE_DIR" ]; then
17
+ echo "error: DERIVED_FILE_DIR does not exist: $DERIVED_FILE_DIR"
18
+ exit 1
19
+ fi
20
+
21
+ # RN/users can define a BUNDLE_NAME, or fallback to main
22
+ SOURCEMAP_NAME="${BUNDLE_NAME:-main}.jsbundle.map"
23
+
24
+ [ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/$SOURCEMAP_NAME"
25
+
26
+ # Check if CONFIGURATION_BUILD_DIR exists, defined by Xcode
27
+ if [ ! -d "$CONFIGURATION_BUILD_DIR" ]; then
28
+ echo "error: CONFIGURATION_BUILD_DIR does not exist: $CONFIGURATION_BUILD_DIR"
29
+ exit 1
30
+ fi
31
+
32
+ # Check for agrid-cli using installer environment variables
33
+ # TODO: provide a config that users can force the location
34
+ # Xcode starts with a very limited $PATH so using whereis does not work
35
+ if [ -n "$AGRID_CLI_INSTALL_DIR" ]; then
36
+ AGRID_CLI_PATH="$AGRID_CLI_INSTALL_DIR/agrid-cli"
37
+ elif [ -n "$CARGO_DIST_FORCE_INSTALL_DIR" ]; then
38
+ AGRID_CLI_PATH="$CARGO_DIST_FORCE_INSTALL_DIR/agrid-cli"
39
+ elif [ -f "$HOME/.agrid/agrid-cli" ]; then
40
+ AGRID_CLI_PATH="$HOME/.agrid/agrid-cli"
41
+ else
42
+ # Check if installed via npm -g @agrid/cli
43
+ NPM_GLOBAL_PATH=$(npm root -g 2>/dev/null)
44
+ if [ -n "$NPM_GLOBAL_PATH" ] && [ -f "$NPM_GLOBAL_PATH/@agrid/cli/bin/agrid-cli" ]; then
45
+ AGRID_CLI_PATH="$NPM_GLOBAL_PATH/@agrid/cli/bin/agrid-cli"
46
+ else
47
+ # Check if installed as local dependency
48
+ NPM_LOCAL_BIN=$(npm bin 2>/dev/null)
49
+ if [ -n "$NPM_LOCAL_BIN" ] && [ -f "$NPM_LOCAL_BIN/agrid-cli" ]; then
50
+ AGRID_CLI_PATH="$NPM_LOCAL_BIN/agrid-cli"
51
+ else
52
+ # Fallback to searching common locations
53
+ export PATH="/usr/local/bin:/opt/homebrew/bin:$HOME/.cargo/bin:$HOME/.local/bin:$HOME/.agrid:$PATH"
54
+ AGRID_CLI_PATH=$(command -v agrid-cli 2>/dev/null)
55
+ fi
56
+ fi
57
+ fi
58
+
59
+ if [ -z "$AGRID_CLI_PATH" ] || [ ! -x "$AGRID_CLI_PATH" ]; then
60
+ echo "error: agrid-cli not found"
61
+ exit 1
62
+ fi
63
+
64
+ # mimics how the file is defined in node_modules/react-native/scripts/react-native-xcode.sh (PACKAGER_SOURCEMAP_FILE)
65
+ SOURCEMAP_PACKAGER_FILE="$CONFIGURATION_BUILD_DIR/$SOURCEMAP_NAME"
66
+
67
+ # RN deletes the PACKAGER_SOURCEMAP_FILE file after execution but we need it
68
+ # lets patch the script to comment out this part if not yet
69
+ if grep -q '^[[:space:]]*rm.*PACKAGER_SOURCEMAP_FILE' "$REACT_NATIVE_XCODE"; then
70
+ echo "Patching React Native script to preserve sourcemap file..."
71
+ sed -i '' 's/^[[:space:]]*rm.*PACKAGER_SOURCEMAP_FILE/#&/' "$REACT_NATIVE_XCODE"
72
+ echo "Patched: commented out rm PACKAGER_SOURCEMAP_FILE line"
73
+ fi
74
+
75
+ # Execute React Native Xcode script and check exit code
76
+ set +x +e # disable printing commands and allow continuing on error
77
+ RN_XCODE_OUTPUT=$(/bin/sh -c "$REACT_NATIVE_XCODE" 2>&1)
78
+ RN_XCODE_EXIT_CODE=$?
79
+ if [ $RN_XCODE_EXIT_CODE -eq 0 ]; then
80
+ echo "$RN_XCODE_OUTPUT" | awk '{print "output: react-native-xcode - " $0}'
81
+ else
82
+ echo "error: react-native-xcode - $RN_XCODE_OUTPUT"
83
+ exit $RN_XCODE_EXIT_CODE
84
+ fi
85
+ set -x -e # re-enable
86
+
87
+ # Execute agrid cli clone
88
+ set +x +e
89
+ CLI_CLONE_OUTPUT=$(/bin/sh -c "$AGRID_CLI_PATH exp hermes clone --minified-map-path $SOURCEMAP_PACKAGER_FILE --composed-map-path $SOURCEMAP_FILE" 2>&1)
90
+ CLONE_EXIT_CODE=$?
91
+ if [ $CLONE_EXIT_CODE -eq 0 ]; then
92
+ echo "$CLI_CLONE_OUTPUT" | awk '{print "output: agrid-cli - " $0}'
93
+ else
94
+ echo "error: agrid-cli - $CLI_CLONE_OUTPUT"
95
+ exit $CLONE_EXIT_CODE
96
+ fi
97
+ set -x -e
98
+
99
+ # Execute agrid cli upload
100
+ set +x +e
101
+ CLI_UPLOAD_OUTPUT=$(/bin/sh -c "$AGRID_CLI_PATH exp hermes upload --directory $DERIVED_FILE_DIR" 2>&1)
102
+ UPLOAD_EXIT_CODE=$?
103
+ if [ $UPLOAD_EXIT_CODE -eq 0 ]; then
104
+ echo "$CLI_UPLOAD_OUTPUT" | awk '{print "output: agrid-cli - " $0}'
105
+ else
106
+ echo "error: agrid-cli - $CLI_UPLOAD_OUTPUT"
107
+ exit $UPLOAD_EXIT_CODE
108
+ fi
109
+ set -x -e
110
+
111
+ exit 0