From 040e0d3df76f88fd1aa06f12691557fbfb7503a3 Mon Sep 17 00:00:00 2001
From: timothycarambat <rambat1010@gmail.com>
Date: Wed, 14 Jun 2023 11:02:46 -0700
Subject: [PATCH] remove chalk dep for cloudformation document generator

---
 aws/cloudformation/generate.mjs | 16 +++++++++++++++-
 package.json                    |  5 +----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/aws/cloudformation/generate.mjs b/aws/cloudformation/generate.mjs
index 67f753535..dce7981c1 100644
--- a/aws/cloudformation/generate.mjs
+++ b/aws/cloudformation/generate.mjs
@@ -12,13 +12,27 @@ import fs from 'fs';
 import { fileURLToPath } from 'url';
 import path, { dirname } from 'path';
 import { exit } from 'process';
-import chalk from 'chalk';
 const __dirname = dirname(fileURLToPath(import.meta.url));
 const REPLACEMENT_KEY = '!SUB::USER::CONTENT!'
 
 const envPath = path.resolve(__dirname, `../../docker/.env`)
 const envFileExists = fs.existsSync(envPath);
 
+const chalk = {
+  redBright: function (text) {
+    return `\x1b[31m${text}\x1b[0m`
+  },
+  cyan: function (text) {
+    return `\x1b[36m${text}\x1b[0m`
+  },
+  greenBright: function (text) {
+    return `\x1b[32m${text}\x1b[0m`
+  },
+  blueBright: function (text) {
+    return `\x1b[34m${text}\x1b[0m`
+  }
+}
+
 if (!envFileExists) {
   console.log(chalk.redBright('[ABORT]'), 'You do not have an .env file in your ./docker/ folder. You need to create it first.');
   console.log('You can start by running', chalk.cyan('cp -n ./docker/.env.example ./docker/.env'))
diff --git a/package.json b/package.json
index 4727ff344..a6bab10e0 100644
--- a/package.json
+++ b/package.json
@@ -18,8 +18,5 @@
     "prod:frontend": "cd frontend && yarn build",
     "generate:cloudformation": "node aws/cloudformation/generate.mjs"
   },
-  "private": false,
-  "devDependencies": {
-    "chalk": "^5.2.0"
-  }
+  "private": false
 }
\ No newline at end of file
-- 
GitLab