From e6a5ed03c16e01205fa311a62be5b203a8487511 Mon Sep 17 00:00:00 2001 From: darwincereska Date: Wed, 5 Nov 2025 21:15:30 -0500 Subject: [PATCH] feat(init): initial commit --- .gitignore | 30 +++++ CHECKLIST.md | 113 ++++++++++++++++++ LICENSE | 0 README.md | 21 ++++ build.gradle.kts | 25 ++++ gradle.properties | 2 + settings.gradle | 2 + src/main/kotlin/io/notevc/NoteVC.kt | 5 + .../kotlin/io/notevc/cli/CommandParser.kt | 1 + .../kotlin/io/notevc/cli/OutputFormatter.kt | 1 + .../io/notevc/commands/CommitCommand.kt | 1 + .../kotlin/io/notevc/commands/DiffCommand.kt | 1 + .../kotlin/io/notevc/commands/InitCommand.kt | 1 + .../kotlin/io/notevc/commands/LogCommand.kt | 1 + .../io/notevc/commands/RestoreCommand.kt | 1 + .../io/notevc/commands/StatusCommand.kt | 1 + .../kotlin/io/notevc/core/NoteSnapshot.kt | 1 + src/main/kotlin/io/notevc/core/ObjectStore.kt | 1 + src/main/kotlin/io/notevc/core/Repository.kt | 1 + src/main/kotlin/io/notevc/core/Timeline.kt | 1 + .../kotlin/io/notevc/storage/FileStorage.kt | 1 + .../io/notevc/storage/MetadataStorage.kt | 1 + src/main/kotlin/io/notevc/utils/FileUtils.kt | 1 + src/main/kotlin/io/notevc/utils/HashUtils.kt | 1 + src/main/kotlin/io/notevc/utils/TimeUtils.kt | 1 + 25 files changed, 215 insertions(+) create mode 100644 .gitignore create mode 100644 CHECKLIST.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.gradle.kts create mode 100644 gradle.properties create mode 100644 settings.gradle create mode 100644 src/main/kotlin/io/notevc/NoteVC.kt create mode 100644 src/main/kotlin/io/notevc/cli/CommandParser.kt create mode 100644 src/main/kotlin/io/notevc/cli/OutputFormatter.kt create mode 100644 src/main/kotlin/io/notevc/commands/CommitCommand.kt create mode 100644 src/main/kotlin/io/notevc/commands/DiffCommand.kt create mode 100644 src/main/kotlin/io/notevc/commands/InitCommand.kt create mode 100644 src/main/kotlin/io/notevc/commands/LogCommand.kt create mode 100644 src/main/kotlin/io/notevc/commands/RestoreCommand.kt create mode 100644 src/main/kotlin/io/notevc/commands/StatusCommand.kt create mode 100644 src/main/kotlin/io/notevc/core/NoteSnapshot.kt create mode 100644 src/main/kotlin/io/notevc/core/ObjectStore.kt create mode 100644 src/main/kotlin/io/notevc/core/Repository.kt create mode 100644 src/main/kotlin/io/notevc/core/Timeline.kt create mode 100644 src/main/kotlin/io/notevc/storage/FileStorage.kt create mode 100644 src/main/kotlin/io/notevc/storage/MetadataStorage.kt create mode 100644 src/main/kotlin/io/notevc/utils/FileUtils.kt create mode 100644 src/main/kotlin/io/notevc/utils/HashUtils.kt create mode 100644 src/main/kotlin/io/notevc/utils/TimeUtils.kt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0a28dde --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Gradle Files +.gradle/ +build/ +out/ +**/build/ +**/out/ +gradle-app.setting + +# Local configuration files +local.properties +*.iml + +# IDE files +.idea/ +*.ipr +*.iws +*.class +*.jar +*.war +*.ear + +# OS-Generated files +.DS_Store +Thumbs.db + +# Log files +*.log + +# Other +*.hprof diff --git a/CHECKLIST.md b/CHECKLIST.md new file mode 100644 index 0000000..b7bfca8 --- /dev/null +++ b/CHECKLIST.md @@ -0,0 +1,113 @@ +# Project Setup + +- [x] Initialize Project +- [x] Configure `build.gradle.kts` with dependencies +- [ ] Set up testing framework + +# Core + +- [ ] Create `Repository.kt` class +- [ ] Implement `.notevc` directory initialization +- [ ] Create `ObjectStore.kt` for content storage +- [ ] Implement content hashing `HashUtils.kt` +- [ ] Create `NoteSnapshot` data class +- [ ] Implement `Timeline.kt` for version tracking +- [ ] Add `RepoMetadata` and configuration + +# File Operations + +- [ ] Implement markdown file scanning +- [ ] Create file change detection logic +- [ ] Add file content reading/writing utilities +- [ ] Implement path resolution and validation +- [ ] Add file timestamp tracking +- [ ] Create backup and restore mechanisms + +# Core Commands + +## Init Command + +- [ ] `notevc init` - Initialize repository +- [ ] Create `.notevc` directory structure +- [ ] Generate initial metadata file +- [ ] Handle existing repository detection + +## Status Command + +- [ ] `notevc status` - Show file changes +- [ ] Compare current files with last snapshot +- [ ] Display added/modified/deleted files +- [ ] Show clean working directory message + +## Commit command + +- [ ] `notevc commit "message"` - Create snapshot +- [ ] Validate commit message exists +- [ ] Store changed file contents +- [ ] Create snapshot with metadata +- [ ] Update repository head pointer + +## Log Command + +- [ ] `notevc log` - Show commit history +- [ ] Display snapshots in reverse chronological order +- [ ] Show commit hashes, messages, and timestamps +- [ ] add `--since` time filtering option + +# Advanced Commands + +## Diff Command + +- [ ] `notevc diff` - Show current changes +- [ ] `notevc diff ` - Show changes for specific file +- [ ] `notevc diff ` - Compare with specific commit +- [ ] Implement basic text diffing algorithm + +## Restore Command + +- [ ] `notevc restore ` - Restore entire state +- [ ] `notevc restore ` - Restore specific file +- [ ] Add conformation prompts for destructive operations +- [ ] Handle file conflicts gracefully + +## Show Command + +- [ ] `notevc show ` - Display commit changes +- [ ] Show commit metadata and file changes +- [ ] Display file contents at specific commit + +# Utilities and Polish + +- [ ] Add colored output for better UX +- [ ] Implement proper error handling messages +- [ ] Add input validation for all commands +- [ ] Create help system (`notevc --help`) +- [ ] Add version information (`notevc --version`) +- [ ] Implement configuration file support + +# Testing + +- [ ] Write unit tests for `ObjectStore` +- [ ] Test `Repository` initialization and operations +- [ ] Add integration tests for CLI commands +- [ ] Test file change detection logic +- [ ] Add edge case testing (empty repos, corrupted data) +- [ ] Performance testing with large note collections + +# Build and Distribution + +- [ ] Create fat JAR for distribution +- [ ] Add shell script wrapper for easy execution +- [ ] Test on different operating systems +- [ ] Create installation scripts +- [ ] Add build automation (GitHub Actions) + +# Future Features + +- [ ] Compression for stored content +- [ ] Garbage collection for unused objects +- [ ] Branch-like functionality for different contexts +- [ ] Automatic backup scheduling +- [ ] File watching for auto-commits +- [ ] Export/import functionality +- [ ] NeoVim Plugin diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..b68f75e --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# NoteVC: Version Control for Markdown +# Repository management +notevc init [path] # Initialize notevc repo +notevc status # Show changed files +notevc commit "message" # Create snapshot +notevc log [--since=time] # Show commit history + +# Viewing changes +notevc diff [file] # Show changes since last commit +notevc diff HEAD~1 [file] # Compare with previous commit +notevc show # Show specific commit + +# Restoration +notevc restore [file] # Restore to specific version +notevc checkout # Restore entire repo state + +# Utilities +notevc clean # Remove old snapshots +notevc gc # Garbage collect unused objects +notevc config # Show/set configuration + diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..27859e7 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,25 @@ +plugins { + kotlin("jvm") version "2.2.21" + application +} + +group = "io.notevc" +version = "1.0.0" + +repositories { + mavenCentral() +} + +dependencies { + implementation(kotlin("stdlib")) +} + +application { + mainClass.set("io.notevc.NoteVCKt") +} + +tasks.jar { + manifest { + attributes["Main-Class"] = "io.notevc.NoteVCKt" + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..6f78d3f --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.caching=true +org.gradle.configuration-cache=true diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..b30df22 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = "NoteVC" +include("src") diff --git a/src/main/kotlin/io/notevc/NoteVC.kt b/src/main/kotlin/io/notevc/NoteVC.kt new file mode 100644 index 0000000..c5498f5 --- /dev/null +++ b/src/main/kotlin/io/notevc/NoteVC.kt @@ -0,0 +1,5 @@ +package io.notevc + +fun main() { + println("hello world") +} diff --git a/src/main/kotlin/io/notevc/cli/CommandParser.kt b/src/main/kotlin/io/notevc/cli/CommandParser.kt new file mode 100644 index 0000000..f6cf54d --- /dev/null +++ b/src/main/kotlin/io/notevc/cli/CommandParser.kt @@ -0,0 +1 @@ +package io.notevc.cli diff --git a/src/main/kotlin/io/notevc/cli/OutputFormatter.kt b/src/main/kotlin/io/notevc/cli/OutputFormatter.kt new file mode 100644 index 0000000..f6cf54d --- /dev/null +++ b/src/main/kotlin/io/notevc/cli/OutputFormatter.kt @@ -0,0 +1 @@ +package io.notevc.cli diff --git a/src/main/kotlin/io/notevc/commands/CommitCommand.kt b/src/main/kotlin/io/notevc/commands/CommitCommand.kt new file mode 100644 index 0000000..a1f7d85 --- /dev/null +++ b/src/main/kotlin/io/notevc/commands/CommitCommand.kt @@ -0,0 +1 @@ +package io.notevc.commands diff --git a/src/main/kotlin/io/notevc/commands/DiffCommand.kt b/src/main/kotlin/io/notevc/commands/DiffCommand.kt new file mode 100644 index 0000000..a1f7d85 --- /dev/null +++ b/src/main/kotlin/io/notevc/commands/DiffCommand.kt @@ -0,0 +1 @@ +package io.notevc.commands diff --git a/src/main/kotlin/io/notevc/commands/InitCommand.kt b/src/main/kotlin/io/notevc/commands/InitCommand.kt new file mode 100644 index 0000000..a1f7d85 --- /dev/null +++ b/src/main/kotlin/io/notevc/commands/InitCommand.kt @@ -0,0 +1 @@ +package io.notevc.commands diff --git a/src/main/kotlin/io/notevc/commands/LogCommand.kt b/src/main/kotlin/io/notevc/commands/LogCommand.kt new file mode 100644 index 0000000..a1f7d85 --- /dev/null +++ b/src/main/kotlin/io/notevc/commands/LogCommand.kt @@ -0,0 +1 @@ +package io.notevc.commands diff --git a/src/main/kotlin/io/notevc/commands/RestoreCommand.kt b/src/main/kotlin/io/notevc/commands/RestoreCommand.kt new file mode 100644 index 0000000..a1f7d85 --- /dev/null +++ b/src/main/kotlin/io/notevc/commands/RestoreCommand.kt @@ -0,0 +1 @@ +package io.notevc.commands diff --git a/src/main/kotlin/io/notevc/commands/StatusCommand.kt b/src/main/kotlin/io/notevc/commands/StatusCommand.kt new file mode 100644 index 0000000..a1f7d85 --- /dev/null +++ b/src/main/kotlin/io/notevc/commands/StatusCommand.kt @@ -0,0 +1 @@ +package io.notevc.commands diff --git a/src/main/kotlin/io/notevc/core/NoteSnapshot.kt b/src/main/kotlin/io/notevc/core/NoteSnapshot.kt new file mode 100644 index 0000000..06fd659 --- /dev/null +++ b/src/main/kotlin/io/notevc/core/NoteSnapshot.kt @@ -0,0 +1 @@ +package io.notevc.core diff --git a/src/main/kotlin/io/notevc/core/ObjectStore.kt b/src/main/kotlin/io/notevc/core/ObjectStore.kt new file mode 100644 index 0000000..06fd659 --- /dev/null +++ b/src/main/kotlin/io/notevc/core/ObjectStore.kt @@ -0,0 +1 @@ +package io.notevc.core diff --git a/src/main/kotlin/io/notevc/core/Repository.kt b/src/main/kotlin/io/notevc/core/Repository.kt new file mode 100644 index 0000000..06fd659 --- /dev/null +++ b/src/main/kotlin/io/notevc/core/Repository.kt @@ -0,0 +1 @@ +package io.notevc.core diff --git a/src/main/kotlin/io/notevc/core/Timeline.kt b/src/main/kotlin/io/notevc/core/Timeline.kt new file mode 100644 index 0000000..06fd659 --- /dev/null +++ b/src/main/kotlin/io/notevc/core/Timeline.kt @@ -0,0 +1 @@ +package io.notevc.core diff --git a/src/main/kotlin/io/notevc/storage/FileStorage.kt b/src/main/kotlin/io/notevc/storage/FileStorage.kt new file mode 100644 index 0000000..c8241f9 --- /dev/null +++ b/src/main/kotlin/io/notevc/storage/FileStorage.kt @@ -0,0 +1 @@ +package io.notevc.storage diff --git a/src/main/kotlin/io/notevc/storage/MetadataStorage.kt b/src/main/kotlin/io/notevc/storage/MetadataStorage.kt new file mode 100644 index 0000000..c8241f9 --- /dev/null +++ b/src/main/kotlin/io/notevc/storage/MetadataStorage.kt @@ -0,0 +1 @@ +package io.notevc.storage diff --git a/src/main/kotlin/io/notevc/utils/FileUtils.kt b/src/main/kotlin/io/notevc/utils/FileUtils.kt new file mode 100644 index 0000000..5675552 --- /dev/null +++ b/src/main/kotlin/io/notevc/utils/FileUtils.kt @@ -0,0 +1 @@ +package io.notevc.utils diff --git a/src/main/kotlin/io/notevc/utils/HashUtils.kt b/src/main/kotlin/io/notevc/utils/HashUtils.kt new file mode 100644 index 0000000..5675552 --- /dev/null +++ b/src/main/kotlin/io/notevc/utils/HashUtils.kt @@ -0,0 +1 @@ +package io.notevc.utils diff --git a/src/main/kotlin/io/notevc/utils/TimeUtils.kt b/src/main/kotlin/io/notevc/utils/TimeUtils.kt new file mode 100644 index 0000000..5675552 --- /dev/null +++ b/src/main/kotlin/io/notevc/utils/TimeUtils.kt @@ -0,0 +1 @@ +package io.notevc.utils