Skip to content

Commit ea61997

Browse files
committed
chore: formatting
1 parent e847f15 commit ea61997

File tree

3 files changed

+67
-62
lines changed

3 files changed

+67
-62
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,17 @@ async function create(_argv: yargs.Arguments<Args>) {
130130

131131
rootPackageJson.devDependencies = rootPackageJson.devDependencies
132132
? {
133-
...rootPackageJson.devDependencies,
134-
...devDependencies,
135-
}
133+
...rootPackageJson.devDependencies,
134+
...devDependencies,
135+
}
136136
: devDependencies;
137137
}
138138

139-
if (config.example === 'vanilla' && config.project.arch === 'new' && !config.project.nitro) {
139+
if (
140+
config.example === 'vanilla' &&
141+
config.project.arch === 'new' &&
142+
!config.project.nitro
143+
) {
140144
addCodegenBuildScript(folder);
141145
}
142146

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

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,27 @@ const LANGUAGE_CHOICES: {
3333
value: ProjectLanguages;
3434
types: ProjectType[];
3535
}[] = [
36-
{
37-
title: 'Kotlin & Swift',
38-
value: 'kotlin-swift',
39-
types: ['nitro-module', 'legacy-module', 'legacy-view'],
40-
},
41-
{
42-
title: 'Kotlin & Objective-C',
43-
value: 'kotlin-objc',
44-
types: ['turbo-module', 'fabric-view', 'legacy-module', 'legacy-view'],
45-
},
46-
{
47-
title: 'C++ for Android & iOS',
48-
value: 'cpp',
49-
types: ['turbo-module', 'legacy-module'],
50-
},
51-
{
52-
title: 'JavaScript for Android, iOS & Web',
53-
value: 'js',
54-
types: ['library'],
55-
},
56-
];
36+
{
37+
title: 'Kotlin & Swift',
38+
value: 'kotlin-swift',
39+
types: ['nitro-module', 'legacy-module', 'legacy-view'],
40+
},
41+
{
42+
title: 'Kotlin & Objective-C',
43+
value: 'kotlin-objc',
44+
types: ['turbo-module', 'fabric-view', 'legacy-module', 'legacy-view'],
45+
},
46+
{
47+
title: 'C++ for Android & iOS',
48+
value: 'cpp',
49+
types: ['turbo-module', 'legacy-module'],
50+
},
51+
{
52+
title: 'JavaScript for Android, iOS & Web',
53+
value: 'js',
54+
types: ['library'],
55+
},
56+
];
5757

5858
const EXAMPLE_CHOICES = (
5959
[
@@ -85,37 +85,37 @@ const TYPE_CHOICES: {
8585
value: ProjectType;
8686
description: string;
8787
}[] = [
88-
{
89-
title: 'Nitro module',
90-
value: 'nitro-module',
91-
description: 'nitro for faster modules',
92-
},
93-
{
94-
title: 'Turbo module',
95-
value: 'turbo-module',
96-
description: 'integration for native APIs to JS',
97-
},
98-
{
99-
title: 'Fabric view',
100-
value: 'fabric-view',
101-
description: 'integration for native views to JS',
102-
},
103-
{
104-
title: 'Legacy Native module',
105-
value: 'legacy-module',
106-
description: 'bridge for native APIs to JS (old architecture)',
107-
},
108-
{
109-
title: 'Legacy Native view',
110-
value: 'legacy-view',
111-
description: 'bridge for native views to JS (old architecture)',
112-
},
113-
{
114-
title: 'JavaScript library',
115-
value: 'library',
116-
description: 'supports Expo Go and Web',
117-
},
118-
];
88+
{
89+
title: 'Nitro module',
90+
value: 'nitro-module',
91+
description: 'nitro for faster modules',
92+
},
93+
{
94+
title: 'Turbo module',
95+
value: 'turbo-module',
96+
description: 'integration for native APIs to JS',
97+
},
98+
{
99+
title: 'Fabric view',
100+
value: 'fabric-view',
101+
description: 'integration for native views to JS',
102+
},
103+
{
104+
title: 'Legacy Native module',
105+
value: 'legacy-module',
106+
description: 'bridge for native APIs to JS (old architecture)',
107+
},
108+
{
109+
title: 'Legacy Native view',
110+
value: 'legacy-view',
111+
description: 'bridge for native views to JS (old architecture)',
112+
},
113+
{
114+
title: 'JavaScript library',
115+
value: 'library',
116+
description: 'supports Expo Go and Web',
117+
},
118+
];
119119

120120
export type Question = Omit<
121121
PromptObject<keyof Answers>,

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ export function generateTemplateConfiguration({
136136
name:
137137
/^[A-Z]/.test(basename) && /^[a-z0-9]+$/i.test(basename)
138138
? // If the project name is already in PascalCase, use it as-is
139-
basename
139+
basename
140140
: // Otherwise, convert it to PascalCase and remove any non-alphanumeric characters
141-
`${project.charAt(0).toUpperCase()}${project
142-
.replace(/[^a-z0-9](\w)/g, (_, $1) => $1.toUpperCase())
143-
.slice(1)}`,
141+
`${project.charAt(0).toUpperCase()}${project
142+
.replace(/[^a-z0-9](\w)/g, (_, $1) => $1.toUpperCase())
143+
.slice(1)}`,
144144
package: pack,
145145
package_array: JSON.stringify(pack.split('.')),
146146
package_dir: pack.replace(/\./g, '/'),
@@ -234,8 +234,9 @@ export async function applyTemplates(
234234
}
235235
}
236236

237-
const templateType = `${config.project.module ? 'module' : 'view'}_${config.project.arch
238-
}` as const;
237+
const templateType = `${config.project.module ? 'module' : 'view'}_${
238+
config.project.arch
239+
}` as const;
239240

240241
await applyTemplate(config, KOTLIN_FILES[templateType], folder);
241242

0 commit comments

Comments
 (0)