Skip to content

Commit

Permalink
build: remove unnecessary dependency (#184)
Browse files Browse the repository at this point in the history
* build: remove unnecessary dependency

* test: update snapshot

* fix: extension filename
  • Loading branch information
Kikobeats authored Jan 1, 2024
1 parent 8b8d796 commit c126406
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
token: ${{ secrets.GH_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install
run: npm install --no-package-lock
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true
- name: Test
run: npm test
- name: Report
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,22 @@
"request"
],
"dependencies": {
"@kikobeats/time-span": "~1.0.2",
"@metascraper/helpers": "~5.42.5",
"@kikobeats/time-span": "~1.0.3",
"@metascraper/helpers": "~5.43.0",
"cheerio": "~1.0.0-rc.12",
"css-url-regex": "~4.0.0",
"debug-logfmt": "~1.2.0",
"execall": "~2.0.0",
"got": "~11.8.6",
"html-encode": "~2.1.6",
"html-urls": "~2.4.45",
"html-urls": "~2.4.55",
"is-html-content": "~1.0.0",
"lodash": "~4.17.21",
"mri": "~1.2.0",
"p-cancelable": "~2.1.0",
"p-retry": "~4.6.0",
"replace-string": "~3.1.0",
"top-sites": "~1.1.169",
"write-json-file": "~4.3.0"
"top-sites": "~1.1.202"
},
"devDependencies": {
"@commitlint/cli": "latest",
Expand Down
4 changes: 2 additions & 2 deletions scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const { compact, reduce, findIndex } = require('lodash')
const { parseUrl } = require('@metascraper/helpers')
const writeJsonFile = require('write-json-file')
const { writeFile } = require('fs').promises
const topsites = require('top-sites')

const domains = [
Expand Down Expand Up @@ -74,6 +74,6 @@ const { top, rest } = reduce(
{ top: new Array(topsites.length), rest: [] }
)

writeJsonFile('./src/auto-domains.json', compact(top).concat(rest)).catch(
writeFile('./src/auto-domains.json', JSON.stringify(compact(top).concat(rest)), null, 2).catch(
error => console.log(error)
)
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ test('from image URL', async t => {
})

test('from video URL', async t => {
const targetUrl = 'http://techslides.com/demos/sample-videos/small.mp4'
const targetUrl = 'https://cdn.microlink.io/file-examples/sample.mp4'
const { url, stats, html } = await getHTML(targetUrl, {
prerender: false,
getBrowserless
Expand Down
8 changes: 4 additions & 4 deletions test/snapshots/index.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ Generated by [AVA](https://avajs.dev).
`<!DOCTYPE html>␊
<html>␊
<head>␊
<title>small.mp4</title>␊
<meta property="og:site_name" content="techslides.com">␊
<title>sample.mp4</title>␊
<meta property="og:site_name" content="microlink.io">␊
<meta name="date" content="{DATE}">␊
<link rel="canonical" href="http://techslides.com/demos/sample-videos/small.mp4">␊
<link rel="canonical" href="https://cdn.microlink.io/file-examples/sample.mp4">␊
</head>␊
<body><video>␊
<source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">␊
<source src="https://cdn.microlink.io/file-examples/sample.mp4" type="video/mp4">␊
</video></body>␊
</html>`

Expand Down
Binary file modified test/snapshots/index.js.snap
Binary file not shown.

0 comments on commit c126406

Please sign in to comment.