Merge branch 'main' into block

This commit is contained in:
Daniel Waxweiler 2021-12-14 17:54:47 +01:00
commit 876c3e3840
33 changed files with 18 additions and 19 deletions

View File

@ -10,11 +10,11 @@ const FOLDER_BUILD = './build'
function injectMetadata() {
return src(
[
FOLDER_BUILD + '/' + PACKAGE.name + '/front/events-loader.js',
FOLDER_BUILD + '/' + PACKAGE.name + '/front/block-events-loader.js',
FOLDER_BUILD + '/' + PACKAGE.name + '/' + PACKAGE.name + '.php',
FOLDER_BUILD + '/' + PACKAGE.name + '/includes/constants.php',
FOLDER_BUILD + '/' + PACKAGE.name + '/readme.txt',
FOLDER_BUILD + '/front/block-events-loader.js',
FOLDER_BUILD + '/front/events-loader.js',
FOLDER_BUILD + '/' + PACKAGE.name + '.php',
FOLDER_BUILD + '/includes/constants.php',
FOLDER_BUILD + '/readme.txt',
],
{ base: './' }
)

View File

@ -8,20 +8,23 @@ const NAME = '<wordpress-name>'
registerBlockType(NAME + '/events-list', {
title: __('Events List', '<wordpress-name>'),
description: __('A list of the upcoming events of the connected Mobilizon instance.', '<wordpress-name>'),
description: __(
'A list of the upcoming events of the connected Mobilizon instance.',
'<wordpress-name>'
),
icon: 'list-view',
category: 'widgets',
attributes: {
eventsCount: {
type: 'number',
default: 3
default: 3,
},
groupName: {
type: 'string'
}
type: 'string',
},
},
supports: {
html: false
html: false,
},
edit,
save,

View File

@ -3,20 +3,16 @@ const path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
const PACKAGE = require('./package.json')
const FOLDER_SOURCE = './source'
module.exports = {
entry: {
'block-events-loader':
FOLDER_SOURCE + '/' + PACKAGE.name + '/front/block-events-loader.js',
'events-loader':
FOLDER_SOURCE + '/' + PACKAGE.name + '/front/events-loader.js',
'block-events-loader': FOLDER_SOURCE + '/front/block-events-loader.js',
'events-loader': FOLDER_SOURCE + '/front/events-loader.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'build/' + PACKAGE.name + '/front'),
path: path.resolve(__dirname, 'build/front'),
},
module: {
rules: [
@ -33,12 +29,12 @@ module.exports = {
new CopyPlugin({
patterns: [
{
context: FOLDER_SOURCE + '/' + PACKAGE.name,
context: FOLDER_SOURCE,
from: '**/*.php',
to: '../',
},
{
context: FOLDER_SOURCE + '/' + PACKAGE.name,
context: FOLDER_SOURCE,
from: '**/*.txt',
to: '../',
},