diff --git a/packages/field-plugin/helpers/vite/package.json b/packages/field-plugin/helpers/vite/package.json index ec4a76dc..66377d68 100644 --- a/packages/field-plugin/helpers/vite/package.json +++ b/packages/field-plugin/helpers/vite/package.json @@ -14,6 +14,6 @@ "vite-plugin-dts": "3.5.0" }, "dependencies": { - "chalk": "5.3.0" + "kleur": "4.1.5" } } diff --git a/packages/field-plugin/helpers/vite/src/utils/text.ts b/packages/field-plugin/helpers/vite/src/utils/text.ts index 446dffb6..7cc91d83 100644 --- a/packages/field-plugin/helpers/vite/src/utils/text.ts +++ b/packages/field-plugin/helpers/vite/src/utils/text.ts @@ -1,8 +1 @@ -import { Chalk } from 'chalk' - -const chalk = new Chalk({ level: 1 }) - -export const green = (text: string) => chalk.green(text) -export const gray = (text: string) => chalk.gray(text) -export const red = (text: string) => chalk.red(text) -export const bold = (text: string) => chalk.bold(text) +export { green, gray, red, bold } from 'kleur/colors' diff --git a/packages/field-plugin/helpers/vite/vite.config.ts b/packages/field-plugin/helpers/vite/vite.config.ts index 673b2485..92616143 100644 --- a/packages/field-plugin/helpers/vite/vite.config.ts +++ b/packages/field-plugin/helpers/vite/vite.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ fileName: 'index', }, rollupOptions: { - external: ['querystring', 'fs', 'path', 'chalk'], + external: ['querystring', 'fs', 'path'], }, }, }) diff --git a/scripts/dev-template.mjs b/scripts/dev-template.mjs index 2a2b6014..8a8d0b0f 100755 --- a/scripts/dev-template.mjs +++ b/scripts/dev-template.mjs @@ -18,6 +18,9 @@ import { $ } from 'zx' import fs from 'fs/promises' import path from 'path' +// eslint-disable-next-line functional/immutable-data +process.env.FORCE_COLOR = '1' + const template = process.argv[3] if (!template) { console.error('[ERROR] This script requires a template name as an argument.') @@ -35,21 +38,21 @@ file = file.replace( alias: [{ find: /^@storyblok\\/field-plugin$/, replacement: '${path.resolve( - __dirname, - '../packages/field-plugin/src/index.ts', - )}' + __dirname, + '../packages/field-plugin/src/index.ts', + )}' }, { find: /^@storyblok\\/field-plugin\\/vue3$/, replacement: '${path.resolve( - __dirname, - '../packages/field-plugin/helpers/vue3/src/index.ts', - )}' + __dirname, + '../packages/field-plugin/helpers/vue3/src/index.ts', + )}' }, { find: /^@storyblok\\/field-plugin\\/react$/, replacement: '${path.resolve( - __dirname, - '../packages/field-plugin/helpers/react/src/index.ts', - )}' + __dirname, + '../packages/field-plugin/helpers/react/src/index.ts', + )}' }] }, plugins:`, diff --git a/yarn.lock b/yarn.lock index ed9fe2e2..6bf5f746 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3925,13 +3925,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:5.3.0, chalk@npm:^5.0.0, chalk@npm:^5.2.0": - version: 5.3.0 - resolution: "chalk@npm:5.3.0" - checksum: 623922e077b7d1e9dedaea6f8b9e9352921f8ae3afe739132e0e00c275971bdd331268183b2628cf4ab1727c45ea1f28d7e24ac23ce1db1eb653c414ca8a5a80 - languageName: node - linkType: hard - "chalk@npm:^2.0.0": version: 2.4.2 resolution: "chalk@npm:2.4.2" @@ -3953,6 +3946,13 @@ __metadata: languageName: node linkType: hard +"chalk@npm:^5.0.0, chalk@npm:^5.2.0": + version: 5.3.0 + resolution: "chalk@npm:5.3.0" + checksum: 623922e077b7d1e9dedaea6f8b9e9352921f8ae3afe739132e0e00c275971bdd331268183b2628cf4ab1727c45ea1f28d7e24ac23ce1db1eb653c414ca8a5a80 + languageName: node + linkType: hard + "char-regex@npm:^1.0.2": version: 1.0.2 resolution: "char-regex@npm:1.0.2" @@ -6305,7 +6305,7 @@ __metadata: version: 0.0.0-use.local resolution: "helper-vite@workspace:packages/field-plugin/helpers/vite" dependencies: - chalk: 5.3.0 + kleur: 4.1.5 typescript: ^5.0.2 vite: ^4.4.5 vite-plugin-dts: 3.5.0