dependencies update

This commit is contained in:
codecalm 2024-01-05 16:13:04 +01:00
parent 6d818d9f28
commit fb302d266e
12 changed files with 1848 additions and 3271 deletions

View File

@ -2,7 +2,7 @@ import fs from 'fs-extra'
import path from 'path'
import { PACKAGES_DIR, readSvgs, readAliases, toPascalCase } from './helpers.mjs'
import { stringify } from 'svgson'
import prettier from 'prettier'
import prettier from "@prettier/sync"
import bundleSize from '@atomico/rollup-plugin-sizes'
import { visualizer } from 'rollup-plugin-visualizer'
@ -78,7 +78,6 @@ export const buildIcons = ({
parser: 'babel'
}) : component
let filePath = path.resolve(DIST_DIR, 'src/icons', `${pascalName ? svgFile.namePascal : svgFile.name}.${extension}`)
fs.writeFileSync(filePath, output, 'utf-8')
@ -107,7 +106,7 @@ export const buildIcons = ({
})
})
fs.writeFileSync(path.resolve(DIST_DIR, `./src/aliases.ts`), aliasesStr, 'utf-8')
fs.writeFileSync(path.resolve(DIST_DIR, `./src/aliases.ts`), aliasesStr || `export {};`, 'utf-8')
} else {
fs.writeFileSync(path.resolve(DIST_DIR, `./src/aliases.ts`), `export {};`, 'utf-8')
}

View File

@ -1,11 +1,11 @@
import glob from 'glob'
import { glob } from 'glob'
import fs from 'fs'
import path from 'path'
import { ICONS_SRC_DIR } from './helpers.mjs'
let unicodes = []
glob(path.join(ICONS_SRC_DIR, '*.svg'), {}, function(er, files) {
glob(path.join(ICONS_SRC_DIR, '*.svg'), {}, function (er, files) {
for (const i in files) {
const file = files[i]

View File

@ -9,6 +9,7 @@ import { parseSync } from 'svgson'
import { optimize } from 'svgo'
import cp from 'child_process'
import minimist from 'minimist'
import { exit } from 'process'
export const getCurrentDirPath = () => {
return path.dirname(fileURLToPath(import.meta.url));
@ -48,9 +49,10 @@ export const readSvgDirectory = (directory) => {
export const readSvgs = () => {
const svgFiles = readSvgDirectory(ICONS_DIR)
const limit = process.env['ICONS_LIMIT'] || Infinity;
return svgFiles
// .slice(0, 100)
.slice(0, limit)
.map(svgFile => {
const name = basename(svgFile, '.svg'),
namePascal = toPascalCase(`icon ${name}`),

View File

@ -1,4 +1,4 @@
import glob from 'glob'
import { glob } from 'glob'
import fs from 'fs'
import { resolve, join, basename } from 'path'
import { ICONS_SRC_DIR } from './helpers.mjs'
@ -40,4 +40,4 @@ extensions.forEach(function (extension) {
}
}
})
})
})

View File

@ -1,14 +1,14 @@
import fs from 'fs'
import glob from 'glob'
import { glob } from 'glob'
import { resolve, basename } from 'path'
import { HOME_DIR, optimizeSVG } from './helpers.mjs'
const files = glob.sync(resolve(HOME_DIR, './new/*.svg'))
files.forEach(function(file, i) {
files.forEach(function (file, i) {
let fileData = fs.readFileSync(file).toString(),
filename = basename(file, '.svg')
filename = basename(file, '.svg')
console.log(filename)
@ -23,35 +23,35 @@ files.forEach(function(file, i) {
}
fileData = fileData.replace(/---/g, '')
.replace(/fill="none"/g, '')
.replace(/fill="#D8D8D8"/gi, '')
.replace(/fill-rule="evenodd"/g, '')
.replace(/stroke-linecap="round"/g, '')
.replace(/stroke-linejoin="round"/g, '')
.replace(/viewBox="0 0 24 24"/g, '')
.replace(/stroke="#000000"/g, '')
.replace(/stroke="#000"/g, '')
.replace(/stroke-width="2"/g, '')
.replace(/width="24"/g, '')
.replace(/width="24px"/g, '')
.replace(/height="24"/g, '')
.replace(/height="24px"/g, '')
.replace(/clip-rule="evenodd"/g, '')
.replace(/xmlns="http:\/\/www.w3.org\/2000\/svg"/g, '')
.replace(/<path d="M0 0h24v24H0z"\/>"/g, '')
.replace(/<path stroke="red" stroke-width=".1" d="[^"]+"\s?\/>/g, '')
.replace(/<path[^>]*fill-opacity=".1"[^>]*\/>/g, '')
.replace(/<path[^>]*stroke="red"[^>]*\/>/gs, '')
.replace(/<circle[^>]*stroke="red"[^>]*\/>/gs, '')
.replace(/<path[^>]*fill="red"[^>]*\/>/gs, '')
.replace(/<g[^>]*stroke="red"[^>]*>.*?<\/g>/gs, '')
.replace(/<svg\s+>/gs, '<svg>')
.replace(/fill="none"/g, '')
.replace(/fill="#D8D8D8"/gi, '')
.replace(/fill-rule="evenodd"/g, '')
.replace(/stroke-linecap="round"/g, '')
.replace(/stroke-linejoin="round"/g, '')
.replace(/viewBox="0 0 24 24"/g, '')
.replace(/stroke="#000000"/g, '')
.replace(/stroke="#000"/g, '')
.replace(/stroke-width="2"/g, '')
.replace(/width="24"/g, '')
.replace(/width="24px"/g, '')
.replace(/height="24"/g, '')
.replace(/height="24px"/g, '')
.replace(/clip-rule="evenodd"/g, '')
.replace(/xmlns="http:\/\/www.w3.org\/2000\/svg"/g, '')
.replace(/<path d="M0 0h24v24H0z"\/>"/g, '')
.replace(/<path stroke="red" stroke-width=".1" d="[^"]+"\s?\/>/g, '')
.replace(/<path[^>]*fill-opacity=".1"[^>]*\/>/g, '')
.replace(/<path[^>]*stroke="red"[^>]*\/>/gs, '')
.replace(/<circle[^>]*stroke="red"[^>]*\/>/gs, '')
.replace(/<path[^>]*fill="red"[^>]*\/>/gs, '')
.replace(/<g[^>]*stroke="red"[^>]*>.*?<\/g>/gs, '')
.replace(/<svg\s+>/gs, '<svg>')
fileData = optimizeSVG(fileData)
if (filename.match(/\-filled$/)) {
fileData = fileData
.replace(/\/>/g, ' stroke-width="0" fill="currentColor" />')
.replace(/\/>/g, ' stroke-width="0" fill="currentColor" />')
}
fileData = fileData.replace(/<svg>/g, '---\n---\n<svg>')
@ -65,10 +65,10 @@ files.forEach(function(file, i) {
}
} else if (filename.match(/\-filled$/)) {
fileData = fileData
.replace(/---\n---/g, '---\ncategory: Filled\n---')
.replace(/---\n---/g, '---\ncategory: Filled\n---')
} else if (filename.match(/brand\-/)) {
fileData = fileData
.replace(/---\n---/g, '---\ncategory: Brand\n---')
.replace(/---\n---/g, '---\ncategory: Brand\n---')
}
fs.writeFileSync(`./src/_icons/${filename}.svg`, fileData)

View File

@ -1,4 +1,4 @@
import glob from 'glob'
import { glob } from 'glob'
import { readFileSync, writeFileSync } from 'fs'
import { join, basename } from 'path'
import { optimizePath, ICONS_SRC_DIR } from './helpers.mjs'

View File

@ -1,7 +1,7 @@
import glob from 'glob'
import { glob } from 'glob'
import { generateIconsPreview } from './helpers.mjs'
glob('icons/*.svg', {}, async function(er, files) {
glob('icons/*.svg', {}, async function (er, files) {
await generateIconsPreview(files, '.github/icons.svg')
await generateIconsPreview(files, '.github/icons-dark.svg', {
color: '#ffffff',

View File

@ -1,4 +1,4 @@
import glob from 'glob'
import { glob } from 'glob'
import { generateIconsPreview } from './helpers.mjs'
glob('icons/*.svg', {}, async function (er, files) {

View File

@ -1,10 +1,10 @@
import glob from 'glob'
import { globSync, glob } from 'glob'
import fs from 'fs'
import path from 'path'
import { ICONS_SRC_DIR } from './helpers.mjs'
const getMaxUnicode = () => {
const files = glob.sync(path.join(ICONS_SRC_DIR, '*.svg'))
const files = globSync(path.join(ICONS_SRC_DIR, '*.svg'))
let maxUnicode = 0
files.forEach(function(file) {

View File

@ -1,5 +1,5 @@
import { readFileSync, writeFileSync } from 'fs'
import glob from 'glob'
import { glob } from 'glob'
import { resolve } from 'path'
import { HOME_DIR } from './helpers.mjs'

View File

@ -49,50 +49,51 @@
},
"devDependencies": {
"@atomico/rollup-plugin-sizes": "^1.1.4",
"@babel/cli": "^7.20.7",
"@babel/core": "7.11.6",
"@babel/parser": "7.11.5",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "7.11.5",
"@babel/preset-react": "7.10.4",
"@release-it-plugins/workspaces": "^3.2.0",
"@rollup/plugin-babel": "5.2.1",
"@rollup/plugin-commonjs": "15.1.0",
"@rollup/plugin-node-resolve": "9.0.0",
"@svgr/babel-plugin-replace-jsx-attribute-value": "5.0.1",
"@svgr/core": "5.4.0",
"@testing-library/jest-dom": "^6.1.6",
"@vue/babel-plugin-jsx": "^1.1.1",
"@babel/cli": "^7.23.4",
"@babel/core": "7.23.7",
"@babel/parser": "7.23.6",
"@babel/plugin-transform-runtime": "^7.23.7",
"@babel/preset-env": "7.23.7",
"@babel/preset-react": "7.23.3",
"@prettier/sync": "^0.3.0",
"@release-it-plugins/workspaces": "^4.0.0",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "25.0.7",
"@rollup/plugin-node-resolve": "15.2.3",
"@svgr/babel-plugin-replace-jsx-attribute-value": "8.0.0",
"@svgr/core": "8.1.0",
"@testing-library/jest-dom": "^6.2.0",
"@vue/babel-plugin-jsx": "^1.1.5",
"adm-zip": "^0.5.10",
"cheerio": "^1.0.0-rc.12",
"csv-parser": "^3.0.0",
"esbuild": "^0.17.5",
"fs-extra": "^10.1.0",
"glob": "7.1.6",
"esbuild": "^0.19.11",
"fs-extra": "^11.2.0",
"glob": "10.3.10",
"html-minifier": "^4.0.0",
"jest-serializer-html": "^7.1.0",
"jsdom": "^23.0.1",
"jsdom": "^23.1.0",
"lodash.template": "4.5.0",
"minimist": "1.2.6",
"node-sass": "8.0.0",
"minimist": "1.2.8",
"node-sass": "9.0.0",
"parse-svg-path": "^0.1.2",
"prettier": "^2.8.1",
"release-it": "15.9.3",
"rollup": "^4.9.2",
"prettier": "^3.1.1",
"release-it": "17.0.1",
"rollup": "^4.9.3",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^4.10.2",
"rollup-plugin-filesize": "9.1.2",
"rollup-plugin-license": "^3.0.1",
"rollup-plugin-esbuild": "^6.1.0",
"rollup-plugin-filesize": "10.0.0",
"rollup-plugin-license": "^3.2.0",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-rename": "^1.0.1",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-visualizer": "^5.8.3",
"rollup-plugin-visualizer": "^5.12.0",
"svg-outline-stroke": "1.3.1",
"svgo": "^2.8.0",
"svgo": "^3.2.0",
"svgpath": "^2.6.0",
"svgson": "^5.2.1",
"typescript": "^5.1.6",
"vitest": "^1.1.2"
"svgson": "^5.3.1",
"typescript": "^5.3.3",
"vitest": "^1.1.3"
},
"release-it": {
"plugins": {

File diff suppressed because it is too large Load Diff