Skip to content

Commit 81e76bf

Browse files
committed
ci: build web on ci
1 parent 5b19e50 commit 81e76bf

File tree

10 files changed

+27
-30
lines changed

10 files changed

+27
-30
lines changed

.github/workflows/build-templates.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ jobs:
8686
--repo-url https://test.test
8787
--type ${{ matrix.type.name }}
8888
--languages ${{ matrix.type.language }}
89-
--example ${{ matrix.type.language == 'js' && 'expo' || 'vanilla' }}
89+
--example vanilla
90+
--tools vite
9091
--tools eslint
9192
--tools jest
9293
--tools lefthook
@@ -209,17 +210,6 @@ jobs:
209210
run: |
210211
yarn prepare
211212
212-
- name: Build example (Web)
213-
if: matrix.type.language == 'js'
214-
working-directory: ${{ env.work_dir }}
215-
shell: bash
216-
run: |
217-
# Clean up built JS files
218-
# So we test that bundling works without any pre-built files
219-
rm -rf lib/*
220-
221-
yarn example expo export --platform web
222-
223213
- name: Install JDK
224214
if: env.android_build == 1 && env.turbo_cache_hit_android != 1
225215
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
@@ -271,3 +261,13 @@ jobs:
271261
working-directory: ${{ env.work_dir }}
272262
run: |
273263
yarn turbo run build:ios --cache-dir=".turbo"
264+
265+
- name: Build example (Web)
266+
working-directory: ${{ env.work_dir }}
267+
shell: bash
268+
run: |
269+
# Clean up built JS files
270+
# So we test that bundling works without any pre-built files
271+
rm -rf lib/*
272+
273+
yarn example build:web
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const FALLBACK_BOB_VERSION = '0.40.18';
1+
export const FALLBACK_BOB_VERSION = '0.41.0';
22
export const FALLBACK_NITRO_MODULES_VERSION = '0.35.2';
33
export const SUPPORTED_MONOREPO_CONFIG_VERSION = '0.3.3';
44
export const SUPPORTED_REACT_NATIVE_VERSION = '0.83.0';

packages/create-react-native-library/templates/common/$.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ jobs:
194194
run: |
195195
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
196196
<% } -%>
197+
197198
<% if (example === 'expo' || tools.includes('vite')) { -%>
198199
build-web:
199200
runs-on: ubuntu-latest

packages/create-react-native-library/templates/js-view/src/{%- project.name %}View.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ type Props = ViewProps & {
44
color?: ColorValue;
55
};
66

7-
export function <%- project.name -%>View({
8-
color,
9-
style,
10-
...rest
11-
}: Props) {
7+
export function <%- project.name -%>View({ color, style, ...rest }: Props) {
128
return <View {...rest} style={[style, { backgroundColor: color }]} />;
139
}

packages/create-react-native-library/templates/tools/vite/example/vite.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
22

33
import { defineConfig, mergeConfig } from 'vite';
44

5-
import bobConfig from 'react-native-builder-bob/vite-config.mjs';
5+
import bobConfig from 'react-native-builder-bob/vite-config';
66

77
export default defineConfig((env) =>
88
mergeConfig(bobConfig(env), {
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/react-native-builder-bob/vite-config.mjs renamed to packages/react-native-builder-bob/configs/vite-config.mjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,11 @@ const jsx = (regex) => ({
3636
});
3737

3838
export default defineConfig(({ mode }) => ({
39-
plugins: [
40-
jsx(/\/(@expo|expo-.+)\//),
41-
commonjs(),
42-
react(),
43-
],
39+
plugins: [jsx(/\/(@expo|expo-.+)\//), commonjs(), react()],
4440
define: {
45-
'__DEV__': JSON.stringify(mode !== 'production'),
41+
__DEV__: JSON.stringify(mode !== 'production'),
4642
'process.env.EXPO_OS': JSON.stringify('web'),
47-
'global': 'globalThis',
43+
global: 'globalThis',
4844
},
4945
resolve: {
5046
extensions,

packages/react-native-builder-bob/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@
1818
},
1919
"homepage": "https://oss.callstack.com/react-native-builder-bob/build",
2020
"main": "lib/index.js",
21+
"exports": {
22+
"./package.json": "./package.json",
23+
"./babel-config": "./configs/babel-config.js",
24+
"./babel-preset": "./configs/babel-preset.js",
25+
"./metro-config": "./configs/metro-config.js",
26+
"./vite-config": "./configs/vite-config.mjs"
27+
},
2128
"bin": {
2229
"bob": "bin/bob"
2330
},
2431
"files": [
2532
"bin",
2633
"lib",
27-
"babel-preset.js",
28-
"metro-config.js",
29-
"babel-config.js",
30-
"vite-config.mjs"
34+
"configs"
3135
],
3236
"engines": {
3337
"node": "^20.19.0 || ^22.12.0 || >= 23.4.0"

0 commit comments

Comments
 (0)