Skip to content

Commit

Permalink
AG-37145 rework library structure
Browse files Browse the repository at this point in the history
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
  • Loading branch information
maximtop committed Nov 12, 2024
1 parent 09e9e0c commit 3ba245f
Show file tree
Hide file tree
Showing 230 changed files with 11,019 additions and 10,535 deletions.
25 changes: 23 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
const path = require('path');

const MAX_LINE_LENGTH = 120;

module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
babelOptions: {
rootMode: 'upward',
},
},
ignorePatterns: ['tests/smoke/**'],
env: {
browser: true,
qunit: true,
Expand Down Expand Up @@ -44,9 +47,9 @@ module.exports = {
'import/prefer-default-export': 0,
'no-continue': 0,
'no-await-in-loop': 0,
'max-len': ['error', { code: 120, ignoreUrls: true }],
'max-len': ['error', { code: MAX_LINE_LENGTH, ignoreUrls: true }],
'arrow-body-style': 0,
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-extraneous-dependencies': 'off',
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
'no-constant-condition': ['error', { checkLoops: false }],
// jsdoc rules
Expand All @@ -67,6 +70,24 @@ module.exports = {
'jsdoc/require-returns': 'off',
'jsdoc/require-returns-description': 0,
'jsdoc/no-defaults': 0,
'import-newlines/enforce': ['error', { items: 3, 'max-len': MAX_LINE_LENGTH }],
// Split external and internal imports with an empty line
'import/order': [
'error',
{
groups: [
['builtin', 'external'],
],
'newlines-between': 'always',
},
],
// Force proper import and export of types
'@typescript-eslint/consistent-type-imports': [
'error',
{
fixStyle: 'inline-type-imports',
},
],
},
overrides: [
{
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,29 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install
run: pnpm install

- name: Run ESLint
run: yarn lint
run: pnpm lint

- name: Run tests
run: yarn test
run: pnpm test

- name: Run build
run: yarn build
run: pnpm build

- name: Release on GitHub
uses: softprops/action-gh-release@v1
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.jobs
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: yarn install
run: yarn install
- name: pnpm install
run: pnpm install

- name: yarn lint
run: yarn lint
- name: pnpm lint
run: pnpm lint

- name: yarn test
run: yarn test
- name: pnpm test
run: pnpm test

- name: yarn build
run: yarn build
- name: pnpm build
run: pnpm build

notify:
name: Send Slack notification on failure
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ if ([[ `git diff --cached --name-only --diff-filter=ACM` == *"scripts/compatibil
echo "\033[33mbut scriptlet aliases or compatibility-redirects.ts are updated as well\033[0m"
fi

yarn lint-staged
yarn test
pnpm lint-staged
pnpm test
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
<!-- TODO: change `@added unknown` tag due to the actual version -->
<!-- during new scriptlets or redirects releasing -->

## [Unreleased]
## [v2.0.0] - 2024-11-12

### Added

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

[Unreleased]: https://github.com/AdguardTeam/Scriptlets/compare/v1.12.1...HEAD
### Removed

- IIFE bundle
- UMD bundle
- Various conversion and validation functions including `isAdgRedirectRule`, `isAdgRedirectCompatibleWithUbo`,
`isUboRedirectCompatibleWithAdg`, `isAbpRedirectCompatibleWithAdg`, `convertUboRedirectToAdg`,
`convertAbpRedirectToAdg`, `convertRedirectToAdg`, and `convertRedirectNameToAdg` functions.


[v2.0.0]: https://github.com/AdguardTeam/Scriptlets/compare/v1.12.1...v2.0.0
[@adguard/agtree]: https://github.com/AdguardTeam/tsurlfilter/releases/tag/agtree-v3.0.0-alpha.1
[#451]: https://github.com/AdguardTeam/Scriptlets/issues/451
[#415]: https://github.com/AdguardTeam/Scriptlets/issues/415
[#455]: https://github.com/AdguardTeam/Scriptlets/issues/455
Expand Down
Loading

0 comments on commit 3ba245f

Please sign in to comment.