From 9d0a5ffcdfaec3b0875b43b07cb43eaf4d0f124a Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Fri, 1 May 2026 09:00:02 -0700 Subject: [PATCH] chore(shorebird_code_push_protocol): bump space_gen pin + regen (#3726) --- .../lib/model_helpers.dart | 2 ++ .../messages/create_patch/create_patch_response.dart | 9 ++++++--- .../get_gcp_download_speed_test_url200_response.dart | 6 ++++-- .../get_gcp_upload_speed_test_url200_response.dart | 6 ++++-- .../lib/src/models/app_collaborator_role.dart | 10 +++++----- .../lib/src/models/organization_type.dart | 10 +++++----- .../lib/src/models/private_user.dart | 3 ++- .../lib/src/models/release_platform.dart | 10 +++++----- .../lib/src/models/release_status.dart | 10 +++++----- .../lib/src/models/role.dart | 10 +++++----- packages/shorebird_code_push_protocol/pubspec.yaml | 7 ++----- pubspec.lock | 11 +++++------ 12 files changed, 50 insertions(+), 44 deletions(-) diff --git a/packages/shorebird_code_push_protocol/lib/model_helpers.dart b/packages/shorebird_code_push_protocol/lib/model_helpers.dart index b14712f0..7975a441 100644 --- a/packages/shorebird_code_push_protocol/lib/model_helpers.dart +++ b/packages/shorebird_code_push_protocol/lib/model_helpers.dart @@ -13,6 +13,8 @@ T parseFromJson( ) { try { return build(); + // Rewrapping TypeError as FormatException is the whole point. + // ignore: avoid_catching_errors } on TypeError catch (error) { throw FormatException('Failed to parse $className from JSON: $error', json); } diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/create_patch/create_patch_response.dart b/packages/shorebird_code_push_protocol/lib/src/messages/create_patch/create_patch_response.dart index 6490e938..71215e54 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/create_patch/create_patch_response.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/create_patch/create_patch_response.dart @@ -1,8 +1,11 @@ +// Spec descriptions copy prose verbatim into dartdoc, where `[x]` +// inside a sentence (placeholder text, ALL_CAPS tokens, license +// templates) is parsed as a symbol reference even when no such +// symbol exists. Suppress file-locally so the lint stays live +// elsewhere; spec authors do not always escape brackets. +// ignore_for_file: comment_references import 'package:meta/meta.dart'; import 'package:shorebird_code_push_protocol/model_helpers.dart'; -import 'package:shorebird_code_push_protocol/shorebird_code_push_protocol.dart' - show Patch; -import 'package:shorebird_code_push_protocol/src/models/patch.dart' show Patch; /// {@template create_patch_response} /// The response body for POST /apps/{appId}/patches. Deliberately diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_download_speed_test_url/get_gcp_download_speed_test_url200_response.dart b/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_download_speed_test_url/get_gcp_download_speed_test_url200_response.dart index 1185694f..d8226cee 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_download_speed_test_url/get_gcp_download_speed_test_url200_response.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_download_speed_test_url/get_gcp_download_speed_test_url200_response.dart @@ -11,7 +11,8 @@ class GetGcpDownloadSpeedTestUrl200Response { required this.downloadUrl, }); - /// Converts a `Map` to a [GetGcpDownloadSpeedTestUrl200Response]. + /// Converts a `Map` to a + /// [GetGcpDownloadSpeedTestUrl200Response]. factory GetGcpDownloadSpeedTestUrl200Response.fromJson( Map json, ) { @@ -38,7 +39,8 @@ class GetGcpDownloadSpeedTestUrl200Response { /// The GCP-signed download URL. final String downloadUrl; - /// Converts a [GetGcpDownloadSpeedTestUrl200Response] to a `Map`. + /// Converts a [GetGcpDownloadSpeedTestUrl200Response] + /// to a `Map`. Map toJson() { return { 'download_url': downloadUrl, diff --git a/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_upload_speed_test_url/get_gcp_upload_speed_test_url200_response.dart b/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_upload_speed_test_url/get_gcp_upload_speed_test_url200_response.dart index ad74ff35..a8997df3 100644 --- a/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_upload_speed_test_url/get_gcp_upload_speed_test_url200_response.dart +++ b/packages/shorebird_code_push_protocol/lib/src/messages/get_gcp_upload_speed_test_url/get_gcp_upload_speed_test_url200_response.dart @@ -11,7 +11,8 @@ class GetGcpUploadSpeedTestUrl200Response { required this.uploadUrl, }); - /// Converts a `Map` to a [GetGcpUploadSpeedTestUrl200Response]. + /// Converts a `Map` to a + /// [GetGcpUploadSpeedTestUrl200Response]. factory GetGcpUploadSpeedTestUrl200Response.fromJson( Map json, ) { @@ -38,7 +39,8 @@ class GetGcpUploadSpeedTestUrl200Response { /// The GCP-signed upload URL. final String uploadUrl; - /// Converts a [GetGcpUploadSpeedTestUrl200Response] to a `Map`. + /// Converts a [GetGcpUploadSpeedTestUrl200Response] + /// to a `Map`. Map toJson() { return { 'upload_url': uploadUrl, diff --git a/packages/shorebird_code_push_protocol/lib/src/models/app_collaborator_role.dart b/packages/shorebird_code_push_protocol/lib/src/models/app_collaborator_role.dart index 6320fa30..df95d069 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/app_collaborator_role.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/app_collaborator_role.dart @@ -10,7 +10,7 @@ enum AppCollaboratorRole { const AppCollaboratorRole._(this.value); - /// Creates a AppCollaboratorRole from a json string. + /// Creates a AppCollaboratorRole from a json value. factory AppCollaboratorRole.fromJson(String json) { return AppCollaboratorRole.values.firstWhere( (value) => value.value == json, @@ -19,7 +19,7 @@ enum AppCollaboratorRole { ); } - /// Convenience to create a nullable type from a nullable json object. + /// Convenience to create a nullable type from a nullable json value. /// Useful when parsing optional fields. static AppCollaboratorRole? maybeFromJson(String? json) { if (json == null) { @@ -28,14 +28,14 @@ enum AppCollaboratorRole { return AppCollaboratorRole.fromJson(json); } - /// The value of the enum, as a string. This is the exact value + /// The value of the enum. This is the exact value /// from the OpenAPI spec and will be used for network transport. final String value; - /// Converts the enum to a json string. + /// Converts the enum to its json value. String toJson() => value; - /// Returns the string value of the enum. + /// Returns the string form of the enum. @override String toString() => value; } diff --git a/packages/shorebird_code_push_protocol/lib/src/models/organization_type.dart b/packages/shorebird_code_push_protocol/lib/src/models/organization_type.dart index 56ea123e..c035673e 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/organization_type.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/organization_type.dart @@ -9,7 +9,7 @@ enum OrganizationType { const OrganizationType._(this.value); - /// Creates a OrganizationType from a json string. + /// Creates a OrganizationType from a json value. factory OrganizationType.fromJson(String json) { return OrganizationType.values.firstWhere( (value) => value.value == json, @@ -18,7 +18,7 @@ enum OrganizationType { ); } - /// Convenience to create a nullable type from a nullable json object. + /// Convenience to create a nullable type from a nullable json value. /// Useful when parsing optional fields. static OrganizationType? maybeFromJson(String? json) { if (json == null) { @@ -27,14 +27,14 @@ enum OrganizationType { return OrganizationType.fromJson(json); } - /// The value of the enum, as a string. This is the exact value + /// The value of the enum. This is the exact value /// from the OpenAPI spec and will be used for network transport. final String value; - /// Converts the enum to a json string. + /// Converts the enum to its json value. String toJson() => value; - /// Returns the string value of the enum. + /// Returns the string form of the enum. @override String toString() => value; } diff --git a/packages/shorebird_code_push_protocol/lib/src/models/private_user.dart b/packages/shorebird_code_push_protocol/lib/src/models/private_user.dart index 55cac144..4f99da11 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/private_user.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/private_user.dart @@ -28,7 +28,8 @@ class PrivateUser { id: json['id'] as int, email: json['email'] as String, displayName: json['display_name'] as String?, - hasActiveSubscription: json['has_active_subscription'] as bool?, + hasActiveSubscription: + json['has_active_subscription'] as bool? ?? false, stripeCustomerId: json['stripe_customer_id'] as String?, jwtIssuer: json['jwt_issuer'] as String, patchOverageLimit: json['patch_overage_limit'] as int?, diff --git a/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart b/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart index 5888db4b..25192896 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/release_platform.dart @@ -17,7 +17,7 @@ enum ReleasePlatform { const ReleasePlatform._(this.value); - /// Creates a ReleasePlatform from a json string. + /// Creates a ReleasePlatform from a json value. factory ReleasePlatform.fromJson(String json) { return ReleasePlatform.values.firstWhere( (value) => value.value == json, @@ -26,7 +26,7 @@ enum ReleasePlatform { ); } - /// Convenience to create a nullable type from a nullable json object. + /// Convenience to create a nullable type from a nullable json value. /// Useful when parsing optional fields. static ReleasePlatform? maybeFromJson(String? json) { if (json == null) { @@ -35,14 +35,14 @@ enum ReleasePlatform { return ReleasePlatform.fromJson(json); } - /// The value of the enum, as a string. This is the exact value + /// The value of the enum. This is the exact value /// from the OpenAPI spec and will be used for network transport. final String value; - /// Converts the enum to a json string. + /// Converts the enum to its json value. String toJson() => value; - /// Returns the string value of the enum. + /// Returns the string form of the enum. @override String toString() => value; } diff --git a/packages/shorebird_code_push_protocol/lib/src/models/release_status.dart b/packages/shorebird_code_push_protocol/lib/src/models/release_status.dart index b7cb78c5..eadae474 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/release_status.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/release_status.dart @@ -9,7 +9,7 @@ enum ReleaseStatus { const ReleaseStatus._(this.value); - /// Creates a ReleaseStatus from a json string. + /// Creates a ReleaseStatus from a json value. factory ReleaseStatus.fromJson(String json) { return ReleaseStatus.values.firstWhere( (value) => value.value == json, @@ -17,7 +17,7 @@ enum ReleaseStatus { ); } - /// Convenience to create a nullable type from a nullable json object. + /// Convenience to create a nullable type from a nullable json value. /// Useful when parsing optional fields. static ReleaseStatus? maybeFromJson(String? json) { if (json == null) { @@ -26,14 +26,14 @@ enum ReleaseStatus { return ReleaseStatus.fromJson(json); } - /// The value of the enum, as a string. This is the exact value + /// The value of the enum. This is the exact value /// from the OpenAPI spec and will be used for network transport. final String value; - /// Converts the enum to a json string. + /// Converts the enum to its json value. String toJson() => value; - /// Returns the string value of the enum. + /// Returns the string form of the enum. @override String toString() => value; } diff --git a/packages/shorebird_code_push_protocol/lib/src/models/role.dart b/packages/shorebird_code_push_protocol/lib/src/models/role.dart index 7a087140..609f3670 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/role.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/role.dart @@ -21,7 +21,7 @@ enum Role { const Role._(this.value); - /// Creates a Role from a json string. + /// Creates a Role from a json value. factory Role.fromJson(String json) { return Role.values.firstWhere( (value) => value.value == json, @@ -29,7 +29,7 @@ enum Role { ); } - /// Convenience to create a nullable type from a nullable json object. + /// Convenience to create a nullable type from a nullable json value. /// Useful when parsing optional fields. static Role? maybeFromJson(String? json) { if (json == null) { @@ -38,14 +38,14 @@ enum Role { return Role.fromJson(json); } - /// The value of the enum, as a string. This is the exact value + /// The value of the enum. This is the exact value /// from the OpenAPI spec and will be used for network transport. final String value; - /// Converts the enum to a json string. + /// Converts the enum to its json value. String toJson() => value; - /// Returns the string value of the enum. + /// Returns the string form of the enum. @override String toString() => value; } diff --git a/packages/shorebird_code_push_protocol/pubspec.yaml b/packages/shorebird_code_push_protocol/pubspec.yaml index 2e81dcd2..82caa819 100644 --- a/packages/shorebird_code_push_protocol/pubspec.yaml +++ b/packages/shorebird_code_push_protocol/pubspec.yaml @@ -16,9 +16,6 @@ dependencies: dev_dependencies: mocktail: ^1.0.5 # Only used by `tool/gen.dart` to regenerate lib/src/ from the OpenAPI - # spec. Pinned to a git commit until space_gen publishes to pub.dev. - space_gen: - git: - url: https://github.com/eseidel/space_gen.git - ref: 58b4410a9b25bf58e3f76a4ae979cad52d4909cc + # spec. + space_gen: ^1.2.2 test: ^1.31.1 diff --git a/pubspec.lock b/pubspec.lock index 6cf77a02..786f7fb2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -676,12 +676,11 @@ packages: space_gen: dependency: transitive description: - path: "." - ref: "58b4410a9b25bf58e3f76a4ae979cad52d4909cc" - resolved-ref: "58b4410a9b25bf58e3f76a4ae979cad52d4909cc" - url: "https://github.com/eseidel/space_gen.git" - source: git - version: "1.0.1" + name: space_gen + sha256: "3aea8da8ffba5802110322093ef4e921e297d9b55ffa073a74b6cb38fd225ee1" + url: "https://pub.dev" + source: hosted + version: "1.2.2" stack_trace: dependency: transitive description: