Skip to content

Commit db89c63

Browse files
committed
feat: Initial implementation
1 parent 7308fb5 commit db89c63

12 files changed

+2547
-0
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[*.php]
14+
indent_size = 4
15+
16+
[phpcs.xml]
17+
indent_size = 4

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github export-ignore
2+
.editorconfig export-ignore
3+
.gitattributes export-ignore
4+
.gitignore export-ignore
5+
.phpcs.xml export-ignore
6+
CHANGELOG.md export-ignore
7+
composer.lock export-ignore

.github/renovate.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:base"]
4+
}

.github/workflows/release.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
token: ${{ secrets.OBLAK_BOT_TOKEN }}
17+
- name: Publish a composer package
18+
uses: better-php-actions/publish-composer-package@v1
19+
with:
20+
package_slug: "whmcs-dev-helper"
21+
package_name: "WHMCS Development Helper"
22+
with_gpg: true
23+
gpg_key: ${{ secrets.GPG_PRIVATE_KEY }}
24+
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
25+
release_token: ${{ secrets.OBLAK_BOT_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.vscode
2+
vendor

.phpcs.xml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="composer-installer">
3+
<description>Coding standards for AutoConstructor Composer Plugin</description>
4+
5+
<arg name="extensions" value="php"/>
6+
<!-- Show sniff codes in all reports, and progress when running -->
7+
<arg value="sp"/>
8+
<!-- Strip the filepaths down to the relevant bit. -->
9+
<arg name="basepath" value="."/>
10+
11+
<file>.</file>
12+
<exclude-pattern>*/.git*</exclude-pattern>
13+
<exclude-pattern>*/build/*</exclude-pattern>
14+
<exclude-pattern>*/vendor/*</exclude-pattern>
15+
16+
<rule ref="PSR12"/>
17+
<rule ref="PSR1"/>
18+
19+
<rule ref="Generic.Formatting.MultipleStatementAlignment">
20+
<properties>
21+
<property name="maxPadding" value="40" />
22+
</properties>
23+
</rule>
24+
25+
<rule ref="PSR1.Files.SideEffects">
26+
<exclude-pattern>*/tests/bootstrap\.php$</exclude-pattern>
27+
</rule>
28+
29+
<!-- Fixture method names in the test classes will be in snake_case because of the PHPUnit Polyfills. -->
30+
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
31+
<exclude-pattern>*/tests/</exclude-pattern>
32+
</rule>
33+
34+
</ruleset>

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div align="center">
2+
3+
# WHMCS Dev Helper
4+
5+
</div>
6+
7+
Composer module which makes your WHMCS Module development easier 😊

bin/module-install

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
find ./modules/ -mindepth 2 -maxdepth 2 -type d | while read -r dir; do
5+
if [ -f "$dir/composer.json" ]; then
6+
printf "Installing Composer modules for: %s\n" "$(basename "$dir")"
7+
composer --working-dir="$dir" install --quiet --no-dev --no-interaction --no-suggest
8+
fi
9+
done

bin/pack

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
rm -rf build && mkdir build
5+
6+
while IFS= read -r MODULE_PATH
7+
do
8+
MODULE_PATH="${MODULE_PATH%%/*}"
9+
mkdir -p "build/$MODULE_PATH"
10+
cp -ar "$MODULE_PATH/" "build/"
11+
done < .manifest
12+
13+
cp .manifest build/
14+
find "$(dirname "$(find build/modules -mindepth 2 -maxdepth 3 -type f -name composer.json)")" -name "composer.*" -type f -exec rm -f {} \;
15+
16+
cp scripts/install build/
17+
18+
MODULE_NAME="$(basename "$(pwd)")"
19+
20+
pushd build
21+
22+
zip -qr "../$MODULE_NAME.zip" .
23+
24+
popd && rm -rf build

composer.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "oblak/whmcs-dev-helper",
3+
"description": "Development utilities for WHMCS modules",
4+
"type": "composer-plugin",
5+
"version": "1.0.0",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Sibin Grasic",
10+
"email": "[email protected]",
11+
"homepage": "https://oblak.host",
12+
"role": "CTO"
13+
},
14+
{
15+
"name": "Contributors",
16+
"homepage": "https://github.com/oblakhost/whmcs-dev-helper/graphs/contributors"
17+
}
18+
],
19+
"support": {
20+
"issues": "https://github.com/oblakhost/whmcs-dev-helper/issues",
21+
"source": "https://github.com/oblakhost/whmcs-dev-helper"
22+
},
23+
"bin": [
24+
"bin/module-install",
25+
"bin/pack"
26+
],
27+
"autoload": {
28+
"psr-4": {
29+
"Oblak\\Composer\\Plugin\\": "src"
30+
}
31+
},
32+
"require": {
33+
"php": "^8.0 | ^8.1",
34+
"composer-plugin-api": "^2.0"
35+
},
36+
"require-dev": {
37+
"composer/composer": "^2.0",
38+
"oblak/whmcs-stubs": "^7.10"
39+
},
40+
"minimum-stability": "dev",
41+
"prefer-stable": true,
42+
"extra": {
43+
"class": "\\Oblak\\Composer\\Plugin\\WHMCSDevPlugin"
44+
},
45+
"scripts": {}
46+
}

0 commit comments

Comments
 (0)