Add most of components and prepare for V1 Release

This commit is contained in:
Fawad Mirzad
2021-02-13 16:09:48 +01:00
parent 1a5cf0b075
commit decca38b67
47 changed files with 2556 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import Puppeteer from 'puppeteer'
import CompileStandalone from './compile-standalone'
import path from 'path'
const puppeteerPromise = CompileStandalone.then(() => {
let options = {}
if (process.env['THIS_IS_ON_TRAVIS_AND_SANDBOX_IS_NOT_ALLOWED'] === 'true') {
options.args = ['--no-sandbox', '--disable-setuid-sandbox']
}
return Puppeteer.launch(options)
})
export function getPage (p) {
return async () => {
p(await puppeteerPromise.then(browser => browser.newPage()))
}
}
export async function loadFile (page, relpath, options) {
return page.goto('file:///' + path.join(__dirname, '../', relpath), options)
}