@blotch/angular-lynx-build 22.2.4 → 22.2.6
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/README.md
CHANGED
|
@@ -42,6 +42,7 @@ It is the only build dependency an AngularLynx app needs, as `@angular/build` is
|
|
|
42
42
|
| `application` | `ng build` | Builds the Lynx bundle (and the web preview bundle) into `dist/` with [rspeedy](https://lynxjs.org/rspeedy/) |
|
|
43
43
|
| | `ng build --watch` | Rebuilds the bundle whenever a file changes |
|
|
44
44
|
| | `ng build --platform ios` | Then builds the iOS app (`--platform android` or `all` for the others) into `dist/<platform>/` |
|
|
45
|
+
| | `... --run` | Then installs the app on a simulator, emulator or phone and opens it (`--device` to choose one) |
|
|
45
46
|
| `dev-server` | `ng serve` | Runs rspeedy's dev server for Lynx Explorer and the web preview, and prints the QR code Lynx Explorer scans |
|
|
46
47
|
| `unit-test` | `ng test` | Runs the unit tests with Angular's own unit-test builder (Vitest), set up for Lynx |
|
|
47
48
|
| `extract-i18n` | `ng extract-i18n` | Extracts the i18n messages with Angular's own extract-i18n builder, set up for Lynx |
|
|
@@ -56,6 +56,11 @@ const runApplication = async function* (options, context, deps = defaultDeps) {
|
|
|
56
56
|
};
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
+
const runError = checkRunOptions(options, platforms);
|
|
60
|
+
if (runError) {
|
|
61
|
+
yield { success: false, error: runError };
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
59
64
|
let rspeedy;
|
|
60
65
|
let native;
|
|
61
66
|
let workDir = '';
|
|
@@ -112,6 +117,7 @@ const runApplication = async function* (options, context, deps = defaultDeps) {
|
|
|
112
117
|
bundleDir,
|
|
113
118
|
outputDir: node_path_1.default.join(bundleDir, platform),
|
|
114
119
|
app: options,
|
|
120
|
+
run: options.run ? { device: options.device } : undefined,
|
|
115
121
|
log: (message) => context.logger.info(message),
|
|
116
122
|
});
|
|
117
123
|
for (const artifact of artifacts) {
|
|
@@ -125,6 +131,22 @@ const runApplication = async function* (options, context, deps = defaultDeps) {
|
|
|
125
131
|
}
|
|
126
132
|
};
|
|
127
133
|
exports.runApplication = runApplication;
|
|
134
|
+
/**
|
|
135
|
+
* Checks that `--run` and `--device` come with what they need, so a mistake
|
|
136
|
+
* fails before a minute of building rather than after it.
|
|
137
|
+
*/
|
|
138
|
+
const checkRunOptions = (options, platforms) => {
|
|
139
|
+
if (options.device && !options.run) {
|
|
140
|
+
return '--device picks where --run opens the app. Add --run.';
|
|
141
|
+
}
|
|
142
|
+
if (options.run && platforms.length === 0) {
|
|
143
|
+
return '--run installs and opens the app that --platform builds. Add --platform ios or --platform android.';
|
|
144
|
+
}
|
|
145
|
+
if (options.device && platforms.length > 1) {
|
|
146
|
+
return '--device names one simulator, emulator or phone. Use it with --platform ios or --platform android, not all.';
|
|
147
|
+
}
|
|
148
|
+
return undefined;
|
|
149
|
+
};
|
|
128
150
|
/**
|
|
129
151
|
* `ng build --watch`: rspeedy's watch build, reporting each compile's result.
|
|
130
152
|
* Compile errors fail that result but keep watching, as in Angular, so the
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
"enum": ["ios", "android", "all"],
|
|
12
12
|
"description": "Also build native binaries into dist/<platform>/. Without it, only the bundle is built, as `rspeedy build` does."
|
|
13
13
|
},
|
|
14
|
+
"run": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": false,
|
|
17
|
+
"description": "After --platform builds the app, install it on a simulator, emulator or phone and open it. iOS uses the running simulator, or else starts the newest iPhone simulator; Android uses the running emulator or connected phone, or else starts the first virtual device."
|
|
18
|
+
},
|
|
19
|
+
"device": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "With --run, where to open the app: on iOS a simulator's name (e.g. \"iPhone 18 Pro\") or UDID, on Android a virtual device's name or an adb serial (e.g. emulator-5554)."
|
|
22
|
+
},
|
|
14
23
|
"watch": {
|
|
15
24
|
"type": "boolean",
|
|
16
25
|
"default": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blotch/angular-lynx-build",
|
|
3
|
-
"version": "22.2.
|
|
3
|
+
"version": "22.2.6",
|
|
4
4
|
"description": "Angular CLI builders for AngularLynx: ng build, ng serve and ng test for Lynx, and native iOS and Android apps",
|
|
5
5
|
"homepage": "https://github.com/Blotch-Smart-Frames/AngularLynx#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"publish:local": "yalc publish --push"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@blotch/angular-lynx-native": "22.2.
|
|
55
|
-
"@blotch/rsbuild-plugin-angular-lynx": "22.2.
|
|
54
|
+
"@blotch/angular-lynx-native": "22.2.6",
|
|
55
|
+
"@blotch/rsbuild-plugin-angular-lynx": "22.2.6",
|
|
56
56
|
"@lynx-js/qrcode-rsbuild-plugin": "^0.7.3",
|
|
57
57
|
"@lynx-js/rspeedy": "^0.18.0"
|
|
58
58
|
},
|