diff --git a/package.json b/package.json index 4bd67ea..1afeee8 100644 --- a/package.json +++ b/package.json @@ -37,4 +37,4 @@ "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index 48e27d0..f858c4a 100644 --- a/test/test.ts +++ b/test/test.ts @@ -11,7 +11,7 @@ tap.test('should start the smartssr instance', async () => { await testSSRInstance.start(); }); -tap.test('should render central.eu', async (tools) => { +tap.test('should render central.eu', async tools => { await testSSRInstance.renderPage('https://central.eu'); }); diff --git a/ts/index.ts b/ts/index.ts index 5279b0e..c43f2aa 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1 +1 @@ -export * from './smartssr.classes.smartssr'; \ No newline at end of file +export * from './smartssr.classes.smartssr'; diff --git a/ts/smartssr.classes.smartssr.ts b/ts/smartssr.classes.smartssr.ts index 1627cd7..ddd5a2d 100644 --- a/ts/smartssr.classes.smartssr.ts +++ b/ts/smartssr.classes.smartssr.ts @@ -32,11 +32,14 @@ export class SmartSSR { const pageContent = await page.content(); const renderedPageString = pageContent; resultDeferred.resolve(renderedPageString); - plugins.smartfile.memory.toFsSync(renderedPageString, plugins.path.join(paths.noGitDir, 'test.html')); + plugins.smartfile.memory.toFsSync( + renderedPageString, + plugins.path.join(paths.noGitDir, 'test.html') + ); }); await page.goto(urlArg); - const result = await resultDeferred.promise; + const result = await resultDeferred.promise; page.close(); return result; } diff --git a/ts/smartssr.function.serialize.ts b/ts/smartssr.function.serialize.ts index 589cec6..c1241fa 100644 --- a/ts/smartssr.function.serialize.ts +++ b/ts/smartssr.function.serialize.ts @@ -18,7 +18,7 @@ export function serializeFunction(rootNode) { styleTemplate = styleTemplate.replace(/\]\)/g, `]`); styleTemplate = styleTemplate.replace(/:host/g, `.${uuidID}`); styleTemplate = styleTemplate.replace(/:host/g, `.${uuidID}`); - + styleTemplate = styleTemplate.replace(/{[ \t\n]+\./g, `{\n\n.${uuidID} .`); styleTemplate = styleTemplate.replace(/}[ \t\n]+img/g, `}\n\n.${uuidID} img`); styleTemplate = styleTemplate.replace(/}[ \t\n]+div/g, `}\n\n.${uuidID} div`); diff --git a/ts/smartssr.paths.ts b/ts/smartssr.paths.ts index e6bc910..3083b07 100644 --- a/ts/smartssr.paths.ts +++ b/ts/smartssr.paths.ts @@ -2,4 +2,3 @@ import * as plugins from './smartssr.plugins'; export const packageDir = plugins.path.join(__dirname, '../'); export const noGitDir = plugins.path.join(packageDir, './.nogit'); - diff --git a/ts/smartssr.plugins.ts b/ts/smartssr.plugins.ts index 580c686..748fcad 100644 --- a/ts/smartssr.plugins.ts +++ b/ts/smartssr.plugins.ts @@ -2,10 +2,7 @@ import * as path from 'path'; import * as fs from 'fs'; -export { - path, - fs -}; +export { path, fs }; // @pushrocks scope import * as smartdelay from '@pushrocks/smartdelay'; @@ -13,9 +10,4 @@ import * as smartfile from '@pushrocks/smartfile'; import * as smartpuppeteer from '@pushrocks/smartpuppeteer'; import * as smartpromise from '@pushrocks/smartpromise'; -export { - smartdelay, - smartfile, - smartpuppeteer, - smartpromise -}; +export { smartdelay, smartfile, smartpuppeteer, smartpromise };