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

[FEATURE REQUEST]: Add Husky #1

Closed
rajdip-b opened this issue Dec 25, 2023 · 15 comments · Fixed by #32
Closed

[FEATURE REQUEST]: Add Husky #1

rajdip-b opened this issue Dec 25, 2023 · 15 comments · Fixed by #32
Assignees
Labels
good first issue Good for newcomers type: enhancement New feature or request
Milestone

Comments

@rajdip-b
Copy link
Member

Is your feature request related to a problem? Please describe.
Add Husky to the project to make pre-commit validations

Describe the solution you'd like
The pre-commit should do the following:

  • lint the code for errors
  • fix the errors (if fixable)
  • run prettier fix on the entire project
@rajdip-b rajdip-b added type: enhancement New feature or request good first issue Good for newcomers labels Dec 25, 2023
@rajdip-b rajdip-b added this to the Release v1 milestone Dec 25, 2023
@Abbhiishek
Copy link
Contributor

hey @rajdip-b,

i want to work on this feature

@rajdip-b
Copy link
Member Author

@Abbhiishek here you go!

@Abbhiishek
Copy link
Contributor

While doing pnpm install am getting this error:

WARN  Installing a dependency from a non-existent directory: D:\optimus prime\keyshade\@nx\js:library

@Abbhiishek
Copy link
Contributor

image

@rajdip-b
Copy link
Member Author

That looks odd. I'll try this once on windows and lyk.

@rajdip-b
Copy link
Member Author

rajdip-b commented Dec 27, 2023

Hey @Abbhiishek, I ran it and couldn't find any issues. Mind telling me what command gave you the stack trace error? Also, what's the current RAM on your device?

WARN  Installing a dependency from a non-existent directory: D:\optimus prime\keyshade@nx\js:library

This was fixed by removing the js:library from package.json

@Abbhiishek
Copy link
Contributor

hey @rajdip-b,
removing js:library from package.json resolves the whole issue.
i am able to pnpm install without any errors.

@rajdip-b
Copy link
Member Author

Great to hear! Please do let us know in here if you face any other issues!

@Abbhiishek
Copy link
Contributor

hey @rajdip-b i have made the initial setup for husky ... need some insight on the scripts we need to run for precommit.

Looking at the package.json file :

    "lint": "nx run-many -t lint --parallel",
    "lint:api": "nx run api:lint",
    "lint:web": "nx run web:lint",
    "lint:workspace": "nx run workspace:lint",
    "lint:cli": "nx run cli:lint",
    "lint:sdk-node": "nx run sdk-js:lint",
    "lint:fix": "nx run-many -t lint --fix --parallel",

I suppose we need to run lint and lint:fix for every commit right?

@Abbhiishek
Copy link
Contributor

I tried running pnpm lint:fix and here are the insights

   NX   Ran target lint for 7 projects (1s)                                                                                                    
                                                                                                                                            
   With additional flags:                                                                                                                 
       --fix=true                                                                                                                           
                                                                                                                                            
√    6/7 succeeded [6 read from cache]                                                                                                      
                                                                                                                                            
×    1/7 targets failed, including the following:                                                                                           
     - nx run sdk-rust:lint                                                                                                                 

View structured, searchable error logs at https://nx.app/runs/ecSS0oBnCJ

image

It successfully run over these apps

image

@rajdip-b
Copy link
Member Author

yeah there are some issues with rust currently. i would suggest you make the lint:fix command to exclude the rust-sdk module. and then use the lint:fix command in husky.

@kriptonian1
Copy link
Contributor

Hey @Abbhiishek, how is the progress going

@Abbhiishek Abbhiishek mentioned this issue Dec 28, 2023
10 tasks
@Abbhiishek
Copy link
Contributor

Hey @kriptonian1 i have raise a PR!

@rajdip-b
Copy link
Member Author

rajdip-b commented Feb 2, 2024

🎉 This issue has been resolved in version 1.0.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@rajdip-b
Copy link
Member Author

rajdip-b commented Feb 9, 2024

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants