mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Reverts `js/webtorrent.js` and `js/gridHealth.js` to a simplified implementation that correctly treats webseeds as peers. This ensures that videos with only webseeds (and 0 P2P peers) are considered healthy and playable, resolving an issue where such videos were marked as unhealthy or failed to stream.
- Updates `js/webtorrent.js` to use `client.add(url, { urlList: [...] })` for better webseed integration.
- Updates `js/gridHealth.js` to rely on `peers > 0` for health, removing complex `webseedOnly` logic.
- Updates `tests/webtorrent-regression.test.mjs` to verify that webseeds are counted as peers and result in a healthy state with reason "peer".
- Excludes `bitvid-working-webtorrent/**` from all linting scripts (`scripts/check-hex.js`, `scripts/check-design-tokens.mjs`, `scripts/check-inline-styles.mjs`, `scripts/check-tailwind-colors.mjs`, `stylelint.config.cjs`) to prevent CI failures from reference code.
Co-authored-by: PR0M3TH3AN <[email protected]>
30 lines
1.4 KiB
JavaScript
30 lines
1.4 KiB
JavaScript
const VAR_PATTERN = /^var\(--.*\)$/;
|
|
const CONTAINS_VAR_PATTERN = /var\(--.*\)/;
|
|
const LINEAR_GRADIENT_PATTERN = /^linear-gradient\(/;
|
|
const COLOR_MIX_PATTERN = /^color-mix\([\s\S]+\)$/;
|
|
const NON_TOKEN_LENGTH_PATTERN = /^(?!.*var\().*\b\d*\.?\d+(?:px|rem)\b/;
|
|
|
|
module.exports = {
|
|
ignoreFiles: ['css/tailwind.generated.css', 'bitvid-working-webtorrent/**'],
|
|
rules: {
|
|
'at-rule-no-unknown': [true, { ignoreAtRules: ['tailwind', 'layer', 'apply'] }],
|
|
'import-notation': 'string',
|
|
'color-no-hex': true,
|
|
'declaration-property-value-allowed-list': {
|
|
color: [VAR_PATTERN, 'inherit', 'currentColor'],
|
|
'background-color': [VAR_PATTERN, 'transparent', 'inherit', 'currentColor', COLOR_MIX_PATTERN],
|
|
background: [VAR_PATTERN, CONTAINS_VAR_PATTERN, LINEAR_GRADIENT_PATTERN, 'none', 'transparent'],
|
|
'border-color': [VAR_PATTERN, CONTAINS_VAR_PATTERN, 'transparent', 'inherit', 'currentColor'],
|
|
'outline-color': [VAR_PATTERN, 'transparent', 'inherit', 'currentColor'],
|
|
fill: [VAR_PATTERN, 'none', 'currentColor', 'inherit'],
|
|
stroke: [VAR_PATTERN, 'none', 'currentColor', 'inherit'],
|
|
'box-shadow': [VAR_PATTERN, CONTAINS_VAR_PATTERN, 'none']
|
|
},
|
|
'declaration-property-value-disallowed-list': {
|
|
'/^((margin|padding)(-.+)?|gap|row-gap|column-gap|font-size|border-radius|outline|outline-offset)$/': [
|
|
NON_TOKEN_LENGTH_PATTERN
|
|
]
|
|
}
|
|
}
|
|
};
|