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

calcite-codemod

v2.0.6

Published

Code modification tool for automatically updating applications after breaking changes to Calcite Design System packages

Downloads

4

Readme

Calcite Codemod

This is a small (unofficial) tool for automatically updating code after breaking changes to Calcite Design System packages. The major version of this package will always align with the major version of @esri/calcite-components that it targets. However, this package may not be updated for every major release of Calcite Components.

The current iteration of this package renames the CSS variables used to modify the styles of Calcite Components. Please read the Calcite Components v2 changelog for a full list of breaking changes.

Installation

Install the package globally and use it anywhere:

npm i -g calcite-codemod@v2

Use it in a single application:

npm i -D calcite-codemod@v2

Or try it out before installing:

npx calcite-codemod "styles.css" "index.html" "src/*.js"

NOTE: You cannot specify the version of a package when using npx, so make sure the current major version of calcite-codemod aligns with your major version of @esri/calcite-components. Otherwise, use one of the previous installation methods above.

Using the CLI

calcite-codemod provides a command line interface (CLI) that renames the CSS Variables in your application. The CLI requires one or more arguments specifying which files/directories to update. The arguments support glob syntax. For more information, see this glob primer by the package calcite-codemod uses internally.

Here are a couple usage examples:

# replace occurrences of renamed CSS variables in style.css, index.html, and all js files in src/
calcite-codemod "styles.css" "index.html" "src/*.js"

# all js/ts/jsx/tsx/css/scss files in src/ and all of its child directories
calcite-codemod "src/**/*.{js,ts,jsx,tsx,css,scss}"

# same as the previous example, except a lot more confusing
calcite-codemod "src/**/*.{{j,t}s{x,},{s,}css}"

Using the CSS

This package also contains a CSS file that maps the old variable names to the new ones. Add this to your application so you can update to Calcite Components v2 before renaming all the CSS Variables.

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@esri/calcite-components@v2/dist/calcite/calcite.esm.js"
></script>
<link
  rel="stylesheet"
  type="text/css"
  href="https://cdn.jsdelivr.net/npm/@esri/calcite-components@v2/dist/calcite/calcite.css"
/>

<!-- Make sure to add `legacy-tokens.css` after `calcite.css` -->
<link
  rel="stylesheet"
  type="text/css"
  href="https://cdn.jsdelivr.net/npm/calcite-codemod@v2/dist/legacy-tokens.css"
/>