Closed SkywaveTM closed 1 year ago
Thanks for your contribution! :)
Hi @SkywaveTM , thanks for your feedback! :)
I'm not very familiar with this issue, but is it related to this?
Hi @SkywaveTM , thanks for your feedback! :)
I'm not very familiar with this issue, but is it related to this?
Thanks for the reply :D
Anyway, It seems that that is not relevant since I don't get any exceptions. The problem I faced is that after preparing fresh dev environments, set by cloning the repository and runningdart pub get
, dart run build_runner build
complains about conflicts between auto generated source codes existing on the main branch and newly generated one.
Hi @SkywaveTM ,
What exactly is the conflict between sources? I have tried to follow your procedure to generate the code, but only got the following diffs.
Map<String, dynamic> _$$_InstanceActivityToJson(_$_InstanceActivity instance) {
+ final val = <String, dynamic>{};
+
+ void writeNotNull(String key, dynamic value) {
+ if (value != null) {
+ val[key] = value;
+ }
+ }
+
+ writeNotNull('week', const UnixTimestampConverter().toJson(instance.week));
+ writeNotNull('statuses', const IntConverter().toJson(instance.statusCount));
+ writeNotNull('logins', const IntConverter().toJson(instance.loginCount));
+ writeNotNull(
+ 'registrations', const IntConverter().toJson(instance.registrationCount));
+ return val;
}
Is this the conflict you are referring to?
@SkywaveTM ,
Or maybe this message?
[INFO] Found 93 declared outputs which already exist on disk. This is likely because the`.dart_tool/build` folder was deleted, or you are submitting generated files to your source repository.
Delete these files?
1 - Delete
2 - Cancel build
3 - List conflicts
@SkywaveTM ,
Or maybe this message?
[INFO] Found 93 declared outputs which already exist on disk. This is likely because the`.dart_tool/build` folder was deleted, or you are submitting generated files to your source repository. Delete these files? 1 - Delete 2 - Cancel build 3 - List conflicts
Yes, exactly (except that I got 89 conflicts). Maybe I had to include the whole outputs earlier :p
@SkywaveTM ,
Oh just a few minutes ago I ran dart upgrade --null-safety
and committed the code generated from the latest dependencies...
https://github.com/mastodon-dart/mastodon-api/pull/87/files
Basically, you can always use the latest dependencies, and also please select 1: Delete
when that option is given, I'll check if it's a breaking change :)
btw, are you interested in pull requests? I'm welcome to add endpoints or even improve the internal process :)
There are few difficulties in adding endpoints, since a generic request mechanism and a mechanism for converting them to model objects already exist :)
@all-contributors please add @SkywaveTM for ideas
@myConsciousness
I've put up a pull request to add @SkywaveTM! :tada:
1. What could be improved
freeze
package, which is being used for generating model classes, could produces different outputs within the versions with the same major version (check commit history for that file). With current version constraints, auto generated codes are not deterministic since different versions offreezed
package could be used.You may reproduce this by playing with follwing commands -
dart pub upgrade
,dart pub downgrade
,dart run build_runner build
,dart run build_runner clean
2. Why should this be improved
Contributors may override exiting auto generated codes with auto generated codes in their environment.
3. Any risks?
You may need to manually upgrade
freeze
package.4. More information