Skip to content

Commit 44f6420

Browse files
committed
ci: build js library template on windows
1 parent 05ece3e commit 44f6420

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.github/workflows/build-templates.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
type:
4343
name: library
4444
language: js
45+
- os: windows-latest
46+
type:
47+
name: library
48+
language: js
4549

4650
concurrency:
4751
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type.name }}-${{ matrix.type.language }}
@@ -61,10 +65,12 @@ jobs:
6165
yarn workspace create-react-native-library prepare
6266
6367
- name: Get working directory
68+
shell: bash
6469
run: |
6570
echo "work_dir=${{ matrix.os }}-${{ matrix.type.name }}-${{ matrix.type.language }}" >> $GITHUB_ENV
6671
6772
- name: Create library
73+
shell: bash
6874
run: |
6975
rm -rf ${{ env.work_dir }} # Workaround for tests failing intermittently
7076
@@ -102,6 +108,7 @@ jobs:
102108
- name: Install dependencies of library
103109
if: steps.library-yarn-cache.outputs.cache-hit != 'true'
104110
working-directory: ${{ env.work_dir }}
111+
shell: bash
105112
run: |
106113
touch yarn.lock # Without this Yarn will fail due to the parent directory being a Yarn workspace
107114
rm -f example/yarn.lock # Workaround for cached yarn.lock from older version
@@ -117,6 +124,7 @@ jobs:
117124
key: ${{ steps.library-yarn-cache.outputs.cache-primary-key }}
118125

119126
- name: Use local version of react-native-builder-bob
127+
shell: bash
120128
run: |
121129
cd packages/react-native-builder-bob
122130
npm pack
@@ -127,6 +135,7 @@ jobs:
127135
128136
- name: Get build target
129137
working-directory: ${{ env.work_dir }}
138+
shell: bash
130139
run: |
131140
# Build Android for only some matrices to skip redundant builds
132141
if [[ ${{ matrix.os }} =~ ubuntu ]]; then
@@ -160,6 +169,7 @@ jobs:
160169
- name: Check turborepo cache
161170
if: env.android_build == 1 || env.ios_build == 1
162171
working-directory: ${{ env.work_dir }}
172+
shell: bash
163173
run: |
164174
TURBO_CACHE_STATUS_ANDROID=$(node -p "($(yarn turbo run build:android --cache-dir=".turbo" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
165175
TURBO_CACHE_STATUS_IOS=$(node -p "($(yarn turbo run build:ios --cache-dir=".turbo" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
@@ -193,8 +203,9 @@ jobs:
193203
yarn prepare
194204
195205
- name: Build example (Web)
196-
working-directory: ${{ env.work_dir }}
197206
if: matrix.type.language == 'js'
207+
working-directory: ${{ env.work_dir }}
208+
shell: bash
198209
run: |
199210
# Clean up built JS files
200211
# So we test that bundling works without any pre-built files
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
*.pbxproj -text
22
# specific for windows script files
3-
*.bat text eol=crlf
3+
*.bat text eol=crlf

packages/create-react-native-library/templates/common/$package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@
158158
"singleQuote": true,
159159
"tabWidth": 2,
160160
"trailingComma": "es5",
161-
"useTabs": false
161+
"useTabs": false,
162+
"endOfLine": "lf"
162163
},
163164
"react-native-builder-bob": {
164165
"source": "src",

packages/create-react-native-library/templates/common/eslint.config.mjs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,10 @@ export default defineConfig([
2020
plugins: { prettier },
2121
rules: {
2222
'react/react-in-jsx-scope': 'off',
23-
'prettier/prettier': [
24-
'error',
25-
{
26-
quoteProps: 'consistent',
27-
singleQuote: true,
28-
tabWidth: 2,
29-
trailingComma: 'es5',
30-
useTabs: false,
31-
},
32-
],
23+
'prettier/prettier': 'error',
3324
},
3425
},
3526
{
36-
ignores: [
37-
'node_modules/',
38-
'lib/'
39-
],
27+
ignores: ['node_modules/', 'lib/'],
4028
},
4129
]);

0 commit comments

Comments
 (0)