Skip to content

Commit e6f0ca0

Browse files
Koalkball-hayden
authored andcommitted
fix(deps): Support Expo 51
1 parent dd00891 commit e6f0ca0

36 files changed

+14309
-42941
lines changed

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
root: true,
3-
extends: ['universe/native', 'universe/web'],
4-
ignorePatterns: ['build'],
3+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
4+
ignorePatterns: ['build/**'],
55
};

.github/workflows/build_and_release.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ jobs:
1919
with:
2020
node-version: 20
2121

22-
- name: Install dependencies
23-
run: npm install
22+
- name: Setup PNPM
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 9
26+
run_install: true
2427

2528
- name: Build
26-
run: npm run build
29+
working-directory: ./react-native-mcu-manager
30+
run: pnpm build
2731

2832
android-example:
2933
name: Android example app
@@ -43,12 +47,15 @@ jobs:
4347
with:
4448
node-version: 20
4549

50+
- name: Setup PNPM
51+
uses: pnpm/action-setup@v4
52+
with:
53+
version: 9
54+
run_install: true
55+
4656
- name: Making sure the android example app builds
4757
run: |
48-
npm install
49-
5058
cd example
51-
npm install
5259
npx expo prebuild --platform android
5360
5461
cd android
@@ -67,12 +74,15 @@ jobs:
6774
with:
6875
node-version: 20
6976

77+
- name: Setup PNPM
78+
uses: pnpm/action-setup@v4
79+
with:
80+
version: 9
81+
run_install: true
82+
7083
- name: Making sure the ios example app builds
7184
run: |
72-
npm install
73-
7485
cd example
75-
npm install
7686
npx expo prebuild --platform ios
7787
7888
cd ios
@@ -89,13 +99,17 @@ jobs:
8999
- name: Setup Node.js
90100
uses: actions/setup-node@v4
91101
with:
92-
node-version: 20
102+
node-version: 20
93103

94-
- name: Install dependencies
95-
run: npm install
104+
- name: Setup PNPM
105+
uses: pnpm/action-setup@v4
106+
with:
107+
version: 9
108+
run_install: true
96109

97110
- name: Release
98111
env:
99112
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100113
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
114+
working-directory: react-native-mcu-manager
101115
run: npx semantic-release

.github/workflows/lint.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@ jobs:
1515
- name: Setup Node.js
1616
uses: actions/setup-node@v4
1717
with:
18-
node-version: 18
18+
node-version: 20
1919

20-
- name: Install package dependencies
21-
run: npm install
22-
23-
- name: Install example app dependencies
24-
working-directory: ./example
25-
run: npm install
20+
- name: Setup PNPM
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 9
24+
run_install: true
2625

2726
- name: Lint
28-
run: npm run lint
27+
run: pnpm lint
28+
29+
- name: Typecheck MCU Manager
30+
run: pnpm typecheck
31+
working-directory: ./react-native-mcu-manager
32+
33+
- name: Typecheck Example
34+
run: pnpm typecheck
35+
working-directory: ./example

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node-linker=hoisted

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ how you get on.
1616

1717
For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
1818

19-
### Add the package to your npm dependencies
19+
### Add the package to your pnpm dependencies
2020

2121
```
22-
npm install @playerdata/react-native-mcu-manager
22+
pnpm install @playerdata/react-native-mcu-manager
2323
```
2424

2525
### Configure for iOS
2626

27-
Run `npx pod-install` after installing the npm package.
27+
Run `npx pod-install` after installing the pnpm package.
2828

2929

3030
### Configure for Android
@@ -82,18 +82,18 @@ For Kotlin, you'll find the source files at `reactnativemcumanager` under `Andro
8282
Make sure your code passes TypeScript and ESLint. Run the following to verify:
8383

8484
```sh
85-
npm run typecheck
86-
npm run lint
85+
pnpm run typecheck
86+
pnpm run lint
8787
```
8888

8989
To fix formatting errors, run the following:
9090

9191
```sh
92-
npm run lint --fix
92+
pnpm run typecheck run lint --fix
9393
```
9494

9595
Remember to add unit tests for your change if possible. Run the unit tests by:
9696

9797
```sh
98-
npm run test
98+
pnpm run typecheck run test
9999
```

android/build.gradle

Lines changed: 0 additions & 93 deletions
This file was deleted.

example/babel.config.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
const path = require('path');
1+
// eslint-disable-next-line no-undef
22
module.exports = function (api) {
33
api.cache(true);
4+
45
return {
56
presets: ['babel-preset-expo'],
6-
plugins: [
7-
[
8-
'module-resolver',
9-
{
10-
extensions: ['.tsx', '.ts', '.js', '.json'],
11-
alias: {
12-
// For development, we want to alias the library to the source
13-
'@playerdata/react-native-mcu-manager': path.join(__dirname, '..', 'src', 'index.ts'),
14-
},
15-
},
16-
],
17-
],
187
};
198
};

example/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { registerRootComponent } from 'expo';
2+
3+
import App from './src/App';
4+
5+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6+
// It also ensures that whether you load the app in Expo Go or in a native build,
7+
// the environment is set up appropriately
8+
registerRootComponent(App);

example/metro.config.js

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1-
// Learn more https://docs.expo.io/guides/customizing-metro
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
/* eslint-disable no-undef */
3+
24
const { getDefaultConfig } = require('expo/metro-config');
35
const path = require('path');
46

5-
const config = getDefaultConfig(__dirname);
7+
const projectRoot = __dirname;
8+
const monorepoRoot = path.resolve(projectRoot, '..');
69

7-
// npm v7+ will install ../node_modules/react-native because of peerDependencies.
8-
// To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native,
9-
// excludes the one from the parent folder when bundling.
10-
config.resolver.blockList = [
11-
...Array.from(config.resolver.blockList ?? []),
12-
new RegExp(path.resolve('..', 'node_modules', 'react-native')),
13-
];
10+
const config = getDefaultConfig(projectRoot);
1411

12+
config.watchFolders = [monorepoRoot];
1513
config.resolver.nodeModulesPaths = [
16-
path.resolve(__dirname, './node_modules'),
17-
path.resolve(__dirname, '../node_modules'),
14+
path.resolve(projectRoot, 'node_modules'),
15+
path.resolve(monorepoRoot, 'node_modules'),
1816
];
1917

20-
config.watchFolders = [path.resolve(__dirname, '..')];
21-
22-
config.transformer.getTransformOptions = async () => ({
23-
transform: {
24-
experimentalImportSupport: false,
25-
inlineRequires: true,
26-
},
27-
});
28-
29-
module.exports = config;
18+
module.exports = config;

0 commit comments

Comments
 (0)