Skip to content

Commit 6e36ee9

Browse files
committed
Make pathsim-flight robust to missing repo: non-fatal clone, flight route pages
1 parent 84d7627 commit 6e36ee9

4 files changed

Lines changed: 64 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@ jobs:
4040
git clone https://github.com/pathsim/pathsim.git ../pathsim || { echo "Failed to clone pathsim"; exit 1; }
4141
git clone https://github.com/pathsim/pathsim-chem.git ../pathsim-chem || { echo "Failed to clone pathsim-chem"; exit 1; }
4242
git clone https://github.com/pathsim/pathsim-vehicle.git ../pathsim-vehicle || { echo "Failed to clone pathsim-vehicle"; exit 1; }
43-
git clone https://github.com/pathsim/pathsim-flight.git ../pathsim-flight || { echo "Failed to clone pathsim-flight"; exit 1; }
43+
git clone https://github.com/pathsim/pathsim-flight.git ../pathsim-flight || echo "Skipping pathsim-flight (not available)"
4444
4545
- name: Fetch all tags
4646
run: |
4747
for repo in pathsim pathsim-chem pathsim-vehicle pathsim-flight; do
48-
git -C ../$repo fetch --tags
49-
latest_tag=$(git -C ../$repo describe --tags --abbrev=0 2>/dev/null || echo 'no tags')
50-
echo "✓ $repo: latest_tag=$latest_tag"
48+
if [ -d "../$repo" ]; then
49+
git -C ../$repo fetch --tags
50+
latest_tag=$(git -C ../$repo describe --tags --abbrev=0 2>/dev/null || echo 'no tags')
51+
echo "✓ $repo: latest_tag=$latest_tag"
52+
else
53+
echo "⊘ $repo: not cloned, skipping"
54+
fi
5155
done
5256
5357
# Build all versions (API, notebooks, outputs, figures)

src/routes/flight/+layout.svelte

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script lang="ts">
2+
import { DocLayout } from '$lib/components/layout';
3+
import type { Snippet } from 'svelte';
4+
import type { LayoutData } from './$types';
5+
6+
interface Props {
7+
data: LayoutData;
8+
children: Snippet;
9+
}
10+
11+
let { data, children }: Props = $props();
12+
</script>
13+
14+
<DocLayout packageId="flight" manifest={data.manifest} currentTag={data.selectedTag}>
15+
{@render children()}
16+
</DocLayout>

src/routes/flight/+layout.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { LayoutLoad } from './$types';
2+
import { getPackageManifest } from '$lib/api/versions';
3+
import { versionStore } from '$lib/stores/versionStore';
4+
5+
const PACKAGE_ID = 'flight';
6+
7+
/**
8+
* Load manifest for the flight package overview.
9+
* This allows the version selector to appear in the sidebar.
10+
*/
11+
export const load: LayoutLoad = async ({ fetch }) => {
12+
try {
13+
const manifest = await getPackageManifest(PACKAGE_ID, fetch);
14+
15+
// Get stored version or use latest
16+
const storedVersion = versionStore.getVersionSync(PACKAGE_ID);
17+
const selectedTag = storedVersion || manifest.latestTag;
18+
19+
return {
20+
packageId: PACKAGE_ID,
21+
manifest,
22+
selectedTag
23+
};
24+
} catch (e) {
25+
// Manifest not available, continue without version selector
26+
return {
27+
packageId: PACKAGE_ID,
28+
manifest: undefined,
29+
selectedTag: undefined
30+
};
31+
}
32+
};

src/routes/flight/+page.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script lang="ts">
2+
import { PackageOverview } from '$lib/components/pages';
3+
import type { PageData } from './$types';
4+
5+
let { data }: { data: PageData } = $props();
6+
</script>
7+
8+
<PackageOverview packageId="flight" manifest={data.manifest} selectedTag={data.selectedTag} />

0 commit comments

Comments
 (0)