diff --git a/emulsify.drush.inc b/emulsify.drush.inc index 9af65fc6..3996c252 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -20,7 +20,7 @@ function emulsify_drush_command() { 'machine_name' => 'The machine-readable name of your subtheme. This will be auto-generated from the human-readable name if ommited.', 'description' => 'The description of your subtheme', 'path' => 'The destination of your subtheme. Defaults to "all" (themes).', - 'kit' => 'The name or url of the starter kit to use. Defaults to "whisk".', + 'recipe' => 'The name or url of the starter recipe to use. Defaults to "whisk".', ], 'examples' => [ 'drush emulsify "Whisk"' => 'Creates a Emulsify subtheme called "Whisk", using the default options.', @@ -82,73 +82,73 @@ function drush_emulsify($name = NULL, $machine_name = NULL) { $subtheme_path = drush_trim_path($path); } - // Determine the kit to use. - $kit = (drush_get_option('kit')) ? drush_trim_path(drush_get_option('kit')) : 'whisk'; + // Determine the recipe to use. + $recipe = (drush_get_option('recipe')) ? drush_trim_path(drush_get_option('recipe')) : 'whisk'; - drush_emulsify_create($name, $machine_name, $description, $subtheme_path, $kit); + drush_emulsify_create($name, $machine_name, $description, $subtheme_path, $recipe); } /** * Create frontend theme. */ -function drush_emulsify_create($name, $machine_name, $description, $subtheme_path, $kit) { +function drush_emulsify_create($name, $machine_name, $description, $subtheme_path, $recipe) { $subtheme_path = drush_normalize_path(drush_get_context('DRUSH_DRUPAL_ROOT') . '/' . $subtheme_path . '/' . $machine_name); - // Make a fresh copy of the kit. - $kit_path = drush_normalize_path(drush_get_context('DRUSH_DRUPAL_ROOT') . '/' . drupal_get_path('theme', 'emulsify') . '/kits/' . $kit); + // Make a fresh copy of the recipe. + $recipe_path = drush_normalize_path(drush_get_context('DRUSH_DRUPAL_ROOT') . '/' . drupal_get_path('theme', 'emulsify') . '/recipes/' . $recipe); if (!is_dir(dirname($subtheme_path))) { drush_die(dt('The directory "!directory" was not found.', ['!directory' => dirname($subtheme_path)])); } - drush_op('drush_copy_dir', $kit_path, $subtheme_path); + drush_op('drush_copy_dir', $recipe_path, $subtheme_path); // Alter the contents of the .info file based on the command options. $alterations = [ - 'EMULSIFY_KIT_NAME' => $name, - 'EMULSIFY_KIT_DESCRIPTION' => $description, - 'emulsify_kit' => $machine_name, + 'EMULSIFY_RECIPE_NAME' => $name, + 'EMULSIFY_RECIPE_DESCRIPTION' => $description, + 'emulsify_recipe' => $machine_name, 'hidden: true' => '', ]; // Replace all occurrences of '{{machine_name}}' with the machine name of our // sub theme. - $files_to_replace = emulsify_get_files_to_make_replacements($kit); + $files_to_replace = emulsify_get_files_to_make_replacements($recipe); foreach ($files_to_replace as $file_to_replace) { drush_op('emulsify_file_str_replace', $subtheme_path . '/' . $file_to_replace, array_keys($alterations), $alterations); } // Rename files. $files_to_rename = [ - '{{kit}}.info.yml', - '{{kit}}.libraries.yml', - '{{kit}}.breakpoints.yml', - '{{kit}}.theme', - 'dev/scss/{{kit}}.scss', - 'dev/js/{{kit}}.js', - 'config/schema/{{kit}}.schema.yml', + '{{recipe}}.info.yml', + '{{recipe}}.libraries.yml', + '{{recipe}}.breakpoints.yml', + '{{recipe}}.theme', + 'dev/scss/{{recipe}}.scss', + 'dev/js/{{recipe}}.js', + 'config/schema/{{recipe}}.schema.yml', ]; foreach ($files_to_rename as $file_to_rename_path) { - $file_original_path = $subtheme_path . '/' . str_replace('{{kit}}', $kit, $file_to_rename_path); - $file_new_path = $subtheme_path . '/' . str_replace('{{kit}}', $machine_name, $file_to_rename_path); + $file_original_path = $subtheme_path . '/' . str_replace('{{recipe}}', $recipe, $file_to_rename_path); + $file_new_path = $subtheme_path . '/' . str_replace('{{recipe}}', $machine_name, $file_to_rename_path); drush_op('rename', drush_normalize_path($file_original_path), drush_normalize_path($file_new_path)); } // Batch rename all config files. $includes_path = $subtheme_path . '/config/optional/*.yml'; foreach (glob($includes_path) as $file_to_rename_path) { - $file_new_path = str_replace($kit, $machine_name, $file_to_rename_path); + $file_new_path = str_replace($recipe, $machine_name, $file_to_rename_path); drush_op('rename', drush_normalize_path($file_to_rename_path), drush_normalize_path($file_new_path)); drush_op('emulsify_file_str_replace', $file_new_path, array_keys($alterations), $alterations); } // Notify user of the newly created theme. - $message = 'Successfully created the Emulsify subtheme "!name" created in: !path using the "!kit" kit'; + $message = 'Successfully created the Emulsify subtheme "!name" created in: !path using the "!recipe" recipe'; $message = dt($message . '.', [ '!name' => $name, '!path' => $subtheme_path, - '!kit' => $kit, + '!recipe' => $recipe, ]); drush_print($message); } @@ -164,22 +164,24 @@ function emulsify_file_str_replace($file_path, $find, $replace) { } /** - * Returns an array of files to make string replacements. Based on kit chosen. + * Returns an array of files to make string replacements. Based on recipe chosen. */ -function emulsify_get_files_to_make_replacements($kit) { +function emulsify_get_files_to_make_replacements($recipe) { return [ - 'config/install/' . $kit . '.settings.yml', - 'config/schema/' . $kit . '.schema.yml', - 'dev/scss/' . $kit . '.scss', - 'dev/js/' . $kit . '.js', - 'dev/bower.json', - 'dev/gulpfile.js', - 'dev/package.json', - 'dev/config/config.json', - $kit . '.info.yml', - $kit . '.libraries.yml', - $kit . '.breakpoints.yml', - $kit . '.theme', + '.cli/init.js', + 'assets/fonts/.gitkeep', + 'assets/icons/.gitkeep', + 'assets/images/.gitkeep', + 'components/.gitkeep', + 'config/install/' . $recipe . '.settings.yml', + 'config/schema/' . $recipe . '.schema.yml', + 'dist/css/.gitkeep', + 'dist/js/.gitkeep', + 'templates/layout/page.html.twig', + $recipe . '.info.yml', + $recipe . '.libraries.yml', + $recipe . '.breakpoints.yml', + $recipe . '.theme', 'README.md', ]; } diff --git a/kits/whisk/.gitignore b/kits/whisk/.gitignore deleted file mode 100644 index dc024f7e..00000000 --- a/kits/whisk/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Ignore SASS files -/.sass-cache -.DS_Store -*.codekit -.idea -node_modules -config/dev/config.local.json diff --git a/kits/whisk/config/dev/.eslintrc b/kits/whisk/config/dev/.eslintrc deleted file mode 100644 index 7e88b38d..00000000 --- a/kits/whisk/config/dev/.eslintrc +++ /dev/null @@ -1,95 +0,0 @@ -{ - "extends": "eslint:recommended", - "env": { - "browser": true - }, - "globals": { - "Drupal": true, - "drupalSettings": true, - "drupalTranslations": true, - "domready": true, - "jQuery": true, - "_": true, - "matchMedia": true, - "Backbone": true, - "Modernizr": true, - "CKEDITOR": true - }, - "rules": { - // Errors. - "array-bracket-spacing": [2, "never"], - "block-scoped-var": 2, - "brace-style": [2, "stroustrup", {"allowSingleLine": true}], - "comma-dangle": [2, "never"], - "comma-spacing": 2, - "comma-style": [2, "last"], - "computed-property-spacing": [2, "never"], - "curly": [2, "all"], - "eol-last": 2, - "eqeqeq": [2, "smart"], - "guard-for-in": 2, - "indent": [2, 2, {"SwitchCase": 1}], - "key-spacing": [2, {"beforeColon": false, "afterColon": true}], - "keyword-spacing": [2, {"before": true, "after": true}], - "linebreak-style": [2, "unix"], - "lines-around-comment": [2, {"beforeBlockComment": true, "afterBlockComment": false}], - "new-parens": 2, - "no-array-constructor": 2, - "no-caller": 2, - "no-catch-shadow": 2, - "no-eval": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-extra-parens": [2, "functions"], - "no-implied-eval": 2, - "no-iterator": 2, - "no-label-var": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-loop-func": 2, - "no-multi-spaces": 2, - "no-multi-str": 2, - "no-native-reassign": 2, - "no-nested-ternary": 2, - "no-new-func": 2, - "no-new-object": 2, - "no-new-wrappers": 2, - "no-octal-escape": 2, - "no-process-exit": 2, - "no-proto": 2, - "no-return-assign": 2, - "no-script-url": 2, - "no-sequences": 2, - "no-shadow-restricted-names": 2, - "no-spaced-func": 2, - "no-trailing-spaces": 2, - "no-undef-init": 2, - "no-undefined": 2, - "no-unused-expressions": 2, - "no-unused-vars": [2, {"vars": "all", "args": "none"}], - "no-with": 2, - "object-curly-spacing": [2, "never"], - "one-var": [2, "never"], - "quote-props": [2, "consistent-as-needed"], - "quotes": [2, "single", "avoid-escape"], - "semi": [2, "always"], - "semi-spacing": [2, {"before": false, "after": true}], - "space-before-blocks": [2, "always"], - "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], - "space-in-parens": [2, "never"], - "space-infix-ops": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "spaced-comment": [2, "always"], - "strict": 2, - "yoda": [2, "never"], - // Warnings. - "max-nested-callbacks": [1, 3], - "valid-jsdoc": [1, { - "prefer": { - "returns": "return", - "property": "prop" - }, - "requireReturn": false - }] - } -} diff --git a/kits/whisk/config/dev/.sass-lint.yml b/kits/whisk/config/dev/.sass-lint.yml deleted file mode 100644 index 54985c4d..00000000 --- a/kits/whisk/config/dev/.sass-lint.yml +++ /dev/null @@ -1,182 +0,0 @@ -# The following scss-lint Linters are not yet supported by sass-lint: -# ElsePlacement, PropertyCount, SelectorDepth, UnnecessaryParentReference -# -# The following settings/values are unsupported by sass-lint: -# Linter Indentation, option "allow_non_nested_indentation" -# Linter Indentation, option "character" -# Linter PropertySortOrder, option "separate_groups" -# Linter SpaceBeforeBrace, option "allow_single_line_padding" - -files: - include: 'scss/**/*.scss' - -options: - formatter: stylish - merge-default-rules: false - -rules: - border-zero: - - 1 - - convention: zero - - brace-style: - - 1 - - allow-single-line: false - - class-name-format: - - 1 - - convention: '([a-z0-9]+-?)+' - - clean-import-paths: - - 0 - - filename-extension: false - leading-underscore: false - - empty-line-between-blocks: - - 1 - - ignore-single-line-rulesets: true - - extends-before-declarations: 1 - - extends-before-mixins: 1 - - final-newline: - - 1 - - include: true - - force-attribute-nesting: 1 - - force-element-nesting: 0 - - force-pseudo-nesting: 1 - - function-name-format: - - 1 - - allow-leading-underscore: true - convention: hyphenatedlowercase - - hex-length: - - 1 - - style: short - - hex-notation: - - 1 - - style: lowercase - - id-name-format: - - 1 - - convention: '([a-z0-9]+-?)+' - - indentation: - - 1 - - size: 2 - - leading-zero: - - 1 - - include: true - - mixin-name-format: - - 1 - - allow-leading-underscore: true - convention: hyphenatedlowercase - - mixins-before-declarations: 1 - - nesting-depth: - - 1 - - max-depth: 3 - - no-color-keywords: 1 - - no-color-literals: 1 - - no-css-comments: 0 - - no-debug: 1 - - no-duplicate-properties: 1 - - no-empty-rulesets: 1 - - no-ids: 1 - - no-important: 0 - - no-invalid-hex: 1 - - no-mergeable-selectors: 1 - - no-misspelled-properties: - - 1 - - extra-properties: [] - - no-qualifying-elements: - - 1 - - allow-element-with-attribute: false - allow-element-with-class: false - allow-element-with-id: false - - no-trailing-zero: 1 - - no-url-protocols: 1 - - no-vendor-prefixes: - - 1 - - ignore-non-standard: true - - placeholder-in-extend: 1 - - placeholder-name-format: - - 1 - - convention: '([a-z0-9]+-?)+' - - property-sort-order: - - 0 - - ignore-custom-properties: false - - quotes: - - 1 - - style: single - - shorthand-values: 1 - - single-line-per-selector: 0 - - space-after-bang: - - 1 - - include: false - - space-after-colon: - - 1 - - include: true - - space-after-comma: 1 - - space-before-bang: - - 1 - - include: true - - space-before-brace: - - 1 - - include: true - - space-before-colon: 1 - - space-between-parens: - - 1 - - include: false - - trailing-semicolon: 1 - - url-quotes: 1 - - variable-for-property: - - 0 - - properties: [] - - variable-name-format: - - 1 - - allow-leading-underscore: true - convention: hyphenatedlowercase - - zero-unit: 1 diff --git a/kits/whisk/config/dev/README.md b/kits/whisk/config/dev/README.md deleted file mode 100644 index b50a7a4a..00000000 --- a/kits/whisk/config/dev/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Gulp Configuration - -These files are the configuration used by our Gulp workflow. Changes **should -not** be made to config.json. If local development settings are needed, -duplicate the *example.config.local.json* and name it *config.local.json* and -make changes within that file. - - cp example.config.local.js config.json diff --git a/kits/whisk/config/dev/config.json b/kits/whisk/config/dev/config.json deleted file mode 100644 index 15819e57..00000000 --- a/kits/whisk/config/dev/config.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "browserSync": { - "proxy": "http://localhost", - "port": 3000, - "openAutomatically": false, - "notify": false - }, - "css": { - "dest": "assets/css", - "src": [ - "scss/**/*.scss" - ], - "includePaths": [ - "../contrib/aeon/scss" - ] - }, - "js": { - "dest": "assets/js", - "src": [ - "js/**/*.js" - ] - }, - "components": { - "css": { - "dest": "./components", - "src": [ - "components/*/src/styles/*.scss", - "scss/base/*.scss" - ], - "includePaths": [ - "../contrib/aeon/scss", - "./scss/base" - ] - }, - "js": { - "dest": "./components", - "src": [ - "components/*/src/scripts/*.js" - ] - } - }, - "templates": { - "src": [ - "templates/**/*.twig", - "components/*/*.twig" - ] - } -} diff --git a/kits/whisk/config/dev/example.config.local.json b/kits/whisk/config/dev/example.config.local.json deleted file mode 100644 index a58a4902..00000000 --- a/kits/whisk/config/dev/example.config.local.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browserSync": { - "proxy" : "http://local.dev" - } -} diff --git a/kits/whisk/package.json b/kits/whisk/package.json deleted file mode 100644 index cfdad107..00000000 --- a/kits/whisk/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "emulsify_kit", - "description": "EMULSIFY_KIT_DESCRIPTION", - "private": true, - "devDependencies": { - "@babel/core": "^7.20.12", - "@babel/preset-env": "^7.20.2", - "browser-sync": "^2.27.11", - "gulp": "^4.0.2", - "gulp-autoprefixer": "^8.0.0", - "gulp-babel": "^8.0.0", - "gulp-cached": "^1.1.1", - "gulp-eslint": "^6.0.0", - "gulp-noop": "^1.0.1", - "gulp-plumber": "^1.2.1", - "gulp-rename": "^2.0.0", - "gulp-sass": "^5.1.0", - "gulp-sass-glob": "^1.1.0", - "gulp-sourcemaps": "^3.0.0", - "gulp-stylelint": "^13.0.0", - "gulp-uglify": "^3.0.2", - "gulp-util": "^3.0.8", - "node-sass": "^8.0.0", - "sass": "^1.58.0", - "stylelint": "^13.13.1", - "stylelint-config-ash": "^3.0.2", - "stylelint-config-standard": "^20.0.0", - "stylelint-order": "^4.1.0", - "stylelint-scss": "^3.21.0" - } -} diff --git a/kits/whisk/whisk.theme b/kits/whisk/whisk.theme deleted file mode 100644 index 3f73e7c8..00000000 --- a/kits/whisk/whisk.theme +++ /dev/null @@ -1,6 +0,0 @@ -id(); + $suggestions[] = 'views_view__' . $variables['view']->id() . '__' . $variables['view']->current_display; + } + + if ($hook == 'views_view_unformatted') { + $suggestions[] = 'views_view_unformatted__' . $variables['view']->id(); + $suggestions[] = 'views_view_unformatted__' . $variables['view']->id() . '__' . $variables['view']->current_display; + } + + if ($hook == 'views_mini_pager') { + $suggestions[] = 'views_mini_pager'; + } +}