-
Notifications
You must be signed in to change notification settings - Fork 177
fix: convert output to default to the source root #1579
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
mbostock
left a comment
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.
Functionally good but one quibble on the import. 👍
Also I deleted the command-line flags section from the docs because it’s getting too long and was buried and I think it’s more appropriate to use --help to get help for the command-line flags. (I did include an inline mention of --output though.)
Also, can you hold off on merging this today so that we can document convert as it currently exists rather than blocking the docs & convert blog post on a new release of Framework? I think the current behavior is acceptable since you often have to move things around anyway.
Co-authored-by: Mike Bostock <[email protected]>
|
This needs a re-merge from main to review again. Let me see if I can do it… |
Note that it is diverging a bit from the ideation in #838. Because, in the config file,
outputdefaults todist(it is where the built files go); in the case of theconvertcommand, I don't think we want that, but rather default to the source root, aka therootoption (which defaults tosrc).If the
--outputcommand-line option is passed explicitly, it must be considered relative to the cwd, not relative to the root. But this means we're comfortable with running this command from anywhere in the project, so if it's not passed explicitly, we make sure to use the source root relative to the root. Otherwise you would end up creating a new "src" folder inside your cwd.(I was surprised in my tests that the cwd is incorrect when calling
yarn tsx ../src/bin/observable.ts convert; I ended up testing manually the built script.)(I'm making this PR against cobus/convert-documentation but it could be merged afterwards.)
closes #838