-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 21a3ecb
Showing
17 changed files
with
10,166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
feature: ['feature/*', 'feat/*'] | ||
fix: ['fix/*', 'bug/*'] | ||
chore: ['chore/*', 'misc/*'] | ||
documentation: ['doc/*', 'docs/*'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- 'feature request' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
label: 'chore' | ||
- title: '📖 Documentation' | ||
labels: | ||
- 'documentation' | ||
- 'docs' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## [v$RESOLVED_VERSION(####-##-##)](https://github.com/al-esc/tips/compare/$PREVIOUS_TAG...$RESOLVED_VERSION) | ||
$CHANGES | ||
--- | ||
Released with ❤️ by: $CONTRIBUTORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: PR Labeler | ||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
pr-labeler: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: TimonVS/pr-labeler-action@v3 | ||
with: | ||
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Build release artifact | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
env: | ||
EXCLUDES: ${{ '"**/node_modules/*" "**/assets/*" "**/*.md" "**/.git/*" "**/.github/*" "**/.gitignore" "**/composer.lock" "**/composer.json" "**/package.json" "**/package-lock.json" "**/phpcs.xml" "**/webpack.mix.js" "**/.eslintrc" "**/phpunit.xml.dist" "**/bin/*" "**/tests/*"' }} | ||
|
||
jobs: | ||
build_artifact: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set repo name environment variable | ||
id: set-repo-variable | ||
run: echo "REPO=$(echo $GITHUB_REPOSITORY | cut -d'/' -f 2)" >> $GITHUB_ENV | ||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::vendor" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install PHP dependencies | ||
id: composer-install | ||
run: composer install --no-dev | ||
- name: Dump autoload files | ||
id: composer-dump | ||
run: composer dump-autoload -o | ||
- name: Get NPM Cache Directory | ||
id: npm-cache | ||
run: | | ||
echo "::set-output name=dir::node_modules" | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
check-latest: true | ||
- name: Install NPM dependencies | ||
id: npm-install | ||
run: npm install | ||
- name: Build production assets | ||
id: npm-build | ||
run: npm run prod | ||
- name: Build artifact | ||
id: build-artifact | ||
env: | ||
ZIP: ${{ env.REPO }}.zip | ||
DIR: ${{ env.REPO }} | ||
run: cd .. && zip -r ${{ env.ZIP }} ${{ env.DIR }} -x ${{ env.EXCLUDES }} | ||
- name: Upload artifact | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ../${{ env.REPO }}.zip | ||
asset_name: ${{ env.REPO }}.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- primary | ||
- develop | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml | ||
config-name: release-drafter.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules/ | ||
vendor/ | ||
dist/ | ||
.DS_Store | ||
*.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<h3 align="center">WordPress Plugin Template</h3> | ||
<h4>Included:</h4> | ||
|
||
- OOP architecture | ||
|
||
- Build pipeline | ||
|
||
- PSR-4 Autoloading | ||
|
||
- GitHub workflows for: | ||
|
||
- Building release asset | ||
|
||
- PR labeler | ||
|
||
- Release drafter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
/** | ||
* The plugin first class. | ||
* | ||
* @package crowdfavorite\tips | ||
*/ | ||
|
||
namespace Tips; | ||
|
||
/** | ||
* The main class | ||
*/ | ||
class Plugin | ||
{ | ||
|
||
/** | ||
* Class instance. | ||
* | ||
* @access private | ||
* @static | ||
* | ||
* @var Main | ||
*/ | ||
private static $instance; | ||
|
||
/** | ||
* Get instance of the class. | ||
* | ||
* @access public | ||
* @static | ||
* | ||
* @return Main | ||
*/ | ||
public static function getInstance() | ||
{ | ||
if (!self::$instance) { | ||
self::$instance = new self(); | ||
} | ||
|
||
return self::$instance; | ||
} | ||
|
||
/** | ||
* The main class construct. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->init(); | ||
} | ||
|
||
/** | ||
* Initialize the plugin. | ||
*/ | ||
private function init() | ||
{ | ||
add_action( | ||
'admin_enqueue_scripts', | ||
[$this, 'enqueueAssets'] | ||
); | ||
} | ||
|
||
/** | ||
* `wp_enqueue_scripts` hook. | ||
* | ||
* @return void | ||
*/ | ||
public function enqueueAssets() | ||
{ | ||
wp_enqueue_script( | ||
TIPS_HANDLE, | ||
TIPS_PLUGIN_DIR_URL . 'dist/app.js', | ||
[], | ||
filemtime(TIPS_PLUGIN_DIR . 'dist/app.js'), | ||
true | ||
); | ||
|
||
wp_enqueue_style( | ||
TIPS_HANDLE, | ||
TIPS_PLUGIN_DIR_URL . 'dist/app.css', | ||
[], | ||
filemtime(TIPS_PLUGIN_DIR . 'dist/app.css') | ||
); | ||
} | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "crowdfavorite/tips", | ||
"type": "wordpress-plugin", | ||
"description": "TIPS is plugin scaffolding", | ||
"keywords": [ | ||
"wordpress", | ||
"plugin" | ||
], | ||
"support": { | ||
"email": "[email protected]" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Al Esc", | ||
"email": "[email protected]", | ||
"homepage": "https://crowfavorite.com" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"Tips\\": "app/" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=7.0.0" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.