-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14836 from IgniteUI/dpetev/fix-ng-ls-migrations-17.2
fix(migrations): fix LS server resolve with schematics encapsulation
- Loading branch information
Showing
5 changed files
with
60 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "build:schematics", | ||
"problemMatcher": [], | ||
"label": "buildSchematics", | ||
"detail": "Build schematics" | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "build:migrations -- --sourceMap", | ||
"dependsOn": [ | ||
"buildSchematics" | ||
], | ||
"problemMatcher": [], | ||
"label": "buildMigrationsSourceMap", | ||
"detail": "Build migrations with sourceMap for debugging" | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "node ./scripts/migrations-sourcemap-shift.mjs", | ||
"dependsOn": [ | ||
"buildMigrationsSourceMap" | ||
], | ||
"problemMatcher": [], | ||
"label": "buildMigrations", | ||
"detail": "Build migrations with sourceMap for debugging" | ||
}, | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { globby } from 'globby'; | ||
import { readFileSync, writeFileSync } from 'fs'; | ||
|
||
/** | ||
* Small patch for debugging compiled migrations that get wrapped with extra lines for encapsulation: | ||
* https://github.com/angular/angular-cli/blob/e51b9068763a115fa27d06e2dd7988b34a3f677c/packages/angular/cli/src/command-builder/utilities/schematic-engine-host.ts#L213-L215 | ||
* Works for the simple "version":3 mappings produced where adding ; at the start shifts the mapped lines (ignores the extra unmapped source) | ||
*/ | ||
(async () => { | ||
const paths = await globby('dist/igniteui-angular/migrations/**/*.js.map'); | ||
for (const path of paths) { | ||
const extraLine = ';'; | ||
const offset = 3; | ||
let content = readFileSync(path, { encoding: 'utf-8' }); | ||
content = content.replace(`"mappings":"`, `"mappings":"${extraLine.repeat(offset)}`); | ||
writeFileSync(path, content); | ||
} | ||
})(); |