Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@mux/mux-elements-codemod
Advanced tools
A codemod to transform @mux-elments scope imports into @mux scope imports
mux-elements-codemod is a CLI app to help run various migrations or codemods on users who use any of the mux elements.
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.
$ 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
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
A codemod to transform @mux-elements scope imports into @mux scope imports
The npm package @mux/mux-elements-codemod receives a total of 246 weekly downloads. As such, @mux/mux-elements-codemod popularity was classified as not popular.
We found that @mux/mux-elements-codemod demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.