Skip to content

Commit

Permalink
moving v4 from beta repo
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Provance <[email protected]>
  • Loading branch information
kprovance committed Jun 29, 2021
1 parent ae94aef commit c3294f5
Show file tree
Hide file tree
Showing 919 changed files with 192,203 additions and 256 deletions.
54 changes: 54 additions & 0 deletions .config/externals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* Utility methods for use when generating build configuration objects.
*/
const { join } = require( 'path' );

/**
* Given a string, returns a new string with dash separators converted to
* camel-case equivalent. This is not as aggressive as `_.camelCase`, which
* which would also upper-case letters following numbers.
*
* @param {string} string Input dash-delimited string.
*
* @return {string} Camel-cased string.
*/
const camelCaseDash = string => string.replace(
/-([a-z])/g,
( match, letter ) => letter.toUpperCase()
);

/**
* Define externals to load components through the wp global.
*/
const externals = [
'api-fetch',
'block-editor',
'blocks',
'components',
'compose',
'data',
'date',
'htmlEntities',
'hooks',
'edit-post',
'element',
'editor',
'i18n',
'plugins',
'viewport',
'ajax',
'codeEditor',
'rich-text',
].reduce( ( externals, name ) => ( {
...externals,
[ `@wordpress/${ name }` ]: `wp.${ camelCaseDash( name ) }`,
} ), {
wp: 'wp',
lodash: 'lodash', // WP loads lodash already.
redux_templates: 'redux-templates', // Our localized JS variable.
fetch: 'fetch', // Used in our debugger sidebar.
'react': 'React',
'react-dom': 'ReactDOM',
} );

module.exports = externals;
31 changes: 31 additions & 0 deletions .config/phplint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

error=false

while test $# -gt 0; do
current=$1
shift

if [ ! -d $current ] && [ ! -f $current ] ; then
echo "Invalid directory or file: $current"
error=true

continue
fi

for file in `find $current -type f -name "*.php"` ; do
RESULTS=`php -l $file`

if [ "$RESULTS" != "No syntax errors detected in $file" ] ; then
echo $RESULTS
error=true
fi
done
done


if [ "$error" = true ] ; then
exit 1
else
exit 0
fi
22 changes: 22 additions & 0 deletions .config/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const ImageminPlugin = require( 'imagemin-webpack' )
const CreateFileWebpack = require('create-file-webpack')

module.exports = [
new ImageminPlugin( {
bail: false,
cache: true,
imageminOptions: {
plugins: [
[ 'pngquant', { quality: [ 0.5, 0.5 ] } ],
]
}
} ),
new CreateFileWebpack({
// path to folder in which the file will be created
path: './',
// file name
fileName: 'local_developer.txt',
// content of the file
content: ''
})
]
11 changes: 11 additions & 0 deletions .config/push_to_master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

cd "$(dirname "$0")"
cd ../build
echo $(pwd)
git clone --depth 1 [email protected]:redux-templates/redux-templates.git --branch master master
mv master/.git redux-templates/
cd redux-templates
git add -A
git commit -m "Release"
git push origin master
3 changes: 3 additions & 0 deletions .config/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Cedits

Config based from https://github.com/kadamwhite/wp-block-hmr-demo
61 changes: 61 additions & 0 deletions .config/webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const externals = require( './externals' )
const rules = require( './rules' )
const plugins = require( './plugins' )
const path = require( 'path' )

module.exports = [{

mode: 'development',

devtool: 'cheap-module-source-map',

entry: {
'redux-templates': path.join( __dirname, '../redux-templates/src/index.js' )
},

output: {
path: path.join( __dirname, '../redux-templates/assets/js' ),
filename: '[name].js',
},

// Permit importing @wordpress/* packages.
externals,

resolve: {
alias: {
'~redux-templates': path.resolve( __dirname, '../redux-templates/src/' )
}
},

optimization: {
splitChunks: {
cacheGroups: {
vendor: {
test: /node_modules/,
chunks: "initial",
name: "vendor",
priority: 10,
enforce: true
}
}
},
},

// Clean up build output
stats: {
all: false,
assets: true,
colors: true,
errors: true,
performance: true,
timings: true,
warnings: true,
},

module: {
strictExportPresence: true,
rules,
},

plugins,
}]
53 changes: 53 additions & 0 deletions .config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const externals = require( './externals' )
const rules = require( './rules' )
const plugins = require( './plugins' )
const path = require( 'path' )

module.exports = [{

mode: 'production',

devtool: 'hidden-source-map',

entry: {
'redux-templates': path.join( __dirname, '../redux-templates/src/index.js' )
},

output: {
path: path.join( __dirname, '../redux-templates/assets/js' ),
filename: '[name].min.js',
},

// Permit importing @wordpress/* packages.
externals,

resolve: {
alias: {
'~redux-templates': path.resolve( __dirname, '../redux-templates/src/' )
}
},

// Optimize output bundle.
optimization: {
minimize: true,
noEmitOnErrors: true,
splitChunks: {
cacheGroups: {
vendor: {
test: /node_modules/,
chunks: "initial",
name: "vendor",
priority: 10,
enforce: true
}
}
},
},

module: {
strictExportPresence: true,
rules,
},

plugins,
}]
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[*.scss]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[{*.txt,wp-config-sample.php}]
end_of_line = crlf
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build
redux-templates/assets/js/redux-templates.js
*.min.js
**/tests/
redux-core/assets/js/redux-vendors.js
redux-core/assets/js/vendor/**/*.js
redux-templates/assets/js/vendor.js
20 changes: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"browser": true,
"node": true
},
"parser": "babel-eslint",
"rules": {
"quotes": [
2,
"single"
]
},
"plugins": [
"react"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
}
}
51 changes: 51 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"preset": "wordpress",
"fileExtensions": [".js", "jscs"],

"excludeFiles": [
"./gulpfile.js",
"./redux-core/inc/themecheck/js/*.min.js",
"./redux-core/inc/welcome/js/jquery.easing.min.js",
"./redux-core/inc/welcome/js/*.js",
"./redux-core/inc/extensions/**/*.min.js",
"./redux-core/inc/fields/spinner/vendor/*.min.js",
"./redux-core/inc/fields/typography/todo/*.*",
"./redux-core/inc/fields/**/*.min.js",
"./redux-core/assets/js/vendor/**/*.js",
"./redux-core/assets/js/vendor/*.js",
"./redux-core/assets/js/media/*.min.js",
"./redux-core/assets/js/*.js",
"./node_modules/**",
"./redux-templates/**",
"./.*/**"
],

"maxErrors": -1,
"requireSemicolons": true,
"requireParenthesesAroundIIFE": true,
"maximumLineLength": 240,
"validateLineBreaks": null,
"validateIndentation": "\t",
"disallowTrailingComma": true,
"disallowUnusedParams": true,

"disallowSpaceAfterPrefixUnaryOperators": false,
"disallowSpacesInsideParentheses": false,
"disallowSpacesInsideObjectBrackets": null,
"disallowImplicitTypeConversion": ["string"],
"requireCamelCaseOrUpperCaseIdentifiers": false,
"validateQuoteMarks": false,
"safeContextKeyword": "_this",
"jsDoc": {
"checkAnnotations": "closurecompiler",
"checkParamNames": true,
"requireParamTypes": true,
"checkRedundantParams": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": "capitalizedNativeCase",
"checkRedundantAccess": true,
"requireNewlineAfterDescription": true
},
}
17 changes: 17 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
./redux-core/assets/js/*.js
./redux-core/assets/js/media/*.min.js
./redux-core/assets/js/vendor/*.js
./redux-core/assets/js/vendor/**/*.js
./redux-core/assets/js/redux/*.js
./redux-core/inc/fields/**/*.min.js
./redux-core/inc/fields/typography/todo/*.*
./redux-core/inc/fields/spinner/vendor/*.*
./redux-core/inc/extensions/**/*.min.js
./redux-core/inc/welcome/js/*.min.js
./redux-core/inc/welcome/js/jquery.easing.min.js
./redux-core/inc/welcome/js/redux-banner-admin.js
./redux-core/inc/themecheck/js/*.min.js
./redux-templates/**
./node_modules/**
./.config/*.js
./.*/**
9 changes: 9 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
bin
obj
*.*
!*.scss
*.svg
*.png
redux-core/assets/scss/vendor/*.scss
redux-core/assets/scss/vendor/**/*.scss
Loading

0 comments on commit c3294f5

Please sign in to comment.