-
-
Notifications
You must be signed in to change notification settings - Fork 28
Replaced Grunt with NPM scripts in demo theme. #2214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 70 additions & 1 deletion
71
...aller/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/.eslintrc.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,72 @@ | ||
| { | ||
| "extends": "../../../core/.eslintrc.legacy.json" | ||
| "extends": [ | ||
| "airbnb-base", | ||
| "plugin:prettier/recommended", | ||
| "plugin:yml/recommended" | ||
| ], | ||
| "root": true, | ||
| "env": { | ||
| "browser": true, | ||
| "es6": true, | ||
| "node": true | ||
| }, | ||
| "parserOptions": { | ||
| "ecmaVersion": 2020 | ||
| }, | ||
| "plugins": [ | ||
| "jsdoc" | ||
| ], | ||
| "globals": { | ||
| "Drupal": true, | ||
| "drupalSettings": true, | ||
| "drupalTranslations": true, | ||
| "jQuery": true, | ||
| "_": true, | ||
| "Cookies": true, | ||
| "Backbone": true, | ||
| "htmx": true, | ||
| "loadjs": true, | ||
| "Shepherd": true, | ||
| "Sortable": true, | ||
| "once": true, | ||
| "CKEditor5": true, | ||
| "tabbable": true, | ||
| "transliterate": true, | ||
| "bodyScrollLock" : true, | ||
| "FloatingUIDOM": true | ||
| }, | ||
| "rules": { | ||
| "prettier/prettier": "error", | ||
| "consistent-return": ["off"], | ||
| "no-underscore-dangle": ["off"], | ||
| "max-nested-callbacks": ["warn", 3], | ||
| "import/no-mutable-exports": ["warn"], | ||
| "no-plusplus": ["warn", { | ||
| "allowForLoopAfterthoughts": true | ||
| }], | ||
| "no-param-reassign": ["off"], | ||
| "no-prototype-builtins": ["off"], | ||
| "jsdoc/require-returns": ["off"], | ||
| "jsdoc/require-returns-type": ["warn"], | ||
| "jsdoc/require-returns-description": ["warn"], | ||
| "jsdoc/require-returns-check": ["warn"], | ||
| "jsdoc/require-param": ["warn"], | ||
| "jsdoc/require-param-type": ["warn"], | ||
| "jsdoc/require-param-description": ["warn"], | ||
| "jsdoc/check-param-names": ["warn"], | ||
| "jsdoc/valid-types": ["warn"], | ||
| "jsdoc/require-param-name": ["warn"], | ||
| "jsdoc/check-tag-names": ["warn"], | ||
| "no-unused-vars": ["warn"], | ||
| "operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }], | ||
| "yml/indent": ["error", 2] | ||
| }, | ||
| "settings": { | ||
| "jsdoc": { | ||
| "tagNamePreference": { | ||
| "returns": "return", | ||
| "property": "prop" | ||
| } | ||
| } | ||
| } | ||
| } |
171 changes: 0 additions & 171 deletions
171
...staller/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/Gruntfile.js
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
.../tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Your Site Theme | ||
|
|
||
| Custom Drupal theme for the project. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Node.js (LTS version recommended) | ||
| - Yarn | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| yarn install | ||
| ``` | ||
|
|
||
| ## Commands | ||
|
|
||
| | Command | Description | | ||
| |----------------------|------------------------------------------------| | ||
| | `yarn run build` | Production build (minified, no source maps) | | ||
| | `yarn run build-dev` | Development build (expanded, with source maps) | | ||
| | `yarn run watch` | Watch for changes and rebuild automatically | | ||
| | `yarn run lint` | Check code style (JS and SCSS) | | ||
| | `yarn run lint-fix` | Fix code style issues automatically | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider more robust JSON parsing for theme detection.
The current string search for 'build-dev' in package.json works but could theoretically match in comments or string values. For more robust detection, consider parsing the JSON and checking for the existence of
scripts.build-dev.🔎 Optional improvement using JSON parsing
protected static function isVortexTheme(string $dir): bool { $c1 = file_exists($dir . '/scss/_variables.scss'); $c2 = file_exists($dir . '/package.json'); - $c3 = File::contains($dir . '/package.json', 'build-dev'); + $c3 = false; + if ($c2) { + $package = json_decode(file_get_contents($dir . '/package.json'), true); + $c3 = isset($package['scripts']['build-dev']); + } return $c1 && $c2 && $c3; }