-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(angular): remove unused
tailwindConfig
option from the ng-pack…
…agr executors (#28940) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> <!-- This is the behavior we have today --> <!-- This is the behavior we should expect with the changes in this PR --> <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
- Loading branch information
1 parent
60730cd
commit f24f778
Showing
14 changed files
with
51 additions
and
237 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import type { NgPackagrBuilderOptions } from '@angular-devkit/build-angular'; | ||
|
||
export interface BuildAngularLibraryExecutorOptions | ||
extends NgPackagrBuilderOptions { | ||
tailwindConfig?: string; | ||
} | ||
extends NgPackagrBuilderOptions {} |
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
58 changes: 0 additions & 58 deletions
58
packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export * from './add-tailwind-config-path-to-project'; | ||
export * from './add-tailwind-config'; | ||
export * from './add-tailwind-required-packages'; | ||
export * from './detect-tailwind-installed-version'; | ||
export * from './normalize-options'; | ||
export * from './update-application-styles'; | ||
export * from './validate-build-target'; |
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
37 changes: 37 additions & 0 deletions
37
packages/angular/src/generators/setup-tailwind/lib/validate-build-target.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,37 @@ | ||
import { stripIndents, type ProjectConfiguration } from '@nx/devkit'; | ||
import type { NormalizedGeneratorOptions } from '../schema'; | ||
|
||
export function validateBuildTarget( | ||
options: NormalizedGeneratorOptions, | ||
project: ProjectConfiguration | ||
): void { | ||
const buildTarget = project.targets?.[options.buildTarget]; | ||
|
||
if (!buildTarget) { | ||
throw new Error( | ||
stripIndents`The target "${options.buildTarget}" was not found for project "${options.project}". | ||
If you are using a different build target, please provide it using the "--buildTarget" option. | ||
If the project is not a buildable or publishable library, you don't need to setup TailwindCSS for it.` | ||
); | ||
} | ||
|
||
const supportedLibraryExecutors = [ | ||
'@angular-devkit/build-angular:ng-packagr', | ||
'@nx/angular:ng-packagr-lite', | ||
'@nx/angular:package', | ||
]; | ||
if ( | ||
!supportedLibraryExecutors.includes( | ||
project.targets[options.buildTarget].executor | ||
) | ||
) { | ||
throw new Error( | ||
stripIndents`The build target for project "${ | ||
options.project | ||
}" is using an unsupported executor "${buildTarget.executor}". | ||
Supported executors are ${supportedLibraryExecutors | ||
.map((e) => `"${e}"`) | ||
.join(', ')}.` | ||
); | ||
} | ||
} |
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.