Skip to content

Commit

Permalink
feat: remove all the java templates
Browse files Browse the repository at this point in the history
  • Loading branch information
atlj committed Jun 11, 2024
1 parent ba16dd6 commit 1d3fa60
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 578 deletions.
45 changes: 4 additions & 41 deletions packages/create-react-native-library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ const NATIVE_FILES = {
),
} as const;

const JAVA_FILES = {
module_legacy: path.resolve(__dirname, '../templates/java-library-legacy'),
module_new: path.resolve(__dirname, '../templates/java-library-new'),
module_mixed: path.resolve(__dirname, '../templates/java-library-mixed'),
view_legacy: path.resolve(__dirname, '../templates/java-view-legacy'),
view_mixed: path.resolve(__dirname, '../templates/java-view-mixed'),
view_new: path.resolve(__dirname, '../templates/java-view-new'),
} as const;

const OBJC_FILES = {
module_common: path.resolve(__dirname, '../templates/objc-library'),
view_legacy: path.resolve(__dirname, '../templates/objc-view-legacy'),
Expand Down Expand Up @@ -101,13 +92,7 @@ type ArgName =
| 'example'
| 'react-native-version';

type ProjectLanguages =
| 'java-objc'
| 'java-swift'
| 'kotlin-objc'
| 'kotlin-swift'
| 'cpp'
| 'js';
type ProjectLanguages = 'kotlin-objc' | 'kotlin-swift' | 'cpp' | 'js';

type ProjectType =
| 'module-legacy'
Expand Down Expand Up @@ -150,28 +135,11 @@ const LANGUAGE_CHOICES: {
'view-module-mixed',
],
},
{
title: 'Java & Objective-C',
value: 'java-objc',
types: [
'module-legacy',
'module-new',
'module-mixed',
'view-mixed',
'view-new',
'view-legacy',
],
},
{
title: 'Kotlin & Swift',
value: 'kotlin-swift',
types: ['module-legacy', 'view-legacy'],
},
{
title: 'Java & Swift',
value: 'java-swift',
types: ['module-legacy', 'view-legacy'],
},
{
title: 'C++ for Android & iOS',
value: 'cpp',
Expand Down Expand Up @@ -521,7 +489,7 @@ async function create(argv: yargs.Arguments<any>) {
authorUrl,
repoUrl,
type = 'module-mixed',
languages = type === 'library' ? 'js' : 'java-objc',
languages = type === 'library' ? 'js' : 'kotlin-objc',
example: hasExample,
reactNativeVersion,
} = {
Expand Down Expand Up @@ -635,8 +603,7 @@ async function create(argv: yargs.Arguments<any>) {
native: languages !== 'js',
arch,
cpp: languages === 'cpp',
kotlin: languages === 'kotlin-objc' || languages === 'kotlin-swift',
swift: languages === 'java-swift' || languages === 'kotlin-swift',
swift: languages === 'kotlin-swift',
view: moduleType === 'view' || moduleType === 'view_module',
module: moduleType === 'module' || moduleType === 'view_module',
},
Expand Down Expand Up @@ -759,11 +726,7 @@ async function create(argv: yargs.Arguments<any>) {

const templateType = `${moduleType}_${arch}` as const;

if (options.project.kotlin) {
await copyDir(KOTLIN_FILES[templateType], folder);
} else {
await copyDir(JAVA_FILES[templateType], folder);
}
await copyDir(KOTLIN_FILES[templateType], folder);

if (options.project.cpp) {
await copyDir(CPP_FILES, folder);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1d3fa60

Please sign in to comment.