Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
Merge branch 'add/spa-amp-shadow-dom' into xwp/add/spa-amp-shadow-dom
Browse files Browse the repository at this point in the history
* add/spa-amp-shadow-dom: (3410 commits)
  Improve copy in comment and error message
  Reuse constant
  Revert introduction of amp_document_output filter for now
  attachShadowDocAsStream expects a string type variable
  AppShell polyfill: Update to latest version - 2.4.1
  Add a filter to allow altering AMP output from themes
  Ensure .site-content-contain element exists
  Amp-Wp-App-Shell - Improve flexibility for different types of caching
  AppShell polyfill: Update to latest version - 2.4.0
  Fix eslint issues
  Fix build and unit tests by preserving uncompiled scripts
  Make use of new Amp\AmpWP\Document methods; add line breaks
  Restore missing live_list_offline_commenting to AMP_Service_Worker
  Fix phpcs linting issues
  Add missing changes to style sanitizer; remove duplicated autoloader entry
  Ignore Story editor tests (ampproject#4043)
  Update dependency eslint-plugin-jest to v23.4.0 (ampproject#4056)
  Update dependency xwp/wp-dev-lib to v1.4.0
  Update amp-video embed regex pattern to include other Vimeo URL formats (ampproject#4051)
  Update amp-instagram embed regex (ampproject#4053)
  ...

# Conflicts:
#	composer.json
  • Loading branch information
delawski committed Jul 22, 2020
2 parents fc9e307 + 30e9faa commit 22cff74
Show file tree
Hide file tree
Showing 790 changed files with 97,608 additions and 27,150 deletions.
25 changes: 0 additions & 25 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends @wordpress/browserslist-config
29 changes: 22 additions & 7 deletions .dev-lib
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
#!/bin/bash

DEFAULT_BASE_BRANCH=develop
ASSETS_DIR=wp-assets
PROJECT_SLUG=amp
SKIP_ECHO_PATHS_SCOPE=1
README_MD_TITLE="AMP Plugin for WordPress"
DEV_LIB_SKIP="$DEV_LIB_SKIP,jshint"
if [[ ! -z $TRAVIS ]]; then
CHECK_SCOPE=all
fi
CHECK_SCOPE=all

function after_wp_install {
echo -n "Installing Gutenberg..."
svn export -q https://plugins.svn.wordpress.org/gutenberg/trunk/ "$WP_CORE_DIR/src/wp-content/plugins/gutenberg"
echo "done"
if [[ "$WP_VERSION" != "4.9" ]]; then
echo -n "Installing Gutenberg..."
gutenberg_plugin_svn_url=https://plugins.svn.wordpress.org/gutenberg/trunk/
svn export -q "$gutenberg_plugin_svn_url" "$WP_CORE_DIR/src/wp-content/plugins/gutenberg"
echo "done"
fi

if [[ ! -z $INSTALL_PWA_PLUGIN ]]; then
echo -n "Installing PWA 0.2-alpha2..."
wget -O "$WP_CORE_DIR/src/wp-content/plugins/pwa.zip" https://github.com/xwp/pwa-wp/releases/download/0.2-alpha2/pwa.zip
unzip -d "$WP_CORE_DIR/src/wp-content/plugins/pwa/" "$WP_CORE_DIR/src/wp-content/plugins/pwa.zip"
echo "done"
fi
}

function coverage_clover {
if [[ ! -z $RUN_PHPUNIT_COVERAGE ]]; then
echo --coverage-clover build/logs/clover.xml
fi
}
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[{.babelrc,.eslintrc,.jshintrc,*.json,*.yml}]
[{.babelrc,.eslintrc,.rtlcssrc,*.json,*.yml}]
indent_style = space
indent_size = 2

Expand Down
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/*.min.js
**/node_modules/**
**/vendor/**
**/assets/js/*-compiled.js
**/assets/js/*.js
!assets/js/amp-service-worker-runtime-precaching.js
build/*
308 changes: 107 additions & 201 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,203 +1,109 @@
{
"root": true,
"extends": [
"wordpress",
"eslint:recommended",
"plugin:react/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react"
],
"env": {
"browser": true,
"es6": true
},
"globals": {
"wp": true,
"window": true,
"document": true
},
"settings": {
"react": {
"pragma": "wp",
"version": "16.6"
}
},
"rules": {
"no-magic-numbers": [2, { "ignoreArrayIndexes": true, "ignore": [ -1, 0, 1 ] }],
"array-bracket-spacing": [
"error",
"always"
],
"brace-style": [
"error",
"1tbs"
],
"camelcase": [
"error",
{
"properties": "never"
}
],
"comma-dangle": [
"error",
"never"
],
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": [
"error",
"always"
],
"dot-notation": "error",
"eol-last": "error",
"eqeqeq": "error",
"func-call-spacing": "error",
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"key-spacing": "error",
"keyword-spacing": "error",
"lines-around-comment": "off",
"no-alert": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-console": "error",
"no-debugger": "error",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-else-return": "error",
"no-eval": "error",
"no-extra-semi": "error",
"no-fallthrough": "error",
"no-lonely-if": "error",
"no-mixed-operators": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": [
"error",
{
"max": 1
}
],
"no-multi-spaces": "error",
"no-multi-str": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "error",
"no-redeclare": "error",
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.name=/^__|_n|_x$/]:not([arguments.0.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
},
{
"selector": "CallExpression[callee.name=/^_n|_x$/]:not([arguments.1.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
},
{
"selector": "CallExpression[callee.name=_nx]:not([arguments.2.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
}
],
"no-shadow": "error",
"no-undef": "error",
"no-undef-init": "error",
"no-unreachable": "error",
"no-unsafe-negation": "error",
"no-unused-expressions": "error",
"no-unused-vars": "error",
"no-useless-return": "error",
"no-whitespace-before-property": "error",
"object-curly-spacing": [
"error",
"always"
],
"padded-blocks": [
"error",
"never"
],
"quote-props": [
"error",
"as-needed"
],
"react/display-name": "off",
"react/no-children-prop": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"semi": "error",
"semi-spacing": "error",
"space-before-blocks": [
"error",
"always"
],
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}
],
"space-in-parens": [
"error",
"always"
],
"space-infix-ops": [
"error",
{
"int32Hint": false
}
],
"space-unary-ops": [
"error",
{
"overrides": {
"!": true,
"yield": true
}
}
],
"valid-jsdoc": [
"error",
{
"prefer": {
"arg": "param",
"argument": "param",
"extends": "augments",
"returns": "return"
},
"preferType": {
"array": "Array",
"bool": "boolean",
"Boolean": "boolean",
"float": "number",
"Float": "number",
"int": "number",
"integer": "number",
"Integer": "number",
"Number": "number",
"object": "Object",
"String": "string",
"Void": "void"
},
"requireParamDescription": false,
"requireReturn": false
}
],
"valid-typeof": "error",
"yoda": "off"
}
"root": true,
"extends": [
"plugin:@wordpress/eslint-plugin/recommended",
"plugin:import/recommended",
"plugin:eslint-comments/recommended"
],
"rules": {
"block-scoped-var": "error",
"complexity": ["error", { "max": 20 } ],
"consistent-return": "error",
"default-case": "error",
"guard-for-in": "error",
"no-await-in-loop": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-loop-func": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-restricted-properties": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-sequences": "error",
"no-shadow": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-vars": [
"error",
{
"ignoreRestSiblings": true
}
],
"no-useless-call": "error",
"no-useless-concat": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"radix": [ "error", "as-needed" ],
"require-await": "error",
"rest-spread-spacing": [ "error", "never" ],
"react/prop-types": "error",
"react-hooks/exhaustive-deps": [ "error", { "additionalHooks": "useSelect" } ],
"react/jsx-closing-tag-location": "error",
"react/jsx-fragments": "error",
"react/jsx-first-prop-new-line": "error",
"react/jsx-max-props-per-line": [ "error", { "when": "multiline" } ],
"react/jsx-no-literals": "error",
"react/jsx-no-useless-fragment": "error",
"react/jsx-one-expression-per-line": "error",
"react/no-unused-prop-types": "error",
"react/self-closing-comp": "error",
"import/no-unresolved": [ "error", {
"ignore": [ "jquery", "amp-block-editor-data" ]
} ],
"import/order": [ "error", { "groups": [ "builtin", [ "external", "unknown" ], "internal", "parent", "sibling", "index" ] } ],
"jsdoc/check-indentation": "error",
"@wordpress/dependency-group": "error",
"@wordpress/react-no-unsafe-timeout": "error"
},
"overrides": [
{
"files":[
"**/__tests__/**/*.js",
"**/test/*.js",
"**/?(*.)test.js",
"tests/js/**/*.js"
],
"extends": [
"plugin:jest/all"
],
"rules": {
"jest/lowercase-name": [
"error",
{
"ignore": [ "describe" ]
}
],
"jest/no-hooks": "off",
"jest/prefer-expect-assertions": "off",
"jest/prefer-inline-snapshots": "off"
}
},
{
"files": [ "tests/e2e/**/*.js" ],
"extends": [
"plugin:@wordpress/eslint-plugin/test-e2e",
"plugin:jest/all"
],
"rules": {
"jest/lowercase-name": [
"error",
{
"ignore": [ "describe" ]
}
],
"jest/no-hooks": "off",
"jest/prefer-expect-assertions": "off",
"jest/prefer-inline-snapshots": "off"
}
}
]
}
Loading

0 comments on commit 22cff74

Please sign in to comment.