Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions packages/build-info/assets/logos/vike/dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions packages/build-info/assets/logos/vike/light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/build-info/src/frameworks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { SvelteKit } from './svelte-kit.js'
import { Svelte } from './svelte.js'
import { TanStackRouter } from './tanstack-router.js'
import { TanStackStart } from './tanstack-start.js'
import { Vike } from './vike.js'
import { Vite } from './vite.js'
import { Vue } from './vue.js'
import { VuePress } from './vuepress.js'
Expand Down Expand Up @@ -86,6 +87,7 @@ export const frameworks = [
Zola,
Observable,
Analog,
Vike,

// Front-end frameworks
Angular,
Expand Down
43 changes: 43 additions & 0 deletions packages/build-info/src/frameworks/vike.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { beforeEach, expect, test } from 'vitest'

import { mockFileSystem } from '../../tests/mock-file-system.js'
import { NodeFS } from '../node/file-system.js'
import { Project } from '../project.js'

beforeEach((ctx) => {
ctx.fs = new NodeFS()
})

test('detects a Vike site', async ({ fs }) => {
const cwd = mockFileSystem({
'package.json': JSON.stringify({
scripts: {
dev: 'vike dev',
build: 'vike build',
preview: 'vike build && vike preview',
},
dependencies: {
vike: '^0.4.247',
react: '^19.2.0',
'react-dom': '^19.2.0',
'vike-react': '^0.6.13',
},
devDependencies: {
typescript: '^5.9.3',
vite: '^7.2.6',
'@vitejs/plugin-react': '^5.1.1',
'@types/react': '^19.2.7',
'@types/react-dom': '^19.2.3',
},
}),
})
const detected = await new Project(fs, cwd).detectFrameworks()

expect(detected?.length).toBe(1)

expect(detected?.[0]?.id).toBe('vike')
expect(detected?.[0]?.build?.command).toBe('vike build')
expect(detected?.[0]?.build?.directory).toBe('dist/client')
expect(detected?.[0]?.dev?.command).toBe('vike dev')
expect(detected?.[0]?.dev?.port).toBe(3000)
})
24 changes: 24 additions & 0 deletions packages/build-info/src/frameworks/vike.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { BaseFramework, Category, Framework } from './framework.js'

export class Vike extends BaseFramework implements Framework {
readonly id = 'vike'
name = 'Vike'
npmDependencies = ['vike']
category = Category.SSG

dev = {
command: 'vike dev',
port: 3000,
}

build = {
command: 'vike build',
directory: 'dist/client',
}

logo = {
default: '/logos/vike/light.svg',
light: '/logos/vite/light.svg',
dark: '/logos/vite/dark.svg',
}
}
1 change: 1 addition & 0 deletions packages/build-info/src/frameworks/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class Vite extends BaseFramework implements Framework {
'@sveltejs/kit',
'@analogjs/platform',
'@react-router/dev',
'vike',
]
category = Category.BuildTool

Expand Down
Loading