@ng-native/schematics 0.26.0 → 0.27.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.
@@ -38,13 +38,13 @@ function targets(root, name, lint = false, desktopOnly = false) {
38
38
  return {
39
39
  serve: expo('start'),
40
40
  build: expo('export', ['--output-dir', outputDir]),
41
- // A desktop-only app runs with `ng-native-desktop`: the Expo CLI has no `run:macos`.
41
+ // A desktop-only app runs with `ng-native-desktop`: the Expo CLI has no `run:macos` or `run:linux`.
42
42
  ...(desktopOnly
43
43
  ? desktopTargets()
44
44
  : { 'run-ios': expo('run:ios'), 'run-android': expo('run:android') }),
45
45
  test: {
46
46
  builder: '@ng-native/schematics:vitest',
47
- options: { project: desktopOnly ? native.DESKTOP_TEST_PROJECT : native.TEST_PROJECT },
47
+ options: { project: desktopOnly ? native.DESKTOP_TEST_PROJECTS : native.TEST_PROJECT },
48
48
  },
49
49
  typecheck: { builder: '@ng-native/schematics:typecheck', options: {} },
50
50
  // With `--linter=eslint`, angular-eslint's builder, which `ng lint` runs, with the project's
@@ -100,7 +100,8 @@ function commands(name, lint, desktopOnly) {
100
100
  const runs = desktopOnly
101
101
  ? [
102
102
  [`ng serve ${name}`, 'Metro, the dev server the app loads from'],
103
- [`ng run ${name}:macos`, 'builds the desktop host and opens the app from Metro'],
103
+ [`ng run ${name}:macos`, 'on a Mac: builds the desktop host and opens the app from Metro'],
104
+ [`ng run ${name}:linux`, 'on Linux: the same, in GTK'],
104
105
  ]
105
106
  : [
106
107
  [
@@ -120,7 +121,7 @@ function commands(name, lint, desktopOnly) {
120
121
  ? [
121
122
  [
122
123
  `ng run ${name}:package`,
123
- 'the .app; "args": ["--format", "dmg"] (or "mas") on the target in angular.json to ship it',
124
+ 'the .app, or the app folder on Linux; "args": ["--format", "dmg"] (or "mas", "deb", "rpm", "flatpak") on the target in angular.json to ship it',
124
125
  ],
125
126
  ]
126
127
  : []),
@@ -142,7 +143,7 @@ function writeFiles(tree, root, name, bundleIdentifier, lint, desktopOnly) {
142
143
  for (const file of native.SOURCE_FILES) {
143
144
  tree.create(path.join(root, file), native.sourceFile(file, desktopOnly));
144
145
  }
145
- const platforms = desktopOnly ? ['macos'] : undefined;
146
+ const platforms = desktopOnly ? native.DESKTOP_OSES : undefined;
146
147
  tree.create(path.join(root, 'app.json'), native.appJson(name, bundleIdentifier, platforms));
147
148
  tree.create(
148
149
  path.join(root, 'AGENTS.md'),
@@ -227,7 +228,7 @@ function application(options) {
227
228
  function created(root, name, lint, desktopOnly) {
228
229
  return (
229
230
  `Created ${root}. Run it with: ng serve ${name} (Metro), ` +
230
- `ng run ${name}:${desktopOnly ? 'macos' : 'run-ios'}, ` +
231
+ `ng run ${name}:${desktopOnly ? 'macos or ng run ' + name + ':linux' : 'run-ios'}, ` +
231
232
  `ng test ${name}, ng run ${name}:typecheck, ` +
232
233
  (lint ? `ng lint ${name}, ` : '') +
233
234
  `ng build ${name}.`
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "desktopOnly": {
38
38
  "type": "boolean",
39
- "description": "A macOS-only app from the desktop template: macos alone in expo.platforms, a sidebar and menu bar starter, and macos and package targets in place of run-ios and run-android.",
39
+ "description": "A desktop-only app from the desktop template: macos and linux alone in expo.platforms, a sidebar and menu bar starter, and macos, linux and package targets in place of run-ios and run-android.",
40
40
  "default": false
41
41
  },
42
42
  "skipInstall": {
package/builders/expo.cjs CHANGED
@@ -5,16 +5,17 @@
5
5
  * `ng run native:run-ios` is `expo run:ios`. Nothing is translated: Metro builds an Angular Native
6
6
  * app, Expo drives Metro, and this is how `ng` reaches it.
7
7
  *
8
- * Two commands are not the Expo CLI's, because its `run` commands are a fixed list with no
9
- * `run:macos`: `macos` is `ng-native-desktop run`, which builds the desktop host and opens the app
10
- * from the dev server `ng serve` runs, and `package` is `ng-native-desktop package`, which makes the
11
- * `.app`, `.dmg` or Mac App Store package. Both come from `@ng-native/desktop`.
8
+ * Three commands are not the Expo CLI's, because its `run` commands are a fixed list with no
9
+ * `run:macos` or `run:linux`: `macos` and `linux` are `ng-native-desktop run`, which builds the
10
+ * desktop host and opens the app from the dev server `ng serve` runs, and `package` is
11
+ * `ng-native-desktop package`, which makes the `.app`, `.dmg` or Mac App Store package, or on Linux
12
+ * the app folder, `.deb`, `.rpm` or Flatpak. All come from `@ng-native/desktop`.
12
13
  */
13
14
  const { createBuilder } = require('@angular-devkit/architect');
14
15
  const { spawnBin } = require('./spawn-bin.cjs');
15
16
 
16
- /** The commands `ng-native-desktop` runs in place of the Expo CLI, by its subcommand. */
17
- const DESKTOP_COMMANDS = { macos: 'run', package: 'package' };
17
+ /** What `ng-native-desktop` runs in place of the Expo CLI: its subcommand, and the OS for `linux`. */
18
+ const DESKTOP_COMMANDS = { macos: ['run'], linux: ['run', '--os', 'linux'], package: ['package'] };
18
19
 
19
20
  /**
20
21
  * The Expo CLI's arguments for a target's options.
@@ -30,15 +31,15 @@ function expoArgs(options) {
30
31
  }
31
32
 
32
33
  /**
33
- * `ng-native-desktop`'s arguments for a `macos` or `package` target. The port is the dev server's
34
- * the host loads the app from, which only `macos` has: `package` bundles the app itself, and
35
- * refuses `--port`.
34
+ * `ng-native-desktop`'s arguments for a `macos`, `linux` or `package` target. The port is the dev
35
+ * server's the host loads the app from, which only `macos` and `linux` have: `package` bundles the
36
+ * app itself, and refuses `--port`.
36
37
  *
37
- * @param {{ command: 'macos' | 'package', args?: string[], port?: number }} options
38
+ * @param {{ command: 'macos' | 'linux' | 'package', args?: string[], port?: number }} options
38
39
  */
39
40
  function desktopArgs(options) {
40
- const args = [DESKTOP_COMMANDS[options.command], ...(options.args ?? [])];
41
- if (options.port && options.command === 'macos') args.push('--port', String(options.port));
41
+ const args = [...DESKTOP_COMMANDS[options.command], ...(options.args ?? [])];
42
+ if (options.port && options.command !== 'package') args.push('--port', String(options.port));
42
43
  return args;
43
44
  }
44
45
 
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "command": {
8
8
  "type": "string",
9
- "description": "The Expo CLI command: start, export, run:ios, run:android, prebuild. Or macos, which builds the desktop host and opens the app in it, and package, which packages the macOS app: both run ng-native-desktop from @ng-native/desktop."
9
+ "description": "The Expo CLI command: start, export, run:ios, run:android, prebuild. Or macos or linux, which build the desktop host and open the app in it, and package, which packages the desktop app: all run ng-native-desktop from @ng-native/desktop."
10
10
  },
11
11
  "args": {
12
12
  "type": "array",
@@ -18,16 +18,16 @@
18
18
  },
19
19
  "platform": {
20
20
  "type": "string",
21
- "enum": ["ios", "android", "macos", "web", "all"],
22
- "description": "Passed as --platform, for export. Not for macos or package."
21
+ "enum": ["ios", "android", "macos", "linux", "web", "all"],
22
+ "description": "Passed as --platform, for export. Not for macos, linux or package."
23
23
  },
24
24
  "port": {
25
25
  "type": "number",
26
- "description": "Passed as --port: the port Metro listens on, or for macos the one the host loads the app from. Not for package, which has no dev server."
26
+ "description": "Passed as --port: the port Metro listens on, or for macos and linux the one the host loads the app from. Not for package, which has no dev server."
27
27
  },
28
28
  "clear": {
29
29
  "type": "boolean",
30
- "description": "Passed as --clear: start Metro with an empty transform cache. Not for macos or package."
30
+ "description": "Passed as --clear: start Metro with an empty transform cache. Not for macos, linux or package."
31
31
  }
32
32
  },
33
33
  "required": ["command"]
@@ -9,10 +9,10 @@
9
9
  const { createBuilder } = require('@angular-devkit/architect');
10
10
  const { spawnBin } = require('./spawn-bin.cjs');
11
11
 
12
- /** @param {{ watch?: boolean, filter?: string, project?: string }} options */
12
+ /** @param {{ watch?: boolean, filter?: string, project?: string | string[] }} options */
13
13
  function vitestArgs(options) {
14
14
  const args = [options.watch ? 'watch' : 'run'];
15
- if (options.project) args.push('--project', options.project);
15
+ for (const project of [options.project ?? []].flat()) args.push('--project', project);
16
16
  if (options.filter) args.push(options.filter);
17
17
  return args;
18
18
  }
@@ -14,8 +14,9 @@
14
14
  "description": "Only test files whose path contains this."
15
15
  },
16
16
  "project": {
17
- "type": "string",
18
- "description": "Only this Vitest project, by its name in vitest.config.mts. A generated app's test target runs node (node-macos in a desktop-only app), since its other projects open the app."
17
+ "type": ["string", "array"],
18
+ "items": { "type": "string" },
19
+ "description": "Only this Vitest project, or these, by name in vitest.config.mts. A generated app's test target runs node, and a desktop-only app's node-macos and node-linux, since its other projects open the app."
19
20
  }
20
21
  }
21
22
  }
package/collection.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "schema": "./component/schema.json"
20
20
  },
21
21
  "desktop": {
22
- "description": "Adds macOS to an Angular Native app: @ng-native/desktop, macos in expo.platforms with Expo's out-of-tree platforms flag, the config plugin, and macos and package targets.",
22
+ "description": "Adds macOS and Linux to an Angular Native app: @ng-native/desktop, macos and linux in expo.platforms with Expo's out-of-tree platforms flag, the config plugin, and macos, linux and package targets.",
23
23
  "factory": "./desktop/index.cjs#desktop",
24
24
  "schema": "./desktop/schema.json"
25
25
  },
package/desktop/index.cjs CHANGED
@@ -1,14 +1,17 @@
1
1
  /**
2
- * `ng generate @ng-native/schematics:desktop native`: an Angular Native app that runs on macOS too.
2
+ * `ng generate @ng-native/schematics:desktop native`: an Angular Native app that runs on macOS and
3
+ * Linux too.
3
4
  *
4
- * The project's `app.json` lists `macos` with Expo's `experiments.outOfTreePlatforms` (without it
5
- * Expo drops `macos` from every bundle and export, and says nothing) and the `@ng-native/desktop`
6
- * config plugin. The workspace depends on `@ng-native/desktop`, and the project gains two targets on
7
- * the `expo` builder: `ng run native:macos` builds the desktop host and opens the app from the dev
8
- * server `ng serve native` runs, and `ng run native:package` makes the `.app`, `.dmg` or Mac App
9
- * Store package.
5
+ * The project's `app.json` lists `macos` and `linux` with Expo's `experiments.outOfTreePlatforms`
6
+ * (without it Expo drops them from every bundle and export, and says nothing) and the
7
+ * `@ng-native/desktop` config plugin. The workspace depends on `@ng-native/desktop`, and the
8
+ * project gains targets on the `expo` builder: `ng run native:macos` and `ng run native:linux`
9
+ * build the desktop host and open the app from the dev server `ng serve native` runs, and
10
+ * `ng run native:package` makes the `.app`, `.dmg` or Mac App Store package, or on Linux the app
11
+ * folder, `.deb`, `.rpm` or Flatpak.
10
12
  *
11
- * It only adds, so running it again changes nothing.
13
+ * It only adds, so running it again changes nothing, and a project that has `macos` alone gains
14
+ * `linux`.
12
15
  */
13
16
  const path = require('node:path').posix;
14
17
  const { workspaces } = require('@angular-devkit/core');
@@ -29,7 +32,7 @@ function writeJson(tree, file, value) {
29
32
 
30
33
  /**
31
34
  * The port the project's `serve` target runs Metro on, from its `port` option or a `--port` in its
32
- * `args`, or undefined for Expo's default. The `macos` target loads the app from it.
35
+ * `args`, or undefined for Expo's default. The `macos` and `linux` targets load the app from it.
33
36
  */
34
37
  function servePort(project) {
35
38
  const serve = project?.targets.get('serve');
@@ -51,15 +54,18 @@ function portOf(options = {}) {
51
54
  }
52
55
 
53
56
  /**
54
- * The two targets, each on the `expo` builder, which runs `ng-native-desktop` for them. `macos`
55
- * takes the `serve` target's port, so the host loads from the dev server `ng serve` runs.
57
+ * The targets, each on the `expo` builder, which runs `ng-native-desktop` for them. `macos` and
58
+ * `linux` take the `serve` target's port, so the host loads from the dev server `ng serve` runs.
56
59
  */
57
60
  function desktopTargets(port) {
58
61
  const desktop = (command, extra) => ({
59
62
  builder: '@ng-native/schematics:expo',
60
63
  options: { command, ...extra },
61
64
  });
62
- return { macos: desktop('macos', port ? { port } : {}), package: desktop('package') };
65
+ return {
66
+ ...Object.fromEntries(native.DESKTOP_OSES.map((os) => [os, desktop(os, port ? { port } : {})])),
67
+ package: desktop('package'),
68
+ };
63
69
  }
64
70
 
65
71
  /** The project's `app.json` with `withOs` applied to its Expo config. */
@@ -145,8 +151,9 @@ function desktop(options) {
145
151
 
146
152
  if (!options.skipInstall) context.addTask(new NodePackageInstallTask());
147
153
  context.logger.info(
148
- `${options.project} runs on macOS: ng serve ${options.project}, then ` +
149
- `ng run ${options.project}:macos. ng run ${options.project}:package makes the app.`,
154
+ `${options.project} runs on macOS and Linux: ng serve ${options.project}, then ` +
155
+ `ng run ${options.project}:macos or ng run ${options.project}:linux. ` +
156
+ `ng run ${options.project}:package makes the app.`,
150
157
  );
151
158
  };
152
159
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "NgNativeDesktop",
4
- "title": "macOS in an Angular Native app",
4
+ "title": "macOS and Linux in an Angular Native app",
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "project": {
@@ -11,7 +11,7 @@
11
11
  "$source": "argv",
12
12
  "index": 0
13
13
  },
14
- "x-prompt": "Which native app should run on macOS?"
14
+ "x-prompt": "Which native app should run on macOS and Linux?"
15
15
  },
16
16
  "skipInstall": {
17
17
  "type": "boolean",
package/files/AGENTS.md CHANGED
@@ -66,8 +66,8 @@ change; both are fast.
66
66
  `::before`/`::after` are dropped with a build warning naming the file, line and reason - lay out
67
67
  with flexbox, grid or a block. Everything is `display: flex` with `flex-direction: column` by
68
68
  default, as in React Native.
69
- - Tailwind v4 works through `@ng-native/tailwind`, with `ios:`, `android:`, `macos:`, `desktop:`
70
- and `dark:` variants.
69
+ - Tailwind v4 works through `@ng-native/tailwind`, with `ios:`, `android:`, `macos:`, `linux:`,
70
+ `desktop:` and `dark:` variants.
71
71
 
72
72
  ## Lists, navigation, forms
73
73
 
@@ -1,6 +1,6 @@
1
1
  # AGENTS.md
2
2
 
3
- This is an Angular app rendering real native macOS views (AppKit) with
3
+ This is an Angular app rendering real native macOS (AppKit) and Linux (GTK) views with
4
4
  [Angular Native](https://ng-native.com): Angular components on React Native's Fabric renderer, in
5
5
  the `@ng-native/desktop` host. Expo is the build tool (CLI, config, autolinking, Metro), not the
6
6
  runtime. It is not a web app, not Electron and not React: there is no DOM, no web view and no JSX.
@@ -16,13 +16,16 @@ browser-only parts do not: there is no `NgOptimizedImage` (use `<image>`), and n
16
16
 
17
17
  ```sh
18
18
  npm start # Metro, the dev server the app loads from
19
- npm run macos # builds the desktop host (the first time) and opens the app from Metro
19
+ npm run macos # on a Mac: builds the desktop host (the first time) and opens the app from Metro
20
+ npm run linux # on Linux: the same, in GTK
20
21
  npm test # Vitest, in Node against a fake native layer: no app window needed
21
22
  npx vitest --project macos # tests in src/**/*.device.ts, inside the running app, which it
22
23
  # starts, with its own Metro
24
+ npx vitest --project linux # the same in GTK: on Linux, or on a Mac in the ngn-el9 container
23
25
  npm run typecheck
24
- npm run package # the .app
26
+ npm run package # the .app on a Mac, an app folder and .tar.gz on Linux
25
27
  npm run package -- --format dmg # a signed, notarised download; --format mas for the Mac App Store
28
+ npm run package -- --os linux --format deb # --format rpm or flatpak too
26
29
  ```
27
30
 
28
31
  `src/main.ts` mounts the root component, `src/app/app.ts`. Run `npm test` and `npm run typecheck` after a
@@ -67,8 +70,8 @@ change; both are fast.
67
70
  `::before`/`::after` are dropped with a build warning naming the file, line and reason - lay out
68
71
  with flexbox, grid or a block. Everything is `display: flex` with `flex-direction: column` by
69
72
  default, as in React Native.
70
- - Tailwind v4 works through `@ng-native/tailwind`, with `ios:`, `android:`, `macos:`, `desktop:`
71
- and `dark:` variants.
73
+ - Tailwind v4 works through `@ng-native/tailwind`, with `ios:`, `android:`, `macos:`, `linux:`,
74
+ `desktop:` and `dark:` variants.
72
75
 
73
76
  ## Lists, navigation, forms
74
77
 
@@ -1,9 +1,9 @@
1
1
  import { Platform } from 'react-native';
2
2
  import { expect, it } from 'vitest';
3
3
 
4
- // Runs inside the app, on real native views: `npx vitest --project macos`, and `ios` or `android`
5
- // once the app has those projects. Render a component with `render` and `screen` from
6
- // `@ng-native/testing/device`.
4
+ // Runs inside the app, on real native views: AppKit with `npx vitest --project macos`, GTK with
5
+ // `npx vitest --project linux`, and `ios` or `android` once the app has those projects. Render a
6
+ // component with `render` and `screen` from `@ng-native/testing/device`.
7
7
  it('runs inside the app', () => {
8
- expect(['macos', 'ios', 'android']).toContain(Platform.OS);
8
+ expect(['macos', 'linux', 'ios', 'android']).toContain(Platform.OS);
9
9
  });
@@ -23,8 +23,13 @@ interface Page {
23
23
  }
24
24
 
25
25
  const PAGES: readonly Page[] = [
26
- { id: 'home', label: 'Home', sfSymbol: 'house', hint: 'A native macOS app, written in Angular.' },
27
- { id: 'notes', label: 'Notes', sfSymbol: 'note.text', hint: 'Real AppKit views, no web view.' },
26
+ {
27
+ id: 'home',
28
+ label: 'Home',
29
+ sfSymbol: 'house',
30
+ hint: 'A native desktop app, written in Angular.',
31
+ },
32
+ { id: 'notes', label: 'Notes', sfSymbol: 'note.text', hint: 'Real native views, no web view.' },
28
33
  { id: 'settings', label: 'Settings', sfSymbol: 'gearshape', hint: 'One runtime: no IPC.' },
29
34
  ];
30
35
 
@@ -32,8 +37,9 @@ const PAGES: readonly Page[] = [
32
37
  * Element names are lowercase, and that is load-bearing rather than style: an uppercase name such
33
38
  * as <View> matches no component's selector, and the Metro transform fails the build on it.
34
39
  *
35
- * Sizes are a phone's by default and a Mac's under :host-context(.platform-macos), so the app is
36
- * Mac-sized now and still fits a phone if iOS or Android is added later.
40
+ * Sizes are a phone's by default and a desktop's under :host-context(.platform-macos) and
41
+ * :host-context(.platform-linux), so the app is desktop-sized now and still fits a phone if iOS or
42
+ * Android is added later.
37
43
  */
38
44
  @Component({
39
45
  imports: [
@@ -108,14 +114,17 @@ const PAGES: readonly Page[] = [
108
114
  color: #5f5f6b;
109
115
  font-size: 15px;
110
116
  }
111
- :host-context(.platform-macos) .content {
117
+ :host-context(.platform-macos) .content,
118
+ :host-context(.platform-linux) .content {
112
119
  gap: 8px;
113
120
  padding: 20px;
114
121
  }
115
- :host-context(.platform-macos) .title {
122
+ :host-context(.platform-macos) .title,
123
+ :host-context(.platform-linux) .title {
116
124
  font-size: 22px;
117
125
  }
118
- :host-context(.platform-macos) .hint {
126
+ :host-context(.platform-macos) .hint,
127
+ :host-context(.platform-linux) .hint {
119
128
  font-size: 13px;
120
129
  }
121
130
  @media (prefers-color-scheme: dark) {
@@ -2,15 +2,18 @@ import { ngNative } from '@ng-native/testing/vitest';
2
2
  import { deviceTests } from '@ng-native/testing/device/vitest';
3
3
  import { defineConfig } from 'vitest/config';
4
4
 
5
- // Two projects. `node-macos` compiles Angular for the tests the way Metro compiles it for the app
6
- // and runs them in Node against a fake of the native side: no app window. `macos` runs the
7
- // `*.device.ts` files inside the running app on this Mac, starting Metro and the app itself.
8
- // `npm test` runs `node-macos` alone.
5
+ // Four projects. `node-macos` and `node-linux` compile Angular for the tests the way Metro
6
+ // compiles it for the app and run them in Node against a fake of the native side: no app window.
7
+ // `macos` and `linux` run the `*.device.ts` files inside the running app, starting Metro and the
8
+ // app themselves: `macos` on this Mac, `linux` in GTK, on Linux or in the ngn-el9 container on a
9
+ // Mac. `npm test` runs the two Node projects alone.
9
10
  export default defineConfig({
10
11
  test: {
11
12
  projects: [
12
13
  { plugins: [ngNative({ os: 'macos' })], test: { name: 'node-macos' } },
14
+ { plugins: [ngNative({ os: 'linux' })], test: { name: 'node-linux' } },
13
15
  { plugins: [deviceTests({ platform: 'macos' })] },
16
+ { plugins: [deviceTests({ platform: 'linux' })] },
14
17
  ],
15
18
  },
16
19
  });
package/migrations.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
3
  "schematics": {
4
4
  "sync-app-versions": {
5
- "version": "0.26.0",
5
+ "version": "0.27.0",
6
6
  "description": "Move the @ng-native packages each project's own package.json lists to the new version.",
7
7
  "factory": "./migrations/run.cjs#sync-app-versions"
8
8
  },
@@ -60,6 +60,11 @@
60
60
  "version": "0.23.0",
61
61
  "description": "Call each service's available, now a Signal<boolean> on every service, and stop awaiting it.",
62
62
  "factory": "./migrations/run.cjs#available-signal"
63
+ },
64
+ "os-comparisons-on-linux": {
65
+ "version": "0.24.0",
66
+ "description": "Note each comparison with 'ios', 'macos' or !== 'android', which answers differently now that Linux is reported as 'linux'.",
67
+ "factory": "./migrations/run.cjs#os-comparisons-on-linux"
63
68
  }
64
69
  }
65
70
  }
package/mobile/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * `ng generate @ng-native/schematics:mobile native`: a desktop-only Angular Native app that runs on
3
3
  * iOS and Android too, undoing what `--desktop-only` left out.
4
4
  *
5
- * The project's `app.json` lists `ios` and `android` beside `macos`, with the phone settings a
5
+ * The project's `app.json` lists `ios` and `android` beside `macos` and `linux`, with the phone settings a
6
6
  * mobile app's has. The workspace and the project's own `package.json`, whose native modules Expo
7
7
  * autolinks, depend on the phone's status bar and system UI packages again. And the project gains
8
8
  * `run-ios` and `run-android` on the `expo` builder, on the `serve` target's port.
package/native-app.cjs CHANGED
@@ -48,8 +48,11 @@ const DESKTOP_SOURCE_FILES = [
48
48
  */
49
49
  const TEST_PROJECT = 'node';
50
50
 
51
- /** The desktop template's, whose other project opens the app on the Mac. */
52
- const DESKTOP_TEST_PROJECT = 'node-macos';
51
+ /**
52
+ * The desktop template's Vitest projects that run in Node, one for each OS, which `ng test` runs
53
+ * alone: its others open the app.
54
+ */
55
+ const DESKTOP_TEST_PROJECTS = shared.DESKTOP_OSES.map((os) => `node-${os}`);
53
56
 
54
57
  /**
55
58
  * @param {string} name
@@ -97,8 +100,8 @@ module.exports = {
97
100
  ...shared,
98
101
  SOURCE_FILES,
99
102
  DESKTOP_SOURCE_FILES,
103
+ DESKTOP_TEST_PROJECTS,
100
104
  TEST_PROJECT,
101
- DESKTOP_TEST_PROJECT,
102
105
  sourceFile,
103
106
  agentsFile,
104
107
  projectManifest,
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "desktopOnly": {
28
28
  "type": "boolean",
29
- "description": "A macOS-only app from the desktop template: macos alone in expo.platforms, a sidebar and menu bar starter, and macos and package targets in place of run-ios and run-android.",
29
+ "description": "A desktop-only app from the desktop template: macos and linux alone in expo.platforms, a sidebar and menu bar starter, and macos, linux and package targets in place of run-ios and run-android.",
30
30
  "default": false
31
31
  },
32
32
  "skipInstall": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-native/schematics",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "ng add and ng generate for Angular Native: an Expo app in an Angular CLI workspace, with builders that run it.",
5
5
  "keywords": [
6
6
  "angular",
@@ -51,7 +51,7 @@
51
51
  "@angular-devkit/architect": ">=0.2200.0 <0.2300.0",
52
52
  "@angular-devkit/core": "^22.0.0",
53
53
  "@angular-devkit/schematics": "^22.0.0",
54
- "@ng-native/migrate": "0.26.0"
54
+ "@ng-native/migrate": "0.27.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@schematics/angular": "22.1.9"