Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,38 @@ on:
pull_request:
branches: [main]

env:
APP_NAME: MyApp
NODEJS_VERSION: 24

jobs:
build:
test:
name: Analyze bundle with React Native ${{ matrix.rn-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
rn-version: [latest, 0.83.4, 0.82.1]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Use Node.js ${{ env.NODEJS_VERSION }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ env.NODEJS_VERSION }}
cache: 'yarn'

- run: yarn install --frozen-lockfile
- run: yarn test
- name: Install node_modules in ${{ github.workspace }}
run: yarn install --frozen-lockfile

- name: Install React Native ${{ matrix.rn-version }} and run the visualizer
working-directory: /tmp
shell: bash
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
set -x # print all executed commands
npx @react-native-community/cli@latest init ${{ env.APP_NAME }} --version ${{ matrix.rn-version }} --skip-git-init --install-pods false --pm yarn
cd ${{ env.APP_NAME }}
yarn add react-native-bundle-visualizer@portal:${{ github.workspace }}
yarn run react-native-bundle-visualizer --verbose --error-on-fail
9 changes: 8 additions & 1 deletion src/react-native-bundle-visualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const chalk = require('chalk');
const fs = require('fs-extra');
const os = require('os');
const process = require('process');
const path = require('path');
const argv = require('minimist')(process.argv.slice(2));
const execa = require('execa');
Expand Down Expand Up @@ -70,6 +71,7 @@ const format = argv.format || 'html';
const bundleOutputExplorerFile = path.join(outDir, 'explorer.' + format);
const onlyMapped = !!argv['only-mapped'] || false;
const borderChecks = argv['border-checks'] === true;
const errorOnFail = argv['error-on-fail'] || false;

// Make sure the temp dir exists
fs.ensureDirSync(baseDir);
Expand Down Expand Up @@ -184,4 +186,9 @@ bundlePromise
// Open output file
return open(bundleOutputExplorerFile);
})
.catch((error) => console.log(chalk.red('=== error ==='), error));
.catch((error) => {
console.log(chalk.red('=== error ==='), error)
if (errorOnFail) {
process.exit(1);
}
});
13 changes: 0 additions & 13 deletions test/Expo42/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions test/Expo42/App.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions test/Expo42/app.json

This file was deleted.

Binary file removed test/Expo42/assets/fonts/SpaceMono-Regular.ttf
Binary file not shown.
Binary file removed test/Expo42/assets/images/adaptive-icon.png
Binary file not shown.
Binary file removed test/Expo42/assets/images/favicon.png
Binary file not shown.
Binary file removed test/Expo42/assets/images/icon.png
Binary file not shown.
Binary file removed test/Expo42/assets/images/splash.png
Binary file not shown.
7 changes: 0 additions & 7 deletions test/Expo42/babel.config.js

This file was deleted.

80 changes: 0 additions & 80 deletions test/Expo42/components/EditScreenInfo.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions test/Expo42/components/StyledText.tsx

This file was deleted.

46 changes: 0 additions & 46 deletions test/Expo42/components/Themed.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions test/Expo42/components/__tests__/StyledText-test.js

This file was deleted.

19 changes: 0 additions & 19 deletions test/Expo42/constants/Colors.ts

This file was deleted.

12 changes: 0 additions & 12 deletions test/Expo42/constants/Layout.ts

This file was deleted.

33 changes: 0 additions & 33 deletions test/Expo42/hooks/useCachedResources.ts

This file was deleted.

8 changes: 0 additions & 8 deletions test/Expo42/hooks/useColorScheme.ts

This file was deleted.

Loading