Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update outdated transform imports lucide-react #53697

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
34 changes: 17 additions & 17 deletions packages/next/src/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,39 +686,39 @@ function assignDefaults(
transform: {
// Special aliases
'(SortAsc|LucideSortAsc|SortAscIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/arrow-up-narrow-wide!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/arrow-up-narrow-wide!lucide-react',
'(SortDesc|LucideSortDesc|SortDescIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/arrow-down-wide-narrow!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/arrow-down-wide-narrow!lucide-react',
'(Verified|LucideVerified|VerifiedIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/badge-check!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/badge-check!lucide-react',
'(Slash|LucideSlash|SlashIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/ban!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/ban!lucide-react',
'(CurlyBraces|LucideCurlyBraces|CurlyBracesIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/braces!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/braces!lucide-react',
'(CircleSlashed|LucideCircleSlashed|CircleSlashedIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/circle-slash-2!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/circle-slash-2!lucide-react',
'(SquareGantt|LucideSquareGantt|SquareGanttIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/gantt-chart-square!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/gantt-chart-square!lucide-react',
'(SquareKanbanDashed|LucideSquareKanbanDashed|SquareKanbanDashedIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/kanban-square-dashed!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/kanban-square-dashed!lucide-react',
'(SquareKanban|LucideSquareKanban|SquareKanbanIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/kanban-square!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/kanban-square!lucide-react',
'(Edit3|LucideEdit3|Edit3Icon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/pen-line!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/pen-line!lucide-react',
'(Edit|LucideEdit|EditIcon|PenBox|LucidePenBox|PenBoxIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/pen-square!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/pen-square!lucide-react',
'(Edit2|LucideEdit2|Edit2Icon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/pen!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/pen!lucide-react',
'(Stars|LucideStars|StarsIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/sparkles!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/sparkles!lucide-react',
'(TextSelection|LucideTextSelection|TextSelectionIcon)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/text-select!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/text-select!lucide-react',
Comment on lines 688 to +715
Copy link

Choose a reason for hiding this comment

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

IMO it would be best if we just delete all those lines.
lucide-icons/lucide#1486

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jguddas Thank for your PR, this looks like best solution for all those aliases.

@shuding I will create another PR with those aliases lines removed after we released new version of lucide with the changes from @jguddas in lucide-icons/lucide#1486

Copy link

Choose a reason for hiding this comment

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

I also have the feeling all these aliases don't belong here, but it should rather be fixed in lucide.
Thanks for taking care!

// General rules
'Lucide(.*)':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/{{ kebabCase memberMatches.[1] }}!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/{{ kebabCase memberMatches.[1] }}!lucide-react',
'(.*)Icon':
'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/{{ kebabCase memberMatches.[1] }}!lucide-react',
'*': 'modularize-import-loader?name={{ member }}&from=default&as=default&join=./icons/{{ kebabCase member }}!lucide-react',
'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/{{ kebabCase memberMatches.[1] }}!lucide-react',
'*': 'modularize-import-loader?name={{ member }}&from=default&as=default&join=../esm/icons/{{ kebabCase member }}!lucide-react',
},
},
ramda: {
Expand Down
2 changes: 1 addition & 1 deletion test/development/basic/modularize-imports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('modularize-imports', () => {
app: new FileRef(join(__dirname, 'modularize-imports/app')),
},
dependencies: {
'lucide-react': '0.263.1',
'lucide-react': '0.264.0',
},
})
})
Expand Down