Skip to content

Commit

Permalink
Many updates
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljolley committed Feb 5, 2024
1 parent 769eb20 commit 6fc3854
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 237 deletions.
89 changes: 0 additions & 89 deletions .all-contributorsrc

This file was deleted.

File renamed without changes.
10 changes: 4 additions & 6 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,21 @@ Fork, then clone the repo:

git clone git@github.com:your-username/ps-alias.git

**All changes should be based from the `vNext` branch.**

- All functions placed in the `src/devtoolbox/Export` folder will be available to the end-user.
- All functions placed in the `src/devtoolbox/Private` folder will only be available to the module's scripts *not* the end-user.

Please follow these steps to include a new function to the module:

1. Create a new function in the `src/devltoolbox/Export` folder.
1. Create a new function in the `src/devltoolbox/export` folder.
1. Run the `/UpdateManifest.ps1` to update the manifest.
1. If you have previously installed the module, run `/UninstallModule.ps1`.
1. Run `/InstallModule.ps1` to install the module to your local module folder and test your new function.

Push to your fork and [submit a pull request](https://github.com/builders-club/devtoolbox/compare/) against the `vNext` branch.
Push to your fork and [submit a pull request](https://github.com/michaeljolley/devtoolbox/compare/).

At this point you're waiting on us. We like to at least comment on pull requests
within three days (and, typically, one day). We may suggest
some changes or improvements or alternatives.
within three days (and, typically, one day). We may suggest some changes or
improvements or alternatives.

Normally reviews & merging occur live on stream at [https://twitch.tv/baldbeardedbuilder](https://twitch.tv/baldbeardedbuilder).

Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: [builders-club]
github: [michaeljolley]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI/CD

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build module
shell: pwsh
run: |
. "$(Build.Repository.LocalPath)/_build/build.ps1"
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to PowerShell Gallery
env:
PS_GALLERY_API_KEY: ${{ secrets.PS_GALLERY_API_KEY }}
shell: pwsh
run: |
Publish-Module -Path "$(Build.Repository.LocalPath)/dist" -NuGetApiKey $(PS_GALLERY_API_KEY)
21 changes: 0 additions & 21 deletions .github/workflows/stale.yml

This file was deleted.

16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [1.0.0]

### Updated

- Changed the `gh` command to `github` in order to avoid conflicts with the GitHub CLI
- Moved CI/CD process to GitHub Actions
- Cleaned up repo to reflect updates in Code of Conduct, Contributing, etc.

### Deleted

- Removed the reload environment `reload` command
- Removed the `IsAdmin` command

## [0.6.2]

### Added
Expand Down Expand Up @@ -43,7 +56,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- New `gh` command that launches browser to GitHub repo if the directory is a GitHub repo
- Tons :)

[Unreleased]: https://github.com/builders-club/devtools/compare/[0.6.2]...HEAD
[Unreleased]: https://github.com/builders-club/devtools/compare/[1.0.0]...HEAD
[0.6.2]: https://github.com/builders-club/devtools/compare/[0.6.2]...[1.0.0]
[0.6.2]: https://github.com/builders-club/devtools/compare/[0.6.0]...[0.6.2]
[0.6.0]: https://github.com/builders-club/devtools/compare/[0.5.0]...[0.6.0]
[0.5.0]: https://github.com/builders-club/devtools/compare/[0.0.4]...[0.5.0]
Expand Down
43 changes: 11 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<img src="https://user-images.githubusercontent.com/1228996/71608160-8fe2d700-2b44-11ea-99fc-a1d5674f74ef.png"/>
</p>

| Release | Contributors | Downloads |
| --- | --- | --- |
| [![Build Status](https://dev.azure.com/michaeljolley/devtoolbox/_apis/build/status/MichaelJolley.devtools?branchName=master)](https://dev.azure.com/michaeljolley/devtoolbox/_build/latest?definitionId=4&branchName=master) | [![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributing) | [![Downloads](https://img.shields.io/powershellgallery/dt/devtoolbox.svg)](https://www.powershellgallery.com/packages/devtoolbox) |
[![Downloads](https://img.shields.io/powershellgallery/dt/devtoolbox.svg)](https://www.powershellgallery.com/packages/devtoolbox)

# What & Why

Expand All @@ -16,6 +14,10 @@ For more information as to how this repo came about, check out this [blog post](

The easiest way to install devtoolbox is via the [PowerShell Gallery](https://www.powershellgallery.com/packages/devtoolbox).

```ps
Install-Module -Name devtoolbox
```

---

## Parameters
Expand All @@ -24,10 +26,10 @@ All aliases accept parameters of the commands they call.

For example, the below are identical:

```CMD
g cl https://github.com/builders-club/devtoolbox.git
```bash
g cl https://github.com/michaeljolley/devtoolbox.git

git clone https://github.com/builders-club/devtoolbox.git
git clone https://github.com/michaeljolley/devtoolbox.git
```

---
Expand Down Expand Up @@ -97,37 +99,14 @@ All aliases for Git begin with `g`.

| Command | Executes |
| --- | --- |
| gh | Launches browser to GitHub repo if the directory is tracked by Git and its origin url is at GitHub |
| github | Launches browser to GitHub repo if the directory is tracked by Git and its origin url is at GitHub |
| hosts | If in Windows, opens the hosts file in an elevated editor. Choosing, in order, between VS Code, VS Code (insiders), Notepad. |
| ~~reload~~ | ~~Restarts PowerShell in-place. Useful in the event you have added something to the path or user profile script and need a powershell restart in order for it to be recognized.~~ |
| Restore-WorkspacePackages (rwp) | Restores NPM, Nuget, and Libman packages starting at the root folder of a workspace. |
| rwp | Restores NPM, Nuget, and Libman packages starting at the root folder of a workspace. |
| Syntax | Prints PowerShell Command Syntax vertically, replicating docs.microsoft.com layout |
| Sort-Reverse | Reverses the order of an array. Accepts pipeline support e.g. `1,2,3,4,5 | Sort-Reverse` |
| p `<dirname>` | Changes your current directory to the directory of the project you provide. It will search the root directory (or the current directory if no root directory is set in the environment variables) recursively for the project directory you provided. |

---

## Contributing

Want to contribute? Check out our [Code of Conduct](CODE_OF_CONDUCT.md) and [Contributing](CONTRIBUTING.md) docs. This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://michaeljolley.com/"><img src="https://avatars2.githubusercontent.com/u/1228996?v=4" width="100px;" alt=""/><br /><sub><b>Michael Jolley</b></sub></a><br /><a href="https://github.com/MichaelJolley/devtoolbox/commits?author=MichaelJolley" title="Code">💻</a> <a href="#ideas-MichaelJolley" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/MichaelJolley/devtoolbox/commits?author=MichaelJolley" title="Documentation">📖</a></td>
<td align="center"><a href="http://ryanhayes.net"><img src="https://avatars3.githubusercontent.com/u/438357?v=4" width="100px;" alt=""/><br /><sub><b>Ryan Hayes</b></sub></a><br /><a href="https://github.com/MichaelJolley/devtoolbox/commits?author=RyannosaurusRex" title="Code">💻</a> <a href="#ideas-RyannosaurusRex" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/MichaelJolley/devtoolbox/commits?author=RyannosaurusRex" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/parithon"><img src="https://avatars3.githubusercontent.com/u/8602418?v=4" width="100px;" alt=""/><br /><sub><b>Anthony Conrad</b></sub></a><br /><a href="https://github.com/MichaelJolley/devtoolbox/commits?author=parithon" title="Code">💻</a> <a href="#ideas-parithon" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/MichaelJolley/devtoolbox/commits?author=parithon" title="Documentation">📖</a> <a href="https://github.com/MichaelJolley/devtoolbox/commits?author=parithon" title="Tests">⚠️</a></td>
<td align="center"><a href="https://millerb.co.uk"><img src="https://avatars0.githubusercontent.com/u/24279339?v=4" width="100px;" alt=""/><br /><sub><b>Brett Miller</b></sub></a><br /><a href="https://github.com/MichaelJolley/devtoolbox/commits?author=brettmillerb" title="Code">💻</a> <a href="#ideas-brettmillerb" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/MichaelJolley/devtoolbox/commits?author=brettmillerb" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/corbob"><img src="https://avatars2.githubusercontent.com/u/30301021?v=4" width="100px;" alt=""/><br /><sub><b>corbob</b></sub></a><br /><a href="#ideas-corbob" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/MichaelJolley/devtoolbox/commits?author=corbob" title="Code">💻</a></td>
<td align="center"><a href="https://c-j.tech"><img src="https://avatars0.githubusercontent.com/u/3969086?v=4" width="100px;" alt=""/><br /><sub><b>Chris Jones</b></sub></a><br /><a href="https://github.com/MichaelJolley/devtoolbox/commits?author=cmjchrisjones" title="Documentation">📖</a></td>
<td align="center"><a href="https://www.ramblinggeek.co.uk"><img src="https://avatars3.githubusercontent.com/u/7108949?v=4" width="100px;" alt=""/><br /><sub><b>Wayne Taylor</b></sub></a><br /><a href="https://github.com/MichaelJolley/devtoolbox/commits?author=RamblingGeekUK" title="Code">💻</a> <a href="https://github.com/MichaelJolley/devtoolbox/commits?author=RamblingGeekUK" title="Documentation">📖</a></td>
</tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
Want to contribute? Check out our [Code of Conduct](CODE_OF_CONDUCT.md) and [Contributing](CONTRIBUTING.md) docs. Contributions of any kind welcome!
31 changes: 0 additions & 31 deletions azure-pipelines.yml

This file was deleted.

12 changes: 6 additions & 6 deletions src/Export/GitHub/Invoke-GitHubRepository.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,25 @@ Describe("Invoke-GitHubRepository") {
$cmd | Should -Be $repoUrl
}

It("Should open default browser to $repoURL/tree/vnext") {
It("Should open default browser to $repoURL/tree/main") {
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "config" } -MockWith { return $repoUrl }
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "branch" -and $PassThruArgs[1] -eq "--show-current" } -MockWith { return "vnext" }
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "branch" -and $PassThruArgs[1] -eq "-r" } -MockWith { return @("origin/vnext") }
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "branch" -and $PassThruArgs[1] -eq "--show-current" } -MockWith { return "main" }
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "branch" -and $PassThruArgs[1] -eq "-r" } -MockWith { return @("origin/main") }
Mock -CommandName "Start-Process" -MockWith {
param($FilePath)
$Script:cmd = $FilePath
}

Invoke-GitHubRepository -Branch
$cmd | Should -Be ($repoUrl + "/tree/vnext")
$cmd | Should -Be ($repoUrl + "/tree/main")
}

It("Should throw if branch doesn't exist") {
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "config" } -MockWith { return $repoUrl }
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "branch" -and $PassThruArgs[1] -eq "--show-current" } -MockWith { return "vnext" }
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "branch" -and $PassThruArgs[1] -eq "--show-current" } -MockWith { return "main" }
Mock -CommandName "git" -ParameterFilter { $PassThruArgs[0] -eq "branch" -and $PassThruArgs[1] -eq "-r" } -MockWith { return @("origin/main") }
Mock -CommandName "Start-Process" -MockWith {}

{ Invoke-GitHubRepository -Branch } | Should -Throw -ExpectedMessage "Git branch 'vnext' does not exist at $repoUrl"
{ Invoke-GitHubRepository -Branch } | Should -Throw -ExpectedMessage "Git branch 'main' does not exist at $repoUrl"
}
}
2 changes: 1 addition & 1 deletion src/Export/GitHub/Invoke-GitHubRepository.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Function Invoke-GitHubRepository {
[Alias('gh')]
[Alias('github')]
Param(
# Browse the branch
[Parameter()]
Expand Down
25 changes: 0 additions & 25 deletions src/Export/Helpers/Invoke-ReloadEnvironment.ps1

This file was deleted.

0 comments on commit 6fc3854

Please sign in to comment.