feeds-fun 1.22.5 → 1.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feeds-fun",
3
- "version": "1.22.5",
3
+ "version": "1.22.6",
4
4
  "author": "Aliaksei Yaletski (Tiendil) <a.eletsky@gmail.com> (https://tiendil.org/)",
5
5
  "description": "Frontend for the Feeds Fun — web-based news reader",
6
6
  "keywords": [
@@ -4,7 +4,7 @@ export const version = __APP_VERSION__;
4
4
 
5
5
  export const authRefreshInterval = import.meta.env.VITE_FFUN_AUTH_REFRESH_INTERVAL || 10 * 60 * 1000;
6
6
 
7
- export const blog = import.meta.env.VITE_FFUN_BLOG || "https://blog.feeds.fun";
7
+ export const blog = import.meta.env.VITE_FFUN_BLOG || "https://feeds.fun/blog";
8
8
  export const roadmap = import.meta.env.VITE_FFUN_ROADMAP || "https://github.com/users/Tiendil/projects/1";
9
9
  export const githubRepo = import.meta.env.VITE_FFUN_GITHUB_REPO || "https://github.com/Tiendil/feeds.fun";
10
10
  export const discordInvite = import.meta.env.VITE_FFUN_DISCORD_INVITE || "https://discord.gg/C5RVusHQXy";
@@ -137,7 +137,7 @@ export function chooseTagByUsage({
137
137
  exclude = [];
138
138
  }
139
139
 
140
- const tags = _.toPairs(tagsCount).sort((a, b) => {
140
+ const tags = _.toPairs(tagsCount).sort((a: [string, number], b: [string, number]) => {
141
141
  if (a[1] === b[1]) {
142
142
  return a[0].localeCompare(b[0]);
143
143
  }
@@ -139,19 +139,22 @@ export const useGlobalSettingsStore = defineStore("globalSettings", () => {
139
139
  );
140
140
  }
141
141
 
142
- function enumBackendSettings(kind: string, enumProperties: any) {
143
- const defaultEntry = _.find([...enumProperties], ([, prop]) => prop.default);
142
+ function enumBackendSettings<TValue extends t.UserSettingsValue, TProperty extends {default?: boolean}>(
143
+ kind: string,
144
+ enumProperties: Map<TValue, TProperty>
145
+ ) {
146
+ const defaultEntry = _.find([...enumProperties], ([, prop]: [TValue, TProperty]) => prop.default === true);
144
147
 
145
148
  if (!defaultEntry) {
146
149
  throw new Error(`No default entry found for enum "${kind}"`);
147
150
  }
148
151
 
149
- let defaultValue = defaultEntry[0];
152
+ let defaultValue: TValue = defaultEntry[0];
150
153
 
151
154
  return backendSettings(
152
155
  kind,
153
156
  (rawValue: t.UserSettingsValue) => {
154
- return enumProperties.has(rawValue);
157
+ return enumProperties.has(rawValue as TValue);
155
158
  },
156
159
  defaultValue
157
160
  );
package/vitest.config.ts CHANGED
@@ -8,6 +8,7 @@ export default mergeConfig(
8
8
  defineConfig({
9
9
  test: {
10
10
  environment: 'jsdom',
11
+ dir: 'src',
11
12
  exclude: [...configDefaults.exclude, 'e2e/*'],
12
13
  root: fileURLToPath(new URL('./', import.meta.url))
13
14
  }