npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-codemod-remove-ember-css-modules

v2.0.7

Published

Codemod to replace ember-css-modules with embroider-css-modules

Downloads

121

Readme

This project uses GitHub Actions for continuous integration.

ember-codemod-remove-ember-css-modules

Codemod to replace ember-css-modules with embroider-css-modules

  1. Features
  2. Usage
  3. Compatibility
  4. Contributing
  5. License

Features

The codemod helps you:

  • Remove ember-css-modules syntax from an Embroider app
  • Remove ember-css-modules syntax from a v2 addon

It preserves your code whenever possible.

Usage

You can find a migration example in ember-container-query.

Step 1. Quickly remove ember-css-modules syntax.1

cd <path/to/your/project>
npx ember-codemod-remove-ember-css-modules <arguments>

Manually remove the remaining instances of local-class attributes and {{local-class}} helpers.

Step 2. Update project configurations.2

  • [x] Set up CSS modules (see the guides for apps and v2 addons).
  • [x] Confirm that you can run all scripts in package.json.

1. Some prerequisites for running the codemod: First, migrate to the Octane layout (flat or nested). You can leverage codemods for classic and pod layouts. Second, refactor code to help the codemod update templates correctly.

2. Files such as .eslintrc.js, .prettierrc.js, .stylelintrc.js, .template-lintrc.js, ember-cli-build.js, package.json, postcss.config.js, tsconfig.json, etc.

Arguments

You must pass --type to indicate what type of project you have.

npx ember-codemod-remove-ember-css-modules --type app
npx ember-codemod-remove-ember-css-modules --type v2-addon

By default, an Embroider project has the flat component structure. Pass --component-structure to indicate otherwise.

npx ember-codemod-remove-ember-css-modules --component-structure nested

Pass --root to run the codemod on a project somewhere else (i.e. not in the current directory).

npx ember-codemod-remove-ember-css-modules --root <path/to/your/project>

Limitations

The codemod is designed to cover typical uses of ember-css-modules. It is not designed to cover one-off cases.

The codemod updates components only.

To better meet your needs, consider cloning the repo and running the codemod locally.

cd <path/to/cloned/repo>

# Compile TypeScript
pnpm build

# Run codemod
./dist/bin/ember-codemod-remove-ember-css-modules.js --root=<path/to/your/project>

Compatibility

  • Node.js v18 or above

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.