Skip to content

Commit

Permalink
feat: Uses source map to display graph data and fixes Windows path is…
Browse files Browse the repository at this point in the history
…sue. (#585)
  • Loading branch information
jaysoo committed Mar 15, 2019
1 parent 6c3e975 commit d80aca4
Show file tree
Hide file tree
Showing 15 changed files with 164 additions and 42,323 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libs/server/src/lib/utils/fixtures
8 changes: 0 additions & 8 deletions apps/angular-console-e2e/src/integration/tasks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,6 @@ describe('Tasks', () => {

cy.contains('.summary .content', 'Started', { timeout: 220000 });

cy.get('.summary .header .mat-select-trigger').click({ force: true });

cy.get('.mat-option-text')
.contains('Parsed')
.click();

cy.contains('.summary .content', /[0-9.]+(k|m|g)?b/i, { timeout: 220000 });

cy.contains('mat-grid-tile', /^.+\.js/);

cy.get('button')
Expand Down
3 changes: 2 additions & 1 deletion apps/electron/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"semver": "5.6.0",
"tmp": "0.0.33",
"node-pty-prebuilt": "0.7.6"
"node-pty-prebuilt": "0.7.6",
"source-map-explorer": "^1.7.0"
}
}
3 changes: 2 additions & 1 deletion apps/vscode/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"dependencies": {
"semver": "5.6.0",
"tmp": "0.0.33",
"node-pty-prebuilt": "0.7.6"
"node-pty-prebuilt": "0.7.6",
"source-map-explorer": "^1.7.0"
}
}
5 changes: 5 additions & 0 deletions libs/server/src/lib/api/detailed-status-calculator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
(global as any).__non_webpack_require__ = () => {
return () => {
throw new Error();
};
};
import {
StatusType,
BuildDetailedStatusCalculator,
Expand Down
20 changes: 15 additions & 5 deletions libs/server/src/lib/utils/architect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ export const SUPPORTED_NG_BUILD_BUILDERS = [
'@nrwl/builders:web-build',
'@nrwl/builders:web-dev-server'
];
export const SUPPORTED_NG_BUILD_BUILDERS_WITH_STATS = [
export const SUPPORTED_NG_BUILD_BUILDERS_WITH_STATS_AND_SOURCE_MAP = [
'@angular-devkit/build-angular:browser',
'@nrwl/builders:web-build'
];
export const SUPPORTED_NG_BUILD_BUILDERS_WITH_VENDOR_SOURCE_MAP = [
'@angular-devkit/build-angular:browser'
];

// For some operations we need to add additional flags or configuration
// in order to make sure we get the expected output.
Expand All @@ -26,21 +29,28 @@ export function normalizeCommands(cwd: string, cmds: string[]): string[] {
const builder = getProjectArchitect(project, operationName, angularJson)
.builder;

let normalized = cmds;

// Make sure we use progress reporter so that we can parse the output consistently.
if (SUPPORTED_KARMA_TEST_BUILDERS.includes(builder)) {
const projectRoot = angularJson.projects[cmds[1]].root;
const karmaConfigPath = join(cwd, projectRoot, 'karma.conf.js');
const isUsingKarma = existsSync(karmaConfigPath);
if (isUsingKarma) {
return cmds.concat(['--reporters', 'progress']);
normalized = cmds.concat(['--reporters', 'progress']);
}
}

// Make sure we generate stats data so we can parse it later.
if (SUPPORTED_NG_BUILD_BUILDERS_WITH_STATS.includes(builder)) {
return cmds.concat(['--stats-json']);
if (SUPPORTED_NG_BUILD_BUILDERS_WITH_STATS_AND_SOURCE_MAP.includes(builder)) {
normalized = normalized.concat(['--stats-json', '--source-map']);
}
return cmds;
// This option is deprecated in 7.2, so we need another way to get vendor source maps.
if (SUPPORTED_NG_BUILD_BUILDERS_WITH_VENDOR_SOURCE_MAP.includes(builder)) {
normalized = normalized.concat(['--vendor-source-map']);
}

return normalized;
}

export function getProjectArchitect(
Expand Down
Loading

0 comments on commit d80aca4

Please sign in to comment.