diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ec9999..f7b1a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # nystudio107/craft Change Log +## 2.4.51 - 2021.12.22 +### Changed +* Updated to use a unified `bootstrap.php` +* Updated to use `vlucas/phpdotenv` `^5.4.0` +* Updated to Tailwind CSS `^3.0.0` + ## 2.4.50 - 2021.12.07 ### Changed * Use Node 16 for the webpack buildchain container diff --git a/buildchain/package.json b/buildchain/package.json index 0af211d..8c1b698 100644 --- a/buildchain/package.json +++ b/buildchain/package.json @@ -38,7 +38,6 @@ "core-js": "^3.0.0", "lazysizes": "^5.2.2", "regenerator-runtime": "^0.13.2", - "tailwindcss": "^2.1.0", "vue": "^3.0.0", "vue-confetti": "^2.0.8" }, @@ -102,6 +101,7 @@ "stylelint": "^13.7.0", "stylelint-config-recommended": "^3.0.0", "symlink-webpack-plugin": "^0.0.4", + "tailwindcss": "^3.0.0", "terser-webpack-plugin": "^5.0.0", "ts-loader": "^8.0.0", "tsconfig-paths-webpack-plugin": "^3.3.0", diff --git a/buildchain/tailwind.config.js b/buildchain/tailwind.config.js index 219a3dc..0269fee 100644 --- a/buildchain/tailwind.config.js +++ b/buildchain/tailwind.config.js @@ -1,26 +1,11 @@ // module exports module.exports = { - mode: 'jit', - purge: { - content: [ - '../cms/templates/**/*.{twig,html}', - '../src/vue/**/*.{vue,html}', - ], - layers: [ - 'base', - 'components', - 'utilities', - ], - mode: 'layers', - options: { - } - }, + content: [ + '../cms/templates/**/*.{twig,html}', + '../src/vue/**/*.{vue,html}', + '../src/css/components/**/*.css', + ], theme: { - // Extend the default Tailwind config here - extend: { - }, - // Replace the default Tailwind config here }, - corePlugins: {}, plugins: [], }; diff --git a/buildchain/webpack-configs/postcss-loader.config.js b/buildchain/webpack-configs/postcss-loader.config.js index debf85f..3056865 100644 --- a/buildchain/webpack-configs/postcss-loader.config.js +++ b/buildchain/webpack-configs/postcss-loader.config.js @@ -37,11 +37,11 @@ module.exports = (type = 'modern', settings) => { ['postcss-import', { path: ['./node_modules'], }], + ['tailwindcss/nesting', { + }], TailwindCss('./tailwind.config.js'), ['postcss-mixins', { }], - ['postcss-nested', { - }], ['postcss-hexrgba', { }], ...postCssPlugins, diff --git a/cms/bootstrap.php b/cms/bootstrap.php new file mode 100644 index 0000000..2502887 --- /dev/null +++ b/cms/bootstrap.php @@ -0,0 +1,20 @@ +safeLoad(); +} + +// Define additional PHP constants +// (see https://craftcms.com/docs/3.x/config/#php-constants) +define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); diff --git a/cms/composer.json b/cms/composer.json index 118dfca..30b5c62 100644 --- a/cms/composer.json +++ b/cms/composer.json @@ -1,7 +1,7 @@ { "require": { "craftcms/cms": "^3.6.9", - "vlucas/phpdotenv": "^3.4.0", + "vlucas/phpdotenv": "^5.4.0", "yiisoft/yii2-redis": "^2.0.6", "nystudio107/craft-imageoptimize": "^1.0.0", "nystudio107/craft-fastcgicachebust": "^1.0.0", diff --git a/cms/craft b/cms/craft index f7d775b..547e508 100755 --- a/cms/craft +++ b/cms/craft @@ -4,20 +4,11 @@ * Craft console bootstrap file */ -// Set path constants -define('CRAFT_BASE_PATH', __DIR__); -define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH.'/vendor'); - -// Load Composer's autoloader -require_once CRAFT_VENDOR_PATH.'/autoload.php'; - -// Load dotenv? -if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) { - Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load(); -} +// Load shared bootstrap +require __DIR__ . '/bootstrap.php'; // Load and run Craft -define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); -$app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/console.php'; +/** @var craft\console\Application $app */ +$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/console.php'; $exitCode = $app->run(); exit($exitCode); diff --git a/cms/web/index.php b/cms/web/index.php index b310965..774c24f 100644 --- a/cms/web/index.php +++ b/cms/web/index.php @@ -3,19 +3,10 @@ * Craft web bootstrap file */ -// Set path constants -define('CRAFT_BASE_PATH', dirname(__DIR__)); -define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH.'/vendor'); - -// Load Composer's autoloader -require_once CRAFT_VENDOR_PATH.'/autoload.php'; - -// Load dotenv? -if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) { - Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load(); -} +// Load shared bootstrap +require dirname(__DIR__) . '/bootstrap.php'; // Load and run Craft -define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); -$app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php'; +/** @var craft\web\Application $app */ +$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php'; $app->run();