Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/7.9" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Apr 15, 2020
1 parent 6e2ca77 commit 72dd8ad
Show file tree
Hide file tree
Showing 843 changed files with 28,260 additions and 13,990 deletions.
38 changes: 15 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ module.exports = {
globals: {
wp: 'off',
},
settings: {
jsdoc: {
mode: 'typescript',
},
},
rules: {
'jest/expect-expect': 'off',
'@wordpress/dependency-group': 'error',
'@wordpress/gutenberg-phase': 'error',
'@wordpress/react-no-unsafe-timeout': 'error',
'@wordpress/i18n-text-domain': [
'error',
{
allowedTextDomain: 'default',
},
],
'no-restricted-syntax': [
'error',
// NOTE: We can't include the forward slash in our regex or
Expand All @@ -67,29 +79,6 @@ module.exports = {
message:
'Deprecated functions must be removed before releasing this version.',
},
{
selector:
'CallExpression[callee.name=/^(__|_n|_nx|_x)$/]:not([arguments.0.type=/^Literal|BinaryExpression$/])',
message:
'Translate function arguments must be string literals.',
},
{
selector:
'CallExpression[callee.name=/^(_n|_nx|_x)$/]:not([arguments.1.type=/^Literal|BinaryExpression$/])',
message:
'Translate function arguments must be string literals.',
},
{
selector:
'CallExpression[callee.name=_nx]:not([arguments.3.type=/^Literal|BinaryExpression$/])',
message:
'Translate function arguments must be string literals.',
},
{
selector:
'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] Literal[value=/\\.{3}/]',
message: 'Use ellipsis character (…) in place of three dots',
},
{
selector:
'ImportDeclaration[source.value="redux"] Identifier.imported[name="combineReducers"]',
Expand Down Expand Up @@ -179,6 +168,9 @@ module.exports = {
{
files: [ 'packages/e2e-test*/**/*.js' ],
extends: [ 'plugin:@wordpress/eslint-plugin/test-e2e' ],
rules: {
'jest/expect-expect': 'off',
},
},
],
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
build
build-module
build-style
build-types
node_modules
gutenberg.zip

Expand All @@ -14,6 +15,7 @@ yarn.lock

playground/dist
.cache
*.tsbuildinfo

# Report generated from jest-junit
test/native/junit.xml
Expand Down
26 changes: 8 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ install:
fi
- |
if [[ "$INSTALL_COMPOSER" = "true" ]]; then
npm run env docker-run -- php composer install
npm run env docker-run -- php composer install --no-interaction
fi
- |
if [[ "$E2E_ROLE" = "author" ]]; then
Expand All @@ -114,6 +114,13 @@ jobs:
script:
- npx eslint --parser-options=ecmaVersion:5 --no-eslintrc --no-ignore ./build/**/*.js

- name: Typecheck
install:
- npm ci
script:
- npm run build:package-types


- name: Build artifacts
install:
# A "full" install is executed, since `npm ci` does not always exit
Expand Down Expand Up @@ -209,22 +216,5 @@ jobs:
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % 4 == 3' < ~/.jest-e2e-tests )

- stage: deploy
if: (NOT type IN (pull_request)) AND (branch = master)
name: Deploy Playground
env: INSTALL_WORDPRESS=false
install:
- npm ci
before_deploy:
- npm run storybook:build
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: true
local_dir: playground/dist
on:
branch: master

allow_failures:
# nothing is allowed to fail at the moment
43 changes: 43 additions & 0 deletions bin/api-docs/are-api-docs-unstaged.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env node

/**
* Node dependencies.
*/
const { extname } = require( 'path' );
const chalk = require( 'chalk' );
const execSync = require( 'child_process' ).execSync;
const { readFile } = require( 'fs' ).promises;

const getUnstagedFiles = () =>
execSync( 'git diff --name-only', { encoding: 'utf8' } )
.split( '\n' )
.filter( Boolean );

const fileHasToken = async ( file ) =>
( await readFile( file, 'utf8' ) ).includes( '<!-- START TOKEN' );

const getUnstagedReadmes = () =>
Promise.all(
getUnstagedFiles().map(
async ( file ) =>
extname( file ) === '.md' &&
( await fileHasToken( file ) ) &&
file
)
).then( ( files ) => files.filter( Boolean ) );

( async () => {
const unstagedReadmes = await getUnstagedReadmes();
if ( unstagedReadmes.length > 0 ) {
process.exitCode = 1;
process.stdout.write(
chalk.red(
'\n',
'Some API docs may be out of date:',
unstagedReadmes.toString(),
'Either stage them or continue with --no-verify.',
'\n'
)
);
}
} )();
37 changes: 0 additions & 37 deletions bin/api-docs/are-readmes-unstaged.js

This file was deleted.

49 changes: 0 additions & 49 deletions bin/api-docs/packages.js

This file was deleted.

Loading

0 comments on commit 72dd8ad

Please sign in to comment.