Skip to content

Commit 59487ca

Browse files
committed
Replaced Grunt with NPM scripts in demo theme.
1 parent c9339d0 commit 59487ca

57 files changed

Lines changed: 2781 additions & 2408 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore.artifact

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ web/sites/default/files
1717
web/sites/simpletest
1818

1919
# Ignore non-production Drupal Scaffold files.
20-
web/sites/default/example.services.local.yml
21-
web/sites/default/example.settings.local.php
2220
web/sites/default/default.services.local.yml
2321
web/sites/default/default.settings.local.php
22+
web/sites/default/example.services.local.yml
23+
web/sites/default/example.settings.local.php
2424

2525
# Ignore custom theme asset sources.
26+
web/themes/custom/your_site_theme/.eslintrc.json
2627
web/themes/custom/your_site_theme/fonts
2728
web/themes/custom/your_site_theme/images
2829
web/themes/custom/your_site_theme/js
29-
web/themes/custom/your_site_theme/scss
30-
web/themes/custom/your_site_theme/Gruntfile.js
30+
web/themes/custom/your_site_theme/node_modules
3131
web/themes/custom/your_site_theme/package.json
32+
web/themes/custom/your_site_theme/postcss.config.js
33+
web/themes/custom/your_site_theme/scss
3234
web/themes/custom/your_site_theme/yarn.lock
33-
web/themes/custom/your_site_theme/.eslintrc.json
34-
web/themes/custom/your_site_theme/node_modules
3535

3636
#;< HOSTING_ACQUIA
3737
# Do not ignore Acquia hooks.
Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
11
{
2-
"extends": "../../../core/.eslintrc.legacy.json"
2+
"extends": [
3+
"airbnb-base",
4+
"plugin:prettier/recommended",
5+
"plugin:yml/recommended"
6+
],
7+
"root": true,
8+
"env": {
9+
"browser": true,
10+
"es6": true,
11+
"node": true
12+
},
13+
"parserOptions": {
14+
"ecmaVersion": 2020
15+
},
16+
"plugins": [
17+
"jsdoc"
18+
],
19+
"globals": {
20+
"Drupal": true,
21+
"drupalSettings": true,
22+
"drupalTranslations": true,
23+
"jQuery": true,
24+
"_": true,
25+
"Cookies": true,
26+
"Backbone": true,
27+
"htmx": true,
28+
"loadjs": true,
29+
"Shepherd": true,
30+
"Sortable": true,
31+
"once": true,
32+
"CKEditor5": true,
33+
"tabbable": true,
34+
"transliterate": true,
35+
"bodyScrollLock" : true,
36+
"FloatingUIDOM": true
37+
},
38+
"rules": {
39+
"prettier/prettier": "error",
40+
"consistent-return": ["off"],
41+
"no-underscore-dangle": ["off"],
42+
"max-nested-callbacks": ["warn", 3],
43+
"import/no-mutable-exports": ["warn"],
44+
"no-plusplus": ["warn", {
45+
"allowForLoopAfterthoughts": true
46+
}],
47+
"no-param-reassign": ["off"],
48+
"no-prototype-builtins": ["off"],
49+
"jsdoc/require-returns": ["off"],
50+
"jsdoc/require-returns-type": ["warn"],
51+
"jsdoc/require-returns-description": ["warn"],
52+
"jsdoc/require-returns-check": ["warn"],
53+
"jsdoc/require-param": ["warn"],
54+
"jsdoc/require-param-type": ["warn"],
55+
"jsdoc/require-param-description": ["warn"],
56+
"jsdoc/check-param-names": ["warn"],
57+
"jsdoc/valid-types": ["warn"],
58+
"jsdoc/require-param-name": ["warn"],
59+
"jsdoc/check-tag-names": ["warn"],
60+
"no-unused-vars": ["warn"],
61+
"operator-linebreak": ["error", "after", { "overrides": { "?": "ignore", ":": "ignore" } }],
62+
"yml/indent": ["error", 2]
63+
},
64+
"settings": {
65+
"jsdoc": {
66+
"tagNamePreference": {
67+
"returns": "return",
68+
"property": "prop"
69+
}
70+
}
71+
}
372
}

.vortex/installer/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/Gruntfile.js

Lines changed: 0 additions & 171 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Your Site Theme
2+
3+
Custom Drupal theme for the project.
4+
5+
## Requirements
6+
7+
- Node.js (LTS version recommended)
8+
- Yarn
9+
10+
## Installation
11+
12+
```bash
13+
yarn install
14+
```
15+
16+
## Commands
17+
18+
| Command | Description |
19+
|----------------------|------------------------------------------------|
20+
| `yarn run build` | Production build (minified, no source maps) |
21+
| `yarn run build-dev` | Development build (expanded, with source maps) |
22+
| `yarn run watch` | Watch for changes and rebuild automatically |
23+
| `yarn run lint` | Check code style (JS and SCSS) |
24+
| `yarn run lint-fix` | Fix code style issues automatically |
Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
/**
2-
* @file
3-
* Global theme behaviors.
2+
* @file Global theme behaviors.
3+
* @param $
4+
* @param Drupal
5+
* @global Drupal, jQuery
46
*/
57

6-
(function ($, Drupal) {
7-
'use strict';
8+
/**
9+
* Global theme behaviors.
10+
*
11+
* @param {jQuery} $ The jQuery object.
12+
* @param {Drupal} Drupal The Drupal object.
13+
*/
14+
(function StarWarsBehaviors($, Drupal) {
815
Drupal.behaviors.star_wars = {
9-
attach: function (context) {
10-
}
16+
attach(context) {
17+
// give me example code here that would be using context with body
18+
$(context)
19+
.find('body')
20+
.once('star-wars-theme')
21+
.each(function iterateBody() {
22+
// Example: Add a class to the body element.
23+
$(this).addClass('star-wars-theme-processed');
24+
});
25+
},
1126
};
12-
}(jQuery, Drupal));
27+
})(jQuery, Drupal);

0 commit comments

Comments
 (0)