@link-assistant/web-capture 1.1.2 → 1.4.2

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +17 -14
  2. package/README.md +256 -146
  3. package/bin/web-capture.js +403 -6
  4. package/package.json +11 -4
  5. package/src/animation.js +283 -0
  6. package/src/archive.js +212 -0
  7. package/src/batch.js +180 -0
  8. package/src/browser.js +150 -111
  9. package/src/docx.js +182 -0
  10. package/src/figures.js +208 -0
  11. package/src/gdocs.js +333 -0
  12. package/src/image.js +65 -8
  13. package/src/index.js +15 -0
  14. package/src/latex.js +127 -0
  15. package/src/lib.js +226 -1
  16. package/src/localize-images.js +202 -0
  17. package/src/metadata.js +333 -0
  18. package/src/pdf.js +76 -0
  19. package/src/popups.js +171 -0
  20. package/src/postprocess.js +265 -0
  21. package/src/retry.js +48 -0
  22. package/src/themed-image.js +167 -0
  23. package/src/verify.js +312 -0
  24. package/tests/e2e/docker.test.js +51 -12
  25. package/tests/e2e/process.test.js +34 -10
  26. package/tests/fixtures/habr-articles.js +45 -0
  27. package/tests/integration/api-endpoints.test.js +231 -0
  28. package/tests/integration/habr-article.test.js +337 -0
  29. package/tests/mock/index.test.js +5 -3
  30. package/tests/unit/animation.test.js +33 -0
  31. package/tests/unit/batch.test.js +114 -0
  32. package/tests/unit/browser.test.js +38 -2
  33. package/tests/unit/figures.test.js +74 -0
  34. package/tests/unit/gdocs.test.js +203 -0
  35. package/tests/unit/latex.test.js +123 -0
  36. package/tests/unit/localize-images.test.js +78 -0
  37. package/tests/unit/metadata.test.js +140 -0
  38. package/tests/unit/postprocess.test.js +108 -0
  39. package/tests/unit/retry.test.js +111 -0
  40. package/tests/unit/verify.test.js +182 -0
  41. package/.github/workflows/release.yml +0 -294
  42. package/ARCHITECTURE.md +0 -982
  43. package/LICENSE +0 -24
  44. package/apply.sh +0 -166
  45. package/docs/market-analysis-2025-05-13.md +0 -64
  46. package/scripts/changeset-version.mjs +0 -38
  47. package/scripts/create-github-release.mjs +0 -93
  48. package/scripts/create-manual-changeset.mjs +0 -88
  49. package/scripts/format-github-release.mjs +0 -83
  50. package/scripts/format-release-notes.mjs +0 -218
  51. package/scripts/instant-version-bump.mjs +0 -121
  52. package/scripts/publish-to-npm.mjs +0 -128
  53. package/scripts/setup-npm.mjs +0 -37
  54. package/scripts/validate-changeset.mjs +0 -106
  55. package/scripts/version-and-commit.mjs +0 -237
@@ -1,294 +0,0 @@
1
- name: Checks and release
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- types: [opened, synchronize, reopened]
9
- # Manual release support - consolidated here to work with npm trusted publishing
10
- # npm only allows ONE workflow file as trusted publisher, so all publishing
11
- # must go through this workflow (release.yml)
12
- workflow_dispatch:
13
- inputs:
14
- release_mode:
15
- description: 'Manual release mode'
16
- required: true
17
- type: choice
18
- default: 'instant'
19
- options:
20
- - instant
21
- - changeset-pr
22
- bump_type:
23
- description: 'Manual release type'
24
- required: true
25
- type: choice
26
- options:
27
- - patch
28
- - minor
29
- - major
30
- description:
31
- description: 'Manual release description (optional)'
32
- required: false
33
- type: string
34
-
35
- concurrency: ${{ github.workflow }}-${{ github.ref }}
36
-
37
- jobs:
38
- # Changeset check - only runs on PRs
39
- changeset-check:
40
- name: Check for Changesets
41
- runs-on: ubuntu-latest
42
- if: github.event_name == 'pull_request'
43
- steps:
44
- - uses: actions/checkout@v4
45
- with:
46
- fetch-depth: 0
47
-
48
- - name: Setup Node.js
49
- uses: actions/setup-node@v4
50
- with:
51
- node-version: '20.x'
52
-
53
- - name: Install dependencies
54
- run: npm install
55
-
56
- - name: Check for changesets
57
- run: |
58
- # Skip changeset check for automated version PRs
59
- if [[ "${{ github.head_ref }}" == "changeset-release/"* ]]; then
60
- echo "Skipping changeset check for automated release PR"
61
- exit 0
62
- fi
63
-
64
- # Run changeset validation script
65
- node scripts/validate-changeset.mjs
66
-
67
- # Linting and formatting - runs after changeset check on PRs, immediately on main
68
- lint:
69
- name: Lint and Format Check
70
- runs-on: ubuntu-latest
71
- needs: [changeset-check]
72
- if: always() && (github.event_name == 'push' || needs.changeset-check.result == 'success')
73
- steps:
74
- - uses: actions/checkout@v4
75
-
76
- - name: Setup Node.js
77
- uses: actions/setup-node@v4
78
- with:
79
- node-version: '20.x'
80
-
81
- - name: Install dependencies
82
- run: npm install
83
-
84
- - name: Run ESLint
85
- run: npm run lint
86
-
87
- - name: Check formatting
88
- run: npm run format:check
89
-
90
- - name: Check code duplication
91
- run: npm run check:duplication
92
-
93
- # Test matrix: Node.js on Ubuntu with unit tests and e2e tests
94
- test:
95
- name: Test (Node.js on ${{ matrix.os }})
96
- runs-on: ${{ matrix.os }}
97
- needs: [changeset-check]
98
- if: always() && (github.event_name == 'push' || needs.changeset-check.result == 'success')
99
- strategy:
100
- fail-fast: false
101
- matrix:
102
- os: [ubuntu-latest]
103
- steps:
104
- - uses: actions/checkout@v4
105
-
106
- - name: Setup Node.js
107
- uses: actions/setup-node@v4
108
- with:
109
- node-version: '22.x'
110
-
111
- - name: Install dependencies
112
- run: npm install
113
-
114
- - name: Install Playwright browsers
115
- run: npx playwright install --with-deps chromium
116
-
117
- - name: Install Puppeteer browsers
118
- run: npx puppeteer browsers install chrome
119
-
120
- - name: Run unit, integration, and e2e process tests
121
- run: npm test -- --testPathIgnorePatterns="docker.test.js"
122
-
123
- - name: Build Docker image for e2e tests
124
- run: docker compose build
125
-
126
- - name: Run e2e Docker tests
127
- run: npm test -- tests/e2e/docker.test.js
128
-
129
- # Release - only runs on main after tests pass (for push events)
130
- release:
131
- name: Release
132
- needs: [lint, test]
133
- # Use always() to ensure this job runs even if changeset-check was skipped
134
- # This is needed because lint/test jobs have a transitive dependency on changeset-check
135
- if: always() && github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.lint.result == 'success' && needs.test.result == 'success'
136
- runs-on: ubuntu-latest
137
- # Permissions required for npm OIDC trusted publishing
138
- permissions:
139
- contents: write
140
- pull-requests: write
141
- id-token: write
142
- steps:
143
- - uses: actions/checkout@v4
144
- with:
145
- fetch-depth: 0
146
-
147
- - name: Setup Node.js
148
- uses: actions/setup-node@v4
149
- with:
150
- node-version: '22.x'
151
- registry-url: 'https://registry.npmjs.org'
152
-
153
- - name: Install dependencies
154
- run: npm install
155
-
156
- - name: Update npm for OIDC trusted publishing
157
- run: node scripts/setup-npm.mjs
158
-
159
- - name: Check for changesets
160
- id: check_changesets
161
- run: |
162
- # Count changeset files (excluding README.md and config.json)
163
- CHANGESET_COUNT=$(find .changeset -name "*.md" ! -name "README.md" | wc -l)
164
- echo "Found $CHANGESET_COUNT changeset file(s)"
165
- echo "has_changesets=$([[ $CHANGESET_COUNT -gt 0 ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
166
-
167
- - name: Version packages and commit to main
168
- if: steps.check_changesets.outputs.has_changesets == 'true'
169
- id: version
170
- run: node scripts/version-and-commit.mjs --mode changeset
171
-
172
- - name: Publish to npm
173
- # Run if version was committed OR if a previous attempt already committed (for re-runs)
174
- if: steps.version.outputs.version_committed == 'true' || steps.version.outputs.already_released == 'true'
175
- id: publish
176
- run: node scripts/publish-to-npm.mjs --should-pull
177
-
178
- - name: Create GitHub Release
179
- if: steps.publish.outputs.published == 'true'
180
- env:
181
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
182
- run: node scripts/create-github-release.mjs --release-version "${{ steps.publish.outputs.published_version }}" --repository "${{ github.repository }}"
183
-
184
- - name: Format GitHub release notes
185
- if: steps.publish.outputs.published == 'true'
186
- env:
187
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188
- run: node scripts/format-github-release.mjs --release-version "${{ steps.publish.outputs.published_version }}" --repository "${{ github.repository }}" --commit-sha "${{ github.sha }}"
189
-
190
- # Manual Instant Release - triggered via workflow_dispatch with instant mode
191
- # This job is in release.yml because npm trusted publishing
192
- # only allows one workflow file to be registered as a trusted publisher
193
- instant-release:
194
- name: Instant Release
195
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_mode == 'instant'
196
- runs-on: ubuntu-latest
197
- # Permissions required for npm OIDC trusted publishing
198
- permissions:
199
- contents: write
200
- pull-requests: write
201
- id-token: write
202
- steps:
203
- - uses: actions/checkout@v4
204
- with:
205
- fetch-depth: 0
206
-
207
- - name: Setup Node.js
208
- uses: actions/setup-node@v4
209
- with:
210
- node-version: '22.x'
211
- registry-url: 'https://registry.npmjs.org'
212
-
213
- - name: Install dependencies
214
- run: npm install
215
-
216
- - name: Update npm for OIDC trusted publishing
217
- run: node scripts/setup-npm.mjs
218
-
219
- - name: Version packages and commit to main
220
- id: version
221
- run: node scripts/version-and-commit.mjs --mode instant --bump-type "${{ github.event.inputs.bump_type }}" --description "${{ github.event.inputs.description }}"
222
-
223
- - name: Publish to npm
224
- # Run if version was committed OR if a previous attempt already committed (for re-runs)
225
- if: steps.version.outputs.version_committed == 'true' || steps.version.outputs.already_released == 'true'
226
- id: publish
227
- run: node scripts/publish-to-npm.mjs
228
-
229
- - name: Create GitHub Release
230
- if: steps.publish.outputs.published == 'true'
231
- env:
232
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
233
- run: node scripts/create-github-release.mjs --release-version "${{ steps.publish.outputs.published_version }}" --repository "${{ github.repository }}"
234
-
235
- - name: Format GitHub release notes
236
- if: steps.publish.outputs.published == 'true'
237
- env:
238
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
239
- run: node scripts/format-github-release.mjs --release-version "${{ steps.publish.outputs.published_version }}" --repository "${{ github.repository }}" --commit-sha "${{ github.sha }}"
240
-
241
- # Manual Changeset PR - creates a pull request with the changeset for review
242
- changeset-pr:
243
- name: Create Changeset PR
244
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_mode == 'changeset-pr'
245
- runs-on: ubuntu-latest
246
- permissions:
247
- contents: write
248
- pull-requests: write
249
- steps:
250
- - uses: actions/checkout@v4
251
- with:
252
- fetch-depth: 0
253
-
254
- - name: Setup Node.js
255
- uses: actions/setup-node@v4
256
- with:
257
- node-version: '22.x'
258
-
259
- - name: Install dependencies
260
- run: npm install
261
-
262
- - name: Create changeset file
263
- run: node scripts/create-manual-changeset.mjs --bump-type "${{ github.event.inputs.bump_type }}" --description "${{ github.event.inputs.description }}"
264
-
265
- - name: Format changeset with Prettier
266
- run: |
267
- # Run Prettier on the changeset file to ensure it matches project style
268
- npx prettier --write ".changeset/*.md" || true
269
-
270
- echo "Formatted changeset files"
271
-
272
- - name: Create Pull Request
273
- uses: peter-evans/create-pull-request@v7
274
- with:
275
- token: ${{ secrets.GITHUB_TOKEN }}
276
- commit-message: 'chore: add changeset for manual ${{ github.event.inputs.bump_type }} release'
277
- branch: changeset-manual-release-${{ github.run_id }}
278
- delete-branch: true
279
- title: 'chore: manual ${{ github.event.inputs.bump_type }} release'
280
- body: |
281
- ## Manual Release Request
282
-
283
- This PR was created by a manual workflow trigger to prepare a **${{ github.event.inputs.bump_type }}** release.
284
-
285
- ### Release Details
286
- - **Type:** ${{ github.event.inputs.bump_type }}
287
- - **Description:** ${{ github.event.inputs.description || 'Manual release' }}
288
- - **Triggered by:** @${{ github.actor }}
289
-
290
- ### Next Steps
291
- 1. Review the changeset in this PR
292
- 2. Merge this PR to main
293
- 3. The automated release workflow will create a version PR
294
- 4. Merge the version PR to publish to npm and create a GitHub release