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

Define and clean up folder/files names #121

Closed
3 tasks
ageddesi opened this issue Oct 3, 2022 · 11 comments
Closed
3 tasks

Define and clean up folder/files names #121

ageddesi opened this issue Oct 3, 2022 · 11 comments
Assignees

Comments

@ageddesi
Copy link
Owner

ageddesi commented Oct 3, 2022

At the moment the files and folders are using different naming conventions and case types.

  • - Define the standards
  • - Update the contribution guide to include these standards
  • - Update existing folders and files to be inline.

image
image

@fms12
Copy link
Contributor

fms12 commented Oct 4, 2022

can you assign me this

@ageddesi
Copy link
Owner Author

ageddesi commented Oct 4, 2022

Hi @fms12 Feel free to start the discussion on this post about what standards we should follow and once we all agree you can do the work involved.

@fms12
Copy link
Contributor

fms12 commented Oct 4, 2022

@ageddesi we can add modules name like that "chat-module" and for files, we can just like that "CurrencyRouters"

@amanksdotdev
Copy link

I can work on this if it is not assigned to anyone.
After going through the codebase I would suggest keeping kebab-case as the naming convention for both files and folders as this is a nodejs project.

@ageddesi
Copy link
Owner Author

Does anyone know of a good coding standards doc we can reference for node projects.

@fms12
Copy link
Contributor

fms12 commented Oct 10, 2022

https://nodejs.dev/en/learn/ you can use this one also.

@amanksdotdev
Copy link

@ageddesi https://stackoverflow.com/questions/18927298/node-js-project-naming-conventions-for-files-folders the first two answers.

@sherlyfebrianti96
Copy link
Contributor

sherlyfebrianti96 commented Oct 15, 2022

Hi, is it okay if i do this task since no updates for 5 days?

I would like to propose this :

  • Using kebab-case for the folders, and keep the naming simple
    • e.g :
      • time_zones -> timezones
      • phone-numbers -> phones
  • Using kebab-case for the filenames
  • Restructuring the files
    • Before :
      • Modules
        • Address/animal/etc (not-standardized yet)
          • api
            • file-routes.ts (not-standardized yet)
          • const
            • file.ts (not-standardized yet)
          • test
            • file.test.ts (not-standardized yet)
          • utils
            • file.ts (not-standardized yet)
    • After :
      • Modules
        • address/animal/timezones (kebab-case)
          • address/animal/timezones.routes.ts (kebab-case) -> This is for APIs
          • address/animal/timezones.types.ts (kebab-case) -> This is for Interfaces/Types
          • utils (kebab-case)
            • util-name-1.ts (kebab-case)
            • util-name-2.ts (kebab-case)
          • test
            • address/animal/timezones
            • utils
              • util-name-1.test.ts (kebab-case)
              • util-name-2.test.ts (kebab-case)

So in general, this is how to identify the code :

  • *.routes.ts is for the APIs
  • *.types.ts is for the Interfaces and Types
  • utils/*.ts is for all the utilities
  • The test folder should have the same structure with current directory
    • and */\.test.ts is for all test files

@ageddesi ageddesi assigned sherlyfebrianti96 and unassigned fms12 Oct 15, 2022
@ageddesi
Copy link
Owner Author

Hi @sherlyfebrianti96 I am happy with the changes you have mentioned and what we have discussed in Discord. Please feel free to take this ticket on 👍

@sherlyfebrianti96
Copy link
Contributor

Update :

The Interfaces/Types will be treated the same as utils folder.
So it will be :

  • Modules
    • address/animal/timezones (kebab-case)
      • address/animal/timezones.routes.ts (kebab-case) -> This is for APIs
      • models (kebab-case)
        • address/animal/timezones.types.ts (kebab-case) -> This is for Interfaces/Types
      • utils (kebab-case)
        • util-name-1.ts (kebab-case)
        • util-name-2.ts (kebab-case)
      • test
        • address/animal/timezones
        • utils
          • util-name-1.test.ts (kebab-case)
          • util-name-2.test.ts (kebab-case)

@sherlyfebrianti96
Copy link
Contributor

sherlyfebrianti96 commented Oct 15, 2022

Update the contribution guide to include the new standards : #222

sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
sherlyfebrianti96 added a commit to sherlyfebrianti96/Mocked-API that referenced this issue Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants