-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
3,525 additions
and
4,397 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/cdk/schematics/ng-update/interfaces/replacement-attribute-to-directive.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/cdk/schematics/ng-update/interfaces/replacement-attribute.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/cdk/schematics/ng-update/interfaces/replacement-tag.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 6 additions & 9 deletions
15
projects/cdk/schematics/ng-update/utils/templates/replace-tag.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
import type {UpdateRecorder} from '@angular-devkit/schematics'; | ||
import type {ElementLocation} from 'parse5'; | ||
import type {ElementLocation} from 'parse5/dist/common/token'; | ||
|
||
const START_TAG_OFFSET = 1; | ||
const END_TAG_OFFSET = 2; | ||
|
||
export function replaceTag( | ||
recorder: UpdateRecorder, | ||
sourceCodeLocation: ElementLocation | undefined, | ||
sourceCodeLocation: ElementLocation | null | undefined, | ||
from: string, | ||
to: string, | ||
templateOffset = 0, | ||
addAttributes: string[] = [], | ||
): void { | ||
const startTagOffset = sourceCodeLocation?.startTag.startOffset; | ||
const endTagOffset = sourceCodeLocation?.endTag?.startOffset; | ||
const startTagOffset = sourceCodeLocation?.startTag?.startOffset ?? 0; | ||
const endTagOffset = sourceCodeLocation?.endTag?.startOffset ?? 0; | ||
|
||
if (endTagOffset) { | ||
recorder.remove(endTagOffset + templateOffset + END_TAG_OFFSET, from.length); | ||
recorder.insertRight(endTagOffset + templateOffset + END_TAG_OFFSET, to); | ||
} | ||
|
||
recorder.remove( | ||
(startTagOffset ?? 0) + templateOffset + START_TAG_OFFSET, | ||
from.length, | ||
); | ||
recorder.remove(startTagOffset + templateOffset + START_TAG_OFFSET, from.length); | ||
recorder.insertRight( | ||
(startTagOffset ?? 0) + templateOffset + START_TAG_OFFSET, | ||
startTagOffset + templateOffset + START_TAG_OFFSET, | ||
`${to} ${addAttributes.join(' ')}`, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
projects/cdk/schematics/ng-update/v3/steps/migrate-textfield-controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.