Skip to content

Commit

Permalink
fix: update ‘js’ value type to new value ‘library’ in create library …
Browse files Browse the repository at this point in the history
…script (#253)

### Summary

The [email protected] has the wrong type value reference for javascript library, and prompt script force to choose a language for mobile.
I'm not sure it fixes everything, but script now seems to work correctly for javascript library path.
```
$ npx [email protected] awesome-module
✔ What is the name of the npm package? … react-native-awesome-module
✔ What is the description for the package? … An awesome module
✔ What is the name of package author? … Marco Travaglini
✔ What is the email address for the package author? … [email protected]
✔ What is the URL for the package author? … https://gitlab.com/napcoder
✔ What is the URL for the repository? … https://gitlab.com/napcoder/react-native-awesome-module
✔ What type of library do you want to develop? › JavaScript library
? Which languages do you want to use? › - Use arrow-keys. Return to submit.
❯   Java & Objective-C
    Java & Swift
    Kotlin & Objective-C
    Kotlin & Swift
    C++ for both iOS & Android
```

### Test plan

```
[napcoder@Ceres:~/projects/moduli/prove]$ ../../react-native-builder-bob/packages/create-react-native-library/bin/create-react-native-library awesome-module
✔ What is the name of the npm package? … react-native-awesome-module
✔ What is the description for the package? … An awesome module
✔ What is the name of package author? … Marco Travaglini
✔ What is the email address for the package author? … [email protected]
✔ What is the URL for the package author? … https://gitlab.com/napcoder
✔ What is the URL for the repository? … https://gitlab.com/napcoder/react-native-awesome-module
✔ What type of library do you want to develop? › JavaScript library
✔ What type of example app do you want to generate? › JavaScript only (with Expo and Web support)
Project created successfully at authsdk!

Get started with the project:

  $ yarn

Run the example app on iOS:

  $ yarn example ios

Run the example app on Android:

  $ yarn example android

Run the example app on Web:

  $ yarn example web

Good luck!
```
  • Loading branch information
napcoder authored Jul 9, 2022
1 parent a079b2a commit 5599ee6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/create-react-native-library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ async function create(argv: yargs.Arguments<any>) {
},
'languages': {
type: (_, values) =>
values.type === 'js' ||
values.type === 'library' ||
values.type === 'module-turbo' ||
values.type === 'module-mixed'
? null
Expand All @@ -274,7 +274,7 @@ async function create(argv: yargs.Arguments<any>) {
],
},
'example': {
type: (_, values) => (values.type === 'js' ? 'select' : null),
type: (_, values) => (values.type === 'library' ? 'select' : null),
name: 'example',
message: 'What type of example app do you want to generate?',
choices: [
Expand Down

0 comments on commit 5599ee6

Please sign in to comment.