Skip to content

Commit 4b7cb47

Browse files
authored
Linter & CI fixes (#5)
1 parent a84c1eb commit 4b7cb47

File tree

12 files changed

+33
-138
lines changed

12 files changed

+33
-138
lines changed

.github/workflows/ci.yml

-118
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@ jobs:
2626
- name: Typecheck files
2727
run: yarn typecheck
2828

29-
test:
30-
runs-on: ubuntu-latest
31-
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v3
34-
35-
- name: Setup
36-
uses: ./.github/actions/setup
37-
38-
- name: Run unit tests
39-
run: yarn test --maxWorkers=2 --coverage
40-
4129
build-library:
4230
runs-on: ubuntu-latest
4331
steps:
@@ -49,109 +37,3 @@ jobs:
4937

5038
- name: Build package
5139
run: yarn prepare
52-
53-
build-android:
54-
runs-on: ubuntu-latest
55-
env:
56-
TURBO_CACHE_DIR: .turbo/android
57-
steps:
58-
- name: Checkout
59-
uses: actions/checkout@v3
60-
61-
- name: Setup
62-
uses: ./.github/actions/setup
63-
64-
- name: Cache turborepo for Android
65-
uses: actions/cache@v3
66-
with:
67-
path: ${{ env.TURBO_CACHE_DIR }}
68-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
69-
restore-keys: |
70-
${{ runner.os }}-turborepo-android-
71-
72-
- name: Check turborepo cache for Android
73-
run: |
74-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
75-
76-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
77-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
78-
fi
79-
80-
- name: Install JDK
81-
if: env.turbo_cache_hit != 1
82-
uses: actions/setup-java@v3
83-
with:
84-
distribution: 'zulu'
85-
java-version: '17'
86-
87-
- name: Finalize Android SDK
88-
if: env.turbo_cache_hit != 1
89-
run: |
90-
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
91-
92-
- name: Cache Gradle
93-
if: env.turbo_cache_hit != 1
94-
uses: actions/cache@v3
95-
with:
96-
path: |
97-
~/.gradle/wrapper
98-
~/.gradle/caches
99-
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
100-
restore-keys: |
101-
${{ runner.os }}-gradle-
102-
103-
- name: Build example for Android
104-
env:
105-
JAVA_OPTS: "-XX:MaxHeapSize=6g"
106-
run: |
107-
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
108-
109-
build-ios:
110-
runs-on: macos-14
111-
env:
112-
TURBO_CACHE_DIR: .turbo/ios
113-
steps:
114-
- name: Checkout
115-
uses: actions/checkout@v3
116-
117-
- name: Setup
118-
uses: ./.github/actions/setup
119-
120-
- name: Cache turborepo for iOS
121-
uses: actions/cache@v3
122-
with:
123-
path: ${{ env.TURBO_CACHE_DIR }}
124-
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
125-
restore-keys: |
126-
${{ runner.os }}-turborepo-ios-
127-
128-
- name: Check turborepo cache for iOS
129-
run: |
130-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
131-
132-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
133-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
134-
fi
135-
136-
- name: Cache cocoapods
137-
if: env.turbo_cache_hit != 1
138-
id: cocoapods-cache
139-
uses: actions/cache@v3
140-
with:
141-
path: |
142-
**/ios/Pods
143-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
144-
restore-keys: |
145-
${{ runner.os }}-cocoapods-
146-
147-
- name: Install cocoapods
148-
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
149-
run: |
150-
cd example/ios
151-
pod install
152-
env:
153-
NO_FLIPPER: 1
154-
155-
- name: Build example for iOS
156-
run: |
157-
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

.github/workflows/docs-build-check.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Check documentation
22

33
on:
4-
pull_request:
4+
push:
5+
branches:
6+
- main
57
paths:
68
- 'docs/**'
79
workflow_dispatch:

docs/docusaurus.config.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const config = {
2727
breadcrumbs: false,
2828
sidebarPath: require.resolve('./sidebars.js'),
2929
sidebarCollapsible: false,
30-
editUrl: 'https://github.com/software-mansion/react-native-executorch/edit/main/docs',
30+
editUrl:
31+
'https://github.com/software-mansion/react-native-executorch/edit/main/docs',
3132
},
3233
theme: {
3334
customCss: require.resolve('./src/css/index.css'),
@@ -53,9 +54,10 @@ const config = {
5354
},
5455
items: [
5556
{
56-
href: 'https://github.com/software-mansion/react-native-executorch',
57-
position: 'right',
58-
className: 'header-github',
57+
'href':
58+
'https://github.com/software-mansion/react-native-executorch',
59+
'position': 'right',
60+
'className': 'header-github',
5961
'aria-label': 'GitHub repository',
6062
},
6163
],

docs/sidebars.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
1515
const sidebars = {
1616
// By default, Docusaurus generates a sidebar from the docs folder structure
17-
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
17+
tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],
1818

1919
// But you can create a sidebar manually
2020
/*

docs/src/components/Hero/StartScreen/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const StartScreen = () => {
1212
<span>ExecuTorch</span>
1313
</h1>
1414
<h2 className={styles.subheadingLabel}>
15-
Declarative way to run AI models in React Native on device, powered by ExecuTorch.
15+
Declarative way to run AI models in React Native on device, powered
16+
by ExecuTorch.
1617
</h2>
1718
</div>
1819
<div className={styles.lowerHeading}>

docs/src/components/HomepageButton/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const HomepageButton: React.FC<{
3535
styles.homepageButton,
3636
backgroundStyling,
3737
borderStyling
38-
)}>
38+
)}
39+
>
3940
{title}
4041

4142
<div className={styles.arrow}>

docs/src/pages/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ function Home() {
1010
return (
1111
<Layout
1212
title={`React Native ExecuTorch`}
13-
description="Declarative way to run AI models in React Native on device, powered by ExecuTorch.">
13+
description="Declarative way to run AI models in React Native on device, powered by ExecuTorch."
14+
>
1415
<div className={styles.container}>
1516
<HomepageStartScreen />
1617
</div>
@@ -45,4 +46,4 @@ function Home() {
4546
);
4647
}
4748

48-
export default Home;
49+
export default Home;

examples/llama/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
33
import ChatScreen from './screens/ChatScreen';
44

55
export default function App() {
6-
const fontsLoaded = useFonts({
6+
useFonts({
77
medium: require('./assets/fonts/Aeonik-Medium.otf'),
88
regular: require('./assets/fonts/Aeonik-Regular.otf'),
99
});

examples/llama/babel.config.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
module.exports = function(api) {
1+
module.exports = function (api) {
22
api.cache(true);
33
return {
44
presets: ['babel-preset-expo'],
5-
plugins: [
6-
'react-native-reanimated/plugin'
7-
]
5+
plugins: ['react-native-reanimated/plugin'],
86
};
97
};

examples/llama/metro.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { getDefaultConfig } = require("expo/metro-config");
1+
const { getDefaultConfig } = require('expo/metro-config');
22

33
module.exports = (() => {
44
const config = getDefaultConfig(__dirname);
@@ -7,14 +7,14 @@ module.exports = (() => {
77

88
config.transformer = {
99
...transformer,
10-
babelTransformerPath: require.resolve("react-native-svg-transformer/expo"),
10+
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
1111
};
1212
config.resolver = {
1313
...resolver,
14-
assetExts: resolver.assetExts.filter((ext) => ext !== "svg"),
15-
sourceExts: [...resolver.sourceExts, "svg"],
14+
assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
15+
sourceExts: [...resolver.sourceExts, 'svg'],
1616
};
17-
17+
1818
config.resolver.assetExts.push('pte');
1919
config.resolver.assetExts.push('bin');
2020

package.json

+8
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@
120120
}
121121
},
122122
"eslintConfig": {
123+
"parserOptions": {
124+
"requireConfigFile": false,
125+
"babelOptions": {
126+
"presets": [
127+
"@babel/preset-react"
128+
]
129+
}
130+
},
123131
"root": true,
124132
"extends": [
125133
"@react-native",

react-native-executorch-0.1.0.tgz

29.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)