@nx/expo 17.0.4 → 17.0.6
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/.eslintrc.json +0 -3
- package/LICENSE +1 -1
- package/README.md +4 -9
- package/collection.json +0 -0
- package/docs/start-examples.md +0 -6
- package/executors.json +0 -5
- package/generators.json +2 -2
- package/migrations.json +6 -114
- package/package.json +16 -12
- package/plugins/metro-resolver.js +1 -4
- package/plugins/with-nx-metro.js +2 -6
- package/plugins/with-nx-webpack.d.ts +1 -1
- package/plugins/with-nx-webpack.js +4 -8
- package/src/executors/build/build.impl.js +1 -2
- package/src/executors/build/schema.json +1 -1
- package/src/executors/build-list/build-list.impl.js +3 -2
- package/src/executors/build-list/schema.json +1 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +0 -4
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +0 -4
- package/src/executors/ensure-symlink/schema.json +1 -1
- package/src/executors/export/export.impl.d.ts +0 -1
- package/src/executors/export/export.impl.js +15 -25
- package/src/executors/export/schema.d.ts +2 -4
- package/src/executors/export/schema.json +13 -14
- package/src/executors/install/install.impl.js +2 -0
- package/src/executors/install/schema.json +1 -1
- package/src/executors/prebuild/prebuild.impl.js +5 -11
- package/src/executors/prebuild/schema.json +1 -2
- package/src/executors/run/schema.json +1 -1
- package/src/executors/start/schema.json +1 -1
- package/src/executors/start/start.impl.js +1 -7
- package/src/executors/submit/schema.json +1 -1
- package/src/executors/submit/submit.impl.js +1 -2
- package/src/executors/sync-deps/schema.d.ts +0 -1
- package/src/executors/sync-deps/schema.json +1 -6
- package/src/executors/sync-deps/sync-deps.impl.d.ts +3 -4
- package/src/executors/sync-deps/sync-deps.impl.js +11 -33
- package/src/executors/update/schema.json +1 -1
- package/src/executors/update/update.impl.js +4 -7
- package/src/generators/application/application.js +7 -27
- package/src/generators/application/files/app.json.template +0 -2
- package/src/generators/application/files/eas.json.template +3 -0
- package/src/generators/application/files/metro.config.js.template +5 -1
- package/src/generators/application/files/src/app/App.tsx.template +13 -50
- package/src/generators/application/lib/add-detox.d.ts +3 -0
- package/src/generators/application/lib/add-detox.js +24 -0
- package/src/generators/application/lib/add-project.js +22 -20
- package/src/generators/application/lib/create-application-files.js +2 -0
- package/src/generators/application/lib/normalize-options.d.ts +0 -6
- package/src/generators/application/lib/normalize-options.js +1 -33
- package/src/generators/application/schema.d.ts +1 -2
- package/src/generators/application/schema.json +4 -4
- package/src/generators/component/files/__fileName__.tsx.template +1 -1
- package/src/generators/component/schema.d.ts +3 -3
- package/src/generators/component/schema.json +4 -4
- package/src/generators/init/init.d.ts +2 -3
- package/src/generators/init/init.js +40 -44
- package/src/generators/init/schema.d.ts +3 -3
- package/src/generators/init/schema.json +16 -11
- package/src/generators/library/files/lib/babel.config.json +17 -0
- package/src/generators/library/lib/normalize-options.js +0 -5
- package/src/generators/library/library.js +38 -52
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +2 -2
- package/src/migrations/{update-18-0-0/change-outputDir-export-target.d.ts → update-16-1-4/add-detox-app-json.d.ts} +1 -1
- package/src/migrations/update-16-1-4/add-detox-app-json.js +29 -0
- package/src/migrations/update-16-6-0/update-metro-config.js +5 -1
- package/src/migrations/update-16-9-0/remove-types-react-native.js +9 -2
- package/src/migrations/update-16-9-0/update-eas-cli-version.js +2 -1
- package/src/utils/add-jest.d.ts +1 -1
- package/src/utils/add-jest.js +5 -15
- package/src/utils/add-linting.d.ts +0 -1
- package/src/utils/add-linting.js +1 -1
- package/src/utils/find-all-npm-dependencies.js +2 -4
- package/src/utils/symlink-task.d.ts +2 -0
- package/src/utils/symlink-task.js +18 -0
- package/src/utils/versions.d.ts +15 -14
- package/src/utils/versions.js +16 -15
- package/docs/export-examples.md +0 -112
- package/plugin.d.ts +0 -1
- package/plugin.js +0 -6
- package/plugins/plugin.d.ts +0 -14
- package/plugins/plugin.js +0 -150
- package/src/executors/serve/lib/is-packager-running.d.ts +0 -1
- package/src/executors/serve/lib/is-packager-running.js +0 -15
- package/src/executors/serve/schema.d.ts +0 -7
- package/src/executors/serve/schema.json +0 -35
- package/src/executors/serve/serve.impl.d.ts +0 -11
- package/src/executors/serve/serve.impl.js +0 -105
- package/src/generators/application/files/webpack.config.js.template +0 -57
- package/src/generators/application/lib/add-e2e.d.ts +0 -3
- package/src/generators/application/lib/add-e2e.js +0 -86
- package/src/generators/library/files/lib/.babelrc.js.template +0 -21
- package/src/migrations/update-18-0-0/change-outputDir-export-target.js +0 -25
- package/src/migrations/update-18-0-0/remove-block-list.d.ts +0 -6
- package/src/migrations/update-18-0-0/remove-block-list.js +0 -28
- package/src/migrations/update-18-0-0/remove-eas-cli.d.ts +0 -12
- package/src/migrations/update-18-0-0/remove-eas-cli.js +0 -18
- package/src/migrations/update-18-0-0/remove-symlink-target.d.ts +0 -6
- package/src/migrations/update-18-0-0/remove-symlink-target.js +0 -29
- package/src/utils/ensure-dependencies.d.ts +0 -2
- package/src/utils/ensure-dependencies.js +0 -24
- package/src/utils/has-expo-plugin.d.ts +0 -2
- package/src/utils/has-expo-plugin.js +0 -11
- package/src/utils/resolve-eas.d.ts +0 -1
- package/src/utils/resolve-eas.js +0 -36
- /package/src/generators/application/files/{.babelrc.js.template → babel.config.js.template} +0 -0
- /package/src/{utils → generators/init/lib}/init-root-babel-config.d.ts +0 -0
- /package/src/{utils → generators/init/lib}/init-root-babel-config.js +0 -0
package/.eslintrc.json
CHANGED
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
<p style="text-align: center;">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
|
|
4
|
-
<img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
|
|
5
|
-
</picture>
|
|
6
|
-
</p>
|
|
1
|
+
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
|
|
7
2
|
|
|
8
3
|
<div style="text-align: center;">
|
|
9
4
|
|
|
@@ -20,9 +15,9 @@
|
|
|
20
15
|
|
|
21
16
|
<hr>
|
|
22
17
|
|
|
23
|
-
# Nx: Smart
|
|
18
|
+
# Nx: Smart, Fast and Extensible Build System
|
|
24
19
|
|
|
25
|
-
Nx is a build system with
|
|
20
|
+
Nx is a next generation build system with first class monorepo support and powerful integrations.
|
|
26
21
|
|
|
27
22
|
This package is a [Expo plugin for Nx](https://nx.dev/expo/overview).
|
|
28
23
|
|
|
@@ -64,5 +59,5 @@ npx nx@latest init
|
|
|
64
59
|
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
|
|
65
60
|
|
|
66
61
|
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
|
67
|
-
width="100%" alt="Nx - Smart
|
|
62
|
+
width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
|
|
68
63
|
|
package/collection.json
ADDED
|
File without changes
|
package/docs/start-examples.md
CHANGED
|
@@ -39,8 +39,6 @@ Opens your app in Expo Go in a currently running iOS simulator on your computer:
|
|
|
39
39
|
}
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
or run command `nx start <your app name> --ios`.
|
|
43
|
-
|
|
44
42
|
Opens your app in Expo Go on a connected Android device
|
|
45
43
|
|
|
46
44
|
```json
|
|
@@ -53,8 +51,6 @@ Opens your app in Expo Go on a connected Android device
|
|
|
53
51
|
}
|
|
54
52
|
```
|
|
55
53
|
|
|
56
|
-
or run command `nx start <your app name> --android`.
|
|
57
|
-
|
|
58
54
|
Opens your app in a web browser:
|
|
59
55
|
|
|
60
56
|
```json
|
|
@@ -67,8 +63,6 @@ Opens your app in a web browser:
|
|
|
67
63
|
}
|
|
68
64
|
```
|
|
69
65
|
|
|
70
|
-
or run command `nx start <your app name> --web`.
|
|
71
|
-
|
|
72
66
|
{% /tab %}
|
|
73
67
|
{% tab label="Specify the host" %}
|
|
74
68
|
The `host` option allows you to specify the type of host to use. `lan` uses the local network; `tunnel` ues any network by tunnel through ngrok; `localhost` connects to the dev server over localhost.
|
package/executors.json
CHANGED
|
@@ -54,11 +54,6 @@
|
|
|
54
54
|
"implementation": "./src/executors/submit/submit.impl",
|
|
55
55
|
"schema": "./src/executors/submit/schema.json",
|
|
56
56
|
"description": "Submit app binary to App Store and/or Play Store"
|
|
57
|
-
},
|
|
58
|
-
"serve": {
|
|
59
|
-
"implementation": "./src/executors/serve/serve.impl",
|
|
60
|
-
"schema": "./src/executors/serve/schema.json",
|
|
61
|
-
"description": "Serve up the Expo web app locally"
|
|
62
57
|
}
|
|
63
58
|
}
|
|
64
59
|
}
|
package/generators.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"extends": ["@nx/workspace"],
|
|
5
5
|
"generators": {
|
|
6
6
|
"init": {
|
|
7
|
-
"factory": "./src/generators/init/init#
|
|
7
|
+
"factory": "./src/generators/init/init#expoInitGenerator",
|
|
8
8
|
"schema": "./src/generators/init/schema.json",
|
|
9
|
-
"description": "Initialize the @
|
|
9
|
+
"description": "Initialize the @nrwl/expo plugin",
|
|
10
10
|
"hidden": true
|
|
11
11
|
},
|
|
12
12
|
"application": {
|
package/migrations.json
CHANGED
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"description": "Update package.json eas build lifecycle scripts",
|
|
37
37
|
"implementation": "./src/migrations/update-16-1-4/update-eas-scripts"
|
|
38
38
|
},
|
|
39
|
+
"add-detox-app-json-16-1-4": {
|
|
40
|
+
"version": "16.1.4-beta.0",
|
|
41
|
+
"cli": "nx",
|
|
42
|
+
"description": "Add app.json for detox",
|
|
43
|
+
"factory": "./src/migrations/update-16-1-4/add-detox-app-json"
|
|
44
|
+
},
|
|
39
45
|
"update-16-6-0-add-dependsOn": {
|
|
40
46
|
"cli": "nx",
|
|
41
47
|
"version": "16.6.0-beta.0",
|
|
@@ -59,30 +65,6 @@
|
|
|
59
65
|
"version": "16.9.0-beta.1",
|
|
60
66
|
"description": "Update eas.json cli version",
|
|
61
67
|
"implementation": "./src/migrations/update-16-9-0/update-eas-cli-version"
|
|
62
|
-
},
|
|
63
|
-
"update-18-0-0-remove-block-list": {
|
|
64
|
-
"cli": "nx",
|
|
65
|
-
"version": "18.0.0-beta.0",
|
|
66
|
-
"description": "Remove blockList in metro.config.js",
|
|
67
|
-
"implementation": "./src/migrations/update-18-0-0/remove-block-list"
|
|
68
|
-
},
|
|
69
|
-
"update-18-0-0-remove-symlink-target": {
|
|
70
|
-
"cli": "nx",
|
|
71
|
-
"version": "18.0.0-beta.0",
|
|
72
|
-
"description": "Remove symlink target in project.json",
|
|
73
|
-
"implementation": "./src/migrations/update-18-0-0/remove-symlink-target"
|
|
74
|
-
},
|
|
75
|
-
"update-18-0-0-remove-eas-cli": {
|
|
76
|
-
"cli": "nx",
|
|
77
|
-
"version": "18.0.0-beta.0",
|
|
78
|
-
"description": "Remove eas-cli from package.json",
|
|
79
|
-
"implementation": "./src/migrations/update-18-0-0/remove-eas-cli"
|
|
80
|
-
},
|
|
81
|
-
"update-18-0-0-remove-offset-export-outputDir": {
|
|
82
|
-
"cli": "nx",
|
|
83
|
-
"version": "18.0.0-beta.0",
|
|
84
|
-
"description": "Remove the offset from the outputDir of the export target",
|
|
85
|
-
"implementation": "./src/migrations/update-18-0-0/change-outputDir-export-target"
|
|
86
68
|
}
|
|
87
69
|
},
|
|
88
70
|
"packageJsonUpdates": {
|
|
@@ -594,96 +576,6 @@
|
|
|
594
576
|
"alwaysAddToPackageJson": false
|
|
595
577
|
}
|
|
596
578
|
}
|
|
597
|
-
},
|
|
598
|
-
"17.1.0": {
|
|
599
|
-
"version": "17.1.0-beta.0",
|
|
600
|
-
"packages": {
|
|
601
|
-
"expo": {
|
|
602
|
-
"version": "49.0.16",
|
|
603
|
-
"alwaysAddToPackageJson": false
|
|
604
|
-
},
|
|
605
|
-
"@expo/cli": {
|
|
606
|
-
"version": "~0.10.13",
|
|
607
|
-
"alwaysAddToPackageJson": false
|
|
608
|
-
},
|
|
609
|
-
"react-native": {
|
|
610
|
-
"version": "0.72.6",
|
|
611
|
-
"alwaysAddToPackageJson": false
|
|
612
|
-
},
|
|
613
|
-
"react-native-web": {
|
|
614
|
-
"version": "~0.19.9",
|
|
615
|
-
"alwaysAddToPackageJson": false
|
|
616
|
-
},
|
|
617
|
-
"metro-resolver": {
|
|
618
|
-
"version": "0.76.8",
|
|
619
|
-
"alwaysAddToPackageJson": false
|
|
620
|
-
},
|
|
621
|
-
"metro": {
|
|
622
|
-
"version": "0.76.8",
|
|
623
|
-
"alwaysAddToPackageJson": false
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
},
|
|
627
|
-
"18.0.0": {
|
|
628
|
-
"version": "18.0.0-beta.0",
|
|
629
|
-
"packages": {
|
|
630
|
-
"expo": {
|
|
631
|
-
"version": "50.0.1",
|
|
632
|
-
"alwaysAddToPackageJson": false
|
|
633
|
-
},
|
|
634
|
-
"expo-splash-screen": {
|
|
635
|
-
"version": "~0.26.1",
|
|
636
|
-
"alwaysAddToPackageJson": false
|
|
637
|
-
},
|
|
638
|
-
"expo-status-bar": {
|
|
639
|
-
"version": "~1.11.1",
|
|
640
|
-
"alwaysAddToPackageJson": false
|
|
641
|
-
},
|
|
642
|
-
"@expo/cli": {
|
|
643
|
-
"version": "~0.16.5",
|
|
644
|
-
"alwaysAddToPackageJson": false
|
|
645
|
-
},
|
|
646
|
-
"babel-preset-expo": {
|
|
647
|
-
"version": "~10.0.0",
|
|
648
|
-
"alwaysAddToPackageJson": false
|
|
649
|
-
},
|
|
650
|
-
"@types/react": {
|
|
651
|
-
"version": "~18.2.45",
|
|
652
|
-
"alwaysAddToPackageJson": false
|
|
653
|
-
},
|
|
654
|
-
"react-native": {
|
|
655
|
-
"version": "~0.73.2",
|
|
656
|
-
"alwaysAddToPackageJson": false
|
|
657
|
-
},
|
|
658
|
-
"react-native-web": {
|
|
659
|
-
"version": "~0.19.9",
|
|
660
|
-
"alwaysAddToPackageJson": false
|
|
661
|
-
},
|
|
662
|
-
"@expo/metro-config": {
|
|
663
|
-
"version": "~0.17.3",
|
|
664
|
-
"alwaysAddToPackageJson": false
|
|
665
|
-
},
|
|
666
|
-
"@expo/metro-runtime": {
|
|
667
|
-
"version": "~3.1.1",
|
|
668
|
-
"addToPackageJson": "devDependencies"
|
|
669
|
-
},
|
|
670
|
-
"react-native-svg-transformer": {
|
|
671
|
-
"version": "1.2.0",
|
|
672
|
-
"alwaysAddToPackageJson": false
|
|
673
|
-
},
|
|
674
|
-
"react-native-svg": {
|
|
675
|
-
"version": "14.1.0",
|
|
676
|
-
"alwaysAddToPackageJson": false
|
|
677
|
-
},
|
|
678
|
-
"@testing-library/react-native": {
|
|
679
|
-
"version": "~12.4.2",
|
|
680
|
-
"alwaysAddToPackageJson": false
|
|
681
|
-
},
|
|
682
|
-
"jest-expo": {
|
|
683
|
-
"version": "~50.0.1",
|
|
684
|
-
"alwaysAddToPackageJson": false
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
579
|
}
|
|
688
580
|
}
|
|
689
581
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "v17.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,23 +26,27 @@
|
|
|
26
26
|
"main": "./index.js",
|
|
27
27
|
"types": "index.d.ts",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@nx/devkit": "17.0.4",
|
|
30
29
|
"chalk": "^4.1.0",
|
|
31
30
|
"enhanced-resolve": "^5.8.3",
|
|
32
31
|
"fs-extra": "^11.1.0",
|
|
33
|
-
"metro-config": "
|
|
34
|
-
"metro-resolver": "
|
|
35
|
-
"node-fetch": "^2.6.7",
|
|
32
|
+
"metro-config": "0.76.7",
|
|
33
|
+
"metro-resolver": "0.76.7",
|
|
36
34
|
"tslib": "^2.3.0",
|
|
37
35
|
"tsconfig-paths": "^4.1.2",
|
|
38
36
|
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
39
|
-
"@nx/
|
|
40
|
-
"@nx/
|
|
41
|
-
"@nx/
|
|
42
|
-
"@nx/
|
|
43
|
-
"@nx/
|
|
44
|
-
"@nx/
|
|
45
|
-
"@
|
|
37
|
+
"@nx/detox": "v17.0.6",
|
|
38
|
+
"@nx/devkit": "v17.0.6",
|
|
39
|
+
"@nx/jest": "v17.0.6",
|
|
40
|
+
"@nx/js": "v17.0.6",
|
|
41
|
+
"@nx/eslint": "v17.0.6",
|
|
42
|
+
"@nx/react": "v17.0.6",
|
|
43
|
+
"@nx/webpack": "v17.0.6",
|
|
44
|
+
"@nrwl/expo": "v17.0.6"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"expo": ">= 49.0.0",
|
|
48
|
+
"@expo/cli": ">= 0.10.0",
|
|
49
|
+
"eas-cli": ">= 3.15.0"
|
|
46
50
|
},
|
|
47
51
|
"executors": "./executors.json",
|
|
48
52
|
"ng-update": {
|
|
@@ -27,9 +27,6 @@ function getResolveRequest(extensions) {
|
|
|
27
27
|
if (resolvedPath) {
|
|
28
28
|
return resolvedPath;
|
|
29
29
|
}
|
|
30
|
-
if (debug) {
|
|
31
|
-
console.log(chalk.red(`[Nx] Unable to resolve with any resolver: ${realModuleName}`));
|
|
32
|
-
}
|
|
33
30
|
throw new Error(`Cannot resolve ${chalk.bold(realModuleName)}`);
|
|
34
31
|
};
|
|
35
32
|
}
|
|
@@ -87,7 +84,7 @@ function tsconfigPathsResolver(context, extensions, realModuleName, platform, de
|
|
|
87
84
|
}
|
|
88
85
|
catch {
|
|
89
86
|
if (debug) {
|
|
90
|
-
console.log(chalk.
|
|
87
|
+
console.log(chalk.red(`[Nx] Failed to resolve ${chalk.bold(realModuleName)}`));
|
|
91
88
|
console.log(chalk.cyan(`[Nx] The following tsconfig paths was used:\n:${chalk.bold(JSON.stringify(paths, null, 2))}`));
|
|
92
89
|
}
|
|
93
90
|
}
|
package/plugins/with-nx-metro.js
CHANGED
|
@@ -11,18 +11,14 @@ async function withNxMetro(userConfig, opts = {}) {
|
|
|
11
11
|
process.env.NX_REACT_NATIVE_DEBUG = 'true';
|
|
12
12
|
if (opts.extensions)
|
|
13
13
|
extensions.push(...opts.extensions);
|
|
14
|
-
let watchFolders =
|
|
15
|
-
.filter((fileName) => !['dist', 'e2e'].includes(fileName) && !fileName.startsWith('.'))
|
|
16
|
-
.map((fileName) => (0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, fileName))
|
|
17
|
-
.filter((filePath) => (0, fs_extra_1.statSync)(filePath).isDirectory());
|
|
14
|
+
let watchFolders = [devkit_1.workspaceRoot];
|
|
18
15
|
if (opts.watchFolders?.length) {
|
|
19
16
|
watchFolders = watchFolders.concat(opts.watchFolders);
|
|
20
17
|
}
|
|
21
|
-
watchFolders =
|
|
18
|
+
watchFolders = watchFolders.filter((folder) => (0, fs_extra_1.existsSync)(folder));
|
|
22
19
|
const nxConfig = {
|
|
23
20
|
resolver: {
|
|
24
21
|
resolveRequest: (0, metro_resolver_1.getResolveRequest)(extensions),
|
|
25
|
-
nodeModulesPaths: [(0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, 'node_modules')],
|
|
26
22
|
},
|
|
27
23
|
watchFolders,
|
|
28
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @deprecated TODO(
|
|
2
|
+
* @deprecated TODO(v17) use bundler: 'metro' instead, will be removed in 16.0.0
|
|
3
3
|
* This function add additional rules to expo's webpack config to make expo web working
|
|
4
4
|
*/
|
|
5
5
|
export declare function withNxWebpack(config: any): Promise<any>;
|
|
@@ -4,12 +4,12 @@ exports.withNxWebpack = void 0;
|
|
|
4
4
|
const tsconfig_paths_webpack_plugin_1 = require("tsconfig-paths-webpack-plugin");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
/**
|
|
7
|
-
* @deprecated TODO(
|
|
7
|
+
* @deprecated TODO(v17) use bundler: 'metro' instead, will be removed in 16.0.0
|
|
8
8
|
* This function add additional rules to expo's webpack config to make expo web working
|
|
9
9
|
*/
|
|
10
10
|
async function withNxWebpack(config) {
|
|
11
11
|
// add additional rule to load files under libs
|
|
12
|
-
const rules = config.module.rules
|
|
12
|
+
const rules = config.module.rules[1]?.oneOf;
|
|
13
13
|
if (rules) {
|
|
14
14
|
rules.push({
|
|
15
15
|
test: /\.(mjs|[jt]sx?)$/,
|
|
@@ -36,16 +36,12 @@ async function withNxWebpack(config) {
|
|
|
36
36
|
config.resolve.plugins = [];
|
|
37
37
|
}
|
|
38
38
|
const extensions = ['.ts', '.tsx', '.mjs', '.js', '.jsx'];
|
|
39
|
-
const tsConfigPath = (0, path_1.resolve)(
|
|
39
|
+
const tsConfigPath = (0, path_1.resolve)('tsconfig.json');
|
|
40
40
|
config.resolve.plugins.push(new tsconfig_paths_webpack_plugin_1.TsconfigPathsPlugin({
|
|
41
41
|
configFile: tsConfigPath,
|
|
42
42
|
extensions,
|
|
43
43
|
}));
|
|
44
|
-
config.resolve.
|
|
45
|
-
...config.resolve.fallback,
|
|
46
|
-
crypto: require.resolve('crypto-browserify'),
|
|
47
|
-
stream: require.resolve('stream-browserify'),
|
|
48
|
-
};
|
|
44
|
+
config.resolve.symlinks = true;
|
|
49
45
|
return config;
|
|
50
46
|
}
|
|
51
47
|
exports.withNxWebpack = withNxWebpack;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const devkit_1 = require("@nx/devkit");
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
-
const resolve_eas_1 = require("../../utils/resolve-eas");
|
|
7
6
|
let childProcess;
|
|
8
7
|
async function* buildExecutor(options, context) {
|
|
9
8
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
@@ -20,7 +19,7 @@ async function* buildExecutor(options, context) {
|
|
|
20
19
|
exports.default = buildExecutor;
|
|
21
20
|
function runCliBuild(workspaceRoot, projectRoot, options) {
|
|
22
21
|
return new Promise((resolve, reject) => {
|
|
23
|
-
childProcess = (0, child_process_1.fork)(
|
|
22
|
+
childProcess = (0, child_process_1.fork)(require.resolve('eas-cli/bin/run'), ['build', ...createBuildOptions(options)], {
|
|
24
23
|
cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
|
|
25
24
|
env: process.env,
|
|
26
25
|
});
|
|
@@ -4,10 +4,11 @@ exports.runCliBuildList = void 0;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
|
-
const
|
|
7
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
8
8
|
let childProcess;
|
|
9
9
|
async function* buildListExecutor(options, context) {
|
|
10
10
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
11
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
11
12
|
try {
|
|
12
13
|
if (options.json) {
|
|
13
14
|
// when json is true, interactive has to be false
|
|
@@ -25,7 +26,7 @@ async function* buildListExecutor(options, context) {
|
|
|
25
26
|
exports.default = buildListExecutor;
|
|
26
27
|
function runCliBuildList(workspaceRoot, projectRoot, options) {
|
|
27
28
|
return new Promise((resolve, reject) => {
|
|
28
|
-
childProcess = (0, child_process_1.fork)(
|
|
29
|
+
childProcess = (0, child_process_1.fork)(require.resolve('eas-cli/bin/run'), ['build:list', ...createBuildListOptions(options)], {
|
|
29
30
|
cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
|
|
30
31
|
env: process.env,
|
|
31
32
|
stdio: ['inherit', 'pipe', 'inherit', 'ipc'], // only stream stdout on child process
|
|
@@ -2,8 +2,4 @@ import { ExecutorContext } from '@nx/devkit';
|
|
|
2
2
|
export interface ExpoEnsureSymlinkOutput {
|
|
3
3
|
success: boolean;
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
6
|
-
* TODO (@xiongemi): remove this function in v19.
|
|
7
|
-
* @deprecated It is no longer needed for react native 73.
|
|
8
|
-
*/
|
|
9
5
|
export default function ensureSymlinkExecutor(_: any, context: ExecutorContext): AsyncGenerator<ExpoEnsureSymlinkOutput>;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
4
|
-
/**
|
|
5
|
-
* TODO (@xiongemi): remove this function in v19.
|
|
6
|
-
* @deprecated It is no longer needed for react native 73.
|
|
7
|
-
*/
|
|
8
4
|
async function* ensureSymlinkExecutor(_, context) {
|
|
9
5
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
10
6
|
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"outputCapture": "direct-nodejs",
|
|
4
4
|
"cli": "nx",
|
|
5
5
|
"$id": "NxExpoEnsureSymlink",
|
|
6
|
-
"$schema": "
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
7
|
"title": "Ensure Symlink for Expo",
|
|
8
8
|
"description": "Ensure workspace node_modules is symlink under app's node_modules folder.",
|
|
9
9
|
"type": "object",
|
|
@@ -4,4 +4,3 @@ export interface ExpoExportOutput {
|
|
|
4
4
|
success: boolean;
|
|
5
5
|
}
|
|
6
6
|
export default function exportExecutor(options: ExportExecutorSchema, context: ExecutorContext): AsyncGenerator<ExpoExportOutput>;
|
|
7
|
-
export declare function createExportOptions(options: ExportExecutorSchema, projectRoot: string): any[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createExportOptions = void 0;
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const child_process_1 = require("child_process");
|
|
6
5
|
const path_1 = require("path");
|
|
@@ -22,7 +21,11 @@ async function* exportExecutor(options, context) {
|
|
|
22
21
|
exports.default = exportExecutor;
|
|
23
22
|
function exportAsync(workspaceRoot, projectRoot, options) {
|
|
24
23
|
return new Promise((resolve, reject) => {
|
|
25
|
-
childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), [
|
|
24
|
+
childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), [
|
|
25
|
+
`export${options.bundler === 'webpack' ? ':web' : ''}`,
|
|
26
|
+
'.',
|
|
27
|
+
...createExportOptions(options),
|
|
28
|
+
], { cwd: (0, path_1.resolve)(workspaceRoot, projectRoot), env: process.env });
|
|
26
29
|
// Ensure the child process is killed when the parent exits
|
|
27
30
|
process.on('exit', () => childProcess.kill());
|
|
28
31
|
process.on('SIGTERM', () => childProcess.kill());
|
|
@@ -39,35 +42,22 @@ function exportAsync(workspaceRoot, projectRoot, options) {
|
|
|
39
42
|
});
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
|
-
const nxOptions = ['bundler'
|
|
45
|
+
const nxOptions = ['bundler'];
|
|
43
46
|
// options from https://github.com/expo/expo/blob/main/packages/@expo/cli/src/export/index.ts
|
|
44
|
-
function createExportOptions(options
|
|
47
|
+
function createExportOptions(options) {
|
|
45
48
|
return Object.keys(options).reduce((acc, k) => {
|
|
46
49
|
if (!nxOptions.includes(k)) {
|
|
47
50
|
const v = options[k];
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
acc.push(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
default:
|
|
59
|
-
if (typeof v === 'boolean') {
|
|
60
|
-
if (v === true) {
|
|
61
|
-
// when true, does not need to pass the value true, just need to pass the flag in kebob case
|
|
62
|
-
acc.push(`--${(0, devkit_1.names)(k).fileName}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
acc.push(`--${(0, devkit_1.names)(k).fileName}`, v);
|
|
67
|
-
}
|
|
51
|
+
if (typeof v === 'boolean') {
|
|
52
|
+
if (v === true) {
|
|
53
|
+
// when true, does not need to pass the value true, just need to pass the flag in kebob case
|
|
54
|
+
acc.push(`--${(0, devkit_1.names)(k).fileName}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
acc.push(`--${(0, devkit_1.names)(k).fileName}`, v);
|
|
68
59
|
}
|
|
69
60
|
}
|
|
70
61
|
return acc;
|
|
71
62
|
}, []);
|
|
72
63
|
}
|
|
73
|
-
exports.createExportOptions = createExportOptions;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
// options form https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/export/resolveOptions.ts
|
|
2
|
-
// https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/export/index.ts
|
|
3
|
-
|
|
4
2
|
export interface ExportExecutorSchema {
|
|
5
3
|
platform?: 'ios' | 'android' | 'all' | 'web'; // default is 'all'
|
|
6
4
|
outputDir?: string;
|
|
7
5
|
clear?: boolean;
|
|
8
6
|
dev?: boolean;
|
|
9
|
-
minify?: boolean;
|
|
10
7
|
maxWorkers?: number;
|
|
11
8
|
dumpAssetmap?: boolean;
|
|
12
|
-
|
|
9
|
+
dumpSourcemap?: boolean;
|
|
10
|
+
bundler: 'metro' | 'webpack';
|
|
13
11
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": 2,
|
|
4
4
|
"outputCapture": "direct-nodejs",
|
|
5
5
|
"$id": "NxExpoExport",
|
|
6
|
-
"$schema": "
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
7
|
"title": "Expo Export",
|
|
8
8
|
"description": "Export the JavaScript and assets for your app using Metro/webpack bundler.",
|
|
9
9
|
"type": "object",
|
|
@@ -11,39 +11,38 @@
|
|
|
11
11
|
"platform": {
|
|
12
12
|
"description": "Choose the platform to compile for",
|
|
13
13
|
"enum": ["ios", "android", "all", "web"],
|
|
14
|
-
"default": "all",
|
|
15
14
|
"alias": "p",
|
|
16
15
|
"x-priority": "important"
|
|
17
16
|
},
|
|
18
17
|
"dev": {
|
|
19
18
|
"type": "boolean",
|
|
20
|
-
"description": "Configure static files for developing locally using a non-https server"
|
|
19
|
+
"description": "Bundle for development environments without minifying code or stripping the __DEV__ boolean. Configure static files for developing locally using a non-https server."
|
|
21
20
|
},
|
|
22
21
|
"clear": {
|
|
23
22
|
"type": "boolean",
|
|
24
23
|
"description": "Clear the bundler cache before exporting"
|
|
25
24
|
},
|
|
26
|
-
"minify": {
|
|
27
|
-
"type": "boolean",
|
|
28
|
-
"description": "Minify source"
|
|
29
|
-
},
|
|
30
25
|
"outputDir": {
|
|
31
26
|
"type": "string",
|
|
32
|
-
"description": "
|
|
27
|
+
"description": "The directory to export the static files to. Default: dist"
|
|
33
28
|
},
|
|
34
29
|
"maxWorkers": {
|
|
35
30
|
"type": "number",
|
|
36
|
-
"description": "
|
|
31
|
+
"description": "Maximum number of tasks to allow Metro to spawn"
|
|
37
32
|
},
|
|
38
33
|
"dumpAssetmap": {
|
|
39
34
|
"type": "boolean",
|
|
40
|
-
"description": "
|
|
35
|
+
"description": "Dump the asset map for further processing"
|
|
41
36
|
},
|
|
42
|
-
"
|
|
37
|
+
"dumpSourcemap": {
|
|
43
38
|
"type": "boolean",
|
|
44
|
-
"description": "
|
|
39
|
+
"description": "Dump the source map for debugging the JS bundle"
|
|
40
|
+
},
|
|
41
|
+
"bundler": {
|
|
42
|
+
"enum": ["metro", "webpack"],
|
|
43
|
+
"description": "Choose the bundler to compile for",
|
|
44
|
+
"default": "metro"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
"required": [
|
|
48
|
-
"examplesFile": "../../../docs/export-examples.md"
|
|
47
|
+
"required": []
|
|
49
48
|
}
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.installAsync = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
6
7
|
let childProcess;
|
|
7
8
|
async function* installExecutor(options, context) {
|
|
8
9
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
9
10
|
try {
|
|
10
11
|
await installAsync(context.root, options);
|
|
12
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
11
13
|
yield {
|
|
12
14
|
success: true,
|
|
13
15
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": 2,
|
|
4
4
|
"outputCapture": "direct-nodejs",
|
|
5
5
|
"$id": "NxExpoInstall",
|
|
6
|
-
"$schema": "
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
7
|
"title": "Expo Install",
|
|
8
8
|
"description": "Install a module or other package to a project.",
|
|
9
9
|
"type": "object",
|