From 13e1b41ed9f6bc23c8de0c93d5c70af97de17eef Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 12 Jan 2023 22:12:21 +0500 Subject: [PATCH 1/6] docs: add changelog for 3.1.2 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fce15ea..4150189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -# [Unreleased] +# [3.1.2](https://github.com/IjzerenHein/react-native-bundle-visualizer/releases/tag/v3.1.2) (2023-01-12) + +### Bug Fixes +- Fixes [Verbose gives size [object Object]](https://github.com/IjzerenHein/react-native-bundle-visualizer/issues/73) -- Thanks to [omerg](https://github.com/omerg) +- Fixes [This error originated either by throwing inside of an async function...](https://github.com/IjzerenHein/react-native-bundle-visualizer/issues/112) by upgrading the `source-map-explorer` dependency. # [3.1.0](https://github.com/IjzerenHein/react-native-bundle-visualizer/compare/v3.0.0...v3.1.0) (2021-10-16) From 07419a6090faa2d8ffd73c01db458665d093a0fa Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 12 Jan 2023 22:23:45 +0500 Subject: [PATCH 2/6] chore: updated .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 60377c5..15c7b7c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ node_modules/ # macOS .DS_Store + +# npm +.npmrc \ No newline at end of file From 1cfe56e2bc490fb7ed0f3704ddedb381880a1166 Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 12 Jan 2023 22:41:23 +0500 Subject: [PATCH 3/6] chore: added contribution.md --- CONTRIBUTION.md | 42 ++++++++++++++++++++++++++++++++++++++++++ package.json | 6 ++---- 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 CONTRIBUTION.md diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md new file mode 100644 index 0000000..cde1a0a --- /dev/null +++ b/CONTRIBUTION.md @@ -0,0 +1,42 @@ +# Contributing to React Native Bundle Visualizer + +Thank you for helping out with **react-native-bundle-visualizer**. We'd like to make contributions as +pleasant as possible, so here's a small guide of how we see it. Happy to hear your feedback about anything, so please let us know. + +## Tests + +All tests are run on Github Actions on opening a pull request or pushing to main, but you should use them locally when making changes. + +- `yarn test`: Run tests for react native cli app and expo app. +- `yarn test:rn`: Run tests only for react native cli app. +- `yarn test:expo`: Run tests only for expo app. + +## Sending a pull request + +When you're sending a pull request: + +- If you want fix/add something, please open new/ find existing issue, so we can discuss it. +- We prefer small pull requests focused on one change, as those are easier to test/ review. +- Please make sure that all tests are passing on your local machine. +- Follow the template when opening a PR. + +## Commits and versioning + +All PRs are squashed into `master` branch and wrapped up in a single commit, +following [conventional commit message](https://www.conventionalcommits.org/en/v1.0.0-beta.3). + +Most notably prefixes you'll see: + +- **fix**: Bug fixes, triggers _patch_ release +- **feat**: New feature implemented, triggers _minor_ +- **chore**: Changes that are not affecting end user (CI config changes, + scripts, ["grunt work"](https://stackoverflow.com/a/26944812/3510245)) +- **docs**: Documentation changes. +- **perf**: A code change that improves performance. +- **refactor**: A code change that neither fixes a bug nor adds a feature. +- **test**: Adding missing tests or correcting existing tests. + +## License + +By contributing to React Native Bundle Visualizer, you agree that your contributions +will be licensed under the **MIT** license. \ No newline at end of file diff --git a/package.json b/package.json index 73be013..f06d392 100644 --- a/package.json +++ b/package.json @@ -30,9 +30,7 @@ }, "scripts": { "test": "yarn test:rn && yarn test:expo", - "test:rn": "yarn test:rn:64", - "test:rn:64": "cd test/RN64 && yarn install && npx ../.. && cd ../..", - "test:expo": "yarn test:expo:42", - "test:expo:42": "cd test/Expo42 && yarn install && npx ../.. && cd ../.." + "test:rn": "cd test/RN64 && yarn install && npx ../.. && cd ../..", + "test:expo": "cd test/Expo42 && yarn install && npx ../.. && cd ../.." } } From 28fdc6146de74b1abdd9fdd31b97a54c2b69ef1d Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 12 Jan 2023 22:41:35 +0500 Subject: [PATCH 4/6] chore: added pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..8e5fb4a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ +## Description + + + +## Test Plan + + From af0289c9da1d3be231e4c826bde614db3530c235 Mon Sep 17 00:00:00 2001 From: Muhammad Hur Ali Date: Mon, 13 Feb 2023 13:22:54 +0500 Subject: [PATCH 5/6] fix: set minify to false (#117) * fix: allow minify for expo projects only * fix: added default false value to isExpo * docs: add expo args information --- README.md | 3 ++- package.json | 2 +- src/react-native-bundle-visualizer.js | 18 +++++++----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0480730..992562d 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,11 @@ All command-line arguments are optional. By default a production build will be c | `only-mapped` | Exclude "unmapped" bytes from the output (default is **false**). This will result in total counts less than the file size. | `--only-mapped` | | `verbose` | Dumps additional output to the console (default is **false**) | `--verbose` | | `reset-cache` | Removes cached react-native files (default is **false**) | `--reset-cache` | +| `--expo` | Set this to true/ false based on whether using expo or not. For eg, set `--expo true` when using expo. Not required to pass this for react-native cli. (default is **false**) | `--expo false` | [smeo]: https://github.com/danvk/source-map-explorer#options -> The `--expo` command is no longer needed for Expo SDK 41 or higher; and has been removed. Use [react-native-bundle-visualizer@2](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v2) when targetting Expo SDK 40 or lower. +>Use [react-native-bundle-visualizer@2](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v2) when targetting Expo SDK 40 or lower. ## Version compatibility diff --git a/package.json b/package.json index f06d392..f0e217d 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,6 @@ "scripts": { "test": "yarn test:rn && yarn test:expo", "test:rn": "cd test/RN64 && yarn install && npx ../.. && cd ../..", - "test:expo": "cd test/Expo42 && yarn install && npx ../.. && cd ../.." + "test:expo": "cd test/Expo42 && yarn install && npx ../.. --expo=true && cd ../.." } } diff --git a/src/react-native-bundle-visualizer.js b/src/react-native-bundle-visualizer.js index b68d053..1309bf6 100755 --- a/src/react-native-bundle-visualizer.js +++ b/src/react-native-bundle-visualizer.js @@ -59,7 +59,7 @@ const tmpDir = path.join(baseDir, getAppName()); const outDir = path.join(tmpDir, 'output'); const entryFile = argv['entry-file'] || getEntryPoint(); const platform = argv.platform || 'ios'; -const expoTargetDeprecated = argv.expo || ''; +const isExpo = argv.expo || false; const dev = argv.dev || false; const verbose = argv.verbose || false; const resetCache = argv['reset-cache'] || false; @@ -95,21 +95,14 @@ const commands = [ bundleOutput, '--sourcemap-output', bundleOutputSourceMap, + '--minify', + isExpo ]; if (resetCache) { commands.push('--reset-cache'); commands.push(resetCache); } -// Warn about `--expo` deprecation -if (expoTargetDeprecated) { - console.error( - chalk.red.bold( - 'The "--expo" command is no longer needed for Expo SDK 41 or higher. When using Expo SDK 40 or lower, please use `react-native-bundle-visualizer@2`.' - ) - ); -} - const reactNativeBin = getReactNativeBin(); const bundlePromise = execa(reactNativeBin, commands); bundlePromise.stdout.pipe(process.stdout); @@ -188,4 +181,7 @@ bundlePromise // Open output file return open(bundleOutputExplorerFile); - }); + }).catch(error => console.log( + chalk.red('=== error ==='), + error + )); From 5589be98a2659c0730142f737b61597af3db37f5 Mon Sep 17 00:00:00 2001 From: hurali97 Date: Mon, 13 Feb 2023 19:53:55 +0500 Subject: [PATCH 6/6] chore: bump package version to 3.1.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0e217d..af7b782 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-bundle-visualizer", - "version": "3.1.2", + "version": "3.1.3", "description": "See what's inside your react-native bundle", "author": "IjzerenHein ", "keywords": [