create-expo 2.1.4 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +83 -8
  2. package/build/index.js +29 -11
  3. package/package.json +8 -7
package/README.md CHANGED
@@ -32,17 +32,92 @@
32
32
  <!-- Body -->
33
33
 
34
34
  ```sh
35
- # With NPM
35
+ # Usage for bun, npm, pnpm, and yarn
36
36
  npx create-expo
37
-
38
- # With Yarn
39
- yarn create expo
40
-
41
- # With pnpm
37
+ bun create expo
42
38
  pnpm create expo
39
+ yarn create expo
43
40
 
44
- # With Bun
45
- bunx create-expo
41
+ # Output help information with all available options
42
+ npx create-expo --help
46
43
  ```
47
44
 
48
45
  Once you're up and running with Create Expo App, visit [this tutorial](https://docs.expo.dev/tutorial/planning/) for more information on building mobile apps with React.
46
+
47
+ ## Templates
48
+
49
+ Create Expo App prepares an empty Expo project by default. You can choose to use a project with more prepared functionality. For that, you can start Create Expo App with the `--template` flag.
50
+
51
+ ```sh
52
+ # Pick from Expo's templates
53
+ npx create-expo --template
54
+
55
+ # Pick the expo-template-tabs template
56
+ npx create-expo --template tabs
57
+ ```
58
+
59
+ ### npm templates
60
+
61
+ Expo publishes all [templates](../../templates/) through npm packages, versioned by Expo SDK. You can create your own npm templates with `npm pack`, or by publishing to npm.
62
+
63
+ ```sh
64
+ # Create from npm
65
+ npx create-expo --template tabs # Short for expo-template-tabs
66
+ npx create-expo --template expo-template-tabs
67
+
68
+ # Create from npm using a semver of the template
69
+ npx create-expo --template expo-template-blank@50
70
+
71
+ # Create from local tarball created with `npm pack`
72
+ npx create-expo --template ./path/to/template.tgz
73
+ ```
74
+
75
+ #### Private npm registry
76
+
77
+ Create Expo App does not support private registries. In order to use a private template, use the local tarball option.
78
+
79
+ ### GitHub templates
80
+
81
+ Besides the templates provided by Expo, you can also create your own or use a 3rd party template directly from GitHub. The `--template` flag supports GitHub URLs, including branch, tag, or even specific commit.
82
+
83
+ ```sh
84
+ # Create from repository
85
+ npx create-expo --template https://github.com/:owner/:repo
86
+
87
+ # Create from repository using the `:ref` branch or tag
88
+ npx create-expo --template https://github.com/:owner/:repo/tree/:ref
89
+
90
+ # Create from repository using the `sdk-50` branch, and "templates/expo-template-bare-minimum" subdirectory
91
+ npx create-expo --template https://github.com/expo/expo/tree/sdk-50/templates/expo-template-bare-minimum
92
+ ```
93
+
94
+ ## App name customization
95
+
96
+ Create Expo App customizes the name of the created app by replacing certain placeholder values in the template with the name specified by the user. Most users won't have to think about this process, but it may be relevant for users offering their own templates.
97
+
98
+ Renaming the app is a two-step process:
99
+
100
+ 1. while unpacking the template, the file and folder names are rewritten
101
+ 2. after unpacking the template, the file contents are rewritten
102
+
103
+ By convention, Expo templates use several placeholder values to be searched for and replaced:
104
+
105
+ - `Hello App Display Name` → The name of the project, without modifications (example [Android](../../templates/expo-template-bare-minimum/android/app/src/main/res/values/strings.xml#L2))
106
+ - `HelloWorld` → The name of the project with sanitization as described below (example [Android](../../templates/expo-template-bare-minimum//android/settings.gradle#L1), [iOS](../../templates/expo-template-bare-minimum/ios/Podfile#L16))
107
+ - `helloworld` → The _lower-cased_ name of the project with sanitization as described below (example [Android](../../templates/expo-template-bare-minimum/android/app/build.gradle#L86))
108
+
109
+ Although all file and folder names are rewritten, only files specified by the "rename config" have their contents rewritten. This is determined by the `defaultRenameConfig` constant in [./src/Template.ts](./src/Template.ts).
110
+
111
+ ### Sanitization
112
+
113
+ Some characters aren't allowed in certain places, that's why Create Expo App applies sanitization to the project name.
114
+
115
+ - Remove all non-word `\W` and underscore `_` characters.
116
+ - Normalize the string using Unicode's normalization form "canonical composition" or `NFD`.
117
+ - Remove all accent characters `u0300-u036f`.
118
+
119
+ ## Special files
120
+
121
+ Due to some limitations with `npm pack`, some files are handled differently.
122
+
123
+ - `gitignore` → Renamed to `.gitignore` due to `npm pack` skipping `.gitignore` files, see [npm/npm#1862](https://github.com/npm/npm/issues/1862)