-
Notifications
You must be signed in to change notification settings - Fork 994
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
chore(rwfw): working refactor, make project:sync
ignore more files
#8579
Conversation
673fefe
to
65f9a97
Compare
@@ -170,7 +170,7 @@ export function buildPackages(packages = frameworkPkgJsonFiles()) { | |||
const packageNames = packages.map(packageJsonName) | |||
execa.sync( | |||
'yarn lerna run build', | |||
['--parallel', `--scope={${packageNames.join(',') + ','}}`], |
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.
Nx issues a warning that this option doesn't do anything anymore
5ef06f1
to
4ff1e87
Compare
4ff1e87
to
84ce669
Compare
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.
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.
Well, blast. 👎 Per request to also test file changes over here in #8580, I now get the error message after sync is successful but I then edit and save a file. To reproduce:
yarn rwfw project:sync
(successful)- edit
packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts
Fails with the error message below.
rwfw Waiting for changes
-------------------------------------------------------------------------------------------------------------
rwfw /Users/price/Repos/redwoodjs-redwood/packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts changed
rwfw Restoring the Redwood project's package.json...
To get your project back to its original state...
- undo the changes to project's your yarn.lock file
- remove your project's node_modules directory
- run 'yarn install'
rwfw Closing the watcher...
node:fs:601
handleErrorFromBinding(ctx);
^
Error: /Users/price/Repos/redwoodjs-redwood/packages/auth-providers/package.json: ENOENT: no such file or directory, open '/Users/price/Repos/redwoodjs-redwood/packages/auth-providers/package.json'
at Object.openSync (node:fs:601:3)
at Object.readFileSync (node:fs:469:35)
at Object.readFileSync (/Users/price/Repos/redwoodjs-redwood/node_modules/jsonfile/index.js:50:22)
at getPackageJsonName (file:///Users/price/Repos/redwoodjs-redwood/tasks/framework-tools/lib/framework.mjs:161:13)
at FSWatcher.<anonymous> (file:///Users/price/Repos/redwoodjs-redwood/tasks/framework-tools/frameworkSyncToProject.mjs:234:25)
at FSWatcher.emit (node:events:513:28)
at FSWatcher.emitWithAll (/Users/price/Repos/redwoodjs-redwood/node_modules/chokidar/index.js:541:32)
at awfEmit (/Users/price/Repos/redwoodjs-redwood/node_modules/chokidar/index.js:607:14)
at /Users/price/Repos/redwoodjs-redwood/node_modules/chokidar/index.js:728:9
at FSReqCallback.oncomplete (node:fs:209:5) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/price/Repos/redwoodjs-redwood/packages/auth-providers/package.json'
}
Node.js v18.16.0
Thanks @thedavidprice and @arimendelow, I realize there's an error in the |
@arimendelow I think I've addressed the issue if you wouldn't mind trying again whenever you have time |
ah it works!!! thanks @jtoar 🙂 i really appreciate how quickly you fixed this |
…8579) * working refactor, make project:sync ignore more * working refactor, make project:sync ignore more * consolidate flags, fix resolvePackageJsonPath * remove caching for now * improve comments * actually fix edge case for web/apollo etc * unlink before trying to symlink * handle broken symlinks better * style: spacing ---------
When I clean the framework (
git clean -fxd -e .env
) so that build has to happen from scratch instead of pulling from the Nx cache, I can reproduceyarn rwfw project:sync
failing with:I'm not sure exactly why this is happening, but the code for
yarn rwfw project:sync
could be stricter about what it watches, how it finds package.jsons, and a few other things. So far these changes seem to fix it it for me, but it doesn't seem like that's true for everyone yet.Working list of changes
cleanPackages
stopped working at some point; I've fixed it for cleaning all packages by keeping it simple and just calling the script in the root package.json. And on a per-packge basis, I just callrimraf
yarn rwfw project:sync
fails, you don't want to have to clean everything. I could probably make this easier by having aset-up-for-watch
flag or something like that, to do all the steps before watching. Also, yargs aliases are making no sense right now and are duplicating properties, so figuring that out