{"//":"NOTE: Typescript does not follow SemVer. Usually the minor digit signifies a major version.","bin":{"tsc_wrapped":"internal/tsc_wrapped/tsc_wrapped.js","ts_project_options_validator":"internal/ts_project_options_validator.js"},"bugs":{"url":"https://github.com/bazelbuild/rules_nodejs/issues"},"dist":{"shasum":"daf2fb0d0bdcd3df331d4320463b1a4beca6031c","tarball":"https://registry.npmjs.org/@bazel/typescript/-/typescript-4.0.0-beta.0.tgz","fileCount":103,"integrity":"sha512-dfI3QLQ5bLyK3BIrrwxuH9cLbMHuku0UZH7nwjHjXwQX70O0MSGN6yXx2Vrqatj2iw/UfHX/akPuhGlNqrDFRw==","signatures":[{"sig":"MEUCIELIpmvc3xH5kRDRpO9ystbvTb2ZPeQBBbofy5RsZ+uuAiEAy5wnw23gVMCsJ6ZhFjT1Fxzbpta7gbkxwSTf5bmAsvU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19450618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg32VnCRA9TVsSAnZWagAA4ycQAIBc9MAMV6qjY1JVCIUR\nwJbvQUNSJK5RIUzAInKp5zA/ci40HAzertnxCQicZbZIsRGWN3+CVvpsTD/e\nvek6LWdudi4UJTQuWjDJRHX5O65+BwuF1iiStb6sPAuW8koM/jYlPxY/es9m\nkkSYqSSNJa1GSthWt8oXwEd3o+g5lF3vJQiq5vaLNJP7VZI+p25LQr3Xtcri\nXH2kKntYTV/3TSmEdSqC8b//l2I9MwbhEU9iRvd00plhse5j0bTl48Abj184\nhAnEhUVTN7EK8vHu4KgAraclTNxsBK7qClY47sK6JqCjhW+YyVzsSiNa/WLm\nalw4ik8Lcf490LWSMHBvuZQPgFuFtKw2qGF3Z32AQddcgCOC/bkhI3cUVPK7\nWJL84Q6XoTeNmOZXzQD77ohTD6BDslGrUk8aWwn2IHabEK71eyUFSD9Js8xM\nHPx2lWzHl9FJRf5SKsVYiysPRYYGGFxG9v66G010zazo69fWJvW2ZlN/EjBk\nUv5HtnRVa2zWiyYTudmldNFLw1tQp+sCmaL7GeMfxAkoxPG5h1KvTD+wuU9c\nebxf4Tt09zdKfcZT6gAF+1NeDBIV9EY17IgDj5cQAtTK2gQ2CLtTAn/xRbXx\nCf9ie1skSulQf0UCT+TvnCpfSZE7+41lkPMAl7xCWkgMEQl3yMSoAT1g91+Y\n3QL6\r\n=/ZsE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./internal/tsc_wrapped/index.js","name":"@bazel/typescript","readme":"<!-- *********************\n  DO NOT EDIT THIS FILE\n  It is a generated build output from Stardoc.\n  Instead you must edit the .bzl file where the rules are declared,\n  or possibly a markdown file next to the .bzl file\n ********************* -->\n\n# TypeScript rules for Bazel\n\nThe TypeScript rules integrate the TypeScript compiler with Bazel.\n\n## Alternatives\n\nThis package provides Bazel wrappers around the TypeScript compiler.\n\nAt a high level, there are three alternatives provided: `tsc`, `ts_project`, `ts_library`.\nThis section describes the trade-offs between these rules.\n\n### tsc\n\n`tsc` is the TypeScript compiler published by the team at Microsoft.\nYou can call it without any custom Bazel rules.\n\nTo use this option, you **do not need to install the `@bazel/typescript` package**.\n\nThe only reason to use raw `tsc` is if you want to compile a directory of `.ts` files and cannot enumerate them ahead-of-time in your BUILD file so that Bazel can predict all the output files.\n(For example if the `.ts` files are generated by some tool).\nThis will produce an opaque directory of `.js` file outputs, which you won't be able to individually reference.\n\nAny other use case for `tsc` is better served by using `ts_project`, see below.\n\nLike we do for any npm package that exposes a binary, rules_nodejs will see your dependency on\n`typescript` and will generate an `index.bzl` file allowing you to run `tsc`.\nTo use it, add the load statement `load(\"@npm//typescript:index.bzl\", \"tsc\")` to your BUILD file.\n(Possibly replacing `@npm` with the name of the repository where you installed dependencies)\n\nThen call it, using the [`npm_package_bin`](Built-ins#npm_package_bin) documentation.\n\nHere is an example:\nhttps://github.com/bazelbuild/rules_nodejs/blob/3.2.2/internal/node/test/BUILD.bazel#L491-L507\n\n### ts_project\n\n`ts_project` simply runs `tsc --project`, with Bazel knowing which outputs to expect based on the TypeScript compiler options,\nand with interoperability with other TypeScript rules via the [DeclarationInfo] Provider that transmits the type information.\n\nIt is intended as an easy on-boarding for existing TypeScript code and should be familiar if your background is in frontend ecosystem idioms.\n\nAny behavior of `ts_project` should be reproducible outside of Bazel, with a couple of caveats noted in the rule documentation below.\n\n`ts_project` is recommended for all new code.\n\nExhaustive examples of calling `ts_project` are in the test suite:\nhttps://github.com/bazelbuild/rules_nodejs/tree/stable/packages/typescript/test/ts_project\n\nAnd there are also many uses of it in our <examples>\n\n[DeclarationInfo]: Built-ins#declarationinfo\n\n### ts_library\n\n`ts_library` should not be used for new code, and may be deprecated in the future.\n\n`ts_library` is an open-sourced version of the rule used to compile TS code at Google.\nHowever there is no support from the team that maintains that internal version.\nIt is very complex, involving code generation of the `tsconfig.json` file, a custom compiler binary, and a lot of extra features.\n\nIt is also opinionated, and may not work with existing TypeScript code. For example:\n\n- Your TS code must compile under the `--declaration` flag so that downstream libraries depend only on types, not implementation. This makes Bazel faster by avoiding cascading rebuilds in cases where the types aren't changed.\n- We control the output format and module syntax so that downstream rules can rely on them.\n- Some other options are incompatible. For example you cannot use the `--noEmit` compiler option in `tsconfig.json`.\n\nThe only reason to use `ts_library` for new code is if you are bought-in to using a [concatjs] bundler, which requires the named AMD module format. This may be faster than other tooling, and this format can be consumed by the Closure Compiler (via integration with [tsickle](https://github.com/angular/tsickle)).\nHowever it is very challenging to configure and there is little available support for problems you'll run into.\n\n[concatjs]: https://www.npmjs.com/package/@bazel/concatjs\n\n## Installation\n\nAdd a `devDependency` on `@bazel/typescript`\n\n```sh\n$ yarn add -D @bazel/typescript\n# or\n$ npm install --save-dev @bazel/typescript\n```\n\nWatch for any `peerDependency` warnings - we assume you have already installed the `typescript` package from npm.\n\n## Typical Usage\n\nThe `ts_project` rule invokes the TypeScript compiler on one compilation unit,\nor \"library\" (generally one directory of source files). In TypeScript terms, this is one \"Project\"\nwhich can use \"Project References\" to break up a large application.\n\nCreate a `BUILD` file next to your sources:\n\n```starlark\nload(\"@npm//@bazel/typescript:index.bzl\", \"ts_project\")\n\nts_project(\n    name = \"my_code\",\n    # glob is a quick way to select all the code,\n    # but has performance penalty in that Bazel must evaluate it.\n    srcs = glob([\"*.ts\"]),\n    deps = [\"//path/to/other:library\"],\n)\n```\n\nHere, `//path/to/other:library` is another target in your repo that produces TypeScript typings (for example, another `ts_project` rule).\nBe sure to set the `rootDirs` in your tsconfig.json as noted below, so that TypeScript can find the `.d.ts` files produced by that other target.\n\nTo use third-party libraries from npm, first install them (likely using `npm_install` or `yarn_install` rules) then add those to the `deps` as well:\n\n```starlark\nts_project(\n    name = \"my_code\",\n    srcs = glob([\"*.ts\"]),\n    deps = [\n      \"@npm//@types/node\",\n      \"@npm//@types/foo\",\n      \"@npm//somelib\",\n      \"//path/to/other:library\",\n    ],\n)\n```\n\nYou can also use the `@npm//@types` grouping target which will include all\npackages in the `@types` scope as dependencies.\n\nTo build a `ts_library` target run:\n\n`bazel build //path/to/package:target`\n\nNote that the `tsconfig.json` file used for compilation should be the same one\nyour editor references, or `extends` from it, to keep consistent settings for the TypeScript compiler.\n\nAnything you do with TypeScript is possible with `ts_project`, including json imports, type-checking only,\ntranspile only, outdir, rootdir, and so on.\nSee many examples in our test cases:\nhttps://github.com/bazelbuild/rules_nodejs/tree/stable/packages/typescript/test/ts_project\n\n\n## ts_config\n\n**USAGE**\n\n<pre>\nts_config(<a href=\"#ts_config-name\">name</a>, <a href=\"#ts_config-deps\">deps</a>, <a href=\"#ts_config-src\">src</a>)\n</pre>\n\nAllows a tsconfig.json file to extend another file.\n\nNormally, you just give a single `tsconfig.json` file as the tsconfig attribute\nof a `ts_library` or `ts_project` rule. However, if your `tsconfig.json` uses the `extends`\nfeature from TypeScript, then the Bazel implementation needs to know about that\nextended configuration file as well, to pass them both to the TypeScript compiler.\n\n\n**ATTRIBUTES**\n\n\n<h4 id=\"ts_config-name\">name</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#name\">Name</a>, mandatory*): A unique name for this target.\n\n\n<h4 id=\"ts_config-deps\">deps</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">List of labels</a>*): Additional tsconfig.json files referenced via extends\n\nDefaults to `[]`\n\n<h4 id=\"ts_config-src\">src</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">Label</a>, mandatory*): The tsconfig.json file passed to the TypeScript compiler\n\n\n\n## ts_library\n\n**USAGE**\n\n<pre>\nts_library(<a href=\"#ts_library-name\">name</a>, <a href=\"#ts_library-angular_assets\">angular_assets</a>, <a href=\"#ts_library-compiler\">compiler</a>, <a href=\"#ts_library-data\">data</a>, <a href=\"#ts_library-deps\">deps</a>, <a href=\"#ts_library-devmode_module\">devmode_module</a>, <a href=\"#ts_library-devmode_target\">devmode_target</a>,\n           <a href=\"#ts_library-expected_diagnostics\">expected_diagnostics</a>, <a href=\"#ts_library-generate_externs\">generate_externs</a>, <a href=\"#ts_library-internal_testing_type_check_dependencies\">internal_testing_type_check_dependencies</a>,\n           <a href=\"#ts_library-link_workspace_root\">link_workspace_root</a>, <a href=\"#ts_library-module_name\">module_name</a>, <a href=\"#ts_library-module_root\">module_root</a>, <a href=\"#ts_library-package_name\">package_name</a>, <a href=\"#ts_library-package_path\">package_path</a>, <a href=\"#ts_library-prodmode_module\">prodmode_module</a>,\n           <a href=\"#ts_library-prodmode_target\">prodmode_target</a>, <a href=\"#ts_library-runtime\">runtime</a>, <a href=\"#ts_library-runtime_deps\">runtime_deps</a>, <a href=\"#ts_library-srcs\">srcs</a>, <a href=\"#ts_library-supports_workers\">supports_workers</a>, <a href=\"#ts_library-tsconfig\">tsconfig</a>, <a href=\"#ts_library-tsickle_typed\">tsickle_typed</a>,\n           <a href=\"#ts_library-use_angular_plugin\">use_angular_plugin</a>)\n</pre>\n\ntype-check and compile a set of TypeScript sources to JavaScript.\n\nIt produces declarations files (`.d.ts`) which are used for compiling downstream\nTypeScript targets and JavaScript for the browser and Closure compiler.\n\nBy default, `ts_library` uses the `tsconfig.json` file in the workspace root\ndirectory. See the notes about the `tsconfig` attribute below.\n\n## Serving TypeScript for development\n\n`ts_library` is typically served by the concatjs_devserver rule, documented in the `@bazel/concatjs` package.\n\n## Accessing JavaScript outputs\n\nThe default output of the `ts_library` rule is the `.d.ts` files.\nThis is for a couple reasons:\n\n- help ensure that downstream rules which access default outputs will not require\n  a cascading re-build when only the implementation changes but not the types\n- make you think about whether you want the `devmode` (named `UMD`) or `prodmode` outputs\n\nYou can access the JS output by adding a `filegroup` rule after the `ts_library`,\nfor example\n\n```python\nts_library(\n    name = \"compile\",\n    srcs = [\"thing.ts\"],\n)\n\nfilegroup(\n    name = \"thing.js\",\n    srcs = [\"compile\"],\n    # Change to es6_sources to get the 'prodmode' JS\n    output_group = \"es5_sources\",\n)\n\nmy_rule(\n    name = \"uses_js\",\n    deps = [\"thing.js\"],\n)\n```\n\n\n\n**ATTRIBUTES**\n\n\n<h4 id=\"ts_library-name\">name</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#name\">Name</a>, mandatory*): A unique name for this target.\n\n\n<h4 id=\"ts_library-angular_assets\">angular_assets</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">List of labels</a>*): Additional files the Angular compiler will need to read as inputs.\n            Includes .css and .html files\n\nDefaults to `[]`\n\n<h4 id=\"ts_library-compiler\">compiler</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">Label</a>*): Sets a different TypeScript compiler binary to use for this library.\nFor example, we use the vanilla TypeScript tsc.js for bootstrapping,\nand Angular compilations can replace this with `ngc`.\n\nThe default ts_library compiler depends on the `//@bazel/typescript`\ntarget which is setup for projects that use bazel managed npm deps and\ninstall the @bazel/typescript npm package.\n\nYou can also use a custom compiler to increase the NodeJS heap size used for compilations.\n\nTo do this, declare your own binary for running `tsc_wrapped`, e.g.:\n\n```python\nnodejs_binary(\n    name = \"tsc_wrapped_bin\",\n    entry_point = \"@npm//:node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js\",\n    templated_args = [\n        \"--node_options=--max-old-space-size=2048\",\n    ],\n    data = [\n        \"@npm//protobufjs\",\n        \"@npm//source-map-support\",\n        \"@npm//tsutils\",\n        \"@npm//typescript\",\n        \"@npm//@bazel/typescript\",\n    ],\n)\n```\n\nthen refer to that target in the `compiler` attribute.\n\nNote that `nodejs_binary` targets generated by `npm_install`/`yarn_install` can include data dependencies\non packages which aren't declared as dependencies.\nFor example, if you use [tsickle](https://github.com/angular/tsickle) to generate Closure Compiler-compatible JS,\nthen it needs to be a data dependency of `tsc_wrapped` so that it can be loaded at runtime.\n\nDefaults to `//@bazel/typescript/bin:tsc_wrapped`\n\n<h4 id=\"ts_library-data\">data</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">List of labels</a>*)\n\nDefaults to `[]`\n\n<h4 id=\"ts_library-deps\">deps</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">List of labels</a>*): Compile-time dependencies, typically other ts_library targets\n\nDefaults to `[]`\n\n<h4 id=\"ts_library-devmode_module\">devmode_module</h4>\n\n(*String*): Set the typescript `module` compiler option for devmode output.\n\nThis value will override the `module` option in the user supplied tsconfig.\n\nDefaults to `\"umd\"`\n\n<h4 id=\"ts_library-devmode_target\">devmode_target</h4>\n\n(*String*): Set the typescript `target` compiler option for devmode output.\n\nThis value will override the `target` option in the user supplied tsconfig.\n\nDefaults to `\"es2015\"`\n\n<h4 id=\"ts_library-expected_diagnostics\">expected_diagnostics</h4>\n\n(*List of strings*)\n\nDefaults to `[]`\n\n<h4 id=\"ts_library-generate_externs\">generate_externs</h4>\n\n(*Boolean*)\n\nDefaults to `True`\n\n<h4 id=\"ts_library-internal_testing_type_check_dependencies\">internal_testing_type_check_dependencies</h4>\n\n(*Boolean*): Testing only, whether to type check inputs that aren't srcs.\n\nDefaults to `False`\n\n<h4 id=\"ts_library-link_workspace_root\">link_workspace_root</h4>\n\n(*Boolean*): Link the workspace root to the bin_dir to support absolute requires like 'my_wksp/path/to/file'.\n\nIf source files need to be required then they can be copied to the bin_dir with copy_to_bin.\n\nDefaults to `False`\n\n<h4 id=\"ts_library-module_name\">module_name</h4>\n\n(*String*)\n\nDefaults to `\"\"`\n\n<h4 id=\"ts_library-module_root\">module_root</h4>\n\n(*String*)\n\nDefaults to `\"\"`\n\n<h4 id=\"ts_library-package_name\">package_name</h4>\n\n(*String*): The package name that the linker will link this ts_library output as.\n\nIf package_path is set, the linker will link this package under <package_path>/node_modules/<package_name>.\nIf package_path is not set the this will be the root node_modules of the workspace.\n\nDefaults to `\"\"`\n\n<h4 id=\"ts_library-package_path\">package_path</h4>\n\n(*String*): The package path in the workspace that the linker will link this ts_library output to.\n\nIf package_path is set, the linker will link this package under <package_path>/node_modules/<package_name>.\nIf package_path is not set the this will be the root node_modules of the workspace.\n\nDefaults to `\"\"`\n\n<h4 id=\"ts_library-prodmode_module\">prodmode_module</h4>\n\n(*String*): Set the typescript `module` compiler option for prodmode output.\n\nThis value will override the `module` option in the user supplied tsconfig.\n\nDefaults to `\"esnext\"`\n\n<h4 id=\"ts_library-prodmode_target\">prodmode_target</h4>\n\n(*String*): Set the typescript `target` compiler option for prodmode output.\n\nThis value will override the `target` option in the user supplied tsconfig.\n\nDefaults to `\"es2015\"`\n\n<h4 id=\"ts_library-runtime\">runtime</h4>\n\n(*String*)\n\nDefaults to `\"browser\"`\n\n<h4 id=\"ts_library-runtime_deps\">runtime_deps</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">List of labels</a>*)  The dependencies of this attribute must provide: JsInfo\n\n\nDefaults to `[]`\n\n<h4 id=\"ts_library-srcs\">srcs</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">List of labels</a>, mandatory*): The TypeScript source files to compile.\n\n\n<h4 id=\"ts_library-supports_workers\">supports_workers</h4>\n\n(*Boolean*): Intended for internal use only.\n\nAllows you to disable the Bazel Worker strategy for this library.\nTypically used together with the \"compiler\" setting when using a\nnon-worker aware compiler binary.\n\nDefaults to `True`\n\n<h4 id=\"ts_library-tsconfig\">tsconfig</h4>\n\n(*<a href=\"https://bazel.build/docs/build-ref.html#labels\">Label</a>*): A tsconfig.json file containing settings for TypeScript compilation.\nNote that some properties in the tsconfig are governed by Bazel and will be\noverridden, such as `target` and `module`.\n\nThe default value is set to `//:tsconfig.json` by a macro. This means you must\neither:\n\n- Have your `tsconfig.json` file in the workspace root directory\n- Use an alias in the root BUILD.bazel file to point to the location of tsconfig:\n    `alias(name=\"tsconfig.json\", actual=\"//path/to:tsconfig-something.json\")`\n    and also make the tsconfig.json file visible to other Bazel packages:\n    `exports_files([\"tsconfig.json\"], visibility = [\"//visibility:public\"])`\n- Give an explicit `tsconfig` attribute to all `ts_library` targets\n\nDefaults to `None`\n\n<h4 id=\"ts_library-tsickle_typed\">tsickle_typed</h4>\n\n(*Boolean*): If using tsickle, instruct it to translate types to ClosureJS format\n\nDefaults to `True`\n\n<h4 id=\"ts_library-use_angular_plugin\">use_angular_plugin</h4>\n\n(*Boolean*): Run the Angular ngtsc compiler under ts_library\n\nDefaults to `False`\n\n\n## ts_project\n\n**USAGE**\n\n<pre>\nts_project(<a href=\"#ts_project-name\">name</a>, <a href=\"#ts_project-tsconfig\">tsconfig</a>, <a href=\"#ts_project-srcs\">srcs</a>, <a href=\"#ts_project-args\">args</a>, <a href=\"#ts_project-deps\">deps</a>, <a href=\"#ts_project-extends\">extends</a>, <a href=\"#ts_project-allow_js\">allow_js</a>, <a href=\"#ts_project-declaration\">declaration</a>, <a href=\"#ts_project-source_map\">source_map</a>,\n           <a href=\"#ts_project-declaration_map\">declaration_map</a>, <a href=\"#ts_project-preserve_jsx\">preserve_jsx</a>, <a href=\"#ts_project-composite\">composite</a>, <a href=\"#ts_project-incremental\">incremental</a>, <a href=\"#ts_project-emit_declaration_only\">emit_declaration_only</a>,\n           <a href=\"#ts_project-ts_build_info_file\">ts_build_info_file</a>, <a href=\"#ts_project-tsc\">tsc</a>, <a href=\"#ts_project-typescript_package\">typescript_package</a>, <a href=\"#ts_project-typescript_require_path\">typescript_require_path</a>, <a href=\"#ts_project-validate\">validate</a>,\n           <a href=\"#ts_project-supports_workers\">supports_workers</a>, <a href=\"#ts_project-declaration_dir\">declaration_dir</a>, <a href=\"#ts_project-out_dir\">out_dir</a>, <a href=\"#ts_project-root_dir\">root_dir</a>, <a href=\"#ts_project-link_workspace_root\">link_workspace_root</a>, <a href=\"#ts_project-kwargs\">kwargs</a>)\n</pre>\n\nCompiles one TypeScript project using `tsc --project`\n\nThis is a drop-in replacement for the `tsc` rule automatically generated for the \"typescript\"\npackage, typically loaded from `@npm//typescript:index.bzl`. Unlike bare `tsc`, this rule understands\nthe Bazel interop mechanism (Providers) so that this rule works with others that produce or consume\nTypeScript typings (`.d.ts` files).\n\nUnlike `ts_library`, this rule is the thinnest possible layer of Bazel interoperability on top\nof the TypeScript compiler. It shifts the burden of configuring TypeScript into the tsconfig.json file.\nSee https://github.com/bazelbuild/rules_nodejs/blob/master/docs/TypeScript.md#alternatives\nfor more details about the trade-offs between the two rules.\n\nSome TypeScript options affect which files are emitted, and Bazel wants to know these ahead-of-time.\nSo several options from the tsconfig file must be mirrored as attributes to ts_project.\nSee https://www.typescriptlang.org/v2/en/tsconfig for a listing of the TypeScript options.\n\nAny code that works with `tsc` should work with `ts_project` with a few caveats:\n\n- Bazel requires that the `outDir` (and `declarationDir`) be set to\n  `bazel-out/[target architecture]/bin/path/to/package`\n  so we override whatever settings appear in your tsconfig.\n- Bazel expects that each output is produced by a single rule.\n  Thus if you have two `ts_project` rules with overlapping sources (the same `.ts` file\n  appears in more than one) then you get an error about conflicting `.js` output\n  files if you try to build both together.\n  Worse, if you build them separately then the output directory will contain whichever\n  one you happened to build most recently. This is highly discouraged.\n\n> Note: in order for TypeScript to resolve relative references to the bazel-out folder,\n> we recommend that the base tsconfig contain a rootDirs section that includes all\n> possible locations they may appear.\n>\n> We hope this will not be needed in some future release of TypeScript.\n> Follow https://github.com/microsoft/TypeScript/issues/37257 for more info.\n>\n> For example, if the base tsconfig file relative to the workspace root is\n> `path/to/tsconfig.json` then you should configure like:\n>\n> ```\n> \"compilerOptions\": {\n>     \"rootDirs\": [\n>         \".\",\n>         \"../../bazel-out/host/bin/path/to\",\n>         \"../../bazel-out/darwin-fastbuild/bin/path/to\",\n>         \"../../bazel-out/k8-fastbuild/bin/path/to\",\n>         \"../../bazel-out/x64_windows-fastbuild/bin/path/to\",\n>         \"../../bazel-out/darwin-dbg/bin/path/to\",\n>         \"../../bazel-out/k8-dbg/bin/path/to\",\n>         \"../../bazel-out/x64_windows-dbg/bin/path/to\",\n>     ]\n> }\n> ```\n>\n> See some related discussion including both \"rootDirs\" and \"paths\" for a monorepo setup\n> using custom import paths:\n> https://github.com/bazelbuild/rules_nodejs/issues/2298\n\n### Issues when running non-sandboxed\n\nWhen using a non-sandboxed spawn strategy (which is the default on Windows), you may\nobserve these problems which require workarounds:\n\n1) Bazel deletes outputs from the previous execution before running `tsc`.\n   This causes a problem with TypeScript's incremental mode: if the `.tsbuildinfo` file\n   is not known to be an output of the rule, then Bazel will leave it in the output\n   directory, and when `tsc` runs, it may see that the outputs written by the prior\n   invocation are up-to-date and skip the emit of these files. This will cause Bazel\n   to intermittently fail with an error that some outputs were not written.\n   This is why we depend on `composite` and/or `incremental` attributes to be provided,\n   so we can tell Bazel to expect a `.tsbuildinfo` output to ensure it is deleted before a\n   subsequent compilation.\n   At present, we don't do anything useful with the `.tsbuildinfo` output, and this rule\n   does not actually have incremental behavior. Deleting the file is actually\n   counter-productive in terms of TypeScript compile performance.\n   Follow https://github.com/bazelbuild/rules_nodejs/issues/1726\n\n2) When using Project References, TypeScript will expect to verify that the outputs of referenced\n   projects are up-to-date with respect to their inputs.\n   (This is true even without using the `--build` option).\n   When using a non-sandboxed spawn strategy, `tsc` can read the sources from other `ts_project`\n   rules in your project, and will expect that the `tsconfig.json` file for those references will\n   indicate where the outputs were written. However the `outDir` is determined by this Bazel rule so\n   it cannot be known from reading the `tsconfig.json` file.\n   This problem is manifested as a TypeScript diagnostic like\n   `error TS6305: Output file '/path/to/execroot/a.d.ts' has not been built from source file '/path/to/execroot/a.ts'.`\n   As a workaround, you can give the Windows \"fastbuild\" output directory as the `outDir` in your tsconfig file.\n   On other platforms, the value isn't read so it does no harm.\n   See https://github.com/bazelbuild/rules_nodejs/tree/stable/packages/typescript/test/ts_project as an example.\n   We hope this will be fixed in a future release of TypeScript;\n   follow https://github.com/microsoft/TypeScript/issues/37378\n\n3) When TypeScript encounters an import statement, it adds the source file resolved by that reference\n   to the program. However you may have included that source file in a different project, so this causes\n   the problem mentioned above where a source file is in multiple programs.\n   (Note, if you use Project References this is not the case, TS will know the referenced\n   file is part of the other program.)\n   This will result in duplicate emit for the same file, which produces an error\n   since the files written to the output tree are read-only.\n   Workarounds include using using Project References, or simply grouping the whole compilation\n   into one program (if this doesn't exceed your time budget).\n\n\n**PARAMETERS**\n\n\n<h4 id=\"ts_project-name\">name</h4>\n\nA name for the target.\n\nWe recommend you use the basename (no `.json` extension) of the tsconfig file that should be compiled.\n\nDefaults to `\"tsconfig\"`\n\n<h4 id=\"ts_project-tsconfig\">tsconfig</h4>\n\nLabel of the tsconfig.json file to use for the compilation\n\nTo support \"chaining\" of more than one extended config, this label could be a target that\nprovdes `TsConfigInfo` such as `ts_config`.\n\nBy default, we assume the tsconfig file is \"tsconfig.json\" in the same folder as the ts_project rule.\n\nEXPERIMENTAL: generated tsconfig\n\nInstead of a label, you can pass a dictionary of tsconfig keys.\n\nIn this case, a tsconfig.json file will be generated for this compilation, in the following way:\n- all top-level keys will be copied by converting the dict to json.\n  So `tsconfig = {\"compilerOptions\": {\"declaration\": True}}`\n  will result in a generated `tsconfig.json` with `{\"compilerOptions\": {\"declaration\": true}}`\n- each file in srcs will be converted to a relative path in the `files` section.\n- the `extends` attribute will be converted to a relative path\n\nNote that you can mix and match attributes and compilerOptions properties, so these are equivalent:\n\n```\nts_project(\n    tsconfig = {\n        \"compilerOptions\": {\n            \"declaration\": True,\n        },\n    },\n)\n```\nand\n```\nts_project(\n    declaration = True,\n)\n```\n\nDefaults to `None`\n\n<h4 id=\"ts_project-srcs\">srcs</h4>\n\nList of labels of TypeScript source files to be provided to the compiler.\n\nIf absent, defaults to `**/*.ts[x]` (all TypeScript files in the package).\n\nDefaults to `None`\n\n<h4 id=\"ts_project-args\">args</h4>\n\nList of strings of additional command-line arguments to pass to tsc.\n\nDefaults to `[]`\n\n<h4 id=\"ts_project-deps\">deps</h4>\n\nList of labels of other rules that produce TypeScript typings (.d.ts files)\n\nDefaults to `[]`\n\n<h4 id=\"ts_project-extends\">extends</h4>\n\nLabel of the tsconfig file referenced in the `extends` section of tsconfig\n\nTo support \"chaining\" of more than one extended config, this label could be a target that\nprovdes `TsConfigInfo` such as `ts_config`.\n\nDefaults to `None`\n\n<h4 id=\"ts_project-allow_js\">allow_js</h4>\n\nboolean; Specifies whether TypeScript will read .js and .jsx files. When used with declaration,\nTypeScript will generate .d.ts files from .js files.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-declaration\">declaration</h4>\n\nif the `declaration` bit is set in the tsconfig.\nInstructs Bazel to expect a `.d.ts` output for each `.ts` source.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-source_map\">source_map</h4>\n\nif the `sourceMap` bit is set in the tsconfig.\nInstructs Bazel to expect a `.js.map` output for each `.ts` source.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-declaration_map\">declaration_map</h4>\n\nif the `declarationMap` bit is set in the tsconfig.\nInstructs Bazel to expect a `.d.ts.map` output for each `.ts` source.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-preserve_jsx\">preserve_jsx</h4>\n\nif the `jsx` value is set to \"preserve\" in the tsconfig.\nInstructs Bazel to expect a `.jsx` or `.jsx.map` output for each `.tsx` source.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-composite\">composite</h4>\n\nif the `composite` bit is set in the tsconfig.\nInstructs Bazel to expect a `.tsbuildinfo` output and a `.d.ts` output for each `.ts` source.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-incremental\">incremental</h4>\n\nif the `incremental` bit is set in the tsconfig.\nInstructs Bazel to expect a `.tsbuildinfo` output.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-emit_declaration_only\">emit_declaration_only</h4>\n\nif the `emitDeclarationOnly` bit is set in the tsconfig.\nInstructs Bazel *not* to expect `.js` or `.js.map` outputs for `.ts` sources.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-ts_build_info_file\">ts_build_info_file</h4>\n\nthe user-specified value of `tsBuildInfoFile` from the tsconfig.\nHelps Bazel to predict the path where the .tsbuildinfo output is written.\n\nDefaults to `None`\n\n<h4 id=\"ts_project-tsc\">tsc</h4>\n\nLabel of the TypeScript compiler binary to run.\n\nFor example, `tsc = \"@my_deps//typescript/bin:tsc\"`\nOr you can pass a custom compiler binary instead.\n\nOne possible compiler is the Angular compiler, provided by the\n`@angular/compiler-cli` package as the `ngc` binary, which can be set typically with\n`tsc = \"@npm//@angular/compiler-cli/bin:ngc\"`\nNote that you'll also need to pass `.html` and `.css` files to the `srcs` of the `ts_project`\nso that they're declared as inputs for the Angular compiler to read them.\n\nAn example can be found in the rules_nodejs repo under `packages/typescript/test/ts_project/ngc`.\n\n&gt; To use the `ngc` program from Angular versions prior to 11, you'll need a fix for\n&gt; https://github.com/angular/angular/issues/36290\n&gt; To apply the fix, you can use the patch-package package to apply this patch:\n&gt; https://gist.github.com/alexeagle/ba44b2601bd7c953d29c6e8ec44d1ef9\n\nDefaults to `None`\n\n<h4 id=\"ts_project-typescript_package\">typescript_package</h4>\n\nLabel of the package containing all data deps of tsc.\n\nFor example, `typescript_package = \"@my_deps//typescript\"`\n\nDefaults to `\"@npm//typescript\"`\n\n<h4 id=\"ts_project-typescript_require_path\">typescript_require_path</h4>\n\nModule name which resolves to typescript_package when required\n\nFor example, `typescript_require_path = \"typescript\"`\n\nDefaults to `\"typescript\"`\n\n<h4 id=\"ts_project-validate\">validate</h4>\n\nboolean; whether to check that the tsconfig JSON settings match the attributes on this target.\n\nSet this to `False` to skip running our validator, in case you have a legitimate reason for these to differ,\ne.g. you have a setting enabled just for the editor but you want different behavior when Bazel runs `tsc`.\n\nDefaults to `True`\n\n<h4 id=\"ts_project-supports_workers\">supports_workers</h4>\n\nExperimental! Use only with caution.\n\nAllows you to enable the Bazel Persistent Workers strategy for this project.\nSee https://docs.bazel.build/versions/master/persistent-workers.html\n\nThis requires that the tsc binary support a `--watch` option.\n\nNOTE: this does not work on Windows yet.\nWe will silently fallback to non-worker mode on Windows regardless of the value of this attribute.\nFollow https://github.com/bazelbuild/rules_nodejs/issues/2277 for progress on this feature.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-declaration_dir\">declaration_dir</h4>\n\na string specifying a subdirectory under the bazel-out folder where generated declaration\noutputs are written. Equivalent to the TypeScript --declarationDir option.\nBy default declarations are written to the out_dir.\n\nDefaults to `None`\n\n<h4 id=\"ts_project-out_dir\">out_dir</h4>\n\na string specifying a subdirectory under the bazel-out folder where outputs are written.\nEquivalent to the TypeScript --outDir option.\nNote that Bazel always requires outputs be written under a subdirectory matching the input package,\nso if your rule appears in path/to/my/package/BUILD.bazel and out_dir = \"foo\" then the .js files\nwill appear in bazel-out/[arch]/bin/path/to/my/package/foo/*.js.\nBy default the out_dir is '.', meaning the packages folder in bazel-out.\n\nDefaults to `None`\n\n<h4 id=\"ts_project-root_dir\">root_dir</h4>\n\na string specifying a subdirectory under the input package which should be consider the\nroot directory of all the input files.\nEquivalent to the TypeScript --rootDir option.\nBy default it is '.', meaning the source directory where the BUILD file lives.\n\nDefaults to `None`\n\n<h4 id=\"ts_project-link_workspace_root\">link_workspace_root</h4>\n\nLink the workspace root to the bin_dir to support absolute requires like 'my_wksp/path/to/file'.\nIf source files need to be required then they can be copied to the bin_dir with copy_to_bin.\n\nDefaults to `False`\n\n<h4 id=\"ts_project-kwargs\">kwargs</h4>\n\npassed through to underlying rule, allows eg. visibility, tags\n\n\n\n\n","license":"Apache-2.0","scripts":{"postinstall":"node npm_version_check.js"},"typings":"./internal/tsc_wrapped/index.d.ts","_npmUser":{"name":"alexeagle","email":"aeagle22206@gmail.com"},"homepage":"https://github.com/bazelbuild/rules_nodejs#readme","keywords":["typescript","bazel"],"deprecated":"No longer maintained, https://github.com/aspect-build/rules_ts is the recommended replacement","repository":{"url":"git+https://github.com/bazelbuild/rules_nodejs.git","type":"git","directory":"packages/typescript"},"_npmVersion":"6.13.4","description":"TypeScript rules for Bazel","directories":{},"maintainers":[{"name":"angular","email":"devops+npm@angular.io"},{"name":"angularcore","email":"devops+npm@angular.io"},{"name":"achew22","email":"npmjs.com@achew22.com"},{"name":"google-wombot","email":"node-team-npm+wombot@google.com"},{"name":"gregmagolan","email":"gmagolan@gmail.com"},{"name":"alexeagle","email":"aeagle22206@gmail.com"}],"_nodeVersion":"12.14.1","dependencies":{"semver":"5.6.0","tsutils":"2.27.2","protobufjs":"6.8.8","source-map-support":"0.5.9"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"typescript":">=3.0.0 <4.4.0"},"_npmOperationalInternal":{"tmp":"tmp/typescript_4.0.0-beta.0_1625253223145_0.9136599763413922","host":"s3://npm-registry-packages"},"_id":"@bazel/typescript@4.0.0-beta.0","version":"4.0.0-beta.0"}