-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build: Add NX bootstrap optimization #14535
Conversation
636adfa
to
378d93f
Compare
Nx Cloud ReportCI ran the following commands for commit b7c9fa7. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
378d93f
to
952826f
Compare
952826f
to
dd02bf6
Compare
@FrozenPandaz do you want to pair again to try and get this across the line & merged? |
dd02bf6
to
74c4660
Compare
74c4660
to
884f889
Compare
# Conflicts: # yarn.lock
Super excited about this! |
@@ -81,7 +81,7 @@ | |||
"@angular/forms": "^11.2.0", | |||
"@angular/platform-browser": "^11.2.0", | |||
"@angular/platform-browser-dynamic": "^11.2.0", | |||
"@nrwl/workspace": "^11.1.5", | |||
"@nrwl/workspace": "^11.6.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an update to the devDependency.
This new version has some allowances that allow Nx to be tested within an Nx repo.
@@ -95,8 +95,8 @@ function run() { | |||
command: () => { | |||
log.info(prefix, 'prepare'); | |||
spawn( | |||
`lerna run prepare ${ | |||
process.env.CI ? `--concurrency ${maxConcurrentTasks} --stream` : '' | |||
`nx run-many --target=prepare --all --parallel ${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the command to use Nx instead of lerna
which has remote caching!
@@ -9,9 +9,13 @@ import { executor as managerExecutor } from './manager/builder'; | |||
import { buildDevStandalone } from './build-dev'; | |||
import { buildStaticStandalone } from './build-static'; | |||
|
|||
// nx-ignore-next-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were some imports that created circular dependencies. These comments ignore the dependencies generated by these lines.
@@ -24,6 +24,7 @@ export const readAngularWorkspaceConfig = async ( | |||
|
|||
const nxWorkspace = require('@nrwl/workspace').readWorkspaceConfig({ | |||
format: 'angularCli', | |||
path: dirToSearch, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this method is used within a Nx workspace, it began to resolve the workspace.json
at the root of this repo in unit tests.
This should not affect end users of Storybook. This is a fix for some tests that use this method.
@FrozenPandaz I think there's a bug in the NX integration.. When I click on "All runs for this branch" I see this url: I think the branch-name is wrong. That looks like the PR-number to me. |
import reactOptions from '../../../app/react/src/server/options'; | ||
// nx-ignore-next-line | ||
import vue3Options from '../../../app/vue3/src/server/options'; | ||
// nx-ignore-next-line | ||
import htmlOptions from '../../../app/html/src/server/options'; | ||
// nx-ignore-next-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shilman If we wanted to remove these circular dependencies we could extract this into it's own util, or duplicate the code (wouldn't recommend that)
Yes, you are right, that is the PR number. The PR number is automatically picked up from circle. We will make it less confusing. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing 🤯 Thank you @FrozenPandaz !!!
What I did
This PR adds Nx to run the prepare stage. Nx has remote caching which would allow developers to reuse builds done on the CI server. This will make getting started with the repo as well as CI faster.
For more information about Nx, see the official documentation
How to test
Running
nx run-many --target prepare --parallel --all
should successfully build all projects.Closes #14504