Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f9501d0
PNPM - SFW
prxt6529 Apr 2, 2026
3f9b839
WIP
prxt6529 Apr 2, 2026
c5c53ae
Merge branch 'main' into pnpm-sfw
prxt6529 Apr 2, 2026
42867be
WIP
prxt6529 Apr 2, 2026
5fe761f
WIP
prxt6529 Apr 3, 2026
3020635
WIP
prxt6529 Apr 3, 2026
e2bdb7d
WIP
prxt6529 Apr 3, 2026
8e491f1
WIP
prxt6529 Apr 3, 2026
8bf4ca3
WIP
prxt6529 Apr 3, 2026
613045e
WIP
prxt6529 Apr 3, 2026
0684d49
WIP
prxt6529 Apr 3, 2026
14c8315
WIP
prxt6529 Apr 3, 2026
9529511
WIP
prxt6529 Apr 3, 2026
37e9af4
WIP
prxt6529 Apr 3, 2026
ce36828
WIP
prxt6529 Apr 3, 2026
c20a14a
WIP
prxt6529 Apr 6, 2026
02fbcf6
WIP
prxt6529 Apr 6, 2026
447aaec
WIP
prxt6529 Apr 6, 2026
0daaac3
WIP
prxt6529 Apr 6, 2026
8134d15
WIP
prxt6529 Apr 6, 2026
f206fb7
WIP
prxt6529 Apr 6, 2026
4ed4fbc
WIP
prxt6529 Apr 6, 2026
37e7026
Merge branch 'main' into pnpm-sfw
prxt6529 Apr 6, 2026
9e5fa29
WIP
prxt6529 Apr 6, 2026
25d1b9c
WIP
prxt6529 Apr 6, 2026
69ea041
WIP
prxt6529 Apr 6, 2026
96abaf7
Merge branch 'main' into pnpm-sfw
prxt6529 Apr 6, 2026
b169336
WIP
prxt6529 Apr 6, 2026
d5fa859
WIP
prxt6529 Apr 6, 2026
34ee678
Test Deploy
prxt6529 Apr 6, 2026
88d18d8
Discover page title
prxt6529 Apr 6, 2026
9185f41
WIP
prxt6529 Apr 6, 2026
d05e2a1
Symlinks fix
prxt6529 Apr 6, 2026
b4a8bfe
Fix EB deploy bundle by excluding traced Next symlink dirs
prxt6529 Apr 6, 2026
0fdd96e
Exclude runtime node_modules from EB source bundle again
prxt6529 Apr 6, 2026
2b7ef43
Bypass EB's default npm install and restore pinned pnpm runtime install
prxt6529 Apr 6, 2026
65ce9cd
Fallback to npm-installed pinned pnpm when Corepack is unavailable on EB
prxt6529 Apr 6, 2026
cf05274
Load dotenv only in build and dev config phases
prxt6529 Apr 6, 2026
3d386b6
Promote zod to runtime dependency for EB startup
prxt6529 Apr 6, 2026
31a1056
Keep .next/static in EB bundle while uploading assets to S3
prxt6529 Apr 6, 2026
c323f2b
Normalize traced .next/node_modules aliases for EB runtime
prxt6529 Apr 7, 2026
2d89b12
Merge branch 'main' into pnpm-sfw
prxt6529 Apr 7, 2026
a27bc54
Add traced instrumentation runtime deps for EB startup
prxt6529 Apr 7, 2026
0e8fdf1
Add traced instrumentation runtime deps for EB startup 2
prxt6529 Apr 7, 2026
49b8660
Disable server Sentry instrumentation on EB runtime
prxt6529 Apr 7, 2026
c0669bf
Restore fixed app port 3001 for start-next
prxt6529 Apr 7, 2026
d846840
Add ms as traced runtime dependency for EB
prxt6529 Apr 7, 2026
4555ce6
Add Reown appkit controllers as EB runtime dependency
prxt6529 Apr 7, 2026
2d729f1
Add Reown appkit utils as EB runtime dependency
prxt6529 Apr 7, 2026
c516e7e
Restore standalone runtime for staging and EB deploys
prxt6529 Apr 7, 2026
ea5080e
Fix standalone NextConfig typing
prxt6529 Apr 7, 2026
92b9915
Run 6529 wrapper under bash in staging PM2
prxt6529 Apr 7, 2026
68028b6
Start staging standalone via bash and force standalone output
prxt6529 Apr 7, 2026
8be6a91
Restore standalone runtime flow for staging and EB deploy
prxt6529 Apr 7, 2026
c8e7a24
Preserve standalone symlinks in EB package
prxt6529 Apr 7, 2026
dad808a
Remove dangling semver symlink from EB bundle
prxt6529 Apr 7, 2026
e9886f9
Remove obsolete EB runtime bandaid dependencies
prxt6529 Apr 7, 2026
0cbee5e
Update docs for standalone staging and EB deploy flow
prxt6529 Apr 7, 2026
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
3 changes: 0 additions & 3 deletions .ebextensions/npm.config

This file was deleted.

5 changes: 5 additions & 0 deletions .ebextensions/runtime-bundle.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
container_commands:
01_verify_runtime_bundle:
command: |
test -d node_modules
test -f .next/BUILD_ID
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/*.cmd text eol=crlf
33 changes: 24 additions & 9 deletions .github/workflows/build-upload-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,33 @@

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pinned pnpm
uses: pnpm/action-setup@v5

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Web Deploy - PROD' step
Uses Step
uses 'pnpm/action-setup' with ref 'v5', not a pinned commit hash
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"

- name: Install dependencies
run: npm ci
- name: Install Socket Firewall
id: socket_firewall
uses: SocketDev/action@2d3f25590c6ed6ba11a9a14c064d962a3a04698f # v1.3.1
with:
mode: firewall

- name: Verify registry signatures
run: npm audit signatures
- name: Assert npm lockfile is absent
run: ./bin/6529 guard:no-package-lock

- name: Install dependencies
env:
SFW_BIN: ${{ steps.socket_firewall.outputs.firewall-path-binary }}
run: ./bin/6529 install:frozen

- name: Lint package.json versions
run: npm run lint:package-json
run: ./bin/6529 lint:package-json

- name: Build App
env:
Expand All @@ -58,13 +70,16 @@
ASSETS_FROM_S3: ${{ env.ASSETS_FROM_S3 }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: npm run build
run: ./bin/6529 build

- name: Prune to production dependencies
run: ./bin/6529 prune:prod

- name: Build Target
run: |
mkdir -p target/_next
cp -r .next/static target/_next/
zip -r package.zip . -x '*.git*' 'node_modules/*' 'target/*'
zip -yr package.zip . -x '*.git*' 'target/*'
mv package.zip target/

- name: Configure AWS Credentials
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# dependencies
/node_modules
/.pnpm-store
/.corepack-tmp
/.pnp
.pnp.js

Expand Down
8 changes: 0 additions & 8 deletions .npmpackagejsonlintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node scripts/start-next.cjs
83 changes: 73 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ again to approve the updated file.
From the repo root, you should be able to run:

```bash
which 6529
which ghruns
6529 dev --help
ghruns
```

Expand Down Expand Up @@ -98,22 +100,63 @@ Are you sure you want to deploy <branch-name> to production?

If you confirm, it triggers the production workflow from `.github/workflows/build-upload-deploy-prod.yml` against your current branch.

PORT: 3000
Default app port: `3001` unless `PORT` is set.

### Documentation

User-facing documentation lives in [`docs/README.md`](docs/README.md).
Developer package-management guidance lives in [`docs/developer/pnpm-and-socket-firewall.md`](docs/developer/pnpm-and-socket-firewall.md).

### Install

Bootstrap Corepack and Socket Firewall once on your machine:

```bash
npm install --global sfw
corepack enable pnpm
corepack prepare "$(node -p 'require("./package.json").packageManager')" --activate
```
npm i

That command reads the pinned version directly from the `packageManager` field
in `package.json` so the bootstrap command stays aligned with the repo pin.

Then install project dependencies through the secure path:

```bash
6529 install
```

### Build
Plain `pnpm install`, `pnpm dev`, and `npm run ...` repo script execution are intentionally blocked. Use the `6529` wrapper only.

If `direnv` is enabled for the repo, you can also use the repo-local wrapper:

```bash
6529 install
6529 dev
6529 build
6529 approve-builds
6529 staging
```

If you want plain `6529 ...` commands to work on a server shell without
`direnv`, run this once from the repo root:

```bash
./bin/6529 bootstrap
```
npm run build

Then open a new shell, or source the rc file that matches your shell.

If you want a one-liner for the current shell, use:

```bash
source <(./bin/6529 bootstrap --print-export)
```

### Build

```bash
6529 build
```

### Environment
Expand All @@ -134,7 +177,7 @@ gateway usage:

To test end-to-end:

1. Run `npm run dev`.
1. Run `6529 dev`.
2. Paste any pepe.wtf link in chat, for example `https://pepe.wtf/asset/GOXPEPE`
or `https://pepe.wtf/artists/Easy-B`, and confirm the preview renders with
imagery and stats.
Expand All @@ -145,20 +188,40 @@ To test end-to-end:

- Locally

```bash
6529 dev
```
npm run dev

- Staging update / rebuild

```bash
./bin/6529 staging
```

- Production
- One-time server bootstrap for plain `6529 ...`

```bash
./bin/6529 bootstrap
```
npm run start

Then open a new shell, or source the rc file that matches your shell.

- After `direnv allow`, the shorthand also works

```bash
6529 staging
```

### RUN USING PM2
- Production

```bash
6529 start
```
pm2 start npm --name=6529seize -- run start

### RUN USING PM2

```bash
pm2 start ./bin/6529 --name=6529seize -- start
```

## Directory Structure
Expand Down
111 changes: 111 additions & 0 deletions bin/6529
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#!/usr/bin/env bash

set -euo pipefail

export COREPACK_HOME="${COREPACK_HOME:-${TMPDIR:-/tmp}/6529-corepack}"
export COREPACK_ENABLE_DOWNLOAD_PROMPT="0"
export SEIZE_6529_COMMAND="1"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"

command_name="${1:-}"

if [[ -z "$command_name" ]]; then
cat <<'EOF'
Usage:
6529 <command> [args...]

Common commands:
6529 bootstrap -> install the global 6529 shim for future shells
6529 install -> pnpm run install:secure
6529 i -> pnpm run install:secure
6529 install:frozen -> pnpm run install:secure:frozen
6529 ci -> pnpm run install:secure:frozen
6529 install:prod -> pnpm run install:secure:prod
6529 dev -> node scripts/dev-with-fallback.cjs
6529 build -> pnpm build
6529 approve-builds -> pnpm approve-builds
6529 prune:prod -> pnpm run prune:prod
6529 staging -> bash repo-rooted scripts/staging.sh
6529 start -> node scripts/start-next.cjs
6529 test -> pnpm test
6529 lint -> pnpm lint

Anything else is forwarded to pnpm unchanged.
EOF
exit 1
fi

shift

case "$command_name" in
bootstrap)
exec bash "$REPO_ROOT/scripts/bootstrap-6529-command.sh" "$@"
;;
dev)
exec node scripts/dev-with-fallback.cjs "$@"
;;
dev:webpack)
exec env USE_TURBO=false node scripts/dev-with-fallback.cjs "$@"
;;
dev:open)
exec node scripts/dev-open.cjs "$@"
;;
staging)
exec bash "$REPO_ROOT/scripts/staging.sh" "$@"
;;
start)
exec node scripts/start-next.cjs "$@"
Comment thread
prxt6529 marked this conversation as resolved.
Outdated
;;
esac

clean_path=""
IFS=':' read -r -a path_parts <<< "${PATH:-}"
for part in "${path_parts[@]}"; do
if [[ -z "$part" || "$part" == "$SCRIPT_DIR" ]]; then
continue
fi
if [[ -z "$clean_path" ]]; then
clean_path="$part"
else
clean_path="${clean_path}:$part"
fi
done

REAL_PNPM="$(PATH="$clean_path" command -v pnpm || true)"

if [[ -z "$REAL_PNPM" ]]; then
echo "pnpm is not available. Activate the repo-pinned pnpm with Corepack first." >&2
exit 1
fi

case "$command_name" in
i)
exec "$REAL_PNPM" run install:secure "$@"
;;
install)
exec "$REAL_PNPM" run install:secure "$@"
;;
ci)
exec "$REAL_PNPM" run install:secure:frozen "$@"
;;
install:frozen)
exec "$REAL_PNPM" run install:secure:frozen "$@"
;;
install:prod)
exec "$REAL_PNPM" run install:secure:prod "$@"
;;
prune:prod)
exec "$REAL_PNPM" run prune:prod "$@"
;;
run)
exec "$REAL_PNPM" run "$@"
;;
exec)
exec "$REAL_PNPM" exec "$@"
;;
*)
exec "$REAL_PNPM" "$command_name" "$@"
Comment thread
prxt6529 marked this conversation as resolved.
;;
esac
4 changes: 4 additions & 0 deletions bin/6529.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
setlocal
cd /d "%~dp0.."
bash "%~dp06529" %*
Comment thread
prxt6529 marked this conversation as resolved.
11 changes: 11 additions & 0 deletions bin/npm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -euo pipefail

echo "Direct npm usage is blocked in this repository." >&2
echo "Use the \`6529\` wrapper instead." >&2
echo "Examples:" >&2
echo " 6529 install" >&2
echo " 6529 dev" >&2
echo " 6529 build" >&2
exit 1
7 changes: 7 additions & 0 deletions bin/npx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

echo "Direct npx usage is blocked in this repository." >&2
echo "Use the \`6529\` wrapper instead." >&2
exit 1
Loading
Loading