Complete Phase 1 foundation: Tasks 1.1 and 1.2

 Task 1.1 - Project Foundation Setup:
- Repository structure with Python packaging (setup.py, pyproject.toml)
- Development dependencies and requirements
- Contributing guidelines and MIT license
- GitHub workflows for CI/CD (test.yml, release.yml)
- Issue and PR templates for community contributions
- Comprehensive project documentation

 Task 1.2 - Core Client Structure:
- wikijs package with proper module organization
- Core client class foundation in client.py
- Exception hierarchy for error handling
- Base model classes and page models
- Type checking support (py.typed)
- Utility modules and helper functions

📊 Progress: Phase 1 MVP Development now 40% complete
🎯 Next: Task 1.3 - Authentication System implementation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-07-29 13:25:36 -04:00
parent 3554d7d69c
commit 11b6be87c8
31 changed files with 3805 additions and 115 deletions

49
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,49 @@
---
name: Bug Report
about: Create a report to help us improve
title: '[BUG] '
labels: ['bug']
assignees: ''
---
## Bug Description
A clear and concise description of what the bug is.
## Steps to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
## Expected Behavior
A clear and concise description of what you expected to happen.
## Actual Behavior
A clear and concise description of what actually happened.
## Code Example
If applicable, add code snippets to help explain your problem.
```python
# Your code here
```
## Environment
- **SDK Version**: [e.g. 0.1.0]
- **Python Version**: [e.g. 3.11.0]
- **Operating System**: [e.g. Ubuntu 22.04]
- **Wiki.js Version**: [e.g. 2.5.300]
## Error Messages
If applicable, add any error messages or stack traces.
```
Paste error messages here
```
## Additional Context
Add any other context about the problem here.
## Possible Solution
If you have suggestions on how to fix the bug, please describe them here.

View File

@@ -0,0 +1,59 @@
---
name: Feature Request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: ['enhancement']
assignees: ''
---
## Feature Summary
A clear and concise description of the feature you'd like to request.
## Problem Statement
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
## Proposed Solution
Describe the solution you'd like.
A clear and concise description of what you want to happen.
## Use Case
Describe your use case for this feature.
- Who would benefit from this feature?
- What problem does it solve?
- How would you use it?
## API Design (if applicable)
If you have ideas about how the API should look, include them here.
```python
# Example of how you envision using this feature
client = WikiJSClient(...)
result = client.new_feature.do_something()
```
## Alternatives Considered
Describe alternatives you've considered.
A clear and concise description of any alternative solutions or features you've considered.
## Implementation Notes
If you have ideas about implementation, include them here.
- Are there any technical challenges?
- Dependencies that might be needed?
- Breaking changes required?
## Additional Context
Add any other context, screenshots, or examples about the feature request here.
## Priority
How important is this feature to you?
- [ ] Nice to have
- [ ] Important for my use case
- [ ] Critical for my use case
## Contribution
Are you willing to contribute to implementing this feature?
- [ ] Yes, I can implement this
- [ ] Yes, but I need guidance
- [ ] No, but I can help with testing
- [ ] No, I just want to request it

66
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,66 @@
# Pull Request
## Description
Brief description of what this PR does and why.
## Type of Change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)
- [ ] Test improvements
## Related Issues
Closes #(issue_number)
Relates to #(issue_number)
## Changes Made
-
-
-
## Testing
- [ ] Tests pass locally
- [ ] Added tests for new functionality
- [ ] Updated existing tests
- [ ] Manual testing completed
Describe any testing you performed:
## Documentation
- [ ] Updated docstrings
- [ ] Updated README if needed
- [ ] Updated API documentation
- [ ] Added/updated examples
## Code Quality
- [ ] Code follows the style guidelines
- [ ] Self-review of the code completed
- [ ] Code is commented where necessary
- [ ] No new warnings introduced
## Breaking Changes
If this introduces breaking changes, please describe them and provide migration guidance:
## Screenshots/Examples
If applicable, add screenshots or code examples to help explain your changes.
```python
# Example usage
```
## Additional Notes
Any additional information that reviewers should know.
---
## Reviewer Checklist
- [ ] Code follows project style guidelines
- [ ] Changes are well documented
- [ ] Tests are adequate and pass
- [ ] No obvious bugs or performance issues
- [ ] Breaking changes are properly documented

66
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run tests
run: pytest tests/ -v --cov=wikijs --cov-fail-under=85
- name: Run security scan
run: bandit -r wikijs
release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

111
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,111 @@
name: Test Suite
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Lint with flake8
run: flake8 wikijs tests
- name: Format check with black
run: black --check wikijs tests
- name: Import sort check
run: isort --check-only wikijs tests
- name: Type check with mypy
run: mypy wikijs
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run unit tests
run: pytest tests/ -v --cov=wikijs --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run security scan with bandit
run: bandit -r wikijs -f json -o bandit-report.json || true
- name: Upload bandit report
uses: actions/upload-artifact@v3
with:
name: bandit-report
path: bandit-report.json
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check dist/*