Skip to content

Commit e0f7c3b

Browse files
agordn52Anthony Gordon
authored andcommitted
chore(release): bump version to 7.21.0
1 parent 654d9bb commit e0f7c3b

5 files changed

Lines changed: 7 additions & 129 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [7.21.0] - 2026-04-28
2+
3+
### Removed (BREAKING)
4+
5+
* **Metro CLI theme scaffolding commands removed** - The `make:theme` and `make:theme_colors` Metro commands have been removed along with their underlying methods (`MetroService.makeTheme`, `MetroService.makeThemeColors`, `MetroService.addToTheme`). The `themesFolder`, `themeColorsFolder`, and `themeDarkFlag` constants have also been removed. Themes can still be created manually in `lib/resources/themes/`
6+
17
## [7.20.2] - 2026-04-26
28

39
### Changed

lib/metro/src/constants/strings.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const String fileOption = 'file';
33
const String helpFlag = 'help';
44
const String forceFlag = 'force';
5-
const String themeDarkFlag = 'dark';
65
const String controllerFlag = 'controller';
76
const String modelFlag = 'model';
87
const String jsonFlag = 'json';
@@ -22,7 +21,6 @@ const String controllersFolder = 'lib/app/controllers';
2221
const String widgetsFolder = 'lib/resources/widgets';
2322
const String pagesFolder = 'lib/resources/pages';
2423
const String modelsFolder = 'lib/app/models';
25-
const String themesFolder = 'lib/resources/themes';
2624
const String providerFolder = 'lib/app/providers';
2725
const String formsFolder = 'lib/app/forms';
2826
const String eventsFolder = 'lib/app/events';
@@ -32,7 +30,6 @@ const String networkingInterceptorsFolder =
3230
const String bootstrapFolder = 'lib/bootstrap';
3331
const String configFolder = 'lib/config';
3432
const String commandsFolder = 'lib/app/commands';
35-
const String themeColorsFolder = 'lib/resources/themes/styles';
3633
const String routeGuardsFolder = 'lib/routes/guards';
3734
const String langFolder = 'lang';
3835

lib/metro/src/metro_service.dart

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -318,58 +318,6 @@ final Map<Type, BaseController> controllers = {$match
318318
);
319319
}
320320

321-
/// Adds a Theme to your config/theme.dart file.
322-
static Future<void> addToTheme(String className) async {
323-
String name = className.replaceAll(RegExp(r'(_?theme)'), "");
324-
ReCase nameReCase = ReCase(name);
325-
326-
String classesToAdd =
327-
"""import '/resources/themes/styles/${nameReCase.snakeCase}_theme_colors.dart';
328-
import '/resources/themes/${nameReCase.snakeCase}_theme.dart';""";
329-
330-
String template =
331-
"""BaseThemeConfig<ColorStyles>(
332-
id: '${nameReCase.snakeCase}_theme',
333-
description: "${nameReCase.titleCase} theme",
334-
theme: ${nameReCase.paramCase}Theme,
335-
colors: ${nameReCase.pascalCase}ThemeColors(),
336-
),""";
337-
338-
String filePath = "lib/config/theme.dart";
339-
String originalFile = await loadAsset(filePath);
340-
341-
// create new file
342-
if (originalFile.contains(template)) {
343-
return;
344-
}
345-
346-
RegExp reg = RegExp(
347-
r'final List<BaseThemeConfig<ColorStyles>> appThemes = \[([^}]*)\];',
348-
);
349-
final match = _getFirstRegexMatch(reg, originalFile);
350-
if (match == null) {
351-
return;
352-
}
353-
354-
String temp =
355-
"""final List<BaseThemeConfig<ColorStyles>> appThemes = [$match $template
356-
];""";
357-
358-
String newFile = originalFile.replaceFirst(
359-
RegExp(
360-
r'final List<BaseThemeConfig<ColorStyles>> appThemes = \[([^}]*)\];',
361-
),
362-
temp,
363-
);
364-
365-
// Add import
366-
newFile = "$classesToAdd\n$newFile";
367-
368-
// save new file
369-
final File file = File(filePath);
370-
await file.writeAsString(newFile);
371-
}
372-
373321
/// Runs a process
374322
static Future<int> runProcess(String command) async {
375323
List<String> commands = command.split(" ");
@@ -772,30 +720,6 @@ final Map<Type, dynamic> modelDecoders = {$match
772720
);
773721
}
774722

775-
/// Creates a new Theme.
776-
static Future<void> makeTheme(
777-
String className,
778-
String value, {
779-
String folderPath = themesFolder,
780-
bool forceCreate = false,
781-
}) async {
782-
String name = className.replaceAll(RegExp(r'(_?theme)'), "");
783-
784-
String filePath = '$folderPath/${name.snakeCase}_theme.dart';
785-
786-
await _makeDirectory(folderPath);
787-
await _checkIfFileExists(filePath, shouldForceCreate: forceCreate);
788-
await _createNewFile(
789-
filePath,
790-
value,
791-
onSuccess: () {
792-
final linkText = '${name.snakeCase}_theme';
793-
final link = MetroConsole.hyperlink(linkText, filePath);
794-
MetroConsole.writeInGreen('[Theme] $link created 🎉');
795-
},
796-
);
797-
}
798-
799723
/// Creates a new Provider.
800724
static Future<void> makeProvider(
801725
String className,
@@ -1063,29 +987,6 @@ final Map<Type, NyApiService> apiDecoders = {$match
1063987
);
1064988
}
1065989

1066-
/// Creates a new Theme Colors file.
1067-
static Future<void> makeThemeColors(
1068-
String className,
1069-
String value, {
1070-
String folderPath = themeColorsFolder,
1071-
bool forceCreate = false,
1072-
}) async {
1073-
String filePath =
1074-
'$folderPath/${className.toLowerCase()}_theme_colors.dart';
1075-
1076-
await _makeDirectory(folderPath);
1077-
await _checkIfFileExists(filePath, shouldForceCreate: forceCreate);
1078-
await _createNewFile(
1079-
filePath,
1080-
value,
1081-
onSuccess: () {
1082-
final linkText = '${className.toLowerCase()}_theme_colors';
1083-
final link = MetroConsole.hyperlink(linkText, filePath);
1084-
MetroConsole.writeInGreen('[Theme Colors] $link created 🎉');
1085-
},
1086-
);
1087-
}
1088-
1089990
/// Check if a file exist by passing in a [path].
1090991
static Future<bool> hasFile(String path) async => await File(path).exists();
1091992

@@ -1245,18 +1146,6 @@ final Map<Type, NyApiService> apiDecoders = {$match
12451146
);
12461147
break;
12471148
}
1248-
case themesFolder:
1249-
{
1250-
if (templateName.contains("_theme")) {
1251-
templateName = templateName.replaceAll("_theme", "");
1252-
}
1253-
await makeTheme(
1254-
templateName,
1255-
template.stub,
1256-
forceCreate: (hasForceFlag ?? false),
1257-
);
1258-
break;
1259-
}
12601149
case providerFolder:
12611150
{
12621151
if (templateName.contains("_provider")) {
@@ -1296,18 +1185,6 @@ final Map<Type, NyApiService> apiDecoders = {$match
12961185
);
12971186
break;
12981187
}
1299-
case themeColorsFolder:
1300-
{
1301-
if (templateName.contains("_theme_colors")) {
1302-
templateName = templateName.replaceAll("_theme_colors", "");
1303-
}
1304-
await makeThemeColors(
1305-
templateName,
1306-
template.stub,
1307-
forceCreate: (hasForceFlag ?? false),
1308-
);
1309-
break;
1310-
}
13111188
case formsFolder:
13121189
{
13131190
if (templateName.contains("_form")) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_support
22
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
3-
version: 7.20.2
3+
version: 7.21.0
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/support/tree/7.x
66
issue_tracker: https://github.com/nylo-core/support/issues

test/metro/metro_service_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,13 @@ void main() {
170170
expect(widgetsFolder, 'lib/resources/widgets');
171171
expect(pagesFolder, 'lib/resources/pages');
172172
expect(modelsFolder, 'lib/app/models');
173-
expect(themesFolder, 'lib/resources/themes');
174173
expect(providerFolder, 'lib/app/providers');
175174
expect(formsFolder, 'lib/app/forms');
176175
expect(eventsFolder, 'lib/app/events');
177176
expect(networkingFolder, 'lib/app/networking');
178177
expect(bootstrapFolder, 'lib/bootstrap');
179178
expect(configFolder, 'lib/config');
180179
expect(commandsFolder, 'lib/app/commands');
181-
expect(themeColorsFolder, 'lib/resources/themes/styles');
182180
expect(routeGuardsFolder, 'lib/routes/guards');
183181
expect(langFolder, 'lang');
184182
});

0 commit comments

Comments
 (0)