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 +4 -5
- package/src/commands/bananass-run/run.js +22 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bananass",
|
|
3
|
-
"version": "0.
|
|
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.
|
|
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.
|
|
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": "
|
|
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(
|
|
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
|
-
|
|
164
|
-
|
|
165
|
+
styleText(['cyan', 'bold'], `TESTCASE`),
|
|
166
|
+
styleText(['cyan', 'bold', 'underline'], `#${index + 1}`),
|
|
167
|
+
styleText(['green', 'bold'], 'INPUT'),
|
|
165
168
|
)
|
|
166
|
-
.log(
|
|
167
|
-
.log(
|
|
169
|
+
.log(styleText(['gray', 'dim'], '-'.repeat(columns)))
|
|
170
|
+
.log(styleText(['magenta', 'bold'], 'Your Input:'))
|
|
168
171
|
.log(input)
|
|
169
|
-
.log(
|
|
172
|
+
.log(styleText(['gray', 'dim'], BDLHIcon.repeat(columns)))
|
|
170
173
|
.log(
|
|
171
174
|
BIcon,
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
styleText(['cyan', 'bold'], `TESTCASE`),
|
|
176
|
+
styleText(['cyan', 'bold', 'underline'], `#${index + 1}`),
|
|
177
|
+
styleText(['green', 'bold'], 'OUTPUT'),
|
|
174
178
|
)
|
|
175
|
-
.log(
|
|
176
|
-
.log(
|
|
179
|
+
.log(styleText(['gray', 'dim'], '-'.repeat(columns)))
|
|
180
|
+
.log(styleText(['magenta', 'bold'], 'Expected Output:'))
|
|
177
181
|
.log(outputExpected)
|
|
178
|
-
.log(
|
|
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
|
-
|
|
190
|
-
|
|
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
|
});
|