kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/typescript/BUILD (about)

     1  load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")
     2  load("@aspect_rules_jasmine//jasmine:defs.bzl", "jasmine_test")
     3  load("@aspect_rules_js//js:defs.bzl", "js_test")
     4  
     5  package(default_visibility = ["//kythe:default_visibility"])
     6  
     7  # If you need to add / update dependencies:
     8  #
     9  # 0. Ensure you have a recent npm and pnpm. npm can come from apt.
    10  # 1. Edit //:package.json and //:WORKSPACE as appropriate
    11  # 2. From the *root dir* of the project, run
    12  #
    13  #       npm install
    14  #       pnpm import
    15  #
    16  # 3. Add the dependencies to the ts_project build rule below.
    17  
    18  ts_project(
    19      name = "kythe",
    20      srcs = ["kythe.ts"],
    21      declaration = True,
    22      source_map = True,
    23      supports_workers = 0,
    24  )
    25  
    26  ts_project(
    27      name = "indexer",
    28      srcs = [
    29          "indexer.ts",
    30          "plugin_api.ts",
    31          "utf8.ts",
    32      ],
    33      declaration = True,
    34      source_map = True,
    35      supports_workers = 0,
    36      deps = [
    37          ":kythe",
    38          "//:node_modules/@types/node",
    39          "//:node_modules/typescript",
    40      ],
    41  )
    42  
    43  ts_project(
    44      name = "test_ts",
    45      srcs = ["test.ts"],
    46      declaration = True,
    47      source_map = True,
    48      supports_workers = 0,
    49      deps = [
    50          ":indexer",
    51          ":kythe",
    52          "//:node_modules/@types/node",
    53          "//:node_modules/source-map",
    54          "//:node_modules/source-map-support",
    55          "//:node_modules/typescript",
    56      ],
    57  )
    58  
    59  ts_project(
    60      name = "utf8_test_ts",
    61      testonly = True,
    62      srcs = ["utf8_test.ts"],
    63      declaration = True,
    64      source_map = True,
    65      supports_workers = 0,
    66      deps = [
    67          ":indexer",
    68          "//:node_modules/@types/jasmine",
    69          "//:node_modules/balanced-match",
    70          "//:node_modules/brace-expansion",
    71          "//:node_modules/fs.realpath",
    72          "//:node_modules/glob",
    73          "//:node_modules/inflight",
    74          "//:node_modules/inherits",
    75          "//:node_modules/jasmine",
    76          "//:node_modules/jasmine-core",
    77          "//:node_modules/jasmine-reporters",
    78          "//:node_modules/minimatch",
    79          "//:node_modules/once",
    80          "//:node_modules/typescript",
    81          "//:node_modules/wrappy",
    82      ],
    83  )
    84  
    85  js_test(
    86      name = "indexer_test",
    87      data = [
    88          ":test_ts",
    89      ] + glob(
    90          ["testdata/**/*"],
    91      ) + [
    92          "//kythe/cxx/verifier",
    93          "//kythe/go/platform/tools/entrystream",
    94          "//kythe/go/util/tools/markedsource",
    95      ],
    96      entry_point = ":test.js",
    97  )
    98  
    99  jasmine_test(
   100      name = "utf8_test",
   101      args = ["utf8_test.js"],
   102      chdir = package_name(),
   103      data = [
   104          "utf8_test.js",
   105          ":utf8_test_ts",
   106      ],
   107      include_declarations = True,
   108      include_npm_linked_packages = True,
   109      include_transitive_sources = True,
   110      log_level = "debug",
   111      node_modules = "//:node_modules",
   112      patch_node_fs = True,
   113  )