Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return path.basename(dirname);
})
);
if (_.isEmpty(demos)) {
return;
}
liveServer.start({
root: './docs',
open: false,
port: 8082,
});
const browser = await puppeteer.launch();
await pEach(demos, async demo => {
const page = await browser.newPage();
page.setViewport({ width: 1600, height: 900 });
await page.goto(`http://127.0.0.1:8082/demos/${demo}/`);
// Wait for the whole InstantSearch to load
let waitForRender = true;
while (waitForRender) {
const renderDiv = await page.evaluate(() =>
document.getElementById('firstRender')
);
waitForRender = !renderDiv;
}
const srcPath = `./src/demos/${demo}/og_image.png`;
const docsPath = `./docs/demos/${demo}/og_image.png`;
await page.screenshot({
export default async function commits(messages) {
const dir = tempy.directory();
fs.symlink(path.resolve('./node_modules'), path.join(dir, 'node_modules'));
process.chdir(dir);
await fs.mkdir('git-templates');
await execa('git', ['init', '--template=./git-templates']);
await pEachSeries(messages, message => execa('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign']));
}
export default async function(assets, compilation, htmlPluginData) {
const handledAssets = await handleUrl(assets);
await pEachSeries(handledAssets, asset =>
addFileToAssets(compilation, htmlPluginData, asset),
);
return htmlPluginData;
}
async addAllAssetsToCompilation(compilation, htmlPluginData) {
const handledAssets = await handleUrl(this.assets);
await pEachSeries(handledAssets, asset =>
this.addFileToAssets(compilation, htmlPluginData, asset),
);
return htmlPluginData;
}
async maybeAddDefaultRoles() {
const existingRoles = await this.AclRole.count();
debug('existing roles', existingRoles);
if (existingRoles === 0) {
debug('no roles found, adding defaults');
const roleNames = Object.keys(defaultRoles);
await eachSeries(roleNames, roleName => this.createRole(roleName, defaultRoles[roleName]));
}
}
async run() {
const cssFiles = await helper.getFiles('style.css');
await pEach(cssFiles, async filepath => {
await this.compile(filepath);
});
},