File tree Expand file tree Collapse file tree 3 files changed +24
-19
lines changed Expand file tree Collapse file tree 3 files changed +24
-19
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ import minimist from 'minimist'
7
7
import prompts from 'prompts'
8
8
import { red , green , bold } from 'kolorist'
9
9
10
+ import * as banners from './utils/banners'
11
+
10
12
import renderTemplate from './utils/renderTemplate'
11
13
import { postOrderDirectoryTraverse , preOrderDirectoryTraverse } from './utils/directoryTraverse'
12
14
import generateReadme from './utils/generateReadme'
13
15
import getCommand from './utils/getCommand'
14
16
import renderEslint from './utils/renderEslint'
15
- import banner from './utils/banner'
16
17
17
18
function isValidPackageName ( projectName ) {
18
19
return / ^ (?: @ [ a - z 0 - 9 - * ~ ] [ a -z 0 -9 -* ._ ~ ] * \/ ) ? [ a - z 0 - 9 - ~ ] [ a - z 0 - 9 - ._ ~ ] * $ / . test ( projectName )
@@ -56,7 +57,13 @@ function emptyDir(dir) {
56
57
}
57
58
58
59
async function init ( ) {
59
- console . log ( `\n${ banner } \n` )
60
+ console . log ( )
61
+ console . log (
62
+ process . stdout . isTTY && process . stdout . getColorDepth ( ) > 8
63
+ ? banners . gradientBanner
64
+ : banners . defaultBanner
65
+ )
66
+ console . log ( )
60
67
61
68
const cwd = process . cwd ( )
62
69
// possible options:
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ const defaultBanner = 'Vue.js - The Progressive JavaScript Framework'
2
+
3
+ // generated by the following code:
4
+ //
5
+ // require('gradient-string')([
6
+ // { color: '#42d392', pos: 0 },
7
+ // { color: '#42d392', pos: 0.1 },
8
+ // { color: '#647eff', pos: 1 }
9
+ // ])('Vue.js - The Progressive JavaScript Framework'))
10
+ //
11
+ // Use the output directly here to keep the bundle small.
12
+ const gradientBanner =
13
+ '\x1B[38;2;66;211;146mV\x1B[39m\x1B[38;2;66;211;146mu\x1B[39m\x1B[38;2;66;211;146me\x1B[39m\x1B[38;2;66;211;146m.\x1B[39m\x1B[38;2;66;211;146mj\x1B[39m\x1B[38;2;67;209;149ms\x1B[39m \x1B[38;2;68;206;152m-\x1B[39m \x1B[38;2;69;204;155mT\x1B[39m\x1B[38;2;70;201;158mh\x1B[39m\x1B[38;2;71;199;162me\x1B[39m \x1B[38;2;72;196;165mP\x1B[39m\x1B[38;2;73;194;168mr\x1B[39m\x1B[38;2;74;192;171mo\x1B[39m\x1B[38;2;75;189;174mg\x1B[39m\x1B[38;2;76;187;177mr\x1B[39m\x1B[38;2;77;184;180me\x1B[39m\x1B[38;2;78;182;183ms\x1B[39m\x1B[38;2;79;179;186ms\x1B[39m\x1B[38;2;80;177;190mi\x1B[39m\x1B[38;2;81;175;193mv\x1B[39m\x1B[38;2;82;172;196me\x1B[39m \x1B[38;2;83;170;199mJ\x1B[39m\x1B[38;2;83;167;202ma\x1B[39m\x1B[38;2;84;165;205mv\x1B[39m\x1B[38;2;85;162;208ma\x1B[39m\x1B[38;2;86;160;211mS\x1B[39m\x1B[38;2;87;158;215mc\x1B[39m\x1B[38;2;88;155;218mr\x1B[39m\x1B[38;2;89;153;221mi\x1B[39m\x1B[38;2;90;150;224mp\x1B[39m\x1B[38;2;91;148;227mt\x1B[39m \x1B[38;2;92;145;230mF\x1B[39m\x1B[38;2;93;143;233mr\x1B[39m\x1B[38;2;94;141;236ma\x1B[39m\x1B[38;2;95;138;239mm\x1B[39m\x1B[38;2;96;136;243me\x1B[39m\x1B[38;2;97;133;246mw\x1B[39m\x1B[38;2;98;131;249mo\x1B[39m\x1B[38;2;99;128;252mr\x1B[39m\x1B[38;2;100;126;255mk\x1B[39m'
14
+
15
+ export { defaultBanner , gradientBanner }
You can’t perform that action at this time.
0 commit comments