Skip to content

Commit

Permalink
(feat) initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
ictbeheer committed Aug 6, 2024
1 parent 82185ff commit 0c25e1b
Show file tree
Hide file tree
Showing 21 changed files with 258 additions and 344 deletions.
37 changes: 10 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
# Yard :package_name
# Yard wp-user-roles

[![Code Style](https://github.com/yardinternet/skeleton-package/actions/workflows/format-php.yml/badge.svg?no-cache)](https://github.com/yardinternet/skeleton-package/actions/workflows/format-php.yml)
[![PHPStan](https://github.com/yardinternet/skeleton-package/actions/workflows/phpstan.yml/badge.svg?no-cache)](https://github.com/yardinternet/skeleton-package/actions/workflows/phpstan.yml)
[![Tests](https://github.com/yardinternet/skeleton-package/actions/workflows/run-tests.yml/badge.svg?no-cache)](https://github.com/yardinternet/skeleton-package/actions/workflows/run-tests.yml)
[![Code Coverage Badge](https://github.com/yardinternet/skeleton-package/blob/badges/coverage.svg)](https://github.com/yardinternet/skeleton-package/actions/workflows/badges.yml)
[![Lines of Code Badge](https://github.com/yardinternet/skeleton-package/blob/badges/lines-of-code.svg)](https://github.com/yardinternet/skeleton-package/actions/workflows/badges.yml)
[![Code Style](https://github.com/yardinternet/wp-user-roles/actions/workflows/format-php.yml/badge.svg?no-cache)](https://github.com/yardinternet/wp-user-roles/actions/workflows/format-php.yml)
[![PHPStan](https://github.com/yardinternet/wp-user-roles/actions/workflows/phpstan.yml/badge.svg?no-cache)](https://github.com/yardinternet/wp-user-roles/actions/workflows/phpstan.yml)
[![Tests](https://github.com/yardinternet/wp-user-roles/actions/workflows/run-tests.yml/badge.svg?no-cache)](https://github.com/yardinternet/wp-user-roles/actions/workflows/run-tests.yml)
[![Code Coverage Badge](https://github.com/yardinternet/wp-user-roles/blob/badges/coverage.svg)](https://github.com/yardinternet/wp-user-roles/actions/workflows/badges.yml)
[![Lines of Code Badge](https://github.com/yardinternet/wp-user-roles/blob/badges/lines-of-code.svg)](https://github.com/yardinternet/wp-user-roles/actions/workflows/badges.yml)

<!--delete-->
---
This repository provides a scaffold for creating an Acorn package. For more detailed information, please refer to the [Acorn Package Development](https://roots.io/acorn/docs/package-development/) documentation.

Follow these steps to get started:

1. Press the "Use this template" button at the top of this repo to create a new repo with the contents of this skeleton.
2. Run "php ./configure.php" to run a script that will replace all placeholders throughout all the files.
3. Have fun creating your package.

---
<!--/delete-->

## Requirements

Expand All @@ -33,14 +22,14 @@ To install this package using Composer, follow these steps:
```json
{
"type": "vcs",
"url": "git@github.com:yardinternet/skeleton-package.git"
"url": "git@github.com:yardinternet/wp-user-roles.git"
}
```

2. Install this package with Composer:

```sh
composer require yard/skeleton-package
composer require yard/wp-user-roles
```

3. Run the Acorn WP-CLI command to discover this package:
Expand All @@ -52,19 +41,13 @@ To install this package using Composer, follow these steps:
You can publish the config file with:

```shell
wp acorn vendor:publish --provider="Yard\SkeletonPackage\SkeletonPackageServiceProvider"
wp acorn vendor:publish --provider="Yard\UserRoles\UserRolesServiceProvider"
```

## Usage

From a Blade template:

```blade
@include('skeleton-package::example')
```

From WP-CLI:

```shell
wp acorn example
wp acorn user-roles
```
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yard/skeleton-package",
"name": "yard/wp-user-roles",
"type": "package",
"description": ":package_description",
"description": "This is my package wp-user-roles",
"version": "1.0.0",
"license": "MIT",
"config": {
Expand All @@ -24,12 +24,12 @@
},
"autoload": {
"psr-4": {
"Yard\\SkeletonPackage\\": "src/"
"Yard\\UserRoles\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Yard\\SkeletonPackage\\Tests\\": "tests/"
"Yard\\UserRoles\\Tests\\": "tests/"
}
},
"scripts": {
Expand All @@ -44,10 +44,10 @@
"extra": {
"acorn": {
"providers": [
"Yard\\SkeletonPackage\\SkeletonPackageServiceProvider"
"Yard\\UserRoles\\UserRolesServiceProvider"
],
"aliases": {
"Example": "Yard\\SkeletonPackage\\Facades\\Example"
"UserRoles": "Yard\\UserRoles\\Facades\\UserRoles"
}
}
}
Expand Down
25 changes: 0 additions & 25 deletions config/skeleton-package.php

This file was deleted.

73 changes: 73 additions & 0 deletions config/user-roles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

declare(strict_types=1);

return [

'prefix' => 'yard',
'roles' => [
'superuser' => [
'display_name' => 'Superuser',
'caps' => [
'read' => true,
'edit_dashboard' => true,
'edit_files' => true,
'unfiltered_html' => true,
'upload_files' => true,
'manage_categories' => true,
'edit_theme_options' => true,
'moderate_comments' => true,
],
'post_type_caps' => [
'post',
'page',
],
'cap_groups' => [
'gravityforms',
'wpseo',
],
],
],
'cap_groups' => [
'plugins' => [
'activate_plugins',
'delete_plugins',
'edit_plugins',
'install_plugins',
'update_plugins',
],
'users' => [
'create_users',
'delete_users',
'edit_users',
'list_users',
'promote_users',
'remove_users',
],
'themes' => [
'delete_themes',
'edit_themes',
'install_themes',
'switch_themes',
'update_themes',
],
'gravityforms' => [
'gravityforms_create_form',
'gravityforms_delete_forms',
'gravityforms_edit_forms',
'gravityforms_preview_forms',
'gravityforms_view_entries',
'gravityforms_edit_entries',
'gravityforms_delete_entries',
'gravityforms_view_entry_notes',
'gravityforms_edit_entry_notes',
],
'wpseo' => [
'wpseo_bulk_edit',
'wpseo_manage_options',
'wpseo_bulk_edit',
'wpseo_manage_options',
],
],

];
154 changes: 0 additions & 154 deletions configure.php

This file was deleted.

4 changes: 2 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ includes:
- vendor/larastan/larastan/extension.neon

parameters:
level: 9
level: 7
paths:
- src
tmpDir: build/phpstan
ignoreErrors:
-
message: '#Call to an undefined static method Yard\\SkeletonPackage\\Facades\\Example::getQuote\(\)#'
message: '#Call to an undefined static method Yard\\UserRoles\\Facades\\UserRoles::getQuote\(\)#'
1 change: 0 additions & 1 deletion resources/views/example.blade.php

This file was deleted.

1 change: 1 addition & 0 deletions resources/views/userroles.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ UserRoles::getQuote() }}
Loading

0 comments on commit 0c25e1b

Please sign in to comment.