Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion packages/core/update/Update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,23 @@ export async function updateWorkspace(rootPath: string): Promise<boolean> {
case "webcomponents":
if (pkgJSON.workspaces) {
pkgJSON.workspaces.forEach(w => {
workspaces.push(path.join(rootPath, w));
// Handle workspace patterns that may contain globs
if (w.includes("*")) {
// Use glob to expand the workspace pattern
const expandedWorkspaces = fs.glob(rootPath, w);
expandedWorkspaces.forEach(expandedWorkspace => {
// Only add if it's a directory
if (fs.directoryExists(expandedWorkspace)) {
workspaces.push(expandedWorkspace);
}
});
} else {
// Direct workspace path
const workspacePath = path.join(rootPath, w);
if (fs.directoryExists(workspacePath)) {
workspaces.push(workspacePath);
}
}
});
} else {
workspaces.push(path.join(rootPath, "src"));
Expand All @@ -116,6 +132,14 @@ export async function updateWorkspace(rootPath: string): Promise<boolean> {
pkgJsonFiles.push(...fs.glob(workspace, `**/package.json`));
}

// For React and WebComponents projects, also include vite.config.ts files
if (framework.toLowerCase() === "react" || framework.toLowerCase() === "webcomponents") {
const viteConfigFiles = fs.glob(rootPath, `vite.config.ts`, ['node_modules', 'dist']);
if (viteConfigFiles && viteConfigFiles.length > 0) {
logicFiles.push(...viteConfigFiles);
}
}

updateFileImports(logicFiles, styleFiles, upgradeable, fs);
if (shouldUpgradeHTML) {
updateHTMLImports(htmlFiles, upgradeable, fs);
Expand Down
Loading
Loading