Skip to content

Commit fdbf795

Browse files
committed
AG-41223 update node to v22 and use pnpm v10
Squashed commit of the following: commit c9faa17 Author: Slava Leleka <v.leleka@adguard.com> Date: Mon May 12 11:55:10 2025 -0400 use node18 as minimum, add test github workflow for it commit dc0cd40 Author: Slava Leleka <v.leleka@adguard.com> Date: Sat May 10 15:11:48 2025 -0400 Revert "add tgz temporary" This reverts commit d735906. commit d735906 Author: Slava Leleka <v.leleka@adguard.com> Date: Sat May 10 15:11:40 2025 -0400 add tgz temporary commit b6f5689 Author: Slava Leleka <v.leleka@adguard.com> Date: Sat May 10 14:54:05 2025 -0400 update node to v22 and use pnpm v10 instead of yarn
1 parent acfe927 commit fdbf795

10 files changed

Lines changed: 6316 additions & 4845 deletions

File tree

.github/workflows/test.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Test Diff Builder
2+
3+
env:
4+
# Minimum supported Node.js version is 18.13.0 which is specified in package.json
5+
# So we use it for testing to ensure compatibility
6+
NODE_VERSION: 18.13.0
7+
PNPM_VERSION: 10.7.1
8+
9+
on:
10+
push
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: ${{ env.PNPM_VERSION }}
23+
run_install: false
24+
25+
- name: Use Node.jobs
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ env.NODE_VERSION }}
29+
30+
- name: pnpm install
31+
run: pnpm install
32+
33+
- name: pnpm lint
34+
run: pnpm lint
35+
36+
- name: pnpm test
37+
run: pnpm test
38+
39+
- name: pnpm build
40+
run: pnpm build
41+
42+
notify:
43+
name: Send Slack notification on failure
44+
needs: build
45+
# Run this job only if the previous job failed and the event was triggered by the 'AdguardTeam/DiffBuilder' repository
46+
# Note: 'always()' is needed to run the notify job even if the test job was failed
47+
if:
48+
${{
49+
always() &&
50+
needs.check_code.result == 'failure' &&
51+
github.repository == 'AdguardTeam/DiffBuilder' &&
52+
(
53+
github.event_name == 'push' ||
54+
github.event_name == 'workflow_dispatch' ||
55+
github.event.pull_request.head.repo.full_name == github.repository
56+
)
57+
}}
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Send Slack notification
61+
uses: 8398a7/action-slack@v3
62+
with:
63+
status: failure
64+
fields: workflow, repo, message, commit, author, eventName, ref, job
65+
job_name: check_code
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
.vscode/
12
node_modules/
23
test-data/
34
dist/
5+
.pnpm-store/
46
.eslintcache
57
.DS_Store
68
build.txt

CHANGELOG.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Switched from js 'diff' to system GNU utility 'diff' [#4].
1313

14-
[#4]: https://github.com/AdguardTeam/DiffBuilder/issues/4
1514
[1.1.0]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.18...v1.1.0
15+
[#4]: https://github.com/AdguardTeam/DiffBuilder/issues/4
1616

1717
## [1.0.18] - 2024-04-04
1818

1919
### Fixed
2020

2121
- Do not fail if the old version of the filter does not exist [#3].
2222

23-
[#3]: https://github.com/AdguardTeam/DiffBuilder/issues/3
2423
[1.0.18]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.17...v1.0.18
24+
[#3]: https://github.com/AdguardTeam/DiffBuilder/issues/3
2525

2626
## [1.0.17] - 2024-03-25
2727

@@ -30,9 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
- Throwing of `UnacceptableResponseError` by `DiffUpdater.applyPatch()`
3131
if response status is unacceptable [AdguardBrowserExtension#2717].
3232

33-
[AdguardBrowserExtension#2717]: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2717
3433
[1.0.17]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.16...v1.0.17
35-
34+
[AdguardBrowserExtension#2717]: https://github.com/AdguardTeam/AdguardBrowserExtension/issues/2717
3635

3736
## [1.0.16] - 2024-03-18
3837

@@ -42,7 +41,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4241

4342
[1.0.16]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.13...v1.0.16
4443

45-
4644
## [1.0.13] - 2024-01-17
4745

4846
### Changed
@@ -51,7 +49,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5149

5250
[1.0.13]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.12...v1.0.13
5351

54-
5552
## [1.0.12] - 2024-01-17
5653

5754
### Changed
@@ -60,7 +57,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6057

6158
[1.0.12]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.11...v1.0.12
6259

63-
6460
## [1.0.11] - 2024-01-16
6561

6662
### Fixed
@@ -77,7 +73,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7773

7874
[1.0.11]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.10...v1.0.11
7975

80-
8176
## [1.0.10] - 2024-01-11
8277

8378
### Fixed
@@ -87,7 +82,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8782

8883
[1.0.10]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.9...v1.0.10
8984

90-
9185
## [1.0.9] - 2024-01-08
9286

9387
### Fixed
@@ -96,7 +90,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9690

9791
[1.0.9]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.8...v1.0.9
9892

99-
10093
## [1.0.8] - 2023-12-29
10194

10295
### Changed
@@ -105,7 +98,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10598

10699
[1.0.8]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.7...v1.0.8
107100

108-
109101
## [1.0.7] - 2023-12-29
110102

111103
### Fixed
@@ -114,7 +106,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
114106

115107
[1.0.7]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.6...v1.0.7
116108

117-
118109
## [1.0.6] - 2023-12-26
119110

120111
### Fixed
@@ -123,7 +114,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
123114

124115
[1.0.6]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.5...v1.0.6
125116

126-
127117
## [1.0.5] - 2023-12-25
128118

129119
### Fixed
@@ -132,7 +122,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
132122

133123
[1.0.5]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.4...v1.0.5
134124

135-
136125
## [1.0.4] - 2023-12-25
137126

138127
### Changed
@@ -145,7 +134,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
145134

146135
[1.0.4]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.3...v1.0.4
147136

148-
149137
## [1.0.3] - 2023-12-20
150138

151139
### Fixed
@@ -154,7 +142,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
154142

155143
[1.0.3]: https://github.com/AdguardTeam/DiffBuilder/compare/v1.0.2...v1.0.3
156144

157-
158145
## [1.0.2] - 2023-12-20
159146

160147
### Fixed

README.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,28 @@ A tool for generating differential updates for filter lists.
77
- [Prerequisites](#prerequisites)
88
- [How to Install](#how-to-install)
99
- [How to Use](#how-to-use)
10-
- [CLI](#cli)
11-
- [API](#api)
12-
- [Algorithm](#algorithm)
10+
- [CLI](#cli)
11+
- [API](#api)
12+
- [Algorithm Overview](#algorithm-overview)
1313

1414
## Prerequisites
1515

16-
- **diff utility**: This tool relies on the standard Unix `diff` utility to generate patches efficiently. Make sure it's installed on your system.
17-
- On macOS: Available by default or through XCode CLI tools
18-
- On Linux: Available by default or install via your package manager (e.g., `apt-get install diffutils`)
19-
- On Windows: Available via WSL or Git Bash
16+
<!-- NOTE: Minimal supported Node.js version should be specified in package.json -->
17+
<!-- and the same one should be used for testing in .github/workflows/test.yaml -->
18+
- [Node.js] v18.13.0 or higher.
19+
20+
- **diff utility** — this tool relies on the standard Unix `diff` utility to generate patches efficiently.
21+
Make sure it's installed on your system:
22+
- On macOS: Available by default or through XCode CLI tools.
23+
- On Linux: Available by default or install via your package manager (e.g., `apt-get install diffutils`).
24+
- On Windows: Available via WSL or Git Bash.
25+
26+
[Node.js]: https://nodejs.org/en/download
2027

2128
## How to Install
2229

2330
```bash
24-
yarn add @adguard/diff-builder
31+
pnpm add @adguard/diff-builder
2532
```
2633

2734
## How to Use
@@ -65,32 +72,38 @@ Where:
6572
## Algorithm Overview
6673

6774
### 1. Setup
68-
- Resolve absolute paths for the old and new filters and the patches directory.
75+
76+
- Resolve absolute paths for the old and new filters and the patches directory.
6977

7078
### 2. Prepare Patch Directory
71-
- Ensure the patches directory exists, creating it if necessary.
79+
80+
- Ensure the patches directory exists, creating it if necessary.
7281

7382
### 3. Clean Up Old Patches
74-
- Delete any outdated patches from the patches directory except empty patches.
83+
84+
- Delete any outdated patches from the patches directory except empty patches.
7585

7686
### 4. Read Filters and Detect Changes
77-
- Read and split the old and new filter files into lines.
78-
- Check if there are significant changes between the two sets of lines, excluding 'Diff-Path' and 'Checksum' tags.
87+
88+
- Read and split the old and new filter files into lines.
89+
- Check if there are significant changes between the two sets of lines, excluding 'Diff-Path' and 'Checksum' tags.
7990

8091
### 5. Handle No Changes
81-
- If no significant changes are found, revert any changes in the new filter and exit.
92+
93+
- If no significant changes are found, revert any changes in the new filter and exit.
8294

8395
### 6. Process Changes
84-
- Generate a new patch name and validate its uniqueness.
85-
- Update the 'Diff-Path' tag in the new filter.
86-
- Create a diff patch between the old and new filters.
87-
- Optionally, add a checksum to the patch.
96+
97+
- Generate a new patch name and validate its uniqueness.
98+
- Update the 'Diff-Path' tag in the new filter.
99+
- Create a diff patch between the old and new filters.
100+
- Optionally, add a checksum to the patch.
88101

89102
### 7. Finalize
90-
- Write the updated new filter back to its file.
91-
- Create an empty patch file for future use if necessary.
92-
- Save the diff patch to the appropriate file.
93103

104+
- Write the updated new filter back to its file.
105+
- Create an empty patch file for future use if necessary.
106+
- Save the diff patch to the appropriate file.
94107

95108
## API
96109

bamboo-specs/build.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plan:
55
key: DIFFBUILDERBUILD
66
name: diff builder - build
77
variables:
8-
dockerNode: adguard/node-ssh:18.13--1
8+
dockerNode: adguard/node-ssh:22.14--0
99

1010
stages:
1111
- Build:
@@ -21,7 +21,7 @@ Build:
2121
docker:
2222
image: ${bamboo.dockerNode}
2323
volumes:
24-
${system.YARN_DIR}: "${bamboo.cacheYarn}"
24+
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
2525
tasks:
2626
- checkout:
2727
force-clean-build: true
@@ -37,17 +37,17 @@ Build:
3737
3838
ls -laht
3939
40-
# Exclude '--ignore-platform' from yarn arguments to fix build
41-
originalValue="$bamboo_varsYarn"
40+
# Set cache directory
41+
pnpm config set store-dir ${bamboo.cachePnpm}
4242
43-
# Use sed to replace "--ignore-platform" with an empty string
44-
modifiedValue=$(echo "$originalValue" | sed 's/--ignore-platform//g')
43+
pnpm install ${bamboo_varsPnpm}
4544
46-
yarn install ${modifiedVarsYarn}
47-
yarn lint
48-
yarn test
49-
yarn build
50-
yarn pack --filename diff-builder.tgz
45+
pnpm lint
46+
pnpm test
47+
48+
pnpm build
49+
50+
pnpm pack --out diff-builder.tgz
5151
- inject-variables:
5252
file: build.txt
5353
scope: RESULT
@@ -86,7 +86,7 @@ triggers: []
8686
branches:
8787
create: manually
8888
delete: never
89-
link-to-jira: 'true'
89+
link-to-jira: true
9090

9191
notifications:
9292
- events:

bamboo-specs/deploy.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ environments:
99

1010
npmjs:
1111
docker:
12-
image: adguard/node-ssh:18.13--1
12+
image: adguard/node-ssh:22.14--0
1313
volumes:
14-
${system.YARN_DIR}: "${bamboo.cacheYarn}"
14+
${system.PNPM_DIR}: "${bamboo.cachePnpm}"
1515
triggers: [ ]
1616
tasks:
1717
- checkout:
18-
force-clean-build: 'true'
18+
force-clean-build: true
1919
- artifact-download:
2020
artifacts:
2121
- name: diff-builder.tgz

0 commit comments

Comments
 (0)