Skip to content

Commit

Permalink
Find and replace on upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels committed Aug 16, 2021
1 parent 1062278 commit 674ff68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/schematics/update/v7/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export const ngUpdate = (): Rule => (
return;
}
// TODO clean this up
content.replace(/(?<key>import|export)\s+(?:(?<alias>[\w,{}\s\*]+)\s+from)?\s*(?:(["'])?firebase\/(?<ref>[@\w\s\\\/.-]+)\3?)\s*;/, "$1 $2 from $3firebase/compat/$4$3;");
content.replace(/(?<key>import|export)\s+(?:(?<alias>[\w,{}\s\*]+)\s+from)?\s*(?:(["'])?@firebase\/(?<ref>[@\w\s\\\/.-]+)\3?)\s*;/, "$1 $2 from $3@firebase/compat/$4$3;");
content.replace(/(?<key>import|export)\s+(?:(?<alias>[\w,{}\s\*]+)\s+from)?\s*(?:(["'])?@angular\/fire\/(?<ref>[@\w\s\\\/.-]+)\3?)\s*;/, "$1 $2 from $3@angular/fire/compat/$4$3;");
content.replace(/(?<key>import|export)\s+(?:(?<alias>[\w,{}\s\*]+)\s+from)?\s*(?:(["'])?firebase\/(?<ref>[@\w\s\\\/.-]+)\3?)\s*;/, '$1 $2 from $3firebase/compat/$4$3;');
content.replace(/(?<key>import|export)\s+(?:(?<alias>[\w,{}\s\*]+)\s+from)?\s*(?:(["'])?@firebase\/(?<ref>[@\w\s\\\/.-]+)\3?)\s*;/, '$1 $2 from $3@firebase/compat/$4$3;');
content.replace(/(?<key>import|export)\s+(?:(?<alias>[\w,{}\s\*]+)\s+from)?\s*(?:(["'])?@angular\/fire\/(?<ref>[@\w\s\\\/.-]+)\3?)\s*;/, '$1 $2 from $3@angular/fire/compat/$4$3;');
host.overwrite(filePath, content);
console.log(filePath);
});
Expand Down

0 comments on commit 674ff68

Please sign in to comment.