winutil/contribute/index.html

15 lines
23 KiB
HTML
Raw Normal View History

<!doctype html><html lang=en class=no-js> <head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=../assets/favicon.png><meta name=generator content="mkdocs-1.6.0, mkdocs-material-9.5.31"><title>How to Contribute? - WinUtil Documentation</title><link rel=stylesheet href=../assets/stylesheets/main.3cba04c6.min.css><link rel=stylesheet href=../assets/stylesheets/palette.06af60db.min.css><link rel=preconnect href=https://fonts.gstatic.com crossorigin><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback"><style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style><script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script></head> <body dir=ltr data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo> <input class=md-toggle data-md-toggle=drawer type=checkbox id=__drawer autocomplete=off> <input class=md-toggle data-md-toggle=search type=checkbox id=__search autocomplete=off> <label class=md-overlay for=__drawer></label> <div data-md-component=skip> <a href=#how-to-contribute class=md-skip> Skip to content </a> </div> <div data-md-component=announce> </div> <header class=md-header data-md-component=header> <nav class="md-header__inner md-grid" aria-label=Header> <a href=.. title="WinUtil Documentation" class="md-header__button md-logo" aria-label="WinUtil Documentation" data-md-component=logo> <img src=../assets/favicon.png alt=logo> </a> <label class="md-header__button md-icon" for=__drawer> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg> </label> <div class=md-header__title data-md-component=header-title> <div class=md-header__ellipsis> <div class=md-header__topic> <span class=md-ellipsis> WinUtil Documentation </span> </div> <div class=md-header__topic data-md-component=header-topic> <span class=md-ellipsis> How to Contribute? </span> </div> </div> </div> <form class=md-header__option data-md-component=palette> <input class=md-option data-md-color-media=(prefers-color-scheme) data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=indigo aria-label="Switch to light mode" type=radio name=__palette id=__palette_0> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_1 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="m14.3 16-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9h-1.9M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69m-9.15 3.96h2.3L12 9l-1.15 3.65Z"/></svg> </label> <input class=md-option data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme=default data-md-color-primary=indigo data-md-color-accent=blue aria-label="Switch to dark mode" type=radio name=__palette id=__palette_1> <label class="md-header__button md-icon" title="Switch to dark mode" for=__palette_2 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg> </label> <input class=md-option data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme=slate data-md-color-primary=black data-md-color-accent=blue aria-label="Switch to light mode" type=radio name=__palette id=__palette_2> <label class="md-header__button md-icon" title="Switch to light mode" for=__palette_0 hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3 3.19.09m3.5 6.91-1.64 1.25.59 1.98-1
</span></code></pre></div> <div class="admonition bug"> <p class=admonition-title>Keep in mind</p> <p>This is a pre-release and should be treated as such. It exists for developers to test the utility and report or fix bugs before they get added to the stable release. Don't use it in production!</p> </div> <h2 id=issues>Issues<a class=headerlink href=#issues title="Permanent link">&para;</a></h2> <ul> <li>If you encounter any challenges or problems with the script, I kindly request that you submit them via the "Issues" tab on the GitHub repository. By filling out the provided template, you can provide specific details about the issue, allowing me (and others in the community) to promptly address any bugs or consider feature requests.</li> </ul> <h2 id=contribute-code>Contribute Code<a class=headerlink href=#contribute-code title="Permanent link">&para;</a></h2> <ul> <li> <p>Pull requests are now handled directly on the <strong>MAIN branch</strong>. This was done since we can now select specific releases to launch via releases in GitHub.</p> </li> <li> <p>If you're doing code changes, then you can submit a PR to <code>main</code> branch, but I am very selective about these.</p> </li> </ul> <div class="admonition warning"> <p class=admonition-title>Important</p> <p>Do not use a code formatter, make massive amounts of line changes, or make multiple feature changes. EACH FEATURE CHANGE SHOULD BE IT'S OWN PULL REQUEST!</p> </div> <ul> <li> <p>When creating pull requests, it is essential to thoroughly document all changes made. This includes, but is not limited to, documenting any additions made to the <code>tweaks</code> section and corresponding <code>undo tweak</code>, so users are able to remove the newly added tweaks if necessary, and comprehensive documentation is required for all code changes. Document your changes and briefly explain why you made your changes in your Pull Request Description. Failure to adhere to this format may result in the denial of the pull request. Additionally, any code lacking sufficient documentation may also be denied.</p> </li> <li> <p>By following these guidelines, we can maintain a high standard of quality and ensure that the codebase remains organized and well-documented.</p> </li> </ul> <div class="admonition note"> <p class=admonition-title>Note</p> <p>When creating a function, please include "WPF" or "WinUtil" in the file name so it can be loaded into the runspace.</p> </div> <h2 id=walk-through>Walk through<a class=headerlink href=#walk-through title="Permanent link">&para;</a></h2> <ul> <li>This is a guide for beginners. If you are still having issues, look at the following official GitHub documentation:<ul> <li><a href=https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/about-commits>Commit through WEB</a></li> <li><a href=https://docs.github.com/en/desktop/making-changes-in-a-branch/committing-and-reviewing-changes-to-your-project-in-github-desktop#about-commits>Commit through GitHub Desktop</a></li> <li><a href=https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>Create a Pull Request</a></li> </ul> </li> </ul> <h3 id=overview>Overview<a class=headerlink href=#overview title="Permanent link">&para;</a></h3> <pre class=mermaid><code>%%{init: {"flowchart": {"curve": "cardinal"}} }%%
graph TD
  A[Fork Project] --&gt; B[Clone Repository];
  B --&gt; C[Create New Branch];
  C --&gt; D[Make Changes];
  D --&gt; G[Test Changes];
  G --&gt; H{Tests Passed?};
  H --&gt;|Yes| E[Commit Changes];
  H --&gt;|No| J[Fix Issues];
  J --&gt; G;
  E --&gt; F[Push Branch];
  F --&gt; K[Create Pull Request];
  K --&gt; L[Fill out PR template];
classDef default stroke:#333,stroke-width:4px,font-size:12pt;</code></pre> <div class="admonition info"> <p class=admonition-title>Info</p> <p>This is a diagram to guide you through the process. It may vary depending on the type of change you're making.</p> </div> <h3 id=fork-the-repo>Fork the Repo<a class=headerlink href=#fork-the-repo title="Permanent link">&para;</a></h3> <ul> <li>Fork the WinUtil Repository <a href=https://github.com/ChrisTitusTech/winutil>here</a> to create a copy that will be available in your repository list.</li> </ul> <p><img alt="Fork Image" src=../assets/Fork-Button-Dark.png#only-dark#gh-dark-mode-only></p> <p><img alt="Fork Image" src=../assets/Fork-Button-Light.png#only-light#gh-light-mode-only></p> <h3 id=clone-the-fork>Clone the Fork<a class=headerlink href=#clone-the-fork title="Permanent link">&para;</a></h3> <div class="admonition tip"> <p class=admonition-title>Tip</p> <p>While you can make your changes directly through the Web, we recommend cloning the repo to your device using the application GitHub Desktop (available in WinUtil) to test your fork easily.</p> </div> <ul> <li>Install GitHub Desktop if it is not already installed.</li> <li>Log in using the same GitHub account you used to fork WinUtil.</li> <li>Choose the fork under "Your Repositories" and press "clone {repo name}"</li> <li> <p>Create a new branch and name it something relatable to your changes.</p> </li> <li> <p>Now you can modify WinUtil to your liking using your preferred text editor.</p> </li> </ul> <h3 id=testing-your-changes>Testing your changes<a class=headerlink href=#testing-your-changes title="Permanent link">&para;</a></h3> <ul> <li> <p>To test to see if your changes work as intended run following commands in a powershell teminal as admin:</p> </li> <li> <p>Change the directory where you are running the commands to the forked project.</p> </li> <li><code>cd {path to the folder with the compile.ps1}</code></li> <li>Run the following command to compile and run WinUtil:</li> <li><code>.\Compile.ps1 -run</code></li> </ul> <p><img alt=Compile src=../assets/Compile.png></p> <ul> <li>After seeing that your changes work properly, feel free to commit the changes to the repository and make a PR. For help on that, follow the documentation below.</li> </ul> <h3 id=committing-the-changes>Committing the changes<a class=headerlink href=#committing-the-changes title="Permanent link">&para;</a></h3> <ul> <li>Before committing your changes, please discard changes made to the <code>winutil.ps1</code> file, like the following:</li> </ul> <p><img alt="Push Commit Image" src=../assets/Discard-GHD.png></p> <ul> <li>Now, commit your changes once you are happy with the result.</li> </ul> <p><img alt="Commit Image" src=../assets/Commit-GHD.png></p> <ul> <li>Push the changes to upload them to your fork on github.com.</li> </ul> <p><img alt="Push Commit Image" src=../assets/Push-Commit.png></p> <h3 id=making-a-pr>Making a PR<a class=headerlink href=#making-a-pr title="Permanent link">&para;</a></h3> <ul> <li>To make a PR on your repo under a new branch linking to the main branch, a button will show and say Preview and Create pull request. Click that button and fill in all the information that is provided on the template. Once all the information is filled in correctly, check your PR to make sure there is not a WinUtil.ps1 file attached to the PR. Once everything is good, make the PR and wait for Chris (the maintainer) to accept or deny your PR. Once it is accepted by Chris, you will be able to see your changes in the "/windev" build.</li> <li>If you do not see your feature in the main "/win" build, that is fine. All new changes go into the /windev build to make sure everything is working OK before going fully public.</li> <li>Congratulations! You just submitted your first PR. Thank you so much for contributing to WinUtil.</li> </ul> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Last update"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1