toga-ai 1.0.114 → 1.0.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,3 +4,4 @@
4
4
  |-----|---------|-------|
5
5
  | [TOGa Supply (toga2-supply) Architecture](architecture.md) | `toga2-supply` is the **React + Vite frontend** for TOGa Supply — warehouse fulfillment tooling (shipment selection, fulfill & ship against carrier APIs, NetSui | toga2-supply/src/api/toga.ts, toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx |
6
6
  | [Fulfill & Ship](features/fulfill-and-ship.md) | Fulfill & Ship lets a warehouse user select sales-order line items, enter serials, pick a carrier/method, and in one action: create the Item Fulfillment records | toga2-supply/src/pages/ShipmentItems/view/ShipmentItemsPage.tsx, toga2-supply/src/pages/EditShipment/view/EditShipmentPage.tsx, toga2-supply/src/pages/EditShipment/view/components/forms/EditShipmentForm.tsx, toga2-supply/src/pages/EditShipment/api/UpdateShipmentApi.ts, toga2-supply/src/pages/Shipments/view/components/ShipmentsCardTableForm/ShipmentsCardTableForm.tsx, toga2-supply/src/pages/Shipments/api/ShipmentsApi.ts, _underscore/Model/Client/ItemFulfillment.php, _underscore/Trait/Netsuite/ItemFulfillment.php, _underscore/Component/Library/Carriers/Ups/Ups.php |
7
+ | [AWS Amplify Build & Deploy (non-prod environments)](workflows/amplify-build-and-deploy.md) | How `toga2-supply` (React + Vite) builds and deploys to **AWS Amplify** for non-prod environments (qc-security, qc-performance, alpha, beta, gamma, …). | toga2-supply/amplify.yml, toga2-supply/package.json, toga2-supply/.env.qc-security |
@@ -0,0 +1,77 @@
1
+ ---
2
+ title: AWS Amplify Build & Deploy (non-prod environments)
3
+ framework: "2.0"
4
+ repo: toga2-supply
5
+ project: TOGa Supply
6
+ client: shared
7
+ type: workflow
8
+ status: active
9
+ updated: 2026-06-17
10
+ owners: ["jcardinal"]
11
+ files:
12
+ - toga2-supply/amplify.yml
13
+ - toga2-supply/package.json
14
+ - toga2-supply/.env.qc-security
15
+ related:
16
+ - ../architecture.md
17
+ ---
18
+
19
+ ## Summary
20
+
21
+ How `toga2-supply` (React + Vite) builds and deploys to **AWS Amplify** for non-prod
22
+ environments (qc-security, qc-performance, alpha, beta, gamma, …). Note that the
23
+ **alpha/beta/gamma/production** environments historically deploy via **GitHub Actions**
24
+ (`.github/workflows/*.yml`) into the `agilantsolutions/toga2-supply-build` repo — Amplify
25
+ is the newer path used when standing up additional non-prod environments. The first Amplify
26
+ build of this app failed with a JavaScript heap OOM; this doc records the fix and the
27
+ scalable per-environment build setup.
28
+
29
+ ## Steps
30
+
31
+ 1. **`amplify.yml` at the repo root drives the build.** When present, it **overrides the
32
+ Amplify console build settings entirely, for every branch of the app** — you cannot split
33
+ "memory in the file, build command in the console." Whichever owns the build phase owns all
34
+ of it. Our `amplify.yml`:
35
+ - Sets `NODE_OPTIONS=--max-old-space-size=4096` in both `preBuild` and `build` (the OOM fix).
36
+ - Runs `npx tsc && npx vite build --mode "$VITE_BUILD_MODE"` — the build mode is **not**
37
+ hardcoded.
38
+ - Publishes `dist/` as the artifact baseDirectory.
39
+ 2. **Per environment, set one Amplify env var on that branch:** `VITE_BUILD_MODE` =
40
+ `qc-security` | `qc-performance` | `alpha` | `beta` | `gamma`. No new npm script per env.
41
+ 3. **Each mode needs a matching `.env.<mode>` file** committed in the repo (Vite loads
42
+ `.env.<mode>` for `--mode <mode>`). e.g. `.env.qc-security` provides `VITE_API`. A new
43
+ environment requires creating its `.env.<mode>` file.
44
+ 4. Commit `amplify.yml` + the env file, push the branch; Amplify rebuilds.
45
+
46
+ ## Systems involved
47
+
48
+ - AWS Amplify (build + hosting), per-branch environment variables.
49
+ - Vite 4 build (`vite build --mode <mode>`), TypeScript `tsc` precompile.
50
+ - Sentry source-map upload via `@sentry/vite-plugin` (source maps are **on** —
51
+ `build.sourcemap: true` in `vite.config.ts`).
52
+
53
+ ## Edge cases & escalation
54
+
55
+ - **OOM root cause:** Amplify gives Node the default ~2 GB old-space heap. This app
56
+ (1793 modules + source maps on) exceeds it during Rollup's `rendering chunks` phase →
57
+ `FATAL ERROR: Ineffective mark-compacts near heap limit`. Fix = raise `NODE_OPTIONS`.
58
+ - **Heap vs. instance RAM:** `--max-old-space-size=4096` only helps if the build container
59
+ has ≥4 GB. Amplify **Standard** compute is 4 GB (tight with source maps on). If it OOMs
60
+ again, switch to the **Large build instance** (Amplify → App settings → Build settings)
61
+ and raise to `6144`/`7168`. Setting the heap above physical RAM makes it worse, not better.
62
+ - **Mode/filename mismatch:** `--mode qc-security` loads `.env.qc-security` exactly — a file
63
+ named `.env.qc-security.beta` is silently ignored (build succeeds but ships with no
64
+ `VITE_API`). Name the env file to match the mode.
65
+ - **Secret hygiene:** `.env.<mode>` files have historically carried a live
66
+ `SENTRY_AUTH_TOKEN`. Prefer rotating it and moving it to an Amplify env var rather than
67
+ committing it.
68
+
69
+ ## Change history
70
+
71
+ - 2026-06-17 — Created on first Amplify setup of a new QC environment: added root `amplify.yml`
72
+ with raised Node heap + parameterized `VITE_BUILD_MODE`; renamed `.env.qc-security.beta` →
73
+ `.env.qc-security` (jcardinal)
74
+
75
+ ## Related docs
76
+
77
+ - [TOGa Supply architecture](../architecture.md)
@@ -18,7 +18,7 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
18
18
  - **worker2** (Worker) — 8 doc(s) → [2.0/apps/worker2/INDEX.md](2.0/apps/worker2/INDEX.md)
19
19
  - **api2** (API) — 3 doc(s) → [2.0/apps/api2/INDEX.md](2.0/apps/api2/INDEX.md)
20
20
  - **dbchanges2** (Database Changes) _(framework core)_ — 1 doc(s) → [2.0/apps/dbchanges2/INDEX.md](2.0/apps/dbchanges2/INDEX.md)
21
- - **toga2-supply** (TOGa Supply) — 2 doc(s) → [2.0/apps/toga2-supply/INDEX.md](2.0/apps/toga2-supply/INDEX.md)
21
+ - **toga2-supply** (TOGa Supply) — 3 doc(s) → [2.0/apps/toga2-supply/INDEX.md](2.0/apps/toga2-supply/INDEX.md)
22
22
  - **saml** (SAML SSO Gateway) — 2 doc(s) → [2.0/apps/saml/INDEX.md](2.0/apps/saml/INDEX.md)
23
23
  - **toga2-view** (TOGa View Frontend) — 0 doc(s) → [2.0/apps/toga2-view/INDEX.md](2.0/apps/toga2-view/INDEX.md)
24
24
  - **toga2-hub** (TOGa Hub) — 2 doc(s) → [2.0/apps/toga2-hub/INDEX.md](2.0/apps/toga2-hub/INDEX.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.114",
3
+ "version": "1.0.115",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",