-
Notifications
You must be signed in to change notification settings - Fork 12
Command line interface #118
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
@vgeorge could you add some details on how to run the cli setup? I'm seeing some issues wrt module resolution. |
@dzole0311 I have updated the file |
…d maintainability
This is ready for review. I’ve made significant changes, so it’s important to check where we stand and confirm we’re heading in the right direction. The README should now clearly cover the CLI instructions and overall approach. I recommend running |
Thanks @vgeorge, this is a good starting point and I have no specific comments around the current structure. Just to expand on what I meant in NASA-IMPACT/veda-ui#1749 (comment) I think there’s potential in VEDA to go beyond a basic SPA map scaffold e.g. imagine a developer working on a flood viewer: they would benefit from a setup they can build on without starting from scratch:
In other words, the I think the main effort would be to identify and package ~7–10 common geospatial UI components, things like layer toggles, legends, time controls, etc and make them injectable via the CLI. Also, since the whole conversation of "faster tool development" is currently only around VEDA which uses USWDS, if we want to move fast with the PoC it might make sense to further scope this and assemble the components using react-uswds primitives to keep things opinionated. |
Thanks for the feedback, @dzole0311. I agree that we can expand the scaffolding capabilities of this CLI tool, but since this PR is already quite large, I suggest we track further enhancements separately. For now, I’d like to propose merging this and using it to replace the current I'm putting this under review by the broader frontend team (especially @danielfdsilva), and I’ll demo it during our next frontend meeting. Next steps:
|
Thanks for the effort here @vgeorge ! This could become very useful. IMO a couple of baseline QA tools are missing:
We could add all these in iteration and after discussion, but I worry that if we do not take the chance now, we might never take the extra effort and add them to the generated projects later. Edit: I looked at the wrong package.json, prettier and Stylelint are already set up! |
I’ve pushed changes to address the issues noted by @danielfdsilva, this is ready for another review. @AliceR Thanks for the feedback. I’ve created an epic ticket (#120) to track ongoing work on the CLI and to capture your proposed changes there. Since this PR already introduces a significant number of changes, I believe it makes sense to merge it into the develop branch and track the remaining work in the epic ticket. |
@AliceR I removed the ESLint custom rule. I also added a missing dependency of the chakra template. |
- Add getTemplatePath utility function to handle path differences between development (src/generator) and production (dist/) environments - Replace hardcoded path.resolve calls with centralized function across all generator modules (index.ts, apply-component-library.ts, apply-map-library.ts) - Fix template path resolution issues that caused ENOENT errors when running CLI in different modes - Ensure consistent behavior between `pnpm start` (dev) and `node dist/index.js` (prod)
fix: Use different template path for dev vs. prod mode
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.
IMO this is solid enough to merge to develop! 👏 We can iterate from there, or leave cli as base for further changes, I don't mind the difference :)
@AliceR lets continue from develop, thanks for the changes 🙂 |
Contributes to #120.
We are investigating a tool starter for VEDA in this issue.
This is a work in progress and not intended to be merged here (unless we decide to do so later).
The general idea is to provide an easy way to generate a web map SPA scaffold. It makes sense to base it on
project-seed
, as we typically use it to start our projects.I created a
/cli
folder without touching existing files. This folder contains the generator and the templates for different variants.What’s included:
By default, the generator creates a scaffold identical to
project-seed
. But it also allows creating with different component libraries. The next step would be to offer mapping library variants, for example, MapLibre and Mapbox.This is very exploratory work, happy to hear any feedback.
cc @aboydnw @dzole0311 @AliceR