Skip to content

Commit

Permalink
chore: deprecate mookme in favor of Gookme
Browse files Browse the repository at this point in the history
LMaxence committed Dec 23, 2024
1 parent 53c045e commit c9cfe37
Showing 2 changed files with 127 additions and 0 deletions.
123 changes: 123 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Migration Guide: From Mookme to Gookme

Mookme has been officially discontinued and replaced by Gookme, a Golang-based CLI for managing Git hooks. This guide will help you transition smoothly from Mookme to Gookme.

## Why the Change?

- Simpler Installation: No dependency on package.json or npm. Gookme is a binary executable.
- Better Cross-Platform Support: Gookme works seamlessly on Windows, macOS, and Linux.
- Future Development: Gookme will continue to receive updates and new features, unlike Mookme.

## Key Differences

| Feature | Mookme | Gookme
|---------|--------|--------|
| Installation | Requires Node.js and npm | Prebuilt binary, no dependencies
| Hook Scripts | Written in any language but tied to JS or Python | Language-agnostic and independent
| Platforms | Linux, macOS (Windows support tricky) | Full cross-platform support

## Installation of Gookme

### 1. Download Gookme

See [the Gookme documentation](https://lmaxence.github.io/gookme/getting-started/)

### 2. Verify Installation

```bash
gookme --version
```

You should see the installed version.

## Global configuration

Gookme uses a global configuration file to store settings. You can create this file by running:

```bash
touch ~/.gookme.json
```

- The `addedBehavior` parameter has been renamed `onModifiedFiles`
- The `noClearRenderer` parameter has been removed

## Updating Hooks

Gookme handles hooks similarly to Mookme but hook files are lightly different. This will allow you to have concurrent installations of Mookme and Gookme, and progressively migrate your hooks to Gookme.

## Step 1: Remove Mookme Hooks

Run the following to clean up existing hooks:

```bash
#!/bin/bash

# Check if the .git/hooks directory exists
if [ ! -d ".git/hooks" ]; then
echo "Error: .git/hooks directory not found!"
exit 1
fi

# Iterate over all files in the .git/hooks directory
for file in .git/hooks/*; do
# Check if the file is a regular file (not a directory or special file)
if [ -f "$file" ]; then
# Use sed to remove lines starting with 'npx mookme run'
sed -i '/^npx mookme run/d' "$file"
echo "Processed $file"
fi
done

echo "All lines starting with 'npx mookme run' have been removed from .git/hooks files."
```

## Step 2: Install Gookme Hooks

Run the following to install Gookme-managed hooks:

```bash
gookme init -t pre-commit,commit-msg # Add any other hooks you need
```

## Step 3: Migrate Hook Scripts

- Using Gookme, hooks are not stored in `.hooks` folders but in `hooks` folders.

```bash
mv /path/to/.hooks /path/to/hooks
```

- Gookme hooks format is slightly different.

However, Gookme will provide a JSON schema for you to check in a code editor if the hook is valid.

The following is the `pre-commit.hook.json` hook file of Gookme:

```json
{
"$schema": "https://raw.githubusercontent.com/LMaxence/gookme/refs/heads/main/assets/schemas/hooks.schema.json",
"steps": [
{
"name": "Check format",
"command": "./scripts/check-format.sh",
"onlyOn": "*.go"
},
{
"name": "Code quality",
"command": "golangci-lint run ./...",
"onlyOn": "*.go"
},
{
"name": "Assets generation",
"command": "make assets"
}
]
}
```

## Further Support

If you encounter issues or have questions:

- Visit the [Gookme Documentation](https://lmaxence.github.io/gookme).
- Open an issue in the [Gookme GitHub Repository](https://github.com/LMaxence/gookme/issues).
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@
- **[see the documentation](https://mookme.org)**
- **[see the *beta* documentation](https://beta.mookme.org)**

## Notice: Mookme is deprecated

As of December 23rd 2024, Mookme has been officially discontinued in favor of [Gookme](https://github.com/LMaxence/gookme), a Golang CLI with a binary executable offering the same functionality. Mookme will no longer receive updates or support. Please refer to the [migration guide](MIGRATION.md) for more information.

<img src="assets/banner.png" alt="demo" width="600"/>

## What you will find on this repository

0 comments on commit c9cfe37

Please sign in to comment.