SamagraX-Stencil / stencil

NestJS on steroids 💪
https://stencil.samagra.io
MIT License
28 stars 28 forks source link

[stencil] [C4GT] Add support for bun #4

Closed techsavvyash closed 3 months ago

techsavvyash commented 7 months ago

Add Runtime Support for Bun in Stencil NestJS Project

Description

With the integrated support for NestJS in Bun, the task is to extend the runtime options in Stencil. Users should have the flexibility to choose between two supported runtimes: NodeJS and BunJS.

Goals

  1. Bun Runtime Integration: Successfully integrate BunJS as a supported runtime in the Stencil NestJS project.

  2. User Runtime Selection: Allow users to choose between the two supported runtimes (NodeJS and BunJS) for executing Stencil.

Acceptance Criteria

  1. BunJS Integration: Implement the necessary configurations and adjustments to seamlessly integrate BunJS as a runtime in the Stencil NestJS project.

  2. Runtime Selection: Implement a user-friendly mechanism to select the desired runtime (NodeJS or BunJS) when running Stencil.

  3. Testing: Ensure that both NodeJS and BunJS runtimes are functional and can successfully execute Stencilt.

  4. Documentation Update: Provide comprehensive documentation on your work. Include it in the form of a READMe.md in your PR. It will be added to the official Stencil Docs

Checklist (To be filled by the developer)

Product Name

Stencil

Organisation Name

SamagraX

Tech Skills Needed

Nodejs, Bun

Mentors

@RyanWalker277

Complexity

Medium

Domain

Category

Backend

Sub Category

Nodejs

techsavvyash commented 6 months ago

References

https://dev.to/mourishitz/running-nestjs-server-with-bun-4cdl https://github.com/SamagraX-Stencil/stencil/pull/86#issuecomment-1991489825

Sandeep0306 commented 4 months ago

Hi, @RyanWalker277 & @techsavvyash I would like to work on this issue. Can you assign me?

techsavvyash commented 4 months ago

Hey @Sandeep0306, please go ahead and raise a PR for the issue. Assignment only comes once a draft PR has been raised.

vsvishalsharma commented 3 months ago

Hi @techsavvyash sir,

I hope you're doing well! I wanted to touch base regarding the pull request I've submitted for the linting setup. While awaiting the review, I've been considering another enhancement for the project.

I noticed that there's an opportunity to integrate BunJS into our project, allowing users to select their preferred runtime environment. This would offer greater flexibility and customization options, enhancing the overall user experience.

Additionally, I'm more than happy to address any feedback or changes needed for the previous pull request. Now that I've gained a better understanding of the codebase, I'm eager to continue contributing and learn more about this amazing tool. Your guidance and insights have been invaluable, and I'm excited to take on new challenges.

Looking forward to your thoughts on this suggestion and any feedback you may have on the current pull request.

techsavvyash commented 3 months ago

Hey @vsvishalsharma, Thanks for sending in the PR for the linting ticket, have merged the both of them. If you interested in adding support for bun in stencil, please go right ahead and raise a PR.

vsvishalsharma commented 3 months ago

@techsavvyash sir I was woking on this i added scripts to run bunjs in package.json file but i keep getting an error of file dist/main not found

screenshot-01

screenshot-02

what I tried: I tried running npm run build to build the file . Tried Changing ile path as "bun start --file dist/main". cross checked nestcli.json

techsavvyash commented 3 months ago

The files inside the packages folder are not meant to be ran via a start script, try running the samples with bun, then make the required changes in the schematics files and then to the CLI.

Yash-Sajwan24 commented 3 months ago

@techsavvyash I understand the problem, and I believe I have the necessary skills. Could I have the opportunity to work on this?

techsavvyash commented 3 months ago

Hey @Yash-Sajwan24, Please go ahead .

Savio629 commented 3 months ago

I'm too interested on trying out this issue. I'll try to open a draft pr

Savio629 commented 3 months ago

Just to confirm We need to add bun at this phase, right? image

techsavvyash commented 3 months ago

Yes

Savio629 commented 3 months ago

Support for Bun Integration Tracker Ref link: https://github.com/SamagraX-Stencil/stencil/pull/86#issuecomment-1991489825

Step 1: Test Stencil Components with BunJS

(Not required)

Step 2: Plan of Action (POA) (If there is no error in Step 1 then we can skip step 2)

Step 3 : Implementation Changes in Stencil-Cli

Step 4 : Documentation and Reporting

Savio629 commented 3 months ago

Step 1: Test Stencil Components with BunJS

(Note: Same issue occurs with npm start too)

01-all-features

(I think the issue is with .env although I followed the steps mentioned in the docs) 01-terminal

02-monitoring

(I don't know why this issue is occuring) 02-terminal

03-response-formatting

(works well) 03-terminal

04-logging

(works well) 04-terminal

05-temporal-package

(is there any other steps i need to follow before setting up temporal-package?) 05-terminal

06-file-upload

(works well) 06-term

Savio629 commented 3 months ago

@techsavvyash If all the samples work well, do I require to test other components present in common folder and the stemantic project or just update the cli project?

Savio629 commented 3 months ago

@techsavvyash

So I updated the code under stencil-cli and tested it out, seems to work well 👍 If it looks good I'll open a pr for review....

(Tested on Gitpod)

bun-test1 bun-test2 bun-test3

techsavvyash commented 3 months ago

Super work @Savio629 !! Impressed by the turn around time. Yes please go ahead and raise a PR.