Skip to content

Commit 1ab3760

Browse files
committed
chore: add issue templates for bug reports and feature requests, enhance PR template, and implement security policy
1 parent 2d2df8d commit 1ab3760

File tree

11 files changed

+650
-14
lines changed

11 files changed

+650
-14
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
## Description
11+
12+
A clear and concise description of the bug.
13+
14+
## Steps to Reproduce
15+
16+
1. Install `@mts-pjsc/image-optimize` library version X.X.X
17+
2. Use the Image component in your React app
18+
3. Observe the behavior
19+
4. See error
20+
21+
## Expected Behavior
22+
23+
What you expected to happen.
24+
25+
## Actual Behavior
26+
27+
What actually happened.
28+
29+
## Code Sample
30+
31+
```typescript
32+
// Example code that demonstrates the issue
33+
import { Image } from "@mts-pjsc/image-optimize";
34+
35+
<Image src="/path/to/image.jpg" alt="Example" />
36+
```
37+
38+
## Configuration
39+
40+
```json
41+
// Environment variables or configuration
42+
```
43+
44+
## Environment
45+
46+
- **@mts-pjsc/image-optimize version**: [e.g., 1.3.9]
47+
- **React version**: [e.g., 18.2.0]
48+
- **Node.js version**: [e.g., 20.10.0]
49+
- **Browser**: [e.g., Chrome 120, Firefox 121, Safari 17]
50+
- **Operating System**: [e.g., Windows 11, macOS 14, Ubuntu 22.04]
51+
- **Build tool**: [e.g., Webpack 5, Vite 5, Next.js 14]
52+
53+
## Additional Context
54+
55+
Add any other context, screenshots, or error messages here.
56+
57+
## Possible Solution
58+
59+
If you have ideas on how to fix this, please share them.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
## Feature Description
11+
12+
A clear and concise description of the feature you'd like to see.
13+
14+
## Problem Statement
15+
16+
What problem would this feature solve? Is your feature request related to a problem?
17+
18+
**Example:** "I'm frustrated when [...]"
19+
20+
## Proposed Solution
21+
22+
Describe the solution you'd like to see implemented.
23+
24+
## Alternatives Considered
25+
26+
Describe any alternative solutions or features you've considered.
27+
28+
## Use Cases
29+
30+
Provide specific examples of how this feature would be used:
31+
32+
1. Use case 1...
33+
2. Use case 2...
34+
35+
## Code Examples
36+
37+
If applicable, provide example code showing how you envision using this feature:
38+
39+
```typescript
40+
// Example usage
41+
import { Image } from "@mts-pjsc/image-optimize";
42+
43+
<Image
44+
src="/path/to/image.jpg"
45+
alt="Example"
46+
optimize={true}
47+
formats={['webp', 'avif']}
48+
/>
49+
```
50+
51+
## Impact
52+
53+
- **Who benefits**: [developers, teams, specific use cases]
54+
- **Breaking changes**: [yes/no - explain if yes]
55+
- **Backward compatibility**: [maintained/affected]
56+
57+
## Additional Context
58+
59+
Add any other context, screenshots, or examples about the feature request here.
60+
61+
## Willingness to Contribute
62+
63+
- [ ] I'm willing to submit a PR to implement this feature
64+
- [ ] I can help with testing
65+
- [ ] I can help with documentation

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
## Description
2+
3+
<!-- Provide a brief description of your changes -->
4+
5+
## Related Issue
6+
7+
<!-- Link to the issue this PR addresses -->
8+
Closes #
9+
10+
## Type of Change
11+
12+
<!-- Check all that apply -->
13+
14+
- [ ] Bug fix (non-breaking change which fixes an issue)
15+
- [ ] New feature (non-breaking change which adds functionality)
16+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
17+
- [ ] Documentation update
18+
- [ ] Code refactoring
19+
- [ ] Dependency update
20+
21+
## Changes Made
22+
23+
<!-- List the main changes in this PR -->
24+
25+
-
26+
-
27+
-
28+
29+
## Testing
30+
31+
<!-- Describe the tests you ran -->
32+
33+
- [ ] I have run `npm test` and all tests pass
34+
- [ ] I have tested the changes manually
35+
- [ ] I have added/updated tests for my changes
36+
37+
## Code Quality
38+
39+
- [ ] My code follows the code style of this project
40+
- [ ] I have performed a self-review of my own code
41+
- [ ] I have commented my code, particularly in hard-to-understand areas
42+
- [ ] My changes generate no new warnings
43+
- [ ] No console.log or debugging code left in
44+
45+
## Documentation
46+
47+
- [ ] I have updated the README.md (if applicable)
48+
- [ ] I have updated the CHANGELOG.md (if applicable)
49+
- [ ] I have added/updated code comments
50+
51+
## Breaking Changes
52+
53+
<!-- If this is a breaking change, describe what breaks and migration path -->
54+
55+
N/A
56+
57+
## Screenshots / Examples
58+
59+
<!-- If applicable, add screenshots or code examples -->
60+
61+
```javascript
62+
// Example code showing the changes
63+
```
64+
65+
## Checklist
66+
67+
- [ ] This PR has a descriptive title
68+
- [ ] All commits follow [Conventional Commits](https://www.conventionalcommits.org/)
69+
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) guide
70+
- [ ] This PR is ready for review
71+
72+
## Additional Notes
73+
74+
<!-- Any additional information or context -->

.github/dependabot.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: 2
2+
updates:
3+
# NPM dependencies
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "thursday"
9+
time: "09:00"
10+
open-pull-requests-limit: 1
11+
groups:
12+
all-minor-patch:
13+
patterns:
14+
- "*"
15+
update-types:
16+
- "minor"
17+
- "patch"
18+
eslint-plugins:
19+
patterns:
20+
- "eslint*"
21+
- "@typescript-eslint/*"
22+
- "@stylistic/*"
23+
development-dependencies:
24+
dependency-type: "development"
25+
exclude-patterns:
26+
- "eslint*"
27+
commit-message:
28+
prefix: "chore"
29+
prefix-development: "chore"
30+
include: "scope"
31+
labels:
32+
- "dependencies"
33+
assignees:
34+
- "LabEG"
35+
36+
# GitHub Actions
37+
- package-ecosystem: "github-actions"
38+
directory: "/"
39+
schedule:
40+
interval: "weekly"
41+
day: "thursday"
42+
time: "09:00"
43+
commit-message:
44+
prefix: "ci"
45+
include: "scope"
46+
labels:
47+
- "dependencies"
48+
assignees:
49+
- "LabEG"

.github/workflows/codeql.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 0 * * 4' # Каждый четверг в 00:00
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
name: Analyze Code
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 360
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [ 'javascript-typescript' ]
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v6
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v4
33+
with:
34+
languages: ${{ matrix.language }}
35+
queries: security-extended,security-and-quality
36+
37+
- name: Autobuild
38+
uses: github/codeql-action/autobuild@v4
39+
40+
- name: Perform CodeQL Analysis
41+
uses: github/codeql-action/analyze@v4
42+
with:
43+
category: "/language:${{matrix.language}}"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Dependabot Auto-merge
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
enable-auto-merge:
13+
runs-on: ubuntu-latest
14+
# Срабатывает ТОЛЬКО для Dependabot PR
15+
if: github.actor == 'dependabot[bot]'
16+
17+
steps:
18+
- name: Dependabot metadata
19+
id: metadata
20+
uses: dependabot/fetch-metadata@v2
21+
with:
22+
github-token: "${{ secrets.GITHUB_TOKEN }}"
23+
24+
- name: Wait for test completion
25+
uses: lewagon/wait-on-check-action@v1.4.1
26+
with:
27+
ref: ${{ github.event.pull_request.head.sha }}
28+
check-name: 'test'
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
wait-interval: 10
31+
32+
- name: Approve PR
33+
run: gh pr review --approve "$PR_URL"
34+
env:
35+
PR_URL: ${{ github.event.pull_request.html_url }}
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Merge PR
39+
run: gh pr merge --squash "$PR_URL"
40+
env:
41+
PR_URL: ${{ github.event.pull_request.html_url }}
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/npm-publish.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker
1+
name: NPM Publish
22

33
# This workflow uses actions that are not certified by GitHub.
44
# They are provided by a third-party and are governed by
@@ -8,15 +8,18 @@ name: Docker
88
on:
99
push:
1010
branches: [ main ]
11+
schedule:
12+
- cron: '0 12 8-14 1,5,9 4' # Thursday of 2nd week, 3 times a year (Jan, May, Sep) at 12:00 UTC
1113
workflow_dispatch:
1214

15+
permissions:
16+
contents: write
17+
id-token: write # Required for npm provenance
18+
1319
jobs:
1420
build:
1521
runs-on: ubuntu-latest
1622

17-
permissions:
18-
contents: write
19-
2023
steps:
2124
- name: Checkout repository
2225
uses: actions/checkout@v4
@@ -27,12 +30,22 @@ jobs:
2730
node-version: 24
2831
registry-url: https://registry.npmjs.org/
2932

30-
- run: git config --global user.email "elabutin@mts.ru"
31-
- run: git config --global user.name "Eugene Labutin"
32-
- run: npm ci
33-
- run: npm run build
34-
- run: npm run release
35-
- run: git push && git push --tags
36-
- run: npm publish --access public
37-
env:
38-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
33+
- name: Configure Git
34+
run: |
35+
git config --global user.email "elabutin@mts.ru"
36+
git config --global user.name "Eugene Labutin"
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Build package
42+
run: npm run build
43+
44+
- name: Create release
45+
run: npm run release
46+
47+
- name: Push changes and tags
48+
run: git push && git push --tags
49+
50+
- name: Publish to NPM
51+
run: npm publish --provenance --access public

0 commit comments

Comments
 (0)