Skip to content

Commit 2a5f76e

Browse files
danielwong0115omargfh
authored andcommitted
Resolve check-types nullability errors and template path import
1 parent e17da4d commit 2a5f76e

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

apps/netlogo/app/components/IntroSplash.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ const demoImageId = computed(() => {
188188
}
189189
190190
// Fallback to selected column_image if available
191-
if (featuredItem.column_images?.[selectedImageIndex.value]?.image?.id) {
192-
return featuredItem.column_images[selectedImageIndex.value].image.id;
191+
const selectedColumnImage = featuredItem.column_images?.[selectedImageIndex.value];
192+
if (selectedColumnImage?.image?.id) {
193+
return selectedColumnImage.image.id;
193194
}
194195
195196
return null;

apps/netlogo/app/components/downloads/DownloadForm.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,19 @@ const selectedPlatform = ref("");
180180
181181
// Set default version on mount
182182
onMounted(() => {
183-
if (props.versions.length > 0) {
184-
formData.version = props.versions[0].version;
183+
const firstVersion = props.versions[0];
184+
if (firstVersion) {
185+
formData.version = firstVersion.version;
185186
}
186187
});
187188
188189
// Also handle if versions load after mount (SSR hydration)
189190
watch(
190191
() => props.versions,
191192
(newVersions) => {
192-
if (newVersions.length > 0 && !formData.version) {
193-
formData.version = newVersions[0].version;
193+
const firstVersion = newVersions[0];
194+
if (firstVersion && !formData.version) {
195+
formData.version = firstVersion.version;
194196
}
195197
},
196198
{ immediate: true },

packages/template/src/engines.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import mustache from "mustache";
66

77
import { RenderError } from "./errors.js";
88
import { getFileExtension } from "./utils.js";
9-
10-
import { convertPath } from "@repo/utils/std/path";
119
abstract class TemplateEngine {
1210
public abstract registerPartial(key: string, content: string): void;
1311
public abstract render(content: string, variables: Record<string, unknown>): string;
@@ -32,7 +30,7 @@ abstract class TemplateEngine {
3230

3331
const filePath = path.join(file.parentPath, file.name);
3432
const fileNameRelativeToRoot = path.relative(rootDirectory, filePath);
35-
const fileKey: string = convertPath(fileNameRelativeToRoot, "posix");
33+
const fileKey = fileNameRelativeToRoot.split(path.sep).join("/");
3634

3735
try {
3836
const content = await fs.readFile(filePath, "utf-8");

0 commit comments

Comments
 (0)