-
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
Move framework-tools deps to root package.json #3908
Conversation
@dac09 Requested your review since I've broken this a few times and just want you to double check that works. |
@@ -1,11 +1,12 @@ | |||
#!/usr/bin/env node | |||
/* eslint-env node */ | |||
|
|||
import path from 'path' | |||
import path from 'node:path' |
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.
Why are you doing this here? I'm confused... why is this necessary
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 the node protocol. It's just a new feature in ES Modules: https://nodejs.org/api/esm.html#node-imports. There's no meaningful difference; the only justification I have is
- using URLs is more web-y than the previous way of doing things
- it's easier for beginners (they can tell that this is from the node std lib)
The Node.js docs will most likely use it in the future too: nodejs/node#38343.
Can remove it though; just added it cause I liked it.
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 like it. Keep us moving in that direction, k? My only concern would be using features that aren't supported in v16 (i.e. > 16 only).
@@ -170,15 +169,15 @@ export function buildPackages(packages = frameworkPkgJsonFiles()) { | |||
{ | |||
shell: true, | |||
stdio: 'inherit', | |||
cwd: path.resolve(__dirname, '../../../../'), | |||
cwd: path.resolve(__dirname, '../../../'), |
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.
Same here, not sure why this path has changed
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 did move it actually; the filepath used to be tasks/framework-tools/src/lib/framework.mjs
.
This is cool! However, should we be updated rwfw to point to the correct path? The fact that its working might be us being lucky, if we're moving this stuff over I'd rather migrate the whole thing properly - because otherwise we might hit bugs that come out of nowhere! |
I did here: redwood/packages/cli/src/rwfw.js Line 50 in 09fd0d4
|
Nice! I'll take it for a spin in the morning |
@jtoar unfortunately looks like generate test project is broken (just FYI, its also broken since the last framework change we did!) |
Swore I tested it when I moved its dependency on @dac09 the fix was just using |
haha yeah it was probably one of those pesky “yarn forgot to remove things” situations. Getting a failure on rwfw in gitpod btw:
But I suspect…. its because the older version of |
It looks like it was because the execa commands that the |
2e8afe0
to
0e4e17e
Compare
Rebased to fix merge conflicts. |
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 gtg for me. Deferring to Danny.
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.
BAZINGA!
This PR gets rid of the
package.json
in framework-tools. Its dependencies and scripts are now in the root workspace's package.json.At first I thought that if we merged this, it would break
yarn rwfw
. But curiouslyyarn rwfw
still seemed to work and that's because yarn 3 is awesome. For example, right nowyarn rwfw project:deps
expands to this:Even though there's no package.json in framework-tools, yarn 3 knows to look in the root workspace's package.json for a script named
project:deps
.In addition to the above, this PR also
import path from 'node:path'
)