Skip to content

alber70g/presentation-refactoring-ast

Repository files navigation

Refactor examples

Project to demonstrate the power of working with the AST and TypeScrip compiler

Project structure

  • sample-project
    the project that will be refactored using the scripts in refactor-scripts and my-org-refactor-lib
  • my-org-refactor-lib
    library that contains @angular-devkit/schematics scripts
  • refactor-scripts
    library that contains ts-morph scripts

Executing refactors

Install (and build) packages in all projects

cd sample-project && npm install && cd .. \
cd my-org-refactor-lib && npm install && npm run build && cd .. \
cd refactor-scripts && npm install && npm run build && cd ..

Execute @angular-devkit/schematics migration

you need the schematics cli installed globally:
npm install --global @angular-devkit/schematics-cli

cd sample-project && schematics ../my-org-refactor-lib:use-parse-float --dry-run=false

Execute ts-morph migration

cd sample-project && node ../refactor-scripts/src/extract-helpers.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published