Assess, plan, evolve.
Reusable compiler-aware skills that help coding agents understand, plan, and safely evolve your codebase.
54 packages
Helps migrate Zod 3 to Zod 4.
- transformation
- migration
# Array.prototype.splice Codemod ## Introduction This codemod replaces usages of the `array.prototype.splice` package with native JavaScript's built-in `Array.prototype.splice` method. By eliminating the dependency on the external package, it reduces bundle size and enhances performance. ### Before ```javascript import splice from 'array.prototype.splice'; const myArray = [1, 2, 3]; splice(myArray, 1, 1, 4); // Removes 2 and adds 4 ``` ### After ```javascript const myArray = [1, 2, 3]; myArray.splice(1, 1, 4); // Removes 2 and adds 4 ```
- e18e
- module-replacement
This recipe is a set of codemods that will help migrate to Nuxt 4. The recipe includes the following codemods: - nuxt/4/absolute-watch-path - nuxt/4/default-data-error-value - nuxt/4/deprecated-dedupe-value - nuxt/4/file-structure - nuxt/4/shallow-function-reactivity - nuxt/4/template-compilation-changes
- migration
- nuxt
## What Changed This codemod updates Style Dictionary to be a class in version 4, rather than a regular JS object. This allows for instance creation using the new class instantiator keyword. Due to ES Modules' asynchronous nature, you must await initialization before accessing properties like tokens on the instance. The `.extend()` method remains available for creating instances based on another instance. ## Before ```jsx const StyleDictionary = require("style-dictionary"); const sd = StyleDictionary.extend("config.json"); console.log(sd.tokens); ``` ## After ```jsx import StyleDictionary from "style-dictionary"; const sd = new StyleDictionary("config.json"); await sd.hasInitialized; console.log(sd.tokens); ```
- styledictionary
- 4
- +1
This recipe is a set of codemods that will help migrate to Fastify 4. The recipe includes the following codemods: - fastify/4/await-register-calls - fastify/4/expose-head-routes - fastify/4/remove-app-use - fastify/4/reply-raw-access - fastify/4/url-params-optional - fastify/4/wrap-routes-plugin
- fastify
- migration
## What Changed This codemod updates Style Dictionary to use ES Modules format entirely in version 4, making it browser-compatible out of the box. This modern JavaScript standard, which supports NodeJS/Browser interoperability among other benefits, allows Style Dictionary to run in many more environments compared to before. ## Before ```jsx const StyleDictionary = require("style-dictionary"); ``` ## After ```jsx import StyleDictionary from "style-dictionary"; ```
- styledictionary
- 4
- +1
# Array.prototype.with Codemod ## Introduction This codemod replaces instances of `array.prototype.with` with the native JavaScript `with` method. This transformation helps to streamline array operations by utilizing built-in functionalities, reducing the need for external libraries, and ultimately improving the codebase's performance and reduce its bundle size. ### Before ```javascript const myArray = [1, 2, 3]; const newArray = myArray.with(1, 4); // Using array.prototype.with ``` ### After ```javascript const myArray = [1, 2, 3]; const newArray = myArray.with(1, 4); // This is now a native method ```
- e18e
- module-replacement
# 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
# 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
# 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
# is-even Codemod ## Introduction This codemod removes the dependency on the `is-even` npm module by replacing its usage with a native JavaScript expression that checks if a number is even. This change optimizes performance, reduces bundle size, and eliminates unnecessary dependencies. ### Before ```ts import isEven from 'is-even'; const result = isEven(4); ``` ### After ```ts const result = (4 % 2) === 0; ```
- e18e
- module-replacement
# Array Prototype Find Last Index Codemod ## Introduction This codemod transforms the usage of the `Array.prototype.findLastIndex` method to its more efficient counterpart, ensuring consistent coding practices and potentially reducing bundle size by leveraging built-in ES features instead of polyfills or outdated methods. ### Before ```javascript const array = [1, 2, 3, 4, 5]; const lastIndex = array.findLastIndex(element => element === 3); ``` ### After ```javascript const array = [1, 2, 3, 4, 5]; const lastIndex = array.findLastIndex(element => element === 3); ```
- e18e
- module-replacement
Ready to evolve your codebase?
Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.