Skip to content

refactor(config): isolate every configurable value - #5

Closed
arnaud-zg wants to merge 1 commit into
ci/checks-and-pages-deployfrom
refactor/isolate-configuration
Closed

arnaud-zg wants to merge 1 commit into
ci/checks-and-pages-deployfrom
refactor/isolate-configuration

Conversation

@arnaud-zg

Copy link
Copy Markdown
Owner

Stacked on #4.

Summary

  • src/config/site.config.ts: base path, origin, author and social links, article link.
    Shared by vite.config.ts at build time and main.tsx at runtime
  • src/config/commerce.config.ts: tax rate, free shipping threshold and cost, per-item
    quantity limits, currency conversion factors. ShippingPolicy, TaxPolicy, CartItem,
    and GoldSilverCopperFormatter read from it, and their static fields are now readonly
  • src/config/storage.config.ts: which WelcomeSurveyStorage implementation is active,
    replacing three commented-out imports in a UI file with one line in a config file
  • src/config/analytics.config.ts: the Umami event-name taxonomy, replacing scattered
    string literals across three files
  • The Umami website id now lives in .env, interpolated into index.html and read by
    analytics.config.ts, one source of truth for both
flowchart LR
  A[hardcoded numbers and strings] --> B[src/config/*.config.ts]
  B --> C[ShippingPolicy, TaxPolicy, CartItem]
  B --> D[storage selection]
  B --> E[analytics events, links]
Loading

Test plan

  • pnpm typecheck
  • pnpm check
  • pnpm build, confirmed the interpolated Umami id lands correctly in dist/index.html
  • pnpm test, same 4 pre-existing failures, unrelated, fixed next in the stack

🤖 Generated with Claude Code

https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g

- src/config/site.config.ts: base path, canonical origin, author and social links, the
  article link, shared by vite.config.ts (build) and main.tsx (runtime)
- src/config/commerce.config.ts: tax rate, free shipping threshold and cost, per-item
  quantity limits, currency conversion factors. ShippingPolicy, TaxPolicy, CartItem, and
  GoldSilverCopperFormatter read from it instead of hardcoding numbers, and their static
  fields are now readonly
- src/config/storage.config.ts: which WelcomeSurveyStorage implementation is active,
  replacing three commented-out imports in a UI file with one line in a config file
- src/config/analytics.config.ts: the Umami event-name taxonomy, replacing scattered
  string literals across ShoppingCart.tsx, WelcomeModal.tsx, and the home route
- the Umami website id now lives in .env (VITE_UMAMI_WEBSITE_ID) and is interpolated into
  index.html's script tag and read by analytics.config.ts, one source of truth for both
- public/404.html can't import a TS module, added a comment pointing at site.config.ts as
  the source it has to stay in sync with

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g
@arnaud-zg

Copy link
Copy Markdown
Owner Author

Folded into #17 (combined toolchain + bugfix PR).

@arnaud-zg arnaud-zg closed this Sep 2, 2026
@arnaud-zg
arnaud-zg deleted the refactor/isolate-configuration branch September 2, 2026 19:01
@arnaud-zg
arnaud-zg restored the refactor/isolate-configuration branch September 2, 2026 19:13
@arnaud-zg arnaud-zg reopened this Sep 2, 2026
@arnaud-zg

Copy link
Copy Markdown
Owner Author

Closing as stale/superseded — this branch stack's work already landed on main via a reorganized set of PRs (see #17, #7, #18, #10, #12, #13, #19, #16, #14, #20). Re-merging this branch now would conflict with / partially revert that work.

@arnaud-zg arnaud-zg closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant