Skip to content

Commit 35eaf9c

Browse files
Merge branch 'main' into main
2 parents d00c11a + a0ca7d2 commit 35eaf9c

File tree

23 files changed

+299
-225
lines changed

23 files changed

+299
-225
lines changed

.github/workflows/build-templates.yml

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,44 +30,30 @@ jobs:
3030
- ubuntu-latest
3131
- macos-14 # macos latest defaults to macos 12 at the moment.
3232
type:
33-
- module-legacy
34-
- module-new
35-
- view-legacy
36-
- view-new
33+
- turbo-module
34+
- fabric-view
35+
- legacy-module
36+
- legacy-view
3737
language:
3838
- kotlin-objc
3939
- kotlin-swift
40-
arch:
41-
- auto
40+
- cpp
4241
exclude:
43-
- type: module-new
42+
- type: turbo-module
4443
language: kotlin-swift
45-
- type: view-new
44+
- type: fabric-view
4645
language: kotlin-swift
46+
- type: fabric-view
47+
language: cpp
48+
- type: legacy-view
49+
language: cpp
4750
include:
4851
- os: ubuntu-latest
4952
type: library
5053
language: js
51-
arch: auto
52-
- os: ubuntu-latest
53-
type: module-legacy
54-
language: cpp
55-
arch: auto
56-
- os: ubuntu-latest
57-
type: module-new
58-
language: cpp
59-
arch: auto
60-
- os: macos-14
61-
type: module-legacy
62-
language: cpp
63-
arch: auto
64-
- os: macos-14
65-
type: module-new
66-
language: cpp
67-
arch: auto
6854

6955
concurrency:
70-
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}
56+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}
7157
cancel-in-progress: true
7258

7359
runs-on: ${{ matrix.os }}
@@ -79,20 +65,13 @@ jobs:
7965
- name: Setup
8066
uses: ./.github/actions/setup
8167

82-
- name: Set environment variables
83-
run: |
84-
if [[ "${{ matrix.arch }}" == "new" ]]; then
85-
echo "RCT_NEW_ARCH_ENABLED=1" >> $GITHUB_ENV
86-
echo "ORG_GRADLE_PROJECT_newArchEnabled=true" >> $GITHUB_ENV
87-
fi
88-
8968
- name: Build package
9069
run: |
9170
yarn workspace create-react-native-library prepare
9271
9372
- name: Get working directory
9473
run: |
95-
echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}" >> $GITHUB_ENV
74+
echo "work_dir=${{ matrix.os }}-${{ matrix.type }}-${{ matrix.language }}" >> $GITHUB_ENV
9675
9776
- name: Create library
9877
run: |
@@ -142,14 +121,14 @@ jobs:
142121
run: |
143122
# Build Android for only some matrices to skip redundant builds
144123
if [[ ${{ matrix.os }} == ubuntu-latest ]]; then
145-
if [[ ${{ matrix.type }} == view-* && ${{ matrix.language }} == *-objc ]] || [[ ${{ matrix.type }} == module-* && ${{ matrix.language }} == *-objc ]] || [[ ${{ matrix.type }} == module-* && ${{ matrix.language }} == cpp ]]; then
124+
if [[ ${{ matrix.type }} == *-view && ${{ matrix.language }} == *-objc ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == *-objc ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == cpp ]]; then
146125
echo "android_build=1" >> $GITHUB_ENV
147126
fi
148127
fi
149128
150129
# Build iOS for only some matrices to skip redundant builds
151130
if [[ ${{ matrix.os }} == macos-14 ]]; then
152-
if [[ ${{ matrix.type }} == view-* && ${{ matrix.language }} == kotlin-* ]] || [[ ${{ matrix.type }} == module-* && ${{ matrix.language }} == kotlin-* ]] || [[ ${{ matrix.type }} == module-* && ${{ matrix.language }} == cpp ]]; then
131+
if [[ ${{ matrix.type }} == *-view && ${{ matrix.language }} == kotlin-* ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == kotlin-* ]] || [[ ${{ matrix.type }} == *-module && ${{ matrix.language }} == cpp ]]; then
153132
echo "ios_build=1" >> $GITHUB_ENV
154133
fi
155134
fi
@@ -160,9 +139,9 @@ jobs:
160139
with:
161140
path: |
162141
${{ env.work_dir }}/.turbo
163-
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
142+
key: ${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ hashFiles(format('{0}/yarn.lock', env.work_dir)) }}
164143
restore-keys: |
165-
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.arch }}-
144+
${{ runner.os }}-library-turborepo-${{ matrix.type }}-${{ matrix.language }}-
166145
167146
- name: Check turborepo cache
168147
if: env.android_build == 1 || env.ios_build == 1

packages/create-react-native-library/CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.45.5](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.45.5) (2024-12-09)
7+
8+
### Bug Fixes
9+
10+
- don't crash if resolving version fails ([a403f14](https://github.com/callstack/react-native-builder-bob/commit/a403f149d2c578b5dcf524951f29b2aa0baa9619)) - by @satya164
11+
- don't create example app for local library ([4f64b22](https://github.com/callstack/react-native-builder-bob/commit/4f64b22d19fee8a28f4c6541b7413b6de14eba1a)) - by @satya164
12+
- improve example app descriptions ([b8c3293](https://github.com/callstack/react-native-builder-bob/commit/b8c32937b1a7dd98d6322c5b0377ad9fa2ed44d4)) - by @satya164
13+
- validate arguments correctly ([#724](https://github.com/callstack/react-native-builder-bob/issues/724)) ([a34d80f](https://github.com/callstack/react-native-builder-bob/commit/a34d80fcf76aff1e3797f1ca1fd586fce7900731)) - by @satya164
14+
15+
## [0.45.4](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.45.4) (2024-12-08)
16+
17+
### Bug Fixes
18+
19+
- don't crash if resolving version fails ([a403f14](https://github.com/callstack/react-native-builder-bob/commit/a403f149d2c578b5dcf524951f29b2aa0baa9619)) - by @satya164
20+
- validate arguments correctly ([#724](https://github.com/callstack/react-native-builder-bob/issues/724)) ([a34d80f](https://github.com/callstack/react-native-builder-bob/commit/a34d80fcf76aff1e3797f1ca1fd586fce7900731)) - by @satya164
21+
22+
## [0.45.3](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.45.3) (2024-12-06)
23+
24+
### Bug Fixes
25+
26+
- fix codegen script failing due to missing platforms ([86c5c67](https://github.com/callstack/react-native-builder-bob/commit/86c5c67656712a990f2dd1c9eda761c7082d52e6)) - by @satya164
27+
28+
## [0.45.2](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.45.2) (2024-12-06)
29+
30+
**Note:** Version bump only for package create-react-native-library
31+
32+
## [0.45.1](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.45.1) (2024-12-06)
33+
34+
**Note:** Version bump only for package create-react-native-library
35+
636
# [0.45.0](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.45.0) (2024-12-04)
737

838
### Bug Fixes

packages/create-react-native-library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-react-native-library",
3-
"version": "0.45.0",
3+
"version": "0.45.5",
44
"description": "CLI to scaffold React Native libraries",
55
"keywords": [
66
"react-native",

packages/create-react-native-library/src/index.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import fs from 'fs-extra';
33
import kleur from 'kleur';
44
import yargs from 'yargs';
55
import ora from 'ora';
6-
import prompts from './utils/prompts';
6+
import { prompt } from './utils/prompt';
77
import generateExampleApp from './exampleApp/generateExampleApp';
88
import { addCodegenBuildScript } from './exampleApp/addCodegenBuildScript';
99
import { createInitialGitCommit } from './utils/initialCommit';
1010
import { assertUserInput, assertNpxExists } from './utils/assert';
11-
import { resolveBobVersionWithFallback } from './utils/promiseWithFallback';
11+
import { resolveNpmPackageVersion } from './utils/resolveNpmPackageVersion';
1212
import { applyTemplates, generateTemplateConfiguration } from './template';
1313
import {
1414
createQuestions,
@@ -44,7 +44,10 @@ async function create(_argv: yargs.Arguments<Args>) {
4444
const { _, $0, ...argv } = _argv;
4545

4646
// Prefetch bob version in background while asking questions
47-
const resolveBobVersion = resolveBobVersionWithFallback(FALLBACK_BOB_VERSION);
47+
const bobVersionPromise = resolveNpmPackageVersion(
48+
'react-native-builder-bob',
49+
FALLBACK_BOB_VERSION
50+
);
4851

4952
const local = await promptLocalLibrary(argv);
5053
const folder = await promptPath(argv, local);
@@ -53,26 +56,19 @@ async function create(_argv: yargs.Arguments<Args>) {
5356

5457
const basename = path.basename(folder);
5558

56-
const { questions, singleChoiceAnswers } = await createQuestions({
57-
basename,
58-
local,
59-
argv,
60-
});
59+
const questions = await createQuestions({ basename, local });
6160

6261
assertUserInput(questions, argv);
6362

64-
const promptAnswers = await prompts(questions);
65-
66-
const answers = {
67-
...argv,
68-
local,
69-
...singleChoiceAnswers,
63+
const promptAnswers = await prompt(questions, argv);
64+
const answers: Answers = {
7065
...promptAnswers,
71-
} as Required<Answers>;
66+
local,
67+
};
7268

7369
assertUserInput(questions, answers);
7470

75-
const bobVersion = await resolveBobVersion();
71+
const bobVersion = await bobVersionPromise;
7672

7773
const config = generateTemplateConfiguration({
7874
bobVersion,
@@ -121,7 +117,7 @@ async function create(_argv: yargs.Arguments<Args>) {
121117
: devDependencies;
122118
}
123119

124-
if (config.example === 'vanilla' && config.project.arch !== 'legacy') {
120+
if (config.example === 'vanilla' && config.project.arch === 'new') {
125121
addCodegenBuildScript(folder);
126122
}
127123

@@ -158,7 +154,7 @@ async function promptLocalLibrary(argv: Args) {
158154

159155
if (hasPackageJson) {
160156
// If we're under a project with package.json, ask the user if they want to create a local library
161-
const answers = await prompts({
157+
const answers = await prompt({
162158
type: 'confirm',
163159
name: 'local',
164160
message: `Looks like you're under a project folder. Do you want to create a local library?`,
@@ -178,7 +174,7 @@ async function promptPath(argv: Args, local: boolean) {
178174
if (argv.name && !local) {
179175
folder = path.join(process.cwd(), argv.name);
180176
} else {
181-
const answers = await prompts({
177+
const answers = await prompt({
182178
type: 'text',
183179
name: 'folder',
184180
message: `Where do you want to create the library?`,

packages/create-react-native-library/src/inform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function printNextSteps(
5454
)} to link the library\n`
5555
: `- Link the library at ${kleur.blue(
5656
path.relative(process.cwd(), folder)
57-
)} based on your project setup'\n`) +
57+
)} based on your project setup\n`) +
5858
`- Run ${kleur.blue(
5959
'pod install --project-directory=ios'
6060
)} to install dependencies with CocoaPods\n` +

0 commit comments

Comments
 (0)