fix(core): update
This commit is contained in:
		@@ -19,23 +19,35 @@ mirror:
 | 
			
		||||
  stage: security
 | 
			
		||||
  script:
 | 
			
		||||
    - npmci git mirror
 | 
			
		||||
  only:
 | 
			
		||||
    - tags
 | 
			
		||||
  tags:
 | 
			
		||||
    - lossless
 | 
			
		||||
    - docker
 | 
			
		||||
    - notpriv
 | 
			
		||||
 | 
			
		||||
audit:
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
    - npmci command npm audit --audit-level=high --only=dev
 | 
			
		||||
  tags:
 | 
			
		||||
    - lossless
 | 
			
		||||
    - docker
 | 
			
		||||
    - notpriv
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
 | 
			
		||||
# ====================
 | 
			
		||||
# test stage
 | 
			
		||||
@@ -50,9 +62,7 @@ testStable:
 | 
			
		||||
    - npmci npm test
 | 
			
		||||
  coverage: /\d+.?\d+?\%\s*coverage/
 | 
			
		||||
  tags:
 | 
			
		||||
    - lossless
 | 
			
		||||
    - docker
 | 
			
		||||
    - priv
 | 
			
		||||
 | 
			
		||||
testBuild:
 | 
			
		||||
  stage: test
 | 
			
		||||
@@ -63,9 +73,7 @@ testBuild:
 | 
			
		||||
    - npmci command npm run build
 | 
			
		||||
  coverage: /\d+.?\d+?\%\s*coverage/
 | 
			
		||||
  tags:
 | 
			
		||||
    - lossless
 | 
			
		||||
    - docker
 | 
			
		||||
    - notpriv
 | 
			
		||||
 | 
			
		||||
release:
 | 
			
		||||
  stage: release
 | 
			
		||||
@@ -85,6 +93,8 @@ release:
 | 
			
		||||
codequality:
 | 
			
		||||
  stage: metadata
 | 
			
		||||
  allow_failure: true
 | 
			
		||||
  only:
 | 
			
		||||
    - tags
 | 
			
		||||
  script:
 | 
			
		||||
    - npmci command npm install -g tslint typescript
 | 
			
		||||
    - npmci npm prepare
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@@ -15,7 +15,7 @@
 | 
			
		||||
            "properties": {
 | 
			
		||||
              "projectType": {
 | 
			
		||||
                "type": "string",
 | 
			
		||||
                "enum": ["website", "element", "service", "npm"]
 | 
			
		||||
                "enum": ["website", "element", "service", "npm", "wcc"]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10479
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										10479
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										17
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								package.json
									
									
									
									
									
								
							@@ -19,16 +19,16 @@
 | 
			
		||||
  },
 | 
			
		||||
  "homepage": "https://gitlab.com/pushrocks/smartbrowser#README",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@pushrocks/smartdelay": "^2.0.9",
 | 
			
		||||
    "@pushrocks/smartpdf": "^2.0.2",
 | 
			
		||||
    "@pushrocks/smartpuppeteer": "^1.0.15",
 | 
			
		||||
    "@pushrocks/smartdelay": "^2.0.10",
 | 
			
		||||
    "@pushrocks/smartpdf": "^2.0.8",
 | 
			
		||||
    "@pushrocks/smartpuppeteer": "^1.0.21",
 | 
			
		||||
    "@pushrocks/smartunique": "^3.0.3"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@gitzone/tsbuild": "^2.1.24",
 | 
			
		||||
    "@gitzone/tstest": "^1.0.32",
 | 
			
		||||
    "@pushrocks/tapbundle": "^3.2.1",
 | 
			
		||||
    "tslint": "^6.1.2",
 | 
			
		||||
    "@gitzone/tsbuild": "^2.1.25",
 | 
			
		||||
    "@gitzone/tstest": "^1.0.52",
 | 
			
		||||
    "@pushrocks/tapbundle": "^3.2.14",
 | 
			
		||||
    "tslint": "^6.1.3",
 | 
			
		||||
    "tslint-config-prettier": "^1.18.0"
 | 
			
		||||
  },
 | 
			
		||||
  "private": false,
 | 
			
		||||
@@ -43,5 +43,8 @@
 | 
			
		||||
    "cli.js",
 | 
			
		||||
    "npmextra.json",
 | 
			
		||||
    "readme.md"
 | 
			
		||||
  ],
 | 
			
		||||
  "browserslist": [
 | 
			
		||||
    "last 1 chrome versions"
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ TypeScript Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
 | 
			
		||||
Code Style | [](https://lossless.cloud)
 | 
			
		||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
 | 
			
		||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
 | 
			
		||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
 | 
			
		||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
 | 
			
		||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
 | 
			
		||||
 | 
			
		||||
@@ -27,7 +27,6 @@ Platform support | [ or [contribute monthly](https://lossless.link/contribute). :)
 | 
			
		||||
 
 | 
			
		||||
@@ -12,12 +12,12 @@ tap.test('should start the browser ', async () => {
 | 
			
		||||
  await expect(testSmartBrowser.start()).to.eventually.be.fulfilled;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
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');
 | 
			
		||||
  expect(result.buffer).to.be.instanceOf(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');
 | 
			
		||||
  expect(result.buffer).to.be.instanceOf(Buffer);
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -43,16 +43,16 @@ export class SmartBrowser {
 | 
			
		||||
    const pageId = plugins.smartunique.shortId();
 | 
			
		||||
    const page = await this.headlessBrowser.newPage();
 | 
			
		||||
    await page.goto(urlArg, {
 | 
			
		||||
      waitUntil: 'networkidle2'
 | 
			
		||||
      waitUntil: 'networkidle2',
 | 
			
		||||
    });
 | 
			
		||||
    const screenshotBuffer = await page.screenshot({
 | 
			
		||||
      encoding: 'binary'
 | 
			
		||||
      encoding: 'binary',
 | 
			
		||||
    });
 | 
			
		||||
    await page.close();
 | 
			
		||||
    return {
 | 
			
		||||
      name: pageId,
 | 
			
		||||
      id: `${pageId}.js`,
 | 
			
		||||
      buffer: screenshotBuffer
 | 
			
		||||
      buffer: screenshotBuffer,
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -64,7 +64,7 @@ export class SmartBrowser {
 | 
			
		||||
  public async evaluateOnPage<T>(urlArg: string, funcArg: () => Promise<T>) {
 | 
			
		||||
    const page = await this.headlessBrowser.newPage();
 | 
			
		||||
    await page.goto(urlArg, {
 | 
			
		||||
      waitUntil: 'networkidle2'
 | 
			
		||||
      waitUntil: 'networkidle2',
 | 
			
		||||
    });
 | 
			
		||||
    const result = await page.evaluate(funcArg);
 | 
			
		||||
    await page.close();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user