generator-chisel 2.0.0-alpha.3 → 2.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/.gitignore.chisel-tpl +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Assets.php +25 -17
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/RegisterBlocks.php +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/slider.twig +4 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/login.js +5 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/theme.json +6 -16
- package/lib/commands/create/creators/app/chisel-starter-theme/twig_cs.php +6 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/404.twig +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/slider.twig +1 -1
- package/lib/commands/create/creators/wp-plugins/plugins.json +1 -3
- package/lib/commands/create/packages-versions.js +1 -1
- package/package.json +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/lint-staged.config.mjs +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- INSERT-NEW-ENTRIES-HERE -->
|
|
4
4
|
|
|
5
|
+
## 2.0.0-alpha.4 (2024-09-16)
|
|
6
|
+
|
|
7
|
+
- adjust plugins ([bc2343a](https://github.com/xfiveco/generator-chisel/commit/bc2343a))
|
|
8
|
+
- bug fixes, phpcs and twigcs fixes ([118297b](https://github.com/xfiveco/generator-chisel/commit/118297b))
|
|
9
|
+
- remove lint staged (it is in coding standards) ([e51b4b6](https://github.com/xfiveco/generator-chisel/commit/e51b4b6))
|
|
10
|
+
- remove unnecessary gitignore ([f48e528](https://github.com/xfiveco/generator-chisel/commit/f48e528))
|
|
11
|
+
- scripts enqueueing fixes ([5a8badf](https://github.com/xfiveco/generator-chisel/commit/5a8badf))
|
|
12
|
+
- theme gitignore update ([9ef8d60](https://github.com/xfiveco/generator-chisel/commit/9ef8d60))
|
|
13
|
+
- twig cs adjustments ([84493cd](https://github.com/xfiveco/generator-chisel/commit/84493cd))
|
|
14
|
+
|
|
5
15
|
## 2.0.0-alpha.3 (2024-09-13)
|
|
6
16
|
|
|
7
17
|
- refactor, adjustments, css spliting, comments, 3rd party integration classes ([e1fe3cd](https://github.com/xfiveco/generator-chisel/commit/e1fe3cd))
|
|
@@ -127,7 +127,7 @@ class Assets implements Instance {
|
|
|
127
127
|
'localize' => array(
|
|
128
128
|
'name' => 'chiselScripts',
|
|
129
129
|
'data' => array(
|
|
130
|
-
'
|
|
130
|
+
'logoUrl' => Helpers::get_login_page_logo_url(),
|
|
131
131
|
),
|
|
132
132
|
),
|
|
133
133
|
),
|
|
@@ -259,9 +259,10 @@ class Assets implements Instance {
|
|
|
259
259
|
if ( $this->frontend_styles ) {
|
|
260
260
|
foreach ( $this->frontend_styles as $handle => $args ) {
|
|
261
261
|
$enqueue_style = apply_filters( 'chisel_enqueue_frontend_style', true, $handle, $args );
|
|
262
|
+
$style_handle = self::get_final_handle( $handle );
|
|
262
263
|
|
|
263
|
-
if ( $enqueue_style ) {
|
|
264
|
-
wp_enqueue_style(
|
|
264
|
+
if ( $enqueue_style && wp_style_is( $style_handle, 'registered' ) ) {
|
|
265
|
+
wp_enqueue_style( $style_handle );
|
|
265
266
|
|
|
266
267
|
// Enqueue js file for fast refresh of the css file.
|
|
267
268
|
$this->enqueue_style_js_for_dev( $handle );
|
|
@@ -272,9 +273,10 @@ class Assets implements Instance {
|
|
|
272
273
|
if ( $this->frontend_scripts ) {
|
|
273
274
|
foreach ( $this->frontend_scripts as $handle => $args ) {
|
|
274
275
|
$enqueue_script = apply_filters( 'chisel_enqueue_frontend_script', true, $handle, $args );
|
|
276
|
+
$script_handle = self::get_final_handle( $handle );
|
|
275
277
|
|
|
276
|
-
if ( $enqueue_script ) {
|
|
277
|
-
wp_enqueue_script(
|
|
278
|
+
if ( $enqueue_script && wp_script_is( $script_handle, 'registered' ) ) {
|
|
279
|
+
wp_enqueue_script( $script_handle );
|
|
278
280
|
$this->set_script_translations( $handle, $args );
|
|
279
281
|
}
|
|
280
282
|
}
|
|
@@ -291,9 +293,10 @@ class Assets implements Instance {
|
|
|
291
293
|
if ( $this->admin_styles ) {
|
|
292
294
|
foreach ( $this->admin_styles as $handle => $args ) {
|
|
293
295
|
$enqueue_style = apply_filters( 'chisel_enqueue_admin_style', true, $handle, $args );
|
|
296
|
+
$style_handle = self::get_final_handle( $handle );
|
|
294
297
|
|
|
295
|
-
if ( $enqueue_style ) {
|
|
296
|
-
wp_enqueue_style(
|
|
298
|
+
if ( $enqueue_style && wp_style_is( $style_handle, 'registered' ) ) {
|
|
299
|
+
wp_enqueue_style( $style_handle );
|
|
297
300
|
|
|
298
301
|
// Enqueue js file for fast refresh of the css file.
|
|
299
302
|
$this->enqueue_style_js_for_dev( $handle );
|
|
@@ -304,9 +307,10 @@ class Assets implements Instance {
|
|
|
304
307
|
if ( $this->admin_scripts ) {
|
|
305
308
|
foreach ( $this->admin_scripts as $handle => $args ) {
|
|
306
309
|
$enqueue_script = apply_filters( 'chisel_enqueue_admin_script', true, $handle, $args );
|
|
310
|
+
$script_handle = self::get_final_handle( $handle );
|
|
307
311
|
|
|
308
|
-
if ( $enqueue_script ) {
|
|
309
|
-
wp_enqueue_script(
|
|
312
|
+
if ( $enqueue_script && wp_script_is( $script_handle, 'registered' ) ) {
|
|
313
|
+
wp_enqueue_script( $script_handle );
|
|
310
314
|
$this->set_script_translations( $handle, $args );
|
|
311
315
|
}
|
|
312
316
|
}
|
|
@@ -323,9 +327,10 @@ class Assets implements Instance {
|
|
|
323
327
|
if ( $this->editor_styles ) {
|
|
324
328
|
foreach ( $this->editor_styles as $handle => $args ) {
|
|
325
329
|
$enqueue_style = apply_filters( 'chisel_enqueue_editor_style', true, $handle, $args );
|
|
330
|
+
$style_handle = self::get_final_handle( $handle );
|
|
326
331
|
|
|
327
|
-
if ( $enqueue_style ) {
|
|
328
|
-
wp_enqueue_style(
|
|
332
|
+
if ( $enqueue_style && wp_style_is( $style_handle, 'registered' ) ) {
|
|
333
|
+
wp_enqueue_style( $style_handle );
|
|
329
334
|
|
|
330
335
|
// Enqueue js file for fast refresh of the css file.
|
|
331
336
|
$this->enqueue_style_js_for_dev( $handle );
|
|
@@ -336,9 +341,10 @@ class Assets implements Instance {
|
|
|
336
341
|
if ( $this->editor_scripts ) {
|
|
337
342
|
foreach ( $this->editor_scripts as $handle => $args ) {
|
|
338
343
|
$enqueue_script = apply_filters( 'chisel_enqueue_editor_script', true, $handle, $args );
|
|
344
|
+
$script_handle = self::get_final_handle( $handle );
|
|
339
345
|
|
|
340
|
-
if ( $enqueue_script ) {
|
|
341
|
-
wp_enqueue_script(
|
|
346
|
+
if ( $enqueue_script && wp_script_is( $script_handle, 'registered' ) ) {
|
|
347
|
+
wp_enqueue_script( $script_handle );
|
|
342
348
|
$this->set_script_translations( $handle, $args );
|
|
343
349
|
}
|
|
344
350
|
}
|
|
@@ -364,9 +370,10 @@ class Assets implements Instance {
|
|
|
364
370
|
if ( $this->login_styles ) {
|
|
365
371
|
foreach ( $this->login_styles as $handle => $args ) {
|
|
366
372
|
$enqueue_style = apply_filters( 'chisel_enqueue_login_style', true, $handle, $args );
|
|
373
|
+
$style_handle = self::get_final_handle( $handle );
|
|
367
374
|
|
|
368
|
-
if ( $enqueue_style ) {
|
|
369
|
-
wp_enqueue_style(
|
|
375
|
+
if ( $enqueue_style && wp_style_is( $style_handle, 'registered' ) ) {
|
|
376
|
+
wp_enqueue_style( $style_handle );
|
|
370
377
|
|
|
371
378
|
// Enqueue js file for fast refresh of the css file.
|
|
372
379
|
$this->enqueue_style_js_for_dev( $handle );
|
|
@@ -377,9 +384,10 @@ class Assets implements Instance {
|
|
|
377
384
|
if ( $this->login_scripts ) {
|
|
378
385
|
foreach ( $this->login_scripts as $handle => $args ) {
|
|
379
386
|
$enqueue_script = apply_filters( 'chisel_enqueue_login_script', true, $handle, $args );
|
|
387
|
+
$script_handle = self::get_final_handle( $handle );
|
|
380
388
|
|
|
381
|
-
if ( $enqueue_script ) {
|
|
382
|
-
wp_enqueue_script(
|
|
389
|
+
if ( $enqueue_script && wp_script_is( $script_handle, 'registered' ) ) {
|
|
390
|
+
wp_enqueue_script( $script_handle );
|
|
383
391
|
$this->set_script_translations( $handle, $args );
|
|
384
392
|
}
|
|
385
393
|
}
|
package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/slider.twig
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{% set
|
|
1
|
+
{% set slides_html = '' %}
|
|
2
2
|
|
|
3
3
|
<div {{ wrapper_attributes }} data-block-id="{{ block.id }}">
|
|
4
4
|
<div class="b-slider__inner alignfull">
|
|
5
5
|
{% if fields.acf_block_slider_slides is not empty %}
|
|
6
6
|
{% for slide in fields.acf_block_slider_slides %}
|
|
7
7
|
{% if slide.acf_bs_image %}
|
|
8
|
-
{% set
|
|
9
|
-
{{
|
|
8
|
+
{% set slides_html %}
|
|
9
|
+
{{ slides_html }}
|
|
10
10
|
<div class="b-slider__slide swiper-slide" data-thumbnail-url="{{ get_image(slide.acf_bs_image).src('medium') }}">
|
|
11
11
|
{{ get_responsive_image(slide.acf_bs_image, 'large') }}
|
|
12
12
|
</div>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
{% endfor %}
|
|
16
16
|
|
|
17
17
|
{% include 'components/slider.twig' with {
|
|
18
|
-
|
|
18
|
+
slides_html,
|
|
19
19
|
params: {
|
|
20
20
|
'slides-per-view': 1,
|
|
21
21
|
block_settings: fields.slider_options
|
|
@@ -13,13 +13,16 @@ class LoginPage {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
this.logo = this.loginPage.querySelector('#login h1 a');
|
|
16
|
+
this.logoUrl = chiselScripts?.logoUrl;
|
|
16
17
|
|
|
17
|
-
this.
|
|
18
|
+
if (this.logoUrl) {
|
|
19
|
+
this.setLogoImage();
|
|
20
|
+
}
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
setLogoImage() {
|
|
21
24
|
if (this.logo) {
|
|
22
|
-
this.logo.setAttribute('style', `background-image: url("${
|
|
25
|
+
this.logo.setAttribute('style', `background-image: url("${this.logoUrl}");`);
|
|
23
26
|
this.logo.setAttribute('aria-hidden', 'true');
|
|
24
27
|
this.logo.parentElement.classList.add(this.classnames.loaded);
|
|
25
28
|
}
|
|
@@ -78,10 +78,7 @@
|
|
|
78
78
|
],
|
|
79
79
|
"duotone": [
|
|
80
80
|
{
|
|
81
|
-
"colors": [
|
|
82
|
-
"#2a1468",
|
|
83
|
-
"#ff6d54"
|
|
84
|
-
],
|
|
81
|
+
"colors": ["#2a1468", "#ff6d54"],
|
|
85
82
|
"slug": "primary-secondary",
|
|
86
83
|
"name": "Primary & Secondary"
|
|
87
84
|
}
|
|
@@ -185,7 +182,7 @@
|
|
|
185
182
|
"fontStyle": "normal",
|
|
186
183
|
"fontStretch": "normal",
|
|
187
184
|
"fontDisplay": "swap",
|
|
188
|
-
"src": [
|
|
185
|
+
"src": ["file:./assets/fonts/quicksand-regular.woff2"]
|
|
189
186
|
},
|
|
190
187
|
{
|
|
191
188
|
"fontFamily": "Quicksand",
|
|
@@ -193,7 +190,7 @@
|
|
|
193
190
|
"fontStyle": "normal",
|
|
194
191
|
"fontStretch": "normal",
|
|
195
192
|
"fontDisplay": "swap",
|
|
196
|
-
"src": [
|
|
193
|
+
"src": ["file:./assets/fonts/quicksand-700.woff2"]
|
|
197
194
|
}
|
|
198
195
|
]
|
|
199
196
|
}
|
|
@@ -206,21 +203,14 @@
|
|
|
206
203
|
"width": false
|
|
207
204
|
},
|
|
208
205
|
"layout": {
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
"contentSize": "1200px",
|
|
207
|
+
"wideSize": "1440px"
|
|
211
208
|
},
|
|
212
209
|
"spacing": {
|
|
213
210
|
"blockGap": false,
|
|
214
211
|
"margin": false,
|
|
215
212
|
"padding": false,
|
|
216
|
-
"units": [
|
|
217
|
-
"%",
|
|
218
|
-
"px",
|
|
219
|
-
"em",
|
|
220
|
-
"rem",
|
|
221
|
-
"vh",
|
|
222
|
-
"vw"
|
|
223
|
-
],
|
|
213
|
+
"units": ["%", "px", "em", "rem", "vh", "vw"],
|
|
224
214
|
"defaultSpacingSizes": false,
|
|
225
215
|
"spacingScale": {
|
|
226
216
|
"operator": "+",
|
|
@@ -3,10 +3,14 @@ declare(strict_types=1);
|
|
|
3
3
|
|
|
4
4
|
use FriendsOfTwig\Twigcs;
|
|
5
5
|
|
|
6
|
-
$
|
|
6
|
+
$finder_1 = Twigcs\Finder\TemplateFinder::create()->in( __DIR__ . '/views' );
|
|
7
|
+
$finder_2 = Twigcs\Finder\TemplateFinder::create()->in( __DIR__ . '/build/blocks' );
|
|
8
|
+
$finder_3 = Twigcs\Finder\TemplateFinder::create()->in( __DIR__ . '/build/blocks-acf' );
|
|
7
9
|
|
|
8
10
|
return Twigcs\Config\Config::create()
|
|
9
|
-
->addFinder( $
|
|
11
|
+
->addFinder( $finder_1 )
|
|
12
|
+
->addFinder( $finder_2 )
|
|
13
|
+
->addFinder( $finder_3 )
|
|
10
14
|
->setName( 'chisel' )
|
|
11
15
|
->setSeverity( 'warning' )
|
|
12
16
|
->setDisplay( Twigcs\Config\ConfigInterface::DISPLAY_BLOCKING )
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{% extends "single.twig" %}
|
|
2
2
|
|
|
3
3
|
{% block inner_content %}
|
|
4
|
-
<h1>{{ __(
|
|
5
|
-
<h2>{{ __(
|
|
4
|
+
<h1>{{ __('404 - Not found', 'chisel') }}</h1>
|
|
5
|
+
<h2>{{ __('Sorry, we couldn\'t find what you\'re looking for', 'chisel') }}</h2>
|
|
6
6
|
{% endblock %}
|
|
7
7
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"plugins": {
|
|
3
|
-
"Classic Editor": "classic-editor",
|
|
4
3
|
"WP Premium: Gravity Forms": "https://github.com/wp-premium/gravityforms/archive/master.zip",
|
|
5
|
-
"WP
|
|
6
|
-
"WP Sync DB Media File Addon": "https://github.com/wp-sync-db/wp-sync-db-media-files/archive/master.zip"
|
|
4
|
+
"WP Migrate Lite": "wp-migrate-db"
|
|
7
5
|
}
|
|
8
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-chisel",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"description": "A generator for scaffolding front-end and WordPress projects",
|
|
5
5
|
"bin": {
|
|
6
6
|
"chisel": "bin/chisel.js"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"tinyqueue": "^2.0.3",
|
|
38
38
|
"update-notifier": "^4.1.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "1bc07b55d6086064ee99ae4feae40bd97d90b711"
|
|
41
41
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const listStagedConfig = {
|
|
2
|
-
'*.{cjs,mjs,js,jsx,ts,tsx}': ['eslint --fix'],
|
|
3
|
-
'*.vue': ['stylelint --fix', 'eslint --fix --allow-empty-input'],
|
|
4
|
-
'*.{json,md,yml}': ['prettier --write'],
|
|
5
|
-
'*.{css,scss}': ['stylelint --fix --allow-empty-input'],
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export default listStagedConfig;
|