skilld-labs / zen

Fork of Drupal Zen theme https://www.drupal.org/project/zen
1 stars 5 forks source link

Base theme rework/overhaul #46

Closed pabloguerino closed 4 years ago

pabloguerino commented 6 years ago
#!/bin/sh

SOURCES="./STARTERKIT" 
REPLACE="STARTERKIT" 

echo -n "Please enter the theme name: " 
read THEME

if [ -z "$THEME" ]; then
  echo "You need to enter a theme name." 
  exit 1
fi

if [ ! -d "$SOURCES" ]; then
  echo "Failed to find STARTERKIT sources." 
  exit 1
fi

cp -rf $SOURCES $THEME

find $THEME \
  -type f \
  -exec sed -i 's/$REPLACE/$THEME/g' {} + \
  -exec rename $REPLACE $THEME {} +
andypost commented 6 years ago

Looks the common way is to add commands to package.json kinda https://github.com/phase2/particle/pull/258/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R29

hog-seruj commented 6 years ago

@pabloguerino i can't see Makefile here: https://github.com/pabloguerino/zen/commit/4e26a3f027f586d8edb8db4e6f925d9c9cd47768

But i see this file i this pullrequest. Where it was added? How i can check your PR?

As i see you removed gulpfile.js in this case we can't use theme with out docker & Makefile.

pabloguerino commented 6 years ago

@hog-seruj,

As i see you removed gulpfile.js in this case we can't use theme with out docker & Makefile.

Theme gulpfile.js was not removed, the one removed was one that we don't really need and can be replaced with a bash script.

i can't see Makefile here: pabloguerino/zen@4e26a3f

Why are you looking for a Makefile? We don't have one on the original theme either. This is what you mean? https://github.com/skilld-labs/zen/blob/8.x-7.x/Makefile

How i can check your PR?

You can use this branch https://github.com/pabloguerino/zen/tree/overhaul

andypost commented 6 years ago

we can use Makefile caching like

greteltrost commented 6 years ago

Updated babel-preset version + dependencies. Removed commented styles since we don't need them, and fixed some naming issues on templates.

iberdinsky-skilld commented 6 years ago

i'm having issues with createSubTheme.sh both local macOs and docker php container. Files and 'STARTERKIT' inside files weren't renamed.

Also i think it would be better to create theme outside zen dir.

iberdinsky-skilld commented 6 years ago

https://github.com/iberdinsky-skilld/zen/tree/overhaul_fixes fixes there. @pabloguerino please merge and update that PR

iberdinsky-skilld commented 6 years ago

phpcs linter fails

FILE: THEMENAME_theme/src/js/init.js

FOUND 5 ERRORS AFFECTING 2 LINES

1 | ERROR | [x] You must use "/**" style comments for a file comment | | (Drupal.Commenting.FileComment.WrongStyle) 1 | ERROR | [x] Inline comments must start with a capital letter | | (Drupal.Commenting.InlineComment.NotCapital) 1 | ERROR | [x] Inline comments must end in full-stops, exclamation | | marks, colons, question marks, or closing parentheses | | (Drupal.Commenting.InlineComment.InvalidEndChar) 6 | ERROR | [x] Inline comments must start with a capital letter | | (Drupal.Commenting.InlineComment.NotCapital) 6 | ERROR | [x] Inline comments must end in full-stops, exclamation | | marks, colons, question marks, or closing parentheses | | (Drupal.Commenting.InlineComment.InvalidEndChar)

PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY

FILE: THEMENAME_theme/src/js/behaviors.js

FOUND 4 ERRORS AFFECTING 3 LINES

1 | ERROR | [x] You must use "/**" style comments for a file | | comment (Drupal.Commenting.FileComment.WrongStyle) 1 | ERROR | [x] Inline comments must end in full-stops, exclamation | | marks, colons, question marks, or closing parentheses | | (Drupal.Commenting.InlineComment.InvalidEndChar) 11 | ERROR | [x] Expected 1 newline at end of file; 2 found | | (Drupal.Files.EndFileNewline.TooMany) 12 | ERROR | [x] Additional whitespace found at end of file | | (Squiz.WhiteSpace.SuperfluousWhitespace.EndFile)

PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY

FILE: THEMENAME_theme/gulpfile.js

FOUND 10 ERRORS AFFECTING 10 LINES

121 | ERROR | [x] Inline comments must end in full-stops, exclamation | | marks, colons, question marks, or closing parentheses | | (Drupal.Commenting.InlineComment.InvalidEndChar) 139 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 8 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 140 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 13 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 141 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 3 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 142 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 11 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 143 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 10 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 144 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 11 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 145 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 9 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 146 | ERROR | [x] Equals sign not aligned with surrounding assignments; | | expected 3 spaces but found 1 space | | (Drupal.Formatting.MultipleStatementAlignment.NotSame) 164 | ERROR | [x] Inline comments must end in full-stops, exclamation | | marks, colons, question marks, or closing parentheses | | (Drupal.Commenting.InlineComment.InvalidEndChar)

PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY

FILE: THEMENAME_theme/README.txt

FOUND 1 ERROR AND 4 WARNINGS AFFECTING 4 LINES

91 | WARNING | [ ] Line exceeds 80 characters; contains 83 | | characters (Drupal.Files.TxtFileLineLength.TooLong) 105 | WARNING | [ ] Line exceeds 80 characters; contains 85 | | characters (Drupal.Files.TxtFileLineLength.TooLong) 109 | WARNING | [ ] Line exceeds 80 characters; contains 82 | | characters (Drupal.Files.TxtFileLineLength.TooLong) 283 | WARNING | [ ] Line exceeds 80 characters; contains 82 | | characters (Drupal.Files.TxtFileLineLength.TooLong) 283 | ERROR | [x] Expected 1 newline at end of file; 0 found | | (Drupal.Files.EndFileNewline.NoneFound)

PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY

FILE: THEMENAME_theme/webpack.config.js

FOUND 1 ERROR AFFECTING 1 LINE

1 | ERROR | [x] Missing file doc comment | | (Drupal.Commenting.FileComment.Missing)

PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY

greteltrost commented 6 years ago

Fixed linter errors, updated babel presets and added clean task. Working on issues renaming theme folder.

greteltrost commented 6 years ago

Fixed issue on renaming theme folder because it didn't work on all OS. Tried bash and shell scripting, ended up using node.js for better compatibility.