Commit Graph

12 Commits

Author SHA1 Message Date
David Montero 375b952d47 refactor(examples): move Pico W WiFi examples to the pro overlay seam
The Pico W WiFi showcase examples are a paid-overlay feature now (the WiFi
engine moved to the overlay). Read them through a build-time `@pro` seam so the
SSR prerender + gallery + sitemap include them when built with the overlay, and
OSS gets an empty stub.

- data/examples.ts: import { proExamples } from '@pro/data/proExamples' (static,
  build-time) instead of the local examples-picow-wifi.ts; delete that file.
- src/__pro_stub__/data/proExamples.ts: OSS no-op (empty list) for the @pro alias.
- vitest.config.ts: mirror the @pro alias (stub by default / overlay when
  VITE_PRO_BUILD) so tests loading examples.ts resolve it.
- scripts/generate-sitemap.mjs: also parse <PRO_OVERLAY_PATH>/data/proExamples.ts
  when building with the overlay (the script reads example IDs from source text,
  so it can't follow the alias).
- Tests: drop the picow-wifi import/usage from the 5 OSS example tests (they
  validate the OSS set now); prune the 4 obsolete picow netlist snapshots. The
  overlay's proExamples get their own coverage in pro/.../__tests__/.
2026-06-15 15:54:44 +02:00
David Montero 07a0bfef6e seo: emit trailing-slash canonical + sitemap URLs
Static/docs/example routes are served as <route>/index.html and nginx
301-redirects the slash-less form to add the trailing slash. The sitemap
generator, the prerender canonical/og:url, and the client useSEO canonical
all emitted the slash-LESS form, so every sitemap URL was fetched as a
redirect (filed under 'Page with redirect' in Search Console) and each
canonical pointed at a redirecting URL.

Align all three to the trailing-slash form so sitemap URL == canonical ==
served URL == 200, with no redirect hop.

- generate-sitemap.mjs: append '/' to every <loc> (root stays '/')
- prerender-seo.mjs: withSlash() on canonical + og:url (routes + examples)
- useSEO.ts: withTrailingSlash() on canonical + og:url (covers dynamic
  project pages too)
2026-06-15 06:10:32 +02:00
David Montero Crespo ac7d74b2b5 fix(monaco): cross-platform postinstall via Node script
Replace Unix-only shell one-liner (mkdir -p / printf / cp -r) with a
Node.js ESM script (scripts/copy-monaco.mjs) that works on Windows,
macOS and Linux alike. The script still writes public/monaco/.gitignore
to keep copied assets out of git.
2026-05-11 12:42:33 -03:00
David Montero Crespo 0ff76a0f9d feat(i18n): translate Velxio 2.0 + 2.5 release pages (block 13)
Wire useTranslation() into Velxio2Page and Velxio25Page: hero badge,
accent, subtitle, CTAs, board/example/outcome cards, OSS section, and
footer links all keyed under landing.v2.* and landing.v25.*.

Split en/common.json (34KB) into common.json (25KB) + releases.json
(9KB) so each translation request stays inside DeepSeek's 8192-token
output cap. i18n bootstrap merges both bundles into the default common
namespace at load time, lazy loader fetches both per locale.

translate-i18n.mjs: set max_tokens=8192 + response_format json_object
on the DeepSeek call so future bundles closer to the cap don't get
silently truncated.

All 9 locales regenerated via DeepSeek (fr/de/es/it/pt-br/zh-cn/ja/ru).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 17:19:16 -03:00
David Montero Crespo cc077c09d1 feat(i18n): react-i18next foundation + 9-locale support for header / footer
This is Phase 1 of multi-language support: the visible chrome (header,
footer, language switcher) and routing are wired up for all 9 locales
(en, es, pt-br, it, fr, zh-cn, de, ja, ru) — same set the blog at
velxio.dev/blog/ already supports. The Editor and the long-form
landing-page copy are still English-only and will be translated in a
follow-up.

Infrastructure
- frontend/src/i18n/config.ts: locale registry + LOCALE_META (htmlLang,
  native name, og locale, dir). Mirrors pro/blog/src/i18n/config.ts so
  cookie sync stays consistent.
- frontend/src/i18n/cookie.ts: read/write the velxio_locale cookie at
  Path=/; Max-Age=1y; SameSite=Lax (Secure on HTTPS). The blog reads
  the same cookie via an inline script in its Layout.astro.
- frontend/src/i18n/path.ts: getLocaleFromPath / stripLocaleFromPath /
  localizedPath / switchLocale / blogUrlFor — match the blog's helpers
  one-to-one.
- frontend/src/i18n/index.ts: i18next bootstrap. English bundle is
  inlined synchronously for first paint; non-default locales are
  lazy-loaded via dynamic import on demand. Initial locale is decided
  in priority order URL > cookie > navigator > en.
- frontend/src/i18n/LocaleSync.tsx: top-level wrapper inside <Router>.
  On every URL change loads the matching locale bundle, calls
  i18n.changeLanguage, writes the cookie, and mirrors the locale onto
  <html lang> and dir.
- frontend/src/i18n/useLocalizedNavigate.ts: useCurrentLocale,
  useLocalizedHref, useLocalizedNavigate hooks for components that
  build internal links.

Routing
- App.tsx: route table extracted to a single ROUTES array, then
  registered twice — once at the root (default English) and once
  nested under each non-default locale (`/<locale>/...`). Explicit
  per-locale parent routes (rather than a generic `:lang` param) so
  React Router never accidentally swallows a real top-level path
  like `/circuit-simulator` as a locale segment.

Header / Footer
- LanguageSwitcher.tsx + .css: dropdown matching the blog's
  LanguageSwitcher.astro. Globe icon + locale code on the trigger,
  native names + ISO codes in the menu. Click → `switchLocale()`
  rewrites the URL under the new locale; LocaleSync handles the
  rest (load bundle, change language, write cookie).
- AppHeader.tsx: every nav label and the auth dropdown copy now
  goes through `t('header.nav.*')`, `t('header.auth.*')`. All
  internal Links wrapped with localize() so navigation stays
  inside the active locale. Added a "Blog" link computed via
  `blogUrlFor(currentLocale)` so /es/ → /blog/es/, etc.
- LandingPage.tsx: footer About-Velxio paragraph reads from
  t('footer.about').

Translations (Phase 1 strings)
- frontend/src/i18n/locales/<locale>/common.json: nav labels, auth
  buttons, footer About copy. Hand-translated for all 9 locales,
  AGPLv3 / brand names preserved as-is.

Tooling
- frontend/scripts/translate-i18n.mjs: standalone Node script that
  takes the en.json bundles and auto-translates them to the 8 other
  locales via DeepSeek (primary) + Gemini (fallback). One LLM call
  per (locale, namespace) pair. Run after extracting new strings
  with `npm run translate:i18n`.

Phase 2 (deferred)
- Editor (toolbar, file explorer, simulator canvas, component picker,
  library manager, error toasts) — hundreds of strings.
- Examples / Docs / About / Profile pages.
- The translate-i18n.mjs script is ready to handle these once the
  strings have been extracted into JSON keys.
2026-05-09 00:40:37 -03:00
David Montero Crespo 212ecd1bcb refactor: rename components and update prefixes to 'velxio-' for consistency
- Modified the index file to reflect the new naming convention for Velxio components.
- Changed JSX declarations to use 'velxio-' prefix for various components.
- Updated component overrides to replace 'wokwi-' with 'velxio-' for logic gates and other components.
- Adjusted SVG generation script to use 'velxio-' prefix for BMP280 and Raspberry Pi components.
- Marked submodules as dirty in QEMU and RP2040 libraries.
- Added .prettierignore and .prettierrc.json for consistent code formatting.
- Introduced InstrumentComponent with support for Voltmeter and Ammeter, including pin information handling.
2026-04-21 16:45:45 -03:00
David Montero Crespo 993a25390c feat: add passive component presets and custom elements
- Implemented a script to inject passive-component preset variants into `scripts/component-overrides.json`, including resistors, capacitors, and inductors with custom names and thumbnails.
- Added a new custom element `<wokwi-capacitor-electrolytic>` representing a polarized aluminum-can capacitor with appropriate SVG representation.
- Updated metadata generation to accommodate new component names and thumbnails for better user experience in the component picker.
- Marked submodules `qemu-lcgamboa` and `rp2040js` as dirty to reflect local changes.
2026-04-21 15:21:03 -03:00
David Montero Crespo b422f2b4c1 fix(seo): include circuitExamples in sitemap generator
generate-sitemap.mjs was only scanning examples.ts for example IDs using a
textual regex. With the 40 new circuit examples living in a separate file
(examples-circuits.ts), they were missing from the generated sitemap.xml
and therefore invisible to search engines / SSR prerender URL list.

Now the generator reads both source files and merges their example IDs.

Also includes auto-applied formatting changes to generate-component-metadata.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 01:06:26 -03:00
David Montero Crespo 12343075d8 feat: add example detail pages and SEO improvements
- Implemented ExampleDetailPage for individual example projects with SEO metadata.
- Updated routing to use ExampleDetailPage instead of ExampleLoaderPage.
- Enhanced sitemap generation to include example project URLs.
- Added prerendering support for example detail pages in the server entry.
- Improved SEO handling in ProjectByIdPage to dynamically set metadata based on project visibility.
- Refactored example ID extraction from examples.ts for sitemap generation.
- Updated console logs to reflect total URLs generated in sitemap.
2026-04-13 15:22:08 -03:00
David Montero Crespo 005f50262f feat: enhance build scripts and add SEO prerendering; improve touch interactions for wire creation 2026-03-25 00:08:46 -03:00
David Montero Crespo b95230f53e feat: update sitemap generation script to use Node.js and mark subprojects as dirty 2026-03-23 19:04:23 -03:00
David Montero Crespo 1c1775c327 feat: add multi-board support section to Velxio 2.0 landing page and update sitemap generation script 2026-03-23 19:01:11 -03:00