-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dart_frog_cli): add dart_frog_new_brick for routes #623
Conversation
b2af796
to
c28494c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to get this merged, I left some comments. Let me know what you think! Besides, I also tested the tool this are some interesting findings:
Given the file structure:
hello
-- index.dart
-- world.py # Not a dart file!
Then doing mason make dart_frog_new world
.
I get as expected:
hello/
-- index.dart
-- world.py
-- world.dart
Do we have (or eventually within e2e) a test to verify this behaviour?
Given the file structure:
hello[id].dart
Then doing mason make dart_frog_new hello[id]/ee[id]
.
Gives:
hello[id]/
-- index.dart
-- ee[id].dart
The content of ee[id].dart is not valid Dart code, since it has two declarations with the same name.
import 'package:dart_frog/dart_frog.dart';
Response onRequest(
RequestContext context,
String id,
String id,
) {
return Response(body: 'Welcome to Dart Frog!');
}
Given:
hello/
-- index.dart
Doing mason make dart_frog_new hello
.
Fails as expected but immediately after reporting:
Failed to create type: /hello already exists.
✗ Making dart_frog_new (15ms)
type 'Null' is not a subtype of type 'Object' # This line is not a nice error message
Is the last error line intended?
012507b
to
2bdcba8
Compare
Goo idea, will add to the doc |
Good catch, added a ceghck for that, will add to the doc as well |
2bdcba8
to
0a277e4
Compare
0a277e4
to
c82e69f
Compare
Closing and reopening to kick actions |
It is not, but it happens with you use Mason directly since it always runs the brick and postgen even if pregen fails. That doesn't happen when integrated with our cli. |
e1ff98b
to
882026e
Compare
Status
READY
Description
Extracted from #616, adds the "new" brick with the implementation for route creation
This is the bulk of #260
Type of Change