@nx/expo 17.3.0-beta.4 → 17.3.0-beta.5

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": "17.3.0-beta.4",
3
+ "version": "17.3.0-beta.5",
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.4",
38
- "@nx/devkit": "17.3.0-beta.4",
39
- "@nx/jest": "17.3.0-beta.4",
40
- "@nx/js": "17.3.0-beta.4",
41
- "@nx/eslint": "17.3.0-beta.4",
42
- "@nx/react": "17.3.0-beta.4",
43
- "@nx/webpack": "17.3.0-beta.4",
44
- "@nrwl/expo": "17.3.0-beta.4"
37
+ "@nx/detox": "17.3.0-beta.5",
38
+ "@nx/devkit": "17.3.0-beta.5",
39
+ "@nx/jest": "17.3.0-beta.5",
40
+ "@nx/js": "17.3.0-beta.5",
41
+ "@nx/eslint": "17.3.0-beta.5",
42
+ "@nx/react": "17.3.0-beta.5",
43
+ "@nx/webpack": "17.3.0-beta.5",
44
+ "@nrwl/expo": "17.3.0-beta.5"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "expo": ">= 49.0.0",
@@ -1,6 +1,7 @@
1
1
  import { CreateDependencies, CreateNodes } from '@nx/devkit';
2
2
  export interface ExpoPluginOptions {
3
3
  startTargetName?: string;
4
+ serveTargetName?: string;
4
5
  runIosTargetName?: string;
5
6
  runAndroidTargetName?: string;
6
7
  exportTargetName?: string;
package/plugins/plugin.js CHANGED
@@ -30,7 +30,6 @@ exports.createNodes = [
30
30
  // Do not create a project if package.json or project.json or metro.config.js isn't there.
31
31
  const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
32
32
  if (!siblingFiles.includes('package.json') ||
33
- !siblingFiles.includes('project.json') ||
34
33
  !siblingFiles.includes('metro.config.js')) {
35
34
  return {};
36
35
  }
@@ -59,16 +58,17 @@ function buildExpoTargets(projectRoot, options, context) {
59
58
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
60
59
  const targets = {
61
60
  [options.startTargetName]: {
62
- command: `expo start`,
61
+ executor: `@nx/expo:start`,
62
+ },
63
+ [options.serveTargetName]: {
64
+ command: `expo start --web`,
63
65
  options: { cwd: projectRoot },
64
66
  },
65
67
  [options.runIosTargetName]: {
66
- command: `expo run:ios`,
67
- options: { cwd: projectRoot },
68
+ executor: `@nx/expo:run-ios`,
68
69
  },
69
70
  [options.runAndroidTargetName]: {
70
- command: `expo run:android`,
71
- options: { cwd: projectRoot },
71
+ executor: `@nx/expo:run-android`,
72
72
  },
73
73
  [options.exportTargetName]: {
74
74
  command: `expo export`,
@@ -91,18 +91,15 @@ function buildExpoTargets(projectRoot, options, context) {
91
91
  options: { cwd: devkit_1.workspaceRoot }, // install at workspace root
92
92
  },
93
93
  [options.prebuildTargetName]: {
94
- command: `expo prebuild`,
95
- options: { cwd: projectRoot },
94
+ executor: `@nx/expo:prebuild`,
96
95
  },
97
96
  [options.buildTargetName]: {
98
- command: `eas build`,
99
- options: { cwd: projectRoot },
97
+ executor: `@nx/expo:build`,
100
98
  dependsOn: [`^${options.buildTargetName}`],
101
99
  inputs: getInputs(namedInputs),
102
100
  },
103
101
  [options.submitTargetName]: {
104
- command: `eas submit`,
105
- options: { cwd: projectRoot },
102
+ executor: `@nx/expo:submit`,
106
103
  dependsOn: [`^${options.submitTargetName}`],
107
104
  inputs: getInputs(namedInputs),
108
105
  },
@@ -148,6 +145,7 @@ function load(path) {
148
145
  function normalizeOptions(options) {
149
146
  options ??= {};
150
147
  options.startTargetName ??= 'start';
148
+ options.serveTargetName ??= 'serve';
151
149
  options.runIosTargetName ??= 'run-ios';
152
150
  options.runAndroidTargetName ??= 'run-android';
153
151
  options.exportTargetName ??= 'export';
@@ -2,11 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const has_expo_plugin_1 = require("../../../utils/has-expo-plugin");
5
6
  function addProject(host, options) {
6
7
  const nxJson = (0, devkit_1.readNxJson)(host);
7
- const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
8
- ? p === '@nx/expo/plugin'
9
- : p.plugin === '@nx/expo/plugin');
8
+ const hasPlugin = (0, has_expo_plugin_1.hasExpoPlugin)(host);
10
9
  const projectConfiguration = {
11
10
  root: options.appProjectRoot,
12
11
  sourceRoot: `${options.appProjectRoot}/src`,
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateDependencies = exports.expoInitGenerator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("../../utils/versions");
6
+ const has_expo_plugin_1 = require("../../utils/has-expo-plugin");
6
7
  const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
7
8
  async function expoInitGenerator(host, schema) {
8
9
  (0, add_git_ignore_entry_1.addGitIgnoreEntry)(host);
@@ -38,14 +39,10 @@ function moveDependency(host) {
38
39
  }
39
40
  function addPlugin(host) {
40
41
  const nxJson = (0, devkit_1.readNxJson)(host);
41
- nxJson.plugins ??= [];
42
- for (const plugin of nxJson.plugins) {
43
- if (typeof plugin === 'string'
44
- ? plugin === '@nx/expo/plugin'
45
- : plugin.plugin === '@nx/expo/plugin') {
46
- return;
47
- }
42
+ if ((0, has_expo_plugin_1.hasExpoPlugin)(host)) {
43
+ return;
48
44
  }
45
+ nxJson.plugins ??= [];
49
46
  nxJson.plugins.push({
50
47
  plugin: '@nx/expo/plugin',
51
48
  options: {
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function hasExpoPlugin(tree: Tree): boolean;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasExpoPlugin = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ function hasExpoPlugin(tree) {
6
+ const nxJson = (0, devkit_1.readNxJson)(tree);
7
+ return !!nxJson.plugins?.some((p) => typeof p === 'string'
8
+ ? p === '@nx/expo/plugin'
9
+ : p.plugin === '@nx/expo/plugin');
10
+ }
11
+ exports.hasExpoPlugin = hasExpoPlugin;