@airfleet/generator-init 0.30.0 → 0.31.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.
Files changed (95) hide show
  1. package/generators/plugin/templates/composer-scoped.json.ejs +1 -1
  2. package/generators/plugin/templates/composer-scoped.lock.ejs +122 -122
  3. package/generators/plugin/templates/gitignore +1 -0
  4. package/generators/plugin/templates/package.json.ejs +1 -1
  5. package/generators/project-plugin/index.js +229 -0
  6. package/generators/project-plugin/templates/.airfleet-release +1 -0
  7. package/generators/project-plugin/templates/.editorconfig +18 -0
  8. package/generators/project-plugin/templates/.env +0 -0
  9. package/generators/project-plugin/templates/.gitattributes +12 -0
  10. package/generators/project-plugin/templates/.github/workflows/create-asana-attachment.yaml +19 -0
  11. package/generators/project-plugin/templates/.github/workflows/test-wordpress.yml +44 -0
  12. package/generators/project-plugin/templates/.husky/gitignore +1 -0
  13. package/generators/project-plugin/templates/.husky/pre-commit +4 -0
  14. package/generators/project-plugin/templates/.parcelrc +4 -0
  15. package/generators/project-plugin/templates/.prettierignore +15 -0
  16. package/generators/project-plugin/templates/.vscode/airfleet.code-snippets.ejs +186 -0
  17. package/generators/project-plugin/templates/.vscode/settings.json +33 -0
  18. package/generators/project-plugin/templates/CHANGELOG.md +10 -0
  19. package/generators/project-plugin/templates/LICENSE.ejs +2 -0
  20. package/generators/project-plugin/templates/README.md.ejs +16 -0
  21. package/generators/project-plugin/templates/acf-json/.gitkeep +0 -0
  22. package/generators/project-plugin/templates/acf-json/field-groups/.gitkeep +0 -0
  23. package/generators/project-plugin/templates/acf-json/option-pages/.gitkeep +0 -0
  24. package/generators/project-plugin/templates/acf-json/option-pages/airfleet-site-settings.json +22 -0
  25. package/generators/project-plugin/templates/acf-json/post-types/.gitkeep +0 -0
  26. package/generators/project-plugin/templates/acf-json/taxonomies/.gitkeep +0 -0
  27. package/generators/project-plugin/templates/assets/admin/styles/admin.entry.scss +2 -0
  28. package/generators/project-plugin/templates/assets/editor/styles/editor.entry.scss +23 -0
  29. package/generators/project-plugin/templates/assets/frontend/fonts/.gitkeep +0 -0
  30. package/generators/project-plugin/templates/assets/frontend/images/.gitkeep +0 -0
  31. package/generators/project-plugin/templates/assets/frontend/scripts/index.entry.js +3 -0
  32. package/generators/project-plugin/templates/assets/frontend/styles/_main.scss +3 -0
  33. package/generators/project-plugin/templates/assets/frontend/styles/_placeholders.scss +3 -0
  34. package/generators/project-plugin/templates/assets/frontend/styles/_root.scss +4 -0
  35. package/generators/project-plugin/templates/assets/frontend/styles/critical.entry.scss +1 -0
  36. package/generators/project-plugin/templates/assets/frontend/styles/index.entry.scss +6 -0
  37. package/generators/project-plugin/templates/assets/frontend/styles/main/_body.scss +6 -0
  38. package/generators/project-plugin/templates/assets/frontend/styles/main/_reset.scss +121 -0
  39. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_button.scss +43 -0
  40. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_container.scss +12 -0
  41. package/generators/project-plugin/templates/assets/frontend/styles/placeholders/_sections.scss +6 -0
  42. package/generators/project-plugin/templates/assets/frontend/styles/root/_fonts.scss +21 -0
  43. package/generators/project-plugin/templates/assets/login/.gitkeep +0 -0
  44. package/generators/project-plugin/templates/assets/shared/styles/_figma-variables.scss +7 -0
  45. package/generators/project-plugin/templates/assets/shared/styles/_lib.scss +4 -0
  46. package/generators/project-plugin/templates/assets/shared/styles/_root.scss +6 -0
  47. package/generators/project-plugin/templates/assets/shared/styles/_shared.scss +1 -0
  48. package/generators/project-plugin/templates/assets/shared/styles/lib/_mixins.scss +6 -0
  49. package/generators/project-plugin/templates/assets/shared/styles/lib/_scss-variables.scss +2 -0
  50. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_background.scss +11 -0
  51. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_body.scss +4 -0
  52. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_breakpoints.scss +79 -0
  53. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_helpers.scss +35 -0
  54. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_list-inline.scss +23 -0
  55. package/generators/project-plugin/templates/assets/shared/styles/lib/mixins/_position.scss +24 -0
  56. package/generators/project-plugin/templates/composer-scoped.json.ejs +8 -0
  57. package/generators/project-plugin/templates/composer-scoped.lock.ejs +124 -0
  58. package/generators/project-plugin/templates/composer.json.ejs +52 -0
  59. package/generators/project-plugin/templates/figma/design-tokens/.gitkeep +0 -0
  60. package/generators/project-plugin/templates/figma/design-tokens/manifest.json +5 -0
  61. package/generators/project-plugin/templates/gitignore +15 -0
  62. package/generators/project-plugin/templates/inc/Features/Menus.php.ejs +22 -0
  63. package/generators/project-plugin/templates/inc/Setup/AjaxVariables.php.ejs +22 -0
  64. package/generators/project-plugin/templates/inc/Setup/AjaxVariablesAdmin.php.ejs +22 -0
  65. package/generators/project-plugin/templates/inc/Setup/Breakpoints.php.ejs +18 -0
  66. package/generators/project-plugin/templates/inc/Setup/Colors.php.ejs +17 -0
  67. package/generators/project-plugin/templates/inc/Setup/RegisterViews.php.ejs +64 -0
  68. package/generators/project-plugin/templates/inc/Setup.php.ejs +30 -0
  69. package/generators/project-plugin/templates/index.php +1 -0
  70. package/generators/project-plugin/templates/package.json.ejs +85 -0
  71. package/generators/project-plugin/templates/phpcs.xml.ejs +23 -0
  72. package/generators/project-plugin/templates/plugin-name.php.ejs +65 -0
  73. package/generators/project-plugin/templates/scoper.custom.php.ejs +8 -0
  74. package/generators/project-plugin/templates/views/blocks/.gitkeep +0 -0
  75. package/generators/project-plugin/templates/views/components/.gitkeep +0 -0
  76. package/generators/project-plugin/templates/views/custom-templates/.gitkeep +0 -0
  77. package/generators/project-plugin/templates/views/parcelkeep.entry.scss +0 -0
  78. package/generators/project-plugin/templates/views/partials/footer/footer.blade.php.ejs +4 -0
  79. package/generators/project-plugin/templates/views/partials/footer/footer.php.ejs +4 -0
  80. package/generators/project-plugin/templates/views/partials/header/header.blade.php.ejs +12 -0
  81. package/generators/project-plugin/templates/views/partials/header/header.php.ejs +12 -0
  82. package/generators/project-plugin/templates/views/partials/layout/layout.blade.php.ejs +3 -0
  83. package/generators/project-plugin/templates/views/partials/layout/layout.php.ejs +5 -0
  84. package/generators/project-plugin/templates/views/templates/index/index.blade.php.ejs +30 -0
  85. package/generators/project-plugin/templates/views/templates/index/index.php.ejs +32 -0
  86. package/generators/project-plugin/templates/views/templates/not-found/not-found.blade.php.ejs +3 -0
  87. package/generators/project-plugin/templates/views/templates/not-found/not-found.php.ejs +5 -0
  88. package/generators/project-plugin/templates/views/templates/page/page.blade.php.ejs +10 -0
  89. package/generators/project-plugin/templates/views/templates/page/page.php.ejs +12 -0
  90. package/generators/project-plugin/templates/views/templates/single/single.blade.php.ejs +28 -0
  91. package/generators/project-plugin/templates/views/templates/single/single.php.ejs +30 -0
  92. package/generators/project-plugin/templates/views-elements/.gitkeep +0 -0
  93. package/generators/project-plugin/templates/views-elements/partials/button/ButtonSetup.php.ejs +32 -0
  94. package/generators/project-plugin/templates/views-elements/partials/button/button.entry.scss +13 -0
  95. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" ?>
2
+ <ruleset
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"
5
+ >
6
+
7
+ <!--
8
+ #############################################################################
9
+ COMMAND LINE ARGUMENTS
10
+ https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
11
+ #############################################################################
12
+ -->
13
+
14
+ <!-- Set cache file -->
15
+ <arg name="cache" value=".phpcscache" />
16
+
17
+ <!-- Check all files in this directory and the directories below it. -->
18
+ <file>.</file>
19
+
20
+ <!-- Airfleet config -->
21
+ <rule ref="Airfleet" />
22
+
23
+ </ruleset>
@@ -0,0 +1,65 @@
1
+ <?php
2
+ /**
3
+ * <%= name.title %>
4
+ *
5
+ * @package Airfleet\Plugins\<%= nameNoAirfleet.pascal %>
6
+ * @version <%= answers.pluginVersion %>
7
+ * @author Airfleet
8
+ * @link https://www.airfleet.co/
9
+ *
10
+ * @wordpress-plugin
11
+ * Plugin Name: <%= name.title %>
12
+ * Plugin URI: https://www.airfleet.co/
13
+ * Description: <%= answers.pluginDescription %>
14
+ * Version: <%= answers.pluginVersion %>
15
+ * Requires PHP: <%= phpVersion %>
16
+ * Author: Airfleet
17
+ * Author URI: https://www.airfleet.co/
18
+ * Text Domain: <%= name.slug %>
19
+ * GitHub Plugin URI: <%= repositoryBase %>
20
+ * Primary Branch: <%= mainBranch %>
21
+ * Release Asset: true
22
+ */
23
+
24
+ // Exit if accessed directly.
25
+ if ( ! defined( 'ABSPATH' ) ) {
26
+ die;
27
+ }
28
+
29
+ // Plugin constants.
30
+ define( '<%= name.constant %>_VERSION', '<%= answers.pluginVersion %>' );
31
+ define( '<%= name.constant %>_SLUG', '<%= name.slug %>' );
32
+ define( '<%= name.constant %>_SLUG_SHORT', '<%= nameNoAirfleet.slug %>' );
33
+ define( '<%= name.constant %>_TITLE', '<%= name.title %>' );
34
+ define( '<%= name.constant %>_TITLE_SHORT', '<%= nameNoAirfleet.title %>' );
35
+ define( '<%= name.constant %>_PATH', plugin_dir_path( __FILE__ ) );
36
+ define( '<%= name.constant %>_URL', plugin_dir_url( __FILE__ ) );
37
+ define( '<%= name.constant %>_FILE', __FILE__ );
38
+ define( '<%= name.constant %>_DIR', __DIR__ );
39
+ define( '<%= name.constant %>_IMAGES_OPTIONS_URL', <%= name.constant %>_URL . '/assets/admin/images/options' );
40
+
41
+ // Autoload classes.
42
+ require_once __DIR__ . '/vendor/autoload.php';
43
+ require_once __DIR__ . '/vendor-scoped/scoper-autoload.php';
44
+
45
+ // Initialize plugin.
46
+ $<%= name.snake %> = new \Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\Setup(
47
+ [
48
+ 'slug' => \<%= name.constant %>_SLUG,
49
+ 'short_slug' => \<%= name.constant %>_SLUG_SHORT,
50
+ 'title' => \<%= name.constant %>_TITLE,
51
+ 'short_title' => \<%= name.constant %>_TITLE_SHORT,
52
+ 'url' => \<%= name.constant %>_URL,
53
+ 'path' => \<%= name.constant %>_PATH,
54
+ 'version' => \<%= name.constant %>_VERSION,
55
+ ]
56
+ );
57
+
58
+ $<%= name.snake %>->initialize();
59
+
60
+ /**
61
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
62
+ * ! Do not make changes to this file.
63
+ * ! Edit the plugin class in folder inc/.
64
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
65
+ */
@@ -0,0 +1,8 @@
1
+ <?php
2
+
3
+ // phpcs:ignore
4
+ function customize_php_scoper_config( array $config ): array {
5
+ $config['exclude-functions'] = [ 'af_field', 'get_current_screen', 'get_post_type', '/acf\_*/' ];
6
+
7
+ return $config;
8
+ }
@@ -0,0 +1,4 @@
1
+ @php apply_filters( 'airfleet/theme/footer/hook', true ) && do_action( 'get_footer' ) @endphp
2
+ @php wp_footer() @endphp
3
+ </body>
4
+ </html>
@@ -0,0 +1,4 @@
1
+ <?php apply_filters( 'airfleet/theme/footer/hook', true ) && do_action( 'get_footer' ); ?>
2
+ <?php wp_footer(); ?>
3
+ </body>
4
+ </html>
@@ -0,0 +1,12 @@
1
+ @php apply_filters( 'airfleet/theme/header/hook', true ) && do_action( 'get_header' ) @endphp
2
+ <!DOCTYPE html>
3
+ <html @php language_attributes() @endphp>
4
+ <head>
5
+ <meta charset="@php bloginfo( 'charset' ) @endphp" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
7
+ <link rel="profile" href="http://gmpg.org/xfn/11" />
8
+ <link rel="pingback" href="@php bloginfo( 'pingback_url' ) @endphp" />
9
+ @php wp_head() @endphp
10
+ </head>
11
+ <body @php body_class() @endphp>
12
+ @php wp_body_open() @endphp
@@ -0,0 +1,12 @@
1
+ <?php apply_filters( 'airfleet/theme/header/hook', true ) && do_action( 'get_header' ); ?>
2
+ <!DOCTYPE html>
3
+ <html <?php language_attributes(); ?>>
4
+ <head>
5
+ <meta charset="<?php bloginfo( 'charset' ) ?>" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
7
+ <link rel="profile" href="http://gmpg.org/xfn/11" />
8
+ <link rel="pingback" href="<?php bloginfo( 'pingback_url' ) ?>" />
9
+ <?php wp_head(); ?>
10
+ </head>
11
+ <body <?php body_class(); ?>>
12
+ <?php wp_body_open(); ?>
@@ -0,0 +1,3 @@
1
+ @view( 'partials-header' )
2
+ {!! $_slot !!}
3
+ @view( 'partials-footer' )
@@ -0,0 +1,5 @@
1
+ <?php
2
+ $_view( 'partials-header' );
3
+ echo $_slot ?? '';
4
+ $_view( 'partials-footer' );
5
+ ?>
@@ -0,0 +1,30 @@
1
+ @view_start( 'partials-layout' )
2
+ @if( have_posts() )
3
+ @while( have_posts() )
4
+ @php the_post() @endphp
5
+ <article @php post_class( 'article article--index' ) @endphp>
6
+ <header class="article__head">
7
+ @if ( has_post_thumbnail() )
8
+ <div class="article__thumbnail">
9
+ @php the_post_thumbnail() @endphp
10
+ </div>
11
+ @endif
12
+ <h2 class="article__title">
13
+ <a href="@php the_permalink() @endphp">
14
+ @php the_title() @endphp
15
+ </a>
16
+ </h2>
17
+ <div class="article__meta">
18
+ <p>
19
+ @php the_time( 'F jS, Y ' ) @endphp
20
+ @php the_author() @endphp
21
+ </p>
22
+ </div>
23
+ </header>
24
+ <div class="article__body">
25
+ @php the_excerpt() @endphp
26
+ </div>
27
+ </article>
28
+ @endwhile
29
+ @endif
30
+ @view_end()
@@ -0,0 +1,32 @@
1
+ <?php $_view_start( 'partials-layout' ); ?>
2
+
3
+ <?php if( have_posts() ) : ?>
4
+ <?php while( have_posts() ) : ?>
5
+ <?php the_post(); ?>
6
+ <article <?php post_class( 'article article--index' ); ?>>
7
+ <header class="article__head">
8
+ <?php if( has_post_thumbnail() ) : ?>
9
+ <div class="article__thumbnail">
10
+ <?php the_post_thumbnail(); ?>
11
+ </div>
12
+ <?php endif; ?>
13
+ <h2 class="article__title">
14
+ <a href="<?php the_permalink() ?>">
15
+ <?php the_title(); ?>
16
+ </a>
17
+ </h2>
18
+ <div class="article__meta">
19
+ <p>
20
+ <?php the_time( 'F jS, Y ' ); ?>
21
+ <?php the_author(); ?>
22
+ </p>
23
+ </div>
24
+ </header>
25
+ <div class="article__body">
26
+ <?php the_excerpt(); ?>
27
+ </div>
28
+ </article>
29
+ <?php endwhile; ?>
30
+ <?php endif; ?>
31
+
32
+ <?php $_view_end(); ?>
@@ -0,0 +1,3 @@
1
+ @view_start( 'partials-layout' )
2
+ <h1>Oops, page not found :(</h1>
3
+ @view_end()
@@ -0,0 +1,5 @@
1
+ <?php $_view_start( 'partials-layout' ); ?>
2
+
3
+ <h1>Oops, page not found :(</h1>
4
+
5
+ <?php $_view_end(); ?>
@@ -0,0 +1,10 @@
1
+ @view_start( 'partials-layout' )
2
+ @if( have_posts() )
3
+ @while( have_posts() )
4
+ @php the_post() @endphp
5
+ <article @php post_class( 'page' ) @endphp>
6
+ @php the_content() @endphp
7
+ </article>
8
+ @endwhile
9
+ @endif
10
+ @view_end()
@@ -0,0 +1,12 @@
1
+ <?php $_view_start( 'partials-layout' ); ?>
2
+
3
+ <?php if( have_posts() ) : ?>
4
+ <?php while( have_posts() ) : ?>
5
+ <?php the_post(); ?>
6
+ <article <?php post_class( 'page' ); ?>>
7
+ <?php the_content(); ?>
8
+ </article>
9
+ <?php endwhile; ?>
10
+ <?php endif; ?>
11
+
12
+ <?php $_view_end(); ?>
@@ -0,0 +1,28 @@
1
+ @view_start( 'partials-layout' )
2
+ @if( have_posts() )
3
+ @while( have_posts() )
4
+ @php the_post() @endphp
5
+ <article @php post_class( 'article article--single' ) @endphp>
6
+ <header class="article__head">
7
+ @if ( has_post_thumbnail() )
8
+ <div class="article__thumbnail">
9
+ @php the_post_thumbnail() @endphp
10
+ </div>
11
+ @endif
12
+ <h2 class="article__title">
13
+ @php the_title() @endphp
14
+ </h2>
15
+ <div class="article__meta">
16
+ <p>
17
+ @php the_time( 'F jS, Y ' ) @endphp
18
+ @php the_author() @endphp
19
+ </p>
20
+ </div>
21
+ </header>
22
+ <div class="article__body">
23
+ @php the_content() @endphp
24
+ </div>
25
+ </article>
26
+ @endwhile
27
+ @endif
28
+ @view_end()
@@ -0,0 +1,30 @@
1
+ <?php $_view_start( 'partials-layout' ); ?>
2
+
3
+ <?php if( have_posts() ) : ?>
4
+ <?php while( have_posts() ) : ?>
5
+ <?php the_post(); ?>
6
+ <article <?php post_class( 'article article--single' ); ?>>
7
+ <header class="article__head">
8
+ <?php if ( has_post_thumbnail() ) : ?>
9
+ <div class="article__thumbnail">
10
+ <?php the_post_thumbnail(); ?>
11
+ </div>
12
+ <?php endif; ?>
13
+ <h2 class="article__title">
14
+ <?php the_title(); ?>
15
+ </h2>
16
+ <div class="article__meta">
17
+ <p>
18
+ <?php the_time( 'F jS, Y ' ); ?>
19
+ <?php the_author(); ?>
20
+ </p>
21
+ </div>
22
+ </header>
23
+ <div class="article__body">
24
+ <?php the_content(); ?>
25
+ </div>
26
+ </article>
27
+ <?php endwhile; ?>
28
+ <?php endif; ?>
29
+
30
+ <?php $_view_end(); ?>
@@ -0,0 +1,32 @@
1
+ <?php
2
+
3
+ namespace Airfleet\Plugins\<%= nameNoAirfleet.pascal %>\ViewsElements\Partials\Button;
4
+
5
+ use Airfleet\Plugins\Views\View\ViewSetup;
6
+
7
+ class ButtonSetup extends ViewSetup {
8
+ public function initialize(): void {
9
+ $this->filter_styles();
10
+ $this->filter_variations();
11
+ }
12
+
13
+ protected function filter_styles(): void {
14
+ add_filter(
15
+ 'airfleet/elements/button/style',
16
+ function ( $choices ) {
17
+ // ? Customize button styles. See https://www.notion.so/codersclan/Airfleet-Elements-Buttons-ddb5303409d143edaf9044bf4403247f?p=67c54d5f1343454c9c949be42c80fb1a&pm=c
18
+ return $choices;
19
+ }
20
+ );
21
+ }
22
+
23
+ protected function filter_variations(): void {
24
+ add_filter(
25
+ 'airfleet/elements/button/variations',
26
+ function ( $choices ) {
27
+ // ? Customize button variations. See https://www.notion.so/codersclan/Airfleet-Elements-Buttons-ddb5303409d143edaf9044bf4403247f?p=1b753e0924d34b378713baee5611953b&pm=c
28
+ return $choices;
29
+ }
30
+ );
31
+ }
32
+ }
@@ -0,0 +1,13 @@
1
+ .afc-button {
2
+ // ? Button styles. Set style options in ButtonSetup.php
3
+ // &--style {
4
+ // &-primary {
5
+ // }
6
+ // }
7
+
8
+ // ? Button variations. Set variation options in ButtonSetup.php
9
+ // &--variation {
10
+ // &-small {
11
+ // }
12
+ // }
13
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airfleet/generator-init",
3
3
  "description": "A Yeoman generator to scaffold common Airfleet features",
4
- "version": "0.30.0",
4
+ "version": "0.31.0",
5
5
  "scripts": {},
6
6
  "publishConfig": {
7
7
  "access": "public"