From 036f8574bbfc7b74bb9220ee6c8e8a02103e9dc4 Mon Sep 17 00:00:00 2001 From: rektdeckard Date: Thu, 28 Mar 2024 22:10:18 -0600 Subject: [PATCH] chore(deps): remove axios dev-dependency --- package.json | 1 - pnpm-lock.yaml | 64 ---------------------------------------------- scripts/catalog.ts | 15 ++++++----- 3 files changed, 8 insertions(+), 72 deletions(-) diff --git a/package.json b/package.json index 9b44887f..f9e4732b 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ }, "devDependencies": { "@types/node": "^18", - "axios": "^1.2.2", "chalk": "^4", "commander": "^9.5.0", "prettier": "^2.8.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8e03ebf2..00e0d6c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ devDependencies: '@types/node': specifier: ^18 version: 18.19.6 - axios: - specifier: ^1.2.2 - version: 1.6.5 chalk: specifier: ^4 version: 4.1.2 @@ -363,20 +360,6 @@ packages: color-convert: 2.0.1 dev: true - /asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - dev: true - - /axios@1.6.5: - resolution: {integrity: sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==} - dependencies: - follow-redirects: 1.15.4 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - dev: true - /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -396,13 +379,6 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true - /combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - dependencies: - delayed-stream: 1.0.0 - dev: true - /commander@9.5.0: resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} engines: {node: ^12.20.0 || >=14} @@ -416,11 +392,6 @@ packages: rename-keys: 1.2.0 dev: true - /delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - dev: true - /esbuild@0.19.11: resolution: {integrity: sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==} engines: {node: '>=12'} @@ -456,25 +427,6 @@ packages: resolution: {integrity: sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==} dev: true - /follow-redirects@1.15.4: - resolution: {integrity: sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dev: true - - /form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - dev: true - /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -505,18 +457,6 @@ packages: is-buffer: 1.1.6 dev: true - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: true - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: true - /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -542,10 +482,6 @@ packages: hasBin: true dev: true - /proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - dev: true - /rename-keys@1.2.0: resolution: {integrity: sha512-U7XpAktpbSgHTRSNRrjKSrjYkZKuhUukfoBlXWXUExCAqhzh1TU3BDRAfJmarcl5voKS+pbKU9MvyLWKZ4UEEg==} engines: {node: '>= 0.8.0'} diff --git a/scripts/catalog.ts b/scripts/catalog.ts index 83b2d1c4..74a6eba2 100644 --- a/scripts/catalog.ts +++ b/scripts/catalog.ts @@ -2,7 +2,6 @@ "use strict"; import fs from "node:fs/promises"; -import axios from "axios"; import chalk from "chalk"; import { Command } from "commander"; @@ -36,11 +35,13 @@ const ICON_API_URL = "https://api.phosphoricons.com"; try { await assertValidAssets(); - const res = await axios.get(`${ICON_API_URL}?${params}`); - if (res.data) { - assertValidApiResponse(res.data); + const res = (await ( + await fetch(`${ICON_API_URL}?${params}`) + ).json()) as IconAPIResponse; + if (res) { + assertValidApiResponse(res); - res.data.icons.sort((a, b) => (a.name < b.name ? -1 : 1)); + res.icons.sort((a, b) => (a.name < b.name ? -1 : 1)); let fileString = `\ import { IconEntry, IconCategory, FigmaCategory } from "./types"; @@ -50,7 +51,7 @@ export type PhosphorIcon = typeof icons[number] export const icons = [ `; - res.data.icons.forEach((icon) => { + res.icons.forEach((icon) => { let categories = "["; icon.search_categories?.forEach((c) => { categories += `IconCategory.${c.toUpperCase()},`; @@ -92,7 +93,7 @@ export const icons = [ try { await fs.writeFile(CATALOG_PATH, fileString); console.info( - `${chalk.green(" DONE ")} ${res.data.icons.length} icons ingested` + `${chalk.green(" DONE ")} ${res.icons.length} icons ingested` ); } catch (e) { console.error(`${chalk.inverse.red(" FAIL ")} Could not write file`);