-
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(core): add metagenerator for convert-to-inferred (#27672)
<!-- 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. --> ## Current Behavior The DX to migrate to project crystal isn't great right now - people have to run `convert-to-inferred` generators manually. ## Expected Behavior We should provide a smoother way to migrate, so we introduced an `@nx/workspace:infer-targets` generator that can handle multiple conversions at once, either for the whole workspace or at a project level. --------- Co-authored-by: Jack Hsu <[email protected]>
- Loading branch information
Showing
25 changed files
with
539 additions
and
43 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
35 changes: 35 additions & 0 deletions
35
docs/generated/packages/workspace/generators/infer-targets.json
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 @@ | ||
{ | ||
"name": "infer-targets", | ||
"factory": "./src/generators/infer-targets/infer-targets", | ||
"schema": { | ||
"$schema": "https://json-schema.org/schema", | ||
"$id": "InferTargets", | ||
"title": "", | ||
"type": "object", | ||
"description": "Convert Nx projects to use inferred targets.", | ||
"properties": { | ||
"project": { | ||
"type": "string", | ||
"description": "The project to convert to use inferred targets.", | ||
"x-priority": "important" | ||
}, | ||
"plugins": { | ||
"type": "array", | ||
"description": "The plugins used to infer targets. For example @nx/eslint or @nx/jest", | ||
"items": { "type": "string" } | ||
}, | ||
"skipFormat": { | ||
"type": "boolean", | ||
"description": "Whether to format files.", | ||
"default": false | ||
} | ||
}, | ||
"presets": [] | ||
}, | ||
"description": "Convert Nx projects to use inferred targets.", | ||
"implementation": "/packages/workspace/src/generators/infer-targets/infer-targets.ts", | ||
"aliases": [], | ||
"hidden": false, | ||
"path": "/packages/workspace/src/generators/infer-targets/schema.json", | ||
"type": "generator" | ||
} |
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
Oops, something went wrong.