-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kevin Provance <[email protected]>
- Loading branch information
Showing
919 changed files
with
192,203 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '' | ||
}) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
./.*/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.