|
| 1 | +# Contribution Guide |
| 2 | + |
| 3 | +## Environment Setup |
| 4 | + |
| 5 | +### Tools |
| 6 | + |
| 7 | +Local development requires the following: |
| 8 | + |
| 9 | +- PowerShell 7.x |
| 10 | +- Pester 5.7.1 |
| 11 | +- [Pandoc](https://pandoc.org) |
| 12 | +- Visual Studio Code, with the following extensions: |
| 13 | + - Test Adapter Converter |
| 14 | + - Test Explorer UI |
| 15 | + - Pester Tests |
| 16 | + |
| 17 | +Development is presently done on Windows 11, though conceptually it should work on Linux |
| 18 | + |
| 19 | +### Codespace |
| 20 | + |
| 21 | +As an alternative to local development environments, a GitHub Codespace can be used to build and test. Codespace usage has an [associated cost](https://docs.github.com/en/billing/concepts/product-billing/github-codespaces). The free option should be sufficient for most developers. |
| 22 | + |
| 23 | +Codespaces are Linux based and require the above tools to be installed. |
| 24 | + |
| 25 | +TODO: DevContainer configuration with tools installed is pending. |
| 26 | + |
| 27 | +### Google Application |
| 28 | + |
| 29 | +The environment uses a Google Application with the following setup. The published module has credentials defined, but if you may want to create an application for local testing purposes. |
| 30 | + |
| 31 | +While this is not a fully documented walk-through on how to create a Google Application in the [Developer Console](https://console.cloud.google.com), the application has the following details. |
| 32 | + |
| 33 | +- Branding: |
| 34 | + - An app name + support email |
| 35 | +- Audience: Testing |
| 36 | +- Clients: |
| 37 | + - Web Application |
| 38 | + - Authorized redirect URIs: |
| 39 | + - <http://localhost/oauth2callback> |
| 40 | + - <https://localhost:8040/oauth2callback> |
| 41 | +- Data Access: uses the following scopes: |
| 42 | + |
| 43 | +- <https://www.googleapis.com/auth/blogger>: manage blogger account and posts |
| 44 | +- <https://www.googleapis.com/auth.drive.file>: upload and manage files into Google Drive that are scoped to the application. |
| 45 | + |
| 46 | +For local testing, you'll need the Client ID and Client Secret |
| 47 | + |
| 48 | +## Running Locally |
| 49 | + |
| 50 | +Within Visual Studio Code, you should be able to run the tests with no additional configuration. |
| 51 | + |
| 52 | +To test the module manually, you will need to provide your client-id and client-secret as environment variables. |
| 53 | + |
| 54 | +```shell |
| 55 | +cd ./src |
| 56 | +./reload.ps1 # to load the source into memory |
| 57 | + |
| 58 | +$env:PSBLOGGER_CLIENT_ID = "<your-id>" |
| 59 | +$env:PSBLOGGER_CLIENT_SECRET = "<your-secret>" |
| 60 | + |
| 61 | +Initialize-Blogger |
| 62 | +``` |
0 commit comments