2
0
mirror of https://github.com/iconify/iconify.git synced 2024-09-29 13:39:08 +00:00

chore: update dependencies

This commit is contained in:
Vjacheslav Trushkin 2022-12-26 00:32:45 +02:00
parent b5e9ecd2b4
commit 2fb77d5bf6
30 changed files with 3577 additions and 3911 deletions

View File

@ -18,7 +18,7 @@
"scripts": { "scripts": {
"build": "node build", "build": "node build",
"build:lib": "tsc -b", "build:lib": "tsc -b",
"build:rollup": "rollup -c rollup.config.js", "build:rollup": "rollup -c rollup.config.mjs",
"build:api": "api-extractor run --local --verbose --config api-extractor.json", "build:api": "api-extractor run --local --verbose --config api-extractor.json",
"build:cleanup": "node cleanup" "build:cleanup": "node cleanup"
}, },

View File

@ -17,7 +17,7 @@
"prebuild": "pnpm run clean", "prebuild": "pnpm run clean",
"build": "node build", "build": "node build",
"build:lib": "tsc -b", "build:lib": "tsc -b",
"build:dist": "rollup -c rollup.config.js", "build:dist": "rollup -c rollup.config.mjs",
"prebuild:api": "api-extractor run --local --verbose --config api-extractor.offline.json", "prebuild:api": "api-extractor run --local --verbose --config api-extractor.offline.json",
"build:api": "api-extractor run --local --verbose --config api-extractor.iconify.json", "build:api": "api-extractor run --local --verbose --config api-extractor.iconify.json",
"build:cleanup": "node cleanup", "build:cleanup": "node cleanup",
@ -48,20 +48,20 @@
"@iconify/types": "workspace:^" "@iconify/types": "workspace:^"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-env": "^7.19.0", "@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6", "@babel/preset-react": "^7.18.6",
"@iconify/core": "workspace:^", "@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^", "@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.30.0", "@microsoft/api-extractor": "^7.33.7",
"@rollup/plugin-node-resolve": "^14.0.0", "@rollup/plugin-node-resolve": "^15.0.1",
"@types/react": "^17.0.49", "@types/react": "^18.0.26",
"babel-jest": "^29.0.2", "babel-jest": "^29.3.1",
"jest": "^29.0.2", "jest": "^29.3.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-test-renderer": "^18.2.0", "react-test-renderer": "^18.2.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.79.0", "rollup": "^3.8.1",
"typescript": "^4.8.2" "typescript": "^4.9.4"
}, },
"peerDependencies": { "peerDependencies": {
"react": ">=16" "react": ">=16"

View File

@ -26,7 +26,6 @@ names.forEach((name) => {
{ {
file: `dist/${name}.js`, file: `dist/${name}.js`,
format: 'cjs', format: 'cjs',
interop: false,
}, },
], ],
external: ['react'], external: ['react'],

View File

@ -431,7 +431,7 @@ export const Icon = React.forwardRef<IconRef, IconProps>(function Icon(
...props, ...props,
_ref: ref, _ref: ref,
_inline: false, _inline: false,
}; } as InternalIconProps;
return React.createElement(IconComponent, newProps); return React.createElement(IconComponent, newProps);
}); });
@ -442,7 +442,11 @@ export const Icon = React.forwardRef<IconRef, IconProps>(function Icon(
*/ */
export const InlineIcon = React.forwardRef<IconRef, IconProps>( export const InlineIcon = React.forwardRef<IconRef, IconProps>(
function InlineIcon(props, ref) { function InlineIcon(props, ref) {
const newProps = { ...props, _ref: ref, _inline: true }; const newProps = {
...props,
_ref: ref,
_inline: true,
} as InternalIconProps;
return React.createElement(IconComponent, newProps); return React.createElement(IconComponent, newProps);
} }
); );

View File

@ -21,7 +21,7 @@
"prebuild": "pnpm run cleanup", "prebuild": "pnpm run cleanup",
"build": "node build", "build": "node build",
"build:tsc": "tsc -b", "build:tsc": "tsc -b",
"build:bundles": "rollup -c rollup.config.js", "build:bundles": "rollup -c rollup.config.mjs",
"build:api": "node build --only-api", "build:api": "node build --only-api",
"test": "vitest" "test": "vitest"
}, },
@ -31,21 +31,21 @@
"devDependencies": { "devDependencies": {
"@iconify/core": "workspace:^", "@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^", "@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.30.0", "@microsoft/api-extractor": "^7.33.7",
"@rollup/plugin-node-resolve": "^14.0.0", "@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-typescript": "^8.5.0", "@rollup/plugin-typescript": "^10.0.1",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.49", "@sveltejs/vite-plugin-svelte": "^2.0.2",
"@testing-library/jest-dom": "^5.16.5", "@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "^3.2.1", "@testing-library/svelte": "^3.2.2",
"@tsconfig/svelte": "^3.0.0", "@tsconfig/svelte": "^3.0.0",
"@types/jest": "^29.0.0", "@types/jest": "^29.2.4",
"@types/node": "^18.7.15", "@types/node": "^18.11.17",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.79.0", "rollup": "^3.8.1",
"rollup-plugin-svelte": "^7.1.0", "rollup-plugin-svelte": "^7.1.0",
"svelte": "3.50.0", "svelte": "3.55.0",
"svelte-preprocess": "^4.10.7", "svelte-preprocess": "^5.0.0",
"vitest": "^0.23.1" "vitest": "^0.26.2"
}, },
"peerDependencies": { "peerDependencies": {
"svelte": ">=3" "svelte": ">=3"

View File

@ -6,7 +6,8 @@ import { mockAPIData } from '@iconify/core/lib/api/modules/mock';
import { provider, nextPrefix } from './load'; import { provider, nextPrefix } from './load';
describe('Testing fake API', () => { describe('Testing fake API', () => {
test('using fake API to load icon', (done) => { test('using fake API to load icon', () => {
return new Promise((fulfill, reject) => {
const prefix = nextPrefix(); const prefix = nextPrefix();
const name = 'mock-test'; const name = 'mock-test';
const iconName = `@${provider}:${prefix}:${name}`; const iconName = `@${provider}:${prefix}:${name}`;
@ -38,7 +39,8 @@ describe('Testing fake API', () => {
]); ]);
expect(missing).toMatchObject([]); expect(missing).toMatchObject([]);
expect(pending).toMatchObject([]); expect(pending).toMatchObject([]);
done(); fulfill(true);
});
}); });
}); });
}); });

View File

@ -3,7 +3,7 @@
*/ */
import { tick } from 'svelte'; import { tick } from 'svelte';
import { render } from '@testing-library/svelte'; import { render } from '@testing-library/svelte';
import Icon, { loadIcons, iconExists } from '../../'; import Icon, { loadIcons, iconExists } from '../../dist';
import { mockAPIData } from '@iconify/core/lib/api/modules/mock'; import { mockAPIData } from '@iconify/core/lib/api/modules/mock';
import { provider, nextPrefix } from './load'; import { provider, nextPrefix } from './load';
@ -14,7 +14,8 @@ const iconData = {
}; };
describe('Rendering icon', () => { describe('Rendering icon', () => {
test('rendering icon after loading it', (done) => { test('rendering icon after loading it', () => {
return new Promise((fulfill, reject) => {
const prefix = nextPrefix(); const prefix = nextPrefix();
const name = 'render-test'; const name = 'render-test';
const iconName = `@${provider}:${prefix}:${name}`; const iconName = `@${provider}:${prefix}:${name}`;
@ -72,11 +73,13 @@ describe('Rendering icon', () => {
// Make sure onLoad has been called // Make sure onLoad has been called
expect(onLoadCalled).toBe(true); expect(onLoadCalled).toBe(true);
done(); fulfill(true);
});
}); });
}); });
test('rendering icon before loading it', (done) => { test('rendering icon before loading it', () => {
return new Promise((fulfill, reject) => {
const prefix = nextPrefix(); const prefix = nextPrefix();
const name = 'mock-test'; const name = 'mock-test';
const iconName = `@${provider}:${prefix}:${name}`; const iconName = `@${provider}:${prefix}:${name}`;
@ -124,7 +127,8 @@ describe('Rendering icon', () => {
// Check component on next tick // Check component on next tick
tick() tick()
.then(() => { .then(() => {
const node = component.container.querySelector('svg')!; const node =
component.container.querySelector('svg')!;
const html = (node.parentNode as HTMLDivElement) const html = (node.parentNode as HTMLDivElement)
.innerHTML; .innerHTML;
@ -135,9 +139,9 @@ describe('Rendering icon', () => {
'" width="1em" height="1em" viewBox="0 0 24 24"><path d="M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z" fill="currentColor"></path></svg>' '" width="1em" height="1em" viewBox="0 0 24 24"><path d="M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z" fill="currentColor"></path></svg>'
); );
done(); fulfill(true);
}) })
.catch(done); .catch(reject);
}, },
}); });
@ -148,8 +152,10 @@ describe('Rendering icon', () => {
// onLoad should not have been called yet // onLoad should not have been called yet
expect(onLoadCalled).toBe(false); expect(onLoadCalled).toBe(false);
}); });
});
test('missing icon', (done) => { test('missing icon', () => {
return new Promise((fulfill, reject) => {
const prefix = nextPrefix(); const prefix = nextPrefix();
const name = 'missing-icon'; const name = 'missing-icon';
const iconName = `@${provider}:${prefix}:${name}`; const iconName = `@${provider}:${prefix}:${name}`;
@ -190,9 +196,9 @@ describe('Rendering icon', () => {
expect(html.replace(/<!--(.*?)-->/gm, '')).toBe( expect(html.replace(/<!--(.*?)-->/gm, '')).toBe(
'<div></div>' '<div></div>'
); );
done(); fulfill(true);
}) })
.catch(done); .catch(reject);
}, },
}); });
@ -212,3 +218,4 @@ describe('Rendering icon', () => {
expect(html.replace(/<!--(.*?)-->/gm, '')).toBe('<div></div>'); expect(html.replace(/<!--(.*?)-->/gm, '')).toBe('<div></div>');
}); });
}); });
});

View File

@ -1,371 +0,0 @@
/**
* @jest-environment jsdom
*/
import { tick } from 'svelte';
import { render } from '@testing-library/svelte';
import { iconExists } from '../../';
import { mockAPIData } from '@iconify/core/lib/api/modules/mock';
import { provider, nextPrefix } from './load';
import ChangeIcon from './fixtures/ChangeIcon.svelte';
import ChangeProps from './fixtures/ChangeProps.svelte';
const iconData = {
body: '<path d="M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z" fill="currentColor"/>',
width: 24,
height: 24,
};
const iconData2 = {
body: '<path d="M19.031 4.281l-11 11l-.687.719l.687.719l11 11l1.438-1.438L10.187 16L20.47 5.719z" fill="currentColor"/>',
width: 32,
height: 32,
};
type TriggerSwap = () => void;
describe('Rendering icon', () => {
test('changing icon property', (done) => {
const prefix = nextPrefix();
const name = 'changing-prop';
const name2 = 'changing-prop2';
const iconName = `@${provider}:${prefix}:${name}`;
const iconName2 = `@${provider}:${prefix}:${name2}`;
const className = `iconify iconify--${prefix} iconify--${provider}`;
let onLoadCalled = ''; // Name of icon from last onLoad call
let triggerSwap: TriggerSwap | undefined;
mockAPIData({
type: 'icons',
provider,
prefix,
response: {
prefix,
icons: {
[name]: iconData,
},
},
delay: (next) => {
// Fixture callback should have been called
expect(typeof triggerSwap).toBe('function');
// Icon should not have loaded yet
expect(iconExists(iconName)).toBe(false);
// onLoad should not have been called yet
expect(onLoadCalled).toBe('');
// Send icon data
next();
// Test it again
expect(iconExists(iconName)).toBe(true);
},
});
mockAPIData({
type: 'icons',
provider,
prefix,
response: {
prefix,
icons: {
[name2]: iconData2,
},
},
delay: (next) => {
// Icon should not have loaded yet
expect(iconExists(iconName2)).toBe(false);
// onLoad should have been called only once for previous icon
expect(onLoadCalled).toBe(iconName);
// Send icon data
next();
// Test it again
expect(iconExists(iconName2)).toBe(true);
},
});
// Check if icon has been loaded
expect(iconExists(iconName)).toBe(false);
// Render component
const component = render(ChangeIcon, {
icon1: iconName,
icon2: iconName2,
expose: (swap: TriggerSwap) => {
triggerSwap = swap;
},
onLoad: (name: string) => {
// onLoad should be called only once per icon
switch (name) {
// First onLoad call
case iconName:
expect(onLoadCalled).toBe('');
// Wait 1 tick, then test rendered icon
tick()
.then(() => {
const node =
component.container.querySelector('svg')!;
const html = (node.parentNode as HTMLDivElement)
.innerHTML;
// Check HTML
expect(html).toBe(
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" viewBox="0 0 24 24" class="' +
className +
'"><path d="M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z" fill="currentColor"></path></svg>'
);
// Change property
triggerSwap!();
})
.catch(done);
break;
// Second onLoad call
case iconName2:
expect(onLoadCalled).toBe(iconName);
// Wait 1 tick, then test rendered icon
tick()
.then(() => {
const node =
component.container.querySelector('svg')!;
const html = (node.parentNode as HTMLDivElement)
.innerHTML;
// Check HTML
expect(html).toBe(
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" viewBox="0 0 32 32" class="' +
className +
'"><path d="M19.031 4.281l-11 11l-.687.719l.687.719l11 11l1.438-1.438L10.187 16L20.47 5.719z" fill="currentColor"></path></svg>'
);
done();
})
.catch(done);
break;
default:
throw new Error(`Unexpected onLoad('${name}') call`);
}
onLoadCalled = name;
},
});
// Should render empty icon
const html = component.container.innerHTML;
expect(html.replace(/<!--(.*?)-->/gm, '')).toBe('<div></div>');
// onLoad should not have been called yet
expect(onLoadCalled).toBe('');
});
test('changing icon property while loading', (done) => {
const prefix = nextPrefix();
const name = 'changing-prop';
const name2 = 'changing-prop2';
const iconName = `@${provider}:${prefix}:${name}`;
const iconName2 = `@${provider}:${prefix}:${name2}`;
const className = `iconify iconify--${prefix} iconify--${provider}`;
let onLoadCalled = ''; // Name of icon from last onLoad call
let isSync = true;
let triggerSwap: TriggerSwap | undefined;
mockAPIData({
type: 'icons',
provider,
prefix,
response: {
prefix,
icons: {
[name]: iconData,
},
},
delay: (next) => {
// Should have been called asynchronously
expect(isSync).toBe(false);
// Icon should not have loaded yet
expect(iconExists(iconName)).toBe(false);
// Send icon data
next();
},
});
mockAPIData({
type: 'icons',
provider,
prefix,
response: {
prefix,
icons: {
[name2]: iconData2,
},
},
delay: (next) => {
// Should have been called asynchronously
expect(isSync).toBe(false);
// Icon should not have loaded yet
expect(iconExists(iconName2)).toBe(false);
// Send icon data
next();
// Test it again
expect(iconExists(iconName2)).toBe(true);
},
});
// Check if icon has been loaded
expect(iconExists(iconName)).toBe(false);
// Render component
const component = render(ChangeIcon, {
icon1: iconName,
icon2: iconName2,
expose: (swap: TriggerSwap) => {
triggerSwap = swap;
},
onLoad: (name: string) => {
// onLoad should be called only for second icon
expect(name).toBe(iconName2);
onLoadCalled = name;
// Wait 1 tick, then test rendered icon
tick()
.then(() => {
const node = component.container.querySelector('svg')!;
const html = (node.parentNode as HTMLDivElement)
.innerHTML;
// Check HTML
expect(html).toBe(
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" viewBox="0 0 32 32" class="' +
className +
'"><path d="M19.031 4.281l-11 11l-.687.719l.687.719l11 11l1.438-1.438L10.187 16L20.47 5.719z" fill="currentColor"></path></svg>'
);
done();
})
.catch(done);
},
});
// Should render empty icon
const html = component.container.innerHTML;
expect(html.replace(/<!--(.*?)-->/gm, '')).toBe('<div></div>');
// Fixture callback should have been called
expect(typeof triggerSwap).toBe('function');
// Change property
triggerSwap!();
// Async
isSync = false;
// onLoad should not have been called yet
expect(onLoadCalled).toBe('');
});
test('changing multiple properties', (done) => {
const prefix = nextPrefix();
const name = 'multiple-props';
const iconName = `@${provider}:${prefix}:${name}`;
const className = `iconify iconify--${prefix} iconify--${provider}`;
let onLoadCalled = false;
let triggerSwap: TriggerSwap | undefined;
mockAPIData({
type: 'icons',
provider,
prefix,
response: {
prefix,
icons: {
[name]: iconData,
},
},
delay: (next) => {
// Fixture callback should have been called
expect(typeof triggerSwap).toBe('function');
// Icon should not have loaded yet
expect(iconExists(iconName)).toBe(false);
// Send icon data
next();
// Test it again
expect(iconExists(iconName)).toBe(true);
},
});
// Check if icon has been loaded
expect(iconExists(iconName)).toBe(false);
// Render component
const component = render(ChangeProps, {
icon: iconName,
expose: (swap: TriggerSwap) => {
triggerSwap = swap;
},
onLoad: (name: string) => {
expect(name).toBe(iconName);
// Should be called only once
expect(onLoadCalled).toBe(false);
onLoadCalled = true;
// Check if state was changed on next tick
tick()
.then(() => {
const node = component.container.querySelector('svg')!;
const html = (node.parentNode as HTMLDivElement)
.innerHTML;
// Check HTML
expect(html).toBe(
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" viewBox="0 0 24 24" class="' +
className +
'"><path d="M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z" fill="currentColor"></path></svg>'
);
// Add horizontal flip and style
triggerSwap!();
// Wait for component to re-render
return tick();
})
.then(() => {
// Check HTML again
const node = component.container.querySelector('svg')!;
const html = (node.parentNode as HTMLDivElement)
.innerHTML;
expect(html).toBe(
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" viewBox="0 0 24 24" class="' +
className +
'"><g transform="translate(24 0) scale(-1 1)"><path d="M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z" fill="currentColor"></path></g></svg>'
);
done();
})
.catch(done);
},
});
// Should render empty icon
const html = component.container.innerHTML;
expect(html.replace(/<!--(.*?)-->/gm, '')).toBe('<div></div>');
// onLoad should not have been called yet
expect(onLoadCalled).toBe(false);
});
});

View File

@ -1,21 +0,0 @@
<script>
import Icon from '../../../';
export let icon1;
export let icon2;
export let expose;
export let onLoad;
let icon = icon1;
$: {
expose(swap);
}
function swap() {
icon = icon2;
}
</script>
<Icon icon={icon} on:load={event => {
onLoad(event.detail.icon)
}} />

View File

@ -1,25 +0,0 @@
<script>
import Icon from '../../../';
export let icon;
export let expose;
export let onLoad;
const props = {
icon
};
$: {
expose(swap);
}
function swap() {
props.hFlip = true;
props.style = {
color: 'red'
}
}
</script>
<Icon {...props} on:load={event => {
onLoad?.(event.detail.icon)
}} />

View File

@ -22,7 +22,7 @@
"prebuild": "pnpm run lint && pnpm run clean", "prebuild": "pnpm run lint && pnpm run clean",
"build": "node build", "build": "node build",
"build:lib": "tsc -b", "build:lib": "tsc -b",
"build:dist": "rollup -c rollup.config.js", "build:dist": "rollup -c rollup.config.mjs",
"build:api": "api-extractor run --local --verbose", "build:api": "api-extractor run --local --verbose",
"build:api2": "api-extractor run --local --verbose --config api-extractor.without-api.json", "build:api2": "api-extractor run --local --verbose --config api-extractor.without-api.json",
"test:jest": "jest --runInBand", "test:jest": "jest --runInBand",
@ -74,22 +74,22 @@
"devDependencies": { "devDependencies": {
"@iconify/core": "workspace:^", "@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^", "@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.30.0", "@microsoft/api-extractor": "^7.33.7",
"@rollup/plugin-buble": "^0.21.3", "@rollup/plugin-buble": "^1.0.1",
"@rollup/plugin-node-resolve": "^14.0.0", "@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^4.0.0", "@rollup/plugin-replace": "^5.0.2",
"@types/jest": "^29.0.0", "@types/jest": "^29.2.4",
"@types/jsdom": "^20.0.0", "@types/jsdom": "^20.0.1",
"@types/node": "^18.7.15", "@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.36.2", "@typescript-eslint/eslint-plugin": "^5.47.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^8.23.0", "eslint": "^8.30.0",
"jest": "^29.0.2", "jest": "^29.3.1",
"jsdom": "^20.0.0", "jsdom": "^20.0.3",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.79.0", "rollup": "^3.8.1",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"ts-jest": "^29.0.0-next.1", "ts-jest": "^29.0.3",
"typescript": "^4.8.2" "typescript": "^4.9.4"
} }
} }

View File

@ -15,7 +15,7 @@
"scripts": { "scripts": {
"build": "node build", "build": "node build",
"build:lib": "tsc -b", "build:lib": "tsc -b",
"build:dist": "rollup -c rollup.config.js", "build:dist": "rollup -c rollup.config.mjs",
"prebuild:api": "api-extractor run --local --verbose --config api-extractor.offline.json", "prebuild:api": "api-extractor run --local --verbose --config api-extractor.offline.json",
"build:api": "api-extractor run --local --verbose --config api-extractor.iconify.json", "build:api": "api-extractor run --local --verbose --config api-extractor.iconify.json",
"test": "vitest" "test": "vitest"
@ -45,19 +45,19 @@
"@iconify/types": "workspace:^" "@iconify/types": "workspace:^"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-env": "^7.19.0", "@babel/preset-env": "^7.20.2",
"@iconify/core": "workspace:^", "@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^", "@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.30.0", "@microsoft/api-extractor": "^7.33.7",
"@rollup/plugin-node-resolve": "^14.0.0", "@rollup/plugin-node-resolve": "^15.0.1",
"@types/jest": "^29.0.0", "@types/jest": "^29.2.4",
"@vitejs/plugin-vue": "^3.1.0", "@vitejs/plugin-vue": "^4.0.0",
"@vue/test-utils": "^2.0.2", "@vue/test-utils": "^2.2.6",
"jsdom": "^20.0.0", "jsdom": "^20.0.3",
"rollup": "^2.79.0", "rollup": "^3.8.1",
"typescript": "^4.8.2", "typescript": "^4.9.4",
"vitest": "^0.23.1", "vitest": "^0.26.2",
"vue": "^3.2.38" "vue": "^3.2.45"
}, },
"peerDependencies": { "peerDependencies": {
"vue": ">=3" "vue": ">=3"

View File

@ -108,7 +108,7 @@ export const render = (
const mode: IconifyRenderMode = props.mode || 'svg'; const mode: IconifyRenderMode = props.mode || 'svg';
// Copy style // Copy style
const style: VStyle = {}; const style = {} as VStyle;
const propsStyle = props.style; const propsStyle = props.style;
const customStyle = const customStyle =
typeof propsStyle === 'object' && !(propsStyle instanceof Array) typeof propsStyle === 'object' && !(propsStyle instanceof Array)

View File

@ -15,7 +15,7 @@
"scripts": { "scripts": {
"build": "node build", "build": "node build",
"build:lib": "tsc -b", "build:lib": "tsc -b",
"build:dist": "rollup -c rollup.config.js", "build:dist": "rollup -c rollup.config.mjs",
"prebuild:api": "api-extractor run --local --verbose --config api-extractor.offline.json", "prebuild:api": "api-extractor run --local --verbose --config api-extractor.offline.json",
"build:api": "api-extractor run --local --verbose --config api-extractor.iconify.json", "build:api": "api-extractor run --local --verbose --config api-extractor.iconify.json",
"test": "jest --runInBand" "test": "jest --runInBand"
@ -45,20 +45,21 @@
"@iconify/types": "workspace:^" "@iconify/types": "workspace:^"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-env": "^7.19.0", "@babel/preset-env": "^7.20.2",
"@iconify/core": "workspace:^", "@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^", "@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.30.0", "@microsoft/api-extractor": "^7.33.7",
"@rollup/plugin-node-resolve": "^13.3.0", "@rollup/plugin-node-resolve": "^13.3.0",
"@types/jest": "^29.0.0", "@types/jest": "^29.2.4",
"@vue/test-utils": "^1.3.0", "@vue/test-utils": "^1.3.0",
"@vue/vue2-jest": "^29.0.0", "@vue/vue2-jest": "^29.0.0",
"babel-jest": "^29.0.2", "babel-jest": "^29.3.1",
"jest": "^29.0.2", "jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1", "jest-environment-jsdom": "^29.3.1",
"rollup": "^2.79.0", "rollup": "^2.79.1",
"typescript": "^4.8.2", "typescript": "^4.9.4",
"vue": "^2.7.10" "vue": "^2.7.14",
"vue-template-compiler": "^2.7.14"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "2.x" "vue": "2.x"

View File

@ -58,7 +58,7 @@ export const render = (
const componentProps = { ...svgDefaults }; const componentProps = { ...svgDefaults };
// Style in Vue 2 components is always passed to rendered component, so no point in parsing it // Style in Vue 2 components is always passed to rendered component, so no point in parsing it
const style: Record<string, unknown> = {}; const style = {} as Record<string, string>;
// Get element properties // Get element properties
for (let key in props) { for (let key in props) {

View File

@ -24,7 +24,7 @@
"build": "node build", "build": "node build",
"build:api": "api-extractor run --local --verbose", "build:api": "api-extractor run --local --verbose",
"build:lib": "tsc -b", "build:lib": "tsc -b",
"build:dist": "rollup -c rollup.config.js", "build:dist": "rollup -c rollup.config.mjs",
"test:jest": "jest --runInBand", "test:jest": "jest --runInBand",
"test:mjs": "cross-env NODE_OPTIONS=--experimental-vm-modules node tests/import-test.mjs", "test:mjs": "cross-env NODE_OPTIONS=--experimental-vm-modules node tests/import-test.mjs",
"test": "pnpm run test:jest && pnpm run test:mjs" "test": "pnpm run test:jest && pnpm run test:mjs"
@ -56,21 +56,21 @@
"devDependencies": { "devDependencies": {
"@iconify/core": "workspace:^", "@iconify/core": "workspace:^",
"@iconify/utils": "workspace:^", "@iconify/utils": "workspace:^",
"@microsoft/api-extractor": "^7.30.0", "@microsoft/api-extractor": "^7.33.7",
"@rollup/plugin-node-resolve": "^14.0.0", "@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^4.0.0", "@rollup/plugin-replace": "^5.0.2",
"@types/jest": "^29.0.0", "@types/jest": "^29.2.4",
"@types/jsdom": "^20.0.0", "@types/jsdom": "^20.0.1",
"@types/node": "^18.7.15", "@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.36.2", "@typescript-eslint/eslint-plugin": "^5.47.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^8.23.0", "eslint": "^8.30.0",
"jest": "^29.0.2", "jest": "^29.3.1",
"jsdom": "^20.0.0", "jsdom": "^20.0.3",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.79.0", "rollup": "^3.8.1",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"ts-jest": "^29.0.0-next.1", "ts-jest": "^29.0.3",
"typescript": "^4.8.2" "typescript": "^4.9.4"
} }
} }

View File

@ -38,16 +38,16 @@
"iconify-icon": "workspace:^" "iconify-icon": "workspace:^"
}, },
"devDependencies": { "devDependencies": {
"@types/react": "^17.0.49", "@types/react": "^18.0.26",
"@types/react-test-renderer": "^18.0.0", "@types/react-test-renderer": "^18.0.0",
"@vitejs/plugin-react": "^2.1.0", "@vitejs/plugin-react": "^3.0.0",
"jest": "^29.0.2", "jest": "^29.3.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-test-renderer": "^18.2.0", "react-test-renderer": "^18.2.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"tsup": "^6.2.3", "tsup": "^6.5.0",
"typescript": "^4.8.2", "typescript": "^4.9.4",
"vitest": "^0.23.1" "vitest": "^0.26.2"
}, },
"peerDependencies": { "peerDependencies": {
"react": ">=16" "react": ">=16"

View File

@ -25,8 +25,8 @@
}, },
"devDependencies": { "devDependencies": {
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"solid-js": "^1.5.4", "solid-js": "^1.6.6",
"typescript": "^4.8.2" "typescript": "^4.9.4"
}, },
"peerDependencies": { "peerDependencies": {
"solid-js": ">=1" "solid-js": ">=1"

View File

@ -4,14 +4,13 @@
"description": "The most versatile icon framework", "description": "The most versatile icon framework",
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)", "author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"license": "MIT", "license": "MIT",
"main": "./monorepo/index.js",
"bugs": "https://github.com/iconify/iconify/issues", "bugs": "https://github.com/iconify/iconify/issues",
"homepage": "https://iconify.design/", "homepage": "https://iconify.design/",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/iconify/iconify.git" "url": "https://github.com/iconify/iconify.git"
}, },
"packageManager": "pnpm@7.3.0", "packageManager": "pnpm@7.19.0",
"scripts": { "scripts": {
"clean": "rm -rf */*/node_modules", "clean": "rm -rf */*/node_modules",
"build": "pnpm recursive --filter \"./(packages|iconify-icon|components)/**\" run build", "build": "pnpm recursive --filter \"./(packages|iconify-icon|components)/**\" run build",

View File

@ -28,13 +28,13 @@
"directory": "packages/api-redundancy" "directory": "packages/api-redundancy"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.0.0", "@types/jest": "^29.2.4",
"@types/node": "^18.7.15", "@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.36.2", "@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.36.2", "@typescript-eslint/parser": "^5.47.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^8.23.0", "eslint": "^8.30.0",
"tsup": "^6.2.3", "tsup": "^6.5.0",
"vitest": "^0.23.1" "vitest": "^0.26.2"
} }
} }

View File

@ -133,16 +133,16 @@
"@iconify/utils": "workspace:^" "@iconify/utils": "workspace:^"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.0.0", "@types/jest": "^29.2.4",
"@types/node": "^18.7.15", "@types/node": "^18.11.17",
"@typescript-eslint/eslint-plugin": "^5.36.2", "@typescript-eslint/eslint-plugin": "^5.47.0",
"cross-fetch": "^3.1.5", "cross-fetch": "^3.1.5",
"eslint": "^8.23.0", "eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"typescript": "^4.8.2", "typescript": "^4.9.4",
"unbuild": "^0.8.10", "unbuild": "^1.0.2",
"vitest": "^0.23.1" "vitest": "^0.26.2"
} }
} }

View File

@ -18,6 +18,6 @@
"directory": "packages/types" "directory": "packages/types"
}, },
"devDependencies": { "devDependencies": {
"typescript": "^4.8.2" "typescript": "^4.9.4"
} }
} }

View File

@ -374,7 +374,7 @@
], ],
"dependencies": { "dependencies": {
"@antfu/install-pkg": "^0.1.1", "@antfu/install-pkg": "^0.1.1",
"@antfu/utils": "^0.5.2", "@antfu/utils": "^0.7.2",
"@iconify/types": "workspace:^", "@iconify/types": "workspace:^",
"debug": "^4.3.4", "debug": "^4.3.4",
"kolorist": "^1.6.0", "kolorist": "^1.6.0",
@ -384,13 +384,13 @@
"@iconify-json/flat-color-icons": "^1.1.3", "@iconify-json/flat-color-icons": "^1.1.3",
"@types/debug": "^4.1.7", "@types/debug": "^4.1.7",
"@types/jest": "^29.2.4", "@types/jest": "^29.2.4",
"@typescript-eslint/eslint-plugin": "^5.46.0", "@typescript-eslint/eslint-plugin": "^5.47.0",
"eslint": "^8.29.0", "eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"typescript": "^4.9.4", "typescript": "^4.9.4",
"unbuild": "^0.8.11", "unbuild": "^1.0.2",
"vitest": "^0.23.4" "vitest": "^0.26.2"
} }
} }

File diff suppressed because it is too large Load Diff