Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mux/mux-elements-codemod

Package Overview
Dependencies
Maintainers
38
Versions
466
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mux/mux-elements-codemod

A codemod to transform @mux-elments scope imports into @mux scope imports

  • 1.0.0-canary.0-935e7ae
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
469
increased by7716.67%
Maintainers
38
Weekly downloads
 
Created
Source

mux-elements-codemod

Downloads Version License

Introduction

mux-elements-codemod is a CLI app to help run various migrations or codemods on users who use any of the mux elements.

Usage

Easiest way to use it is via npx which ships with npm:

npx @mux/mux-elements-codemod

Alternatively, install it globally with npm or yarn

npm install --global @mux/mux-elements-codemod
mux-elements-codemod

By default, it will run in dry-run mode, so, you don't have to worry about it changing your files. Pass in --force for it to change any file.

command usage

$ mux-elements-codemod --help

$ mux-elements-codemod [OPTIONS] [paths ...]
$ mux-elements-codemod [--help|-h]

paths can be regular globbed items or a list of folders
The default path is ./

Examples:
$ mux-elements-codemod -i ./packages ./examples
$ mux-elements-codemod --imports ./packages
$ mux-elements-codemod --imports ./examples/**/*.tsx
$ mux-elements-codemod --extensions="tsx jsx" --imports ./examples/
$ mux-elements-codemod -e="tsx jsx" --imports ./examples/ --ignore .next --ignore dist

Options:
  -i --imports      update imports/requires scope from @mux-elements to @mux
     --ignore       Add a name to ignore in the files, multiples can be provided
  -e --extensions   specifiy the specific file extensions to use as a space separated string
                    default is "js ts jsx tsx json html mjs cjs"
  -f --force        by default, this does a dry run, run with --force to replace the text inline
  -h --help         show this help

Available codemods

Imports

Currently, the only available codemod is a scope migration script for imports.

It allows you to bulk change multiple imports that use the old scope (@mux-elements) to the new scope (@mux).

$ mux-elements-codemod --imports ./src
Running in dry run mode. The following files will be modified:
src/player.tsx
Before:
	2:import MuxPlayer from "@mux-elements/mux-player-react";
After:
	2:import MuxPlayer from "@mux/mux-player-react";

And then, you can run it with --force to make the replacements inline.

$ mux-elements-codemod --imports ./src --force
Modifying the following files to replace `@mux-elements/` scope with `@mux`:
src/player.tsx

FAQs

Package last updated on 05 Jul 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc