mirror of
https://github.com/iconify/iconify.git
synced 2024-12-13 14:13:06 +00:00
chore: add kolorist
This commit is contained in:
parent
6af802b9f7
commit
0838ccc038
13
packages/utils/package-lock.json
generated
13
packages/utils/package-lock.json
generated
@ -12,7 +12,8 @@
|
|||||||
"@antfu/install-pkg": "^0.1.0",
|
"@antfu/install-pkg": "^0.1.0",
|
||||||
"@antfu/utils": "^0.3.0",
|
"@antfu/utils": "^0.3.0",
|
||||||
"@iconify/types": "^1.0.12",
|
"@iconify/types": "^1.0.12",
|
||||||
"debug": "^4.3.3"
|
"debug": "^4.3.3",
|
||||||
|
"kolorist": "^1.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify/library-builder": "^1.0.4",
|
"@iconify/library-builder": "^1.0.4",
|
||||||
@ -3944,6 +3945,11 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/kolorist": {
|
||||||
|
"version": "1.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.5.0.tgz",
|
||||||
|
"integrity": "sha512-pPobydIHK884YBtkS/tWSZXpSAEpcMbilyun3KL37ot935qL2HNKm/tI45i/Rd+MxdIWEhm7/LmUQzWZYK+Qhg=="
|
||||||
|
},
|
||||||
"node_modules/leven": {
|
"node_modules/leven": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
|
||||||
@ -8385,6 +8391,11 @@
|
|||||||
"integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
|
"integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"kolorist": {
|
||||||
|
"version": "1.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.5.0.tgz",
|
||||||
|
"integrity": "sha512-pPobydIHK884YBtkS/tWSZXpSAEpcMbilyun3KL37ot935qL2HNKm/tI45i/Rd+MxdIWEhm7/LmUQzWZYK+Qhg=="
|
||||||
|
},
|
||||||
"leven": {
|
"leven": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
|
||||||
|
@ -153,8 +153,9 @@
|
|||||||
"@antfu/install-pkg": "^0.1.0",
|
"@antfu/install-pkg": "^0.1.0",
|
||||||
"@antfu/utils": "^0.3.0",
|
"@antfu/utils": "^0.3.0",
|
||||||
"@iconify/types": "^1.0.12",
|
"@iconify/types": "^1.0.12",
|
||||||
"debug": "^4.3.3"
|
"debug": "^4.3.3",
|
||||||
},
|
"kolorist": "^1.5.0"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify/library-builder": "^1.0.4",
|
"@iconify/library-builder": "^1.0.4",
|
||||||
"@types/debug": "^4.1.7",
|
"@types/debug": "^4.1.7",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { installPackage } from '@antfu/install-pkg';
|
import { installPackage } from '@antfu/install-pkg';
|
||||||
import { sleep } from '@antfu/utils';
|
import { sleep } from '@antfu/utils';
|
||||||
|
import { cyan, yellow } from 'kolorist'
|
||||||
|
|
||||||
export function camelize(str: string): string {
|
export function camelize(str: string): string {
|
||||||
return str.replace(/-([a-z0-9])/g, g => g[1].toUpperCase());
|
return str.replace(/-([a-z0-9])/g, g => g[1].toUpperCase());
|
||||||
@ -23,7 +24,7 @@ const warnned = new Set<string>();
|
|||||||
export function warnOnce(msg: string): void {
|
export function warnOnce(msg: string): void {
|
||||||
if (!warnned.has(msg)) {
|
if (!warnned.has(msg)) {
|
||||||
warnned.add(msg);
|
warnned.add(msg);
|
||||||
console.warn(`[@iconify-loader] ${msg}`);
|
console.warn(yellow(`[@iconify-loader] ${msg}`))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ export async function tryInstallPkg(name: string): Promise<void | undefined> {
|
|||||||
|
|
||||||
if (!tasks[name]) {
|
if (!tasks[name]) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(`Installing ${name}...`);
|
console.log(cyan(`Installing ${name}...`))
|
||||||
tasks[name] = pending = installPackage(name, { dev: true, preferOffline: true })
|
tasks[name] = pending = installPackage(name, { dev: true, preferOffline: true })
|
||||||
.then(() => sleep(300))
|
.then(() => sleep(300))
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
|
Loading…
Reference in New Issue
Block a user