@wavemaker/rn-codegen 11.8.0-rc.5684 → 11.8.1-next.45208
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.
- rn-codegen/command.js +8 -19
- rn-codegen/command.js.map +1 -1
- rn-codegen/index.js +0 -26
- rn-codegen/index.js.map +1 -1
- rn-codegen/package.json +42 -42
- rn-codegen/src/app.generator.js +2 -4
- rn-codegen/src/app.generator.js.map +1 -1
- rn-codegen/src/templates/app.template +30 -42
- rn-codegen/src/templates/babel.config.js.template +1 -7
- rn-codegen/src/templates/component/component.template +3 -2
- rn-codegen/src/templates/package.web.json +53 -52
- rn-codegen/src/templates/project/app.json +1 -11
- rn-codegen/src/templates/project/esbuild/esbuild.script.js +2 -113
- rn-codegen/src/templates/project/metro.config.js +0 -2
- rn-codegen/src/templates/project/package-lock.json +6031 -5685
- rn-codegen/src/templates/project/package.json +54 -52
- rn-codegen/src/templates/project/revert-to-1.0.styles.js +6 -31
- rn-codegen/src/templates/project/scripts/post-build.js +0 -13
- rn-codegen/src/templates/variables.template +0 -10
- rn-codegen/src/theme/components/basic/lottie.styledef.js +0 -6
- rn-codegen/src/theme/components/basic/lottie.styledef.js.map +1 -1
- rn-codegen/src/theme/components/chart/area-chart.styledef.js +1 -7
- rn-codegen/src/theme/components/chart/area-chart.styledef.js.map +1 -1
- rn-codegen/src/theme/components/chart/bar-chart.styledef.js +1 -7
- rn-codegen/src/theme/components/chart/bar-chart.styledef.js.map +1 -1
- rn-codegen/src/theme/components/chart/bubble-chart.styledef.js +1 -7
- rn-codegen/src/theme/components/chart/bubble-chart.styledef.js.map +1 -1
- rn-codegen/src/theme/components/chart/column-chart.styledef.js +1 -7
- rn-codegen/src/theme/components/chart/column-chart.styledef.js.map +1 -1
- rn-codegen/src/theme/components/chart/donut-chart.styledef.js +1 -30
- rn-codegen/src/theme/components/chart/donut-chart.styledef.js.map +1 -1
- rn-codegen/src/theme/components/chart/line-chart.styledef.js +0 -7
- rn-codegen/src/theme/components/chart/line-chart.styledef.js.map +1 -1
- rn-codegen/src/theme/components/chart/pie-chart.styledef.js +0 -27
- rn-codegen/src/theme/components/chart/pie-chart.styledef.js.map +1 -1
- rn-codegen/src/theme/components/container/wizard.styledef.js +0 -4
- rn-codegen/src/theme/components/container/wizard.styledef.js.map +1 -1
- rn-codegen/src/theme/components/input/epoch/datetime.styledef.js +1 -9
- rn-codegen/src/theme/components/input/epoch/datetime.styledef.js.map +1 -1
- rn-codegen/src/theme/components/input/slider.styledef.js +0 -40
- rn-codegen/src/theme/components/input/slider.styledef.js.map +1 -1
- rn-codegen/src/theme/components/input/switch.styledef.js +0 -10
- rn-codegen/src/theme/components/input/switch.styledef.js.map +1 -1
- rn-codegen/src/theme/components/style-definition.provider.js +0 -2
- rn-codegen/src/theme/components/style-definition.provider.js.map +1 -1
- rn-codegen/src/theme/variables.js +0 -6
- rn-codegen/src/theme/variables.js.map +1 -1
- rn-codegen/src/transpile/components/advanced/carousel/carousel-template.transformer.js +2 -2
- rn-codegen/src/transpile/components/advanced/carousel/carousel-template.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/basic/search.transformer.js +1 -2
- rn-codegen/src/transpile/components/basic/search.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/area-chart.transformer.js +1 -4
- rn-codegen/src/transpile/components/chart/area-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/bar-chart.transformer.js +2 -4
- rn-codegen/src/transpile/components/chart/bar-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/bubble-chart.transformer.js +2 -4
- rn-codegen/src/transpile/components/chart/bubble-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/column-chart.transformer.js +2 -4
- rn-codegen/src/transpile/components/chart/column-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/donut-chart.transformer.js +2 -4
- rn-codegen/src/transpile/components/chart/donut-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/line-chart.transformer.js +2 -4
- rn-codegen/src/transpile/components/chart/line-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/pie-chart.transformer.js +2 -4
- rn-codegen/src/transpile/components/chart/pie-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/chart/stack-chart.transformer.js +2 -4
- rn-codegen/src/transpile/components/chart/stack-chart.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/data/list/list-template.transformer.js +25 -0
- rn-codegen/src/transpile/components/data/list/list-template.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/data/list.transformer.js +3 -29
- rn-codegen/src/transpile/components/data/list.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/input/checkboxset.transformer.js +1 -3
- rn-codegen/src/transpile/components/input/checkboxset.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/input/radioset.transformer.js +1 -2
- rn-codegen/src/transpile/components/input/radioset.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/input/slider.transformer.js +1 -15
- rn-codegen/src/transpile/components/input/slider.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/page/partial-container.transformer.js +1 -1
- rn-codegen/src/transpile/components/page/partial-container.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/prefab/prefab.transformer.js +1 -1
- rn-codegen/src/transpile/components/prefab/prefab.transformer.js.map +1 -1
- rn-codegen/src/transpile/components/transform-register.js +0 -4
- rn-codegen/src/transpile/components/transform-register.js.map +1 -1
- rn-codegen/src/transpile/components/utils.js +1 -20
- rn-codegen/src/transpile/components/utils.js.map +1 -1
- rn-codegen/src/transpile/property/property-parser.js +8 -21
- rn-codegen/src/transpile/property/property-parser.js.map +1 -1
- rn-codegen/src/transpile/style/background-image.parser.js +1 -1
- rn-codegen/src/transpile/style/background-image.parser.js.map +1 -1
- rn-codegen/src/transpile/style/dimension-style.parser.js +0 -5
- rn-codegen/src/transpile/style/dimension-style.parser.js.map +1 -1
- rn-codegen/src/transpile/transpile.js +4 -11
- rn-codegen/src/transpile/transpile.js.map +1 -1
- rn-codegen/src/utils.js +20 -1
- rn-codegen/src/utils.js.map +1 -1
- rn-codegen/src/variables/variable.transformer.js +1 -8
- rn-codegen/src/variables/variable.transformer.js.map +1 -1
- rn-codegen/src/templates/project/esbuild/@react-navigation/drawer/6.6.3/lib/module/views/modern/Drawer.js +0 -303
- rn-codegen/src/templates/project/esbuild/@react-navigation/drawer/6.6.3/lib/module/views/modern/Overlay.js +0 -60
- rn-codegen/src/theme/components/data/list/list-action-template.styledef.js +0 -18
- rn-codegen/src/theme/components/data/list/list-action-template.styledef.js.map +0 -1
- rn-codegen/src/transpile/components/data/list/list-action-template.transformer.js +0 -15
- rn-codegen/src/transpile/components/data/list/list-action-template.transformer.js.map +0 -1
- rn-codegen/src/transpile/components/data/list/list-content.transformer.js +0 -35
- rn-codegen/src/transpile/components/data/list/list-content.transformer.js.map +0 -1
|
@@ -15,7 +15,6 @@ import BaseApp from '@wavemaker/app-rn-runtime/runtime/App';
|
|
|
15
15
|
import { WmMemo } from '@wavemaker/app-rn-runtime/runtime/memo.component';
|
|
16
16
|
{{#if sslPinning}}
|
|
17
17
|
import { initializeSslPinning, isSslPinningAvailable } from 'react-native-ssl-public-key-pinning';
|
|
18
|
-
import { getPublicHashKey } from '@wavemaker/react-native-ssl-publickey';
|
|
19
18
|
{{/if}}
|
|
20
19
|
|
|
21
20
|
import { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
|
@@ -69,11 +68,11 @@ class App extends BaseApp {
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
getServiceDefinitions() {
|
|
72
|
-
{{#if profile.useLocalMetadata}}
|
|
73
|
-
return Promise.resolve(require('./metadata/app/service-definitions.json'))
|
|
74
|
-
{{else}}
|
|
75
71
|
return axios.get(this.baseUrl + '/services/servicedefs')
|
|
76
72
|
.then((response) => response?.data || {})
|
|
73
|
+
{{#if profile.useLocalMetadata}}
|
|
74
|
+
.catch(() => import('./metadata/app/service-definitions.json').then(mod => mod.default))
|
|
75
|
+
{{else}}
|
|
77
76
|
.catch(() => ({}))
|
|
78
77
|
{{/if}}
|
|
79
78
|
.then(data => {
|
|
@@ -93,14 +92,13 @@ class App extends BaseApp {
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
loadWmProperties() {
|
|
96
|
-
{{#if profile.useLocalMetadata}}
|
|
97
|
-
return Promise.resolve(require('./src/wmProperties').default)
|
|
98
|
-
{{else}}
|
|
99
95
|
return axios.get(this.baseUrl + '/services/application/wmProperties.js')
|
|
100
96
|
.then((response) => {
|
|
101
97
|
const data = response.data;
|
|
102
98
|
return JSON.parse(data.substring(data.indexOf('{'), data.length - 1));
|
|
103
99
|
})
|
|
100
|
+
{{#if profile.useLocalMetadata}}
|
|
101
|
+
.catch(() => import('./src/wmProperties').then(mod => mod.default))
|
|
104
102
|
{{/if}}
|
|
105
103
|
.then(appProperties => {
|
|
106
104
|
this.appConfig.appProperties = appProperties;
|
|
@@ -244,21 +242,9 @@ class App extends BaseApp {
|
|
|
244
242
|
|
|
245
243
|
|
|
246
244
|
{{#if sslPinning}}
|
|
247
|
-
|
|
248
|
-
let sslPinning = {{{stringify sslPinning}}}
|
|
245
|
+
initSSLPininng() {
|
|
249
246
|
if (isSslPinningAvailable()) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
for (const key of Object.keys(sslPinning)) {
|
|
253
|
-
const value = sslPinning[key];
|
|
254
|
-
if (value.loadOnStartup) {
|
|
255
|
-
const publickey = await getPublicHashKey(key);
|
|
256
|
-
value.publicKeyHashes = [(publickey), "NoBackUpKey" + publickey.substring(11)];
|
|
257
|
-
}
|
|
258
|
-
updatedSslPinning[key] = value; // Update the modified object
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return initializeSslPinning(updatedSslPinning).then(() => true);
|
|
247
|
+
return initializeSslPinning({{{stringify sslPinning}}}).then(() => true);
|
|
262
248
|
}
|
|
263
249
|
return Promise.resolve(false);
|
|
264
250
|
}
|
|
@@ -268,31 +254,33 @@ class App extends BaseApp {
|
|
|
268
254
|
{{#if animatedSplash}}
|
|
269
255
|
SplashScreen.hideAsync().then(() => {});{{/if}}
|
|
270
256
|
this.appConfig.getServiceDefinitions = this.getServiceDefinitions.bind(this);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
.
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
.then(() => this.loadTheme())
|
|
257
|
+
NetworkService.start(this.appConfig)
|
|
258
|
+
{{#if profile.useLocalMetadata}}
|
|
259
|
+
{{else}}
|
|
260
|
+
.then(() => {
|
|
261
|
+
NetworkService.connect(true);
|
|
262
|
+
})
|
|
263
|
+
{{/if}}
|
|
264
|
+
.then(() => {console.log('NetworkService started')})
|
|
265
|
+
.then(() => this.loadWmProperties())
|
|
266
|
+
.then(() => {console.log('WmProperties loaded')})
|
|
267
|
+
{{#if sslPinning}}
|
|
268
|
+
.then(() => this.initSSLPininng())
|
|
269
|
+
.then((flag) => {flag && console.log('SSL Pinning loaded')})
|
|
270
|
+
{{/if}}
|
|
271
|
+
.then(() => this.loadTheme())
|
|
287
272
|
.then(() => {console.log('Theme loaded')})
|
|
288
|
-
|
|
289
|
-
|
|
273
|
+
.then(() => AppI18nService.init())
|
|
274
|
+
.then(() => this.changeLocale())
|
|
290
275
|
.then(() => {console.log('Locale files loaded')})
|
|
291
|
-
|
|
276
|
+
.then(() => this.getSecurityInfo())
|
|
277
|
+
.then(() => {console.log('Security info loaded')})
|
|
278
|
+
.then(() => this.loadFonts())
|
|
292
279
|
.then(() => {console.log('Font files loaded')})
|
|
293
|
-
|
|
280
|
+
.then(() => initializeDeviceOperations())
|
|
294
281
|
.then(() => {console.log('Loaded device operations loaded')})
|
|
295
|
-
|
|
282
|
+
.then(() => this.bootstrap())
|
|
283
|
+
.then(() => {console.log('Bootstrap Complete')})
|
|
296
284
|
.then(() => super.componentDidMount())
|
|
297
285
|
.catch(error => {
|
|
298
286
|
console.error(error);
|
|
@@ -2,13 +2,7 @@ module.exports = function(api) {
|
|
|
2
2
|
api.cache(true);
|
|
3
3
|
return {
|
|
4
4
|
presets: ['babel-preset-expo'],
|
|
5
|
-
plugins: [
|
|
6
|
-
{{#if enableLogs}} {{else}}'transform-remove-console', {{/if}}
|
|
7
|
-
['@babel/plugin-transform-class-static-block', { "loose": true }],
|
|
8
|
-
['@babel/plugin-transform-class-properties', { "loose": true }],
|
|
9
|
-
'@babel/plugin-proposal-export-namespace-from',
|
|
10
|
-
'react-native-reanimated/plugin'
|
|
11
|
-
],
|
|
5
|
+
plugins: ['react-native-reanimated/plugin',{{#if enableLogs}} {{else}}'transform-remove-console'{{/if}}],
|
|
12
6
|
overrides: [{
|
|
13
7
|
test: './src',
|
|
14
8
|
plugins: ['./scripts/wm-babel.transform.plugin.js']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { ScrollView } from 'react-native
|
|
3
|
+
import { ScrollView } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { AssetProvider } from '@wavemaker/app-rn-runtime/core/asset.provider';
|
|
6
6
|
import Base{{typeLabel}} from '@wavemaker/app-rn-runtime/runtime/base-{{lType}}.component';
|
|
@@ -89,7 +89,8 @@ export default class {{name}}{{typeLabel}} extends Base{{typeLabel}} {
|
|
|
89
89
|
componentDidMount() {
|
|
90
90
|
{{#ifEquals lType 'prefab' this}}
|
|
91
91
|
{{#if profile.useLocalMetadata}}
|
|
92
|
-
|
|
92
|
+
import('../../../service-definitions.json')
|
|
93
|
+
.then(mod => mod.default?.serviceDefs)
|
|
93
94
|
{{else}}
|
|
94
95
|
this.getServiceDefinitions()
|
|
95
96
|
{{/if}}
|
|
@@ -9,68 +9,66 @@
|
|
|
9
9
|
"postinstall": "echo \"\""
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@
|
|
13
|
-
"@wavemaker/
|
|
14
|
-
"@wavemaker/
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"expo-
|
|
21
|
-
"expo-
|
|
22
|
-
"expo-
|
|
23
|
-
"expo-
|
|
24
|
-
"expo-
|
|
25
|
-
"expo-
|
|
26
|
-
"expo-
|
|
27
|
-
"expo-
|
|
28
|
-
"expo-
|
|
29
|
-
"expo-
|
|
30
|
-
"expo-
|
|
31
|
-
"expo-
|
|
32
|
-
"expo-
|
|
33
|
-
"expo-
|
|
34
|
-
"expo-
|
|
35
|
-
"expo-
|
|
12
|
+
"@unimodules/react-native-adapter": "6.3.9",
|
|
13
|
+
"@wavemaker/app-rn-runtime": "11.8.1-next.45208",
|
|
14
|
+
"@wavemaker/variables": "11.8.1-next.45208",
|
|
15
|
+
"@wavemaker/rn-codegen": "11.8.1-next.45208",
|
|
16
|
+
"axios": "^1.4.0",
|
|
17
|
+
"css-mediaquery": "^0.1.2",
|
|
18
|
+
"deprecated-react-native-prop-types": "~4.1.0",
|
|
19
|
+
"expo": "49.0.7",
|
|
20
|
+
"@expo/vector-icons": "13.0.0",
|
|
21
|
+
"expo-font": "11.4.0",
|
|
22
|
+
"expo-file-system": "15.4.3",
|
|
23
|
+
"expo-camera": "13.4.2",
|
|
24
|
+
"expo-av": "13.4.1",
|
|
25
|
+
"expo-barcode-scanner": "12.5.3",
|
|
26
|
+
"expo-web-browser": "12.3.2",
|
|
27
|
+
"expo-device": "5.4.0",
|
|
28
|
+
"expo-network": "5.4.0",
|
|
29
|
+
"expo-location": "16.1.0",
|
|
30
|
+
"expo-localization": "14.3.0",
|
|
31
|
+
"expo-contacts": "12.2.0",
|
|
32
|
+
"expo-calendar": "11.3.0",
|
|
33
|
+
"expo-splash-screen": "0.20.5",
|
|
34
|
+
"expo-document-picker": "11.5.4",
|
|
35
|
+
"expo-constants": "14.4.2",
|
|
36
36
|
"@react-native/assets": "1.0.0",
|
|
37
37
|
"hermes-engine": "0.11.0",
|
|
38
|
-
"imask": "7.
|
|
38
|
+
"imask": "^7.5.0",
|
|
39
39
|
"react": "18.2.0",
|
|
40
40
|
"react-dom": "18.2.0",
|
|
41
|
-
"react-native": "0.
|
|
42
|
-
"react-native-web": "0.
|
|
43
|
-
"@react-native/
|
|
44
|
-
"@react-native-
|
|
45
|
-
"
|
|
46
|
-
"react-native-
|
|
47
|
-
"react-native-reanimated": "3.6.2",
|
|
41
|
+
"react-native": "0.72.4",
|
|
42
|
+
"react-native-web": "0.18.12",
|
|
43
|
+
"@react-native-async-storage/async-storage": "1.18.2",
|
|
44
|
+
"@react-native-community/netinfo": "9.3.10",
|
|
45
|
+
"react-native-gesture-handler": "2.12.1",
|
|
46
|
+
"react-native-reanimated": "^1.13.2",
|
|
48
47
|
"react-native-bundle-splitter": "2.2.3",
|
|
49
|
-
"react-native-safe-area-context": "4.
|
|
50
|
-
"@react-native-community/datetimepicker": "7.
|
|
51
|
-
"@react-native-community/slider": "4.
|
|
52
|
-
"react-native-circular-progress": "1.
|
|
53
|
-
"@react-native-masked-view/masked-view": "0.
|
|
48
|
+
"react-native-safe-area-context": "4.6.3",
|
|
49
|
+
"@react-native-community/datetimepicker": "7.2.0",
|
|
50
|
+
"@react-native-community/slider": "4.4.2",
|
|
51
|
+
"react-native-circular-progress": "1.3.9",
|
|
52
|
+
"@react-native-masked-view/masked-view": "0.2.9",
|
|
54
53
|
"react-native-snap-carousel": "3.9.1",
|
|
55
54
|
"react-native-svg": "13.4.0",
|
|
56
|
-
"react-native-ssl-public-key-pinning": "1.
|
|
57
|
-
"@wavemaker/react-native-ssl-publickey": "1.0.2",
|
|
55
|
+
"react-native-ssl-public-key-pinning": "1.1.1",
|
|
58
56
|
"victory-native": "36.6.11",
|
|
59
57
|
"@react-navigation/native": "6.1.7",
|
|
60
|
-
"react-native-pager-view": "6.2.
|
|
61
|
-
"react-native-webview": "13.
|
|
62
|
-
"react-native-vector-icons": "10.0.
|
|
58
|
+
"react-native-pager-view": "6.2.0",
|
|
59
|
+
"react-native-webview": "13.2.2",
|
|
60
|
+
"react-native-vector-icons": "10.0.0",
|
|
63
61
|
"@react-navigation/drawer": "6.6.3",
|
|
64
|
-
"react-native-screens": "3.
|
|
65
|
-
"react-native-svg-transformer": "1.
|
|
66
|
-
"lottie-react-native": "
|
|
67
|
-
"react-lottie-player": "
|
|
68
|
-
"expo-linear-gradient": "12.
|
|
62
|
+
"react-native-screens": "3.22.0",
|
|
63
|
+
"react-native-svg-transformer": "1.0.0",
|
|
64
|
+
"lottie-react-native": "5.1.6",
|
|
65
|
+
"react-lottie-player": "1.5.4",
|
|
66
|
+
"expo-linear-gradient": "12.3.0",
|
|
69
67
|
"setimmediate": "1.0.5",
|
|
70
68
|
"react-native-restart": "0.0.27",
|
|
71
|
-
"@expo/webpack-config": "
|
|
69
|
+
"@expo/webpack-config": "18.0.1",
|
|
72
70
|
"@babel/core": "7.20.2",
|
|
73
|
-
"@babel/standalone": "7.23.10",
|
|
71
|
+
"@babel/standalone": "^7.23.10",
|
|
74
72
|
"@babel/plugin-syntax-jsx": "7.21.4",
|
|
75
73
|
"victory": "^36.5.3"
|
|
76
74
|
},
|
|
@@ -81,12 +79,15 @@
|
|
|
81
79
|
"esbuild": "0.15.15",
|
|
82
80
|
"esbuild-plugin-resolve": "1.0.3",
|
|
83
81
|
"fs-extra": "10.0.0",
|
|
84
|
-
"
|
|
82
|
+
"expo-modules-autolinking": "1.5.0",
|
|
85
83
|
"babel-plugin-transform-remove-console": "6.9.4",
|
|
86
84
|
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
|
87
85
|
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
88
|
-
"@types/babel__standalone": "7.1.7"
|
|
89
|
-
|
|
86
|
+
"@types/babel__standalone": "^7.1.7"
|
|
87
|
+
},
|
|
88
|
+
"resolutions": {
|
|
89
|
+
"react-error-overlay": "6.0.9",
|
|
90
|
+
"react-native-reanimated": "3.4.1"
|
|
90
91
|
},
|
|
91
92
|
"private": true
|
|
92
93
|
}
|
|
@@ -136,10 +136,6 @@ class EsBuilder {
|
|
|
136
136
|
);
|
|
137
137
|
}`;
|
|
138
138
|
});
|
|
139
|
-
const target = `${__dirname}/../node_modules/react-native-web/dist/cjs/exports/BackHandler/index.js`;
|
|
140
|
-
await readAndReplaceFileContent(target, content => {
|
|
141
|
-
return content.replace('console.error', '// console.error');
|
|
142
|
-
});
|
|
143
139
|
console.log('Patched react-native-web');
|
|
144
140
|
}
|
|
145
141
|
|
|
@@ -151,101 +147,6 @@ class EsBuilder {
|
|
|
151
147
|
}
|
|
152
148
|
}
|
|
153
149
|
|
|
154
|
-
async patchReactNativeAssetRegistry() {
|
|
155
|
-
const content = `
|
|
156
|
-
/**
|
|
157
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the MIT license found in the
|
|
160
|
-
* LICENSE file in the root directory of this source tree.
|
|
161
|
-
*
|
|
162
|
-
* @flow strict
|
|
163
|
-
* @format
|
|
164
|
-
*/
|
|
165
|
-
|
|
166
|
-
'use strict';
|
|
167
|
-
|
|
168
|
-
const assets = [];
|
|
169
|
-
|
|
170
|
-
function registerAsset(asset) {
|
|
171
|
-
// push returns new array length, so the first asset will
|
|
172
|
-
// get id 1 (not 0) to make the value truthy
|
|
173
|
-
return assets.push(asset);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function getAssetByID(assetId) {
|
|
177
|
-
return assets[assetId - 1];
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
module.exports = {registerAsset, getAssetByID};
|
|
181
|
-
|
|
182
|
-
`;
|
|
183
|
-
fs.writeFileSync(`${__dirname}/../node_modules/@react-native/assets-registry/registry.js`, content);
|
|
184
|
-
const expoAssetRegistry = `${__dirname}/../node_modules/expo-asset/node_modules/@react-native/assets-registry/registry.js`;
|
|
185
|
-
readAndReplaceFileContent(expoAssetRegistry, () => content);
|
|
186
|
-
console.log('Patched @react-native/assets-registry');
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async patchBabelExpoPreset() {
|
|
190
|
-
const target = `${__dirname}/../node_modules/babel-preset-expo/build/index.js`;
|
|
191
|
-
await readAndReplaceFileContent(target, content => {
|
|
192
|
-
return content.replace(
|
|
193
|
-
`(0, common_1.hasModule)('react-native-reanimated') &&`,
|
|
194
|
-
`//(0, common_1.hasModule)('react-native-reanimated') &&`)
|
|
195
|
-
.replace(
|
|
196
|
-
`platformOptions.reanimated !== false && [require.resolve('react-native-reanimated/plugin')],`,
|
|
197
|
-
`//platformOptions.reanimated !== false && [require.resolve('react-native-reanimated/plugin')],`
|
|
198
|
-
)
|
|
199
|
-
});
|
|
200
|
-
console.log('Patched babel-expo-preset');
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
async patchUUID() {
|
|
204
|
-
const target = `${__dirname}/../node_modules/expo-modules-core/build/uuid/uuid.web.js`;
|
|
205
|
-
await readAndReplaceFileContent(target, content => {
|
|
206
|
-
return content.replace(`require('crypto')`, 'crypto');
|
|
207
|
-
});
|
|
208
|
-
console.log('Patched UUID.');
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
async patchExpoRootComponent() {
|
|
212
|
-
const target = `${__dirname}/../node_modules/expo/build/launch/registerRootComponent.js`;
|
|
213
|
-
await readAndReplaceFileContent(target, content => {
|
|
214
|
-
return content.replace(`export default`,
|
|
215
|
-
`
|
|
216
|
-
const process = {env: {
|
|
217
|
-
NODE_ENV: 'development',
|
|
218
|
-
EXPO_PUBLIC_USE_STATIC: '0'
|
|
219
|
-
}};
|
|
220
|
-
export default `);
|
|
221
|
-
});
|
|
222
|
-
console.log('Patched Expo Root Component.');
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
async patchReactNavigation() {
|
|
226
|
-
// https://github.com/react-navigation/react-navigation/pull/11496/files
|
|
227
|
-
fs.copyFileSync(
|
|
228
|
-
`${__dirname}/@react-navigation/drawer/6.6.3/lib/module/views/modern/Drawer.js`,
|
|
229
|
-
`${__dirname}/../node_modules/@react-navigation/drawer/lib/module/views/modern/Drawer.js`
|
|
230
|
-
);
|
|
231
|
-
fs.copyFileSync(
|
|
232
|
-
`${__dirname}/@react-navigation/drawer/6.6.3/lib/module/views/modern/Overlay.js`,
|
|
233
|
-
`${__dirname}/../node_modules/@react-navigation/drawer/lib/module/views/modern/Overlay.js`
|
|
234
|
-
);
|
|
235
|
-
console.log('Patched React Navigation.');
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
async patchReactNativeReanimated() {
|
|
239
|
-
await readAndReplaceFileContent(`${__dirname}/../node_modules/react-native-reanimated/lib/module/reanimated2/PlatformChecker.js`, (c) => {
|
|
240
|
-
return c.replace(
|
|
241
|
-
'!!process.env.JEST_WORKER_ID',
|
|
242
|
-
'false; // !!process.env.JEST_WORKER_ID'
|
|
243
|
-
)
|
|
244
|
-
});
|
|
245
|
-
console.log('Patched React Native Reanimated.');
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
150
|
buildLibraries() {
|
|
250
151
|
const promises = [{
|
|
251
152
|
name: 'expo-web-browser',
|
|
@@ -281,12 +182,6 @@ class EsBuilder {
|
|
|
281
182
|
.then(() => this.patchReactNativeWeb())
|
|
282
183
|
.then(() => this.patchReactNativeAssets())
|
|
283
184
|
.then(() => this.patchCamera())
|
|
284
|
-
.then(() => this.patchReactNativeAssetRegistry())
|
|
285
|
-
.then(() => this.patchBabelExpoPreset())
|
|
286
|
-
.then(() => this.patchUUID())
|
|
287
|
-
.then(() => this.patchExpoRootComponent())
|
|
288
|
-
.then(() => this.patchReactNavigation())
|
|
289
|
-
.then(() => this.patchReactNativeReanimated())
|
|
290
185
|
.then(() => {
|
|
291
186
|
console.log('*********** LIBRARIES ARE BUILT FOR ESBUILD **************');
|
|
292
187
|
}, (e) => {
|
|
@@ -317,11 +212,7 @@ class EsBuilder {
|
|
|
317
212
|
esmodules: true
|
|
318
213
|
},
|
|
319
214
|
sourceMaps: 'inline',
|
|
320
|
-
plugins: [
|
|
321
|
-
__dirname + '/../scripts/wm-babel.transform.plugin.js',
|
|
322
|
-
'@babel/plugin-proposal-export-namespace-from',
|
|
323
|
-
'react-native-reanimated/plugin',
|
|
324
|
-
]
|
|
215
|
+
plugins: [__dirname + '/../scripts/wm-babel.transform.plugin.js']
|
|
325
216
|
}
|
|
326
217
|
}), resolve({
|
|
327
218
|
'victory-native': 'victory'
|
|
@@ -338,9 +229,7 @@ class EsBuilder {
|
|
|
338
229
|
.then(() => {
|
|
339
230
|
console.timeEnd('react native with esbuild');
|
|
340
231
|
console.log('*********** REACT NATIVE ESBUILD SUCCESSFUL **************');
|
|
341
|
-
}).catch((
|
|
342
|
-
console.log('*********** REACT PROJECT ESBUILD ERROR **************');
|
|
343
|
-
console.error(error);
|
|
232
|
+
}).catch(() => {
|
|
344
233
|
console.timeEnd('react native with esbuild');
|
|
345
234
|
console.log('*********** REACT PROJECT ESBUILD FAILED **************');
|
|
346
235
|
});
|
|
@@ -11,7 +11,6 @@ module.exports = (async () => {
|
|
|
11
11
|
];
|
|
12
12
|
config.resolver.disableHierarchicalLookup = true;
|
|
13
13
|
config.transformer = {
|
|
14
|
-
...config.transformer,
|
|
15
14
|
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
16
15
|
getTransformOptions: async () => ({
|
|
17
16
|
transform: {
|
|
@@ -21,7 +20,6 @@ module.exports = (async () => {
|
|
|
21
20
|
})
|
|
22
21
|
}
|
|
23
22
|
config.resolver = {
|
|
24
|
-
...config.resolver,
|
|
25
23
|
assetExts: config.resolver.assetExts.filter(ext => ext !== 'svg'),
|
|
26
24
|
sourceExts: [...config.resolver.sourceExts, 'svg']
|
|
27
25
|
}
|