Skip to content

Commit 53a90ef

Browse files
authored
add ember-table (#1042)
* add ember-table * code snippet fixes for ember * order library pills better
1 parent 4b2c635 commit 53a90ef

12 files changed

Lines changed: 86 additions & 7 deletions

File tree

src/components/FileExplorer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import jsonIconUrl from '~/images/file-icons/json.svg?url'
77
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'
10+
import emberIconUrl from '~/images/ember-logo.svg?url'
1011
import textIconUrl from '~/images/file-icons/txt.svg?url'
1112
import type { GitHubFileNode } from '~/utils/documents.server'
1213
import { twMerge } from 'tailwind-merge'
@@ -33,6 +34,9 @@ const getFileIconPath = (filename: string) => {
3334
return vueIconUrl
3435
case 'marko':
3536
return markoIconUrl
37+
case 'gjs':
38+
case 'gts':
39+
return emberIconUrl
3640
default:
3741
return textIconUrl
3842
}

src/components/markdown/codeBlock.shared.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ export function getCodeBlockLanguageFromFilePath(filePath: string) {
8383

8484
if (['cts', 'mts'].includes(ext)) return 'ts'
8585
if (['cjs', 'mjs'].includes(ext)) return 'js'
86+
if (ext === 'gts') return 'ts'
87+
if (ext === 'gjs') return 'js'
8688
if (['prettierrc', 'babelrc', 'webmanifest'].includes(ext)) return 'json'
8789
if (['env', 'example'].includes(ext)) return 'sh'
8890

src/images/ember-logo.svg

Lines changed: 6 additions & 0 deletions
Loading

src/libraries/frameworks.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import alpineLogo from '../images/alpine-logo.svg'
22
import angularLogo from '../images/angular-logo.svg'
3+
import emberLogo from '../images/ember-logo.svg'
34
import jsLogo from '../images/js-logo.svg'
45
import litLogo from '../images/lit-logo.svg'
56
import markoLogo from '../images/marko-logo.svg'
@@ -40,6 +41,13 @@ export const frameworkOptions = [
4041
color: 'bg-red-500',
4142
fontColor: 'text-fuchsia-500',
4243
},
44+
{
45+
label: 'Ember',
46+
value: 'ember',
47+
logo: emberLogo,
48+
color: 'bg-orange-600',
49+
fontColor: 'text-orange-600',
50+
},
4351
{
4452
label: 'Solid',
4553
value: 'solid',

src/libraries/libraries.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export const table: LibrarySlim = {
314314
to: '/table',
315315
tagline: 'Headless UI for building powerful tables & datagrids',
316316
description:
317-
'Supercharge your tables or build a datagrid from scratch for TS/JS, React, Vue, Solid, Svelte, Qwik, Angular, and Lit while retaining 100% control over markup and styles.',
317+
'Supercharge your tables or build a datagrid from scratch in any framework while retaining 100% control over markup and styles.',
318318
bgStyle: 'bg-blue-500',
319319
borderStyle: 'border-blue-500/50',
320320
textStyle: 'text-blue-500',
@@ -326,6 +326,7 @@ export const table: LibrarySlim = {
326326
repo: 'tanstack/table',
327327
frameworks: [
328328
'angular',
329+
'ember',
329330
'react',
330331
'preact',
331332
'solid',

src/libraries/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export type { LibraryId } from './ids'
66
export type Framework =
77
| 'angular'
88
| 'alpine'
9+
| 'ember'
910
| 'lit'
1011
| 'marko'
1112
| 'preact'

src/routes/-libraries-utils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,17 @@ export function getFrameworkLibraryCounts(allLibraries: Array<LibrarySlim>) {
4141

4242
return counts
4343
}
44+
45+
export function orderFrameworksForBrowse<
46+
TFramework extends { value: Framework },
47+
>(
48+
frameworks: ReadonlyArray<TFramework>,
49+
counts: Partial<Record<Framework, number>>,
50+
) {
51+
return [...frameworks].sort((a, b) => {
52+
if (a.value === 'vanilla') return 1
53+
if (b.value === 'vanilla') return -1
54+
55+
return (counts[b.value] ?? 0) - (counts[a.value] ?? 0)
56+
})
57+
}

src/routes/libraries.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import LibraryCard from '~/components/LibraryCard'
77
import {
88
getFrameworkLibraryCounts,
99
getVisibleLibraries,
10+
orderFrameworksForBrowse,
1011
orderLibrariesForBrowse,
1112
} from './-libraries-utils'
1213

@@ -30,8 +31,11 @@ function LibrariesPage() {
3031
const allLibraries = getVisibleLibraries()
3132
const ordered = orderLibrariesForBrowse(allLibraries)
3233
const frameworkCounts = getFrameworkLibraryCounts(allLibraries)
33-
const frameworksWithLibraries = frameworkOptions.filter(
34-
(framework) => (frameworkCounts[framework.value] ?? 0) > 0,
34+
const frameworksWithLibraries = orderFrameworksForBrowse(
35+
frameworkOptions.filter(
36+
(framework) => (frameworkCounts[framework.value] ?? 0) > 0,
37+
),
38+
frameworkCounts,
3539
)
3640
const deprecatedLibraries = [reactChartsProject]
3741

src/routes/libraries_.$framework.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import LibraryCard from '~/components/LibraryCard'
66
import {
77
getFrameworkLibraryCounts,
88
getVisibleLibraries,
9+
orderFrameworksForBrowse,
910
orderLibrariesForBrowse,
1011
} from './-libraries-utils'
1112

@@ -45,8 +46,11 @@ function LibrariesFrameworkPage() {
4546

4647
const allLibraries = getVisibleLibraries()
4748
const frameworkCounts = getFrameworkLibraryCounts(allLibraries)
48-
const frameworksWithLibraries = frameworkOptions.filter(
49-
(option) => (frameworkCounts[option.value] ?? 0) > 0,
49+
const frameworksWithLibraries = orderFrameworksForBrowse(
50+
frameworkOptions.filter(
51+
(option) => (frameworkCounts[option.value] ?? 0) > 0,
52+
),
53+
frameworkCounts,
5054
)
5155
const filteredLibraries = orderLibrariesForBrowse(
5256
allLibraries.filter((library) =>

src/utils/llms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const librarySections = [
4141
const frameworkLabels: Record<Framework, string> = {
4242
angular: 'Angular',
4343
alpine: 'Alpine',
44+
ember: 'Ember',
4445
lit: 'Lit',
4546
marko: 'Marko',
4647
preact: 'Preact',

0 commit comments

Comments
 (0)