Skip to content

Commit 653db13

Browse files
committed
Use TypeScript and Bun for App Stories tooling
1 parent a31c01b commit 653db13

13 files changed

Lines changed: 17 additions & 17 deletions

File tree

website/DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ apps through PRs in [longbridge/gpui-kit-showcases](https://github.com/longbridg
237237
- **Manifests are the source of truth.** Each app has `apps/<app-id>/manifest.json`
238238
and local preview images in the Showcase repository. `author` and an English-only
239239
`description` are required; the project link field is `website`. The Astro pages
240-
load these at build time with `src/lib/showcases.mjs` and pass serializable data
240+
load these at build time with `src/lib/showcases.ts` and pass serializable data
241241
to the Vue app; no duplicated hard-coded app list.
242242
- **Screenshots show the complete window.** Authors must preserve all four corners
243243
and edges in a clear, tidy capture. Images are archived unchanged and referenced

website/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"type": "module",
44
"private": true,
55
"scripts": {
6-
"dev": "astro dev",
7-
"build": "astro build && bunx pagefind --site dist",
8-
"test:showcases": "bun test tests/showcases.test.mjs tests/showcase-browser.test.mjs",
9-
"test:seo": "bun test tests/seo.test.mjs",
10-
"preview": "astro preview",
11-
"astro": "astro"
6+
"dev": "bun --bun astro dev",
7+
"build": "bun --bun astro build && bunx pagefind --site dist",
8+
"test:showcases": "bun test tests/showcases.test.ts tests/showcase-browser.test.ts",
9+
"test:seo": "bun test tests/seo.test.ts",
10+
"preview": "bun --bun astro preview",
11+
"astro": "bun --bun astro"
1212
},
1313
"dependencies": {
1414
"@astrojs/markdown-remark": "^7.3.0",

website/src/components/AppsApp.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
</template>
102102

103103
<script setup lang="ts">
104-
import { selectShowcases } from "../lib/showcase-browser.mjs";
104+
import { selectShowcases } from "../lib/showcase-browser.ts";
105105
import { computed, ref } from "vue";
106106
import { ArrowRight, ArrowUpRight, Boxes, Github, Monitor } from "lucide-vue-next";
107107

website/src/components/ShowcaseDetail.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import DocsLayout from '../layouts/DocsLayout.astro';
3-
import { getShowcaseReadme } from '../lib/showcases.mjs';
3+
import { getShowcaseReadme } from '../lib/showcases.ts';
44
const { app, lang = 'en' } = Astro.props;
55
const isZh = lang === 'zh-CN';
66
const html = await getShowcaseReadme(app);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ async function catalogModule(name) {
8080
let catalog;
8181
export function getShowcaseApps() {
8282
return catalog ??= (async () => {
83-
const { validateCatalog } = await catalogModule('validate.mjs');
83+
const { validateCatalog } = await catalogModule('validate.ts');
8484
await validateCatalog(showcaseRoot());
8585
return loadShowcases(showcaseRoot());
8686
})();
8787
}
8888
export async function getShowcaseReadme(app) {
89-
const { renderReadme } = await catalogModule('readme.mjs');
89+
const { renderReadme } = await catalogModule('readme.ts');
9090
const markdown = await readFile(join(showcaseRoot(), 'apps', app.id, 'README.md'), 'utf8');
9191
return renderReadme(markdown, app, app.mediaBase);
9292
}

website/src/pages/apps.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import DocsLayout from '../layouts/DocsLayout.astro';
3-
import { getShowcaseApps } from '../lib/showcases.mjs';
3+
import { getShowcaseApps } from '../lib/showcases.ts';
44
import AppsApp from '../components/AppsApp.vue';
55
const apps = await getShowcaseApps();
66
---

website/src/pages/apps/[id].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import ShowcaseDetail from '../../components/ShowcaseDetail.astro';
3-
import { getShowcaseApps } from '../../lib/showcases.mjs';
3+
import { getShowcaseApps } from '../../lib/showcases.ts';
44
export async function getStaticPaths() {
55
return (await getShowcaseApps()).filter(app => app.hasReadme).map(app => ({ params: { id: app.id }, props: { app } }));
66
}

website/src/pages/zh-CN/apps.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import DocsLayout from '../../layouts/DocsLayout.astro';
3-
import { getShowcaseApps } from '../../lib/showcases.mjs';
3+
import { getShowcaseApps } from '../../lib/showcases.ts';
44
import AppsApp from '../../components/AppsApp.vue';
55
const apps = await getShowcaseApps();
66
---

website/src/pages/zh-CN/apps/[id].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import ShowcaseDetail from '../../../components/ShowcaseDetail.astro';
3-
import { getShowcaseApps } from '../../../lib/showcases.mjs';
3+
import { getShowcaseApps } from '../../../lib/showcases.ts';
44
export async function getStaticPaths() {
55
return (await getShowcaseApps()).filter(app => app.hasReadme).map(app => ({ params: { id: app.id }, props: { app } }));
66
}

0 commit comments

Comments
 (0)