From 9bee22ee0832d31031fa75d8ee18365b90d27d92 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sat, 18 Jan 2025 21:59:22 +0800 Subject: [PATCH 1/5] chore: enable noUncheckedIndexedAccess, better type check --- apps/main/package.json | 1 + apps/main/preload/index.ts | 4 +- apps/main/src/env.ts | 4 +- apps/main/src/index.ts | 2 +- apps/main/src/init.ts | 4 +- apps/main/src/lib/proxy.ts | 2 +- apps/main/src/lib/utils.ts | 4 +- .../src/modules/language-detection/index.ts | 2 +- .../src/updater/custom-github-provider.ts | 2 +- apps/main/src/updater/hot-updater.ts | 2 +- apps/main/tsconfig.json | 4 +- apps/mobile/package.json | 1 + .../src/components/ui/form/PickerIos.tsx | 2 +- apps/mobile/src/components/ui/form/Select.tsx | 4 +- .../src/components/ui/icon/fallback-icon.tsx | 4 +- .../src/components/ui/tabview/TabBar.tsx | 14 ++--- .../src/components/ui/toast/manager.tsx | 4 +- .../discover/RecommendationListItem.tsx | 4 +- .../src/modules/discover/Recommendations.tsx | 16 +++--- .../src/modules/discover/SearchTabBar.tsx | 2 +- .../src/modules/feed-drawer/feed-panel.tsx | 2 +- apps/mobile/src/modules/feed/FollowFeed.tsx | 2 +- apps/mobile/src/modules/login/index.tsx | 2 +- apps/mobile/src/modules/login/social.tsx | 2 +- .../src/modules/subscription/ViewTab.tsx | 8 +-- .../subscription/items/SubscriptionItem.tsx | 2 +- .../src/screens/(modal)/rsshub-form.tsx | 6 +-- .../src/screens/(stack)/(tabs)/index.tsx | 2 +- apps/mobile/src/store/subscription/getter.ts | 2 +- apps/mobile/src/store/subscription/hooks.ts | 2 +- apps/mobile/tsconfig.json | 2 + .../src/components/common/NotFound.tsx | 2 +- .../src/components/common/ShadowDOM.tsx | 3 +- .../errors/previews/FeedPreview.tsx | 4 +- .../ui/markdown/components/hooks.tsx | 4 +- .../src/components/ui/media/VideoPlayer.tsx | 4 +- .../src/components/ui/media/VolumeSlider.tsx | 2 +- .../src/components/ui/media/hooks.tsx | 2 +- .../src/components/ui/media/preview-media.tsx | 16 +++--- .../components/ux/pull-to-refresh/index.tsx | 4 +- apps/renderer/src/constants/shortcuts.ts | 2 +- apps/renderer/src/database/db.test.ts | 12 ++--- .../renderer/src/hooks/biz/useFeedActions.tsx | 6 +-- apps/renderer/src/lib/immersive-translate.ts | 2 +- apps/renderer/src/lib/native-menu.ts | 2 +- apps/renderer/src/lib/translate.ts | 2 +- apps/renderer/src/lib/utils.ts | 8 +-- .../src/modules/action/feed-filter.tsx | 8 +-- .../src/modules/action/target-action-list.tsx | 2 +- .../app-layout/entry-column/desktop.tsx | 2 +- .../app-layout/entry-content/desktop.tsx | 2 +- .../feed-column/components/PodcastButton.tsx | 4 +- .../feed-column/float-bar.mobile.tsx | 2 +- apps/renderer/src/modules/auth/Form.tsx | 2 +- .../modules/command/commands/integration.tsx | 2 +- .../src/modules/discover/DiscoverFeedForm.tsx | 6 +-- apps/renderer/src/modules/discover/form.tsx | 10 ++-- .../modules/discover/recommendations-card.tsx | 8 +-- .../src/modules/discover/rss3-form.tsx | 4 +- .../src/modules/discover/transform-form.tsx | 4 +- .../src/modules/discover/user-form.tsx | 4 +- .../Items/picture-item-stateless.tsx | 2 +- .../entry-column/Items/picture-item.tsx | 4 +- .../modules/entry-column/Items/video-item.tsx | 8 +-- .../src/modules/entry-column/grid.tsx | 6 +-- .../entry-column/hooks/useEntriesByView.ts | 21 +++++--- .../hooks/useEntryMarkReadHandler.tsx | 2 +- .../src/modules/entry-column/index.tsx | 6 +-- .../src/modules/entry-column/item.tsx | 2 +- .../layouts/EntryListHeader.desktop.tsx | 4 +- .../layouts/EntryListHeader.shared.tsx | 2 +- .../entry-column/layouts/TimelineTabs.tsx | 52 +++++++++++-------- .../src/modules/entry-column/list.tsx | 6 +-- .../templates/list-item-template.tsx | 6 +-- .../modules/entry-column/wrapper.desktop.tsx | 4 +- .../modules/entry-column/wrapper.mobile.tsx | 5 +- .../actions/electron-actions.tsx | 2 +- .../entry-content/actions/picture-gallery.tsx | 2 +- .../modules/entry-content/header.desktop.tsx | 2 +- .../modules/entry-content/index.shared.tsx | 4 +- .../src/modules/feed-column/category.tsx | 4 +- .../src/modules/feed-column/index.tsx | 4 +- .../renderer/src/modules/feed-column/item.tsx | 4 +- .../src/modules/feed-column/list.desktop.tsx | 4 +- .../src/modules/feed-column/list.mobile.tsx | 4 +- .../src/modules/feed-column/list.shared.tsx | 14 ++--- .../sort-by/SortByAlphabeticalList.tsx | 8 +-- .../feed-column/sort-by/SortByUnreadList.tsx | 6 +-- apps/renderer/src/modules/feed/feed-icon.tsx | 10 ++-- .../src/modules/feed/view-select-content.tsx | 2 +- .../new-user-guide/guide-modal-content.tsx | 12 ++--- .../src/modules/player/corner-player.tsx | 4 +- .../reward-description-modal.tsx | 2 +- .../power/my-wallet-section/withdraw.tsx | 6 +-- apps/renderer/src/modules/profile/hooks.ts | 2 +- .../profile/user-profile-modal.mobile.tsx | 2 +- .../profile/user-profile-modal.shared.tsx | 2 +- .../modules/renderer/components/TimeStamp.tsx | 6 +-- .../src/modules/settings/modal/layout.tsx | 2 +- .../modules/settings/tabs/data-control.tsx | 2 +- .../src/modules/settings/tabs/lists/index.tsx | 6 +-- .../modules/settings/tabs/lists/modals.tsx | 5 +- .../modules/shared/ViewSelectorRadioGroup.tsx | 2 +- .../(layer)/(subview)/discover/index.tsx | 2 +- apps/renderer/src/providers/i18n-provider.tsx | 2 +- .../providers/wrapped-element-provider.tsx | 4 +- apps/renderer/src/store/action/hooks.ts | 2 +- apps/renderer/src/store/action/store.ts | 2 +- apps/renderer/src/store/entry/helper.ts | 2 +- apps/renderer/src/store/entry/hooks.ts | 2 +- apps/renderer/src/store/entry/store.ts | 30 ++++++----- apps/renderer/src/store/feed/hooks.ts | 2 +- apps/renderer/src/store/inbox/hooks.ts | 2 +- apps/renderer/src/store/list/hooks.ts | 2 +- apps/renderer/src/store/list/store.ts | 2 +- apps/renderer/src/store/subscription/hooks.ts | 4 +- .../src/store/subscription/selector.ts | 2 +- apps/renderer/src/store/subscription/store.ts | 22 ++++---- apps/renderer/src/store/unread/index.ts | 2 +- apps/renderer/src/store/user/hooks.ts | 2 +- apps/renderer/src/store/user/store.ts | 2 +- apps/renderer/src/workers/sw/pusher.ts | 2 +- apps/renderer/tsconfig.json | 2 + apps/server/client/@types/constants.ts | 2 +- apps/server/client/components/items/grid.tsx | 2 +- .../client/components/items/picture.tsx | 6 +-- apps/server/client/i18n.ts | 2 +- apps/server/client/initialize/helper.ts | 7 ++- apps/server/client/pages/(login)/register.tsx | 2 +- .../pages/(main)/share/lists/[id]/index.tsx | 2 +- .../pages/(main)/share/lists/[id]/metadata.ts | 2 +- .../pages/(main)/share/users/[id]/index.tsx | 2 +- apps/server/client/query/users.ts | 2 +- apps/server/package.json | 3 +- apps/server/src/lib/api-client.ts | 2 +- apps/server/src/router/og/index.ts | 6 +-- apps/server/tsconfig.json | 2 + configs/tailwind.base.config.ts | 2 +- packages/atoms/package.json | 5 +- packages/components/package.json | 4 +- packages/components/src/atoms/route.ts | 2 +- .../components/src/common/PoweredByFooter.tsx | 3 +- .../src/ui/auto-resize-height/index.tsx | 4 +- .../src/ui/button/action-button.tsx | 2 +- .../components/src/ui/feed-icon/index.tsx | 11 ++-- packages/components/src/ui/input/OTP.tsx | 2 +- packages/components/src/ui/kbd/Kbd.tsx | 2 +- .../components/src/ui/markdown/parse-html.ts | 6 +-- .../components/src/utils/parse-markdown.tsx | 1 + packages/constants/package.json | 5 +- packages/constants/src/internal/i18n.ts | 36 ------------- packages/constants/src/tabs.tsx | 4 +- packages/constants/tsconfig.json | 2 +- packages/hooks/package.json | 4 +- .../hooks/src/factory/createHTMLMediaHook.ts | 2 +- packages/hooks/src/useLongPress.ts | 6 +-- packages/hooks/src/useSetState.ts | 2 +- packages/hooks/src/useTitle.ts | 2 +- packages/logger/package.json | 5 +- packages/models/package.json | 4 +- packages/shared/package.json | 4 +- packages/shared/src/bridge.ts | 3 ++ packages/shared/src/constants.ts | 1 + packages/shared/src/env.ts | 3 +- packages/tsconfig.extend.json | 10 ++-- packages/types/package.json | 5 +- .../vite.d.ts => packages/types/vite-env.d.ts | 0 packages/utils/package.json | 3 +- packages/utils/src/cjk.ts | 2 +- packages/utils/src/color.ts | 24 ++++++--- packages/utils/src/event-bus.ts | 2 +- packages/utils/src/jotai.ts | 2 +- packages/utils/src/path-parser.ts | 2 +- packages/utils/src/route-builder.ts | 6 +-- packages/utils/src/utils.ts | 8 +-- packages/utils/tsconfig.json | 2 +- packages/utils/vitest.config.ts | 1 + plugins/vite/locales.ts | 2 +- plugins/vite/utils/i18n-completeness.ts | 2 +- pnpm-lock.yaml | 3 ++ tsconfig.json | 7 ++- 181 files changed, 438 insertions(+), 406 deletions(-) delete mode 100644 packages/constants/src/internal/i18n.ts rename types/vite.d.ts => packages/types/vite-env.d.ts (100%) diff --git a/apps/main/package.json b/apps/main/package.json index d7aab971b1..40da5304fb 100644 --- a/apps/main/package.json +++ b/apps/main/package.json @@ -53,6 +53,7 @@ "vscode-languagedetection": "npm:@vscode/vscode-languagedetection@^1.0.22" }, "devDependencies": { + "@follow/types": "workspace:*", "@types/js-yaml": "4.0.9", "@types/node": "^22.10.1", "electron": "33.2.0", diff --git a/apps/main/preload/index.ts b/apps/main/preload/index.ts index fad6d2b9b0..cc0f2290b9 100644 --- a/apps/main/preload/index.ts +++ b/apps/main/preload/index.ts @@ -18,8 +18,8 @@ const detectingWindows11 = () => { if (!isWindows) return false const release = os.release() - const majorVersion = Number.parseInt(release.split(".")[0]) - const buildNumber = Number.parseInt(release.split(".")[2]) + const majorVersion = Number.parseInt(release.split(".")[0]!) + const buildNumber = Number.parseInt(release.split(".")[2]!) return majorVersion === 10 && buildNumber >= 22000 } diff --git a/apps/main/src/env.ts b/apps/main/src/env.ts index 62638dde05..37e2b9c7f8 100644 --- a/apps/main/src/env.ts +++ b/apps/main/src/env.ts @@ -28,8 +28,8 @@ const detectingWindows11 = () => { if (!isWindows) return false const release = os.release() - const majorVersion = Number.parseInt(release.split(".")[0]) - const buildNumber = Number.parseInt(release.split(".")[2]) + const majorVersion = Number.parseInt(release.split(".")[0]!) + const buildNumber = Number.parseInt(release.split(".")[2]!) return majorVersion === 10 && buildNumber >= 22000 } diff --git a/apps/main/src/index.ts b/apps/main/src/index.ts index 47e54b5e09..e01cf6ce4b 100644 --- a/apps/main/src/index.ts +++ b/apps/main/src/index.ts @@ -109,7 +109,7 @@ function bootstrap() { userAgent = userAgent.replace(/\s?Electron\/[\d.]+/, "") userAgent = userAgent.replace(/\s?Follow\/[\d.a-zA-Z-]+/, "") } - details.requestHeaders["User-Agent"] = userAgent + details.requestHeaders["User-Agent"] = userAgent! // set referer and origin if (selfRefererMatches.some((item) => details.url.startsWith(item))) { diff --git a/apps/main/src/init.ts b/apps/main/src/init.ts index 2358554fad..ebe8739bc5 100644 --- a/apps/main/src/init.ts +++ b/apps/main/src/init.ts @@ -20,7 +20,7 @@ import { initializeSentry } from "./sentry" import { router } from "./tipc" import { createMainWindow, getMainWindow } from "./window" -if (process.argv.length === 3 && process.argv[2].startsWith("follow-dev:")) { +if (process.argv.length === 3 && process.argv[2]!.startsWith("follow-dev:")) { process.env.NODE_ENV = "development" } const isDev = process.env.NODE_ENV === "development" @@ -36,7 +36,7 @@ export const initializeAppStage1 = () => { if (process.defaultApp) { if (process.argv.length >= 2) { app.setAsDefaultProtocolClient(APP_PROTOCOL, process.execPath, [ - path.resolve(process.argv[1]), + path.resolve(process.argv[1]!), ]) } } else { diff --git a/apps/main/src/lib/proxy.ts b/apps/main/src/lib/proxy.ts index bc3aaf28ba..edd8a24608 100644 --- a/apps/main/src/lib/proxy.ts +++ b/apps/main/src/lib/proxy.ts @@ -40,7 +40,7 @@ const normalizeProxyUri = (userProxy: string) => { return } // Only use the first proxy if there are multiple urls - const firstInput = userProxy.split(",")[0] + const firstInput = userProxy.split(",")[0]! try { const proxyUrl = new URL(firstInput) diff --git a/apps/main/src/lib/utils.ts b/apps/main/src/lib/utils.ts index 12b3d133d0..2eda0e595f 100644 --- a/apps/main/src/lib/utils.ts +++ b/apps/main/src/lib/utils.ts @@ -7,7 +7,7 @@ export function refreshBound(window: BrowserWindow, timeout = 0) { setTimeout(() => { // FIXME: workaround for theme bug in full screen mode const size = window?.getSize() - window?.setSize(size[0] + 1, size[1] + 1) - window?.setSize(size[0], size[1]) + window?.setSize(size[0]! + 1, size[1]! + 1) + window?.setSize(size[0]!, size[1]!) }, timeout) } diff --git a/apps/main/src/modules/language-detection/index.ts b/apps/main/src/modules/language-detection/index.ts index 9e683d5f0c..f54a56c172 100644 --- a/apps/main/src/modules/language-detection/index.ts +++ b/apps/main/src/modules/language-detection/index.ts @@ -73,7 +73,7 @@ export const detectCodeStringLanguage = async function* (codeString: string) { logger.debug("no model results", codeString) return } - const firstModelResult = adjustLanguageConfidence(modelResults[0]) + const firstModelResult = adjustLanguageConfidence(modelResults[0]!) if (firstModelResult.confidence < expectedRelativeConfidence) { logger.debug("first model result confidence is less than expected relative confidence") return diff --git a/apps/main/src/updater/custom-github-provider.ts b/apps/main/src/updater/custom-github-provider.ts index b1e6ca3483..567b9dfb01 100644 --- a/apps/main/src/updater/custom-github-provider.ts +++ b/apps/main/src/updater/custom-github-provider.ts @@ -87,7 +87,7 @@ export class CustomGitHubProvider extends BaseGitHubProvider { if (hrefElement === null) continue // This Release's Tag - const hrefTag = hrefElement[1] + const hrefTag = hrefElement[1]! // Get Channel from this release's tag // If it is null, we believe it is stable version const hrefChannel = (semver.prerelease(hrefTag)?.[0] as string) || "stable" diff --git a/apps/main/src/updater/hot-updater.ts b/apps/main/src/updater/hot-updater.ts index 68b7e6d797..4c02b89efe 100644 --- a/apps/main/src/updater/hot-updater.ts +++ b/apps/main/src/updater/hot-updater.ts @@ -40,7 +40,7 @@ const getLatestReleaseTag = async () => { // Search the top nightly release const nightlyRelease = json.find((item) => item.prerelease) - if (!nightlyRelease) return json[0].tag_name + if (!nightlyRelease) return json[0]!.tag_name return nightlyRelease.tag_name } } diff --git a/apps/main/tsconfig.json b/apps/main/tsconfig.json index 83e899f20b..7195126e32 100644 --- a/apps/main/tsconfig.json +++ b/apps/main/tsconfig.json @@ -3,11 +3,13 @@ "compilerOptions": { "composite": true, "outDir": "dist", - "types": ["electron-vite/node"], + "types": ["electron-vite/node", "@follow/types/vite"], "moduleResolution": "Bundler", "noImplicitReturns": false, "noUnusedLocals": false, "noUnusedParameters": false, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, "baseUrl": ".", "paths": { "@pkg": ["../../package.json"], diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 3899f1b20d..a8c638582a 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -11,6 +11,7 @@ "ios:device": "expo run:ios --device", "lint": "expo lint", "start": "expo start --dev-client", + "typecheck": "tsc --noEmit", "web": "expo start --web" }, "dependencies": { diff --git a/apps/mobile/src/components/ui/form/PickerIos.tsx b/apps/mobile/src/components/ui/form/PickerIos.tsx index 5c871f276e..9456ce60f4 100644 --- a/apps/mobile/src/components/ui/form/PickerIos.tsx +++ b/apps/mobile/src/components/ui/form/PickerIos.tsx @@ -33,7 +33,7 @@ export function PickerIos({ const [currentValue, setCurrentValue] = useState(() => { if (!value) { - return options[0].value + return options[0]!.value } return value }) diff --git a/apps/mobile/src/components/ui/form/Select.tsx b/apps/mobile/src/components/ui/form/Select.tsx index d2810a1ec7..ccd1d8fa4b 100644 --- a/apps/mobile/src/components/ui/form/Select.tsx +++ b/apps/mobile/src/components/ui/form/Select.tsx @@ -31,7 +31,7 @@ export function Select({ }: SelectProps) { const [currentValue, setCurrentValue] = useState(() => { if (!value) { - return options[0].value + return options[0]!.value } return value }) @@ -65,7 +65,7 @@ export function Select({ }))} onPress={(e) => { const { index } = e.nativeEvent - handleChangeValue(options[index].value) + handleChangeValue(options[index]!.value) }} > { - const isCJK = isCJKChar(title[0]) + const isCJK = isCJKChar(title[0]!) return ( {isCJK ? title[0] : title.slice(0, 2)} @@ -39,7 +39,7 @@ export const FallbackIcon = ({ return ( diff --git a/apps/mobile/src/components/ui/tabview/TabBar.tsx b/apps/mobile/src/components/ui/tabview/TabBar.tsx index 046cdc39cf..50461ecbb4 100644 --- a/apps/mobile/src/components/ui/tabview/TabBar.tsx +++ b/apps/mobile/src/components/ui/tabview/TabBar.tsx @@ -112,11 +112,11 @@ export const TabBar = forwardRef( indicatorPosition.value = withSpring(tabPositions[currentTab] || 0, springConfig) if (tabRef.current) { - const x = currentTab > 0 ? tabPositions[currentTab - 1] + tabWidths[currentTab - 1] : 0 + const x = currentTab > 0 ? tabPositions[currentTab - 1]! + tabWidths[currentTab - 1]! : 0 const isCurrentTabVisible = - sharedPagerOffsetX.value < tabPositions[currentTab] && - sharedPagerOffsetX.value + tabWidths[currentTab] > tabPositions[currentTab] + sharedPagerOffsetX.value < tabPositions[currentTab]! && + sharedPagerOffsetX.value + tabWidths[currentTab]! > tabPositions[currentTab]! if (!isCurrentTabVisible) { tabRef.current.scrollTo({ x, y: 0, animated: true }) @@ -146,17 +146,17 @@ export const TabBar = forwardRef( // Interpolate between current and next tab positions const xPosition = - tabPositions[currentIndex] + - (tabPositions[nextIndex] - tabPositions[currentIndex]) * progress + tabPositions[currentIndex]! + + (tabPositions[nextIndex]! - tabPositions[currentIndex]!) * progress // Interpolate between current and next tab widths const width = - tabWidths[currentIndex] + (tabWidths[nextIndex] - tabWidths[currentIndex]) * progress + tabWidths[currentIndex]! + (tabWidths[nextIndex]! - tabWidths[currentIndex]!) * progress return { transform: [{ translateX: Math.max(xPosition, 0) }], width, - backgroundColor: tabs[currentTab].activeColor || accentColor, + backgroundColor: tabs[currentTab]!.activeColor || accentColor, } }) diff --git a/apps/mobile/src/components/ui/toast/manager.tsx b/apps/mobile/src/components/ui/toast/manager.tsx index 8c10e7f614..1f49c42937 100644 --- a/apps/mobile/src/components/ui/toast/manager.tsx +++ b/apps/mobile/src/components/ui/toast/manager.tsx @@ -64,14 +64,14 @@ export class ToastManager { } private scheduleDismiss(index: number) { - const props = this.propsMap[index] + const props = this.propsMap[index]! if (props.duration === Infinity) { return } setTimeout(async () => { - await this.toastRefs[index].dimiss() + await this.toastRefs[index]!.dimiss() this.remove(index) }, props.duration) } diff --git a/apps/mobile/src/modules/discover/RecommendationListItem.tsx b/apps/mobile/src/modules/discover/RecommendationListItem.tsx index a959368f59..130a960f02 100644 --- a/apps/mobile/src/modules/discover/RecommendationListItem.tsx +++ b/apps/mobile/src/modules/discover/RecommendationListItem.tsx @@ -25,7 +25,7 @@ export const RecommendationListItem: FC<{ const maintainers = new Set() const categories = new Set() for (const route in data.routes) { - const routeData = data.routes[route] + const routeData = data.routes[route]! if (routeData.maintainers) { routeData.maintainers.forEach((m) => maintainers.add(m)) } @@ -120,7 +120,7 @@ export const RecommendationListItem: FC<{ /> - {data.routes[route].name} + {data.routes[route]!.name} diff --git a/apps/mobile/src/modules/discover/Recommendations.tsx b/apps/mobile/src/modules/discover/Recommendations.tsx index c10629018e..9246a7fb28 100644 --- a/apps/mobile/src/modules/discover/Recommendations.tsx +++ b/apps/mobile/src/modules/discover/Recommendations.tsx @@ -75,11 +75,11 @@ const Tab: TabComponent = ({ tab, ...rest }) => { return [] } return Object.keys(data).sort((a, b) => { - const aname = data[a].name - const bname = data[b].name + const aname = data[a]!.name + const bname = data[b]!.name - const aRouteName = data[a].routes[Object.keys(data[a].routes)[0]].name - const bRouteName = data[b].routes[Object.keys(data[b].routes)[0]].name + const aRouteName = data[a]!.routes[Object.keys(data[a]!.routes)[0]!]!.name + const bRouteName = data[b]!.routes[Object.keys(data[b]!.routes)[0]!]!.name const ia = isASCII(aname) && isASCII(aRouteName) const ib = isASCII(bname) && isASCII(bRouteName) @@ -98,7 +98,7 @@ const Tab: TabComponent = ({ tab, ...rest }) => { const groups = keys.reduce( (acc, key) => { // A-Z -> A-Z, 0-9 -> #, other -> #, # push to the end - const firstChar = key[0].toUpperCase() + const firstChar = key[0]!.toUpperCase() if (/[A-Z]/.test(firstChar)) { acc[firstChar] = acc[firstChar] || [] acc[firstChar].push(key) @@ -127,7 +127,7 @@ const Tab: TabComponent = ({ tab, ...rest }) => { if (!data) { continue } - result.push({ key: item, data: data[item] }) + result.push({ key: item, data: data[item]! }) } } @@ -198,7 +198,7 @@ const NavigationSidebar: FC<{ (letter: string, animated = true) => { const index = alphabetGroups.findIndex((group) => { if (typeof group !== "string") return false - const firstChar = group[0].toUpperCase() + const firstChar = group[0]!.toUpperCase() const firstCharIsAlphabet = /[A-Z]/.test(firstChar) if (firstCharIsAlphabet) { return firstChar === letter @@ -233,7 +233,7 @@ const NavigationSidebar: FC<{ return } - const firstChar = letter[0].toUpperCase() + const firstChar = letter[0]!.toUpperCase() const firstCharIsAlphabet = /[A-Z]/.test(firstChar) if (firstCharIsAlphabet) { scrollToLetter(letter, false) diff --git a/apps/mobile/src/modules/discover/SearchTabBar.tsx b/apps/mobile/src/modules/discover/SearchTabBar.tsx index 57040028f0..f84e9c41c3 100644 --- a/apps/mobile/src/modules/discover/SearchTabBar.tsx +++ b/apps/mobile/src/modules/discover/SearchTabBar.tsx @@ -20,7 +20,7 @@ export const SearchTabBar: FC<{ tabs={SearchTabs} currentTab={SearchTabs.findIndex((tab) => tab.value === searchType)} onTabItemPress={(index) => { - setSearchType(SearchTabs[index].value as SearchType) + setSearchType(SearchTabs[index]!.value as SearchType) }} /> ) diff --git a/apps/mobile/src/modules/feed-drawer/feed-panel.tsx b/apps/mobile/src/modules/feed-drawer/feed-panel.tsx index e58a9c61eb..289ca07a1a 100644 --- a/apps/mobile/src/modules/feed-drawer/feed-panel.tsx +++ b/apps/mobile/src/modules/feed-drawer/feed-panel.tsx @@ -199,7 +199,7 @@ const CategoryGrouped = memo( const SubscriptionItem = memo(({ id, className }: { id: string; className?: string }) => { const subscription = useSubscription(id) const unreadCount = useUnreadCount(id) - const feed = useFeed(id) + const feed = useFeed(id)! const inGrouped = !!useContext(GroupedContext) const view = useCurrentView() const { isLoading } = usePrefetchFeed(id, { enabled: !feed }) diff --git a/apps/mobile/src/modules/feed/FollowFeed.tsx b/apps/mobile/src/modules/feed/FollowFeed.tsx index 5cabfe9883..8383c1bceb 100644 --- a/apps/mobile/src/modules/feed/FollowFeed.tsx +++ b/apps/mobile/src/modules/feed/FollowFeed.tsx @@ -50,7 +50,7 @@ export function FollowFeed(props: { id: string }) { function FollowImpl() { const { id } = useLocalSearchParams() - const feed = useFeed(id as string) + const feed = useFeed(id as string)! const isSubscribed = useSubscriptionByFeedId(feed?.id || "") const form = useForm>({ diff --git a/apps/mobile/src/modules/login/index.tsx b/apps/mobile/src/modules/login/index.tsx index a31ffcdeab..c7bf1ab7f2 100644 --- a/apps/mobile/src/modules/login/index.tsx +++ b/apps/mobile/src/modules/login/index.tsx @@ -96,7 +96,7 @@ const TeamsCheckBox = forwardRef< const runAnimation = (index: number) => { "worklet" if (index < animations.length) { - shakeSharedValue.value = withTiming(animations[index], { duration: 100 }, () => { + shakeSharedValue.value = withTiming(animations[index]!, { duration: 100 }, () => { runAnimation(index + 1) }) } diff --git a/apps/mobile/src/modules/login/social.tsx b/apps/mobile/src/modules/login/social.tsx index d1dec8a73f..6938682b64 100644 --- a/apps/mobile/src/modules/login/social.tsx +++ b/apps/mobile/src/modules/login/social.tsx @@ -48,7 +48,7 @@ export function SocialLogin() { {Object.keys(provider) .filter((key) => key !== "apple" || (Platform.OS === "ios" && key === "apple")) .map((key) => { - const providerInfo = provider[key] + const providerInfo = provider[key]! return ( { indicatorPosition.value = withSpring(tabPositions[currentView] || 0, springConfig) if (tabRef.current) { - const x = currentView > 0 ? tabPositions[currentView - 1] + tabWidths[currentView - 1] : 0 + const x = currentView > 0 ? tabPositions[currentView - 1]! + tabWidths[currentView - 1]! : 0 const isCurrentTabVisible = - scrollOffsetX.current < tabPositions[currentView] && - scrollOffsetX.current + tabWidths[currentView] > tabPositions[currentView] + scrollOffsetX.current < tabPositions[currentView]! && + scrollOffsetX.current + tabWidths[currentView]! > tabPositions[currentView]! if (!isCurrentTabVisible) { tabRef.current.scrollTo({ x, y: 0, animated: true }) @@ -58,7 +58,7 @@ export const ViewTab = () => { translateX: indicatorPosition.value + 10 + Math.abs(offset), }, ], - backgroundColor: views[currentView].activeColor, + backgroundColor: views[currentView]!.activeColor, width: (tabWidths[currentView] || 20) - 40 + Math.abs(offset), } }) diff --git a/apps/mobile/src/modules/subscription/items/SubscriptionItem.tsx b/apps/mobile/src/modules/subscription/items/SubscriptionItem.tsx index d3f165fb14..05ffd1e8af 100644 --- a/apps/mobile/src/modules/subscription/items/SubscriptionItem.tsx +++ b/apps/mobile/src/modules/subscription/items/SubscriptionItem.tsx @@ -46,7 +46,7 @@ import { GroupedContext, useViewPageCurrentView } from "../ctx" export const SubscriptionItem = memo(({ id, className }: { id: string; className?: string }) => { const subscription = useSubscription(id) const unreadCount = useUnreadCount(id) - const feed = useFeed(id) + const feed = useFeed(id)! const inGrouped = !!useContext(GroupedContext) const view = useViewPageCurrentView() const { isLoading } = usePrefetchFeed(id, { enabled: !subscription && !feed }) diff --git a/apps/mobile/src/screens/(modal)/rsshub-form.tsx b/apps/mobile/src/screens/(modal)/rsshub-form.tsx index 1632d529ed..edd759c97e 100644 --- a/apps/mobile/src/screens/(modal)/rsshub-form.tsx +++ b/apps/mobile/src/screens/(modal)/rsshub-form.tsx @@ -54,7 +54,7 @@ export default function RsshubForm() { if (!parsedRoute || !routePrefix) { return null } - return + return } function FormImpl({ route, routePrefix, name }: RsshubFormParams) { @@ -97,7 +97,7 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) { const ret = {} as Record if (!route.parameters) return ret for (const key in route.parameters) { - const params = normalizeRSSHubParameters(route.parameters[key]) + const params = normalizeRSSHubParameters(route.parameters[key]!) if (!params) continue ret[key] = params.default } @@ -123,7 +123,7 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) { {keys.map((keyItem) => { - const parameters = normalizeRSSHubParameters(route.parameters[keyItem.name]) + const parameters = normalizeRSSHubParameters(route.parameters[keyItem.name]!) return ( diff --git a/apps/mobile/src/screens/(stack)/(tabs)/index.tsx b/apps/mobile/src/screens/(stack)/(tabs)/index.tsx index eb8fa3236b..a561167ac2 100644 --- a/apps/mobile/src/screens/(stack)/(tabs)/index.tsx +++ b/apps/mobile/src/screens/(stack)/(tabs)/index.tsx @@ -29,7 +29,7 @@ export default function Index() { { const ids = [] as string[] for (const id of Object.keys(state.data)) { - if (state.data[id].category === category) { + if (state.data[id]!.category === category) { ids.push(id) } } diff --git a/apps/mobile/src/store/subscription/hooks.ts b/apps/mobile/src/store/subscription/hooks.ts index a882805eac..b9ed9da24b 100644 --- a/apps/mobile/src/store/subscription/hooks.ts +++ b/apps/mobile/src/store/subscription/hooks.ts @@ -114,7 +114,7 @@ export const useSortedGroupedSubscription = ( }) const sortedList = [] as { category: string; subscriptionIds: string[] }[] for (const category of sortedCategories) { - sortedList.push({ category, subscriptionIds: grouped[category] }) + sortedList.push({ category, subscriptionIds: grouped[category]! }) } return sortedList }, [grouped, sortBy, sortOrder]), diff --git a/apps/mobile/tsconfig.json b/apps/mobile/tsconfig.json index 86e8c7d32c..e6d2d18720 100644 --- a/apps/mobile/tsconfig.json +++ b/apps/mobile/tsconfig.json @@ -2,6 +2,8 @@ "extends": "expo/tsconfig.base", "compilerOptions": { "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, "paths": { "@/*": ["./*"] }, diff --git a/apps/renderer/src/components/common/NotFound.tsx b/apps/renderer/src/components/common/NotFound.tsx index 1cbde8f385..d1d293f6e3 100644 --- a/apps/renderer/src/components/common/NotFound.tsx +++ b/apps/renderer/src/components/common/NotFound.tsx @@ -20,7 +20,7 @@ class AccessNotFoundError extends Error { this.name = "AccessNotFoundError" } - toString() { + override toString() { return `${this.name}: ${this.message} at ${this.path}` } } diff --git a/apps/renderer/src/components/common/ShadowDOM.tsx b/apps/renderer/src/components/common/ShadowDOM.tsx index 72a563da05..36d6b2f3de 100644 --- a/apps/renderer/src/components/common/ShadowDOM.tsx +++ b/apps/renderer/src/components/common/ShadowDOM.tsx @@ -88,6 +88,7 @@ export const ShadowDOM: FC< const [uiFont, usePointerCursor] = useUISettingKeys(["uiFontFamily", "usePointerCursor"]) return ( + // @ts-expect-error
{ setCurrentDragging(true) }} onValueChange={(value) => { - setDragTime(value[0]) + setDragTime(value[0]!) startTransition(() => { - controls.seek(value[0]) + controls.seek(value[0]!) }) }} onValueCommit={() => { diff --git a/apps/renderer/src/components/ui/media/VolumeSlider.tsx b/apps/renderer/src/components/ui/media/VolumeSlider.tsx index 3bc599460e..f31a7dfd24 100644 --- a/apps/renderer/src/components/ui/media/VolumeSlider.tsx +++ b/apps/renderer/src/components/ui/media/VolumeSlider.tsx @@ -12,7 +12,7 @@ export const VolumeSlider: FC<{ orientation="vertical" value={[volume ?? 0.8]} onValueChange={(values) => { - onVolumeChange?.(values[0]) + onVolumeChange?.(values[0]!) }} > diff --git a/apps/renderer/src/components/ui/media/hooks.tsx b/apps/renderer/src/components/ui/media/hooks.tsx index 6a7471e8aa..3ef858c1e9 100644 --- a/apps/renderer/src/components/ui/media/hooks.tsx +++ b/apps/renderer/src/components/ui/media/hooks.tsx @@ -13,7 +13,7 @@ export const usePreviewMedia = (children?: React.ReactNode) => { return useCallback( (media: PreviewMediaProps[], initialIndex = 0) => { if (isMobile()) { - window.open(replaceImgUrlIfNeed(media[initialIndex].url)) + window.open(replaceImgUrlIfNeed(media[initialIndex]!.url)) return } present({ diff --git a/apps/renderer/src/components/ui/media/preview-media.tsx b/apps/renderer/src/components/ui/media/preview-media.tsx index 8e2102c995..e4263127db 100644 --- a/apps/renderer/src/components/ui/media/preview-media.tsx +++ b/apps/renderer/src/components/ui/media/preview-media.tsx @@ -209,8 +209,8 @@ export const PreviewMediaContent: FC<{ if (media.length === 0) return null if (media.length === 1) { - const src = media[0].url - const { type } = media[0] + const src = media[0]!.url + const { type } = media[0]! const isVideo = type === "video" return ( @@ -225,23 +225,23 @@ export const PreviewMediaContent: FC<{ /> ) : ( )} ) } - const isVideo = currentMedia.type === "video" + const isVideo = currentMedia!.type === "video" return ( - +
{media.map((med) => ( diff --git a/apps/renderer/src/components/ux/pull-to-refresh/index.tsx b/apps/renderer/src/components/ux/pull-to-refresh/index.tsx index d0adff9e3f..01c20514fa 100644 --- a/apps/renderer/src/components/ux/pull-to-refresh/index.tsx +++ b/apps/renderer/src/components/ux/pull-to-refresh/index.tsx @@ -43,7 +43,7 @@ export function PullToRefresh({ ) as HTMLElement if (!scrollContainer) return - const touchY = e.touches[0].clientY + const touchY = e.touches[0]!.clientY setStartY(touchY) if (scrollContainer.scrollTop <= 0) { @@ -56,7 +56,7 @@ export function PullToRefresh({ const touchMoveHandler = (e: TouchEvent) => { if (!shouldAllowPull || isRefreshing) return - const y = e.touches[0].clientY + const y = e.touches[0]!.clientY const delta = y - startY if (delta > 0) { diff --git a/apps/renderer/src/constants/shortcuts.ts b/apps/renderer/src/constants/shortcuts.ts index e6b58dd392..4fa1235e64 100644 --- a/apps/renderer/src/constants/shortcuts.ts +++ b/apps/renderer/src/constants/shortcuts.ts @@ -125,7 +125,7 @@ function transformShortcuts(configs: T) { for (const category in configs) { for (const shortcutKey in configs[category]) { const config = configs[category][shortcutKey] - result[category][shortcutKey].key = transformShortcut(config.key) + result[category]![shortcutKey]!.key = transformShortcut(config!.key) } } diff --git a/apps/renderer/src/database/db.test.ts b/apps/renderer/src/database/db.test.ts index f17167f8e0..25b8ea1d9e 100644 --- a/apps/renderer/src/database/db.test.ts +++ b/apps/renderer/src/database/db.test.ts @@ -20,17 +20,17 @@ describe("upgradeToV8", () => { const feeds = await browserDB.feeds.toArray() expect(feeds.length).toEqual(3) - expect(feeds[0].tipUsers).toEqual(insertFeeds[0].tipUsers) - expect(feeds[1].tipUsers).toEqual(insertFeeds[1].tipUsers) - expect(feeds[2].tipUsers).toEqual(insertFeeds[2].tipUsers) + expect(feeds[0]!.tipUsers).toEqual(insertFeeds[0]!.tipUsers) + expect(feeds[1]!.tipUsers).toEqual(insertFeeds[1]!.tipUsers) + expect(feeds[2]!.tipUsers).toEqual(insertFeeds[2]!.tipUsers) await browserDB.transaction("rw", [browserDB.feeds], async (tx) => { await browserDB.upgradeToV8(tx) }) const feedsAfterMigrate = await browserDB.feeds.toArray() expect(feedsAfterMigrate.length).toEqual(3) - expect(feedsAfterMigrate[0].tipUsers).toEqual([]) - expect(feedsAfterMigrate[1].tipUsers).toEqual(null) - expect(feedsAfterMigrate[2].tipUsers).toEqual([{ name: "user1" }]) + expect(feedsAfterMigrate[0]!.tipUsers).toEqual([]) + expect(feedsAfterMigrate[1]!.tipUsers).toEqual(null) + expect(feedsAfterMigrate[2]!.tipUsers).toEqual([{ name: "user1" }]) }) }) diff --git a/apps/renderer/src/hooks/biz/useFeedActions.tsx b/apps/renderer/src/hooks/biz/useFeedActions.tsx index f19e0a9148..fa52157533 100644 --- a/apps/renderer/src/hooks/biz/useFeedActions.tsx +++ b/apps/renderer/src/hooks/biz/useFeedActions.tsx @@ -79,7 +79,7 @@ export const useFeedActions = ({ const inbox = useInboxById(feedId) const isInbox = !!inbox - const subscription = useSubscriptionByFeedId(feedId) + const subscription = useSubscriptionByFeedId(feedId)! const subscriptions = useSubscriptionsByFeedIds( useMemo(() => feedIds || [feedId], [feedId, feedIds]), @@ -215,7 +215,7 @@ export const useFeedActions = ({ submenu: [ ...Array.from(categories.values()).map((category) => { const isIncluded = isMultipleSelection - ? subscriptions.every((s) => s.category === category) + ? subscriptions.every((s) => s!.category === category) : subscription?.category === category return { label: category, @@ -397,7 +397,7 @@ export const useFeedActions = ({ export const useListActions = ({ listId, view }: { listId: string; view: FeedViewType }) => { const { t } = useTranslation() const list = useListById(listId) - const subscription = useSubscriptionByFeedId(listId) + const subscription = useSubscriptionByFeedId(listId)! const { present } = useModalStack() const { mutateAsync: deleteSubscription } = useDeleteSubscription({}) diff --git a/apps/renderer/src/lib/immersive-translate.ts b/apps/renderer/src/lib/immersive-translate.ts index 4bf92ee3b5..772b8019ea 100644 --- a/apps/renderer/src/lib/immersive-translate.ts +++ b/apps/renderer/src/lib/immersive-translate.ts @@ -53,7 +53,7 @@ export function immersiveTranslate({ return } - if (html.childNodes.length === 1 && html.childNodes[0].nodeType === Node.TEXT_NODE) { + if (html.childNodes.length === 1 && html.childNodes[0]?.nodeType === Node.TEXT_NODE) { const textNode = html.childNodes[0] as Text if (!textNode.textContent) { return diff --git a/apps/renderer/src/lib/native-menu.ts b/apps/renderer/src/lib/native-menu.ts index c922a9fa9a..eff2b946bb 100644 --- a/apps/renderer/src/lib/native-menu.ts +++ b/apps/renderer/src/lib/native-menu.ts @@ -42,7 +42,7 @@ const getMenuItemByPath = (items: ElectronMenuItem[], path: number[]): ElectronM for (const index of path) { if (!currentItems || index >= currentItems.length) return null - currentItem = currentItems[index] + currentItem = currentItems[index]! if (currentItem.submenu && Array.isArray(currentItem.submenu)) { currentItems = currentItem.submenu diff --git a/apps/renderer/src/lib/translate.ts b/apps/renderer/src/lib/translate.ts index be83987ebf..bb303b4ec3 100644 --- a/apps/renderer/src/lib/translate.ts +++ b/apps/renderer/src/lib/translate.ts @@ -74,7 +74,7 @@ export async function translate({ if (!language) { return null } - let fields = language && view !== undefined ? views[view!].translation.split(",") : [] + let fields = language && view !== undefined ? views[view!]!.translation.split(",") : [] if (extraFields) { fields = [...fields, ...extraFields] } diff --git a/apps/renderer/src/lib/utils.ts b/apps/renderer/src/lib/utils.ts index 7a4196c72c..4171ded3c2 100644 --- a/apps/renderer/src/lib/utils.ts +++ b/apps/renderer/src/lib/utils.ts @@ -84,20 +84,20 @@ export const getLevelMultiplier = (level: number) => { if (!serverConfigs) { return 1 } - const level1Range = serverConfigs?.LEVEL_PERCENTAGES[3] - serverConfigs?.LEVEL_PERCENTAGES[2] + const level1Range = serverConfigs?.LEVEL_PERCENTAGES[3]! - serverConfigs?.LEVEL_PERCENTAGES[2]! const percentageIndex = serverConfigs.LEVEL_PERCENTAGES.length - level let levelCurrentRange if (percentageIndex - 1 < 0) { levelCurrentRange = serverConfigs?.LEVEL_PERCENTAGES[percentageIndex] } else { levelCurrentRange = - serverConfigs?.LEVEL_PERCENTAGES[percentageIndex] - - serverConfigs?.LEVEL_PERCENTAGES[percentageIndex - 1] + serverConfigs?.LEVEL_PERCENTAGES[percentageIndex]! - + serverConfigs?.LEVEL_PERCENTAGES[percentageIndex - 1]! } const rangeMultiplier = levelCurrentRange / level1Range const poolMultiplier = - serverConfigs?.DAILY_POWER_PERCENTAGES[level] / serverConfigs?.DAILY_POWER_PERCENTAGES[1] + serverConfigs?.DAILY_POWER_PERCENTAGES[level]! / serverConfigs?.DAILY_POWER_PERCENTAGES[1]! return (poolMultiplier / rangeMultiplier).toFixed(0) } diff --git a/apps/renderer/src/modules/action/feed-filter.tsx b/apps/renderer/src/modules/action/feed-filter.tsx index 1184657159..35f458f8c4 100644 --- a/apps/renderer/src/modules/action/feed-filter.tsx +++ b/apps/renderer/src/modules/action/feed-filter.tsx @@ -110,7 +110,7 @@ export const FeedFilter = ({ index }: { index: number }) => { if (!data.condition[orConditionIdx]) { data.condition[orConditionIdx] = [{}] } - data.condition[orConditionIdx][conditionIdx][key] = value + data.condition[orConditionIdx][conditionIdx]![key] = value }) } const type = @@ -174,15 +174,15 @@ export const FeedFilter = ({ index }: { index: number }) => { disabled={disabled} onAnd={() => { onChange((data) => { - data.condition[orConditionIdx].push({}) + data.condition[orConditionIdx]!.push({}) }) }} onDelete={() => { onChange((data) => { - if (data.condition[orConditionIdx].length === 1) { + if (data.condition[orConditionIdx]!.length === 1) { data.condition.splice(orConditionIdx, 1) } else { - data.condition[orConditionIdx].splice(conditionIdx, 1) + data.condition[orConditionIdx]!.splice(conditionIdx, 1) } }) }} diff --git a/apps/renderer/src/modules/action/target-action-list.tsx b/apps/renderer/src/modules/action/target-action-list.tsx index 04fccffc50..ac40426987 100644 --- a/apps/renderer/src/modules/action/target-action-list.tsx +++ b/apps/renderer/src/modules/action/target-action-list.tsx @@ -207,7 +207,7 @@ export const TargetActionList = ({ index }: { index: number }) => { {rewriteRules?.map((rule, rewriteIdx) => { const change = (key: string, value: string) => { onChange((data) => { - data.result.rewriteRules![rewriteIdx][key] = value + data.result.rewriteRules![rewriteIdx]![key] = value }) } return ( diff --git a/apps/renderer/src/modules/app-layout/entry-column/desktop.tsx b/apps/renderer/src/modules/app-layout/entry-column/desktop.tsx index bb08b41315..7e92b45ed6 100644 --- a/apps/renderer/src/modules/app-layout/entry-column/desktop.tsx +++ b/apps/renderer/src/modules/app-layout/entry-column/desktop.tsx @@ -23,7 +23,7 @@ export function CenterColumnDesktop() { const settingWideMode = useRealInWideMode() const entryColWidth = useMemo(() => getUISettings().entryColWidth, []) const { view } = useRouteParams() - const inWideMode = (view ? views[view].wideMode : false) || settingWideMode + const inWideMode = (view ? views[view]!.wideMode : false) || settingWideMode const feedColumnWidth = useUISettingKey("feedColWidth") const { position, separatorProps, isDragging, separatorCursor } = useResizable({ axis: "x", diff --git a/apps/renderer/src/modules/app-layout/entry-content/desktop.tsx b/apps/renderer/src/modules/app-layout/entry-content/desktop.tsx index d8032444d2..104e46c19f 100644 --- a/apps/renderer/src/modules/app-layout/entry-content/desktop.tsx +++ b/apps/renderer/src/modules/app-layout/entry-content/desktop.tsx @@ -26,7 +26,7 @@ export const RightContentDesktop = () => { const settingWideMode = useRealInWideMode() const realEntryId = entryId === ROUTE_ENTRY_PENDING ? "" : entryId - const showEntryContent = !(views[view].wideMode || (settingWideMode && !realEntryId)) + const showEntryContent = !(views[view]!.wideMode || (settingWideMode && !realEntryId)) const wideMode = !!(settingWideMode && realEntryId) const feedColumnTempShow = useFeedColumnTempShow() const feedColumnShow = useFeedColumnShow() diff --git a/apps/renderer/src/modules/app-layout/feed-column/components/PodcastButton.tsx b/apps/renderer/src/modules/app-layout/feed-column/components/PodcastButton.tsx index 59a73bfdbe..21a1c5eb5c 100644 --- a/apps/renderer/src/modules/app-layout/feed-column/components/PodcastButton.tsx +++ b/apps/renderer/src/modules/app-layout/feed-column/components/PodcastButton.tsx @@ -109,13 +109,13 @@ const PlaybackRateButton = () => { const handleClick = () => { const nextIndex = (currentIndex + 1) % rates.length setCurrentIndex(nextIndex) - AudioPlayer.setPlaybackRate(rates[nextIndex]) + AudioPlayer.setPlaybackRate(rates[nextIndex]!) } return ( ) diff --git a/apps/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx b/apps/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx index f817e18016..da1d452182 100644 --- a/apps/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx +++ b/apps/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx @@ -123,7 +123,7 @@ const ViewTabs = ({ onViewChange }: { onViewChange?: (view: number) => void }) = {showCount && ( - {unreadByView[item.view] > 99 ? "99+" : unreadByView[item.view] || "0"} + {unreadByView[item.view]! > 99 ? "99+" : unreadByView[item.view] || "0"} )}
diff --git a/apps/renderer/src/modules/auth/Form.tsx b/apps/renderer/src/modules/auth/Form.tsx index 89e1f999ef..1a5d02738e 100644 --- a/apps/renderer/src/modules/auth/Form.tsx +++ b/apps/renderer/src/modules/auth/Form.tsx @@ -168,7 +168,7 @@ function RegisterForm() { return signUp.email({ email: values.email, password: values.password, - name: values.email.split("@")[0], + name: values.email.split("@")[0]!, callbackURL: "/", fetchOptions: { onSuccess() { diff --git a/apps/renderer/src/modules/command/commands/integration.tsx b/apps/renderer/src/modules/command/commands/integration.tsx index a42806185a..ae61ec6366 100644 --- a/apps/renderer/src/modules/command/commands/integration.tsx +++ b/apps/renderer/src/modules/command/commands/integration.tsx @@ -240,7 +240,7 @@ const getEntryContentAsMarkdown = async (entry: FlatEntryModel) => { const isReadabilityReady = getReadabilityStatus()[entry.entries.id] === ReadabilityStatus.SUCCESS const content = (isReadabilityReady - ? getReadabilityContent()[entry.entries.id].content + ? getReadabilityContent()[entry.entries.id]!.content : entry.entries.content) || "" const [toMarkdown, toMdast, gfmTableToMarkdown] = await Promise.all([ import("mdast-util-to-markdown").then((m) => m.toMarkdown), diff --git a/apps/renderer/src/modules/discover/DiscoverFeedForm.tsx b/apps/renderer/src/modules/discover/DiscoverFeedForm.tsx index 023547b780..8e97e9d4b3 100644 --- a/apps/renderer/src/modules/discover/DiscoverFeedForm.tsx +++ b/apps/renderer/src/modules/discover/DiscoverFeedForm.tsx @@ -158,7 +158,7 @@ export const DiscoverFeedForm = ({ const ret = {} if (!route.parameters) return ret for (const key in route.parameters) { - const params = normalizeRSSHubParameters(route.parameters[key]) + const params = normalizeRSSHubParameters(route.parameters[key]!) if (!params) continue ret[key] = params.default } @@ -218,7 +218,7 @@ export const DiscoverFeedForm = ({ toast.error(err.message) const idx = keys.findIndex((item) => item.name === err.param) - form.setFocus(keys[idx === 0 ? 0 : idx - 1].name, { + form.setFocus(keys[idx === 0 ? 0 : idx - 1]!.name, { shouldSelect: true, }) } @@ -249,7 +249,7 @@ export const DiscoverFeedForm = ({ )}
{keys.map((keyItem) => { - const parameters = normalizeRSSHubParameters(route.parameters?.[keyItem.name]) + const parameters = normalizeRSSHubParameters(route.parameters?.[keyItem.name]!) const formRegister = form.register(keyItem.name) diff --git a/apps/renderer/src/modules/discover/form.tsx b/apps/renderer/src/modules/discover/form.tsx index 242813efdb..b77a670fde 100644 --- a/apps/renderer/src/modules/discover/form.tsx +++ b/apps/renderer/src/modules/discover/form.tsx @@ -67,7 +67,7 @@ const info: Record< type DiscoverSearchData = Awaited>["data"] export function DiscoverForm({ type = "search" }: { type?: string }) { - const { prefix, default: defaultValue } = info[type] + const { prefix, default: defaultValue } = info[type]! const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { @@ -99,7 +99,7 @@ export function DiscoverForm({ type = "search" }: { type?: string }) { const { present, dismissAll } = useModalStack() function onSubmit(values: z.infer) { - if (info[type].showModal) { + if (info[type]!.showModal) { const defaultView = getSidebarActiveView() as FeedViewType present({ title: t("feed_form.add_feed"), @@ -128,7 +128,7 @@ export function DiscoverForm({ type = "search" }: { type?: string }) { } const isValidPrefix = prefix.find((p) => trimmedKeyword.startsWith(p)) if (!isValidPrefix) { - form.setValue("keyword", prefix[0]) + form.setValue("keyword", prefix[0]!) return } if (trimmedKeyword.startsWith(`${isValidPrefix}${isValidPrefix}`)) { @@ -208,7 +208,7 @@ export function DiscoverForm({ type = "search" }: { type?: string }) { name="keyword" render={({ field }) => ( - {t(info[type]?.label)} + {t(info[type]?.label!)} @@ -254,7 +254,7 @@ export function DiscoverForm({ type = "search" }: { type?: string }) { )}
diff --git a/apps/renderer/src/modules/discover/recommendations-card.tsx b/apps/renderer/src/modules/discover/recommendations-card.tsx index 6c7c748c0e..a6177b37cd 100644 --- a/apps/renderer/src/modules/discover/recommendations-card.tsx +++ b/apps/renderer/src/modules/discover/recommendations-card.tsx @@ -29,7 +29,7 @@ export const RecommendationCard: FC = memo( const maintainers = new Set() const categories = new Set() for (const route in data.routes) { - const routeData = data.routes[route] + const routeData = data.routes[route]! if (routeData.maintainers) { routeData.maintainers.forEach((m) => maintainers.add(m)) } @@ -89,17 +89,17 @@ export const RecommendationCard: FC = memo( content: () => ( ), icon: ( ), - title: `${data.name} - ${data.routes[route].name}`, + title: `${data.name} - ${data.routes[route]!.name}`, }) }} > - {data.routes[route].name} + {data.routes[route]!.name} ))} diff --git a/apps/renderer/src/modules/discover/rss3-form.tsx b/apps/renderer/src/modules/discover/rss3-form.tsx index 783e1c959b..3e4352061b 100644 --- a/apps/renderer/src/modules/discover/rss3-form.tsx +++ b/apps/renderer/src/modules/discover/rss3-form.tsx @@ -29,11 +29,11 @@ export function DiscoverRSS3() { return ( <> - {data?.rss3.routes && ( + {data?.rss3!.routes && (
diff --git a/apps/renderer/src/modules/discover/transform-form.tsx b/apps/renderer/src/modules/discover/transform-form.tsx index 6948ab371d..8a32982a15 100644 --- a/apps/renderer/src/modules/discover/transform-form.tsx +++ b/apps/renderer/src/modules/discover/transform-form.tsx @@ -67,11 +67,11 @@ export function DiscoverTransform() { return ( <> - {data?.rsshub.routes && ( + {data?.rsshub!.routes && (
- {data?.follow.routes && ( + {data?.follow!.routes && (
diff --git a/apps/renderer/src/modules/entry-column/Items/picture-item-stateless.tsx b/apps/renderer/src/modules/entry-column/Items/picture-item-stateless.tsx index bf64b433ba..0d47d75d91 100644 --- a/apps/renderer/src/modules/entry-column/Items/picture-item-stateless.tsx +++ b/apps/renderer/src/modules/entry-column/Items/picture-item-stateless.tsx @@ -17,7 +17,7 @@ export function PictureItemStateLess({ entry, feed }: EntryItemStatelessProps) {
{entry.media?.[0] ? ( diff --git a/apps/renderer/src/modules/entry-column/Items/picture-item.tsx b/apps/renderer/src/modules/entry-column/Items/picture-item.tsx index ff535b1b22..9957d46878 100644 --- a/apps/renderer/src/modules/entry-column/Items/picture-item.tsx +++ b/apps/renderer/src/modules/entry-column/Items/picture-item.tsx @@ -127,7 +127,7 @@ export const PictureWaterFallItem = memo(function PictureWaterFallItem({ }} > {media && media.length > 0 ? ( - + ({ width: itemWidth, - height: itemWidth / stableRadioCtx, + height: itemWidth / stableRadioCtx!, }), [itemWidth, stableRadioCtx], ) diff --git a/apps/renderer/src/modules/entry-column/Items/video-item.tsx b/apps/renderer/src/modules/entry-column/Items/video-item.tsx index 7cef35c098..53f5a1593a 100644 --- a/apps/renderer/src/modules/entry-column/Items/video-item.tsx +++ b/apps/renderer/src/modules/entry-column/Items/video-item.tsx @@ -111,10 +111,10 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP /> ) : entry.entries.media ? ( scrollRef, - estimateSize: (i) => columns[i], + estimateSize: (i) => columns[i]!, overscan: 5, initialOffset: offsetCache.get(columnCacheKey) ?? 0, initialMeasurementsCache: measurementsCache.get(columnCacheKey) ?? [], @@ -205,7 +205,7 @@ const VirtualGridImpl: FC< const rowVirtualizer = useVirtualizer({ count: rows.length + 1, estimateSize: () => { - return columns[0] / ratioMap[view] + 58 + return columns[0]! / ratioMap[view] + 58 }, overscan: 5, gap: 8, @@ -309,7 +309,7 @@ const VirtualGridImpl: FC< > {ready && ( )} diff --git a/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts b/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts index 6b1498ac3d..546273fee2 100644 --- a/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts +++ b/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts @@ -137,7 +137,7 @@ export const useEntriesByView = ({ const groupByDate = useGeneralSettingKey("groupByDate") const groupedCounts: number[] | undefined = useMemo(() => { - if (views[view].gridMode) { + if (views[view]!.gridMode) { return } if (!groupByDate) { @@ -184,8 +184,11 @@ function sortEntriesIdByEntryPublishedAt(entries: string[]) { const entriesId2Map = entryActions.getFlattenMapEntries() return entries .slice() - .sort((a, b) => - entriesId2Map[b]?.entries.publishedAt.localeCompare(entriesId2Map[a]?.entries.publishedAt), + .sort( + (a, b) => + entriesId2Map[b]?.entries.publishedAt.localeCompare( + entriesId2Map[a]?.entries.publishedAt!, + ) || 0, ) } @@ -203,8 +206,10 @@ function sortEntriesIdByEntryInsertedAt(entries: string[]) { const entriesId2Map = entryActions.getFlattenMapEntries() return entries .slice() - .sort((a, b) => - entriesId2Map[b]?.entries.insertedAt.localeCompare(entriesId2Map[a]?.entries.insertedAt), + .sort( + (a, b) => + entriesId2Map[b]?.entries.insertedAt.localeCompare(entriesId2Map[a]?.entries.insertedAt!) || + 0, ) } @@ -217,7 +222,7 @@ const useFetchEntryContentByStream = (remoteEntryIds?: string[]) => { const nextIds = [] as string[] if (onlyNoStored) { for (const id of remoteEntryIds) { - const entry = getEntry(id) + const entry = getEntry(id)! if (entry.entries.content) { continue } @@ -253,8 +258,8 @@ const useFetchEntryContentByStream = (remoteEntryIds?: string[]) => { // Process all complete lines for (let i = 0; i < lines.length - 1; i++) { - if (lines[i].trim()) { - const json = JSON.parse(lines[i]) + if (lines[i]!.trim()) { + const json = JSON.parse(lines[i]!) // Handle each JSON line here entryActions.updateEntryContent(json.id, json.content) } diff --git a/apps/renderer/src/modules/entry-column/hooks/useEntryMarkReadHandler.tsx b/apps/renderer/src/modules/entry-column/hooks/useEntryMarkReadHandler.tsx index 47be0cac00..7b068b412a 100644 --- a/apps/renderer/src/modules/entry-column/hooks/useEntryMarkReadHandler.tsx +++ b/apps/renderer/src/modules/entry-column/hooks/useEntryMarkReadHandler.tsx @@ -29,7 +29,7 @@ export const useEntryMarkReadHandler = (entriesIds: string[]) => { ) return useMemo(() => { - if (views[feedView].wideMode && renderAsRead) { + if (views[feedView]!.wideMode && renderAsRead) { return handleRenderAsRead } diff --git a/apps/renderer/src/modules/entry-column/index.tsx b/apps/renderer/src/modules/entry-column/index.tsx index 1368fa364b..7379c5f45f 100644 --- a/apps/renderer/src/modules/entry-column/index.tsx +++ b/apps/renderer/src/modules/entry-column/index.tsx @@ -92,7 +92,7 @@ function EntryColumnImpl() { // Determine if the archived button should be shown const showArchivedButton = commonConditions && feed?.type === "feed" - const hasNoEntries = entries.data?.pages?.[0].data?.length === 0 && !entries.isLoading + const hasNoEntries = entries.data?.pages?.[0]?.data?.length === 0 && !entries.isLoading // Determine if archived entries should be loaded const shouldLoadArchivedEntries = @@ -140,7 +140,7 @@ function EntryColumnImpl() { } if (!renderAsRead) return - if (!views[view].wideMode) { + if (!views[view]!.wideMode) { return } // For gird, render as mark read logic @@ -156,7 +156,7 @@ function EntryColumnImpl() { }, [entries]) const isMobile = useMobile() - const ListComponent = views[view].gridMode ? EntryColumnGrid : EntryList + const ListComponent = views[view]!.gridMode ? EntryColumnGrid : EntryList return (
+
{SkeletonItem} {SkeletonItem} {SkeletonItem} diff --git a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx index fc5402b283..112f40e8ea 100644 --- a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx +++ b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx @@ -85,7 +85,7 @@ export const EntryListHeader: FC<{ )} onClick={stopPropagation} > - {views[view].wideMode && entryId && entryId !== ROUTE_ENTRY_PENDING && ( + {views[view]!.wideMode && entryId && entryId !== ROUTE_ENTRY_PENDING && ( <> @@ -93,7 +93,7 @@ export const EntryListHeader: FC<{ )} - {!views[view].wideMode && } + {!views[view]!.wideMode && } {view === FeedViewType.SocialMedia && } {view === FeedViewType.Pictures && } {view === FeedViewType.Pictures && } diff --git a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx index 50cc826327..329b669cc1 100644 --- a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx +++ b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx @@ -149,7 +149,7 @@ export const SwitchToMasonryButton = () => { step={1} defaultValue={[masonryColumnValue]} onValueCommit={(value) => { - setMasonryColumnValue(value[0]) + setMasonryColumnValue(value[0]!) }} />
diff --git a/apps/renderer/src/modules/entry-column/layouts/TimelineTabs.tsx b/apps/renderer/src/modules/entry-column/layouts/TimelineTabs.tsx index 642a3a9353..5ec7c92173 100644 --- a/apps/renderer/src/modules/entry-column/layouts/TimelineTabs.tsx +++ b/apps/renderer/src/modules/entry-column/layouts/TimelineTabs.tsx @@ -12,13 +12,15 @@ export const TimelineTabs = () => { const listsData = useSubscriptionStore( useCallback( - (state) => state.feedIdByView[view].map((id) => state.data[id]).filter((s) => "listId" in s), + (state) => + state.feedIdByView[view].map((id) => state.data[id]).filter((s) => s && "listId" in s), [view], ), ) const inboxData = useSubscriptionStore( useCallback( - (state) => state.feedIdByView[view].map((id) => state.data[id]).filter((s) => "inboxId" in s), + (state) => + state.feedIdByView[view].map((id) => state.data[id]).filter((s) => s && "inboxId" in s), [view], ), ) @@ -27,7 +29,7 @@ export const TimelineTabs = () => { (state) => { const categoryNames = new Set() for (const subId of state.feedIdByView[view]) { - const sub = state.data[subId] + const sub = state.data[subId]! if (sub.category) { categoryNames.add(sub.category) } @@ -63,16 +65,18 @@ export const TimelineTabs = () => { Yours - {listsData.map((s) => ( - - - - ))} + {listsData + .filter((s) => !!s) + .map((s) => ( + + + + ))} {categoriesData.map((s) => ( { ))} - {inboxData.map((s) => ( - - - - ))} + {inboxData + .filter((s) => !!s) + .map((s) => ( + + + + ))} ) diff --git a/apps/renderer/src/modules/entry-column/list.tsx b/apps/renderer/src/modules/entry-column/list.tsx index 3b61d4b764..cbc6e2aaaa 100644 --- a/apps/renderer/src/modules/entry-column/list.tsx +++ b/apps/renderer/src/modules/entry-column/list.tsx @@ -110,7 +110,7 @@ export const EntryList: FC = memo( groupCounts ? groupCounts.reduce( (acc, count, index) => { - acc[index + 1] = acc[index] + count + acc[index + 1] = acc[index]! + count return acc }, [0], @@ -263,7 +263,7 @@ export const EntryList: FC = memo( } >
@@ -277,7 +277,7 @@ export const EntryList: FC = memo( ref={rowVirtualizer.measureElement} data-index={virtualRow.index} > - +
) diff --git a/apps/renderer/src/modules/entry-column/templates/list-item-template.tsx b/apps/renderer/src/modules/entry-column/templates/list-item-template.tsx index bac629e3ec..e571747396 100644 --- a/apps/renderer/src/modules/entry-column/templates/list-item-template.tsx +++ b/apps/renderer/src/modules/entry-column/templates/list-item-template.tsx @@ -83,7 +83,7 @@ export function ListItem({ const related = feed || inbox - const hasAudio = entry.entries?.attachments?.[0].url + const hasAudio = entry.entries?.attachments?.[0]!.url const hasMedia = entry.entries?.media?.[0]?.url const marginWidth = 8 * (isMobile ? 1.125 : 1) @@ -180,9 +180,9 @@ export function ListItem({ {withAudio && !!hasAudio && ( diff --git a/apps/renderer/src/modules/entry-column/wrapper.mobile.tsx b/apps/renderer/src/modules/entry-column/wrapper.mobile.tsx index 7375267731..c14ca4e3b2 100644 --- a/apps/renderer/src/modules/entry-column/wrapper.mobile.tsx +++ b/apps/renderer/src/modules/entry-column/wrapper.mobile.tsx @@ -19,7 +19,10 @@ export const EntryColumnWrapper = forwardRef(null) return (
-
+
({ width: itemWidth, - height: itemWidth / stableRadioCtx, + height: itemWidth / stableRadioCtx!, }), [itemWidth, stableRadioCtx], ) diff --git a/apps/renderer/src/modules/entry-content/header.desktop.tsx b/apps/renderer/src/modules/entry-content/header.desktop.tsx index c4354f70b3..02150029fa 100644 --- a/apps/renderer/src/modules/entry-content/header.desktop.tsx +++ b/apps/renderer/src/modules/entry-content/header.desktop.tsx @@ -39,7 +39,7 @@ function EntryHeaderImpl({ view, entryId, className, compact }: EntryHeaderProps className={cn( "absolute left-5 top-0 flex h-full items-center gap-2 text-[13px] leading-none text-zinc-500 zen-mode-macos:left-12", "visible z-[11]", - views[view].wideMode && "static", + views[view]!.wideMode && "static", shouldShowMeta && "hidden", )} > diff --git a/apps/renderer/src/modules/entry-content/index.shared.tsx b/apps/renderer/src/modules/entry-content/index.shared.tsx index c9ad6abab2..9a10680b3d 100644 --- a/apps/renderer/src/modules/entry-content/index.shared.tsx +++ b/apps/renderer/src/modules/entry-content/index.shared.tsx @@ -299,7 +299,7 @@ const BackTopIndicator: Component = memo(({ className }) => {
} - icon2={} + icon2={} status={readPercent === 0 ? "init" : "done"} /> {readPercent}% @@ -311,7 +311,7 @@ const BackTopIndicator: Component = memo(({ className }) => { }} className={cn( "mt-1 flex flex-nowrap items-center gap-2 opacity-50 transition-all duration-500 hover:opacity-100", - readPercent > 10 ? "" : "pointer-events-none opacity-0", + readPercent! > 10 ? "" : "pointer-events-none opacity-0", )} > diff --git a/apps/renderer/src/modules/feed-column/category.tsx b/apps/renderer/src/modules/feed-column/category.tsx index c767fb1f2c..61cd5d3859 100644 --- a/apps/renderer/src/modules/feed-column/category.tsx +++ b/apps/renderer/src/modules/feed-column/category.tsx @@ -68,7 +68,7 @@ function FeedCategoryImpl({ data: ids, view, categoryOpenStateData }: FeedCatego const navigate = useNavigateEntry() - const subscription = useSubscriptionByFeedId(ids[0]) + const subscription = useSubscriptionByFeedId(ids[0]!)! const autoGroup = useGeneralSettingSelector((state) => state.autoGroup) const folderName = subscription?.category || (autoGroup ? subscription.defaultCategory : subscription.feedId) @@ -240,7 +240,7 @@ function FeedCategoryImpl({ data: ids, view, categoryOpenStateData }: FeedCatego submenu: views .filter((v) => v.view !== view) .map((v) => ({ - label: t(v.name), + label: t(v.name as any), type: "text" as const, shortcut: (v.view + 1).toString(), icon: v.icon, diff --git a/apps/renderer/src/modules/feed-column/index.tsx b/apps/renderer/src/modules/feed-column/index.tsx index d1e8eb75bb..3675969420 100644 --- a/apps/renderer/src/modules/feed-column/index.tsx +++ b/apps/renderer/src/modules/feed-column/index.tsx @@ -217,7 +217,7 @@ const ViewSwitchButton: FC<{ - {unreadByView[index] > 99 ? 99+ : unreadByView[index]} + {unreadByView[index]! > 99 ? 99+ : unreadByView[index]}
) : ( { const { t } = useTranslation() - const subscription = useSubscriptionByFeedId(feedId) + const subscription = useSubscriptionByFeedId(feedId)! const navigate = useNavigateEntry() const feed = useFeedById(feedId, (feed) => { return { @@ -244,7 +244,7 @@ const ListItemImpl: Component<{ const listUnread = useFeedUnreadStore((state) => state.data[listId] || 0) const [isContextMenuOpen, setIsContextMenuOpen] = useState(false) - const subscription = useSubscriptionByFeedId(listId) + const subscription = useSubscriptionByFeedId(listId)! const navigate = useNavigateEntry() const handleNavigate = useCallback( (e: React.MouseEvent) => { diff --git a/apps/renderer/src/modules/feed-column/list.desktop.tsx b/apps/renderer/src/modules/feed-column/list.desktop.tsx index 505b274786..a8c40f5445 100644 --- a/apps/renderer/src/modules/feed-column/list.desktop.tsx +++ b/apps/renderer/src/modules/feed-column/list.desktop.tsx @@ -174,7 +174,7 @@ const FeedListImpl = forwardRef { // with intersection, we need to update selected ids as between // otherwise, we need to add between to selected ids @@ -199,7 +199,7 @@ const FeedListImpl = forwardRef { - scrollerRef.current?.scrollBy(e.direction[0] * 10, e.direction[1] * 10) + scrollerRef.current?.scrollBy(e.direction[0]! * 10, e.direction[1]! * 10) }} /> diff --git a/apps/renderer/src/modules/feed-column/list.mobile.tsx b/apps/renderer/src/modules/feed-column/list.mobile.tsx index 4e9583d878..d87b5ad196 100644 --- a/apps/renderer/src/modules/feed-column/list.mobile.tsx +++ b/apps/renderer/src/modules/feed-column/list.mobile.tsx @@ -94,11 +94,11 @@ const FeedListImpl = ({ className, view }: { className?: string; view: number }) }} className={cn(feedColumnStyles.item, "px-2.5 py-[2px]")} > - {views[view].icon} + {views[view]!.icon} {t("words.all", { ns: "common" })} {t("space", { ns: "common" })} - {t(views[view].name)} + {t(views[view]!.name as any)} { const groupFolder = {} as Record - for (const subscription of data) { + for (const subscription of data.filter((s) => !!s)) { const category = subscription.category || (autoGroup ? subscription.defaultCategory : subscription.feedId) @@ -66,11 +66,11 @@ export const useListsGroupedData = (view: FeedViewType) => { return useMemo(() => { if (!data || data.length === 0) return {} - const lists = data.filter((s) => "listId" in s) + const lists = data.filter((s) => s && "listId" in s) const groupFolder = {} as Record - for (const subscription of lists) { + for (const subscription of lists.filter((s) => !!s)) { groupFolder[subscription.feedId] = [subscription.feedId] } @@ -86,11 +86,11 @@ export const useInboxesGroupedData = (view: FeedViewType) => { return useMemo(() => { if (!data || data.length === 0) return {} - const inboxes = data.filter((s) => "inboxId" in s) + const inboxes = data.filter((s) => s && "inboxId" in s) const groupFolder = {} as Record - for (const subscription of inboxes) { + for (const subscription of inboxes.filter((s) => !!s)) { if (!subscription.inboxId) continue groupFolder[subscription.inboxId] = [subscription.inboxId] } @@ -127,7 +127,7 @@ export const ListHeader = ({ view }: { view: number }) => { let unread = 0 for (const category in feedsData) { - for (const feedId of feedsData[category]) { + for (const feedId of feedsData[category]!) { unread += state.data[feedId] || 0 } } @@ -155,7 +155,7 @@ export const ListHeader = ({ view }: { view: number }) => { } }} > - {view !== undefined && t(views[view].name)} + {view !== undefined && t(views[view]!.name as any)}
diff --git a/apps/renderer/src/modules/feed-column/sort-by/SortByAlphabeticalList.tsx b/apps/renderer/src/modules/feed-column/sort-by/SortByAlphabeticalList.tsx index a39f3c5daf..f1eff0a1f9 100644 --- a/apps/renderer/src/modules/feed-column/sort-by/SortByAlphabeticalList.tsx +++ b/apps/renderer/src/modules/feed-column/sort-by/SortByAlphabeticalList.tsx @@ -20,7 +20,7 @@ export const SortByAlphabeticalFeedList = ({ (state) => { const map = {} as Record for (const categoryName in data) { - const feedId = data[categoryName][0] + const feedId = data[categoryName]![0] if (!feedId) { continue } @@ -42,7 +42,7 @@ export const SortByAlphabeticalFeedList = ({ (state) => { const map = {} as Record for (const categoryName in data) { - const feedId = data[categoryName][0] + const feedId = data[categoryName]![0] if (!feedId) { continue @@ -52,7 +52,7 @@ export const SortByAlphabeticalFeedList = ({ continue } const hascategoryNameNotDefault = !!feedId2CategoryMap[feedId] - const isSingle = data[categoryName].length === 1 + const isSingle = data[categoryName]!.length === 1 if (!isSingle || hascategoryNameNotDefault) { map[categoryName] = categoryName } else { @@ -84,7 +84,7 @@ export const SortByAlphabeticalFeedList = ({ {sortedByAlphabetical.map((category) => ( diff --git a/apps/renderer/src/modules/feed-column/sort-by/SortByUnreadList.tsx b/apps/renderer/src/modules/feed-column/sort-by/SortByUnreadList.tsx index b5ce07b6b1..85107bd6d4 100644 --- a/apps/renderer/src/modules/feed-column/sort-by/SortByUnreadList.tsx +++ b/apps/renderer/src/modules/feed-column/sort-by/SortByUnreadList.tsx @@ -16,7 +16,7 @@ export const SortByUnreadFeedList = ({ view, data, categoryOpenStateData }: Feed const folderUnread = {} as Record // Calc total unread count for each folder for (const category in data) { - folderUnread[category] = data[category].reduce( + folderUnread[category] = data[category]!.reduce( (acc, cur) => (state.data[cur] || 0) + acc, 0, ) @@ -24,9 +24,9 @@ export const SortByUnreadFeedList = ({ view, data, categoryOpenStateData }: Feed // Sort by unread count Object.keys(folderUnread) - .sort((a, b) => folderUnread[b] - folderUnread[a]) + .sort((a, b) => folderUnread[b]! - folderUnread[a]!) .forEach((key) => { - sortedList.push([key, data[key]]) + sortedList.push([key, data[key]!]) }) if (!isDesc) { diff --git a/apps/renderer/src/modules/feed/feed-icon.tsx b/apps/renderer/src/modules/feed/feed-icon.tsx index f66ed221fc..ec835bb7d0 100644 --- a/apps/renderer/src/modules/feed/feed-icon.tsx +++ b/apps/renderer/src/modules/feed/feed-icon.tsx @@ -165,10 +165,10 @@ export function FeedIcon({ const [src] = getFeedIconSrc({ siteUrl, }) - finalSrc = src + finalSrc = src! - const isIconLoaded = isIconLoadedSet.has(src) - isIconLoadedSet.add(src) + const isIconLoaded = isIconLoadedSet.has(src!) + isIconLoadedSet.add(src!) ImageElement = ( @@ -207,7 +207,7 @@ export function FeedIcon({ height: size * 2, }, }) - finalSrc = src + finalSrc = src! ImageElement = ( ) diff --git a/apps/renderer/src/modules/feed/view-select-content.tsx b/apps/renderer/src/modules/feed/view-select-content.tsx index 55165d1f62..7bb14983fa 100644 --- a/apps/renderer/src/modules/feed/view-select-content.tsx +++ b/apps/renderer/src/modules/feed/view-select-content.tsx @@ -12,7 +12,7 @@ export const ViewSelectContent = () => {
{view.icon} - {t(view.name)} + {t(view.name as any)}
))} diff --git a/apps/renderer/src/modules/new-user-guide/guide-modal-content.tsx b/apps/renderer/src/modules/new-user-guide/guide-modal-content.tsx index eadee56502..52da542523 100644 --- a/apps/renderer/src/modules/new-user-guide/guide-modal-content.tsx +++ b/apps/renderer/src/modules/new-user-guide/guide-modal-content.tsx @@ -189,17 +189,17 @@ export function GuideModalContent({ onClose }: { onClose: () => void }) { {!!title && (

- {typeof guideSteps[step - 1].icon === "string" ? ( - + {typeof guideSteps[step - 1]!.icon === "string" ? ( + ) : ( - guideSteps[step - 1].icon + guideSteps[step - 1]!.icon )} {title}

- {!!guideSteps[step - 1].description && ( + {!!guideSteps[step - 1]!.description && (
- {guideSteps[step - 1].description!} + {guideSteps[step - 1]!.description!}
)} @@ -208,7 +208,7 @@ export function GuideModalContent({ onClose }: { onClose: () => void }) { {status === "initial" ? ( ) : status === "active" ? ( - guideSteps[step - 1].content + guideSteps[step - 1]!.content ) : status === "complete" ? ( ) : null} diff --git a/apps/renderer/src/modules/player/corner-player.tsx b/apps/renderer/src/modules/player/corner-player.tsx index dcc27fa49d..1748769342 100644 --- a/apps/renderer/src/modules/player/corner-player.tsx +++ b/apps/renderer/src/modules/player/corner-player.tsx @@ -352,8 +352,8 @@ export const PlayerProgress = () => { value={[controlledCurrentTime]} onPointerDown={() => setIsDraggingProgress(true)} onPointerUp={() => setIsDraggingProgress(false)} - onValueChange={(value) => setControlledCurrentTime(value[0])} - onValueCommit={(value) => AudioPlayer.seek(value[0])} + onValueChange={(value) => setControlledCurrentTime(value[0]!)} + onValueCommit={(value) => AudioPlayer.seek(value[0]!)} > diff --git a/apps/renderer/src/modules/power/my-wallet-section/reward-description-modal.tsx b/apps/renderer/src/modules/power/my-wallet-section/reward-description-modal.tsx index 19637600b2..6186ba3107 100644 --- a/apps/renderer/src/modules/power/my-wallet-section/reward-description-modal.tsx +++ b/apps/renderer/src/modules/power/my-wallet-section/reward-description-modal.tsx @@ -53,7 +53,7 @@ export const useRewardDescriptionModal = () => { { from( serverConfigs.DAILY_POWER_SUPPLY * - serverConfigs?.DAILY_POWER_PERCENTAGES[level], + serverConfigs?.DAILY_POWER_PERCENTAGES[level]!, 18, )[0] } diff --git a/apps/renderer/src/modules/power/my-wallet-section/withdraw.tsx b/apps/renderer/src/modules/power/my-wallet-section/withdraw.tsx index cad4a4f37c..7485b57ee6 100644 --- a/apps/renderer/src/modules/power/my-wallet-section/withdraw.tsx +++ b/apps/renderer/src/modules/power/my-wallet-section/withdraw.tsx @@ -48,7 +48,7 @@ export const WithdrawButton = () => { const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => { const { t } = useTranslation("settings") const wallet = useWallet() - const cashablePowerTokenBigInt = [BigInt(wallet.data?.[0].cashablePowerToken || 0n), 18] as const + const cashablePowerTokenBigInt = [BigInt(wallet.data?.[0]!.cashablePowerToken || 0n), 18] as const const cashablePowerTokenNumber = toNumber(cashablePowerTokenBigInt) const formSchema = z.object({ @@ -119,8 +119,8 @@ const WithdrawModalContent = ({ dismiss }: { dismiss: () => void }) => { i18nKey="wallet.withdraw.availableBalance" components={{ Balance: ( - - {wallet.data?.[0].cashablePowerToken || "0"} + + {wallet.data?.[0]!.cashablePowerToken || "0"} ), }} diff --git a/apps/renderer/src/modules/profile/hooks.ts b/apps/renderer/src/modules/profile/hooks.ts index 7bac33b8e2..dae2f2928d 100644 --- a/apps/renderer/src/modules/profile/hooks.ts +++ b/apps/renderer/src/modules/profile/hooks.ts @@ -40,7 +40,7 @@ export const useUserSubscriptionsQuery = (userId: string | undefined) => { if (!groupFolder[subscription.category]) { groupFolder[subscription.category] = [] } - groupFolder[subscription.category].push(subscription) + groupFolder[subscription.category]!.push(subscription) } } diff --git a/apps/renderer/src/modules/profile/user-profile-modal.mobile.tsx b/apps/renderer/src/modules/profile/user-profile-modal.mobile.tsx index 49c42def1c..a7ada9d7a2 100644 --- a/apps/renderer/src/modules/profile/user-profile-modal.mobile.tsx +++ b/apps/renderer/src/modules/profile/user-profile-modal.mobile.tsx @@ -107,7 +107,7 @@ export const UserProfileModalContent: FC = ({ use ))} diff --git a/apps/renderer/src/modules/profile/user-profile-modal.shared.tsx b/apps/renderer/src/modules/profile/user-profile-modal.shared.tsx index 057afcf4ae..41ffdbb444 100644 --- a/apps/renderer/src/modules/profile/user-profile-modal.shared.tsx +++ b/apps/renderer/src/modules/profile/user-profile-modal.shared.tsx @@ -57,7 +57,7 @@ export const SubscriptionItems = ({ ))} diff --git a/apps/renderer/src/modules/renderer/components/TimeStamp.tsx b/apps/renderer/src/modules/renderer/components/TimeStamp.tsx index 7f39f3de61..13c781b978 100644 --- a/apps/renderer/src/modules/renderer/components/TimeStamp.tsx +++ b/apps/renderer/src/modules/renderer/components/TimeStamp.tsx @@ -10,7 +10,7 @@ export const TimeStamp = (props: { time: string }) => { const { entryId } = useContext(EntryInfoContext) const entry = useEntry(entryId) const mediaDuration = entry?.entries.attachments?.[0]?.duration_in_seconds - const src = entry?.entries?.attachments?.[0].url + const src = entry?.entries?.attachments?.[0]?.url if (!src) return {props.time} const seekTo = timeStringToSeconds(props.time) @@ -95,10 +95,10 @@ function timeStringToSeconds(time: string): number | null { if (timeParts.length === 2) { const [minutes, seconds] = timeParts - return minutes * 60 + seconds + return minutes! * 60 + seconds! } else if (timeParts.length === 3) { const [hours, minutes, seconds] = timeParts - return hours * 3600 + minutes * 60 + seconds + return hours! * 3600 + minutes! * 60 + seconds! } else { return null } diff --git a/apps/renderer/src/modules/settings/modal/layout.tsx b/apps/renderer/src/modules/settings/modal/layout.tsx index f96429b9cf..d49a9b646a 100644 --- a/apps/renderer/src/modules/settings/modal/layout.tsx +++ b/apps/renderer/src/modules/settings/modal/layout.tsx @@ -54,7 +54,7 @@ export function SettingModalLayout( if (initialTab) { setTab(initialTab) } else { - setTab(availableSettings[0].path) + setTab(availableSettings[0]!.path) } } }, [availableSettings]) diff --git a/apps/renderer/src/modules/settings/tabs/data-control.tsx b/apps/renderer/src/modules/settings/tabs/data-control.tsx index bdfde552d1..b0e73b6c7c 100644 --- a/apps/renderer/src/modules/settings/tabs/data-control.tsx +++ b/apps/renderer/src/modules/settings/tabs/data-control.tsx @@ -304,7 +304,7 @@ const AppCacheLimit = () => { }) const onChange = (value: number[]) => { - tipcClient?.limitCacheSize(value[0]) + tipcClient?.limitCacheSize(value[0]!) refetchCacheLimit() } diff --git a/apps/renderer/src/modules/settings/tabs/lists/index.tsx b/apps/renderer/src/modules/settings/tabs/lists/index.tsx index f3bc7f373f..2253be95e9 100644 --- a/apps/renderer/src/modules/settings/tabs/lists/index.tsx +++ b/apps/renderer/src/modules/settings/tabs/lists/index.tsx @@ -155,14 +155,14 @@ export const SettingLists = () => { - {views[row.view].icon} + {views[row.view]!.icon} - {t(views[row.view].name)} + {t(views[row.view]!.name as any)} diff --git a/apps/renderer/src/modules/settings/tabs/lists/modals.tsx b/apps/renderer/src/modules/settings/tabs/lists/modals.tsx index 90d1820123..9371d4de7f 100644 --- a/apps/renderer/src/modules/settings/tabs/lists/modals.tsx +++ b/apps/renderer/src/modules/settings/tabs/lists/modals.tsx @@ -63,7 +63,7 @@ export const ListCreationModalContent = ({ id }: { id?: string }) => { const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { - view: list?.view.toString() || views[0].view.toString(), + view: list?.view.toString() || views[0]?.view.toString(), fee: list?.fee || 0, title: list?.title || "", description: list?.description || "", @@ -96,7 +96,8 @@ export const ListCreationModalContent = ({ id }: { id?: string }) => { dismiss() if (!list) return - if (id) subscriptionActions.changeListView(id, views[list.view].view, views[values.view].view) + if (id) + subscriptionActions.changeListView(id, views[list.view]!.view, views[values.view].view) }, onError: createErrorToaster(id ? t("lists.edit.error") : t("lists.created.error")), }) diff --git a/apps/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx b/apps/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx index e84a7d637a..c0cfdeb433 100644 --- a/apps/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx +++ b/apps/renderer/src/modules/shared/ViewSelectorRadioGroup.tsx @@ -45,7 +45,7 @@ export const ViewSelectorRadioGroup = forwardRef< {cloneElement(view.icon, { className: `text-lg ${view.icon?.props?.className ?? ""}`, })} - {t(view.name)} + {t(view.name as any)}
))} diff --git a/apps/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx b/apps/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx index 5bf082a0bb..e9f194c7e2 100644 --- a/apps/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx +++ b/apps/renderer/src/pages/(main)/(layer)/(subview)/discover/index.tsx @@ -112,7 +112,7 @@ export function Component() { {currentTabs.map((tab) => (
- {createElement(TabComponent[tab.value] || TabComponent.default, { + {createElement(TabComponent[tab.value]! || TabComponent.default, { type: tab.value, })}
diff --git a/apps/renderer/src/providers/i18n-provider.tsx b/apps/renderer/src/providers/i18n-provider.tsx index 0b1697281d..d60e51a0a0 100644 --- a/apps/renderer/src/providers/i18n-provider.tsx +++ b/apps/renderer/src/providers/i18n-provider.tsx @@ -38,7 +38,7 @@ export const I18nProvider: FC = ({ children }) => { }) const userLang = languageDetector.detect() if (!userLang) return - const firstUserLang = Array.isArray(userLang) ? userLang[0] : userLang + const firstUserLang = Array.isArray(userLang) ? userLang[0]! : userLang if (currentSupportedLanguages.includes(firstUserLang)) { setGeneralSetting("language", firstUserLang) } diff --git a/apps/renderer/src/providers/wrapped-element-provider.tsx b/apps/renderer/src/providers/wrapped-element-provider.tsx index dafdec0437..b2b13c59b1 100644 --- a/apps/renderer/src/providers/wrapped-element-provider.tsx +++ b/apps/renderer/src/providers/wrapped-element-provider.tsx @@ -72,7 +72,7 @@ const ArticleElementResizeObserver = () => { setPosition({ x, y }) const observer = new ResizeObserver((entries) => { - const entry = entries[0] + const entry = entries[0]! const { height, width } = entry.contentRect const { x, y } = entry.target.getBoundingClientRect() @@ -117,7 +117,7 @@ const BoundingDetection: Component<{ const $el = ref.current const observer = new IntersectionObserver( (entries) => { - const entry = entries[0] + const entry = entries[0]! if (bounding === "start") startSetter(entry.isIntersecting) else endSetter(entry.isIntersecting) diff --git a/apps/renderer/src/store/action/hooks.ts b/apps/renderer/src/store/action/hooks.ts index 927d3ddc82..9a53dd63c6 100644 --- a/apps/renderer/src/store/action/hooks.ts +++ b/apps/renderer/src/store/action/hooks.ts @@ -12,7 +12,7 @@ export function useActionByIndex(index: number): ActionModel export function useActionByIndex(index: number, selector: (action: ActionModel) => T): T export function useActionByIndex(index: number, selector?: (action: ActionModel) => T) { return useActionStore((state) => - selector ? selector(state.actions[index]) : state.actions[index], + selector ? selector(state.actions[index]!) : state.actions[index], ) } diff --git a/apps/renderer/src/store/action/store.ts b/apps/renderer/src/store/action/store.ts index 26a05ef8f8..f3e816c175 100644 --- a/apps/renderer/src/store/action/store.ts +++ b/apps/renderer/src/store/action/store.ts @@ -40,7 +40,7 @@ class ActionActionStatic { updateByIndex(index: number, update: (action: ActionModel) => void) { set((state) => { - update(state.actions[index]) + update(state.actions[index]!) state.isDirty = true }) } diff --git a/apps/renderer/src/store/entry/helper.ts b/apps/renderer/src/store/entry/helper.ts index 81618116d2..4af86360e5 100644 --- a/apps/renderer/src/store/entry/helper.ts +++ b/apps/renderer/src/store/entry/helper.ts @@ -40,7 +40,7 @@ const unread = create({ await apiClient.reads.$post({ json: { entryIds: ids.map((i) => i.entryId), - isInbox: ids[0].isInbox, + isInbox: ids[0]!.isInbox, readHistories: ids.filter((i) => !i.isPrivate).map((i) => i.entryId), }, }) diff --git a/apps/renderer/src/store/entry/hooks.ts b/apps/renderer/src/store/entry/hooks.ts index 39a4bec706..3e046a42b4 100644 --- a/apps/renderer/src/store/entry/hooks.ts +++ b/apps/renderer/src/store/entry/hooks.ts @@ -115,4 +115,4 @@ export const useEntryIdsByFeedIdOrView = ( export const useEntryReadHistory = ( entryId: string, ): Omit | null => - useEntryStore((state) => state.readHistory[entryId]) + useEntryStore((state) => state.readHistory[entryId] || null) diff --git a/apps/renderer/src/store/entry/store.ts b/apps/renderer/src/store/entry/store.ts index 7a710b3e2d..5795ccaae6 100644 --- a/apps/renderer/src/store/entry/store.ts +++ b/apps/renderer/src/store/entry/store.ts @@ -228,7 +228,7 @@ class EntryActions { ids.forEach((entryId) => { if (filter) { - const entry = draft.flatMapEntries[entryId] + const entry = draft.flatMapEntries[entryId]! if ( +new Date(entry.entries.publishedAt) < filter.startTime || +new Date(entry.entries.publishedAt) > filter.endTime @@ -236,7 +236,7 @@ class EntryActions { return } } - Object.assign(draft.flatMapEntries[entryId], changed) + Object.assign(draft.flatMapEntries[entryId]!, changed) if (changed.entries) { patchChangedEntriesInDb.push({ @@ -290,11 +290,12 @@ class EntryActions { draft.internal_feedId2entryIdSet[item.feeds.id] = new Set() } - if (!draft.internal_feedId2entryIdSet[item.feeds.id].has(item.entries.id)) { - draft.entries[item.feeds.id].push(item.entries.id) - draft.internal_feedId2entryIdSet[item.feeds.id].add(item.entries.id) + if (!draft.internal_feedId2entryIdSet[item.feeds.id]!.has(item.entries.id)) { + draft.entries[item.feeds.id]!.push(item.entries.id) + draft.internal_feedId2entryIdSet[item.feeds.id]!.add(item.entries.id) } + // @ts-expect-error draft.flatMapEntries[item.entries.id] = merge( draft.flatMapEntries[item.entries.id] || {}, { @@ -326,6 +327,7 @@ class EntryActions { draft.internal_feedId2entryIdSet[inboxId].add(item.entries.id) } + // @ts-expect-error draft.flatMapEntries[item.entries.id] = merge( draft.flatMapEntries[item.entries.id] || {}, { @@ -369,7 +371,7 @@ class EntryActions { } if (item.settings && draft.flatMapEntries[item.entries.id] && !options?.isArchived) { - draft.flatMapEntries[item.entries.id].settings = item.settings + draft.flatMapEntries[item.entries.id]!.settings = item.settings } } @@ -412,9 +414,9 @@ class EntryActions { draft.internal_feedId2entryIdSet[item.feedId] = new Set() } - if (!draft.internal_feedId2entryIdSet[item.feedId].has(item.entries.id)) { - draft.entries[item.feedId].push(item.entries.id) - draft.internal_feedId2entryIdSet[item.feedId].add(item.entries.id) + if (!draft.internal_feedId2entryIdSet[item.feedId]!.has(item.entries.id)) { + draft.entries[item.feedId]!.push(item.entries.id) + draft.internal_feedId2entryIdSet[item.feedId]!.add(item.entries.id) } draft.flatMapEntries[item.entries.id] = merge( @@ -444,7 +446,7 @@ class EntryActions { async markRead({ feedId, entryId, read }: { feedId: string; entryId: string; read: boolean }) { const entry = get().flatMapEntries[entryId] - const isInbox = entry?.entries && "inboxHandle" in entry.entries + const isInbox = !!(entry?.entries && "inboxHandle" in entry.entries) const subscription = getSubscriptionByFeedId(feedId) if (read && entry?.read) { @@ -454,7 +456,7 @@ class EntryActions { const tx = createTransaction({}) tx.optimistic((_, ctx) => { - const prevUnread = feedUnreadActions.incrementByFeedId(feedId, read ? -1 : 1) + const prevUnread = feedUnreadActions.incrementByFeedId(feedId, read ? -1 : 1)! ctx.prevUnread = prevUnread this.patch(entryId, { @@ -588,7 +590,7 @@ class EntryActions { delete nextFlatMapEntries[entryId] - const index = state.entries[fullInboxId].indexOf(entryId) + const index = state.entries[fullInboxId]!.indexOf(entryId) const nextState = { ...state, @@ -600,7 +602,7 @@ class EntryActions { const nextFeedEntries = { ...state.entries, - [fullInboxId]: state.entries[fullInboxId].filter((id) => id !== entryId), + [fullInboxId]: state.entries[fullInboxId]!.filter((id) => id !== entryId), } nextState.entries = nextFeedEntries @@ -623,7 +625,7 @@ class EntryActions { ...state, entries: { ...state.entries, - [entry.feedId]: state.entries[entry.feedId].splice(ctx.deletedIndex, 0, entryId), + [entry.feedId]: state.entries[entry.feedId]!.splice(ctx.deletedIndex, 0, entryId), }, flatMapEntries: { ...state.flatMapEntries, diff --git a/apps/renderer/src/store/feed/hooks.ts b/apps/renderer/src/store/feed/hooks.ts index fe234f0078..3d85cab3a4 100644 --- a/apps/renderer/src/store/feed/hooks.ts +++ b/apps/renderer/src/store/feed/hooks.ts @@ -79,7 +79,7 @@ export const useFeedHeaderTitle = () => { switch (currentFeedId) { case ROUTE_FEED_PENDING: { - return t(views[view].name) + return t(views[view]!.name as any) } case FEED_COLLECTION_LIST: { return t("words.starred") diff --git a/apps/renderer/src/store/inbox/hooks.ts b/apps/renderer/src/store/inbox/hooks.ts index 6ff7d651a0..843f4e0d93 100644 --- a/apps/renderer/src/store/inbox/hooks.ts +++ b/apps/renderer/src/store/inbox/hooks.ts @@ -10,6 +10,6 @@ export function useInboxById( export function useInboxById(inboxId: Nullable, selector?: (inbox: InboxModel) => T) { return useInboxStore((state) => - inboxId ? (selector ? selector(state.inboxes[inboxId]) : state.inboxes[inboxId]) : null, + inboxId ? (selector ? selector(state.inboxes[inboxId]!) : state.inboxes[inboxId]) : null, ) } diff --git a/apps/renderer/src/store/list/hooks.ts b/apps/renderer/src/store/list/hooks.ts index 4bb5ded108..2090b8baef 100644 --- a/apps/renderer/src/store/list/hooks.ts +++ b/apps/renderer/src/store/list/hooks.ts @@ -7,7 +7,7 @@ import { useWhoami } from "~/atoms/user" import { useListStore } from "./store" export const useListById = (listId: Nullable): ListModel | null => - useListStore((state) => (listId ? state.lists[listId] : null)) + useListStore((state) => (listId ? state.lists[listId] || null : null)) export const useListByView = (view: FeedViewType) => { return useListStore( diff --git a/apps/renderer/src/store/list/store.ts b/apps/renderer/src/store/list/store.ts index 4e2b8758f9..d0a4ba2210 100644 --- a/apps/renderer/src/store/list/store.ts +++ b/apps/renderer/src/store/list/store.ts @@ -50,7 +50,7 @@ class ListActionStatic { private patch(listId: string, data: Partial) { immerSet((state) => { - state.lists[listId] = { ...state.lists[listId], ...data } + state.lists[listId] = { ...state.lists[listId]!, ...data } return state }) diff --git a/apps/renderer/src/store/subscription/hooks.ts b/apps/renderer/src/store/subscription/hooks.ts index 9d37fc1014..3c7dfa17fe 100644 --- a/apps/renderer/src/store/subscription/hooks.ts +++ b/apps/renderer/src/store/subscription/hooks.ts @@ -40,7 +40,7 @@ export const useCategoriesByView = (view: FeedViewType) => (state) => new Set( subscriptionByViewSelector(view)(state) - .map((subscription) => subscription.category) + .map((subscription) => subscription!.category) .filter((category) => category !== null && category !== undefined) .filter(Boolean), ), @@ -90,7 +90,7 @@ export const useAllFeeds = () => { const allSubscriptions = Object.values(store.feedIdByView).flat() for (const feedId of allSubscriptions) { - const subscription = store.data[feedId] + const subscription = store.data[feedId]! const feed = feedTitleMap[feedId] if (feed) { feedInfo.push({ title: subscription.title || feed || "", id: feedId }) diff --git a/apps/renderer/src/store/subscription/selector.ts b/apps/renderer/src/store/subscription/selector.ts index c04565d887..b735d9e01c 100644 --- a/apps/renderer/src/store/subscription/selector.ts +++ b/apps/renderer/src/store/subscription/selector.ts @@ -43,7 +43,7 @@ export const folderFeedsByFeedIdSelector = const folderName = feedId.replace(ROUTE_FEED_IN_FOLDER, "") const feedIds: string[] = [] for (const feedId in state.data) { - const subscription = state.data[feedId] + const subscription = state.data[feedId]! if ( subscription.view === view && (subscription.category === folderName || subscription.defaultCategory === folderName) diff --git a/apps/renderer/src/store/subscription/store.ts b/apps/renderer/src/store/subscription/store.ts index 8b37a6e490..46ac3ad30b 100644 --- a/apps/renderer/src/store/subscription/store.ts +++ b/apps/renderer/src/store/subscription/store.ts @@ -255,7 +255,7 @@ class SubscriptionActions { tx.optimistic(async () => { const state = get() for (const feedId in state.data) { - if (state.data[feedId].view === view) { + if (state.data[feedId]!.view === view) { // We can not process this logic in local, so skip it. and then we will fetch the unread count from server. !filter && feedUnreadActions.updateByFeedId(feedId, 0) entryActions.patchManyByFeedId(feedId, { read: true }, filter) @@ -370,7 +370,7 @@ class SubscriptionActions { if (!idSet.has(id)) { return } - const subscription = state.data[id] + const subscription = state.data[id]! const feed = getFeedById(subscription.feedId) if (!feed || feed.type !== "feed") return const { siteUrl } = feed @@ -386,7 +386,7 @@ class SubscriptionActions { tx.rollback(async (snapshot) => { immerSet((state) => { Object.keys(snapshot.data).forEach((id) => { - state.data[id] = snapshot.data[id] + state.data[id] = snapshot.data[id]! }) }) }) @@ -417,7 +417,7 @@ class SubscriptionActions { set((state) => produce(state, (draft) => { for (const feedId of feedIds) { - const subscription = state.data[feedId] + const subscription = state.data[feedId]! ctx.subscription[feedId] = subscription delete draft.data[feedId] @@ -444,7 +444,7 @@ class SubscriptionActions { if (!ctx.subscription[feedId]) return draft.data[feedId] = ctx.subscription[feedId] - for (const view of ctx.viewDeleted[feedId]) { + for (const view of ctx.viewDeleted[feedId]!) { draft.feedIdByView[view].push(feedId) } } @@ -552,7 +552,7 @@ class SubscriptionActions { view, }, }) - const oldView = snapshot.data[feedIdList[0]].view + const oldView = snapshot.data[feedIdList[0]!]!.view queryClient.invalidateQueries({ predicate(query) { @@ -592,7 +592,7 @@ class SubscriptionActions { changeToViewFeedIds.push(feedId) } - ctx.subscription[feedId] = state.data[feedId] + ctx.subscription[feedId] = state.data[feedId]! } }), ) @@ -602,7 +602,7 @@ class SubscriptionActions { set((state) => produce(state, (draft) => { for (const feedId of feedIdList) { - draft.data[feedId] = ctx.subscription[feedId] + draft.data[feedId] = ctx.subscription[feedId]! } for (let i = 0; i < 6; i++) { draft.feedIdByView[i] = ctx.feedIdByView[i] @@ -648,7 +648,7 @@ class SubscriptionActions { const subscriptionIds = [] as string[] const state = get() for (const feedId in state.data) { - const subscription = state.data[feedId] + const subscription = state.data[feedId]! if (subscription.category === lastCategory || subscription.defaultCategory === lastCategory) { subscriptionIds.push(feedId) } @@ -676,7 +676,7 @@ class SubscriptionActions { subscription.category = newCategory subscription.defaultCategory = undefined - ctx.subscription[feedId] = state.data[feedId] + ctx.subscription[feedId] = state.data[feedId]! } } }), @@ -686,7 +686,7 @@ class SubscriptionActions { set((state) => produce(state, (draft) => { for (const feedId of Object.keys(ctx.subscription)) { - draft.data[feedId] = ctx.subscription[feedId] + draft.data[feedId] = ctx.subscription[feedId]! } }), ) diff --git a/apps/renderer/src/store/unread/index.ts b/apps/renderer/src/store/unread/index.ts index a449e631e6..0fec9354f2 100644 --- a/apps/renderer/src/store/unread/index.ts +++ b/apps/renderer/src/store/unread/index.ts @@ -91,7 +91,7 @@ class FeedUnreadActions { const handler = (state: UnreadState): void => { let unread = 0 for (const key in state.data) { - unread += state.data[key] + unread += state.data[key]! } fn(unread) diff --git a/apps/renderer/src/store/user/hooks.ts b/apps/renderer/src/store/user/hooks.ts index 1607b1380a..99f752f3f6 100644 --- a/apps/renderer/src/store/user/hooks.ts +++ b/apps/renderer/src/store/user/hooks.ts @@ -3,4 +3,4 @@ import type { UserModel } from "@follow/models/types" import { useUserStore } from "./store" export const useUserById = (userId: string): UserModel | null => - useUserStore((state) => state.users[userId]) + useUserStore((state) => state.users[userId] || null) diff --git a/apps/renderer/src/store/user/store.ts b/apps/renderer/src/store/user/store.ts index bfe264a4ed..14bb7ae840 100644 --- a/apps/renderer/src/store/user/store.ts +++ b/apps/renderer/src/store/user/store.ts @@ -20,7 +20,7 @@ const avatarBatcher = create({ const result = Array.from({ length: ids.length }).fill(null) as (typeof res)[string][] for (const [i, id] of ids.entries()) { - result[i] = res[id] + result[i] = res[id]! } return result }, diff --git a/apps/renderer/src/workers/sw/pusher.ts b/apps/renderer/src/workers/sw/pusher.ts index cb9b40eecf..f6a40871f8 100644 --- a/apps/renderer/src/workers/sw/pusher.ts +++ b/apps/renderer/src/workers/sw/pusher.ts @@ -70,7 +70,7 @@ export const registerPusher = (self: ServiceWorkerGlobalScope) => { .then((windowClients) => { if (windowClients.length > 0) { const client = windowClients[0] - return client.focus() + return client?.focus() } return self.clients.openWindow(urlToOpen.href) }) diff --git a/apps/renderer/tsconfig.json b/apps/renderer/tsconfig.json index c9ebfe8e30..c6d5ef0b64 100644 --- a/apps/renderer/tsconfig.json +++ b/apps/renderer/tsconfig.json @@ -7,6 +7,8 @@ "noUnusedLocals": false, "noUnusedParameters": false, "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, "baseUrl": ".", "noImplicitReturns": false, "noEmit": true, diff --git a/apps/server/client/@types/constants.ts b/apps/server/client/@types/constants.ts index 5b51c1b9a3..bff7374aef 100644 --- a/apps/server/client/@types/constants.ts +++ b/apps/server/client/@types/constants.ts @@ -44,5 +44,5 @@ export const dayjsLocaleImportMap = { ["ko"]: ["ko", () => import("dayjs/locale/ko")], ["tr"]: ["tr", () => import("dayjs/locale/tr")], } -export const ns = ["common", "lang", "errors"] as const +export const ns = ["common", "lang", "errors", "external"] as const export const defaultNS = "external" as const diff --git a/apps/server/client/components/items/grid.tsx b/apps/server/client/components/items/grid.tsx index 4d94488de1..266ef55d2a 100644 --- a/apps/server/client/components/items/grid.tsx +++ b/apps/server/client/components/items/grid.tsx @@ -20,7 +20,7 @@ export const GridList: FC<{
diff --git a/apps/server/client/components/items/picture.tsx b/apps/server/client/components/items/picture.tsx index 10e0680ef9..882100c796 100644 --- a/apps/server/client/components/items/picture.tsx +++ b/apps/server/client/components/items/picture.tsx @@ -49,7 +49,7 @@ const MasonryItemFixedDimensionWrapper = ( const style = useMemo( () => ({ width: itemWidth, - height: itemWidth / stableRadioCtx, + height: itemWidth / stableRadioCtx!, }), [itemWidth, stableRadioCtx], ) @@ -148,10 +148,10 @@ export const PictureList: FC<{ const flattenedItems = [] const imageSrcSet = new Set() for (let i = 0; i < entries?.length || 0; i++) { - const entry = entries[i] + const entry = entries[i]! if (!entry.media) continue for (let j = 0; j < entry.media?.length || 0; j++) { - const media = entry.media[j] + const media = entry.media[j]! if (imageSrcSet.has(media.url)) continue imageSrcSet.add(media.url) diff --git a/apps/server/client/i18n.ts b/apps/server/client/i18n.ts index 317e32fa83..b025e554f7 100644 --- a/apps/server/client/i18n.ts +++ b/apps/server/client/i18n.ts @@ -40,7 +40,7 @@ export const fallbackLanguage = "en" export const initI18n = async () => { const i18next = jotaiStore.get(i18nAtom) - const lang = getGeneralSettings().language + const lang = getGeneralSettings().language! const mergedResources = { ...defaultResources, diff --git a/apps/server/client/initialize/helper.ts b/apps/server/client/initialize/helper.ts index 1b5073c954..0b35c87ee1 100644 --- a/apps/server/client/initialize/helper.ts +++ b/apps/server/client/initialize/helper.ts @@ -1,15 +1,14 @@ -import type { User } from "@auth/core/types" +import type { AuthUser } from "@follow/shared/hono" import { op } from "./op" -export const setIntegrationIdentify = async (user: User) => { +export const setIntegrationIdentify = async (user: AuthUser) => { op.identify({ profileId: user.id, email: user.email, - avatar: user.image, + avatar: user.image ?? undefined, lastName: user.name, properties: { - // @ts-expect-error handle: user.handle, name: user.name, }, diff --git a/apps/server/client/pages/(login)/register.tsx b/apps/server/client/pages/(login)/register.tsx index 9066b8a657..3e2dfd55b3 100644 --- a/apps/server/client/pages/(login)/register.tsx +++ b/apps/server/client/pages/(login)/register.tsx @@ -57,7 +57,7 @@ function RegisterForm() { return signUp.email({ email: values.email, password: values.password, - name: values.email.split("@")[0], + name: values.email.split("@")[0]!, callbackURL: "/", fetchOptions: { onSuccess() { diff --git a/apps/server/client/pages/(main)/share/lists/[id]/index.tsx b/apps/server/client/pages/(main)/share/lists/[id]/index.tsx index 7b6d14e1f8..29230366f3 100644 --- a/apps/server/client/pages/(main)/share/lists/[id]/index.tsx +++ b/apps/server/client/pages/(main)/share/lists/[id]/index.tsx @@ -104,7 +104,7 @@ export function Component() {
{listData!.feedIds ?.slice(0, 7) - .map((feedId) => )} + .map((feedId) => )} {"feedCount" in list.data && (
{t("feed.follow_to_view_all", { diff --git a/apps/server/client/pages/(main)/share/lists/[id]/metadata.ts b/apps/server/client/pages/(main)/share/lists/[id]/metadata.ts index 8c9ed4cddb..2fad6ca8e2 100644 --- a/apps/server/client/pages/(main)/share/lists/[id]/metadata.ts +++ b/apps/server/client/pages/(main)/share/lists/[id]/metadata.ts @@ -1,7 +1,7 @@ import { defineMetadata } from "~/meta-handler" export default defineMetadata(async ({ params, apiClient, origin, throwError }) => { - const listId = params.id + const listId = params.id! const list = await apiClient.lists .$get({ query: { listId } }) .catch((e) => throwError(e.response?.status || 500, "List not found")) diff --git a/apps/server/client/pages/(main)/share/users/[id]/index.tsx b/apps/server/client/pages/(main)/share/users/[id]/index.tsx index 042b9df75e..870eb8c072 100644 --- a/apps/server/client/pages/(main)/share/users/[id]/index.tsx +++ b/apps/server/client/pages/(main)/share/users/[id]/index.tsx @@ -68,7 +68,7 @@ export const Component = () => {

{category}

- {subscriptions.data?.[category].map( + {subscriptions.data?.[category]!.map( (subscription) => "feeds" in subscription && (
diff --git a/apps/server/client/query/users.ts b/apps/server/client/query/users.ts index 586a909d81..47cd3528ff 100644 --- a/apps/server/client/query/users.ts +++ b/apps/server/client/query/users.ts @@ -24,7 +24,7 @@ export const useUserSubscriptionsQuery = (userId: string | undefined) => { if (!groupFolder[subscription.category]) { groupFolder[subscription.category] = [] } - groupFolder[subscription.category].push(subscription) + groupFolder[subscription.category]!.push(subscription) } } return groupFolder diff --git a/apps/server/package.json b/apps/server/package.json index 1803d3d33d..0bdf5c730c 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -5,7 +5,8 @@ "build": "cross-env NODE_ENV=production vite build && tsx scripts/prepare-vercel-build.ts && tsup && tsx scripts/cleanup-vercel-build.ts", "dev": "cross-env NODE_ENV=development tsx watch --include \"src/**/*.ts\" --exclude \"./*.ts\" --exclude \"./*.mjs\" index.ts", "meta": "tsx helper/meta-map.ts --watch", - "start": "tsx index.ts" + "start": "tsx index.ts", + "typecheck": "tsc --noEmit" }, "dependencies": { "@fastify/middie": "9.0.2", diff --git a/apps/server/src/lib/api-client.ts b/apps/server/src/lib/api-client.ts index 3cf0a937d6..0280f436d4 100644 --- a/apps/server/src/lib/api-client.ts +++ b/apps/server/src/lib/api-client.ts @@ -73,7 +73,7 @@ export const getTokenFromCookie = (cookie: string) => { .reduce( (acc, item) => { const [key, value] = item.split("=") - acc[key] = value + acc[key!] = value! return acc }, {} as Record, diff --git a/apps/server/src/router/og/index.ts b/apps/server/src/router/og/index.ts index 586574b1b1..acfa157015 100644 --- a/apps/server/src/router/og/index.ts +++ b/apps/server/src/router/og/index.ts @@ -21,16 +21,16 @@ export const ogRoute = (app: FastifyInstance) => { switch (type) { case "feed": { - imageRes = await renderFeedOG(apiClient, id).catch(errorFallback) + imageRes = await renderFeedOG(apiClient, id!).catch(errorFallback) break } case "user": { - imageRes = await renderUserOG(apiClient, id).catch(errorFallback) + imageRes = await renderUserOG(apiClient, id!).catch(errorFallback) break } case "list": { - imageRes = await renderListOG(apiClient, id).catch(errorFallback) + imageRes = await renderListOG(apiClient, id!).catch(errorFallback) break } default: { diff --git a/apps/server/tsconfig.json b/apps/server/tsconfig.json index 84e79a3b68..4823f1c171 100644 --- a/apps/server/tsconfig.json +++ b/apps/server/tsconfig.json @@ -5,6 +5,8 @@ "allowJs": true, "skipLibCheck": true, "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, "noEmit": true, "moduleResolution": "Bundler", "esModuleInterop": true, diff --git a/configs/tailwind.base.config.ts b/configs/tailwind.base.config.ts index 23b39dc8fd..fb967ddfc4 100644 --- a/configs/tailwind.base.config.ts +++ b/configs/tailwind.base.config.ts @@ -119,7 +119,7 @@ export const baseTwConfig = { sm: "calc(var(--radius) - 4px)", }, - typography: (theme) => ({ + typography: (theme: any) => ({ zinc: { css: { "--tw-prose-body": theme("colors.zinc.500"), diff --git a/packages/atoms/package.json b/packages/atoms/package.json index a40e3b68ee..619a811b63 100644 --- a/packages/atoms/package.json +++ b/packages/atoms/package.json @@ -1,6 +1,6 @@ { "name": "@follow/atoms", - "version": "0.0.1", + "private": true, "sideEffects": false, "exports": { "./atoms/*": { @@ -12,6 +12,9 @@ "types": "./src/helper/*" } }, + "scripts": { + "typecheck": "tsc --noEmit" + }, "dependencies": { "@follow/hooks": "workspace:*", "@follow/types": "workspace:*", diff --git a/packages/components/package.json b/packages/components/package.json index 09d1f951e7..9d8e8c8863 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,5 @@ { "name": "@follow/components", - "version": "0.0.1", "private": true, "sideEffects": false, "exports": { @@ -16,6 +15,9 @@ "./utils/*": "./src/utils/*" }, "main": "./exports.ts", + "scripts": { + "typecheck": "tsc --noEmit" + }, "peerDependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" diff --git a/packages/components/src/atoms/route.ts b/packages/components/src/atoms/route.ts index f5273d8d43..ab09947b23 100644 --- a/packages/components/src/atoms/route.ts +++ b/packages/components/src/atoms/route.ts @@ -26,7 +26,7 @@ export const [routeAtom, , , , getReadonlyRoute, setRoute] = createAtomHooks( }), ) -const noop = [] +const noop: [] = [] export const useReadonlyRouteSelector = ( selector: (route: RouteAtom) => T, deps: any[] = noop, diff --git a/packages/components/src/common/PoweredByFooter.tsx b/packages/components/src/common/PoweredByFooter.tsx index 3e6d89da5b..ae96de3136 100644 --- a/packages/components/src/common/PoweredByFooter.tsx +++ b/packages/components/src/common/PoweredByFooter.tsx @@ -1,5 +1,4 @@ import { cn } from "@follow/utils/utils" -import pkg from "@pkg" import { Logo } from "../icons/logo" @@ -8,7 +7,7 @@ export const PoweredByFooter: Component = ({ className }) => ( {new Date().getFullYear()}{" "} {" "} = ({ if (!containerRef.current) return const resizeObserver = new ResizeObserver((entries) => { // We only have one entry, so we can use entries[0]. - const target = entries[0].target as HTMLElement - const observedHeight = entries[0].contentRect.height + const target = entries[0]!.target as HTMLElement + const observedHeight = entries[0]!.contentRect.height const style = getComputedStyle(target) const marginHeight = diff --git a/packages/components/src/ui/button/action-button.tsx b/packages/components/src/ui/button/action-button.tsx index 576121f45e..be2947c248 100644 --- a/packages/components/src/ui/button/action-button.tsx +++ b/packages/components/src/ui/button/action-button.tsx @@ -19,7 +19,7 @@ export interface ActionButtonProps { shortcut?: string disableTriggerShortcut?: boolean enableHoverableContent?: boolean - size?: "sm" | "md" | "base" + size?: "sm" | "base" /** * @description only trigger shortcut when focus with in `` diff --git a/packages/components/src/ui/feed-icon/index.tsx b/packages/components/src/ui/feed-icon/index.tsx index a365727940..bc8d2c79de 100644 --- a/packages/components/src/ui/feed-icon/index.tsx +++ b/packages/components/src/ui/feed-icon/index.tsx @@ -1,5 +1,3 @@ -import { PlatformIcon } from "@follow/components/ui/platform-icon/index.jsx" -import { getFeedIconSrc } from "@follow/components/utils/icon" import type { CombinedEntryModel, FeedModel, FeedOrListRespModel } from "@follow/models/types" import { getColorScheme, stringToHue } from "@follow/utils/color" import { getImageProxyUrl } from "@follow/utils/img-proxy" @@ -9,6 +7,9 @@ import { m } from "framer-motion" import type { ReactNode } from "react" import { forwardRef, useMemo } from "react" +import { getFeedIconSrc } from "../../utils/icon" +import { PlatformIcon } from "../platform-icon" + const FallbackableImage = forwardRef< HTMLImageElement, { @@ -108,7 +109,7 @@ export function FeedIcon({ const [src] = getFeedIconSrc({ siteUrl, }) - finalSrc = src + finalSrc = src! ImageElement = ( @@ -145,7 +146,7 @@ export function FeedIcon({ height: size * 2, }, }) - finalSrc = src + finalSrc = src! ImageElement = ( ) diff --git a/packages/components/src/ui/input/OTP.tsx b/packages/components/src/ui/input/OTP.tsx index af40817ea6..b0b6137787 100644 --- a/packages/components/src/ui/input/OTP.tsx +++ b/packages/components/src/ui/input/OTP.tsx @@ -31,7 +31,7 @@ const InputOTPSlot = React.forwardRef< React.ComponentPropsWithoutRef<"div"> & { index: number } >(({ index, className, ...props }, ref) => { const inputOTPContext = React.useContext(OTPInputContext) - const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index] + const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]! return (
= 0; i--) { - const item = tree.children[i] + const item = tree.children[i]! if (item.type === "element") { if (item.tagName === "br") { tree.children.pop() @@ -56,8 +56,8 @@ export const parseHtml = (content: string, options?: ParseHtmlOptions) => { rehypeSchema.attributes = { ...rehypeSchema.attributes, "*": renderInlineStyle - ? [...rehypeSchema.attributes!["*"], "style", "class"] - : rehypeSchema.attributes!["*"], + ? [...rehypeSchema.attributes!["*"]!, "style", "class"] + : rehypeSchema.attributes!["*"]!, video: ["src", "poster"], } } diff --git a/packages/components/src/utils/parse-markdown.tsx b/packages/components/src/utils/parse-markdown.tsx index c60fac974b..7703d42ce4 100644 --- a/packages/components/src/utils/parse-markdown.tsx +++ b/packages/components/src/utils/parse-markdown.tsx @@ -3,6 +3,7 @@ import "remark-gh-alerts/styles/github-colors-light.css" import "remark-gh-alerts/styles/github-colors-dark-media.css" import "remark-gh-alerts/styles/github-base.css" +// @ts-ignore import remarkCalloutDirectives from "@microflash/remark-callout-directives" import type { Components } from "hast-util-to-jsx-runtime" import { toJsxRuntime } from "hast-util-to-jsx-runtime" diff --git a/packages/constants/package.json b/packages/constants/package.json index e945d78d2c..716c7b1e39 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -1,11 +1,14 @@ { "name": "@follow/constants", - "version": "0.0.1", + "private": true, "sideEffects": false, "exports": { ".": "./src/index.ts" }, "main": "./src/index.ts", + "scripts": { + "typecheck": "tsc --noEmit" + }, "peerDependencies": { "react": "^18.3.1" }, diff --git a/packages/constants/src/internal/i18n.ts b/packages/constants/src/internal/i18n.ts deleted file mode 100644 index 0f287193ea..0000000000 --- a/packages/constants/src/internal/i18n.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { useTranslation } from "react-i18next" - -import en from "../../../../locales/app/en.json" -import common_en from "../../../../locales/common/en.json" -import errors_en from "../../../../locales/errors/en.json" -import external_en from "../../../../locales/external/en.json" -import lang_en from "../../../../locales/lang/en.json" -import settings_en from "../../../../locales/settings/en.json" -import shortcuts_en from "../../../../locales/shortcuts/en.json" - -const _defaultResources = { - en: { - app: en, - lang: lang_en, - common: common_en, - external: external_en, - settings: settings_en, - shortcuts: shortcuts_en, - errors: errors_en, - }, -} -declare module "i18next" { - interface CustomTypeOptions { - // ns: ["app", "common", "external", "lang", "settings", "shortcuts"] - ns: ["app"] - resources: (typeof _defaultResources)["en"] - defaultNS: "app" - // if you see an error like: "Argument of type 'DefaultTFuncReturn' is not assignable to parameter of type xyz" - // set returnNull to false (and also in the i18next init options) - // returnNull: false; - } -} -// eslint-disable-next-line react-hooks/rules-of-hooks, unused-imports/no-unused-vars -const { t } = useTranslation() - -export { type t } diff --git a/packages/constants/src/tabs.tsx b/packages/constants/src/tabs.tsx index d0fb552e2a..2610626cac 100644 --- a/packages/constants/src/tabs.tsx +++ b/packages/constants/src/tabs.tsx @@ -1,11 +1,9 @@ import * as React from "react" import { FeedViewType } from "./enums" -import type { t } from "./internal/i18n" -export type I18nKeys = OmitStringType[0]> interface ViewDefinition { - name: I18nKeys + name: string icon: React.JSX.Element className: string peerClassName: string diff --git a/packages/constants/tsconfig.json b/packages/constants/tsconfig.json index 06e14fd2e3..5b6fd63ed7 100644 --- a/packages/constants/tsconfig.json +++ b/packages/constants/tsconfig.json @@ -9,5 +9,5 @@ "@pkg": ["../../package.json"] } }, - "include": ["src/**/*"] + "include": ["src/**/*", "../../locales/**/*.json"] } diff --git a/packages/hooks/package.json b/packages/hooks/package.json index 709262d519..355a4620ea 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -1,6 +1,5 @@ { "name": "@follow/hooks", - "version": "0.0.1", "private": true, "sideEffects": false, "exports": { @@ -10,6 +9,9 @@ } }, "main": "./exports.ts", + "scripts": { + "typecheck": "tsc --noEmit" + }, "peerDependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" diff --git a/packages/hooks/src/factory/createHTMLMediaHook.ts b/packages/hooks/src/factory/createHTMLMediaHook.ts index 8acf6fdc26..979855313e 100644 --- a/packages/hooks/src/factory/createHTMLMediaHook.ts +++ b/packages/hooks/src/factory/createHTMLMediaHook.ts @@ -78,7 +78,7 @@ export default function createHTMLMediaHook state) const ref = useRef(null) - const wrapEvent = (userEvent, proxyEvent?) => (event) => { + const wrapEvent = (userEvent: any, proxyEvent?: any) => (event: any) => { try { proxyEvent && proxyEvent(event) } finally { diff --git a/packages/hooks/src/useLongPress.ts b/packages/hooks/src/useLongPress.ts index 7679f55514..234c6b9933 100644 --- a/packages/hooks/src/useLongPress.ts +++ b/packages/hooks/src/useLongPress.ts @@ -27,7 +27,7 @@ export function useLongPress({ events.onTouchStart?.(e) e.preventDefault() isLongPress.current = false - const touch = e.touches[0] + const touch = e.touches[0]! clearTimeout(timerRef.current) startPosition.current = { @@ -61,7 +61,7 @@ export function useLongPress({ const compatEventProxy = new Proxy(compatEvent, { get: (target, prop: string) => { if (compatProperties.has(prop)) { - return target[prop] + return target[prop as keyof typeof target] } throw new Error(`Property ${prop} not implemented on compatEvent`) }, @@ -75,7 +75,7 @@ export function useLongPress({ events.onTouchMove?.(e) if (!startPosition.current) return - const touch = e.touches[0] + const touch = e.touches[0]! const currentX = touch.clientX + window.scrollX const currentY = touch.clientY + window.scrollY diff --git a/packages/hooks/src/useSetState.ts b/packages/hooks/src/useSetState.ts index 688281b6c0..1a68318baa 100644 --- a/packages/hooks/src/useSetState.ts +++ b/packages/hooks/src/useSetState.ts @@ -7,7 +7,7 @@ export const useSetState = ( initialState: T = {} as T, ): [T, (patch: Partial | ((prevState: T) => Partial)) => void] => { const [state, set] = useState(initialState) - const setState = useCallback((patch) => { + const setState = useCallback((patch: any) => { set((prevState) => Object.assign({}, prevState, patch instanceof Function ? patch(prevState) : patch), ) diff --git a/packages/hooks/src/useTitle.ts b/packages/hooks/src/useTitle.ts index 2ca29acf4b..6d05bd31dd 100644 --- a/packages/hooks/src/useTitle.ts +++ b/packages/hooks/src/useTitle.ts @@ -3,7 +3,7 @@ import { useEffect, useRef } from "react" const titleTemplate = IN_ELECTRON ? `%s` : `%s | ${APP_NAME}` -export const useTitle = (title?: Nullable) => { +export const useTitle = (title?: string | null) => { const currentTitleRef = useRef(document.title) useEffect(() => { if (!title) return diff --git a/packages/logger/package.json b/packages/logger/package.json index 06d0d30b91..d67940e042 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@follow/logger", - "version": "0.0.1", + "private": true, "exports": { ".": { "types": "./electron.ts", @@ -8,6 +8,9 @@ "default": "./electron.ts" } }, + "scripts": { + "typecheck": "tsc --noEmit" + }, "dependencies": { "electron-log": "5.2.4" } diff --git a/packages/models/package.json b/packages/models/package.json index 360d57a95b..084922546b 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,5 @@ { "name": "@follow/models", - "version": "0.0.1", "private": true, "sideEffects": false, "exports": { @@ -17,6 +16,9 @@ "require": "./src/types.ts" } }, + "scripts": { + "typecheck": "tsc --noEmit" + }, "dependencies": { "@auth/core": "0.37.4", "@follow/constants": "workspace:*", diff --git a/packages/shared/package.json b/packages/shared/package.json index d35e57a271..c9eba97246 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -28,7 +28,9 @@ } }, "main": "./exports.ts", - "scripts": {}, + "scripts": { + "typecheck": "tsc --noEmit" + }, "dependencies": { "@electron-toolkit/preload": "^3.0.1", "@electron-toolkit/tsconfig": "^1.0.1", diff --git a/packages/shared/src/bridge.ts b/packages/shared/src/bridge.ts index 1b62628da4..5e7b52ca12 100644 --- a/packages/shared/src/bridge.ts +++ b/packages/shared/src/bridge.ts @@ -66,7 +66,9 @@ interface RenderGlobalContext { } export const registerGlobalContext = (context: Partial) => { + // @ts-ignore globalThis[PREFIX] = { + // @ts-ignore ...globalThis[PREFIX], ...context, } @@ -135,5 +137,6 @@ export function callWebviewExpose( } export function callWindowExposeRenderer() { + // @ts-ignore return globalThis[PREFIX] as Fn } diff --git a/packages/shared/src/constants.ts b/packages/shared/src/constants.ts index 07f92adb18..9dc043772c 100644 --- a/packages/shared/src/constants.ts +++ b/packages/shared/src/constants.ts @@ -7,6 +7,7 @@ declare const globalThis: { electron?: ElectronAPI api?: { canWindowBlur: boolean } } + electron?: ElectronAPI } export const APP_PROTOCOL = isDev ? "follow-dev" : "follow" diff --git a/packages/shared/src/env.ts b/packages/shared/src/env.ts index 52fe04ac81..9029ce3034 100644 --- a/packages/shared/src/env.ts +++ b/packages/shared/src/env.ts @@ -49,6 +49,7 @@ function getRuntimeEnv() { } } +declare const globalThis: any function injectExternalEnv(originEnv: T): T { if (!("document" in globalThis)) { return originEnv @@ -60,7 +61,7 @@ function injectExternalEnv(originEnv: T): T { } for (const key in env) { - originEnv[key] = env[key] + originEnv[key as keyof T] = env[key] } return originEnv } diff --git a/packages/tsconfig.extend.json b/packages/tsconfig.extend.json index c2893f3a76..8a045309d8 100644 --- a/packages/tsconfig.extend.json +++ b/packages/tsconfig.extend.json @@ -3,7 +3,6 @@ "target": "esnext", "module": "esnext", "sourceMap": false, - "strict": true, "jsx": "preserve", "esModuleInterop": true, "moduleResolution": "Bundler", @@ -11,10 +10,9 @@ "isolatedModules": true, "forceConsistentCasingInFileNames": true, "skipLibCheck": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitAny": false, - "noImplicitReturns": true, - "noEmit": true + "noEmit": true, + "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true } } diff --git a/packages/types/package.json b/packages/types/package.json index ac1b398051..7783ba21c3 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,9 +1,10 @@ { "name": "@follow/types", - "version": "0.0.1", + "private": true, "sideEffects": false, "exports": { "./global": "./global.d.ts", - "./react": "./react-global.d.ts" + "./react": "./react-global.d.ts", + "./vite": "./vite-env.d.ts" } } diff --git a/types/vite.d.ts b/packages/types/vite-env.d.ts similarity index 100% rename from types/vite.d.ts rename to packages/types/vite-env.d.ts diff --git a/packages/utils/package.json b/packages/utils/package.json index 2969aea483..268f9d8500 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -24,7 +24,8 @@ }, "main": "./exports.ts", "scripts": { - "test": "vitest" + "test": "vitest", + "typecheck": "tsc --noEmit" }, "dependencies": { "@follow/shared": "workspace:*", diff --git a/packages/utils/src/cjk.ts b/packages/utils/src/cjk.ts index 6b2497704c..17010e3363 100644 --- a/packages/utils/src/cjk.ts +++ b/packages/utils/src/cjk.ts @@ -12,7 +12,7 @@ export const isCJKChar = (char: string): boolean => { export const getNameInitials = (name?: string): string => { if (!name) return "" - const first = name[0] + const first = name[0]! const second = name[1] if (isCJKChar(first)) return first diff --git a/packages/utils/src/color.ts b/packages/utils/src/color.ts index 6e51979aeb..e6032e3e23 100644 --- a/packages/utils/src/color.ts +++ b/packages/utils/src/color.ts @@ -24,7 +24,19 @@ export function stringToHue(str: string) { } const memoMap = {} as Record> -export const getColorScheme = (hue?: number, memo?: boolean) => { +export const getColorScheme = ( + hue?: number, + memo?: boolean, +): { + light: { + accent: string + background: string + } + dark: { + accent: string + background: string + } +} => { const baseHue = hue ?? Math.floor(Math.random() * 361) if (baseHue && memo) { if (memoMap[baseHue]) { @@ -70,14 +82,14 @@ const adjustColorTowardsTarget = (color: string, targetColor: string, factor: nu const [r1, g1, b1] = hexToRgb(color) const [r2, g2, b2] = hexToRgb(targetColor) - const r = Math.round(lerp(r1, r2, factor)) - const g = Math.round(lerp(g1, g2, factor)) - const b = Math.round(lerp(b1, b2, factor)) + const r = Math.round(lerp(r1!, r2!, factor)) + const g = Math.round(lerp(g1!, g2!, factor)) + const b = Math.round(lerp(b1!, b2!, factor)) return rgbToHex(r, g, b) } -export const getBackgroundGradient = (seed?: Nullable) => { +export const getBackgroundGradient = (seed?: string | null | undefined) => { const nextSeed = seed ?? Math.random().toString(36).slice(7) const bgAccent = uniqolor(nextSeed, { @@ -125,7 +137,7 @@ export function getDominantColor(imageObject: HTMLImageElement) { // get pixel color const i = ctx.getImageData(0, 0, 1, 1).data - return `#${((1 << 24) + (i[0] << 16) + (i[1] << 8) + i[2]).toString(16).slice(1)}` + return `#${((1 << 24) + (i[0]! << 16) + (i[1]! << 8) + i[2]!).toString(16).slice(1)}` } export const isHexColor = (color: string) => { diff --git a/packages/utils/src/event-bus.ts b/packages/utils/src/event-bus.ts index c6a2c2f6c3..1cc3388145 100644 --- a/packages/utils/src/event-bus.ts +++ b/packages/utils/src/event-bus.ts @@ -30,7 +30,7 @@ class EventBusStatic { return this.unsubscribe.bind(this, event as string, handler) } - unsubscribe(event: string, handler: (e: any) => void) { + unsubscribe(_event: string, handler: (e: any) => void) { window.removeEventListener(EventBusEvent.type, handler) } } diff --git a/packages/utils/src/jotai.ts b/packages/utils/src/jotai.ts index 87dc70fb16..35294090e3 100644 --- a/packages/utils/src/jotai.ts +++ b/packages/utils/src/jotai.ts @@ -42,7 +42,7 @@ export const createAtomHooks = (atom: PrimitiveAtom) => { return result as any as Result } -const noop = [] +const noop: any[] = [] const createAtomSelector = (atom: Atom) => { const useHook = (selector: (a: T) => R, deps: any[] = noop) => useAtomValue( diff --git a/packages/utils/src/path-parser.ts b/packages/utils/src/path-parser.ts index c64398d258..e7cc511854 100644 --- a/packages/utils/src/path-parser.ts +++ b/packages/utils/src/path-parser.ts @@ -132,7 +132,7 @@ export const parseRegexpPathParams = ( } } case "group": { - if ("name" in token.tokens[1]) { + if ("name" in token.tokens[1]!) { return { name: token.tokens[1].name, optional: true, diff --git a/packages/utils/src/route-builder.ts b/packages/utils/src/route-builder.ts index 7e6ea7a2cf..832063f7a0 100644 --- a/packages/utils/src/route-builder.ts +++ b/packages/utils/src/route-builder.ts @@ -98,7 +98,7 @@ export function buildGlobRoutes(glob: Record Promise>): Route // } const childrenChildren: RouteObject[] = [] - dtsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key], parentPath) + dtsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key]!, parentPath) children.push({ path: "", lazy: globGetter, @@ -131,7 +131,7 @@ export function buildGlobRoutes(glob: Record Promise>): Route }) break } else { - const content = paths[key] + const content = paths[key]! const hasChild = Object.keys(content).length > 0 const normalizeKey = normalizePathKey(key) @@ -158,7 +158,7 @@ export function buildGlobRoutes(glob: Record Promise>): Route } else { const childrenChildren: RouteObject[] = [] const fullPath = `${parentPath}/${normalizeKey}` - dtsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key], fullPath) + dtsRoutes(`${segmentPathKey}/`, childrenChildren, paths[key]!, fullPath) children.push({ path: normalizeKey, children: childrenChildren, diff --git a/packages/utils/src/utils.ts b/packages/utils/src/utils.ts index c5c8fdc1df..27a52d2855 100644 --- a/packages/utils/src/utils.ts +++ b/packages/utils/src/utils.ts @@ -92,7 +92,7 @@ export const isSafari = once(() => { }) // eslint-disable-next-line no-control-regex -export const isASCII = (str) => /^[\u0000-\u007F]*$/.test(str) +export const isASCII = (str: string) => /^[\u0000-\u007F]*$/.test(str) const EPOCH = 1712546615000n // follow repo created const MAX_TIMESTAMP_BITS = 41n // Maximum number of bits typically used for timestamp @@ -149,7 +149,7 @@ export const capitalizeFirstLetter = (string: string) => string.charAt(0).toUpperCase() + string.slice(1) export const omitObjectUndefinedValue = (obj: Record) => { - const newObj = {} + const newObj = {} as any for (const key in obj) { if (obj[key] !== undefined) { newObj[key] = obj[key] @@ -232,13 +232,13 @@ export function isKeyForMultiSelectPressed(e: MouseEvent) { export const toScientificNotation = (num: string, threshold: number) => { const cleanNum = num.replaceAll(",", "") const [intPart, decimalPart = ""] = cleanNum.split(".") - const numLength = intPart.replace(/^0+/, "").length + const numLength = intPart!.replace(/^0+/, "").length if (numLength > threshold) { const fullNum = intPart + decimalPart const firstDigit = fullNum.match(/[1-9]/)?.[0] || "0" const position = fullNum.indexOf(firstDigit) - const exponent = intPart.length - position - 1 + const exponent = intPart!.length - position - 1 const significand = fullNum.slice(position, position + 3) const formattedSignificand = `${significand[0]}.${significand.slice(1)}` diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 8ebcfd1ae8..5d2572d7de 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "baseUrl": ".", "declaration": false, - "types": ["@follow/types/global"], + "types": ["@follow/types/global", "@follow/types/vite"], "paths": { "@follow/utils/*": ["./src/*"] } diff --git a/packages/utils/vitest.config.ts b/packages/utils/vitest.config.ts index 22646f76e4..56e96463bb 100644 --- a/packages/utils/vitest.config.ts +++ b/packages/utils/vitest.config.ts @@ -27,6 +27,7 @@ export default defineProject({ }, plugins: [ + // @ts-expect-error tsconfigPath({ projects: ["./tsconfig.json"], }), diff --git a/plugins/vite/locales.ts b/plugins/vite/locales.ts index c471df9155..c37f5022f2 100644 --- a/plugins/vite/locales.ts +++ b/plugins/vite/locales.ts @@ -15,7 +15,7 @@ export function localesPlugin(): Plugin { const localesDir = path.resolve(__dirname, "../../locales") const namespaces = fs.readdirSync(localesDir).filter((dir) => dir !== ".DS_Store") - const languageResources = {} + const languageResources = {} as any namespaces.forEach((namespace) => { const namespacePath = path.join(localesDir, namespace) diff --git a/plugins/vite/utils/i18n-completeness.ts b/plugins/vite/utils/i18n-completeness.ts index 479e7790a5..ea703097b4 100644 --- a/plugins/vite/utils/i18n-completeness.ts +++ b/plugins/vite/utils/i18n-completeness.ts @@ -49,7 +49,7 @@ function calculateCompleteness(localesDir: string): LanguageCompletion { languages.forEach((lang) => { if (lang !== "en") { - const percent = Math.round((keyCount[lang] / enCount) * 100) + const percent = Math.round((keyCount[lang]! / enCount) * 100) completeness[lang] = percent } }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2362c057d..611beef23a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -388,6 +388,9 @@ importers: specifier: npm:@vscode/vscode-languagedetection@^1.0.22 version: '@vscode/vscode-languagedetection@1.0.22' devDependencies: + '@follow/types': + specifier: workspace:* + version: link:../../packages/types '@types/js-yaml': specifier: 4.0.9 version: 4.0.9 diff --git a/tsconfig.json b/tsconfig.json index 1eb64c31c9..c6b256ee4a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,9 @@ { "extends": "@electron-toolkit/tsconfig/tsconfig.node.json", "compilerOptions": { - "target": "ES2022" - } + "target": "ES2022", + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true + }, + "exclude": ["apps", "packages"] } From 776b67f34f5952efc3ee3da44456ea00cd81cba6 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sat, 18 Jan 2025 22:13:31 +0800 Subject: [PATCH 2/5] chore: update --- pnpm-lock.yaml | 251 ++++++++++--------------------------------------- 1 file changed, 50 insertions(+), 201 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 218fc86cf6..47598f7a75 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -613,9 +613,6 @@ importers: react-native-svg: specifier: 15.8.0 version: 15.8.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) - react-native-uikit-colors: - specifier: 0.1.1 - version: 0.1.1(nativewind@4.1.23(nstbpzfxmampvbdkx7dnhhhjzi))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2))) react-native-web: specifier: ~0.19.13 version: 0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -2478,8 +2475,8 @@ packages: resolution: {integrity: sha512-F+nKc0xW+kVbBRhFzaMgPy3KwmuNTYX1fx6+FxxoSnNgwYX6LD7AKBTWkU0MQ6IBoe7dz069CNkR673sPAgkCQ==} engines: {node: '>=14'} - '@electron/node-gyp@git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': - resolution: {commit: 06b29aafb7708acef8b3669835c8a7857ebc92d2, repo: git@github.com:electron/node-gyp.git, type: git} + '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': + resolution: {tarball: https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2} version: 10.2.0-electron.1 engines: {node: '>=12.13.0'} hasBin: true @@ -3366,9 +3363,6 @@ packages: '@expo/config-plugins@9.0.14': resolution: {integrity: sha512-Lx1ebV95rTFKKQmbu4wMPLz65rKn7mqSpfANdCx+KwRxuLY2JQls8V4h3lQjG6dW8NWf9qV5QaEFAgNB6VMyOQ==} - '@expo/config-types@52.0.1': - resolution: {integrity: sha512-vD8ZetyKV7U29lR6+NJohYeoLYTH+eNYXJeNiSOrWCz0witJYY11meMmEnpEaVbN89EfC6uauSUOa6wihtbyPQ==} - '@expo/config-types@52.0.3': resolution: {integrity: sha512-muxvuARmbysH5OGaiBRlh1Y6vfdmL56JtpXxB+y2Hfhu0ezG1U4FjZYBIacthckZPvnDCcP3xIu1R+eTo7/QFA==} @@ -3405,9 +3399,6 @@ packages: '@expo/json-file@8.3.3': resolution: {integrity: sha512-eZ5dld9AD0PrVRiIWpRkm5aIoWBw3kAyd8VkuWEy92sEthBKDDDHAnK2a0dw0Eil6j7rK7lS/Qaq/Zzngv2h5A==} - '@expo/json-file@9.0.0': - resolution: {integrity: sha512-M+55xFVrFzDcgMDf+52lPDLjKB5xwRfStWlv/b/Vu2OLgxGZLWpxoPYjlRoHqxjPbCQIi2ZCbobK+0KuNhsELg==} - '@expo/json-file@9.0.1': resolution: {integrity: sha512-ZVPhbbEBEwafPCJ0+kI25O2Iivt3XKHEKAADCml1q2cmOIbQnKgLyn8DpOJXqWEyRQr/VWS+hflBh8DU2YFSqg==} @@ -5959,10 +5950,6 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/scope-manager@8.17.0': - resolution: {integrity: sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.20.0': resolution: {integrity: sha512-J7+VkpeGzhOt3FeG1+SzhiMj9NzGD/M6KoGn9f4dbz3YzK9hvbhVTmLj/HiTp9DazIzJ8B4XcM80LrR9Dm1rJw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5974,39 +5961,16 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/types@8.17.0': - resolution: {integrity: sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.20.0': resolution: {integrity: sha512-cqaMiY72CkP+2xZRrFt3ExRBu0WmVitN/rYPZErA80mHjHx/Svgp8yfbzkJmDoQ/whcytOPO9/IZXnOc+wigRA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.17.0': - resolution: {integrity: sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/typescript-estree@8.20.0': resolution: {integrity: sha512-Y7ncuy78bJqHI35NwzWol8E0X7XkRVS4K4P4TCyzWkOJih5NDvtoRDW4Ba9YJJoB2igm9yXDdYI/+fkiiAxPzA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@8.17.0': - resolution: {integrity: sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - '@typescript-eslint/utils@8.20.0': resolution: {integrity: sha512-dq70RUw6UK9ei7vxc4KQtBRk7qkHZv447OUZ6RPQMQl71I3NZxQJX/f32Smr+iqWrB02pHKn2yAdHBb0KNrRMA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -6014,10 +5978,6 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/visitor-keys@8.17.0': - resolution: {integrity: sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/visitor-keys@8.20.0': resolution: {integrity: sha512-v/BpkeeYAsPkKCkR8BDwcno0llhzWVqPOamQrAEMdpZav2Y9OVjd9dwJyBLJWwf335B5DmlifECIkZRJCaGaHA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -8863,11 +8823,6 @@ packages: react: '*' react-native: '*' - expo-manifests@0.15.4: - resolution: {integrity: sha512-Ki6+twRbm+HTX3L8larhOdDbSYPG3ojGnZepR/+TGg3JF/5yyscosDVY6c6z8xEGjKIjs1F813yq9yAfiPh8/g==} - peerDependencies: - expo: '*' - expo-manifests@0.15.5: resolution: {integrity: sha512-3X3eQomnTa4G0Y9GoJeyewHPTscuzWMrTB3x4CknqOyXpGOJjOuCKjhzvccHxXZAt0XswqBI94iTbqIofo9Uqw==} peerDependencies: @@ -10887,9 +10842,6 @@ packages: magic-string@0.25.9: resolution: {integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==} - magic-string@0.30.14: - resolution: {integrity: sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==} - magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} @@ -11339,9 +11291,6 @@ packages: engines: {node: '>=10'} hasBin: true - mlly@1.7.3: - resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} - mlly@1.7.4: resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} @@ -12061,9 +12010,6 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} - pkg-types@1.2.1: - resolution: {integrity: sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==} - pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} @@ -12847,14 +12793,6 @@ packages: react: '*' react-native: '*' - react-native-uikit-colors@0.1.1: - resolution: {integrity: sha512-PNAXc/Pk/WYnU+/C1I7iaMCVdphjt/QRXqvq0cWDEDgX3ac0gP2H4RTb6xAJWGTsIbGYmtE+BNp5LnX0NgBibw==} - peerDependencies: - nativewind: '>=4.1.0' - react: '>=18.0.0' - react-native: '>=0.76.0' - tailwindcss: '>=3.0.0' - react-native-web@0.19.13: resolution: {integrity: sha512-etv3bN8rJglrRCp/uL4p7l8QvUNUC++QwDbdZ8CB7BvZiMvsxfFIRM1j04vxNldG3uo2puRd6OSWR3ibtmc29A==} peerDependencies: @@ -14210,12 +14148,6 @@ packages: truncate-utf8-bytes@1.0.2: resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} - ts-api-utils@1.4.3: - resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==} - engines: {node: '>=16'} - peerDependencies: - typescript: '>=4.2.0' - ts-api-utils@2.0.0: resolution: {integrity: sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==} engines: {node: '>=18.12'} @@ -16625,7 +16557,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@electron/node-gyp@git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': + '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.1 @@ -16725,7 +16657,7 @@ snapshots: '@electron/rebuild@3.7.1': dependencies: - '@electron/node-gyp': git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2 + '@electron/node-gyp': https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2 '@malept/cross-spawn-promise': 2.0.0 chalk: 4.1.2 debug: 4.4.0(supports-color@8.1.1) @@ -17332,16 +17264,16 @@ snapshots: '@0no-co/graphql.web': 1.0.12(graphql@16.8.1) '@babel/runtime': 7.26.0 '@expo/code-signing-certificates': 0.0.5 - '@expo/config': 10.0.6 - '@expo/config-plugins': 9.0.12 + '@expo/config': 10.0.8 + '@expo/config-plugins': 9.0.14 '@expo/devcert': 1.1.4 '@expo/env': 0.4.0 '@expo/image-utils': 0.6.3 - '@expo/json-file': 9.0.0 + '@expo/json-file': 9.0.1 '@expo/metro-config': 0.19.8 '@expo/osascript': 2.1.4 '@expo/package-manager': 1.6.1 - '@expo/plist': 0.2.0 + '@expo/plist': 0.2.1 '@expo/prebuild-config': 8.0.23 '@expo/rudder-sdk-node': 1.1.1(encoding@0.1.13) '@expo/spawn-async': 1.7.2 @@ -17495,9 +17427,9 @@ snapshots: '@expo/config-plugins@9.0.12': dependencies: - '@expo/config-types': 52.0.1 - '@expo/json-file': 9.0.0 - '@expo/plist': 0.2.0 + '@expo/config-types': 52.0.3 + '@expo/json-file': 9.0.1 + '@expo/plist': 0.2.1 '@expo/sdk-runtime-versions': 1.0.0 chalk: 4.1.2 debug: 4.4.0(supports-color@8.1.1) @@ -17531,16 +17463,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@expo/config-types@52.0.1': {} - '@expo/config-types@52.0.3': {} '@expo/config@10.0.6': dependencies: '@babel/code-frame': 7.10.4 - '@expo/config-plugins': 9.0.12 - '@expo/config-types': 52.0.1 - '@expo/json-file': 9.0.0 + '@expo/config-plugins': 9.0.14 + '@expo/config-types': 52.0.3 + '@expo/json-file': 9.0.1 deepmerge: 4.3.1 getenv: 1.0.0 glob: 10.4.5 @@ -17669,12 +17599,6 @@ snapshots: json5: 2.2.3 write-file-atomic: 2.4.3 - '@expo/json-file@9.0.0': - dependencies: - '@babel/code-frame': 7.10.4 - json5: 2.2.3 - write-file-atomic: 2.4.3 - '@expo/json-file@9.0.1': dependencies: '@babel/code-frame': 7.10.4 @@ -17692,9 +17616,9 @@ snapshots: '@babel/generator': 7.26.3 '@babel/parser': 7.26.3 '@babel/types': 7.26.3 - '@expo/config': 10.0.6 + '@expo/config': 10.0.8 '@expo/env': 0.4.0 - '@expo/json-file': 9.0.0 + '@expo/json-file': 9.0.1 '@expo/spawn-async': 1.7.2 chalk: 4.1.2 debug: 4.4.0(supports-color@8.1.1) @@ -17715,9 +17639,9 @@ snapshots: '@babel/generator': 7.26.3 '@babel/parser': 7.26.3 '@babel/types': 7.26.3 - '@expo/config': 10.0.6 + '@expo/config': 10.0.8 '@expo/env': 0.4.0 - '@expo/json-file': 9.0.0 + '@expo/json-file': 9.0.1 '@expo/spawn-async': 1.7.2 chalk: 4.1.2 debug: 4.4.0(supports-color@8.1.1) @@ -17747,7 +17671,7 @@ snapshots: '@expo/package-manager@1.6.1': dependencies: - '@expo/json-file': 9.0.0 + '@expo/json-file': 9.0.1 '@expo/spawn-async': 1.7.2 ansi-regex: 5.0.1 chalk: 4.1.2 @@ -17804,11 +17728,11 @@ snapshots: '@expo/prebuild-config@8.0.17': dependencies: - '@expo/config': 10.0.6 - '@expo/config-plugins': 9.0.12 - '@expo/config-types': 52.0.1 + '@expo/config': 10.0.8 + '@expo/config-plugins': 9.0.14 + '@expo/config-types': 52.0.3 '@expo/image-utils': 0.6.3 - '@expo/json-file': 9.0.0 + '@expo/json-file': 9.0.1 '@react-native/normalize-colors': 0.76.2 debug: 4.4.0(supports-color@8.1.1) fs-extra: 9.1.0 @@ -17820,11 +17744,11 @@ snapshots: '@expo/prebuild-config@8.0.23': dependencies: - '@expo/config': 10.0.6 - '@expo/config-plugins': 9.0.12 - '@expo/config-types': 52.0.1 + '@expo/config': 10.0.8 + '@expo/config-plugins': 9.0.14 + '@expo/config-types': 52.0.3 '@expo/image-utils': 0.6.3 - '@expo/json-file': 9.0.0 + '@expo/json-file': 9.0.1 '@react-native/normalize-colors': 0.76.5 debug: 4.4.0(supports-color@8.1.1) fs-extra: 9.1.0 @@ -18392,7 +18316,7 @@ snapshots: debug: 4.4.0(supports-color@8.1.1) kolorist: 1.8.0 local-pkg: 0.5.1 - mlly: 1.7.3 + mlly: 1.7.4 transitivePeerDependencies: - supports-color @@ -20730,7 +20654,7 @@ snapshots: '@stylistic/eslint-plugin@2.13.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2)': dependencies: - '@typescript-eslint/utils': 8.17.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2) + '@typescript-eslint/utils': 8.20.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2) eslint: 9.18.0(jiti@2.4.2) eslint-visitor-keys: 4.2.0 espree: 10.3.0 @@ -21119,11 +21043,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.17.0': - dependencies: - '@typescript-eslint/types': 8.17.0 - '@typescript-eslint/visitor-keys': 8.17.0 - '@typescript-eslint/scope-manager@8.20.0': dependencies: '@typescript-eslint/types': 8.20.0 @@ -21140,25 +21059,8 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.17.0': {} - '@typescript-eslint/types@8.20.0': {} - '@typescript-eslint/typescript-estree@8.17.0(typescript@5.7.2)': - dependencies: - '@typescript-eslint/types': 8.17.0 - '@typescript-eslint/visitor-keys': 8.17.0 - debug: 4.4.0(supports-color@8.1.1) - fast-glob: 3.3.2 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 1.4.3(typescript@5.7.2) - optionalDependencies: - typescript: 5.7.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/typescript-estree@8.20.0(typescript@5.7.2)': dependencies: '@typescript-eslint/types': 8.20.0 @@ -21173,18 +21075,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.17.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2)': - dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0(jiti@2.4.2)) - '@typescript-eslint/scope-manager': 8.17.0 - '@typescript-eslint/types': 8.17.0 - '@typescript-eslint/typescript-estree': 8.17.0(typescript@5.7.2) - eslint: 9.18.0(jiti@2.4.2) - optionalDependencies: - typescript: 5.7.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/utils@8.20.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0(jiti@2.4.2)) @@ -21196,11 +21086,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.17.0': - dependencies: - '@typescript-eslint/types': 8.17.0 - eslint-visitor-keys: 4.2.0 - '@typescript-eslint/visitor-keys@8.20.0': dependencies: '@typescript-eslint/types': 8.20.0 @@ -21342,7 +21227,7 @@ snapshots: browserslist: 4.24.2 browserslist-to-esbuild: 2.1.1(browserslist@4.24.2) core-js: 3.39.0 - magic-string: 0.30.14 + magic-string: 0.30.17 regenerator-runtime: 0.14.1 systemjs: 6.15.1 terser: 5.35.0 @@ -21372,7 +21257,7 @@ snapshots: dependencies: '@vitest/spy': 2.1.8 estree-walker: 3.0.3 - magic-string: 0.30.14 + magic-string: 0.30.17 optionalDependencies: vite: 5.4.11(@types/node@22.10.1)(lightningcss@1.28.2)(terser@5.35.0) @@ -21388,7 +21273,7 @@ snapshots: '@vitest/snapshot@2.1.8': dependencies: '@vitest/pretty-format': 2.1.8 - magic-string: 0.30.14 + magic-string: 0.30.17 pathe: 1.1.2 '@vitest/spy@2.1.8': @@ -22370,11 +22255,11 @@ snapshots: dotenv: 16.4.7 giget: 1.2.3 jiti: 1.21.6 - mlly: 1.7.3 + mlly: 1.7.4 ohash: 1.1.4 pathe: 1.1.2 perfect-debounce: 1.0.0 - pkg-types: 1.2.1 + pkg-types: 1.3.1 rc9: 2.1.2 cac@6.7.14: {} @@ -23767,7 +23652,7 @@ snapshots: '@babel/plugin-transform-arrow-functions': 7.25.9(@babel/core@7.26.0) cac: 6.7.14 esbuild: 0.21.5 - magic-string: 0.30.14 + magic-string: 0.30.17 picocolors: 1.1.1 vite: 6.0.3(@types/node@22.10.1)(jiti@2.4.2)(lightningcss@1.28.2)(terser@5.35.0)(tsx@4.19.2)(yaml@2.6.1) transitivePeerDependencies: @@ -24297,8 +24182,8 @@ snapshots: eslint-plugin-import-x@4.6.1(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2): dependencies: '@types/doctrine': 0.0.9 - '@typescript-eslint/scope-manager': 8.17.0 - '@typescript-eslint/utils': 8.17.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2) + '@typescript-eslint/scope-manager': 8.20.0 + '@typescript-eslint/utils': 8.20.0(eslint@9.18.0(jiti@2.4.2))(typescript@5.7.2) debug: 4.4.0(supports-color@8.1.1) doctrine: 3.0.0 enhanced-resolve: 5.18.0 @@ -24740,7 +24625,7 @@ snapshots: expo-constants@17.0.3(4zmahxl5ymv4iqnmz7u7srsqim): dependencies: - '@expo/config': 10.0.6 + '@expo/config': 10.0.8 '@expo/env': 0.4.0 expo: 52.0.23(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) @@ -24750,7 +24635,7 @@ snapshots: expo-constants@17.0.3(yviy5suycsk3aacmyts4vro3la): dependencies: - '@expo/config': 10.0.6 + '@expo/config': 10.0.8 '@expo/env': 0.4.0 expo: 52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) @@ -24864,14 +24749,6 @@ snapshots: - expo - supports-color - expo-manifests@0.15.4(expo@52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)): - dependencies: - '@expo/config': 10.0.6 - expo: 52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) - expo-json-utils: 0.14.0 - transitivePeerDependencies: - - supports-color - expo-manifests@0.15.5(expo@52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)): dependencies: '@expo/config': 10.0.8 @@ -24989,14 +24866,14 @@ snapshots: expo-updates@0.26.10(encoding@0.1.13)(expo@52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react@18.3.1): dependencies: '@expo/code-signing-certificates': 0.0.5 - '@expo/config': 10.0.6 - '@expo/config-plugins': 9.0.12 + '@expo/config': 10.0.8 + '@expo/config-plugins': 9.0.14 '@expo/spawn-async': 1.7.2 arg: 4.1.0 chalk: 4.1.2 expo: 52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) expo-eas-client: 0.13.1 - expo-manifests: 0.15.4(expo@52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)) + expo-manifests: 0.15.5(expo@52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)) expo-structured-headers: 4.0.0 expo-updates-interface: 1.0.0(expo@52.0.18(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@expo/metro-runtime@4.0.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)))(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1)(react-native-webview@13.12.5(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)) fast-glob: 3.3.2 @@ -25017,8 +24894,8 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 '@expo/cli': 0.22.5(bufferutil@4.0.8)(encoding@0.1.13)(graphql@16.8.1) - '@expo/config': 10.0.6 - '@expo/config-plugins': 9.0.12 + '@expo/config': 10.0.8 + '@expo/config-plugins': 9.0.14 '@expo/fingerprint': 0.11.3 '@expo/metro-config': 0.19.7 '@expo/vector-icons': 14.0.4 @@ -27111,12 +26988,12 @@ snapshots: local-pkg@0.5.1: dependencies: - mlly: 1.7.3 - pkg-types: 1.2.1 + mlly: 1.7.4 + pkg-types: 1.3.1 local-pkg@1.0.0: dependencies: - mlly: 1.7.3 + mlly: 1.7.4 pkg-types: 1.3.1 locate-path@2.0.0: @@ -27251,16 +27128,12 @@ snapshots: magic-string-ast@0.6.3: dependencies: - magic-string: 0.30.14 + magic-string: 0.30.17 magic-string@0.25.9: dependencies: sourcemap-codec: 1.4.8 - magic-string@0.30.14: - dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 - magic-string@0.30.17: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -28054,13 +27927,6 @@ snapshots: mkdirp@3.0.1: {} - mlly@1.7.3: - dependencies: - acorn: 8.14.0 - pathe: 1.1.2 - pkg-types: 1.2.1 - ufo: 1.5.4 - mlly@1.7.4: dependencies: acorn: 8.14.0 @@ -28341,7 +28207,7 @@ snapshots: consola: 3.2.3 execa: 8.0.1 pathe: 1.1.2 - pkg-types: 1.2.1 + pkg-types: 1.3.1 ufo: 1.5.4 oauth4webapi@3.1.3: {} @@ -28799,12 +28665,6 @@ snapshots: dependencies: find-up: 4.1.0 - pkg-types@1.2.1: - dependencies: - confbox: 0.1.8 - mlly: 1.7.3 - pathe: 1.1.2 - pkg-types@1.3.1: dependencies: confbox: 0.1.8 @@ -29514,13 +29374,6 @@ snapshots: react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) warn-once: 0.1.1 - react-native-uikit-colors@0.1.1(nativewind@4.1.23(nstbpzfxmampvbdkx7dnhhhjzi))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2))): - dependencies: - nativewind: 4.1.23(nstbpzfxmampvbdkx7dnhhhjzi) - react: 18.3.1 - react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) - tailwindcss: 3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2)) - react-native-web@0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 @@ -31152,10 +31005,6 @@ snapshots: dependencies: utf8-byte-length: 1.0.5 - ts-api-utils@1.4.3(typescript@5.7.2): - dependencies: - typescript: 5.7.2 - ts-api-utils@2.0.0(typescript@5.7.2): dependencies: typescript: 5.7.2 @@ -31795,7 +31644,7 @@ snapshots: chai: 5.1.2 debug: 4.4.0(supports-color@8.1.1) expect-type: 1.1.0 - magic-string: 0.30.14 + magic-string: 0.30.17 pathe: 1.1.2 std-env: 3.8.0 tinybench: 2.9.0 From bdf5ccb9245f5c48b619b017e09a976166718939 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sat, 18 Jan 2025 22:15:00 +0800 Subject: [PATCH 3/5] chore: update --- pnpm-lock.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 47598f7a75..123e840be7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -613,6 +613,9 @@ importers: react-native-svg: specifier: 15.8.0 version: 15.8.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1) + react-native-uikit-colors: + specifier: 0.1.1 + version: 0.1.1(nativewind@4.1.23(nstbpzfxmampvbdkx7dnhhhjzi))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2))) react-native-web: specifier: ~0.19.13 version: 0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -12793,6 +12796,14 @@ packages: react: '*' react-native: '*' + react-native-uikit-colors@0.1.1: + resolution: {integrity: sha512-PNAXc/Pk/WYnU+/C1I7iaMCVdphjt/QRXqvq0cWDEDgX3ac0gP2H4RTb6xAJWGTsIbGYmtE+BNp5LnX0NgBibw==} + peerDependencies: + nativewind: '>=4.1.0' + react: '>=18.0.0' + react-native: '>=0.76.0' + tailwindcss: '>=3.0.0' + react-native-web@0.19.13: resolution: {integrity: sha512-etv3bN8rJglrRCp/uL4p7l8QvUNUC++QwDbdZ8CB7BvZiMvsxfFIRM1j04vxNldG3uo2puRd6OSWR3ibtmc29A==} peerDependencies: @@ -29374,6 +29385,13 @@ snapshots: react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) warn-once: 0.1.1 + react-native-uikit-colors@0.1.1(nativewind@4.1.23(nstbpzfxmampvbdkx7dnhhhjzi))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2))): + dependencies: + nativewind: 4.1.23(nstbpzfxmampvbdkx7dnhhhjzi) + react: 18.3.1 + react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1) + tailwindcss: 3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2)) + react-native-web@0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 From 1c2d093f58061adea7bc89294f055b3c4e5b3b13 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sat, 18 Jan 2025 22:20:10 +0800 Subject: [PATCH 4/5] chore: type --- apps/mobile/src/screens/(modal)/add.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/mobile/src/screens/(modal)/add.tsx b/apps/mobile/src/screens/(modal)/add.tsx index ee30f6ea47..11a2998903 100644 --- a/apps/mobile/src/screens/(modal)/add.tsx +++ b/apps/mobile/src/screens/(modal)/add.tsx @@ -10,6 +10,7 @@ export default function Add() { const [url, setUrl] = useState("") const label = useColor("label") + // @ts-expect-error FIXME: use the right color const disabled = useColor("disabled") return ( From 2c1915e03addd1ee05dd3b1aa0073a976264351b Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sat, 18 Jan 2025 22:34:44 +0800 Subject: [PATCH 5/5] chore: update --- apps/renderer/src/store/entry/store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/renderer/src/store/entry/store.ts b/apps/renderer/src/store/entry/store.ts index 5795ccaae6..f7ebaf3e96 100644 --- a/apps/renderer/src/store/entry/store.ts +++ b/apps/renderer/src/store/entry/store.ts @@ -295,7 +295,7 @@ class EntryActions { draft.internal_feedId2entryIdSet[item.feeds.id]!.add(item.entries.id) } - // @ts-expect-error + // @ts-expect-error FIXME: fix this draft.flatMapEntries[item.entries.id] = merge( draft.flatMapEntries[item.entries.id] || {}, { @@ -327,7 +327,7 @@ class EntryActions { draft.internal_feedId2entryIdSet[inboxId].add(item.entries.id) } - // @ts-expect-error + // @ts-expect-error FIXME: fix this draft.flatMapEntries[item.entries.id] = merge( draft.flatMapEntries[item.entries.id] || {}, {