angular/packages/bazel/package.json
Paul Gschwendtner 49b82ae561 feat(bazel): implement partial compilation APF v13 for ng_package rule (#43431)
This commit implements partial compilation APF v13 for the
`ng_package` rule. The changes involve the following things:

1. Requesting the partial compilation output for all targets (and
   its transitives) in the `deps` or `srcs` attributes.

2. Downleveling of ES2020 prodmode output to a FESM2015 file.

3. Cleanup of file resolution. Previusly, execroot file paths (which are
   passed to the packager tool) were composed manually. This is prone to
   mistakes and breaks with transitions.

   A lot of this code can be simplified by passing the necessary Bazel
   `File` information as JSON. This also simplifies the packager tool
   significantly (and makes it more readable..)

4. Remoal of UMD bundles. This also allows us remove the `globals` rule
   attribute with `externals` (we do not need any UMD global identifier
   names anymore).

5. The `package.json` will set the `exports` field and use subpath
   exports to make module resolution work for ESM consumers.

6. TSLib is also always set as `external` now. Previously it had to be
   added as `dep` to the `ng_package` rule as UMD files bundled `tslib`.

7. The `include_devmode_srcs` option has been removed. This option was
   an addition to APF that allowed the `@angular/compiler` to ship
   non-flattened ES5 CommonJS sources. We want to keep APF consistent
   and not allow such exceptions. Compiler is now a strict APF package
   as well, and the compiler-cli just needs to go through the primary
   entry-point for things it needs (or it bundles the necessary parts
   into the CLI.)

Overall, these are all changes. A lot of changes to make the packager
rule and tool more readable and Bazel-idiomatic were made as well. This
allows us to easier make packaging changes in the future, and it's more
future-proof if we ever change how inputs (like `ng_module` targets) are
generated (e.g. consider a case where we'd use the `ts_project` rule).

PR Close #43431
2021-10-01 18:28:42 +00:00

53 lines
1.3 KiB
JSON

{
"name": "@angular/bazel",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular - bazel build rules",
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.14.1 || >=14.0.0"
},
"bin": {
"api-extractor": "./src/api-extractor/index.js",
"ngc-wrapped": "./src/ngc-wrapped/index.js",
"packager": "./src/ng_package/packager.js",
"xi18n": "./src/ngc-wrapped/extract_i18n.js"
},
"typings": "./src/ngc-wrapped/index.d.ts",
"bazelBin": {
"ngc-wrapped": {
"additionalAttributes": {
"configuration_env_vars": "[\"angular_ivy_enabled\"]"
}
}
},
"dependencies": {
"@microsoft/api-extractor": "7.18.11",
"shelljs": "0.8.4",
"tsickle": "^0.38.0",
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
"@bazel/typescript": ">=1.0.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"rollup": "^2.56.3",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.9.0",
"typescript": ">=4.2.3 <4.5"
},
"peerDependenciesMeta": {
"terser": {
"optional": true
}
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular.git",
"directory": "packages/bazel"
},
"ng-update": {
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
}
}