Skip to content

Support for Astro v6#79

Draft
pawcoding wants to merge 16 commits intomasterfrom
feat/astro-v6
Draft

Support for Astro v6#79
pawcoding wants to merge 16 commits intomasterfrom
feat/astro-v6

Conversation

@pawcoding
Copy link
Owner

Changes

Summary:

  • Upgraded to Astro v6
  • Removed improveTypes options (always enabled)
  • Replaced ZodSchema with ZodType
  • Updated schema generation for Astro v6
  • Replaced deprecated zod usage
  • Stabilized live loader (all experimental things renamed)

Issues

Related issues:

Dependencies

Depends on:

Testing

Test coverage:

  • Manual testing completed
  • Automated tests added/updated

Code Quality

Code review checklist:

  • Code follows existing patterns and conventions
  • Functions are small and focused
  • Types are properly defined
  • Error handling is appropriate
  • Documentation is updated if needed

Breaking Changes

Are there any breaking changes?

  • No breaking changes
  • Yes, breaking changes (describe below)

Migration notes:

  • Upgrade to Astro v6
  • Remove improveTypes option
  • Remove experimental prefix from everything related to the live loader
    See changelog for more information

BREAKING CHANGE: With v6 astro changed the way custom content loaders
provide their schemas. Please check the official documentation for
breaking changes.
BREAKING CHANGE: `improveTypes` is now always enabled, so the
configuration option was removed entirely.
BREAKING CHANGE: astro does not automatically generate typescript types
anymore, instead content loaders need to implement this logic
themselves.
BREAKING CHANGE: The `experimentalPocketbaseLiveLoader` as been renamed
to `pocketbaseLiveLoader`, incl. all it's option and filter types. The
`liveTypesOnly` option for the base loader is still experimental though.
@pawcoding pawcoding requested a review from Copilot December 13, 2025 13:22
@pawcoding pawcoding self-assigned this Dec 13, 2025
@pawcoding pawcoding added type/maintenance Dependencies need updates or code needs refactoring team/internal [internal] This will be done by the core team priority/high [internal] This will be done in the near future and is on the roadmap labels Dec 13, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request upgrades the package to support Astro v6, implementing breaking API changes required by the new version. The changes align with Astro v6's stable content loader API and remove experimental features.

  • Updated Astro dependency from v5 to v6.0.0-alpha.1
  • Replaced deprecated ZodSchema type with ZodType throughout the codebase
  • Removed improveTypes option (behavior now always enabled)
  • Stabilized live loader API by removing "experimental" prefix from types and exports
  • Migrated from schema method to new createSchema method that returns both schema and type definitions

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Updated Astro to v6.0.0-alpha.1, added zod-to-ts as dependency and peer dependency, removed npx prefix from scripts
package-lock.json Updated dependency lock file for Astro v6 and related packages
src/pocketbase-loader.ts Replaced schema method with createSchema that returns schema and types, removed experimental prefix from live loader function
src/index.ts Updated exports to remove experimental prefixes
src/types/pocketbase-loader-options.type.ts Removed improveTypes option, stabilized live loader types by removing experimental prefix
src/types/pocketbase-live-loader-filter.type.ts Removed experimental prefixes and JSDoc tags
src/types/pocketbase-entry.type.ts Simplified to use z.looseObject directly, removed intermediate base entry schema
src/schema/generate-schema.ts Updated to use ZodType instead of ZodSchema, changed BASIC_SCHEMA to object, removed improveTypes parameter
src/schema/parse-schema.ts Removed improveTypes option, made number and bool fields always required
src/schema/generate-type.ts New file implementing type generation using zod-to-ts library
src/loader/*.ts Updated type references to remove experimental prefixes
test/schema/*.ts Updated all tests to remove improveTypes parameter, added type annotations, added new snapshot test for type generation
test/_mocks/create-live-loader-options.ts Updated type references to remove experimental prefix
README.md Updated documentation to reflect API changes, removed improveTypes section, removed experimental warnings for live loader

Comment on lines +25 to +26
// oxlint-disable-next-line explicit-module-boundary-types
export function pocketbaseLoader(options: PocketBaseLoaderOptions) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Return type was removed on purpose according to migration guide. Astro will now infer the type of the content collection according to createSchema. This also has effects downstream for createSchema and generateSchema

package.json Outdated
"@types/node": "24.10.1",
"@vitest/coverage-v8": "4.0.15",
"astro": "5.16.5",
"astro": "6.0.0-alpha.1",
Copy link
Owner Author

Choose a reason for hiding this comment

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

Will be upgraded to 6.0.0 before the release

Copy link
Owner Author

@pawcoding pawcoding left a comment

Choose a reason for hiding this comment

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

Self review looks good ✔️

@github-actions
Copy link

github-actions bot commented Dec 16, 2025

📝 Changelog Preview

3.0.0 (2026-01-17)

⚠ BREAKING CHANGES

  • live-loader: The experimentalPocketbaseLiveLoader as been renamed
    to pocketbaseLiveLoader, incl. all it's option and filter types. The
    liveTypesOnly option for the base loader is still experimental though.
  • schema: astro does not automatically generate typescript types
    anymore, instead content loaders need to implement this logic
    themselves.
  • schema: improveTypes is now always enabled, so the
    configuration option was removed entirely.
  • deps: With v6 astro changed the way custom content loaders
    provide their schemas. Please check the official documentation for
    breaking changes.

🚀 Features

  • live-loader: stabilize live content loader (8e55b4c)

📖 Documentation

  • README: update compatibility table (bdd690d)

🛠️ Code Refactoring

  • replace ZodSchema with ZodType (9ca5fc7)
  • schema: remove improveTypes option (0cd6445)
  • schema: update schema generation for astro@v6 (f63c945)
  • update deprecated zod usage (720c7c2)

🏗 Dependency updates

  • deps: update dependencies (f33c819)
  • deps: update linter + rule set (a351995)
  • deps: upgrade to astro@v6 (0dd4456)

pawcoding and others added 5 commits December 16, 2025 10:34
# [3.0.0-astro-v6.1](v2.10.1...v3.0.0-astro-v6.1) (2025-12-16)

### Build System

* **deps:** upgrade to astro@v6 ([0dd4456](0dd4456))

### Code Refactoring

* **schema:** remove `improveTypes` option ([0cd6445](0cd6445))
* **schema:** update schema generation for astro@v6 ([f63c945](f63c945))

### Features

* **live-loader:** stabilize live content loader ([8e55b4c](8e55b4c))

### BREAKING CHANGES

* **live-loader:** The `experimentalPocketbaseLiveLoader` as been renamed
to `pocketbaseLiveLoader`, incl. all it's option and filter types. The
`liveTypesOnly` option for the base loader is still experimental though.
* **schema:** astro does not automatically generate typescript types
anymore, instead content loaders need to implement this logic
themselves.
* **schema:** `improveTypes` is now always enabled, so the
configuration option was removed entirely.
* **deps:** With v6 astro changed the way custom content loaders
provide their schemas. Please check the official documentation for
breaking changes.
## [3.0.0-astro-v6.2](v3.0.0-astro-v6.1...v3.0.0-astro-v6.2) (2026-01-17)

### 🏗 Dependency updates

* **deps:** update dependencies ([f33c819](f33c819))
Base automatically changed from next to master February 28, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/high [internal] This will be done in the near future and is on the roadmap team/internal [internal] This will be done by the core team type/maintenance Dependencies need updates or code needs refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants