Skip to content
Merged
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
17 changes: 11 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 22
- run: corepack enable
- name: Install dependencies (with Node v22)
run: yarn install --frozen-lockfile --ignore-engines
run: yarn install --immutable
# make sure the ipfs executable is executable
- name: Download IPFS and set permissions (with Node v22)
run: node electron/download-ipfs && sudo chmod +x bin/linux/ipfs
Expand Down Expand Up @@ -77,6 +78,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 22
- run: corepack enable
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
Expand All @@ -89,7 +91,7 @@ jobs:
- run: pip install setuptools

- name: Install dependencies (with Node v22)
run: yarn install --frozen-lockfile --ignore-engines
run: yarn install --immutable
# make sure the ipfs executable is executable
- name: Download IPFS and set permissions (with Node v22)
run: node electron/download-ipfs && sudo chmod +x bin/mac/ipfs
Expand Down Expand Up @@ -132,8 +134,9 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 22
- name: Install dependencies (with Node v22) # --network-timeout and --network-concurrency are yarn v1 flags.
run: yarn install --frozen-lockfile --network-timeout 100000 --network-concurrency 1
- run: corepack enable
- name: Install dependencies (with Node v22)
run: yarn install --immutable
Comment on lines +137 to +139
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistency: Windows job omits --ignore-engines.

Other jobs (Linux at line 33, Mac at line 94, Android at line 182, finalize-release at line 225) use --ignore-engines, but the Windows job does not. This could cause failures if engine constraints don't match on Windows runners.

🛠️ Proposed fix for consistency
      - run: corepack enable
      - name: Install dependencies (with Node v22)
-       run: yarn install --immutable
+       run: yarn install --immutable --ignore-engines
📝 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
- run: corepack enable
- name: Install dependencies (with Node v22)
run: yarn install --immutable
- run: corepack enable
- name: Install dependencies (with Node v22)
run: yarn install --immutable --ignore-engines
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 137 - 139, Add the missing
--ignore-engines flag to the Windows job's yarn install step to match other
jobs: update the run command that currently uses "yarn install --immutable" in
the Windows job (the step following "corepack enable") to include
"--ignore-engines" so it reads "yarn install --immutable --ignore-engines",
ensuring consistent behavior with the Linux, Mac, Android, and finalize-release
jobs.

- name: Build React app (with Node v22)
run: npx cross-env NODE_ENV=production yarn build
- name: Build Electron app for Windows (x64)
Expand Down Expand Up @@ -171,11 +174,12 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 22
- run: corepack enable
- run: sudo apt install -y apksigner zipalign

# install all dependencies (including devDependencies needed for React build)
- name: Install dependencies (with Node v22)
run: yarn install --frozen-lockfile --ignore-engines
run: yarn install --immutable
# build react app
- run: CI='' NODE_ENV=production yarn build
# set android versionCode and versionName
Expand Down Expand Up @@ -216,8 +220,9 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 22
- run: corepack enable
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines
run: yarn install --immutable
- name: Generate final release body from GitHub assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- run: corepack enable

- name: Cache electron binaries
uses: actions/cache@v4
Expand All @@ -32,7 +32,7 @@ jobs:
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
yarn install --immutable && break
sleep 5
[ "$i" = "3" ] && exit 1
done
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- run: corepack enable

- name: Install setuptools for native modules
run: pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
Expand All @@ -105,7 +105,7 @@ jobs:
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
yarn install --immutable && break
sleep 5
[ "$i" = "3" ] && exit 1
done
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- run: corepack enable

- name: Install setuptools for native modules
run: pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
Expand All @@ -166,7 +166,7 @@ jobs:
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
yarn install --immutable && break
sleep 5
[ "$i" = "3" ] && exit 1
done
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- run: corepack enable

- name: Cache electron binaries
uses: actions/cache@v4
Expand All @@ -225,7 +225,7 @@ jobs:
run: |
for i in 1 2 3; do
echo "yarn install attempt $i"
yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1 && break
yarn install --immutable && break
sleep 5
[ "$i" = "3" ] && exit 1
done
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.12.0
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
21 changes: 12 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ Seedit is a serverless, adminless, decentralized Reddit alternative built on the
- **Vite** for bundling
- **plebbit-react-hooks** for Plebbit protocol integration
- **i18next** for translations
- **yarn** as package manager
- **Node 22.12.0** via `.nvmrc`
- **Yarn 4** via **Corepack**; run `corepack enable` once, then use plain `yarn install` / `yarn build` / `yarn test`
- **oxlint** for linting
- **oxfmt** for formatting
- **tsgo** for type checking (native TypeScript compiler)

## Commands

```bash
yarn install # Install dependencies
nvm install && nvm use
corepack enable
yarn install
yarn start # Start dev server (port 3000)
yarn build # Production build
yarn test # Run tests
Expand Down Expand Up @@ -118,15 +121,15 @@ Set up these hooks for this project:
| Hook | Command | Purpose |
|------|---------|---------|
| `afterFileEdit` | `npx oxfmt <file>` | Auto-format files after AI edits |
| `stop` | `yarn build && yarn lint && yarn type-check && (yarn audit || true)` | Build, verify code, and check security when agent finishes. Note: `yarn audit` returns non-zero on vulnerabilities, so `|| true` makes it informational only |
| `stop` | `corepack yarn build && corepack yarn lint && corepack yarn type-check && (corepack yarn npm audit || true)` | Build, verify code, and check security when agent finishes. Note: `yarn npm audit` returns non-zero on vulnerabilities, so `|| true` makes it informational only |

### Why Use Hooks

- **Consistent formatting** — Every file follows the same style
- **Catch build errors** — `yarn build` catches compilation errors that would break production
- **Catch issues early** — Lint and type errors are caught before commit/CI
- **Security awareness** — `yarn audit` flags known vulnerabilities in dependencies
- **Less manual work** — No need to run `yarn build`, `yarn lint`, `yarn type-check`, `yarn audit` manually
- **Security awareness** — `yarn npm audit` flags known vulnerabilities in dependencies
- **Less manual work** — No need to run `yarn build`, `yarn lint`, `yarn type-check`, `yarn npm audit` manually

### Example Hook Scripts

Expand All @@ -151,10 +154,10 @@ exit 0
# Run build, lint, type-check, and security audit when agent finishes

cat > /dev/null # consume stdin
echo "=== yarn build ===" && yarn build
echo "=== yarn lint ===" && yarn lint
echo "=== yarn type-check ===" && yarn type-check
echo "=== yarn audit ===" && (yarn audit || true) # || true makes audit informational (non-fatal)
echo "=== corepack yarn build ===" && corepack yarn build
echo "=== corepack yarn lint ===" && corepack yarn lint
echo "=== corepack yarn type-check ===" && corepack yarn type-check
echo "=== corepack yarn npm audit ===" && (corepack yarn npm audit || true) # || true makes audit informational (non-fatal)
exit 0
```

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ Peers can connect to your bitsocial community using any bitsocial client, such a
### How to add a community to the default list (s/all)
The default list of communities, used on s/all on Seedit, is bitsocial's [default-multisub.json list](https://github.com/bitsocialhq/lists/blob/master/default-multisub.json). You can open a pull request in that repo to add your community to the list.

## Contributor setup

1. `nvm install && nvm use`
2. Run `corepack enable` once on your machine
3. Use plain `yarn install`, `yarn build`, and `yarn test` from then on

## To run locally

1. Install Node v22 (Download from https://nodejs.org)
2. Install Yarn: `npm install -g yarn`
3. `yarn install --frozen-lockfile` to install Seedit dependencies
4. `yarn start` to run the web client
1. `yarn install` to install Seedit dependencies
2. `yarn start` to run the web client

### Scripts:

Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"license": "GPL-2.0-only",
"private": true,
"packageManager": "yarn@4.13.0",
"dependencies": {
"@capacitor/app": "7.0.1",
"@capacitor/filesystem": "7.1.4",
Expand All @@ -14,7 +15,7 @@
"@capacitor/status-bar": "7.0.1",
"@capawesome/capacitor-android-edge-to-edge-support": "7.2.2",
"@floating-ui/react": "0.26.1",
"@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#df3cb6901f63054870dc127cd7565c98617c2a4f",
"@plebbit/plebbit-react-hooks": "https://codeload.github.com/plebbit/plebbit-react-hooks/tar.gz/df3cb6901f63054870dc127cd7565c98617c2a4f",
"@types/node": "20.8.2",
"@types/react": "19.1.2",
"@types/react-dom": "19.1.2",
Expand All @@ -33,6 +34,7 @@
"i18next-browser-languagedetector": "7.1.0",
"i18next-http-backend": "2.2.2",
"json-stringify-pretty-compact": "4.0.0",
"kubo": "0.39.0",
"lodash": "4.17.21",
"memoizee": "0.4.15",
"node-fetch": "2",
Expand All @@ -51,15 +53,14 @@
"remark-supersub": "1.0.0",
"tcp-port-used": "1.0.2",
"typescript": "5.1.6",
"zustand": "4.4.3",
"kubo": "0.39.0"
"zustand": "4.4.3"
},
"scripts": {
"start": "vite",
"build": "cross-env NODE_ENV=production PUBLIC_URL=./ GENERATE_SOURCEMAP=false vite build",
"build:preload": "cross-env NODE_ENV=production vite build --config electron/vite.preload.config.js",
"build-netlify": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" NODE_ENV=production PUBLIC_URL=./ GENERATE_SOURCEMAP=true VITE_COMMIT_REF=$COMMIT_REF CI='' vite build",
"test": "vitest",
"test": "vitest --passWithNoTests",
"preview": "vite preview",
"analyze-bundle": "cross-env NODE_ENV=production PUBLIC_URL=./ GENERATE_SOURCEMAP=true vite build && npx source-map-explorer 'build/assets/*.js'",
"electron": "yarn build:preload && yarn electron:before && electron .",
Expand Down Expand Up @@ -108,6 +109,7 @@
"@electron-forge/maker-zip": "7.6.0",
"@electron-forge/plugin-auto-unpack-natives": "7.6.0",
"@react-scan/vite-plugin-react-scan": "0.1.8",
"@reforged/maker-appimage": "5.1.1",
"@types/memoizee": "0.4.9",
"@types/node-fetch": "2",
"@typescript/native-preview": "7.0.0-dev.20260115.1",
Expand All @@ -123,21 +125,21 @@
"cz-conventional-changelog": "3.3.0",
"decompress": "4.2.1",
"electron": "36.4.0",
"glob": "10.5.0",
"husky": "4.3.8",
"isomorphic-fetch": "3.0.0",
"lint-staged": "12.3.8",
"oxfmt": "0.24.0",
"oxlint": "1.39.0",
"progress": "2.0.3",
"react-grab": "0.1.28",
"react-scan": "0.5.3",
"stream-browserify": "3.0.0",
"vite": "8.0.0",
"vite-plugin-node-polyfills": "0.24.0",
"vite-plugin-pwa": "0.21.1",
"wait-on": "7.0.1",
"@reforged/maker-appimage": "5.1.1",
"glob": "10.5.0",
"progress": "2.0.3"
"vitest": "4.1.0",
"wait-on": "7.0.1"
},
"resolutions": {
"js-yaml": "4.1.1",
Expand Down
3 changes: 2 additions & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
],
"buildCommand": "yarn build",
"installCommand": "corepack yarn install --immutable",
"buildCommand": "corepack yarn build",
Comment on lines +5 to +6
Copy link

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

🌐 Web query:

Does Vercel support Corepack for Yarn?

💡 Result:

Yes—Vercel supports using Corepack for Yarn, but it’s treated as experimental and must be explicitly enabled.

  • Enable Corepack on Vercel by setting the environment variable ENABLE_EXPERIMENTAL_COREPACK=1, and set your desired Yarn version via packageManager in your root package.json (for example, "packageManager": "yarn@4.x.x"). [1][2]
  • Vercel’s own docs note that if you’re using Yarn 4, you should enable Corepack. [3]

Sources: [1][2][3]


Environment variable required for Corepack to work on Vercel.

While Vercel supports Corepack, it's treated as experimental and requires explicit enablement. The corepack yarn commands in vercel.json will not work without setting the environment variable ENABLE_EXPERIMENTAL_COREPACK=1 in your Vercel deployment settings. Additionally, ensure your package.json includes the packageManager field (e.g., "packageManager": "yarn@4.x.x").

Verify that both the environment variable and package.json configuration are in place before deploying.

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

In `@vercel.json` around lines 5 - 6, The vercel.json uses "installCommand" and
"buildCommand" with "corepack yarn" but Corepack is experimental on Vercel; set
the environment variable ENABLE_EXPERIMENTAL_COREPACK=1 in the Vercel
project/deployment settings and ensure package.json includes a packageManager
entry (e.g., "packageManager": "yarn@4.x.x") so the "corepack yarn install
--immutable" and "corepack yarn build" commands work reliably during
deployments.

"outputDirectory": "build",
"framework": "vite"
}
Loading
Loading