-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup(angular): simplify package executor adjustments for angular v…
…17 (nrwl#20869)
- Loading branch information
1 parent
9fea60b
commit 87256aa
Showing
14 changed files
with
230 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/angular/src/executors/package/ng-packagr-adjustments/ng-packagr.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { NgPackagr, ngPackagr } from 'ng-packagr'; | ||
import type { BuildAngularLibraryExecutorOptions } from '../../package/schema'; | ||
import { getInstalledAngularVersionInfo } from '../../utilities/angular-version-utils'; | ||
import { STYLESHEET_PROCESSOR } from '../../utilities/ng-packagr/stylesheet-processor.di'; | ||
|
||
export async function getNgPackagrInstance( | ||
options: BuildAngularLibraryExecutorOptions | ||
): Promise<NgPackagr> { | ||
const { major: angularMajorVersion } = getInstalledAngularVersionInfo(); | ||
if (angularMajorVersion >= 17) { | ||
const packagr = ngPackagr(); | ||
packagr.withProviders([STYLESHEET_PROCESSOR]); | ||
return packagr; | ||
} | ||
|
||
const { NX_ENTRY_POINT_PROVIDERS } = await import( | ||
'./ng-package/entry-point/entry-point.di' | ||
); | ||
const { nxProvideOptions } = await import('./ng-package/options.di'); | ||
const { NX_PACKAGE_PROVIDERS, NX_PACKAGE_TRANSFORM } = await import( | ||
'./ng-package/package.di' | ||
); | ||
|
||
const packagr = new NgPackagr([ | ||
...NX_PACKAGE_PROVIDERS, | ||
...NX_ENTRY_POINT_PROVIDERS, | ||
nxProvideOptions({ | ||
tailwindConfig: options.tailwindConfig, | ||
watch: options.watch, | ||
}), | ||
]); | ||
packagr.withBuildTransform(NX_PACKAGE_TRANSFORM.provide); | ||
|
||
return packagr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
187 changes: 0 additions & 187 deletions
187
packages/angular/src/executors/package/package.impl.spec.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.