Compare commits

...

2 Commits

Author SHA1 Message Date
23b4c1cf89 1.0.3 2020-02-12 21:32:26 +00:00
714073d1c6 fix(core): update 2020-02-12 21:32:25 +00:00
8 changed files with 12 additions and 18 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartssr",
"version": "1.0.2",
"version": "1.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartssr",
"version": "1.0.2",
"version": "1.0.3",
"private": false,
"description": "a smart server side renderer supporting shadow dom",
"main": "dist/index.js",

View File

@ -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');
});

View File

@ -1 +1 @@
export * from './smartssr.classes.smartssr';
export * from './smartssr.classes.smartssr';

View File

@ -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;
}

View File

@ -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`);

View File

@ -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');

View File

@ -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 };