2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-06 07:20:40 +00:00

Move setFetch to API internals in core, publish core and SVG framework as stable versions

This commit is contained in:
Vjacheslav Trushkin 2021-05-07 21:01:14 +03:00
parent 957892eb76
commit 2282a05bea
10 changed files with 58 additions and 64 deletions

View File

@ -1,16 +1,16 @@
{
"name": "@iconify/iconify-browser-tests",
"version": "2.0.0-rc.5",
"version": "0.0.0-dev",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@iconify/iconify-browser-tests",
"version": "2.0.0-rc.5",
"version": "0.0.0-dev",
"license": "(Apache-2.0 OR GPL-2.0)",
"devDependencies": {
"@iconify/core": "^1.0.0-rc.5",
"@iconify/iconify": "^2.0.0-rc.6",
"@iconify/core": "^1.0.0",
"@iconify/iconify": "^2.0.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",
@ -29,9 +29,9 @@
"dev": true
},
"node_modules/@iconify/core": {
"version": "1.0.0-rc.5",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0-rc.5.tgz",
"integrity": "sha512-1VFvNlBqsX/pMRI3nd00UzEqAS7weayJ/CyCD18b8+kFa9PvoVcGAmob1bTTm++v+QKVqQs+8iQaBFl/DrrsvA==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0.tgz",
"integrity": "sha512-jzGZQMOqoPpKFZ4K4dQ6gNcDqALoJE02FMExm+kcN4vp2GJ5JKCccYxJLBWTmR23vVeZzpxlCtL3KSKjUfe2Kw==",
"dev": true,
"dependencies": {
"@cyberalien/redundancy": "^1.1.0",
@ -39,9 +39,9 @@
}
},
"node_modules/@iconify/iconify": {
"version": "2.0.0-rc.6",
"resolved": "https://registry.npmjs.org/@iconify/iconify/-/iconify-2.0.0-rc.6.tgz",
"integrity": "sha512-pXvLXqLPQsjpDY4qbbyh5cPEtakTfWfQCAo6SdYNhYQzat+/0fbeEhScryqaketNAG0bT4/+deKezkJZTvbuSg==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@iconify/iconify/-/iconify-2.0.0.tgz",
"integrity": "sha512-9D+LKG9lC8Wqc6m1u1HMzHO13VWoHy7pqJEJXQW94WPn22nRGCjvs62xfj3VTSIlxucn+XHQpNH9GsrugGuKDw==",
"dev": true,
"dependencies": {
"cross-fetch": "^3.0.6"
@ -403,7 +403,6 @@
"dependencies": {
"anymatch": "~3.1.1",
"braces": "~3.0.2",
"fsevents": "~2.1.2",
"glob-parent": "~5.1.0",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
@ -491,9 +490,9 @@
"dev": true
},
"node_modules/cross-fetch": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz",
"integrity": "sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz",
"integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==",
"dev": true,
"dependencies": {
"node-fetch": "2.6.1"
@ -1311,9 +1310,6 @@
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz",
"integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==",
"dev": true,
"dependencies": {
"fsevents": "~2.1.2"
},
"bin": {
"rollup": "dist/bin/rollup"
},
@ -1775,9 +1771,9 @@
"dev": true
},
"@iconify/core": {
"version": "1.0.0-rc.5",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0-rc.5.tgz",
"integrity": "sha512-1VFvNlBqsX/pMRI3nd00UzEqAS7weayJ/CyCD18b8+kFa9PvoVcGAmob1bTTm++v+QKVqQs+8iQaBFl/DrrsvA==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0.tgz",
"integrity": "sha512-jzGZQMOqoPpKFZ4K4dQ6gNcDqALoJE02FMExm+kcN4vp2GJ5JKCccYxJLBWTmR23vVeZzpxlCtL3KSKjUfe2Kw==",
"dev": true,
"requires": {
"@cyberalien/redundancy": "^1.1.0",
@ -1785,9 +1781,9 @@
}
},
"@iconify/iconify": {
"version": "2.0.0-rc.6",
"resolved": "https://registry.npmjs.org/@iconify/iconify/-/iconify-2.0.0-rc.6.tgz",
"integrity": "sha512-pXvLXqLPQsjpDY4qbbyh5cPEtakTfWfQCAo6SdYNhYQzat+/0fbeEhScryqaketNAG0bT4/+deKezkJZTvbuSg==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@iconify/iconify/-/iconify-2.0.0.tgz",
"integrity": "sha512-9D+LKG9lC8Wqc6m1u1HMzHO13VWoHy7pqJEJXQW94WPn22nRGCjvs62xfj3VTSIlxucn+XHQpNH9GsrugGuKDw==",
"dev": true,
"requires": {
"cross-fetch": "^3.0.6"
@ -2150,9 +2146,9 @@
"dev": true
},
"cross-fetch": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz",
"integrity": "sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==",
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz",
"integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==",
"dev": true,
"requires": {
"node-fetch": "2.6.1"

View File

@ -3,7 +3,7 @@
"private": true,
"description": "Browser tests for @iconify/iconify package",
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "2.0.0-rc.6",
"version": "2.0.0",
"license": "(Apache-2.0 OR GPL-2.0)",
"bugs": "https://github.com/iconify/iconify/issues",
"homepage": "https://iconify.design/",
@ -18,8 +18,8 @@
"build:dist": "rollup -c rollup.config.js"
},
"devDependencies": {
"@iconify/core": "^1.0.0-rc.5",
"@iconify/iconify": "^2.0.0-rc.6",
"@iconify/core": "^1.0.0",
"@iconify/iconify": "^2.0.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",

View File

@ -27,4 +27,4 @@ Iconify is dual-licensed under Apache 2.0 and GPL 2.0 license. You may select, a
This license does not apply to icons. Icons are released under different licenses, see each icon set for details.
Icons available by default are all licensed under some kind of open-source or free license.
© 2020 Iconify OÜ
© 2020, 2021 Iconify OÜ

View File

@ -1,12 +1,12 @@
{
"name": "@iconify/core",
"version": "1.0.0-rc.5",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@iconify/core",
"version": "1.0.0-rc.5",
"version": "1.0.0",
"license": "(Apache-2.0 OR GPL-2.0)",
"dependencies": {
"@cyberalien/redundancy": "^1.1.0",

View File

@ -2,7 +2,7 @@
"name": "@iconify/core",
"description": "Reusable files used by multiple Iconify packages",
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "1.0.0-rc.5",
"version": "1.0.0",
"license": "(Apache-2.0 OR GPL-2.0)",
"bugs": "https://github.com/iconify/iconify/issues",
"homepage": "https://iconify.design/",

View File

@ -14,7 +14,6 @@ import { setAPIModule } from './modules';
* Iconify API functions
*/
export interface IconifyAPIFunctions {
/* Scan DOM */
/**
* Load icons
*/
@ -23,7 +22,6 @@ export interface IconifyAPIFunctions {
callback?: IconifyIconLoaderCallback
) => IconifyIconLoaderAbort;
/* API stuff */
/**
* Add API provider
*/
@ -60,6 +58,13 @@ export interface IconifyAPIInternalFunctions {
* Set API module
*/
setAPIModule: (provider: string, item: IconifyAPIModule) => void;
/**
* Optional setFetch (should be imported from ./modules/fetch if fetch is used)
*
* Used to set custom fetch function, such as one provided by cross-fetch, making fetch usable on server
*/
setFetch?: (item: typeof fetch) => void;
}
export const APIInternalFunctions: IconifyAPIInternalFunctions = {

View File

@ -21,13 +21,13 @@ Iconify SVG framework is designed to be as easy to use as possible.
Add this line to your page to load Iconify SVG framework (you can add it to `<head>` section of the page or before `</body>`):
```html
<script src="https://code.iconify.design/2/2.0.0-rc.6/iconify.min.js"></script>
<script src="https://code.iconify.design/2/2.0.0/iconify.min.js"></script>
```
or
```html
<script src="https://cdn.jsdelivr.net/npm/@iconify/iconify@2.0.0-rc.6/dist/iconify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@iconify/iconify@2.0.0/dist/iconify.min.js"></script>
```
or, if you are building a project with something like WebPack or Rollup, you can include the script by installing `@iconify/iconify` as a dependency and importing it in your project:

View File

@ -1,18 +1,19 @@
{
"name": "@iconify/iconify",
"version": "2.0.0-rc.6",
"version": "2.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@iconify/iconify",
"version": "2.0.0-rc.6",
"version": "2.0.0",
"license": "(Apache-2.0 OR GPL-2.0)",
"dependencies": {
"cross-fetch": "^3.0.6"
},
"devDependencies": {
"@iconify/core": "^1.0.0-rc.5",
"@iconify/core": "^1.0.0",
"@iconify/types": "^1.0.6",
"@microsoft/api-extractor": "^7.12.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^16.0.0",
@ -61,9 +62,9 @@
"dev": true
},
"node_modules/@iconify/core": {
"version": "1.0.0-rc.5",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0-rc.5.tgz",
"integrity": "sha512-1VFvNlBqsX/pMRI3nd00UzEqAS7weayJ/CyCD18b8+kFa9PvoVcGAmob1bTTm++v+QKVqQs+8iQaBFl/DrrsvA==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0.tgz",
"integrity": "sha512-jzGZQMOqoPpKFZ4K4dQ6gNcDqALoJE02FMExm+kcN4vp2GJ5JKCccYxJLBWTmR23vVeZzpxlCtL3KSKjUfe2Kw==",
"dev": true,
"dependencies": {
"@cyberalien/redundancy": "^1.1.0",
@ -542,7 +543,6 @@
"dependencies": {
"anymatch": "~3.1.1",
"braces": "~3.0.2",
"fsevents": "~2.1.2",
"glob-parent": "~5.1.0",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
@ -1078,9 +1078,6 @@
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"dependencies": {
"graceful-fs": "^4.1.6"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
@ -1101,9 +1098,9 @@
}
},
"node_modules/lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"node_modules/lodash.get": {
@ -1565,9 +1562,6 @@
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.35.1.tgz",
"integrity": "sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA==",
"dev": true,
"dependencies": {
"fsevents": "~2.1.2"
},
"bin": {
"rollup": "dist/bin/rollup"
},
@ -2140,7 +2134,6 @@
"integrity": "sha512-DUOKC/IhbkdLKKiV89gw9DUauTV8U/8yJl1sjf6MtDmzevLKOF2duNJ495S3MFVjqZarr+qNGCPbkg4mu4PpLw==",
"dev": true,
"dependencies": {
"commander": "^2.7.1",
"lodash.get": "^4.0.0",
"lodash.isequal": "^4.0.0",
"validator": "^8.0.0"
@ -2187,9 +2180,9 @@
"dev": true
},
"@iconify/core": {
"version": "1.0.0-rc.5",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0-rc.5.tgz",
"integrity": "sha512-1VFvNlBqsX/pMRI3nd00UzEqAS7weayJ/CyCD18b8+kFa9PvoVcGAmob1bTTm++v+QKVqQs+8iQaBFl/DrrsvA==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@iconify/core/-/core-1.0.0.tgz",
"integrity": "sha512-jzGZQMOqoPpKFZ4K4dQ6gNcDqALoJE02FMExm+kcN4vp2GJ5JKCccYxJLBWTmR23vVeZzpxlCtL3KSKjUfe2Kw==",
"dev": true,
"requires": {
"@cyberalien/redundancy": "^1.1.0",
@ -3005,9 +2998,9 @@
}
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"lodash.get": {

View File

@ -2,7 +2,7 @@
"name": "@iconify/iconify",
"description": "Unified SVG framework with over 70,000 icons to choose from",
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "2.0.0-rc.6",
"version": "2.0.0",
"license": "(Apache-2.0 OR GPL-2.0)",
"main": "./dist/iconify.min.js",
"types": "./dist/iconify.d.ts",
@ -29,7 +29,8 @@
"cross-fetch": "^3.0.6"
},
"devDependencies": {
"@iconify/core": "^1.0.0-rc.5",
"@iconify/core": "^1.0.0",
"@iconify/types": "^1.0.6",
"@microsoft/api-extractor": "^7.12.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^16.0.0",

View File

@ -114,7 +114,6 @@ export interface IconifyGlobal
IconifyBrowserCacheFunctions,
IconifyAPIFunctions {
_api: IconifyAPIInternalFunctions;
setNodeFetch: (nodeFetch: typeof fetch) => void;
}
/**
@ -173,7 +172,7 @@ setAPIModule('', getAPIModule(getAPIConfig));
/**
* Function to enable node-fetch for getting icons on server side
*/
Iconify.setNodeFetch = (nodeFetch: typeof fetch) => {
Iconify._api.setFetch = (nodeFetch: typeof fetch) => {
setFetch(nodeFetch);
if (getAPIModule !== getFetchAPIModule) {
getAPIModule = getFetchAPIModule;