angular/tools
Paul Gschwendtner 8d7f1098d8 refactor: make all imports compatible with ESM/CJS output. (#43431)
As outlined in the previous commit which enabled the `esModuleInterop`
TypeScript compiler option, we need to update all namespace imports
for `typescript` to default imports. This is needed to allow for
TypeScript to be imported at runtime from an ES module.

Similar changes are needed for modules like `semver` where the types incorrectly
suggest named exports that will not exist at runtime when imported from ESM.

This commit refactors all imports to match with the lint rule we have
configured in the previous commit. See the previous commit for more
details on why certain imports have been changed.

A special case are the imports to `@babel/core` and `@babel/types`. For
these a special interop is needed as both default imports, or named
imports break the other module format. e.g default imports would work
well for ESM, but it breaks for CJS. For CJS, the named imports would
only work, but in ESM, only the default export exist. We work around
this for now until the devmode is using ESM as well (which would be
consistent with prodmode and gives us more valuable test results). More
details on the interop can be found in the `babel_core.ts` files (two
interops are needed for both localize/or the compiler-cli).

PR Close #43431
2021-10-01 18:28:45 +00:00
..
build build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
circular_dependency_test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
contributing-stats refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
gulp-tasks build: convert CLDR locale extraction from Gulp to Bazel tool (#42230) 2021-07-16 12:44:59 -07:00
npm build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
npm_integration_test build: update to latest version of rules_nodejs v3.3.0 (#41599) 2021-04-13 17:37:28 -07:00
rxjs build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
saucelabs build: update to latest version of rules_nodejs v3.3.0 (#41599) 2021-04-13 17:37:28 -07:00
size-tracking build: update chalk to version 4.0.1 (#41738) 2021-04-21 17:30:28 -07:00
source-map-test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
symbol-extractor refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
testing refactor(core): remove unused fakeAsyncFallback and asyncFallback (#37879) 2020-11-20 08:34:59 -08:00
tslint refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
BUILD.bazel refactor: remove entry_point attribute from ng_package targets (#43431) 2021-10-01 18:28:42 +00:00
defaults.bzl build: ship locales in @angular/common in ESM format (#43431) 2021-10-01 18:28:44 +00:00
extract_typings_rule.bzl refactor: expose new @angular/localize/tools entry-point for CLI usage (#43431) 2021-10-01 18:28:44 +00:00
inline-package-json-deps.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jasmine-seed-generator.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
ng_benchmark.bzl refactor(dev-infra): ng_rollup_bundle rule should leverage @bazel/rollup (#37623) 2020-06-22 10:55:28 -07:00
postinstall-patches.js refactor: fix typo in postinstall-patches.js (#43362) 2021-09-07 18:44:47 +00:00
tsconfig-test.json build(bazel): use fine-grained npm deps (#26111) (#26488) 2018-10-19 20:59:29 -07:00
tsconfig.json build: enable esModuleInterop in TypeScript compilations (#43431) 2021-10-01 18:28:45 +00:00
tsec.bzl build: Auto-gen tsec tsconfig files (#43440) 2021-09-17 17:17:34 +00:00
types.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
utils.bzl build: create macro for transpiling javascript file to es5 (#36802) 2020-05-04 12:43:50 -07:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00