Skip to content

Commit 6a935c1

Browse files
committed
Added JS and CSS example libraries to the ys_base and added module CSS and JS linting.
1 parent 341116a commit 6a935c1

77 files changed

Lines changed: 6731 additions & 63 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.

.ahoy.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ commands:
2323
ahoy up --build --force-recreate # Start the stack.
2424
ahoy composer install # Install Composer dependencies.
2525
ahoy fei # Install front-end dependencies.
26+
#;< DRUPAL_THEME
2627
ahoy fe # Build front-end assets.
28+
#;> DRUPAL_THEME
2729
ahoy provision # Provision the site.
2830
VORTEX_SHOW_LOGIN=1 ahoy info # Show information and a login link.
2931
@@ -160,11 +162,15 @@ commands:
160162
ahoy confirm "All containers and build files will be removed. Proceed?" &&
161163
AHOY_CONFIRM_RESPONSE=y ahoy down && ./scripts/vortex/reset.sh "$@"
162164
163-
#;< DRUPAL_THEME
164165
fei:
165166
usage: Install front-end assets.
166-
cmd: ahoy cli "yarn --cwd=${WEBROOT}/themes/custom/${DRUPAL_THEME} install"
167+
cmd: |
168+
ahoy cli "yarn install --frozen-lockfile"
169+
#;< DRUPAL_THEME
170+
ahoy cli "yarn --cwd=${WEBROOT}/themes/custom/${DRUPAL_THEME} install --frozen-lock"
171+
#;> DRUPAL_THEME
167172
173+
#;< DRUPAL_THEME
168174
fe:
169175
usage: Build front-end assets.
170176
cmd: ahoy cli "cd ${WEBROOT}/themes/custom/${DRUPAL_THEME} && npm run build"
@@ -192,13 +198,14 @@ commands:
192198
ahoy cli vendor/bin/rector --clear-cache --dry-run
193199
ahoy cli vendor/bin/phpmd . text phpmd.xml
194200
195-
#;< DRUPAL_THEME
196201
lint-fe:
197202
usage: Lint front-end code.
198203
cmd: |
199204
ahoy cli vendor/bin/twig-cs-fixer lint
205+
ahoy cli "yarn run lint"
206+
#;< DRUPAL_THEME
200207
ahoy cli "yarn run --cwd=\${WEBROOT}/themes/custom/\${DRUPAL_THEME} lint"
201-
#;> DRUPAL_THEME
208+
#;> DRUPAL_THEME
202209
203210
lint-tests:
204211
usage: Lint tests code.
@@ -215,13 +222,14 @@ commands:
215222
ahoy cli vendor/bin/rector --clear-cache
216223
ahoy cli vendor/bin/phpcbf
217224
218-
#;< DRUPAL_THEME
219225
lint-fe-fix:
220226
usage: Fix lint issues of front-end code.
221227
cmd: |
222228
ahoy cli vendor/bin/twig-cs-fixer lint --fix
229+
ahoy cli "yarn run lint-fix"
230+
#;< DRUPAL_THEME
223231
ahoy cli "yarn run --cwd=\${WEBROOT}/themes/custom/\${DRUPAL_THEME} lint-fix"
224-
#;> DRUPAL_THEME
232+
#;> DRUPAL_THEME
225233
226234
test:
227235
usage: Run all tests.

.circleci/config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,10 @@ jobs:
263263
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c " \
264264
if [ -n \"${GITHUB_TOKEN:-}\" ]; then export COMPOSER_AUTH='{\"github-oauth\": {\"github.com\": \"${GITHUB_TOKEN-}\"}}'; fi && \
265265
COMPOSER_MEMORY_LIMIT=-1 composer --ansi install --prefer-dist"
266+
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "yarn install --frozen-lockfile"
266267
267268
- run:
268-
name: Validate Composer configuration normalized
269+
name: Validate Composer configuration is normalized
269270
command: docker compose exec -T cli composer normalize --dry-run || [ "${VORTEX_CI_COMPOSER_NORMALIZE_IGNORE_FAILURE:-0}" -eq 1 ]
270271

271272
- run:
@@ -293,8 +294,14 @@ jobs:
293294
command: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features || [ "${VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE:-0}" -eq 1 ]
294295

295296
- run:
296-
name: Lint code with NodeJS linters
297+
name: Lint module code with NodeJS linters
298+
command: docker compose exec -T cli bash -c "yarn run lint" || [ "${VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE:-0}" -eq 1 ]
299+
300+
#;< DRUPAL_THEME
301+
- run:
302+
name: Lint theme code with NodeJS linters
297303
command: docker compose exec -T cli bash -c "yarn --cwd=\${WEBROOT}/themes/custom/\${DRUPAL_THEME} run lint" || [ "${VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE:-0}" -eq 1 ]
304+
#;> DRUPAL_THEME
298305

299306
- run:
300307
name: Provision site

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ drush/contrib/
2929
!.docker/scripts
3030
!.env
3131
!.eslintrc.json
32+
!.eslintignore
3233
!.sass-lint.yml
34+
!.stylelintrc.js
3335
!.twig-cs-fixer.php
3436
!gherkinlint.json
3537
!Gruntfile.js

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
vendor/
3+
web/core/
4+
web/libraries/
5+
web/modules/contrib/
6+
web/profiles/contrib/
7+
web/themes/contrib/
8+
web/sites/*/files/
9+
*.min.js
10+
*.min.css

.eslintrc.json

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
{
2+
"extends": "eslint:recommended",
3+
"root": true,
4+
"env": {
5+
"browser": true
6+
},
7+
"parserOptions": {
8+
"ecmaVersion": 2020
9+
},
10+
"globals": {
11+
"Drupal": true,
12+
"drupalSettings": true,
13+
"drupalTranslations": true,
14+
"domready": true,
15+
"jQuery": true,
16+
"_": true,
17+
"matchMedia": true,
18+
"Backbone": true
19+
},
20+
"rules": {
21+
"array-bracket-spacing": [
22+
"error",
23+
"never"
24+
],
25+
"block-scoped-var": "error",
26+
"brace-style": [
27+
"error",
28+
"stroustrup",
29+
{
30+
"allowSingleLine": true
31+
}
32+
],
33+
"comma-dangle": [
34+
"error",
35+
"never"
36+
],
37+
"comma-spacing": "error",
38+
"comma-style": [
39+
"error",
40+
"last"
41+
],
42+
"computed-property-spacing": [
43+
"error",
44+
"never"
45+
],
46+
"curly": [
47+
"error",
48+
"all"
49+
],
50+
"eol-last": "error",
51+
"eqeqeq": [
52+
"error",
53+
"smart"
54+
],
55+
"guard-for-in": "error",
56+
"indent": [
57+
"error",
58+
2,
59+
{
60+
"SwitchCase": 1
61+
}
62+
],
63+
"key-spacing": [
64+
"error",
65+
{
66+
"beforeColon": false,
67+
"afterColon": true
68+
}
69+
],
70+
"keyword-spacing": [
71+
"error",
72+
{
73+
"before": true,
74+
"after": true
75+
}
76+
],
77+
"linebreak-style": [
78+
"error",
79+
"unix"
80+
],
81+
"lines-around-comment": [
82+
"error",
83+
{
84+
"beforeBlockComment": true,
85+
"afterBlockComment": false
86+
}
87+
],
88+
"new-parens": "error",
89+
"no-array-constructor": "error",
90+
"no-caller": "error",
91+
"no-catch-shadow": "error",
92+
"no-eval": "error",
93+
"no-extend-native": "error",
94+
"no-extra-bind": "error",
95+
"no-extra-parens": [
96+
"error",
97+
"functions"
98+
],
99+
"no-implied-eval": "error",
100+
"no-iterator": "error",
101+
"no-label-var": "error",
102+
"no-labels": "error",
103+
"no-lone-blocks": "error",
104+
"no-loop-func": "error",
105+
"no-multi-spaces": "error",
106+
"no-multi-str": "error",
107+
"no-native-reassign": "error",
108+
"no-nested-ternary": "error",
109+
"no-new-func": "error",
110+
"no-new-object": "error",
111+
"no-new-wrappers": "error",
112+
"no-octal-escape": "error",
113+
"no-process-exit": "error",
114+
"no-proto": "error",
115+
"no-return-assign": "error",
116+
"no-script-url": "error",
117+
"no-sequences": "error",
118+
"no-shadow-restricted-names": "error",
119+
"no-spaced-func": "error",
120+
"no-trailing-spaces": "error",
121+
"no-undef-init": "error",
122+
"no-undefined": "error",
123+
"no-unused-expressions": "error",
124+
"no-unused-vars": [
125+
"error",
126+
{
127+
"vars": "all",
128+
"args": "none"
129+
}
130+
],
131+
"no-with": "error",
132+
"object-curly-spacing": [
133+
"error",
134+
"never"
135+
],
136+
"one-var": [
137+
"error",
138+
"never"
139+
],
140+
"quote-props": [
141+
"error",
142+
"consistent-as-needed"
143+
],
144+
"quotes": [
145+
"error",
146+
"single",
147+
"avoid-escape"
148+
],
149+
"semi": [
150+
"error",
151+
"always"
152+
],
153+
"semi-spacing": [
154+
"error",
155+
{
156+
"before": false,
157+
"after": true
158+
}
159+
],
160+
"space-before-blocks": [
161+
"error",
162+
"always"
163+
],
164+
"space-before-function-paren": [
165+
"error",
166+
{
167+
"anonymous": "always",
168+
"named": "never"
169+
}
170+
],
171+
"space-in-parens": [
172+
"error",
173+
"never"
174+
],
175+
"space-infix-ops": "error",
176+
"space-unary-ops": [
177+
"error",
178+
{
179+
"words": true,
180+
"nonwords": false
181+
}
182+
],
183+
"spaced-comment": [
184+
"error",
185+
"always"
186+
],
187+
"strict": [
188+
"error",
189+
"function"
190+
],
191+
"yoda": [
192+
"error",
193+
"never"
194+
],
195+
"max-nested-callbacks": [
196+
"warn",
197+
5
198+
],
199+
"valid-jsdoc": [
200+
"warn",
201+
{
202+
"prefer": {
203+
"returns": "return",
204+
"property": "prop"
205+
},
206+
"requireReturn": false
207+
}
208+
]
209+
}
210+
}

.github/workflows/build-test-deploy.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,9 @@ jobs:
251251
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c " \
252252
if [ -n \"${GITHUB_TOKEN:-}\" ]; then export COMPOSER_AUTH='{\"github-oauth\": {\"github.com\": \"${GITHUB_TOKEN-}\"}}'; fi && \
253253
COMPOSER_MEMORY_LIMIT=-1 composer --ansi install --prefer-dist"
254+
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "yarn install --frozen-lockfile"
254255
255-
- name: Validate Composer configuration normalized
256+
- name: Validate Composer configuration is normalized
256257
run: docker compose exec -T cli composer normalize --dry-run
257258
continue-on-error: ${{ vars.VORTEX_CI_COMPOSER_NORMALIZE_IGNORE_FAILURE == '1' }}
258259

@@ -280,8 +281,12 @@ jobs:
280281
run: docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features
281282
continue-on-error: ${{ vars.VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE == '1' }}
282283

284+
- name: Lint module code with NodeJS linters
285+
run: docker compose exec -T cli bash -c "yarn run lint"
286+
continue-on-error: ${{ vars.VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE == '1' }}
287+
283288
#;< DRUPAL_THEME
284-
- name: Lint code with NodeJS linters
289+
- name: Lint theme code with NodeJS linters
285290
run: docker compose exec -T cli bash -c "yarn --cwd=\${WEBROOT}/themes/custom/\${DRUPAL_THEME} run lint"
286291
continue-on-error: ${{ vars.VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE == '1' }}
287292
#;> DRUPAL_THEME

.stylelintrc.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
extends: [
3+
'stylelint-config-standard'
4+
],
5+
plugins: [
6+
'stylelint-order'
7+
],
8+
rules: {
9+
'order/properties-alphabetical-order': true,
10+
'at-rule-no-unknown': [
11+
true,
12+
{
13+
ignoreAtRules: [
14+
'extend',
15+
'at-root',
16+
'debug',
17+
'warn',
18+
'error',
19+
'if',
20+
'else',
21+
'for',
22+
'each',
23+
'while',
24+
'include',
25+
'mixin',
26+
'function',
27+
'return',
28+
'content'
29+
]
30+
}
31+
],
32+
'selector-class-pattern': null,
33+
'selector-id-pattern': null,
34+
'custom-property-pattern': null,
35+
'keyframes-name-pattern': null,
36+
'no-descending-specificity': null,
37+
'font-family-no-missing-generic-family-keyword': null
38+
}
39+
};

.vortex/docs/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
root: true,
23
env: {
34
browser: true,
45
es2021: true,

0 commit comments

Comments
 (0)