react-native-bundle-discovery 1.0.0-rc.11 → 1.0.0-rc.12

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.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  > Currently, everything is in a very early stage. The project is not yet ready for use.
5
5
 
6
6
 
7
- <img width="800" src="https://github.com/user-attachments/assets/211145d4-8fe7-499b-a372-9d752e878772" />
7
+ <img width="800" alt="" src="./assets/img.png" />
8
8
 
9
9
  ### Setup:
10
10
 
@@ -37,7 +37,31 @@ const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
37
37
  module.exports = mergeConfig(getDefaultConfig(__dirname), config);
38
38
  ```
39
39
 
40
+ #### 3. Build the app
41
+
42
+ As example, for iOS you can run the following command, and it will generate the `metro-stats.json` file in the root of your project:
43
+
44
+ ```bash
45
+ npx react-native bundle \
46
+ --entry-file index.js \
47
+ --platform ios \
48
+ --dev false \
49
+ --bundle-output ios/main.jsbundle \
50
+ --assets-dest ios/assets
51
+ ```
52
+
53
+ #### 4. View the report
54
+
55
+ Run webserver to view the report:
56
+
57
+ ```bash
58
+ npx react-native-bundle-discovery metro-stats.json
59
+ ```
60
+
61
+ ---
62
+
40
63
  **Similar projects:**
64
+
41
65
  - https://github.com/expo/atlas
42
66
  - https://github.com/v3ron/expo-atlas-without-expo
43
67
  - https://github.com/callstack/react-native-bundle-visualizer
@@ -45,7 +69,8 @@ module.exports = mergeConfig(getDefaultConfig(__dirname), config);
45
69
  - https://github.com/statoscope/statoscope
46
70
  - https://github.com/relative-ci/bundle-stats/tree/master/packages/cli
47
71
 
72
+ ---
48
73
 
49
- **Links:**
74
+ **Built using Discovery.js:**
50
75
  - Build blocks for pages: https://discoveryjs.github.io/discovery/#views-showcase
51
76
  - Jora syntax: https://discoveryjs.github.io/jora/#article:jora-syntax-operators
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-bundle-discovery",
3
- "version": "1.0.0-rc.11",
3
+ "version": "1.0.0-rc.12",
4
4
  "main": "index.js",
5
5
  "bin": "lib/bin.js",
6
6
  "repository": "git@github.com:retyui/react-native-bundle-discovery.git",
@@ -38,6 +38,5 @@
38
38
  ],
39
39
  "devDependencies": {
40
40
  "prettier": "3.5.3"
41
- },
42
- "packageManager": "yarn@4.6.0"
41
+ }
43
42
  }
package/queryHelpers.js CHANGED
@@ -260,9 +260,7 @@ function flattenTree(
260
260
  }
261
261
 
262
262
  function sumSizes(node) {
263
- const isEmpty = require("lodash/isEmpty");
264
-
265
- const isFile = isEmpty(node.children);
263
+ const isFile = Object.keys(node.children).length === 0;
266
264
  let totalFiles = isFile ? 1 : 0;
267
265
  let totalSize = node.size || 0;
268
266
  for (const key in node.children) {