Skip to content

🅰️ CLI tool to automate file renaming and content refactoring for Angular 20 projects. This tool updates file names and TypeScript file contents to align with Angular 20 conventions, handling patterns like .component, .service, .directive, .model and more

License

Notifications You must be signed in to change notification settings

esteecodes/angular-v20-bulk-file-refactor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular v20 Bulk File Refactor

A CLI tool to automate file renaming and content refactoring for Angular 20 projects. This tool updates file names and TypeScript file contents to align with Angular 20 conventions, handling patterns like .component, .service, .directive, and .model.

Installation

Global Installation

Install the tool globally to use it from any directory:

npm install -g angular-v20-bulk-file-refactor

Run the tool directly:

angular-v20-bulk-file-refactor /path/to/your/angular/project

Local Installation

Install the tool locally within a project:

npm install angular-v20-bulk-file-refactor

Run the tool using npx:

npx angular-v20-bulk-file-refactor /path/to/your/angular/project

Alternatively, add a script to your package.json:

{
  "scripts": {
    "refactor": "angular-v20-bulk-file-refactor"
  }
}

Then run:

npm run refactor -- /path/to/your/angular/project

Usage

Run the tool on your Angular project by specifying the project folder path. Use the global command or npx depending on your installation method.

Options

  • --skip-dirs <dirs>: Comma-separated list of directories to skip during processing.
    Default: models,partials
    Example: --skip-dirs models,tests skips the models and tests directories.

  • --replace-file-name-segments <segments>: Comma-separated list of file name segments to replace with a hyphenated version (e.g., .service becomes -service in the services folder).
    Default: services,directives
    Example: --replace-file-name-segments services,pipes replaces .service with -service in the services folder.

  • --remove-file-name-segments <segments>: Comma-separated list of file name segments to remove (e.g., .model is removed from file names in the models folder).
    Default: models
    Example: --remove-file-name-segments models,utils removes .model from file names in the models folder.

  • --replace-import-segments <segments>: Comma-separated list of import segments to replace (e.g., .service becomes -service in import statements).
    Default: .service
    Example: --replace-import-segments .service replaces .service with -service in imports.

  • --remove-import-segments <segments>: Comma-separated list of import segments to remove from import statements.
    Default: .component,.directive,.model
    Example: --remove-import-segments .component,.directive removes these segments from imports.

Example

Run the tool on a specific Angular project folder with custom options:

# Global installation
angular-v20-bulk-file-refactor D:\\Estee\\Programming\\My-Projects\\angular-app\\src\\app --skip-dirs models,tests --replace-file-name-segments services,pipes --remove-file-name-segments models,utils

# Local installation with default options
npx angular-v20-bulk-file-refactor D:\\Estee\\Programming\\My-Projects\\angular-app\\src\\app --skip-dirs models,partials --replace-file-name-segments services,directives --remove-file-name-segments models --replace-import-segments .service --remove-import-segments .component,.directive,.model

# Local installation with custom options
npx angular-v20-bulk-file-refactor D:\\Estee\\Programming\\My-Projects\\angular-app\\src\\app --skip-dirs models,tests --replace-file-name-segments services,pipes --remove-file-name-segments models,utils

# Using package.json script
npm run refactor -- D:\\Estee\\Programming\\My-Projects\\angular-app\\src\\app --skip-dirs models,tests --replace-file-name-segments services,pipes --remove-file-name-segments models,utils

Compatibility

This tool has been tested on Windows and works reliably. A Linux binary is included but hasn’t been fully tested yet. I’d love to hear how it performs on Linux or macOS! Please share your experience or report issues at github.com/esteecodes/angular-v20-bulk-file-refactor/issues.

License

MIT License. See LICENSE for details.

Author

Esther White esteecodes

Repository

github.com/esteecodes/angular-v20-bulk-file-refactor

Issues

Report bugs or suggest improvements at github.com/esteecodes/angular-v20-bulk-file-refactor/issues.

Security Measures

This package includes several security features to protect users:

  • SHA-256 Verification: Each binary comes with a .sha256 file containing a unique fingerprint that verifies the file hasn't been tampered with during download.
  • GPG Signatures: All binaries include .asc signature files that prove the software was created by the package author and not modified by third parties.
  • Automated Builds: All binaries are built using GitHub Actions automated workflows, ensuring consistent and reproducible builds without manual intervention.

Read more at keys/README.md

About

🅰️ CLI tool to automate file renaming and content refactoring for Angular 20 projects. This tool updates file names and TypeScript file contents to align with Angular 20 conventions, handling patterns like .component, .service, .directive, .model and more

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published