fix(dev-infra): prep ts-circular-deps to load via node_modules (#36165)

to run ts-circular-deps via installed node_modules, we needed to set
the hashbang of the script to be a node environment, and discover the
project directory based on where the script is run rather than the
scripts file location.

PR Close #36165
This commit is contained in:
Joey Perrott 2020-03-20 10:17:42 -07:00 committed by Misko Hevery
parent e81ad3a1bc
commit 0e76b32aa5
2 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,7 @@ ts_library(
module_name = "@angular/dev-infra-private/ts-circular-dependencies",
visibility = ["//dev-infra:__subpackages__"],
deps = [
"//dev-infra/utils:config",
"@npm//@types/glob",
"@npm//@types/node",
"@npm//@types/yargs",

View File

@ -1,3 +1,4 @@
#!/usr/bin/env node
/**
* @license
* Copyright Google Inc. All Rights Reserved.
@ -17,7 +18,9 @@ import {Analyzer, ReferenceChain} from './analyzer';
import {compareGoldens, convertReferenceChainToGolden, Golden} from './golden';
import {convertPathToForwardSlash} from './file_system';
const projectDir = join(__dirname, '../../');
import {getRepoBaseDir} from '../utils/config';
const projectDir = getRepoBaseDir();
const packagesDir = join(projectDir, 'packages/');
// The default glob does not capture deprecated packages such as http, or the webworker platform.
const defaultGlob =