Skip to content

Modernize project: Vite + Vue 3 + Cypress 13 + GitHub Actions#23

Open
circlecube wants to merge 4 commits into
mainfrom
claude/modernize-project-deps-6wGt5
Open

Modernize project: Vite + Vue 3 + Cypress 13 + GitHub Actions#23
circlecube wants to merge 4 commits into
mainfrom
claude/modernize-project-deps-6wGt5

Conversation

@circlecube

Copy link
Copy Markdown
Owner

Summary

Full toolchain modernization to bring the project up to date and ready for future mobile distribution via Capacitor.

  • Build system: Gulp (2016-era) → Vite 5 with @vitejs/plugin-vue. npm run dev for hot-reload dev server, npm run build for production output.
  • Vue 2 → Vue 3: Migrated from a vendor-file Vue 2 instance to a Vue 3 Single File Component (src/App.vue) using the Options API. Logic is identical — filters replaced with a method, v-bind:/v-on: shortened to : / @.
  • Moment.js removed: Replaced moment().fromNow() with native Intl.RelativeTimeFormat (zero extra bytes).
  • Font Awesome 4.6.3 → FA6 (npm): Removed bundled local CSS/font files; now installed as @fortawesome/fontawesome-free. Only the solid icon set is imported to keep the bundle lean.
  • Modernizr removed: CSS Grid is universally supported — grid layout applied unconditionally, no feature detection needed.
  • Cypress 1.0.3 → 13.x: Config migrated from cypress.json to cypress.config.js; tests moved from www/cypress/integration/ to cypress/e2e/ with .cy.js extension.
  • Travis CI → GitHub Actions: New workflow at .github/workflows/ci.yml (Node 20 LTS, cypress-io/github-action@v6).
  • Removed: gulpfile.js, .travis.yml, cypress.json (all superseded).

New project structure

src/
  main.js          # Vue 3 entry point
  App.vue          # Full app as a Single File Component
  style.scss       # Global styles (grid layout always on, Vue 3 transitions)
  assets/fonts/    # MarvinVisions font (woff2/woff only, dropped IE .eot)
cypress/
  e2e/math-tests.cy.js   # Existing tests, moved + renamed
  support/
vite.config.js
cypress.config.js
.github/workflows/ci.yml

Mobile distribution (Capacitor — next step)

For wrapping in a native iOS/Android app (recommended over Cordova):

npm install @capacitor/core @capacitor/cli @capacitor/ios
npx cap init
# in capacitor.config.ts set webDir: 'dist'
npx cap add ios
npm run build && npx cap sync
npx cap open ios

Or to keep the existing Cordova www/ convention, just set build.outDir: 'www' in vite.config.js.

Test plan

  • npm run dev — hot-reload dev server at http://localhost:5173
  • npm run build — clean build to dist/ with no warnings
  • npm run preview — serves built app at http://localhost:8888
  • All existing Cypress e2e tests pass against the built app
  • All game modes (practice / test / timer), card flip, progress bar, and log work visually

https://claude.ai/code/session_016mM8ccmRQf7mAZQn83oZRS


Generated by Claude Code

claude added 4 commits June 3, 2026 02:42
…Hub Actions

- Replace Gulp build system with Vite 5 + @vitejs/plugin-vue
- Migrate Vue 2 (vendor file) to Vue 3 (npm package) using Options API SFC
- Replace Moment.js with native Intl.RelativeTimeFormat
- Replace Font Awesome 4.6.3 (local) with @fortawesome/fontawesome-free 6 (npm)
- Remove Modernizr; apply CSS Grid layout unconditionally (all modern browsers)
- Drop IE/legacy browser targets from autoprefixer
- Upgrade Cypress 1.0.3 → 13.x; migrate config from cypress.json to cypress.config.js
  and move tests from www/cypress/integration/ to cypress/e2e/
- Replace Travis CI with GitHub Actions workflow (Node 20 LTS)
- Add src/ directory with App.vue, style.scss, main.js; font assets in src/assets/
- Remove gulpfile.js, .travis.yml, cypress.json (all superseded)

For Capacitor (mobile) integration: set build.outDir: 'www' in vite.config.js

https://claude.ai/code/session_016mM8ccmRQf7mAZQn83oZRS
Cypress 13 introduced testIsolation: true as the default, which navigates
to about:blank before each test. The existing test suite was written for
the old behavior where tests share browser state within a describe block
(only the first test calls cy.visit). With testIsolation: false the tests
run as originally intended.

https://claude.ai/code/session_016mM8ccmRQf7mAZQn83oZRS
- Use v-show instead of v-if for .infomode and .option.number so
  Cypress can assert .should('not.be.visible') on elements that
  remain in the DOM (Cypress 13 requires elements to exist before
  checking visibility)
- Use numeric:'always' in Intl.RelativeTimeFormat so log timestamps
  always read "X seconds ago" rather than "now" (which lacked 'ago')
- Fix .logs selector typo in 'close logs' test (should be .log)

https://claude.ai/code/session_016mM8ccmRQf7mAZQn83oZRS
When a log entry is created fractions of a second before display,
Math.round(diff) returns 0 and format(0, 'second') produces
'in 0 seconds' rather than 'ago'. Clamp to -1 so entries always
display as '1 second ago' when the rounded value is zero.

https://claude.ai/code/session_016mM8ccmRQf7mAZQn83oZRS
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.

2 participants