@nrwl/expo 13.7.0-beta.1

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 (217) hide show
  1. package/README.md +187 -0
  2. package/collection.json +0 -0
  3. package/executors.json +116 -0
  4. package/generators.json +61 -0
  5. package/index.d.ts +3 -0
  6. package/index.js +10 -0
  7. package/index.js.map +1 -0
  8. package/jest.config.js +12 -0
  9. package/package.json +50 -0
  10. package/plugins/jest/svg-mock.d.ts +0 -0
  11. package/plugins/jest/svg-mock.js +4 -0
  12. package/plugins/jest/svg-mock.js.map +1 -0
  13. package/plugins/metro-resolver.d.ts +1 -0
  14. package/plugins/metro-resolver.js +142 -0
  15. package/plugins/metro-resolver.js.map +1 -0
  16. package/plugins/with-nx-metro.d.ts +6 -0
  17. package/plugins/with-nx-metro.js +26 -0
  18. package/plugins/with-nx-metro.js.map +1 -0
  19. package/project.json +99 -0
  20. package/src/executors/build-android/build-android.impl.d.ts +6 -0
  21. package/src/executors/build-android/build-android.impl.js +66 -0
  22. package/src/executors/build-android/build-android.impl.js.map +1 -0
  23. package/src/executors/build-android/compat.d.ts +2 -0
  24. package/src/executors/build-android/compat.js +6 -0
  25. package/src/executors/build-android/compat.js.map +1 -0
  26. package/src/executors/build-android/schema.d.ts +13 -0
  27. package/src/executors/build-android/schema.json +54 -0
  28. package/src/executors/build-ios/build-ios.impl.d.ts +6 -0
  29. package/src/executors/build-ios/build-ios.impl.js +66 -0
  30. package/src/executors/build-ios/build-ios.impl.js.map +1 -0
  31. package/src/executors/build-ios/compat.d.ts +2 -0
  32. package/src/executors/build-ios/compat.js +6 -0
  33. package/src/executors/build-ios/compat.js.map +1 -0
  34. package/src/executors/build-ios/schema.d.ts +23 -0
  35. package/src/executors/build-ios/schema.json +91 -0
  36. package/src/executors/build-status/build-status.impl.d.ts +6 -0
  37. package/src/executors/build-status/build-status.impl.js +59 -0
  38. package/src/executors/build-status/build-status.impl.js.map +1 -0
  39. package/src/executors/build-status/compat.d.ts +2 -0
  40. package/src/executors/build-status/compat.js +6 -0
  41. package/src/executors/build-status/compat.js.map +1 -0
  42. package/src/executors/build-status/schema.d.ts +4 -0
  43. package/src/executors/build-status/schema.json +15 -0
  44. package/src/executors/build-web/build-web.impl.d.ts +6 -0
  45. package/src/executors/build-web/build-web.impl.js +59 -0
  46. package/src/executors/build-web/build-web.impl.js.map +1 -0
  47. package/src/executors/build-web/compat.d.ts +2 -0
  48. package/src/executors/build-web/compat.js +6 -0
  49. package/src/executors/build-web/compat.js.map +1 -0
  50. package/src/executors/build-web/schema.d.ts +6 -0
  51. package/src/executors/build-web/schema.json +24 -0
  52. package/src/executors/ensure-symlink/compat.d.ts +2 -0
  53. package/src/executors/ensure-symlink/compat.js +6 -0
  54. package/src/executors/ensure-symlink/compat.js.map +1 -0
  55. package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +5 -0
  56. package/src/executors/ensure-symlink/ensure-symlink.impl.js +13 -0
  57. package/src/executors/ensure-symlink/ensure-symlink.impl.js.map +1 -0
  58. package/src/executors/ensure-symlink/schema.json +9 -0
  59. package/src/executors/publish/compat.d.ts +2 -0
  60. package/src/executors/publish/compat.js +6 -0
  61. package/src/executors/publish/compat.js.map +1 -0
  62. package/src/executors/publish/publish.impl.d.ts +6 -0
  63. package/src/executors/publish/publish.impl.js +72 -0
  64. package/src/executors/publish/publish.impl.js.map +1 -0
  65. package/src/executors/publish/schema.d.ts +10 -0
  66. package/src/executors/publish/schema.json +42 -0
  67. package/src/executors/publish-set/compat.d.ts +2 -0
  68. package/src/executors/publish-set/compat.js +6 -0
  69. package/src/executors/publish-set/compat.js.map +1 -0
  70. package/src/executors/publish-set/publish-set.impl.d.ts +6 -0
  71. package/src/executors/publish-set/publish-set.impl.js +61 -0
  72. package/src/executors/publish-set/publish-set.impl.js.map +1 -0
  73. package/src/executors/publish-set/schema.d.ts +6 -0
  74. package/src/executors/publish-set/schema.json +19 -0
  75. package/src/executors/rollback/compat.d.ts +2 -0
  76. package/src/executors/rollback/compat.js +6 -0
  77. package/src/executors/rollback/compat.js.map +1 -0
  78. package/src/executors/rollback/rollback.impl.d.ts +6 -0
  79. package/src/executors/rollback/rollback.impl.js +61 -0
  80. package/src/executors/rollback/rollback.impl.js.map +1 -0
  81. package/src/executors/rollback/schema.d.ts +6 -0
  82. package/src/executors/rollback/schema.json +23 -0
  83. package/src/executors/run/compat.d.ts +2 -0
  84. package/src/executors/run/compat.js +6 -0
  85. package/src/executors/run/compat.js.map +1 -0
  86. package/src/executors/run/run.impl.d.ts +6 -0
  87. package/src/executors/run/run.impl.js +87 -0
  88. package/src/executors/run/run.impl.js.map +1 -0
  89. package/src/executors/run/schema.d.ts +11 -0
  90. package/src/executors/run/schema.json +51 -0
  91. package/src/executors/start/compat.d.ts +2 -0
  92. package/src/executors/start/compat.js +6 -0
  93. package/src/executors/start/compat.js.map +1 -0
  94. package/src/executors/start/schema.d.ts +22 -0
  95. package/src/executors/start/schema.json +85 -0
  96. package/src/executors/start/start.impl.d.ts +7 -0
  97. package/src/executors/start/start.impl.js +77 -0
  98. package/src/executors/start/start.impl.js.map +1 -0
  99. package/src/executors/sync-deps/compat.d.ts +2 -0
  100. package/src/executors/sync-deps/compat.js +6 -0
  101. package/src/executors/sync-deps/compat.js.map +1 -0
  102. package/src/executors/sync-deps/schema.d.ts +3 -0
  103. package/src/executors/sync-deps/schema.json +14 -0
  104. package/src/executors/sync-deps/sync-deps.impl.d.ts +8 -0
  105. package/src/executors/sync-deps/sync-deps.impl.js +58 -0
  106. package/src/executors/sync-deps/sync-deps.impl.js.map +1 -0
  107. package/src/generators/application/application.d.ts +5 -0
  108. package/src/generators/application/application.js +34 -0
  109. package/src/generators/application/application.js.map +1 -0
  110. package/src/generators/application/files/.babelrc.js.template +6 -0
  111. package/src/generators/application/files/app.json.template +32 -0
  112. package/src/generators/application/files/assets/adaptive-icon.png +0 -0
  113. package/src/generators/application/files/assets/favicon.png +0 -0
  114. package/src/generators/application/files/assets/icon.png +0 -0
  115. package/src/generators/application/files/assets/logo.png +0 -0
  116. package/src/generators/application/files/assets/splash.png +0 -0
  117. package/src/generators/application/files/assets/star.svg +11 -0
  118. package/src/generators/application/files/eas.js.template +1 -0
  119. package/src/generators/application/files/eas.json.template +18 -0
  120. package/src/generators/application/files/index.js.template +9 -0
  121. package/src/generators/application/files/metro.config.js.template +21 -0
  122. package/src/generators/application/files/package.json.template +25 -0
  123. package/src/generators/application/files/src/app/App.spec.tsx.template +9 -0
  124. package/src/generators/application/files/src/app/App.tsx.template +486 -0
  125. package/src/generators/application/files/src/app/icons/blog.svg +1 -0
  126. package/src/generators/application/files/src/app/icons/book.svg +1 -0
  127. package/src/generators/application/files/src/app/icons/checkmark.svg +1 -0
  128. package/src/generators/application/files/src/app/icons/chevron-right.svg +1 -0
  129. package/src/generators/application/files/src/app/icons/courses.svg +1 -0
  130. package/src/generators/application/files/src/app/icons/github.svg +1 -0
  131. package/src/generators/application/files/src/app/icons/heart.svg +1 -0
  132. package/src/generators/application/files/src/app/icons/logo.png +0 -0
  133. package/src/generators/application/files/src/app/icons/nx-cloud.svg +1 -0
  134. package/src/generators/application/files/src/app/icons/pointer.svg +1 -0
  135. package/src/generators/application/files/src/app/icons/terminal.svg +1 -0
  136. package/src/generators/application/files/src/app/icons/vscode.svg +1 -0
  137. package/src/generators/application/files/src/app/icons/youtube.svg +1 -0
  138. package/src/generators/application/files/test-setup.ts.template +1 -0
  139. package/src/generators/application/files/tsconfig.app.json.template +9 -0
  140. package/src/generators/application/files/tsconfig.json.template +25 -0
  141. package/src/generators/application/lib/add-detox.d.ts +3 -0
  142. package/src/generators/application/lib/add-detox.js +16 -0
  143. package/src/generators/application/lib/add-detox.js.map +1 -0
  144. package/src/generators/application/lib/add-project.d.ts +3 -0
  145. package/src/generators/application/lib/add-project.js +92 -0
  146. package/src/generators/application/lib/add-project.js.map +1 -0
  147. package/src/generators/application/lib/create-application-files.d.ts +3 -0
  148. package/src/generators/application/lib/create-application-files.js +24 -0
  149. package/src/generators/application/lib/create-application-files.js.map +1 -0
  150. package/src/generators/application/lib/normalize-options.d.ts +9 -0
  151. package/src/generators/application/lib/normalize-options.js +28 -0
  152. package/src/generators/application/lib/normalize-options.js.map +1 -0
  153. package/src/generators/application/schema.d.ts +17 -0
  154. package/src/generators/application/schema.json +76 -0
  155. package/src/generators/component/component.d.ts +5 -0
  156. package/src/generators/component/component.js +51 -0
  157. package/src/generators/component/component.js.map +1 -0
  158. package/src/generators/component/files/__fileName__.spec.tsx.template +11 -0
  159. package/src/generators/component/files/__fileName__.tsx.template +32 -0
  160. package/src/generators/component/lib/add-import.d.ts +3 -0
  161. package/src/generators/component/lib/add-import.js +30 -0
  162. package/src/generators/component/lib/add-import.js.map +1 -0
  163. package/src/generators/component/lib/normalize-options.d.ts +8 -0
  164. package/src/generators/component/lib/normalize-options.js +58 -0
  165. package/src/generators/component/lib/normalize-options.js.map +1 -0
  166. package/src/generators/component/schema.d.ts +15 -0
  167. package/src/generators/component/schema.json +82 -0
  168. package/src/generators/init/init.d.ts +6 -0
  169. package/src/generators/init/init.js +70 -0
  170. package/src/generators/init/init.js.map +1 -0
  171. package/src/generators/init/lib/add-git-ignore-entry.d.ts +2 -0
  172. package/src/generators/init/lib/add-git-ignore-entry.js +19 -0
  173. package/src/generators/init/lib/add-git-ignore-entry.js.map +1 -0
  174. package/src/generators/init/lib/gitignore-entries.d.ts +1 -0
  175. package/src/generators/init/lib/gitignore-entries.js +18 -0
  176. package/src/generators/init/lib/gitignore-entries.js.map +1 -0
  177. package/src/generators/init/lib/init-root-babel-config.d.ts +2 -0
  178. package/src/generators/init/lib/init-root-babel-config.js +14 -0
  179. package/src/generators/init/lib/init-root-babel-config.js.map +1 -0
  180. package/src/generators/init/schema.d.ts +5 -0
  181. package/src/generators/init/schema.json +27 -0
  182. package/src/generators/library/files/lib/README.md +7 -0
  183. package/src/generators/library/files/lib/package.json.template +5 -0
  184. package/src/generators/library/files/lib/src/index.ts.template +0 -0
  185. package/src/generators/library/files/lib/test-setup.ts.template +1 -0
  186. package/src/generators/library/files/lib/tsconfig.json.template +16 -0
  187. package/src/generators/library/files/lib/tsconfig.lib.json.template +9 -0
  188. package/src/generators/library/lib/normalize-options.d.ts +12 -0
  189. package/src/generators/library/lib/normalize-options.js +27 -0
  190. package/src/generators/library/lib/normalize-options.js.map +1 -0
  191. package/src/generators/library/library.d.ts +5 -0
  192. package/src/generators/library/library.js +114 -0
  193. package/src/generators/library/library.js.map +1 -0
  194. package/src/generators/library/schema.d.ts +22 -0
  195. package/src/generators/library/schema.json +97 -0
  196. package/src/utils/add-jest.d.ts +2 -0
  197. package/src/utils/add-jest.js +44 -0
  198. package/src/utils/add-jest.js.map +1 -0
  199. package/src/utils/add-linting.d.ts +3 -0
  200. package/src/utils/add-linting.js +42 -0
  201. package/src/utils/add-linting.js.map +1 -0
  202. package/src/utils/ensure-node-modules-symlink.d.ts +9 -0
  203. package/src/utils/ensure-node-modules-symlink.js +29 -0
  204. package/src/utils/ensure-node-modules-symlink.js.map +1 -0
  205. package/src/utils/find-all-npm-dependencies.d.ts +2 -0
  206. package/src/utils/find-all-npm-dependencies.js +26 -0
  207. package/src/utils/find-all-npm-dependencies.js.map +1 -0
  208. package/src/utils/symlink-task.d.ts +2 -0
  209. package/src/utils/symlink-task.js +19 -0
  210. package/src/utils/symlink-task.js.map +1 -0
  211. package/src/utils/versions.d.ts +21 -0
  212. package/src/utils/versions.js +25 -0
  213. package/src/utils/versions.js.map +1 -0
  214. package/tsconfig.json +13 -0
  215. package/tsconfig.lib.json +11 -0
  216. package/tsconfig.spec.json +19 -0
  217. package/typings/svg.d.ts +6 -0
package/README.md ADDED
@@ -0,0 +1,187 @@
1
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-react.png" width="600" alt="Nx - Smart, Extensible Build Framework"></p>
2
+
3
+ <div style="text-align: center;">
4
+
5
+ [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
6
+ [![License](https://img.shields.io/npm/l/@nrwl/workspace.svg?style=flat-square)]()
7
+ [![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nrwl/workspace)
8
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
9
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10
+ [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
11
+ [![Join us @nrwl/community on slack](https://img.shields.io/badge/slack-%40nrwl%2Fcommunity-brightgreen)](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc)
12
+
13
+ </div>
14
+
15
+
16
+ <hr>
17
+
18
+ # Expo Plugin for Nx
19
+
20
+ ## What is Nx?
21
+
22
+ 🔎 **Smart, Fast and Extensible Build System**
23
+
24
+ Nx is a smart, fast and extensible build system. It comes with first class monorepo support and powerful integrations.
25
+
26
+ ### Best-in-Class Support for Monorepos
27
+
28
+ <strong>Nx</strong> provides distributed graph-based task execution and computation caching.
29
+
30
+ <strong>Nx</strong> is smart. It analyzes your workspace and figures out what can be affected by every code change.
31
+ That's why Nx doesn't rebuild and retest everything on every commit--<strong>it only rebuilds what is necessary</strong>
32
+ .
33
+
34
+ <strong>Nx</strong> partitions commands into a graph of smaller tasks. Nx then runs those tasks in parallel,
35
+ and <strong>it can even distribute them across multiple machines without any configuration</strong>.
36
+
37
+ <strong>Nx also uses a distributed computation cache.</strong> If someone has already built or tested similar code, Nx
38
+ will use their results to speed up the command for everyone else.
39
+
40
+ ### Holistic Dev Experience Powered by an Advanced CLI and Editor Plugins
41
+
42
+ <strong>Nx</strong> helps scale your development from one team building one application to many teams building multiple
43
+ frontend and backend applications all in the same workspace. <strong >When using Nx, developers have a holistic dev
44
+ experience powered by an advanced CLI</strong > (with editor plugins), capabilities for controlled code sharing and
45
+ consistent code generation.
46
+
47
+ ### Rich Plugin Ecosystem
48
+
49
+ <strong>Nx</strong> is an open platform with plugins for many modern tools and frameworks. It has support for
50
+ TypeScript, React, Angular, Cypress, Jest, Prettier, Nest.js, Next.js, Storybook, Ionic among others. With Nx, you get a
51
+ consistent dev experience regardless of the tools used.
52
+
53
+
54
+ ## Getting Started
55
+
56
+ ### Creating an Nx Workspace
57
+
58
+ **Using `npx`**
59
+
60
+ ```bash
61
+ npx create-nx-workspace
62
+ ```
63
+
64
+ **Using `npm init`**
65
+
66
+ ```bash
67
+ npm init nx-workspace
68
+ ```
69
+
70
+ **Using `yarn create`**
71
+
72
+ ```bash
73
+ yarn create nx-workspace
74
+ ```
75
+
76
+ The `create-nx-workspace` command will ask you to select a preset, which will configure some plugins and create your applications to help you get started.
77
+
78
+ ```
79
+ ? What to create in the new workspace (Use arrow keys)
80
+ ❯ empty [an empty workspace with a layout that works best for building apps]
81
+ npm [an empty workspace set up to publish npm packages (similar to and compatible with yarn workspaces)]
82
+ react [a workspace with a single React application]
83
+ angular [a workspace with a single Angular application]
84
+ next.js [a workspace with a single Next.js application]
85
+ gatsby [a workspace with a single Gatsby application]
86
+ nest [a workspace with a single Nest application]
87
+ express [a workspace with a single Express application]
88
+ web components [a workspace with a single app built using web components]
89
+ react-express [a workspace with a full stack application (React + Express)]
90
+ angular-nest [a workspace with a full stack application (Angular + Nest)]
91
+ ```
92
+
93
+ Select the preset that works best for you.
94
+
95
+
96
+ ```
97
+ ? Workspace name (e.g., org name) happyorg
98
+ ? What to create in the new workspace expo [a workspace with a single expo application]
99
+ ? Application name myapp
100
+ ```
101
+
102
+ If it's your first Nx project, the command will recommend you to install the `nx` package globally, so you can invoke `nx` directly without going through yarn or npm.
103
+
104
+ ### Serving Application
105
+
106
+ - Run `nx start myapp` to start a local dev server for the app.
107
+ - Run `nx run myapp --platform=ios` to run the iOS app binary locally.
108
+ - Run `nx run myapp --platform=android` to run the Android app binary locally.
109
+ - Run `nx test myapp` to test it.
110
+ - Run `nx test-ios myapp-e2e` to run e2e tests for it on iOS.
111
+ - Run `nx test-android myapp-e2e` to run e2e tests for it on Android.
112
+ - Run `nx ensure-symlink myapp` to ensure workspace node_modules is symlink under app's node_modules folder.
113
+ - Run `nx sync-deps myapp` to update package.json with project dependencies. For example: `nx sync-deps myapp --include=react-native-gesture-handler,react-native-safe-area-context`
114
+ - Run `nx build-ios myapp` to build and sign a standalone IPA for the Apple App Store.
115
+ - Run `nx build-android myapp` to build and sign a standalone APK or App Bundle for the Google Play Store.
116
+ - Run `nx build-status myapp` to get the status of the latest build for the project.
117
+
118
+ ### Adding Expo Plugin Into an Existing Workspace
119
+
120
+ You can always add the Expo plugin to an existing workspace by installing `@nrwl/expo` and then generating an Expo application, as follows: `nx g @nrwl/expo:app myapp`.
121
+
122
+ ## Quick Start Videos
123
+
124
+ <a href="https://www.youtube.com/watch?v=E188J7E_MDU" target="_blank">
125
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-react-video.png" width="350" alt="Nx - Quick start video"></p>
126
+ </a>
127
+
128
+ ## Documentation & Resources
129
+
130
+ Even though Nx isn't technology specific, we provide 3 separate flavours of the documentation site to it make it easier for you to get up and running. For every link below, you will be able to select whether you want your examples to be written in React, Node or Angular.
131
+
132
+ - [Nx Documentation and Guides](https://nx.dev)
133
+ - [Intro into Nx](https://nx.dev/getting-started/intro)
134
+ - [Interactive Tutorial with Videos](https://nx.dev/tutorial/01-create-application)
135
+
136
+ ### Quick Start Videos
137
+
138
+ - [Scale Your React Development with Nx](https://www.youtube.com/watch?v=sNz-4PUM0k8)
139
+ - [Scale your Node Development with Nx](https://www.youtube.com/watch?v=iIh5h_G52kI)
140
+ - [Modern Angular with Nx Dev Tools](https://www.youtube.com/watch?v=cXOkmOy-8dk)
141
+
142
+ ### Courses
143
+
144
+ <table>
145
+ <tr>
146
+ <td><strong>Scale React Development with Nx</strong></td>
147
+ <td><strong>Nx Workspaces</strong></td>
148
+ <td><strong>Advanced Nx Workspaces</strong></td>
149
+ </tr>
150
+ <tr>
151
+ <td>
152
+ <a href="https://egghead.io/playlists/scale-react-development-with-nx-4038" target="_blank">
153
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/EGH_ScalingReactNx.png" height="150px" alt="Nx - Scale React Development with Nx video course"></p>
154
+ </a>
155
+ </td>
156
+ <td>
157
+ <a href="https://www.youtube.com/watch?v=2mYLe9Kp9VM&list=PLakNactNC1dH38AfqmwabvOszDmKriGco" target="_blank">
158
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-workspace-course.png" width="350" alt="Nx Workspaces video course"></p>
159
+ </a>
160
+ </td>
161
+ <td>
162
+ <a href="https://nxplaybook.com/p/advanced-nx-workspaces" target="_blank">
163
+ <p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/advanced-nx-workspace-course.png" width="350" alt="Nx Advanced Workspaces video course"></p>
164
+ </a>
165
+ </td>
166
+ </tr>
167
+ </table>
168
+
169
+ ### Videos, Blogs, Books, Examples
170
+
171
+ - [Nx Dev Tools for Monorepos, In-Depth Explainer (React)](https://www.youtube.com/watch?v=jCf92IyR-GE)
172
+
173
+ - [Nx Dev Tools for Monorepos, In-Depth Explainer (Angular)](https://youtu.be/h5FIGDn5YM0)
174
+
175
+ - [Youtube Channel with Nx-Related Videos](https://www.youtube.com/playlist?list=PLakNactNC1dHHWx4JIORwfnEajRv6FG5m)
176
+
177
+ - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
178
+
179
+ - [Angular Enterprise Monorepo Patterns Book (free)](https://go.nrwl.io/angular-enterprise-monorepo-patterns-new-book?utm_campaign=Book%3A%20Monorepo%20Patterns%2C%20Jan%202019&utm_source=Github&utm_medium=Banner%20Ad)
180
+
181
+ - [Nx Examples Repo](https://github.com/nrwl/nx-examples)
182
+
183
+ # Engage with the Core Team and the Community
184
+
185
+ - [The Nx Show Playlist on YouTube](https://www.youtube.com/playlist?list=PLakNactNC1dE8KLQ5zd3fQwu_yQHjTmR5). It's a regular YouTube stream where we talk all things Nx. Join the stream, ask questions, etc.
186
+ - [Follow Nx on Twitter](https://twitter.com/NxDevTools)
187
+
File without changes
package/executors.json ADDED
@@ -0,0 +1,116 @@
1
+ {
2
+ "executors": {
3
+ "build-ios": {
4
+ "implementation": "./src/executors/build-ios/build-ios.impl",
5
+ "schema": "./src/executors/build-ios/schema.json",
6
+ "description": "Build and sign a standalone IPA for the Apple App Store"
7
+ },
8
+ "build-android": {
9
+ "implementation": "./src/executors/build-android/build-android.impl",
10
+ "schema": "./src/executors/build-android/schema.json",
11
+ "description": "Build and sign a standalone APK or App Bundle for the Google Play Store"
12
+ },
13
+ "build-web": {
14
+ "implementation": "./src/executors/build-web/build-web.impl",
15
+ "schema": "./src/executors/build-web/schema.json",
16
+ "description": "Build the web app for production"
17
+ },
18
+ "build-status": {
19
+ "implementation": "./src/executors/build-status/build-status.impl",
20
+ "schema": "./src/executors/build-status/schema.json",
21
+ "description": "Get the status of the latest build for the project"
22
+ },
23
+ "publish": {
24
+ "implementation": "./src/executors/publish/publish.impl",
25
+ "schema": "./src/executors/publish/schema.json",
26
+ "description": "Deploy a project to Expo hosting"
27
+ },
28
+ "publish-set": {
29
+ "implementation": "./src/executors/publish-set/publish-set.impl",
30
+ "schema": "./src/executors/publish-set/schema.json",
31
+ "description": "Specify the channel to serve a published release"
32
+ },
33
+ "rollback": {
34
+ "implementation": "./src/executors/rollback/rollback.impl",
35
+ "schema": "./src/executors/rollback/schema.json",
36
+ "description": "Undo an update to a channel"
37
+ },
38
+ "run": {
39
+ "implementation": "./src/executors/run/run.impl",
40
+ "schema": "./src/executors/run/schema.json",
41
+ "description": "Run the Android app binary locally or run the iOS app binary locally"
42
+ },
43
+ "start": {
44
+ "implementation": "./src/executors/start/start.impl",
45
+ "schema": "./src/executors/start/schema.json",
46
+ "description": "Start a local dev server for the app or start a Webpack dev server for the web app"
47
+ },
48
+ "sync-deps": {
49
+ "implementation": "./src/executors/sync-deps/sync-deps.impl",
50
+ "schema": "./src/executors/sync-deps/schema.json",
51
+ "description": "Syncs dependencies to package.json (required for autolinking)."
52
+ },
53
+ "ensure-symlink": {
54
+ "implementation": "./src/executors/ensure-symlink/ensure-symlink.impl",
55
+ "schema": "./src/executors/ensure-symlink//schema.json",
56
+ "description": "Ensure workspace node_modules is symlink under app's node_modules folder."
57
+ }
58
+ },
59
+ "builders": {
60
+ "build-ios": {
61
+ "implementation": "./src/executors/build-ios/compat",
62
+ "schema": "./src/executors/build-ios/schema.json",
63
+ "description": "Build and sign a standalone IPA for the Apple App Store"
64
+ },
65
+ "build-android": {
66
+ "implementation": "./src/executors/build-android/compat",
67
+ "schema": "./src/executors/build-android/schema.json",
68
+ "description": "Build and sign a standalone APK or App Bundle for the Google Play Store"
69
+ },
70
+ "build-web": {
71
+ "implementation": "./src/executors/build-web/compat",
72
+ "schema": "./src/executors/build-web/schema.json",
73
+ "description": "Build the web app for production"
74
+ },
75
+ "build-status": {
76
+ "implementation": "./src/executors/build-status/compat",
77
+ "schema": "./src/executors/build-status/schema.json",
78
+ "description": "Get the status of the latest build for the project"
79
+ },
80
+ "publish": {
81
+ "implementation": "./src/executors/publish/compat",
82
+ "schema": "./src/executors/publish/schema.json",
83
+ "description": "Deploy a project to Expo hosting"
84
+ },
85
+ "publish-set": {
86
+ "implementation": "./src/executors/publish-set/compact",
87
+ "schema": "./src/executors/publish-set/schema.json",
88
+ "description": "Specify the channel to serve a published release"
89
+ },
90
+ "rollback": {
91
+ "implementation": "./src/executors/rollback/compact",
92
+ "schema": "./src/executors/rollback/schema.json",
93
+ "description": "Undo an update to a channel"
94
+ },
95
+ "run": {
96
+ "implementation": "./src/executors/run/compat",
97
+ "schema": "./src/executors/run/schema.json",
98
+ "description": "Run the Android app binary locally or run the iOS app binary locally"
99
+ },
100
+ "start": {
101
+ "implementation": "./src/executors/start/compat",
102
+ "schema": "./src/executors/start/schema.json",
103
+ "description": "Start a local dev server for the app or start a Webpack dev server for the web app"
104
+ },
105
+ "sync-deps": {
106
+ "implementation": "./src/executors/sync-deps/compat",
107
+ "schema": "./src/executors/sync-deps/schema.json",
108
+ "description": "Syncs dependencies to package.json (required for autolinking)."
109
+ },
110
+ "ensure-symlink": {
111
+ "implementation": "./src/executors/ensure-symlink/compat",
112
+ "schema": "./src/executors/ensure-symlink//schema.json",
113
+ "description": "Ensure workspace node_modules is symlink under app's node_modules folder."
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "Nx Expo",
3
+ "version": "0.1",
4
+ "extends": ["@nrwl/workspace"],
5
+ "schematics": {
6
+ "init": {
7
+ "factory": "./src/generators/init/init#expoInitSchematic",
8
+ "schema": "./src/generators/init/schema.json",
9
+ "description": "Initialize the @nrwl/expo plugin",
10
+ "hidden": true
11
+ },
12
+ "application": {
13
+ "factory": "./src/generators/application/application#expoApplicationSchematic",
14
+ "schema": "./src/generators/application/schema.json",
15
+ "aliases": ["app"],
16
+ "x-type": "application",
17
+ "description": "Create an application"
18
+ },
19
+ "library": {
20
+ "factory": "./src/generators/library/library#expoLibrarySchematic",
21
+ "schema": "./src/generators/library/schema.json",
22
+ "aliases": ["lib"],
23
+ "x-type": "library",
24
+ "description": "Create a library"
25
+ },
26
+ "component": {
27
+ "factory": "./src/generators/component/component#expoComponentSchematic",
28
+ "schema": "./src/generators/component/schema.json",
29
+ "description": "Create a component",
30
+ "aliases": ["c"]
31
+ }
32
+ },
33
+ "generators": {
34
+ "init": {
35
+ "factory": "./src/generators/init/init#expoInitGenerator",
36
+ "schema": "./src/generators/init/schema.json",
37
+ "description": "Initialize the @nrwl/expo plugin",
38
+ "hidden": true
39
+ },
40
+ "application": {
41
+ "factory": "./src/generators/application/application#expoApplicationGenerator",
42
+ "schema": "./src/generators/application/schema.json",
43
+ "aliases": ["app"],
44
+ "x-type": "application",
45
+ "description": "Create an application"
46
+ },
47
+ "library": {
48
+ "factory": "./src/generators/library/library#expoLibraryGenerator",
49
+ "schema": "./src/generators/library/schema.json",
50
+ "aliases": ["lib"],
51
+ "x-type": "library",
52
+ "description": "Create a library"
53
+ },
54
+ "component": {
55
+ "factory": "./src/generators/component/component#expoComponentGenerator",
56
+ "schema": "./src/generators/component/schema.json",
57
+ "description": "Create a component",
58
+ "aliases": ["c"]
59
+ }
60
+ }
61
+ }
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { expoInitGenerator } from './src/generators/init/init';
2
+ export { expoApplicationGenerator } from './src/generators/application/application';
3
+ export { withNxMetro } from './plugins/with-nx-metro';
package/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withNxMetro = exports.expoApplicationGenerator = exports.expoInitGenerator = void 0;
4
+ var init_1 = require("./src/generators/init/init");
5
+ Object.defineProperty(exports, "expoInitGenerator", { enumerable: true, get: function () { return init_1.expoInitGenerator; } });
6
+ var application_1 = require("./src/generators/application/application");
7
+ Object.defineProperty(exports, "expoApplicationGenerator", { enumerable: true, get: function () { return application_1.expoApplicationGenerator; } });
8
+ var with_nx_metro_1 = require("./plugins/with-nx-metro");
9
+ Object.defineProperty(exports, "withNxMetro", { enumerable: true, get: function () { return with_nx_metro_1.withNxMetro; } });
10
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/expo/index.ts"],"names":[],"mappings":";;;AAAA,mDAA+D;AAAtD,yGAAA,iBAAiB,OAAA;AAC1B,wEAAoF;AAA3E,uHAAA,wBAAwB,OAAA;AACjC,yDAAsD;AAA7C,4GAAA,WAAW,OAAA"}
package/jest.config.js ADDED
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ preset: '../../jest.preset.js',
3
+ transform: {
4
+ '^.+\\.[tj]sx?$': 'ts-jest',
5
+ },
6
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'],
7
+ globals: {
8
+ 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' },
9
+ },
10
+ displayName: 'expo',
11
+ testEnvironment: 'node',
12
+ };
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@nrwl/expo",
3
+ "version": "13.7.0-beta.1",
4
+ "description": "Expo Plugin for Nx",
5
+ "keywords": [
6
+ "Monorepo",
7
+ "Expo",
8
+ "React",
9
+ "Web",
10
+ "Jest",
11
+ "Native",
12
+ "CLI"
13
+ ],
14
+ "homepage": "https://nx.dev",
15
+ "bugs": {
16
+ "url": "https://github.com/nrwl/nx/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/nrwl/nx.git",
21
+ "directory": "packages/expo"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Victor Savkin",
25
+ "main": "index.js",
26
+ "types": "index.d.ts",
27
+ "dependencies": {
28
+ "@nrwl/detox": "*",
29
+ "@nrwl/devkit": "*",
30
+ "@nrwl/jest": "*",
31
+ "@nrwl/linter": "*",
32
+ "@nrwl/react": "*",
33
+ "@nrwl/workspace": "*",
34
+ "chalk": "4.1.0",
35
+ "enhanced-resolve": "^5.8.3",
36
+ "expo-cli": "^5.0.3",
37
+ "metro-resolver": "^0.66.2",
38
+ "tsconfig-paths": "^3.9.0"
39
+ },
40
+ "peerDependencies": {
41
+ "expo": "^44.0.5"
42
+ },
43
+ "builders": "./executors.json",
44
+ "ng-update": {
45
+ "requirements": {},
46
+ "migrations": "./migrations.json"
47
+ },
48
+ "schematics": "./generators.json",
49
+ "typings": "./index.d.ts"
50
+ }
File without changes
@@ -0,0 +1,4 @@
1
+ // From https://github.com/kristerkari/react-native-svg-transformer#usage-with-jest
2
+ module.exports = 'SvgMock';
3
+ module.exports.ReactComponent = 'SvgMock';
4
+ //# sourceMappingURL=svg-mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svg-mock.js","sourceRoot":"","sources":["../../../../../packages/expo/plugins/jest/svg-mock.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;AAC3B,MAAM,CAAC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function getResolveRequest(extensions: string[]): (_context: any, realModuleName: string, platform: string | null, moduleName: string) => any;
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getResolveRequest = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const metroResolver = require("metro-resolver");
6
+ const tsconfig_paths_1 = require("tsconfig-paths");
7
+ const chalk = require("chalk");
8
+ const devkit_1 = require("@nrwl/devkit");
9
+ const enhanced_resolve_1 = require("enhanced-resolve");
10
+ const path_1 = require("path");
11
+ const fs = require("fs");
12
+ const app_root_1 = require("@nrwl/tao/src/utils/app-root");
13
+ /*
14
+ * Use tsconfig to resolve additional workspace libs.
15
+ *
16
+ * This resolve function requires projectRoot to be set to
17
+ * workspace root in order modules and assets to be registered and watched.
18
+ */
19
+ function getResolveRequest(extensions) {
20
+ return function (_context, realModuleName, platform, moduleName) {
21
+ const DEBUG = process.env.NX_REACT_NATIVE_DEBUG === 'true';
22
+ if (DEBUG)
23
+ console.log(chalk.cyan(`[Nx] Resolving: ${moduleName}`));
24
+ const { resolveRequest } = _context, context = (0, tslib_1.__rest)(_context, ["resolveRequest"]);
25
+ let resolvedPath = defaultMetroResolver(context, moduleName, platform);
26
+ if (resolvedPath) {
27
+ return resolvedPath;
28
+ }
29
+ if ((0, devkit_1.detectPackageManager)(app_root_1.appRootPath) === 'pnpm') {
30
+ resolvedPath = pnpmResolver(extensions, context, realModuleName, moduleName);
31
+ if (resolvedPath) {
32
+ return resolvedPath;
33
+ }
34
+ }
35
+ return tsconfigPathsResolver(extensions, realModuleName, moduleName);
36
+ };
37
+ }
38
+ exports.getResolveRequest = getResolveRequest;
39
+ /**
40
+ * This function try to resolve path using metro's default resolver
41
+ * @returns path if resolved, else undefined
42
+ */
43
+ function defaultMetroResolver(context, moduleName, platform) {
44
+ const DEBUG = process.env.NX_REACT_NATIVE_DEBUG === 'true';
45
+ try {
46
+ return metroResolver.resolve(context, moduleName, platform);
47
+ }
48
+ catch (_a) {
49
+ if (DEBUG)
50
+ console.log(chalk.cyan(`[Nx] Unable to resolve with default Metro resolver: ${moduleName}`));
51
+ }
52
+ }
53
+ /**
54
+ * This resolver try to resolve module for pnpm.
55
+ * @returns path if resolved, else undefined
56
+ * This pnpm resolver is inspired from https://github.com/vjpr/pnpm-react-native-example/blob/main/packages/pnpm-expo-helper/util/make-resolver.js
57
+ */
58
+ function pnpmResolver(extensions, context, realModuleName, moduleName) {
59
+ const DEBUG = process.env.NX_REACT_NATIVE_DEBUG === 'true';
60
+ try {
61
+ const pnpmResolver = getPnpmResolver(app_root_1.appRootPath, extensions);
62
+ const lookupStartPath = (0, path_1.dirname)(context.originModulePath);
63
+ const filePath = pnpmResolver.resolveSync({}, lookupStartPath, realModuleName);
64
+ if (filePath) {
65
+ return { type: 'sourceFile', filePath };
66
+ }
67
+ }
68
+ catch (_a) {
69
+ if (DEBUG)
70
+ console.log(chalk.cyan(`[Nx] Unable to resolve with default PNPM resolver: ${moduleName}`));
71
+ }
72
+ }
73
+ /**
74
+ * This function try to resolve files that are specified in tsconfig's paths
75
+ * @returns path if resolved, else undefined
76
+ */
77
+ function tsconfigPathsResolver(extensions, realModuleName, moduleName) {
78
+ const DEBUG = process.env.NX_REACT_NATIVE_DEBUG === 'true';
79
+ const matcher = getMatcher();
80
+ let match;
81
+ // find out the file extension
82
+ const matchExtension = extensions.find((extension) => {
83
+ match = matcher(realModuleName, undefined, undefined, ['.' + extension]);
84
+ return !!match;
85
+ });
86
+ if (match) {
87
+ return {
88
+ type: 'sourceFile',
89
+ filePath: !matchExtension || match.endsWith(`.${matchExtension}`)
90
+ ? match
91
+ : `${match}.${matchExtension}`,
92
+ };
93
+ }
94
+ else {
95
+ if (DEBUG) {
96
+ console.log(chalk.red(`[Nx] Failed to resolve ${chalk.bold(moduleName)}`));
97
+ console.log(chalk.cyan(`[Nx] The following tsconfig paths was used:\n:${chalk.bold(JSON.stringify(paths, null, 2))}`));
98
+ }
99
+ throw new Error(`Cannot resolve ${chalk.bold(moduleName)}`);
100
+ }
101
+ }
102
+ let matcher;
103
+ let absoluteBaseUrl;
104
+ let paths;
105
+ function getMatcher() {
106
+ const DEBUG = process.env.NX_REACT_NATIVE_DEBUG === 'true';
107
+ if (!matcher) {
108
+ const result = (0, tsconfig_paths_1.loadConfig)();
109
+ if (result.resultType === 'success') {
110
+ absoluteBaseUrl = result.absoluteBaseUrl;
111
+ paths = result.paths;
112
+ if (DEBUG) {
113
+ console.log(chalk.cyan(`[Nx] Located tsconfig at ${chalk.bold(absoluteBaseUrl)}`));
114
+ console.log(chalk.cyan(`[Nx] Found the following paths:\n:${chalk.bold(JSON.stringify(paths, null, 2))}`));
115
+ }
116
+ matcher = (0, tsconfig_paths_1.createMatchPath)(absoluteBaseUrl, paths);
117
+ }
118
+ else {
119
+ console.log(chalk.cyan(`[Nx] Failed to locate tsconfig}`));
120
+ throw new Error(`Could not load tsconfig for project`);
121
+ }
122
+ }
123
+ return matcher;
124
+ }
125
+ /**
126
+ * This function returns resolver for pnpm.
127
+ * It is inspired form https://github.com/vjpr/pnpm-expo-example/blob/main/packages/pnpm-expo-helper/util/make-resolver.js.
128
+ */
129
+ let resolver;
130
+ function getPnpmResolver(appRootPath, extensions) {
131
+ if (!resolver) {
132
+ const fileSystem = new enhanced_resolve_1.CachedInputFileSystem(fs, 4000);
133
+ resolver = enhanced_resolve_1.ResolverFactory.createResolver({
134
+ fileSystem,
135
+ extensions: extensions.map((extension) => '.' + extension),
136
+ useSyncFileSystemCalls: true,
137
+ modules: [(0, path_1.join)(appRootPath, 'node_modules'), 'node_modules'],
138
+ });
139
+ }
140
+ return resolver;
141
+ }
142
+ //# sourceMappingURL=metro-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metro-resolver.js","sourceRoot":"","sources":["../../../../packages/expo/plugins/metro-resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAEhD,mDAA6D;AAC7D,+BAA+B;AAC/B,yCAAoD;AACpD,uDAA0E;AAC1E,+BAAqC;AACrC,yBAAyB;AACzB,2DAA2D;AAE3D;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,UAAoB;IACpD,OAAO,UACL,QAAa,EACb,cAAsB,EACtB,QAAuB,EACvB,UAAkB;QAElB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM,CAAC;QAE3D,IAAI,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAC,CAAC;QAEpE,MAAM,EAAE,cAAc,KAAiB,QAAQ,EAApB,OAAO,uBAAK,QAAQ,EAAzC,kBAA8B,CAAW,CAAC;QAEhD,IAAI,YAAY,GAAG,oBAAoB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QACvE,IAAI,YAAY,EAAE;YAChB,OAAO,YAAY,CAAC;SACrB;QAED,IAAI,IAAA,6BAAoB,EAAC,sBAAW,CAAC,KAAK,MAAM,EAAE;YAChD,YAAY,GAAG,YAAY,CACzB,UAAU,EACV,OAAO,EACP,cAAc,EACd,UAAU,CACX,CAAC;YACF,IAAI,YAAY,EAAE;gBAChB,OAAO,YAAY,CAAC;aACrB;SACF;QAED,OAAO,qBAAqB,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC,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{
2
+ debug?: boolean;
3
+ extensions?: string[];
4
+ }
5
+ export declare function withNxMetro(config: any, opts?: WithNxOptions): any;
6
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withNxMetro = void 0;
4
+ const file_utils_1 = require("@nrwl/workspace/src/core/file-utils");
5
+ const app_root_1 = require("@nrwl/workspace/src/utils/app-root");
6
+ const path_1 = require("path");
7
+ const metro_resolver_1 = require("./metro-resolver");
8
+ function withNxMetro(config, opts = {}) {
9
+ const extensions = ['', 'ts', 'tsx', 'js', 'jsx', 'json'];
10
+ if (opts.debug)
11
+ process.env.NX_REACT_NATIVE_DEBUG = 'true';
12
+ if (opts.extensions)
13
+ extensions.push(...opts.extensions);
14
+ // Set the root to workspace root so we can resolve modules and assets
15
+ config.projectRoot = app_root_1.appRootPath;
16
+ const watchFolders = config.watchFolders || [];
17
+ config.watchFolders = watchFolders.concat([
18
+ (0, path_1.join)(app_root_1.appRootPath, 'node_modules'),
19
+ (0, path_1.join)(app_root_1.appRootPath, (0, file_utils_1.workspaceLayout)().libsDir),
20
+ ]);
21
+ // Add support for paths specified by tsconfig
22
+ config.resolver = Object.assign(Object.assign({}, config.resolver), { resolveRequest: (0, metro_resolver_1.getResolveRequest)(extensions) });
23
+ return config;
24
+ }
25
+ exports.withNxMetro = withNxMetro;
26
+ //# sourceMappingURL=with-nx-metro.js.map