diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..dd84ea78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..3c5f7a29 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,192 @@ +### Changelog + +All notable changes to this project will be documented in this file. Dates are displayed in UTC. + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +#### [v0.8.0-beta](https://github.com/hydephp/framework/compare/v0.7.5-alpha...v0.8.0-beta) + +> 2 April 2022 + +- Rewrite main navigation menu [`#60`](https://github.com/hydephp/framework/pull/60) +- Fix #59, unify sidebar elements [`#59`](https://github.com/hydephp/framework/issues/59) +- Unify the navigation menu [`f0e6cfc`](https://github.com/hydephp/framework/commit/f0e6cfc28eae7c0325a89ab0cce4ab67329e3be5) +- Add the interaction [`c5b4f7e`](https://github.com/hydephp/framework/commit/c5b4f7eb71166bce556b19ddf84861798ea2bda4) + +#### [v0.7.5-alpha](https://github.com/hydephp/framework/compare/v0.7.4-alpha...v0.7.5-alpha) + +> 2 April 2022 + +- Fix broken meta url in schema prop [`b54cfe4`](https://github.com/hydephp/framework/commit/b54cfe4a1aa1441584cd0b209fcb89a99fa4ce7a) +- Fix broken meta url in schema prop [`80b5523`](https://github.com/hydephp/framework/commit/80b552305c3d5730a951ae2f5115bed21c9a4b84) + +#### [v0.7.4-alpha](https://github.com/hydephp/framework/compare/v0.7.3-alpha...v0.7.4-alpha) + +> 1 April 2022 + +- Fix bug #47 [`b7cdaf6`](https://github.com/hydephp/framework/commit/b7cdaf67e626855c3df7513dd0b58a563f9030be) + +#### [v0.7.3-alpha](https://github.com/hydephp/framework/compare/v0.7.2-alpha...v0.7.3-alpha) + +> 1 April 2022 + +- Fix #58 [`#58`](https://github.com/hydephp/framework/issues/58) + +#### [v0.7.2-alpha](https://github.com/hydephp/framework/compare/v0.7.1-alpha...v0.7.2-alpha) + +> 1 April 2022 + +- Create new command to scaffold pages [`#55`](https://github.com/hydephp/framework/pull/55) +- Apply fixes from StyleCI [`#56`](https://github.com/hydephp/framework/pull/56) +- Create the action [`b788de2`](https://github.com/hydephp/framework/commit/b788de22a3175c3b09eadf15249d152026f0a160) +- Create the command [`eac5258`](https://github.com/hydephp/framework/commit/eac5258268a152496cf10bff05a23aa2977617eb) +- Clean up and format code [`dc5c5ee`](https://github.com/hydephp/framework/commit/dc5c5eef20df88b729bf749004001a0832d31302) + +#### [v0.7.1-alpha](https://github.com/hydephp/framework/compare/v0.7.0-alpha...v0.7.1-alpha) + +> 1 April 2022 + +- Add a favicon link automatically if the file exists [`#54`](https://github.com/hydephp/framework/pull/54) +- Create LICENSE.md [`57d4a1b`](https://github.com/hydephp/framework/commit/57d4a1b6122e7fcef021d84bff76a97b53424d0a) +- Use getPrettyVersion for composer version [`7569fb7`](https://github.com/hydephp/framework/commit/7569fb7616bcbaa22b30aad00bf559cb81578feb) +- Change version to the (pretty) framework version [`973cc74`](https://github.com/hydephp/framework/commit/973cc7414c8a398801e2cb52364f9eb44269cf3e) + +#### [v0.7.0-alpha](https://github.com/hydephp/framework/compare/v0.6.2-alpha...v0.7.0-alpha) + +> 1 April 2022 + +- Fix bug #47 StaticPageBuilder not able to create nested documentation directories [`#51`](https://github.com/hydephp/framework/pull/51) +- Remove _authors and _drafts directories #48 [`#49`](https://github.com/hydephp/framework/pull/49) +- Apply fixes from StyleCI [`#50`](https://github.com/hydephp/framework/pull/50) +- Delete phpdoc.dist.xml [`b28afb7`](https://github.com/hydephp/framework/commit/b28afb712f7ea522e1fb9b2175223812d910b3a0) +- Remove _data directory [`a11ff92`](https://github.com/hydephp/framework/commit/a11ff9266ff3086c4e7a3ed17f7320e90cbd8788) +- Update author yml config path [`e0578bb`](https://github.com/hydephp/framework/commit/e0578bb8938c48b62540573fa88240932e629b4f) + +#### [v0.6.2-alpha](https://github.com/hydephp/framework/compare/v0.6.1-alpha...v0.6.2-alpha) + +> 30 March 2022 + +- Fix the documentation page header link [`#46`](https://github.com/hydephp/framework/pull/46) +- Use the indexpath basename for the doc header [`e188eb5`](https://github.com/hydephp/framework/commit/e188eb54f7d5c4fdc784fc16ffd7a60ad9ab458c) + +#### [v0.6.1-alpha](https://github.com/hydephp/framework/compare/v0.6.0-alpha...v0.6.1-alpha) + +> 30 March 2022 + +- Use relative path helper for links [`#45`](https://github.com/hydephp/framework/pull/45) +- Apply fixes from StyleCI [`#43`](https://github.com/hydephp/framework/pull/43) +- Add support for nesting the documentation pages [`#42`](https://github.com/hydephp/framework/pull/42) + +#### [v0.6.0-alpha](https://github.com/hydephp/framework/compare/v0.5.3-alpha...v0.6.0-alpha) + +> 30 March 2022 + +- Fix the 404 route bug [`#41`](https://github.com/hydephp/framework/pull/41) +- #38 Add a rebuild command to the Hyde CLI to rebuild a specific file [`#39`](https://github.com/hydephp/framework/pull/39) +- Apply fixes from StyleCI [`#40`](https://github.com/hydephp/framework/pull/40) +- Move scripts into app.js [`#35`](https://github.com/hydephp/framework/pull/35) +- #32 refactor command class names to be consistent [`#33`](https://github.com/hydephp/framework/pull/33) +- Add internal PHPDoc class descriptions [`#30`](https://github.com/hydephp/framework/pull/30) +- Apply fixes from StyleCI [`#31`](https://github.com/hydephp/framework/pull/31) +- Apply fixes from StyleCI [`#28`](https://github.com/hydephp/framework/pull/28) +- Require Torchlight [`#27`](https://github.com/hydephp/framework/pull/27) +- Restructure backend models [`#26`](https://github.com/hydephp/framework/pull/26) +- Rework how Markdown files are handled to improve maintainability and testing [`#25`](https://github.com/hydephp/framework/pull/25) +- 0.6.0 Remove support for Front Matter in Markdown Pages [`#24`](https://github.com/hydephp/framework/pull/24) +- Fix #21 by dynamically routing to the docs index [`#23`](https://github.com/hydephp/framework/pull/23) +- Merge pull request #23 from hydephp/21-bug-documentation-sidebar-header-should-link-to-readme-if-that-exists-but-an-index-does-not [`#21`](https://github.com/hydephp/framework/issues/21) +- Fix #21 by dynamically routing to the docs index [`#21`](https://github.com/hydephp/framework/issues/21) +- Add PHPUnit [`0d59ea0`](https://github.com/hydephp/framework/commit/0d59ea032a8b2be2f5c09db06563ab504e233d05) +- Create the HydeRebuildStaticSiteCommand [`92b1d20`](https://github.com/hydephp/framework/commit/92b1d20069482f851ee18629a0845a69e8f5a43a) +- Refactor to use the MarkdownFileService [`48a27a2`](https://github.com/hydephp/framework/commit/48a27a2799fd6a27e3bfa55417c2eb7fda3a4c43) + +#### [v0.5.3-alpha](https://github.com/hydephp/framework/compare/v0.5.2-alpha...v0.5.3-alpha) + +> 26 March 2022 + +- Remove deprecated methods [`#19`](https://github.com/hydephp/framework/pull/19) +- Make the command extend the base command [`eaba9da`](https://github.com/hydephp/framework/commit/eaba9dac5a9849804ccfdfc2798129fbe5cb0daf) +- Remove deprecated class [`24753c1`](https://github.com/hydephp/framework/commit/24753c1776c5f887baed82c93f02b632032ffde1) +- Format to PSR2 [`8307b65`](https://github.com/hydephp/framework/commit/8307b65087f73c3bbb40ecc7eb469db83c7777be) + +#### [v0.5.2-alpha](https://github.com/hydephp/framework/compare/v0.5.1-alpha...v0.5.2-alpha) + +> 25 March 2022 + +- Remove the Hyde installer [`#18`](https://github.com/hydephp/framework/pull/18) +- 0.6.x Remove deprecated command [`#17`](https://github.com/hydephp/framework/pull/17) +- Improve Docgen Feature by allowing the output directory to be dynamically changed [`#16`](https://github.com/hydephp/framework/pull/16) +- Rework installer prompts and fix wrong directory [`c15a4ac`](https://github.com/hydephp/framework/commit/c15a4acdf76e71221f3ba4c8d028ce2d0a7e3b0a) +- Allow the documentation output directory to be changed [`6cf07a3`](https://github.com/hydephp/framework/commit/6cf07a35aa3517d6691da3bb0ded266dea0e812a) +- Allow the homepage argument to be set from cli [`ab8dedd`](https://github.com/hydephp/framework/commit/ab8deddbebd73e458712cbde51a8c40a33fae38e) + +#### [v0.5.1-alpha](https://github.com/hydephp/framework/compare/v0.5.0-alpha...v0.5.1-alpha) + +> 24 March 2022 + +- Fix visual bug caused by setting max-width on body instead of article [`#15`](https://github.com/hydephp/framework/pull/15) +- Load commands in service provider instead of config/commands.php [`#13`](https://github.com/hydephp/framework/pull/13) +- Load commands in service provider instead of config [`46397fd`](https://github.com/hydephp/framework/commit/46397fd28e6cec25ec92ce44e047183b87346331) + +#### [v0.5.0-alpha](https://github.com/hydephp/framework/compare/v0.4.3-alpha...v0.5.0-alpha) + +> 24 March 2022 + +- Merge 0.5.0 into Master - Adds a multitude of new tests, code refactors and quality of life features [`#12`](https://github.com/hydephp/framework/pull/12) +- Sync branch with Master [`#11`](https://github.com/hydephp/framework/pull/11) +- Merge 0.5.x progress [`#10`](https://github.com/hydephp/framework/pull/10) +- Add _data directory and Authors object as well as stubs to aid in testing [`#9`](https://github.com/hydephp/framework/pull/9) +- Add required depedency to framework [`e5f0ec5`](https://github.com/hydephp/framework/commit/e5f0ec58df1163ef1de85a0b3233a347c45be136) +- Implement the Authors backend feature [`d7679f5`](https://github.com/hydephp/framework/commit/d7679f5b8d9ac900229a91d59099974cb82568e1) +- Add Commonmark as an explicit dependency [`bf915b1`](https://github.com/hydephp/framework/commit/bf915b130f418433ee2b47cc158229614883b090) + +#### [v0.4.3-alpha](https://github.com/hydephp/framework/compare/v0.4.2-alpha...v0.4.3-alpha) + +> 23 March 2022 + +- Add bindings for the package versions [`a9ce58d`](https://github.com/hydephp/framework/commit/a9ce58d2a9583866c05451ecf0da1dac4f84260b) +- Get version from facade [`465bafc`](https://github.com/hydephp/framework/commit/465bafc59fd0d20c5df91148d148d4c89a36e988) +- Replace Git version with Hyde version [`bcb7357`](https://github.com/hydephp/framework/commit/bcb7357f637138239bbee3ece007ff45564718bd) + +#### [v0.4.2-alpha](https://github.com/hydephp/framework/compare/v0.4.1-alpha...v0.4.2-alpha) + +> 23 March 2022 + +- v0.4.2-alpha Adds new meta tags and more data rich HTML [`#8`](https://github.com/hydephp/framework/pull/8) +- Add new meta tag options [`78a74c7`](https://github.com/hydephp/framework/commit/78a74c7c5342d6a8b528134022ba822e506cb12e) +- Add the Site URL feature, remember to update config! [`ee2f5c6`](https://github.com/hydephp/framework/commit/ee2f5c6b542ec3eb20412a8ef718b11cc1a9e23c) +- Add more rich HTML content [`8eb6778`](https://github.com/hydephp/framework/commit/8eb677849a655a30dffe5bfb3d48921ff4b24821) + +#### [v0.4.1-alpha](https://github.com/hydephp/framework/compare/v0.4.0-alpha...v0.4.1-alpha) + +> 22 March 2022 + +- Add the Hyde::getLatestPosts() shorthand to get the latest posts collection [`#4`](https://github.com/hydephp/framework/pull/4) +- Add new options to the build command to improve the user experience [`#3`](https://github.com/hydephp/framework/pull/3) +- Remove progress bar from empty collections [`40d3203`](https://github.com/hydephp/framework/commit/40d3203d5494d37cea1b921f2a4447bc924d18d7) +- Add option to remove old files before building [`2650997`](https://github.com/hydephp/framework/commit/26509974c02a0c2d14f6fec490bdedc89a9b7725) +- Add options to automatically build frontend assets [`f789c2f`](https://github.com/hydephp/framework/commit/f789c2fc840e5bbffbf1df2b6a56576a846d48f5) + +#### [v0.4.0-alpha](https://github.com/hydephp/framework/compare/v0.3.1-alpha...v0.4.0-alpha) + +> 22 March 2022 + +- Add the console logo font [`2683a4b`](https://github.com/hydephp/framework/commit/2683a4b06d6ea646d2d3f6eaab32746df8a02da0) +- Add the config files [`47e9044`](https://github.com/hydephp/framework/commit/47e9044c3f63a02c8c5858d0a32861031126387c) +- Add the 404 page [`962cbe2`](https://github.com/hydephp/framework/commit/962cbe2886f2815a5c46de56b73e594cd3b12d1b) + +#### [v0.3.1-alpha](https://github.com/hydephp/framework/compare/v0.3.0-alpha...v0.3.1-alpha) + +> 22 March 2022 + +- Delete vendor directory [`4f96627`](https://github.com/hydephp/framework/commit/4f96627679a2e6de95520010a6f1bc98f30bca9f) +- 0.3.1 Move commands to framework [`70dd8df`](https://github.com/hydephp/framework/commit/70dd8df956e7fc1bc1c9b67a14e2b23a8fea4d76) +- Add php 8 require, and suggest hyde/hyde [`a8ff6ad`](https://github.com/hydephp/framework/commit/a8ff6ad9b3db7fe5bf69c638dd03b21309b85e42) + +#### v0.3.0-alpha + +> 21 March 2022 + +- Add the Core files (with temporary namespace) [`816ad3a`](https://github.com/hydephp/framework/commit/816ad3a24e5f95dff5aa1f1cfd581764fd1a1389) +- Initial Commit [`fa00787`](https://github.com/hydephp/framework/commit/fa007876e36ca6588147b05d44f927d7e8fbf997) +- Successfully move namespace Core to Framework [`0c9160f`](https://github.com/hydephp/framework/commit/0c9160f33124701e6ed21a1e5b2bd70f46aaa65a) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..bcf7bf8a --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +caen@desilva.se. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..b5475079 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,59 @@ +# Contributing + +Contributions are **welcome** and will be fully **credited**. + +Please read and understand the contribution guide before creating an issue or pull request. + +## Etiquette + +This project is open source, and as such, the maintainers give their free time to build and maintain the source code +held within. They make the code freely available in the hope that it will be of use to other developers. It would be +extremely unfair for them to suffer abuse or anger for their hard work. + +Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the +world that developers are civilized and selfless people. + +It's the duty of the maintainer to ensure that all submissions to the project are of sufficient +quality to benefit the project. Many developers have different skill sets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. + +## Viability + +When requesting or submitting new features, first consider whether it might be useful to others. Open +source projects are used by many developers, who may have entirely different needs to your own. Think about +whether or not your feature is likely to be used by other users of the project. + +## Procedure + +Before filing an issue: + +- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. +- Check to make sure your feature suggestion isn't already present within the project. +- Check the pull requests tab to ensure that the bug doesn't have a fix in progress. +- Check the pull requests tab to ensure that the feature isn't already in progress. + +Before submitting a pull request: + +- Check the codebase to ensure that your feature doesn't already exist. +- Check the pull requests to ensure that another person hasn't already submitted the feature or fix. + +## Requirements + +If the project maintainer has any additional requirements, you will find them listed here. + +We try to follow the Laravel standards, https://laravel.com/docs/9.x/contributions#coding-style + +- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** + +**Please add tests!** +- **Add tests!** - Your patch might not be accepted if it doesn't have tests. + +- **Document any change in behavior** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. + + + +- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. This makes it easier to keep track of changes. + +- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. + +**Happy coding**! diff --git a/README.md b/README.md index 8b63a255..6237396e 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,9 @@
-## ⚠ Alpha Software Warning ⚠ -### This is a very new repo that has been made public to run further tests before the initial release. Please wait until v1.0 for production use. +## ⚠ Beta Software Warning ⚠ +### Heads up! HydePHP is still very new. As such there may be bugs (please report them) and breaking changes. +#### Please wait until v1.0 for production use and remember to backup your source files before updating (use Git!). --- > Note: This repository contains the core code of the Hyde framework. If you want to build an application using Hyde, visit the [main Hyde repository](https://github.com/hydephp/hyde) which also serves as a template to get started quickly. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..fe6687e5 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | Notes | +| ------- | ------------------ | ---- | +| 0.1.0-Pre | :warning: | Pre-release | +| 0.1.0 | :x: | Alpha-release | + +:warning: Pre-releases are not suited for production. + + + + +## Reporting a Vulnerability + +If you discover a security vulnerability within this package, please send an e-mail to the creator, Caen De Silva, via caen@desilva.se. + +All security vulnerabilities will be promptly addressed. diff --git a/src/Actions/CreatesDefaultDirectories.php b/src/Actions/CreatesDefaultDirectories.php index c5f39fe3..135ce07d 100644 --- a/src/Actions/CreatesDefaultDirectories.php +++ b/src/Actions/CreatesDefaultDirectories.php @@ -3,6 +3,7 @@ namespace Hyde\Framework\Actions; use Hyde\Framework\Hyde; +use JetBrains\PhpStorm\Pure; /** * Create the default directories required by the Application. @@ -12,7 +13,7 @@ * * This behavior is handled in the Service Provider. * - * @see Hyde\Framework\HydeServiceProvider + * @see \Hyde\Framework\HydeServiceProvider */ class CreatesDefaultDirectories { @@ -51,6 +52,7 @@ public function __invoke(): void * * @return array */ + #[Pure] public static function getRequiredDirectories(): array { return (new CreatesDefaultDirectories)->requiredDirectories; diff --git a/src/Actions/CreatesNewMarkdownPostFile.php b/src/Actions/CreatesNewMarkdownPostFile.php index f5851269..19efb070 100644 --- a/src/Actions/CreatesNewMarkdownPostFile.php +++ b/src/Actions/CreatesNewMarkdownPostFile.php @@ -15,7 +15,7 @@ * using the Hyde command, and converts and formats the * data input by the user, and then saves the file. * - * @see Hyde\Framework\Commands\MakePostCommand + * @see \Hyde\Framework\Commands\HydeMakePostCommand */ class CreatesNewMarkdownPostFile { diff --git a/src/Actions/CreatesNewPageSourceFile.php b/src/Actions/CreatesNewPageSourceFile.php index ea857b7b..7f70915b 100644 --- a/src/Actions/CreatesNewPageSourceFile.php +++ b/src/Actions/CreatesNewPageSourceFile.php @@ -126,6 +126,6 @@ public function createBladeFile(): int|false @endsection EOF -); + ); } } diff --git a/src/Actions/GeneratesNavigationMenu.php b/src/Actions/GeneratesNavigationMenu.php index 58fb8b3c..a7866daa 100644 --- a/src/Actions/GeneratesNavigationMenu.php +++ b/src/Actions/GeneratesNavigationMenu.php @@ -7,6 +7,7 @@ use Hyde\Framework\Hyde; use Hyde\Framework\Services\CollectionService; use Illuminate\Support\Str; +use JetBrains\PhpStorm\Pure; /** * Generate the dynamic navigation menu. @@ -156,6 +157,7 @@ public function getTitleFromSlug(string $slug): string * * @return array */ + #[Pure] private function getListOfCustomPages(): array { $array = []; diff --git a/src/Commands/HydeBuildStaticSiteCommand.php b/src/Commands/HydeBuildStaticSiteCommand.php index 4aa554d2..65577359 100644 --- a/src/Commands/HydeBuildStaticSiteCommand.php +++ b/src/Commands/HydeBuildStaticSiteCommand.php @@ -15,6 +15,7 @@ use Hyde\Framework\Models\MarkdownPost; use Hyde\Framework\Services\CollectionService; use Hyde\Framework\StaticPageBuilder; +use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\File; use LaravelZero\Framework\Commands\Command; @@ -33,7 +34,8 @@ class HydeBuildStaticSiteCommand extends Command {--run-prod : Run the NPM prod script after build} {--pretty : Should the build files be prettified?} {--clean : Should the output directory be emptied before building?} - {--force : Allow file deletions when using --clean without confirmation?}'; + {--force : Allow file deletions when using --clean without confirmation?} + {--no-api : Disable external API calls, such as Torchlight}'; /** * The description of the command. @@ -55,6 +57,13 @@ public function handle(): int $this->title('Building your static site!'); + if ($this->option('no-api')) { + $this->info('Disabling external API calls, such as Torchlight'); + $config = config('hyde.features'); + unset($config[array_search('torchlight', $config)]); + Config::set(['hyde.features' => $config]); + } + if ($this->option('clean')) { if ($this->option('force')) { $this->purge(); diff --git a/src/Commands/HydePublishViewsCommand.php b/src/Commands/HydePublishViewsCommand.php index f5a11aa4..a0e93557 100644 --- a/src/Commands/HydePublishViewsCommand.php +++ b/src/Commands/HydePublishViewsCommand.php @@ -5,7 +5,6 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Arr; use Illuminate\Support\ServiceProvider; -use LaravelZero\Framework\Commands\Command; /** * Publish the Hyde assets. @@ -98,7 +97,7 @@ protected function promptForProviderOrTag() * * @return array */ - protected function publishableChoices() + protected function publishableChoices(): array { return array_merge( ['