Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mbalabash committed Nov 21, 2023
1 parent 3fc40b5 commit 66ced61
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ on:
jobs:
full:
runs-on: ubuntu-latest
name: OS ubuntu-latest Node.js 19
name: OS ubuntu-latest Node.js 18
steps:
- name: Install Chrome
uses: browser-actions/setup-chrome@latest
uses: browser-actions/setup-chrome@latest
- name: Checkout the repository
uses: actions/checkout@v2
- name: Install Node.js 19
- name: Install Node.js 18
uses: actions/setup-node@v2
with:
node-version: 19
node-version: 18
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run unit tests
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

This project adheres to [Semantic Versioning](http://semver.org/).

## 1.1.3
## 2.0.0

- Dropped support for CommonJS
- Fixed type compatibility issue between puppeteer-core and puppeteer.
- Upgraded devDependencies.

Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ function scrollPage(scrollDirection) {
}
}

module.exports = { scrollPageToBottom: scrollPage('bottom'), scrollPageToTop: scrollPage('top') }
export const scrollPageToBottom = scrollPage('bottom');

export const scrollPageToTop = scrollPage('top');
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "puppeteer-autoscroll-down",
"version": "1.1.3",
"version": "2.0.0",
"description": "Handle infinite scroll on websites with puppeteer",
"main": "index.js",
"types": "./index.d.ts",
"engines": {
"node": ">=12"
"node": ">=18"
},
"type": "module",
"license": "MIT",
"author": "mbalabash <[email protected]>",
"scripts": {
Expand Down Expand Up @@ -39,7 +40,7 @@
"eslint-plugin-perfectionist": "^2.4.0",
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-promise": "^6.1.1",
"find-chrome-bin": "1.0.5",
"find-chrome-bin": "2.0.0",
"puppeteer-core": "^21.5.2",
"tsm": "^2.3.0",
"typescript": "^5.3.2",
Expand Down
16 changes: 9 additions & 7 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const { test } = require('uvu')
const { join } = require('node:path')
const assert = require('uvu/assert')
const puppeteer = require('puppeteer-core')
const { findChrome } = require('find-chrome-bin')
const { PUPPETEER_REVISIONS } = require('puppeteer-core/lib/cjs/puppeteer/revisions.js')
import { findChrome } from 'find-chrome-bin'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url';
import puppeteer from 'puppeteer-core'
import { PUPPETEER_REVISIONS } from 'puppeteer-core/lib/cjs/puppeteer/revisions.js'
import { test } from 'uvu';
import * as assert from 'uvu/assert';

const { scrollPageToBottom, scrollPageToTop } = require('../index')
import { scrollPageToBottom, scrollPageToTop } from '../index.js'
const __dirname = dirname(fileURLToPath(import.meta.url));

test('should scroll `regular` page to bottom', async () => {
let chromeInfo = await findChrome({
Expand Down
24 changes: 13 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@puppeteer/[email protected]":
"@puppeteer/[email protected]", "@puppeteer/browsers@^1.8.0":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-1.8.0.tgz#fb6ee61de15e7f0e67737aea9f9bab1512dbd7d8"
integrity sha512-TkRHIV6k2D8OlUe8RtG+5jgOF/H98Myx0M6AOafC8DdNVOFiBSFa5cpRDtpm8LXOa9sVwe0+e6Q3FC56X/DZfg==
Expand Down Expand Up @@ -145,9 +145,9 @@
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==

"@types/node@*":
version "20.9.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.2.tgz#002815c8e87fe0c9369121c78b52e800fadc0ac6"
integrity sha512-WHZXKFCEyIUJzAwh3NyyTHYSR35SevJ6mZ1nWwJafKtiQbqRTIKSRcw3Ma3acqgsent3RRDqeVwpHntMk+9irg==
version "20.9.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.3.tgz#e089e1634436f676ff299596c9531bd2b59fffc6"
integrity sha512-nk5wXLAXGBKfrhLB0cyHGbSqopS+nz0BUgZkUQqSHSSgdee0kssp1IAqlQOu333bW+gMNs2QREx7iynm19Abxw==
dependencies:
undici-types "~5.26.4"

Expand All @@ -159,9 +159,9 @@
puppeteer "*"

"@types/semver@^7.5.0":
version "7.5.5"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.5.tgz#deed5ab7019756c9c90ea86139106b0346223f35"
integrity sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==
version "7.5.6"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339"
integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==

"@types/yauzl@^2.9.1":
version "2.10.3"
Expand Down Expand Up @@ -1144,10 +1144,12 @@ fill-range@^7.0.1:
dependencies:
to-regex-range "^5.0.1"

[email protected]:
version "1.0.5"
resolved "https://registry.yarnpkg.com/find-chrome-bin/-/find-chrome-bin-1.0.5.tgz#45ba5c6599ece2ee9546e520475f29fd6f28d5c8"
integrity sha512-hz7lQfY012+IkiK4dJCp+kPCGurGLjbHhl9ngFeqr55ihS0eBhdKqCQamvHJvT59HSZB1tRORfMfRgTOpkLdxQ==
[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/find-chrome-bin/-/find-chrome-bin-2.0.0.tgz#c9d51e3aa929fe7530e369d3face39389c341e58"
integrity sha512-Uwsw1Orpl1wXW0GuafLhKGBrwqFTB0SPqru0vOvHMeO1xnP9pvdqlb1BP36kbcpXal2sZhcW10DEPT/U2DWL2w==
dependencies:
"@puppeteer/browsers" "^1.8.0"

find-up@^5.0.0:
version "5.0.0"
Expand Down

0 comments on commit 66ced61

Please sign in to comment.