feat: Astro buildpack

This commit is contained in:
Andras Bacsai 2022-02-23 22:07:06 +01:00
parent df896542e4
commit 15a3fd4456
3 changed files with 51 additions and 30 deletions

View File

@ -10,6 +10,7 @@ import nuxtjs from './nuxtjs';
import vuejs from './vuejs';
import php from './php';
import rust from './rust';
import astro from './static';
export {
node,
@ -23,5 +24,6 @@ export {
nuxtjs,
vuejs,
php,
rust
rust,
astro
};

View File

@ -126,6 +126,16 @@ export function findBuildPack(pack, packageManager = 'npm') {
port: 3000
};
}
if (pack === 'astro') {
return {
...metaData,
installCommand: `yarn install`,
buildCommand: `yarn build`,
startCommand: null,
publishDirectory: `dist`,
port: 80
};
}
return {
name: 'node',
fancyName: 'Node.js',
@ -145,7 +155,6 @@ export const buildPacks = [
hoverColor: 'hover:bg-green-700',
color: 'bg-green-700'
},
{
name: 'static',
fancyName: 'Static',
@ -158,36 +167,18 @@ export const buildPacks = [
hoverColor: 'hover:bg-sky-700',
color: 'bg-sky-700'
},
{
name: 'php',
fancyName: 'PHP',
hoverColor: 'hover:bg-indigo-700',
color: 'bg-indigo-700'
},
{
name: 'svelte',
fancyName: 'Svelte',
hoverColor: 'hover:bg-orange-700',
color: 'bg-orange-700'
},
{
name: 'nestjs',
fancyName: 'NestJS',
hoverColor: 'hover:bg-red-700',
color: 'bg-red-700'
},
{
name: 'react',
fancyName: 'React',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'nextjs',
fancyName: 'NextJS',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'gatsby',
fancyName: 'Gatsby',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'vuejs',
fancyName: 'VueJS',
@ -200,6 +191,24 @@ export const buildPacks = [
hoverColor: 'hover:bg-green-700',
color: 'bg-green-700'
},
{
name: 'astro',
fancyName: 'Astro',
hoverColor: 'hover:bg-pink-700',
color: 'bg-pink-700'
},
{
name: 'gatsby',
fancyName: 'Gatsby',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'react',
fancyName: 'React',
hoverColor: 'hover:bg-blue-700',
color: 'bg-blue-700'
},
{
name: 'preact',
fancyName: 'Preact',
@ -207,10 +216,16 @@ export const buildPacks = [
color: 'bg-blue-700'
},
{
name: 'php',
fancyName: 'PHP',
hoverColor: 'hover:bg-indigo-700',
color: 'bg-indigo-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: 'rust',
@ -220,6 +235,9 @@ export const buildPacks = [
}
];
export const scanningTemplates = {
astro: {
buildPack: 'astro'
},
svelte: {
buildPack: 'svelte'
},

View File

@ -35,6 +35,7 @@
import { get } from '$lib/api';
import { errorNotification } from '$lib/form';
import { gitTokens } from '$lib/store';
import { browser } from '$app/env';
let scanning = true;
let foundConfig = null;