Skip to content

Commit

Permalink
chore(lib): use modern extensions and named file exports
Browse files Browse the repository at this point in the history
  • Loading branch information
rektdeckard committed Sep 14, 2023
1 parent 40fbc91 commit cb2ed01
Show file tree
Hide file tree
Showing 1,255 changed files with 2,521 additions and 5,024 deletions.
2 changes: 1 addition & 1 deletion core
Submodule core updated 1 files
+1 −0 README.md
6 changes: 3 additions & 3 deletions example/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState, useCallback } from "react";

import * as Icons from "../src";
import { IconContext } from "../src";
import type { IconWeight, Icon } from "../src";
import * as Icons from "../dist";
import { IconContext } from "../dist";
import type { IconWeight, Icon } from "../dist";
import { icons } from "../core/src/icons";
import "./index.css";

Expand Down
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@phosphor-icons/react",
"version": "2.0.10",
"type": "module",
"version": "2.1.0",
"description": "A clean and friendly icon family for React",
"author": {
"name": "Tobias Fried",
Expand All @@ -13,24 +12,28 @@
"homepage": "https://phosphoricons.com",
"sideEffects": false,
"private": false,
"module": "./dist/index.es.js",
"main": "./dist/index.umd.js",
"type": "module",
"module": "./dist/index.mjs",
"main": "./dist/index.cjs",
"exports": {
".": {
"import": "./dist/index.es.js",
"require": "./dist/index.umd.js",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
},
"./dist/icons/*": {
"import": "./dist/icons/*.es.js",
"import": "./dist/icons/*.mjs",
"require": "./dist/index.cjs",
"types": "./dist/icons/*.d.ts"
},
"./dist/lib/*": {
"import": "./dist/lib/*.es.js",
"import": "./dist/lib/*.mjs",
"require": "./dist/index.cjs",
"types": "./dist/lib/*.d.ts"
},
"./*": {
"import": "./dist/icons/*.es.js",
"import": "./dist/icons/*.mjs",
"require": "./dist/index.cjs",
"types": "./dist/icons/*.d.ts"
}
},
Expand Down
8 changes: 3 additions & 5 deletions scripts/assemble.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,11 @@ ${Object.entries(icon)
`;

componentString += `
const ${name}: Icon = forwardRef((props, ref) => (
export const ${name}: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));
${name}.displayName = "${name}";
export default ${name};
`;
try {
fs.writeFileSync(
Expand Down Expand Up @@ -183,8 +181,8 @@ export { IconContext, IconBase } from "./lib";
for (let key in icons) {
const name = pascalize(key);
indexString += `\
export { default as ${name}${
!!ALIASES[key] ? `, default as ${pascalize(ALIASES[key])}` : ""
export { ${name}${
!!ALIASES[key] ? `, ${name} as ${pascalize(ALIASES[key])}` : ""
} } from "./icons/${name}";
`;
}
Expand Down
4 changes: 1 addition & 3 deletions src/icons/AddressBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AddressBook: Icon = forwardRef((props, ref) => (
export const AddressBook: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AddressBook.displayName = "AddressBook";

export default AddressBook;
4 changes: 1 addition & 3 deletions src/icons/AirTrafficControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AirTrafficControl: Icon = forwardRef((props, ref) => (
export const AirTrafficControl: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirTrafficControl.displayName = "AirTrafficControl";

export default AirTrafficControl;
4 changes: 1 addition & 3 deletions src/icons/Airplane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const Airplane: Icon = forwardRef((props, ref) => (
export const Airplane: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Airplane.displayName = "Airplane";

export default Airplane;
4 changes: 1 addition & 3 deletions src/icons/AirplaneInFlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AirplaneInFlight: Icon = forwardRef((props, ref) => (
export const AirplaneInFlight: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneInFlight.displayName = "AirplaneInFlight";

export default AirplaneInFlight;
4 changes: 1 addition & 3 deletions src/icons/AirplaneLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AirplaneLanding: Icon = forwardRef((props, ref) => (
export const AirplaneLanding: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneLanding.displayName = "AirplaneLanding";

export default AirplaneLanding;
4 changes: 1 addition & 3 deletions src/icons/AirplaneTakeoff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AirplaneTakeoff: Icon = forwardRef((props, ref) => (
export const AirplaneTakeoff: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneTakeoff.displayName = "AirplaneTakeoff";

export default AirplaneTakeoff;
4 changes: 1 addition & 3 deletions src/icons/AirplaneTilt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AirplaneTilt: Icon = forwardRef((props, ref) => (
export const AirplaneTilt: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneTilt.displayName = "AirplaneTilt";

export default AirplaneTilt;
4 changes: 1 addition & 3 deletions src/icons/Airplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const Airplay: Icon = forwardRef((props, ref) => (
export const Airplay: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Airplay.displayName = "Airplay";

export default Airplay;
4 changes: 1 addition & 3 deletions src/icons/Alarm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const Alarm: Icon = forwardRef((props, ref) => (
export const Alarm: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Alarm.displayName = "Alarm";

export default Alarm;
4 changes: 1 addition & 3 deletions src/icons/Alien.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const Alien: Icon = forwardRef((props, ref) => (
export const Alien: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Alien.displayName = "Alien";

export default Alien;
4 changes: 1 addition & 3 deletions src/icons/AlignBottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignBottom: Icon = forwardRef((props, ref) => (
export const AlignBottom: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignBottom.displayName = "AlignBottom";

export default AlignBottom;
4 changes: 1 addition & 3 deletions src/icons/AlignBottomSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignBottomSimple: Icon = forwardRef((props, ref) => (
export const AlignBottomSimple: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignBottomSimple.displayName = "AlignBottomSimple";

export default AlignBottomSimple;
4 changes: 1 addition & 3 deletions src/icons/AlignCenterHorizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignCenterHorizontal: Icon = forwardRef((props, ref) => (
export const AlignCenterHorizontal: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterHorizontal.displayName = "AlignCenterHorizontal";

export default AlignCenterHorizontal;
4 changes: 1 addition & 3 deletions src/icons/AlignCenterHorizontalSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignCenterHorizontalSimple: Icon = forwardRef((props, ref) => (
export const AlignCenterHorizontalSimple: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterHorizontalSimple.displayName = "AlignCenterHorizontalSimple";

export default AlignCenterHorizontalSimple;
4 changes: 1 addition & 3 deletions src/icons/AlignCenterVertical.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignCenterVertical: Icon = forwardRef((props, ref) => (
export const AlignCenterVertical: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterVertical.displayName = "AlignCenterVertical";

export default AlignCenterVertical;
4 changes: 1 addition & 3 deletions src/icons/AlignCenterVerticalSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignCenterVerticalSimple: Icon = forwardRef((props, ref) => (
export const AlignCenterVerticalSimple: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterVerticalSimple.displayName = "AlignCenterVerticalSimple";

export default AlignCenterVerticalSimple;
4 changes: 1 addition & 3 deletions src/icons/AlignLeft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignLeft: Icon = forwardRef((props, ref) => (
export const AlignLeft: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignLeft.displayName = "AlignLeft";

export default AlignLeft;
4 changes: 1 addition & 3 deletions src/icons/AlignLeftSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignLeftSimple: Icon = forwardRef((props, ref) => (
export const AlignLeftSimple: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignLeftSimple.displayName = "AlignLeftSimple";

export default AlignLeftSimple;
4 changes: 1 addition & 3 deletions src/icons/AlignRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignRight: Icon = forwardRef((props, ref) => (
export const AlignRight: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignRight.displayName = "AlignRight";

export default AlignRight;
4 changes: 1 addition & 3 deletions src/icons/AlignRightSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignRightSimple: Icon = forwardRef((props, ref) => (
export const AlignRightSimple: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignRightSimple.displayName = "AlignRightSimple";

export default AlignRightSimple;
4 changes: 1 addition & 3 deletions src/icons/AlignTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignTop: Icon = forwardRef((props, ref) => (
export const AlignTop: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignTop.displayName = "AlignTop";

export default AlignTop;
4 changes: 1 addition & 3 deletions src/icons/AlignTopSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AlignTopSimple: Icon = forwardRef((props, ref) => (
export const AlignTopSimple: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignTopSimple.displayName = "AlignTopSimple";

export default AlignTopSimple;
4 changes: 1 addition & 3 deletions src/icons/AmazonLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AmazonLogo: Icon = forwardRef((props, ref) => (
export const AmazonLogo: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AmazonLogo.displayName = "AmazonLogo";

export default AmazonLogo;
4 changes: 1 addition & 3 deletions src/icons/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const Anchor: Icon = forwardRef((props, ref) => (
export const Anchor: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Anchor.displayName = "Anchor";

export default Anchor;
4 changes: 1 addition & 3 deletions src/icons/AnchorSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AnchorSimple: Icon = forwardRef((props, ref) => (
export const AnchorSimple: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AnchorSimple.displayName = "AnchorSimple";

export default AnchorSimple;
4 changes: 1 addition & 3 deletions src/icons/AndroidLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ const weights = new Map<IconWeight, ReactElement>([
],
]);

const AndroidLogo: Icon = forwardRef((props, ref) => (
export const AndroidLogo: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AndroidLogo.displayName = "AndroidLogo";

export default AndroidLogo;
Loading

0 comments on commit cb2ed01

Please sign in to comment.