Skip to content

Commit 13c30dd

Browse files
committed
[#2320] Added support to select Eslint and Stilelint in the installer.
1 parent 9ec1fe0 commit 13c30dd

279 files changed

Lines changed: 5170 additions & 227 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.

.circleci/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ jobs:
285285
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c " \
286286
if [ -n \"${PACKAGE_TOKEN:-}\" ]; then export COMPOSER_AUTH='{\"github-oauth\": {\"github.com\": \"${PACKAGE_TOKEN-}\"}}'; fi && \
287287
COMPOSER_MEMORY_LIMIT=-1 composer --ansi install --prefer-dist"
288+
#;< TOOL_ESLINT_STYLELINT
288289
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "yarn install --frozen-lockfile"
290+
#;> TOOL_ESLINT_STYLELINT
289291
290292
- run:
291293
name: Audit Composer packages
@@ -343,11 +345,13 @@ jobs:
343345
docker compose exec -T cli vendor/bin/gherkinlint lint tests/behat/features || [ "${VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE:-0}" -eq 1 ]
344346
#;> TOOL_BEHAT
345347

348+
#;< TOOL_ESLINT_STYLELINT
346349
- run:
347350
name: Lint module code with NodeJS linters
348351
command: |
349352
[ "${CIRCLE_NODE_TOTAL:-1}" -gt 1 ] && [ "${CIRCLE_NODE_INDEX:-0}" -ne 0 ] && exit 0
350353
docker compose exec -T cli bash -c "yarn run lint" || [ "${VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE:-0}" -eq 1 ]
354+
#;> TOOL_ESLINT_STYLELINT
351355

352356
#;< DRUPAL_THEME
353357
- run:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ jobs:
277277
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c " \
278278
if [ -n \"${PACKAGE_TOKEN:-}\" ]; then export COMPOSER_AUTH='{\"github-oauth\": {\"github.com\": \"${PACKAGE_TOKEN-}\"}}'; fi && \
279279
COMPOSER_MEMORY_LIMIT=-1 composer --ansi install --prefer-dist"
280+
#;< TOOL_ESLINT_STYLELINT
280281
docker compose exec $(env | cut -f1 -d= | sed 's/^/-e /') -T cli bash -c "yarn install --frozen-lockfile"
282+
#;> TOOL_ESLINT_STYLELINT
281283
282284
- name: Audit Composer packages
283285
run: docker compose exec -T cli composer audit
@@ -328,10 +330,12 @@ jobs:
328330
continue-on-error: ${{ vars.VORTEX_CI_GHERKIN_LINT_IGNORE_FAILURE == '1' }}
329331
#;> TOOL_BEHAT
330332

333+
#;< TOOL_ESLINT_STYLELINT
331334
- name: Lint module code with NodeJS linters
332335
if: ${{ matrix.instance == 0 || strategy.job-total == 1 }}
333336
run: docker compose exec -T cli bash -c "yarn run lint"
334337
continue-on-error: ${{ vars.VORTEX_CI_NODEJS_LINT_IGNORE_FAILURE == '1' }}
338+
#;> TOOL_ESLINT_STYLELINT
335339

336340
#;< DRUPAL_THEME
337341
- name: Lint theme code with NodeJS linters

.vortex/docs/.utils/svg-term-render.js

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,55 @@ for (let i = 2; i < args.length; i++) {
5151
}
5252
}
5353

54-
// Read input cast file.
55-
const input = fs.readFileSync(inputFile, 'utf8');
54+
// Read input cast file and convert v3 to v2 if needed.
55+
// svg-term only supports asciicast v1 and v2 formats, but asciinema 3.x
56+
// produces v3 format with two breaking differences:
57+
// 1. Header uses {term: {cols, rows, type}} instead of {width, height}
58+
// 2. Timestamps are relative (delta from previous event) not absolute
59+
// Additionally, v3 introduces event type "x" (exit) which v2 doesn't have.
60+
let input = fs.readFileSync(inputFile, 'utf8');
61+
const lines = input.split('\n');
62+
if (lines.length > 0) {
63+
try {
64+
const header = JSON.parse(lines[0]);
65+
if (header.version === 3) {
66+
// Convert header.
67+
header.version = 2;
68+
if (header.term) {
69+
header.width = header.term.cols;
70+
header.height = header.term.rows;
71+
if (!header.env) {
72+
header.env = {};
73+
}
74+
if (header.term.type) {
75+
header.env.TERM = header.term.type;
76+
}
77+
delete header.term;
78+
}
79+
// Convert event lines: relative timestamps to absolute, drop non-"o" events.
80+
const convertedLines = [JSON.stringify(header)];
81+
let absoluteTime = 0;
82+
for (let i = 1; i < lines.length; i++) {
83+
const line = lines[i].trim();
84+
if (!line) {
85+
continue;
86+
}
87+
try {
88+
const event = JSON.parse(line);
89+
absoluteTime += event[0];
90+
if (event[1] === 'o') {
91+
convertedLines.push(JSON.stringify([parseFloat(absoluteTime.toFixed(6)), 'o', event[2]]));
92+
}
93+
} catch (_) {
94+
// Skip malformed lines.
95+
}
96+
}
97+
input = convertedLines.join('\n') + '\n';
98+
}
99+
} catch (_) {
100+
// Not valid JSON header - let svg-term handle the error.
101+
}
102+
}
56103

57104
// Define custom theme with lineHeight set to 1.0.
58105
// Based on Atom One Dark theme colors.

.vortex/docs/.utils/update-installer-video.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ record_installer() {
306306
note "Output file: $output_cast"
307307

308308
asciinema rec \
309-
--cols="$TERMINAL_WIDTH" \
310-
--rows="$TERMINAL_HEIGHT" \
309+
--window-size="${TERMINAL_WIDTH}x${TERMINAL_HEIGHT}" \
310+
--output-format=asciicast-v2 \
311311
--title="Vortex Installer Demo" \
312312
--command="$expect_script" \
313313
--overwrite \

0 commit comments

Comments
 (0)