Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 22c6e26

Browse files
committed
refactor(all): switch to gulp-drupal-task
1 parent 231553f commit 22c6e26

File tree

12 files changed

+102
-110
lines changed

12 files changed

+102
-110
lines changed

.editorconfig

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
1-
# EditorConfig helps developers define and maintain consistent
2-
# coding styles between different editors and IDEs
3-
# editorconfig.org
1+
# Drupal editor configuration normalization
2+
# @see http://editorconfig.org/
43

4+
# This is the top-most .editorconfig file; do not search in parent directories.
55
root = true
66

7-
7+
# All files.
88
[*]
9-
10-
# Change these settings to your own preference
9+
end_of_line = LF
1110
indent_style = space
12-
indent_size = 4
13-
14-
# We recommend you to keep these unchanged
15-
end_of_line = lf
11+
indent_size = 2
1612
charset = utf-8
1713
trim_trailing_whitespace = true
1814
insert_final_newline = true
1915

20-
[*.md]
21-
trim_trailing_whitespace = false
22-
23-
# Tab indentation (no size specified)
24-
[Makefile]
25-
indent_style = tab
26-
27-
# Matches the exact files either package.json or bower.json
28-
[{package.json,bower.json,.jscsrc,.jshintrc,.jshintrc-spec}]
29-
indent_style = space
30-
indent_size = 2
16+
[composer.{json,lock}]
17+
indent_size = 4

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
node_modules/**/*
12
/templates

.github/CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ First you'll want to clone this repo next to the repo you are working on.
44
my-project/ (repo)
55
- package.json
66
- node_modules/
7-
- gulp-drupal-theme-core/
8-
gulp-drupal-theme-core/ (repo)
7+
- gulp-drupal-stack/
8+
gulp-drupal-stack/ (repo)
99
```
1010

11-
While in `my-project/`, symlink the `gulp-drupal-theme-core/` that is a repo into your `node_modules/` directory with `npm link` like so:
11+
While in `my-project/`, symlink the `gulp-drupal-stack/` that is a repo into your `node_modules/` directory with `npm link` like so:
1212

13-
npm link ../gulp-drupal-theme-core/
13+
npm link ../gulp-drupal-stack/
1414

15-
This will replace `node_modules/gulp-drupal-theme-core/` with a symlink to the `gulp-drupal-theme-core` repo.
15+
This will replace `node_modules/gulp-drupal-stack/` with a symlink to the `gulp-drupal-stack` repo.
1616

1717
Now you can make changes and contribute!
1818

1919
## Acceptance Criteria
2020

2121
- Passes `npm test` - Travis runs this and will report it on your PR
22-
- Branch off `master` and into a `feature/name-of-it` - no `develop` branch going
22+
- Branch off `master` and into a `feature/name-of-it` - no `develop` branch going
2323
- If you add new config, add it to `gulpfile.default.yml`
2424

25-
### Bonus Points
25+
### Bonus Points
2626

2727
Adding a new test. See `tests/css/css.test.js`
2828

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
Gulp Drupal Theme - Core
2-
========================
1+
Gulp Drupal Stack
2+
=================
33

4-
![gulp-drupal-theme-core-banner](banner.png)
4+
![gulp-drupal-stack-banner](banner.png)
55

6-
[![Maintenance](https://img.shields.io/maintenance/yes/2017.svg)]()
7-
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/ovh/ux)
8-
[![travis](https://travis-ci.org/ovh-ux/gulp-drupal-theme-core.svg?branch=master)](https://travis-ci.org/ovh-ux/gulp-drupal-theme-core)
9-
[![Documentation Status](https://readthedocs.org/projects/gulp-drupal-theme-core/badge/?version=latest)](http://gulp-drupal-theme-core.readthedocs.io/en/latest/?badge=latest)
6+
[![Maintenance](https://img.shields.io/maintenance/yes/2017.svg)]()
7+
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/ovh/ux)
8+
[![travis](https://travis-ci.org/ovh-ux/gulp-drupal-stack.svg?branch=master)](https://travis-ci.org/ovh-ux/gulp-drupal-stack)
9+
[![Documentation Status](https://readthedocs.org/projects/gulp-drupal-stack/badge/?version=latest)](http://gulp-drupal-stack.readthedocs.io/en/latest/?badge=latest)
1010

1111

12-
This theme core is to be included in your main project and sets up many Gulp tasks that can work in many flexible ways by passing in different `config` objects, which can be based off of `gulpfile.default.yml` (and is merged with).
12+
This stack core is to be included in your main project and sets up many Gulp tasks that can work in many flexible ways by passing in different `config` objects, which can be based off of `gulpfile.default.yml` (and is merged with).
1313

1414

1515
## Features
@@ -25,7 +25,7 @@ All is easily configurable by changing values in your `gulpfile.yml` file in you
2525

2626
## Documentation
2727

28-
Full documentation is available [here](https://gulp-drupal-theme-core.readthedocs.io/en/latest/).
28+
Full documentation is available [here](https://gulp-drupal-stack.readthedocs.io/en/latest/).
2929

3030

3131
#### TODO

docs/features/drupal-drush.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Launch a Drupal command.
22

33
## Commands
44

5-
- `gulp cc` - Launch Drupal command (by default `drush cc all`)
6-
- `gulp watch:drupal` - Watch files and launch `gulp cc`
5+
- `gulp cr` - Launch Drupal command (by default `drush cr`)
6+
- `gulp watch:drupal` - Watch files and launch `gulp cr`
77

88
## Config
99

@@ -15,6 +15,6 @@ Launch a Drupal command.
1515
If you want to use it with [Drucker](https://github.com/ovh-ux/drucker), you need to:
1616

1717
- set the `config.drupal.dir` to `./path/to/drucker`
18-
- set the `config.drupal.command` to `. load-env && drush cc all`
18+
- set the `config.drupal.command` to `. load-env && drush cr`
1919

2020
---

docs/index.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Gulp Drupal Theme - Core
2-
========================
1+
Gulp Drupal Stack
2+
=================
33

4-
![gulp-drupal-theme-core-banner](banner.png)
4+
![gulp-drupal-stack-banner](banner.png)
55

6-
This theme core is to be included in your main project and sets up many Gulp tasks that can work in many flexible ways by passing in different `config` objects, which can be based off of `gulpfile.default.yml` (and is merged with).
6+
This stack core is to be included in your main project and sets up many Gulp tasks that can work in many flexible ways by passing in different `config` objects, which can be based off of `gulpfile.default.yml` (and is merged with).
77

88

99
## Features
@@ -28,11 +28,13 @@ All is easily configurable by changing values in your `gulpfile.yml` file in you
2828
Follow theses steps:
2929

3030
```bash
31-
$ cd <your-theme>
31+
$ cd <your-theme-or-module>
32+
# (optional) init a new npm module
33+
$ npm init
3234
# Install it
33-
$ npm install gulp-drupal-theme-core --save-dev
35+
$ npm install gulp-drupal-stack --save-dev
3436
# Create a gulpfile.js
35-
$ cp node_modules/gulp-drupal-theme-core/templates/gulpfile.js ./
37+
$ cp node_modules/gulp-drupal-stack/templates/gulpfile.js ./
3638
# Create a gulpfile.yml (config file)
3739
$ vi gulpfile.yml
3840
# <set the config that you want, and save it>

docs/usage.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ You can find all the available options and defaults settings inside the `gulpfil
1616
## Commands
1717

1818
- `gulp` - Run all compile tasks, and watch for changes
19-
- `gulp compile` - Run all compile tasks
19+
- `gulp compile` or `gulp build` - Run all compile tasks
20+
- `gulp test` - Run all tests tasks (unit tests, ...)
2021
- `gulp validate` - Run all validate tasks (eslint, ...)
2122
- `gulp watch` - Watch for changes
2223
- `gulp clean` - Run all clean tasks
@@ -35,27 +36,27 @@ In order to use Babel, you need to create a `.babelrc` into your project, with t
3536

3637
**Example:**
3738

38-
Run:
39+
Run:
3940
```bash
4041
$ npm install --save-dev babel-preset-es2015
4142
```
4243
And create a `.babelrc` file:
4344
```json
4445
{
45-
"presets": ["es2015"]
46+
"presets": ["es2015"]
4647
}
4748
```
4849

4950
### ESLint
5051

51-
You need to create a `.eslintrc.js` file, and specify whitch rules that you want (`eslint-config-ovh` is recommanded).
52+
You need to create a `.eslintrc.js` file, and specify whitch rules that you want (`eslint-config-drupal` is recommanded).
5253

5354
**Example:**
5455

55-
Run:
56+
Run:
5657
```bash
5758
$ npm install --save-dev babel-eslint
58-
$ npm install --save-dev eslint-config-ovh
59+
$ npm install --save-dev eslint-config-drupal
5960
```
6061
And create a `.eslintrc.js` file:
6162
```javascript
@@ -64,33 +65,27 @@ And create a `.eslintrc.js` file:
6465
// individual rule reference: http://eslint.org/docs/rules/NAME-OF-RULE
6566
6667
module.exports = {
67-
extends: "ovh/configs/es6-browser",
68-
globals: {
69-
Drupal: true,
70-
jQuery: true,
71-
_: true,
72-
domready: true
73-
}
68+
extends: 'eslint-config-drupal'
7469
};
7570
```
7671

7772
### StyleLint
7873

79-
You need to create a `.stylelintrc.js` file, and specify whitch rules that you want (`stylelint-config-ovh` is recommanded).
74+
You need to create a `.stylelintrc.js` file, and specify whitch rules that you want (`stylelint-config-drupal` is recommanded).
8075

8176
**Example:**
8277

83-
Run:
78+
Run:
8479
```bash
8580
$ npm install --save-dev stylelint-scss
86-
$ npm install --save-dev stylelint-config-ovh
81+
$ npm install --save-dev stylelint-config-drupal
8782
```
8883
And create a `.stylelintrc.js` file:
8984
```javascript
90-
"use strict";
85+
'use strict';
9186
9287
module.exports = {
93-
"extends": "stylelint-config-ovh/configs/scss"
88+
'extends': 'stylelint-config-drupal'
9489
};
9590
```
9691

gulpfile.default.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ css:
88
- scss/**/*.scss
99
flattenDestOutput: true
1010
lint:
11-
enabled: true
11+
enabled: false
1212
failOnError: true
1313
extraSrc:
1414
- scss/**/*.scss
@@ -21,7 +21,7 @@ css:
2121
- last 3 versions
2222
- IE >= 10
2323
includePaths:
24-
- "./node_modules"
24+
- './node_modules'
2525
sassdoc:
2626
enabled: false
2727
dest: dist/sassdoc
@@ -47,14 +47,18 @@ js:
4747
babel: true
4848
bundleBower: false
4949
bundleBowerExclusions: []
50-
bowerBasePath: "./"
50+
bowerBasePath: './'
5151
eslint:
52-
enabled: true
52+
enabled: false
5353
src:
5454
- js/**/*.js
5555
webpack:
5656
enabled: false
5757
config: ./webpack.config.js
58+
eslint:
59+
enabled: false
60+
src:
61+
- js/**/*.js
5862
icons:
5963
enabled: false
6064
src: images/icons/*.svg
@@ -68,7 +72,7 @@ icons:
6872
templates:
6973
enabled: true
7074
css:
71-
src: node_modules/gulp-drupal-theme-core/templates/_icons.scss
75+
src: node_modules/gulp-drupal-stack/templates/_icons.scss
7276
dest: scss/base/
7377
# demo:
7478
# src: templates/component/_icons.twig.tpl
@@ -82,7 +86,7 @@ browserSync:
8286
enabled: false
8387
port: 3050
8488
watchFiles: []
85-
baseDir: "./"
89+
baseDir: './'
8690
startPath: pattern-lab/public/
8791
openBrowserAtStart: false
8892
browser:
@@ -95,5 +99,5 @@ drupal:
9599
watch:
96100
- template.php
97101
- templates/**
98-
command: drush cc all
99-
dir: "./"
102+
command: drush cr
103+
dir: './'

lib/drupal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = (gulp, config, tasks) => {
1515

1616
clearDrupalCache.description = 'Clear Drupal Cache';
1717

18-
gulp.task('cc', clearDrupalCache);
18+
gulp.task('cr', clearDrupalCache);
1919

2020
gulp.task('watch:drupal', () => {
2121
gulp.watch(config.drupal.watch, clearDrupalCache);

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
site_name: Gulp Drupal Theme - Core
1+
site_name: Gulp Drupal Stack
22
docs_dir: docs
33

44
pages:

0 commit comments

Comments
 (0)