Skip to main content
PRONeed enterprise-grade codemods tailored to your codebase?

Assess, plan, evolve.

Reusable compiler-aware skills that help coding agents understand, plan, and safely evolve your codebase.

33 packages

Sort by
fastify/5/migrationRecipe

This recipe provides a set of codemods designed to assist with migrating to Fastify 5. Each codemod addresses specific changes and enhancements introduced in Fastify 5. ### Included Codemods - **`fastify/5/req-params-hasOwnProperty-to-objectHasOwn`**: Converts `req.params.hasOwnProperty` to `Object.hasOwn`. - **`fastify/5/listen-arg-transformation`**: Updates the transformation of arguments passed to `listen`. - **`fastify/5/replace-hardcoded-url-in-hasroute`**: Replaces hardcoded URLs in `hasRoute` checks. - **`fastify/5/replace-reply-sent-with-hijack`**: Replaces `reply.sent` with `reply.hijack`. - **`fastify/5/add-expose-head-routes-option`**: Adds the `exposeHeadRoutes` option where necessary. - **`fastify/5/decorate-request-to-getter-method`**: Converts request decorators to getter methods. - **`fastify/5/route-schema-enhancement`**: Enhances route schemas with new features. - **`fastify/5/req-connection-to-socket`**: Converts `req.connection` to `req.socket`. - **`fastify/5/getResponseTime-to-elapsedTime`**: Renames `getResponseTime` to `elapsedTime`. - **`fastify/5/redirect-arg-order`**: Updates the argument order for `redirect`. - **`fastify/5/make-reply-trailer-async`**: Converts `reply.trailer` to an async method. - **`fastify/5/remove-done-callback`**: Changes `plugin.register` from `done` callback to `return`. - **`fastify/5/rename-logger-to-logger-instance`**: Renames `logger` to `loggerInstance`. These codemods will help streamline your migration process and ensure compatibility with Fastify 5. ---

  • fastify
  • migration
Mmanishjha-04
v1.0.4
19
a year ago
svelte/5/migration-recipe

This recipe is a set of codemods that will help migrate to Svelte 5. The recipe includes the following codemods: - svelte/5/components-as-functions - svelte/5/components-as-functions-destroyfunction - svelte/5/components-as-functions-onfunction - svelte/5/is-where-scoping - svelte/5/server-api-changes - svelte/5/svelte-element-expression

  • migration
  • svelte
335c4n0r
v1.0.5
2
a year ago
svelte/5/components-as-functions-destroyfunction

This codemod updates Svelte component instantiation and event handling for Svelte 5: - Converts `new Component({ target })` to `mount(Component, { target })`. - Replaces `$destroy` method calls with `unmount`. - Ensures compatibility with Svelte 5's function-based components and new event handling. ## Before ```jsx import App from './App.svelte'; const app = new App({ target: document.getElementById('app'), props: { foo: 'bar' }, }); app.$destroy(); ``` ## After ```jsx import { unmount } from 'svelte'; import { mount } from 'svelte'; import App from './App.svelte'; const app = mount(App, { target: document.getElementById('app'), props: { foo: 'bar' }, }); unmount(app); ```

  • svelte
  • 5
  • +1
335c4n0r
v1.0.3
108
2 years ago
svelte/5/components-as-functions

In Svelte 3 and 4, components were classes, while in Svelte 5, components are functions. This codemod updates the instantiation of Svelte components to use `mount` or `hydrate` (imported from svelte), ensuring compatibility with Svelte 5's new functional component model. ## Before ```jsx import App from './App.svelte'; const app = new App({ target: document.getElementById('app') }); export default app; ``` ## After ```jsx import { mount } from 'svelte'; import App from './App.svelte'; const app = mount(App, { target: document.getElementById('app') }); export default app; ```

  • svelte
  • 5
  • +1
335c4n0r
v1.0.3
101
2 years ago
svelte/5/components-as-functions-onfunction

This codemod updates Svelte component instantiation and event handling for Svelte 5: - Converts `new Component({ target })` to `mount(Component, { target })`. - Adds the `mount` import from `svelte` if not present. - Replaces `$on` method calls with the `events` property in the mount options. This ensures compatibility with Svelte 5's function-based components and new event handling. ## Before ```jsx import App from './App.svelte'; const app = new App({ target: document.getElementById('app') }); app.$on('event', callback); ``` ## After ```jsx import { mount } from 'svelte'; import App from './App.svelte'; const app = mount(App, { target: document.getElementById('app'), events: { event: callback }, }); ```

  • svelte
  • 5
  • +1
335c4n0r
v1.0.3
92
2 years ago
@e18e/is-odd

# is-odd Codemod ## Introduction This codemod replaces the use of the `is-odd` npm module with a more efficient built-in JavaScript expression. It transforms function calls to `is-odd` into a binary expression that checks if a number is odd, thus reducing unnecessary dependencies and improving performance. ### Before ```javascript import { isOdd } from 'is-odd'; const result = isOdd(5); ``` ### After ```javascript const result = (5 % 2) !== 0; ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
45
a year ago
@e18e/array.prototype.concat

# Array.prototype.concat Codemod ## Introduction This codemod optimizes the usage of the `Array.prototype.concat` method by transforming its usage into a more efficient syntax. This helps to reduce redundancy and improve performance within the codebase. ### Before ```javascript const array1 = [1, 2, 3]; const array2 = [4, 5, 6]; const combined = array1.concat(array2); ``` ### After ```javascript const array1 = [1, 2, 3]; const array2 = [4, 5, 6]; const combined = [...array1, ...array2]; ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
38
a year ago
@e18e/math.clz32

# Math.clz32 Codemod ## Introduction This codemod replaces the usage of the `math.clz32/polyfill` library with the built-in `Math.clz32` method. The objective is to eliminate the unnecessary dependency on the polyfill, thereby reducing the bundle size and improving performance. ### Before ```javascript import { clz32 } from 'math.clz32/polyfill'; const result = clz32(5); ``` ### After ```javascript const result = Math.clz32(5); ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
37
a year ago
@e18e/array.prototype.tospliced

# Array.prototype.tospliced Codemod ## Introduction This codemod updates instances of the deprecated `Array.prototype.tospliced` method to the more standard `Array.prototype.toSpliced` method. This transformation aims to standardize the usage of array methods in your codebase, improve readability, and reduce potential confusion caused by using non-standard methods. ### Before ```javascript const array = [1, 2, 3, 4]; const newArray = array.tospliced(1, 2, 5); ``` ### After ```javascript const array = [1, 2, 3, 4]; const newArray = array.toSpliced(1, 2, 5); ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
37
a year ago
@e18e/string.prototype.padleft

# String.prototype.padLeft Codemod ## Introduction This codemod replaces uses of the `String.prototype.padLeft` method with the built-in `String.prototype.padStart` method. The goal is to eliminate the reliance on the less common `padLeft` method, reducing unnecessary dependencies and simplifying the codebase. ### Before ```javascript const paddedString = myString.padLeft(5, '0'); ``` ### After ```javascript const paddedString = myString.padStart(5, '0'); ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
36
a year ago
@e18e/array.prototype.copywithin

# Array.prototype.copyWithin Codemod ## Introduction This codemod replaces the usage of the `Array.prototype.copyWithin` method with the `copyWithin` method without the need for the `Array` prototype. It aims to streamline the code by ensuring that the native method is used directly, which can enhance performance and reduce unnecessary abstraction. ### Before ```javascript const array = [1, 2, 3, 4, 5]; array.copyWithin(0, 3); // This is using the prototype method ``` ### After ```javascript const array = [1, 2, 3, 4, 5]; array.copyWithin(0, 3); // This is using the native method, directly through the array ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
36
a year ago
@e18e/string.prototype.substr

# String.prototype.substr Codemod ## Introduction This codemod replaces occurrences of the `String.prototype.substr` method with the more modern and preferred `String.prototype.substring` method. By doing so, it helps streamline the codebase, reduce reliance on deprecated features, and enhance readability. ### Before ```javascript const stringValue = "Hello, World!"; const substring = stringValue.substr(0, 5); ``` ### After ```javascript const stringValue = "Hello, World!"; const substring = stringValue.substring(0, 5); ```

  • e18e
  • module-replacement
Ee18e
v1.0.5
34
a year ago

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.