Skip to content

Commit d21b925

Browse files
committed
AG-40452 && AG-41874 && AG-37988 Update to AGTree v3
Squashed commit of the following: commit dfc7c36 Author: scripthunter7 <d.tota@adguard.com> Date: Wed May 21 12:02:10 2025 +0300 update release date commit b5b1f1c Author: scripthunter7 <d.tota@adguard.com> Date: Tue May 20 12:00:19 2025 +0300 more permissive GitHub workflow triggers commit 523989a Author: scripthunter7 <d.tota@adguard.com> Date: Tue May 20 11:58:29 2025 +0300 add Node.js version matrix testing for github ci commit 7af1b8d Author: scripthunter7 <d.tota@adguard.com> Date: Mon May 19 19:42:19 2025 +0300 improve changelog commit 7151a9a Author: scripthunter7 <d.tota@adguard.com> Date: Mon May 19 19:39:56 2025 +0300 specify node version commit e95518e Author: Slava Leleka <v.leleka@adguard.com> Date: Mon May 19 19:39:04 2025 +0300 Applied suggestion commit dd7dbde Author: Slava Leleka <v.leleka@adguard.com> Date: Mon May 19 19:35:15 2025 +0300 Applied suggestion commit f79b40f Author: Slava Leleka <v.leleka@adguard.com> Date: Mon May 19 19:29:20 2025 +0300 Applied suggestion commit b8bc5c1 Author: scripthunter7 <d.tota@adguard.com> Date: Mon May 19 19:21:45 2025 +0300 improve eslint config commit 80e03fc Author: scripthunter7 <d.tota@adguard.com> Date: Mon May 19 19:19:53 2025 +0300 changelog commit 3e44ca6 Author: scripthunter7 <d.tota@adguard.com> Date: Mon May 19 19:15:00 2025 +0300 remove browser bundle assets from GH CI commit 5d06c35 Author: scripthunter7 <d.tota@adguard.com> Date: Mon May 19 19:09:24 2025 +0300 Update to AGTree v3
1 parent 7178b78 commit d21b925

Some content is hidden

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

47 files changed

+1091
-2292
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
parser: '@typescript-eslint/parser',
2020
parserOptions: {
2121
tsconfigRootDir: join(__dirname),
22-
project: 'tsconfig.eslint.json',
22+
project: 'tsconfig.json',
2323
},
2424
plugins: ['import', '@typescript-eslint', 'import-newlines'],
2525
rules: {

.github/workflows/check.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
name: Check code
22

33
env:
4-
NODE_VERSION: 22
54
PNPM_VERSION: 10.7.1
65

76
on:
87
push:
9-
branches:
10-
- master
118
pull_request:
12-
branches:
13-
- master
149
# Make possible to run manually
1510
workflow_dispatch:
1611

1712
jobs:
1813
check_code:
1914
name: Run type checking, linting, and testing
2015
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
# https://nodejs.org/en/about/previous-releases
20+
node-version:
21+
- 18.x
22+
- 20.x
23+
- 22.x
24+
2125
steps:
2226
- name: Check out to repository
2327
uses: actions/checkout@v4
@@ -31,7 +35,7 @@ jobs:
3135
- name: Set up Node.js
3236
uses: actions/setup-node@v4
3337
with:
34-
node-version: ${{ env.NODE_VERSION }}
38+
node-version: ${{ matrix.node-version }}
3539
cache: pnpm
3640

3741
- name: Install dependencies
@@ -49,7 +53,7 @@ jobs:
4953
- name: Run ESLint
5054
run: pnpm lint:ts
5155

52-
- name: Run Jest tests
56+
- name: Run tests
5357
run: pnpm test
5458

5559
- name: Build should be successful

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Create GitHub Release
22

33
env:
4-
NODE_VERSION: 22
4+
NODE_VERSION: 22.14.0
55
PNPM_VERSION: 10.7.1
66

77
on:
@@ -53,7 +53,7 @@ jobs:
5353
- name: Run ESLint
5454
run: pnpm lint:ts
5555

56-
- name: Run Jest tests
56+
- name: Run tests
5757
run: pnpm test
5858

5959
- name: Run Rollup build
@@ -67,8 +67,6 @@ jobs:
6767
with:
6868
files: |
6969
aglint.tgz
70-
dist/aglint.iife.min.js
71-
dist/aglint.umd.min.js
7270
draft: false
7371
prerelease: false
7472
# TODO: Extract data from CHANGELOG.md

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
77
[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/
88
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
99

10+
## [3.0.0] - 2025-05-21
11+
12+
### Changed
13+
14+
- Project become ESM-only.
15+
- Minimum Node.js version is `v18`.
16+
- The build structure has been updated: files are no longer bundled. Users can handle bundling as needed.
17+
- Updated [@adguard/agtree] to `v3.1.4` [#247].
18+
19+
### Fixed
20+
21+
- zod vulnerability issue [#250].
22+
23+
### Removed
24+
25+
- Legacy `umd` and `iife` builds.
26+
27+
[3.0.0]: https://github.com/AdguardTeam/AGLint/compare/v2.1.5...v3.0.0
28+
[#247]: https://github.com/AdguardTeam/AGLint/issues/247
29+
[#250]: https://github.com/AdguardTeam/AGLint/issues/250
30+
1031
## [2.1.5] - 2025-05-05
1132

1233
### Added

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,15 @@ During development, you can use the following commands (listed in `package.json`
3838
- `pnpm build-types` - build type definitions with [TypeScript][typescript] to the `dist/types` folder.
3939
- `pnpm check-types` - check types with [TypeScript][typescript]
4040
- `pnpm clean` - remove the `dist` folder.
41-
- `pnpm clean-types` - remove the `dist/types` folder.
4241
- `pnpm coverage` - print test coverage report
4342
- `pnpm lint` - run all linters.
4443
- `pnpm lint:md` - lint the markdown files with [markdownlint][markdownlint].
4544
- `pnpm lint:ts` - lint the code with [ESLint][eslint].
46-
- `pnpm test` - run tests with [Jest][jest] (you can also run a specific test with `pnpm test <test-name>`)
45+
- `pnpm test` - run tests with [Vitest][vitest] (you can also run a specific test with `pnpm test <test-name>`)
4746

4847
[contribute]: https://adguard.com/contribute.html
4948
[eslint]: https://eslint.org/
50-
[jest]: https://jestjs.io/
49+
[vitest]: https://vitest.dev/
5150
[markdownlint]: https://github.com/DavidAnson/markdownlint
5251
[rollup]: https://rollupjs.org/
5352
[typescript]: https://www.typescriptlang.org/

jest.config.ts

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

package.json

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adguard/aglint",
3-
"version": "2.1.5",
3+
"version": "3.0.0",
44
"description": "Universal adblock filter list linter.",
55
"keywords": [
66
"adblock",
@@ -12,6 +12,7 @@
1212
],
1313
"author": "AdGuard Software Ltd.",
1414
"license": "MIT",
15+
"type": "module",
1516
"repository": {
1617
"type": "git",
1718
"url": "git+https://github.com/AdguardTeam/AGLint.git"
@@ -20,55 +21,47 @@
2021
"url": "https://github.com/AdguardTeam/AGLint/issues"
2122
},
2223
"homepage": "https://github.com/AdguardTeam/AGLint#readme",
23-
"main": "dist/aglint.js",
24-
"module": "dist/aglint.esm.mjs",
25-
"types": "dist/aglint.d.ts",
26-
"bin": "dist/aglint.cli.js",
24+
"bin": "dist/index.cli.js",
25+
"main": "dist/index.node.js",
26+
"module": "dist/index.node.js",
27+
"types": "dist/types/index.node.d.ts",
2728
"exports": {
2829
".": {
29-
"types": "./dist/aglint.d.ts",
30-
"import": "./dist/aglint.esm.mjs",
31-
"require": "./dist/aglint.js"
32-
},
33-
"./es": "./dist/aglint.esm.mjs",
34-
"./iife": "./dist/aglint.iife.min.js",
35-
"./umd": "./dist/aglint.umd.min.js"
30+
"types": "./dist/types/index.node.d.ts",
31+
"import": "./dist/index.node.js"
32+
}
3633
},
3734
"files": [
38-
"dist"
35+
"dist/**",
36+
"!dist/build.txt"
3937
],
4038
"engines": {
41-
"node": ">=17"
39+
"node": ">=18"
4240
},
4341
"scripts": {
44-
"build": "pnpm clean && pnpm build-txt && pnpm build-types && pnpm rollup --config rollup.config.ts --configPlugin @rollup/plugin-json --configPlugin @rollup/plugin-typescript && pnpm clean-types",
45-
"build-types": "tsc --declaration --emitDeclarationOnly --outdir dist/types",
42+
"build": "pnpm clean && pnpm build-txt && pnpm build-types && rollup --config rollup.config.ts --configPlugin typescript",
43+
"build-types": "tsc --project tsconfig.build.json",
4644
"build-txt": "tsx tasks/build-txt.ts",
47-
"check-types": "tsc --noEmit",
45+
"check-types": "tsc",
4846
"clean": "rimraf dist",
49-
"clean-types": "rimraf dist/types",
50-
"coverage": "jest --coverage",
47+
"coverage": "vitest --coverage",
5148
"lint": "pnpm check-types && pnpm lint:ts && pnpm lint:md",
5249
"lint:md": "markdownlint .",
5350
"lint:ts": "eslint . --cache --ext .ts",
5451
"prepare": "node .husky/install.mjs",
5552
"increment": "pnpm version patch --no-git-tag-version",
56-
"test": "jest --runInBand"
53+
"test": "vitest"
5754
},
5855
"devDependencies": {
5956
"@babel/core": "^7.22.5",
6057
"@babel/preset-env": "^7.22.5",
61-
"@rollup/plugin-babel": "^6.0.3",
6258
"@rollup/plugin-commonjs": "^25.0.2",
6359
"@rollup/plugin-json": "^6.0.0",
6460
"@rollup/plugin-node-resolve": "^15.2.3",
65-
"@rollup/plugin-terser": "^0.4.3",
66-
"@rollup/plugin-typescript": "^11.1.1",
61+
"@rollup/plugin-typescript": "^12.1.2",
6762
"@swc/core": "^1.3.74",
68-
"@swc/jest": "^0.2.28",
6963
"@types/clone-deep": "^4.0.1",
7064
"@types/fs-extra": "^11.0.1",
71-
"@types/jest": "^29.5.12",
7265
"@types/js-yaml": "^4.0.5",
7366
"@types/node": "^18.11.7",
7467
"@types/text-table": "^0.2.2",
@@ -81,21 +74,19 @@
8174
"eslint-plugin-import-newlines": "^1.3.1",
8275
"eslint-plugin-jsdoc": "^46.3.0",
8376
"husky": "^9.0.7",
84-
"jest": "^29.5.0",
8577
"jsdoc": "^4.0.2",
8678
"markdownlint": "^0.30.0",
8779
"markdownlint-cli": "^0.35.0",
8880
"rimraf": "^5.0.1",
89-
"rollup": "^3.25.3",
90-
"rollup-plugin-dts": "^5.3.0",
81+
"rollup": "^4.41.0",
9182
"rollup-plugin-node-externals": "^6.1.1",
92-
"rollup-plugin-polyfill-node": "^0.12.0",
9383
"ts-node": "^10.9.1",
9484
"tsx": "^4.7.0",
95-
"typescript": "^4.9.5"
85+
"typescript": "^5.8.3",
86+
"vitest": "^3.1.3"
9687
},
9788
"dependencies": {
98-
"@adguard/agtree": "^2.3.0",
89+
"@adguard/agtree": "^3.1.4",
9990
"@adguard/ecss-tree": "^1.1.0",
10091
"@inquirer/checkbox": "^1.3.7",
10192
"@inquirer/select": "^1.2.7",
@@ -109,7 +100,7 @@
109100
"inflection": "^2.0.1",
110101
"js-yaml": "^4.1.0",
111102
"strip-ansi": "6.0.1",
112-
"superstruct": "^1.0.3",
103+
"superstruct": "^2.0.2",
113104
"terminal-link": "2.1.1",
114105
"text-table": "^0.2.0"
115106
}

0 commit comments

Comments
 (0)