Skip to content

Commit

Permalink
feat: add PHPIcons Initializer + icon(…) helper function
Browse files Browse the repository at this point in the history
- bootstrap library with docs + quality tools
  • Loading branch information
yassinedoghri authored and Yassine Doghri committed Oct 19, 2024
0 parents commit 29f5a4a
Show file tree
Hide file tree
Showing 46 changed files with 12,483 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/php
{
"name": "PHP",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/php:1-8.3-bullseye",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"extensions": [
"bmewburn.vscode-intelephense-client",
"breezelin.phpstan",
"eamodio.gitlens",
"esbenp.prettier-vscode",
"github.vscode-github-actions",
"pflannery.vscode-versionlens",
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000],
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/node:1": {}
},
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
"workspaceFolder": "/workspaces/tempest-icons"

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"
}
20 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file tells which files and directories should be ignored and
# NOT downloaded when using composer to pull down a project with
# the --prefer-dist option selected. Used to remove development
# specific files so user has a clean download.

/.devcontainer/ export-ignore
/.github/ export-ignore
/example/ export-ignore
/tests/ export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.releaserc export-ignore
/CONTRIBUTING.md export-ignore
/ecs.php export-ignore
/package.json export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/pnpm-lock.yaml export-ignore
/rector.php export-ignore
/SECURITY.md export-ignore
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: "\U0001F41B Bug Report"
about: "If something isn't working as expected \U0001F914."
title: ""
labels: "i: bug"
assignees: ""
---

**Describe the bug**

A clear and concise description of what the bug is.

**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.

**Screenshots**

If applicable, add screenshots to help explain your problem.

**Context (please complete the following information):**

- `php-icons` version: [e.g. 1.0.0]
- OS: [e.g. Ubuntu 22.04]
- Browser: [e.g. firefox]

Add any other context about the problem here.

**Possible fixes**

If you can, link to the line of code that might be responsible for the problem.

---

- [ ] I confirm that I have read the
[Contributing Guide](./../../CONTRIBUTING.md) and
[Security Guide](./../../SECURITY.md)
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature-request
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: "\U0001F680 Feature Request"
about: "I have a suggestion (and may want to implement it \U0001F642)!"
title: ""
labels: "i: enhancement"
assignees: ""
---

**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 [...]

**Describe the solution you'd like**

A clear and concise description of what you want to happen.

**Describe alternatives you've considered**

A clear and concise description of any alternative solutions or features you've
considered.

**Additional context**

Add any other context or screenshots about the feature request here.

---

- [ ] I confirm that I have read the
[Contributing Guide](./../../CONTRIBUTING.md) and
[Security Guide](./../../SECURITY.md)
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: GitHub Community Support
url: https://github.com/yassinedoghri/tempest-icons/discussions
about: Please ask and answer questions here.
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
- Fill in the form below correctly. This will help us to understand the PR and also work on it.
-->

### Subject:

- [ ] Bug fix
- [ ] New feature

### Description:

_Clearly and concisely describe what's in this pull request. Include
screenshots, if necessary._

### Related:

_Link to the issue(s) your PR is solving. If it doesn't exist, remove the
"Related" section_

---

- [ ] I confirm that I have read the [Contributing Guide](./../CONTRIBUTING.md)
and [Security Guide](./../SECURITY.md)
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
21 changes: 21 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: tempest-icons-pull-request-lint

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: tempest-icons-release

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

permissions:
contents: read

jobs:
quality:
runs-on: ubuntu-latest

steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4

- name: 🐘 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3

- name: ✅ Validate composer.json and composer.lock
run: composer validate --strict

- name: 🗂️ Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: 📥 Install dependencies
run: composer install --prefer-dist --no-progress

- name: ✨ Quality check
run: |
composer validate --strict --ansi
composer run-script style
composer run-script phpstan
composer run-script rector
composer run-script pest:type-coverage
- name: 🧪 Run tests and collect coverage
run: vendor/bin/pest --parallel --coverage-clover coverage.xml

- name: 📤 Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}

release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [quality]
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
strategy:
matrix:
node-version: [20]
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN_SEMANTIC_RELEASE }}

- name: 📥 Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: ⚙️ Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: 🚀 Run Semantic Release
run: |
pnpm install
pnpx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.pnpm-store
vendor/
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"overrides": [
{
"files": "*.md",
"options": {
"proseWrap": "always"
}
}
]
}
19 changes: 19 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/exec",
{
"prepareCmd": "pnpm exec prettier --write CHANGELOG.md"
}
],
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
]
}
Loading

0 comments on commit 29f5a4a

Please sign in to comment.