Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions apps/self-hosted/config.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
}
},
"features": {
"postsFilters": ["blog", "posts", "comments", "replies"],
"postsFilters": [
"blog",
"posts",
"comments",
"replies"
],
"likes": {
"enabled": true
},
Expand All @@ -60,9 +65,28 @@
},
"auth": {
"enabled": true,
"methods": ["keychain", "hivesigner", "hiveauth"]
"methods": [
"keychain",
"hivesigner",
"hiveauth"
]
},
"tipping": {
"general": {
"enabled": false,
"buttonLabel": "Tip"
},
"post": {
"enabled": false,
"buttonLabel": "Tip"
},
"amounts": [
1,
5,
10
]
}
}
}
}
}
}
5 changes: 5 additions & 0 deletions apps/self-hosted/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"preview": "rsbuild preview"
},
"dependencies": {
"@floating-ui/dom": "^1.7.4",
"@floating-ui/react-dom": "^2.1.6",
Comment on lines +14 to +15
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for direct imports of `@floating-ui/dom` in tipping code
rg -n --type ts --type tsx "from ['\"]@floating-ui/dom['\"]" || echo "No direct imports found"

Repository: ecency/vision-next

Length of output: 130


🏁 Script executed:

#!/bin/bash
# Locate web app package.json (typically at apps/web or similar)
find . -name "package.json" -type f | grep -E "(web|app)" | head -10

Repository: ecency/vision-next

Length of output: 527


🏁 Script executed:

#!/bin/bash
# List all package.json files in the repository
find . -name "package.json" -type f | head -20

Repository: ecency/vision-next

Length of output: 1236


🏁 Script executed:

#!/bin/bash
# Read web app package.json dependencies
cat ./apps/web/package.json | grep -A 50 '"dependencies"' | head -80

Repository: ecency/vision-next

Length of output: 2028


🏁 Script executed:

#!/bin/bash
# Broader search for `@floating-ui/dom` usage with adjusted pattern
rg "@floating-ui/dom" --type ts -n || echo "No `@floating-ui/dom` references found"

Repository: ecency/vision-next

Length of output: 978


🏁 Script executed:

#!/bin/bash
# Check if `@floating-ui/dom`, qrcode, `@rsbuild/plugin-node-polyfill`, `@types/qrcode` are in web app
cat ./apps/web/package.json | grep -E '"(`@floating-ui`|qrcode|@rsbuild/plugin-node-polyfill|@types/qrcode)"'

Repository: ecency/vision-next

Length of output: 116


🏁 Script executed:

#!/bin/bash
# Read web app devDependencies
cat ./apps/web/package.json | grep -A 100 '"devDependencies"' | grep -E '(`@rsbuild/plugin-node-polyfill`|@types/qrcode)'

Repository: ecency/vision-next

Length of output: 92


🏁 Script executed:

#!/bin/bash
# Also check self-hosted versions to compare side-by-side
echo "=== Self-hosted versions ===" && \
cat ./apps/self-hosted/package.json | grep -E '"(`@floating-ui`|qrcode|@rsbuild|@types/qrcode)"' && \
echo "" && echo "=== Web app versions ===" && \
cat ./apps/web/package.json | grep -E '"(`@floating-ui`|qrcode|@rsbuild|@types/qrcode)"'

Repository: ecency/vision-next

Length of output: 226


Align dependency versions between self-hosted and web app packages.

The @floating-ui/dom dependency is not redundant—it's directly imported in apps/self-hosted/src/features/tipping/components/tip-button.tsx (e.g., import { autoUpdate, offset } from "@floating-ui/dom"), and multiple files in the web app also import directly from it.

However, the self-hosted package has version mismatches with the web app:

  • @floating-ui/dom: self-hosted uses ^1.7.4 while web app uses ^1.6.13
  • @floating-ui/react-dom: self-hosted uses ^2.1.6 while web app uses ^2.1.2
  • qrcode: self-hosted uses ^1.5.4 while web app uses ^1.5.3
  • @rsbuild/plugin-node-polyfill: added to self-hosted devDeps but not present in web app

Update the web app's package.json to match self-hosted versions, or justify version differences if intentional.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/self-hosted/package.json` around lines 14 - 15, The web app's
package.json must be aligned to the self-hosted package versions: update the web
app package.json dependencies to use "@floating-ui/dom": "^1.7.4",
"@floating-ui/react-dom": "^2.1.6", and "qrcode": "^1.5.4" (these are required
because files like
apps/self-hosted/src/features/tipping/components/tip-button.tsx import
autoUpdate and offset from "@floating-ui/dom"), and either add the devDependency
"@rsbuild/plugin-node-polyfill" to the web app devDependencies or add a short
justification comment in the PR explaining why the web app should intentionally
keep a different set; ensure package.json keys are updated (not duplicate) and
run install to verify no resolution conflicts.

"@ecency/render-helper": "workspace:*",
"@ecency/sdk": "workspace:*",
"@ecency/ui": "workspace:*",
Expand Down Expand Up @@ -38,6 +40,7 @@
"hivesigner": "^3.3.5",
"marked": "^12.0.0",
"motion": "^12.23.22",
"qrcode": "^1.5.4",
"qrcode.react": "^4.2.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
Expand All @@ -50,6 +53,7 @@
"devDependencies": {
"@biomejs/biome": "2.2.3",
"@rsbuild/core": "^1.5.6",
"@rsbuild/plugin-node-polyfill": "^1.4.4",
"@rsbuild/plugin-react": "^1.4.0",
"@tailwindcss/postcss": "^4.1.13",
"@tanstack/react-query-devtools": "^5.90.2",
Expand All @@ -58,6 +62,7 @@
"@types/dompurify": "^3.0.5",
"@types/node": "^24.6.0",
"@types/turndown": "^5.0.0",
"@types/qrcode": "^1.5.5",
"@types/react": "^19.1.16",
"@types/react-dom": "^19.1.9",
"@types/speakingurl": "^13.0.6",
Expand Down
13 changes: 12 additions & 1 deletion apps/self-hosted/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import path from 'node:path';
import { createRequire } from 'node:module';
import { fileURLToPath } from 'node:url';
import { defineConfig } from '@rsbuild/core';
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
import { pluginReact } from '@rsbuild/plugin-react';
import { tanstackRouter } from '@tanstack/router-plugin/rspack';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const require = createRequire(import.meta.url);
const bip39Resolved = require.resolve('bip39', {
paths: [__dirname, path.join(__dirname, 'node_modules/@ecency/wallets')],
});

export default defineConfig({
plugins: [pluginReact()],
plugins: [pluginReact(), pluginNodePolyfill()],
resolve: {
alias: {
'@': './src',
// bip39 has only named exports; wallets uses default import — shim provides default
'bip39': path.resolve(__dirname, 'src/shim-bip39.ts'),
'bip39-original': bip39Resolved,
},
},
tools: {
Expand All @@ -22,6 +31,8 @@ export default defineConfig({
react: path.resolve(__dirname, 'node_modules/react'),
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
'@ecency/ui': path.resolve(__dirname, '../../packages/ui/dist/index.js'),
'bip39': path.resolve(__dirname, 'src/shim-bip39.ts'),
'bip39-original': bip39Resolved,
},
},
plugins: [
Expand Down
6 changes: 6 additions & 0 deletions apps/self-hosted/src/core/configuration-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ export interface InstanceConfig {
post: {
text2Speech: { enabled: boolean };
};
tipping?: {
enabled?: boolean;
general?: { enabled: boolean; buttonLabel?: string };
post?: { enabled: boolean; buttonLabel?: string };
amounts?: number[];
};
Comment on lines +71 to +76
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Top-level tipping.enabled is a schema orphan.

The enabled?: boolean at the tipping root level is absent from both config.template.json and config-fields.ts. The per-variant general.enabled and post.enabled are the actual feature toggles, making the top-level field redundant and potentially confusing to anyone reading the type.

🔧 Suggested cleanup
 tipping?: {
-  enabled?: boolean;
   general?: { enabled: boolean; buttonLabel?: string };
   post?: { enabled: boolean; buttonLabel?: string };
   amounts?: number[];
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tipping?: {
enabled?: boolean;
general?: { enabled: boolean; buttonLabel?: string };
post?: { enabled: boolean; buttonLabel?: string };
amounts?: number[];
};
tipping?: {
general?: { enabled: boolean; buttonLabel?: string };
post?: { enabled: boolean; buttonLabel?: string };
amounts?: number[];
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/self-hosted/src/core/configuration-loader.ts` around lines 71 - 76, The
top-level optional property tipping.enabled is an orphan and should be removed:
delete the enabled?: boolean from the tipping type in configuration-loader.ts so
the shape only contains general, post and amounts (with general.enabled and
post.enabled as the feature toggles); update the corresponding schema/template
(config.template.json) and the config-fields.ts to remove references to
tipping.enabled so runtime validation and UI fields align with the type.

auth: {
enabled: boolean;
methods: string[];
Expand Down
Loading