Skip to content

Commit 0141240

Browse files
init
0 parents  commit 0141240

31 files changed

+1666
-0
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env"
4+
]
5+
}

.eslintrc

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"env": {
3+
"amd": true,
4+
"browser": true,
5+
"jasmine": true,
6+
"node": true,
7+
"es6": true
8+
},
9+
parserOptions: {
10+
ecmaVersion: 2017,
11+
"ecmaFeatures": {
12+
"experimentalObjectRestSpread": true
13+
}
14+
},
15+
"rules": {
16+
"consistent-return": 2,
17+
"eqeqeq": [2, "smart"],
18+
"guard-for-in": 2,
19+
"indent": ["error", 4],
20+
"lines-around-comment": [
21+
2,
22+
{
23+
"beforeBlockComment": true
24+
}
25+
],
26+
"max-depth": [2, 2],
27+
"max-len": [2, 120, 4],
28+
"max-nested-callbacks": [2, 3],
29+
"newline-after-var": 2,
30+
"no-alert": 2,
31+
"no-array-constructor": 2,
32+
"no-caller": 2,
33+
"no-catch-shadow": 2,
34+
"no-cond-assign": 2,
35+
"no-constant-condition": 2,
36+
"no-debugger": 2,
37+
"no-else-return": 2,
38+
"no-eval": 2,
39+
"no-ex-assign": 2,
40+
"no-extend-native": 2,
41+
"no-extra-bind": 2,
42+
"no-extra-boolean-cast": 2,
43+
"no-extra-parens": 2,
44+
"no-extra-semi": 2,
45+
"no-fallthrough": 2,
46+
"no-floating-decimal": 2,
47+
"no-func-assign": 2,
48+
"no-implied-eval": 2,
49+
"no-inner-declarations": 2,
50+
"no-invalid-regexp": 2,
51+
"no-lone-blocks": 2,
52+
"no-lonely-if": 2,
53+
"no-loop-func": 2,
54+
"no-multi-str": 2,
55+
"no-native-reassign": 2,
56+
"no-negated-in-lhs": 2,
57+
"no-new-object": 2,
58+
"no-proto": 2,
59+
"no-redeclare": 2,
60+
"no-regex-spaces": 2,
61+
"no-return-assign": 2,
62+
"no-self-compare": 2,
63+
"no-shadow": 2,
64+
"no-undef": 2,
65+
"no-undef-init": 2,
66+
"no-unreachable": 2,
67+
"no-unused-vars": [
68+
2,
69+
{
70+
"args": "after-used",
71+
"vars": "all"
72+
}
73+
],
74+
"no-use-before-define": 2,
75+
"no-with": 2,
76+
"operator-assignment": [2, "always"],
77+
"radix": 2,
78+
"semi": [2, "always"],
79+
"semi-spacing": 2,
80+
"space-before-blocks": 2,
81+
"use-isnan": 2,
82+
"valid-typeof": 2,
83+
"vars-on-top": 2,
84+
"quotes": [2, "single", { "avoidEscape": true }]
85+
}
86+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

.stylelintrc

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{
2+
"plugins": [
3+
"stylelint-order"
4+
],
5+
"rules": {
6+
# stylelint-order plugin
7+
"order/order": [
8+
"less-mixins",
9+
"at-variables",
10+
"declarations"
11+
],
12+
"order/properties-alphabetical-order": true,
13+
# Possible errors
14+
"color-no-invalid-hex": true,
15+
"font-family-no-duplicate-names": true,
16+
"font-family-no-missing-generic-family-keyword": true,
17+
"function-calc-no-unspaced-operator": true,
18+
"function-linear-gradient-no-nonstandard-direction": true,
19+
"string-no-newline": true,
20+
"unit-no-unknown": true,
21+
"property-no-unknown": true,
22+
"keyframe-declaration-no-important": true,
23+
"declaration-block-no-duplicate-properties": true,
24+
"declaration-block-no-shorthand-property-overrides": true,
25+
"block-no-empty": true,
26+
"selector-pseudo-class-no-unknown": true,
27+
"selector-pseudo-element-no-unknown": true,
28+
"selector-type-no-unknown": true,
29+
"media-feature-name-no-unknown": true,
30+
"at-rule-no-unknown": true,
31+
"comment-no-empty": true,
32+
"no-duplicate-at-import-rules": true,
33+
"no-duplicate-selectors": true,
34+
"no-empty-source": true,
35+
"no-extra-semicolons": true,
36+
"no-invalid-double-slash-comments": true,
37+
# Limit language features
38+
"color-named": "never",
39+
"function-url-no-scheme-relative": true,
40+
"shorthand-property-no-redundant-values": true,
41+
"declaration-block-no-redundant-longhand-properties": [
42+
true, {
43+
"ignoreShorthands": [
44+
"font"
45+
]
46+
}
47+
],
48+
"declaration-no-important": true,
49+
"declaration-block-single-line-max-declarations": 1,
50+
"selector-max-empty-lines": 0,
51+
"no-unknown-animations": true,
52+
# Stylistic issues
53+
"color-hex-case": "lower",
54+
"color-hex-length": "short",
55+
"font-family-name-quotes": "always-where-recommended",
56+
"font-weight-notation": "numeric",
57+
"function-comma-space-after": "always-single-line",
58+
"function-comma-space-before": "never",
59+
"function-max-empty-lines": 0,
60+
"function-name-case": "lower",
61+
"function-comma-newline-after": "always-multi-line",
62+
"function-parentheses-newline-inside": "always-multi-line",
63+
"function-parentheses-space-inside": "never",
64+
"function-url-quotes": "always",
65+
"function-whitespace-after": "always",
66+
"number-leading-zero": "never",
67+
"number-no-trailing-zeros": true,
68+
"string-quotes": "single",
69+
"length-zero-no-unit": true,
70+
"unit-case": "lower",
71+
"value-keyword-case": "lower",
72+
"value-list-comma-newline-after": "always-multi-line",
73+
"value-list-comma-space-after": "always-single-line",
74+
"value-list-comma-space-before": "never",
75+
"value-list-max-empty-lines": 0,
76+
"property-case": "lower",
77+
"declaration-bang-space-after": "never",
78+
"declaration-bang-space-before": "always",
79+
"declaration-colon-space-after": "always-single-line",
80+
"declaration-colon-space-before": "never",
81+
"declaration-empty-line-before": "never",
82+
"declaration-block-semicolon-newline-after": "always-multi-line",
83+
"declaration-block-semicolon-newline-before": "never-multi-line",
84+
"declaration-block-semicolon-space-after": "always-single-line",
85+
"declaration-block-semicolon-space-before": "never",
86+
"declaration-block-trailing-semicolon": "always",
87+
"block-closing-brace-empty-line-before": "never",
88+
"block-closing-brace-newline-after": "always",
89+
"block-closing-brace-newline-before": "always-multi-line",
90+
"block-closing-brace-space-after": "always-single-line",
91+
"block-closing-brace-space-before": "always-single-line",
92+
"block-opening-brace-newline-after": "always-multi-line",
93+
"block-opening-brace-space-after": "always-single-line",
94+
"block-opening-brace-space-before": "always",
95+
"selector-attribute-brackets-space-inside": "never",
96+
"selector-attribute-operator-space-after": "never",
97+
"selector-attribute-operator-space-before": "never",
98+
"selector-attribute-quotes": "always",
99+
"selector-combinator-space-after": "always",
100+
"selector-combinator-space-before": "always",
101+
"selector-descendant-combinator-no-non-space": true,
102+
"selector-pseudo-class-case": "lower",
103+
"selector-pseudo-class-parentheses-space-inside": "never",
104+
"selector-pseudo-element-case": "lower",
105+
"selector-pseudo-element-colon-notation": "single",
106+
"selector-type-case": "lower",
107+
"selector-list-comma-newline-after": "always",
108+
"selector-list-comma-newline-before": "never-multi-line",
109+
"selector-list-comma-space-after": "always-single-line",
110+
"selector-list-comma-space-before": "never",
111+
"media-feature-colon-space-after": "always",
112+
"media-feature-colon-space-before": "never",
113+
"media-feature-name-case": "lower",
114+
"media-feature-parentheses-space-inside": "never",
115+
"media-feature-range-operator-space-before": "always",
116+
"media-query-list-comma-newline-after": "always-multi-line",
117+
"media-query-list-comma-newline-before": "never-multi-line",
118+
"media-query-list-comma-space-after": "always-single-line",
119+
"media-query-list-comma-space-before": "never",
120+
"at-rule-empty-line-before": [
121+
"always",
122+
{
123+
"except": ["first-nested"],
124+
"ignore": ["after-comment"]
125+
}
126+
],
127+
"at-rule-name-case": "lower",
128+
"at-rule-name-space-after": "always-single-line",
129+
"at-rule-semicolon-newline-after": "always",
130+
"at-rule-semicolon-space-before": "never",
131+
"comment-empty-line-before": [
132+
"always",
133+
{
134+
"except": ["first-nested"],
135+
"ignore": ["stylelint-commands"]
136+
}
137+
],
138+
"comment-whitespace-inside": "always",
139+
"indentation": 4,
140+
"max-empty-lines": 1,
141+
"max-line-length": 120,
142+
"no-eol-whitespace": true
143+
}
144+
}

README.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Getting Started
2+
3+
### Check for Node and NPM
4+
5+
Make sure that you've installed Node and NPM before attempting to install gulp.
6+
```
7+
$ node -v
8+
```
9+
```
10+
$ npm -v
11+
```
12+
### Install Gulp globally
13+
14+
```
15+
$ npm install gulp -g
16+
```
17+
18+
## Project integration
19+
20+
### Composer
21+
22+
Add gulp dependence to project's `composer.json`
23+
24+
```
25+
"require": {
26+
"bobmotor/magento-2-gulp":"~1.2.0"
27+
}
28+
```
29+
30+
Run
31+
32+
```
33+
$ composer update --prefer-source
34+
```
35+
36+
Install modules listed as dependencies in `package.json`
37+
38+
```
39+
$ npm install
40+
```
41+
42+
### Manually
43+
44+
Copy source files to your project root directory
45+
46+
47+
Install modules listed as dependencies in `package.json`
48+
49+
```
50+
$ npm install
51+
```
52+
53+
## Configuration
54+
55+
Rename the following files in your project root directory
56+
57+
* `package.json.sample-aws` to `package.json`
58+
59+
Check or set theme configuration in the `dev/tools/grunt/configs/themes.js`
60+
61+
```
62+
module.exports = {
63+
...
64+
<Theme>: {
65+
area: 'frontend|adminhtml',
66+
name: '<Vendor>/<Theme>',
67+
locale: locale,
68+
files: [
69+
'css/styles-m',
70+
'css/styles-l',
71+
],
72+
dsl: 'less'
73+
}
74+
...
75+
}
76+
```
77+
78+
Example:
79+
80+
```
81+
module.exports = {
82+
...
83+
capezio: {
84+
area: 'frontend',
85+
name: 'Aws/capezio',
86+
locale: 'en_US',
87+
files: [
88+
'css/styles-m',
89+
'css/styles-l'
90+
],
91+
dsl: 'less'
92+
}
93+
...
94+
}
95+
```
96+
97+
To configure BrowserSync set hostnames in the `dev/tools/gulp/constants/bsConfig.js`
98+
99+
```
100+
module.exports = {
101+
proxy: 'http://hostname.loc/',
102+
host: 'hostname.loc',
103+
tunnel: 'hostname',
104+
open: false
105+
};
106+
```
107+
108+
Example:
109+
110+
```
111+
module.exports = {
112+
proxy: 'http://capezio.loc/',
113+
host: 'capezio.loc',
114+
tunnel: 'capezio',
115+
open: false
116+
};
117+
```
118+
119+
### How to use
120+
121+
In project root dir run `gulp [command] --[package] --[arguments]`
122+
123+
Avaliable commands:
124+
125+
```
126+
default, help Display this help message
127+
cache-flush Flush Magento cache
128+
clean Remove cached files (pub/static/*, var/*)
129+
exec Republishes symlinks to the source files
130+
less Compile LESS to CSS
131+
watch Watch for theme files
132+
es6 Compile ES6+ to ES5
133+
svg Create svg sprite
134+
```
135+
136+
Options:
137+
138+
```
139+
--[package] Package name (optional field). Need to be the first option. Ex.: --blank
140+
--min Minify css files
141+
--map Add maping to CSS files
142+
--live Enable livereload
143+
--bs Enable browsersync
144+
```
145+
146+
Example:
147+
148+
```
149+
gulp clean --capezio && gulp exec --capezio && gulp less --capezio --map
150+
```
151+
152+
Note:
153+
154+
* ES6 files should be placed at `.../web/js/src/*.js`. Compiled files will be in the `.../web/js/dist/`
155+
* svg icons (`*.svg`) need to be uploaded to `app/design/frontend/<your_vendor_name>/<your_theme_name>/web/images/icons/`

0 commit comments

Comments
 (0)