Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/create-react-native-library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const NATIVE_COMMON_FILES = path.resolve(
'../templates/native-common'
);

const FALLBACK_BOB_VERSION = '0.18.0';

// Java
const JAVA_FILES = (moduleType: ModuleType) => {
switch (moduleType) {
Expand Down Expand Up @@ -324,7 +326,7 @@ async function create(argv: yargs.Arguments<any>) {
try {
version = await Promise.race([
new Promise<string>((resolve) =>
setTimeout(() => resolve(version), 1000)
setTimeout(() => resolve(FALLBACK_BOB_VERSION), 1000)
),
new Promise<string>((resolve, reject) => {
const npm = spawn('npm', [
Expand All @@ -341,12 +343,12 @@ async function create(argv: yargs.Arguments<any>) {
]);
} catch (e) {
// Fallback to a known version if we couldn't fetch
version = '0.18.0';
version = FALLBACK_BOB_VERSION;
}

const options = {
bob: {
version,
version: version || FALLBACK_BOB_VERSION,
},
project: {
slug,
Expand Down