Skip to content

Conversation

@nervmouse
Copy link

No description provided.

google-labs-jules bot and others added 14 commits January 21, 2026 23:22
- Converted core files and fields in src/js to ESM.
- Created src/js/index.js as entry point.
- Added vite.config.js for bundling (UMD/ESM/CJS).
- Renamed gulpfile.js to gulpfile.cjs.
- Cleaned up imports and removed IIFEs.
- Removed unused imports (e.g. jQuery in Alpaca-async.js).
- Verified build with npx vite build.
- Converted core files and fields in src/js to ESM.
- Created src/js/index.js as entry point.
- Added vite.config.js for bundling (UMD/ESM/CJS).
- Renamed gulpfile.js to gulpfile.cjs.
- Cleaned up imports and removed IIFEs.
- Removed unused imports (e.g. jQuery in Alpaca-async.js).
- Verified build with npx vite build.
- Added refactor-esm-todo.md for remaining tasks.
- Update `package.json` to point to new Vite build artifacts (CJS/ESM/UMD).
- Update `package.json` scripts to use `vite build` as default.
- Remove `"type": "module"` from `package.json` to support legacy test runners, and rename `vite.config.js` to `vite.config.mjs`.
- Refactor `src/js/HandlebarsTemplateEngine.js` to proper ESM module.
- Update `src/js/index.js` to import all CSS files for bundling.
- Update `.testem.json` to run tests against `dist/alpaca/alpaca.umd.js` and fix dependencies.
- Update `features/support/cucumber.html` to load new artifacts.
- Update `features/support/world.js` to use `selenium-webdriver` correctly with Headless Chrome.
- Install `selenium-webdriver` and `bower` dependencies.
…098400457

Refactor ESM: Finalize build and test configuration
- Replaces legacy testing stack with Vitest and HappyDOM.
- Implements a QUnit adapter in `vitest.setup.js` to run existing tests without rewrite.
- Creates a Vite plugin to transform `module()` to `window.module()` to avoid CommonJS conflicts.
- Adds dynamic template compilation in test setup to inject Handlebars templates.
- Fixes module exports in `src/js/Alpaca-async.js`.
- Fixes `compileTemplates` in `src/js/Alpaca.js` to handle empty template queues.
- Installs necessary test dependencies via npm.
…1184442089650

Refactor testing to Vitest + HappyDOM
…ion)

- Fixed race conditions in `ArrayField` tests by using async `simulateClick` and disabling animations.
- Fixed `ReferenceError: arrayId is not defined` in `ArrayField.js`.
- Fixed assertion count mismatch in `ArrayField.js`.
- Fixed missing `.alpaca-controlfield` class in `ControlField.js`.
- Fixed validation state refresh logic in `Alpaca.js` to ensure correct validity state even when initial errors are hidden.
- Updated `fix-errors-todo.md` with progress.
- Cleaned up test helpers and setup.
Refactors `vitest.setup.js` to support legacy QUnit tests by:
- Importing missing dependencies (`jquery-price-format`).
- Mocking `window.CKEDITOR`.
- Polyfilling jQuery pseudo-selectors and patching `querySelectorAll` to force Sizzle usage in `happy-dom`.
- Pre-populating `#qunit-fixture` with necessary DOM elements.
Also fixes a typo in `TextAreaField.js` test.

Co-authored-by: nervmouse <2713788+nervmouse@users.noreply.github.com>
…5987348418060398

Migrate legacy tests to Vitest
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