Skip to content

fix: Add vite.config.ts support to upgrade-packages command#1410

Closed
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-5858b022-0978-40f0-9ad3-7b3888cfbae8
Closed

fix: Add vite.config.ts support to upgrade-packages command#1410
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-5858b022-0978-40f0-9ad3-7b3888cfbae8

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 20, 2025

Fixes #1388 - The ig upgrade-packages command now correctly updates trial package references to licensed package references in vite.config.ts files for React and WebComponents projects.

Problem

When using ig upgrade-packages, the CLI would upgrade package references in TypeScript/TSX files, CSS files, HTML files, and package.json files, but would skip vite.config.ts files. This meant that references like:

export default defineConfig(({ mode }) => {
  return {
    plugins: [
      viteStaticCopy({
        targets: [
          {
            src: "node_modules/igniteui-webcomponents-grids/grids/themes/light/bootstrap.css",
            dest: "themes",
          },
        ],
      }),
    ],
  };
});

Would not be upgraded to use the licensed package paths:

src: "node_modules/@infragistics/igniteui-webcomponents-grids/grids/themes/light/bootstrap.css",

Solution

Added vite.config.ts files to the logic files collection that gets processed during the upgrade for React and WebComponents projects. The existing regex patterns that handle import statement upgrades also correctly handle the string literal paths in vite.config.ts files.

Changes

  • packages/core/update/Update.ts: Added 6 lines to include vite.config.ts files in the upgrade process for React and WebComponents frameworks
  • spec/unit/update-spec.ts: Added comprehensive tests for both React and WebComponents vite.config.ts upgrade scenarios and updated existing test expectations

Testing

  • ✅ Added specific tests for vite.config.ts upgrade functionality for both React and WebComponents
  • ✅ All existing updateWorkspace tests continue to pass
  • ✅ No regressions introduced - same test failure count as before (unrelated environment issues)
  • ✅ Verified that existing regex patterns correctly handle vite.config.ts string literals

The fix is minimal and surgical, leveraging the existing upgrade infrastructure while extending support to an important configuration file used in modern Vite-based projects.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.google-analytics.com
    • Triggering command: Ignite UI CLI (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits August 20, 2025 05:16
Co-authored-by: Lipata <2621802+Lipata@users.noreply.github.com>
Co-authored-by: Lipata <2621802+Lipata@users.noreply.github.com>
Copilot AI changed the title [WIP] fix: Should upgrade cli command to update vite.config? #1388 Note: The discussion in the issue to find the proper solution fix: Add vite.config.ts support to upgrade-packages command Aug 20, 2025
Copilot AI requested a review from Lipata August 20, 2025 05:26
@Lipata Lipata marked this pull request as ready for review August 20, 2025 06:07
@coveralls
Copy link
Copy Markdown

coveralls commented Aug 20, 2025

Coverage Status

coverage: 70.204% (+0.04%) from 70.167%
when pulling 89b1f81 on copilot/fix-5858b022-0978-40f0-9ad3-7b3888cfbae8
into d71af0d on master.

Copilot AI added a commit that referenced this pull request Aug 20, 2025
…ttern fix

Co-authored-by: Lipata <2621802+Lipata@users.noreply.github.com>
@Lipata
Copy link
Copy Markdown
Contributor

Lipata commented Aug 21, 2025

Closing, because the fix is already in #1408

@Lipata Lipata closed this Aug 21, 2025
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.

Should upgrade cli command update vite.config?

3 participants