Skip to content

Commit 3ba245f

Browse files
committed
AG-37145 rework library structure
Merge in ADGUARD-FILTERS/scriptlets from fix/AG-37145 to master Squashed commit of the following: commit 02462fa Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 18:21:16 2024 +0200 AG-37145 update changelog commit 76478c3 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 18:15:49 2024 +0200 AG-37145 update agtree version to 3.0.0-alpha.1 commit 1b17aa4 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 16:19:11 2024 +0200 AG-37145 update agtree version to v3.0.0-alpha0 commit 7472650 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 15:48:21 2024 +0200 AG-37145 rename package to show that it is temp commit 3210dd8 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 15:31:55 2024 +0200 AG-37145 add temp scriptlets package commit 0737bff Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 15:17:00 2024 +0200 AG-37145 fix order of running tests commit e9748e4 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 15:09:04 2024 +0200 AG-37145 remove dirs from the dist commit 4c90576 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 15:07:31 2024 +0200 AG-37145 revert dist commit 8f735a6 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:55:59 2024 +0200 AG-37145 describe interface FlagsData commit 7e80dff Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:47:19 2024 +0200 AG-37145 fix eslint warnings commit 387345e Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:42:55 2024 +0200 AG-37145 fix review notes commit 8cafa56 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:39:01 2024 +0200 AG-37145 fix eslint review commit 3f46c8a Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:16:34 2024 +0200 AG-37145 install pnpm commit c30b4ac Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:07:57 2024 +0200 AG-37145 improve jsdoc commit c3c1aea Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:05:27 2024 +0200 AG-37145 unexport interface commit 87e346b Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 12:02:10 2024 +0200 AG-37145 fix jsdoc commit cca8ed7 Author: Maxim Topciu <[email protected]> Date: Tue Nov 12 11:52:58 2024 +0200 AG-37145 update readme commit df4ecb7 Author: Maxim Topciu <[email protected]> Date: Mon Nov 11 13:44:51 2024 +0200 AG-37145 update changelog commit ba0f6db Author: Maxim Topciu <[email protected]> Date: Mon Nov 11 12:27:41 2024 +0200 AG-37145 update changelog commit ea32a73 Author: Maxim Topciu <[email protected]> Date: Mon Nov 11 12:21:12 2024 +0200 AG-37145 update changelog ... and 44 more commits
1 parent 09e9e0c commit 3ba245f

File tree

230 files changed

+11019
-10535
lines changed

Some content is hidden

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

230 files changed

+11019
-10535
lines changed

.eslintrc.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
const path = require('path');
22

3+
const MAX_LINE_LENGTH = 120;
4+
35
module.exports = {
46
parser: '@babel/eslint-parser',
57
parserOptions: {
68
babelOptions: {
79
rootMode: 'upward',
810
},
911
},
12+
ignorePatterns: ['tests/smoke/**'],
1013
env: {
1114
browser: true,
1215
qunit: true,
@@ -44,9 +47,9 @@ module.exports = {
4447
'import/prefer-default-export': 0,
4548
'no-continue': 0,
4649
'no-await-in-loop': 0,
47-
'max-len': ['error', { code: 120, ignoreUrls: true }],
50+
'max-len': ['error', { code: MAX_LINE_LENGTH, ignoreUrls: true }],
4851
'arrow-body-style': 0,
49-
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
52+
'import/no-extraneous-dependencies': 'off',
5053
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
5154
'no-constant-condition': ['error', { checkLoops: false }],
5255
// jsdoc rules
@@ -67,6 +70,24 @@ module.exports = {
6770
'jsdoc/require-returns': 'off',
6871
'jsdoc/require-returns-description': 0,
6972
'jsdoc/no-defaults': 0,
73+
'import-newlines/enforce': ['error', { items: 3, 'max-len': MAX_LINE_LENGTH }],
74+
// Split external and internal imports with an empty line
75+
'import/order': [
76+
'error',
77+
{
78+
groups: [
79+
['builtin', 'external'],
80+
],
81+
'newlines-between': 'always',
82+
},
83+
],
84+
// Force proper import and export of types
85+
'@typescript-eslint/consistent-type-imports': [
86+
'error',
87+
{
88+
fixStyle: 'inline-type-imports',
89+
},
90+
],
7091
},
7192
overrides: [
7293
{

.github/workflows/release.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,29 @@ jobs:
3434
- name: Check out the repository
3535
uses: actions/checkout@v4
3636

37+
- name: Install pnpm
38+
uses: pnpm/action-setup@v4
39+
with:
40+
version: 8
41+
3742
- name: Set up Node.js
3843
uses: actions/setup-node@v4
3944
with:
4045
node-version: ${{ env.NODE_VERSION }}
4146
registry-url: https://registry.npmjs.org
42-
cache: yarn
47+
cache: pnpm
4348

4449
- name: Install dependencies
45-
run: yarn install
50+
run: pnpm install
4651

4752
- name: Run ESLint
48-
run: yarn lint
53+
run: pnpm lint
4954

5055
- name: Run tests
51-
run: yarn test
56+
run: pnpm test
5257

5358
- name: Run build
54-
run: yarn build
59+
run: pnpm build
5560

5661
- name: Release on GitHub
5762
uses: softprops/action-gh-release@v1

.github/workflows/test.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,28 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19+
20+
- name: Install pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 8
24+
1925
- name: Use Node.jobs
2026
uses: actions/setup-node@v4
2127
with:
2228
node-version: ${{ env.NODE_VERSION }}
2329

24-
- name: yarn install
25-
run: yarn install
30+
- name: pnpm install
31+
run: pnpm install
2632

27-
- name: yarn lint
28-
run: yarn lint
33+
- name: pnpm lint
34+
run: pnpm lint
2935

30-
- name: yarn test
31-
run: yarn test
36+
- name: pnpm test
37+
run: pnpm test
3238

33-
- name: yarn build
34-
run: yarn build
39+
- name: pnpm build
40+
run: pnpm build
3541

3642
notify:
3743
name: Send Slack notification on failure

.husky/pre-commit

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ if ([[ `git diff --cached --name-only --diff-filter=ACM` == *"scripts/compatibil
2323
echo "\033[33mbut scriptlet aliases or compatibility-redirects.ts are updated as well\033[0m"
2424
fi
2525

26-
yarn lint-staged
27-
yarn test
26+
pnpm lint-staged
27+
pnpm test

CHANGELOG.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
1010
<!-- TODO: change `@added unknown` tag due to the actual version -->
1111
<!-- during new scriptlets or redirects releasing -->
1212

13-
## [Unreleased]
13+
## [v2.0.0] - 2024-11-12
1414

1515
### Added
1616

@@ -26,8 +26,22 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
2626
- set response `ok` to `false` by `prevent-fetch` if response type is `opaque` [#441]
2727
- improve `prevent-xhr` — modify response [#415]
2828
- improve `prevent-xhr` — add missed events [#414]
29+
- `Source` type instead of `IConfiguration`
30+
- API structure. Validators, Converters, Scriptlets and redirects are now separate modules
31+
- The minimum supported Safari version is now 13
32+
- Updated [@adguard/agtree] to `3.0.0-alpha.1`.
2933

30-
[Unreleased]: https://github.com/AdguardTeam/Scriptlets/compare/v1.12.1...HEAD
34+
### Removed
35+
36+
- IIFE bundle
37+
- UMD bundle
38+
- Various conversion and validation functions including `isAdgRedirectRule`, `isAdgRedirectCompatibleWithUbo`,
39+
`isUboRedirectCompatibleWithAdg`, `isAbpRedirectCompatibleWithAdg`, `convertUboRedirectToAdg`,
40+
`convertAbpRedirectToAdg`, `convertRedirectToAdg`, and `convertRedirectNameToAdg` functions.
41+
42+
43+
[v2.0.0]: https://github.com/AdguardTeam/Scriptlets/compare/v1.12.1...v2.0.0
44+
[@adguard/agtree]: https://github.com/AdguardTeam/tsurlfilter/releases/tag/agtree-v3.0.0-alpha.1
3145
[#451]: https://github.com/AdguardTeam/Scriptlets/issues/451
3246
[#415]: https://github.com/AdguardTeam/Scriptlets/issues/415
3347
[#455]: https://github.com/AdguardTeam/Scriptlets/issues/455

0 commit comments

Comments
 (0)