generator-chisel 2.0.0-alpha.9 → 2.0.0
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 +53 -0
- package/bin/chisel.js +6 -0
- package/lib/commands/create/Creator.js +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/.gitignore.chisel-tpl +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/.nvmrc +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/404.php +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/README.md +37 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/acf-json/group_6772609e3c28c.json +83 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/acf-json/group_6772615562fb4.json +49 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/archive.php +2 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/block.json +31 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/edit.js +35 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/editor.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/index.js +45 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/save.js +20 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/script.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/style.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/view.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example/view.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/block.json +32 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/edit.js +33 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/editor.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/index.js +45 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/render.php +12 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/render.twig +5 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/save.js +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/script.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/style.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/view.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks/example-server-side/view.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/block.json +36 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/critical.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/editor.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/example.twig +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/index.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/init.php +0 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/script.js +8 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/style.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/view.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/example-blocks/blocks-acf/example/view.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/arrow-left.svg +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/arrow-right.svg +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/chisel-icon.svg +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/chisel-logo.svg +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/close-line.svg +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/color/chisel-icon.svg +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/color/chisel-logo.svg +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/color/facebook-logo.svg +10 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/color/instagram-logo.svg +14 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons-source/x-logo.svg +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/author.php +3 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/composer.json +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/footer.php +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/functions.php +18 -24
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factory/RegisterAcfOptionsPage.php +62 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/Factory}/RegisterBlocks.php +53 -22
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factory/RegisterCustomPostType.php +211 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factory/RegisterCustomTaxonomy.php +174 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/AcfHelpers.php +46 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/AjaxHelpers.php +33 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/AssetsHelpers.php +28 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/BlocksHelpers.php +118 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/CacheHelpers.php +41 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/CommentsHelpers.php +26 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/DataHelpers.php +35 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/GravityFormsHelpers.php +65 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/ImageHelpers.php +102 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes/Helpers.php → inc/Helper/ThemeHelpers.php} +53 -93
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/WoocommerceHelpers.php +72 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helper/YoastHelpers.php +37 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes/interfaces/Instance.php → inc/Interfaces/HooksInterface.php} +3 -8
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Interfaces/InstanceInterface.php +16 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/Module}/AcfSync.php +13 -20
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/Module}/Ajax.php +16 -41
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/Plugin}/GravityForms.php +15 -72
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/Plugin}/Woocommerce.php +26 -80
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Plugin/Yoast.php +46 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Traits/PageBlocks.php +92 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Traits/Singleton.php +23 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Acf.php +118 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/AcfBlocks.php +62 -61
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/AjaxEnpoints.php +6 -6
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Assets.php +258 -119
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Blocks.php +63 -51
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Cache.php +103 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes/ExtendedImage.php → inc/WP/ChiselImage.php} +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes/ExtendedPost.php → inc/WP/ChiselPost.php} +4 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes/ExtendedProduct.php → inc/WP/ChiselProduct.php} +4 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes/ExtendedTerm.php → inc/WP/ChiselTerm.php} +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Comments.php +10 -32
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Components.php +61 -36
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/CustomPostTypes.php +124 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/CustomTaxonomies.php +129 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Sidebars.php +11 -17
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Site.php +15 -21
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Theme.php +22 -15
- package/lib/commands/create/creators/app/chisel-starter-theme/{classes → inc/WP}/Twig.php +34 -21
- package/lib/commands/create/creators/app/chisel-starter-theme/index.php +2 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/package.chisel-tpl.json +5 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/page.php +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/phpcs.xml +5 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/search.php +3 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/single.php +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/accordion-item.js +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks/accordion/style.scss +12 -5
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/acf-json/group_66462c70b851f.json +107 -105
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/block.json +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/slider.twig +4 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/settings/_index.scss +2 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_buttons.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_icon.scss +39 -7
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_index.scss +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_layout.scss +11 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/admin/acf.js +65 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/app.js +2 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/blocks.js +10 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/mods/core-button.js +13 -9
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/utils.js +0 -12
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/loaded.js +7 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/admin.scss +2 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-button.scss +14 -13
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_buttons.scss +14 -13
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_icons-preview.scss +97 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_main-nav.scss +19 -9
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_posts-items.scss +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_icon.scss +51 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_layout.scss +0 -13
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-admin/_acf.scss +29 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-admin/_index.scss +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/style.chisel-tpl.css +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/base.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/header.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/{partials → components}/logo.twig +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/main-nav-item.twig +2 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/main-nav.twig +5 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/pagination.twig +70 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/slider.twig +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/{partials → components}/the-title.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/index.twig +10 -5
- package/lib/commands/create/creators/app/chisel-starter-theme/views/objects/icon.twig +37 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/partials/icons-preview.twig +81 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/sidebar-blog.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/sidebar-woocommerce.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/single.twig +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/archive-product.twig +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/linked-products.twig +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/single-product.twig +4 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/woocommerce.php +6 -6
- package/lib/commands/create/creators/app/index.js +74 -20
- package/lib/commands/create/creators/app/template/.devcontainer/Dockerfile +21 -0
- package/lib/commands/create/creators/app/template/.devcontainer/compose.chisel-tpl +3 -0
- package/lib/commands/create/creators/app/template/.devcontainer/devcontainer.json.chisel-tpl +31 -0
- package/lib/commands/create/creators/app/template/.devcontainer/docker-compose.yml.chisel-tpl +40 -0
- package/lib/commands/create/creators/app/template/.devcontainer/exec +8 -0
- package/lib/commands/create/creators/app/template/.devcontainer/post-create-command.sh.chisel-tpl +24 -0
- package/lib/commands/create/creators/devcontainer.js +62 -0
- package/lib/commands/create/creators/utils.js +58 -0
- package/lib/commands/create/creators/wp/index.js +24 -3
- package/lib/commands/create/creators/wp-plugins/plugins.json +1 -1
- package/lib/commands/create/index.js +9 -2
- package/lib/commands/create/packages-versions.js +3 -3
- package/package.json +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Acf.php +0 -188
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/ChiselCache.php +0 -87
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/CustomPostTypes.php +0 -444
- package/lib/commands/create/creators/app/chisel-starter-theme/classes/Yoast.php +0 -78
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_icon.scss +0 -19
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/icon.twig +0 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/partials/pagination.twig +0 -70
- /package/lib/commands/create/creators/app/chisel-starter-theme/assets/icons/{loader.svg → animated/loader.svg} +0 -0
- /package/lib/commands/create/creators/app/chisel-starter-theme/assets/{icons → icons-source}/minus.svg +0 -0
- /package/lib/commands/create/creators/app/chisel-starter-theme/assets/{icons → icons-source}/plus.svg +0 -0
package/lib/commands/create/creators/app/chisel-starter-theme/views/partials/icons-preview.twig
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<section class="o-wrapper__inner c-icons-preview">
|
|
2
|
+
<h2>Icons preview</h2>
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<article class="c-icons-preview__article">
|
|
6
|
+
<h3>Icons HTML usage example</h3>
|
|
7
|
+
|
|
8
|
+
<section class="c-icons-preview__section">
|
|
9
|
+
<h4 class="c-icons-preview__h4">Monochromatic</h4>
|
|
10
|
+
<div style="font-size: 2rem;">
|
|
11
|
+
{% include 'objects/icon.twig' with {name: 'chisel-logo', rectangle: true, alt: 'Chisel logo'} %}
|
|
12
|
+
{% include 'objects/icon.twig' with {name: 'x-logo', inline: true} %}
|
|
13
|
+
{% include 'objects/icon.twig' with {name: 'color-pallet', forceMono: true, inline: true} %}
|
|
14
|
+
{% include 'objects/icon.twig' with {name: 'chisel-icon', forceMono: true, inline: true} %}
|
|
15
|
+
<span style="font-size: 4rem">{% include 'objects/icon.twig' with {name: 'chisel-icon', forceMono: true, inline: true} %}</span>
|
|
16
|
+
<span style="display: inline-block;padding: 1rem; background: rgba(0, 0, 255, 20%);">
|
|
17
|
+
{% include 'objects/icon.twig' with {name: 'chisel-icon'} %}
|
|
18
|
+
</span>
|
|
19
|
+
<span style="display: inline-block; color: green">
|
|
20
|
+
{% include 'objects/icon.twig' with {name: 'chisel-icon'} %}
|
|
21
|
+
</span>
|
|
22
|
+
<span style="display: block; color: blue; font-size: 1.2rem; --o-icon-color: red; --o-icon-size: 2rem">
|
|
23
|
+
Blue text with red icon: {% include 'objects/icon.twig' with {name: 'chisel-icon', inline: true} %}
|
|
24
|
+
</span>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
27
|
+
|
|
28
|
+
<section class="c-icons-preview__section">
|
|
29
|
+
<h4 class="c-icons-preview__h4">Multicolor</h4>
|
|
30
|
+
<div style="font-size: 2rem;">
|
|
31
|
+
{% include 'objects/icon.twig' with {name: 'color-chisel-logo', alt: 'Chisel logo ALT', rectangle: true, inline: true} %}
|
|
32
|
+
{% include 'objects/icon.twig' with {name: 'color-facebook-logo', inline: true} %}
|
|
33
|
+
{% include 'objects/icon.twig' with {name: 'color-chisel-icon', inline: true} %}
|
|
34
|
+
<span style="font-size: 4rem">
|
|
35
|
+
{% include 'objects/icon.twig' with {name: 'color-chisel-icon', inline: true} %}
|
|
36
|
+
</span>
|
|
37
|
+
<span style="display: inline-block;padding: 1rem; background: rgba(0, 0, 255, 20%);">
|
|
38
|
+
{% include 'objects/icon.twig' with {name: 'color-chisel-icon', inline: false} %}
|
|
39
|
+
</span>
|
|
40
|
+
</div>
|
|
41
|
+
</section>
|
|
42
|
+
</article>
|
|
43
|
+
|
|
44
|
+
<article class="c-icons-preview__article">
|
|
45
|
+
<h3>Icons CSS usage example</h3>
|
|
46
|
+
|
|
47
|
+
<section class="c-icons-preview__section">
|
|
48
|
+
<h4 class="c-icons-preview__h4">Monochromatic</h4>
|
|
49
|
+
<div style="font-size: 2rem;">
|
|
50
|
+
<i class="c-icons-preview__css-icon1"></i>
|
|
51
|
+
<i class="c-icons-preview__css-icon2"></i>
|
|
52
|
+
<i class="c-icons-preview__css-icon3"></i>
|
|
53
|
+
<i class="c-icons-preview__css-icon4"></i>
|
|
54
|
+
<i class="c-icons-preview__css-icon5"></i>
|
|
55
|
+
<i class="c-icons-preview__css-icon6"></i>
|
|
56
|
+
<i class="c-icons-preview__css-icon7"></i>
|
|
57
|
+
<div style="display: block; color: blue; font-size: 1.2rem;">
|
|
58
|
+
Blue text with red icon: <i class="c-icons-preview__css-icon8"></i>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</section>
|
|
62
|
+
|
|
63
|
+
<section class="c-icons-preview__section">
|
|
64
|
+
<h4 class="c-icons-preview__h4">Multicolor</h4>
|
|
65
|
+
<div style="font-size: 2rem;">
|
|
66
|
+
<i class="c-icons-preview__css-color-icon1"></i>
|
|
67
|
+
<i class="c-icons-preview__css-color-icon2"></i>
|
|
68
|
+
<i class="c-icons-preview__css-color-icon3"></i>
|
|
69
|
+
<i class="c-icons-preview__css-color-icon4"></i>
|
|
70
|
+
<i class="c-icons-preview__css-color-icon5"></i>
|
|
71
|
+
</div>
|
|
72
|
+
</section>
|
|
73
|
+
</article>
|
|
74
|
+
|
|
75
|
+
<!-- TODO: list all of the available icons -->
|
|
76
|
+
<article class="c-icons-preview__article">
|
|
77
|
+
<h3>All available icons</h3>
|
|
78
|
+
<section class="c-icons-preview__section">TODO :)</section>
|
|
79
|
+
</article>
|
|
80
|
+
|
|
81
|
+
</section>
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
<section class="o-wrapper__inner c-post__inner {{ wrapper_class }}">
|
|
6
6
|
|
|
7
7
|
<div class="o-layout c-content{% if sidebar %} has-sidebar{% endif %}">
|
|
8
|
-
<div class="
|
|
8
|
+
<div class="{{ bem('o-layout__item', (sidebar ? '8' : '12') ~ '-large') }} c-content__inner">
|
|
9
9
|
|
|
10
|
-
{
|
|
10
|
+
{% include 'components/the-title.twig' %}
|
|
11
11
|
|
|
12
12
|
{% block inner_content %}
|
|
13
13
|
|
package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/archive-product.twig
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{% do action('woocommerce_before_shop_loop') %}
|
|
33
33
|
|
|
34
34
|
<div class="o-layout">
|
|
35
|
-
<div class="
|
|
35
|
+
<div class="{{ bem('o-layout__item', (sidebar ? '8' : '12') ~ '-large') }}">
|
|
36
36
|
<div class="c-posts-items c-shop-items {{ loop_columns_class }} js-load-more-container">
|
|
37
37
|
{% if products is not empty %}
|
|
38
38
|
{% for post in products %}
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</div>
|
|
63
63
|
|
|
64
64
|
{% if products is not empty %}
|
|
65
|
-
{% include '
|
|
65
|
+
{% include 'components/pagination.twig' with {type: 'load-more'} %}
|
|
66
66
|
{% endif %}
|
|
67
67
|
</div>
|
|
68
68
|
|
package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/linked-products.twig
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<div class="o-layout
|
|
1
|
+
<div class="o-layout {{ bem('c-product-linked', linked_type|default('related')) }}">
|
|
2
2
|
{% if linked_title %}
|
|
3
3
|
<div class="o-layout__item">
|
|
4
4
|
<h2 class="c-product-linked__title">{{ linked_title }}</h2>
|
|
5
5
|
</div>
|
|
6
6
|
{% endif %}
|
|
7
7
|
|
|
8
|
-
<div class="
|
|
8
|
+
<div class="{{ bem('o-layout__item', (sidebar ? '8' : '12') ~ '-large') }}">
|
|
9
9
|
<div class="c-product-linked__items {{ grid_classnames }}">
|
|
10
10
|
{% for post in linked_products %}
|
|
11
11
|
{% include "woocommerce/content-product.twig" with {post: post} %}
|
package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/single-product.twig
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
{% do action('woocommerce_before_single_product') %}
|
|
6
6
|
|
|
7
7
|
<article id="post-{{ post.ID }}" itemscope itemtype="https://schema.org/Product" class="{{ post_classes(post.class) }}">
|
|
8
|
-
<section class="o-wrapper__inner {{ wrapper_class }}
|
|
8
|
+
<section class="o-wrapper__inner {{ wrapper_class }} {{ bem('c-post', post.type|default('page')) }}">
|
|
9
9
|
|
|
10
10
|
<div class="o-layout c-content{% if sidebar %} has-sidebar{% endif %} product">
|
|
11
|
-
<div class="
|
|
11
|
+
<div class="{{ bem('o-layout__item', (sidebar ? '8' : '12') ~ '-large') }} c-content__inner">
|
|
12
12
|
|
|
13
13
|
<div class="o-layout c-product__inner">
|
|
14
|
-
<div class="c-product__gallery o-layout__item
|
|
14
|
+
<div class="c-product__gallery {{ bem('o-layout__item', '6-large') }}">
|
|
15
15
|
{#
|
|
16
16
|
* Hook: woocommerce_before_single_product_summary.
|
|
17
17
|
*
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
{% do action('woocommerce_before_single_product_summary') %}
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
|
-
<div class="c-product__summary o-layout__item
|
|
24
|
+
<div class="c-product__summary {{ bem('o-layout__item', '6-large') }}">
|
|
25
25
|
{#
|
|
26
26
|
* Hook: woocommerce_single_product_summary.
|
|
27
27
|
*
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* @package Chisel
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
use Chisel\ChiselCache;
|
|
9
|
-
use Chisel\Woocommerce;
|
|
10
8
|
use Timber\Timber;
|
|
9
|
+
use Chisel\Helper\CacheHelpers;
|
|
10
|
+
use Chisel\Helper\WoocommerceHelpers;
|
|
11
11
|
|
|
12
12
|
$context = Timber::context();
|
|
13
13
|
|
|
@@ -25,19 +25,19 @@ if ( is_singular( 'product' ) ) {
|
|
|
25
25
|
$context['upsells_products'] = $upsells_ids ? Timber::get_posts( $upsells_ids ) : array();
|
|
26
26
|
$context['related_products'] = $related_ids ? Timber::get_posts( $related_ids ) : array();
|
|
27
27
|
$context['wrapper_class'] = 'c-product';
|
|
28
|
-
$context['grid_classnames'] =
|
|
28
|
+
$context['grid_classnames'] = WoocommerceHelpers::get_products_grid_classnames( true, false );
|
|
29
29
|
|
|
30
30
|
// Restore the context and loop back to the main query loop.
|
|
31
31
|
wp_reset_postdata();
|
|
32
32
|
|
|
33
|
-
Timber::render( 'woocommerce/single-product.twig', $context,
|
|
33
|
+
Timber::render( 'woocommerce/single-product.twig', $context, CacheHelpers::expiry() );
|
|
34
34
|
} else {
|
|
35
35
|
$products = Timber::get_posts();
|
|
36
36
|
$has_sidebar = ! empty( $context['sidebar'] );
|
|
37
37
|
$loop_columns = wc_get_loop_prop( 'columns' );
|
|
38
38
|
$loop_rows = wc_get_default_product_rows_per_page();
|
|
39
39
|
|
|
40
|
-
$grid_classnames =
|
|
40
|
+
$grid_classnames = WoocommerceHelpers::get_products_grid_classnames( $products, $has_sidebar );
|
|
41
41
|
|
|
42
42
|
$context['products'] = $products;
|
|
43
43
|
$context['loop_columns_class'] = $grid_classnames;
|
|
@@ -53,5 +53,5 @@ if ( is_singular( 'product' ) ) {
|
|
|
53
53
|
$context['title'] = single_term_title( '', false );
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
Timber::render( 'woocommerce/archive-product.twig', $context,
|
|
56
|
+
Timber::render( 'woocommerce/archive-product.twig', $context, CacheHelpers::expiry() );
|
|
57
57
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const { startCase } = require('lodash');
|
|
3
|
-
const speakingUrl = require('speakingurl');
|
|
4
3
|
const {
|
|
5
4
|
execa,
|
|
6
5
|
run,
|
|
@@ -8,6 +7,8 @@ const {
|
|
|
8
7
|
installDependencies,
|
|
9
8
|
} = require('chisel-shared-utils');
|
|
10
9
|
const packagesVersions = require('../../packages-versions');
|
|
10
|
+
const { prepareName, getDevcontainerBaseImageVersion } = require('../utils');
|
|
11
|
+
const fs = require('fs/promises');
|
|
11
12
|
|
|
12
13
|
module.exports = async (api) => {
|
|
13
14
|
let app;
|
|
@@ -20,27 +21,40 @@ module.exports = async (api) => {
|
|
|
20
21
|
timeout: 2000,
|
|
21
22
|
}).catch(() => ({}));
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
const { devcontainerComplete } = api.creator.data;
|
|
25
|
+
|
|
26
|
+
app = await api.prompt(
|
|
27
|
+
[
|
|
28
|
+
!devcontainerComplete && {
|
|
29
|
+
name: 'name',
|
|
30
|
+
message: 'Please enter the project name:',
|
|
31
|
+
default: () => startCase(path.basename(process.cwd())),
|
|
32
|
+
validate: (val) => Boolean(val),
|
|
33
|
+
},
|
|
34
|
+
!devcontainerComplete && {
|
|
35
|
+
type: 'number',
|
|
36
|
+
name: 'devcontainerPort',
|
|
37
|
+
message: 'Enter the devcontainer port:',
|
|
38
|
+
default: 3000,
|
|
39
|
+
validate: (val) => Boolean(val),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'author',
|
|
43
|
+
message: 'Please enter author name:',
|
|
44
|
+
default: async () => (await userName).stdout,
|
|
45
|
+
validate: (val) => Boolean(val),
|
|
46
|
+
},
|
|
47
|
+
].filter(Boolean),
|
|
48
|
+
);
|
|
36
49
|
|
|
37
|
-
app.nameSlug = speakingUrl(app.name)
|
|
38
|
-
.replace(/(?<=[^\d])-(\d+)/g, (_, d) => d)
|
|
39
|
-
.replace(/[^a-z0-9-]/g, '-');
|
|
40
|
-
// app.nameCamel = camelCase(app.nameSlug);
|
|
41
50
|
app.hasJQuery = false;
|
|
42
|
-
app.
|
|
43
|
-
|
|
51
|
+
app.devcontainerBaseImageVersion = await getDevcontainerBaseImageVersion();
|
|
52
|
+
|
|
53
|
+
if (devcontainerComplete) {
|
|
54
|
+
Object.assign(app, devcontainerComplete);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Object.assign(app, prepareName(app.name));
|
|
44
58
|
|
|
45
59
|
await api.creator.loadCreator('wp');
|
|
46
60
|
});
|
|
@@ -86,6 +100,46 @@ module.exports = async (api) => {
|
|
|
86
100
|
{ cwd: api.resolve(app.themePath) },
|
|
87
101
|
);
|
|
88
102
|
|
|
103
|
+
await api.modifyFile(
|
|
104
|
+
'.devcontainer/devcontainer.json',
|
|
105
|
+
async (body) => {
|
|
106
|
+
const extensionsText = await fs.readFile(
|
|
107
|
+
api.resolve(app.themePath, '.vscode/extensions.json'),
|
|
108
|
+
'utf8',
|
|
109
|
+
);
|
|
110
|
+
const { recommendations } = JSON.parse(extensionsText);
|
|
111
|
+
|
|
112
|
+
return body.replace(
|
|
113
|
+
/ +\/\/ EXTENSIONS-FROM-VSCODE-EXTENSIONS-FILE/,
|
|
114
|
+
recommendations
|
|
115
|
+
.map((ext) => ` ${JSON.stringify(ext)}`)
|
|
116
|
+
.join(',\n'),
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
{ isJson: false },
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const preCommitPath = api.resolve(app.themePath, '.husky/pre-commit');
|
|
123
|
+
|
|
124
|
+
if (
|
|
125
|
+
await fs
|
|
126
|
+
.access(preCommitPath)
|
|
127
|
+
.then(() => true)
|
|
128
|
+
.catch(() => false)
|
|
129
|
+
) {
|
|
130
|
+
await api.modifyFile(preCommitPath, (body) => {
|
|
131
|
+
const str = [
|
|
132
|
+
'',
|
|
133
|
+
'if [ -f .use-devcontainer ]; then',
|
|
134
|
+
' alias npx="/usr/bin/env bash ../../../.devcontainer/exec npx"',
|
|
135
|
+
'fi',
|
|
136
|
+
'',
|
|
137
|
+
].join('\n');
|
|
138
|
+
|
|
139
|
+
return body.replace('npx ', str + '\nnpx ');
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
89
143
|
if (api.creator.cmd.link) {
|
|
90
144
|
const availablePackages = Object.keys(packagesVersions);
|
|
91
145
|
const installedAndAvailable = installedPackages.filter((pkg) =>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
ARG BASE_IMAGE_VERSION
|
|
2
|
+
FROM wordpress:${BASE_IMAGE_VERSION}
|
|
3
|
+
|
|
4
|
+
ARG CHISEL_PORT=3000
|
|
5
|
+
|
|
6
|
+
# Install MariaDB Client
|
|
7
|
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
8
|
+
&& apt-get -y install --no-install-recommends mariadb-client
|
|
9
|
+
|
|
10
|
+
# Install WP CLI
|
|
11
|
+
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
|
|
12
|
+
&& chmod +x wp-cli.phar \
|
|
13
|
+
&& mv wp-cli.phar /usr/local/bin/wp
|
|
14
|
+
|
|
15
|
+
# Update port
|
|
16
|
+
RUN sed -i 's/80/${CHISEL_PORT}/' /etc/apache2/ports.conf
|
|
17
|
+
|
|
18
|
+
# Use wordpress user to run apache
|
|
19
|
+
ENV APACHE_RUN_USER wordpress
|
|
20
|
+
ENV APACHE_RUN_GROUP wordpress
|
|
21
|
+
ENV CHISEL_PORT=${CHISEL_PORT}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json.
|
|
2
|
+
{
|
|
3
|
+
"name": "WordPress Development",
|
|
4
|
+
"dockerComposeFile": "docker-compose.yml",
|
|
5
|
+
"service": "app",
|
|
6
|
+
// when changing workspace name or theme path, also update the docker-compose.yml file
|
|
7
|
+
"workspaceFolder": "/workspaces/<%= app.nameSlug %>/<%= app.themePath %>",
|
|
8
|
+
|
|
9
|
+
// Features to add to the dev container. More info: https://containers.dev/features.
|
|
10
|
+
"features": {
|
|
11
|
+
"ghcr.io/devcontainers/features/common-utils:2": {
|
|
12
|
+
"username": "wordpress"
|
|
13
|
+
},
|
|
14
|
+
"ghcr.io/devcontainers/features/node:1": {
|
|
15
|
+
"version": "20"
|
|
16
|
+
},
|
|
17
|
+
"ghcr.io/devcontainers/features/git:1": {}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"postCreateCommand": "bash ../../../.devcontainer/post-create-command.sh",
|
|
21
|
+
|
|
22
|
+
"remoteUser": "wordpress",
|
|
23
|
+
|
|
24
|
+
"customizations": {
|
|
25
|
+
"vscode": {
|
|
26
|
+
"extensions": [
|
|
27
|
+
// EXTENSIONS-FROM-VSCODE-EXTENSIONS-FILE
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: <%= app.nameSlug %>_devcontainer
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
app:
|
|
5
|
+
build:
|
|
6
|
+
context: .
|
|
7
|
+
dockerfile: Dockerfile
|
|
8
|
+
args:
|
|
9
|
+
# Keep this in sync with installed WordPress version and
|
|
10
|
+
# PHP version used in production
|
|
11
|
+
# See https://hub.docker.com/_/wordpress for available versions
|
|
12
|
+
BASE_IMAGE_VERSION: <%= app.devcontainerBaseImageVersion %>
|
|
13
|
+
CHISEL_PORT: <%= app.devcontainerPort %>
|
|
14
|
+
|
|
15
|
+
ports:
|
|
16
|
+
- '127.0.0.1:<%= app.devcontainerPort %>:<%= app.devcontainerPort %>' # should be CHISEL_PORT
|
|
17
|
+
- '127.0.0.1:<%= app.devcontainerPort + 1 %>:<%= app.devcontainerPort + 1 %>' # should be CHISEL_PORT + 1
|
|
18
|
+
|
|
19
|
+
volumes:
|
|
20
|
+
- ..:/workspaces/<%= app.nameSlug %>
|
|
21
|
+
- ..:/var/www/html
|
|
22
|
+
- node_modules:/workspaces/<%= app.nameSlug %>/wp-content/themes/<%= app.themeName %>/node_modules
|
|
23
|
+
- vendor:/workspaces/<%= app.nameSlug %>/wp-content/themes/<%= app.themeName %>/vendor
|
|
24
|
+
- vendor:/var/www/html/wp-content/themes/<%= app.themeName %>/vendor
|
|
25
|
+
|
|
26
|
+
db:
|
|
27
|
+
image: mariadb:11.4
|
|
28
|
+
restart: unless-stopped
|
|
29
|
+
volumes:
|
|
30
|
+
- db:/var/lib/mysql
|
|
31
|
+
environment:
|
|
32
|
+
MYSQL_ROOT_PASSWORD: mariadb
|
|
33
|
+
MYSQL_DATABASE: mariadb
|
|
34
|
+
MYSQL_USER: mariadb
|
|
35
|
+
MYSQL_PASSWORD: mariadb
|
|
36
|
+
|
|
37
|
+
volumes:
|
|
38
|
+
db:
|
|
39
|
+
vendor:
|
|
40
|
+
node_modules:
|
package/lib/commands/create/creators/app/template/.devcontainer/post-create-command.sh.chisel-tpl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -eux
|
|
4
|
+
|
|
5
|
+
sudo chown "$USER:$USER" node_modules vendor
|
|
6
|
+
touch .use-devcontainer
|
|
7
|
+
|
|
8
|
+
pushd ../../..
|
|
9
|
+
|
|
10
|
+
sudo chown "$USER:$USER" . index.php wp-config.php
|
|
11
|
+
if [ -d .git ] ; then sudo chown "$USER:$USER" .git ; fi
|
|
12
|
+
chmod +x .devcontainer/compose .devcontainer/exec
|
|
13
|
+
<% if (app.devcontainer) { %>
|
|
14
|
+
{
|
|
15
|
+
npx --yes generator-chisel@<%= chiselVersion %> --devcontainer-complete <%= app.responsesAsBase64 %>
|
|
16
|
+
exit
|
|
17
|
+
}
|
|
18
|
+
<% } %>
|
|
19
|
+
popd
|
|
20
|
+
<% if (!app.devcontainer) { %>
|
|
21
|
+
npm install
|
|
22
|
+
npm run wp-config -- --devcontainer
|
|
23
|
+
npm run composer install
|
|
24
|
+
npm run build<% } %>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const { prepareName, getDevcontainerBaseImageVersion } = require('./utils');
|
|
2
|
+
const fsPromises = require('fs/promises');
|
|
3
|
+
|
|
4
|
+
module.exports = async (api) => {
|
|
5
|
+
let app;
|
|
6
|
+
|
|
7
|
+
api.schedule(api.PRIORITIES.PROMPT, async () => {
|
|
8
|
+
app = await api.prompt([
|
|
9
|
+
{
|
|
10
|
+
name: 'name',
|
|
11
|
+
message: 'Please enter the project name:',
|
|
12
|
+
validate: (val) => Boolean(val),
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: 'number',
|
|
16
|
+
name: 'devcontainerPort',
|
|
17
|
+
message: 'Enter the devcontainer port:',
|
|
18
|
+
default: 3000,
|
|
19
|
+
validate: (val) => Boolean(val),
|
|
20
|
+
},
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const responsesAsBase64 = Buffer.from(JSON.stringify(app)).toString(
|
|
24
|
+
'base64'
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
Object.assign(app, prepareName(app.name));
|
|
28
|
+
app.devcontainer = true;
|
|
29
|
+
app.responsesAsBase64 = responsesAsBase64;
|
|
30
|
+
app.devcontainerBaseImageVersion = await getDevcontainerBaseImageVersion();
|
|
31
|
+
api.creator.data.app = app;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
api.schedule(api.PRIORITIES.COPY, async () => {
|
|
35
|
+
await api.copy({
|
|
36
|
+
from: '../app/template/.devcontainer',
|
|
37
|
+
to: '.devcontainer',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
await fsPromises.mkdir(api.creator.data.app.themePath, {
|
|
41
|
+
recursive: true,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
await fsPromises.writeFile('index.php', '');
|
|
45
|
+
await fsPromises.writeFile('wp-config.php', '');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
api.schedule(api.PRIORITIES.END_MESSAGE, async () => {
|
|
49
|
+
console.log(`
|
|
50
|
+
Devcontainer definition is ready.
|
|
51
|
+
|
|
52
|
+
To continue creating the project do one of the following:
|
|
53
|
+
|
|
54
|
+
1. If you are using VS Code, open the folder in VS Code and run
|
|
55
|
+
"Dev Containers: Reopen in Container" from the command palette.
|
|
56
|
+
|
|
57
|
+
2. Otherwise you have to use Dev Containers CLI to start the container:
|
|
58
|
+
> npx -y @devcontainers/cli@latest up --workspace-folder .
|
|
59
|
+
(dot at the end is part of the command)
|
|
60
|
+
`);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
module.exports.prepareName = (name) => {
|
|
2
|
+
const speakingUrl = require('speakingurl');
|
|
3
|
+
const nameSlug = speakingUrl(name)
|
|
4
|
+
.replace(/(?<=[^\d])-(\d+)/g, (_, d) => d)
|
|
5
|
+
.replace(/[^a-z0-9-]/g, '-');
|
|
6
|
+
|
|
7
|
+
const themeName = `${nameSlug}-chisel`;
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
nameSlug,
|
|
11
|
+
themeName,
|
|
12
|
+
themePath: `wp-content/themes/${themeName}`,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
module.exports.getDevcontainerBaseImageVersion = async () => {
|
|
17
|
+
const phpVersion = '8.3';
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const response = await fetch(
|
|
21
|
+
'https://api.wordpress.org/core/version-check/1.7/',
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
throw new Error('Failed to fetch WordPress version');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const data = await response.json();
|
|
29
|
+
|
|
30
|
+
const { version } = data.offers.find(
|
|
31
|
+
(offer) => offer.response === 'upgrade',
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const versionForTag =
|
|
35
|
+
version.split('.').length === 2 ? `${version}.0` : version;
|
|
36
|
+
|
|
37
|
+
const tag = `${versionForTag}-php${phpVersion}`;
|
|
38
|
+
|
|
39
|
+
const tagExists = await fetch(
|
|
40
|
+
`https://hub.docker.com/v2/namespaces/library/repositories/wordpress/tags/${tag}`,
|
|
41
|
+
{ method: 'HEAD' },
|
|
42
|
+
).then((res) => {
|
|
43
|
+
if (res.status === 200) return true;
|
|
44
|
+
if (res.status === 404) return false;
|
|
45
|
+
throw new Error(
|
|
46
|
+
`Failed to check if tag exists: ${res.status} ${res.statusText}`,
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (tagExists) {
|
|
51
|
+
return tag;
|
|
52
|
+
}
|
|
53
|
+
} catch (e) {
|
|
54
|
+
// noop
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return `6-php${phpVersion}`;
|
|
58
|
+
};
|
|
@@ -26,16 +26,31 @@ module.exports = (api) => {
|
|
|
26
26
|
const userName = gitConfig('user.name');
|
|
27
27
|
const userEmail = gitConfig('user.email');
|
|
28
28
|
|
|
29
|
+
let url = `http://${api.creator.data.app.nameSlug}.test/`;
|
|
30
|
+
const { devcontainerPort } = api.creator.data.app;
|
|
31
|
+
|
|
32
|
+
if (process.env.CODESPACES === 'true') {
|
|
33
|
+
const {
|
|
34
|
+
CODESPACE_NAME,
|
|
35
|
+
GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN,
|
|
36
|
+
} = process.env;
|
|
37
|
+
url = `https://${CODESPACE_NAME}-${devcontainerPort}.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/`;
|
|
38
|
+
} else if (await fs.exists('/.dockerenv')) {
|
|
39
|
+
url = `http://127.0.0.1:${devcontainerPort}/`;
|
|
40
|
+
}
|
|
41
|
+
|
|
29
42
|
await api.prompt([
|
|
30
43
|
{
|
|
31
44
|
name: 'title',
|
|
32
45
|
message: 'Enter title for the new site:',
|
|
33
46
|
default: api.creator.data.app.name,
|
|
47
|
+
validate: (val) => Boolean(val),
|
|
34
48
|
},
|
|
35
49
|
{
|
|
36
50
|
name: 'url',
|
|
37
51
|
message: 'Enter URL:',
|
|
38
|
-
default:
|
|
52
|
+
default: url,
|
|
53
|
+
validate: (val) => Boolean(val),
|
|
39
54
|
},
|
|
40
55
|
{
|
|
41
56
|
name: 'adminUser',
|
|
@@ -47,6 +62,7 @@ module.exports = (api) => {
|
|
|
47
62
|
nameParts[0].toLowerCase() + Math.floor(1000 + Math.random() * 9000)
|
|
48
63
|
);
|
|
49
64
|
},
|
|
65
|
+
validate: (val) => Boolean(val),
|
|
50
66
|
},
|
|
51
67
|
{
|
|
52
68
|
name: 'adminPassword',
|
|
@@ -88,7 +104,6 @@ module.exports = (api) => {
|
|
|
88
104
|
`${api.creator.data.app.themePath}/package.json`,
|
|
89
105
|
(body) => {
|
|
90
106
|
body.chisel = {
|
|
91
|
-
url: api.creator.data.wp.url,
|
|
92
107
|
tablePrefix,
|
|
93
108
|
};
|
|
94
109
|
},
|
|
@@ -104,7 +119,13 @@ module.exports = (api) => {
|
|
|
104
119
|
api.schedule(api.PRIORITIES.WP_CONFIG, async () => {
|
|
105
120
|
if (api.creator.cmd.skipWpConfig) return;
|
|
106
121
|
|
|
107
|
-
|
|
122
|
+
const extraArgs = [];
|
|
123
|
+
|
|
124
|
+
if (api.creator.data.devcontainerComplete) {
|
|
125
|
+
extraArgs.push('--devcontainer');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
await runLocal(['chisel-scripts', 'wp-config', ...extraArgs], {
|
|
108
129
|
cwd: api.resolve(themePath),
|
|
109
130
|
execaOpts: { stdio: 'inherit' },
|
|
110
131
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"plugins": {
|
|
3
|
-
"WP Premium: Gravity Forms": "https://github.com/
|
|
3
|
+
"WP Premium: Gravity Forms": "https://github.com/pronamic/gravityforms/archive/master.zip",
|
|
4
4
|
"SVG Support": "svg-support",
|
|
5
5
|
"Yoast SEO": "wordpress-seo",
|
|
6
6
|
"Yoast SEO ACF": "acf-content-analysis-for-yoast-seo"
|