fix(core): update
This commit is contained in:
		
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -15,8 +15,6 @@ node_modules/ | ||||
|  | ||||
| # builds | ||||
| dist/ | ||||
| dist_web/ | ||||
| dist_serve/ | ||||
| dist_ts_web/ | ||||
| dist_*/ | ||||
|  | ||||
| # custom | ||||
| @@ -19,22 +19,23 @@ mirror: | ||||
|   stage: security | ||||
|   script: | ||||
|     - npmci git mirror | ||||
|   only: | ||||
|     - tags | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| snyk: | ||||
|   image: registry.gitlab.com/hosttoday/ht-docker-node:snyk | ||||
| audit: | ||||
|   image: registry.gitlab.com/hosttoday/ht-docker-node:npmci | ||||
|   stage: security | ||||
|   script: | ||||
|     - npmci npm prepare | ||||
|     - npmci command npm install --ignore-scripts | ||||
|     - npmci command snyk test | ||||
|     - npmci command npm config set registry https://registry.npmjs.org | ||||
|     - npmci command npm audit --audit-level=high | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| # ==================== | ||||
| # test stage | ||||
| @@ -49,9 +50,7 @@ testStable: | ||||
|     - npmci npm test | ||||
|   coverage: /\d+.?\d+?\%\s*coverage/ | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - priv | ||||
|  | ||||
| testBuild: | ||||
|   stage: test | ||||
| @@ -62,9 +61,7 @@ testBuild: | ||||
|     - npmci command npm run build | ||||
|   coverage: /\d+.?\d+?\%\s*coverage/ | ||||
|   tags: | ||||
|     - lossless | ||||
|     - docker | ||||
|     - notpriv | ||||
|  | ||||
| release: | ||||
|   stage: release | ||||
| @@ -84,6 +81,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"] | ||||
|               } | ||||
|             } | ||||
|           } | ||||
|   | ||||
							
								
								
									
										10
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								package.json
									
									
									
									
									
								
							| @@ -3,8 +3,8 @@ | ||||
|   "version": "1.0.10", | ||||
|   "private": false, | ||||
|   "description": "a smart server side renderer supporting shadow dom", | ||||
|   "main": "dist/index.js", | ||||
|   "typings": "dist/index.d.ts", | ||||
|   "main": "dist_ts/index.js", | ||||
|   "typings": "dist_ts/index.d.ts", | ||||
|   "author": "Lossless GmbH", | ||||
|   "license": "MIT", | ||||
|   "scripts": { | ||||
| @@ -32,11 +32,15 @@ | ||||
|     "ts/**/*", | ||||
|     "ts_web/**/*", | ||||
|     "dist/**/*", | ||||
|     "dist_web/**/*", | ||||
|     "dist_*/**/*", | ||||
|     "dist_ts/**/*", | ||||
|     "dist_ts_web/**/*", | ||||
|     "assets/**/*", | ||||
|     "cli.js", | ||||
|     "npmextra.json", | ||||
|     "readme.md" | ||||
|   ], | ||||
|   "browserslist": [ | ||||
|     "last 1 chrome versions" | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										21
									
								
								readme.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								readme.md
									
									
									
									
									
								
							| @@ -8,13 +8,20 @@ a smart server side renderer supporting shadow dom | ||||
| * [docs (typedoc)](https://pushrocks.gitlab.io/smartssr/) | ||||
|  | ||||
| ## Status for master | ||||
| [](https://gitlab.com/pushrocks/smartssr/commits/master) | ||||
| [](https://gitlab.com/pushrocks/smartssr/commits/master) | ||||
| [](https://www.npmjs.com/package/@pushrocks/smartssr) | ||||
| [](https://snyk.io/test/npm/@pushrocks/smartssr) | ||||
| [](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||||
| [](https://nodejs.org/dist/latest-v10.x/docs/api/) | ||||
| [](https://prettier.io/) | ||||
|  | ||||
| Status Category | Status Badge | ||||
| -- | -- | ||||
| GitLab Pipelines | [](https://lossless.cloud) | ||||
| GitLab Pipline Test Coverage | [](https://lossless.cloud) | ||||
| npm | [](https://lossless.cloud) | ||||
| Snyk | [](https://lossless.cloud) | ||||
| TypeScript Support | [](https://lossless.cloud) | ||||
| node 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) | ||||
| BundlePhobia (total size when bundled) | [](https://lossless.cloud) | ||||
| Platform support | [](https://lossless.cloud) [](https://lossless.cloud) | ||||
|  | ||||
| ## Usage | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ let testSSRInstance: smartssr.SmartSSR; | ||||
|  | ||||
| tap.test('should create a valid smartssr instance', async () => { | ||||
|   testSSRInstance = new smartssr.SmartSSR({ | ||||
|     debug: true | ||||
|     debug: true, | ||||
|   }); | ||||
| }); | ||||
|  | ||||
| @@ -13,8 +13,10 @@ tap.test('should start the smartssr instance', async () => { | ||||
|   await testSSRInstance.start(); | ||||
| }); | ||||
|  | ||||
| tap.test('should render central.eu', async tools => { | ||||
|   await testSSRInstance.renderPage('https://central.eu/article/5e76873b9cf69b7bf6bc78bc/Introducing%3A%20central.eu'); | ||||
| tap.test('should render central.eu', async (tools) => { | ||||
|   await testSSRInstance.renderPage( | ||||
|     'https://central.eu/article/5e76873b9cf69b7bf6bc78bc/Introducing%3A%20central.eu' | ||||
|   ); | ||||
| }); | ||||
|  | ||||
| tap.skip.test('should render lossless.com', async () => { | ||||
|   | ||||
| @@ -17,9 +17,9 @@ export class SmartSSR { | ||||
|   constructor(optionsArg?: ISmartSSROptions) { | ||||
|     this.options = { | ||||
|       ...{ | ||||
|         debug: false | ||||
|         debug: false, | ||||
|       }, | ||||
|       ...optionsArg | ||||
|       ...optionsArg, | ||||
|     }; | ||||
|   } | ||||
|  | ||||
| @@ -42,7 +42,7 @@ export class SmartSSR { | ||||
|     const resultDeferred = plugins.smartpromise.defer<string>(); | ||||
|     const context = await this.browser.createIncognitoBrowserContext(); | ||||
|     const page = await context.newPage(); | ||||
|     page.on('console', msg => { | ||||
|     page.on('console', (msg) => { | ||||
|       console.log(`${urlArg}: ${msg.text()}`); | ||||
|     }); | ||||
|  | ||||
| @@ -52,7 +52,7 @@ export class SmartSSR { | ||||
|  | ||||
|       if (this.options.debug) { | ||||
|         screenshotBuffer = await page.screenshot({ | ||||
|           encoding: 'binary' | ||||
|           encoding: 'binary', | ||||
|         }); | ||||
|       } | ||||
|  | ||||
| @@ -69,7 +69,6 @@ export class SmartSSR { | ||||
|         const fs = await import('fs'); | ||||
|         fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.png'), screenshotBuffer); | ||||
|       } | ||||
|  | ||||
|     }); | ||||
|  | ||||
|     const renderTimeMeasurement = new plugins.smarttime.HrtMeasurement(); | ||||
| @@ -82,8 +81,12 @@ export class SmartSSR { | ||||
|     context.close(); | ||||
|  | ||||
|     overallTimeMeasurement.stop(); | ||||
|     console.log(`Overall it took ${overallTimeMeasurement.milliSeconds} milliseconds to render ${urlArg}`); | ||||
|     console.log(`The rendering alone took ${renderTimeMeasurement.milliSeconds} milliseconds for ${urlArg}`) | ||||
|     console.log( | ||||
|       `Overall it took ${overallTimeMeasurement.milliSeconds} milliseconds to render ${urlArg}` | ||||
|     ); | ||||
|     console.log( | ||||
|       `The rendering alone took ${renderTimeMeasurement.milliSeconds} milliseconds for ${urlArg}` | ||||
|     ); | ||||
|     return result; | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -64,7 +64,7 @@ export function serializeFunction(rootNode) { | ||||
|           noteForAppending.push(childNode); | ||||
|         } | ||||
|       }); | ||||
|       noteForAppending.forEach(childNode => { | ||||
|       noteForAppending.forEach((childNode) => { | ||||
|         nodeArg.append(childNode); | ||||
|       }); | ||||
|     } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user