Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a8abe1b
Fixed settings page not loading
apalfrey Oct 10, 2023
75dc709
Fixed gutenberg notice in widgets page
apalfrey Oct 10, 2023
b4f6608
Removed .gitignore for assets
apalfrey Oct 10, 2023
6821e6a
Removed need for `CWP_THEME_SLUG` constant
apalfrey Oct 10, 2023
93d6752
Moved settings page to use multiple pages
apalfrey Oct 10, 2023
5d8a42b
Missed some version numbers & changelog
apalfrey Oct 10, 2023
a45591c
Added bookmarks for version number & changelog
apalfrey Oct 10, 2023
0f40f8d
Removed unnecessary todos
apalfrey Oct 10, 2023
2d61c72
Added some useful todos
apalfrey Oct 10, 2023
daf8029
Added custom menu items to screen options
apalfrey Oct 10, 2023
d28186b
Implemented menu items into customizer
apalfrey Oct 11, 2023
66826e9
Improved logo & white logo fields
apalfrey Oct 11, 2023
7155b23
Implemented controller enable setting
apalfrey Oct 11, 2023
fefe82a
Implemented phpcs as an npm command
apalfrey Oct 11, 2023
df070bf
Implemented styles & scripts enable settings
apalfrey Oct 11, 2023
2e3dd12
Added footer column count setting
apalfrey Oct 11, 2023
09d28ac
Improved settings styling
apalfrey Oct 11, 2023
dff3c85
Implemented JS translation functionality
apalfrey Oct 11, 2023
14b3061
Added po to json functionality
apalfrey Oct 12, 2023
26e2164
Allow pagination query passthrough
apalfrey Oct 16, 2023
a679242
Some phpcs fixes
apalfrey Oct 16, 2023
37aba7e
Fixed args comment
apalfrey Oct 18, 2023
cc0777c
Fixed active link in navwalker
apalfrey Oct 18, 2023
94d3080
Added options for auto including & running theme classes
apalfrey Oct 19, 2023
45a7899
Added auto-load theme textdomain
apalfrey Oct 19, 2023
2ac8699
Updated translations
apalfrey Oct 19, 2023
727a297
Version bump to 0.2.0
apalfrey Oct 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ vendor/
# Misc
*.log

# Compiled files
assets/
# Archives
dist/
*.zip
*.tar
*.gz
*.tgz
257 changes: 215 additions & 42 deletions .gulpconfig.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,45 @@
const pkg = require( './package.json' )
const TerserPlugin = require( 'terser-webpack-plugin' )
const areas = {
constructWp: {
path: './plugins/construct-wp',
name: 'construct-wp',
title: 'ConstructWP',
version: '0.1.0',
version: '0.2.0',
},
}

const translatePipes = {
checktextdomain: {
text_domain: 'text-domain',
keywords: [
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d',
'esc_html__:1,2d',
'esc_html_e:1,2d',
'esc_html_x:1,2c,3d',
'esc_attr__:1,2d',
'esc_attr_e:1,2d',
'esc_attr_x:1,2c,3d',
],
report_missing: true,
report_success: false,
report_variable_domain: true,
correct_domain: true,
create_report_file: false,
force: false,
},
pot: {
domain: 'text-domain',
package: 'Package Name',
team: `${pkg.author.name} <${pkg.author.email}>`,
lastTranslator: `${pkg.author.name} <${pkg.author.email}>`,
},
}

Expand All @@ -15,7 +50,6 @@ module.exports = {
paths: [
`${areas.constructWp.path}/assets`,
`${areas.constructWp.path}/dist`,
`${areas.constructWp.path}/languages`,
],
pipes: {
del: {
Expand Down Expand Up @@ -43,7 +77,7 @@ module.exports = {
src: {
allowEmpty: true,
base: `${areas.constructWp.path}/src/scss`,
sourcemaps: process.env.NODE_ENV !== 'development',
sourcemaps: process.env.NODE_ENV === 'development',
},
dest: {
sourcemaps: '.',
Expand Down Expand Up @@ -103,6 +137,92 @@ module.exports = {
},
},
},
scripts: {
process: true,
watch: true,
logColor: 'magenta',
areas: [
{
paths: {
src: `${areas.constructWp.path}/src/js/**/*`,
watch: `${areas.constructWp.path}/src/js/**/*`,
dest: `${areas.constructWp.path}/assets/js`,
},
minify: {
process: process.env.NODE_ENV !== 'development',
separate: false,
},
pipes: {
// Put any pipe overrides here
src: {
allowEmpty: true,
base: `${areas.constructWp.path}/src/js`,
sourcemaps: process.env.NODE_ENV === 'development',
},
dest: {
sourcemaps: '.',
},
},
},
],
pipes: {
filters: {
lint: [
'**/*.js',
],
build: [
'**/*.js',
'!**/libs/**/*.js',
],
},
watch: {
events: 'all',
},
eslint: {
// Overrides the version of eslint used
eslint: null,
formatter: 'stylish',
options: {
fix: false,
},
},
rollup: {
// Overrides the version of rollup used.
// Make sure to pass through the rollup function
// e.g. require( 'rollup' ).rollup
rollup: null,
input: {
plugins: [
require( '@rollup/plugin-babel' ).babel( {
exclude: 'node_modules/**',
babelHelpers: 'bundled',
} ),
require( '@rollup/plugin-node-resolve' ).nodeResolve(),
],
treeshake: false,
onwarn( e ) {
if ( e.code === 'THIS_IS_UNDEFINED' ) {
return
}

console.warn( e.message )
},
},
output: {
file: 'scripts.js',
name: 'Scripts',
format: 'umd',
generatedCode: 'es2015',
globals: {},
},
},
uglify: {
output: {
comments: '/^!|@preserve|@license|@cc_on/i',
},
},
},
},
webpack: {
process: true,
watch: true,
Expand All @@ -123,7 +243,7 @@ module.exports = {
src: {
allowEmpty: true,
base: `${areas.constructWp.path}/src/gutenberg`,
sourcemaps: process.env.NODE_ENV !== 'development',
sourcemaps: process.env.NODE_ENV === 'development',
},
dest: {
sourcemaps: '.',
Expand Down Expand Up @@ -192,7 +312,9 @@ module.exports = {
},
],
],
plugins: [],
plugins: [
'@automattic/babel-plugin-preserve-i18n',
],
},
},
},
Expand All @@ -201,8 +323,42 @@ module.exports = {
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
devtool: process.env.NODE_ENV == 'development' ? 'source-map' : false,
mode: process.env.NODE_ENV == 'development' ? 'development' : 'production',
optimization: {
minimizer: [
new TerserPlugin( {
parallel: true,
terserOptions: {
output: {
comments: /translators:/i,
},
compress: {
passes: 2,
},
mangle: {
reserved: [
'__',
'_e',
'_x',
'_ex',
'_n',
'_nx',
'_n_noop',
'_nx_noop',
'esc_html__',
'esc_html_e',
'esc_html_x',
'esc_attr__',
'esc_attr_e',
'esc_attr_x',
],
},
},
extractComments: false,
} ),
],
},
devtool: process.env.NODE_ENV === 'development' ? 'source-map' : false,
mode: process.env.NODE_ENV === 'development' ? 'development' : 'production',
},
},
uglify: {
Expand All @@ -229,43 +385,59 @@ module.exports = {
allowEmpty: true,
},
dest: {},
checktextdomain: {
...translatePipes.checktextdomain,
text_domain: areas.constructWp.name,
},
pot: {
...translatePipes.pot,
domain: areas.constructWp.name,
package: areas.constructWp.title,
relativeTo: areas.constructWp.path,
},
},
},
],
pipes: {
checktextdomain: {
text_domain: areas.constructWp.name,
keywords: [
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d',
'esc_html__:1,2d',
'esc_html_e:1,2d',
'esc_html_x:1,2c,3d',
'esc_attr__:1,2d',
'esc_attr_e:1,2d',
'esc_attr_x:1,2c,3d',
],
report_missing: true,
report_success: false,
report_variable_domain: true,
correct_domain: true,
create_report_file: false,
force: false,
},
pot: {
domain: areas.constructWp.name,
package: areas.constructWp.title,
lastTranslator: `${pkg.author.name} <${pkg.author.email}>`,
headers: {
'Language-Team': `${pkg.author.name} <${pkg.author.email}>`,
{
paths: {
src: `${areas.constructWp.path}/assets/js/**/*.js`,
watch: `${areas.constructWp.path}/assets/js/**/*.js`,
dest: `${areas.constructWp.path}/languages/js/${areas.constructWp.name}.pot`,
},
pipes: {
// Put any pipe overrides here
src: {
allowEmpty: true,
},
dest: {},
checktextdomain: {
...translatePipes.checktextdomain,
text_domain: areas.constructWp.name,
},
pot: {
...translatePipes.pot,
domain: areas.constructWp.name,
package: areas.constructWp.title,
relativeTo: areas.constructWp.path,
parser: 'js',
parserOptions: {
ecmaVersion: 9,
},
},
},
},
],
pipes: translatePipes,
},
po2json: {
process: true,
watch: true,
paths: [
`${areas.constructWp.path}/languages/**/*.po`,
],
bin: 'vendor/bin/wp',
pretty: true,
execSync: {
shell: 'C:\\Program Files\\Git\\bin\\bash.exe',
},
},
browsersync: {
Expand All @@ -275,8 +447,9 @@ module.exports = {
port: 4000,
ui: false,
files: [
'**/*',
'!**/src/**/*'
'plugins/**/*',
'themes/**/*',
'!**/src/**/*',
],
ghostmode: false,
open: false,
Expand Down
54 changes: 54 additions & 0 deletions .vscode/bookmarks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"files": [
{
"path": ".gulpconfig.js",
"bookmarks": [
{
"line": 7,
"column": 18,
"label": "Version number"
}
]
},
{
"path": "plugins/construct-wp/construct-wp.php",
"bookmarks": [
{
"line": 5,
"column": 22,
"label": "Version number"
},
{
"line": 34,
"column": 24,
"label": "Version number"
}
]
},
{
"path": "plugins/construct-wp/README.txt",
"bookmarks": [
{
"line": 6,
"column": 12,
"label": "Version number"
},
{
"line": 49,
"column": 0,
"label": "Changelog"
}
]
},
{
"path": "README.md",
"bookmarks": [
{
"line": 37,
"column": 0,
"label": "Changelog"
}
]
}
]
}
Loading