From 2282a05bea91a1c4f3dd4b966a7d5364eb2801ca Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 7 May 2021 21:01:14 +0300 Subject: [PATCH] Move setFetch to API internals in core, publish core and SVG framework as stable versions --- packages/browser-tests/package-lock.json | 48 +++++++++++------------- packages/browser-tests/package.json | 6 +-- packages/core/README.md | 2 +- packages/core/package-lock.json | 4 +- packages/core/package.json | 2 +- packages/core/src/api/functions.ts | 9 ++++- packages/iconify/README.md | 4 +- packages/iconify/package-lock.json | 39 ++++++++----------- packages/iconify/package.json | 5 ++- packages/iconify/src/iconify.ts | 3 +- 10 files changed, 58 insertions(+), 64 deletions(-) diff --git a/packages/browser-tests/package-lock.json b/packages/browser-tests/package-lock.json index dc641a9..b2ce969 100644 --- a/packages/browser-tests/package-lock.json +++ b/packages/browser-tests/package-lock.json @@ -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" diff --git a/packages/browser-tests/package.json b/packages/browser-tests/package.json index 7529905..d53891c 100644 --- a/packages/browser-tests/package.json +++ b/packages/browser-tests/package.json @@ -3,7 +3,7 @@ "private": true, "description": "Browser tests for @iconify/iconify package", "author": "Vjacheslav Trushkin (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", diff --git a/packages/core/README.md b/packages/core/README.md index 1494189..1878063 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -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Ü diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 8c4db9e..f07629e 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -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", diff --git a/packages/core/package.json b/packages/core/package.json index 8601ff1..d012111 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -2,7 +2,7 @@ "name": "@iconify/core", "description": "Reusable files used by multiple Iconify packages", "author": "Vjacheslav Trushkin (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/", diff --git a/packages/core/src/api/functions.ts b/packages/core/src/api/functions.ts index 3f26c54..80a6e1f 100644 --- a/packages/core/src/api/functions.ts +++ b/packages/core/src/api/functions.ts @@ -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 = { diff --git a/packages/iconify/README.md b/packages/iconify/README.md index 7ca514a..430f79e 100644 --- a/packages/iconify/README.md +++ b/packages/iconify/README.md @@ -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 `` section of the page or before ``): ```html - + ``` or ```html - + ``` 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: diff --git a/packages/iconify/package-lock.json b/packages/iconify/package-lock.json index 1914a4f..1e34015 100644 --- a/packages/iconify/package-lock.json +++ b/packages/iconify/package-lock.json @@ -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": { diff --git a/packages/iconify/package.json b/packages/iconify/package.json index b470bd2..ae6a781 100644 --- a/packages/iconify/package.json +++ b/packages/iconify/package.json @@ -2,7 +2,7 @@ "name": "@iconify/iconify", "description": "Unified SVG framework with over 70,000 icons to choose from", "author": "Vjacheslav Trushkin (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", diff --git a/packages/iconify/src/iconify.ts b/packages/iconify/src/iconify.ts index 9878455..685bf0d 100644 --- a/packages/iconify/src/iconify.ts +++ b/packages/iconify/src/iconify.ts @@ -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;