Skip to content

feat: add ouds/web-migrate package#3523

Open
MaxLardenois wants to merge 13 commits intoouds/mainfrom
ouds/main-integrate-ouds-migrate-inside-the-monorepo
Open

feat: add ouds/web-migrate package#3523
MaxLardenois wants to merge 13 commits intoouds/mainfrom
ouds/main-integrate-ouds-migrate-inside-the-monorepo

Conversation

@MaxLardenois
Copy link
Copy Markdown
Collaborator

@MaxLardenois MaxLardenois commented Apr 17, 2026

Types of change

  • Non-breaking change
  • Breaking change (fix or feature that would change existing functionality and usage)

Related issues

Closes #3520

Context & Motivation

Integrate the migration tool into OUDS web monorepo

Description

See packges/migrate/README.md

Checklists

  • I have read the contributing guidelines
  • My change follows the developer guide
  • My change pass all tests
  • My change is compatible with a responsive display
  • I have added tests (Javascript unit test or visual) to cover my changes
  • My change introduces changes to the documentation that I have updated accordingly
    • Title and DOM structure is correct
    • Links have been updated (title changes impact links)
    • CSS for the documentation
  • I have checked all states and combinations of the component with my change
  • I have checked all the impacts for the other components and core behavior (grid, reboot, utilities)

Checklist (for Core Team only)

  • The changes need to be in the migration guide
  • The changes are well displayed in Storybook (be careful if example order has changed for DSM)
  • The changes are compatible with RTL
  • Manually test browser compatibility with BrowserStack (Chrome 120, Firefox 121, Edge 120, Safari 15.6, iOS Safari, Chrome & Firefox on Android)

Progression (for Core Team only)

Live previews

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 17, 2026

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit a95c7b3
🔍 Latest deploy log https://app.netlify.com/projects/boosted/deploys/69e7735dd9395e00083e6396
😎 Deploy Preview https://deploy-preview-3523--boosted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@MaxLardenois MaxLardenois linked an issue Apr 17, 2026 that may be closed by this pull request
3 tasks
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new workspace package @ouds/web-migrate to integrate the OUDS Web migration CLI into the monorepo (issue #3520), including replacement rules and snapshot-based tests for HTML/CSS migrations.

Changes:

  • Introduces packages/migrate CLI package with migration engine (replace-in-file) and replacement sets for boosted, ob1, and ouds.
  • Adds Vitest tests + fixtures/snapshots covering replacements and warning emission.
  • Updates repo tooling to exclude the new non-brand workspace from SRI generation and links the workspace in the root lockfile.

Reviewed changes

Copilot reviewed 23 out of 26 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/migrate/vitest.config.js Adds Vitest configuration for the migrate package.
packages/migrate/tests/source-ouds.html HTML fixture for “from ouds” migration testing.
packages/migrate/tests/source-ob1.html HTML fixture for “from ob1” migration testing.
packages/migrate/tests/source-boosted.html HTML fixture for “from boosted” migration testing.
packages/migrate/tests/source-boosted.css CSS fixture for migration testing.
packages/migrate/tests/snapshots/migrated-ouds.html Expected migrated output snapshot (ouds).
packages/migrate/tests/snapshots/migrated-ob1.html Expected migrated output snapshot (ob1).
packages/migrate/tests/snapshots/migrated-boosted.html Expected migrated output snapshot (boosted).
packages/migrate/tests/snapshots/migrated-boosted.css Expected migrated output snapshot (CSS).
packages/migrate/src/utils/warnings.mjs Warning collection + helpers for deprecated/removed classes.
packages/migrate/src/utils/args.mjs CLI arg parsing for --from.
packages/migrate/src/replacements/replacements.spec.mjs Unit tests for core replacement generators.
packages/migrate/src/replacements/ouds.mjs OUDS breakpoint-related replacements.
packages/migrate/src/replacements/ob1.mjs OB1-specific replacements + OUDS updates.
packages/migrate/src/replacements/index.mjs Builds regex arrays for replace-in-file per source set.
packages/migrate/src/replacements/common.mjs Shared replacements and generators (spacing/gap/etc.).
packages/migrate/src/replacements/boosted.mjs Boosted-specific replacements + OUDS updates.
packages/migrate/src/migrate.spec.mjs Integration tests running the migration over fixtures and validating warnings.
packages/migrate/src/migrate.mjs Thin wrapper around replace-in-file with computed replacements.
packages/migrate/package.json Declares the new workspace package and CLI bin entrypoint.
packages/migrate/package-lock.json Adds a per-package lockfile for migrate (new).
packages/migrate/index.mjs CLI entrypoint wiring args → migrate + warning output.
packages/migrate/README.md Documentation for usage/options/examples of the CLI.
package-lock.json Links the new workspace and updates dependency graph.
build/generate-sri.mjs Excludes packages/migrate from brand SRI generation.
.gitignore Ignores packages/migrate/node_modules.
Files not reviewed (1)
  • packages/migrate/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/migrate/package-lock.json Outdated
Comment thread packages/migrate/package-lock.json Outdated
Comment thread build/generate-sri.mjs
sh.config.fatal = true

const BRANDS = fs.readdirSync('packages', { withFileTypes: true }).filter(file => file.isDirectory()).map(dir => dir.name)
const BRANDS = fs.readdirSync('packages', { withFileTypes: true }).filter(file => file.isDirectory() && file.name !== 'migrate').map(dir => dir.name)
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coding file.name !== 'migrate' couples this script to a specific directory name. Since the script actually requires packages/<brand>/config.yml, consider filtering directories by the existence of config.yml (or another brand marker) instead, so adding future non-brand workspace packages won’t require updating this script again.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do that if or when we add another non-brand sub-package

Comment thread packages/migrate/index.mjs Outdated
Comment thread packages/migrate/README.md Outdated
Comment thread packages/migrate/src/replacements/common.mjs Outdated
Comment on lines +16 to +18

return options.remove ? '' : (options.replace === undefined ? args[0] : options.replace)
}
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When options.remove is true, the replacement returns an empty string, which can leave behind empty/whitespace-only class attributes (e.g. the snapshot ends up with class=" "). Consider trimming adjacent whitespace when removing a class token, or add a post-pass to normalize class attributes (collapse spaces and turn class=" " into class="").

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

@MaxLardenois MaxLardenois Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fair point, we could add a replacement for class=" " or something more complex to handle class="some-class ".
But right now we only remove for alert-sm and then again I'm not that confident to actually remove while we have dual-mode projects... Should we keep the remove option and handle spaces or should we not remove anything?
What do you think @vprothais?

@MaxLardenois MaxLardenois marked this pull request as ready for review April 21, 2026 12:56
@boosted-bot boosted-bot moved this from In Progress / Draft to Need Dev Review in 🟣 [Orange-Boosted-Bootstrap] PRs Board Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Need Dev Review

Development

Successfully merging this pull request may close these issues.

[OUDS] Integrate ouds-migrate inside the monorepo

3 participants