{{ message }}
Repository navigation
feat(administration): ship a Jest config factory with the extension tooling - #21797
Open
Gerrit Weiermann (gweiermann) wants to merge 8 commits into
Open
Gerrit Weiermann (gweiermann) wants to merge 8 commits into
Gerrit Weiermann (gweiermann) wants to merge 8 commits into
Conversation
This was referenced Oct 20, 2026
…ooling Extensions such as SwagCommercial run their specs on the Administration's test harness but copy its Jest config by hand, so harness changes like the shopware:* virtual modules or the feature flag registry behind triggerDeprecationOrThrow never reach them. extension-tooling/jest.mjs now owns the harness: environment, setup files, transforms and host module mapping, all resolved into the installed Administration. The Administration's own Jest config composes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…extension Setup now writes .shopware/jest.mjs next to the tsconfig and ESLint bridges. It re-exports the factory of the installed Administration, so an extension's jest.config.mjs imports it and only adds its own options. No jest.config.mjs is scaffolded, because not every extension has specs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tory The factory spread every unknown option into the config. An extension could replace testEnvironment or resolver and silently lose it.activeFeatureFlags(), and its transformIgnorePatterns was overwritten by the harness default. The factory now merges the harness options (plus testEnvironmentOptions), lets an explicit allowlist replace the default, and throws on any other option with the list of accepted ones. It also keeps the harness on the installed Administration: - globals.adminPath, the vue-jest tsConfig and ADMIN_PATH stay pinned to it. - Pinia, vue-i18n and vue-router resolve to its copies, like Vue and the Meteor packages, so a spec and the code it mounts share one instance. - Only src/ imports map into it, so a package such as srcdoc-polyfill stays untouched. - The meta-glob Babel transform matches only its own files, so an extension's src/module/index.ts stays on SWC. - HOST_TRANSFORMED_PACKAGES and HOST_TRANSFORM_IGNORE_PATTERNS export its frozen transform defaults, so a replaced transformIgnorePatterns keeps them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e of the jest harness The harness reads two files that every installation generates itself: the component import map and the entity schema. The factory checked only the first, so a missing entity schema surfaced as an unresolved import in the first spec. The factory now lists every missing generated file with the command that generates it. It still fails first, and with its own message, when the Administration ships no test/ folder at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e end to end The e2e sets up a plugin in a temporary project and runs its specs with the Administration's Jest through the generated .shopware/jest.mjs bridge. The specs resolve the shopware:* virtual modules, warn about a deprecation before its major and throw once the major is active, and mount a TypeScript setup SFC and a Twig template. The SFC spreads a Set, which renders nothing unless vue-jest compiles it with the Administration's tsconfig. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The extension-tooling README explains how an extension composes the factory, which options merge and which replace, how to transform an additional ESM package, and which generated files the harness needs. RELEASE_INFO announces the factory as experimental extension tooling that runs in a platform checkout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrit Weiermann (gweiermann)
force-pushed
the
feat/admin-extension-jest-config
branch
from
October 21, 2026 14:48
0396ccd to
74c1acd
Compare
5 tasks done
Gerrit Weiermann (gweiermann)
marked this pull request as ready for review
October 21, 2026 14:56
Gerrit Weiermann (gweiermann)
marked this pull request as draft
October 22, 2026 08:12
…est factory The stack makes the Composer package ship the Jest setup files, so the factory no longer needs to reject an Administration without test/_setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Draft
4 of 5 tasks
Gerrit Weiermann (gweiermann)
marked this pull request as ready for review
October 23, 2026 06:31
Gerrit Weiermann (gweiermann)
requested review from
David Traum (davidtraum) and
Jannis Leifeld (jleifeld)
October 23, 2026 06:31
Jannis Leifeld (jleifeld)
approved these changes
Oct 23, 2026
David Traum (davidtraum)
approved these changes
Oct 23, 2026
This branch has not been deployed
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
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.

1. Why is this change necessary?
Jest in SwagCommercial and other extensions missed / will miss these features:
shopware:*virtual modulestriggerDeprecationOrThrow()baseline and assertionsit.deprecated()/it.activeFeatureFlags()helperThe extension tooling already gives extensions their TypeScript and ESLint config from the installed Administration. Jest was missing.
2. What does this change do, exactly?
extension-tooling/jest.mjswithshopwareAdminJest(options)testEnvironment) throws@vue/test-utils, Pinia, vue-i18n, vue-router and Meteor resolve to the Administration's copy, so specs share one instance with the Administration code they mount.shopware/jest.mjsjest.config.mjsis scaffolded, extensions opt inCurrently weird:
test/folder. The factory says so instead of failing on a missing file (fixed in feat(administration): ship the Jest harness with the Composer package #21805)3. Describe each step to reproduce the issue or behaviour.
In a plugin under
custom/plugins:composer admin:setup-extension-toolingnode <administration>/node_modules/jest/bin/jest.js --config jest.config.mjsin the plugin's Administration folderV6_8_0_0=1makes the deprecation throw.SwagCommercial's full suite on its trunk config and on the factory (through the bridge): 5447 tests each, 0 tests changed status.
4. Please link to the relevant issues (if any).
admin:test-extensions)5. Checklist
RELEASE_INFO-6.<current major line>.mdin the upcoming version section for informational changes: what changed, who is affected, and how to adapt.UPGRADE-6.<next major>.mdfor breaking changes and deprecations: what changed, who is affected, and how to adapt.