Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
e6a87e408e | |||
637170ecd2 | |||
23b4c1cf89 | |||
714073d1c6 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartssr",
|
"name": "@pushrocks/smartssr",
|
||||||
"version": "1.0.2",
|
"version": "1.0.4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartssr",
|
"name": "@pushrocks/smartssr",
|
||||||
"version": "1.0.2",
|
"version": "1.0.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a smart server side renderer supporting shadow dom",
|
"description": "a smart server side renderer supporting shadow dom",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -11,7 +11,7 @@ tap.test('should start the smartssr instance', async () => {
|
|||||||
await testSSRInstance.start();
|
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');
|
await testSSRInstance.renderPage('https://central.eu');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -32,11 +32,14 @@ export class SmartSSR {
|
|||||||
const pageContent = await page.content();
|
const pageContent = await page.content();
|
||||||
const renderedPageString = pageContent;
|
const renderedPageString = pageContent;
|
||||||
resultDeferred.resolve(renderedPageString);
|
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);
|
await page.goto(urlArg);
|
||||||
const result = await resultDeferred.promise;
|
const result = await resultDeferred.promise;
|
||||||
page.close();
|
page.close();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,4 @@ import * as plugins from './smartssr.plugins';
|
|||||||
|
|
||||||
export const packageDir = plugins.path.join(__dirname, '../');
|
export const packageDir = plugins.path.join(__dirname, '../');
|
||||||
export const noGitDir = plugins.path.join(packageDir, './.nogit');
|
export const noGitDir = plugins.path.join(packageDir, './.nogit');
|
||||||
|
plugins.smartfile.fs.ensureDirSync(noGitDir);
|
@ -1,11 +1,7 @@
|
|||||||
// node native
|
// node native
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
export {
|
export { path };
|
||||||
path,
|
|
||||||
fs
|
|
||||||
};
|
|
||||||
|
|
||||||
// @pushrocks scope
|
// @pushrocks scope
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
@ -13,9 +9,4 @@ import * as smartfile from '@pushrocks/smartfile';
|
|||||||
import * as smartpuppeteer from '@pushrocks/smartpuppeteer';
|
import * as smartpuppeteer from '@pushrocks/smartpuppeteer';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
export {
|
export { smartdelay, smartfile, smartpuppeteer, smartpromise };
|
||||||
smartdelay,
|
|
||||||
smartfile,
|
|
||||||
smartpuppeteer,
|
|
||||||
smartpromise
|
|
||||||
};
|
|
||||||
|
Reference in New Issue
Block a user