diff --git a/packages/cli/lib/constants.ts b/packages/cli/lib/constants.ts index dee0eb1..6efedf1 100644 --- a/packages/cli/lib/constants.ts +++ b/packages/cli/lib/constants.ts @@ -1,14 +1,28 @@ import * as fs from 'fs' import * as path from 'path' import { cwd } from 'process' -import * as http from 'http' +import * as https from 'https' +import axios from 'axios' +import kleur from 'kleur' +import gradient from 'gradient-string' + export const c = { - // Welcome message is only accessable by files in src, + // Welcome message is only accessable by files in lib, // else it throws an error. - welcomeMessage: `${http.get("https://raw.githubusercontent.com/CompeyDev/create-guilded-bot/main/packages/lib/welcome.txt")}` -} + word_CreateAscii: " _ \n | | \n ___ _ __ ___ __ _| |_ ___ \n / __| \'__/ _ \\/ _` | __/ _ \\\n | (__| | | __/ (_| | || __/\n \\___|_| \\___|\\__,_|\\__\\___|", + word_GuildedAscii: " _ _ _ _ \n (_) | | | | |\n __ _ _ _ _| | __| | ___ __| |\n / _` | | | | | |/ _` |/ _ \\/ _` |\n | (_| | |_| | | | (_| | __/ (_| |\n \\__, |\\__,_|_|_|\\__,_|\\___|\\__,_|\n __/ | \n |___/ ", + word_BotAscii: " _ _ \n | | | | \n | |__ ___ | |_ \n | \'_ \\ / _ \\| __|\n | |_) | (_) | |_ \n |_.__/ \\___/ \\__|", + word_HyphenAscii: " \n \n ______ \n |______|\n \n \n \n ", + welcomeMessage: gradient.rainbow.multiline(" _ _ _ _ _ \n | | (_) | | | | | \n ___ _ __ ___ __ _| |_ ___ ______ __ _ _ _ _| | __| | ___ __| |______ __ _ _ __ _ __ \n / __| \'__/ _ \\/ _` | __/ _ \\______/ _` | | | | | |/ _` |/ _ \\/ _` |______/ _` | \'_ \\| \'_ \\ \n | (__| | | __/ (_| | || __/ | (_| | |_| | | | (_| | __/ (_| | | (_| | |_) | |_) |\n \\___|_| \\___|\\__,_|\\__\\___| \\__, |\\__,_|_|_|\\__,_|\\___|\\__,_| \\__,_| .__/| .__/ \n __/ | | | | | \n |___/ |_| |_| \n") -export default function getConstant(constant: string): string { +} + +const hyphen = kleur.yellow(c.word_HyphenAscii) +const styleGreen = kleur.green + +// c.welcomeMessage = styleGreen(c.word_CreateAscii.trimEnd()) + hyphen + styleGreen(c.word_GuildedAscii.trimEnd()) + styleGreen(c.word_BotAscii.trimEnd()) + +export default function getConstant(constant: keyof typeof c): string { return c[constant] } \ No newline at end of file diff --git a/packages/cli/lib/welcome.txt b/packages/cli/lib/welcome.txt deleted file mode 100644 index 37d1643..0000000 --- a/packages/cli/lib/welcome.txt +++ /dev/null @@ -1,7 +0,0 @@ - - ,--. ,--.,--. ,--. ,--. ,--. ,--. - ,---.,--.--. ,---. ,--,--.,-' '-. ,---. ,-----. ,---.,--.,--.`--'| | ,-| |,---. ,-| |,-----.| |-. ,---. ,-' '-. -| .--'| .--'| .-. :' ,-. |'-. .-'| .-. :'-----'| .-. | || |,--.| |' .-. | .-. :' .-. |'-----'| .-. '| .-. |'-. .-' -\ `--.| | \ --.\ '-' | | | \ --. ' '-' ' '' '| || |\ `-' \ --.\ `-' | | `-' |' '-' ' | | - `---'`--' `----' `--`--' `--' `----' .`- / `----' `--'`--' `---' `----' `---' `---' `---' `--' - `---' \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index 9d6bf5c..53b275d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -12,6 +12,7 @@ "author": "", "license": "ISC", "dependencies": { + "axios": "^1.1.3", "fs-extra": "^10.1.0", "inquirer": "8.2.3", "kleur": "^4.1.5" diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index e69de29..522df1e 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "tsconfig/default" +} \ No newline at end of file diff --git a/packages/package.json b/packages/package.json index 16d765c..200c34e 100644 --- a/packages/package.json +++ b/packages/package.json @@ -1,5 +1,9 @@ { "dependencies": { - "async": "latest" + "async": "latest", + "gradient-string": "^2.0.2" + }, + "devDependencies": { + "@types/gradient-string": "^1.1.2" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e3c108..0b2121d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,20 @@ importers: libs/tsconfig: specifiers: {} + packages: + + specifiers: + '@types/gradient-string': ^1.1.2 + async: latest + gradient-string: ^2.0.2 + + dependencies: + async: 3.2.4 + gradient-string: 2.0.2 + + devDependencies: + '@types/gradient-string': 1.1.2 + packages/bot: specifiers: tsconfig: workspace:* @@ -43,6 +57,7 @@ importers: '@types/inquirer': 8.2.3 '@types/node': ^18.11.9 '@types/prompt': ^1.1.4 + axios: ^1.1.3 fs-extra: ^10.1.0 inquirer: 8.2.3 kleur: ^4.1.5 @@ -52,6 +67,7 @@ importers: tslib: ^2.4.1 typescript: ^4.9.3 dependencies: + axios: 1.1.3 fs-extra: 10.1.0 inquirer: 8.2.3 kleur: 4.1.5 @@ -204,6 +220,12 @@ packages: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} dev: true + /@types/gradient-string/1.1.2: + resolution: {integrity: sha512-zIet2KvHr2dkOCPI5ggQQ+WJVyfBSFaqK9sNelhgDjlE2K3Fu2muuPJwu5aKM3xoWuc3WXudVEMUwI1QWhykEQ==} + dependencies: + '@types/tinycolor2': 1.4.3 + dev: true + /@types/inquirer/8.2.3: resolution: {integrity: sha512-ZlBqD+8WIVNy3KIVkl+Qne6bGLW2erwN0GJXY9Ri/9EMbyupee3xw3H0Mmv5kJoLyNpfd/oHlwKxO0DUDH7yWA==} dependencies: @@ -243,6 +265,9 @@ packages: '@types/node': 18.11.9 dev: true + /@types/tinycolor2/1.4.3: + resolution: {integrity: sha512-Kf1w9NE5HEgGxCRyIcRXR/ZYtDv0V8FVPtYHwLxl0O+maGX0erE77pQlD0gpP+/KByMZ87mOA79SjifhSB3PjQ==} + /@typescript-eslint/parser/5.43.0_77fvizpdb3y4icyeo2mf4eo7em: resolution: {integrity: sha512-2iHUK2Lh7PwNUlhFxxLI2haSDNyXvebBO9izhjhMoDC+S3XI9qt2DGFUsiJ89m2k7gGYch2aEpYqV5F/+nwZug==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -450,11 +475,29 @@ packages: engines: {node: '>=8'} dev: false + /async/3.2.4: + resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==} + dev: false + + /asynckit/0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + /axe-core/4.5.2: resolution: {integrity: sha512-u2MVsXfew5HBvjsczCv+xlwdNnB1oQR9HlAcsejZttNjKKSkeDNVwB1vMThIUIFI9GoT57Vtk8iQLwqOfAkboA==} engines: {node: '>=4'} dev: false + /axios/1.1.3: + resolution: {integrity: sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==} + dependencies: + follow-redirects: 1.15.2 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /axobject-query/2.2.0: resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==} dev: false @@ -593,6 +636,13 @@ packages: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: false + /combined-stream/1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: false + /concat-map/0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -670,6 +720,11 @@ packages: object-keys: 1.1.1 dev: false + /delayed-stream/1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false + /diff/4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -1158,6 +1213,25 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: false + /follow-redirects/1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /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: false + /fs-extra/10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} @@ -1265,6 +1339,14 @@ packages: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: false + /gradient-string/2.0.2: + resolution: {integrity: sha512-rEDCuqUQ4tbD78TpzsMtt5OIf0cBCSDWSJtUDaF6JsAh+k0v9r++NzxNEG87oDZx9ZwGhD8DaezR2L/yrw0Jdw==} + engines: {node: '>=10'} + dependencies: + chalk: 4.1.2 + tinygradient: 1.1.5 + dev: false + /has-bigints/1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: false @@ -1614,6 +1696,18 @@ packages: picomatch: 2.3.1 dev: false + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + /mimic-fn/2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -1812,6 +1906,10 @@ packages: react-is: 16.13.1 dev: false + /proxy-from-env/1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /punycode/2.1.1: resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} engines: {node: '>=6'} @@ -2116,6 +2214,17 @@ packages: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} dev: false + /tinycolor2/1.4.2: + resolution: {integrity: sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==} + dev: false + + /tinygradient/1.1.5: + resolution: {integrity: sha512-8nIfc2vgQ4TeLnk2lFj4tRLvvJwEfQuabdsmvDdQPT0xlk9TaNtpGd6nNRxXoK6vQhN6RSzj+Cnp5tTQmpxmbw==} + dependencies: + '@types/tinycolor2': 1.4.3 + tinycolor2: 1.4.2 + dev: false + /tmp/0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'}