@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.
- package/README.md +187 -0
- package/collection.json +0 -0
- package/executors.json +116 -0
- package/generators.json +61 -0
- package/index.d.ts +3 -0
- package/index.js +10 -0
- package/index.js.map +1 -0
- package/jest.config.js +12 -0
- package/package.json +50 -0
- package/plugins/jest/svg-mock.d.ts +0 -0
- package/plugins/jest/svg-mock.js +4 -0
- package/plugins/jest/svg-mock.js.map +1 -0
- package/plugins/metro-resolver.d.ts +1 -0
- package/plugins/metro-resolver.js +142 -0
- package/plugins/metro-resolver.js.map +1 -0
- package/plugins/with-nx-metro.d.ts +6 -0
- package/plugins/with-nx-metro.js +26 -0
- package/plugins/with-nx-metro.js.map +1 -0
- package/project.json +99 -0
- package/src/executors/build-android/build-android.impl.d.ts +6 -0
- package/src/executors/build-android/build-android.impl.js +66 -0
- package/src/executors/build-android/build-android.impl.js.map +1 -0
- package/src/executors/build-android/compat.d.ts +2 -0
- package/src/executors/build-android/compat.js +6 -0
- package/src/executors/build-android/compat.js.map +1 -0
- package/src/executors/build-android/schema.d.ts +13 -0
- package/src/executors/build-android/schema.json +54 -0
- package/src/executors/build-ios/build-ios.impl.d.ts +6 -0
- package/src/executors/build-ios/build-ios.impl.js +66 -0
- package/src/executors/build-ios/build-ios.impl.js.map +1 -0
- package/src/executors/build-ios/compat.d.ts +2 -0
- package/src/executors/build-ios/compat.js +6 -0
- package/src/executors/build-ios/compat.js.map +1 -0
- package/src/executors/build-ios/schema.d.ts +23 -0
- package/src/executors/build-ios/schema.json +91 -0
- package/src/executors/build-status/build-status.impl.d.ts +6 -0
- package/src/executors/build-status/build-status.impl.js +59 -0
- package/src/executors/build-status/build-status.impl.js.map +1 -0
- package/src/executors/build-status/compat.d.ts +2 -0
- package/src/executors/build-status/compat.js +6 -0
- package/src/executors/build-status/compat.js.map +1 -0
- package/src/executors/build-status/schema.d.ts +4 -0
- package/src/executors/build-status/schema.json +15 -0
- package/src/executors/build-web/build-web.impl.d.ts +6 -0
- package/src/executors/build-web/build-web.impl.js +59 -0
- package/src/executors/build-web/build-web.impl.js.map +1 -0
- package/src/executors/build-web/compat.d.ts +2 -0
- package/src/executors/build-web/compat.js +6 -0
- package/src/executors/build-web/compat.js.map +1 -0
- package/src/executors/build-web/schema.d.ts +6 -0
- package/src/executors/build-web/schema.json +24 -0
- package/src/executors/ensure-symlink/compat.d.ts +2 -0
- package/src/executors/ensure-symlink/compat.js +6 -0
- package/src/executors/ensure-symlink/compat.js.map +1 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +5 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +13 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.js.map +1 -0
- package/src/executors/ensure-symlink/schema.json +9 -0
- package/src/executors/publish/compat.d.ts +2 -0
- package/src/executors/publish/compat.js +6 -0
- package/src/executors/publish/compat.js.map +1 -0
- package/src/executors/publish/publish.impl.d.ts +6 -0
- package/src/executors/publish/publish.impl.js +72 -0
- package/src/executors/publish/publish.impl.js.map +1 -0
- package/src/executors/publish/schema.d.ts +10 -0
- package/src/executors/publish/schema.json +42 -0
- package/src/executors/publish-set/compat.d.ts +2 -0
- package/src/executors/publish-set/compat.js +6 -0
- package/src/executors/publish-set/compat.js.map +1 -0
- package/src/executors/publish-set/publish-set.impl.d.ts +6 -0
- package/src/executors/publish-set/publish-set.impl.js +61 -0
- package/src/executors/publish-set/publish-set.impl.js.map +1 -0
- package/src/executors/publish-set/schema.d.ts +6 -0
- package/src/executors/publish-set/schema.json +19 -0
- package/src/executors/rollback/compat.d.ts +2 -0
- package/src/executors/rollback/compat.js +6 -0
- package/src/executors/rollback/compat.js.map +1 -0
- package/src/executors/rollback/rollback.impl.d.ts +6 -0
- package/src/executors/rollback/rollback.impl.js +61 -0
- package/src/executors/rollback/rollback.impl.js.map +1 -0
- package/src/executors/rollback/schema.d.ts +6 -0
- package/src/executors/rollback/schema.json +23 -0
- package/src/executors/run/compat.d.ts +2 -0
- package/src/executors/run/compat.js +6 -0
- package/src/executors/run/compat.js.map +1 -0
- package/src/executors/run/run.impl.d.ts +6 -0
- package/src/executors/run/run.impl.js +87 -0
- package/src/executors/run/run.impl.js.map +1 -0
- package/src/executors/run/schema.d.ts +11 -0
- package/src/executors/run/schema.json +51 -0
- package/src/executors/start/compat.d.ts +2 -0
- package/src/executors/start/compat.js +6 -0
- package/src/executors/start/compat.js.map +1 -0
- package/src/executors/start/schema.d.ts +22 -0
- package/src/executors/start/schema.json +85 -0
- package/src/executors/start/start.impl.d.ts +7 -0
- package/src/executors/start/start.impl.js +77 -0
- package/src/executors/start/start.impl.js.map +1 -0
- package/src/executors/sync-deps/compat.d.ts +2 -0
- package/src/executors/sync-deps/compat.js +6 -0
- package/src/executors/sync-deps/compat.js.map +1 -0
- package/src/executors/sync-deps/schema.d.ts +3 -0
- package/src/executors/sync-deps/schema.json +14 -0
- package/src/executors/sync-deps/sync-deps.impl.d.ts +8 -0
- package/src/executors/sync-deps/sync-deps.impl.js +58 -0
- package/src/executors/sync-deps/sync-deps.impl.js.map +1 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +34 -0
- package/src/generators/application/application.js.map +1 -0
- package/src/generators/application/files/.babelrc.js.template +6 -0
- package/src/generators/application/files/app.json.template +32 -0
- package/src/generators/application/files/assets/adaptive-icon.png +0 -0
- package/src/generators/application/files/assets/favicon.png +0 -0
- package/src/generators/application/files/assets/icon.png +0 -0
- package/src/generators/application/files/assets/logo.png +0 -0
- package/src/generators/application/files/assets/splash.png +0 -0
- package/src/generators/application/files/assets/star.svg +11 -0
- package/src/generators/application/files/eas.js.template +1 -0
- package/src/generators/application/files/eas.json.template +18 -0
- package/src/generators/application/files/index.js.template +9 -0
- package/src/generators/application/files/metro.config.js.template +21 -0
- package/src/generators/application/files/package.json.template +25 -0
- package/src/generators/application/files/src/app/App.spec.tsx.template +9 -0
- package/src/generators/application/files/src/app/App.tsx.template +486 -0
- package/src/generators/application/files/src/app/icons/blog.svg +1 -0
- package/src/generators/application/files/src/app/icons/book.svg +1 -0
- package/src/generators/application/files/src/app/icons/checkmark.svg +1 -0
- package/src/generators/application/files/src/app/icons/chevron-right.svg +1 -0
- package/src/generators/application/files/src/app/icons/courses.svg +1 -0
- package/src/generators/application/files/src/app/icons/github.svg +1 -0
- package/src/generators/application/files/src/app/icons/heart.svg +1 -0
- package/src/generators/application/files/src/app/icons/logo.png +0 -0
- package/src/generators/application/files/src/app/icons/nx-cloud.svg +1 -0
- package/src/generators/application/files/src/app/icons/pointer.svg +1 -0
- package/src/generators/application/files/src/app/icons/terminal.svg +1 -0
- package/src/generators/application/files/src/app/icons/vscode.svg +1 -0
- package/src/generators/application/files/src/app/icons/youtube.svg +1 -0
- package/src/generators/application/files/test-setup.ts.template +1 -0
- package/src/generators/application/files/tsconfig.app.json.template +9 -0
- package/src/generators/application/files/tsconfig.json.template +25 -0
- package/src/generators/application/lib/add-detox.d.ts +3 -0
- package/src/generators/application/lib/add-detox.js +16 -0
- package/src/generators/application/lib/add-detox.js.map +1 -0
- package/src/generators/application/lib/add-project.d.ts +3 -0
- package/src/generators/application/lib/add-project.js +92 -0
- package/src/generators/application/lib/add-project.js.map +1 -0
- package/src/generators/application/lib/create-application-files.d.ts +3 -0
- package/src/generators/application/lib/create-application-files.js +24 -0
- package/src/generators/application/lib/create-application-files.js.map +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +9 -0
- package/src/generators/application/lib/normalize-options.js +28 -0
- package/src/generators/application/lib/normalize-options.js.map +1 -0
- package/src/generators/application/schema.d.ts +17 -0
- package/src/generators/application/schema.json +76 -0
- package/src/generators/component/component.d.ts +5 -0
- package/src/generators/component/component.js +51 -0
- package/src/generators/component/component.js.map +1 -0
- package/src/generators/component/files/__fileName__.spec.tsx.template +11 -0
- package/src/generators/component/files/__fileName__.tsx.template +32 -0
- package/src/generators/component/lib/add-import.d.ts +3 -0
- package/src/generators/component/lib/add-import.js +30 -0
- package/src/generators/component/lib/add-import.js.map +1 -0
- package/src/generators/component/lib/normalize-options.d.ts +8 -0
- package/src/generators/component/lib/normalize-options.js +58 -0
- package/src/generators/component/lib/normalize-options.js.map +1 -0
- package/src/generators/component/schema.d.ts +15 -0
- package/src/generators/component/schema.json +82 -0
- package/src/generators/init/init.d.ts +6 -0
- package/src/generators/init/init.js +70 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/lib/add-git-ignore-entry.d.ts +2 -0
- package/src/generators/init/lib/add-git-ignore-entry.js +19 -0
- package/src/generators/init/lib/add-git-ignore-entry.js.map +1 -0
- package/src/generators/init/lib/gitignore-entries.d.ts +1 -0
- package/src/generators/init/lib/gitignore-entries.js +18 -0
- package/src/generators/init/lib/gitignore-entries.js.map +1 -0
- package/src/generators/init/lib/init-root-babel-config.d.ts +2 -0
- package/src/generators/init/lib/init-root-babel-config.js +14 -0
- package/src/generators/init/lib/init-root-babel-config.js.map +1 -0
- package/src/generators/init/schema.d.ts +5 -0
- package/src/generators/init/schema.json +27 -0
- package/src/generators/library/files/lib/README.md +7 -0
- package/src/generators/library/files/lib/package.json.template +5 -0
- package/src/generators/library/files/lib/src/index.ts.template +0 -0
- package/src/generators/library/files/lib/test-setup.ts.template +1 -0
- package/src/generators/library/files/lib/tsconfig.json.template +16 -0
- package/src/generators/library/files/lib/tsconfig.lib.json.template +9 -0
- package/src/generators/library/lib/normalize-options.d.ts +12 -0
- package/src/generators/library/lib/normalize-options.js +27 -0
- package/src/generators/library/lib/normalize-options.js.map +1 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +114 -0
- package/src/generators/library/library.js.map +1 -0
- package/src/generators/library/schema.d.ts +22 -0
- package/src/generators/library/schema.json +97 -0
- package/src/utils/add-jest.d.ts +2 -0
- package/src/utils/add-jest.js +44 -0
- package/src/utils/add-jest.js.map +1 -0
- package/src/utils/add-linting.d.ts +3 -0
- package/src/utils/add-linting.js +42 -0
- package/src/utils/add-linting.js.map +1 -0
- package/src/utils/ensure-node-modules-symlink.d.ts +9 -0
- package/src/utils/ensure-node-modules-symlink.js +29 -0
- package/src/utils/ensure-node-modules-symlink.js.map +1 -0
- package/src/utils/find-all-npm-dependencies.d.ts +2 -0
- package/src/utils/find-all-npm-dependencies.js +26 -0
- package/src/utils/find-all-npm-dependencies.js.map +1 -0
- package/src/utils/symlink-task.d.ts +2 -0
- package/src/utils/symlink-task.js +19 -0
- package/src/utils/symlink-task.js.map +1 -0
- package/src/utils/versions.d.ts +21 -0
- package/src/utils/versions.js +25 -0
- package/src/utils/versions.js.map +1 -0
- package/tsconfig.json +13 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.spec.json +19 -0
- 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
|
+
[](https://circleci.com/gh/nrwl/nx)
|
|
6
|
+
[]()
|
|
7
|
+
[](https://www.npmjs.com/@nrwl/workspace)
|
|
8
|
+
[]()
|
|
9
|
+
[](http://commitizen.github.io/cz-cli/)
|
|
10
|
+
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
11
|
+
[](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
|
+
|
package/collection.json
ADDED
|
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
|
+
}
|
package/generators.json
ADDED
|
@@ -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
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 @@
|
|
|
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,q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C;YAC3D,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SACxD;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,IAAI,QAAQ,CAAC;AACb,SAAS,eAAe,CAAC,WAAmB,EAAE,UAAoB;IAChE,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,UAAU,GAAG,IAAI,wCAAqB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACvD,QAAQ,GAAG,kCAAe,CAAC,cAAc,CAAC;YACxC,UAAU;YACV,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,GAAG,SAAS,CAAC;YAC1D,sBAAsB,EAAE,IAAI;YAC5B,OAAO,EAAE,CAAC,IAAA,WAAI,EAAC,WAAW,EAAE,cAAc,CAAC,EAAE,cAAc,CAAC;SAC7D,CAAC,CAAC;KACJ;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -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
|