Compare commits

..

5 Commits

13 changed files with 3551 additions and 5919 deletions
-141
View File
@@ -1,141 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @git.zone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true
+37
View File
@@ -0,0 +1,37 @@
{
"@git.zone/cli": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartpuppeteer",
"shortDescription": "simplified access to puppeteer",
"npmPackagename": "@push.rocks/smartpuppeteer",
"license": "MIT",
"description": "Provides simplified access to Puppeteer for automation and testing purposes.",
"keywords": [
"puppeteer",
"automation",
"browser automation",
"web scraping",
"testing",
"headless browsing",
"incognito browsing"
]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
},
"@ship.zone/szci": {
"npmGlobalTools": [],
"npmRegistryUrl": "registry.npmjs.org"
}
}
+13
View File
@@ -1,5 +1,18 @@
# Changelog
## 2026-05-01 - 2.0.6 - fix(browser)
update browser context creation for current Puppeteer API and refresh build configuration
- Replace deprecated incognito context creation with createBrowserContext() for compatibility with newer Puppeteer versions
- Refresh build and test tooling configuration, including updated scripts and Node typings
- Rename the test entrypoint to test.node.ts and migrate assertions to @git.zone/tstest/tapbundle
## 2025-02-25 - 2.0.5 - fix(dependencies)
Update dependencies including Puppeteer and node types.
- Updated Puppeteer version from ^22.6.4 to ^24.3.0.
- Updated @types/node version from ^20.12.7 to ^22.13.5.
## 2025-02-25 - 2.0.4 - fix(IncognitoBrowser)
Enhance IncognitoBrowser error handling and process management
+2 -2
View File
@@ -1,4 +1,4 @@
Copyright (c) 2019 Lossless GmbH (hello@lossless.com)
Copyright (c) 2019 Task Venture Capital GmbH <hello@task.vc>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
+14 -8
View File
@@ -1,5 +1,5 @@
{
"gitzone": {
"@git.zone/cli": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
@@ -8,7 +8,6 @@
"shortDescription": "simplified access to puppeteer",
"npmPackagename": "@push.rocks/smartpuppeteer",
"license": "MIT",
"projectDomain": "push.rocks",
"description": "Provides simplified access to Puppeteer for automation and testing purposes.",
"keywords": [
"puppeteer",
@@ -19,13 +18,20 @@
"headless browsing",
"incognito browsing"
]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"tsdoc": {
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
},
"@ship.zone/szci": {
"npmGlobalTools": [],
"npmRegistryUrl": "registry.npmjs.org"
}
}
}
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@push.rocks/smartpuppeteer",
"version": "2.0.4",
"version": "2.0.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@push.rocks/smartpuppeteer",
"version": "2.0.4",
"version": "2.0.5",
"license": "MIT",
"dependencies": {
"@push.rocks/smartdelay": "^2.0.13",
+13 -10
View File
@@ -1,28 +1,29 @@
{
"name": "@push.rocks/smartpuppeteer",
"version": "2.0.4",
"version": "2.0.6",
"private": false,
"description": "Provides simplified access to Puppeteer for automation and testing purposes.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH",
"author": "Task Venture Capital GmbH <hello@task.vc>",
"license": "MIT",
"scripts": {
"test": "tstest test/",
"build": "tsbuild --web --allowimplicitany"
"format": "gitzone format",
"build": "tsbuild --web",
"buildDocs": "tsdoc"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.1.63",
"@git.zone/tsrun": "^1.2.46",
"@git.zone/tstest": "^1.0.71",
"@push.rocks/tapbundle": "^5.0.8",
"@types/node": "^20.12.7"
"@git.zone/tsbuild": "^4.4.0",
"@git.zone/tsrun": "^2.0.3",
"@git.zone/tstest": "^3.6.3",
"@types/node": "^25.6.0"
},
"dependencies": {
"@push.rocks/smartdelay": "^3.0.1",
"@push.rocks/smartshell": "^3.0.3",
"puppeteer": "^22.6.4",
"@push.rocks/smartshell": "^3.3.8",
"puppeteer": "^24.42.0",
"tree-kill": "^1.2.2"
},
"files": [
@@ -34,6 +35,8 @@
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
".smartconfig.json",
"license",
"npmextra.json",
"readme.md"
],
+3456 -5740
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -1,7 +1,7 @@
import { expect, tap } from '@push.rocks/tapbundle';
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as smartpuppeteer from '../ts/index.js';
tap.test('should use pipe', async (tools) => {
tap.test('should use pipe', async () => {
const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({
forceNoSandbox: false,
});
@@ -12,7 +12,7 @@ tap.test('should use pipe', async (tools) => {
await headlessBrowser.close();
});
tap.test('should use websocket', async (tools) => {
tap.test('should use websocket', async () => {
const headlessBrowser = await smartpuppeteer.getEnvAwareBrowserInstance({
forceNoSandbox: false,
usePipe: false,
@@ -31,4 +31,4 @@ tap.test('should get and stop an Incognito browser', async () => {
await incognitoInstance.stop();
});
tap.start();
export default tap.start();
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartpuppeteer',
version: '2.0.4',
version: '2.0.6',
description: 'Provides simplified access to Puppeteer for automation and testing purposes.'
}
@@ -55,14 +55,12 @@ export class IncognitoBrowser {
/**
* Returns a new incognito browser context.
* This uses Puppeteer's createIncognitoBrowserContext() API, which is the
* correct method for creating isolated sessions.
* This uses Puppeteer's current createBrowserContext() API for isolated sessions.
*/
public async getNewIncognitoContext(): Promise<plugins.puppeteer.BrowserContext> {
if (!this.browser) {
throw new Error('You need to start the IncognitoBrowser instance first');
}
// @ts-ignore
return this.browser.createIncognitoBrowserContext();
return this.browser.createBrowserContext();
}
}
}
+2 -2
View File
@@ -43,10 +43,10 @@ export const getEnvAwareBrowserInstance = async (
const headlessBrowser = await plugins.puppeteer.launch({
args: chromeArgs,
pipe: options.usePipe !== undefined ? options.usePipe : true,
pipe: options.usePipe ?? true,
headless: true,
...executablePathOptions,
});
return headlessBrowser;
};
};
+4 -4
View File
@@ -5,10 +5,10 @@
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noImplicitAny": true,
"esModuleInterop": true,
"verbatimModuleSyntax": true
"verbatimModuleSyntax": true,
"types": ["node"]
},
"exclude": [
"dist_*/**/*.d.ts"
]
"exclude": ["dist_*/**/*.d.ts"]
}