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 🙏

© 2026 – Pkg Stats / Ryan Hefner

angular-signal-migration

v0.1.14

Published

Migrate Angular projects to signal-based components using official Angular schematics plus a conservative custom codemod.

Readme

Angular Signal Migration CLI

This CLI migrates Angular projects toward signal-based components. It first runs the official Angular signal migrations (@angular/core:signal-input-migration and @angular/core:signal-queries-migration) and then applies its own conservative codemod for additional safe signal opportunities.

Status

The tool focuses on safety before rewrite:

  • runs official Angular signal-input and signal-queries migrations first
  • component and directive discovery
  • template symbol tracking, including ng-template locals and Angular 20 control-flow aliases
  • ng-template and embedded view detection
  • unsafe mutation detection in class code and templates
  • migration suggestions for fields that appear safe to convert to signals
  • applies safe codemods by default; use --dry-run to analyze only

Unsafe cases the analyzer guards against

Class-side mutations:

  • direct/compound assignment (this.count += 1)
  • increment/decrement (this.count++)
  • element-access assignment (this.items[0] = 1)
  • mutating method calls (this.items.push(1))
  • alias-based mutation (const alias = this.value; alias.count += 1)
  • destructuring alias mutation (const { count } = this.value; count += 1)
  • for-of/for-in alias mutation (for (const item of this.items) { item.count += 1 })
  • passing a symbol to a potentially mutating call (mutate(this.items))
  • @Input mutation

Template-side mutations:

  • event handler assignments ((click)="count = count + 1")
  • event handler mutating method calls ((click)="items.push(1)")
  • two-way bindings ([(ngModel)]="user")

Excluded symbols:

  • @Output() fields
  • fields already initialized with signal(), input(), model(), computed(), or toSignal()

Computed and input getter/setter support

The analyzer detects pure template getters that can become computed():

get fullName() {
  return `${this.firstName} ${this.lastName}`;
}

It also detects fields read in templates whose initializer depends on signal-like symbols (@Input(), input(), signal(), computed(), model(), signal queries, etc.) and converts them to computed() instead of signal():

readonly fullName = computed(() => `${this.firstName()} ${this.lastName()}`);

For @Input() getter/setter pairs, both accessors are classified as input and are excluded from signal-field migration.

Usage

Interactive scope selection (default behavior applies migrations):

npx angular-signal-migration /path/to/angular-app

Analyze only without writing files:

npx angular-signal-migration /path/to/angular-app --dry-run
# or
npx angular-signal-migration /path/to/angular-app --analyze

Migrate a specific scope. The official Angular schematics receive the same scope, operating on directories for --kind=file and --kind=ng-module because they do not support single-file migration:

npx angular-signal-migration /path/to/angular-app src/app/feature --kind=folder --non-interactive
npx angular-signal-migration /path/to/angular-app src/app/feature.module.ts --kind=ng-module --non-interactive
npx angular-signal-migration /path/to/angular-app src/app/app.component.ts --kind=file --non-interactive

Skip the official Angular signal migrations and run only the custom analyzer:

npx angular-signal-migration /path/to/angular-app --skip-schematics

Optional JSON output:

npx angular-signal-migration /path/to/angular-app --json

Non-interactive mode (useful in CI or when stdin is not a TTY):

npx angular-signal-migration /path/to/angular-app --non-interactive

Publishing

Publishing automatically bumps the patch version before the tarball is created:

npm publish

The prepublishOnly script runs npm version patch --no-git-tag-version to bump package.json, then npm publish ships the new version. No git commit or tag is created automatically.

If you prefer the explicit two-step flow with a git commit and tag, use:

npm run release

Notes

This is intentionally conservative. If the analyzer cannot confidently prove a case is safe, it will report the risk instead of proposing an automatic rewrite.