Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
test:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Hemlock
run: |
# Clone and build Hemlock
git clone https://github.com/hemlang/hemlock.git /tmp/hemlock
cd /tmp/hemlock
make
sudo make install

- name: Verify Hemlock installation
run: hemlock --version

- name: Run tests
run: make test

- name: Create hpm wrapper
run: make all

- name: Test hpm --help
run: ./hpm --help

- name: Test hpm --version
run: ./hpm --version

lint:
name: Lint Check
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for trailing whitespace
run: |
if grep -r --include="*.hml" '[[:space:]]$' src/ test/; then
echo "Found trailing whitespace in .hml files"
exit 1
fi
echo "No trailing whitespace found"

- name: Check for TODO comments
run: |
echo "Checking for TODO comments..."
grep -r --include="*.hml" "TODO" src/ || echo "No TODO comments found"
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2024-XX-XX

### Added

- **SHA256 Integrity Verification**: All downloaded packages are now verified using SHA256 hashes
- Hash is computed after download and stored in `package-lock.json`
- On subsequent installs, cached packages are verified against stored hash
- Use `--skip-integrity` flag to bypass verification if needed
- Integrity mismatches trigger automatic re-download

- **Enhanced `hpm init` Command**:
- Auto-detects git remote and sets repository field
- Supports command-line flags for non-interactive use:
- `--name=owner/repo`
- `--version=1.0.0`
- `--description=...`
- `--author=...`
- `--license=...`
- `--main=...`
- Shows helpful tips when not using `--yes` flag

- **Progress Indicators**:
- Shows `[1/N]` progress during package installation
- Displays timing summary: "Installed X package(s) in Y seconds"

- **Improved Error Messages**:
- Better formatted error output with suggestions
- Added `--debug` flag for detailed debugging information
- Network errors now show troubleshooting tips

- **Integration Tests**:
- Added `test_resolver.hml` with cycle detection and tree building tests
- Added `test_installer.hml` with uninstall and verification tests
- Updated test runner and Makefile with new test targets

- **GitHub Actions CI/CD**:
- Added `.github/workflows/ci.yml`
- Runs tests on push/PR to main branch
- Includes lint checks for trailing whitespace

### Changed

- Version updated to 1.1.0 (synchronized in package.json and main.hml)
- `install_package` now accepts expected integrity parameter for verification
- `install_all` now shows progress for each package being installed

### Fixed

- Version number consistency between package.json and src/main.hml

## [1.0.2] - Previous Release

- Initial stable release
- Core package management (install, update, uninstall)
- Dependency resolution with conflict detection
- Circular dependency detection
- GitHub API integration with retry logic
- Global package cache
- Offline mode support
- Lockfile management
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ test-lockfile:
test-cache:
$(HEMLOCK) -e 'import * as t from "./test/test_cache.hml"; import { summary } from "./test/framework.hml"; t.run(); summary();'

test-resolver:
$(HEMLOCK) -e 'import * as t from "./test/test_resolver.hml"; import { summary } from "./test/framework.hml"; t.run(); summary();'

test-installer:
$(HEMLOCK) -e 'import * as t from "./test/test_installer.hml"; import { summary } from "./test/framework.hml"; t.run(); summary();'

# Show help
help:
@echo "hpm Makefile targets:"
Expand All @@ -79,10 +85,12 @@ help:
@echo " test-manifest - Run only manifest tests"
@echo " test-lockfile - Run only lockfile tests"
@echo " test-cache - Run only cache tests"
@echo " test-resolver - Run only resolver tests"
@echo " test-installer - Run only installer tests"
@echo " help - Show this help"
@echo ""
@echo "Variables:"
@echo " PREFIX - Installation prefix (default: /usr/local)"
@echo " HEMLOCK - Hemlock interpreter (default: hemlock)"

.PHONY: all hpm build test install install-bundle uninstall clean help test-semver test-manifest test-lockfile test-cache
.PHONY: all hpm build test install install-bundle uninstall clean help test-semver test-manifest test-lockfile test-cache test-resolver test-installer
Loading
Loading