Skip to content

Commit

Permalink
Introduce init.js to all core blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Jul 22, 2022
1 parent c1f0167 commit e9d28c3
Show file tree
Hide file tree
Showing 189 changed files with 863 additions and 24 deletions.
1 change: 1 addition & 0 deletions packages/block-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"sideEffects": [
"build-style/**",
"src/**/*.scss",
"src/*/init.js",
"src/navigation-link/index.js",
"src/template-part/index.js",
"src/query/index.js",
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/archives/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { archive as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -18,3 +19,5 @@ export const settings = {
example: {},
edit,
};

export const init = () => initBlock( { name, metadata, settings } );
5 changes: 2 additions & 3 deletions packages/block-library/src/archives/init.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* Internal dependencies
*/
import * as block from './';
import initBlock from '../utils/init-block';
import { init } from './';

export default initBlock( block );
export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/audio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { audio as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import deprecated from './deprecated';
import edit from './edit';
import metadata from './block.json';
Expand All @@ -28,3 +29,5 @@ export const settings = {
edit,
save,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/audio/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/avatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { commentAuthorAvatar as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -16,3 +17,5 @@ export const settings = {
icon,
edit,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/avatar/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { symbol as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -17,3 +18,5 @@ export const settings = {
edit,
icon,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/block/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { button as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import deprecated from './deprecated';
import edit from './edit';
import metadata from './block.json';
Expand All @@ -32,3 +33,5 @@ export const settings = {
text: ( a.text || '' ) + text,
} ),
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/button/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/buttons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { buttons as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import deprecated from './deprecated';
import transforms from './transforms';
import edit from './edit';
Expand Down Expand Up @@ -36,3 +37,5 @@ export const settings = {
edit,
save,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/buttons/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/calendar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { calendar as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';
import transforms from './transforms';
Expand All @@ -20,3 +21,5 @@ export const settings = {
edit,
transforms,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/calendar/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/categories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { category as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -18,3 +19,5 @@ export const settings = {
example: {},
edit,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/categories/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/code/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { code as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import edit from './edit';
import metadata from './block.json';
import save from './save';
Expand All @@ -32,3 +33,5 @@ export const settings = {
edit,
save,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/code/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/column/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { column as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import deprecated from './deprecated';
import edit from './edit';
import metadata from './block.json';
Expand All @@ -21,3 +22,5 @@ export const settings = {
save,
deprecated,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/column/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/columns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { columns as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import deprecated from './deprecated';
import edit from './edit';
import metadata from './block.json';
Expand Down Expand Up @@ -83,3 +84,5 @@ export const settings = {
save,
transforms,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/columns/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-author-avatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { commentAuthorAvatar as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -16,3 +17,5 @@ export const settings = {
icon,
edit,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/comment-author-avatar/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-author-name/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { commentAuthorName as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';
import deprecated from './deprecated';
Expand All @@ -18,3 +19,5 @@ export const settings = {
edit,
deprecated,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/comment-author-name/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { commentContent as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -16,3 +17,5 @@ export const settings = {
icon,
edit,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/comment-content/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-date/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { postDate as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';
import deprecated from './deprecated';
Expand All @@ -18,3 +19,5 @@ export const settings = {
edit,
deprecated,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/comment-date/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-edit-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { commentEditLink as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -16,3 +17,5 @@ export const settings = {
icon,
edit,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/comment-edit-link/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-reply-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { commentReplyLink as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';

Expand All @@ -16,3 +17,5 @@ export const settings = {
edit,
icon,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/comment-reply-link/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
3 changes: 3 additions & 0 deletions packages/block-library/src/comment-template/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { layout as icon } from '@wordpress/icons';
/**
* Internal dependencies
*/
import initBlock from '../utils/init-block';
import metadata from './block.json';
import edit from './edit';
import save from './save';
Expand All @@ -18,3 +19,5 @@ export const settings = {
edit,
save,
};

export const init = () => initBlock( { name, metadata, settings } );
6 changes: 6 additions & 0 deletions packages/block-library/src/comment-template/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/
import { init } from './';

export default init();
Loading

0 comments on commit e9d28c3

Please sign in to comment.