diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 0d541e2bc..a0c76f181 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -57,32 +57,42 @@
*/src/*/*Example.php
- */src/Init/theme/
- */src/Init/plugin/
+ */src/Init/standard/theme/
+ */src/Init/standard/plugin/
+ */src/Init/tailwind/theme/
+ */src/Init/tailwind/plugin/
*/src/*/*Example.php
- */src/Init/theme/
- */src/Init/plugin/
+ */src/Init/standard/theme/
+ */src/Init/standard/plugin/
+ */src/Init/tailwind/theme/
+ */src/Init/tailwind/plugin/
*/src/*/*Example.php
- */src/Init/theme/
- */src/Init/plugin/
+ */src/Init/standard/theme/
+ */src/Init/standard/plugin/
+ */src/Init/tailwind/theme/
+ */src/Init/tailwind/plugin/
*/src/*/*Example.php
- */src/Init/theme/
- */src/Init/plugin/
+ */src/Init/standard/theme/
+ */src/Init/standard/plugin/
+ */src/Init/tailwind/theme/
+ */src/Init/tailwind/plugin/
*/src/*/*Example.php
- */src/Init/theme/
- */src/Init/plugin/
+ */src/Init/standard/theme/
+ */src/Init/standard/plugin/
+ */src/Init/tailwind/theme/
+ */src/Init/tailwind/plugin/
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index db3d37a04..3886e5a6e 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -12,8 +12,10 @@ parameters:
- src/
excludePaths:
- src/**/*Example.php
- - src/Init/theme/
- - src/Init/plugin/
+ - src/Init/standard/theme/
+ - src/Init/standard/plugin/
+ - src/Init/tailwind/theme/
+ - src/Init/tailwind/plugin/
ignoreErrors:
# Ignore errors about reflection class variable being undefined. Errors are caught.
- '/^Variable \$reflectionClass might not be defined\.$/'
diff --git a/src/Blocks/AbstractBlocksCli.php b/src/Blocks/AbstractBlocksCli.php
index 2f153f516..c3243afe6 100644
--- a/src/Blocks/AbstractBlocksCli.php
+++ b/src/Blocks/AbstractBlocksCli.php
@@ -26,11 +26,10 @@ abstract class AbstractBlocksCli extends AbstractCli
* @param string $destination Destination path.
* @param string $type Type of items used for output log.
* @param bool $isSingleFolder Is single folder item.
- * @param string $sourcePrivate Source private libs path.
*
* @return void
*/
- protected function moveItems(array $args, string $source, string $destination, string $type, bool $isSingleFolder = false, string $sourcePrivate = ''): void
+ protected function moveItems(array $args, string $source, string $destination, string $type, bool $isSingleFolder = false): void
{
// Get Props.
$skipExisting = $this->getSkipExisting($args);
@@ -63,14 +62,6 @@ protected function moveItems(array $args, string $source, string $destination, s
$sourceItems = \array_diff(\scandir($source) ?: [], ['..', '.']); // phpcs:ignore WordPress.PHP.DisallowShortTernary.Found
$sourceItems = \array_fill_keys(\array_values($sourceItems), $source);
- $sourceItemsPrivate = [];
-
- if (\is_dir($sourcePrivate)) {
- $sourceItemsPrivate = \array_diff(\scandir($sourcePrivate) ?: [], ['..', '.']); // phpcs:ignore WordPress.PHP.DisallowShortTernary.Found
- $sourceItemsPrivate = \array_fill_keys(\array_values($sourceItemsPrivate), $sourcePrivate);
- }
-
- $sourceItems = \array_merge($sourceItems, $sourceItemsPrivate);
if (!$sourceItems) {
self::cliError(
diff --git a/src/Blocks/UseAssetsCli.php b/src/Blocks/UseAssetsCli.php
index ecccef7a5..91cececa5 100644
--- a/src/Blocks/UseAssetsCli.php
+++ b/src/Blocks/UseAssetsCli.php
@@ -61,6 +61,8 @@ public function getDoc(): array
Assets will be created from this folder:
https://github.com/infinum/eightshift-frontend-libs/tree/develop/blocks/init/src/Blocks/assets
+ or
+ https://github.com/infinum/eightshift-frontend-libs-tailwind/tree/develop/blocks/init/src/Blocks/assets
"),
];
}
@@ -79,7 +81,7 @@ public function __invoke(array $args, array $assocArgs)
'name' => 'assets',
],
),
- Helpers::getProjectPaths('blocksAssetsSource'),
+ $this->isTailwind() ? Helpers::getProjectPaths('blocksAssetsTailwindSource') : Helpers::getProjectPaths('blocksAssetsSource'),
Helpers::getProjectPaths('blocksAssetsDestination'),
'assets folder',
true
diff --git a/src/Blocks/UseBlockCli.php b/src/Blocks/UseBlockCli.php
index c4bc32700..4798e123e 100644
--- a/src/Blocks/UseBlockCli.php
+++ b/src/Blocks/UseBlockCli.php
@@ -91,6 +91,8 @@ public function getDoc(): array
All our blocks can be found here:
https://github.com/infinum/eightshift-frontend-libs/tree/develop/blocks/init/src/Blocks/custom
+ or
+ https://github.com/infinum/eightshift-frontend-libs-tailwind/tree/develop/blocks/init/src/Blocks/custom
"),
];
}
@@ -104,11 +106,9 @@ public function __invoke(array $args, array $assocArgs)
$this->moveItems(
$assocArgs,
- Helpers::getProjectPaths('blocksSourceCustom'),
+ $this->isTailwind() ? Helpers::getProjectPaths('blocksSourceTailwindCustom') : Helpers::getProjectPaths('blocksSourceCustom'),
Helpers::getProjectPaths('blocksDestinationCustom'),
- 'block',
- false,
- Helpers::getProjectPaths('blocksPrivateSourceCustom')
+ 'block'
);
}
}
diff --git a/src/Blocks/UseComponentCli.php b/src/Blocks/UseComponentCli.php
index 683bcfc92..c2b62d999 100644
--- a/src/Blocks/UseComponentCli.php
+++ b/src/Blocks/UseComponentCli.php
@@ -91,6 +91,8 @@ public function getDoc(): array
All our components can be found here:
https://github.com/infinum/eightshift-frontend-libs/tree/develop/blocks/init/src/Blocks/components
+ or
+ https://github.com/infinum/eightshift-frontend-libs-tailwind/tree/develop/blocks/init/src/Blocks/components
"),
];
}
@@ -104,11 +106,9 @@ public function __invoke(array $args, array $assocArgs)
$this->moveItems(
$assocArgs,
- Helpers::getProjectPaths('blocksSourceComponents'),
+ $this->isTailwind() ? Helpers::getProjectPaths('blocksSourceTailwindComponents') : Helpers::getProjectPaths('blocksSourceComponents'),
Helpers::getProjectPaths('blocksDestinationComponents'),
- 'component',
- false,
- Helpers::getProjectPaths('blocksPrivateSourceCustom')
+ 'component'
);
if (!$assocArgs[self::ARG_GROUP_OUTPUT]) {
diff --git a/src/Blocks/UseGlobalAssetsCli.php b/src/Blocks/UseGlobalAssetsCli.php
index 13e1aaa26..94037f990 100644
--- a/src/Blocks/UseGlobalAssetsCli.php
+++ b/src/Blocks/UseGlobalAssetsCli.php
@@ -61,6 +61,8 @@ public function getDoc(): array
Global assets will be created from this folder:
https://github.com/infinum/eightshift-frontend-libs/tree/develop/blocks/init/assets
+ or
+ https://github.com/infinum/eightshift-frontend-libs-tailwind/tree/develop/blocks/init/assets
"),
];
}
@@ -79,7 +81,7 @@ public function __invoke(array $args, array $assocArgs)
'name' => 'assets',
],
),
- Helpers::getProjectPaths('blocksGlobalAssetsSource'),
+ $this->isTailwind() ? Helpers::getProjectPaths('blocksGlobalAssetsTailwindSource') : Helpers::getProjectPaths('blocksGlobalAssetsSource'),
Helpers::getProjectPaths('blocksGlobalAssetsDestination'),
'assets folder',
true
diff --git a/src/Blocks/UseManifestCli.php b/src/Blocks/UseManifestCli.php
index aafc8f89b..88c631508 100644
--- a/src/Blocks/UseManifestCli.php
+++ b/src/Blocks/UseManifestCli.php
@@ -60,6 +60,8 @@ public function getDoc(): array
Manifest.json file will be created from this file:
https://github.com/infinum/eightshift-frontend-libs/tree/develop/blocks/init/src/Blocks/manifest.json
+ or
+ https://github.com/infinum/eightshift-frontend-libs-tailwind/tree/develop/blocks/init/src/Blocks/manifest.json
"),
];
}
@@ -78,7 +80,7 @@ public function __invoke(array $args, array $assocArgs)
'name' => 'manifest.json',
],
),
- Helpers::getProjectPaths('blocksSource'),
+ $this->isTailwind() ? Helpers::getProjectPaths('blocksTailwindSource') : Helpers::getProjectPaths('blocksSource'),
Helpers::getProjectPaths('blocksDestination'),
'file'
);
diff --git a/src/Blocks/UseVariationCli.php b/src/Blocks/UseVariationCli.php
index 5325b499f..85acf9403 100644
--- a/src/Blocks/UseVariationCli.php
+++ b/src/Blocks/UseVariationCli.php
@@ -81,6 +81,8 @@ public function getDoc(): array
All our variations can be found here:
https://github.com/infinum/eightshift-frontend-libs/tree/develop/blocks/init/src/Blocks/variations
+ or
+ https://github.com/infinum/eightshift-frontend-libs-tailwind/tree/develop/blocks/init/src/Blocks/variations
"),
];
}
@@ -94,11 +96,9 @@ public function __invoke(array $args, array $assocArgs)
$this->moveItems(
$assocArgs,
- Helpers::getProjectPaths('blocksSourceVariations'),
+ $this->isTailwind() ? Helpers::getProjectPaths('blocksSourceTailwindVariations') : Helpers::getProjectPaths('blocksSourceVariations'),
Helpers::getProjectPaths('blocksDestinationVariations'),
- 'variation',
- false,
- Helpers::getProjectPaths('blocksPrivateSourceCustom')
+ 'variation'
);
if (!$assocArgs[self::ARG_GROUP_OUTPUT]) {
diff --git a/src/Blocks/UseWrapperCli.php b/src/Blocks/UseWrapperCli.php
index 004eb1806..a532ab743 100644
--- a/src/Blocks/UseWrapperCli.php
+++ b/src/Blocks/UseWrapperCli.php
@@ -57,6 +57,8 @@ public function getDoc(): array
Our wrapper can be found here:
https://github.com/infinum/eightshift-frontend-libs/tree/develop/blocks/init/src/Blocks/wrapper
+ or
+ https://github.com/infinum/eightshift-frontend-libs-tailwind/tree/develop/blocks/init/src/Blocks/wrapper
"),
];
}
@@ -75,7 +77,7 @@ public function __invoke(array $args, array $assocArgs)
'name' => 'wrapper',
],
),
- Helpers::getProjectPaths('blocksSourceWrapper'),
+ $this->isTailwind() ? Helpers::getProjectPaths('blocksSourceTailwindWrapper') : Helpers::getProjectPaths('blocksSourceWrapper'),
Helpers::getProjectPaths('blocksDestinationWrapper'),
'wrapper',
true
diff --git a/src/Cli/AbstractCli.php b/src/Cli/AbstractCli.php
index 1ea8881fd..b55dc9800 100644
--- a/src/Cli/AbstractCli.php
+++ b/src/Cli/AbstractCli.php
@@ -134,6 +134,13 @@ abstract class AbstractCli implements CliInterface
*/
public const ARG_FRONTEND_LIBS_VERSION = 'g_frontend_libs_version';
+ /**
+ * Output project frontend libs type arg.
+ *
+ * @var string
+ */
+ public const ARG_FRONTEND_LIBS_TYPE = 'g_frontend_libs_type';
+
/**
* Output namespace arg.
*
@@ -277,6 +284,7 @@ public function prepareSetupArgs(array $args = []): array
self::ARG_SITE_URL => $args[self::ARG_SITE_URL] ?? \site_url(),
self::ARG_LIBS_VERSION => $args[self::ARG_LIBS_VERSION] ?? '',
self::ARG_FRONTEND_LIBS_VERSION => $args[self::ARG_FRONTEND_LIBS_VERSION] ?? '',
+ self::ARG_FRONTEND_LIBS_TYPE => \strtolower($args[self::ARG_FRONTEND_LIBS_TYPE] ?? 'standard'),
self::ARG_SKIP_EXISTING => true,
self::ARG_GROUP_OUTPUT => true,
];
@@ -657,6 +665,7 @@ public function cleanUpInitialBoilerplate(string $destination): void
*
* @param string $libsVersion Version of libs to install.
* @param string $frontendLibsVersion Version of frontend libs to install.
+ * @param string $frontendLibsType Type of frontend libs to install.
* @param string $destination Destination path.
*
* @return void
@@ -664,6 +673,7 @@ public function cleanUpInitialBoilerplate(string $destination): void
public function initMandatoryAfter(
string $libsVersion,
string $frontendLibsVersion,
+ string $frontendLibsType,
string $destination
): void {
$this->cliLog('--------------------------------------------------', 'C');
@@ -681,10 +691,16 @@ public function initMandatoryAfter(
}
$this->cliLog('--------------------------------------------------', 'C');
$this->cliLog('Running npm install', 'C');
+
+ $flibsType = 'frontend-libs';
+ if ($frontendLibsType === 'tailwind') {
+ $flibsType = 'frontend-libs-tailwind';
+ }
+
if ($frontendLibsVersion) {
- \shell_exec("cd {$destination} && npm install infinum/eightshift-frontend-libs#{$frontendLibsVersion}"); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_shell_exec
+ \shell_exec("cd {$destination} && npm install infinum/eightshift-{$flibsType}#{$frontendLibsVersion}"); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_shell_exec
} else {
- \shell_exec("cd {$destination} && npm install @eightshift/frontend-libs"); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_shell_exec
+ \shell_exec("cd {$destination} && npm install @eightshift/{$flibsType}"); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_shell_exec
}
}
@@ -1072,4 +1088,14 @@ public function runCliCommand(string $commandClass, string $commandParentName, a
$args,
));
}
+
+ /**
+ * Check if the project is using Tailwind.
+ *
+ * @return bool
+ */
+ public function isTailwind(): bool
+ {
+ return \file_exists(Helpers::getProjectPaths('blocksTailwindSource'));
+ }
}
diff --git a/src/Helpers/Helpers.php b/src/Helpers/Helpers.php
index f3e0c160f..dc86ad11d 100644
--- a/src/Helpers/Helpers.php
+++ b/src/Helpers/Helpers.php
@@ -226,7 +226,7 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s
}
$flibsPath = ["node_modules", "@eightshift", "frontend-libs", "blocks", "init"];
- $fPLibsPath = ["node_modules", "@eightshift", "frontend-libs-private", "blocks", "init"];
+ $fTailwindLibsPath = ["node_modules", "@eightshift", "frontend-libs-tailwind", "blocks", "init"];
$libsPath = ["vendor", "infinum", "eightshift-libs"];
$libsPrefixedPath = ["vendor-prefixed", "infinum", "eightshift-libs"];
$testsDataPath = ["tests", "data"];
@@ -317,8 +317,22 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s
$path = self::joinPaths([...$testsDataPath, ...$blocksPath]);
}
break;
- case 'blocksPrivateSource':
- $path = self::joinPaths([...$fPLibsPath, ...$blocksPath]);
+ case 'blocksGlobalAssetsTailwindSource':
+ $path = self::joinPaths([...$fTailwindLibsPath, $assetsPath]);
+
+ if (\getenv('ES_TEST')) {
+ $path = self::joinPaths([...$testsDataPath, $assetsPath]);
+ }
+ break;
+ case 'blocksAssetsTailwindSource':
+ $path = self::joinPaths([...$fTailwindLibsPath, ...$blocksPath, $assetsPath]);
+
+ if (\getenv('ES_TEST')) {
+ $path = self::joinPaths([...$testsDataPath, ...$blocksPath, $assetsPath]);
+ }
+ break;
+ case 'blocksTailwindSource':
+ $path = self::joinPaths([...$fTailwindLibsPath, ...$blocksPath]);
if (\getenv('ES_TEST')) {
$path = self::joinPaths([...$testsDataPath, ...$blocksPath]);
@@ -329,26 +343,27 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s
case 'custom':
case 'blocksDestinationCustom':
case 'blocksSourceCustom':
- case 'blocksPrivateSourceCustom':
+ case 'blocksSourceTailwindCustom':
$name = 'custom';
break;
case 'component':
case 'components':
case 'blocksDestinationComponents':
case 'blocksSourceComponents':
- case 'blocksPrivateSourceComponents':
+ case 'blocksSourceTailwindComponents':
$name = 'components';
break;
case 'variation':
case 'variations':
case 'blocksDestinationVariations':
case 'blocksSourceVariations':
- case 'blocksPrivateSourceVariations':
+ case 'blocksSourceTailwindVariations':
$name = 'variations';
break;
case 'wrapper':
case 'blocksDestinationWrapper':
case 'blocksSourceWrapper':
+ case 'blocksSourceTailwindWrapper':
$name = 'wrapper';
break;
case 'blocksGlobalAssetsDestination':
@@ -385,11 +400,11 @@ public static function getProjectPaths(string $type = '', string $suffix = '', s
$path = self::joinPaths([...$testsDataPath, ...$blocksPath, $name]);
}
break;
-
- case 'blocksPrivateSourceCustom':
- case 'blocksPrivateSourceComponents':
- case 'blocksPrivateSourceVariations':
- $path = self::joinPaths([...$fPLibsPath, ...$blocksPath, $name]);
+ case 'blocksSourceTailwindCustom':
+ case 'blocksSourceTailwindComponents':
+ case 'blocksSourceTailwindVariations':
+ case 'blocksSourceTailwindWrapper':
+ $path = self::joinPaths([...$fTailwindLibsPath, ...$blocksPath, $name]);
if (\getenv('ES_TEST')) {
$path = self::joinPaths([...$testsDataPath, ...$blocksPath, $name]);
diff --git a/src/Init/InitPluginSetupCli.php b/src/Init/InitPluginSetupCli.php
index 652e0d17b..471745305 100644
--- a/src/Init/InitPluginSetupCli.php
+++ b/src/Init/InitPluginSetupCli.php
@@ -108,6 +108,12 @@ public function getDoc(): array
'description' => 'Define Eightshift frontend libs version.',
'optional' => true,
],
+ [
+ 'type' => 'assoc',
+ 'name' => self::ARG_FRONTEND_LIBS_TYPE,
+ 'description' => 'Define Eightshift frontend libs type.',
+ 'optional' => true,
+ ],
],
'longdesc' => $this->prepareLongDesc("
## USAGE
@@ -129,11 +135,12 @@ public function __invoke(array $args, array $assocArgs)
$assocArgs = $this->prepareSetupArgs($assocArgs);
$textdomain = $assocArgs[self::ARG_TEXTDOMAIN];
+ $frontendLibsType = $assocArgs[self::ARG_FRONTEND_LIBS_TYPE];
$this->getIntroText($assocArgs);
$sep = \DIRECTORY_SEPARATOR;
- $dir = __DIR__ . "{$sep}plugin";
+ $dir = __DIR__ . "{$sep}{$frontendLibsType}{$sep}plugin";
$files = \array_diff(\scandir($dir), ['..', '.']);
$destionation = Helpers::getProjectPaths('pluginRoot');
@@ -164,6 +171,7 @@ public function __invoke(array $args, array $assocArgs)
$this->initMandatoryAfter(
$assocArgs[self::ARG_LIBS_VERSION],
$assocArgs[self::ARG_FRONTEND_LIBS_VERSION],
+ $assocArgs[self::ARG_FRONTEND_LIBS_TYPE],
$newDestionation
);
$this->cleanUpInitialBoilerplate($newDestionation);
diff --git a/src/Init/InitThemeSetupCli.php b/src/Init/InitThemeSetupCli.php
index 2bd49dec8..d5c54542a 100644
--- a/src/Init/InitThemeSetupCli.php
+++ b/src/Init/InitThemeSetupCli.php
@@ -108,6 +108,12 @@ public function getDoc(): array
'description' => 'Define Eightshift frontend libs version.',
'optional' => true,
],
+ [
+ 'type' => 'assoc',
+ 'name' => self::ARG_FRONTEND_LIBS_TYPE,
+ 'description' => 'Define Eightshift frontend libs type.',
+ 'optional' => true,
+ ],
],
'longdesc' => $this->prepareLongDesc("
## USAGE
@@ -129,11 +135,12 @@ public function __invoke(array $args, array $assocArgs)
$assocArgs = $this->prepareSetupArgs($assocArgs);
$textdomain = $assocArgs[self::ARG_TEXTDOMAIN];
+ $frontendLibsType = $assocArgs[self::ARG_FRONTEND_LIBS_TYPE];
$this->getIntroText($assocArgs);
$sep = \DIRECTORY_SEPARATOR;
- $dir = __DIR__ . "{$sep}theme";
+ $dir = __DIR__ . "{$sep}{$frontendLibsType}{$sep}theme";
$files = \array_diff(\scandir($dir), ['..', '.']);
$destionation = Helpers::getProjectPaths('themeRoot');
@@ -160,6 +167,7 @@ public function __invoke(array $args, array $assocArgs)
$this->initMandatoryAfter(
$assocArgs[self::ARG_LIBS_VERSION],
$assocArgs[self::ARG_FRONTEND_LIBS_VERSION],
+ $assocArgs[self::ARG_FRONTEND_LIBS_TYPE],
$newDestionation
);
$this->cleanUpInitialBoilerplate($newDestionation);
diff --git a/src/Init/plugin/babel.config.js b/src/Init/plugin/babel.config.js
deleted file mode 100644
index 8d62641ba..000000000
--- a/src/Init/plugin/babel.config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- extends: './node_modules/@eightshift/frontend-libs/babel/babel.config.js',
-};
\ No newline at end of file
diff --git a/src/Init/plugin/.browserslistrc b/src/Init/standard/plugin/.browserslistrc
similarity index 100%
rename from src/Init/plugin/.browserslistrc
rename to src/Init/standard/plugin/.browserslistrc
diff --git a/src/Init/plugin/.eslintignore b/src/Init/standard/plugin/.eslintignore
similarity index 100%
rename from src/Init/plugin/.eslintignore
rename to src/Init/standard/plugin/.eslintignore
diff --git a/src/Init/plugin/.eslintrc b/src/Init/standard/plugin/.eslintrc
similarity index 100%
rename from src/Init/plugin/.eslintrc
rename to src/Init/standard/plugin/.eslintrc
diff --git a/src/Init/plugin/.gitignore b/src/Init/standard/plugin/.gitignore
similarity index 100%
rename from src/Init/plugin/.gitignore
rename to src/Init/standard/plugin/.gitignore
diff --git a/src/Init/plugin/.stylelintrc b/src/Init/standard/plugin/.stylelintrc
similarity index 100%
rename from src/Init/plugin/.stylelintrc
rename to src/Init/standard/plugin/.stylelintrc
diff --git a/src/Init/plugin/README.md b/src/Init/standard/plugin/README.md
similarity index 100%
rename from src/Init/plugin/README.md
rename to src/Init/standard/plugin/README.md
diff --git a/src/Init/plugin/composer.json b/src/Init/standard/plugin/composer.json
similarity index 100%
rename from src/Init/plugin/composer.json
rename to src/Init/standard/plugin/composer.json
diff --git a/src/Init/plugin/eightshift-boilerplate-plugin.php b/src/Init/standard/plugin/eightshift-boilerplate-plugin.php
similarity index 100%
rename from src/Init/plugin/eightshift-boilerplate-plugin.php
rename to src/Init/standard/plugin/eightshift-boilerplate-plugin.php
diff --git a/src/Init/theme/package.json b/src/Init/standard/plugin/package.json
similarity index 91%
rename from src/Init/theme/package.json
rename to src/Init/standard/plugin/package.json
index 8ddcb5def..034a55fcc 100644
--- a/src/Init/theme/package.json
+++ b/src/Init/standard/plugin/package.json
@@ -8,7 +8,7 @@
"lintJs": "eslint src/ assets/",
"lint": "npm run lintJs && npm run lintStyle && composer standards:check -- --filter=gitstaged",
"start": "webpack --watch --mode development",
- "build": "webpack --progress --mode production"
+ "build": "webpack --mode production"
},
"devDependencies": {
"husky": "^9.0.11",
diff --git a/src/Init/plugin/phpcs.xml.dist b/src/Init/standard/plugin/phpcs.xml.dist
similarity index 100%
rename from src/Init/plugin/phpcs.xml.dist
rename to src/Init/standard/plugin/phpcs.xml.dist
diff --git a/src/Init/plugin/phpstan.neon.dist b/src/Init/standard/plugin/phpstan.neon.dist
similarity index 100%
rename from src/Init/plugin/phpstan.neon.dist
rename to src/Init/standard/plugin/phpstan.neon.dist
diff --git a/src/Init/plugin/postcss.config.js b/src/Init/standard/plugin/postcss.config.js
similarity index 100%
rename from src/Init/plugin/postcss.config.js
rename to src/Init/standard/plugin/postcss.config.js
diff --git a/src/Init/plugin/strauss.phar b/src/Init/standard/plugin/strauss.phar
similarity index 100%
rename from src/Init/plugin/strauss.phar
rename to src/Init/standard/plugin/strauss.phar
diff --git a/src/Init/plugin/uninstall.php b/src/Init/standard/plugin/uninstall.php
similarity index 100%
rename from src/Init/plugin/uninstall.php
rename to src/Init/standard/plugin/uninstall.php
diff --git a/src/Init/plugin/webpack.config.js b/src/Init/standard/plugin/webpack.config.js
similarity index 88%
rename from src/Init/plugin/webpack.config.js
rename to src/Init/standard/plugin/webpack.config.js
index ae9f7a268..e33327090 100644
--- a/src/Init/plugin/webpack.config.js
+++ b/src/Init/standard/plugin/webpack.config.js
@@ -15,5 +15,5 @@
};
// Generate webpack config for this project using options object.
- return require('./node_modules/@eightshift/frontend-libs/webpack')(argv.mode, projectConfig);
+ return require('@eightshift/frontend-libs/webpack')(argv.mode, projectConfig);
};
diff --git a/src/Init/theme/.browserslistrc b/src/Init/standard/theme/.browserslistrc
similarity index 100%
rename from src/Init/theme/.browserslistrc
rename to src/Init/standard/theme/.browserslistrc
diff --git a/src/Init/theme/.eslintignore b/src/Init/standard/theme/.eslintignore
similarity index 100%
rename from src/Init/theme/.eslintignore
rename to src/Init/standard/theme/.eslintignore
diff --git a/src/Init/theme/.eslintrc b/src/Init/standard/theme/.eslintrc
similarity index 100%
rename from src/Init/theme/.eslintrc
rename to src/Init/standard/theme/.eslintrc
diff --git a/src/Init/theme/.gitignore b/src/Init/standard/theme/.gitignore
similarity index 100%
rename from src/Init/theme/.gitignore
rename to src/Init/standard/theme/.gitignore
diff --git a/src/Init/theme/.stylelintrc b/src/Init/standard/theme/.stylelintrc
similarity index 100%
rename from src/Init/theme/.stylelintrc
rename to src/Init/standard/theme/.stylelintrc
diff --git a/src/Init/theme/404.php b/src/Init/standard/theme/404.php
similarity index 100%
rename from src/Init/theme/404.php
rename to src/Init/standard/theme/404.php
diff --git a/src/Init/theme/README.md b/src/Init/standard/theme/README.md
similarity index 100%
rename from src/Init/theme/README.md
rename to src/Init/standard/theme/README.md
diff --git a/src/Init/theme/composer.json b/src/Init/standard/theme/composer.json
similarity index 100%
rename from src/Init/theme/composer.json
rename to src/Init/standard/theme/composer.json
diff --git a/src/Init/theme/footer.php b/src/Init/standard/theme/footer.php
similarity index 100%
rename from src/Init/theme/footer.php
rename to src/Init/standard/theme/footer.php
diff --git a/src/Init/theme/functions.php b/src/Init/standard/theme/functions.php
similarity index 100%
rename from src/Init/theme/functions.php
rename to src/Init/standard/theme/functions.php
diff --git a/src/Init/theme/header.php b/src/Init/standard/theme/header.php
similarity index 100%
rename from src/Init/theme/header.php
rename to src/Init/standard/theme/header.php
diff --git a/src/Init/theme/index.php b/src/Init/standard/theme/index.php
similarity index 100%
rename from src/Init/theme/index.php
rename to src/Init/standard/theme/index.php
diff --git a/src/Init/plugin/package.json b/src/Init/standard/theme/package.json
similarity index 91%
rename from src/Init/plugin/package.json
rename to src/Init/standard/theme/package.json
index 8ddcb5def..034a55fcc 100644
--- a/src/Init/plugin/package.json
+++ b/src/Init/standard/theme/package.json
@@ -8,7 +8,7 @@
"lintJs": "eslint src/ assets/",
"lint": "npm run lintJs && npm run lintStyle && composer standards:check -- --filter=gitstaged",
"start": "webpack --watch --mode development",
- "build": "webpack --progress --mode production"
+ "build": "webpack --mode production"
},
"devDependencies": {
"husky": "^9.0.11",
diff --git a/src/Init/theme/page.php b/src/Init/standard/theme/page.php
similarity index 100%
rename from src/Init/theme/page.php
rename to src/Init/standard/theme/page.php
diff --git a/src/Init/theme/phpcs.xml.dist b/src/Init/standard/theme/phpcs.xml.dist
similarity index 100%
rename from src/Init/theme/phpcs.xml.dist
rename to src/Init/standard/theme/phpcs.xml.dist
diff --git a/src/Init/theme/phpstan.neon.dist b/src/Init/standard/theme/phpstan.neon.dist
similarity index 100%
rename from src/Init/theme/phpstan.neon.dist
rename to src/Init/standard/theme/phpstan.neon.dist
diff --git a/src/Init/theme/postcss.config.js b/src/Init/standard/theme/postcss.config.js
similarity index 100%
rename from src/Init/theme/postcss.config.js
rename to src/Init/standard/theme/postcss.config.js
diff --git a/src/Init/theme/screenshot.png b/src/Init/standard/theme/screenshot.png
similarity index 100%
rename from src/Init/theme/screenshot.png
rename to src/Init/standard/theme/screenshot.png
diff --git a/src/Init/theme/single.php b/src/Init/standard/theme/single.php
similarity index 100%
rename from src/Init/theme/single.php
rename to src/Init/standard/theme/single.php
diff --git a/src/Init/theme/strauss.phar b/src/Init/standard/theme/strauss.phar
similarity index 100%
rename from src/Init/theme/strauss.phar
rename to src/Init/standard/theme/strauss.phar
diff --git a/src/Init/theme/style.css b/src/Init/standard/theme/style.css
similarity index 100%
rename from src/Init/theme/style.css
rename to src/Init/standard/theme/style.css
diff --git a/src/Init/theme/webpack.config.js b/src/Init/standard/theme/webpack.config.js
similarity index 100%
rename from src/Init/theme/webpack.config.js
rename to src/Init/standard/theme/webpack.config.js
diff --git a/src/Init/tailwind/plugin/.browserslistrc b/src/Init/tailwind/plugin/.browserslistrc
new file mode 100644
index 000000000..bdc10da10
--- /dev/null
+++ b/src/Init/tailwind/plugin/.browserslistrc
@@ -0,0 +1,3 @@
+defaults
+not IE 11
+not op_mini all
diff --git a/src/Init/tailwind/plugin/.eslintignore b/src/Init/tailwind/plugin/.eslintignore
new file mode 100644
index 000000000..9f9b48d05
--- /dev/null
+++ b/src/Init/tailwind/plugin/.eslintignore
@@ -0,0 +1 @@
+public/**/*.js
diff --git a/src/Init/tailwind/plugin/.eslintrc b/src/Init/tailwind/plugin/.eslintrc
new file mode 100644
index 000000000..c66d4f005
--- /dev/null
+++ b/src/Init/tailwind/plugin/.eslintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "./node_modules/@eightshift/frontend-libs-tailwind/linters/eslint.config.js"
+}
diff --git a/src/Init/tailwind/plugin/.gitignore b/src/Init/tailwind/plugin/.gitignore
new file mode 100644
index 000000000..6ffcec905
--- /dev/null
+++ b/src/Init/tailwind/plugin/.gitignore
@@ -0,0 +1,6 @@
+# Project Specific
+/public
+/vendor
+/vendor-prefixed
+/node_modules
+.DS_Store
diff --git a/src/Init/tailwind/plugin/.stylelintrc b/src/Init/tailwind/plugin/.stylelintrc
new file mode 100644
index 000000000..de27f7569
--- /dev/null
+++ b/src/Init/tailwind/plugin/.stylelintrc
@@ -0,0 +1,5 @@
+
+{
+ "extends": "./node_modules/@eightshift/frontend-libs-tailwind/linters/stylelint.config.js",
+ "ignoreFiles": "public/**/*.css"
+}
diff --git a/src/Init/tailwind/plugin/README.md b/src/Init/tailwind/plugin/README.md
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/Init/tailwind/plugin/composer.json b/src/Init/tailwind/plugin/composer.json
new file mode 100644
index 000000000..5c23710a6
--- /dev/null
+++ b/src/Init/tailwind/plugin/composer.json
@@ -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$/"]
+ }
+ }
+ }
+}
diff --git a/src/Init/tailwind/plugin/eightshift-boilerplate-plugin.php b/src/Init/tailwind/plugin/eightshift-boilerplate-plugin.php
new file mode 100644
index 000000000..56fa168fe
--- /dev/null
+++ b/src/Init/tailwind/plugin/eightshift-boilerplate-plugin.php
@@ -0,0 +1,95 @@
+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');
+}
diff --git a/src/Init/tailwind/plugin/package.json b/src/Init/tailwind/plugin/package.json
new file mode 100644
index 000000000..034a55fcc
--- /dev/null
+++ b/src/Init/tailwind/plugin/package.json
@@ -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"
+ }
+ }
+}
diff --git a/src/Init/tailwind/plugin/phpcs.xml.dist b/src/Init/tailwind/plugin/phpcs.xml.dist
new file mode 100644
index 000000000..3d5ae47d7
--- /dev/null
+++ b/src/Init/tailwind/plugin/phpcs.xml.dist
@@ -0,0 +1,37 @@
+
+
+ Ruleset for the Eightshift Boilerplate Plugin.
+
+
+
+ */tests/*
+ */vendor/*
+ */vendor-prefixed/*
+ */public/*
+ */node_modules/*
+
+
+
+
+
+
+
+ .
+
+
+
+
+
+
+
+
+ /src/CompiledContainer\.php
+
+
+
+
+
+
+
+
+
diff --git a/src/Init/tailwind/plugin/phpstan.neon.dist b/src/Init/tailwind/plugin/phpstan.neon.dist
new file mode 100644
index 000000000..1a7ad2080
--- /dev/null
+++ b/src/Init/tailwind/plugin/phpstan.neon.dist
@@ -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
diff --git a/src/Init/tailwind/plugin/postcss.config.js b/src/Init/tailwind/plugin/postcss.config.js
new file mode 100644
index 000000000..ef176f5bf
--- /dev/null
+++ b/src/Init/tailwind/plugin/postcss.config.js
@@ -0,0 +1,7 @@
+const autoprefixer = require('autoprefixer');
+
+module.exports = {
+ plugins: [
+ autoprefixer,
+ ],
+};
\ No newline at end of file
diff --git a/src/Init/tailwind/plugin/strauss.phar b/src/Init/tailwind/plugin/strauss.phar
new file mode 100644
index 000000000..3e6f472a6
Binary files /dev/null and b/src/Init/tailwind/plugin/strauss.phar differ
diff --git a/src/Init/tailwind/plugin/tailwind.config.js b/src/Init/tailwind/plugin/tailwind.config.js
new file mode 100644
index 000000000..fa26b13d2
--- /dev/null
+++ b/src/Init/tailwind/plugin/tailwind.config.js
@@ -0,0 +1,79 @@
+const defaultTheme = require('tailwindcss/defaultTheme');
+import { processEightshiftClasses, getScreens } from '@eightshift/frontend-libs-tailwind/scripts/editor/tailwindcss';
+import globalManifest from './src/Blocks/manifest.json';
+import fluid, { extract } from 'fluid-tailwind';
+import plugin from 'tailwindcss/plugin';
+import animate from 'tailwindcss-animate';
+import { themeColors } from './assets/scripts/theme-colors';
+
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: {
+ files: ['./src/**/*.{html,js,php,json}', './**/*.php'],
+ transform: processEightshiftClasses(Object.keys(globalManifest.globalVariables.breakpoints)),
+ extract,
+ },
+ theme: {
+ colors: themeColors,
+ screens: getScreens(globalManifest.globalVariables.breakpoints),
+ extend: {
+ fontFamily: {
+ sans: ['Noto Sans', ...defaultTheme.fontFamily.sans],
+ display: ['Fraunces', ...defaultTheme.fontFamily.serif],
+ },
+ gridColumnEnd: {
+ 'span-1': 'span 1',
+ 'span-2': 'span 2',
+ 'span-3': 'span 3',
+ 'span-4': 'span 4',
+ 'span-5': 'span 5',
+ 'span-6': 'span 6',
+ 'span-7': 'span 7',
+ 'span-8': 'span 8',
+ 'span-9': 'span 9',
+ 'span-10': 'span 10',
+ 'span-11': 'span 11',
+ 'span-12': 'span 12',
+ },
+ gridRowEnd: {
+ 'span-1': 'span 1',
+ 'span-2': 'span 2',
+ 'span-3': 'span 3',
+ 'span-4': 'span 4',
+ 'span-5': 'span 5',
+ 'span-6': 'span 6',
+ 'span-7': 'span 7',
+ 'span-8': 'span 8',
+ 'span-9': 'span 9',
+ 'span-10': 'span 10',
+ 'span-11': 'span 11',
+ 'span-12': 'span 12',
+ },
+ rotate: {
+ 135: '135deg',
+ },
+ aspectRatio: {
+ '3/2': '3 / 2',
+ '5/4': '5 / 4',
+ '21/9': '21 / 9',
+ },
+ },
+ },
+ plugins: [
+ fluid(),
+ animate,
+ plugin(({ addComponents, addVariant }) => {
+ addComponents({
+ '.font-synthesis-none': {
+ 'font-synthesis': 'none',
+ },
+ '.font-synthesis': {
+ 'font-synthesis': 'auto',
+ },
+ });
+ addVariant('open', '&.is-open');
+ addVariant('wp-logged-in', 'body.logged-in &');
+ addVariant('wp-logged-in-mobile', '@media (max-width: 782px) { body.logged-in & }');
+ }),
+ ],
+};
diff --git a/src/Init/tailwind/plugin/uninstall.php b/src/Init/tailwind/plugin/uninstall.php
new file mode 100644
index 000000000..8bd7cfc78
--- /dev/null
+++ b/src/Init/tailwind/plugin/uninstall.php
@@ -0,0 +1,18 @@
+ {
+
+ const projectConfig = {
+ config: {
+ projectDir: __dirname, // Current project directory absolute path.
+ projectUrl: '%g_site_url%', // Used for providing browsersync functionality.
+ projectPath: 'wp-content/plugins/%g_textdomain%', // Project path relative to project root.
+ },
+ };
+
+ // Generate webpack config for this project using options object.
+ return require('@eightshift/frontend-libs-tailwind/webpack')(argv.mode, projectConfig);
+};
diff --git a/src/Init/tailwind/theme/.browserslistrc b/src/Init/tailwind/theme/.browserslistrc
new file mode 100644
index 000000000..bdc10da10
--- /dev/null
+++ b/src/Init/tailwind/theme/.browserslistrc
@@ -0,0 +1,3 @@
+defaults
+not IE 11
+not op_mini all
diff --git a/src/Init/tailwind/theme/.eslintignore b/src/Init/tailwind/theme/.eslintignore
new file mode 100644
index 000000000..9f9b48d05
--- /dev/null
+++ b/src/Init/tailwind/theme/.eslintignore
@@ -0,0 +1 @@
+public/**/*.js
diff --git a/src/Init/tailwind/theme/.eslintrc b/src/Init/tailwind/theme/.eslintrc
new file mode 100644
index 000000000..c66d4f005
--- /dev/null
+++ b/src/Init/tailwind/theme/.eslintrc
@@ -0,0 +1,3 @@
+{
+ "extends": "./node_modules/@eightshift/frontend-libs-tailwind/linters/eslint.config.js"
+}
diff --git a/src/Init/tailwind/theme/.gitignore b/src/Init/tailwind/theme/.gitignore
new file mode 100644
index 000000000..6ffcec905
--- /dev/null
+++ b/src/Init/tailwind/theme/.gitignore
@@ -0,0 +1,6 @@
+# Project Specific
+/public
+/vendor
+/vendor-prefixed
+/node_modules
+.DS_Store
diff --git a/src/Init/tailwind/theme/.stylelintrc b/src/Init/tailwind/theme/.stylelintrc
new file mode 100644
index 000000000..2f30a4605
--- /dev/null
+++ b/src/Init/tailwind/theme/.stylelintrc
@@ -0,0 +1,4 @@
+{
+ "extends": "./node_modules/@eightshift/frontend-libs-tailwind/linters/stylelint.config.js",
+ "ignoreFiles": "public/**/*.css"
+}
diff --git a/src/Init/tailwind/theme/404.php b/src/Init/tailwind/theme/404.php
new file mode 100644
index 000000000..0b7c129a0
--- /dev/null
+++ b/src/Init/tailwind/theme/404.php
@@ -0,0 +1,13 @@
+=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$/"]
+ }
+ }
+ }
+}
diff --git a/src/Init/tailwind/theme/footer.php b/src/Init/tailwind/theme/footer.php
new file mode 100644
index 000000000..e9e6c7137
--- /dev/null
+++ b/src/Init/tailwind/theme/footer.php
@@ -0,0 +1,22 @@
+
+
+
+
+
+