Skip to content

Commit df9d5c8

Browse files
committed
Merge remote-tracking branch 'hc/main'
2 parents 8a53145 + ab32098 commit df9d5c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+683
-8161
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.js

Lines changed: 22 additions & 11 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
es6: true,
@@ -22,42 +23,41 @@ module.exports = {
2223
processor: 'svelte3/svelte3',
2324
rules: {
2425
'import/first': 'off',
25-
'import/no-duplicates': 'off',
26-
'import/no-mutable-exports': 'off',
2726
'no-multiple-empty-lines': [
2827
'error',
2928
{ max: 2 }
3029
],
31-
'@typescript-eslint/prefer-nullish-coalescing': 'off',
3230
// Causes false positives with reactive and auto subscriptions
3331
'@typescript-eslint/strict-boolean-expressions': 'off',
3432
'no-sequences': 'off',
35-
'no-unused-expressions': 'off',
33+
'svelte/missing-declaration': "off",
3634
}
3735
}
3836
],
3937
rules: {
38+
// TODO: probably want to enable some of these
39+
'@typescript-eslint/explicit-function-return-type': 'off',
40+
'@typescript-eslint/no-confusing-void-expression': 'off',
41+
'@typescript-eslint/no-floating-promises': 'off',
42+
'@typescript-eslint/no-non-null-assertion': 'off',
43+
'@typescript-eslint/no-unused-expressions': 'off',
44+
4045
'linebreak-style': [
4146
'error',
4247
'unix'
4348
],
44-
semi: 'off',
4549
'@typescript-eslint/semi': [
4650
'error',
4751
'always'
4852
],
49-
'no-extra-semi': 'off',
5053
'@typescript-eslint/no-extra-semi': 'error',
51-
'@typescript-eslint/no-floating-promises': 'off',
52-
'no-unused-vars': 'off',
5354
'@typescript-eslint/no-unused-vars': [
5455
'error',
5556
{
5657
varsIgnorePattern: '^_',
5758
argsIgnorePattern: '^_'
5859
}
5960
],
60-
'space-before-function-paren': 'off',
6161
'@typescript-eslint/space-before-function-paren': [
6262
'error',
6363
{
@@ -97,7 +97,18 @@ module.exports = {
9797
globals: {
9898
Ytc: 'readonly',
9999
Chat: 'readonly',
100-
YtcF: 'readonly'
100+
YtcF: 'readonly',
101+
'svelte3/typescript': () => require('typescript'),
102+
'svelte3/ignore-warnings': (warning) => {
103+
if (warning.code === 'a11y-click-events-have-key-events') {
104+
return true;
105+
}
106+
107+
if (warning.code === 'missing-declaration' && warning.message === "'__VERSION__' is not defined") {
108+
return true;
109+
}
110+
111+
return false;
112+
},
101113
},
102-
root: true
103114
};

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
push:
44
pull_request:
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
610
jobs:
711
build:
812
runs-on: ubuntu-latest
@@ -14,10 +18,8 @@ jobs:
1418
uses: actions/setup-node@v4
1519
with:
1620
node-version: '22'
17-
cache: 'yarn'
18-
19-
- name: Install modules
20-
run: yarn
2121

22-
- name: Build
23-
run: yarn build
22+
- run: |
23+
npm install
24+
npm run lint:check
25+
npm run build

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [ main ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ main ]
2020

2121
jobs:
2222
analyze:

.github/workflows/release.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,15 @@ jobs:
1818
uses: actions/setup-node@v4
1919
with:
2020
node-version: '22'
21-
cache: 'yarn'
2221

23-
- name: Install modules
24-
run: |
25-
sudo apt install jq
26-
yarn
27-
VERSION=$(echo -n "${{ github.ref }}" | sed 's/[refs\/tagv]//g' | sed 's/-.*//')
28-
jq --arg version $VERSION '.version = $version' src/manifest.json > src/manifest.json.tmp
29-
mv src/manifest.json.tmp src/manifest.json
22+
- run: |
23+
npm install
24+
npm run lint:check
3025
31-
- name: Build Chrome
32-
run: |
3326
# Extract version number from the tag
3427
VERSION=$(echo -n "${{ github.ref }}" | sed 's/[refs\/tagv]//g' | sed 's/-.*//')
35-
yarn build:chrome
36-
yarn package
28+
29+
npm run build
3730
3831
- name: Upload Chrome package to release
3932
uses: svenstaro/upload-release-action@v2
@@ -44,13 +37,6 @@ jobs:
4437
tag: ${{ github.ref }}
4538
overwrite: true
4639

47-
- name: Build Firefox
48-
run: |
49-
# Extract version number from the tag
50-
VERSION=$(echo -n "${{ github.ref }}" | sed 's/[refs\/tagv]//g' | sed 's/-.*//')
51-
yarn build:firefox
52-
yarn package
53-
5440
- name: Upload Firefox package to release
5541
uses: svenstaro/upload-release-action@v2
5642
with:

.gitignore

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
.DS_Store
22
node_modules
33
build
4-
dist
54
package-lock.json
5+
.eslintcache
66

77
# local env files
88
.env.local
99
.env.*.local
1010

1111
# Log files
1212
npm-debug.log*
13-
yarn-debug.log*
14-
yarn-error.log*
15-
pnpm-debug.log*
1613

1714
# Editor directories and files
1815
.idea
@@ -22,10 +19,3 @@ pnpm-debug.log*
2219
*.njsproj
2320
*.sln
2421
*.sw?
25-
26-
# Vue Browser Extension Output
27-
*.pem
28-
*.pub
29-
*.zip
30-
artifacts
31-
.eslintcache

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# YtcFilter | YouTube Chat Filter
22
<!--
33
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
4-
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/standard/semistandard)
54
[![Contributors](https://img.shields.io/github/contributors/LiveTL/HyperChat)](https://github.com/LiveTL/HyperChat/contributors)
65
[![Issues](https://img.shields.io/github/issues/LiveTL/HyperChat)](https://github.com/LiveTL/HyperChat/issues)
7-
![Total Lines](https://img.shields.io/tokei/lines/github/LiveTL/HyperChat)
86
![Size](https://img.shields.io/github/repo-size/LiveTL/HyperChat)
97
[![Commit Activity](https://img.shields.io/github/commit-activity/w/LiveTL/HyperChat)](https://github.com/LiveTL/HyperChat/commits/)
108
[![Discord](https://img.shields.io/discord/780938154437640232.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/uJrV3tmthg) -->
@@ -16,11 +14,19 @@
1614

1715
Release packages are also available [on GitHub](https://github.com/LiveTL/ytcfilter/releases).
1816

17+
18+
<!-- ## Install
19+
20+
HyperChat is available in the Chrome and Firefox stores.
21+
22+
See https://livetl.app/hyperchat/install -->
23+
24+
1925
## Building from Source
2026

21-
<!-- ### ⚠️ WARNING ⚠️
27+
<!-- ### ⚠️ WARNING ⚠️ -->
2228

23-
Due to unreliable Manifest v3 feature support in Firefox, we maintain both MV2 and MV3 versions of HyperChat in parallel. The MV2 variant sits in the `master` branch, while the MV3 variant sits on the `mv3` branch. When contributing, please ensure that you check out to the `master` branch to implement the features in MV2 first. Once the feature is stable, please open a separate PR to the `mv3` branch to port the feature to MV3. -->
29+
For legacy reasons, we have a `mv2` branch used by [the LiveTL extension](https://github.com/LiveTL/LiveTL)'s Manifest V2 Firefox variant, while the `main` branch houses the main Manifest V3 version that's published to stores.
2430

2531
### Development
2632

@@ -39,17 +45,26 @@ cd ytcfilter
3945
yarn # install dependencies
4046
```
4147

42-
Build or serve the extension:
48+
Serve the extension for local development:
4349

4450
```bash
45-
yarn dev:firefox # devserver for firefox extension
46-
yarn dev:chrome # devserver for chrome extension
47-
yarn start # alias to yarn dev:chrome for backwards compat
48-
yarn start:none # alias to yarn dev:chrome for backwards compat
49-
yarn start:firefox # devserver + open extension in firefox
50-
yarn start:chrome # devserver + open extension in chrome
51-
yarn build # production mode (chrome)
52-
yarn build:chrome # production mode (chrome)
53-
yarn build:firefox # production mode (firefox)
54-
VERSION=x.x.x yarn build
51+
npm run dev:chrome # devserver for Chrome extension
52+
npm run dev:firefox # devserver for Firefox extension
53+
54+
npm run start:chrome # devserver + open extension in Chrome
55+
npm run start:firefox # devserver + open extension in Firefox
5556
```
57+
58+
### Building for Production
59+
60+
Our build script is [an automated GitHub action](.github/workflows/release.yml), where `${{ github.ref }}` should evaluate to a tag in the format `vX.Y.Z` (where `X.Y.Z` is the version number).
61+
62+
To simulate the build:
63+
64+
```bash
65+
VERSION=X.Y.Z npm run build # Chrome & Firefox
66+
VERSION=X.Y.Z npm run build:chrome # just Chrome
67+
VERSION=X.Y.Z npm run build:firefox # just Firefox
68+
```
69+
70+
The built ZIP files can be found in the `build` directory.

README_PRODUCTION.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

img/install-android.png

-29.4 KB
Binary file not shown.

img/install-chrome.png

-229 KB
Binary file not shown.

0 commit comments

Comments
 (0)