feat: 11ty buildpack

This commit is contained in:
Andras Bacsai 2022-02-24 00:30:33 +01:00
parent 15a3fd4456
commit fd95936219
3 changed files with 37 additions and 11 deletions

View File

@ -11,6 +11,7 @@ import vuejs from './vuejs';
import php from './php';
import rust from './rust';
import astro from './static';
import eleventy from './static';
export {
node,
@ -25,5 +26,6 @@ export {
vuejs,
php,
rust,
astro
astro,
eleventy
};

View File

@ -136,6 +136,16 @@ export function findBuildPack(pack, packageManager = 'npm') {
port: 80
};
}
if (pack === 'eleventy') {
return {
...metaData,
installCommand: `yarn install`,
buildCommand: `yarn build`,
startCommand: null,
publishDirectory: `_site`,
port: 80
};
}
return {
name: 'node',
fancyName: 'Node.js',
@ -191,6 +201,12 @@ export const buildPacks = [
hoverColor: 'hover:bg-green-700',
color: 'bg-green-700'
},
{
name: 'gatsby',
fancyName: 'Gatsby',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'astro',
fancyName: 'Astro',
@ -198,11 +214,12 @@ export const buildPacks = [
color: 'bg-pink-700'
},
{
name: 'gatsby',
fancyName: 'Gatsby',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
name: 'eleventy',
fancyName: 'Eleventy',
hoverColor: 'hover:bg-red-700',
color: 'bg-red-700'
},
{
name: 'react',
fancyName: 'React',
@ -215,18 +232,18 @@ export const buildPacks = [
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'nestjs',
fancyName: 'NestJS',
hoverColor: 'hover:bg-red-700',
color: 'bg-red-700'
},
{
name: 'nextjs',
fancyName: 'NextJS',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'nestjs',
fancyName: 'NestJS',
hoverColor: 'hover:bg-red-700',
color: 'bg-red-700'
},
{
name: 'rust',
fancyName: 'Rust',
@ -238,6 +255,9 @@ export const scanningTemplates = {
astro: {
buildPack: 'astro'
},
'@11ty/eleventy': {
buildPack: 'eleventy'
},
svelte: {
buildPack: 'svelte'
},

View File

@ -37,6 +37,8 @@
import { gitTokens } from '$lib/store';
import { browser } from '$app/env';
const { id } = $page.params;
let scanning = true;
let foundConfig = null;
let packageManager = 'npm';
@ -176,6 +178,8 @@
}
}
if (error.message === 'Bad credentials') {
const { token } = await get(`/applications/${id}/configuration/githubToken.json`);
$gitTokens.githubToken = token;
browser && window.location.reload();
}
return errorNotification(error);