├── .editorconfig ├── .env.example ├── .eslintrc.js ├── .gitignore ├── .htaccess ├── .vscode └── launch.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── app ├── Classes │ ├── API.php │ └── Vite.php ├── Controllers │ ├── App.php │ ├── FrontPage.php │ ├── Page.php │ └── Partials │ │ └── PostTrait.php ├── admin.php ├── filters.php ├── helpers.php └── setup.php ├── composer.json ├── composer.lock ├── config ├── assets.php ├── theme.php └── view.php ├── package.json ├── phpcs.xml ├── resources ├── assets │ ├── fonts │ │ └── .gitkeep │ ├── images │ │ └── .gitkeep │ ├── scripts │ │ ├── components │ │ │ ├── App.tsx │ │ │ └── VueApp.vue │ │ ├── main.ts │ │ ├── react-example.tsx │ │ ├── shims-vue.d.ts │ │ └── vue-example.ts │ └── styles │ │ ├── common │ │ ├── _global.scss │ │ ├── _util.scss │ │ └── _variables.scss │ │ ├── components │ │ ├── _buttons.scss │ │ ├── _comments.scss │ │ ├── _forms.scss │ │ └── _wp-classes.scss │ │ ├── layouts │ │ ├── _footer.scss │ │ ├── _header.scss │ │ ├── _pages.scss │ │ ├── _posts.scss │ │ ├── _sidebar.scss │ │ └── _tinymce.scss │ │ └── main.scss ├── functions-app.php ├── functions-default.php ├── functions.php ├── index.php ├── screenshot.png ├── style.css └── views │ ├── 404.blade.php │ ├── front-page.blade.php │ ├── index.blade.php │ ├── layouts │ └── app.blade.php │ ├── page.blade.php │ ├── partials │ ├── comments.blade.php │ ├── content-page.blade.php │ ├── content-search.blade.php │ ├── content-single.blade.php │ ├── content.blade.php │ ├── entry-meta.blade.php │ ├── footer.blade.php │ ├── head.blade.php │ ├── header.blade.php │ ├── page-header.blade.php │ └── sidebar.blade.php │ ├── search.blade.php │ ├── single.blade.php │ └── template-custom.blade.php ├── tsconfig.json ├── vite.config.ts └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | 13 | [*.php] 14 | indent_size = 2 15 | 16 | [resources/views/**.php] 17 | indent_size = 2 18 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV = 'development' | 'staging' | 'production' 2 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'root': true, 3 | 'extends': 'eslint:recommended', 4 | 'globals': { 5 | 'wp': true, 6 | }, 7 | 'env': { 8 | 'node': true, 9 | 'es6': true, 10 | 'amd': true, 11 | 'browser': true, 12 | 'jquery': true, 13 | }, 14 | 'parserOptions': { 15 | 'ecmaFeatures': { 16 | 'globalReturn': true, 17 | 'generators': false, 18 | 'objectLiteralDuplicateProperties': false, 19 | 'experimentalObjectRestSpread': true, 20 | }, 21 | 'ecmaVersion': 2017, 22 | 'sourceType': 'module', 23 | }, 24 | 'plugins': [ 25 | 'import', 26 | ], 27 | 'settings': { 28 | 'import/core-modules': [], 29 | 'import/ignore': [ 30 | 'node_modules', 31 | '\\.(coffee|scss|css|less|hbs|svg|json)$', 32 | ], 33 | }, 34 | 'rules': { 35 | 'no-console': 0, 36 | 'quotes': ['error', 'single'], 37 | 'comma-dangle': [ 38 | 'error', 39 | { 40 | 'arrays': 'always-multiline', 41 | 'objects': 'always-multiline', 42 | 'imports': 'always-multiline', 43 | 'exports': 'always-multiline', 44 | 'functions': 'ignore', 45 | }, 46 | ], 47 | }, 48 | }; 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Include your project-specific ignores in this file 2 | # Read about how to use .gitignore: https://help.github.com/articles/ignoring-files 3 | .cache-loader 4 | dist 5 | node_modules 6 | npm-debug.log 7 | yarn-error.log 8 | /vendor 9 | resources/assets/config-local.json 10 | .env 11 | .DS_Store 12 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Order Allow,Deny 3 | Deny from all 4 | 5 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Listen for Xdebug", 9 | "type": "php", 10 | "request": "launch", 11 | "port": 9000 12 | }, 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### 9.0.9: February 13th, 2019 2 | * Update to Bootstrap 4.3.1 ([#2153](https://github.com/roots/sage/pull/2153)) 3 | 4 | ### 9.0.8: February 11th, 2019 5 | * Update to Bootstrap 4.3.0 ([#2152](https://github.com/roots/sage/pull/2152)) 6 | * Filter template hierarchy for embed templates ([#2145](https://github.com/roots/sage/pull/2145)) 7 | * Decrease optipng level ([#2143](https://github.com/roots/sage/pull/2143)) 8 | * Unescape post titles ([#2141](https://github.com/roots/sage/pull/2141)) 9 | 10 | ### 9.0.7: December 28th, 2018 11 | * Update sage-installer which now allows to opt-in for sending framework selection data ([#2137](https://github.com/roots/sage/pull/2137)) 12 | 13 | ### 9.0.6: December 21st, 2018 14 | * Update to Bootstrap 4.2.1 ([#2136](https://github.com/roots/sage/pull/2136)) 15 | * Do not ignore vendors for plugins ([#2132](https://github.com/roots/sage/pull/2132)) 16 | * Fix stylelint and eslint validation errors ([#2131](https://github.com/roots/sage/pull/2131)) 17 | * Hook run sequence fix ([#2123](https://github.com/roots/sage/pull/2123)) 18 | * Dispatch event when firing routes ([#2080](https://github.com/roots/sage/pull/2080)) 19 | * Normalize and enforce single quotes ([#2076](https://github.com/roots/sage/pull/2076)) 20 | 21 | ### 9.0.5: September 17th, 2018 22 | * Workaround for Bootstrap incompatibility with webpack. Fixes #2017 ([e72b490](https://github.com/roots/sage/commit/e72b4906264551dc00cd0890de74ae2bce0d77c8)) 23 | 24 | ### 9.0.4: September 7th, 2018 25 | * Force `illuminate/support` to `5.6.*` ([#2112](https://github.com/roots/sage/pull/2112)) 26 | 27 | ### 9.0.3: September 7th, 2018 28 | * Revert "Add searchform partial and function to replace default WordPress functionality" ([#2110](https://github.com/roots/sage/pull/2110)) 29 | * Unescape get_language_attributes() ([#2108](https://github.com/roots/sage/pull/2108)) 30 | * Add data from controller to comments template ([#2100](https://github.com/roots/sage/pull/2100)) 31 | 32 | ### 9.0.2: August 21st, 2018 33 | * Update to Bootstrap 4.1.3 ([#2097](https://github.com/roots/sage/pull/2097)) 34 | * Comments template fix ([#2095](https://github.com/roots/sage/pull/2095)) 35 | * UglifyJs: Change the ecma option from 8 to 5 ([#2092](https://github.com/roots/sage/pull/2092)) 36 | * Add searchform partial and function to replace default WordPress functionality ([#2090](https://github.com/roots/sage/pull/2090)) 37 | * Change language_attributes() to get_language_attributes() ([#2089](https://github.com/roots/sage/pull/2089)) 38 | * Fix missing comment-reply JS ([#2085](https://github.com/roots/sage/pull/2085)) 39 | * Use better merge method for Webpack Preset config ([#2084](https://github.com/roots/sage/pull/2084)) 40 | * Add support for preset specific Webpack config ([#2083](https://github.com/roots/sage/pull/2083)) 41 | * Enable Sass comments and run prefixing before minification ([#2078](https://github.com/roots/sage/pull/2078)) 42 | * Set removeViewBox to 'false' in webpack's optimization settings ([#2075](https://github.com/roots/sage/pull/2075)) 43 | * Add uglifyjs plugin ([#2070](https://github.com/roots/sage/pull/2070)) 44 | * Make template() compatible with wp admin ([#2068](https://github.com/roots/sage/pull/2068)) 45 | * Upgrade to Controller 2.1.0 ([#2025](https://github.com/roots/sage/pull/2025)) 46 | 47 | ### 9.0.1: April 30th, 2018 48 | * Update to Bootstrap 4.1.1 ([#2065](https://github.com/roots/sage/pull/2065)) 49 | * Auto-detect `proxyUrl` scheme ([#2062](https://github.com/roots/sage/pull/2062)) 50 | * Bump to Laravel 5.6 ([#2061](https://github.com/roots/sage/pull/2061)) 51 | * Update to Bootstrap 4.1.0 ([#2056](https://github.com/roots/sage/pull/2056)) 52 | * Change inline `@php` directive to full form ([#2042](https://github.com/roots/sage/pull/2042)) 53 | * PHP 7.1.3+ is now required ([#2037](https://github.com/roots/sage/pull/2037)) 54 | 55 | ### 9.0.0: February 7th, 2018 56 | * Update to Bootstrap 4 ([#2015](https://github.com/roots/sage/pull/2015)) 57 | * Allow `no-console` development ([#2008](https://github.com/roots/sage/pull/2008)) 58 | * Move variables and Bootstrap lines to autoload ([#1993](https://github.com/roots/sage/pull/1993)) 59 | * Update controller examples ([#1986](https://github.com/roots/sage/pull/1986)) 60 | * Update to Bootstrap 4 Beta 2 ([#1981](https://github.com/roots/sage/pull/1981)) 61 | * Add friendly-errors-webpack-plugin ([#1961](https://github.com/roots/sage/pull/1961)) 62 | * Update to Controller 9.0.0-beta.4 ([#1959](https://github.com/roots/sage/pull/1959)) 63 | * Change default Controller path to `app/controllers/` ([#1954](https://github.com/roots/sage/pull/1954)) 64 | * Fix `lint:styles` task with cmd.exe ([#1955](https://github.com/roots/sage/pull/1955)) 65 | * Ensure template filenames are without path and extension ([#1941](https://github.com/roots/sage/pull/1941)) 66 | * Moved `title()` helper to `app.php` controller ([#1912](https://github.com/roots/sage/pull/1912)) 67 | * Fix `lint:styles` script not matching files in deep subdirectories ([#1951](https://github.com/roots/sage/pull/1951)) 68 | * Fix for plugins that don't enqueue their scripts properly ([#1949](https://github.com/roots/sage/pull/1949)) 69 | * Fix Popper for Bootstrap 4 ([#1946](https://github.com/roots/sage/pull/1946)) 70 | 71 | ### 9.0.0-beta.4: August 11th, 2017 72 | * Update to Bootstrap 4.0.0-beta ([#1943](https://github.com/roots/sage/pull/1943)) 73 | * PHP 7+ is now required ([#1935](https://github.com/roots/sage/pull/1935)) 74 | * Update dependencies, support `config-local.json`, implement autoload system for styles/scripts, use `roots/sage-installer`, use `roots/sage-lib` ([#1919](https://github.com/roots/sage/pull/1919)) 75 | * Add soberwp/controller ([#1903](https://github.com/roots/sage/pull/1903)) 76 | * Change syntax of template call to match other files in views ([#1908](https://github.com/roots/sage/pull/1908)) 77 | * Add Tachyons as a CSS framework option ([#1867](https://github.com/roots/sage/pull/1867)) 78 | * Remove post format reference in template call ([#1904](https://github.com/roots/sage/pull/1904)) 79 | * Update inline documentation to reflect correct theme file locations ([#1890](https://github.com/roots/sage/pull/1890)) 80 | * Optimize CSS Assets safe = true ([#1901](https://github.com/roots/sage/pull/1901)) 81 | * Update Autoprefixer and standardize browserlist location ([#1899](https://github.com/roots/sage/pull/1899)) 82 | * Do not redirect for WP-CLI ([#1891](https://github.com/roots/sage/pull/1891)) 83 | * Illuminate: container make with parameters ([#1888](https://github.com/roots/sage/pull/1888)) 84 | * Add Stylelint for linting stylesheets ([#1885](https://github.com/roots/sage/pull/1885)) 85 | 86 | ### 9.0.0-beta.3: April 21st, 2017 87 | * Move required theme files to `sage/resources` ([#1877](https://github.com/roots/sage/pull/1877)) 88 | * Move `src/` to `app/` ([#1868](https://github.com/roots/sage/pull/1868)) 89 | * Move `templates/` to `resources/views/`, move `assets/` to `resources/assets/`, rename `base.blade.php` to `app.blade.php` ([#1864](https://github.com/roots/sage/pull/1864)) 90 | * Add option to configure build settings ([#1822](https://github.com/roots/sage/pull/1822)) 91 | * Add support for HTML injection ([#1817](https://github.com/roots/sage/pull/1817)) 92 | * Add Tachyons as a CSS framework option ([#1867](https://github.com/roots/sage/pull/1867)) 93 | 94 | ### 9.0.0-beta.2: January 19th, 2017 95 | * Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815)) 96 | * Add option to select CSS framework, add Foundation as an option ([#1813](https://github.com/roots/sage/pull/1813)) 97 | * Add option to add Font Awesome ([#1812](https://github.com/roots/sage/pull/1812)) 98 | * Add option to change theme file headers ([#1811](https://github.com/roots/sage/pull/1811)) 99 | * Add option to remove Bootstrap ([#1810](https://github.com/roots/sage/pull/1810)) 100 | * Remove Font Awesome ([#1809](https://github.com/roots/sage/pull/1809)) 101 | * Remove grid defaults ([#1808](https://github.com/roots/sage/pull/1808)) 102 | * Fix for `publicPath` ([#1806](https://github.com/roots/sage/pull/1806)) 103 | * Update clean task name ([#1800](https://github.com/roots/sage/pull/1800)) 104 | * Allow browser versions to be configured in `config.json` ([#1798](https://github.com/roots/sage/pull/1798)) 105 | * Use stock ESLint ([#1796](https://github.com/roots/sage/pull/1796)) 106 | 107 | ### 9.0.0-beta.1: January 10th, 2017 108 | * Update to Bootstrap 4 Alpha 6 ([#1792](https://github.com/roots/sage/pull/1792)) 109 | * Add Blade ([#1765](https://github.com/roots/sage/pull/1765) and [#1777](https://github.com/roots/sage/pull/1777)) 110 | * Remove sidebar defaults ([#1760](https://github.com/roots/sage/pull/1760)) 111 | * Remove post formats ([#1759](https://github.com/roots/sage/pull/1759)) 112 | 113 | ### 9.0.0-alpha.4: November 16th, 2016 114 | * Use new webpack api schema ([8ac5f15](https://github.com/roots/sage/commit/e6e60aa)) 115 | * Update dependencies ([70ebba7](https://github.com/roots/sage/commit/70ebba7)) 116 | * Variables organization ([8ac5f15](https://github.com/roots/sage/commit/8ac5f15)) 117 | * Use `$.fn.ready()` (reverts [724d550](https://github.com/roots/sage/commit/724d550)) ([e7fccbe](https://github.com/roots/sage/commit/e7fccbe)) 118 | * Theme activation updates 'stylesheet' option instead of 'template' ([fb19145](https://github.com/roots/sage/commit/fb19145)) 119 | * Reorganize and refactor build routine ([8c9ba05](https://github.com/roots/sage/commit/8c9ba05)) 120 | * Switch assets manifest plugin ([c1bb2b3](https://github.com/roots/sage/commit/c1bb2b3)) 121 | * Add images to assets manifest ([c49793c](https://github.com/roots/sage/commit/c49793c)) 122 | * Switch from babel to buble ([0d38ab8](https://github.com/roots/sage/commit/0d38ab8)) 123 | * Update dependencies & webpack compatibility ([eae52fd](https://github.com/roots/sage/commit/eae52fd)) 124 | * Use http by default (not https) to be consistent with Trellis ([e6f2f49](https://github.com/roots/sage/commit/e6f2f49)) 125 | 126 | ### 9.0.0-alpha.3: September 11th, 2016 127 | * Fix webpack HMR ([#1713](https://github.com/roots/sage/issues/1713)) 128 | * Remove minor edits from CHANGELOG.md ([3516629](https://github.com/roots/sage/commit/3516629)) 129 | 130 | ### 9.0.0-alpha.2: September 4th, 2016 131 | * Refactor build routine ([#1703](https://github.com/roots/sage/pull/1703)) 132 | * Update `_grid.scss` to use `@include make-col-ready()` mixin ([#1706](https://github.com/roots/sage/pull/1706)) 133 | 134 | ### 9.0.0-alpha.1: August 30th, 2016 135 | * Move assets found in `node_modules/` to `dist/vendor`, simpler `assets/config.json` ([#1697](https://github.com/roots/sage/pull/1697)) 136 | * Set dynamically absolute public path ([#1696](https://github.com/roots/sage/pull/1696)) 137 | * Load Tether ([#1686](https://github.com/roots/sage/pull/1686)) 138 | * Squash asset pipeline bugs ([4d58f88](https://github.com/roots/sage/commit/4d58f88)) 139 | * Update dependencies, incl Bootstrap 4 alpha 3 ([447c24d](https://github.com/roots/sage/commit/447c24d)) 140 | * Fix path to stylesheet in `add_editor_style` ([#1684](https://github.com/roots/sage/pull/1684)) 141 | * Update required Node.js version ([72b2d89](https://github.com/roots/sage/commit/72b2d89)) 142 | * Router doesn't require jQuery, use default params ([339cc8e](https://github.com/roots/sage/commit/339cc8e)) 143 | * Fix display of theme name in Customizer ([3425386](https://github.com/roots/sage/commit/3425386)) 144 | * Convert scripts to ES6 ([f34af48](https://github.com/roots/sage/commit/f34af48)) 145 | * Refactor functions.php ([eae36be](https://github.com/roots/sage/commit/eae36be)) 146 | * Rework template wrapper, bring back template_part() ([#1678](https://github.com/roots/sage/pull/1678)) 147 | * Remove unused static variable in Wrapper ([9bfdd5a](https://github.com/roots/sage/commit/9bfdd5a)) 148 | * Remove `path.extname()` check ([#1673](https://github.com/roots/sage/pull/1673)) 149 | * Updated to align with the Bootstrap 4 docs ([#1667](https://github.com/roots/sage/pull/1667)) 150 | * Add `npm prune` to Travis CI ([#1663](https://github.com/roots/sage/pull/1663)) 151 | * Bootstrap NPM ^4.0.0-alpha.2 ([#1650](https://github.com/roots/sage/pull/1650)) 152 | * Fix Bootstrap 4 styles ([#1642](https://github.com/roots/sage/pull/1642)) 153 | * Fix autoloader load order issue when including Sage 9 via composer.json in Bedrock ([#1628](https://github.com/roots/sage/pull/1628)) 154 | * `is_page_template()` requires the name of the subfolder ([#1626](https://github.com/roots/sage/pull/1626)) 155 | * Webpack config improvements ([#1629](https://github.com/roots/sage/pull/1629)) 156 | * Webpack implementation improvements ([#1627](https://github.com/roots/sage/pull/1627)) 157 | * Webpack implementation ([#1625](https://github.com/roots/sage/pull/1625)) 158 | * Fix BS4 grid after their grid updates ([5551dde](https://github.com/roots/sage/commit/5551dde)) 159 | * Pass the correct template ([856a482](https://github.com/roots/sage/commit/856a482)) 160 | * Optimize travis a bit ([b42c425](https://github.com/roots/sage/commit/b42c425)) 161 | * Move single-post loop to single.php, closes #1582 ([6efa099](https://github.com/roots/sage/commit/6efa099)) 162 | * All function braces need to be on new line ([b491f76](https://github.com/roots/sage/commit/b491f76)) 163 | * Fix issue with WP loading wrong index.php ([9e2917e](https://github.com/roots/sage/commit/9e2917e)) 164 | * Use 4 spaces for `src/*.php` ([fe659f4](https://github.com/roots/sage/commit/fe659f4)) 165 | * Use phpcs.xml for all rules ([246955c](https://github.com/roots/sage/commit/246955c)) 166 | * Conform to new rules ([6a4d3bd](https://github.com/roots/sage/commit/6a4d3bd)) 167 | * Create new phpcs rules ([2d02544](https://github.com/roots/sage/commit/2d02544)) 168 | * Remove Template class ([1df3fee](https://github.com/roots/sage/commit/1df3fee)) 169 | * Remove closure from sidebar registration ([12d6ac3](https://github.com/roots/sage/commit/12d6ac3)) 170 | * Remove sage.pot ([d4461fa](https://github.com/roots/sage/commit/d4461fa)) 171 | * Remove template_part, template_sidebar, temp sidebar fix ([abeea0f](https://github.com/roots/sage/commit/abeea0f)) 172 | * Update asset handles ([fa0e51f](https://github.com/roots/sage/commit/fa0e51f)) 173 | * Remove comment-reply JS ([d217ba6](https://github.com/roots/sage/commit/d217ba6)) 174 | * Update node in travis, remove unsupported php ([8712dc8](https://github.com/roots/sage/commit/8712dc8)) 175 | * Update dependencies, switch to eslint ([e51e41e](https://github.com/roots/sage/commit/e51e41e)) 176 | * Bootstrap 4 ([c9ef232](https://github.com/roots/sage/commit/c9ef232)) 177 | * Fix: page title not displaying ([9283bbb](https://github.com/roots/sage/commit/9283bbb)) 178 | * Rename interfaces, unset after unwrapping ([97906e9](https://github.com/roots/sage/commit/97906e9)) 179 | * Restructure theme, use autoloader ([9eaffa3](https://github.com/roots/sage/commit/9eaffa3a2d4df462dd8020a10551334208bd32a3)) 180 | 181 | ### 8.5.0: September 20th, 2016 182 | * Update installation instructions 183 | * Update dependencies 184 | * Update to Bootstrap 4.0.0-alpha.4 ([5eb01fd](https://github.com/roots/sage/commit/5eb01fd0319a7b6576e31579dc50e16b023abb74)) 185 | 186 | ### 8.4.2: February 19th, 2016 187 | * Add Composer vendor directory to gitignore ([#1618](https://github.com/roots/sage/issues/1618)) 188 | * Fix build test by removing trailing space ([#1617](https://github.com/roots/sage/issues/1617)) 189 | * Replace deprecated gulp-minify-css with gulp-cssnano ([#1610](https://github.com/roots/sage/issues/1610)) 190 | 191 | ### 8.4.1: January 27th, 2016 192 | * Add `composer.json` and update installation instructions ([#1583](https://github.com/roots/sage/issues/1583)) 193 | 194 | ### 8.4.0: December 1st, 2015 195 | * Update to Bootstrap 3.3.6 ([#1578](https://github.com/roots/sage/pull/1578)) 196 | * Remove unnecessary underscore ([#1577](https://github.com/roots/sage/pull/1577)) 197 | * Drop support for older browsers ([#1571](https://github.com/roots/sage/pull/1571)) 198 | * Add support for theme customizer ([#1573](https://github.com/roots/sage/pull/1573)) 199 | * Remove extraneous no-js ([#1562](https://github.com/roots/sage/pull/1562)) 200 | * Simplify/speed up editor style process ([#1560](https://github.com/roots/sage/pull/1560)) 201 | 202 | ### 8.3.0: October 13th, 2015 203 | * Setup organization ([#1558](https://github.com/roots/sage/pull/1558)) 204 | * Remove redundancy with WAI-ARIA in HTML ([#1557](https://github.com/roots/sage/pull/1557)) 205 | * Rename config.php to setup.php ([#1556](https://github.com/roots/sage/pull/1556)) 206 | * Move init.php to config.php ([#1555](https://github.com/roots/sage/pull/1555)) 207 | * Use Sass to style search form, remove search template ([#1545](https://github.com/roots/sage/pull/1545)) 208 | * Remove Modernizr ([#1541](https://github.com/roots/sage/pull/1541)) 209 | * Remove references to WP_ENV ([#1554](https://github.com/roots/sage/pull/1554)) 210 | * Use WP core's HTML5 gallery markup ([#1546](https://github.com/roots/sage/pull/1546)) 211 | * Use slash in handle names for theme CSS and JS ([#1537](https://github.com/roots/sage/pull/1537)) 212 | * Add compatibility with WooCommerce Multilingual plugin ([#1530](https://github.com/roots/sage/pull/1530)) 213 | * Remove ConditionalTagCheck class ([#1494](https://github.com/roots/sage/pull/1494)) 214 | * Add search templates ([#1459](https://github.com/roots/sage/issues/1459)) 215 | * Allow `debugger` statements in development JavaScript ([#1487](https://github.com/roots/sage/issues/1487)) 216 | 217 | ### 8.2.1: May 7th, 2015 218 | * Update BrowserSync ([#1457](https://github.com/roots/sage/issues/1457)) 219 | * Bump dependencies ([#1448](https://github.com/roots/sage/issues/1448)) 220 | * Allow revved files to resolve in development if they exist ([#1456](https://github.com/roots/sage/issues/1456)) 221 | * Disable advanced minification features to fix incorrect file path in compiled CSS ([#1452](https://github.com/roots/sage/issues/1452)) 222 | * Fix Glyphicon font path ([#1455](https://github.com/roots/sage/issues/1455)) 223 | 224 | ### 8.2.0: April 29th, 2015 225 | * Use Sass Bootstrap by default ([#1437](https://github.com/roots/sage/issues/1437)) 226 | * Remove nav walker and Bootstrap navbar ([#1427](https://github.com/roots/sage/issues/1427)) 227 | * Remove Bootstrap gallery ([#1421](https://github.com/roots/sage/issues/1421)) 228 | * Remove hardcoded feed link ([#1426](https://github.com/roots/sage/issues/1426)) 229 | * Move jQuery CDN feature to Soil ([#1422](https://github.com/roots/sage/issues/1422)) 230 | * Bump `gulp-load-plugins` to 0.10.0 ([#1419](https://github.com/roots/sage/issues/1419)) 231 | * Switch from [yargs](https://github.com/bcoe/yargs) to [minimist](https://github.com/substack/minimist) ([#1418](https://github.com/roots/sage/issues/1418)) 232 | * Remove `$content_width` ([#1417](https://github.com/roots/sage/issues/1417)) 233 | * Lowercase `X-UA-Compatible` ([#1409](https://github.com/roots/sage/issues/1409)) 234 | * Remove mention of Google Analytics from the config ([#1384](https://github.com/roots/sage/issues/1384)) 235 | 236 | ### 8.1.1: March 31st, 2015 237 | * Remove pleeease dependency in favor of vanilla gulp-autoprefixer and gulp-minify-css ([#1402](https://github.com/roots/sage/issues/1402)) 238 | * Fix `gulp --production` race condition ([#1398](https://github.com/roots/sage/issues/1398)) 239 | * Update to Bootstrap 3.3.4 ([#1387](https://github.com/roots/sage/issues/1387)) 240 | 241 | ### 8.1.0: March 13th, 2015 242 | * Move HTML5 Boilerplate's Google Analytics snippet to Soil ([#1382](https://github.com/roots/sage/issues/1382)) 243 | * Run `gulp build` if `bower.json` is changed ([#1378](https://github.com/roots/sage/issues/1378)) 244 | * Remove namespace from base.php ([#1372](https://github.com/roots/sage/issues/1372)) 245 | * Allow build directory to be customized ([#1352](https://github.com/roots/sage/issues/1352), [#1366](https://github.com/roots/sage/issues/1366)) 246 | * Update ConditionalTagCheck and usage docs ([#1365](https://github.com/roots/sage/issues/1365)) 247 | * Change default gallery columns to 3 ([#1364](https://github.com/roots/sage/issues/1364)) 248 | * Apply `script_loader_src` filter to jQuery fallback ([#1363](https://github.com/roots/sage/issues/1363)) 249 | 250 | ### 8.0.1: February 26th, 2015 251 | * Update asset-builder version to fix Windows compatibility ([#1351](https://github.com/roots/sage/issues/1351)) 252 | * Fix broken wiredep imports with main.scss.example ([Discussion](https://discourse.roots.io/t/issue-with-sage-sass-version/2962)) 253 | 254 | ### 8.0.0: February 25th, 2015 255 | * Change theme name from Roots to Sage 256 | * Bump required PHP version to >=5.4 257 | * Add coding standards based on PSR-2 258 | * Add Travis CI 259 | * Add namespace 260 | * Use short array syntax 261 | * Use short echo syntax 262 | * Switch from Grunt to gulp, new front-end development workflow 263 | * Switch from Livereload to [BrowserSync](http://www.browsersync.io/) 264 | * Use wiredep for Sass and Less injection 265 | * Implement JSON file based asset pipeline with [asset-builder](https://github.com/austinpray/asset-builder) 266 | * Re-organize asset file structure 267 | * Re-organize stylesheet file structure 268 | * Add main.scss.example and instructions for using Sass 269 | * Use the primary theme stylesheet for the editor stylesheet 270 | * Remove theme activation, move to [wp-cli-theme-activation](https://github.com/roots/wp-cli-theme-activation) 271 | * Simplify 404 page 272 | * Convert Sidebar to ConditionalTagCheck 273 | * Update to jQuery 1.11.2 274 | * Use new core navigation template tag 275 | * Update sidebar to fix default template check 276 | * Update nav walker to correctly assign `active` classes for custom post types 277 | * Better support for CPT templates 278 | 279 | ### 7.0.3: December 18th, 2014 280 | * Use `get_the_archive_title` 281 | * Remove `wp_title`, add title-tag theme support 282 | * Remove `Roots_Nav_Walker` as default for all menus 283 | * Update to Bootstrap 3.3.1 284 | * Add some base comment styling 285 | * Make search term `required` in search form 286 | 287 | ### 7.0.2: October 24th, 2014 288 | * Simplify comments, use core comment form and list 289 | * Remove HTML5 shiv from Modernizr build 290 | * Move JavaScript to footer 291 | * Update hEntry schema to use `updated` instead of `published` 292 | * Move variables into `main.less` 293 | * Add `roots_body_class` function that checks for page slug in `body_class` 294 | * Move `wp_footer` from footer template into `base.php` 295 | 296 | ### 7.0.1: August 15th, 2014 297 | * Move `
` and `.sidebar` markup out of PHP and into LESS 298 | * Define `WP_ENV` if it is not already defined 299 | * Only load Google Analytics in production environment 300 | 301 | ### 7.0.0: July 3rd, 2014 302 | * Updated Grunt workflow 303 | * Use grunt-modernizr to make a lean Modernizr build 304 | * Use Bower for front-end package management 305 | * Update to Bootstrap 3.2.0 306 | * Update to Modernizr 2.8.2 307 | * Update to jQuery 1.11.1 308 | * Move clean up, relative URLs, and nice search to [Soil](https://github.com/roots/soil) 309 | * Update LESS organization 310 | * Move [community translations](https://github.com/roots/roots-translations) to separate repository 311 | 312 | ### 6.5.2: February 4th, 2014 313 | * Update to Bootstrap 3.1.0 314 | * Move DOM routing into an anonymous function to support jQuery noConflict 315 | * Update to jQuery 1.11.0 316 | * Add notice to theme activation, tidy activation table markup 317 | * Remove changing media folder from theme activation (use [Bedrock](https://github.com/roots/bedrock) for clean URLs out of the box) 318 | * Switch `div.main` to `main` element now that Modernizr uses the latest HTML5 Shiv 319 | * Update to Modernizr 2.7.0 320 | * Don't run JSHint on plugins (`assets/js/plugins/`) 321 | * Disable warnings about undefined variables (JSHint) 322 | * Merge in updates from HTML5 Boilerplate 323 | * Add JS source map (disabled by default) 324 | * Replace `grunt-recess` with `grunt-contrib-less`, add LESS source map support 325 | 326 | ### 6.5.1: November 5th, 2013 327 | * Move clean URLs to a [plugin](https://github.com/roots/roots-rewrites) 328 | * Update to Bootstrap 3.0.1 329 | 330 | ### 6.5.0: August 23rd, 2013 331 | * Reference new site, [http://roots.io/](http://roots.io/) 332 | * Remove bundled docs, reference [http://roots.io/docs/](http://roots.io/docs/) 333 | * Use Bootstrap variables for media queries 334 | * Update to Bootstrap 3.0.0 335 | * Update to jQuery 1.10.2 336 | * Change media directory from `/assets/` to `/media/` 337 | * Update to Google Universal Analytics 338 | * Show author display name for author archives 339 | * Add Serbian translation 340 | * Remove post tags from templates 341 | * Remove TinyMCE valid elements tweaks (no longer necessary) 342 | * Remove additional widget classes 343 | * Move `/assets/css/less/` to `/assets/less/` 344 | * Add wrapper templates filter 345 | * Fix relative external URLs issue 346 | 347 | ### 6.4.0: May 1st, 2013 348 | * Fix Theme Activation page issues 349 | * Fix issues with root relative URLs and rewrites on non-standard setups 350 | * Make sure rewrites are added to `.htaccess` immediately after activation 351 | * Move HTML5 Boilerplate's `.htaccess` to a [plugin](https://github.com/roots/wp-h5bp-htaccess) 352 | * Rename `page-custom.php` to `template-custom.php` 353 | * Don't warn about unwritable htaccess if that option is disabled 354 | * Add missing collapse class for top navbar 355 | * Add comment template 356 | * Update is_dropdown evaluation in nav walker 357 | * Re-organize archives template 358 | * Add missing comment ID 359 | * hNews consistency with entry-title class 360 | * Add `wp_title()` filter 361 | * Fix missing closing div in comments 362 | * Fix for navbar dropdowns 363 | * Add option for using jQuery on Google CDN 364 | * Correct logic in `roots_enable_root_relative_urls` 365 | * Add Greek translation, update Brazilian Portuguese translation 366 | * Update to Bootstrap 2.3.1 367 | * Simplify alerts 368 | * Remove disabled post nav links 369 | * Use Bootstrap media object for listing comments 370 | * Move Google Analytics to `lib/scripts.php` 371 | * Static top navbar instead of fixed 372 | 373 | ### 6.3.0: February 8th, 2013 374 | * Update to Bootstrap 2.3.0 375 | * Update to jQuery 1.9.1 376 | * Output author title with `get_the_author()` 377 | * Add EditorConfig 378 | * Update 404 template based on H5BP 379 | * Update H5BP's included .htaccess 380 | * Don't show comments on passworded posts 381 | * Add `do_action('get_header')` for WooSidebars compatibility 382 | * Simplify entry meta 383 | * Allow `get_search_form()` to be called more than once per request 384 | * Move plugins.js and main.js to footer 385 | * JavaScript clean up (everything is now enqueued) 386 | * Remove conditional feed 387 | * Introduce `add_theme_support('bootstrap-gallery')` 388 | * Rewrites organization (introduce `lib/rewrites.php`) 389 | * Fix `add_editor_style` path 390 | * Updated translations: French, Bulgarian, Turkish, Korean 391 | * Enable `add_theme_support` for Nice Search 392 | * Replace ID's with classes 393 | * Add support for dynamic sidebar templates 394 | * Fix PHP notice on search with no results 395 | * Update to jQuery 1.9.0 396 | 397 | ### 6.2.0: January 13th, 2013 398 | * Implement latest Nice Search 399 | * Update [gallery] shortcode 400 | * Add Simplified Chinese, Indonesian, Korean translations 401 | * Move template title to `lib/utils.php` 402 | * Update to Bootstrap 2.2.2 403 | * Update to jQuery 1.8.3 404 | * Use `entry-summary` class for excerpts per Readability's Article Publishing Guidelines 405 | * Cleanup/refactor `lib/activation.php` 406 | * Remove `lib/post-types.php` and `lib/metaboxes.php` 407 | * Make sure Primary Navigation menu always gets created and has the location set upon activation, update activation permalink method 408 | * Update to Bootstrap 2.2.1 409 | * Update conditional feed method 410 | * Update to Bootstrap 2.2.0 411 | * Return instead of echo class names in `roots_main_class` and `roots_sidebar_class` 412 | * Move nav customizations into `lib/nav.php` 413 | 414 | ### 6.1.0: October 2nd, 2012 415 | * Change roots_sidebar into a more explicit configuration array 416 | * Re-organize configuration/setup files 417 | * Update to jQuery 1.8.2 418 | * Refactor/simplify Roots vCard Widget 419 | * Move custom entry_meta code into template 420 | * Move Google Analytics code into footer template 421 | * Add CONTRIBUTING.md to assist with the new GitHub UI 422 | * Add nav walker support for CSS dividers and nav-header 423 | 424 | ### 6.0.0: September 16th, 2012 425 | * Simplify nav walker and support 3rd level dropdowns 426 | * Update to Bootstrap 2.1.1, jQuery 1.8.1, Modernizr 2.6.2 427 | * Add bundled docs 428 | * Update all templates to use [PHP Alternative Syntax](http://php.net/manual/en/control-structures.alternative-syntax.php) 429 | * Add MIT License 430 | * Implement scribu's [Theme Wrapper](http://scribu.net/wordpress/theme-wrappers.html) (see `base.php`) 431 | * Move `css/`, `img/`, and `js/` folders within a new `assets/` folder 432 | * Move templates, `comments.php`, and `searchform.php` to `templates/` folder 433 | * Rename `inc/` to `lib/` 434 | * Add placeholder `lib/post-types.php` and `lib/metaboxes.php` files 435 | * Rename `loop-` files to `content-` 436 | * Remove all hooks 437 | * Use `templates/page-header.php` for page titles 438 | * Use `head.php` for everything in `` 439 | 440 | ### 5.2.0: August 18th, 2012 441 | * Update to jQuery 1.8.0 and Modernizr 2.6.1 442 | * Fix duplicate active class in `wp_nav_menu` items 443 | * Merge `Roots_Navbar_Nav_Walker` into `Roots_Nav_Walker` 444 | * Add and update code documentation 445 | * Use `wp_get_theme()` to get the theme name on activation 446 | * Use `
` & `
` for captions 447 | * Wrap embedded media as suggested by Readability 448 | * Remove unnecessary `remove_action`'s on `wp_head` as of WordPress 3.2.1 449 | * Add updates from HTML5 Boilerplate 450 | * Remove well class from sidebar 451 | * Flush permalinks on activation to avoid 404s with clean URLs 452 | * Show proper classes on additional `wp_nav_menu()`'s 453 | * Clean up `inc/cleanup.php` 454 | * Remove old admin notice for tagline 455 | * Remove default tagline admin notice, hide from feed 456 | * Fix for duplicated classes in widget markup 457 | * Show title on custom post type archive template 458 | * Fix for theme preview in WordPress 3.3.2 459 | * Introduce `inc/config.php` with options for clean URLs, H5BP's `.htaccess`, root relative URLs, and Bootstrap features 460 | * Allow custom CSS classes in menus, walker cleanup 461 | * Remove WordPress version numbers from stylesheets 462 | * Don't include HTML5 Boilerplate's `style.css` by default 463 | * Allow `inc/htaccess.php` to work with Litespeed 464 | * Update to Bootstrap 2.0.4 465 | * Update Bulgarian translation 466 | * Don't use clean URLs with default permalink structure 467 | * Add translations for Catalan, Polish, Hungarian, Norwegian, Russian 468 | 469 | ### 5.1.0: April 14th, 2012 470 | * Various bugfixes for scripts, stylesheets, root relative URLs, clean URLs, and htaccess issues 471 | * Add a conditional feed link 472 | * Temporarily remove Gravity Forms customizations 473 | * Update to Bootstrap 2.0.2 474 | * Update `roots.pot` for translations 475 | * Add/update languages: Vietnamese, Swedish, Bulgarian, Turkish, Norwegian, Brazilian Portugese 476 | * Change widgets to use `
` instead of `
` 477 | * Add comment-reply.js 478 | * Remove optimized robots.txt 479 | * HTML5 Boilerplate, Modernizr, and jQuery updates 480 | 481 | ### 5.0.0: February 5th, 2012 482 | * Remove all frameworks except Bootstrap 483 | * Update to Bootstrap 2.0 484 | * Remove `roots-options.php` and replaced with a more simple `roots-config.php` 485 | * Now using Bootstrap markup on forms, page titles, image galleries, alerts and errors, post and comment navigation 486 | * Remove Roots styles from `style.css` and introduced `app.css` for site-specific CSS 487 | * Remove almost all previous default Roots styling 488 | * Latest updates from HTML5 Boilerplate 489 | 490 | ### 4.1.0: February 1st, 2012 491 | * Update translations 492 | * HTML5 Boilerplate updates 493 | * Fix for Server 500 errors 494 | * Add `roots-scripts.php`, now using `wp_enqueue_script` 495 | * Re-organize `roots-actions.php` 496 | * Allow `'; 49 | }); 50 | return; 51 | } 52 | 53 | $res = ''; 54 | foreach (self::importsUrls($entry) as $url) { 55 | $res .= ''; 56 | } 57 | 58 | add_action('wp_head', function () use (&$res) { 59 | echo $res; 60 | }); 61 | } 62 | 63 | private static function cssTag(string $entry): string 64 | { 65 | // not needed on dev, it's inject by Vite 66 | if (IS_DEVELOPMENT) { 67 | return ''; 68 | } 69 | 70 | $tags = ''; 71 | foreach (self::cssUrls($entry) as $url) { 72 | wp_register_style("sage/$entry", $url); 73 | wp_enqueue_style("sage/$entry", $url); 74 | } 75 | return $tags; 76 | } 77 | 78 | 79 | // Helpers to locate files 80 | 81 | private static function getManifest(): array 82 | { 83 | $content = file_get_contents(get_theme_root() . '/' . App::theme_name() . '/dist/manifest.json'); 84 | 85 | return json_decode($content, true); 86 | } 87 | 88 | private static function assetUrl(string $entry): string 89 | { 90 | $manifest = self::getManifest(); 91 | 92 | return isset($manifest[$entry]) 93 | ? self::base_path() . $manifest[$entry]['file'] 94 | : self::base_path() . $entry; 95 | } 96 | 97 | private static function getPublicURLBase() 98 | { 99 | return IS_DEVELOPMENT ? '/dist/' : self::base_path(); 100 | } 101 | 102 | private static function importsUrls(string $entry): array 103 | { 104 | $urls = []; 105 | $manifest = self::getManifest(); 106 | 107 | if (!empty($manifest[$entry]['imports'])) { 108 | foreach ($manifest[$entry]['imports'] as $imports) { 109 | $urls[] = self::getPublicURLBase() . $manifest[$imports]['file']; 110 | } 111 | } 112 | return $urls; 113 | } 114 | 115 | private static function cssUrls(string $entry): array 116 | { 117 | $urls = []; 118 | $manifest = self::getManifest(); 119 | 120 | if (!empty($manifest[$entry]['css'])) { 121 | foreach ($manifest[$entry]['css'] as $file) { 122 | $urls[] = self::getPublicURLBase() . $file; 123 | } 124 | } 125 | return $urls; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /app/Controllers/App.php: -------------------------------------------------------------------------------- 1 | ID, $term, ['fields' => 'ids']); 13 | $args = [ 14 | 'post_type' => get_post_type($post), 15 | 'post_status' => 'publish', 16 | 'posts_per_page' => 1, 17 | 'orderby' => 'term_id', 18 | 'post__not_in' => [$post->ID], 19 | 'tax_query' => [ 20 | [ 21 | 'taxonomy' => $term, 22 | 'field' => 'id', 23 | 'terms' => $custom_taxterms 24 | ] 25 | ], 26 | ]; 27 | $related_items = new WP_Query($args); 28 | 29 | if ($related_items->have_posts()) { 30 | return $related_items->posts; 31 | } else { 32 | return []; 33 | } 34 | } 35 | 36 | public static function getByTerm($post_type, $taxonomy, $term, $args = []) { 37 | $default_args = [ 38 | 'post_type' => $post_type, 39 | 'post_status' => 'publish', 40 | 'posts_per_page' => -1, 41 | 'tax_query' => [ 42 | 'relation' => 'AND', 43 | [ 44 | 'taxonomy' => $taxonomy, 45 | 'field' => 'slug', 46 | 'terms' => $term, 47 | 'operator' => 'IN' 48 | ] 49 | ], 50 | ]; 51 | $args = array_merge($default_args, $args); 52 | 53 | $the_posts = new WP_Query($args); 54 | 55 | if ($the_posts->have_posts()) { 56 | $posts = self::addACFFields($the_posts->posts); 57 | return $posts; 58 | } else { 59 | return []; 60 | } 61 | } 62 | 63 | public static function getByCategory($post_type, $category_slug, $args = []) { 64 | $args = [ 65 | 'post_type' => $post_type, 66 | 'posts_per_page' => -1, 67 | 'lang' => '', 68 | 'category_name' => $category_slug, 69 | ]; 70 | 71 | $resources = new WP_Query($args); 72 | if ($resources->have_posts()) { 73 | return self::addACFFields($resources->posts); 74 | } else { 75 | return []; 76 | } 77 | } 78 | 79 | public static function getByMeta($post_type, $key, $value, $limit = -1) { 80 | $query = new WP_Query([ 81 | 'post_type' => $post_type, 82 | 'post_status' => 'publish', 83 | 'posts_per_page' => $limit, 84 | 'meta_query' => [ 85 | [ 86 | 'meta_key' => $key, 87 | 'meta_value' => $value, 88 | 'compare' => '=' 89 | ] 90 | ] 91 | ]); 92 | 93 | if ($query->have_posts()) { 94 | return $query->posts; 95 | } else { 96 | return []; 97 | } 98 | } 99 | 100 | public static function getByPostType($slug, $optional_args = []) { 101 | 102 | $args = [ 103 | 'post_type' => $slug, 104 | 'post_status' => 'publish', 105 | 'posts_per_page' => -1, 106 | 'orderby' => 'title', 107 | 'order' => 'ASC' 108 | ]; 109 | 110 | $args = array_merge($args, $optional_args); 111 | 112 | $query = new WP_Query($args); 113 | 114 | if ($query->have_posts()) { 115 | return $query->posts; 116 | } else { 117 | return []; 118 | } 119 | } 120 | 121 | public static function addACFFields($posts) { 122 | if (is_array($posts)) { 123 | foreach ($posts as $post) { 124 | // add ACF fields to the original post object. 125 | $fields = get_fields($post->ID); 126 | foreach ($fields as $key => $value) { 127 | // prefer object notation when possible. 128 | if (is_array($value)) { 129 | $post->{$key} = (object)$value; 130 | } else { 131 | $post->{$key} = $value; 132 | } 133 | } 134 | } 135 | return $posts; 136 | } elseif ($posts instanceof WP_Post || is_object($posts)) { 137 | $fields = get_fields($posts->ID); 138 | foreach ($fields as $key => $value) { 139 | // prefer object notation when possible. 140 | if (is_array($value)) { 141 | $posts->{$key} = (object)$value; 142 | } else { 143 | $posts->{$key} = $value; 144 | } 145 | } 146 | return $posts; 147 | } else { 148 | return $posts; 149 | } 150 | } 151 | 152 | public static function getChildPages() { 153 | global $post; 154 | $query = new WP_Query([ 155 | 'post_type' => 'page', 156 | 'posts_per_page' => -1, 157 | 'post_parent' => $post->ID, 158 | 'order' => 'ASC', 159 | 'orderby' => 'menu_order' 160 | ]); 161 | 162 | if ($query->have_posts()) { 163 | return self::addACFFields($query->posts); 164 | } else { 165 | return []; 166 | } 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /app/admin.php: -------------------------------------------------------------------------------- 1 | get_setting('blogname')->transport = 'postMessage'; 11 | $wp_customize->selective_refresh->add_partial('blogname', [ 12 | 'selector' => '.brand', 13 | 'render_callback' => function () { 14 | bloginfo('name'); 15 | } 16 | ]); 17 | }); 18 | 19 | /** 20 | * Customizer JS 21 | */ 22 | add_action('customize_preview_init', function () { 23 | wp_enqueue_script('module/sage/customizer.js', asset_path('scripts/customizer.js'), ['customize-preview'], null, true); 24 | }); 25 | -------------------------------------------------------------------------------- /app/filters.php: -------------------------------------------------------------------------------- 1 | classes 9 | */ 10 | add_filter('body_class', function (array $classes) { 11 | /** Add page slug if it doesn't exist */ 12 | if (is_single() || is_page() && !is_front_page()) { 13 | if (!in_array(basename(get_permalink()), $classes)) { 14 | $classes[] = basename(get_permalink()); 15 | } 16 | } 17 | 18 | /** Add class if sidebar is active */ 19 | if (display_sidebar()) { 20 | $classes[] = 'sidebar-primary'; 21 | } 22 | 23 | /** Clean up class names for custom templates */ 24 | $classes = array_map(function ($class) { 25 | return preg_replace(['/-blade(-php)?$/', '/^page-template-views/'], '', $class); 26 | }, $classes); 27 | 28 | return array_filter($classes); 29 | }); 30 | 31 | /** 32 | * Add "… Continued" to the excerpt 33 | */ 34 | add_filter('excerpt_more', function () { 35 | return ' … ' . __('Continued', 'sage') . ''; 36 | }); 37 | 38 | /** 39 | * Template Hierarchy should search for .blade.php files 40 | */ 41 | collect([ 42 | 'index', '404', 'archive', 'author', 'category', 'tag', 'taxonomy', 'date', 'home', 43 | 'frontpage', 'page', 'paged', 'search', 'single', 'singular', 'attachment', 'embed' 44 | ])->map(function ($type) { 45 | add_filter("{$type}_template_hierarchy", __NAMESPACE__ . '\\filter_templates'); 46 | }); 47 | 48 | /** 49 | * Render page using Blade 50 | */ 51 | add_filter('template_include', function ($template) { 52 | collect(['get_header', 'wp_head'])->each(function ($tag) { 53 | ob_start(); 54 | do_action($tag); 55 | $output = ob_get_clean(); 56 | remove_all_actions($tag); 57 | add_action($tag, function () use ($output) { 58 | echo $output; 59 | }); 60 | }); 61 | $data = collect(get_body_class())->reduce(function ($data, $class) use ($template) { 62 | return apply_filters("sage/template/{$class}/data", $data, $template); 63 | }, []); 64 | if ($template) { 65 | echo template($template, $data); 66 | return get_stylesheet_directory() . '/index.php'; 67 | } 68 | return $template; 69 | }, PHP_INT_MAX); 70 | 71 | /** 72 | * Render comments.blade.php 73 | */ 74 | add_filter('comments_template', function ($comments_template) { 75 | $comments_template = str_replace( 76 | [get_stylesheet_directory(), get_template_directory()], 77 | '', 78 | $comments_template 79 | ); 80 | 81 | $data = collect(get_body_class())->reduce(function ($data, $class) use ($comments_template) { 82 | return apply_filters("sage/template/{$class}/data", $data, $comments_template); 83 | }, []); 84 | 85 | $theme_template = locate_template(["views/{$comments_template}", $comments_template]); 86 | 87 | if ($theme_template) { 88 | echo template($theme_template, $data); 89 | return get_stylesheet_directory() . '/index.php'; 90 | } 91 | 92 | return $comments_template; 93 | }, 100); 94 | 95 | add_filter('script_loader_tag', function ($tag, $handle) { 96 | if (str_contains($handle, 'module/sage/')) { 97 | $str = "type='module'"; 98 | $str .= App::isDev() ? ' crossorigin' : ''; 99 | $tag = str_replace("type='text/javascript'", $str, $tag); 100 | } 101 | return $tag; 102 | }, 10, 2); 103 | -------------------------------------------------------------------------------- /app/helpers.php: -------------------------------------------------------------------------------- 1 | bound($abstract) 21 | ? $container->makeWith($abstract, $parameters) 22 | : $container->makeWith("sage.{$abstract}", $parameters); 23 | } 24 | 25 | /** 26 | * Get / set the specified configuration value. 27 | * 28 | * If an array is passed as the key, we will assume you want to set an array of values. 29 | * 30 | * @param array|string $key 31 | * @param mixed $default 32 | * @return mixed|\Roots\Sage\Config 33 | * @copyright Taylor Otwell 34 | * @link https://github.com/laravel/framework/blob/c0970285/src/Illuminate/Foundation/helpers.php#L254-L265 35 | */ 36 | function config($key = null, $default = null) { 37 | if (is_null($key)) { 38 | return sage('config'); 39 | } 40 | if (is_array($key)) { 41 | return sage('config')->set($key); 42 | } 43 | return sage('config')->get($key, $default); 44 | } 45 | 46 | /** 47 | * @param string $file 48 | * @param array $data 49 | * @return string 50 | */ 51 | function template($file, $data = []) { 52 | return sage('blade')->render($file, $data); 53 | } 54 | 55 | /** 56 | * Retrieve path to a compiled blade view 57 | * @param $file 58 | * @param array $data 59 | * @return string 60 | */ 61 | function template_path($file, $data = []) { 62 | return sage('blade')->compiledPath($file, $data); 63 | } 64 | 65 | /** 66 | * @param $asset 67 | * @return string 68 | */ 69 | function asset_path($asset) { 70 | return sage('assets')->getUri($asset); 71 | } 72 | 73 | /** 74 | * @param string|string[] $templates Possible template files 75 | * @return array 76 | */ 77 | function filter_templates($templates) { 78 | $paths = apply_filters('sage/filter_templates/paths', [ 79 | 'views', 80 | 'resources/views' 81 | ]); 82 | $paths_pattern = "#^(" . implode('|', $paths) . ")/#"; 83 | 84 | return collect($templates) 85 | ->map(function ($template) use ($paths_pattern) { 86 | /** Remove .blade.php/.blade/.php from template names */ 87 | $template = preg_replace('#\.(blade\.?)?(php)?$#', '', ltrim($template)); 88 | 89 | /** Remove partial $paths from the beginning of template names */ 90 | if (strpos($template, '/')) { 91 | $template = preg_replace($paths_pattern, '', $template); 92 | } 93 | 94 | return $template; 95 | }) 96 | ->flatMap(function ($template) use ($paths) { 97 | return collect($paths) 98 | ->flatMap(function ($path) use ($template) { 99 | return [ 100 | "{$path}/{$template}.blade.php", 101 | "{$path}/{$template}.php", 102 | ]; 103 | }) 104 | ->concat([ 105 | "{$template}.blade.php", 106 | "{$template}.php", 107 | ]); 108 | }) 109 | ->filter() 110 | ->unique() 111 | ->all(); 112 | } 113 | 114 | /** 115 | * @param string|string[] $templates Relative path to possible template files 116 | * @return string Location of the template 117 | */ 118 | function locate_template($templates) { 119 | return \locate_template(filter_templates($templates)); 120 | } 121 | 122 | /** 123 | * Determine whether to show the sidebar 124 | * @return bool 125 | */ 126 | function display_sidebar() { 127 | static $display; 128 | isset($display) || $display = apply_filters('sage/display_sidebar', false); 129 | return $display; 130 | } 131 | -------------------------------------------------------------------------------- /app/setup.php: -------------------------------------------------------------------------------- 1 | load(); 19 | } 20 | 21 | /** 22 | * Theme assets 23 | */ 24 | add_action('wp_enqueue_scripts', function () { 25 | Vite::useVite(); 26 | 27 | if (is_single() && comments_open() && get_option('thread_comments')) { 28 | wp_enqueue_script('comment-reply'); 29 | } 30 | }, 100); 31 | 32 | /** 33 | * Theme setup 34 | */ 35 | add_action('after_setup_theme', function () { 36 | /** 37 | * Enable features from Soil when plugin is activated 38 | * @link https://roots.io/plugins/soil/ 39 | */ 40 | add_theme_support('soil-clean-up'); 41 | add_theme_support('soil-jquery-cdn'); 42 | add_theme_support('soil-nav-walker'); 43 | add_theme_support('soil-nice-search'); 44 | add_theme_support('soil-relative-urls'); 45 | 46 | /** 47 | * Enable plugins to manage the document title 48 | * @link https://developer.wordpress.org/reference/functions/add_theme_support/#title-tag 49 | */ 50 | add_theme_support('title-tag'); 51 | 52 | /** 53 | * Register navigation menus 54 | * @link https://developer.wordpress.org/reference/functions/register_nav_menus/ 55 | */ 56 | register_nav_menus([ 57 | 'primary_navigation' => __('Primary Navigation', 'sage') 58 | ]); 59 | 60 | /** 61 | * Enable post thumbnails 62 | * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ 63 | */ 64 | add_theme_support('post-thumbnails'); 65 | 66 | /** 67 | * Enable HTML5 markup support 68 | * @link https://developer.wordpress.org/reference/functions/add_theme_support/#html5 69 | */ 70 | add_theme_support('html5', ['caption', 'comment-form', 'comment-list', 'gallery', 'search-form']); 71 | 72 | /** 73 | * Enable selective refresh for widgets in customizer 74 | * @link https://developer.wordpress.org/themes/advanced-topics/customizer-api/#theme-support-in-sidebars 75 | */ 76 | add_theme_support('customize-selective-refresh-widgets'); 77 | 78 | /** 79 | * Use main stylesheet for visual editor 80 | * @see resources/assets/styles/layouts/_tinymce.scss 81 | */ 82 | add_editor_style(asset_path('styles/main.css')); 83 | 84 | add_theme_support('custom-logo'); 85 | }, 20); 86 | 87 | /** 88 | * Register sidebars 89 | */ 90 | add_action('widgets_init', function () { 91 | $config = [ 92 | 'before_widget' => '
', 93 | 'after_widget' => '
', 94 | 'before_title' => '

', 95 | 'after_title' => '

' 96 | ]; 97 | register_sidebar([ 98 | 'name' => __('Primary', 'sage'), 99 | 'id' => 'sidebar-primary' 100 | ] + $config); 101 | register_sidebar([ 102 | 'name' => __('Footer', 'sage'), 103 | 'id' => 'sidebar-footer' 104 | ] + $config); 105 | }); 106 | 107 | /** 108 | * Updates the `$post` variable on each iteration of the loop. 109 | * Note: updated value is only available for subsequently loaded views, such as partials 110 | */ 111 | add_action('the_post', function ($post) { 112 | sage('blade')->share('post', $post); 113 | }); 114 | 115 | /** 116 | * Setup Sage options 117 | */ 118 | add_action('after_setup_theme', function () { 119 | /** 120 | * Add JsonManifest to Sage container 121 | */ 122 | sage()->singleton('sage.assets', function () { 123 | return new JsonManifest(config('assets.manifest'), config('assets.uri')); 124 | }); 125 | 126 | /** 127 | * Add Blade to Sage container 128 | */ 129 | sage()->singleton('sage.blade', function (Container $app) { 130 | $cachePath = config('view.compiled'); 131 | if (!file_exists($cachePath)) { 132 | wp_mkdir_p($cachePath); 133 | } 134 | (new BladeProvider($app))->register(); 135 | return new Blade($app['view']); 136 | }); 137 | 138 | /** 139 | * Create @asset() Blade directive 140 | */ 141 | sage('blade')->compiler()->directive('asset', function ($asset) { 142 | return ""; 143 | }); 144 | }); 145 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "8bit-echo/sage-vite", 3 | "version": "9.0.9", 4 | "type": "wordpress-theme", 5 | "license": "MIT", 6 | "description": "WordPress starter theme with Vite workflow", 7 | "homepage": "https://roots.io/sage/", 8 | "authors": [ 9 | { 10 | "name": "Ben Word", 11 | "email": "ben@benword.com", 12 | "homepage": "https://github.com/retlehs" 13 | }, 14 | { 15 | "name": "Scott Walkinshaw", 16 | "email": "scott.walkinshaw@gmail.com", 17 | "homepage": "https://github.com/swalkinshaw" 18 | }, 19 | { 20 | "name": "QWp6t", 21 | "email": "hi@qwp6t.me", 22 | "homepage": "https://github.com/qwp6t" 23 | }, 24 | { 25 | "name": "Matt Dickey", 26 | "email": "mdickey46@gmail.com", 27 | "homepage": "https://github.com/8bit-echo" 28 | } 29 | ], 30 | "keywords": ["wordpress", "sage", "vite"], 31 | "support": { 32 | "issues": "https://github.com/8bit-echo/sage-starter/issues", 33 | "forum": "https://discourse.roots.io/" 34 | }, 35 | "autoload": { 36 | "psr-4": { 37 | "App\\": "app/" 38 | } 39 | }, 40 | "require": { 41 | "php": ">=7.1", 42 | "composer/installers": "~1.0", 43 | "illuminate/support": "5.6.*", 44 | "roots/sage-lib": "~9.0.9", 45 | "soberwp/controller": "~2.1.0", 46 | "vlucas/phpdotenv": "^5.3", 47 | "oscarotero/env": "^2.1" 48 | }, 49 | "require-dev": { 50 | "squizlabs/php_codesniffer": "^2.8.0" 51 | }, 52 | "scripts": { 53 | "test": ["phpcs"] 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "158edb5e55cb89785b79cac2968dfd00", 8 | "packages": [ 9 | { 10 | "name": "brain/hierarchy", 11 | "version": "2.5.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/Brain-WP/Hierarchy.git", 15 | "reference": "d5d46c6a44f84e59384b0d4d61b27cb5b91bc523" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/Brain-WP/Hierarchy/zipball/d5d46c6a44f84e59384b0d4d61b27cb5b91bc523", 20 | "reference": "d5d46c6a44f84e59384b0d4d61b27cb5b91bc523", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=5.6" 25 | }, 26 | "require-dev": { 27 | "brain/monkey": "^2", 28 | "gmazzap/andrew": "~1.0", 29 | "mockery/mockery": "^1", 30 | "phpunit/phpunit": "^5.7", 31 | "symfony/finder": "~2.7.0" 32 | }, 33 | "suggest": { 34 | "symfony/finder": "Allows loading of templates using Symfony finder component." 35 | }, 36 | "type": "library", 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "2.x-dev" 40 | } 41 | }, 42 | "autoload": { 43 | "psr-4": { 44 | "Brain\\Hierarchy\\": "src/" 45 | } 46 | }, 47 | "notification-url": "https://packagist.org/downloads/", 48 | "license": [ 49 | "MIT" 50 | ], 51 | "authors": [ 52 | { 53 | "name": "Giuseppe Mazzapica", 54 | "email": "giuseppe.mazzapica@gmail.com" 55 | } 56 | ], 57 | "description": "No-dependencies package that embodies WordPress template hierarchy", 58 | "keywords": [ 59 | "wordpress" 60 | ], 61 | "support": { 62 | "issues": "https://github.com/Brain-WP/Hierarchy/issues", 63 | "source": "https://github.com/Brain-WP/Hierarchy/Hierarchy" 64 | }, 65 | "time": "2020-10-14T20:27:51+00:00" 66 | }, 67 | { 68 | "name": "composer/installers", 69 | "version": "v1.11.0", 70 | "source": { 71 | "type": "git", 72 | "url": "https://github.com/composer/installers.git", 73 | "reference": "ae03311f45dfe194412081526be2e003960df74b" 74 | }, 75 | "dist": { 76 | "type": "zip", 77 | "url": "https://api.github.com/repos/composer/installers/zipball/ae03311f45dfe194412081526be2e003960df74b", 78 | "reference": "ae03311f45dfe194412081526be2e003960df74b", 79 | "shasum": "" 80 | }, 81 | "require": { 82 | "composer-plugin-api": "^1.0 || ^2.0" 83 | }, 84 | "replace": { 85 | "roundcube/plugin-installer": "*", 86 | "shama/baton": "*" 87 | }, 88 | "require-dev": { 89 | "composer/composer": "1.6.* || ^2.0", 90 | "composer/semver": "^1 || ^3", 91 | "phpstan/phpstan": "^0.12.55", 92 | "phpstan/phpstan-phpunit": "^0.12.16", 93 | "symfony/phpunit-bridge": "^4.2 || ^5", 94 | "symfony/process": "^2.3" 95 | }, 96 | "type": "composer-plugin", 97 | "extra": { 98 | "class": "Composer\\Installers\\Plugin", 99 | "branch-alias": { 100 | "dev-main": "1.x-dev" 101 | } 102 | }, 103 | "autoload": { 104 | "psr-4": { 105 | "Composer\\Installers\\": "src/Composer/Installers" 106 | } 107 | }, 108 | "notification-url": "https://packagist.org/downloads/", 109 | "license": [ 110 | "MIT" 111 | ], 112 | "authors": [ 113 | { 114 | "name": "Kyle Robinson Young", 115 | "email": "kyle@dontkry.com", 116 | "homepage": "https://github.com/shama" 117 | } 118 | ], 119 | "description": "A multi-framework Composer library installer", 120 | "homepage": "https://composer.github.io/installers/", 121 | "keywords": [ 122 | "Craft", 123 | "Dolibarr", 124 | "Eliasis", 125 | "Hurad", 126 | "ImageCMS", 127 | "Kanboard", 128 | "Lan Management System", 129 | "MODX Evo", 130 | "MantisBT", 131 | "Mautic", 132 | "Maya", 133 | "OXID", 134 | "Plentymarkets", 135 | "Porto", 136 | "RadPHP", 137 | "SMF", 138 | "Starbug", 139 | "Thelia", 140 | "Whmcs", 141 | "WolfCMS", 142 | "agl", 143 | "aimeos", 144 | "annotatecms", 145 | "attogram", 146 | "bitrix", 147 | "cakephp", 148 | "chef", 149 | "cockpit", 150 | "codeigniter", 151 | "concrete5", 152 | "croogo", 153 | "dokuwiki", 154 | "drupal", 155 | "eZ Platform", 156 | "elgg", 157 | "expressionengine", 158 | "fuelphp", 159 | "grav", 160 | "installer", 161 | "itop", 162 | "joomla", 163 | "known", 164 | "kohana", 165 | "laravel", 166 | "lavalite", 167 | "lithium", 168 | "magento", 169 | "majima", 170 | "mako", 171 | "mediawiki", 172 | "miaoxing", 173 | "modulework", 174 | "modx", 175 | "moodle", 176 | "osclass", 177 | "phpbb", 178 | "piwik", 179 | "ppi", 180 | "processwire", 181 | "puppet", 182 | "pxcms", 183 | "reindex", 184 | "roundcube", 185 | "shopware", 186 | "silverstripe", 187 | "sydes", 188 | "sylius", 189 | "symfony", 190 | "tastyigniter", 191 | "typo3", 192 | "wordpress", 193 | "yawik", 194 | "zend", 195 | "zikula" 196 | ], 197 | "support": { 198 | "issues": "https://github.com/composer/installers/issues", 199 | "source": "https://github.com/composer/installers/tree/v1.11.0" 200 | }, 201 | "funding": [ 202 | { 203 | "url": "https://packagist.com", 204 | "type": "custom" 205 | }, 206 | { 207 | "url": "https://github.com/composer", 208 | "type": "github" 209 | }, 210 | { 211 | "url": "https://tidelift.com/funding/github/packagist/composer/composer", 212 | "type": "tidelift" 213 | } 214 | ], 215 | "time": "2021-04-28T06:42:17+00:00" 216 | }, 217 | { 218 | "name": "doctrine/inflector", 219 | "version": "1.4.4", 220 | "source": { 221 | "type": "git", 222 | "url": "https://github.com/doctrine/inflector.git", 223 | "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" 224 | }, 225 | "dist": { 226 | "type": "zip", 227 | "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", 228 | "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", 229 | "shasum": "" 230 | }, 231 | "require": { 232 | "php": "^7.1 || ^8.0" 233 | }, 234 | "require-dev": { 235 | "doctrine/coding-standard": "^8.0", 236 | "phpstan/phpstan": "^0.12", 237 | "phpstan/phpstan-phpunit": "^0.12", 238 | "phpstan/phpstan-strict-rules": "^0.12", 239 | "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" 240 | }, 241 | "type": "library", 242 | "extra": { 243 | "branch-alias": { 244 | "dev-master": "2.0.x-dev" 245 | } 246 | }, 247 | "autoload": { 248 | "psr-4": { 249 | "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector", 250 | "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" 251 | } 252 | }, 253 | "notification-url": "https://packagist.org/downloads/", 254 | "license": [ 255 | "MIT" 256 | ], 257 | "authors": [ 258 | { 259 | "name": "Guilherme Blanco", 260 | "email": "guilhermeblanco@gmail.com" 261 | }, 262 | { 263 | "name": "Roman Borschel", 264 | "email": "roman@code-factory.org" 265 | }, 266 | { 267 | "name": "Benjamin Eberlei", 268 | "email": "kontakt@beberlei.de" 269 | }, 270 | { 271 | "name": "Jonathan Wage", 272 | "email": "jonwage@gmail.com" 273 | }, 274 | { 275 | "name": "Johannes Schmitt", 276 | "email": "schmittjoh@gmail.com" 277 | } 278 | ], 279 | "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", 280 | "homepage": "https://www.doctrine-project.org/projects/inflector.html", 281 | "keywords": [ 282 | "inflection", 283 | "inflector", 284 | "lowercase", 285 | "manipulation", 286 | "php", 287 | "plural", 288 | "singular", 289 | "strings", 290 | "uppercase", 291 | "words" 292 | ], 293 | "support": { 294 | "issues": "https://github.com/doctrine/inflector/issues", 295 | "source": "https://github.com/doctrine/inflector/tree/1.4.4" 296 | }, 297 | "funding": [ 298 | { 299 | "url": "https://www.doctrine-project.org/sponsorship.html", 300 | "type": "custom" 301 | }, 302 | { 303 | "url": "https://www.patreon.com/phpdoctrine", 304 | "type": "patreon" 305 | }, 306 | { 307 | "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", 308 | "type": "tidelift" 309 | } 310 | ], 311 | "time": "2021-04-16T17:34:40+00:00" 312 | }, 313 | { 314 | "name": "graham-campbell/result-type", 315 | "version": "v1.0.1", 316 | "source": { 317 | "type": "git", 318 | "url": "https://github.com/GrahamCampbell/Result-Type.git", 319 | "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb" 320 | }, 321 | "dist": { 322 | "type": "zip", 323 | "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/7e279d2cd5d7fbb156ce46daada972355cea27bb", 324 | "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb", 325 | "shasum": "" 326 | }, 327 | "require": { 328 | "php": "^7.0|^8.0", 329 | "phpoption/phpoption": "^1.7.3" 330 | }, 331 | "require-dev": { 332 | "phpunit/phpunit": "^6.5|^7.5|^8.5|^9.0" 333 | }, 334 | "type": "library", 335 | "extra": { 336 | "branch-alias": { 337 | "dev-master": "1.0-dev" 338 | } 339 | }, 340 | "autoload": { 341 | "psr-4": { 342 | "GrahamCampbell\\ResultType\\": "src/" 343 | } 344 | }, 345 | "notification-url": "https://packagist.org/downloads/", 346 | "license": [ 347 | "MIT" 348 | ], 349 | "authors": [ 350 | { 351 | "name": "Graham Campbell", 352 | "email": "graham@alt-three.com" 353 | } 354 | ], 355 | "description": "An Implementation Of The Result Type", 356 | "keywords": [ 357 | "Graham Campbell", 358 | "GrahamCampbell", 359 | "Result Type", 360 | "Result-Type", 361 | "result" 362 | ], 363 | "support": { 364 | "issues": "https://github.com/GrahamCampbell/Result-Type/issues", 365 | "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.1" 366 | }, 367 | "funding": [ 368 | { 369 | "url": "https://github.com/GrahamCampbell", 370 | "type": "github" 371 | }, 372 | { 373 | "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", 374 | "type": "tidelift" 375 | } 376 | ], 377 | "time": "2020-04-13T13:17:36+00:00" 378 | }, 379 | { 380 | "name": "illuminate/config", 381 | "version": "v5.6.39", 382 | "source": { 383 | "type": "git", 384 | "url": "https://github.com/illuminate/config.git", 385 | "reference": "61f4eb8145a1473577a9876471c92fa4de4718a7" 386 | }, 387 | "dist": { 388 | "type": "zip", 389 | "url": "https://api.github.com/repos/illuminate/config/zipball/61f4eb8145a1473577a9876471c92fa4de4718a7", 390 | "reference": "61f4eb8145a1473577a9876471c92fa4de4718a7", 391 | "shasum": "" 392 | }, 393 | "require": { 394 | "illuminate/contracts": "5.6.*", 395 | "illuminate/support": "5.6.*", 396 | "php": "^7.1.3" 397 | }, 398 | "type": "library", 399 | "extra": { 400 | "branch-alias": { 401 | "dev-master": "5.6-dev" 402 | } 403 | }, 404 | "autoload": { 405 | "psr-4": { 406 | "Illuminate\\Config\\": "" 407 | } 408 | }, 409 | "notification-url": "https://packagist.org/downloads/", 410 | "license": [ 411 | "MIT" 412 | ], 413 | "authors": [ 414 | { 415 | "name": "Taylor Otwell", 416 | "email": "taylor@laravel.com" 417 | } 418 | ], 419 | "description": "The Illuminate Config package.", 420 | "homepage": "https://laravel.com", 421 | "support": { 422 | "issues": "https://github.com/laravel/framework/issues", 423 | "source": "https://github.com/laravel/framework" 424 | }, 425 | "time": "2017-11-07T20:23:51+00:00" 426 | }, 427 | { 428 | "name": "illuminate/container", 429 | "version": "v5.6.39", 430 | "source": { 431 | "type": "git", 432 | "url": "https://github.com/illuminate/container.git", 433 | "reference": "779b56b37396b888414622d5667d3bcc205964ab" 434 | }, 435 | "dist": { 436 | "type": "zip", 437 | "url": "https://api.github.com/repos/illuminate/container/zipball/779b56b37396b888414622d5667d3bcc205964ab", 438 | "reference": "779b56b37396b888414622d5667d3bcc205964ab", 439 | "shasum": "" 440 | }, 441 | "require": { 442 | "illuminate/contracts": "5.6.*", 443 | "php": "^7.1.3", 444 | "psr/container": "~1.0" 445 | }, 446 | "type": "library", 447 | "extra": { 448 | "branch-alias": { 449 | "dev-master": "5.6-dev" 450 | } 451 | }, 452 | "autoload": { 453 | "psr-4": { 454 | "Illuminate\\Container\\": "" 455 | } 456 | }, 457 | "notification-url": "https://packagist.org/downloads/", 458 | "license": [ 459 | "MIT" 460 | ], 461 | "authors": [ 462 | { 463 | "name": "Taylor Otwell", 464 | "email": "taylor@laravel.com" 465 | } 466 | ], 467 | "description": "The Illuminate Container package.", 468 | "homepage": "https://laravel.com", 469 | "support": { 470 | "issues": "https://github.com/laravel/framework/issues", 471 | "source": "https://github.com/laravel/framework" 472 | }, 473 | "time": "2018-05-24T13:16:56+00:00" 474 | }, 475 | { 476 | "name": "illuminate/contracts", 477 | "version": "v5.6.39", 478 | "source": { 479 | "type": "git", 480 | "url": "https://github.com/illuminate/contracts.git", 481 | "reference": "66b653fd430bf06f59cef1112197d009bd02da84" 482 | }, 483 | "dist": { 484 | "type": "zip", 485 | "url": "https://api.github.com/repos/illuminate/contracts/zipball/66b653fd430bf06f59cef1112197d009bd02da84", 486 | "reference": "66b653fd430bf06f59cef1112197d009bd02da84", 487 | "shasum": "" 488 | }, 489 | "require": { 490 | "php": "^7.1.3", 491 | "psr/container": "~1.0", 492 | "psr/simple-cache": "~1.0" 493 | }, 494 | "type": "library", 495 | "extra": { 496 | "branch-alias": { 497 | "dev-master": "5.6-dev" 498 | } 499 | }, 500 | "autoload": { 501 | "psr-4": { 502 | "Illuminate\\Contracts\\": "" 503 | } 504 | }, 505 | "notification-url": "https://packagist.org/downloads/", 506 | "license": [ 507 | "MIT" 508 | ], 509 | "authors": [ 510 | { 511 | "name": "Taylor Otwell", 512 | "email": "taylor@laravel.com" 513 | } 514 | ], 515 | "description": "The Illuminate Contracts package.", 516 | "homepage": "https://laravel.com", 517 | "support": { 518 | "issues": "https://github.com/laravel/framework/issues", 519 | "source": "https://github.com/laravel/framework" 520 | }, 521 | "time": "2018-07-31T12:49:53+00:00" 522 | }, 523 | { 524 | "name": "illuminate/events", 525 | "version": "v5.6.39", 526 | "source": { 527 | "type": "git", 528 | "url": "https://github.com/illuminate/events.git", 529 | "reference": "c702e65fe37458fece6ae87ce7906aaa614383d6" 530 | }, 531 | "dist": { 532 | "type": "zip", 533 | "url": "https://api.github.com/repos/illuminate/events/zipball/c702e65fe37458fece6ae87ce7906aaa614383d6", 534 | "reference": "c702e65fe37458fece6ae87ce7906aaa614383d6", 535 | "shasum": "" 536 | }, 537 | "require": { 538 | "illuminate/container": "5.6.*", 539 | "illuminate/contracts": "5.6.*", 540 | "illuminate/support": "5.6.*", 541 | "php": "^7.1.3" 542 | }, 543 | "type": "library", 544 | "extra": { 545 | "branch-alias": { 546 | "dev-master": "5.6-dev" 547 | } 548 | }, 549 | "autoload": { 550 | "psr-4": { 551 | "Illuminate\\Events\\": "" 552 | } 553 | }, 554 | "notification-url": "https://packagist.org/downloads/", 555 | "license": [ 556 | "MIT" 557 | ], 558 | "authors": [ 559 | { 560 | "name": "Taylor Otwell", 561 | "email": "taylor@laravel.com" 562 | } 563 | ], 564 | "description": "The Illuminate Events package.", 565 | "homepage": "https://laravel.com", 566 | "support": { 567 | "issues": "https://github.com/laravel/framework/issues", 568 | "source": "https://github.com/laravel/framework" 569 | }, 570 | "time": "2018-07-23T01:01:28+00:00" 571 | }, 572 | { 573 | "name": "illuminate/filesystem", 574 | "version": "v5.6.39", 575 | "source": { 576 | "type": "git", 577 | "url": "https://github.com/illuminate/filesystem.git", 578 | "reference": "b25940b428c9fd284feaad20e176ace8d780973b" 579 | }, 580 | "dist": { 581 | "type": "zip", 582 | "url": "https://api.github.com/repos/illuminate/filesystem/zipball/b25940b428c9fd284feaad20e176ace8d780973b", 583 | "reference": "b25940b428c9fd284feaad20e176ace8d780973b", 584 | "shasum": "" 585 | }, 586 | "require": { 587 | "illuminate/contracts": "5.6.*", 588 | "illuminate/support": "5.6.*", 589 | "php": "^7.1.3", 590 | "symfony/finder": "~4.0" 591 | }, 592 | "suggest": { 593 | "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).", 594 | "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", 595 | "league/flysystem-cached-adapter": "Required to use the Flysystem cache (~1.0).", 596 | "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", 597 | "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (~1.0)." 598 | }, 599 | "type": "library", 600 | "extra": { 601 | "branch-alias": { 602 | "dev-master": "5.6-dev" 603 | } 604 | }, 605 | "autoload": { 606 | "psr-4": { 607 | "Illuminate\\Filesystem\\": "" 608 | } 609 | }, 610 | "notification-url": "https://packagist.org/downloads/", 611 | "license": [ 612 | "MIT" 613 | ], 614 | "authors": [ 615 | { 616 | "name": "Taylor Otwell", 617 | "email": "taylor@laravel.com" 618 | } 619 | ], 620 | "description": "The Illuminate Filesystem package.", 621 | "homepage": "https://laravel.com", 622 | "support": { 623 | "issues": "https://github.com/laravel/framework/issues", 624 | "source": "https://github.com/laravel/framework" 625 | }, 626 | "time": "2018-08-13T14:51:11+00:00" 627 | }, 628 | { 629 | "name": "illuminate/support", 630 | "version": "v5.6.39", 631 | "source": { 632 | "type": "git", 633 | "url": "https://github.com/illuminate/support.git", 634 | "reference": "e2fce24254b8f60a2f92a3ab485799b372625a06" 635 | }, 636 | "dist": { 637 | "type": "zip", 638 | "url": "https://api.github.com/repos/illuminate/support/zipball/e2fce24254b8f60a2f92a3ab485799b372625a06", 639 | "reference": "e2fce24254b8f60a2f92a3ab485799b372625a06", 640 | "shasum": "" 641 | }, 642 | "require": { 643 | "doctrine/inflector": "~1.1", 644 | "ext-mbstring": "*", 645 | "illuminate/contracts": "5.6.*", 646 | "nesbot/carbon": "1.25.*", 647 | "php": "^7.1.3" 648 | }, 649 | "conflict": { 650 | "tightenco/collect": "<5.5.33" 651 | }, 652 | "suggest": { 653 | "illuminate/filesystem": "Required to use the composer class (5.6.*).", 654 | "ramsey/uuid": "Required to use Str::uuid() (^3.7).", 655 | "symfony/process": "Required to use the composer class (~4.0).", 656 | "symfony/var-dumper": "Required to use the dd function (~4.0)." 657 | }, 658 | "type": "library", 659 | "extra": { 660 | "branch-alias": { 661 | "dev-master": "5.6-dev" 662 | } 663 | }, 664 | "autoload": { 665 | "psr-4": { 666 | "Illuminate\\Support\\": "" 667 | }, 668 | "files": [ 669 | "helpers.php" 670 | ] 671 | }, 672 | "notification-url": "https://packagist.org/downloads/", 673 | "license": [ 674 | "MIT" 675 | ], 676 | "authors": [ 677 | { 678 | "name": "Taylor Otwell", 679 | "email": "taylor@laravel.com" 680 | } 681 | ], 682 | "description": "The Illuminate Support package.", 683 | "homepage": "https://laravel.com", 684 | "support": { 685 | "issues": "https://github.com/laravel/framework/issues", 686 | "source": "https://github.com/laravel/framework" 687 | }, 688 | "time": "2018-09-06T13:37:53+00:00" 689 | }, 690 | { 691 | "name": "illuminate/view", 692 | "version": "v5.6.39", 693 | "source": { 694 | "type": "git", 695 | "url": "https://github.com/illuminate/view.git", 696 | "reference": "60fd8f12340417a4312e5d90961510333d4f1d46" 697 | }, 698 | "dist": { 699 | "type": "zip", 700 | "url": "https://api.github.com/repos/illuminate/view/zipball/60fd8f12340417a4312e5d90961510333d4f1d46", 701 | "reference": "60fd8f12340417a4312e5d90961510333d4f1d46", 702 | "shasum": "" 703 | }, 704 | "require": { 705 | "illuminate/container": "5.6.*", 706 | "illuminate/contracts": "5.6.*", 707 | "illuminate/events": "5.6.*", 708 | "illuminate/filesystem": "5.6.*", 709 | "illuminate/support": "5.6.*", 710 | "php": "^7.1.3", 711 | "symfony/debug": "~4.0" 712 | }, 713 | "type": "library", 714 | "extra": { 715 | "branch-alias": { 716 | "dev-master": "5.6-dev" 717 | } 718 | }, 719 | "autoload": { 720 | "psr-4": { 721 | "Illuminate\\View\\": "" 722 | } 723 | }, 724 | "notification-url": "https://packagist.org/downloads/", 725 | "license": [ 726 | "MIT" 727 | ], 728 | "authors": [ 729 | { 730 | "name": "Taylor Otwell", 731 | "email": "taylor@laravel.com" 732 | } 733 | ], 734 | "description": "The Illuminate View package.", 735 | "homepage": "https://laravel.com", 736 | "support": { 737 | "issues": "https://github.com/laravel/framework/issues", 738 | "source": "https://github.com/laravel/framework" 739 | }, 740 | "time": "2018-10-02T13:27:20+00:00" 741 | }, 742 | { 743 | "name": "kylekatarnls/update-helper", 744 | "version": "1.2.1", 745 | "source": { 746 | "type": "git", 747 | "url": "https://github.com/kylekatarnls/update-helper.git", 748 | "reference": "429be50660ed8a196e0798e5939760f168ec8ce9" 749 | }, 750 | "dist": { 751 | "type": "zip", 752 | "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/429be50660ed8a196e0798e5939760f168ec8ce9", 753 | "reference": "429be50660ed8a196e0798e5939760f168ec8ce9", 754 | "shasum": "" 755 | }, 756 | "require": { 757 | "composer-plugin-api": "^1.1.0 || ^2.0.0", 758 | "php": ">=5.3.0" 759 | }, 760 | "require-dev": { 761 | "codeclimate/php-test-reporter": "dev-master", 762 | "composer/composer": "2.0.x-dev || ^2.0.0-dev", 763 | "phpunit/phpunit": ">=4.8.35 <6.0" 764 | }, 765 | "type": "composer-plugin", 766 | "extra": { 767 | "class": "UpdateHelper\\ComposerPlugin" 768 | }, 769 | "autoload": { 770 | "psr-0": { 771 | "UpdateHelper\\": "src/" 772 | } 773 | }, 774 | "notification-url": "https://packagist.org/downloads/", 775 | "license": [ 776 | "MIT" 777 | ], 778 | "authors": [ 779 | { 780 | "name": "Kyle", 781 | "email": "kylekatarnls@gmail.com" 782 | } 783 | ], 784 | "description": "Update helper", 785 | "support": { 786 | "issues": "https://github.com/kylekatarnls/update-helper/issues", 787 | "source": "https://github.com/kylekatarnls/update-helper/tree/1.2.1" 788 | }, 789 | "funding": [ 790 | { 791 | "url": "https://github.com/kylekatarnls", 792 | "type": "github" 793 | }, 794 | { 795 | "url": "https://opencollective.com/Carbon", 796 | "type": "open_collective" 797 | }, 798 | { 799 | "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", 800 | "type": "tidelift" 801 | } 802 | ], 803 | "time": "2020-04-07T20:44:10+00:00" 804 | }, 805 | { 806 | "name": "nesbot/carbon", 807 | "version": "1.25.3", 808 | "source": { 809 | "type": "git", 810 | "url": "https://github.com/briannesbitt/Carbon.git", 811 | "reference": "ad6afecd38ce2d7f7bd1b5d47ffd8e93ebbd3ed8" 812 | }, 813 | "dist": { 814 | "type": "zip", 815 | "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ad6afecd38ce2d7f7bd1b5d47ffd8e93ebbd3ed8", 816 | "reference": "ad6afecd38ce2d7f7bd1b5d47ffd8e93ebbd3ed8", 817 | "shasum": "" 818 | }, 819 | "require": { 820 | "kylekatarnls/update-helper": "^1.1", 821 | "php": ">=5.3.9", 822 | "symfony/translation": "~2.6 || ~3.0 || ~4.0" 823 | }, 824 | "require-dev": { 825 | "composer/composer": "^1.2", 826 | "friendsofphp/php-cs-fixer": "~2", 827 | "phpunit/phpunit": "^4.8.35 || ^5.7" 828 | }, 829 | "bin": [ 830 | "bin/upgrade-carbon" 831 | ], 832 | "type": "library", 833 | "extra": { 834 | "update-helper": "Carbon\\Upgrade" 835 | }, 836 | "autoload": { 837 | "psr-4": { 838 | "Carbon\\": "src/Carbon/" 839 | } 840 | }, 841 | "notification-url": "https://packagist.org/downloads/", 842 | "license": [ 843 | "MIT" 844 | ], 845 | "authors": [ 846 | { 847 | "name": "Brian Nesbitt", 848 | "email": "brian@nesbot.com", 849 | "homepage": "http://nesbot.com" 850 | } 851 | ], 852 | "description": "A simple API extension for DateTime.", 853 | "homepage": "http://carbon.nesbot.com", 854 | "keywords": [ 855 | "date", 856 | "datetime", 857 | "time" 858 | ], 859 | "support": { 860 | "issues": "https://github.com/briannesbitt/Carbon/issues", 861 | "source": "https://github.com/briannesbitt/Carbon" 862 | }, 863 | "time": "2019-06-03T17:56:44+00:00" 864 | }, 865 | { 866 | "name": "oscarotero/env", 867 | "version": "v2.1.0", 868 | "source": { 869 | "type": "git", 870 | "url": "https://github.com/oscarotero/env.git", 871 | "reference": "0da22cadc6924155fa9bbea2cdda2e84ab7cbdd3" 872 | }, 873 | "dist": { 874 | "type": "zip", 875 | "url": "https://api.github.com/repos/oscarotero/env/zipball/0da22cadc6924155fa9bbea2cdda2e84ab7cbdd3", 876 | "reference": "0da22cadc6924155fa9bbea2cdda2e84ab7cbdd3", 877 | "shasum": "" 878 | }, 879 | "require": { 880 | "ext-ctype": "*", 881 | "php": ">=7.1" 882 | }, 883 | "require-dev": { 884 | "friendsofphp/php-cs-fixer": "^2.16", 885 | "phpunit/phpunit": "^7.0" 886 | }, 887 | "type": "library", 888 | "autoload": { 889 | "psr-4": { 890 | "Env\\": "src/" 891 | }, 892 | "files": [ 893 | "src/env_function.php" 894 | ] 895 | }, 896 | "notification-url": "https://packagist.org/downloads/", 897 | "license": [ 898 | "MIT" 899 | ], 900 | "authors": [ 901 | { 902 | "name": "Oscar Otero", 903 | "email": "oom@oscarotero.com", 904 | "homepage": "http://oscarotero.com", 905 | "role": "Developer" 906 | } 907 | ], 908 | "description": "Simple library to consume environment variables", 909 | "homepage": "https://github.com/oscarotero/env", 910 | "keywords": [ 911 | "env" 912 | ], 913 | "support": { 914 | "email": "oom@oscarotero.com", 915 | "issues": "https://github.com/oscarotero/env/issues", 916 | "source": "https://github.com/oscarotero/env/tree/v2.1.0" 917 | }, 918 | "time": "2020-06-11T10:59:27+00:00" 919 | }, 920 | { 921 | "name": "phpoption/phpoption", 922 | "version": "1.7.5", 923 | "source": { 924 | "type": "git", 925 | "url": "https://github.com/schmittjoh/php-option.git", 926 | "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525" 927 | }, 928 | "dist": { 929 | "type": "zip", 930 | "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/994ecccd8f3283ecf5ac33254543eb0ac946d525", 931 | "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525", 932 | "shasum": "" 933 | }, 934 | "require": { 935 | "php": "^5.5.9 || ^7.0 || ^8.0" 936 | }, 937 | "require-dev": { 938 | "bamarni/composer-bin-plugin": "^1.4.1", 939 | "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0 || ^8.0 || ^9.0" 940 | }, 941 | "type": "library", 942 | "extra": { 943 | "branch-alias": { 944 | "dev-master": "1.7-dev" 945 | } 946 | }, 947 | "autoload": { 948 | "psr-4": { 949 | "PhpOption\\": "src/PhpOption/" 950 | } 951 | }, 952 | "notification-url": "https://packagist.org/downloads/", 953 | "license": [ 954 | "Apache-2.0" 955 | ], 956 | "authors": [ 957 | { 958 | "name": "Johannes M. Schmitt", 959 | "email": "schmittjoh@gmail.com" 960 | }, 961 | { 962 | "name": "Graham Campbell", 963 | "email": "graham@alt-three.com" 964 | } 965 | ], 966 | "description": "Option Type for PHP", 967 | "keywords": [ 968 | "language", 969 | "option", 970 | "php", 971 | "type" 972 | ], 973 | "support": { 974 | "issues": "https://github.com/schmittjoh/php-option/issues", 975 | "source": "https://github.com/schmittjoh/php-option/tree/1.7.5" 976 | }, 977 | "funding": [ 978 | { 979 | "url": "https://github.com/GrahamCampbell", 980 | "type": "github" 981 | }, 982 | { 983 | "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", 984 | "type": "tidelift" 985 | } 986 | ], 987 | "time": "2020-07-20T17:29:33+00:00" 988 | }, 989 | { 990 | "name": "psr/container", 991 | "version": "1.1.1", 992 | "source": { 993 | "type": "git", 994 | "url": "https://github.com/php-fig/container.git", 995 | "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" 996 | }, 997 | "dist": { 998 | "type": "zip", 999 | "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", 1000 | "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", 1001 | "shasum": "" 1002 | }, 1003 | "require": { 1004 | "php": ">=7.2.0" 1005 | }, 1006 | "type": "library", 1007 | "autoload": { 1008 | "psr-4": { 1009 | "Psr\\Container\\": "src/" 1010 | } 1011 | }, 1012 | "notification-url": "https://packagist.org/downloads/", 1013 | "license": [ 1014 | "MIT" 1015 | ], 1016 | "authors": [ 1017 | { 1018 | "name": "PHP-FIG", 1019 | "homepage": "https://www.php-fig.org/" 1020 | } 1021 | ], 1022 | "description": "Common Container Interface (PHP FIG PSR-11)", 1023 | "homepage": "https://github.com/php-fig/container", 1024 | "keywords": [ 1025 | "PSR-11", 1026 | "container", 1027 | "container-interface", 1028 | "container-interop", 1029 | "psr" 1030 | ], 1031 | "support": { 1032 | "issues": "https://github.com/php-fig/container/issues", 1033 | "source": "https://github.com/php-fig/container/tree/1.1.1" 1034 | }, 1035 | "time": "2021-03-05T17:36:06+00:00" 1036 | }, 1037 | { 1038 | "name": "psr/log", 1039 | "version": "1.1.4", 1040 | "source": { 1041 | "type": "git", 1042 | "url": "https://github.com/php-fig/log.git", 1043 | "reference": "d49695b909c3b7628b6289db5479a1c204601f11" 1044 | }, 1045 | "dist": { 1046 | "type": "zip", 1047 | "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", 1048 | "reference": "d49695b909c3b7628b6289db5479a1c204601f11", 1049 | "shasum": "" 1050 | }, 1051 | "require": { 1052 | "php": ">=5.3.0" 1053 | }, 1054 | "type": "library", 1055 | "extra": { 1056 | "branch-alias": { 1057 | "dev-master": "1.1.x-dev" 1058 | } 1059 | }, 1060 | "autoload": { 1061 | "psr-4": { 1062 | "Psr\\Log\\": "Psr/Log/" 1063 | } 1064 | }, 1065 | "notification-url": "https://packagist.org/downloads/", 1066 | "license": [ 1067 | "MIT" 1068 | ], 1069 | "authors": [ 1070 | { 1071 | "name": "PHP-FIG", 1072 | "homepage": "https://www.php-fig.org/" 1073 | } 1074 | ], 1075 | "description": "Common interface for logging libraries", 1076 | "homepage": "https://github.com/php-fig/log", 1077 | "keywords": [ 1078 | "log", 1079 | "psr", 1080 | "psr-3" 1081 | ], 1082 | "support": { 1083 | "source": "https://github.com/php-fig/log/tree/1.1.4" 1084 | }, 1085 | "time": "2021-05-03T11:20:27+00:00" 1086 | }, 1087 | { 1088 | "name": "psr/simple-cache", 1089 | "version": "1.0.1", 1090 | "source": { 1091 | "type": "git", 1092 | "url": "https://github.com/php-fig/simple-cache.git", 1093 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" 1094 | }, 1095 | "dist": { 1096 | "type": "zip", 1097 | "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 1098 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 1099 | "shasum": "" 1100 | }, 1101 | "require": { 1102 | "php": ">=5.3.0" 1103 | }, 1104 | "type": "library", 1105 | "extra": { 1106 | "branch-alias": { 1107 | "dev-master": "1.0.x-dev" 1108 | } 1109 | }, 1110 | "autoload": { 1111 | "psr-4": { 1112 | "Psr\\SimpleCache\\": "src/" 1113 | } 1114 | }, 1115 | "notification-url": "https://packagist.org/downloads/", 1116 | "license": [ 1117 | "MIT" 1118 | ], 1119 | "authors": [ 1120 | { 1121 | "name": "PHP-FIG", 1122 | "homepage": "http://www.php-fig.org/" 1123 | } 1124 | ], 1125 | "description": "Common interfaces for simple caching", 1126 | "keywords": [ 1127 | "cache", 1128 | "caching", 1129 | "psr", 1130 | "psr-16", 1131 | "simple-cache" 1132 | ], 1133 | "support": { 1134 | "source": "https://github.com/php-fig/simple-cache/tree/master" 1135 | }, 1136 | "time": "2017-10-23T01:57:42+00:00" 1137 | }, 1138 | { 1139 | "name": "roots/sage-lib", 1140 | "version": "9.0.9", 1141 | "source": { 1142 | "type": "git", 1143 | "url": "https://github.com/roots/sage-lib.git", 1144 | "reference": "b9adfbd72faf997b226d5a9f06b8ea74260e72fd" 1145 | }, 1146 | "dist": { 1147 | "type": "zip", 1148 | "url": "https://api.github.com/repos/roots/sage-lib/zipball/b9adfbd72faf997b226d5a9f06b8ea74260e72fd", 1149 | "reference": "b9adfbd72faf997b226d5a9f06b8ea74260e72fd", 1150 | "shasum": "" 1151 | }, 1152 | "require": { 1153 | "composer/installers": "~1.0", 1154 | "illuminate/config": "~5.6", 1155 | "illuminate/view": "~5.6", 1156 | "php": ">=7.1" 1157 | }, 1158 | "require-dev": { 1159 | "squizlabs/php_codesniffer": "~3.3.1" 1160 | }, 1161 | "type": "library", 1162 | "autoload": { 1163 | "psr-4": { 1164 | "Roots\\Sage\\": "" 1165 | } 1166 | }, 1167 | "notification-url": "https://packagist.org/downloads/", 1168 | "license": [ 1169 | "MIT" 1170 | ], 1171 | "authors": [ 1172 | { 1173 | "name": "Ben Word", 1174 | "email": "ben@benword.com", 1175 | "homepage": "https://github.com/retlehs" 1176 | }, 1177 | { 1178 | "name": "QWp6t", 1179 | "email": "hi@qwp6t.me", 1180 | "homepage": "https://github.com/qwp6t" 1181 | } 1182 | ], 1183 | "description": "Library files for Sage Starter Theme", 1184 | "homepage": "https://roots.io/sage/", 1185 | "keywords": [ 1186 | "wordpress" 1187 | ], 1188 | "support": { 1189 | "forum": "https://discourse.roots.io/", 1190 | "issues": "https://github.com/roots/sage-lib/issues", 1191 | "source": "https://github.com/roots/sage-lib/tree/master" 1192 | }, 1193 | "time": "2018-12-28T01:46:28+00:00" 1194 | }, 1195 | { 1196 | "name": "soberwp/controller", 1197 | "version": "2.1.3", 1198 | "source": { 1199 | "type": "git", 1200 | "url": "https://github.com/soberwp/controller.git", 1201 | "reference": "af84ce8357a5112c93f68826793fc512ba5d1792" 1202 | }, 1203 | "dist": { 1204 | "type": "zip", 1205 | "url": "https://api.github.com/repos/soberwp/controller/zipball/af84ce8357a5112c93f68826793fc512ba5d1792", 1206 | "reference": "af84ce8357a5112c93f68826793fc512ba5d1792", 1207 | "shasum": "" 1208 | }, 1209 | "require": { 1210 | "brain/hierarchy": "^2.4.0", 1211 | "php": ">=5.6.0" 1212 | }, 1213 | "require-dev": { 1214 | "squizlabs/php_codesniffer": "^3.2" 1215 | }, 1216 | "type": "package", 1217 | "autoload": { 1218 | "psr-4": { 1219 | "Sober\\Controller\\": "src/" 1220 | }, 1221 | "files": [ 1222 | "controller.php" 1223 | ] 1224 | }, 1225 | "notification-url": "https://packagist.org/downloads/", 1226 | "license": [ 1227 | "MIT" 1228 | ], 1229 | "authors": [ 1230 | { 1231 | "name": "Darren Jacoby", 1232 | "email": "darren@jacoby.co.za", 1233 | "homepage": "https://github.com/darrenjacoby" 1234 | } 1235 | ], 1236 | "description": "WordPress package to enable a basic controller when using Blade with Sage 9", 1237 | "homepage": "https://github.com/soberwp", 1238 | "keywords": [ 1239 | "wordpress" 1240 | ], 1241 | "support": { 1242 | "issues": "https://github.com/soberwp/controller/issues", 1243 | "source": "https://github.com/soberwp/controller/tree/2.1.3" 1244 | }, 1245 | "time": "2021-05-27T14:42:31+00:00" 1246 | }, 1247 | { 1248 | "name": "symfony/debug", 1249 | "version": "v4.4.22", 1250 | "source": { 1251 | "type": "git", 1252 | "url": "https://github.com/symfony/debug.git", 1253 | "reference": "45b2136377cca5f10af858968d6079a482bca473" 1254 | }, 1255 | "dist": { 1256 | "type": "zip", 1257 | "url": "https://api.github.com/repos/symfony/debug/zipball/45b2136377cca5f10af858968d6079a482bca473", 1258 | "reference": "45b2136377cca5f10af858968d6079a482bca473", 1259 | "shasum": "" 1260 | }, 1261 | "require": { 1262 | "php": ">=7.1.3", 1263 | "psr/log": "~1.0", 1264 | "symfony/polyfill-php80": "^1.15" 1265 | }, 1266 | "conflict": { 1267 | "symfony/http-kernel": "<3.4" 1268 | }, 1269 | "require-dev": { 1270 | "symfony/http-kernel": "^3.4|^4.0|^5.0" 1271 | }, 1272 | "type": "library", 1273 | "autoload": { 1274 | "psr-4": { 1275 | "Symfony\\Component\\Debug\\": "" 1276 | }, 1277 | "exclude-from-classmap": [ 1278 | "/Tests/" 1279 | ] 1280 | }, 1281 | "notification-url": "https://packagist.org/downloads/", 1282 | "license": [ 1283 | "MIT" 1284 | ], 1285 | "authors": [ 1286 | { 1287 | "name": "Fabien Potencier", 1288 | "email": "fabien@symfony.com" 1289 | }, 1290 | { 1291 | "name": "Symfony Community", 1292 | "homepage": "https://symfony.com/contributors" 1293 | } 1294 | ], 1295 | "description": "Provides tools to ease debugging PHP code", 1296 | "homepage": "https://symfony.com", 1297 | "support": { 1298 | "source": "https://github.com/symfony/debug/tree/v4.4.22" 1299 | }, 1300 | "funding": [ 1301 | { 1302 | "url": "https://symfony.com/sponsor", 1303 | "type": "custom" 1304 | }, 1305 | { 1306 | "url": "https://github.com/fabpot", 1307 | "type": "github" 1308 | }, 1309 | { 1310 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1311 | "type": "tidelift" 1312 | } 1313 | ], 1314 | "time": "2021-04-02T07:50:12+00:00" 1315 | }, 1316 | { 1317 | "name": "symfony/finder", 1318 | "version": "v4.4.24", 1319 | "source": { 1320 | "type": "git", 1321 | "url": "https://github.com/symfony/finder.git", 1322 | "reference": "a96bc19ed87c88eec78e1a4c803bdc1446952983" 1323 | }, 1324 | "dist": { 1325 | "type": "zip", 1326 | "url": "https://api.github.com/repos/symfony/finder/zipball/a96bc19ed87c88eec78e1a4c803bdc1446952983", 1327 | "reference": "a96bc19ed87c88eec78e1a4c803bdc1446952983", 1328 | "shasum": "" 1329 | }, 1330 | "require": { 1331 | "php": ">=7.1.3" 1332 | }, 1333 | "type": "library", 1334 | "autoload": { 1335 | "psr-4": { 1336 | "Symfony\\Component\\Finder\\": "" 1337 | }, 1338 | "exclude-from-classmap": [ 1339 | "/Tests/" 1340 | ] 1341 | }, 1342 | "notification-url": "https://packagist.org/downloads/", 1343 | "license": [ 1344 | "MIT" 1345 | ], 1346 | "authors": [ 1347 | { 1348 | "name": "Fabien Potencier", 1349 | "email": "fabien@symfony.com" 1350 | }, 1351 | { 1352 | "name": "Symfony Community", 1353 | "homepage": "https://symfony.com/contributors" 1354 | } 1355 | ], 1356 | "description": "Finds files and directories via an intuitive fluent interface", 1357 | "homepage": "https://symfony.com", 1358 | "support": { 1359 | "source": "https://github.com/symfony/finder/tree/v4.4.24" 1360 | }, 1361 | "funding": [ 1362 | { 1363 | "url": "https://symfony.com/sponsor", 1364 | "type": "custom" 1365 | }, 1366 | { 1367 | "url": "https://github.com/fabpot", 1368 | "type": "github" 1369 | }, 1370 | { 1371 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1372 | "type": "tidelift" 1373 | } 1374 | ], 1375 | "time": "2021-05-16T12:27:45+00:00" 1376 | }, 1377 | { 1378 | "name": "symfony/polyfill-ctype", 1379 | "version": "v1.23.0", 1380 | "source": { 1381 | "type": "git", 1382 | "url": "https://github.com/symfony/polyfill-ctype.git", 1383 | "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" 1384 | }, 1385 | "dist": { 1386 | "type": "zip", 1387 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", 1388 | "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", 1389 | "shasum": "" 1390 | }, 1391 | "require": { 1392 | "php": ">=7.1" 1393 | }, 1394 | "suggest": { 1395 | "ext-ctype": "For best performance" 1396 | }, 1397 | "type": "library", 1398 | "extra": { 1399 | "branch-alias": { 1400 | "dev-main": "1.23-dev" 1401 | }, 1402 | "thanks": { 1403 | "name": "symfony/polyfill", 1404 | "url": "https://github.com/symfony/polyfill" 1405 | } 1406 | }, 1407 | "autoload": { 1408 | "psr-4": { 1409 | "Symfony\\Polyfill\\Ctype\\": "" 1410 | }, 1411 | "files": [ 1412 | "bootstrap.php" 1413 | ] 1414 | }, 1415 | "notification-url": "https://packagist.org/downloads/", 1416 | "license": [ 1417 | "MIT" 1418 | ], 1419 | "authors": [ 1420 | { 1421 | "name": "Gert de Pagter", 1422 | "email": "BackEndTea@gmail.com" 1423 | }, 1424 | { 1425 | "name": "Symfony Community", 1426 | "homepage": "https://symfony.com/contributors" 1427 | } 1428 | ], 1429 | "description": "Symfony polyfill for ctype functions", 1430 | "homepage": "https://symfony.com", 1431 | "keywords": [ 1432 | "compatibility", 1433 | "ctype", 1434 | "polyfill", 1435 | "portable" 1436 | ], 1437 | "support": { 1438 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" 1439 | }, 1440 | "funding": [ 1441 | { 1442 | "url": "https://symfony.com/sponsor", 1443 | "type": "custom" 1444 | }, 1445 | { 1446 | "url": "https://github.com/fabpot", 1447 | "type": "github" 1448 | }, 1449 | { 1450 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1451 | "type": "tidelift" 1452 | } 1453 | ], 1454 | "time": "2021-02-19T12:13:01+00:00" 1455 | }, 1456 | { 1457 | "name": "symfony/polyfill-mbstring", 1458 | "version": "v1.23.0", 1459 | "source": { 1460 | "type": "git", 1461 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1462 | "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" 1463 | }, 1464 | "dist": { 1465 | "type": "zip", 1466 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", 1467 | "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", 1468 | "shasum": "" 1469 | }, 1470 | "require": { 1471 | "php": ">=7.1" 1472 | }, 1473 | "suggest": { 1474 | "ext-mbstring": "For best performance" 1475 | }, 1476 | "type": "library", 1477 | "extra": { 1478 | "branch-alias": { 1479 | "dev-main": "1.23-dev" 1480 | }, 1481 | "thanks": { 1482 | "name": "symfony/polyfill", 1483 | "url": "https://github.com/symfony/polyfill" 1484 | } 1485 | }, 1486 | "autoload": { 1487 | "psr-4": { 1488 | "Symfony\\Polyfill\\Mbstring\\": "" 1489 | }, 1490 | "files": [ 1491 | "bootstrap.php" 1492 | ] 1493 | }, 1494 | "notification-url": "https://packagist.org/downloads/", 1495 | "license": [ 1496 | "MIT" 1497 | ], 1498 | "authors": [ 1499 | { 1500 | "name": "Nicolas Grekas", 1501 | "email": "p@tchwork.com" 1502 | }, 1503 | { 1504 | "name": "Symfony Community", 1505 | "homepage": "https://symfony.com/contributors" 1506 | } 1507 | ], 1508 | "description": "Symfony polyfill for the Mbstring extension", 1509 | "homepage": "https://symfony.com", 1510 | "keywords": [ 1511 | "compatibility", 1512 | "mbstring", 1513 | "polyfill", 1514 | "portable", 1515 | "shim" 1516 | ], 1517 | "support": { 1518 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" 1519 | }, 1520 | "funding": [ 1521 | { 1522 | "url": "https://symfony.com/sponsor", 1523 | "type": "custom" 1524 | }, 1525 | { 1526 | "url": "https://github.com/fabpot", 1527 | "type": "github" 1528 | }, 1529 | { 1530 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1531 | "type": "tidelift" 1532 | } 1533 | ], 1534 | "time": "2021-05-27T09:27:20+00:00" 1535 | }, 1536 | { 1537 | "name": "symfony/polyfill-php80", 1538 | "version": "v1.23.0", 1539 | "source": { 1540 | "type": "git", 1541 | "url": "https://github.com/symfony/polyfill-php80.git", 1542 | "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" 1543 | }, 1544 | "dist": { 1545 | "type": "zip", 1546 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", 1547 | "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", 1548 | "shasum": "" 1549 | }, 1550 | "require": { 1551 | "php": ">=7.1" 1552 | }, 1553 | "type": "library", 1554 | "extra": { 1555 | "branch-alias": { 1556 | "dev-main": "1.23-dev" 1557 | }, 1558 | "thanks": { 1559 | "name": "symfony/polyfill", 1560 | "url": "https://github.com/symfony/polyfill" 1561 | } 1562 | }, 1563 | "autoload": { 1564 | "psr-4": { 1565 | "Symfony\\Polyfill\\Php80\\": "" 1566 | }, 1567 | "files": [ 1568 | "bootstrap.php" 1569 | ], 1570 | "classmap": [ 1571 | "Resources/stubs" 1572 | ] 1573 | }, 1574 | "notification-url": "https://packagist.org/downloads/", 1575 | "license": [ 1576 | "MIT" 1577 | ], 1578 | "authors": [ 1579 | { 1580 | "name": "Ion Bazan", 1581 | "email": "ion.bazan@gmail.com" 1582 | }, 1583 | { 1584 | "name": "Nicolas Grekas", 1585 | "email": "p@tchwork.com" 1586 | }, 1587 | { 1588 | "name": "Symfony Community", 1589 | "homepage": "https://symfony.com/contributors" 1590 | } 1591 | ], 1592 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 1593 | "homepage": "https://symfony.com", 1594 | "keywords": [ 1595 | "compatibility", 1596 | "polyfill", 1597 | "portable", 1598 | "shim" 1599 | ], 1600 | "support": { 1601 | "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" 1602 | }, 1603 | "funding": [ 1604 | { 1605 | "url": "https://symfony.com/sponsor", 1606 | "type": "custom" 1607 | }, 1608 | { 1609 | "url": "https://github.com/fabpot", 1610 | "type": "github" 1611 | }, 1612 | { 1613 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1614 | "type": "tidelift" 1615 | } 1616 | ], 1617 | "time": "2021-02-19T12:13:01+00:00" 1618 | }, 1619 | { 1620 | "name": "symfony/translation", 1621 | "version": "v4.4.24", 1622 | "source": { 1623 | "type": "git", 1624 | "url": "https://github.com/symfony/translation.git", 1625 | "reference": "424d29dfcc15575af05196de0100d7b52f650602" 1626 | }, 1627 | "dist": { 1628 | "type": "zip", 1629 | "url": "https://api.github.com/repos/symfony/translation/zipball/424d29dfcc15575af05196de0100d7b52f650602", 1630 | "reference": "424d29dfcc15575af05196de0100d7b52f650602", 1631 | "shasum": "" 1632 | }, 1633 | "require": { 1634 | "php": ">=7.1.3", 1635 | "symfony/polyfill-mbstring": "~1.0", 1636 | "symfony/translation-contracts": "^1.1.6|^2" 1637 | }, 1638 | "conflict": { 1639 | "symfony/config": "<3.4", 1640 | "symfony/dependency-injection": "<3.4", 1641 | "symfony/http-kernel": "<4.4", 1642 | "symfony/yaml": "<3.4" 1643 | }, 1644 | "provide": { 1645 | "symfony/translation-implementation": "1.0|2.0" 1646 | }, 1647 | "require-dev": { 1648 | "psr/log": "~1.0", 1649 | "symfony/config": "^3.4|^4.0|^5.0", 1650 | "symfony/console": "^3.4|^4.0|^5.0", 1651 | "symfony/dependency-injection": "^3.4|^4.0|^5.0", 1652 | "symfony/finder": "~2.8|~3.0|~4.0|^5.0", 1653 | "symfony/http-kernel": "^4.4", 1654 | "symfony/intl": "^3.4|^4.0|^5.0", 1655 | "symfony/service-contracts": "^1.1.2|^2", 1656 | "symfony/yaml": "^3.4|^4.0|^5.0" 1657 | }, 1658 | "suggest": { 1659 | "psr/log-implementation": "To use logging capability in translator", 1660 | "symfony/config": "", 1661 | "symfony/yaml": "" 1662 | }, 1663 | "type": "library", 1664 | "autoload": { 1665 | "psr-4": { 1666 | "Symfony\\Component\\Translation\\": "" 1667 | }, 1668 | "exclude-from-classmap": [ 1669 | "/Tests/" 1670 | ] 1671 | }, 1672 | "notification-url": "https://packagist.org/downloads/", 1673 | "license": [ 1674 | "MIT" 1675 | ], 1676 | "authors": [ 1677 | { 1678 | "name": "Fabien Potencier", 1679 | "email": "fabien@symfony.com" 1680 | }, 1681 | { 1682 | "name": "Symfony Community", 1683 | "homepage": "https://symfony.com/contributors" 1684 | } 1685 | ], 1686 | "description": "Provides tools to internationalize your application", 1687 | "homepage": "https://symfony.com", 1688 | "support": { 1689 | "source": "https://github.com/symfony/translation/tree/v4.4.24" 1690 | }, 1691 | "funding": [ 1692 | { 1693 | "url": "https://symfony.com/sponsor", 1694 | "type": "custom" 1695 | }, 1696 | { 1697 | "url": "https://github.com/fabpot", 1698 | "type": "github" 1699 | }, 1700 | { 1701 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1702 | "type": "tidelift" 1703 | } 1704 | ], 1705 | "time": "2021-05-16T09:52:47+00:00" 1706 | }, 1707 | { 1708 | "name": "symfony/translation-contracts", 1709 | "version": "v2.4.0", 1710 | "source": { 1711 | "type": "git", 1712 | "url": "https://github.com/symfony/translation-contracts.git", 1713 | "reference": "95c812666f3e91db75385749fe219c5e494c7f95" 1714 | }, 1715 | "dist": { 1716 | "type": "zip", 1717 | "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", 1718 | "reference": "95c812666f3e91db75385749fe219c5e494c7f95", 1719 | "shasum": "" 1720 | }, 1721 | "require": { 1722 | "php": ">=7.2.5" 1723 | }, 1724 | "suggest": { 1725 | "symfony/translation-implementation": "" 1726 | }, 1727 | "type": "library", 1728 | "extra": { 1729 | "branch-alias": { 1730 | "dev-main": "2.4-dev" 1731 | }, 1732 | "thanks": { 1733 | "name": "symfony/contracts", 1734 | "url": "https://github.com/symfony/contracts" 1735 | } 1736 | }, 1737 | "autoload": { 1738 | "psr-4": { 1739 | "Symfony\\Contracts\\Translation\\": "" 1740 | } 1741 | }, 1742 | "notification-url": "https://packagist.org/downloads/", 1743 | "license": [ 1744 | "MIT" 1745 | ], 1746 | "authors": [ 1747 | { 1748 | "name": "Nicolas Grekas", 1749 | "email": "p@tchwork.com" 1750 | }, 1751 | { 1752 | "name": "Symfony Community", 1753 | "homepage": "https://symfony.com/contributors" 1754 | } 1755 | ], 1756 | "description": "Generic abstractions related to translation", 1757 | "homepage": "https://symfony.com", 1758 | "keywords": [ 1759 | "abstractions", 1760 | "contracts", 1761 | "decoupling", 1762 | "interfaces", 1763 | "interoperability", 1764 | "standards" 1765 | ], 1766 | "support": { 1767 | "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" 1768 | }, 1769 | "funding": [ 1770 | { 1771 | "url": "https://symfony.com/sponsor", 1772 | "type": "custom" 1773 | }, 1774 | { 1775 | "url": "https://github.com/fabpot", 1776 | "type": "github" 1777 | }, 1778 | { 1779 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1780 | "type": "tidelift" 1781 | } 1782 | ], 1783 | "time": "2021-03-23T23:28:01+00:00" 1784 | }, 1785 | { 1786 | "name": "vlucas/phpdotenv", 1787 | "version": "v5.3.0", 1788 | "source": { 1789 | "type": "git", 1790 | "url": "https://github.com/vlucas/phpdotenv.git", 1791 | "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" 1792 | }, 1793 | "dist": { 1794 | "type": "zip", 1795 | "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", 1796 | "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", 1797 | "shasum": "" 1798 | }, 1799 | "require": { 1800 | "ext-pcre": "*", 1801 | "graham-campbell/result-type": "^1.0.1", 1802 | "php": "^7.1.3 || ^8.0", 1803 | "phpoption/phpoption": "^1.7.4", 1804 | "symfony/polyfill-ctype": "^1.17", 1805 | "symfony/polyfill-mbstring": "^1.17", 1806 | "symfony/polyfill-php80": "^1.17" 1807 | }, 1808 | "require-dev": { 1809 | "bamarni/composer-bin-plugin": "^1.4.1", 1810 | "ext-filter": "*", 1811 | "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" 1812 | }, 1813 | "suggest": { 1814 | "ext-filter": "Required to use the boolean validator." 1815 | }, 1816 | "type": "library", 1817 | "extra": { 1818 | "branch-alias": { 1819 | "dev-master": "5.3-dev" 1820 | } 1821 | }, 1822 | "autoload": { 1823 | "psr-4": { 1824 | "Dotenv\\": "src/" 1825 | } 1826 | }, 1827 | "notification-url": "https://packagist.org/downloads/", 1828 | "license": [ 1829 | "BSD-3-Clause" 1830 | ], 1831 | "authors": [ 1832 | { 1833 | "name": "Graham Campbell", 1834 | "email": "graham@alt-three.com", 1835 | "homepage": "https://gjcampbell.co.uk/" 1836 | }, 1837 | { 1838 | "name": "Vance Lucas", 1839 | "email": "vance@vancelucas.com", 1840 | "homepage": "https://vancelucas.com/" 1841 | } 1842 | ], 1843 | "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", 1844 | "keywords": [ 1845 | "dotenv", 1846 | "env", 1847 | "environment" 1848 | ], 1849 | "support": { 1850 | "issues": "https://github.com/vlucas/phpdotenv/issues", 1851 | "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" 1852 | }, 1853 | "funding": [ 1854 | { 1855 | "url": "https://github.com/GrahamCampbell", 1856 | "type": "github" 1857 | }, 1858 | { 1859 | "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", 1860 | "type": "tidelift" 1861 | } 1862 | ], 1863 | "time": "2021-01-20T15:23:13+00:00" 1864 | } 1865 | ], 1866 | "packages-dev": [ 1867 | { 1868 | "name": "squizlabs/php_codesniffer", 1869 | "version": "2.9.2", 1870 | "source": { 1871 | "type": "git", 1872 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 1873 | "reference": "2acf168de78487db620ab4bc524135a13cfe6745" 1874 | }, 1875 | "dist": { 1876 | "type": "zip", 1877 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", 1878 | "reference": "2acf168de78487db620ab4bc524135a13cfe6745", 1879 | "shasum": "" 1880 | }, 1881 | "require": { 1882 | "ext-simplexml": "*", 1883 | "ext-tokenizer": "*", 1884 | "ext-xmlwriter": "*", 1885 | "php": ">=5.1.2" 1886 | }, 1887 | "require-dev": { 1888 | "phpunit/phpunit": "~4.0" 1889 | }, 1890 | "bin": [ 1891 | "scripts/phpcs", 1892 | "scripts/phpcbf" 1893 | ], 1894 | "type": "library", 1895 | "extra": { 1896 | "branch-alias": { 1897 | "dev-master": "2.x-dev" 1898 | } 1899 | }, 1900 | "autoload": { 1901 | "classmap": [ 1902 | "CodeSniffer.php", 1903 | "CodeSniffer/CLI.php", 1904 | "CodeSniffer/Exception.php", 1905 | "CodeSniffer/File.php", 1906 | "CodeSniffer/Fixer.php", 1907 | "CodeSniffer/Report.php", 1908 | "CodeSniffer/Reporting.php", 1909 | "CodeSniffer/Sniff.php", 1910 | "CodeSniffer/Tokens.php", 1911 | "CodeSniffer/Reports/", 1912 | "CodeSniffer/Tokenizers/", 1913 | "CodeSniffer/DocGenerators/", 1914 | "CodeSniffer/Standards/AbstractPatternSniff.php", 1915 | "CodeSniffer/Standards/AbstractScopeSniff.php", 1916 | "CodeSniffer/Standards/AbstractVariableSniff.php", 1917 | "CodeSniffer/Standards/IncorrectPatternException.php", 1918 | "CodeSniffer/Standards/Generic/Sniffs/", 1919 | "CodeSniffer/Standards/MySource/Sniffs/", 1920 | "CodeSniffer/Standards/PEAR/Sniffs/", 1921 | "CodeSniffer/Standards/PSR1/Sniffs/", 1922 | "CodeSniffer/Standards/PSR2/Sniffs/", 1923 | "CodeSniffer/Standards/Squiz/Sniffs/", 1924 | "CodeSniffer/Standards/Zend/Sniffs/" 1925 | ] 1926 | }, 1927 | "notification-url": "https://packagist.org/downloads/", 1928 | "license": [ 1929 | "BSD-3-Clause" 1930 | ], 1931 | "authors": [ 1932 | { 1933 | "name": "Greg Sherwood", 1934 | "role": "lead" 1935 | } 1936 | ], 1937 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 1938 | "homepage": "http://www.squizlabs.com/php-codesniffer", 1939 | "keywords": [ 1940 | "phpcs", 1941 | "standards" 1942 | ], 1943 | "support": { 1944 | "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", 1945 | "source": "https://github.com/squizlabs/PHP_CodeSniffer", 1946 | "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" 1947 | }, 1948 | "time": "2018-11-07T22:31:41+00:00" 1949 | } 1950 | ], 1951 | "aliases": [], 1952 | "minimum-stability": "stable", 1953 | "stability-flags": [], 1954 | "prefer-stable": false, 1955 | "prefer-lowest": false, 1956 | "platform": { 1957 | "php": ">=7.1" 1958 | }, 1959 | "platform-dev": [], 1960 | "plugin-api-version": "2.0.0" 1961 | } 1962 | -------------------------------------------------------------------------------- /config/assets.php: -------------------------------------------------------------------------------- 1 | get_theme_file_path() . '/dist/assets.json', 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Assets Path URI 22 | |-------------------------------------------------------------------------- 23 | | 24 | | The asset manifest contains relative paths to your assets. This URI will 25 | | be prepended when using Sage's asset management system. Change this if 26 | | you are using a CDN. 27 | | 28 | */ 29 | 30 | 'uri' => get_theme_file_uri() . '/dist', 31 | ]; 32 | -------------------------------------------------------------------------------- /config/theme.php: -------------------------------------------------------------------------------- 1 | get_theme_file_path(), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Theme Directory URI 22 | |-------------------------------------------------------------------------- 23 | | 24 | | This is the web server URI to your theme directory. 25 | | 26 | | Example: 27 | | https://example.com/app/themes/sage 28 | | 29 | */ 30 | 31 | 'uri' => get_theme_file_uri(), 32 | ]; 33 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 16 | get_theme_file_path() . '/resources/views', 17 | get_parent_theme_file_path() . '/resources/views', 18 | ], 19 | 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Compiled View Path 24 | |-------------------------------------------------------------------------- 25 | | 26 | | This option determines where all the compiled Blade templates will be 27 | | stored for your application. Typically, this is within the uploads 28 | | directory. However, as usual, you are free to change this value. 29 | | 30 | */ 31 | 32 | 'compiled' => wp_upload_dir()['basedir'] . '/cache', 33 | 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | View Namespaces 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Blade has an underutilized feature that allows developers to add 41 | | supplemental view paths that may contain conflictingly named views. 42 | | These paths are prefixed with a namespace to get around the conflicts. 43 | | A use case might be including views from within a plugin folder. 44 | | 45 | */ 46 | 47 | 'namespaces' => [ 48 | /* Given the below example, in your views use something like: @include('WC::some.view.or.partial.here') */ 49 | // 'WC' => WP_PLUGIN_DIR.'/woocommerce/templates/', 50 | ], 51 | ]; 52 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sage-vite", 3 | "version": "9.0.9", 4 | "authors": [ 5 | "Roots ", 6 | "Matt Dickey " 7 | ], 8 | "homepage": "https://roots.io/sage/", 9 | "private": true, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/8bit-echo/sage-starter.git" 13 | }, 14 | "bugs": { 15 | "url": "https://github.com/8bit-echo/sage-starter/issues" 16 | }, 17 | "licenses": [ 18 | { 19 | "type": "MIT", 20 | "url": "http://opensource.org/licenses/MIT" 21 | } 22 | ], 23 | "scripts": { 24 | "dev": "yarn env:dev && export APP_ENV=development && vite", 25 | "build": "yarn env:prod && export APP_ENV=production && tsc && vite build", 26 | "env:dev": "replace-in-files --string='production' --replacement='development' ./.env", 27 | "env:prod": "replace-in-files --string='development' --replacement='production' ./.env" 28 | }, 29 | "engines": { 30 | "node": ">= 8.0.0" 31 | }, 32 | "devDependencies": { 33 | "@types/blazy": "^1.5.32", 34 | "@types/node": "^15.6.0", 35 | "@types/react": "^17.0.0", 36 | "@types/react-dom": "^17.0.0", 37 | "@vitejs/plugin-react-refresh": "^1.3.3", 38 | "@vitejs/plugin-vue": "^1.2.2", 39 | "@vue/compiler-sfc": "^3.0.11", 40 | "replace-in-files-cli": "^1.0.0", 41 | "sass": "^1.34.0", 42 | "typescript": "^4.1.2", 43 | "vite": "^2.3.4", 44 | "vite-plugin-live-reload": "^2.1.0", 45 | "vue-tsc": "^0.0.24" 46 | }, 47 | "dependencies": { 48 | "blazy": "^1.8.2", 49 | "jquery": "^3.6.0", 50 | "react": "^17.0.0", 51 | "react-dom": "^17.0.0", 52 | "vue": "^3.0.5" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Roots Coding Standards 4 | 5 | 6 | resources/functions.php 7 | resources/index.php 8 | app 9 | resources/views 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | resources/views 25 | 26 | 27 | 28 | 29 | resources/views 30 | 31 | 32 | 33 | 34 | resources/views 35 | 36 | 37 | 38 | 39 | resources/views 40 | 41 | 42 | 43 | 44 | resources/views 45 | 46 | 47 | 48 | 49 | resources/views 50 | 51 | 52 | 53 | 54 | resources/views 55 | 56 | 57 | 58 | 59 | resources/views 60 | 61 | 62 | 63 | 64 | resources/views 65 | 66 | 67 | 68 | 69 | resources/views 70 | 71 | 72 | -------------------------------------------------------------------------------- /resources/assets/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/8bit-echo/sage-vite/ccc36b33b4c9738ba79e57fce2a960803cdfd49c/resources/assets/fonts/.gitkeep -------------------------------------------------------------------------------- /resources/assets/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/8bit-echo/sage-vite/ccc36b33b4c9738ba79e57fce2a960803cdfd49c/resources/assets/images/.gitkeep -------------------------------------------------------------------------------- /resources/assets/scripts/components/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react'; 2 | 3 | export default function App() { 4 | const [count, setCount] = useState(0); 5 | return ( 6 |
7 | I'm a React App! 8 |
9 | 16 |
17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /resources/assets/scripts/components/VueApp.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 19 | -------------------------------------------------------------------------------- /resources/assets/scripts/main.ts: -------------------------------------------------------------------------------- 1 | import blazy from 'blazy'; 2 | import '../styles/main.scss'; 3 | 4 | new blazy({ selector: '.lazy' }); 5 | -------------------------------------------------------------------------------- /resources/assets/scripts/react-example.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './components/App'; 4 | 5 | ReactDOM.render( 6 | , 7 | document.getElementById('react') 8 | ); 9 | -------------------------------------------------------------------------------- /resources/assets/scripts/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import { DefineComponent } from 'vue' 3 | const component: DefineComponent<{}, {}, any> 4 | export default component 5 | } 6 | -------------------------------------------------------------------------------- /resources/assets/scripts/vue-example.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import VueApp from './components/VueApp.vue'; 3 | 4 | createApp(VueApp).mount('#vue'); 5 | -------------------------------------------------------------------------------- /resources/assets/styles/common/_global.scss: -------------------------------------------------------------------------------- 1 | /* stylelint-disable */ 2 | :root { 3 | --background: ghostwhite; 4 | --text-color: #222222; 5 | // @media (prefers-color-scheme: dark) { 6 | // --background: #2e2e2e; 7 | // --text-color: ghostwhite; 8 | // } 9 | } 10 | /* stylelint-enable */ 11 | body, 12 | html { 13 | font-size: 16px; 14 | margin: 0; 15 | width: 100%; 16 | height: 100%; 17 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 18 | line-height: 1.5; 19 | background: var(--background); 20 | color: var(--text-color); 21 | } 22 | 23 | *, 24 | *::before, 25 | *::after { 26 | box-sizing: border-box; 27 | word-break: break-word; 28 | } 29 | 30 | img { 31 | max-width: 100%; 32 | } 33 | 34 | main, 35 | footer { 36 | padding: 0 1rem; 37 | } 38 | 39 | .lazy { 40 | transition: opacity 500ms ease-in-out; 41 | max-width: 100%; 42 | opacity: 0; 43 | } 44 | 45 | .lazy.b-loaded, 46 | .lazy.b-error { 47 | transition: opacity 500ms ease-in-out; 48 | opacity: 1; 49 | } 50 | -------------------------------------------------------------------------------- /resources/assets/styles/common/_util.scss: -------------------------------------------------------------------------------- 1 | .center { 2 | text-align: center; 3 | } 4 | 5 | .left { 6 | text-align: left; 7 | } 8 | 9 | .right { 10 | text-align: right; 11 | } 12 | 13 | .container { 14 | width: 100%; 15 | max-width: $max-width; 16 | margin: auto; 17 | } 18 | 19 | @mixin pseudo() { 20 | content: ''; 21 | display: block; 22 | position: absolute; 23 | } 24 | 25 | @mixin undoListStyles() { 26 | padding: 0; 27 | margin: 0; 28 | list-style: none; 29 | } 30 | -------------------------------------------------------------------------------- /resources/assets/styles/common/_variables.scss: -------------------------------------------------------------------------------- 1 | /** Colors */ 2 | $brand-primary: #525ddc; 3 | $brand-secondary: #dc8552; 4 | $white: ghostwhite; 5 | $black: #222; 6 | 7 | $background: $white; 8 | $text: $black; 9 | 10 | $error: #e04b4b; 11 | $warning: #e77540; 12 | $success: #3bd63b; 13 | $notice: #ffffa6; 14 | 15 | /** Box Model */ 16 | $spacer: 2rem; 17 | $max-width: 1200px; 18 | 19 | $breakpoint: 800px; 20 | -------------------------------------------------------------------------------- /resources/assets/styles/components/_buttons.scss: -------------------------------------------------------------------------------- 1 | a { 2 | color: var(--text-color); 3 | } 4 | -------------------------------------------------------------------------------- /resources/assets/styles/components/_comments.scss: -------------------------------------------------------------------------------- 1 | // TODO: .comment-list {} 2 | // TODO: .comment-list ol {} 3 | // TODO: .comment-form p {} 4 | // TODO: .comment-form input {} 5 | // TODO: .comment-form textarea {} 6 | -------------------------------------------------------------------------------- /resources/assets/styles/components/_forms.scss: -------------------------------------------------------------------------------- 1 | /** Search form */ 2 | // TODO: .search-form {} 3 | // TODO: .search-form label {} 4 | // TODO: .search-form .search-field {} 5 | // TODO: .search-form .search-submit {} 6 | -------------------------------------------------------------------------------- /resources/assets/styles/components/_wp-classes.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress Generated Classes 3 | * @see http://codex.wordpress.org/CSS#WordPress_Generated_Classes 4 | */ 5 | 6 | /** Media alignment */ 7 | .alignnone { 8 | margin-left: 0; 9 | margin-right: 0; 10 | max-width: 100%; 11 | height: auto; 12 | } 13 | 14 | .aligncenter { 15 | display: block; 16 | margin: math.div($spacer, 2) auto; 17 | height: auto; 18 | } 19 | 20 | .alignleft, 21 | .alignright { 22 | margin-bottom: math.div($spacer, 2); 23 | height: auto; 24 | } 25 | 26 | @media (min-width: 30rem) { 27 | .alignleft { 28 | float: left; 29 | margin-right: math.div($spacer, 2); 30 | } 31 | 32 | .alignright { 33 | float: right; 34 | margin-left: math.div($spacer, 2); 35 | } 36 | } 37 | 38 | /** Captions */ 39 | 40 | // TODO: .wp-caption {} 41 | // TODO: .wp-caption img {} 42 | // TODO: .wp-caption-text {} 43 | 44 | /** Text meant only for screen readers */ 45 | .screen-reader-text { 46 | position: absolute; 47 | width: 1px; 48 | height: 1px; 49 | padding: 0; 50 | margin: -1px; 51 | overflow: hidden; 52 | clip: rect(0, 0, 0, 0); 53 | border: 0; 54 | color: var(--text-color); 55 | background: #fff; 56 | } 57 | -------------------------------------------------------------------------------- /resources/assets/styles/layouts/_footer.scss: -------------------------------------------------------------------------------- 1 | footer.site-footer { 2 | margin-top: $spacer; 3 | background: $black; 4 | color: $white; 5 | padding: $spacer math.div($spacer, 2); 6 | 7 | a { 8 | color: white; 9 | } 10 | 11 | @media all and (min-width: $breakpoint) { 12 | .widgets { 13 | display: flex; 14 | justify-content: space-around; 15 | align-items: flex-start; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /resources/assets/styles/layouts/_header.scss: -------------------------------------------------------------------------------- 1 | @use 'sass:math'; 2 | header.site-header { 3 | box-shadow: 0 5px 1rem rgba($black, 0.25); 4 | } 5 | 6 | nav.primary { 7 | display: flex; 8 | justify-content: space-between; 9 | align-items: center; 10 | position: relative; 11 | 12 | .mobile-button { 13 | position: absolute; 14 | background: transparent; 15 | border: none; 16 | outline: none; 17 | cursor: pointer; 18 | font-size: 1.5rem; 19 | } 20 | 21 | a.custom-logo-link { 22 | max-width: 40%; 23 | display: flex; /* ensures no floating borders */ 24 | } 25 | 26 | a { 27 | text-decoration: none; 28 | } 29 | 30 | ul { 31 | padding-left: 0; 32 | margin: 0; 33 | list-style: none; 34 | } 35 | 36 | #mobile-nav-open { 37 | right: $spacer; 38 | } 39 | 40 | #mobile-nav-close { 41 | position: absolute; 42 | top: $spacer; 43 | right: $spacer; 44 | z-index: 10; 45 | } 46 | 47 | // top level 48 | .mobile-menu-wrap { 49 | position: fixed; 50 | background-color: var(--background); 51 | color: var(--text-color); 52 | top: 0; 53 | right: -100vw; 54 | height: 100vh; 55 | width: 80vw; 56 | padding: 1rem; 57 | transition: right 500ms ease-in-out; 58 | box-shadow: -5px 0 1rem rgba(0, 0, 0, 0.5); 59 | 60 | &.active { 61 | z-index: 10; 62 | right: 0; 63 | } 64 | } 65 | 66 | li.menu-item { 67 | font-size: 1.25rem; 68 | padding: 10px 0; 69 | 70 | &.menu-item-has-children { 71 | &::after { 72 | display: inline-block; 73 | content: ''; 74 | width: 0.5rem; 75 | height: 0.5rem; 76 | margin-left: 5px; 77 | border-bottom: solid 2px var(--text-color); 78 | border-right: solid 2px var(--text-color); 79 | transform: rotate(-45deg); 80 | } 81 | 82 | .sub-menu { 83 | position: absolute; 84 | right: -100vw; 85 | top: 0; 86 | background-color: var(--background); 87 | transition: right 500ms ease-in-out; 88 | z-index: 4; 89 | padding: $spacer; 90 | box-shadow: 0 -5px 1rem rgba(0, 0, 0, 0.5); 91 | } 92 | 93 | //TODO: need JS to handle mobile this class. 94 | &.open { 95 | > .sub-menu { 96 | width: 95%; 97 | height: 100%; 98 | right: 0; 99 | } 100 | } 101 | } 102 | } 103 | } 104 | 105 | @media all and (min-width: $breakpoint) { 106 | nav.primary { 107 | display: flex; 108 | align-items: center; 109 | 110 | a.custom-logo-link { 111 | max-width: 200px; 112 | margin-right: $spacer; 113 | } 114 | 115 | a { 116 | text-decoration: none; 117 | } 118 | 119 | ul { 120 | padding-left: 0; 121 | margin: 0; 122 | list-style: none; 123 | } 124 | 125 | > div { 126 | flex: 1; 127 | } 128 | 129 | // top level 130 | .menu { 131 | display: flex; 132 | justify-content: flex-end; 133 | } 134 | 135 | li.menu-item { 136 | flex-shrink: 1; 137 | position: relative; 138 | line-height: 1.2; 139 | padding: 5px 0; 140 | font-size: 0.9rem; 141 | height: auto; 142 | margin: 0 1rem; 143 | border-bottom: solid 3px transparent; 144 | 145 | &:hover { 146 | border-bottom: solid 3px lighten($brand-primary, 20%); 147 | } 148 | 149 | &.menu-item-has-children { 150 | &::after { 151 | transform: rotate(45deg) translateY(-5px); 152 | } 153 | 154 | .sub-menu { 155 | display: none; 156 | position: absolute; 157 | top: calc(100% + 15px); 158 | padding: math.div($spacer, 2) $spacer; 159 | width: 15rem; 160 | background-color: var(--text-color); 161 | right: 0; 162 | transition: none; 163 | box-shadow: 0 0 2px rgba($white, 15%); 164 | 165 | a { 166 | color: var(--background); 167 | } 168 | 169 | &::before { 170 | content: ''; 171 | display: block; 172 | background: transparent; 173 | width: 100%; 174 | height: 15px; 175 | position: absolute; 176 | top: -15px; 177 | left: 0; 178 | } 179 | 180 | &::after { 181 | display: block; 182 | content: ''; 183 | position: absolute; 184 | top: -10px; 185 | left: 10px; 186 | width: 0; 187 | height: 0; 188 | border-style: solid; 189 | border-width: 0 10px 10px 10px; 190 | border-color: transparent transparent var(--text-color) transparent; 191 | } 192 | 193 | li::after { 194 | border-color: $white; 195 | } 196 | } 197 | 198 | &:hover { 199 | > .sub-menu { 200 | display: block; 201 | height: auto; 202 | width: 15rem; 203 | left: 0; 204 | } 205 | } 206 | } 207 | 208 | &.current-menu-item { 209 | border-bottom: solid 3px $brand-primary; 210 | } 211 | } 212 | 213 | .mobile-menu-wrap { 214 | position: static; 215 | background: transparent; 216 | top: 0; 217 | right: 0; 218 | height: auto; 219 | width: 100%; 220 | padding: 0; 221 | transition: right 500ms ease-in-out; 222 | box-shadow: none; 223 | } 224 | } 225 | 226 | .mobile-button { 227 | display: none; 228 | } 229 | } 230 | 231 | body.logged-in { 232 | .mobile-menu-wrap.active { 233 | top: calc(32px + 1rem); 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /resources/assets/styles/layouts/_pages.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/8bit-echo/sage-vite/ccc36b33b4c9738ba79e57fce2a960803cdfd49c/resources/assets/styles/layouts/_pages.scss -------------------------------------------------------------------------------- /resources/assets/styles/layouts/_posts.scss: -------------------------------------------------------------------------------- 1 | body.blog { 2 | article { 3 | padding: 1rem; 4 | margin: 0.5rem 0; 5 | border-radius: 10px; 6 | 7 | .image { 8 | height: 325px; 9 | width: 100%; 10 | background-size: cover; 11 | background-repeat: no-repeat; 12 | background-position: center; 13 | } 14 | 15 | &.sticky { 16 | background-color: rgba(black, 0.25); 17 | border-left: solid 10px dimgrey; 18 | } 19 | 20 | time a { 21 | text-decoration: none; 22 | } 23 | } 24 | 25 | @media all and (min-width: $breakpoint) { 26 | article { 27 | display: flex; 28 | justify-content: space-between; 29 | align-items: flex-start; 30 | height: 100%; 31 | 32 | .image { 33 | margin-right: 1rem; 34 | height: 325px; 35 | width: 300px; 36 | flex: 1; 37 | } 38 | 39 | > div { 40 | flex: 1; 41 | } 42 | } 43 | } 44 | } 45 | 46 | .nav-links { 47 | display: flex; 48 | flex-direction: row-reverse; 49 | justify-content: space-between; 50 | margin-top: $spacer; 51 | 52 | .nav-previous::after, 53 | .nav-next::before { 54 | @include pseudo(); 55 | 56 | display: inline-block; 57 | position: static; 58 | width: 0.5rem; 59 | height: 0.5rem; 60 | border-right: solid 1px $black; 61 | border-bottom: solid 1px $black; 62 | margin: 0 0.25rem; 63 | } 64 | 65 | .nav-next::before { 66 | transform: rotate(135deg); 67 | } 68 | 69 | .nav-previous::after { 70 | transform: rotate(-45deg); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /resources/assets/styles/layouts/_sidebar.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/8bit-echo/sage-vite/ccc36b33b4c9738ba79e57fce2a960803cdfd49c/resources/assets/styles/layouts/_sidebar.scss -------------------------------------------------------------------------------- /resources/assets/styles/layouts/_tinymce.scss: -------------------------------------------------------------------------------- 1 | body#tinymce { 2 | margin: 12px !important; 3 | } 4 | 5 | .alignfull { 6 | margin-left: calc(-100vw / 2 + 100% / 2); 7 | margin-right: calc(-100vw / 2 + 100% / 2); 8 | max-width: 100vw; 9 | width: 100vw; 10 | } 11 | 12 | figcaption { 13 | text-align: center; 14 | display: block; 15 | width: 100%; 16 | } 17 | 18 | blockquote, 19 | .wp-block-quote, 20 | .wp-block-quote.is-style-large { 21 | border-inline-start: solid 4px $black; 22 | padding: math.div($spacer, 2) $spacer; 23 | background-color: rgba(black, 0.25); 24 | } 25 | 26 | .wp-block-pullquote blockquote { 27 | background-color: transparent; 28 | border: none; 29 | font-style: italic; 30 | position: relative; 31 | 32 | &::before, 33 | &::after { 34 | @include pseudo(); 35 | 36 | font-size: 7rem; 37 | color: lightgrey; 38 | font-family: serif; 39 | content: '\201C'; 40 | left: -2rem; 41 | top: -2rem; 42 | } 43 | } 44 | 45 | .wp-block-embed.is-type-video { 46 | margin: 2rem auto; 47 | position: relative; 48 | 49 | .wp-block-embed__wrapper { 50 | position: relative; 51 | margin: auto; 52 | padding-bottom: 56.9%; // only works with 16:9 aspect ratio 53 | } 54 | 55 | iframe { 56 | position: absolute; 57 | top: 0; 58 | width: 100%; 59 | height: 100%; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /resources/assets/styles/main.scss: -------------------------------------------------------------------------------- 1 | @use 'sass:math'; 2 | 3 | @import 'common/variables'; 4 | @import 'common/util'; 5 | 6 | /** Import everything from autoload */ 7 | // @import './autoload/**/*'; 8 | 9 | /** 10 | * Import npm dependencies 11 | * 12 | * Prefix your imports with `~` to grab from node_modules/ 13 | * @see https://github.com/webpack-contrib/sass-loader#imports 14 | */ 15 | // @import "~some-node-module"; 16 | 17 | /** Import theme styles */ 18 | @import 'common/global'; 19 | @import 'components/buttons'; 20 | @import 'components/comments'; 21 | @import 'components/forms'; 22 | @import 'components/wp-classes'; 23 | @import 'layouts/header'; 24 | @import 'layouts/sidebar'; 25 | @import 'layouts/footer'; 26 | @import 'layouts/pages'; 27 | @import 'layouts/posts'; 28 | @import 'layouts/tinymce'; 29 | -------------------------------------------------------------------------------- /resources/functions-app.php: -------------------------------------------------------------------------------- 1 | 'White', 9 | 'slug' => 'white', 10 | 'color' => '#fff', 11 | ], 12 | [ 13 | 'name' => 'Black', 14 | 'slug' => 'black', 15 | 'color' => '#222', 16 | ], 17 | ]; 18 | 19 | add_theme_support('editor-color-palette', $colors); 20 | }); 21 | 22 | 23 | // Custom WYSIWYG FORMATS 24 | function cusom_tinymce_formats($init_array) 25 | { 26 | $style_formats = [ 27 | [ 28 | 'title' => 'wrapper', 29 | 'block' => 'span', 30 | 'classes' => '', 31 | 'wrapper' => true // is this a wrapper element? 32 | ], 33 | ]; 34 | $init_array['style_formats'] = json_encode($style_formats); 35 | 36 | return $init_array; 37 | } 38 | // Attach callback to 'tiny_mce_before_init' 39 | add_filter('tiny_mce_before_init', 'cusom_tinymce_formats'); 40 | -------------------------------------------------------------------------------- /resources/functions-default.php: -------------------------------------------------------------------------------- 1 | remove_menu('wp-logo'); 15 | // $wp_admin_bar->remove_menu('customize'); 16 | $wp_admin_bar->remove_menu('updates'); 17 | $wp_admin_bar->remove_menu('comments'); 18 | $wp_admin_bar->remove_menu('itsec_admin_bar_menu'); 19 | $wp_admin_bar->remove_menu('wpseo-menu'); 20 | } 21 | 22 | /** Global custom stylesheet for WP back-end. */ 23 | function get_sage_admin_styles() { 24 | wp_register_style('sage-admin-styles', get_theme_file_uri() . '/resources/sage-admin.css'); 25 | wp_enqueue_style('sage-admin-styles'); 26 | } 27 | 28 | /** Allow uploads of SVGs to the media library */ 29 | function allow_svg_upload($mimes) { 30 | $mimes['svg'] = 'image/svg+xml'; 31 | 32 | return $mimes; 33 | } 34 | 35 | /** fixes improper display of svg thumbnails in media library */ 36 | function fix_svg_thumb_display() { 37 | echo ''; 43 | } 44 | 45 | /** Hide pages for CPTUI and ACF if the user isn't privileged. */ 46 | function remove_menu_items_from_admin() { 47 | remove_menu_page('cptui_main_menu'); 48 | remove_menu_page('edit.php?post_type=acf-field-group'); 49 | } 50 | 51 | /** Browser detection function for Last 3 Versions of IE */ 52 | function is_ie() { 53 | return boolval(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/') !== false); 54 | } 55 | 56 | /** opinionated theme default setup */ 57 | function theme_setup() { 58 | add_theme_support('align-wide'); 59 | add_theme_support('disable-custom-colors'); 60 | } 61 | 62 | /** lazyload images from wysiwyg. */ 63 | function lazy_load_wysiwyg_images($content) { 64 | // parse DOM 65 | if (!strlen($content)) return $content; 66 | $content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8"); 67 | $document = new DOMDocument(); 68 | libxml_use_internal_errors(true); 69 | $document->loadHTML(utf8_decode($content)); 70 | 71 | // replace image src with data-src 72 | $imgs = $document->getElementsByTagName('img'); 73 | foreach ($imgs as $img) { 74 | $existing_class = $img->getAttribute('class'); 75 | $img->setAttribute('class', "$existing_class lazy"); 76 | $img->setAttribute('data-src', $img->getAttribute('src')); 77 | $img->setAttribute('src', ''); 78 | } 79 | 80 | $html = $document->saveHTML(); 81 | return $html; 82 | } 83 | 84 | // change default excerpt text from "Continued" to "Read More" 85 | function custom_excerpt_link_text($more) { 86 | $post = get_post(); 87 | if (is_object($post)) { 88 | return '…Read More'; 89 | } 90 | } 91 | 92 | function strip_archive_title($title) { 93 | if (is_category()) { 94 | $title = single_cat_title('', false); 95 | } elseif (is_tag()) { 96 | $title = single_tag_title('', false); 97 | } elseif (is_author()) { 98 | $title = '' . get_the_author() . ''; 99 | } elseif (is_post_type_archive()) { 100 | $title = post_type_archive_title('', false); 101 | } elseif (is_tax()) { 102 | $title = single_term_title('', false); 103 | } elseif (is_month()) { 104 | $title = str_replace('Month: ', '', $title); 105 | } 106 | 107 | return $title; 108 | } 109 | 110 | 111 | 112 | /*============================*/ 113 | /* Admin Functions */ 114 | /*============================*/ 115 | if (is_admin()) { 116 | $current_user = wp_get_current_user(); 117 | add_action('admin_head', 'get_sage_admin_styles'); 118 | 119 | // User is not an admin 120 | if (!in_array('administrator', $current_user->roles)) { 121 | add_action('admin_init', 'remove_menu_items_from_admin'); 122 | } 123 | } 124 | 125 | /*===========================*/ 126 | /* Actions */ 127 | /*===========================*/ 128 | 129 | add_action('wp_before_admin_bar_render', 'clean_admin_bar'); 130 | add_action('admin_head', 'fix_svg_thumb_display'); 131 | add_action('after_setup_theme', 'theme_setup'); 132 | 133 | 134 | /*===========================*/ 135 | /* Filters */ 136 | /*===========================*/ 137 | 138 | add_filter('upload_mimes', 'allow_svg_upload'); 139 | add_filter('excerpt_more', 'custom_excerpt_link_text', 21); 140 | add_filter('the_content', 'lazy_load_wysiwyg_images', 10, 1); 141 | add_filter('get_the_archive_title', 'strip_archive_title'); 142 | -------------------------------------------------------------------------------- /resources/functions.php: -------------------------------------------------------------------------------- 1 | roots.io/sage/docs/'; 19 | $message = "

{$title}
{$subtitle}

{$message}

{$footer}

"; 20 | wp_die($message, $title); 21 | }; 22 | 23 | /** 24 | * Ensure compatible version of PHP is used 25 | */ 26 | if (version_compare('7.1', phpversion(), '>=')) { 27 | $sage_error(__('You must be using PHP 7.1 or greater.', 'sage'), __('Invalid PHP version', 'sage')); 28 | } 29 | 30 | /** 31 | * Ensure compatible version of WordPress is used 32 | */ 33 | if (version_compare('4.7.0', get_bloginfo('version'), '>=')) { 34 | $sage_error(__('You must be using WordPress 4.7.0 or greater.', 'sage'), __('Invalid WordPress version', 'sage')); 35 | } 36 | 37 | /** 38 | * Ensure dependencies are loaded 39 | */ 40 | if (!class_exists('Roots\\Sage\\Container')) { 41 | if (!file_exists($composer = __DIR__ . '/../vendor/autoload.php')) { 42 | $sage_error( 43 | __('You must run composer install from the Sage directory.', 'sage'), 44 | __('Autoloader not found.', 'sage') 45 | ); 46 | } 47 | require_once $composer; 48 | } 49 | 50 | /** 51 | * Sage required files 52 | * 53 | * The mapped array determines the code library included in your theme. 54 | * Add or remove files to the array as needed. Supports child theme overrides. 55 | */ 56 | array_map(function ($file) use ($sage_error) { 57 | $file = "../app/{$file}.php"; 58 | if (!locate_template($file, true, true)) { 59 | $sage_error(sprintf(__('Error locating %s for inclusion.', 'sage'), $file), 'File not found'); 60 | } 61 | }, ['helpers', 'setup', 'filters', 'admin']); 62 | 63 | /** 64 | * Here's what's happening with these hooks: 65 | * 1. WordPress initially detects theme in themes/sage/resources 66 | * 2. Upon activation, we tell WordPress that the theme is actually in themes/sage/resources/views 67 | * 3. When we call get_template_directory() or get_template_directory_uri(), we point it back to themes/sage/resources 68 | * 69 | * We do this so that the Template Hierarchy will look in themes/sage/resources/views for core WordPress themes 70 | * But functions.php, style.css, and index.php are all still located in themes/sage/resources 71 | * 72 | * This is not compatible with the WordPress Customizer theme preview prior to theme activation 73 | * 74 | * get_template_directory() -> /srv/www/example.com/current/web/app/themes/sage/resources 75 | * get_stylesheet_directory() -> /srv/www/example.com/current/web/app/themes/sage/resources 76 | * locate_template() 77 | * ├── STYLESHEETPATH -> /srv/www/example.com/current/web/app/themes/sage/resources/views 78 | * └── TEMPLATEPATH -> /srv/www/example.com/current/web/app/themes/sage/resources 79 | */ 80 | array_map( 81 | 'add_filter', 82 | ['theme_file_path', 'theme_file_uri', 'parent_theme_file_path', 'parent_theme_file_uri'], 83 | array_fill(0, 4, 'dirname') 84 | ); 85 | Container::getInstance() 86 | ->bindIf('config', function () { 87 | return new Config([ 88 | 'assets' => require dirname(__DIR__) . '/config/assets.php', 89 | 'theme' => require dirname(__DIR__) . '/config/theme.php', 90 | 'view' => require dirname(__DIR__) . '/config/view.php', 91 | ]); 92 | }, true); 93 | 94 | include __DIR__ . '/functions-default.php'; 95 | include __DIR__ . '/functions-app.php'; 96 | -------------------------------------------------------------------------------- /resources/index.php: -------------------------------------------------------------------------------- 1 | 8 | 404 9 | {{ __('Sorry, but the page you were trying to view was not found.', 'sage') }} 10 | {!! get_search_form(false) !!} 11 | @endif 12 | @endsection 13 | -------------------------------------------------------------------------------- /resources/views/front-page.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @while(have_posts()) @php the_post() @endphp 5 | @include('partials.content-page') 6 |
Vue
7 |
React
8 | @endwhile 9 | @endsection 10 | -------------------------------------------------------------------------------- /resources/views/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @include('partials.page-header') 5 | 6 | @if (!have_posts()) 7 |
{{ __('Sorry, no results were found.', 'sage') }} 8 |
{!! get_search_form(false) !!} 9 | @endif 10 | 11 | @while (have_posts()) @php the_post() @endphp 12 |
13 | @include('partials.content-'.get_post_type()) 14 | 15 | @endwhile {!! get_the_posts_navigation() !!} 16 |
17 | @endsection 18 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | @include('partials.head') 4 | 5 | @php do_action('get_header') @endphp 6 | @include('partials.header') 7 |
8 | @yield('content') 9 |
10 | 11 | @if (App\display_sidebar()) 12 | 15 | @endif 16 | 17 | @php do_action('get_footer') @endphp 18 | @include('partials.footer') 19 | @php wp_footer() @endphp 20 | 21 | 22 | -------------------------------------------------------------------------------- /resources/views/page.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @while(have_posts()) @php the_post() @endphp 5 | @include('partials.page-header') 6 | @include('partials.content-page') 7 | @endwhile 8 | @endsection 9 | -------------------------------------------------------------------------------- /resources/views/partials/comments.blade.php: -------------------------------------------------------------------------------- 1 | @php 2 | if (post_password_required()) { 3 | return; 4 | } 5 | @endphp 6 | 7 |
8 |
9 | @if (have_comments()) 10 |

{!! sprintf(_nx('One response to “%2$s”', '%1$s responses to “%2$s”', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '' . get_the_title() . '') !!} 11 |

12 | 13 |
    {!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!} 14 |
15 | 16 | @if (get_comment_pages_count() > 1 && get_option('page_comments')) 17 | 27 | @endif 28 | @endif 29 | 30 | @if (!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments')) 31 |
{{ __('Comments are closed.', 'sage') }} 32 |
33 | @endif 34 | 35 | @php comment_form() @endphp 36 |
37 |
38 | -------------------------------------------------------------------------------- /resources/views/partials/content-page.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @php the_content() @endphp 3 |
4 | 5 | {!! wp_link_pages(['echo' => 0, 'before' => '']) !!} 6 | -------------------------------------------------------------------------------- /resources/views/partials/content-search.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{!! get_the_title() !!}

4 | @if (get_post_type() === 'post') 5 | @include('partials/entry-meta') 6 | @endif 7 |
8 |
9 | @php the_excerpt() @endphp 10 |
11 |
12 | -------------------------------------------------------------------------------- /resources/views/partials/content-single.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

{!! get_the_title() !!}

5 | @include('partials/entry-meta') 6 | {!! the_post_thumbnail('full') !!} 7 |
8 |
9 | @php the_content() @endphp 10 |
11 |
{!! wp_link_pages(['echo' => 0, 'before' => '']) !!} 12 |
13 | @php comments_template('/partials/comments.blade.php') @endphp 14 | 15 |
16 | -------------------------------------------------------------------------------- /resources/views/partials/content.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @if(has_post_thumbnail()) 3 |
4 |   5 |
6 | @endif 7 |
8 |
9 |

{!! get_the_title() !!}

10 | @include('partials/entry-meta') 11 |
12 |
13 | @php the_excerpt() @endphp 14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /resources/views/partials/entry-meta.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /resources/views/partials/footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | @php dynamic_sidebar('sidebar-footer') @endphp 5 |
6 |
7 |
8 | -------------------------------------------------------------------------------- /resources/views/partials/head.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @php wp_head() @endphp 6 | 7 | -------------------------------------------------------------------------------- /resources/views/partials/header.blade.php: -------------------------------------------------------------------------------- 1 | 20 | -------------------------------------------------------------------------------- /resources/views/partials/page-header.blade.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /resources/views/partials/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | @php dynamic_sidebar('sidebar-primary') @endphp 2 | -------------------------------------------------------------------------------- /resources/views/search.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @include('partials.page-header') 5 | 6 | @if (!have_posts()) 7 |
{{ __('Sorry, no results were found.', 'sage') }} 8 |
{!! get_search_form(false) !!} 9 | @endif 10 | 11 | @while(have_posts()) @php the_post() @endphp 12 | @include('partials.content-search') 13 | @endwhile {!! get_the_posts_navigation() !!} 14 | @endsection 15 | -------------------------------------------------------------------------------- /resources/views/single.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @while(have_posts()) @php the_post() @endphp 5 | @include('partials.content-single-'.get_post_type()) 6 | @endwhile 7 | @endsection 8 | -------------------------------------------------------------------------------- /resources/views/template-custom.blade.php: -------------------------------------------------------------------------------- 1 | {{-- 2 | Template Name: Custom Template 3 | --}} 4 | 5 | @extends('layouts.app') 6 | 7 | @section('content') 8 | @while(have_posts()) @php the_post() @endphp 9 | @include('partials.page-header') 10 | @include('partials.content-page') 11 | @endwhile 12 | @endsection 13 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "lib": ["ESNext", "DOM.Iterable", "DOM"], 5 | "types": ["vite/client"], 6 | "checkJs": false, 7 | "allowJs": false, 8 | "skipLibCheck": true, 9 | "esModuleInterop": false, 10 | "allowSyntheticDefaultImports": true, 11 | "strict": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "module": "ESNext", 14 | "moduleResolution": "Node", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "sourceMap": true, 18 | "noEmit": true, 19 | "jsx": "react", 20 | "noUnusedLocals": true, 21 | "noUnusedParameters": true, 22 | "noImplicitReturns": true 23 | }, 24 | "include": ["./resources/assets/scripts"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import reactRefresh from '@vitejs/plugin-react-refresh'; 2 | import { defineConfig } from 'vite'; 3 | import vue from '@vitejs/plugin-vue'; 4 | import liveReload from 'vite-plugin-live-reload'; 5 | import path from 'path'; 6 | import fs from 'fs'; 7 | 8 | const rootpath = './resources/assets/scripts'; 9 | const themeDirName = path.basename(__dirname); 10 | 11 | function getTopLevelFiles(): Record { 12 | let topLevelFiles = fs.readdirSync(path.resolve(__dirname, rootpath)); 13 | let files: { [key: string]: string } = {}; 14 | topLevelFiles.forEach((file) => { 15 | const isFile = fs.lstatSync(path.resolve(rootpath, file)).isFile(); 16 | if (isFile && !file.includes('.d.ts')) { 17 | const chunkName = file.slice(0, file.lastIndexOf('.')); 18 | files[chunkName] = path.resolve(rootpath, file); 19 | } 20 | }); 21 | return files; 22 | } 23 | 24 | export default defineConfig({ 25 | root: rootpath, 26 | base: process.env.APP_ENV === 'development' ? '/' : `/wp-content/themes/${themeDirName}/dist/`, 27 | build: { 28 | manifest: true, 29 | emptyOutDir: true, 30 | outDir: path.resolve(__dirname, 'dist'), 31 | assetsDir: '', 32 | rollupOptions: { 33 | input: getTopLevelFiles(), 34 | }, 35 | }, 36 | server: { 37 | // required to load scripts from custom host 38 | cors: true, 39 | strictPort: true, 40 | port: 3000, 41 | hmr: { 42 | port: 3000, 43 | host: 'localhost', 44 | protocol: 'ws', 45 | }, 46 | }, 47 | plugins: [vue(), reactRefresh(), liveReload(`${__dirname}/**/*\.php`)], 48 | }); 49 | --------------------------------------------------------------------------------