refactor(language-service): move TS utils to separate file (#36984)

This commit refactors TS-only utility functions to a separate file so
that they could be shared with Ivy language service.
A separate ts_library rule is created so that there is no dependency on
`compiler` and `compiler-cli` to make the compilation fast and
light-weight.
The method `getPropertyAssignmentFromValue` is modified slightly to
improve the ergonomics of the function.

PR Close #36984
This commit is contained in:
Keen Yee Liau
2020-05-07 08:55:33 -07:00
committed by Misko Hevery
parent 7eb1a58b26
commit 40025f55ad
8 changed files with 160 additions and 145 deletions

View File

@ -9,8 +9,12 @@ ts_library(
"*.ts",
"src/**/*.ts",
],
exclude = [
"src/ts_utils.ts",
],
),
deps = [
":ts_utils",
"//packages:types",
"//packages/compiler",
"//packages/compiler-cli",
@ -20,6 +24,14 @@ ts_library(
],
)
ts_library(
name = "ts_utils",
srcs = ["src/ts_utils.ts"],
deps = [
"@npm//typescript",
],
)
pkg_npm(
name = "npm_package",
srcs = ["package.json"],