Socket
Book a DemoInstallSign in
Socket

@backstage/codemods

Package Overview
Dependencies
Maintainers
3
Versions
477
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backstage/codemods

A collection of codemods for Backstage projects

latest
Source
npmnpm
Version
0.1.52
Version published
Weekly downloads
199
-12.72%
Maintainers
3
Weekly downloads
 
Created
Source

@backstage/codemods

A collection of codemods for use with Backstage projects. They are intended to improve and simplify large scale refactoring, upgrades of code to use new implementations, alignment to ADRs or project standards, or other refactoring.

Usage

This package is a wrapper around jscodeshift with some included transforms. The transforms can either be executed via the included CLI or directly via jscodeshift.

To run the core-imports codemod towards all source files in the current directory, run the following:

npx @backstage/codemods apply core-imports

Note that this will modify the source files directly, but it's possible to do a dry-run by adding the --dry flag.

By passing a list of paths the codemod will only be applied to those paths:

npx @backstage/codemods apply core-imports plugins/my-plugin-a plugins/my-plugin-b

To print a list of all available transforms you use the list command:

npx @backstage/codemods list

You can also apply the transforms manually using jscodeshift. The transforms are located within the transforms/ directory in this package, so running directly with jscodeshift looks like this:

npx jscodeshift --parser=tsx --extensions=tsx,js,ts,tsx --transform=node_modules/@backstage/codemods/transforms/core-imports.js .

Documentation

Keywords

backstage

FAQs

Package last updated on 19 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts