-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Update composer.json, move lib files to src folder (renewed) #102
Conversation
Thank you again for this PR, On more thing comes to my mind: is it possible to specify the path for the autoloader on the build? In my current .gitignore I have an entry for the vendor folder to avoid pushing lots of unnecessary files to this repo, but I want that a clone of this repo will also work without building it via composer, also I need to take care to copy only necessary files to the docker image on the build process. So my question is, if we introduce a namespace and a new sub folder (vendor) for the autoloader.php can we change the structure that we only need one new sub folder for autoloader.php, PerliteParsedown.php, Parsedown.php etc. So I would recommend to either move also the PerliteParsedown.php to the vendor folder and I change the .gitingore to exclude everything non needed from the vendor folder or we go the other way to have a new (src) folder and move the autoloader.php PerliteParsedown and Parsedown.php to this folder. You know what I mean? |
Thank you for taking the time to review my PR :) Your concerns are very thoughtful. I completely support your ideas. Below are brief pros and cons of including/excluding the vendor folder.
Based on my understanding, your question is about having one folder to store both 1st and 3rd party class files.
Here are my opinions:
My view on a more common folder structure is:
Developers familiar with Composer or those coming from popular frameworks will feel comfortable with this structure. The integration of Composer entails significant decisions. |
Thank you for the extensive information! I think I will follow your suggestions. Unfortunately, this means I need to exclude the JS dependencies again from the composer and either update them manually, use CDNs or use a second composer file and a bash script. However, if there is a best practice in development, I will try to follow it :) I will try to include this in the next release. |
I decided to use a separate php composer file for the js assets. This way I can include the vendor folder and use the php autoload script. Release is now online in 1.5.7. Thanks again for the contribution! |
Related to #67, #101
This PR introduces a
Perlite
namespace incomposer.json
and maps it to the newly created/perlite/.src
folder.This enables class autoloading in accordance with PSR-4 standards.
The code changes have been minimized compared to #101.
However, one line in
helper.php
was modified during local testingto accommodate OS-independent handling of the temp folder.
I recognize that using
.src
as a namespace root is unconventional.While
src
is more commonly adopted, there's a potential risk of it colliding with a user's vault name (and thevendor
folder too).The prefix
.
insrc
is intended as a temporary measure until the project undergoes a folder structure reorganization.I welcome any suggestions or feedback.