diff --git a/.editorconfig b/.editorconfig index 2ca82c5eee..daa51f26a7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,7 @@ insert_final_newline = true indent_style = space indent_size = 2 trim_trailing_whitespace = true +quote_type = single [*.md] trim_trailing_whitespace = false diff --git a/.github/labeler.yml b/.github/labeler.yml index 557156db29..c20a60dbcc 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,21 +1,27 @@ build: -- .eslintrc.js -- .prettierrc -- .stylelintrc -- bud.config.js -- tsconfig.json - + - changed-files: + - any-glob-to-any-file: + - .eslintrc.js + - .prettierrc + - .stylelintrc + - bud.config.js + - tsconfig.json dependencies: -- yarn.lock - + - changed-files: + - any-glob-to-any-file: + - yarn.lock javascript: -- resources/scripts/**/*.js - + - changed-files: + - any-glob-to-any-file: + - resources/scripts/**/*.js php: -- functions.php -- app/**/*.php -- resources/views/**/*.php - + - changed-files: + - any-glob-to-any-file: + - functions.php + - app/**/*.php + - resources/views/**/*.php views: -- index.php -- resources/views/**/*.php + - changed-files: + - any-glob-to-any-file: + - index.php + - resources/views/**/*.php diff --git a/.github/renovate.json b/.github/renovate.json index 9864c0890d..fbbea0eaf4 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,17 +1,17 @@ { "baseBranches": ["main"], - "commitMessageAction": "Bump", - "commitMessageTopic": "📦 update {{depName}}", - "extends": ["config:base", "schedule:daily"], + "commitMessageAction": "⬆️ Bump", + "commitMessageTopic": "{{depName}}", + "extends": ["config:base", "schedule:weekly"], "packageRules": [ { - "automerge": true, "matchUpdateTypes": ["minor", "patch", "pin"] }, { - "groupName": "roots", - "matchPackagePrefixes": ["@roots/"] + "groupName": "Bud", + "matchPackagePrefixes": ["@roots/"], + "schedule": ["at any time"] } ], - "timezone": "America/Los_Angeles" + "timezone": "America/Chicago" } diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 31e78f82a6..80bba040d0 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -6,6 +6,6 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 16206eec09..cbcbcff52e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,29 +15,20 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: - node: ['16'] + node: ['20'] steps: - name: Checkout the project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup the Node ${{ matrix.node }} environment on ${{ runner.os }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} + cache: 'yarn' env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Restore the Yarn cache directory - id: yarncache - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - with: - path: ${{ steps.yarncache.outputs.dir }} - key: ${{ runner.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ runner.os }}-${{ matrix.node }}-yarn- - - name: Install dependencies using Yarn run: yarn install --frozen-lockfile @@ -53,11 +44,11 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: - php: ['7.4', '8.0', '8.1'] + php: ['8.1', '8.2'] steps: - name: Checkout the project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }} uses: shivammathur/setup-php@v2 @@ -65,13 +56,13 @@ jobs: php-version: ${{ matrix.php }} coverage: xdebug env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Restore the Composer cache directory id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ${{ steps.composercache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} @@ -80,5 +71,5 @@ jobs: - name: Install Composer dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest - - name: Execute the PHP lint script - run: composer run-script lint + - name: Run Pint + run: vendor/bin/pint --test diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index a27aab935e..0000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,68 +0,0 @@ -## HEAD - -* [Full changelog](https://github.com/roots/sage/compare/v10.2.0...main) - -## 10.2.0: July 19th, 2022 - -* [Full changelog](https://github.com/roots/sage/compare/v10.1.7...v10.2.0) - -## 10.1.7: May 30th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.7) -* [Full changelog](https://github.com/roots/sage/compare/v10.1.6...v10.1.7) - - -## 10.1.6: March 30th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.6) -* [Full changelog](https://github.com/roots/sage/compare/v10.1.5...v10.1.6) - -## 10.1.5: March 29th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.5) -* [Full changelog](https://github.com/roots/sage/compare/v10.1.4...v10.1.5) - -## 10.1.4: March 27th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.4) -* [Full changelog](https://github.com/roots/sage/compare/v10.1.3...v10.1.4) - -## 10.1.3: March 25th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.3) -* [Full changelog](https://github.com/roots/sage/compare/v10.1.2...v10.1.3) - -## 10.1.2: March 17th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.2) -* [Full changelog](https://github.com/roots/sage/compare/v10.1.1...v10.1.2) - -## 10.1.1: March 9th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.1) -* [Full changelog](https://github.com/roots/sage/compare/v10.0.1...v10.1.1) - -## 10.1.0: March 8th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.1.0) -* [Full changelog](https://github.com/roots/sage/compare/v10.0.0...v10.1.0) - -## 10.0.0: March 1st, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/v10.0.0) -* [Full changelog](https://github.com/roots/sage/compare/10.0.0-beta.3...v10.0.0) - -## 10.0.0-beta.3: February 14th, 2022 - -* [Release notes](https://github.com/roots/sage/releases/tag/10.0.0-beta.3) -* [Full changelog](https://github.com/roots/sage/compare/10.0.0-beta.2...10.0.0-beta.3) - -## 10.0.0-beta.2: December 21st, 2021 - -* [Release notes](https://github.com/roots/sage/releases/tag/10.0.0-beta.2) -* [Full changelog](https://github.com/roots/sage/compare/10.0.0-beta.1...10.0.0-beta.2) - -## 10.0.0-beta.1: October 21st, 2021 - -* [Release notes](https://github.com/roots/sage/releases/tag/10.0.0-beta.1) -* [Full changelog](https://github.com/roots/sage/compare/9.0.9...10.0.0-beta.1) diff --git a/README.md b/README.md index 0978fafe72..d99f229086 100644 --- a/README.md +++ b/README.md @@ -5,133 +5,50 @@
-- WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow -
+Advanced WordPress starter theme with Tailwind CSS and Laravel Blade
- Website
Documentation
Releases
Support
+ Website Documentation Releases Community
'.__('Pages:', 'sage'), + 'after' => '
', + ]); + } } diff --git a/app/setup.php b/app/setup.php index fe33dc4941..695a7b37e6 100644 --- a/app/setup.php +++ b/app/setup.php @@ -32,18 +32,6 @@ * @return void */ add_action('after_setup_theme', function () { - /** - * Enable features from the Soil plugin if activated. - * - * @link https://roots.io/plugins/soil/ - */ - add_theme_support('soil', [ - 'clean-up', - 'nav-walker', - 'nice-search', - 'relative-urls', - ]); - /** * Disable full-site editing support. * @@ -84,7 +72,7 @@ /** * Enable responsive embed support. * - * @link https://wordpress.org/gutenberg/handbook/designers-developers/developers/themes/theme-support/#responsive-embedded-content + * @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#responsive-embedded-content */ add_theme_support('responsive-embeds'); @@ -106,7 +94,7 @@ /** * Enable selective refresh for widgets in customizer. * - * @link https://developer.wordpress.org/themes/advanced-topics/customizer-api/#theme-support-in-sidebars + * @link https://developer.wordpress.org/reference/functions/add_theme_support/#customize-selective-refresh-widgets */ add_theme_support('customize-selective-refresh-widgets'); }, 20); diff --git a/bud.config.js b/bud.config.js new file mode 100644 index 0000000000..51948e7b98 --- /dev/null +++ b/bud.config.js @@ -0,0 +1,80 @@ +/** + * Compiler configuration + * + * @see {@link https://roots.io/sage/docs sage documentation} + * @see {@link https://bud.js.org/learn/config bud.js configuration guide} + * + * @type {import('@roots/bud').Config} + */ +export default async (app) => { + /** + * Application assets & entrypoints + * + * @see {@link https://bud.js.org/reference/bud.entry} + * @see {@link https://bud.js.org/reference/bud.assets} + */ + app + .entry('app', ['@scripts/app', '@styles/app']) + .entry('editor', ['@scripts/editor', '@styles/editor']) + .assets(['images']); + + /** + * Set public path + * + * @see {@link https://bud.js.org/reference/bud.setPublicPath} + */ + app.setPublicPath('/app/themes/sage/public/'); + + /** + * Development server settings + * + * @see {@link https://bud.js.org/reference/bud.setUrl} + * @see {@link https://bud.js.org/reference/bud.setProxyUrl} + * @see {@link https://bud.js.org/reference/bud.watch} + */ + app + .setUrl('http://localhost:3000') + .setProxyUrl('http://example.test') + .watch(['resources/views', 'app']); + + /** + * Generate WordPress `theme.json` + * + * @note This overwrites `theme.json` on every build. + * + * @see {@link https://bud.js.org/extensions/sage/theme.json} + * @see {@link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json} + */ + app.wpjson + .setSettings({ + background: { + backgroundImage: true, + }, + color: { + custom: false, + customDuotone: false, + customGradient: false, + defaultDuotone: false, + defaultGradients: false, + defaultPalette: false, + duotone: [], + }, + custom: { + spacing: {}, + typography: { + 'font-size': {}, + 'line-height': {}, + }, + }, + spacing: { + padding: true, + units: ['px', '%', 'em', 'rem', 'vw', 'vh'], + }, + typography: { + customFontSize: false, + }, + }) + .useTailwindColors() + .useTailwindFontFamily() + .useTailwindFontSize(); +}; diff --git a/bud.config.mjs b/bud.config.mjs deleted file mode 100644 index 4b7f37db61..0000000000 --- a/bud.config.mjs +++ /dev/null @@ -1,43 +0,0 @@ -// @ts-check - -/** - * Build configuration - * - * @see {@link https://bud.js.org/guides/getting-started/configure} - * @param {import('@roots/bud').Bud} app - */ -export default async (app) => { - app - /** - * Application entrypoints - */ - .entry({ - app: ["@scripts/app", "@styles/app"], - editor: ["@scripts/editor", "@styles/editor"], - }) - - /** - * Directory contents to be included in the compilation - */ - .assets(["images"]) - - /** - * Matched files trigger a page reload when modified - */ - .watch(["resources/views/**/*", "app/**/*"]) - - /** - * Proxy origin (`WP_HOME`) - */ - .proxy("http://example.test") - - /** - * Development origin - */ - .serve("http://0.0.0.0:3000") - - /** - * URI of the `public` directory - */ - .setPublicPath("/app/themes/sage/public/"); -}; diff --git a/composer.json b/composer.json index e62a3a6d6a..97e64d1565 100644 --- a/composer.json +++ b/composer.json @@ -39,14 +39,13 @@ } }, "require": { - "php": "^7.4|^8.0" + "php": ">=8.1" }, "require-dev": { - "squizlabs/php_codesniffer": "3.7.1" + "laravel/pint": "^1.13" }, "suggest": { - "log1x/sage-directives": "A collection of useful Blade directives for WordPress and Sage (^1.0).", - "log1x/sage-svg": "A useful SVG directive for inlining SVG's within Blade views (^1.0)." + "log1x/sage-directives": "A collection of useful Blade directives for WordPress and Sage (^1.0)." }, "config": { "optimize-autoloader": true, @@ -55,11 +54,6 @@ }, "minimum-stability": "dev", "prefer-stable": true, - "scripts": { - "lint": [ - "phpcs --extensions=php --standard=PSR12 app" - ] - }, "extra": { "acorn": { "providers": [ diff --git a/functions.php b/functions.php index 72b371b161..9b1b0c0947 100644 --- a/functions.php +++ b/functions.php @@ -29,19 +29,19 @@ | */ -try { - \Roots\bootloader(); -} catch (Throwable $e) { +if (! function_exists('\Roots\bootloader')) { wp_die( __('You need to install Acorn to use this theme.', 'sage'), '', [ - 'link_url' => 'https://docs.roots.io/acorn/2.x/installation/', + 'link_url' => 'https://roots.io/acorn/docs/installation/', 'link_text' => __('Acorn Docs: Installation', 'sage'), ] ); } +\Roots\bootloader()->boot(); + /* |-------------------------------------------------------------------------- | Register Sage Theme Files @@ -63,17 +63,3 @@ ); } }); - -/* -|-------------------------------------------------------------------------- -| Enable Sage Theme Support -|-------------------------------------------------------------------------- -| -| Once our theme files are registered and available for use, we are almost -| ready to boot our application. But first, we need to signal to Acorn -| that we will need to initialize the necessary service providers built in -| for Sage when booting. -| -*/ - -add_theme_support('sage'); diff --git a/index.php b/index.php index 2738f4a997..edc07f1a98 100644 --- a/index.php +++ b/index.php @@ -1,20 +1,3 @@ - -> - - - - - +> - - - -