Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codefresh/codefresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ steps:
# Run tests
- yarn bazel test //tools/ts-api-guardian:all
- yarn test-ivy-aot //packages/animations/test //packages/common/test //packages/forms/test //packages/http/test //packages/platform-browser/test //packages/platform-browser-dynamic/test //packages/router/test
- yarn bazel test //tools/public_api_guard/...
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
*.js eol=lf
*.ts eol=lf

# API guardian patch must always use LF for tests to work
*.patch eol=lf

# Must keep Windows line ending to be parsed correctly
scripts/windows/packages.txt eol=crlf
3 changes: 2 additions & 1 deletion tools/ts-api-guardian/index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def ts_api_guardian_test(
]

for i in strip_export_pattern:
args += ["--stripExportPattern", i]
# The below replacement is needed because under Windows '^' needs to be escaped twice
args += ["--stripExportPattern", i.replace("^", "^^^^")]

for i in allow_module_identifiers:
args += ["--allowModuleIdentifiers", i]
Expand Down
2 changes: 1 addition & 1 deletion tools/ts-api-guardian/lib/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class ResolvedDeclarationEmitter {
const jsdocComment = this.processJsDocTags(node, tagOptions);
if (jsdocComment) {
// Add the annotation after the leading whitespace
output = output.replace(/^(\n\s*)/, `$1${jsdocComment} `);
output = output.replace(/^(\r?\n\s*)/, `$1${jsdocComment} `);
}
}

Expand Down
6 changes: 5 additions & 1 deletion tools/ts-api-guardian/test/cli_e2e_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ function execute(args: string[]): {stdout: string, stderr: string, status: numbe
// We need to determine the directory that includes the `ts-api-guardian` npm_package that
// will be used to spawn the CLI binary. This is a workaround because technically we shouldn't
// spawn a child process that doesn't have the custom NodeJS module resolution for Bazel.
const nodePath = path.join(path.dirname(require.resolve('../lib/cli.js')), '../');
const nodePath = [
path.join(require.resolve('npm/node_modules/chalk/package.json'), '../../'),
path.join(require.resolve('../lib/cli.js'), '../../'),
].join(process.platform === 'win32' ? ';' : ':');

const output = child_process.spawnSync(process.execPath, [BINARY_PATH, ...args], {
env: {
'NODE_PATH': nodePath,
Expand Down