diff --git a/.editorconfig b/.editorconfig index cf8d7fa6ee..2ca82c5eee 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,24 @@ -# editorconfig.org - root = true [*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true indent_style = space indent_size = 2 -end_of_line = lf -charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[*.php] +indent_size = 4 + +[*.blade.php] +indent_size = 2 + +[resources/views/**.php] +indent_size = 2 + +[index.php] +indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..54acc2566c --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,51 @@ +module.exports = { + root: true, + extends: ['eslint:recommended', 'plugin:react/recommended'], + globals: { + wp: true, + }, + env: { + node: true, + es6: true, + amd: true, + browser: true, + jquery: true, + }, + parser: 'babel-eslint', + parserOptions: { + ecmaFeatures: { + experimentalObjectRestSpread: true, + globalReturn: true, + generators: false, + impliedStrict: true, + objectLiteralDuplicateProperties: false, + jsx: true, + }, + ecmaVersion: 2017, + sourceType: 'module', + }, + plugins: ['import', 'react-hooks'], + settings: { + react: { + version: 'detect', + }, + 'import/core-modules': [], + 'import/ignore': [ + 'node_modules', + '\\.(coffee|scss|css|less|hbs|svg|json)$', + ], + }, + rules: { + 'no-console': 0, + 'comma-dangle': [ + 'error', + { + arrays: 'always-multiline', + objects: 'always-multiline', + imports: 'always-multiline', + exports: 'always-multiline', + functions: 'ignore', + }, + ], + }, +}; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..aacb20e852 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/.gitattributes export-ignore +/.github export-ignore diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..9e6590a587 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,103 @@ +version: 2 +updates: +- package-ecosystem: composer + directory: "/" + schedule: + interval: daily + time: "08:00" + timezone: US/Central + open-pull-requests-limit: 10 + target-branch: main + ignore: + - dependency-name: filp/whoops + versions: + - 2.10.0 + - 2.11.0 + - 2.12.0 + - 2.9.2 + - dependency-name: symfony/http-kernel + versions: + - 5.2.2 + - 5.2.3 +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "08:00" + timezone: US/Central + open-pull-requests-limit: 10 + target-branch: main + ignore: + - dependency-name: postcss + versions: + - 8.2.10 + - 8.2.12 + - 8.2.7 + - 8.2.8 + - 8.2.9 + - dependency-name: laravel-mix + versions: + - 5.0.9 + - 6.0.13 + - 6.0.16 + - 6.0.17 + - dependency-name: sass + versions: + - 1.32.10 + - 1.32.11 + - 1.32.5 + - 1.32.6 + - 1.32.7 + - 1.32.8 + - dependency-name: eslint + versions: + - 7.18.0 + - 7.19.0 + - 7.20.0 + - 7.21.0 + - 7.22.0 + - 7.23.0 + - 7.24.0 + - dependency-name: "@wordpress/browserslist-config" + versions: + - 3.0.2 + - dependency-name: "@wordpress/babel-preset-default" + versions: + - 5.0.0 + - 5.0.1 + - 5.1.0 + - 5.2.0 + - dependency-name: "@wordpress/dependency-extraction-webpack-plugin" + versions: + - 3.1.0 + - 3.1.1 + - dependency-name: tailwindcss + versions: + - 2.0.4 + - 2.1.1 + - dependency-name: stylelint + versions: + - 13.10.0 + - 13.11.0 + - 13.12.0 + - 13.9.0 + - dependency-name: sass-loader + versions: + - 10.1.1 + - 11.0.0 + - 11.0.1 + - dependency-name: browser-sync + versions: + - 2.26.14 + - dependency-name: purgecss-with-wordpress + versions: + - 4.0.0 + - dependency-name: ini + versions: + - 1.3.8 + - dependency-name: vue-template-compiler + versions: + - 2.6.12 + - dependency-name: eslint-plugin-import + versions: + - 2.22.1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..56b76b286e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,87 @@ +name: Main + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + node: + name: Node ${{ matrix.node }} + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + matrix: + node: ['16'] + + steps: + - name: Checkout the project + uses: actions/checkout@v2 + + - name: Setup the Node ${{ matrix.node }} environment on ${{ runner.os }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Restore the Yarn cache directory + id: yarncache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.yarncache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-${{ matrix.node }}-yarn- + + - name: Install dependencies using Yarn + run: yarn install --frozen-lockfile + + - name: Lint scripts and styles + run: yarn lint + + - name: Build and compile assets + run: | + yarn build + cat public/entrypoints.json + cat public/manifest.json + + php: + name: PHP ${{ matrix.php }} + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + matrix: + php: ['7.3', '7.4', '8.0'] + + steps: + - name: Checkout the project + uses: actions/checkout@v2 + + - name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Restore the Composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest + + - name: Execute the PHP lint script + run: composer run-script lint diff --git a/.gitignore b/.gitignore index b2e9742c59..a1900e3e52 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ -# Include your project-specific ignores in this file -# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files -node_modules -assets/css/main.min.css.map +/node_modules +/vendor +/public +.env +.budfiles +npm-debug.log +yarn-error.log diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 136eae5378..0000000000 --- a/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "bitwise": true, - "browser": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "esnext": true, - "immed": true, - "jquery": true, - "latedef": true, - "newcap": true, - "noarg": true, - "node": true, - "strict": false, - "trailing": true -} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..16cbd288d5 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,9 @@ +{ + "bracketSpacing": false, + "jsxBracketSameLine": true, + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": false +} diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 0000000000..83ac1e2714 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,42 @@ +{ + "extends": "stylelint-config-standard", + "rules": { + "string-quotes": null, + "selector-class-pattern": null, + "declaration-colon-newline-after": null, + "value-list-comma-newline-after": null, + "no-empty-source": null, + "no-descending-specificity": null, + "at-rule-empty-line-before": null, + "at-rule-no-unknown": [ + true, + { + "ignoreAtRules": [ + "extend", + "at-root", + "debug", + "warn", + "error", + "if", + "else", + "for", + "each", + "while", + "mixin", + "include", + "content", + "return", + "tailwind", + "apply", + "responsive", + "variants", + "screen", + "function", + "use", + "forward", + "layer" + ] + } + ] + } +} diff --git a/404.php b/404.php deleted file mode 100644 index 51f0483d30..0000000000 --- a/404.php +++ /dev/null @@ -1,13 +0,0 @@ - - -
- -
- -

- - - diff --git a/CHANGELOG.md b/CHANGELOG.md index a780efb301..c12da501de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,333 +1,759 @@ ### HEAD -* Update to Bootstrap 3.1.1 +- Replace Laravel Mix with Bud ([#2643](https://github.com/roots/sage/pull/2643)) +- chore(deps): Bump roots/acorn to v2.0.0-beta.5 ([#2861](https://github.com/roots/sage/pull/2861)) +- Move compiled views back to cache dir by default ([#2837](https://github.com/roots/sage/pull/2837)) + +### 10.0.0-beta.1: October 21st, 2021 + +- Use menu name as accessible name of `