Skip to content

Commit e0f20ea

Browse files
devversionmmalerba
authored andcommitted
chore(schematics): fix formatting in workflow document (#13216)
Somehow the formatting of the code snippets in the schematics workflow file is incorrect.
1 parent 6b6cf45 commit e0f20ea

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

src/lib/schematics/update/update-schematic.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ This also makes the rule walker API consistent with the handling of inline resou
4949
```ts
5050
// PSEUDO CODE
5151
visitExternalTemplate(node: ts.SourceFile) {
52-
const parsed = parse5.parse(node.getFullText()); this._findOutdatedInputs()
53-
.forEach(offsetStart => this._addExternalFailure(offsetStart, 'Outdated input', _myFix);}
52+
const parsedHtml = parse5.parse(node.getFullText());
53+
54+
this._findOutdatedInputs(parsedHtml)
55+
.forEach(offsetStart => this._addExternalFailure(offsetStart, 'Outdated input', _myFix);}
5456
```
5557
5658
### Upgrade data for target versions
@@ -112,37 +114,47 @@ In the scenario where a property from `MatRipple` has been renamed in V7, we don
112114
_src/lib/schematics/update/test-cases/v7/property-names_input.ts_
113115
```ts
114116
...
117+
115118
/**
116-
* Mock definitions. This test case does not have access to @angular/material. */
119+
* Mock definitions. This test case does not have access to @angular/material.
120+
*/
117121
class MatRipple {
118122
color: string;
119123
}
120-
/*
124+
125+
/*
121126
* Actual test cases using the previously defined definitions.
122127
*/
123-
class A implements OnInit {
124-
constructor(private a: MatRipple) {}
128+
class A implements OnInit {
129+
constructor(private a: MatRipple) {}
130+
125131
ngOnInit() {
126132
this.a.color = 'primary';
127-
} }
133+
}
134+
}
128135
```
129136
130137
_src/lib/schematics/update/test-cases/v7/property-names_expected_output.ts_
131138
```ts
132139
...
140+
133141
/**
134-
* Mock definitions. This test case does not have access to @angular/material. */
142+
* Mock definitions. This test case does not have access to @angular/material.
143+
*/
135144
class MatRipple {
136145
color: string;
137146
}
138-
/*
147+
148+
/*
139149
* Actual test cases using the previously defined definitions.
140150
*/
141-
class A implements OnInit {
142-
constructor(private a: MatRipple) {}
151+
class A implements OnInit {
152+
constructor(private a: MatRipple) {}
153+
143154
ngOnInit() {
144155
this.a.newColor = 'primary';
145-
} }
156+
}
157+
}
146158
```
147159
148160
**Note**: The `_input.ts` file will be just transformed by the V7 migrations and compared to the `_expected_output.ts` file. This means that it's necessary to also include the no longer valid mock declarations to the expected output file.

0 commit comments

Comments
 (0)