Skip to content

Commit

Permalink
feat(compiler-cli): support more recent version of tsickle (#47018)
Browse files Browse the repository at this point in the history
Updates the tsickle version in the repository and accounts for its changes in
the `compiler-cli` package. Tsickle made a breaking change in the minor version
segment bump that would break the use with `@angular/compiler-cli`

Additionally the tsickle version for `@angular/bazel` is updated since
we updated `@bazel/typescript` to also account for the breaking changes.

See: bazelbuild/rules_nodejs@78a0528

PR Close #47018
  • Loading branch information
devversion authored and dylhunn committed Aug 4, 2022
1 parent f42a7c5 commit ea89677
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -169,7 +169,7 @@
"tmp": "0.2.1",
"todomvc-app-css": "^2.3.0",
"todomvc-common": "^1.0.5",
"tsickle": "0.38.1",
"tsickle": "0.46.3",
"tslib": "^2.3.0",
"tslint": "6.1.3",
"typescript": "~4.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/bazel/package.json
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@microsoft/api-extractor": "^7.24.2",
"shelljs": "^0.8.5",
"tsickle": "^0.38.0",
"tsickle": "^0.46.3",
"tslib": "^2.3.0"
},
"peerDependencies": {
Expand Down
8 changes: 7 additions & 1 deletion packages/compiler-cli/src/main.ts
Expand Up @@ -104,7 +104,8 @@ function createEmitCallback(
TsickleHost,
'shouldSkipTsickleProcessing'|'pathToModuleName'|'shouldIgnoreWarningsForPath'|
'fileNameToModuleId'|'googmodule'|'untyped'|'convertIndexImportShorthand'|
'transformDecorators'|'transformTypesToClosure'> = {
'transformDecorators'|'transformTypesToClosure'|'generateExtraSuppressions'|
'rootDirsRelative'> = {
shouldSkipTsickleProcessing: (fileName) => /\.d\.ts$/.test(fileName) ||
// View Engine's generated files were never intended to be processed with tsickle.
(!options.enableIvy && GENERATED_FILES.test(fileName)),
Expand All @@ -118,6 +119,11 @@ function createEmitCallback(
// conflicts, we disable decorator transformations for tsickle.
transformDecorators: false,
transformTypesToClosure: true,
generateExtraSuppressions: true,
// Only used by the http://go/tsjs-migration-independent-javascript-imports migration in
// tsickle. This migration is not relevant externally and is only enabled when users
// would explicitly invoke `goog.tsMigrationExportsShim` (which is internal-only).
rootDirsRelative: (fileName) => fileName,
};

return ({
Expand Down
12 changes: 7 additions & 5 deletions yarn.lock
Expand Up @@ -2717,7 +2717,7 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40"
integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==

"@types/minimist@^1.2.0":
"@types/minimist@^1.2.0", "@types/minimist@^1.2.1":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
Expand Down Expand Up @@ -14633,10 +14633,12 @@ tsec@0.2.5:
glob "^7.1.1"
minimatch "^3.0.3"

tsickle@0.38.1:
version "0.38.1"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.38.1.tgz#30762db759d40c435943093b6972c7f2efb384ef"
integrity sha512-4xZfvC6+etRu6ivKCNqMOd1FqcY/m6JY3Y+yr5+Xw+i751ciwrWINi6x/3l1ekcODH9GZhlf0ny2LpzWxnjWYA==
tsickle@0.46.3:
version "0.46.3"
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.46.3.tgz#b74918a77e3ca1310a2ce4d019f5d6294360b56d"
integrity sha512-9PDXxOrtn2AdpvDin6FLGveXVGg8ec3ga8fh8mPR5lz9KtitW6riVgxgagicdfF1rgiBxDeH+5hVowPXhmZbYQ==
dependencies:
"@types/minimist" "^1.2.1"

tslib@1.9.0:
version "1.9.0"
Expand Down

0 comments on commit ea89677

Please sign in to comment.