Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .wranglerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
scripts/
contracts/
docker/
docs/
node_modules/
genesis-q-mem/
yennefer-observatory/
logs/
.git/
.env*
ecosystem.*.config.cjs
!package.json
!package-lock.json
!wrangler.toml
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"scripts": {
"test": "hardhat test",
"build": "cd frontend && npm run build",
"build": "echo 'No build step required'",
"worker:dev": "wrangler dev",
"worker:deploy": "wrangler deploy --env production",
"worker:deploy:staging": "wrangler deploy --env staging"
Expand Down
10 changes: 8 additions & 2 deletions scripts/genesis.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ const path = require('path');
const PATHS = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The fs module is used on lines 19-20 but is not imported in this file. This will result in a ReferenceError when the script attempts to create the logs directory. Please add the fs requirement at the top of the file.

const fs = require('fs');
const PATHS = {

soul: '/dev/shm/yennefer_soul_state.json',
mind: path.join(__dirname, '../yennefer-observatory/public/evolution.json'),
body: path.join(__dirname, '../yennefer-observatory/src/components/generated'),
journal: '/home/yenn/.yennefer/genesis_journal.jsonl'
body: path.join(__dirname, '../yennefer-observatory/src/components/mutations'),
journal: path.join(__dirname, '../logs/genesis_journal.jsonl')
};

// Ensure logs directory exists
const logDir = path.dirname(PATHS.journal);
if (!fs.existsSync(logDir)) {
fs.mkdirSync(logDir, { recursive: true });
}
Comment on lines +19 to +21
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The if (!fs.existsSync(logDir)) check is redundant when using fs.mkdirSync with the recursive: true option. The recursive option ensures the operation is idempotent and does not throw an error if the directory already exists, simplifying the code.

fs.mkdirSync(logDir, { recursive: true });


// --- CONFIGURATION ---
const CONFIG = {
fundingTarget: 10.0,
Expand Down
File renamed without changes.
10 changes: 3 additions & 7 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "yennefer"
main = "workers/index.js"
compatibility_date = "2024-09-23"
main = "workers/index.mjs"
compatibility_date = "2024-04-01"
compatibility_flags = ["nodejs_compat"]

# ─── Build step ──────────────────────────────────────────────────────────────
Expand All @@ -9,7 +9,7 @@ compatibility_flags = ["nodejs_compat"]
# Installs frontend deps and builds the SPA so frontend/build exists before
# `wrangler deploy` uploads assets. NODE_OPTIONS is required for
# react-scripts 5.x + Node 18+ (webpack 4 OpenSSL 3.0 compatibility).
command = "cd frontend && npm install --include=dev && GENERATE_SOURCEMAP=false CI=false NODE_OPTIONS=--openssl-legacy-provider npm run build"
command = "cd frontend && npm install --legacy-peer-deps --include=dev && GENERATE_SOURCEMAP=false CI=false NODE_OPTIONS=--openssl-legacy-provider npm run build"

# ─── Static Assets (React SPA build output) ──────────────────────────────────
# Built by `npm run build` (root package.json) before every `wrangler deploy`.
Expand All @@ -20,10 +20,6 @@ command = "cd frontend && npm install --include=dev && GENERATE_SOURCEMAP=false
directory = "frontend/build"
binding = "ASSETS"

# ─── Placement ───────────────────────────────────────────────────────────────
[placement]
mode = "smart"

# ─── Production environment (yennefer.quest) ─────────────────────────────────
# BACKEND_URL is set as a Cloudflare Worker secret (not a plain var) so it
# stays encrypted and is never committed to source:
Expand Down