15 Commits

Author SHA1 Message Date
e9bf2032fb 2.0.4 2022-10-26 23:10:45 +02:00
3a2e85b4e5 fix(core): update 2022-10-26 23:10:45 +02:00
fdfa6a72c8 2.0.3 2022-10-26 23:00:44 +02:00
801416dc1e fix(core): update 2022-10-26 23:00:43 +02:00
84cf226d42 2.0.2 2022-03-25 01:19:21 +01:00
63f56da150 fix(core): update 2022-03-25 01:19:21 +01:00
3559453579 2.0.1 2022-03-24 23:41:51 +01:00
ea509d4246 fix(core): update 2022-03-24 23:41:51 +01:00
c13a125ac7 2.0.0 2022-03-24 14:58:00 +01:00
8f6949b1b8 1.0.23 2022-03-24 14:57:17 +01:00
9b698c6dea fix(core): update 2022-03-24 14:57:16 +01:00
157bcff7c4 1.0.22 2021-11-07 20:42:50 +01:00
934423f0ad fix(core): update 2021-11-07 20:42:49 +01:00
e6d7fdced6 1.0.21 2021-11-07 20:21:04 +01:00
2fc4e691ac fix(core): update 2021-11-07 20:21:03 +01:00
11 changed files with 4118 additions and 11601 deletions

View File

@ -12,6 +12,9 @@ stages:
- release - release
- metadata - metadata
before_script:
- npm install -g @shipzone/npmci
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
@ -36,6 +39,7 @@ auditProductionDependencies:
- npmci command npm audit --audit-level=high --only=prod --production - npmci command npm audit --audit-level=high --only=prod --production
tags: tags:
- docker - docker
allow_failure: true
auditDevDependencies: auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

11540
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,13 @@
{ {
"name": "@pushrocks/smartbrowser", "name": "@pushrocks/smartbrowser",
"version": "1.0.20", "version": "2.0.4",
"description": "simplified puppeteer", "description": "simplified puppeteer",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web)" "build": "(tsbuild --web --allowimplicitany)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -19,17 +20,16 @@
}, },
"homepage": "https://gitlab.com/pushrocks/smartbrowser#README", "homepage": "https://gitlab.com/pushrocks/smartbrowser#README",
"dependencies": { "dependencies": {
"@pushrocks/smartdelay": "^2.0.10", "@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartpdf": "^2.0.9", "@pushrocks/smartpdf": "^3.0.14",
"@pushrocks/smartpuppeteer": "^1.0.21", "@pushrocks/smartpuppeteer": "^2.0.0",
"@pushrocks/smartunique": "^3.0.3" "@pushrocks/smartunique": "^3.0.3"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.61",
"@gitzone/tstest": "^1.0.52", "@gitzone/tsrun": "^1.2.39",
"@pushrocks/tapbundle": "^3.2.14", "@gitzone/tstest": "^1.0.69",
"tslint": "^6.1.3", "@pushrocks/tapbundle": "^5.0.3"
"tslint-config-prettier": "^1.18.0"
}, },
"private": false, "private": false,
"files": [ "files": [

4071
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +1,25 @@
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect, expectAsync } from '@pushrocks/tapbundle';
import * as smartbrowser from '../ts/index'; import * as smartbrowser from '../ts/index.js';
let testSmartBrowser: smartbrowser.SmartBrowser; let testSmartBrowser: smartbrowser.SmartBrowser;
tap.test('should instanstiate a new browser ', async () => { tap.test('should instanstiate a new browser ', async () => {
testSmartBrowser = new smartbrowser.SmartBrowser(); testSmartBrowser = new smartbrowser.SmartBrowser();
return expect(testSmartBrowser).to.be.instanceof(smartbrowser.SmartBrowser); return expect(testSmartBrowser).toBeInstanceOf(smartbrowser.SmartBrowser);
}); });
tap.test('should start the browser ', async () => { tap.test('should start the browser ', async () => {
await expect(testSmartBrowser.start()).to.eventually.be.fulfilled; await testSmartBrowser.start();
}); });
tap.test('should create a PDF from a page', async (tools) => { tap.test('should create a PDF from a page', async (tools) => {
const result = await testSmartBrowser.pdfFromPage('https://lossless.com'); const result = await testSmartBrowser.pdfFromPage('https://lossless.com');
expect(result.buffer).to.be.instanceOf(Buffer); expect(result.buffer).toBeInstanceOf(Buffer);
}); });
tap.test('should produce a valid screenshot', async (tools) => { tap.test('should produce a valid screenshot', async (tools) => {
const result = await testSmartBrowser.screenshotFromPage('https://lossless.com'); const result = await testSmartBrowser.screenshotFromPage('https://lossless.com');
expect(result.buffer).to.be.instanceOf(Buffer); expect(result.buffer).toBeInstanceOf(Buffer);
}); });
tap.test('should evalute something in the browser', async () => { tap.test('should evalute something in the browser', async () => {
@ -30,7 +30,7 @@ tap.test('should evalute something in the browser', async () => {
}); });
tap.test('should stop the browser ', async () => { tap.test('should stop the browser ', async () => {
await expect(testSmartBrowser.stop()).to.eventually.be.fulfilled; await testSmartBrowser.stop();
}); });
tap.start(); tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartbrowser',
version: '2.0.4',
description: 'simplified puppeteer'
}

View File

@ -1,6 +1,6 @@
import * as plugins from './smartbrowser.plugins'; import * as plugins from './smartbrowser.plugins.js';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces/index.js';
/** /**
* SmartBrowser * SmartBrowser
@ -30,8 +30,8 @@ export class SmartBrowser {
* create a pdf from page * create a pdf from page
* @param urlArg * @param urlArg
*/ */
public pdfFromPage(urlArg: string) { public async pdfFromPage(urlArg: string) {
const result = this.smartpdf.getFullWebsiteAsSinglePdf(urlArg); const result = await this.smartpdf.getFullWebsiteAsSinglePdf(urlArg);
return result; return result;
} }
@ -47,7 +47,7 @@ export class SmartBrowser {
}); });
const screenshotBuffer = await page.screenshot({ const screenshotBuffer = await page.screenshot({
encoding: 'binary', encoding: 'binary',
}); }) as Buffer;
await page.close(); await page.close();
return { return {
name: pageId, name: pageId,

View File

@ -1 +1 @@
export * from './interfaces.screenshotresult'; export * from './interfaces.screenshotresult.js';

9
tsconfig.json Normal file
View File

@ -0,0 +1,9 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
}

View File

@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}