Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
3061c00
WIP: ES6 refactoring - complete core library modernization
theturtle32 Jun 12, 2025
fc92a7e
Phase 1: Complete test suite modernization with ES6 patterns
theturtle32 Jun 12, 2025
6e85cda
Update test/scripts/echo-server.js
theturtle32 Jun 12, 2025
10cf1c9
Address PR feedback: Complete arrow function conversions in test suite
theturtle32 Jun 12, 2025
e274ac7
Merge branch 'phase1-test-suite-modernization' of github.com:theturtl…
theturtle32 Jun 12, 2025
bf45bf1
Modernize development tooling and code formatting
theturtle32 Jun 12, 2025
936847a
Complete remaining var → const/let conversions and fix ESLint issues
theturtle32 Jun 12, 2025
42db179
Adding .eslintrc.js
theturtle32 Jun 12, 2025
317f4e3
Complete migration from JSHint to ESLint with 2-space indentation
theturtle32 Jun 12, 2025
d826ff5
Complete Phase 1: Test Suite Modernization
theturtle32 Jun 12, 2025
3b7d6ef
Merge branch 'es6-refactor' into v2
theturtle32 Jun 12, 2025
afb79bd
Merge branch 'v2' into phase1-test-suite-modernization
theturtle32 Jun 12, 2025
cd1174c
Replace gulp with npm scripts for linting
theturtle32 Jun 12, 2025
e485355
Merge pull request #463 from theturtle32/phase1-test-suite-modernization
theturtle32 Jun 12, 2025
cc1ed44
Phase 2: Implement template literals, arrow functions, and destructuring
theturtle32 Jun 13, 2025
6c02de1
Fix GitHub Actions ESLint compatibility issue
theturtle32 Jun 13, 2025
15181d5
Fix code review issues: restore ES6+ modernizations
theturtle32 Jun 13, 2025
2096cac
Add Autobahn test results parser script
theturtle32 Jun 13, 2025
0ea2144
Add comprehensive Autobahn test runner
theturtle32 Jun 13, 2025
54ca978
Add Autobahn test script to package.json
theturtle32 Jun 13, 2025
68c277a
Only run on pull request
theturtle32 Jun 13, 2025
dff09ab
Merge pull request #465 from theturtle32/phase2-template-literals-arr…
theturtle32 Jun 13, 2025
6373223
Update ES6_REFACTORING_PLAN.md with Phase 2 progress
theturtle32 Jun 13, 2025
fc371e4
Implement Default Parameters and Object Literal Enhancements
theturtle32 Jun 13, 2025
6239e11
Update ES6_REFACTORING_PLAN.md - Phase 2 COMPLETED ✅
theturtle32 Jun 13, 2025
e9e2f01
Updating CLAUDE.md
theturtle32 Jun 13, 2025
4c1f78a
Merge pull request #466 from theturtle32/phase2-default-parameters-ob…
theturtle32 Jun 13, 2025
20e51af
Improve ESLint configuration: re-enable no-empty and no-unsafe-finally
theturtle32 Jun 13, 2025
c307d61
Updating Claude's instructions
theturtle32 Jun 13, 2025
09fc35e
Address code review feedback: Add robustness check to parse-results.js
theturtle32 Jun 13, 2025
d38718a
Merge pull request #467 from theturtle32/phase2-code-quality-enhancem…
theturtle32 Jun 13, 2025
df1eb52
Phase 3: ES6 Class Syntax Conversion
theturtle32 Jun 13, 2025
339f237
Merge pull request #468 from theturtle32/phase3-advanced-features
theturtle32 Jun 13, 2025
e863f19
Adding Claude config and DevContainer config
theturtle32 Jun 13, 2025
b8c298f
Update devcontainer config
theturtle32 Jun 13, 2025
7035e46
Adding test suite modernization plan
theturtle32 Jun 13, 2025
0e76563
Implement Phase 1: Test Suite Modernization Foundation
theturtle32 Jun 14, 2025
f01df91
Fix lint errors by converting ES modules to CommonJS
theturtle32 Jun 14, 2025
4eebd10
Enable ES modules for test suite while maintaining CommonJS compatibi…
theturtle32 Jun 14, 2025
d34add4
Updating github actions workflow to run new tests too
theturtle32 Jun 14, 2025
60d6aa3
Converting new test files to use ES Modules syntax
theturtle32 Jun 14, 2025
b88eaf5
Merge pull request #469 from theturtle32/test-modernization-phase-1
theturtle32 Jun 14, 2025
4d46ab3
Complete Phase 2: Migrate all existing tape tests to Vitest
theturtle32 Jun 14, 2025
b79d245
Updates to devcontainer and pnpm workspace
theturtle32 Jun 14, 2025
a4f0dba
Complete Phase 2.2: Comprehensive test helper infrastructure
theturtle32 Jun 14, 2025
4442865
Address code review feedback
theturtle32 Jun 14, 2025
f808d3d
Address latest Gemini code review feedback
theturtle32 Jun 14, 2025
30a7d69
Fix protocol mismatch test timeout issue
theturtle32 Jun 14, 2025
3d9ee2c
Do not add test-results.json to git
theturtle32 Jun 14, 2025
f41d2e8
Fix Promise reject parameter scope issue in test-server.mjs
theturtle32 Jun 14, 2025
f89e8ed
Address remaining Gemini code review feedback
theturtle32 Jun 14, 2025
895dcd7
Address final three unaddressed Gemini review comments
theturtle32 Jun 14, 2025
3f6694f
Merge pull request #470 from theturtle32/phase-2-test-migration
theturtle32 Jun 14, 2025
cede811
Adding a copy of the Websocket RFC to the docs folder.
theturtle32 Jun 14, 2025
0837d7a
Making RFC more readable
theturtle32 Jun 14, 2025
5acb4e5
Implement Phase 3.1: WebSocketFrame Comprehensive Testing
theturtle32 Jun 14, 2025
c07dc6c
Fix control frame size validation tests
theturtle32 Jun 14, 2025
41ff642
Enhance WebSocketFrame tests with additional edge cases and validations
theturtle32 Jun 14, 2025
6009978
Merge pull request #471 from theturtle32/phase-3.1-websocket-frame-tests
theturtle32 Jun 14, 2025
ec44126
Complete Phase 3.2: WebSocketConnection comprehensive testing
theturtle32 Jun 14, 2025
444552e
Fix async timing issues in WebSocketConnection tests
theturtle32 Jun 14, 2025
b476c63
Stabilize WebSocketConnection test suite and add MockSocket analysis
theturtle32 Jun 14, 2025
66b1c55
Fix critical WebSocketConnection infrastructure bug - enable frame pr…
theturtle32 Jun 14, 2025
f1bfa74
Revert "Fix critical WebSocketConnection infrastructure bug - enable …
theturtle32 Jun 14, 2025
8e8e59c
Establish correct WebSocketConnection testing pattern and add impleme…
theturtle32 Jun 14, 2025
10f10f3
Complete Phase 3.2.A.1: Enhanced test infrastructure with async utili…
theturtle32 Jun 14, 2025
ad83d44
Complete Phase 3.2.A.2: Frame Generation and Processing Foundation
theturtle32 Jun 14, 2025
1d61b10
Complete Phase 3.2.A.3.1: Enhanced Event Capture and Verification Sys…
theturtle32 Jun 15, 2025
2d79d06
Complete Phase 3.2.A.3.3: Connection Lifecycle Testing Standards
theturtle32 Jun 15, 2025
f7d0706
Complete Phase 3: ES6 Class Conversion for All Core Components
theturtle32 Sep 30, 2025
61cab4b
Excluding claude local settings
theturtle32 Sep 30, 2025
51c4b47
Complete Phase 3 Advanced Modernization: var → const/let + arrow func…
theturtle32 Oct 2, 2025
8003bbb
Complete v2.0 Modernization: Promise APIs, ES2021, and Test Migration
theturtle32 Oct 2, 2025
71fa0ca
Fix var→const/let regressions in modernization
theturtle32 Oct 2, 2025
b3c66fc
Add pnpm-lock.yaml for GitHub Actions
theturtle32 Oct 2, 2025
dd2228c
Remove pnpm-workspace.yaml - not a monorepo
theturtle32 Oct 2, 2025
28c871f
Replace buffer-equal with native Buffer.equals()
theturtle32 Oct 2, 2025
05a8397
Suppress EventEmitter MaxListeners warnings in tests
theturtle32 Oct 2, 2025
440d9c8
Remove debug console.log from start-echo-server
theturtle32 Oct 2, 2025
4206f91
Add comprehensive unit tests for WebSocketClient, WebSocketServer, We…
theturtle32 Oct 2, 2025
20bb5e1
Increase EventEmitter max listeners in client tests to suppress warnings
theturtle32 Oct 2, 2025
14b2a1c
Fix EventEmitter listener leak in protocol validation test
theturtle32 Oct 2, 2025
52d4ecb
Merge pull request #478 from theturtle32/phase3-v2-modernization
theturtle32 Oct 2, 2025
bd4c774
Merge pull request #476 from theturtle32/phase3-advanced-modernization
theturtle32 Oct 2, 2025
dfc849f
Fix all skipped WebSocketConnection tests (22 tests) (#479)
theturtle32 Oct 5, 2025
050b462
Fix all remaining skipped tests - achieve 100% test pass rate (396/39…
theturtle32 Oct 5, 2025
6bde282
Add comprehensive integration tests with real Node.js sockets (#481)
theturtle32 Oct 5, 2025
4ebeef0
Add comprehensive WebSocketRequest test suite (40 new tests) (#482)
theturtle32 Oct 5, 2025
7bd4026
Add enhanced utils.js tests - 21 new targeted tests (#483)
theturtle32 Oct 5, 2025
f6bc159
Add comprehensive WebSocketRouterRequest tests - 28 new tests (#484)
theturtle32 Oct 5, 2025
8be6dc3
Add comprehensive W3CWebSocket tests - 41 new tests (#485)
theturtle32 Oct 5, 2025
e7c4b10
Remove obsolete tape test files - cleanup complete (#486)
theturtle32 Oct 5, 2025
d6d64d9
Add cross-platform support for Autobahn test suite (#488)
theturtle32 Oct 6, 2025
e12b5d9
Achieve 85%+ test coverage target with 57 new tests (#489)
theturtle32 Oct 6, 2025
8159027
Add Playwright browser testing infrastructure (#490)
theturtle32 Oct 6, 2025
140d9ed
Update test plan to reflect browser testing completion (#491)
theturtle32 Oct 6, 2025
56e4f28
Add multi-version Node.js testing to CI (#492)
theturtle32 Oct 6, 2025
8a6834c
Update test plan to reflect multi-version CI completion (#493)
theturtle32 Oct 6, 2025
6116cd1
Add performance benchmarking and regression detection (#494)
theturtle32 Oct 6, 2025
bf428ef
Add performance metrics to Autobahn test parser (#495)
theturtle32 Oct 6, 2025
0480dca
Use commit SHA in Autobahn test reporting
Oct 6, 2025
f19a878
Address Gemini code review comments on PR #494 (#496)
theturtle32 Oct 6, 2025
62d1f62
Add performance benchmark results to GitHub Actions summary
Oct 6, 2025
c3c9272
Simplify benchmark summary - use code block instead of parsing
Oct 6, 2025
f072619
Restructure benchmarks and use Vitest's native comparison
Oct 6, 2025
490af8f
Address Gemini review comments: simplify scripts and clarify bench:check
Oct 6, 2025
ac53fda
Merge pull request #497 from theturtle32/restructure-benchmarks
theturtle32 Oct 6, 2025
b8c1c85
Strip ANSI control codes from benchmark output in GitHub Actions summary
Oct 6, 2025
e89a9a8
Generate markdown table from JSON benchmark results
Oct 6, 2025
d605d5e
Fix benchmark table: match ASCII output format and correct units
Oct 6, 2025
631dc24
Replace jq/shell logic with Node.js script for benchmark formatting
Oct 6, 2025
6f092f6
Increase precision to 4 decimal places for benchmark values
Oct 6, 2025
ae27ddd
Merge pull request #498 from theturtle32/fix-benchmark-ansi-codes
theturtle32 Oct 6, 2025
1a865f3
Add Codecov integration for coverage reporting
Oct 6, 2025
9e61f4b
Address Gemini review comments and update to codecov-action@v5
Oct 6, 2025
66bbafb
Run coverage only on Node.js 22.x to avoid duplication
Oct 6, 2025
2ac7888
Merge pull request #499 from theturtle32/add-codecov-integration
theturtle32 Oct 6, 2025
261da58
Update test plan: Phase 6.2 Coverage Reporting complete
Oct 6, 2025
0852606
Merge pull request #500 from theturtle32/update-test-plan-codecov
theturtle32 Oct 6, 2025
32d5130
Add comprehensive v2.0 release readiness report
Oct 6, 2025
e35b2bd
Update Node.js minimum version requirement to 18.x
Oct 6, 2025
295da9d
Suppress debug output during test runs (#501)
theturtle32 Oct 6, 2025
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
79 changes: 79 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
FROM node:20

ARG TZ
ENV TZ="$TZ"

# Install basic development tools and iptables/ipset
RUN apt update && apt install -y less \
git \
procps \
sudo \
fzf \
zsh \
man-db \
unzip \
gnupg2 \
gh \
iptables \
ipset \
iproute2 \
dnsutils \
aggregate \
jq

# Ensure default node user has access to /usr/local/share
RUN mkdir -p /usr/local/share/npm-global && \
chown -R node:node /usr/local/share

ARG USERNAME=node

# Persist bash history.
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
&& mkdir /commandhistory \
&& touch /commandhistory/.bash_history \
&& chown -R $USERNAME /commandhistory

# Set `DEVCONTAINER` environment variable to help with orientation
ENV DEVCONTAINER=true

# Create workspace and config directories and set permissions
RUN mkdir -p /workspace /home/node/.claude && \
chown -R node:node /workspace /home/node/.claude

WORKDIR /workspace

RUN ARCH=$(dpkg --print-architecture) && \
wget "https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_${ARCH}.deb" && \
sudo dpkg -i "git-delta_0.18.2_${ARCH}.deb" && \
rm "git-delta_0.18.2_${ARCH}.deb"

# Set up non-root user
USER node

# Install global packages
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
ENV PATH=$PATH:/usr/local/share/npm-global/bin

# Set the default shell to zsh rather than sh
ENV SHELL=/bin/zsh

# Default powerline10k theme
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
-p git \
-p fzf \
-a "source /usr/share/doc/fzf/examples/key-bindings.zsh" \
-a "source /usr/share/doc/fzf/examples/completion.zsh" \
-a "export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
-x

# Install Claude
RUN npm install -g @anthropic-ai/claude-code

# Copy and set up firewall script
COPY init-firewall.sh /usr/local/bin/
COPY post-create.sh /usr/local/bin/
USER root
RUN chmod +x /usr/local/bin/post-create.sh && \
echo "node ALL=(root) NOPASSWD: /usr/local/bin/post-create.sh" > /etc/sudoers.d/devcontainer-post-create && \
chmod 0440 /etc/sudoers.d/devcontainer-post-create
USER node
71 changes: 71 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "WebSocket-Node DevContainer",
"build": {
"dockerfile": "Dockerfile",
"args": {
"TZ": "${localEnv:TZ:America/Los_Angeles}"
}
},
"runArgs": ["--cap-add=NET_ADMIN", "--cap-add=NET_RAW"],
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
"packages": "postgresql-client,redis-tools,xdg-utils,openssh-client,gnupg,vim"
}
},
"customizations": {
"vscode": {
"extensions": [
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"zainchen.json",
"bierner.markdown-checkbox",
"bierner.markdown-emoji",
"bierner.markdown-footnotes",
"bierner.markdown-mermaid",
"bierner.markdown-preview-github-styles",
"bierner.markdown-shiki",
"bierner.markdown-yaml-preamble"
],
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh"
}
}
}
}
},
"remoteUser": "node",
"mounts": [
"source=claude-code-bashhistory,target=/commandhistory,type=volume",
"source=claude-code-config,target=/home/node/.claude,type=volume",
"source=dotconfig,target=/home/node/.config,type=volume",
"source=pnpm-home,target=/pnpm,type=volume",
"source=node-modules,target=/workspace/node_modules,type=volume",
"source=${localEnv:HOME}/.gitconfig,target=/tmp/host-gitconfig,type=bind,consistency=cached",
"source=${localEnv:HOME}/.config/gh,target=/tmp/host-gh-config,type=bind,consistency=cached",
"source=${localEnv:HOME}/.ssh,target=/tmp/host-ssh,type=bind,consistency=cached,readonly"
],
"remoteEnv": {
"NODE_OPTIONS": "--max-old-space-size=4096",
"CLAUDE_CONFIG_DIR": "/home/node/.claude",
"POWERLEVEL9K_DISABLE_GITSTATUS": "true"
},
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
"workspaceFolder": "/workspace",
"postCreateCommand": "sudo /usr/local/bin/post-create.sh"
}
122 changes: 122 additions & 0 deletions .devcontainer/init-firewall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#!/bin/bash
set -euo pipefail # Exit on error, undefined vars, and pipeline failures
IFS=$'\n\t' # Stricter word splitting

echo 'Setting up Firewall Rules...'

# Flush existing rules and delete existing ipsets
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
ipset destroy allowed-domains 2>/dev/null || true

# First allow DNS and localhost before any restrictions
# Allow outbound DNS
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
# Allow inbound DNS responses
iptables -A INPUT -p udp --sport 53 -j ACCEPT
# Allow outbound SSH
iptables -A OUTPUT -p tcp --dport 22 -j ACCEPT
# Allow inbound SSH responses
iptables -A INPUT -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
# Allow localhost
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Create ipset with CIDR support
ipset create allowed-domains hash:net

# Fetch GitHub meta information and aggregate + add their IP ranges
echo "Fetching GitHub IP ranges..."
gh_ranges=$(curl -s https://api.github.com/meta)
if [ -z "$gh_ranges" ]; then
echo "ERROR: Failed to fetch GitHub IP ranges"
exit 1
fi

if ! echo "$gh_ranges" | jq -e '.web and .api and .git' >/dev/null; then
echo "ERROR: GitHub API response missing required fields"
exit 1
fi

echo "Processing GitHub IPs..."
while read -r cidr; do
if [[ ! "$cidr" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}$ ]]; then
echo "ERROR: Invalid CIDR range from GitHub meta: $cidr"
exit 1
fi
echo "Adding GitHub range $cidr"
ipset add allowed-domains "$cidr"
done < <(echo "$gh_ranges" | jq -r '(.web + .api + .git)[]' | aggregate -q)

# Resolve and add other allowed domains
for domain in \
"registry.npmjs.org" \
"api.anthropic.com" \
"sentry.io" \
"statsig.anthropic.com" \
"statsig.com"; do
echo "Resolving $domain..."
ips=$(dig +short A "$domain")
if [ -z "$ips" ]; then
echo "ERROR: Failed to resolve $domain"
exit 1
fi

while read -r ip; do
if [[ ! "$ip" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
echo "ERROR: Invalid IP from DNS for $domain: $ip"
exit 1
fi
echo "Adding $ip for $domain"
ipset add allowed-domains "$ip"
done < <(echo "$ips")
done

# Get host IP from default route
HOST_IP=$(ip route | grep default | cut -d" " -f3)
if [ -z "$HOST_IP" ]; then
echo "ERROR: Failed to detect host IP"
exit 1
fi

HOST_NETWORK=$(echo "$HOST_IP" | sed "s/\.[0-9]*$/.0\/24/")
echo "Host network detected as: $HOST_NETWORK"

# Set up remaining iptables rules
iptables -A INPUT -s "$HOST_NETWORK" -j ACCEPT
iptables -A OUTPUT -d "$HOST_NETWORK" -j ACCEPT

# Set default policies to DROP first
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

# First allow established connections for already approved traffic
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Then allow only specific outbound traffic to allowed domains
iptables -A OUTPUT -m set --match-set allowed-domains dst -j ACCEPT

echo "Firewall configuration complete"
echo "Verifying firewall rules..."
if curl --connect-timeout 5 https://example.com >/dev/null 2>&1; then
echo "ERROR: Firewall verification failed - was able to reach https://example.com"
exit 1
else
echo "Firewall verification passed - unable to reach https://example.com as expected"
fi

# Verify GitHub API access
if ! curl --connect-timeout 5 https://api.github.com/zen >/dev/null 2>&1; then
echo "ERROR: Firewall verification failed - unable to reach https://api.github.com"
exit 1
else
echo "Firewall verification passed - able to reach https://api.github.com as expected"
fi

echo 'Firewall configuration complete.'
Loading