Skip to content

Commit 2741b9c

Browse files
authored
feat: add Octane framework support (#1088)
1 parent 5fbb46c commit 2741b9c

13 files changed

Lines changed: 79 additions & 5 deletions

src/components/FileExplorer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import svelteIconUrl from '~/images/file-icons/svelte.svg?url'
88
import vueIconUrl from '~/images/file-icons/vue.svg?url'
99
import markoIconUrl from '~/images/file-icons/marko.svg?url'
1010
import emberIconUrl from '~/images/ember-logo.svg?url'
11+
import octaneIconUrl from '~/images/octane-logo.svg?url'
1112
import textIconUrl from '~/images/file-icons/txt.svg?url'
1213
import type { GitHubFileNode } from '~/utils/documents.server'
1314
import { twMerge } from 'tailwind-merge'
@@ -19,6 +20,8 @@ const getFileIconPath = (filename: string) => {
1920
case 'ts':
2021
case 'tsx':
2122
return typescriptIconUrl
23+
case 'tsrx':
24+
return octaneIconUrl
2225
case 'js':
2326
case 'jsx':
2427
return javascriptIconUrl

src/components/markdown/codeBlock.shared.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export function getCodeBlockLanguageFromFilePath(filePath: string) {
8282
}
8383

8484
if (['cts', 'mts'].includes(ext)) return 'ts'
85+
if (ext === 'tsrx') return 'tsx'
8586
if (['cjs', 'mjs'].includes(ext)) return 'js'
8687
if (ext === 'gts') return 'ts'
8788
if (ext === 'gjs') return 'js'

src/images/octane-logo.svg

Lines changed: 7 additions & 0 deletions
Loading

src/libraries/frameworks.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import emberLogo from '../images/ember-logo.svg'
44
import jsLogo from '../images/js-logo.svg'
55
import litLogo from '../images/lit-logo.svg'
66
import markoLogo from '../images/marko-logo.svg'
7+
import octaneLogo from '../images/octane-logo.svg'
78
import qwikLogo from '../images/qwik-logo.svg'
89
import preactLogo from '../images/preact-logo.svg'
910
import reactLogo from '../images/react-logo.svg'
@@ -69,6 +70,13 @@ export const frameworkOptions = [
6970
color: 'bg-cyan-500',
7071
fontColor: 'text-cyan-500',
7172
},
73+
{
74+
label: 'Octane',
75+
value: 'octane',
76+
logo: octaneLogo,
77+
color: 'bg-rose-500',
78+
fontColor: 'text-rose-500',
79+
},
7280
{
7381
label: 'Qwik',
7482
value: 'qwik',

src/libraries/libraries.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ export const table: LibrarySlim = {
300300
frameworks: [
301301
'angular',
302302
'ember',
303+
'octane',
303304
'react',
304305
'preact',
305306
'solid',
@@ -474,7 +475,16 @@ export const store: LibrarySlim = {
474475
'The immutable-reactive data store that powers the core of TanStack libraries and their framework adapters.',
475476
badge: 'alpha',
476477
repo: 'tanstack/store',
477-
frameworks: ['react', 'preact', 'solid', 'svelte', 'vue', 'angular', 'lit'],
478+
frameworks: [
479+
'react',
480+
'preact',
481+
'solid',
482+
'svelte',
483+
'vue',
484+
'angular',
485+
'lit',
486+
'octane',
487+
],
478488
corePackageName: '@tanstack/store',
479489
npmPackageNames: ['@tanstack/store'],
480490
latestVersion: 'v0',

src/libraries/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export type Framework =
99
| 'ember'
1010
| 'lit'
1111
| 'marko'
12+
| 'octane'
1213
| 'preact'
1314
| 'qwik'
1415
| 'react'

src/routes/_library/$libraryId/$version.docs.framework.$framework.examples.$.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,13 @@ function determineStartingFilePath(
487487
const preferenceFiles = new Set([
488488
getExampleStartingFileName(framework, libraryId),
489489
...['__root', 'App', 'main', 'index', 'page', 'action']
490-
.map((name) => [`${name}.tsx`, `${name}.ts`, `${name}.js`, `${name}.jsx`])
490+
.map((name) => [
491+
`${name}.tsrx`,
492+
`${name}.tsx`,
493+
`${name}.ts`,
494+
`${name}.js`,
495+
`${name}.jsx`,
496+
])
491497
.flat(),
492498
'README.md',
493499
])

src/utils/llms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const frameworkLabels: Record<Framework, string> = {
4040
ember: 'Ember',
4141
lit: 'Lit',
4242
marko: 'Marko',
43+
octane: 'Octane',
4344
preact: 'Preact',
4445
qwik: 'Qwik',
4546
react: 'React',

src/utils/npm-packages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const frameworkMeta: Record<Framework, { name: string; color: string }> =
3131
alpine: { name: 'Alpine', color: '#77C1D2' },
3232
marko: { name: 'Marko', color: '#44bfef' },
3333
ember: { name: 'Ember', color: '#E04E39' },
34+
octane: { name: 'Octane', color: '#FF415A' },
3435
qwik: { name: 'Qwik', color: '#18B6F6' },
3536
vanilla: { name: 'Vanilla', color: '#F7DF1E' },
3637
}

src/utils/sandbox.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ export function getExampleStartingFileName(
3131
? 'svelte'
3232
: framework === 'vue'
3333
? 'vue'
34-
: ['angular', 'lit'].includes(framework)
35-
? 'ts'
36-
: 'tsx'
34+
: framework === 'octane'
35+
? 'tsrx'
36+
: ['angular', 'lit'].includes(framework)
37+
? 'ts'
38+
: 'tsx'
3739

3840
return `${file}.${ext}` as const
3941
}

0 commit comments

Comments
 (0)