@nx/expo 19.5.6 → 19.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/expo",
3
- "version": "19.5.6",
3
+ "version": "19.6.0-beta.0",
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": [
@@ -28,7 +28,7 @@
28
28
  "main": "./index",
29
29
  "types": "index.d.ts",
30
30
  "dependencies": {
31
- "@nx/devkit": "19.5.6",
31
+ "@nx/devkit": "19.6.0-beta.0",
32
32
  "chalk": "^4.1.0",
33
33
  "enhanced-resolve": "^5.8.3",
34
34
  "fs-extra": "^11.1.0",
@@ -37,13 +37,13 @@
37
37
  "node-fetch": "^2.6.7",
38
38
  "tslib": "^2.3.0",
39
39
  "tsconfig-paths": "^4.1.2",
40
- "@nx/jest": "19.5.6",
41
- "@nx/js": "19.5.6",
42
- "@nx/eslint": "19.5.6",
43
- "@nx/react": "19.5.6",
44
- "@nx/web": "19.5.6",
45
- "@nx/webpack": "19.5.6",
46
- "@nrwl/expo": "19.5.6"
40
+ "@nx/jest": "19.6.0-beta.0",
41
+ "@nx/js": "19.6.0-beta.0",
42
+ "@nx/eslint": "19.6.0-beta.0",
43
+ "@nx/react": "19.6.0-beta.0",
44
+ "@nx/web": "19.6.0-beta.0",
45
+ "@nx/webpack": "19.6.0-beta.0",
46
+ "@nrwl/expo": "19.6.0-beta.0"
47
47
  },
48
48
  "executors": "./executors.json",
49
49
  "ng-update": {
@@ -5,12 +5,13 @@ const devkit_1 = require("@nx/devkit");
5
5
  const web_1 = require("@nx/web");
6
6
  const versions_1 = require("../../../utils/versions");
7
7
  const has_expo_plugin_1 = require("../../../utils/has-expo-plugin");
8
+ const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
9
+ const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
8
10
  async function addE2e(tree, options) {
9
11
  const hasPlugin = (0, has_expo_plugin_1.hasExpoPlugin)(tree);
10
12
  switch (options.e2eTestRunner) {
11
13
  case 'cypress': {
12
- const hasNxExpoPlugin = (0, has_expo_plugin_1.hasExpoPlugin)(tree);
13
- if (!hasNxExpoPlugin) {
14
+ if (!hasPlugin) {
14
15
  await (0, web_1.webStaticServeGenerator)(tree, {
15
16
  buildTarget: `${options.projectName}:export`,
16
17
  targetName: 'serve-static',
@@ -25,7 +26,7 @@ async function addE2e(tree, options) {
25
26
  implicitDependencies: [options.projectName],
26
27
  tags: [],
27
28
  });
28
- return await configurationGenerator(tree, {
29
+ const e2eTask = await configurationGenerator(tree, {
29
30
  ...options,
30
31
  project: options.e2eProjectName,
31
32
  directory: 'src',
@@ -35,12 +36,26 @@ async function addE2e(tree, options) {
35
36
  devServerTarget: `${options.projectName}:${options.e2eWebServerTarget}`,
36
37
  port: options.e2ePort,
37
38
  baseUrl: options.e2eWebServerAddress,
38
- ciWebServerCommand: hasNxExpoPlugin
39
+ ciWebServerCommand: hasPlugin
39
40
  ? `nx run ${options.projectName}:serve-static`
40
41
  : undefined,
41
42
  jsx: true,
42
43
  rootProject: options.rootProject,
43
44
  });
45
+ if (options.addPlugin ||
46
+ (0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
47
+ ? p === '@nx/cypress/plugin'
48
+ : p.plugin === '@nx/cypress/plugin')) {
49
+ let buildTarget = '^export';
50
+ if (hasPlugin) {
51
+ const matchingExpoPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, '@nx/expo/plugin', (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'app.json'));
52
+ if (matchingExpoPlugin && typeof matchingExpoPlugin !== 'string') {
53
+ buildTarget = `^${matchingExpoPlugin.options?.exportTargetName ?? 'export'}`;
54
+ }
55
+ }
56
+ await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/cypress/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `cypress.config.${options.js ? 'js' : 'ts'}`));
57
+ }
58
+ return e2eTask;
44
59
  }
45
60
  case 'playwright': {
46
61
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
@@ -51,7 +66,7 @@ async function addE2e(tree, options) {
51
66
  targets: {},
52
67
  implicitDependencies: [options.projectName],
53
68
  });
54
- return configurationGenerator(tree, {
69
+ const e2eTask = await configurationGenerator(tree, {
55
70
  project: options.e2eProjectName,
56
71
  skipFormat: true,
57
72
  skipPackageJson: options.skipPackageJson,
@@ -62,7 +77,22 @@ async function addE2e(tree, options) {
62
77
  webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx ${options.e2eWebServerTarget} ${options.name}`,
63
78
  webServerAddress: options.e2eWebServerAddress,
64
79
  rootProject: options.rootProject,
80
+ addPlugin: options.addPlugin,
65
81
  });
82
+ if (options.addPlugin ||
83
+ (0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
84
+ ? p === '@nx/playwright/plugin'
85
+ : p.plugin === '@nx/playwright/plugin')) {
86
+ let buildTarget = '^export';
87
+ if (hasPlugin) {
88
+ const matchingExpoPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, '@nx/expo/plugin', (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'app.json'));
89
+ if (matchingExpoPlugin && typeof matchingExpoPlugin !== 'string') {
90
+ buildTarget = `^${matchingExpoPlugin.options?.exportTargetName ?? 'export'}`;
91
+ }
92
+ }
93
+ await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/playwright/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `playwright.config.ts`));
94
+ }
95
+ return e2eTask;
66
96
  }
67
97
  case 'detox':
68
98
  const { detoxApplicationGenerator } = (0, devkit_1.ensurePackage)('@nx/detox', versions_1.nxVersion);
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = addProject;
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
+ const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
7
7
  function addProject(host, options) {
8
8
  const nxJson = (0, devkit_1.readNxJson)(host);
9
9
  const hasPlugin = (0, has_expo_plugin_1.hasExpoPlugin)(host);
10
10
  if (!hasPlugin) {
11
- (0, add_build_target_defaults_1.addBuildTargetDefaults)(host, '@nx/expo:build');
11
+ (0, target_defaults_utils_1.addBuildTargetDefaults)(host, '@nx/expo:build');
12
12
  }
13
13
  const projectConfiguration = {
14
14
  root: options.appProjectRoot,
@@ -11,7 +11,7 @@ const versions_1 = require("../../utils/versions");
11
11
  const normalize_options_1 = require("./lib/normalize-options");
12
12
  const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
13
13
  const init_root_babel_config_1 = require("../../utils/init-root-babel-config");
14
- const add_build_target_defaults_1 = require("@nx/devkit/src/generators/add-build-target-defaults");
14
+ const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
15
15
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
16
16
  async function expoLibraryGenerator(host, schema) {
17
17
  return await expoLibraryGeneratorInternal(host, {
@@ -87,7 +87,7 @@ async function addProject(host, options) {
87
87
  skipFormat: true,
88
88
  });
89
89
  const external = ['react/jsx-runtime', 'react-native', 'react', 'react-dom'];
90
- (0, add_build_target_defaults_1.addBuildTargetDefaults)(host, '@nx/rollup:rollup');
90
+ (0, target_defaults_utils_1.addBuildTargetDefaults)(host, '@nx/rollup:rollup');
91
91
  project.targets.build = {
92
92
  executor: '@nx/rollup:rollup',
93
93
  outputs: ['{options.outputPath}'],