Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/autocomplete-search
Browse files Browse the repository at this point in the history
  • Loading branch information
WalkingPizza committed Sep 8, 2022
2 parents b4979c7 + c44f21d commit bd201cd
Show file tree
Hide file tree
Showing 1,609 changed files with 28,266 additions and 21,635 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ examples/**
cypress/**
packages/generators/generators/lib/files/
packages/generators/app/lib/resources/files/
packages/core/admin/admin/src/plugins.js
packages/core/helper-plugin/build/**
packages/core/helper-plugin/lib/src/old/components/**
packages/core/helper-plugin/lib/src/testUtils/**
Expand Down
72 changes: 28 additions & 44 deletions .eslintrc.back.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,39 @@
'use strict';

module.exports = {
extends: [
'eslint:recommended',
'prettier',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:node/recommended',
// 'plugin:jsdoc/recommended',
],
plugins: ['jsdoc'],
env: {
es6: true,
node: true,
jest: true,
extends: '@strapi/eslint-config/back',
parserOptions: {
ecmaVersion: 2020,
},
globals: {
strapi: false,
},
rules: {
// 'jsdoc/require-jsdoc': [
// 'warn',
// {
// publicOnly: true,
// require: {
// ArrowFunctionExpression: true,
// ClassDeclaration: true,
// ClassExpression: true,
// FunctionDeclaration: true,
// FunctionExpression: true,
// MethodDefinition: true,
// },
// },
// ],
'node/no-unpublished-require': 'off',
'require-atomic-updates': 'off',
'import/no-dynamic-require': 'off',
'global-require': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'packages/admin-test-utils/**/*.js',
'packages/generators/admin/**/*.js',
'scripts/**/*.js',
'**/test/**/*.js',
'**/tests/**/*.js',
'**/__tests__/**/*.js',
'**/__mocks__/**/*.js',
],
},
],
'prefer-destructuring': ['error', { AssignmentExpression: { array: false } }],
eqeqeq: 'warn',
'no-underscore-dangle': 'warn',
'no-use-before-define': 'warn',
'no-param-reassign': 'warn',
'no-continue': 'warn',
'no-process-exit': 'off',
strict: ['error', 'global'],
'no-return-await': 'error',
'object-shorthand': ['error', 'always', { avoidExplicitReturnArrows: true }],
'import/order': 'error',
'import/no-cycle': 'error',
'import/no-useless-path-segments': 'error',
'import/first': 'error',
'import/extensions': ['error', 'never'],
'import/newline-after-import': 'error',
'node/exports-style': ['error', 'module.exports'],
'node/no-new-require': 'error',
'node/no-path-concat': 'error',
'node/no-callback-literal': 'error',
'node/handle-callback-err': 'error',
'one-var': ['error', 'never'],
'no-plusplus': 'warn',
'no-loop-func': 'warn',
'guard-for-in': 'warn',
},
};
100 changes: 9 additions & 91 deletions .eslintrc.front.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
module.exports = {
parser: 'babel-eslint',
extends: [
'airbnb',
'eslint:recommended',
'plugin:react/recommended',
'plugin:redux-saga/recommended',
'prettier',
],
plugins: ['react', 'redux-saga', 'react-hooks', 'import', 'jsx-a11y'],
parser: '@babel/eslint-parser',
extends: ['@strapi/eslint-config/front'],
env: {
browser: true,
commonjs: true,
Expand All @@ -16,11 +9,10 @@ module.exports = {
mocha: true,
},
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true,
requireConfigFile: false,
babelOptions: {
presets: ['@babel/preset-react'],
},
sourceType: 'module',
},
globals: {
strapi: false,
Expand All @@ -39,86 +31,12 @@ module.exports = {
},
settings: {
react: {
version: '16.5.2',
version: 'detect',
},
},
rules: {
'import/no-unresolved': 0,
'generator-star-spacing': 0,
'no-console': 0,
'require-atomic-updates': 0,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'arrow-body-style': 0,
'arrow-parens': 0,
camelcase: 0,
'comma-dangle': 0,
'consistent-return': [
2,
{
treatUndefinedAsUnspecified: true,
},
],
'template-curly-spacing': 0,
'func-names': ['error', 'never'],
'function-paren-newline': 0,
'implicit-arrow-linebreak': 0,
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'import/order': 2,
'import/prefer-default-export': 'off',
'jsx-a11y/click-events-have-key-events': 1,
'max-len': [
2,
{
code: 120,
ignoreComments: true,
ignoreUrls: true,
ignoreTrailingComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
'newline-before-return': 2,
'no-confusing-arrow': 0,
'no-else-return': 1,
'no-nested-ternary': ['error'],
'no-return-assign': 0,
'no-param-reassign': 0,
'no-plusplus': 0,
'no-shadow': 0,
'no-underscore-dangle': 0,
'no-use-before-define': ['error', { functions: false, classes: false, variables: false }],
'object-curly-newline': [2, { multiline: true, consistent: true }],
'one-var': ['error', 'never'],
'operator-linebreak': 0,
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'if' },
{ blankLine: 'any', prev: 'block-like', next: 'if' },
],
'prefer-arrow-callback': 0,
'prefer-const': 0,
'prefer-destructuring': 0,
'prefer-object-spread': 0,
'prefer-spread': 0,
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'react/destructuring-assignment': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/forbid-prop-types': 0,
'react/no-unused-prop-types': 2,
'react/jsx-props-no-spreading': 0,
'react/jsx-one-expression-per-line': 0,
'react/state-in-constructor': 0,
'react/static-property-placement': 0,
'react/display-name': 0,
'react/jsx-wrap-multilines': 0,
'react/jsx-no-constructed-context-values': 'warn',
'react/jsx-no-useless-fragment': 'warn',
'react/no-unstable-nested-components': 'warn',
},
};
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const frontPaths = [

module.exports = {
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 2020,
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ https://guides.github.com/features/mastering-markdown/
Please ensure you have also read and understand the contributing guide.
https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md#reporting-an-issue
https://github.com/strapi/strapi/blob/main/CONTRIBUTING.md#reporting-an-issue
-->

## Bug report
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To help us merge your PR, make sure to follow the instructions below:
- Refer to the issue you are closing in the PR description: Fix #issue
- Specify if the PR is ready to be merged or work in progress (by opening a draft PR)
Please ensure you read the Contributing Guide: https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md
Please ensure you read the Contributing Guide: https://github.com/strapi/strapi/blob/main/CONTRIBUTING.md
-->

### What does it do?
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/check-pr-status/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PR checker for status

This action checks a PR labels, milestone and status to validate it is ready for merging into master.
This action checks a PR labels, milestone and status to validate it is ready for merging into main.

> 鉂楋笍 When making changes to this code, make sure to run the build before committing. See [Development](#development) to know more.
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/check-pr-status/__tests__/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jest.mock('@actions/core');
const github = require('@actions/github');
const core = require('@actions/core');

test.each(action.BLOCKING_LABELS)('Test blocking labels %s', async label => {
test.each(action.BLOCKING_LABELS)('Test blocking labels %s', async (label) => {
github.context = {
payload: {
pull_request: {
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/check-pr-status/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ async function main() {
try {
const labels = github.context.payload.pull_request?.labels ?? [];

const blockingLabels = labels.filter(label => BLOCKING_LABELS.includes(label.name));
const blockingLabels = labels.filter((label) => BLOCKING_LABELS.includes(label.name));

if (blockingLabels.length > 0) {
core.setFailed(
`The PR has been labelled with a blocking label (${blockingLabels
.map(label => label.name)
.map((label) => label.name)
.join(', ')}).`
);

return;
}

const sourceLabelCount = labels.filter(label => label.name.startsWith('source: ')).length;
const issueLabelCount = labels.filter(label => label.name.startsWith('pr: ')).length;
const sourceLabelCount = labels.filter((label) => label.name.startsWith('source: ')).length;
const issueLabelCount = labels.filter((label) => label.name.startsWith('pr: ')).length;

if (sourceLabelCount !== 1) {
core.setFailed(`The PR must have one and only one 'source:' label.`);
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/check-pr-status/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "check-pr-status",
"version": "4.3.2",
"version": "4.3.8",
"main": "dist/index.js",
"license": "MIT",
"private": true,
Expand All @@ -9,7 +9,7 @@
"watch": "NODE_ENV=production ncc build index.js -w -o dist --minify"
},
"devDependencies": {
"@actions/core": "1.9.0",
"@actions/core": "1.9.1",
"@actions/github": "5.0.0",
"@vercel/ncc": "0.34.0"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- labeled
- unlabeled
branches:
- master
- main

jobs:
check-pr-status:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Nightly Releases'

on:
schedule:
- cron: '0 0 * * 2-6'
workflow_dispatch:

jobs:
publish:
name: 'Publish'
runs-on: ubuntu-latest
if: github.repository == 'strapi/strapi'
steps:
- uses: actions/checkout@v3
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
- run: ./scripts/pre-publish.sh --yes
env:
VERSION: '0.0.0-${{ github.sha }}'
DIST_TAG: experimental
46 changes: 46 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy static content to Pages

on:
push:
branches:
- 'main'
paths:
- 'docs/**'

workflow_dispatch:

concurrency:
group: 'pages'
cancel-in-progress: true

defaults:
run:
working-directory: docs

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build website
run: yarn build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
9 changes: 8 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ name: 'Tests'
on:
push:
branches:
- master
- main
pull_request:
paths-ignore:
- 'docs/**'
- '**.mdx?'

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
lint:
Expand Down

0 comments on commit bd201cd

Please sign in to comment.