Skip to content
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

Auto-install deps when creating a new TS Srcbook #210

Open
nichochar opened this issue Aug 24, 2024 · 6 comments
Open

Auto-install deps when creating a new TS Srcbook #210

nichochar opened this issue Aug 24, 2024 · 6 comments
Labels

Comments

@nichochar
Copy link
Contributor

Auto-Install Dependencies for New TypeScript Srcbooks

Objective

Automatically install required dependencies (tsx, typescript, @types/node) when creating a new TypeScript Srcbook, eliminating the need for the "install dependencies" toast, which needs to be clicked 100% of the time.

Current Behavior

  • "Install dependencies" toast appears when creating a new TS Srcbook

Proposed Change

  • Automatically install tsx, typescript, and @types/node upon TS Srcbook creation

Considerations

  • Block running cells until completed?
  • Handle scenarios where auto-installation fails
  • Consider allowing users to opt-out of auto-installation
@ThePrimeJnr
Copy link

can I work on this??

just found out srcbook today and it's just been amazing. I'd like to make some contributions

@nichochar
Copy link
Contributor Author

Hey @destinedcodes, sounds good, I've assigned the ticket to you. If you want to discuss the implementation or have any issues on the dev side of Srcbook, we have a Discord

@nichochar nichochar assigned nichochar and ThePrimeJnr and unassigned nichochar Sep 13, 2024
@BeRecursive22
Copy link
Contributor

BeRecursive22 commented Sep 21, 2024

@nichochar @benjreinhart

Observed an edge case with Prettier formatting:

  • New code cell + TypeScript + Enter = No execution, no stdout output
  • Same cell + Format before running = Executes without issues

Root cause seems to be a dependency quirk.

Fix: send an additional cell:format event right after cell:create. This handles the dependency issue.

Tested and working as expected now. Let me know if we're good to go with this or want me to push this change.

image
screen-capture.16.webm

With above approach, the "Need to install deps" toast would not make much sense since the cell is ready to be executed even before having an actual code.

@Aswanth-c
Copy link
Contributor

Aswanth-c commented Oct 3, 2024

Hey I'm back in action, started working on it,
feel free to assign

Consider allowing users to opt out of auto-installation

for this, I'm considering a toggle option in the settings. Let me what you think about this approach.

@Aryann15
Copy link

Aryann15 commented Oct 3, 2024

Hey @nichochar, Can I work on this issue?

@nichochar
Copy link
Contributor Author

for this, I'm considering a toggle option in the settings. Let me what you think about this approach.

Yes, this works, let's default it to "auto-install".

Sorry @Aryann15 I'm going to assign @Aswanth-c as he asked first and has also already contributed. There are other issues with the "good first issue" tag you can tackle!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants