Skip to content

Release: 4.x (Vite and Storybook React v10)#174

Open
callinmullaney wants to merge 87 commits into
developfrom
4.x
Open

Release: 4.x (Vite and Storybook React v10)#174
callinmullaney wants to merge 87 commits into
developfrom
4.x

Conversation

@callinmullaney
Copy link
Copy Markdown
Collaborator

@callinmullaney callinmullaney commented Jun 10, 2025

This PR does the following:

  • Replaces the Webpack-based build pipeline with Vite for Emulsify Core 4.x while preserving legacy upgrade paths.
  • Migrates Storybook to React/Vite so Twig-rendered components and React components can be documented in the same Storybook instance.
  • Adds a normalized project.emulsify.json environment/config model with platform adapters for generic and Drupal behavior.
  • Supports src/components, root ./components, and explicit variant.structureImplementations component structures without requiring existing projects to refactor.
  • Preserves Drupal SDC behavior, including Drupal-specific behavior attachment, Twig filter defaults, and component mirroring behind the Drupal adapter.
  • Adds first-class Twig Storybook rendering through renderTwig from @emulsify/core/storybook.
  • Adds native Twig.js support for Emulsify helpers including bem(), add_attributes(), and switch / case / default / endswitch tags.
  • Adds package exports for stable public import paths.
  • Adds release-readiness fixtures and CI validation for Vite builds, Storybook builds, mixed Twig/React stories, legacy component structures, and structure implementation variants.
  • Updates documentation for the 4.x Vite + Storybook release, including Twig, React, mixed Storybook usage, platform behavior, output paths, and migration notes.
  • Keeps Node 24 as the supported runtime floor.

Related Issue(s)

Notes:

  • This PR intentionally does not address the hard-coded GitHub URL in Storybook manager styling; that is being handled separately.
  • The implemented platform adapters are currently generic and drupal. WordPress + Timber and Craft remain platform directions documented as future adapter opportunities rather than fully implemented adapters.
  • Existing lint output still includes pre-existing warnings from the repo-wide ESLint/security rules, but the lint command exits successfully.
  • Drupal-specific behavior is now adapter-driven instead of being assumed globally for every Storybook/project type.

Functional Testing:

  • Install dependencies with Node 24: npm install
  • Run lint: npm run lint
  • Run unit tests: npm test
  • Build Storybook: npm run storybook-build
  • Run release fixture builds: npm run fixtures:release
  • Verify package contents include public runtime files: npm pack --dry-run --ignore-scripts --json
  • In a Drupal SDC fixture/project, confirm src/components builds into dist and mirrors component output according to Drupal SDC behavior.
  • In a generic fixture/project, confirm no Drupal behavior shim or window.Drupal requirement is introduced.
  • In Storybook, confirm Twig stories using renderTwig() and React stories render side by side.
  • In a Twig story/template, confirm bem(), add_attributes(), and switch / case / default / endswitch render through Twig.js.

Security

Security checks that should be reviewed

  • Project structure paths from project.emulsify.json are normalized and unsafe paths outside the project root are ignored.
  • Optional project-level Vite and Storybook extension points remain explicit and scoped to the configured project extension paths.
  • Drupal behavior attachment is no longer a global assumption for all platforms.
  • Package files is allowlist-based so release fixtures/tests are not shipped to downstream installs unless intentionally included.

Accessibility

Should this be checked for this feature?

  • Storybook a11y parameters are preserved by default and can still be overridden by project preview configuration.
  • This PR primarily changes build/render infrastructure rather than introducing production UI components.
  • Mixed Twig/React Storybook rendering should still be reviewed in Storybook for expected semantic markup and addon behavior where project stories include user-facing UI.

Callin Mullaney added 30 commits May 24, 2026 13:05
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.

3 participants