Skip to content

Commit

Permalink
Initial block
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfelt committed Apr 19, 2023
0 parents commit 7e76d42
Show file tree
Hide file tree
Showing 17 changed files with 16,990 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.git
.github
node_modules/
vendor/
.distignore
.eslintrc.js
.gitignore
composer.json
composer.lock
package-lock.json
package.json
phpcs.xml
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
env: {
browser: true,
},
ignorePatterns: [
'.*.js',
'*.config.js',
'**/build/*.js',
],
rules: {
'no-console': [ 'warn', { allow: [ 'error' ] } ],
},
};
16 changes: 16 additions & 0 deletions .github/workflows/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add new issues to Happy Prime project

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/happyprime/projects/5
github-token: ${{ secrets.AMIABOT_BOT_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: PHP_CodeSniffer

on: pull_request

jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none
tools: composer, cs2pr

- name: Cache Composer
id: cache-composer
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.cache-composer.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress
- name: Detect coding standard violations
run: vendor/bin/phpcs -q --report=checkstyle . | cs2pr --notices-as-warnings
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/build/
/node_modules
/vendor/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Toggle Block

Add a toggle in the WordPress block editor to show and hide another block.
24 changes: 24 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "happyprime/toggle-block",
"description": "Add a toggle to show and hide another block.",
"version": "0.1.0",
"type": "wordpress-plugin",
"license": "GPLv2-or-later",
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true
}
},
"require-dev": {
"squizlabs/php_codesniffer": "*",
"dealerdirect/phpcodesniffer-composer-installer": "*",
"phpcompatibility/phpcompatibility-wp": "*",
"sirbrillig/phpcs-variable-analysis": "*",
"wp-coding-standards/wpcs": "*"
},
"scripts": {
"phpcs": "vendor/bin/phpcs",
"phpcbf": "vendor/bin/phpcbf"
}
}
Loading

0 comments on commit 7e76d42

Please sign in to comment.