Skip to content

Commit a037329

Browse files
committed
First commit of the project
0 parents  commit a037329

29 files changed

+6076
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Environment (please complete the following information):**
27+
- OS: [e.g. Windows 11, Ubuntu 20.04]
28+
- PHP Version: [e.g. 8.1.0]
29+
- Web Server: [e.g. Apache 2.4, Nginx 1.18]
30+
- Browser: [e.g. Chrome 96, Firefox 95]
31+
32+
**Project Structure Viewer Version**
33+
- Version: [e.g. 1.0.0]
34+
- Installation method: [e.g. Composer, Manual]
35+
36+
**Additional context**
37+
Add any other context about the problem here.
38+
39+
**Error Messages**
40+
If applicable, paste any error messages or logs here:
41+
```
42+
[Paste error messages here]
43+
```
44+
45+
**Code Sample**
46+
If applicable, provide a minimal code sample that reproduces the issue:
47+
```php
48+
<?php
49+
// Your code here
50+
```
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Use Case**
20+
Describe the specific use case or scenario where this feature would be helpful.
21+
22+
**Implementation Ideas**
23+
If you have ideas about how this could be implemented, please share them here.
24+
25+
**Priority**
26+
How important is this feature to you?
27+
- [ ] Low - Nice to have
28+
- [ ] Medium - Would be helpful
29+
- [ ] High - Critical for my use case
30+
31+
**Additional context**
32+
Add any other context, screenshots, or examples about the feature request here.
33+
34+
**Mockups/Examples**
35+
If applicable, add mockups, examples, or references to similar implementations in other tools.

.github/pull_request_template.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Pull Request
2+
3+
## Description
4+
Brief description of the changes in this PR.
5+
6+
## Type of Change
7+
Please delete options that are not relevant.
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
- [ ] Performance improvement
14+
- [ ] Code refactoring
15+
- [ ] Test improvements
16+
17+
## Changes Made
18+
- List the specific changes made
19+
- Use bullet points for clarity
20+
- Include any new files created or deleted
21+
22+
## Testing
23+
- [ ] I have tested these changes locally
24+
- [ ] I have added tests that prove my fix is effective or that my feature works
25+
- [ ] New and existing unit tests pass locally with my changes
26+
- [ ] I have tested the web interface functionality
27+
28+
## Screenshots (if applicable)
29+
Add screenshots to help explain your changes.
30+
31+
## Checklist
32+
- [ ] My code follows the project's coding standards
33+
- [ ] I have performed a self-review of my own code
34+
- [ ] I have commented my code, particularly in hard-to-understand areas
35+
- [ ] I have made corresponding changes to the documentation
36+
- [ ] My changes generate no new warnings
37+
- [ ] I have added tests that prove my fix is effective or that my feature works
38+
- [ ] New and existing unit tests pass locally with my changes
39+
40+
## Related Issues
41+
Fixes #(issue number)
42+
Closes #(issue number)
43+
Related to #(issue number)
44+
45+
## Additional Notes
46+
Any additional information that reviewers should know about this PR.

.github/workflows/ci.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php-version: ['8.0', '8.1', '8.2', '8.3']
16+
17+
name: PHP ${{ matrix.php-version }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
extensions: mbstring, json
27+
coverage: xdebug
28+
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate --strict
31+
32+
- name: Cache Composer packages
33+
id: composer-cache
34+
uses: actions/cache@v3
35+
with:
36+
path: vendor
37+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-php-${{ matrix.php-version }}-
40+
41+
- name: Install dependencies
42+
run: composer install --prefer-dist --no-progress --no-dev
43+
44+
- name: Check PHP syntax
45+
run: find src -name "*.php" -exec php -l {} \;
46+
47+
- name: Test basic functionality
48+
run: php -r "require 'vendor/autoload.php'; use ProjectStructureViewer\ProjectStructureViewer; \$viewer = ProjectStructureViewer::create(); echo 'Basic functionality test passed';"
49+
50+
- name: Test HTML output
51+
run: php -r "require 'vendor/autoload.php'; use ProjectStructureViewer\ProjectStructureViewer; \$viewer = ProjectStructureViewer::create(); \$html = \$viewer->toHtml('Test'); if (strlen(\$html) > 100) echo 'HTML output test passed'; else exit(1);"
52+
53+
- name: Test JSON output
54+
run: php -r "require 'vendor/autoload.php'; use ProjectStructureViewer\ProjectStructureViewer; \$viewer = ProjectStructureViewer::create(); \$json = \$viewer->toJson(); if (json_decode(\$json)) echo 'JSON output test passed'; else exit(1);"
55+
56+
security:
57+
runs-on: ubuntu-latest
58+
name: Security Check
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Setup PHP
64+
uses: shivammathur/setup-php@v2
65+
with:
66+
php-version: '8.1'
67+
extensions: mbstring, json
68+
69+
- name: Install dependencies
70+
run: composer install --prefer-dist --no-progress --no-dev
71+
72+
- name: Security check
73+
run: |
74+
# Check for common security issues
75+
if grep -r "eval(" src/; then echo "Security issue: eval() found" && exit 1; fi
76+
if grep -r "exec(" src/; then echo "Security issue: exec() found" && exit 1; fi
77+
if grep -r "system(" src/; then echo "Security issue: system() found" && exit 1; fi
78+
if grep -r "shell_exec(" src/; then echo "Security issue: shell_exec() found" && exit 1; fi
79+
echo "Security check passed"
80+
81+
package-test:
82+
runs-on: ubuntu-latest
83+
name: Package Installation Test
84+
85+
steps:
86+
- uses: actions/checkout@v4
87+
88+
- name: Setup PHP
89+
uses: shivammathur/setup-php@v2
90+
with:
91+
php-version: '8.1'
92+
extensions: mbstring, json
93+
94+
- name: Create test project
95+
run: |
96+
mkdir test-project
97+
cd test-project
98+
composer init --name="test/project" --no-interaction
99+
100+
- name: Install package locally
101+
run: |
102+
cd test-project
103+
composer config repositories.local path ../
104+
composer require arcanisgk/project-structure-viewer:@dev --no-interaction
105+
106+
- name: Test installation
107+
run: |
108+
cd test-project
109+
php -r "require 'vendor/autoload.php'; use ProjectStructureViewer\ProjectStructureViewer; \$viewer = ProjectStructureViewer::create(); echo 'Package installation test passed';"

0 commit comments

Comments
 (0)