-
Notifications
You must be signed in to change notification settings - Fork 364
Refactor/esm #784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nervmouse
wants to merge
14
commits into
gitana:master
Choose a base branch
from
nervmouse:refactor/esm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor/esm #784
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
…0289998 Refactor AlpacaJS to ESM
- 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
… view normalization
…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.
…8036 Fix AlpacaJS test execution errors
…9910 Fix test suite errors
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.