Skip to content

Commit 8005e7f

Browse files
committed
fix: improve type safety and add typecheck script
1 parent a333a10 commit 8005e7f

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

apps/media/lib/podcast-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const fetchAllPodcasts = async (): Promise<PodcastShow[]> => {
3737
return {
3838
name: hostData.name || "Unknown Host",
3939
...(hostData.avatar && { avatar: hostData.avatar }),
40-
};
40+
} as PodcastHost;
4141
})
4242
.filter((host): host is PodcastHost => host !== null);
4343

@@ -100,7 +100,7 @@ export const fetchPodcastBySlug = async (
100100
return {
101101
name: hostData.name || "Unknown Host",
102102
...(hostData.avatar && { avatar: hostData.avatar }),
103-
};
103+
} as PodcastHost;
104104
})
105105
.filter((host): host is PodcastHost => host !== null);
106106

apps/media/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"build-public": "TINA_PUBLIC_IS_LOCAL=true tinacms build --local --skip-indexing --skip-cloud-checks && next build",
1010
"start": "tinacms build && next start",
1111
"export": "npm run build && next export",
12+
"typecheck": "tsc --noEmit",
1213
"lint": "eslint .",
1314
"lint:fix": "eslint . --fix",
1415
"format": "prettier --write .",

apps/media/tina/config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Podcast from "./collection/podcast";
1414
// Check if we're using local mode (no authentication)
1515
const isLocalMode = process.env.TINA_PUBLIC_IS_LOCAL === "true";
1616

17-
const config = defineConfig({
17+
const config: ReturnType<typeof defineConfig> = defineConfig({
1818
// Only require clientId and token if not in local mode
1919
clientId: isLocalMode ? undefined : process.env.NEXT_PUBLIC_TINA_CLIENT_ID,
2020
branch: process.env.NEXT_PUBLIC_TINA_BRANCH!,

apps/media/tina/fields/color.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const colorOptions = [
1313
"white",
1414
];
1515

16-
export const ColorPickerInput = wrapFieldsWithMeta(({ input }) => {
16+
export const ColorPickerInput: any = wrapFieldsWithMeta(({ input }) => {
1717
const inputClasses = {
1818
blue: "bg-blue-500 border-blue-600",
1919
teal: "bg-teal-500 border-teal-600",

apps/media/tina/fields/icon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const parseIconName = (name: string) => {
2121
}
2222
};
2323

24-
export const IconPickerInput = wrapFieldsWithMeta(({ input }) => {
24+
export const IconPickerInput: any = wrapFieldsWithMeta(({ input }) => {
2525
const [filter, setFilter] = React.useState("");
2626
const filteredBlocks = React.useMemo(() => {
2727
return Object.keys(IconOptions).filter((name) => {
@@ -142,7 +142,7 @@ export const IconPickerInput = wrapFieldsWithMeta(({ input }) => {
142142
);
143143
});
144144

145-
export const iconSchema = {
145+
export const iconSchema: any = {
146146
type: "object",
147147
label: "Icon",
148148
name: "icon",

0 commit comments

Comments
 (0)