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 php from './php';
import rust from './rust'; import rust from './rust';
import astro from './static'; import astro from './static';
import eleventy from './static';
export { export {
node, node,
@ -25,5 +26,6 @@ export {
vuejs, vuejs,
php, php,
rust, rust,
astro astro,
eleventy
}; };

View File

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

View File

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