[6.x] Rename @craftcms/cp to @craftcms/ui#19260
Draft
brianjhanson wants to merge 12 commits into
Draft
Conversation
Package directory moves from packages/craftcms-cp to packages/craftcms-ui; npm scripts dev:cp/build:cp/test:cp/storybook:cp become dev:ui/build:ui/ test:ui/storybook:ui. package-lock.json is path-renamed rather than re-resolved, so dependency versions are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The root test script and resources/js tests use vitest but relied on npm hoisting it from workspace packages. The garnish and ui workspaces had drifted to different vitest patch versions, which (because vitest's sibling packages peer-pin exact versions) forced nested per-workspace copies and made root hoisting fragile. Everything now pins ^4.1.10 so a single copy hoists cleanly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Font Awesome kit no longer includes several custom icons that core depends on (c-debug, c-outline, craft-cms, craft-partners, craft-stack-exchange, default-plugin, plus the custom variants of grip-dots, image-slash, and language). custom-icons/ is the only icons directory tracked by git for exactly this reason, but copyicons.php still assumed the kit was the source of truth, so wiping and regenerating the icons directory silently lost them - and a stale grip-dots style override wrote a 0-byte SVG that ended up committed. copyicons.php now skips empty kit SVG content instead of writing it, drops the stale grip-dots override, and fails with restore instructions if any repo-owned custom icon is missing or empty after a run. Also restores the real grip-dots.svg artwork. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- badge story asserted the old fill contract; craft-indicator now receives the raw color name and resolves the loud-tone CSS variable itself - input-color's picker set aria-controls to the slotted text input's id, but ARIA references cannot cross the shadow boundary, so the reference never resolved (axe aria-valid-attr-value) - indicator story tables used an empty <th> for the corner cell - chip thumbnail story img was missing alt text Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The package's vitest suite (including the storybook browser tests) was not run by any workflow, so failures went unnoticed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
QueueService and the queue types are Control Panel application code, not reusable UI-library material, so they move from @craftcms/ui to resources/js/common (services/Queue.ts, types/queue.ts). The CpServices global interface moves with them since it types the app-bootstrapped $queue/$config globals. The moved service keeps relative/bare-package imports only, because the legacy webpack bundle (CP.js) also compiles it and doesn't know Vite's @/ alias. Its test now runs under the root vitest suite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Follows the shared module pattern (like listbox): the service moves to resources/js/modules/queue/queue.ts with its types and test alongside, and a new index.ts assigns Craft.QueueService for legacy/plugin callers. Both entrypoints load the shim. CP.js keeps importing the service directly rather than using the global, because the webpack bundle instantiates it while still evaluating - before Vite's module scripts have assigned Craft.QueueService. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CP.js's QueueService prototype property becomes a lazy getter that reads Craft.QueueService (assigned by the modules/queue shim), so the webpack bundle no longer compiles in its own copy of the service. This also ends the split-brain singleton: legacy delegates like Craft.cp.runQueue() now drive the same initialized instance the Vue surfaces listen to. The getter is safe because the shim's deferred module scripts run before DOMContentLoaded, and every CP.js queue call fires on user interaction or later; only the old eager initializer ran at bundle-eval time. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CraftAuthChallengeForm is an app auth feature (it posts through actionClient), not library UI, and was the only component coupled to the package's HTTP layer. It now lives with its sibling auth custom elements in resources/js/modules/auth/components, and is exposed as Craft.AuthChallengeForm for plugin auth methods - extending a bundled copy from an import would give plugins a separate, useless method registry, so the global is the correct extension surface. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Laravel's File::deleteDirectory() follows a top-level symlink: is_dir() and FilesystemIterator both resolve it, so deletePublishedAssets() would recurse into the link target and empty it, while the trailing @rmdir fails silently and leaves the symlink in place to strike again. With the common dev setup that symlinks public/vendor/craft straight at the cms-assets resources, every craft:setup:publish run wiped the source tree - including the git-tracked custom icons (the recurring "icons keep getting lost" incidents). setup:publish now detects the symlink, warns, and skips deleting and publishing assets entirely; a symlinked target is already serving the source directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
When we started this journey, I thought the
@craftcms/cppackage would carry more code than it has been. This renames the package to@craftcms/uito better reflect the actual purpose. The@craftcms/uipackage will be responsible for UI related code, mostly the web components, while theresourcesfolder holds code that's more specific to the CP itself.Part of this change is relocating the few services from
@craftcms/cpinto theresourcesfolder.