@nx/expo 20.5.0-beta.2 → 20.5.0-canary.20250128-e0c49d3

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": "20.5.0-beta.2",
3
+ "version": "20.5.0-canary.20250128-e0c49d3",
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,16 +28,17 @@
28
28
  "main": "./index",
29
29
  "types": "index.d.ts",
30
30
  "dependencies": {
31
- "@nx/devkit": "20.5.0-beta.2",
32
- "@nx/eslint": "20.5.0-beta.2",
33
- "@nx/jest": "20.5.0-beta.2",
34
- "@nx/js": "20.5.0-beta.2",
35
- "@nx/react": "20.5.0-beta.2",
36
- "@nx/web": "20.5.0-beta.2",
37
- "@nx/webpack": "20.5.0-beta.2",
31
+ "@nx/devkit": "20.5.0-canary.20250128-e0c49d3",
32
+ "@nx/eslint": "20.5.0-canary.20250128-e0c49d3",
33
+ "@nx/jest": "20.5.0-canary.20250128-e0c49d3",
34
+ "@nx/js": "20.5.0-canary.20250128-e0c49d3",
35
+ "@nx/react": "20.5.0-canary.20250128-e0c49d3",
36
+ "@nx/web": "20.5.0-canary.20250128-e0c49d3",
37
+ "@nx/webpack": "20.5.0-canary.20250128-e0c49d3",
38
38
  "enhanced-resolve": "^5.8.3",
39
39
  "metro-config": "~0.80.4",
40
40
  "metro-resolver": "~0.80.4",
41
+ "node-fetch": "^2.6.7",
41
42
  "picocolors": "^1.1.0",
42
43
  "tsconfig-paths": "^4.1.2",
43
44
  "tslib": "^2.3.0"
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isPackagerRunning = isPackagerRunning;
4
+ const node_fetch_1 = require("node-fetch");
4
5
  async function isPackagerRunning(packagerPort) {
5
6
  try {
6
- const resp = await fetch(`http://localhost:${packagerPort}/status`);
7
+ const resp = await (0, node_fetch_1.default)(`http://localhost:${packagerPort}/status`);
7
8
  const data = await resp.text();
8
9
  return data === 'packager-status:running' ? 'running' : 'unrecognized';
9
10
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "<%= projectName %>",
2
+ "name": "<%= name %>",
3
3
  "version": "0.0.1",
4
4
  "main": "<%= appMain %>"
5
5
  }
@@ -3,7 +3,6 @@ import { Schema } from '../schema';
3
3
  export interface NormalizedSchema extends Schema {
4
4
  name: string;
5
5
  fileName: string;
6
- projectName: string;
7
6
  projectRoot: string;
8
7
  routePath: string;
9
8
  parsedTags: string[];
@@ -4,7 +4,6 @@ exports.normalizeOptions = normalizeOptions;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
6
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
7
- const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
8
7
  async function normalizeOptions(host, options) {
9
8
  await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'library');
10
9
  const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
@@ -21,20 +20,16 @@ async function normalizeOptions(host, options) {
21
20
  ? options.tags.split(',').map((s) => s.trim())
22
21
  : [];
23
22
  const appMain = options.js ? 'src/index.js' : 'src/index.ts';
24
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
25
23
  const normalized = {
26
24
  ...options,
27
25
  fileName: projectName,
28
26
  routePath: `/${projectNames.projectSimpleName}`,
29
27
  name: projectName,
30
- projectName: isUsingTsSolutionConfig
31
- ? (0, get_import_path_1.getImportPath)(host, projectName)
32
- : projectName,
33
28
  projectRoot,
34
29
  parsedTags,
35
30
  importPath,
36
31
  appMain,
37
- isUsingTsSolutionConfig,
32
+ isUsingTsSolutionConfig: (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host),
38
33
  };
39
34
  return normalized;
40
35
  }
@@ -14,6 +14,7 @@ const init_root_babel_config_1 = require("../../utils/init-root-babel-config");
14
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
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
17
+ const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
17
18
  const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
18
19
  async function expoLibraryGenerator(host, schema) {
19
20
  return await expoLibraryGeneratorInternal(host, {
@@ -32,9 +33,6 @@ async function expoLibraryGeneratorInternal(host, schema) {
32
33
  if (options.publishable === true && !schema.importPath) {
33
34
  throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
34
35
  }
35
- if (options.isUsingTsSolutionConfig) {
36
- (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
37
- }
38
36
  const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
39
37
  tasks.push(initTask);
40
38
  if (!options.skipPackageJson) {
@@ -48,13 +46,13 @@ async function expoLibraryGeneratorInternal(host, schema) {
48
46
  }
49
47
  const lintTask = await (0, add_linting_1.addLinting)(host, {
50
48
  ...options,
51
- projectName: options.projectName,
49
+ projectName: options.name,
52
50
  tsConfigPaths: [
53
51
  (0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.lib.json'),
54
52
  ],
55
53
  });
56
54
  tasks.push(lintTask);
57
- const jestTask = await (0, add_jest_1.addJest)(host, options.unitTestRunner, options.projectName, options.projectRoot, options.js, options.skipPackageJson, options.addPlugin);
55
+ const jestTask = await (0, add_jest_1.addJest)(host, options.unitTestRunner, options.name, options.projectRoot, options.js, options.skipPackageJson, options.addPlugin);
58
56
  tasks.push(jestTask);
59
57
  if (options.publishable || options.buildable) {
60
58
  updateLibPackageNpmScope(host, options);
@@ -71,6 +69,9 @@ async function expoLibraryGeneratorInternal(host, schema) {
71
69
  }, options.linter === 'eslint'
72
70
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
73
71
  : undefined);
72
+ if (options.isUsingTsSolutionConfig) {
73
+ (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
74
+ }
74
75
  (0, sort_fields_1.sortPackageJsonFields)(host, options.projectRoot);
75
76
  if (!options.skipFormat) {
76
77
  await (0, devkit_1.formatFiles)(host);
@@ -93,34 +94,23 @@ async function addProject(host, options) {
93
94
  targets: {},
94
95
  };
95
96
  if (options.isUsingTsSolutionConfig) {
97
+ const packageName = (0, get_import_path_1.getImportPath)(host, options.name);
96
98
  const sourceEntry = !options.buildable
97
99
  ? options.js
98
100
  ? './src/index.js'
99
101
  : './src/index.ts'
100
102
  : undefined;
101
103
  (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), {
102
- name: options.projectName,
104
+ name: packageName,
103
105
  version: '0.0.1',
104
106
  main: sourceEntry,
105
107
  types: sourceEntry,
106
- // For buildable libraries, the entries are configured by the bundler (i.e. Rollup).
107
- exports: options.buildable
108
- ? undefined
109
- : {
110
- './package.json': './package.json',
111
- '.': options.js
112
- ? './src/index.js'
113
- : {
114
- types: './src/index.ts',
115
- import: './src/index.ts',
116
- default: './src/index.ts',
117
- },
118
- },
119
- nx: options.parsedTags?.length
120
- ? {
121
- tags: options.parsedTags,
122
- }
123
- : undefined,
108
+ nx: {
109
+ name: packageName === options.name ? undefined : options.name,
110
+ projectType: 'library',
111
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
112
+ tags: options.parsedTags?.length ? options.parsedTags : undefined,
113
+ },
124
114
  });
125
115
  }
126
116
  else {
@@ -132,7 +122,7 @@ async function addProject(host, options) {
132
122
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/rollup', versions_1.nxVersion);
133
123
  const rollupConfigTask = await configurationGenerator(host, {
134
124
  ...options,
135
- project: options.projectName,
125
+ project: options.name,
136
126
  skipFormat: true,
137
127
  });
138
128
  const external = ['react/jsx-runtime', 'react-native', 'react', 'react-dom'];
@@ -156,7 +146,7 @@ async function addProject(host, options) {
156
146
  ],
157
147
  },
158
148
  };
159
- (0, devkit_1.updateProjectConfiguration)(host, options.projectName, project);
149
+ (0, devkit_1.updateProjectConfiguration)(host, options.name, project);
160
150
  return rollupConfigTask;
161
151
  }
162
152
  function updateTsConfig(tree, options) {
@@ -181,9 +171,7 @@ function createFiles(host, options) {
181
171
  offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.projectRoot),
182
172
  rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(host, options.projectRoot),
183
173
  });
184
- if (!options.publishable &&
185
- !options.buildable &&
186
- !options.isUsingTsSolutionConfig) {
174
+ if (!options.publishable && !options.buildable) {
187
175
  host.delete(`${options.projectRoot}/package.json`);
188
176
  }
189
177
  if (options.js) {