difflicious 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- difflicious-0.1.0/.dockerignore +61 -0
- difflicious-0.1.0/.github/workflows/ci.yml +62 -0
- difflicious-0.1.0/.github/workflows/docker-publish.yml +56 -0
- difflicious-0.1.0/.github/workflows/pypi-publish.yml +41 -0
- difflicious-0.1.0/.github/workflows/test.yml +50 -0
- difflicious-0.1.0/.gitignore +112 -0
- difflicious-0.1.0/AGENTS.md +33 -0
- difflicious-0.1.0/CHANGELOG.md +122 -0
- difflicious-0.1.0/CLAUDE.md +126 -0
- difflicious-0.1.0/CONTRIBUTING.md +378 -0
- difflicious-0.1.0/DEPLOYMENT.md +307 -0
- difflicious-0.1.0/Dockerfile +69 -0
- difflicious-0.1.0/LICENSE +21 -0
- difflicious-0.1.0/PKG-INFO +190 -0
- difflicious-0.1.0/PLAN.md +72 -0
- difflicious-0.1.0/README.md +154 -0
- difflicious-0.1.0/cilicious.sh +7 -0
- difflicious-0.1.0/docs/TROUBLESHOOTING.md +357 -0
- difflicious-0.1.0/docs/notes/2025-08-03-1009-claude-fixing-uncommon-off-by-one-error.md +66 -0
- difflicious-0.1.0/docs/notes/2025-08-19-1925-expandable-context.md +144 -0
- difflicious-0.1.0/docs/notes/2025-08-19-1925-troubleshooting-context-expansion-2025-07-29.md +107 -0
- difflicious-0.1.0/docs/plans/2025-07-29-1015-expandable-context-feature.md +75 -0
- difflicious-0.1.0/docs/prompts/2025-08-19-1934-phase-1-css-foundation-dark-theme.md +74 -0
- difflicious-0.1.0/docs/proposals/2025-07-29-1916-code-structure-refactoring-recommendations.md +187 -0
- difflicious-0.1.0/docs/proposals/2025-07-29-1917-extract-context-expansion-module.md +289 -0
- difflicious-0.1.0/docs/proposals/2025-07-29-1918-extract-business-logic-service-layer.md +584 -0
- difflicious-0.1.0/docs/proposals/2025-07-30-1701-jinja2-server-side-diff-rendering.md +1366 -0
- difflicious-0.1.0/docs/proposals/2025-07-30-1730-virtual-scrolling-lazy-rendering.md +1224 -0
- difflicious-0.1.0/docs/proposals/2025-08-03-2106-typescript-migration-plan.md +306 -0
- difflicious-0.1.0/docs/proposals/2025-08-04-2130-simplify-diff-logic-and-ui.md +70 -0
- difflicious-0.1.0/docs/proposals/2025-08-18-1954-font-configuration-proposal.md +156 -0
- difflicious-0.1.0/docs/proposals/2025-08-18-1954-font-implementation-plan.md +176 -0
- difflicious-0.1.0/docs/proposals/2025-08-18-1954-font-implementation-summary.md +122 -0
- difflicious-0.1.0/docs/proposals/2025-08-19-1430-dark-light-mode-implementation.md +389 -0
- difflicious-0.1.0/docs/reports/2025-01-28-test-coverage-improvement-summary.md +122 -0
- difflicious-0.1.0/docs/reports/2025-07-29-2100-context-expansion-extraction-report.md +134 -0
- difflicious-0.1.0/docs/reports/2025-07-30-1647-diff-rendering-performance-analysis.md +213 -0
- difflicious-0.1.0/docs/reports/2025-07-30-1655-backend-migration-performance-analysis.md +498 -0
- difflicious-0.1.0/docs/reports/2025-08-18-1200-dead-code-analysis-report.md +197 -0
- difflicious-0.1.0/docs/reports/2025-09-22-1857-production-readiness-analysis.md +286 -0
- difflicious-0.1.0/docs/reports/2025-09-22-1949-ui-css-cleanup-analysis.md +269 -0
- difflicious-0.1.0/docs/reports/2025-10-30-2201-production-readiness-update.md +408 -0
- difflicious-0.1.0/docs/reports/2025-10-31-1253-test-coverage-analysis.md +378 -0
- difflicious-0.1.0/docs/reports/2025-10-31-1720-0.9-release-plan.md +406 -0
- difflicious-0.1.0/docs/sessions/2025-07-27-1256-project-setup-and-modern-python-packaging.md +126 -0
- difflicious-0.1.0/docs/sessions/2025-07-27-1415-git-integration-and-security-implementation.md +163 -0
- difflicious-0.1.0/docs/sessions/2025-07-27-1820-diff-parser-and-side-by-side-ui.md +260 -0
- difflicious-0.1.0/docs/sessions/2025-07-28-0953-syntax-highlighting-implementation.md +211 -0
- difflicious-0.1.0/docs/sessions/2025-07-28-1500-commit-comparison-and-ui-enhancements.md +286 -0
- difflicious-0.1.0/docs/sessions/2025-07-28-1805-untracked-files-implementation-and-bugfix.md +147 -0
- difflicious-0.1.0/docs/sessions/2025-07-31-1730-pygments-syntax-highlighting.compacted.md +57 -0
- difflicious-0.1.0/package-lock.json +9245 -0
- difflicious-0.1.0/package.json +67 -0
- difflicious-0.1.0/parsed_diff_output.json +5282 -0
- difflicious-0.1.0/postcss.config.cjs +7 -0
- difflicious-0.1.0/pyproject.toml +102 -0
- difflicious-0.1.0/rendering_output_sample.json +666 -0
- difflicious-0.1.0/src/difflicious/__init__.py +6 -0
- difflicious-0.1.0/src/difflicious/app.py +505 -0
- difflicious-0.1.0/src/difflicious/cli.py +77 -0
- difflicious-0.1.0/src/difflicious/diff_parser.py +525 -0
- difflicious-0.1.0/src/difflicious/dummy_data.json +44 -0
- difflicious-0.1.0/src/difflicious/git_operations.py +1005 -0
- difflicious-0.1.0/src/difflicious/services/__init__.py +1 -0
- difflicious-0.1.0/src/difflicious/services/base_service.py +32 -0
- difflicious-0.1.0/src/difflicious/services/diff_service.py +403 -0
- difflicious-0.1.0/src/difflicious/services/exceptions.py +19 -0
- difflicious-0.1.0/src/difflicious/services/git_service.py +135 -0
- difflicious-0.1.0/src/difflicious/services/syntax_service.py +162 -0
- difflicious-0.1.0/src/difflicious/services/template_service.py +382 -0
- difflicious-0.1.0/src/difflicious/static/css/styles.css +885 -0
- difflicious-0.1.0/src/difflicious/static/css/tailwind.css +1 -0
- difflicious-0.1.0/src/difflicious/static/css/tailwind.input.css +5 -0
- difflicious-0.1.0/src/difflicious/static/js/app.js +1002 -0
- difflicious-0.1.0/src/difflicious/static/js/diff-interactions.js +1617 -0
- difflicious-0.1.0/src/difflicious/templates/base.html +54 -0
- difflicious-0.1.0/src/difflicious/templates/diff_file.html +90 -0
- difflicious-0.1.0/src/difflicious/templates/diff_groups.html +29 -0
- difflicious-0.1.0/src/difflicious/templates/diff_hunk.html +170 -0
- difflicious-0.1.0/src/difflicious/templates/index.html +54 -0
- difflicious-0.1.0/src/difflicious/templates/partials/empty_state.html +29 -0
- difflicious-0.1.0/src/difflicious/templates/partials/global_controls.html +23 -0
- difflicious-0.1.0/src/difflicious/templates/partials/loading_state.html +7 -0
- difflicious-0.1.0/src/difflicious/templates/partials/toolbar.html +165 -0
- difflicious-0.1.0/tailwind.config.cjs +132 -0
- difflicious-0.1.0/test_api.py +102 -0
- difflicious-0.1.0/test_api_detailed.py +81 -0
- difflicious-0.1.0/test_context.txt +6 -0
- difflicious-0.1.0/test_frontend.py +98 -0
- difflicious-0.1.0/test_parser.py +123 -0
- difflicious-0.1.0/test_rendering_parser.py +132 -0
- difflicious-0.1.0/test_side_by_side.py +90 -0
- difflicious-0.1.0/test_staging_bug.txt +1 -0
- difflicious-0.1.0/tests/__init__.py +1 -0
- difflicious-0.1.0/tests/js/diff-state-persistence.test.js +340 -0
- difflicious-0.1.0/tests/sample_01.diff +890 -0
- difflicious-0.1.0/tests/services/__init__.py +1 -0
- difflicious-0.1.0/tests/services/test_base_service.py +66 -0
- difflicious-0.1.0/tests/services/test_diff_service.py +427 -0
- difflicious-0.1.0/tests/services/test_exceptions.py +45 -0
- difflicious-0.1.0/tests/services/test_git_service.py +150 -0
- difflicious-0.1.0/tests/services/test_syntax_service.py +182 -0
- difflicious-0.1.0/tests/services/test_template_service.py +382 -0
- difflicious-0.1.0/tests/test_app.py +614 -0
- difflicious-0.1.0/tests/test_cli.py +108 -0
- difflicious-0.1.0/tests/test_git_operations.py +983 -0
- difflicious-0.1.0/uv.lock +1225 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Version control
|
|
2
|
+
.git/
|
|
3
|
+
.gitignore
|
|
4
|
+
|
|
5
|
+
# Python
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
*.so
|
|
10
|
+
.Python
|
|
11
|
+
*.egg-info/
|
|
12
|
+
dist/
|
|
13
|
+
build/
|
|
14
|
+
|
|
15
|
+
# Testing
|
|
16
|
+
tests/
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.coverage
|
|
19
|
+
htmlcov/
|
|
20
|
+
*.cover
|
|
21
|
+
.hypothesis/
|
|
22
|
+
|
|
23
|
+
# Documentation
|
|
24
|
+
docs/
|
|
25
|
+
*.md
|
|
26
|
+
!README.md
|
|
27
|
+
|
|
28
|
+
# Development files
|
|
29
|
+
.vscode/
|
|
30
|
+
.idea/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
*~
|
|
34
|
+
.DS_Store
|
|
35
|
+
|
|
36
|
+
# Node modules (if any)
|
|
37
|
+
node_modules/
|
|
38
|
+
package-lock.json
|
|
39
|
+
package.json
|
|
40
|
+
|
|
41
|
+
# Build artifacts
|
|
42
|
+
build/
|
|
43
|
+
dist/
|
|
44
|
+
*.egg
|
|
45
|
+
|
|
46
|
+
# Environment files
|
|
47
|
+
.env
|
|
48
|
+
.env.local
|
|
49
|
+
.venv/
|
|
50
|
+
venv/
|
|
51
|
+
|
|
52
|
+
# CI/CD
|
|
53
|
+
.github/
|
|
54
|
+
|
|
55
|
+
# Miscellaneous
|
|
56
|
+
*.log
|
|
57
|
+
*.tmp
|
|
58
|
+
parsed_diff_output.json
|
|
59
|
+
rendering_output_sample.json
|
|
60
|
+
test_*.py
|
|
61
|
+
test_*.txt
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
python-tests:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: [3.9]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
run: uv python install ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --all-extras --dev
|
|
29
|
+
|
|
30
|
+
- name: Run Python linting with ruff
|
|
31
|
+
run: uv run ruff check
|
|
32
|
+
|
|
33
|
+
- name: Run Python formatting check with black
|
|
34
|
+
run: uv run black --check .
|
|
35
|
+
|
|
36
|
+
- name: Run type checking with mypy
|
|
37
|
+
run: uv run mypy src/
|
|
38
|
+
|
|
39
|
+
- name: Run Python tests with pytest
|
|
40
|
+
run: uv run pytest
|
|
41
|
+
|
|
42
|
+
javascript-lint:
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- name: Set up Node.js
|
|
49
|
+
uses: actions/setup-node@v4
|
|
50
|
+
with:
|
|
51
|
+
node-version: '18'
|
|
52
|
+
cache: 'npm'
|
|
53
|
+
|
|
54
|
+
- name: Install JavaScript dependencies
|
|
55
|
+
run: npm install
|
|
56
|
+
|
|
57
|
+
- name: Run JavaScript linting with ESLint
|
|
58
|
+
run: npm run lint:js
|
|
59
|
+
|
|
60
|
+
- name: Run JavaScript tests with Jest (if available)
|
|
61
|
+
run: npm run test:js
|
|
62
|
+
continue-on-error: true # Allow this to fail if no tests exist yet
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Docker Build and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
REGISTRY: docker.io
|
|
11
|
+
IMAGE_NAME: ${{ github.repository }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build-and-push:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
packages: write
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout repository
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Docker Buildx
|
|
25
|
+
uses: docker/setup-buildx-action@v3
|
|
26
|
+
|
|
27
|
+
- name: Log in to Docker Hub
|
|
28
|
+
if: github.event_name != 'pull_request'
|
|
29
|
+
uses: docker/login-action@v3
|
|
30
|
+
with:
|
|
31
|
+
username: ${{ secrets.DOCKER_USERNAME }}
|
|
32
|
+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
33
|
+
|
|
34
|
+
- name: Extract metadata (tags, labels) for Docker
|
|
35
|
+
id: meta
|
|
36
|
+
uses: docker/metadata-action@v5
|
|
37
|
+
with:
|
|
38
|
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
39
|
+
tags: |
|
|
40
|
+
type=ref,event=branch
|
|
41
|
+
type=ref,event=pr
|
|
42
|
+
type=semver,pattern={{version}}
|
|
43
|
+
type=semver,pattern={{major}}.{{minor}}
|
|
44
|
+
type=semver,pattern={{major}}
|
|
45
|
+
type=raw,value=latest,enable={{is_default_branch}}
|
|
46
|
+
|
|
47
|
+
- name: Build and push Docker image
|
|
48
|
+
uses: docker/build-push-action@v5
|
|
49
|
+
with:
|
|
50
|
+
context: .
|
|
51
|
+
platforms: linux/amd64,linux/arm64
|
|
52
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
53
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
54
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
55
|
+
cache-from: type=gha
|
|
56
|
+
cache-to: type=gha,mode=max
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: PyPI Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v4
|
|
22
|
+
with:
|
|
23
|
+
version: "latest"
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.11"
|
|
29
|
+
|
|
30
|
+
- name: Install build dependencies
|
|
31
|
+
run: |
|
|
32
|
+
uv sync --group dev
|
|
33
|
+
|
|
34
|
+
- name: Build package
|
|
35
|
+
run: |
|
|
36
|
+
uv build
|
|
37
|
+
|
|
38
|
+
- name: Publish to PyPI
|
|
39
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
40
|
+
with:
|
|
41
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
uv sync
|
|
32
|
+
|
|
33
|
+
- name: Run linting
|
|
34
|
+
run: |
|
|
35
|
+
uv run ruff check
|
|
36
|
+
|
|
37
|
+
- name: Run type checking
|
|
38
|
+
run: |
|
|
39
|
+
uv run mypy src/ || true
|
|
40
|
+
|
|
41
|
+
- name: Run tests with coverage
|
|
42
|
+
run: |
|
|
43
|
+
uv run pytest --cov=src/difflicious --cov-report=xml --cov-report=term
|
|
44
|
+
|
|
45
|
+
- name: Upload coverage to Codecov
|
|
46
|
+
uses: codecov/codecov-action@v4
|
|
47
|
+
if: matrix.python-version == '3.11'
|
|
48
|
+
with:
|
|
49
|
+
file: ./coverage.xml
|
|
50
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
npm-debug.log*
|
|
4
|
+
yarn-debug.log*
|
|
5
|
+
yarn-error.log*
|
|
6
|
+
|
|
7
|
+
# Build outputs
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
*.tgz
|
|
11
|
+
*.tar.gz
|
|
12
|
+
|
|
13
|
+
# Environment variables
|
|
14
|
+
.env
|
|
15
|
+
.env.local
|
|
16
|
+
.env.development.local
|
|
17
|
+
.env.test.local
|
|
18
|
+
.env.production.local
|
|
19
|
+
|
|
20
|
+
# IDE and editor files
|
|
21
|
+
.vscode/
|
|
22
|
+
.idea/
|
|
23
|
+
*.swp
|
|
24
|
+
*.swo
|
|
25
|
+
*~
|
|
26
|
+
|
|
27
|
+
# OS generated files
|
|
28
|
+
.DS_Store
|
|
29
|
+
.DS_Store?
|
|
30
|
+
._*
|
|
31
|
+
.Spotlight-V100
|
|
32
|
+
.Trashes
|
|
33
|
+
ehthumbs.db
|
|
34
|
+
Thumbs.db
|
|
35
|
+
|
|
36
|
+
# Logs
|
|
37
|
+
logs/
|
|
38
|
+
*.log
|
|
39
|
+
|
|
40
|
+
# Runtime data
|
|
41
|
+
pids/
|
|
42
|
+
*.pid
|
|
43
|
+
*.seed
|
|
44
|
+
*.pid.lock
|
|
45
|
+
|
|
46
|
+
# Coverage directory used by tools like istanbul
|
|
47
|
+
coverage/
|
|
48
|
+
.nyc_output/
|
|
49
|
+
|
|
50
|
+
# Dependency directories
|
|
51
|
+
jspm_packages/
|
|
52
|
+
|
|
53
|
+
# Optional npm cache directory
|
|
54
|
+
.npm
|
|
55
|
+
|
|
56
|
+
# Optional REPL history
|
|
57
|
+
.node_repl_history
|
|
58
|
+
|
|
59
|
+
# Output of 'npm pack'
|
|
60
|
+
*.tgz
|
|
61
|
+
|
|
62
|
+
# Yarn Integrity file
|
|
63
|
+
.yarn-integrity
|
|
64
|
+
|
|
65
|
+
# dotenv environment variables file
|
|
66
|
+
.env
|
|
67
|
+
|
|
68
|
+
# next.js build output
|
|
69
|
+
.next
|
|
70
|
+
|
|
71
|
+
# Nuxt.js build output
|
|
72
|
+
.nuxt
|
|
73
|
+
|
|
74
|
+
# Gatsby files
|
|
75
|
+
.cache/
|
|
76
|
+
public
|
|
77
|
+
|
|
78
|
+
# Storybook build outputs
|
|
79
|
+
.out
|
|
80
|
+
.storybook-out
|
|
81
|
+
|
|
82
|
+
# Temporary folders
|
|
83
|
+
tmp/
|
|
84
|
+
temp/
|
|
85
|
+
|
|
86
|
+
# Python
|
|
87
|
+
__pycache__/
|
|
88
|
+
*.py[cod]
|
|
89
|
+
*$py.class
|
|
90
|
+
*.so
|
|
91
|
+
.Python
|
|
92
|
+
env/
|
|
93
|
+
venv/
|
|
94
|
+
ENV/
|
|
95
|
+
env.bak/
|
|
96
|
+
venv.bak/
|
|
97
|
+
|
|
98
|
+
# Jupyter Notebook
|
|
99
|
+
.ipynb_checkpoints
|
|
100
|
+
|
|
101
|
+
# pyenv
|
|
102
|
+
.python-version
|
|
103
|
+
|
|
104
|
+
# Rust
|
|
105
|
+
target/
|
|
106
|
+
Cargo.lock
|
|
107
|
+
|
|
108
|
+
# Go
|
|
109
|
+
vendor/
|
|
110
|
+
|
|
111
|
+
.coverage
|
|
112
|
+
vendor/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# AGENTS.md - Development Guide for Agentic Coding
|
|
2
|
+
|
|
3
|
+
## Build/Test Commands
|
|
4
|
+
- **Install dependencies**: `uv sync`
|
|
5
|
+
- **Run tests**: `uv run pytest`
|
|
6
|
+
- **Run single test**: `uv run pytest tests/test_app.py::test_index_route`
|
|
7
|
+
- **Run with coverage**: `uv run pytest --cov=src/difflicious`
|
|
8
|
+
- **Lint code**: `uv run ruff check`
|
|
9
|
+
- **Format code**: `uv run black .`
|
|
10
|
+
- **Type check**: `uv run mypy src/`
|
|
11
|
+
- **Run app**: `uv run difflicious`
|
|
12
|
+
|
|
13
|
+
## Docker Commands
|
|
14
|
+
- **Build image**: `docker build -t insipid/difflicious:latest .`
|
|
15
|
+
- **Build multi-platform**: `docker buildx build --platform linux/amd64,linux/arm64 -t insipid/difflicious:latest .`
|
|
16
|
+
- **Push to Docker Hub**: `docker push insipid/difflicious:latest`
|
|
17
|
+
- **Tag version**: `git tag v0.9.0 && git push origin v0.9.0` (triggers automated build/push)
|
|
18
|
+
|
|
19
|
+
## Code Style Guidelines
|
|
20
|
+
- **Line length**: 88 characters (Black/Ruff configured)
|
|
21
|
+
- **Imports**: Use absolute imports, group stdlib/third-party/local with blank lines
|
|
22
|
+
- **Type hints**: Required for all function definitions (`disallow_untyped_defs = true`)
|
|
23
|
+
- **Docstrings**: Use triple quotes with Args/Returns sections for public functions
|
|
24
|
+
- **Naming**: snake_case for functions/variables, PascalCase for classes
|
|
25
|
+
- **Error handling**: Use custom exceptions (GitOperationError, DiffParseError) with descriptive messages
|
|
26
|
+
- **Security**: All subprocess calls must use proper sanitization (see git_operations.py)
|
|
27
|
+
- **File endings**: All text files must end with carriage return
|
|
28
|
+
|
|
29
|
+
## Testing Patterns
|
|
30
|
+
- Use pytest fixtures for app/client setup
|
|
31
|
+
- Test classes for grouping related functionality (e.g., TestAPIDiffCommitComparison)
|
|
32
|
+
- Assert response status codes and JSON structure for API endpoints
|
|
33
|
+
- Mock external dependencies, test error handling paths
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to difflicious will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.9.0] - 2025-10-31
|
|
9
|
+
|
|
10
|
+
### Infrastructure & Deployment
|
|
11
|
+
|
|
12
|
+
#### Docker & Containerization
|
|
13
|
+
- **Multi-stage Dockerfile** with Alpine Linux for minimal image size
|
|
14
|
+
- **.dockerignore** for optimized build context
|
|
15
|
+
- **Multi-platform support** for AMD64 and ARM64 architectures
|
|
16
|
+
- **Security hardening** with non-root user execution
|
|
17
|
+
- **Health checks** for container monitoring
|
|
18
|
+
- **Proper environment configuration** for local usage
|
|
19
|
+
|
|
20
|
+
#### CI/CD Pipeline
|
|
21
|
+
- **GitHub Actions workflows** for automated testing and deployment
|
|
22
|
+
- **Multi-version testing** across Python 3.9, 3.10, 3.11, and 3.12
|
|
23
|
+
- **Automated linting** with Ruff for Python code quality
|
|
24
|
+
- **Automated type checking** with MyPy
|
|
25
|
+
- **Code coverage reporting** with Codecov integration
|
|
26
|
+
- **JavaScript linting** with ESLint
|
|
27
|
+
- **Automated Docker publishing** to Docker Hub on version tags
|
|
28
|
+
- **Automated PyPI publishing** with trusted publishing
|
|
29
|
+
- **Build caching** for faster CI/CD runs
|
|
30
|
+
|
|
31
|
+
#### Testing Infrastructure
|
|
32
|
+
- **Comprehensive test suite** with 169 passing tests
|
|
33
|
+
- **86% test coverage** across all modules
|
|
34
|
+
- **Integration tests** for critical workflows
|
|
35
|
+
- **Security tests** for git command sanitization
|
|
36
|
+
- **Automated test execution** on every commit and PR
|
|
37
|
+
- **Quality metrics** tracking and reporting
|
|
38
|
+
|
|
39
|
+
#### Code Quality Automation
|
|
40
|
+
- **Automated linting** with Ruff
|
|
41
|
+
- **Automated formatting** with Black
|
|
42
|
+
- **Automated type checking** with MyPy
|
|
43
|
+
- **Automated quality checks** in CI pipeline
|
|
44
|
+
- **Consistent code style** across the project
|
|
45
|
+
|
|
46
|
+
### Build & Packaging
|
|
47
|
+
- **Modern Python packaging** with pyproject.toml
|
|
48
|
+
- **uv package management** for fast dependency resolution
|
|
49
|
+
- **Standalone builds** with PyInstaller support
|
|
50
|
+
- **CLI interface** with Click framework
|
|
51
|
+
- **Version management** with dynamic versioning
|
|
52
|
+
|
|
53
|
+
### Documentation
|
|
54
|
+
- **Installation guide** with Docker and local installation instructions
|
|
55
|
+
- **Troubleshooting guide** for common issues and solutions
|
|
56
|
+
- **Contributing guidelines** for developers
|
|
57
|
+
- **Changelog** for version history tracking
|
|
58
|
+
- **Updated README** with current features and setup
|
|
59
|
+
|
|
60
|
+
## [0.8.0] - Previous Versions
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
- **Side-by-side diff visualization** with professional interface
|
|
64
|
+
- **Syntax highlighting** with Pygments for 30+ languages
|
|
65
|
+
- **Intelligent diff parsing** with proper line alignment
|
|
66
|
+
- **Interactive UI** with search, filtering, and expand/collapse
|
|
67
|
+
- **Git integration** with status, diff, and branch detection
|
|
68
|
+
- **Font customization** with 6 programming fonts
|
|
69
|
+
- **Dark/Light mode** support
|
|
70
|
+
- **Context expansion** for viewing more code around hunks
|
|
71
|
+
- **Rename detection** for moved files
|
|
72
|
+
|
|
73
|
+
### Infrastructure
|
|
74
|
+
- **Flask backend** for minimal setup and git integration
|
|
75
|
+
- **Alpine.js frontend** for lightweight, declarative UI
|
|
76
|
+
- **Service layer architecture** with clean separation of concerns
|
|
77
|
+
- **Error handling** with proper exception hierarchy
|
|
78
|
+
- **Security** with subprocess sanitization for git commands
|
|
79
|
+
|
|
80
|
+
## Version History
|
|
81
|
+
|
|
82
|
+
- **0.9.0** (2025-10-31): Infrastructure milestone with Docker, CI/CD, and deployment automation
|
|
83
|
+
- **0.8.0** and earlier: Core features and functionality
|
|
84
|
+
|
|
85
|
+
## Future Releases
|
|
86
|
+
|
|
87
|
+
### Planned for 1.0
|
|
88
|
+
- Final UI/UX polish and improvements
|
|
89
|
+
- Performance optimizations
|
|
90
|
+
- Accessibility enhancements
|
|
91
|
+
- Browser compatibility improvements
|
|
92
|
+
- User feedback incorporation
|
|
93
|
+
|
|
94
|
+
### Under Consideration
|
|
95
|
+
- Real-time updates with Server-Sent Events
|
|
96
|
+
- Advanced search and filtering
|
|
97
|
+
- Keyboard shortcuts
|
|
98
|
+
- Plugin system
|
|
99
|
+
- Export options
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Release Notes
|
|
104
|
+
|
|
105
|
+
### 0.9.0 - Infrastructure Release
|
|
106
|
+
|
|
107
|
+
The 0.9 release marks a significant milestone for difflicious, establishing the development and operational infrastructure needed for reliable releases. This release focuses entirely on infrastructure, automation, and packaging tooling, laying the foundation for the 1.0 feature release.
|
|
108
|
+
|
|
109
|
+
**Key Achievements:**
|
|
110
|
+
- ✅ Complete CI/CD pipeline with GitHub Actions
|
|
111
|
+
- ✅ Docker images for easy local installation
|
|
112
|
+
- ✅ Automated testing across multiple Python versions
|
|
113
|
+
- ✅ 86% test coverage with 169 passing tests
|
|
114
|
+
- ✅ Automated quality checks and code coverage reporting
|
|
115
|
+
- ✅ Docker Hub and PyPI publishing automation
|
|
116
|
+
|
|
117
|
+
**What's Next:**
|
|
118
|
+
Version 1.0 will focus on final features, polish, and user experience improvements based on real-world usage feedback from the 0.9 release.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
*For detailed information about changes in each version, see the git commit history.*
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Difflicious is a lightweight web-based git diff visualization tool built with Flask backend and Alpine.js frontend. It provides developers with an elegant interface for viewing git changes while working on branches locally.
|
|
8
|
+
|
|
9
|
+
## Architecture
|
|
10
|
+
|
|
11
|
+
**Technology Stack:**
|
|
12
|
+
- Backend: Python Flask with service layer architecture for business logic separation
|
|
13
|
+
- Services: Dedicated service classes (DiffService, GitService) with secure subprocess calls
|
|
14
|
+
- Frontend: Alpine.js (~15KB) + vanilla CSS with Grid/Flexbox
|
|
15
|
+
- Real-time: Server-Sent Events (SSE) for live git status monitoring
|
|
16
|
+
- Security: Proper subprocess sanitization for git command execution
|
|
17
|
+
|
|
18
|
+
**Service Layer Architecture:**
|
|
19
|
+
- `BaseService`: Common functionality and lazy-loaded git repository access
|
|
20
|
+
- `DiffService`: Business logic for diff processing and rendering
|
|
21
|
+
- `GitService`: Git repository operations (status, branches, file access)
|
|
22
|
+
- Service exceptions: `DiffServiceError`, `GitServiceError` for proper error handling
|
|
23
|
+
- Clear separation between HTTP concerns (Flask routes) and business logic
|
|
24
|
+
|
|
25
|
+
**Distribution Strategy:**
|
|
26
|
+
1. PyPI package (primary) - `pip install difflicious`
|
|
27
|
+
2. Docker image (secondary) - containerized deployment
|
|
28
|
+
3. Source installation (development fallback)
|
|
29
|
+
|
|
30
|
+
## Development Commands
|
|
31
|
+
|
|
32
|
+
This project uses `uv` for fast Python package management and development environments.
|
|
33
|
+
|
|
34
|
+
**Project Setup:**
|
|
35
|
+
```bash
|
|
36
|
+
# Install uv if not already installed
|
|
37
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
38
|
+
|
|
39
|
+
# Create virtual environment and install dependencies
|
|
40
|
+
uv sync
|
|
41
|
+
|
|
42
|
+
# Run in development mode
|
|
43
|
+
uv run difflicious
|
|
44
|
+
|
|
45
|
+
# Access at localhost:5000
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Development Commands:**
|
|
49
|
+
```bash
|
|
50
|
+
# Add new dependencies
|
|
51
|
+
uv add package-name
|
|
52
|
+
|
|
53
|
+
# Add development dependencies
|
|
54
|
+
uv add --dev pytest ruff black
|
|
55
|
+
|
|
56
|
+
# Run tests (comprehensive test suite available)
|
|
57
|
+
uv run pytest
|
|
58
|
+
|
|
59
|
+
# Run linting/formatting
|
|
60
|
+
uv run ruff check
|
|
61
|
+
uv run black .
|
|
62
|
+
|
|
63
|
+
# Build package
|
|
64
|
+
uv build
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Docker Development:**
|
|
68
|
+
- Multi-stage builds using uv for optimized container images
|
|
69
|
+
- Base images will use uv for dependency installation
|
|
70
|
+
|
|
71
|
+
## Current Development Status
|
|
72
|
+
|
|
73
|
+
**Phase 1 - Project Setup & Core Backend (COMPLETED):**
|
|
74
|
+
1. ✅ Set up modern Python project structure with pyproject.toml and uv
|
|
75
|
+
2. ✅ Create Flask backend with proper uv-based packaging
|
|
76
|
+
3. ✅ Implement git command execution wrapper with security
|
|
77
|
+
4. ✅ Create basic HTML template with Alpine.js integration
|
|
78
|
+
5. ✅ Build JSON API endpoints for git status and diff data
|
|
79
|
+
6. 🚧 Create Dockerfile using uv for containerized deployment
|
|
80
|
+
|
|
81
|
+
**Implementation Completed:**
|
|
82
|
+
- ✅ Git command wrapper: Secure subprocess sanitization with comprehensive security validation
|
|
83
|
+
- ✅ Flask backend: Complete API with `/api/status` and `/api/diff` endpoints
|
|
84
|
+
- ✅ Service Layer: Business logic extracted to DiffService and GitService with 100% test coverage
|
|
85
|
+
- ✅ Frontend: Alpine.js reactive interface with search, filtering, and diff visualization
|
|
86
|
+
- ✅ Security: All git commands properly sanitized, injection prevention, path validation
|
|
87
|
+
- ✅ Testing: Comprehensive test suite including dedicated service layer tests
|
|
88
|
+
|
|
89
|
+
## Core Features Status
|
|
90
|
+
|
|
91
|
+
- ✅ **Advanced Diff Parsing**: Complete git diff parser with side-by-side structure generation
|
|
92
|
+
- ✅ **Side-by-Side Visualization**: Professional-grade diff interface with line numbering and color coding
|
|
93
|
+
- ✅ **Syntax Highlighting**: Beautiful code highlighting for 30+ languages using Highlight.js
|
|
94
|
+
- ✅ **Smart UI Controls**: Expand/collapse all buttons with intelligent disabled states
|
|
95
|
+
- ✅ **Clean File Paths**: Automatic removal of git diff artifacts (a/, b/ prefixes)
|
|
96
|
+
- ✅ **Interactive Controls**: Toggle visibility, search/filter capabilities implemented
|
|
97
|
+
- ✅ **Git Integration**: Live git status and structured diff data from real repositories
|
|
98
|
+
- ✅ **Service Architecture**: Clean separation of concerns with testable business logic
|
|
99
|
+
- ✅ **Command-line Interface**: Full CLI with host, port, debug options
|
|
100
|
+
- ✅ **Modern UI**: Tailwind CSS styling with responsive design
|
|
101
|
+
- 🚧 **Real-time Updates**: Server-Sent Events implementation planned
|
|
102
|
+
- 🚧 **Word-level Diffs**: Advanced word-diff parsing (available in separate branch)
|
|
103
|
+
|
|
104
|
+
## Security Requirements (IMPLEMENTED)
|
|
105
|
+
|
|
106
|
+
- ✅ All git command execution uses proper subprocess sanitization
|
|
107
|
+
- ✅ Command injection prevention with argument validation and character filtering
|
|
108
|
+
- ✅ Safe git option validation with whitelist-based approach
|
|
109
|
+
- ✅ File path validation to prevent directory traversal attacks
|
|
110
|
+
- ✅ Timeout protection for git commands to prevent resource exhaustion
|
|
111
|
+
- ✅ No exposure of sensitive git repository information
|
|
112
|
+
- ✅ Local-only operation (no external network calls for core functionality)
|
|
113
|
+
|
|
114
|
+
## Code Quality Requirements
|
|
115
|
+
|
|
116
|
+
- **File Formatting**: ALL TEXT FILES SHOULD END WITH A CARRIAGE RETURN
|
|
117
|
+
- **Documentation Sync**: Any changes to architecture/infrastructure must update PLAN.md, README.md, and CLAUDE.md to keep them in sync
|
|
118
|
+
- **Package Management**: Use `uv` for all Python dependency management and virtual environments
|
|
119
|
+
- **Security**: All git command execution must use proper subprocess sanitization
|
|
120
|
+
|
|
121
|
+
## Deployment Targets
|
|
122
|
+
|
|
123
|
+
The application is designed for multiple distribution channels:
|
|
124
|
+
- PyPI package for easy `pip install` (built with uv)
|
|
125
|
+
- Docker containers using uv for consistent, fast dependency installation
|
|
126
|
+
- Source installation with uv for development and customization
|