Skip to content

Commit 570ff89

Browse files
committed
fix: cannot import "require" on the client
1 parent 75bcd30 commit 570ff89

File tree

1,617 files changed

+3516
-11568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,617 files changed

+3516
-11568
lines changed

icon-sprite/scripts/gen-wrappers.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,10 @@ for (const file of files) {
2828
const wrapperTsx = `\
2929
import { SPRITE_PATH } from "../config.js";
3030
import { warnMissingIconSize } from "../utils.js";
31-
import { createRequire } from "module";
31+
import { ${pascal} as DevIcon } from "lucide-react"
3232
import { renderUse,type IconProps,} from "../_shared.js";
3333
34-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
35-
if (process.env.NODE_ENV !== "production") {
36-
const require = createRequire(import.meta.url);
37-
const mod = require("lucide-react");
38-
DevIcon = mod.${pascal} as any;
39-
}
34+
4035
4136
export function ${pascal}({ size, width, height, ...props }: IconProps) {
4237
warnMissingIconSize("${pascal}", size, width, height);

icon-sprite/src/icons/AArrowDown.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { AArrowDown as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.AArrowDown as any;
11-
}
6+
127

138
export function AArrowDown({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("AArrowDown", size, width, height);

icon-sprite/src/icons/AArrowUp.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { AArrowUp as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.AArrowUp as any;
11-
}
6+
127

138
export function AArrowUp({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("AArrowUp", size, width, height);

icon-sprite/src/icons/ALargeSmall.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { ALargeSmall as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.ALargeSmall as any;
11-
}
6+
127

138
export function ALargeSmall({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("ALargeSmall", size, width, height);

icon-sprite/src/icons/Accessibility.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { Accessibility as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.Accessibility as any;
11-
}
6+
127

138
export function Accessibility({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("Accessibility", size, width, height);

icon-sprite/src/icons/Activity.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { Activity as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.Activity as any;
11-
}
6+
127

138
export function Activity({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("Activity", size, width, height);

icon-sprite/src/icons/AirVent.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { AirVent as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.AirVent as any;
11-
}
6+
127

138
export function AirVent({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("AirVent", size, width, height);

icon-sprite/src/icons/Airplay.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { Airplay as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.Airplay as any;
11-
}
6+
127

138
export function Airplay({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("Airplay", size, width, height);

icon-sprite/src/icons/AlarmClock.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { AlarmClock as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.AlarmClock as any;
11-
}
6+
127

138
export function AlarmClock({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("AlarmClock", size, width, height);

icon-sprite/src/icons/AlarmClockCheck.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { SPRITE_PATH } from "../config.js";
22
import { warnMissingIconSize } from "../utils.js";
3-
import { createRequire } from "module";
3+
import { AlarmClockCheck as DevIcon } from "lucide-react"
44
import { renderUse,type IconProps,} from "../_shared.js";
55

6-
let DevIcon: ((p: IconProps) => React.JSX.Element) | undefined;
7-
if (process.env.NODE_ENV !== "production") {
8-
const require = createRequire(import.meta.url);
9-
const mod = require("lucide-react");
10-
DevIcon = mod.AlarmClockCheck as any;
11-
}
6+
127

138
export function AlarmClockCheck({ size, width, height, ...props }: IconProps) {
149
warnMissingIconSize("AlarmClockCheck", size, width, height);

0 commit comments

Comments
 (0)