@ng-native/nx 0.1.0 → 0.1.1

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.
@@ -4,7 +4,10 @@
4
4
  * The app is an Expo project, built by Metro. `@nx/expo`'s plugin, which `init` registers, infers
5
5
  * its Expo targets from the files written here; `project.json` adds the two it cannot infer:
6
6
  * `typecheck`, since Expo's `tsconfig` sets `noEmit` and `@nx/js` disables its own for that, and
7
- * `test`, which runs Vitest once rather than watching.
7
+ * `test`, which runs Vitest once rather than watching. It also replaces the inferred `start`,
8
+ * which is `@nx/expo:start`, an executor Nx deprecates and warns about on every run, with the
9
+ * `expo start` that executor runs, as the plugin already infers `run-ios` and `export`. Once the
10
+ * plugin infers `start` as a command too, this one can go.
8
11
  *
9
12
  * Where the dependencies go depends on the workspace. With package-manager workspaces, the Nx
10
13
  * default since 20, the app is a workspace package and lists them itself, which pnpm needs in
@@ -45,6 +48,7 @@ function targets(directory) {
45
48
  inputs: ['default', '^production'],
46
49
  },
47
50
  test: { ...run('vitest run'), cache: true, inputs: ['default', '^production'] },
51
+ start: { ...run('expo start'), continuous: true },
48
52
  };
49
53
  }
50
54
 
package/init/index.cjs CHANGED
@@ -14,6 +14,10 @@
14
14
  * because `@nx/expo` depends on `@nx/react`, whose `react-dom` peer npm otherwise takes at the
15
15
  * newest React and then refuses every later install beside React 19.2.3. And `@expo/cli`, which
16
16
  * `@nx/expo`'s prebuild executor loads from the root, where npm does not put it on its own.
17
+ *
18
+ * It also adds Babel 7's `@babel/runtime`, the one Expo's Babel preset writes imports of. In an
19
+ * Angular workspace `@angular-devkit/build-angular` hoists Babel 8's to the root, which has no
20
+ * `regenerator`, and every `nx start` warned that Metro fell back to file-based resolution.
17
21
  */
18
22
  const {
19
23
  addDependenciesToPackageJson,
package/native-app.cjs CHANGED
@@ -47,9 +47,14 @@ const dependencies = {
47
47
 
48
48
  /**
49
49
  * What `nx add` puts beside `@nx/expo`, in place of the `@nx/expo:init` it does not run: see
50
- * `init/index.cjs`. `@expo/cli` is the range the template's `expo` depends on.
50
+ * `init/index.cjs`. `@expo/cli` and `@babel/runtime` are the ranges the template's `expo` depends
51
+ * on.
51
52
  */
52
- const expoCompanions = { 'react-dom': dependencies.react, '@expo/cli': '^57.0.22' };
53
+ const expoCompanions = {
54
+ 'react-dom': dependencies.react,
55
+ '@expo/cli': '^57.0.22',
56
+ '@babel/runtime': '^7.20.0',
57
+ };
53
58
 
54
59
  /** @type {Record<string, string>} */
55
60
  const devDependencies = {
@@ -104,6 +109,8 @@ function appJson(name) {
104
109
  ios: { supportsTablet: true },
105
110
  android: { predictiveBackGestureEnabled: false },
106
111
  scheme: slug.replace(/[^a-z0-9]/gi, '').toLowerCase(),
112
+ // The template's: Expo otherwise guesses a router root from src/app and says so on every start.
113
+ extra: { router: { root: 'src/app' } },
107
114
  };
108
115
  return JSON.stringify({ expo }, null, 2) + '\n';
109
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-native/nx",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Nx generators for Angular Native: nx add, and an Expo app project whose targets run it.",
5
5
  "keywords": [
6
6
  "angular",