bananass 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bananass",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Baekjoon Framework for JavaScript.🍌",
6
6
  "exports": {
@@ -97,11 +97,10 @@
97
97
  "@babel/plugin-transform-typescript": "^7.28.0",
98
98
  "@babel/preset-env": "^7.28.0",
99
99
  "babel-loader": "^10.0.0",
100
- "bananass-utils-console": "^0.3.1",
101
- "chalk": "^5.4.1",
100
+ "bananass-utils-console": "^0.4.0",
102
101
  "commander": "^14.0.0",
103
102
  "defu": "^6.1.4",
104
- "enhanced-resolve": "^5.18.2",
103
+ "enhanced-resolve": "^5.18.3",
105
104
  "envinfo": "^7.14.0",
106
105
  "jiti": "^2.5.1",
107
106
  "open": "^10.2.0",
@@ -112,5 +111,5 @@
112
111
  "@types/babel__core": "^7.20.5",
113
112
  "@types/envinfo": "^7.8.4"
114
113
  },
115
- "gitHead": "f2a5479ecbc8cc9f4260afb29c4aa9b7d38ab688"
114
+ "gitHead": "9ef4b5d85c599fd179cd90de4619668d6ee6867f"
116
115
  }
@@ -8,6 +8,7 @@
8
8
  // --------------------------------------------------------------------------------
9
9
 
10
10
  import { resolve } from 'node:path';
11
+ import { styleText } from 'node:util';
11
12
 
12
13
  import createLogger from 'bananass-utils-console/logger';
13
14
  import createSpinner from 'bananass-utils-console/spinner';
@@ -16,8 +17,6 @@ import {
16
17
  bulletIcon as BIcon,
17
18
  boxDrawingsLightHorizontalIcon as BDLHIcon,
18
19
  } from 'bananass-utils-console/icons';
19
-
20
- import chalk from 'chalk';
21
20
  import { createJiti } from 'jiti';
22
21
 
23
22
  import { defaultConfigObject as dco } from '../../core/conf/index.js';
@@ -153,29 +152,34 @@ export default async function run(problems, configObject = dco) {
153
152
  .eol();
154
153
 
155
154
  testResults.forEach(({ results }, idx) => {
156
- logger.log(chalk.cyan.bold(`PROBLEM:`, chalk.green.bold(problems[idx])));
155
+ logger.log(
156
+ styleText(['cyan', 'bold'], `PROBLEM:`),
157
+ styleText(['green', 'bold'], problems[idx]),
158
+ );
157
159
 
158
160
  results.forEach(({ input, outputExpected, outputActual }, index, thisArg) => {
159
161
  logger
160
162
  .log(BDLHIcon.repeat(columns))
161
163
  .log(
162
164
  BIcon,
163
- chalk.cyan.bold(`TESTCASE`, chalk.underline(`#${index + 1}`)),
164
- chalk.green.bold('INPUT'),
165
+ styleText(['cyan', 'bold'], `TESTCASE`),
166
+ styleText(['cyan', 'bold', 'underline'], `#${index + 1}`),
167
+ styleText(['green', 'bold'], 'INPUT'),
165
168
  )
166
- .log(chalk.gray.dim('-'.repeat(columns)))
167
- .log(chalk.magenta.bold('Your Input:'))
169
+ .log(styleText(['gray', 'dim'], '-'.repeat(columns)))
170
+ .log(styleText(['magenta', 'bold'], 'Your Input:'))
168
171
  .log(input)
169
- .log(chalk.gray.dim(BDLHIcon.repeat(columns)))
172
+ .log(styleText(['gray', 'dim'], BDLHIcon.repeat(columns)))
170
173
  .log(
171
174
  BIcon,
172
- chalk.cyan.bold(`TESTCASE`, chalk.underline(`#${index + 1}`)),
173
- chalk.greenBright.bold('OUTPUT'),
175
+ styleText(['cyan', 'bold'], `TESTCASE`),
176
+ styleText(['cyan', 'bold', 'underline'], `#${index + 1}`),
177
+ styleText(['green', 'bold'], 'OUTPUT'),
174
178
  )
175
- .log(chalk.gray.dim('-'.repeat(columns)))
176
- .log(chalk.magenta.bold('Expected Output:'))
179
+ .log(styleText(['gray', 'dim'], '-'.repeat(columns)))
180
+ .log(styleText(['magenta', 'bold'], 'Expected Output:'))
177
181
  .log(outputExpected)
178
- .log(chalk.magenta.bold('Your Output:'))
182
+ .log(styleText(['magenta', 'bold'], 'Your Output:'))
179
183
  .log(outputActual);
180
184
 
181
185
  if (thisArg.length === index + 1) {
@@ -186,8 +190,11 @@ export default async function run(problems, configObject = dco) {
186
190
  results.forEach(({ isTestPassed }, index) => {
187
191
  logger.log(
188
192
  BIcon,
189
- chalk.cyan.bold(`TESTCASE`, chalk.underline(`#${index + 1}`)),
190
- isTestPassed ? chalk.green.bold('PASSED') : chalk.red.bold('FAILED'),
193
+ styleText(['cyan', 'bold'], `TESTCASE`),
194
+ styleText(['cyan', 'bold', 'underline'], `#${index + 1}`),
195
+ isTestPassed
196
+ ? styleText(['green', 'bold'], 'PASSED')
197
+ : styleText(['red', 'bold'], 'FAILED'),
191
198
  );
192
199
  });
193
200
  });