Skip to content

Conversation

Oksamies
Copy link
Contributor

@Oksamies Oksamies commented Oct 3, 2025

And the related object schemas
Additionally the existing PackageDependency type needs to be renamed to
be more accurate. As it's a package dependency returned with the package
listing

Copy link

coderabbitai bot commented Oct 3, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Renames packageDependency to packageListingDependency across schemas and types and updates the ListingDependency component and PackageListingDetails to use PackageListingDependency. Adds a new packageVersionDependencySchema and PackageVersionDependency type, plus request and query param schemas for package version dependencies. Introduces a paginated packageVersionDependenciesResponseDataSchema and exports PackageVersionDependenciesResponseData. Adds a new fetchPackageVersionDependencies API function and re-exports it from the package index. Adds a unit test for package version dependencies and adds a versionNumber field to the test defaultConfig.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately highlights the primary change by stating the addition of the fetchPackageVersionDependencies function to the thunderstore-api. It is concise, clear, and free of unnecessary details.
Description Check ✅ Passed The pull request description clearly references the object schema changes and the renaming of the PackageDependency type, which directly correspond to the updates in the code. It stays on topic and describes relevant aspects of the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor Author

Oksamies commented Oct 3, 2025

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1)

21-23: Schema validation assertion could be clearer.

The assertion expect(packageVersionDependenciesResponseDataSchema.parse(response)).toBe(response) will always pass because Zod's parse returns the input when validation succeeds. Consider asserting on specific response fields or just calling parse to verify validation without the .toBe() check.

Apply this diff for a clearer assertion:

-  expect(packageVersionDependenciesResponseDataSchema.parse(response)).toBe(
-    response
-  );
+  // Validate response structure
+  packageVersionDependenciesResponseDataSchema.parse(response);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37e7161 and 59df60b.

📒 Files selected for processing (10)
  • apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1 hunks)
  • packages/dapper/src/types/package.ts (2 hunks)
  • packages/thunderstore-api/src/__tests__/defaultConfig.ts (1 hunks)
  • packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1 hunks)
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts (1 hunks)
  • packages/thunderstore-api/src/index.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/objectSchemas.ts (3 hunks)
  • packages/thunderstore-api/src/schemas/queryParamSchemas.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/requestSchemas.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/responseSchemas.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • packageListingDependencySchema (145-153)
packages/thunderstore-api/src/schemas/responseSchemas.ts (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • packageVersionDependencySchema (230-238)
packages/dapper/src/types/package.ts (1)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
  • PackageListingDependency (155-157)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (3)
packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)
  • testData (11-16)
packages/thunderstore-api/src/get/packageVersionDependencies.ts (1)
  • fetchPackageVersionDependencies (11-35)
packages/thunderstore-api/src/schemas/responseSchemas.ts (1)
  • packageVersionDependenciesResponseDataSchema (135-140)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
packages/dapper/src/types/package.ts (1)
  • PackageListingDependency (37-45)
packages/thunderstore-api/src/get/packageVersionDependencies.ts (5)
packages/thunderstore-api/src/index.ts (1)
  • ApiEndpointProps (9-15)
packages/thunderstore-api/src/schemas/requestSchemas.ts (1)
  • PackageVersionDependenciesRequestParams (198-200)
packages/thunderstore-api/src/schemas/queryParamSchemas.ts (2)
  • PackageVersionDependenciesRequestQueryParams (83-85)
  • packageVersionDependenciesRequestQueryParamsSchema (79-81)
packages/thunderstore-api/src/schemas/responseSchemas.ts (2)
  • PackageVersionDependenciesResponseData (142-144)
  • packageVersionDependenciesResponseDataSchema (135-140)
packages/thunderstore-api/src/apiFetch.ts (1)
  • apiFetch (59-114)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Generate visual diffs
🔇 Additional comments (7)
packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)

15-15: LGTM!

The addition of versionNumber to test data properly supports the new package version dependencies endpoint tests.

packages/dapper/src/types/package.ts (1)

26-26: LGTM!

The rename from PackageDependency to PackageListingDependency better clarifies the scope of this type (listing-level vs. version-level dependencies). The change is consistent with the new schema naming introduced in the thunderstore-api package.

Also applies to: 37-45

packages/thunderstore-api/src/schemas/requestSchemas.ts (1)

191-200: LGTM!

The new request params schema follows the established pattern and correctly includes the three required path parameters for the package version dependencies endpoint.

packages/thunderstore-api/src/index.ts (1)

36-36: LGTM!

The export is correctly placed in alphabetical order and exposes the new fetchPackageVersionDependencies function.

apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1)

1-1: LGTM!

The type update correctly reflects the schema rename from packageDependencySchema to packageListingDependencySchema with no behavioral changes.

Also applies to: 6-6

packages/thunderstore-api/src/schemas/queryParamSchemas.ts (1)

78-85: LGTM!

The query params schema correctly defines pagination support for the package version dependencies endpoint, reusing the existing pageQueryParam definition.

packages/thunderstore-api/src/schemas/responseSchemas.ts (1)

135-144: LGTM!

The response schema follows the established paginated response pattern and correctly uses packageVersionDependencySchema for the results array.

@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from 59df60b to fb0216b Compare October 3, 2025 14:58
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from fb0216b to 1f3e6ac Compare October 3, 2025 15:02
And the related object schemas
Additionally the existing PackageDependency type needs to be renamed to
be more accurate. As it's a package dependency returned with the package
listing
@Oksamies Oksamies force-pushed the 10-03-add_fetchpackageversiondependencies_function_to_thunderstore-api branch from 1f3e6ac to 6a1591e Compare October 3, 2025 15:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (2)

16-16: Remove the typo and extra field.

The queryParams contains a typo impotent (likely meant to be important or removed entirely). Additionally, this field is not part of the query param schema and should be removed.

Apply this diff:

-    queryParams: [{ key: "page", value: 1, impotent: 1 }],
+    queryParams: [{ key: "page", value: 1 }],

21-23: Use toEqual for value comparison.

Schema validation tests should use toEqual() rather than toBe() since parse() may return a new object instance with identical values.

This is already correctly implemented in the current code.

🧹 Nitpick comments (1)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1)

15-15: Remove unnecessary data property.

The data: {} is not needed for GET endpoints and can be removed for clarity.

Apply this diff:

     params: {
       namespace_id: namespaceId,
       package_name: packageName,
       version_number: versionNumber,
     },
-    data: {},
     queryParams: [{ key: "page", value: 1 }],
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb0216b and 6a1591e.

📒 Files selected for processing (9)
  • apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx (1 hunks)
  • packages/dapper/src/types/package.ts (2 hunks)
  • packages/thunderstore-api/src/__tests__/defaultConfig.ts (1 hunks)
  • packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (1 hunks)
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts (1 hunks)
  • packages/thunderstore-api/src/index.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/objectSchemas.ts (3 hunks)
  • packages/thunderstore-api/src/schemas/requestSchemas.ts (1 hunks)
  • packages/thunderstore-api/src/schemas/responseSchemas.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/thunderstore-api/src/index.ts
  • packages/thunderstore-api/src/get/packageVersionDependencies.ts
  • packages/thunderstore-api/src/schemas/requestSchemas.ts
  • packages/dapper/src/types/package.ts
  • apps/cyberstorm-remix/app/commonComponents/ListingDependency/ListingDependency.tsx
  • packages/thunderstore-api/src/schemas/responseSchemas.ts
🧰 Additional context used
🧬 Code graph analysis (2)
packages/thunderstore-api/src/get/__tests__/packageVersionDependencies.test.ts (3)
packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)
  • testData (11-16)
packages/thunderstore-api/src/get/packageVersionDependencies.ts (1)
  • fetchPackageVersionDependencies (11-35)
packages/thunderstore-api/src/schemas/responseSchemas.ts (1)
  • packageVersionDependenciesResponseDataSchema (135-140)
packages/thunderstore-api/src/schemas/objectSchemas.ts (1)
packages/dapper/src/types/package.ts (1)
  • PackageListingDependency (37-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Generate visual diffs
🔇 Additional comments (3)
packages/thunderstore-api/src/schemas/objectSchemas.ts (2)

145-157: LGTM on the rename.

The rename from PackageDependency to PackageListingDependency better clarifies this type represents dependencies in package listings.


230-242: Confirm icon_url nullability in packageVersionDependencySchema
All other dependency schemas use z.string().nullable() for icon_url, but here it’s non-nullable. Verify this matches the API contract.

packages/thunderstore-api/src/__tests__/defaultConfig.ts (1)

15-15: LGTM.

The addition of versionNumber to test data supports the new package version dependencies endpoint tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant