Skip to content

Commit 5544ebc

Browse files
committed
v1.6.0
Add nylo metro command and remove [SUCCESS] prefix from self-update confirmation.
1 parent 39d8f6e commit 5544ebc

8 files changed

Lines changed: 99 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [1.6.0] - 2026-03-28
2+
3+
### Added
4+
- `nylo metro <command>` command: run metro commands via `dart run nylo_framework:main` (e.g. `nylo metro make:model User`)
5+
6+
### Fixed
7+
- Self-update command: use plain `write()` instead of `writeSuccess()` for the "Updated nylo_installer" confirmation message to remove misleading `[SUCCESS]` prefix
8+
19
## [1.5.3] - 2026-03-28
210

311
### Changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Commands:
2020
--ios Deep clean iOS (remove Pods, re-run pod install)
2121
--android Deep clean Android (run gradlew clean)
2222
--all Deep clean both iOS and Android
23+
metro <command> Run a metro command (e.g. make:model)
2324
test Format and run Flutter tests
2425
--no-format Skip formatting before running tests
2526
--filter=<pattern> Filter tests by name
@@ -97,6 +98,18 @@ nylo test --path integration_test # Specify test directory
9798
nylo test --filter "auth" --coverage
9899
```
99100

101+
### `nylo metro <command>`
102+
103+
Run metro commands without needing the metro alias:
104+
105+
```bash
106+
nylo metro make:model User
107+
nylo metro make:page HomePage
108+
nylo metro make:controller HomeController
109+
```
110+
111+
This runs `dart run nylo_framework:main <command>` behind the scenes.
112+
100113
### `nylo self-update`
101114

102115
Update nylo to the latest version from pub.dev:

bin/nylo.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'dart:io';
44
import 'package:args/args.dart';
55
import 'package:nylo_installer/src/commands/clean_command.dart';
66
import 'package:nylo_installer/src/commands/init_command.dart';
7+
import 'package:nylo_installer/src/commands/metro_command.dart';
78
import 'package:nylo_installer/src/commands/new_command.dart';
89
import 'package:nylo_installer/src/commands/self_update_command.dart';
910
import 'package:nylo_installer/src/commands/test_command.dart';
@@ -60,6 +61,11 @@ void main(List<String> arguments) async {
6061
results.rest.length > 1 ? results.rest.sublist(1) : <String>[];
6162
await TestCommand().run(testArgs);
6263
break;
64+
case 'metro':
65+
final metroArgs =
66+
results.rest.length > 1 ? results.rest.sublist(1) : <String>[];
67+
await MetroCommand().run(metroArgs);
68+
break;
6369
case 'self-update':
6470
await SelfUpdateCommand().run();
6571
break;
@@ -97,6 +103,7 @@ void _printUsage() {
97103
--ios Deep clean iOS (remove Pods, re-run pod install)
98104
--android Deep clean Android (run gradlew clean)
99105
--all Deep clean both iOS and Android
106+
metro <command> Run a metro command (e.g. make:model)
100107
test Format and run Flutter tests
101108
--no-format Skip formatting before running tests
102109
--filter=<pattern> Filter tests by name
@@ -117,6 +124,7 @@ void _printUsage() {
117124
nylo clean --all
118125
nylo test
119126
nylo test --filter "login" --coverage
127+
nylo metro make:model User
120128
nylo self-update
121129
122130
Documentation: ${Constants.docsUrl}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import 'dart:io';
2+
3+
import 'package:nylo_installer/src/utils/process_runner.dart';
4+
5+
/// Command to run metro commands via dart run nylo_framework:main
6+
class MetroCommand {
7+
Future<void> run(List<String> arguments) async {
8+
final result = await ProcessRunner.run(
9+
'dart',
10+
['run', 'nylo_framework:main', ...arguments],
11+
inheritStdio: true,
12+
);
13+
14+
if (result.exitCode != 0) {
15+
exit(result.exitCode);
16+
}
17+
}
18+
}

lib/src/commands/self_update_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ class SelfUpdateCommand {
5050
exit(1);
5151
}
5252

53-
NyloConsole.writeSuccess('Updated nylo_installer to $latestVersion');
53+
NyloConsole.write('Updated nylo_installer to $latestVersion');
5454
}
5555
}

lib/src/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Constants {
88
static const String templateRepoUrl = 'https://github.com/nylo-core/nylo';
99

1010
/// Installer version
11-
static const String version = '1.5.3';
11+
static const String version = '1.6.0';
1212

1313
/// Documentation URL
1414
static const String docsUrl = 'https://nylo.dev/docs';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_installer
22
description: CLI tool to create new Nylo Flutter projects. Quickly scaffold production-ready Flutter applications.
3-
version: 1.5.3
3+
version: 1.6.0
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/nylo-installer
66
issue_tracker: https://github.com/nylo-core/nylo-installer/issues

test/metro_command_test.dart

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import 'dart:io';
2+
3+
import 'package:test/test.dart';
4+
5+
void main() {
6+
group('MetroCommand', () {
7+
group('CLI integration', () {
8+
test('help should list metro command', () async {
9+
final result = await Process.run(
10+
'dart',
11+
['run', 'bin/nylo.dart', '--help'],
12+
);
13+
14+
expect(result.exitCode, equals(0));
15+
expect(result.stdout, contains('metro'));
16+
expect(result.stdout, contains('metro <command>'));
17+
});
18+
19+
test('metro should be a recognized command', () async {
20+
// Running metro without being in a Nylo project will fail,
21+
// but it should NOT trigger the "Unknown command" error path.
22+
final result = await Process.run(
23+
'dart',
24+
['run', 'bin/nylo.dart', 'metro'],
25+
);
26+
27+
expect(result.stderr, isNot(contains('Unknown command')));
28+
}, timeout: Timeout(Duration(seconds: 30)));
29+
30+
test('metro with arguments should be a recognized command', () async {
31+
final result = await Process.run(
32+
'dart',
33+
['run', 'bin/nylo.dart', 'metro', 'make:model', 'User'],
34+
);
35+
36+
expect(result.stderr, isNot(contains('Unknown command')));
37+
}, timeout: Timeout(Duration(seconds: 30)));
38+
39+
test('metro example should appear in help', () async {
40+
final result = await Process.run(
41+
'dart',
42+
['run', 'bin/nylo.dart', '--help'],
43+
);
44+
45+
expect(result.stdout, contains('nylo metro'));
46+
});
47+
});
48+
});
49+
}

0 commit comments

Comments
 (0)