Build Log — claritysystems-lobby / newrise


Build 002 — 2026-04-28

Commit: 7a65b26 Branch: main Status: pushed

Changes

resellers/newrise/sales-training/pricing/index.html (modified)

resellers/newrise/sales-training/hrdc-pricing/index.html (new)

Decisions


Current State

resellers/newrise/ sales-training/ index.html done pricing/ index.html done + HRDC CTA added (Build 002) hrdc-pricing/ index.html new (Build 002) hrdc-public-registration/ NEXT BUILD


Next Build: hrdc-public-registration

Inputs needed before build:

  1. Form fields: what is required? (name, IC, company, HRDC levy number, ticket type?)
  2. Where does form post? (email / Cloudflare Worker / Google Sheet / other?)
  3. Confirmation / thank-you behaviour after submit?

Build 003 — 2026-04-28

Commit: c5c3e53 Status: pushed

Changes

Scaffold stub files for owner copy-paste:

Each file contains only its own filename as body text.

Next Build (triggered by owner)

Once content is pasted and committed into all three files:

Pending: owner to paste code and commit, then signal ready for link wiring.


Build 004 — 2026-04-28

Commit: b2cefc8 Status: pushed

Changes

Rewired all links in about, faq, articles to circulate within newrise subdomain.

Files touched:

Per file — changes applied:

Current State

resellers/newrise/ index.html (not yet created — newrise subdomain home) about/index.html done articles/index.njk done faq/index.html done sales-training/ index.html done pricing/index.html done + HRDC CTA hrdc-pricing/index.html done hrdc-public-registration/ NEXT BUILD

Next Build

hrdc-public-registration page. Inputs needed:

  1. Form fields required?
  2. Where does form post?
  3. Confirmation behaviour after submit?

Build 005 — PLANNED: hrdc-public-registration

Status: blocked on owner decisions (listed below)

Page Design Decisions (resolved in this session)

UX principle: Eliminate every question a prospect has before they reach the form. Uncertainty about cost, process, or next steps kills the submission.

Page structure (top to bottom):

  1. Countdown bar (if date confirmed) OR waitlist framing (if TBC)
  2. Course facts: date, time, venue, duration — above the fold
  3. "What you're getting" — 3-line summary of programme
  4. Price calculator — live total based on participant stepper (1–9)
  5. HRDC SBL-Khas explained in 1 sentence
  6. Numbered next steps (BEFORE the form):
    1. Submit this form — 2 min
    2. Receive proforma invoice + trainer profile + tentative schedule within 1 business day
    3. Training Provider calls to confirm
    4. Submit proforma to HRDC for grant approval
    5. Attend training — grant settled after completion
  7. Form (fields below)
  8. Testimonials (below form — for hesitant scrollers)

Form fields:

  1. Company Full Name
  2. Company Registered Address
  3. Name of Person in Charge
  4. Designation
  5. Email Address
  6. Contact Number
  7. Number of Participants (stepper 1–9, drives live price display)

After submit:

Worker sends: proforma invoice + trainer profile + tentative schedule Worker writes to: newrise D1 Telegram notification: on every submission (same pattern as cac-corporate-enquiry)

Urgency mechanisms:

Blocked On (owner to confirm before build starts)

  1. Run date confirmed? YES → countdown timer + hard date in hero NO → waitlist framing ("register interest, hold your place")

  2. Cohort size cap? What is the number, and can it be kept accurate?

  3. Form POST endpoint? Worker URL, or confirm stubbed for now and wired in worker session.

  4. Telegram notification: Same worker as cac-corporate-enquiry, or new worker?

  5. D1 table: Existing table or needs to be created? Table name?

  6. Email sender: Same Cloudflare Email Worker as existing setup, or different?


Build 006 — 2026-04-28

Commit: 40c67cd Status: pushed

Changes

Newrise logo added to every page on the newrise subdomain.

Logo placement — below the wordmark/subtext in the top-left nav or cover header:

Implementation: base64 data URI embedded directly. No CDN, no external image dependency. Verified: exactly 1 logo per file across all 6.


Build 007 — 2026-04-28

Commit: aca06c7 Status: pushed

Audit findings

Nav drawer links in sales-training pages were still pointing to claritysystems.work instead of the newrise subdomain. About/faq/articles were already clean from Build 004.

Fixes applied

sales-training/index.html

sales-training/pricing/index.html

sales-training/hrdc-pricing/index.html

Verified state

Note

enquiry/ and register/ pages do not yet exist under resellers/newrise. Nav links point to newrise subdomain URLs for those paths. These become active once those pages are built.


Build 009 — 2026-04-30

Workers: hrdc-grant-public-training (new) + cac-corporate-enquiry (updated)

Commits: d9e80de (fix builds), preceded by d1d75de, 075089d, 08c64c8, 36b14ff, 09d9dc1

Changes delivered

New worker — workers/hrdc-grant-public-training/

Templates (shared, in R2 cac-assets)

CAC corporate worker — workers/cac-corporate-enquiry/src/index.js

sales-training/config.js

sales-training/request-hrdc-grant-claim/index.html

_includes/base.njk

Build note — dist files

Both workers must be built with @cloudflare/puppeteer and all node:* builtins marked external. CF Workers runtime provides puppeteer via the BROWSER binding — it must NOT be bundled. Bundling it (via --platform=node) inlines node:buffer imports which CF Workers cannot resolve.

Correct build command (both workers):

npx esbuild src/index.js \
  --bundle \
  --format=esm \
  --platform=browser \
  --external:@cloudflare/puppeteer \
  --external:node:buffer \
  --external:node:stream \
  --external:node:util \
  --external:node:path \
  --external:node:fs \
  --external:node:crypto \
  --outfile=dist-index.js

Output size should be ~12–17kb. If output is ~800kb, puppeteer was bundled — wrong.

Outstanding (register page)

CSS/HTML restructure for register page was interrupted — not yet applied:


Build 009 — Addendum (same session)

Worker deploy failure — both workers

Error on src/index.js pasted into CF dashboard:

Uncaught Error: No such module "@cloudflare/puppeteer". imported from "worker.js"

Root cause not yet resolved. The CAC corporate enquiry worker was previously working when pasted as src/index.js directly. Something in the current src/index.js structure is incompatible with CF dashboard's bundler.

What next session must investigate:

  1. Check how the original working CAC worker src/index.js imported puppeteer — compare with current version
  2. The CF dashboard bundler should resolve @cloudflare/puppeteer automatically IF the BROWSER binding is present and the import is at the top level. Verify bindings are set on both workers in CF dashboard.
  3. Check if CF dashboard requires import puppeteer from '@cloudflare/puppeteer' vs a different import style
  4. Do NOT attempt another dist-index.js build — that path is confirmed broken for dashboard deploy
  5. Look at git history for the last known working version of CAC src/index.js before Build 009 changes and compare the puppeteer import line

Command to check git history:

git log --oneline -- workers/cac-corporate-enquiry/src/index.js
git show <commit>:workers/cac-corporate-enquiry/src/index.js | head -20

Root cause found: nodejs_compat flag is set in wrangler.toml but does NOT carry over when pasting code into CF dashboard manually. Dashboard deploy needs the flag set separately.

Fix: For BOTH workers in CF dashboard: Settings → Compatibility flags → add nodejs_compat → Save → THEN paste src/index.js and deploy.

This is required for @cloudflare/puppeteer to resolve. Without it the dashboard bundler cannot find the module regardless of bindings.