- 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Chore/fix workspace build again #94
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
Conversation
This removes using rollup node-resolve plugin and typescript project references, all that was needed was to set the build order in the workspaces field for the compilation to suceed.
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.
I'd like to better understand why this is failing often.
        
          
                package.json
              
                Outdated
          
        
      | "packages/internal-test-env", | ||
| "packages/internal-playwright-testids", | ||
| "packages/internal-playwright-helpers", | ||
| "packages/jest-jsdom-polyfills" | 
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 change shouldn't be needed, this just tells npm to glob that directory..
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.
I'll try what you suggested in your comment and have lerna run the build, because I actually thought that was already the case and that lerna was hooking into the workspaces setup. This changes just adds an order in which the packages are built, because using alphabetical order results in packages/internal-playwright-helpers being built first, while it has dependencies on the other packages.
| 
           If you're seeing   | 
    
| 
           Aside, it can't hurt to add a ci.yml which always runs a build? Might be necessary now that we're getting more complex packages here  | 
    
This reverts commit 2af3763.
Building based on workspaces alone (i.e. `npm run build --workspaces`) doesn't account for dependencies between workspaces, resulting in an arbitrary build order being based on the globbing pattern/order in which workspaces are defined. Instead, this commit uses Lerna to run the build, and relies on Nx to figure out the build order based on the dependency graph.
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "useNx": false, | |||
| "useNx": true, | |||
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.
Reading this page, it all makes sense the order of operations being taken care of by lerna here with help from Nx to see it that it cannot build the helpers package before testids. https://nx.dev/recipes/adopting-nx/lerna-and-nx Makes sense 👍
| # the other way around results in top-level dependencies (namely, lerna) | ||
| # not being installed. | ||
| - run: npm ci | ||
| - run: npm run build | 
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.
Release runs build as part of it, or, at least should. Part of publishing a package is running the build step iirc
No description provided.