[RHCLOUD-42870] Nx tool migration#1518
[RHCLOUD-42870] Nx tool migration#1518Hyperkid123 merged 20 commits intodata-driven-forms:masterfrom
Conversation
|
@Jakub007d is attempting to deploy a commit to the data-driven-forms Team on Vercel. A member of the Team first needs to authorize it. |
3707bc0 to
1d2408e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1518 +/- ##
=======================================
Coverage 94.28% 94.28%
=======================================
Files 185 185
Lines 3397 3397
Branches 1461 1461
=======================================
Hits 3203 3203
Misses 194 194 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
caa6f4a to
2c284a9
Compare
de61b39 to
a484371
Compare
a484371 to
23e49e8
Compare
package.json
Outdated
| "@khala/npm-release-monorepo": "^2.5.2", | ||
| "@khala/wildcard-release-notes": "^2.5.2", | ||
| "@nx/js": "22.0.1", | ||
| "@semantic-release/exec": "^6.0.3", |
There was a problem hiding this comment.
@Jakub007d since we are switching to NX's release process, I think we can remove the legacy semantic-release packages right?
There was a problem hiding this comment.
You are right removed
.github/workflows/main.yml
Outdated
| run: npx nx release --first-release --dry-run --verbose | ||
|
|
||
| # Job that runs after merge (on push to master) | ||
| post-merge: |
There was a problem hiding this comment.
@Jakub007d I'm wondering if we want the PR checks to also run for merge jobs, and just exclude the release for PRs. Something like we do here: https://github.com/RedHatInsights/javascript-clients/blob/main/.github/workflows/ci.yml
package.json
Outdated
| "lerna": "^4.0.0", | ||
| "ncp": "^2.0.0", | ||
| "sass": "^1.77.8", | ||
| "nx": "^22.0.1", |
There was a problem hiding this comment.
NIT - looks like in the past 2 days NX released 22.0.2 😂
|
@Jakub007d since we are moving to NX, should we remove Lerna as well and replace with NX? https://github.com/data-driven-forms/react-forms/blob/master/lerna.json |
| "fallbackCurrentVersionResolver": "disk" | ||
| } | ||
| }, | ||
| "namedInputs": { |
There was a problem hiding this comment.
@Jakub007d quick AI review comment:
Your nx.json sets namedInputs.default to only sharedGlobals. For run-commands with cache=true this can cause stale cache. Suggest:
In nx.json:
Set namedInputs.default to include project sources, e.g. ["sharedGlobals", "{projectRoot}/**/*", "!{projectRoot}/dist/**", "!{projectRoot}/.next/**"].
Optionally add a production namedInput variant if needed.
Or, per target in project.json, define inputs: ["default", "^default"].
5f2166a to
06e8e80
Compare
|
Hmm the tests for the react-form-renderer started failing im looking into it |
707446d to
3cfa84f
Compare
|
Fixed the failing test |
JetyAdam
left a comment
There was a problem hiding this comment.
Running npx nx graph fails with a MultipleProjectsWithSameNameError. This is because many sub-projects (e.g., .../ant-component-mapper/checkbox and .../mui-component-mapper/checkbox) are being detected with the same name ("checkbox").
This error breaks the Nx dependency graph, which means core features like nx affected will not work.
JetyAdam
left a comment
There was a problem hiding this comment.
I've reviewed the latest commit, and this new approach of generating project.json files during the build unfortunately won't solve the problem.
Nx needs to read all project.json files before it can run any task, including the build task itself.
The MultipleProjectsWithSameNameError happens during this initial configuration scan, so Nx fails long before it ever gets a chance to run your new generate-sub-projects.js script.
These project.json files must be static configuration, not build artifacts.
The script you wrote is correct, but it needs to be used differently. Please run that script locally one time to generate all the project.json files, commit those new files directly to this PR, and then remove the build:sub-projects step from the package.json files.
Hyperkid123
left a comment
There was a problem hiding this comment.
A few more steps are remaining
- make sure correct tags are on the git repository
- remove the first-release flags
- ensure NX publish root directories are configured to the packages/ dir (by default it expects assets to be at dist//)
- verify the version is updating the correct files
Once these are done, we can update the secrets and publish
d2e231e to
51989be
Compare
Fixes #(issue) (if applicable)
Description
As a part of the RHCLOUD-42870 task i have added the nx tool to help with running tests/linters/builds/type-checks/releases/publish in CI. Release and publish would be ran after the PR gets merged (For proper release/publish we need to add 2 secrets to the repository (NOT TESTED only the dry run was ran so far)).
Please include a summary of the change.
Schema (if applicable)
Checklist: (please see documentation page for more information)
Yarn buildpassesYarn lintpassesYarn testpassesfix|feat({scope}): {description}fix(pf3): wizard correctly handles next buttonFix button on documenation example page