generated from nhcarrigan/template
feat: initial prototype attempt
This commit is contained in:
@@ -1,39 +1,154 @@
|
||||
# New Repository Template
|
||||
# Minori - Dependency Update Manager
|
||||
|
||||
This template contains all of our basic files for a new GitHub repository. There is also a handy workflow that will create an issue on a new repository made from this template, with a checklist for the steps we usually take in setting up a new repository.
|
||||
Minori is an automated dependency management system for Gitea repositories. It checks all repositories in your organisation for outdated npm dependencies and creates pull requests with changelogs for each update.
|
||||
|
||||
If you're starting a Node.JS project with TypeScript, we have a [specific template](https://github.com/naomi-lgbt/nodejs-typescript-template) for that purpose.
|
||||
## Features
|
||||
|
||||
## Readme
|
||||
- 🔍 Scans all repositories in a Gitea organisation
|
||||
- 📦 Checks npm dependencies for updates
|
||||
- 📝 Fetches changelogs from GitHub releases when available
|
||||
- 🔄 Creates individual PRs for each dependency update
|
||||
- ⏰ Runs on a configurable schedule or one-time
|
||||
- 🌸 Adds a friendly signature to each PR
|
||||
|
||||
Delete all of the above text (including this line), and uncomment the below text to use our standard readme template.
|
||||
## Prerequisites
|
||||
|
||||
<!-- # Project Name
|
||||
- Node.js v20 or higher
|
||||
- pnpm package manager
|
||||
- A Gitea instance with API access
|
||||
- 1Password CLI (for secret management)
|
||||
|
||||
Project Description
|
||||
## Installation
|
||||
|
||||
## Live Version
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone https://git.nhcarrigan.com/nhcarrigan/minori.git
|
||||
cd minori
|
||||
```
|
||||
|
||||
This page is currently deployed. [View the live website.]
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
## Feedback and Bugs
|
||||
3. Build the project:
|
||||
```bash
|
||||
pnpm build
|
||||
```
|
||||
|
||||
If you have feedback or a bug report, please [log a ticket on our forum](https://support.nhcarrigan.com).
|
||||
## Configuration
|
||||
|
||||
## Contributing
|
||||
Minori uses the `prod.env` file for secrets management with 1Password vault references:
|
||||
|
||||
If you would like to contribute to the project, you may create a Pull Request containing your proposed changes and we will review it as soon as we are able! Please review our [contributing guidelines](CONTRIBUTING.md) first.
|
||||
```bash
|
||||
# Gitea Authentication
|
||||
GITEA_TOKEN=op://Personal/Gitea Personal Access Token/credential
|
||||
```
|
||||
|
||||
## Code of Conduct
|
||||
Other configuration values are set in `src/config.ts`:
|
||||
- `GITEA_URL`: https://git.nhcarrigan.com
|
||||
- `GITEA_ORG`: nhcarrigan
|
||||
- `CHECK_INTERVAL`: 0 7 * * * (daily at 7am)
|
||||
- `PR_BRANCH_PREFIX`: dependencies/update-
|
||||
|
||||
Before interacting with our community, please read our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
### Required Permissions
|
||||
|
||||
Your Gitea personal access token needs the following permissions:
|
||||
- Read access to repositories
|
||||
- Write access to create branches
|
||||
- Write access to create pull requests
|
||||
- Write access to push commits
|
||||
|
||||
## Usage
|
||||
|
||||
### Run Once (Testing)
|
||||
|
||||
To run a single dependency check without scheduling:
|
||||
|
||||
```bash
|
||||
RUN_ONCE=true op run --env-file=prod.env -- node prod/index.js
|
||||
```
|
||||
|
||||
Note: `RUN_ONCE` is a runtime flag, not a configuration value
|
||||
|
||||
### Run as Service
|
||||
|
||||
To run continuously on a schedule:
|
||||
|
||||
```bash
|
||||
op run --env-file=prod.env -- node prod/index.js
|
||||
```
|
||||
|
||||
### Systemd Service (Production)
|
||||
|
||||
Create a systemd service file at `/etc/systemd/system/minori.service`:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Minori Dependency Update Manager
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=naomi
|
||||
WorkingDirectory=/path/to/minori
|
||||
ExecStart=/usr/bin/op run --env-file=prod.env -- /usr/bin/node prod/index.js
|
||||
Restart=on-failure
|
||||
RestartSec=30
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Enable and start the service:
|
||||
```bash
|
||||
sudo systemctl enable minori
|
||||
sudo systemctl start minori
|
||||
```
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Repository Discovery**: Minori fetches all repositories from your Gitea organisation
|
||||
2. **Package Analysis**: For each repository with a `package.json`, it checks all dependencies
|
||||
3. **Version Comparison**: Compares current versions with latest npm releases
|
||||
4. **PR Creation**: For each outdated dependency:
|
||||
- Creates a new branch
|
||||
- Updates the version in `package.json`
|
||||
- Fetches changelog information
|
||||
- Creates a pull request with details
|
||||
5. **Deduplication**: Skips creating PRs if one already exists for that dependency
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Run linting
|
||||
pnpm lint
|
||||
|
||||
# Build the project
|
||||
pnpm build
|
||||
|
||||
# Run tests
|
||||
pnpm test
|
||||
```
|
||||
|
||||
## Scripts
|
||||
|
||||
- `pnpm lint` - Run ESLint
|
||||
- `pnpm build` - Build TypeScript to JavaScript
|
||||
- `pnpm start` - Run the built application with 1Password
|
||||
- `pnpm test` - Run tests (placeholder)
|
||||
|
||||
## License
|
||||
|
||||
This software is licensed under our [global software license](https://docs.nhcarrigan.com/#/license).
|
||||
See LICENSE.md
|
||||
|
||||
Copyright held by Naomi Carrigan.
|
||||
## Credits
|
||||
|
||||
## Contact
|
||||
Created with 💖 by Naomi Carrigan
|
||||
|
||||
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`. -->
|
||||
✨ Minori was built with help from Hikari~ 🌸
|
||||
Reference in New Issue
Block a user