@adguard/hostlist-compiler 2.1.0 → 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +29 -0
- package/.github/workflows/ci.yml +22 -0
- package/.github/workflows/mirror.yml +24 -0
- package/.github/workflows/prepare-release.yml +26 -0
- package/.github/workflows/publish-release.yml +44 -0
- package/.markdownlint.json +29 -0
- package/.markdownlintignore +1 -0
- package/AGENTS.md +314 -103
- package/CHANGELOG.md +76 -7
- package/DEPLOYMENT.md +171 -0
- package/DEVELOPMENT.md +174 -76
- package/README.md +240 -140
- package/examples/china/README.md +2 -2
- package/examples/energized/README.md +4 -2
- package/examples/sdn/README.md +2 -2
- package/examples/whitelist/README.md +2 -2
- package/package.json +29 -24
- package/src/cli.js +59 -33
- package/src/compile-source.js +4 -3
- package/src/configuration.js +132 -2
- package/src/download.js +27 -0
- package/src/filter.js +2 -2
- package/src/index.d.ts +2 -0
- package/src/index.js +21 -51
- package/src/{transformations/ip-normalize.js → ip-normalize.js} +2 -2
- package/src/schemas/configuration.schema.js +137 -0
- package/src/source-types.js +17 -0
- package/src/transformations/enum.js +49 -0
- package/src/transformations/include.js +1 -1
- package/src/transformations/transform.js +40 -74
- package/src/transformations/validate-allow-ip-and-public-suffix.js +1 -1
- package/src/transformations/validate-allow-ip.js +1 -1
- package/src/utils.js +1284 -0
- package/src/validation-conflicts.js +106 -0
- package/test/cli-error-output.test.js +305 -0
- package/test/cli.test.js +47 -0
- package/test/compile-source.test.js +167 -7
- package/test/configuration.test.js +438 -0
- package/test/download.test.js +260 -0
- package/test/helpers/http-mock.js +94 -0
- package/test/index.test.js +497 -4
- package/test/{transformations/ip-normalize.test.js → ip-normalize.test.js} +1 -1
- package/test/resolve-include.test.js +8 -8
- package/test/transformations/covert-to-ascii.test.js +1 -1
- package/test/transformations/exclude.test.js +2 -2
- package/test/transformations/include.test.js +9 -3
- package/test/transformations/ip-alignment.test.js +1 -1
- package/test/transformations/transform.test.js +66 -1
- package/test/utils.test.js +1559 -0
- package/test/validation-conflicts.test.js +230 -0
- package/bamboo-specs/bamboo.yaml +0 -14
- package/bamboo-specs/build.yaml +0 -92
- package/bamboo-specs/deploy.yaml +0 -38
- package/bamboo-specs/increment.yaml +0 -54
- package/bamboo-specs/permissions.yaml +0 -16
- package/bamboo-specs/test.yaml +0 -56
- package/src/schemas/configuration.schema.json +0 -369
- package/tools/build-txt.js +0 -19
package/.dockerignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Version control
|
|
2
|
+
.git
|
|
3
|
+
|
|
4
|
+
# IDE / editor
|
|
5
|
+
.idea
|
|
6
|
+
.vscode
|
|
7
|
+
|
|
8
|
+
# macOS
|
|
9
|
+
.DS_Store
|
|
10
|
+
|
|
11
|
+
# Lint cache
|
|
12
|
+
.eslintcache
|
|
13
|
+
|
|
14
|
+
# Dependencies & build output
|
|
15
|
+
node_modules/
|
|
16
|
+
dist/
|
|
17
|
+
|
|
18
|
+
# Docker
|
|
19
|
+
Dockerfile*
|
|
20
|
+
|
|
21
|
+
# Logs & archives
|
|
22
|
+
*.log
|
|
23
|
+
*.tgz
|
|
24
|
+
|
|
25
|
+
# Local environment & secrets (may contain npm registry auth tokens)
|
|
26
|
+
.npmrc
|
|
27
|
+
.npmrc.*
|
|
28
|
+
.env
|
|
29
|
+
.env.*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
description: Lints, tests, and builds on pull requests and pushes to master.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
|
|
11
|
+
# Runs on every PR and every push to master; cancel superseded runs to avoid
|
|
12
|
+
# spawning overlapping workflows that waste self-hosted runner capacity.
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
test:
|
|
19
|
+
uses: AdGuardSoftwareLimited/ext-shared-actions/.github/workflows/test-and-build.yml@master
|
|
20
|
+
with:
|
|
21
|
+
package_file: hostlist-compiler.tgz
|
|
22
|
+
team: filters
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Mirror
|
|
2
|
+
|
|
3
|
+
description: Mirrors code to the public repo on every push to master.
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- master
|
|
9
|
+
|
|
10
|
+
# `contents: read` — checkout source repo
|
|
11
|
+
# `actions: write` — disable workflows in the public mirror
|
|
12
|
+
# `id-token: write` — Octopass token for push to public repo
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
actions: write
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
mirror:
|
|
20
|
+
uses: AdGuardSoftwareLimited/actions/.github/workflows/mirror.yml@master
|
|
21
|
+
with:
|
|
22
|
+
team: filters
|
|
23
|
+
target_repo: git@github.com:AdguardTeam/HostlistCompiler.git
|
|
24
|
+
secrets: inherit
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Prepare release
|
|
2
|
+
|
|
3
|
+
description: >-
|
|
4
|
+
Opens a release PR that finalizes CHANGELOG.md for the given tag.
|
|
5
|
+
After merge, publish-release.yml takes over.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
inputs:
|
|
10
|
+
tag:
|
|
11
|
+
description: 'Release tag WITH "v" prefix (e.g. v2.1.0, v2.1.0-beta.1)'
|
|
12
|
+
required: true
|
|
13
|
+
type: string
|
|
14
|
+
|
|
15
|
+
# `contents: write` — push the release-bump branch
|
|
16
|
+
# `id-token: write` — Octopass OIDC for PR creation
|
|
17
|
+
permissions:
|
|
18
|
+
contents: write
|
|
19
|
+
id-token: write
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
create-release-pr:
|
|
23
|
+
uses: AdGuardSoftwareLimited/actions/.github/workflows/create-release-pr.yml@master
|
|
24
|
+
with:
|
|
25
|
+
tag: ${{ inputs.tag }}
|
|
26
|
+
team: filters
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Publish release
|
|
2
|
+
|
|
3
|
+
description: >-
|
|
4
|
+
Tags the release commit, builds, tests, publishes to npm,
|
|
5
|
+
mirrors to the public repo, drafts a GitHub Release, and notifies Slack.
|
|
6
|
+
|
|
7
|
+
# The `pull_request` trigger fires for ANY closed PR against master, including
|
|
8
|
+
# PRs closed without being merged. The called workflow (tag-from-changelog)
|
|
9
|
+
# only proceeds when `github.event.pull_request.merged == true` and the head
|
|
10
|
+
# ref starts with `release-bump/`, so an unmerged close is a safe no-op.
|
|
11
|
+
# Mirroring that guard here keeps the intent visible at the call site.
|
|
12
|
+
on:
|
|
13
|
+
pull_request:
|
|
14
|
+
types: [closed]
|
|
15
|
+
branches: [master]
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
inputs:
|
|
18
|
+
ref:
|
|
19
|
+
description: Ref to publish manually
|
|
20
|
+
required: false
|
|
21
|
+
type: string
|
|
22
|
+
|
|
23
|
+
# Serialize release runs: a manual dispatch racing a merge-triggered run must
|
|
24
|
+
# not concurrently create tags, publish to npm, or draft GitHub Releases.
|
|
25
|
+
concurrency:
|
|
26
|
+
group: publish-release
|
|
27
|
+
cancel-in-progress: false
|
|
28
|
+
|
|
29
|
+
jobs:
|
|
30
|
+
publish:
|
|
31
|
+
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
|
|
32
|
+
uses: AdGuardSoftwareLimited/ext-shared-actions/.github/workflows/publish-release.yml@master
|
|
33
|
+
with:
|
|
34
|
+
package_file: hostlist-compiler.tgz
|
|
35
|
+
npm_package_name: "@adguard/hostlist-compiler"
|
|
36
|
+
target_repo: AdguardTeam/HostlistCompiler
|
|
37
|
+
team: filters
|
|
38
|
+
slack_channel: "#adguard-filters-vcs"
|
|
39
|
+
ref: ${{ inputs.ref }}
|
|
40
|
+
secrets: inherit
|
|
41
|
+
permissions:
|
|
42
|
+
contents: write # create tag & GitHub release (tag-from-changelog, mirror-and-release)
|
|
43
|
+
id-token: write # OIDC trusted publishing to npm (deploy-to-npm, mirror-and-release)
|
|
44
|
+
actions: write # disable/enable workflows in the mirror repo (mirror-and-release)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ul-indent": {
|
|
3
|
+
"indent": 4
|
|
4
|
+
},
|
|
5
|
+
"line-length": {
|
|
6
|
+
"strict": true,
|
|
7
|
+
"line_length": 120,
|
|
8
|
+
"tables": false
|
|
9
|
+
},
|
|
10
|
+
"no-multiple-blanks": {
|
|
11
|
+
"maximum": 2
|
|
12
|
+
},
|
|
13
|
+
"no-inline-html": {
|
|
14
|
+
"allowed_elements": [
|
|
15
|
+
"a"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"no-duplicate-heading": {
|
|
19
|
+
"siblings_only": true
|
|
20
|
+
},
|
|
21
|
+
"no-blanks-blockquote": false,
|
|
22
|
+
"no-bare-urls": false,
|
|
23
|
+
"table-column-style": {
|
|
24
|
+
"style": "aligned"
|
|
25
|
+
},
|
|
26
|
+
"ul-style": {
|
|
27
|
+
"style": "dash"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules/
|