-
Notifications
You must be signed in to change notification settings - Fork 11
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
Showing
83 changed files
with
718 additions
and
18 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
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
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
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,3 @@ | ||
defaults | ||
not IE 11 | ||
not op_mini all |
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 @@ | ||
public/**/*.js |
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,3 @@ | ||
{ | ||
"extends": "./node_modules/@eightshift/frontend-libs-tailwind/linters/eslint.config.js" | ||
} |
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,6 @@ | ||
# Project Specific | ||
/public | ||
/vendor | ||
/vendor-prefixed | ||
/node_modules | ||
.DS_Store |
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 @@ | ||
|
||
{ | ||
"extends": "./node_modules/@eightshift/frontend-libs-tailwind/linters/stylelint.config.js", | ||
"ignoreFiles": "public/**/*.css" | ||
} |
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,3 @@ | ||
module.exports = { | ||
extends: './node_modules/@eightshift/frontend-libs-tailwind/babel/babel.config.js', | ||
}; |
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,59 @@ | ||
{ | ||
"name": "%g_textdomain%/%g_textdomain%", | ||
"description": "%g_project_description%", | ||
"private": true, | ||
"license": "MIT", | ||
"require-dev": { | ||
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0.0", | ||
"infinum/eightshift-coding-standards": "^3.0.0", | ||
"php-stubs/wordpress-stubs": "^v6.5.3", | ||
"szepeviktor/phpstan-wordpress": "^v1.3.4", | ||
"wp-cli/wp-cli": "^v2.10.0" | ||
}, | ||
"require": { | ||
"php": ">=8.2" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"%g_namespace%\\": "src/" | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"config": { | ||
"sort-packages": true, | ||
"optimize-autoloader": true, | ||
"process-timeout": 2000, | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
}, | ||
"scripts": { | ||
"test:types": "@php ./vendor/bin/phpstan analyze", | ||
"test:standards": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 8.2-", | ||
"test": [ | ||
"@test:standards", | ||
"@test:types" | ||
], | ||
"prefix-namespaces": [ | ||
"@php strauss.phar", | ||
"composer dump-autoload" | ||
], | ||
"post-install-cmd": [ | ||
"@php strauss.phar", | ||
"composer dump-autoload" | ||
], | ||
"post-update-cmd": [ | ||
"@php strauss.phar", | ||
"composer dump-autoload" | ||
] | ||
}, | ||
"extra": { | ||
"strauss": { | ||
"namespace_prefix": "%g_namespace_vendor_prefix%", | ||
"exclude_from_prefix": { | ||
"file_patterns": ["/Example.php$/"] | ||
} | ||
} | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
src/Init/tailwind/plugin/eightshift-boilerplate-plugin.php
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,95 @@ | ||
<?php | ||
|
||
/** | ||
* Plugin Name: %g_project_name% | ||
* Description: %g_project_description% | ||
* Author: %g_project_author% | ||
* Author URI: %g_project_author_url% | ||
* Version: %g_project_version% | ||
* License: MIT | ||
* License URI: http://www.gnu.org/licenses/gpl.html | ||
* Text Domain: %g_textdomain% | ||
* | ||
* @package %g_namespace% | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace %g_namespace%; | ||
|
||
use %g_namespace%\Cache\ManifestCache; | ||
use %g_namespace%\Main\Main; | ||
use %g_use_libs%\Cli\Cli; | ||
|
||
/** | ||
* If this file is called directly, abort. | ||
*/ | ||
if (! \defined('WPINC')) { | ||
die; | ||
} | ||
|
||
/** | ||
* Bailout, if the plugin is not loaded via Composer. | ||
*/ | ||
if (!\file_exists(__DIR__ . '/vendor/autoload.php')) { | ||
return; | ||
} | ||
|
||
/** | ||
* Require the Composer autoloader. | ||
*/ | ||
$loader = require __DIR__ . '/vendor/autoload.php'; | ||
|
||
/** | ||
* Require the Composer autoloader for the prefixed libraries. | ||
*/ | ||
if (\file_exists(__DIR__ . '/vendor-prefixed/autoload.php')) { | ||
require __DIR__ . '/vendor-prefixed/autoload.php'; | ||
} | ||
|
||
if (\class_exists(PluginFactory::class)) { | ||
/** | ||
* The code that runs during plugin activation. | ||
*/ | ||
\register_activation_hook( | ||
__FILE__, | ||
function () { | ||
PluginFactory::activate(); | ||
} | ||
); | ||
|
||
/** | ||
* The code that runs during plugin deactivation. | ||
*/ | ||
\register_deactivation_hook( | ||
__FILE__, | ||
function () { | ||
PluginFactory::deactivate(); | ||
} | ||
); | ||
} | ||
|
||
/** | ||
* Set all the cache for the plugin. | ||
*/ | ||
if (\class_exists(ManifestCache::class)) { | ||
(new ManifestCache())->setAllCache(); | ||
} | ||
|
||
/** | ||
* Begins execution of the plugin. | ||
* | ||
* Since everything within the plugin is registered via hooks, | ||
* then kicking off the plugin from this point in the file does | ||
* not affect the page life cycle. | ||
*/ | ||
if (\class_exists(Main::class)) { | ||
(new Main($loader->getPrefixesPsr4(), __NAMESPACE__))->register(); | ||
} | ||
|
||
/** | ||
* Run all WPCLI commands. | ||
*/ | ||
if (\class_exists(Cli::class)) { | ||
(new Cli())->load('boilerplate'); | ||
} |
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,23 @@ | ||
{ | ||
"name": "%g_textdomain%", | ||
"description": "%g_project_description%", | ||
"private": true, | ||
"license": "MIT", | ||
"scripts": { | ||
"lintStyle": "stylelint **/*.scss", | ||
"lintJs": "eslint src/ assets/", | ||
"lint": "npm run lintJs && npm run lintStyle && composer standards:check -- --filter=gitstaged", | ||
"start": "webpack --watch --mode development", | ||
"build": "webpack --mode production" | ||
}, | ||
"devDependencies": { | ||
"husky": "^9.0.11", | ||
"webpack": "^5.91.0", | ||
"webpack-cli": "^5.1.4" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm run lint" | ||
} | ||
} | ||
} |
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,37 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Eightshift Boilerplate ruleset"> | ||
<description>Ruleset for the Eightshift Boilerplate Plugin.</description> | ||
|
||
<rule ref="Eightshift" /> | ||
|
||
<exclude-pattern>*/tests/*</exclude-pattern> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
<exclude-pattern>*/vendor-prefixed/*</exclude-pattern> | ||
<exclude-pattern>*/public/*</exclude-pattern> | ||
<exclude-pattern>*/node_modules/*</exclude-pattern> | ||
|
||
<!-- Additional arguments. --> | ||
<arg value="sp"/> | ||
<arg name="basepath" value="."/> | ||
<arg name="parallel" value="8"/> | ||
<arg name="extensions" value="php"/> | ||
|
||
<file>.</file> | ||
|
||
<!-- Check for PHP cross-version compatibility. --> | ||
<config name="testVersion" value="8.2-"/> | ||
<rule ref="PHPCompatibilityWP"/> | ||
|
||
<!-- Support only latest 3 WP versions. --> | ||
<config name="minimum_supported_wp_version" value="8.0"/> | ||
|
||
<exclude-pattern>/src/CompiledContainer\.php</exclude-pattern> | ||
|
||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<property name="lineLimit" value="300" /> | ||
<property name="ignoreComments" value="true" /> | ||
</properties> | ||
</rule> | ||
|
||
</ruleset> |
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,17 @@ | ||
includes: | ||
- vendor/szepeviktor/phpstan-wordpress/extension.neon | ||
parameters: | ||
level: 6 | ||
inferPrivatePropertyTypeFromConstructor: true | ||
treatPhpDocTypesAsCertain: false | ||
bootstrapFiles: | ||
- vendor-prefixed/autoload.php | ||
paths: | ||
- src/ | ||
ignoreErrors: | ||
# Block templates | ||
- '#^Variable \$attributes might not be defined\.#' | ||
- '#^Variable \$renderContent might not be defined\.#' | ||
- '#^Variable \$this might not be defined\.#' | ||
- '#^Variable \$templatePath might not be defined\.#' | ||
- identifier: missingType.generics |
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,7 @@ | ||
const autoprefixer = require('autoprefixer'); | ||
|
||
module.exports = { | ||
plugins: [ | ||
autoprefixer, | ||
], | ||
}; |
Binary file not shown.
Oops, something went wrong.