|
| 1 | +import fs from 'fs-extra'; |
1 | 2 | import githubUsername from 'github-username'; |
| 3 | +import path from 'path'; |
2 | 4 | import validateNpmPackage from 'validate-npm-package-name'; |
3 | 5 | import type yargs from 'yargs'; |
4 | 6 | import { version } from '../package.json'; |
| 7 | +import { SUPPORTED_REACT_NATIVE_VERSION } from './constants'; |
5 | 8 | import type { Question } from './utils/prompt'; |
6 | 9 | import { spawn } from './utils/spawn'; |
7 | | -import fs from 'fs-extra'; |
8 | | -import path from 'path'; |
9 | 10 |
|
10 | 11 | export type ProjectLanguages = 'kotlin-objc' | 'kotlin-swift' | 'js'; |
11 | 12 |
|
@@ -91,59 +92,57 @@ const TYPE_CHOICES: { |
91 | 92 | ]; |
92 | 93 |
|
93 | 94 | export const acceptedArgs = { |
94 | | - slug: { |
| 95 | + 'slug': { |
95 | 96 | description: 'Name of the npm package', |
96 | 97 | type: 'string', |
97 | 98 | }, |
98 | | - description: { |
| 99 | + 'description': { |
99 | 100 | description: 'Description of the npm package', |
100 | 101 | type: 'string', |
101 | 102 | }, |
102 | | - authorName: { |
| 103 | + 'author-name': { |
103 | 104 | description: 'Name of the package author', |
104 | 105 | type: 'string', |
105 | 106 | }, |
106 | | - authorEmail: { |
| 107 | + 'author-email': { |
107 | 108 | description: 'Email address of the package author', |
108 | 109 | type: 'string', |
109 | 110 | }, |
110 | | - authorUrl: { |
| 111 | + 'author-url': { |
111 | 112 | description: 'URL for the package author', |
112 | 113 | type: 'string', |
113 | 114 | }, |
114 | | - repoUrl: { |
| 115 | + 'repo-url': { |
115 | 116 | description: 'URL for the repository', |
116 | 117 | type: 'string', |
117 | 118 | }, |
118 | | - languages: { |
| 119 | + 'languages': { |
119 | 120 | description: 'Languages you want to use', |
120 | 121 | choices: LANGUAGE_CHOICES.map(({ value }) => value), |
121 | 122 | }, |
122 | | - type: { |
| 123 | + 'type': { |
123 | 124 | description: 'Type of library you want to develop', |
124 | 125 | choices: TYPE_CHOICES.map(({ value }) => value), |
125 | 126 | }, |
126 | | - reactNativeVersion: { |
127 | | - description: 'Version of React Native to use, uses latest if not specified', |
| 127 | + 'react-native-version': { |
| 128 | + description: 'Version of React Native to use', |
128 | 129 | type: 'string', |
| 130 | + default: SUPPORTED_REACT_NATIVE_VERSION, |
129 | 131 | }, |
130 | | - local: { |
| 132 | + 'local': { |
131 | 133 | description: 'Whether to create a local library', |
132 | 134 | type: 'boolean', |
133 | 135 | }, |
134 | | - example: { |
| 136 | + 'example': { |
135 | 137 | description: 'Type of the example app to create', |
136 | 138 | type: 'string', |
137 | 139 | choices: EXAMPLE_CHOICES.map(({ value }) => value), |
138 | 140 | }, |
139 | | - interactive: { |
| 141 | + 'interactive': { |
140 | 142 | description: 'Whether to run in interactive mode', |
141 | 143 | type: 'boolean', |
142 | 144 | }, |
143 | | -} as const satisfies Record< |
144 | | - Exclude<keyof Answers, 'name' | 'directory'>, |
145 | | - yargs.Options |
146 | | ->; |
| 145 | +} as const satisfies Record<string, yargs.Options>; |
147 | 146 |
|
148 | 147 | export type ExampleApp = 'none' | 'test-app' | 'expo' | 'vanilla'; |
149 | 148 |
|
|
0 commit comments