Articles tagged with "Partnerships"
After more than a year of collaboration and joint contributions, we’re thrilled to announce our official partnership with the OpenJS Foundation . Together, we’ll accelerate the adoption of new releases for projects under their umbrella—starting with Node.js . About OpenJS Foundation Formed in 2019, the OpenJS Foundation is home to nearly 40 of the most influential JavaScript projects , including Node.js, Electron, jQuery, webpack, ESLint, and Appium . As a neutral foundation, OpenJS provides governance, security, and community support to projects that power billions of websites and applications worldwide. By uniting these projects, OpenJS keeps the JavaScript ecosystem stable, innovative, and ready for the future. Node.js Userland Migrations Initiative The Userland Migrations Initiative, launched by Jacob Smith from the Node.js core team with key contributions from Augustin Mauroy and other maintainers, helps developers adopt new features and manage breaking changes across the Node.js ecosystem. Official migrations are now published under the @nodejs scope in the Codemod Registry. These codemods are created and reviewed by Node.js members, giving developers safe, trustworthy migration paths. After more than a year of iteration on both tooling and codemods, this initiative has paved the way for other frameworks to deliver an exceptional migration experience for their users. Codemod For The Community Codemod makes it easier for framework and SDK maintainers to build and share migrations with: Codemod CLI — scaffold, publish, and run codemods directly from the terminal with Codemod’s open-source CLI. Workflow engine — orchestrate and schedule multi-step code transformations, including AI-powered ones with Codemod’s open-source workflow engine. Codemod MCP — an open-source Model Context Protocol server that enables AI tools (like Claude and Cursor) to analyze code, generate codemods, and automate transformations Codemod Registry — a central hub to discover, share, and run codemods with rich metadata We also sponsor and contribute to ast-grep , a modern polyglot code query and transformation toolkit with a vibrant community. Codemod for The Enterprise Alongside our open-source stack, Codemod provides enterprise features to help engineering leaders and platform teams de-risk and automate migrations at scale. Examples include: End-of-life package upgrades for security Internationalization (i18n) for market expansion Accessibility (a11y) for compliance Post-M&A codebase unification Cross-vendor SDK migrations for cost savings API shifts for modernization Enterprise capabilities include: Pro Codemods high-quality, custom-built migrations run safely on-prem Codemod Insights dashboards that track migration health and ROI across codebases Codemod Campaigns codify and orchestrate fleet-wide migrations into repeatable workflows Codemod AI build, test, and run codemods faster with the help of AI in IDEs or Studio SOC2 compliance flexible deployment options, and enterprise-grade reliability and support Codemod brings reliability, visibility, and orchestration to large-scale code changes—unlocking the full potential of AI for enterprise software maintenance. 👉 Get in touch to learn more about our open-source tools and enterprise solutions.
We are thrilled to announce that we are partnering with Tokens Studio to facilitate the adoption of the latest features of Amazon’s Style Dictionary, starting with the v4 migration, through open-source codemods Style Dictionary v4 migration Style Dictionary v4 introduces many new highly-requested features and improvements, including migrating to ESM, making the library browser-compatible out of the box, and supporting asynchronicity in Style Dictionary’s various APIs. The Codemod community developed codemods to help you migrate your project to Style Dictionary v4. Use the following command to migrate your project: npx codemod styledictionary/4/migration-recipe For more details about the codemod visit Codemod Registry Codemod is optimized for open-source framework builders. Style Dictionary maintainers, among others such as React, Nuxt.js, pnpm, MSW, i18next, and many more, adopted the open-source tier of Codemod platform so they can be bold and ship new features without worrying about bringing the community along with them. Here are only a few of the Codemod platform benefits for framework builders: Improved Codemod Tooling: Don’t waste your time building framework migration tooling. Codemod platform delivers a feature-rich out-of-the-box experience for code migrations, streamlining users’ upgrade experience with minimal setup. Leverage Codemod Community: By tapping into the power of Codemod community, you can get support and a feedback loop from a pool of vetted migration experts, helping you save hours of codemod development time. Get Access to Adoption Analytics: Get a clear picture of framework adoption velocity using Codemod platform’s migration analytics. This allows you to pinpoint adoption bottlenecks and improve users’ upgrade experience. Codemod enterprise offers successful migrations for codebases of any size. Style Dictionary migration recipe is optimized for common usages of the framework and it can automate the bulk of the migration for small codebases where one engineer can easily tweak and test the changes and not many custom layers and business logic intertwined with the framework. However, in large enterprise codebases, where multiple teams and products are impacted, big migration campaigns involve different phases such as planning, pre-migration refactoring, incremental development, and post-migration refactoring and cleanup. Such migrations require scalable and secure development infrastructure to build and test code changes, customer-specific codemods, orchestration of changes among many teams, integration with the development environments tools, and some human involvement at every stage. Codemod has got you covered with its SOC2-compliant code automation platform, a proven technology, and evolution of what’s being used in tech giants like Meta for any large-scale migrations. You can fully delegate your migration projects to Codemod agents, without distracting your engineers from their feature work or dealing with the risks and hassle of procurement of third-party contractors. Book a demo call with us to learn how we've guaranteed and delivered exceptional migration services, achieving faster time to market and reduced costs for progressive companies like Netlify We can do the same for you.
We are thrilled to announce that we are partnering with the Nuxt team to build and maintain open-source codemods for the Nuxt 3 to 4 migration. This collaboration aims to enhance Nuxt migrations, beginning with the Nuxt 4 upgrade. Nuxt 4 migration Nuxt 4 introduces several new features and improvements, including performance and API consistency improvements. We've developed a codemod to help you migrate your project to Nuxt 4. Use the following command to migrate your project: npx codemod@latest nuxt/4/migration-recipe For more details about the codemod visit Codemod Registry . Enhanced Codemod Platform Using Codemod platform for Nuxt and other framework migrations brings many benefits: Diverse Codemod Engines : We support various engines like ast-grep, ts-morph, and LLM-based engines (Codemod 2.0), allowing us to choose the best tool for each task. Recipes/Presets : An ordered list of codemods that can be executed with one click to streamline your workflow. Flexible File Selection : Better control over which files are processed. Dependency Management : Simplify the installation and uninstallation of dependencies after running your codemods. Enhanced Performance : Enjoy faster execution times with threading. Integrated Formatter : Automatically format code post-modification for clean, readable output. Community and Reporting : Report issues and engage with the community for support. We are just one CLI command away: npx codemod feedback . AI Customization : Build new or customize existing codemods with the help of Codemod AI in the studio . Unified Search ( codemod search <fuzzy-terms> ) : Find all codemods regardless of language, framework, or publisher. Argument Flexibility : Customize codemods with specific arguments. Examples include feature flag clean-up codemods. Enterprise Support : Manage large-scale changes for big enterprises. Codemod architecture is designed from day one to optimize community involvement while separating features needed for large teams and enterprises. Contact us for more details. Join Our Community Be part of our vibrant community of codemod experts and forward-thinking developers. Share your feedback and let us assist with your code migration needs, regardless of your codebase or team size.
We are thrilled to announce that we are partnering with the pnpm team to build and maintain open-source codemods in the pnpm/codemod repo. This collaboration aims to enhance pnpm migrations, beginning with the adoption of the pnpm catalog feature. pnpm catalog migration As described in pnpm docs, catalog comes with the following benefits: Maintain unique versions — It's usually desirable to have only one version of a dependency in a workspace. Catalogs make this easier to maintain. Duplicated dependencies can conflict at runtime and cause bugs. Duplicates also increase size when using a bundler. Easier upgrades — When upgrading a dependency, only the catalog entry in pnpm-workspace.yaml needs to be edited rather than all package.json files using that dependency. This saves time — only one line needs to be changed instead of many. Fewer merge conflicts — Since package.json files do not need to be edited when upgrading a dependency, git merge conflicts no longer happen in these files. We've developed a codemod to help you migrate your project to pnpm's latest version and adopt the catalog feature. Use the following command to migrate your project: npx codemod@latest pnpm/catalog For more details about the codemod visit Codemod Registry. Enhanced Codemod Platform Using Codemod platform for pnpm and other framework migrations, brings many benefits: Diverse Codemod Engines : We support various engines like ast-grep, ts-morph, and LLM-based engines (Codemod 2.0), allowing us to choose the best tool for each task. Recipes/Presets : An ordered list of codemods that can be executed with one click to streamline your workflow. Flexible File Selection : Better control over which files are processed. Dependency Management : Simplify the installation and uninstallation of dependencies after running your codemods. Enhanced Performance : Enjoy faster execution times with threading. Integrated Formatter : Automatically format code post-modification for clean, readable output. AI Customization : Build new or customize existing codemods with the help of Codemod AI in the studio . Unified Search ( codemod search <fuzzy-terms> ) : Find all codemods regardless of language, framework, or publisher. Argument Flexibility : Customize codemods with specific arguments. Examples include feature flag clean up codemods. Enterprise Support : Manage large-scale changes for big enterprises. Codemod architecture is designed from day one to optimize community involvement while separating features needed for large teams and enterprises. Contact us for more details. Join Our Community Be part of our vibrant community of codemod experts and forward-thinking developers. Share your feedback and let us assist with your code migration needs, regardless of your codebase or team size.
Why bother migrating to Vitest? Vitest is a modern test runner with improved perfomance and developer experience comapred to many other existing alternatives, which explains its growing popularity. More specifically, Vitest simplifies configuration, supports TypeScript & ESM, and popular component libraries out of the box. Last but not least, it comes with code coverage analysis, and overall, saving hours of tedious work for developers. But, the manual migration from Mocha.js to Vitest could take a considerable amount of time, especially when you have a lot of test suites. What if there were code modification bots that could automate the entire migration process? Codemod: The code automation platform Building codemods requires knowledge of abstract syntax trees and compiler internals. The Codemod platform simplifies this by providing tools to build, test, share, and run codemods at any scale: Build : Use Codemod Studio to create and test codemods visually, powered by JSSG (our primary transformation engine built on ast-grep). Share : Publish codemods to the Codemod Registry , making them available to colleagues or the community. Run : Discover and run codemods with a single CLI command. Orchestrate : Use Codemod Workflows to chain multi-step migrations across repositories. Mocha to Vitest migration with Codemod.com Build the codemod To build a codemod with Codemod Studio, you provide code snippets showing the before and after states of the transformation. The Studio uses AI to generate the codemod logic, which you can then refine and test interactively. Imagine we have an existing Mocha.js-compatible test file: Imagine we have an existing Mocha.js-compatible test file with the following code, which we place in the “before” snippet: import type Context from 'mocha'; import expect from 'chai'; describe('Test Suite 1', function (this) beforeEach(() = doAThing(); ); it('addition', () = expect(1 + 1).to.equal(2); ); afterAll(() = doBThing(); ); ); With Vitest, we would write the test file in the following way, which we place in the “after” snippet: import describe, it, expect, beforeEach, afterAll from 'vitest'; describe('Test Suite 1', () = beforeEach(() = doAThing(); ); it('addition', () = expect(1 + 1).to.equal(2); ); afterAll(() = doBThing(); ); ); As you can see, in Mocha.js describe , beforeEach , it and afterAll functions exist in the global scope. Additionally, we chose to use the expect function from the chai library explicitly for test assertions. In Vitest, we need to import all of these functions from the vitest package. import type FileInfo, API, Options from 'jscodeshift'; export default function transform( file: FileInfo, api: API, options?: Options, ): string undefined const j = api.jscodeshift; const root = j(file.source); // Helper function to preserve leading comments function replaceWithComments(path, newNode) // If the original node had comments, add them to the new node if (path.node.comments) newNode.comments = path.node.comments; // Replace the node j(path).replaceWith(newNode); // Check if beforeEach and afterAll are used in the code const isBeforeEachUsed = root.find(j.Identifier, name: 'beforeEach' ).size() 0; const isAfterAllUsed = root.find(j.Identifier, name: 'afterAll' ).size() 0; // Find all import declarations root.find(j.ImportDeclaration).forEach(path = // Check if import source is 'chai' if (path.node.source.value === 'chai') // Replace 'chai' with 'vitest' path.node.source.value = 'vitest'; // Add 'describe', 'it', 'expect', 'beforeEach', 'afterAll' to import specifiers conditionally const importNames = ['describe', 'it', 'expect']; if (isBeforeEachUsed) importNames.push('beforeEach'); if (isAfterAllUsed) importNames.push('afterAll'); path.node.specifiers = importNames.map(name = j.importSpecifier.from( imported: j.identifier(name), local: j.identifier(name) ) ); // Replace the node with the new node, preserving comments replaceWithComments(path, path.node); ); // Find all function declarations root.find(j.FunctionExpression).forEach(path = // Check if function has 'this' as parameter if (path.node.params.some(param = param.type === 'Identifier' && param.name === 'this')) // Remove 'this' from parameters path.node.params = path.node.params.filter(param = !(param.type === 'Identifier' && param.name === 'this')); // Replace function declaration with arrow function expression const arrowFunction = j.arrowFunctionExpression.from( params: path.node.params, body: path.node.body, async: path.node.async, ); // Replace the node with the new node, preserving comments replaceWithComments(path, arrowFunction); ); return root.toSource(); Using the Studio's AI assistance, we generated a codemod to handle this transformation. The generated codemod served as a base for the final one called mocha/vitest/migrate-tests . We refined and improved it based on the edge cases we discovered during testing. We also built a second codemod called mocha/vitest/migrate-configurations that removes all Mocha.js configuration files, drops the library from all package dependencies, and adds Vitest instead. Both codemods were combined into a recipe called mocha/vitest/recipe which can be discovered, shared, and run from the Codemod Registry. Run the codemod Run the recipe with a single CLI command: npx codemod mocha/vitest/recipe We ran the recipe over 3 of our own repositories: codemod-com/filemod codemod-com/codemod-engine-node codemod-com/codemod-registry The first two had a handful of Mocha.js test suites and we migrated them first to spot problems early in the development. Once the codemod was ready and accurate, we merged them into the Codemod Registry. Once codemods are published to the registry, they automatically become accessible to the community via Codemod.com VSCode Extension or the Codemod.com CLI. And shown below, with the help of our codemod, we automated the bulk of the migration for over 60 test files spread across the entire Codemod Registry monorepo. We repeated the same steps for the Codemod Engine Node. During testing, we found out Vitest does not transpile TypeScript files if we use them as entry points for thread workers. This functionality used to work with Mocha.js supported by the ts-node/esm dependency. We replaced the path to the TS file with a path to the built ESM files to restore the feature. Final tweaks When migrating the Codemod Registry, we found unhandled cases, like: the usages of the Context type from Mocha.js, the usages of the this variable in test bodies. We could fix the former problem by putting the existing codemod into the Codemod Studio and asking the AI helper to fix it. With the latter, we fixed the test bodies manually due to the small number of such occurrences. Since the Codemod.com CLI can execute local codemods, we used it to see if the changes to the codemod resulted in the correct transformation of the codebase in question. This speeded up the development process tremendously. The impact With the help of the recipe, we were able to migrate three repositories in a short amount of time. We reused the same code within the recipe for all the projects. Now, other developers may leverage our work as well. If we were to manually migrate the Codemod Registry alone, we would have to: delete the 60+ existing Mocha.js configuration files (1 minute for each), remove Mocha.js and add Vitest dependencies in 60+ package files (1 minute for each), drop Mocha.js types and put the Vitest import statements in 60+ tests files (2 minutes for each). It would have taken around 4 hours of mundane work to perform the migration without ensuring we had not introduced any mistakes. After ensuring the proper quality of the code automation agents, we executed the recipe that transformed over 200 files instantly. We removed all Mocha.js configuration files and thus reduced the complexity of the test suites. Our platform made it all available at the push of a button. Conclusion This article walked through migrating from Mocha to Vitest using automated codemods. Key takeaways: Codemods are powerful code transformation tools that can automate tedious migration work at any scale. AI-assisted codemod creation through Codemod Studio and Codemod MCP lets any developer build codemods quickly. Open source : With Codemod's platform, you can automate crucial yet tedious tasks for yourself, your colleagues, and the community.