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

Suggestion to change the project structure #28

Closed
tu2-atmanand opened this issue Dec 9, 2024 · 7 comments
Closed

Suggestion to change the project structure #28

tu2-atmanand opened this issue Dec 9, 2024 · 7 comments

Comments

@tu2-atmanand
Copy link

Hii @jillro,

I would like to suggest a better project structure to organize the codebase efficiently by using a standardized structure followed by a lot of other developers. There is even a somewhat popular template I had come across in Obsidian community few times, which is following the project structure I have proposed : https://github.com/emilio-toledo/obsidian-svelte-plugin

Although I always like to keep the main.ts file, the entry file, in the root of the project. You can find my implemented changes here : https://github.com/tu2-atmanand/obsidian-notes-explorer

I would also like to mention that, I made massive changes in my fork and initially created a huge PR in a hope to first discuss the same in the PR itself. But I understood my mistake and as per your suggestions from the README as well, I would like to first discuss it here, and if you think my changes are a good approach for an elastic project structure, I would like to create a PR for the same. (You can close the old PR)

This will be the first step for me to create more PRs to suggest the various other features I have implemented in my fork. I guess this way I can continue to contribute with the best I can.

Let me know how we can proceed with the same, so the plugin always remains updated which satisfies the need of all its users by integrating all the FRs and fixing all the issues. I would also like to know if I can help in any way to maintain the plugin and keep its development active.

@claremacrae
Copy link

Hi @tu2-atmanand, so what files would end up where - which files would you move, and where to?

@tu2-atmanand
Copy link
Author

tu2-atmanand commented Dec 10, 2024

Yes, so earlier the structure was :
components folder, settings.ts, view.ts files were in the root folder of the project. But proceeding further with the development, there might be a need to add more files. As I have added few in my fork : https://github.com/tu2-atmanand/obsidian-notes-explorer

So, I would suggest moving the folder and the two mentioned files inside a new directory called src.

Also, as I mentioned earlier, I personally like to keep the main.ts file in the root folder. But a lot of developers also prefer it to be moved inside src folder itself. So, it can be done as well, I am fine with both ways.

@claremacrae
Copy link

Thanks.

Reasons for doing this rearrangement:

  • it makes it a bit easier to search just the project source code, such as in IDEs
  • Obsidian policy: these days, when developers submit new plugins, if source files are at the top level, the Obsidian reviewer will ask for them to be moved to a sub-directory, saying something like "for ease of review and future maintenance".
  • it opens up the possibility of a tests directory in future

@tu2-atmanand
Copy link
Author

Hii @jillro ! Glad to hear from you on my contributions.

I believe you’ve reviewed the initial PR I submitted. The reason for my rather inconsiderate submission was that I thought our timings might not align. Since this is an open-source platform, we can’t always be sure when we’ll be available to contribute effectively. As a result, I jumped straight into implementing the ideas I had in mind rather than focusing on proper documentation of my work through commits and PRs.

I presumed you might had first merged the submitted 45 commits and then fine-tune the code to align with your vision for this plugin, because I think you might not be interested in integrating few of the functionalities of my own I have integrated (although Ill be submitting Issues for the same). Or, I submitted the PR thinking you might refer to my code to expedite the work of implementing the new functionalites. (This is the developer mentallity I had while working in other organizations).

Now, let me get to the main point I want to share. I would like to know your (and also other developers') opinions on the development and contribution workflow I follow. You can read more about it here: https://tu2-atmanand.github.io/task-board-docs/docs/Advanced/HowToJoinDevelopment/.

Using this workflow, you can maintain a specific branch in your repository for contributions from other developers. Where once any developer submits any PR, after reviewing the commits, you can directly merge it into this special branch. Then you can refine the code (add/delete/organize), as needed, and finally merge it into the main branch after thorough testing to release a new version.

This approach allows me to submit a collection of commits at once for a particular functionality I’ve implemented. Sometimes, after integrating a feature, I identify new bugs during testing and fix them, which results in multiple commits.

I would love to hear your and other developers' thoughts on this approach.

@claremacrae
Copy link

claremacrae commented Dec 11, 2024

That sounds like a different topic to me.

Much better to keep this one focused on changing the project directory structure, may I suggest.

@claremacrae
Copy link

That sounds like a different topic to me.

Much better to keep this one focused on changing the project directory structure, may I suggest.

Actually, I'm going to step away from this now - I've appreciated the opportunity to share suggestions, but really all that matters is @jillro's views...

Good luck with the projects, everyone...

@jillro
Copy link
Owner

jillro commented Dec 11, 2024

I agree that creating a src folder would improve developer experience, and I will do it myself very quick.

Aside from that, please try to stick to one topic, one issue. For your contributions, just try to make clear PR, with clean commit history and good commit messages. The project being small and young, there is no need for a complex workflow for contributions.

@jillro jillro closed this as completed in d2fa7e6 Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants