Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@mohalla-tech/atomizer-tailwindcss-migrator
Advanced tools
Changelog
1.0.2
Readme
CLI tool to refactor atomizer codebases to tailwindcss
npm
npm install @mohalla-tech/atomizer-tailwindcss-migrator -g
yarn
yarn add @mohalla-tech/atomizer-tailwindcss-migrator -g
pnpm
pnpm add @mohalla-tech/atomizer-tailwindcss-migrator -g
Now you can run the migrator using tw-mg
command
Show help
Path to atomizer generated css file, it contains all the generated classes
Target files to transform, supports glob pattern
Dry run mode, will only generate report and open it
Do not open report in browser
Path to json file with mappings from atomizer classes to tailwindcss classes, for example we may want to replace $fzTitle
variable with title
in tailwindcss variable so any class like Fz($fzTitle)
will be replaced with text-title
Ex:
{
"$fzTitle": "title"
}
Path to js file with plugins which will be loaded by the migrator this can be helpful if you want to do some custom transformation for help on writing plugins see Writing Plugins
if we want to run without any mappings or plugins
tw-mg -s ./path/to/atomizer.css -t ./path/to/target/files
with mappings
tw-mg -s ./path/to/atomizer.css -t ./path/to/target/files -m ./path/to/mappings.json
with plugins
tw-mg -s ./path/to/atomizer.css -t ./path/to/target/files -p ./path/to/plugins.js
with mappings and plugins
tw-mg -s ./path/to/atomizer.css -t ./path/to/target/files -m ./path/to/mappings.json -p ./path/to/plugins.js
dry run mode - it will only generate report and open it
tw-mg -s ./path/to/atomizer.css -t ./path/to/target/files -d
we have a file /src/styles/main.css
with atomizer classes
.Fz($fzTitle) {
font-size: $fzTitle;
}
.D\(f\) {
display: flex;
}
.Bgc\(c\) {
background-color: $c;
}
we want to transform all the atomizer classes to tailwindcss classes within /src/components
directory
tw-mg -s ./src/styles/main.css -t ./src/components/**/*.jsx -d
this will generate a report and open it in browser, you can then review the changes and apply them by removing -d
flag
tw-mg -s ./src/styles/main.css -t ./src/components/**/*.jsx
Plugin file must export an array of plugins which will be loaded by the migrator, plugins must be an object with name
and plugin
keys where name
is the name of the plugin and plugin
is a function which will be called for each atomizer class with className
and mappings
as arguments, className
is the atomizer class and mappings
is the mappings object passed to the migrator
module.exports = [
{
name: 'plugin-name',
plugin: function (className, mappings) {
// do something with atomizer
// return null in case you want to skip this plugin
return newClassName;
},
},
];
FAQs
A CLI tool to migrate from atomizer to tailwindcss
The npm package @mohalla-tech/atomizer-tailwindcss-migrator receives a total of 1 weekly downloads. As such, @mohalla-tech/atomizer-tailwindcss-migrator popularity was classified as not popular.
We found that @mohalla-tech/atomizer-tailwindcss-migrator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 15 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.