@nx/expo 17.3.0-beta.5 → 17.3.0-beta.8
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/package.json +9 -9
- package/src/generators/application/lib/add-project.js +4 -0
- package/src/generators/component/files/__fileName__.tsx.template +1 -1
- package/src/generators/init/init.d.ts +1 -1
- package/src/generators/init/init.js +8 -3
- package/src/generators/init/schema.d.ts +2 -0
- package/src/generators/init/schema.json +12 -0
- package/src/generators/library/library.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "17.3.0-beta.
|
|
3
|
+
"version": "17.3.0-beta.8",
|
|
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": [
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"tslib": "^2.3.0",
|
|
35
35
|
"tsconfig-paths": "^4.1.2",
|
|
36
36
|
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
37
|
-
"@nx/detox": "17.3.0-beta.
|
|
38
|
-
"@nx/devkit": "17.3.0-beta.
|
|
39
|
-
"@nx/jest": "17.3.0-beta.
|
|
40
|
-
"@nx/js": "17.3.0-beta.
|
|
41
|
-
"@nx/eslint": "17.3.0-beta.
|
|
42
|
-
"@nx/react": "17.3.0-beta.
|
|
43
|
-
"@nx/webpack": "17.3.0-beta.
|
|
44
|
-
"@nrwl/expo": "17.3.0-beta.
|
|
37
|
+
"@nx/detox": "17.3.0-beta.8",
|
|
38
|
+
"@nx/devkit": "17.3.0-beta.8",
|
|
39
|
+
"@nx/jest": "17.3.0-beta.8",
|
|
40
|
+
"@nx/js": "17.3.0-beta.8",
|
|
41
|
+
"@nx/eslint": "17.3.0-beta.8",
|
|
42
|
+
"@nx/react": "17.3.0-beta.8",
|
|
43
|
+
"@nx/webpack": "17.3.0-beta.8",
|
|
44
|
+
"@nrwl/expo": "17.3.0-beta.8"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"expo": ">= 49.0.0",
|
|
@@ -3,9 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addProject = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const has_expo_plugin_1 = require("../../../utils/has-expo-plugin");
|
|
6
|
+
const add_build_target_defaults_1 = require("@nx/devkit/src/generators/add-build-target-defaults");
|
|
6
7
|
function addProject(host, options) {
|
|
7
8
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
8
9
|
const hasPlugin = (0, has_expo_plugin_1.hasExpoPlugin)(host);
|
|
10
|
+
if (!hasPlugin) {
|
|
11
|
+
(0, add_build_target_defaults_1.addBuildTargetDefaults)(host, '@nx/expo:build');
|
|
12
|
+
}
|
|
9
13
|
const projectConfiguration = {
|
|
10
14
|
root: options.appProjectRoot,
|
|
11
15
|
sourceRoot: `${options.appProjectRoot}/src`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
export declare function expoInitGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
|
-
export declare function updateDependencies(host: Tree): GeneratorCallback;
|
|
4
|
+
export declare function updateDependencies(host: Tree, schema: Schema): GeneratorCallback;
|
|
5
5
|
export default expoInitGenerator;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateDependencies = exports.expoInitGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const update_package_scripts_1 = require("@nx/devkit/src/utils/update-package-scripts");
|
|
6
|
+
const plugin_1 = require("../../../plugins/plugin");
|
|
5
7
|
const versions_1 = require("../../utils/versions");
|
|
6
8
|
const has_expo_plugin_1 = require("../../utils/has-expo-plugin");
|
|
7
9
|
const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
|
|
@@ -13,7 +15,10 @@ async function expoInitGenerator(host, schema) {
|
|
|
13
15
|
const tasks = [];
|
|
14
16
|
if (!schema.skipPackageJson) {
|
|
15
17
|
tasks.push(moveDependency(host));
|
|
16
|
-
tasks.push(updateDependencies(host));
|
|
18
|
+
tasks.push(updateDependencies(host, schema));
|
|
19
|
+
}
|
|
20
|
+
if (schema.updatePackageScripts) {
|
|
21
|
+
await (0, update_package_scripts_1.updatePackageScripts)(host, plugin_1.createNodes);
|
|
17
22
|
}
|
|
18
23
|
if (!schema.skipFormat) {
|
|
19
24
|
await (0, devkit_1.formatFiles)(host);
|
|
@@ -21,7 +26,7 @@ async function expoInitGenerator(host, schema) {
|
|
|
21
26
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
22
27
|
}
|
|
23
28
|
exports.expoInitGenerator = expoInitGenerator;
|
|
24
|
-
function updateDependencies(host) {
|
|
29
|
+
function updateDependencies(host, schema) {
|
|
25
30
|
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
26
31
|
react: versions_1.reactVersion,
|
|
27
32
|
'react-dom': versions_1.reactDomVersion,
|
|
@@ -31,7 +36,7 @@ function updateDependencies(host) {
|
|
|
31
36
|
'@nx/expo': versions_1.nxVersion,
|
|
32
37
|
'@expo/cli': versions_1.expoCliVersion,
|
|
33
38
|
'eas-cli': versions_1.easCliVersion,
|
|
34
|
-
});
|
|
39
|
+
}, undefined, schema.keepExistingVersions);
|
|
35
40
|
}
|
|
36
41
|
exports.updateDependencies = updateDependencies;
|
|
37
42
|
function moveDependency(host) {
|
|
@@ -15,6 +15,18 @@
|
|
|
15
15
|
"type": "boolean",
|
|
16
16
|
"default": false,
|
|
17
17
|
"description": "Do not add dependencies to `package.json`."
|
|
18
|
+
},
|
|
19
|
+
"keepExistingVersions": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"x-priority": "internal",
|
|
22
|
+
"description": "Keep existing dependencies versions",
|
|
23
|
+
"default": false
|
|
24
|
+
},
|
|
25
|
+
"updatePackageScripts": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"x-priority": "internal",
|
|
28
|
+
"description": "Update `package.json` scripts with inferred targets",
|
|
29
|
+
"default": false
|
|
18
30
|
}
|
|
19
31
|
},
|
|
20
32
|
"required": []
|
|
@@ -10,6 +10,7 @@ const versions_1 = require("../../utils/versions");
|
|
|
10
10
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
11
11
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
12
12
|
const init_root_babel_config_1 = require("../../utils/init-root-babel-config");
|
|
13
|
+
const add_build_target_defaults_1 = require("@nx/devkit/src/generators/add-build-target-defaults");
|
|
13
14
|
async function expoLibraryGenerator(host, schema) {
|
|
14
15
|
return await expoLibraryGeneratorInternal(host, {
|
|
15
16
|
projectNameAndRootFormat: 'derived',
|
|
@@ -82,6 +83,7 @@ async function addProject(host, options) {
|
|
|
82
83
|
skipFormat: true,
|
|
83
84
|
});
|
|
84
85
|
const external = ['react/jsx-runtime', 'react-native', 'react', 'react-dom'];
|
|
86
|
+
(0, add_build_target_defaults_1.addBuildTargetDefaults)(host, '@nx/rollup:rollup');
|
|
85
87
|
project.targets.build = {
|
|
86
88
|
executor: '@nx/rollup:rollup',
|
|
87
89
|
outputs: ['{options.outputPath}'],
|