Skip to content

Commit 72dd8ad

Browse files
committed
Merge changes published in the Gutenberg plugin "release/7.9" branch
1 parent 6e2ca77 commit 72dd8ad

843 files changed

Lines changed: 28260 additions & 13990 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,22 @@ module.exports = {
3838
globals: {
3939
wp: 'off',
4040
},
41+
settings: {
42+
jsdoc: {
43+
mode: 'typescript',
44+
},
45+
},
4146
rules: {
47+
'jest/expect-expect': 'off',
4248
'@wordpress/dependency-group': 'error',
4349
'@wordpress/gutenberg-phase': 'error',
4450
'@wordpress/react-no-unsafe-timeout': 'error',
51+
'@wordpress/i18n-text-domain': [
52+
'error',
53+
{
54+
allowedTextDomain: 'default',
55+
},
56+
],
4557
'no-restricted-syntax': [
4658
'error',
4759
// NOTE: We can't include the forward slash in our regex or
@@ -67,29 +79,6 @@ module.exports = {
6779
message:
6880
'Deprecated functions must be removed before releasing this version.',
6981
},
70-
{
71-
selector:
72-
'CallExpression[callee.name=/^(__|_n|_nx|_x)$/]:not([arguments.0.type=/^Literal|BinaryExpression$/])',
73-
message:
74-
'Translate function arguments must be string literals.',
75-
},
76-
{
77-
selector:
78-
'CallExpression[callee.name=/^(_n|_nx|_x)$/]:not([arguments.1.type=/^Literal|BinaryExpression$/])',
79-
message:
80-
'Translate function arguments must be string literals.',
81-
},
82-
{
83-
selector:
84-
'CallExpression[callee.name=_nx]:not([arguments.3.type=/^Literal|BinaryExpression$/])',
85-
message:
86-
'Translate function arguments must be string literals.',
87-
},
88-
{
89-
selector:
90-
'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] Literal[value=/\\.{3}/]',
91-
message: 'Use ellipsis character (…) in place of three dots',
92-
},
9382
{
9483
selector:
9584
'ImportDeclaration[source.value="redux"] Identifier.imported[name="combineReducers"]',
@@ -179,6 +168,9 @@ module.exports = {
179168
{
180169
files: [ 'packages/e2e-test*/**/*.js' ],
181170
extends: [ 'plugin:@wordpress/eslint-plugin/test-e2e' ],
171+
rules: {
172+
'jest/expect-expect': 'off',
173+
},
182174
},
183175
],
184176
};

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
build
33
build-module
44
build-style
5+
build-types
56
node_modules
67
gutenberg.zip
78

@@ -14,6 +15,7 @@ yarn.lock
1415

1516
playground/dist
1617
.cache
18+
*.tsbuildinfo
1719

1820
# Report generated from jest-junit
1921
test/native/junit.xml

.travis.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ install:
9191
fi
9292
- |
9393
if [[ "$INSTALL_COMPOSER" = "true" ]]; then
94-
npm run env docker-run -- php composer install
94+
npm run env docker-run -- php composer install --no-interaction
9595
fi
9696
- |
9797
if [[ "$E2E_ROLE" = "author" ]]; then
@@ -114,6 +114,13 @@ jobs:
114114
script:
115115
- npx eslint --parser-options=ecmaVersion:5 --no-eslintrc --no-ignore ./build/**/*.js
116116

117+
- name: Typecheck
118+
install:
119+
- npm ci
120+
script:
121+
- npm run build:package-types
122+
123+
117124
- name: Build artifacts
118125
install:
119126
# A "full" install is executed, since `npm ci` does not always exit
@@ -209,22 +216,5 @@ jobs:
209216
- $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
210217
- $( 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 )
211218

212-
- stage: deploy
213-
if: (NOT type IN (pull_request)) AND (branch = master)
214-
name: Deploy Playground
215-
env: INSTALL_WORDPRESS=false
216-
install:
217-
- npm ci
218-
before_deploy:
219-
- npm run storybook:build
220-
deploy:
221-
provider: pages
222-
skip_cleanup: true
223-
github_token: $GITHUB_TOKEN
224-
keep_history: true
225-
local_dir: playground/dist
226-
on:
227-
branch: master
228-
229219
allow_failures:
230220
# nothing is allowed to fail at the moment
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* Node dependencies.
5+
*/
6+
const { extname } = require( 'path' );
7+
const chalk = require( 'chalk' );
8+
const execSync = require( 'child_process' ).execSync;
9+
const { readFile } = require( 'fs' ).promises;
10+
11+
const getUnstagedFiles = () =>
12+
execSync( 'git diff --name-only', { encoding: 'utf8' } )
13+
.split( '\n' )
14+
.filter( Boolean );
15+
16+
const fileHasToken = async ( file ) =>
17+
( await readFile( file, 'utf8' ) ).includes( '<!-- START TOKEN' );
18+
19+
const getUnstagedReadmes = () =>
20+
Promise.all(
21+
getUnstagedFiles().map(
22+
async ( file ) =>
23+
extname( file ) === '.md' &&
24+
( await fileHasToken( file ) ) &&
25+
file
26+
)
27+
).then( ( files ) => files.filter( Boolean ) );
28+
29+
( async () => {
30+
const unstagedReadmes = await getUnstagedReadmes();
31+
if ( unstagedReadmes.length > 0 ) {
32+
process.exitCode = 1;
33+
process.stdout.write(
34+
chalk.red(
35+
'\n',
36+
'Some API docs may be out of date:',
37+
unstagedReadmes.toString(),
38+
'Either stage them or continue with --no-verify.',
39+
'\n'
40+
)
41+
);
42+
}
43+
} )();

bin/api-docs/are-readmes-unstaged.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

bin/api-docs/packages.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)