• Sveltekit Vite Preprocess Migration

    This codemod updates import paths and ensures compatibility with changes in library structures. In this example, it modifies the import statement for vitePreprocess to reflect updates in the library's API.

    by@priyanshuthapliyal2005
  • Sveltekit Import And Path Simplification

    This codemod simplifies the import statements and path resolution in your SvelteKit project. It replaces the usage of resolvePath and concatenation with base by using the resolveRoute function from $app/paths. This results in cleaner and more readable code.

    by@priyanshuthapliyal2005
  • Dynamic To Static Env Transformer

    This codemod transforms import {$A} from '$env/dynamic/public'; and import {$A} from '$env/dynamic/private'; into their static counterparts, replacing them with import {$A} from '$env/static/public'; and import {$A} from '$env/static/private';, respectively. It ensures compatibility for prerendered pages and static deployments.

    by@priyanshuthapliyal2005
  • Add Status To Error Handling

    This codemod improves error handling in SvelteKit by updating the way errors are returned in the load function. In SvelteKit 1, errors were handled inconsistently, often missing the status property or failing to trigger the handleError hook. SvelteKit 2 standardizes error handling by automatically including the status and message properties in error responses.

    by@priyanshuthapliyal2005
  • Add Multipart Enctype To Forms With File Input

    This codemod automatically adds the enctype="multipart/form-data" attribute to forms containing file input fields. It ensures that forms with file inputs properly handle file uploads during non-JS submissions, which is a requirement for SvelteKit v2.

    by@priyanshuthapliyal2005
  • Add Cookie Path To All Methods

    This codemod adds { path: '/' } to all cookies method calls in your TypeScript project. It ensures that cookies are set, deleted, or serialized with the correct path specified, which helps in consistent cookie handling across different environments.

    by@priyanshuthapliyal2005