bananass 0.4.1 → 0.5.1
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/README.md +2 -2
- package/build/commands/bananass-bug/bug.d.ts +2 -2
- package/build/commands/bananass-build/build.d.ts +2 -2
- package/build/commands/bananass-discussion/discussion.d.ts +2 -2
- package/build/commands/bananass-home/home.d.ts +2 -2
- package/build/commands/bananass-info/info.d.ts +2 -2
- package/build/commands/bananass-open/open.d.ts +3 -3
- package/build/commands/bananass-repo/repo.d.ts +2 -2
- package/build/commands/bananass-run/run.d.ts +3 -3
- package/build/commands/bananass-run/test-runner.d.ts +12 -9
- package/build/core/conf/config-loader/config-loader.d.ts +57 -5
- package/build/core/constants.d.ts +1 -1
- package/build/core/types/index.d.ts +1 -0
- package/build/core/types/types.d.ts +415 -0
- package/package.json +17 -23
- package/src/commands/bananass-bug/bug.js +5 -9
- package/src/commands/bananass-build/build.js +14 -16
- package/src/commands/bananass-discussion/discussion.js +5 -9
- package/src/commands/bananass-home/home.js +5 -9
- package/src/commands/bananass-info/info.js +5 -9
- package/src/commands/bananass-open/open.js +9 -13
- package/src/commands/bananass-repo/repo.js +5 -9
- package/src/commands/bananass-run/run.js +16 -18
- package/src/commands/bananass-run/test-runner.js +20 -31
- package/src/core/conf/config-loader/config-loader.js +1 -1
- package/src/core/conf/default-config-object/default-config-object.js +1 -1
- package/src/core/constants.js +1 -1
- package/src/core/types/index.js +1 -0
- package/src/core/types/types.js +336 -0
- package/build/core/structs/config-object/config-object.d.ts +0 -11
- package/build/core/structs/config-object/index.d.ts +0 -2
- package/build/core/structs/config-object-add/config-object-add.d.ts +0 -12
- package/build/core/structs/config-object-add/index.d.ts +0 -2
- package/build/core/structs/config-object-browser/config-object-browser.d.ts +0 -11
- package/build/core/structs/config-object-browser/index.d.ts +0 -2
- package/build/core/structs/config-object-bug/config-object-bug.d.ts +0 -12
- package/build/core/structs/config-object-bug/index.d.ts +0 -2
- package/build/core/structs/config-object-build/config-object-build.d.ts +0 -11
- package/build/core/structs/config-object-build/index.d.ts +0 -2
- package/build/core/structs/config-object-console/config-object-console.d.ts +0 -11
- package/build/core/structs/config-object-console/index.d.ts +0 -2
- package/build/core/structs/config-object-discussion/config-object-discussion.d.ts +0 -12
- package/build/core/structs/config-object-discussion/index.d.ts +0 -2
- package/build/core/structs/config-object-home/config-object-home.d.ts +0 -12
- package/build/core/structs/config-object-home/index.d.ts +0 -2
- package/build/core/structs/config-object-info/config-object-info.d.ts +0 -11
- package/build/core/structs/config-object-info/index.d.ts +0 -2
- package/build/core/structs/config-object-open/config-object-open.d.ts +0 -12
- package/build/core/structs/config-object-open/index.d.ts +0 -2
- package/build/core/structs/config-object-repo/config-object-repo.d.ts +0 -12
- package/build/core/structs/config-object-repo/index.d.ts +0 -2
- package/build/core/structs/config-object-run/config-object-run.d.ts +0 -12
- package/build/core/structs/config-object-run/index.d.ts +0 -2
- package/build/core/structs/index.d.ts +0 -21
- package/build/core/structs/input/index.d.ts +0 -2
- package/build/core/structs/input/input.d.ts +0 -12
- package/build/core/structs/output/index.d.ts +0 -2
- package/build/core/structs/output/output.d.ts +0 -12
- package/build/core/structs/problem/index.d.ts +0 -2
- package/build/core/structs/problem/problem.d.ts +0 -12
- package/build/core/structs/problems/index.d.ts +0 -2
- package/build/core/structs/problems/problems.d.ts +0 -12
- package/build/core/structs/solution/index.d.ts +0 -2
- package/build/core/structs/solution/solution.d.ts +0 -11
- package/build/core/structs/solution-with-testcases/index.d.ts +0 -2
- package/build/core/structs/solution-with-testcases/solution-with-testcases.d.ts +0 -11
- package/build/core/structs/testcase/index.d.ts +0 -2
- package/build/core/structs/testcase/testcase.d.ts +0 -11
- package/build/core/structs/testcases/index.d.ts +0 -2
- package/build/core/structs/testcases/testcases.d.ts +0 -12
- package/build/core/types.d.ts +0 -199
- package/src/core/structs/config-object/config-object.js +0 -64
- package/src/core/structs/config-object/index.js +0 -3
- package/src/core/structs/config-object-add/config-object-add.js +0 -34
- package/src/core/structs/config-object-add/index.js +0 -3
- package/src/core/structs/config-object-browser/config-object-browser.js +0 -37
- package/src/core/structs/config-object-browser/index.js +0 -3
- package/src/core/structs/config-object-bug/config-object-bug.js +0 -34
- package/src/core/structs/config-object-bug/index.js +0 -3
- package/src/core/structs/config-object-build/config-object-build.js +0 -37
- package/src/core/structs/config-object-build/index.js +0 -3
- package/src/core/structs/config-object-console/config-object-console.js +0 -37
- package/src/core/structs/config-object-console/index.js +0 -3
- package/src/core/structs/config-object-discussion/config-object-discussion.js +0 -34
- package/src/core/structs/config-object-discussion/index.js +0 -3
- package/src/core/structs/config-object-home/config-object-home.js +0 -34
- package/src/core/structs/config-object-home/index.js +0 -3
- package/src/core/structs/config-object-info/config-object-info.js +0 -36
- package/src/core/structs/config-object-info/index.js +0 -3
- package/src/core/structs/config-object-open/config-object-open.js +0 -34
- package/src/core/structs/config-object-open/index.js +0 -3
- package/src/core/structs/config-object-repo/config-object-repo.js +0 -34
- package/src/core/structs/config-object-repo/index.js +0 -3
- package/src/core/structs/config-object-run/config-object-run.js +0 -34
- package/src/core/structs/config-object-run/index.js +0 -3
- package/src/core/structs/index.js +0 -61
- package/src/core/structs/input/index.js +0 -3
- package/src/core/structs/input/input.js +0 -34
- package/src/core/structs/output/index.js +0 -3
- package/src/core/structs/output/output.js +0 -34
- package/src/core/structs/problem/index.js +0 -3
- package/src/core/structs/problem/problem.js +0 -39
- package/src/core/structs/problems/index.js +0 -3
- package/src/core/structs/problems/problems.js +0 -40
- package/src/core/structs/solution/index.js +0 -3
- package/src/core/structs/solution/solution.js +0 -38
- package/src/core/structs/solution-with-testcases/index.js +0 -3
- package/src/core/structs/solution-with-testcases/solution-with-testcases.js +0 -39
- package/src/core/structs/testcase/index.js +0 -3
- package/src/core/structs/testcase/testcase.js +0 -39
- package/src/core/structs/testcases/index.js +0 -3
- package/src/core/structs/testcases/testcases.js +0 -35
- package/src/core/types.js +0 -160
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ npm create bananass@latest
|
|
|
137
137
|
|
|
138
138
|
다만, 올바른 커뮤니티 환경을 준수하고 더 나은 오픈 소스를 만들기 위해, 바나나 프레임워크에 기여하기 전 반드시 아래 내용들을 확인해주세요.
|
|
139
139
|
|
|
140
|
-
- [기여자 행동 강령 규약](
|
|
140
|
+
- [기여자 행동 강령 규약](https://github.com/lumirlumir/.github/blob/main/CODE_OF_CONDUCT_KO.md#%EA%B8%B0%EC%97%AC%EC%9E%90-%ED%96%89%EB%8F%99-%EA%B0%95%EB%A0%B9-%EA%B7%9C%EC%95%BD)
|
|
141
141
|
- [기여하기](CONTRIBUTING.md)
|
|
142
142
|
|
|
143
143
|
## 버전 정책<sup>Versioning</sup>
|
|
@@ -146,7 +146,7 @@ npm create bananass@latest
|
|
|
146
146
|
|
|
147
147
|
## 기여자 행동 강령 규약<sup>Code of Conduct</sup>
|
|
148
148
|
|
|
149
|
-
커뮤니티에 기여하기 전, [기여자 행동 강령 규약](
|
|
149
|
+
커뮤니티에 기여하기 전, [기여자 행동 강령 규약](https://github.com/lumirlumir/.github/blob/main/CODE_OF_CONDUCT_KO.md#%EA%B8%B0%EC%97%AC%EC%9E%90-%ED%96%89%EB%8F%99-%EA%B0%95%EB%A0%B9-%EA%B7%9C%EC%95%BD)을 참고해주세요.
|
|
150
150
|
|
|
151
151
|
## 변경 사항<sup>Change Log</sup>
|
|
152
152
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { ConfigObject } from '../../core/types.js';
|
|
2
|
+
* @import { ConfigObject } from '../../core/types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously open the github issues in a browser.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @async
|
|
8
8
|
*/
|
|
9
9
|
export default function bug(configObject?: ConfigObject): Promise<void>;
|
|
10
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
10
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @async
|
|
6
6
|
*/
|
|
7
7
|
export default function build(problems: Problems, configObject?: ConfigObject): Promise<void>;
|
|
8
|
-
import type { Problems } from '../../core/types.js';
|
|
9
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
8
|
+
import type { Problems } from '../../core/types/index.js';
|
|
9
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { ConfigObject } from '../../core/types.js';
|
|
2
|
+
* @import { ConfigObject } from '../../core/types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously open the github discussions in a browser.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @async
|
|
8
8
|
*/
|
|
9
9
|
export default function discussion(configObject?: ConfigObject): Promise<void>;
|
|
10
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
10
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { ConfigObject } from '../../core/types.js';
|
|
2
|
+
* @import { ConfigObject } from '../../core/types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously open the official documentation homepage in a browser.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @async
|
|
8
8
|
*/
|
|
9
9
|
export default function home(configObject?: ConfigObject): Promise<void>;
|
|
10
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
10
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { ConfigObject } from '../../core/types.js';
|
|
2
|
+
* @import { ConfigObject } from '../../core/types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously print relevant details about the current system which can be used to report bugs.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @async
|
|
8
8
|
*/
|
|
9
9
|
export default function info(configObject?: ConfigObject): Promise<void>;
|
|
10
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
10
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { Problems, ConfigObject } from '../../core/types.js';
|
|
2
|
+
* @import { Problems, ConfigObject } from '../../core/types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously open the given baekjoon problem numbers in a browser
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* @async
|
|
9
9
|
*/
|
|
10
10
|
export default function home(problems: Problems, configObject?: ConfigObject): Promise<void>;
|
|
11
|
-
import type { Problems } from '../../core/types.js';
|
|
12
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
11
|
+
import type { Problems } from '../../core/types/index.js';
|
|
12
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { ConfigObject } from '../../core/types.js';
|
|
2
|
+
* @import { ConfigObject } from '../../core/types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously open the github repository in a browser.
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* @async
|
|
8
8
|
*/
|
|
9
9
|
export default function repo(configObject?: ConfigObject): Promise<void>;
|
|
10
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
10
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { Problems,
|
|
2
|
+
* @import { ConfigObject, Problems, Testcases, Solution } from '../../core/types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Asynchronously run generated testcases and compare them with the expected outputs.
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* @async
|
|
9
9
|
*/
|
|
10
10
|
export default function run(problems: Problems, configObject?: ConfigObject): Promise<void>;
|
|
11
|
-
import type { Problems } from '../../core/types.js';
|
|
12
|
-
import type { ConfigObject } from '../../core/types.js';
|
|
11
|
+
import type { Problems } from '../../core/types/index.js';
|
|
12
|
+
import type { ConfigObject } from '../../core/types/index.js';
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test runner. Return an object with test results.
|
|
3
|
-
* @param {
|
|
3
|
+
* @param {{testcases?: Testcases, solution: Solution}} solutionWithTestcases
|
|
4
4
|
*/
|
|
5
|
-
export default function testRunner(
|
|
5
|
+
export default function testRunner({ testcases, solution }: {
|
|
6
|
+
testcases?: Testcases;
|
|
7
|
+
solution: Solution;
|
|
8
|
+
}): {
|
|
6
9
|
results: {
|
|
7
|
-
input: string;
|
|
8
|
-
outputExpected:
|
|
9
|
-
outputActual:
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
input: string | undefined;
|
|
11
|
+
outputExpected: string | number | boolean;
|
|
12
|
+
outputActual: string | number | boolean;
|
|
13
|
+
normalizedOutputExpected: string;
|
|
14
|
+
normalizedOutputActual: string;
|
|
12
15
|
isTestPassed: boolean;
|
|
13
16
|
}[];
|
|
14
17
|
numberOfTests: number;
|
|
@@ -16,5 +19,5 @@ export default function testRunner(solutionWithTestcases: SolutionWithTestcases)
|
|
|
16
19
|
numberOfTestsFailed: number;
|
|
17
20
|
isAllTestsPassed: boolean;
|
|
18
21
|
};
|
|
19
|
-
import type {
|
|
20
|
-
import type {
|
|
22
|
+
import type { Testcases } from '../../core/types/index.js';
|
|
23
|
+
import type { Solution } from '../../core/types/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { ConfigObject } from '../../types.js';
|
|
2
|
+
* @import { ConfigObject } from '../../types/index.js';
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Load and merge configuration objects.
|
|
@@ -14,8 +14,60 @@
|
|
|
14
14
|
* @async
|
|
15
15
|
*/
|
|
16
16
|
export default function configLoader({ cwd, cliConfigObject, defaultConfigObject, }?: {
|
|
17
|
-
cwd?: string;
|
|
18
|
-
cliConfigObject?:
|
|
19
|
-
|
|
17
|
+
cwd?: string | undefined;
|
|
18
|
+
cliConfigObject?: Readonly<{
|
|
19
|
+
cwd?: string | undefined;
|
|
20
|
+
entryDir?: string | undefined;
|
|
21
|
+
outDir?: string | undefined;
|
|
22
|
+
browser?: Readonly<{
|
|
23
|
+
browser?: "default" | "chrome" | "edge" | "firefox" | "brave" | undefined;
|
|
24
|
+
secret?: boolean | undefined;
|
|
25
|
+
}> | undefined;
|
|
26
|
+
console?: Readonly<{
|
|
27
|
+
debug?: boolean | undefined;
|
|
28
|
+
quiet?: boolean | undefined;
|
|
29
|
+
}> | undefined;
|
|
30
|
+
add?: Readonly<Record<string, never>> | undefined;
|
|
31
|
+
bug?: Readonly<Record<string, never>> | undefined;
|
|
32
|
+
build?: Readonly<{
|
|
33
|
+
clean?: boolean | undefined;
|
|
34
|
+
templateType?: "fs" | "rl" | undefined;
|
|
35
|
+
}> | undefined;
|
|
36
|
+
discussion?: Readonly<Record<string, never>> | undefined;
|
|
37
|
+
home?: Readonly<Record<string, never>> | undefined;
|
|
38
|
+
info?: Readonly<{
|
|
39
|
+
all?: boolean | undefined;
|
|
40
|
+
}> | undefined;
|
|
41
|
+
open?: Readonly<Record<string, never>> | undefined;
|
|
42
|
+
repo?: Readonly<Record<string, never>> | undefined;
|
|
43
|
+
run?: Readonly<Record<string, never>> | undefined;
|
|
44
|
+
}> | undefined;
|
|
45
|
+
defaultConfigObject?: Readonly<{
|
|
46
|
+
cwd?: string | undefined;
|
|
47
|
+
entryDir?: string | undefined;
|
|
48
|
+
outDir?: string | undefined;
|
|
49
|
+
browser?: Readonly<{
|
|
50
|
+
browser?: "default" | "chrome" | "edge" | "firefox" | "brave" | undefined;
|
|
51
|
+
secret?: boolean | undefined;
|
|
52
|
+
}> | undefined;
|
|
53
|
+
console?: Readonly<{
|
|
54
|
+
debug?: boolean | undefined;
|
|
55
|
+
quiet?: boolean | undefined;
|
|
56
|
+
}> | undefined;
|
|
57
|
+
add?: Readonly<Record<string, never>> | undefined;
|
|
58
|
+
bug?: Readonly<Record<string, never>> | undefined;
|
|
59
|
+
build?: Readonly<{
|
|
60
|
+
clean?: boolean | undefined;
|
|
61
|
+
templateType?: "fs" | "rl" | undefined;
|
|
62
|
+
}> | undefined;
|
|
63
|
+
discussion?: Readonly<Record<string, never>> | undefined;
|
|
64
|
+
home?: Readonly<Record<string, never>> | undefined;
|
|
65
|
+
info?: Readonly<{
|
|
66
|
+
all?: boolean | undefined;
|
|
67
|
+
}> | undefined;
|
|
68
|
+
open?: Readonly<Record<string, never>> | undefined;
|
|
69
|
+
repo?: Readonly<Record<string, never>> | undefined;
|
|
70
|
+
run?: Readonly<Record<string, never>> | undefined;
|
|
71
|
+
}> | undefined;
|
|
20
72
|
}): Promise<ConfigObject>;
|
|
21
|
-
import type { ConfigObject } from '../../types.js';
|
|
73
|
+
import type { ConfigObject } from '../../types/index.js';
|
|
@@ -36,4 +36,4 @@ export const WEBPACK_BANNER: string;
|
|
|
36
36
|
export const BANANASS_PKG_NAMES: readonly ["bananass", "bananass-utils-console", "create-bananass", "eslint-config-bananass", "prettier-config-bananass"];
|
|
37
37
|
export const SUPPORTED_SOLUTION_FILE_EXTENSIONS: readonly [".js", ".mjs", ".cjs", ".ts", ".mts", ".cts"];
|
|
38
38
|
export const SUPPORTED_CONFIG_FILE_NAMES: ("bananass.config.cjs" | "bananass.config.js" | "bananass.config.mjs" | "bananass.config.ts" | "bananass.config.mts" | "bananass.config.cts")[];
|
|
39
|
-
import type { Problem } from "./types.js";
|
|
39
|
+
import type { Problem } from "./types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {z.infer<typeof configObject>} ConfigObject
|
|
3
|
+
* Bananass configuration object.
|
|
4
|
+
* @typedef {z.infer<typeof configObjectBrowser>} ConfigObjectBrowser
|
|
5
|
+
* Global browser options.
|
|
6
|
+
* @typedef {z.infer<typeof configObjectConsole>} ConfigObjectConsole
|
|
7
|
+
* Global console options.
|
|
8
|
+
* @typedef {z.infer<typeof configObjectAdd>} ConfigObjectAdd
|
|
9
|
+
* Options exclusive to the `bananass add` command.
|
|
10
|
+
* @typedef {z.infer<typeof configObjectBug>} ConfigObjectBug
|
|
11
|
+
* Options exclusive to the `bananass bug` command.
|
|
12
|
+
* @typedef {z.infer<typeof configObjectBuild>} ConfigObjectBuild
|
|
13
|
+
* Options exclusive to the `bananass build` command.
|
|
14
|
+
* @typedef {z.infer<typeof configObjectDiscussion>} ConfigObjectDiscussion
|
|
15
|
+
* Options exclusive to the `bananass discussion` command.
|
|
16
|
+
* @typedef {z.infer<typeof configObjectHome>} ConfigObjectHome
|
|
17
|
+
* Options exclusive to the `bananass home` command.
|
|
18
|
+
* @typedef {z.infer<typeof configObjectInfo>} ConfigObjectInfo
|
|
19
|
+
* Options exclusive to the `bananass info` command.
|
|
20
|
+
* @typedef {z.infer<typeof configObjectOpen>} ConfigObjectOpen
|
|
21
|
+
* Options exclusive to the `bananass open` command.
|
|
22
|
+
* @typedef {z.infer<typeof configObjectRepo>} ConfigObjectRepo
|
|
23
|
+
* Options exclusive to the `bananass repo` command.
|
|
24
|
+
* @typedef {z.infer<typeof configObjectRun>} ConfigObjectRun
|
|
25
|
+
* Options exclusive to the `bananass run` command.
|
|
26
|
+
*
|
|
27
|
+
* @typedef {z.infer<typeof problem>} Problem
|
|
28
|
+
* Baekjoon problem number as a string.
|
|
29
|
+
* Problem number must be an integer greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
|
|
30
|
+
* @typedef {z.infer<typeof problems>} Problems
|
|
31
|
+
* Baekjoon problem numbers as a nonempty string array.
|
|
32
|
+
* Each problem number must be an integer greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
|
|
33
|
+
*
|
|
34
|
+
* @typedef {z.infer<typeof input>} Input
|
|
35
|
+
* Input value. Must be a `string` or `undefined`.
|
|
36
|
+
* @typedef {z.infer<typeof output>} Output
|
|
37
|
+
* Output value. Must be a `string`, `number`, or `boolean`.
|
|
38
|
+
* (It can be a primitive type except for `bigint`, `symbol`, `undefined`, and `null`).
|
|
39
|
+
*
|
|
40
|
+
* Output values will be **coerced to a `string` and any trailing whitespace
|
|
41
|
+
* will be removed using `trimEnd()`** when running the `bananass run` command.
|
|
42
|
+
* (This behavior mimics how `console.log` converts values to a `string` before displaying them.)
|
|
43
|
+
*
|
|
44
|
+
* Note that `bigint` is not allowed, as `console.log(BigInt(1))` outputs `1n`,
|
|
45
|
+
* whereas `console.log(String(BigInt(1)))` outputs `1`, which have different representations.
|
|
46
|
+
* @typedef {z.infer<typeof testcase>} Testcase
|
|
47
|
+
* Testcase object.
|
|
48
|
+
* @typedef {z.infer<typeof testcases>} Testcases
|
|
49
|
+
* Testcases array.
|
|
50
|
+
* @typedef {ReturnType<typeof solution.implement>} Solution
|
|
51
|
+
* Solution function.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Global browser options.
|
|
55
|
+
*/
|
|
56
|
+
export const configObjectBrowser: z.ZodReadonly<z.ZodObject<{
|
|
57
|
+
/**
|
|
58
|
+
* Browser name. Select from `'chrome'`, `'edge'`, `'firefox'`, `'brave'`, or `'default'`.
|
|
59
|
+
* @default 'default'
|
|
60
|
+
*/
|
|
61
|
+
browser: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
default: "default";
|
|
63
|
+
chrome: "chrome";
|
|
64
|
+
edge: "edge";
|
|
65
|
+
firefox: "firefox";
|
|
66
|
+
brave: "brave";
|
|
67
|
+
}>>;
|
|
68
|
+
/**
|
|
69
|
+
* Open browser in secret (private or incognito) mode.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
secret: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
}, z.core.$strict>>;
|
|
74
|
+
/**
|
|
75
|
+
* Global console options.
|
|
76
|
+
*/
|
|
77
|
+
export const configObjectConsole: z.ZodReadonly<z.ZodObject<{
|
|
78
|
+
/**
|
|
79
|
+
* Enable debug mode.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Enable quiet mode.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
quiet: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
}, z.core.$strict>>;
|
|
89
|
+
/**
|
|
90
|
+
* Options exclusive to the `bananass add` command.
|
|
91
|
+
*/
|
|
92
|
+
export const configObjectAdd: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
|
|
93
|
+
/**
|
|
94
|
+
* Options exclusive to the `bananass bug` command.
|
|
95
|
+
*/
|
|
96
|
+
export const configObjectBug: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
|
|
97
|
+
/**
|
|
98
|
+
* Options exclusive to the `bananass build` command.
|
|
99
|
+
*/
|
|
100
|
+
export const configObjectBuild: z.ZodReadonly<z.ZodObject<{
|
|
101
|
+
/**
|
|
102
|
+
* Clean the output directory before emit.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
clean: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
/**
|
|
107
|
+
* Webpack entry file template type. Select from `'fs'` (File System) or `'rl'` (Read Line).
|
|
108
|
+
* @default 'fs'
|
|
109
|
+
*/
|
|
110
|
+
templateType: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
fs: "fs";
|
|
112
|
+
rl: "rl";
|
|
113
|
+
}>>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
/**
|
|
116
|
+
* Options exclusive to the `bananass discussion` command.
|
|
117
|
+
*/
|
|
118
|
+
export const configObjectDiscussion: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
|
|
119
|
+
/**
|
|
120
|
+
* Options exclusive to the `bananass home` command.
|
|
121
|
+
*/
|
|
122
|
+
export const configObjectHome: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
|
|
123
|
+
/**
|
|
124
|
+
* Options exclusive to the `bananass info` command.
|
|
125
|
+
*/
|
|
126
|
+
export const configObjectInfo: z.ZodReadonly<z.ZodObject<{
|
|
127
|
+
/**
|
|
128
|
+
* Show all information including Not Found.
|
|
129
|
+
* @default false
|
|
130
|
+
*/
|
|
131
|
+
all: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
}, z.core.$strict>>;
|
|
133
|
+
/**
|
|
134
|
+
* Options exclusive to the `bananass open` command.
|
|
135
|
+
*/
|
|
136
|
+
export const configObjectOpen: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
|
|
137
|
+
/**
|
|
138
|
+
* Options exclusive to the `bananass repo` command.
|
|
139
|
+
*/
|
|
140
|
+
export const configObjectRepo: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
|
|
141
|
+
/**
|
|
142
|
+
* Options exclusive to the `bananass run` command.
|
|
143
|
+
*/
|
|
144
|
+
export const configObjectRun: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
|
|
145
|
+
/**
|
|
146
|
+
* Bananass configuration object.
|
|
147
|
+
*/
|
|
148
|
+
export const configObject: z.ZodReadonly<z.ZodObject<{
|
|
149
|
+
/**
|
|
150
|
+
* Current working directory.
|
|
151
|
+
* @default findRootDir()
|
|
152
|
+
*/
|
|
153
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
154
|
+
/**
|
|
155
|
+
* Entry directory name.
|
|
156
|
+
* @default 'bananass'
|
|
157
|
+
*/
|
|
158
|
+
entryDir: z.ZodOptional<z.ZodString>;
|
|
159
|
+
/**
|
|
160
|
+
* Output directory name.
|
|
161
|
+
* @default '.bananass'
|
|
162
|
+
*/
|
|
163
|
+
outDir: z.ZodOptional<z.ZodString>;
|
|
164
|
+
/**
|
|
165
|
+
* Global browser options.
|
|
166
|
+
*/
|
|
167
|
+
browser: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
168
|
+
/**
|
|
169
|
+
* Browser name. Select from `'chrome'`, `'edge'`, `'firefox'`, `'brave'`, or `'default'`.
|
|
170
|
+
* @default 'default'
|
|
171
|
+
*/
|
|
172
|
+
browser: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
default: "default";
|
|
174
|
+
chrome: "chrome";
|
|
175
|
+
edge: "edge";
|
|
176
|
+
firefox: "firefox";
|
|
177
|
+
brave: "brave";
|
|
178
|
+
}>>;
|
|
179
|
+
/**
|
|
180
|
+
* Open browser in secret (private or incognito) mode.
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
secret: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
+
}, z.core.$strict>>>;
|
|
185
|
+
/**
|
|
186
|
+
* Global console options.
|
|
187
|
+
*/
|
|
188
|
+
console: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
189
|
+
/**
|
|
190
|
+
* Enable debug mode.
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
/**
|
|
195
|
+
* Enable quiet mode.
|
|
196
|
+
* @default false
|
|
197
|
+
*/
|
|
198
|
+
quiet: z.ZodOptional<z.ZodBoolean>;
|
|
199
|
+
}, z.core.$strict>>>;
|
|
200
|
+
/**
|
|
201
|
+
* Options exclusive to the `bananass add` command.
|
|
202
|
+
*/
|
|
203
|
+
add: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
|
|
204
|
+
/**
|
|
205
|
+
* Options exclusive to the `bananass bug` command.
|
|
206
|
+
*/
|
|
207
|
+
bug: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
|
|
208
|
+
/**
|
|
209
|
+
* Options exclusive to the `bananass build` command.
|
|
210
|
+
*/
|
|
211
|
+
build: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
212
|
+
/**
|
|
213
|
+
* Clean the output directory before emit.
|
|
214
|
+
* @default false
|
|
215
|
+
*/
|
|
216
|
+
clean: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
+
/**
|
|
218
|
+
* Webpack entry file template type. Select from `'fs'` (File System) or `'rl'` (Read Line).
|
|
219
|
+
* @default 'fs'
|
|
220
|
+
*/
|
|
221
|
+
templateType: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
fs: "fs";
|
|
223
|
+
rl: "rl";
|
|
224
|
+
}>>;
|
|
225
|
+
}, z.core.$strict>>>;
|
|
226
|
+
/**
|
|
227
|
+
* Options exclusive to the `bananass discussion` command.
|
|
228
|
+
*/
|
|
229
|
+
discussion: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
|
|
230
|
+
/**
|
|
231
|
+
* Options exclusive to the `bananass home` command.
|
|
232
|
+
*/
|
|
233
|
+
home: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
|
|
234
|
+
/**
|
|
235
|
+
* Options exclusive to the `bananass info` command.
|
|
236
|
+
*/
|
|
237
|
+
info: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
238
|
+
/**
|
|
239
|
+
* Show all information including Not Found.
|
|
240
|
+
* @default false
|
|
241
|
+
*/
|
|
242
|
+
all: z.ZodOptional<z.ZodBoolean>;
|
|
243
|
+
}, z.core.$strict>>>;
|
|
244
|
+
/**
|
|
245
|
+
* Options exclusive to the `bananass open` command.
|
|
246
|
+
*/
|
|
247
|
+
open: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
|
|
248
|
+
/**
|
|
249
|
+
* Options exclusive to the `bananass repo` command.
|
|
250
|
+
*/
|
|
251
|
+
repo: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
|
|
252
|
+
/**
|
|
253
|
+
* Options exclusive to the `bananass run` command.
|
|
254
|
+
*/
|
|
255
|
+
run: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
|
|
256
|
+
}, z.core.$strict>>;
|
|
257
|
+
/**
|
|
258
|
+
* Baekjoon problem number as a string.
|
|
259
|
+
* Problem number must be an integer greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
|
|
260
|
+
*/
|
|
261
|
+
export const problem: z.ZodString;
|
|
262
|
+
/**
|
|
263
|
+
* Baekjoon problem numbers as a nonempty string array.
|
|
264
|
+
* Each problem number must be an integer greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
|
|
265
|
+
*/
|
|
266
|
+
export const problems: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
267
|
+
/**
|
|
268
|
+
* Input value. Must be a `string` or `undefined`.
|
|
269
|
+
*/
|
|
270
|
+
export const input: z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>;
|
|
271
|
+
/**
|
|
272
|
+
* Output value. Must be a `string`, `number`, or `boolean`.
|
|
273
|
+
* (It can be a primitive type except for `bigint`, `symbol`, `undefined`, and `null`).
|
|
274
|
+
*
|
|
275
|
+
* Output values will be **coerced to a `string` and any trailing whitespace
|
|
276
|
+
* will be removed using `trimEnd()`** when running the `bananass run` command.
|
|
277
|
+
* (This behavior mimics how `console.log` converts values to a `string` before displaying them.)
|
|
278
|
+
*
|
|
279
|
+
* Note that `bigint` is not allowed, as `console.log(BigInt(1))` outputs `1n`,
|
|
280
|
+
* whereas `console.log(String(BigInt(1)))` outputs `1`, which have different representations.
|
|
281
|
+
*/
|
|
282
|
+
export const output: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
283
|
+
/**
|
|
284
|
+
* Testcase object.
|
|
285
|
+
*/
|
|
286
|
+
export const testcase: z.ZodReadonly<z.ZodObject<{
|
|
287
|
+
/**
|
|
288
|
+
* Input value. Must be a `string` or `undefined`.
|
|
289
|
+
*/
|
|
290
|
+
input: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>;
|
|
291
|
+
/**
|
|
292
|
+
* Output value. Must be a `string`, `number`, or `boolean`.
|
|
293
|
+
* (It can be a primitive type except for `bigint`, `symbol`, `undefined`, and `null`).
|
|
294
|
+
*
|
|
295
|
+
* Output values will be **coerced to a `string` and any trailing whitespace
|
|
296
|
+
* will be removed using `trimEnd()`** when running the `bananass run` command.
|
|
297
|
+
* (This behavior mimics how `console.log` converts values to a `string` before displaying them.)
|
|
298
|
+
*
|
|
299
|
+
* Note that `bigint` is not allowed, as `console.log(BigInt(1))` outputs `1n`,
|
|
300
|
+
* whereas `console.log(String(BigInt(1)))` outputs `1`, which have different representations.
|
|
301
|
+
*/
|
|
302
|
+
output: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
303
|
+
}, z.core.$strict>>;
|
|
304
|
+
/**
|
|
305
|
+
* Testcases array.
|
|
306
|
+
*/
|
|
307
|
+
export const testcases: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
308
|
+
/**
|
|
309
|
+
* Input value. Must be a `string` or `undefined`.
|
|
310
|
+
*/
|
|
311
|
+
input: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>;
|
|
312
|
+
/**
|
|
313
|
+
* Output value. Must be a `string`, `number`, or `boolean`.
|
|
314
|
+
* (It can be a primitive type except for `bigint`, `symbol`, `undefined`, and `null`).
|
|
315
|
+
*
|
|
316
|
+
* Output values will be **coerced to a `string` and any trailing whitespace
|
|
317
|
+
* will be removed using `trimEnd()`** when running the `bananass run` command.
|
|
318
|
+
* (This behavior mimics how `console.log` converts values to a `string` before displaying them.)
|
|
319
|
+
*
|
|
320
|
+
* Note that `bigint` is not allowed, as `console.log(BigInt(1))` outputs `1n`,
|
|
321
|
+
* whereas `console.log(String(BigInt(1)))` outputs `1`, which have different representations.
|
|
322
|
+
*/
|
|
323
|
+
output: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
324
|
+
}, z.core.$strict>>>>;
|
|
325
|
+
/**
|
|
326
|
+
* Solution function.
|
|
327
|
+
*/
|
|
328
|
+
export const solution: z.ZodFunction<z.ZodTuple<readonly [z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodUndefined]>>], null>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
329
|
+
/**
|
|
330
|
+
* Bananass configuration object.
|
|
331
|
+
*/
|
|
332
|
+
export type ConfigObject = z.infer<typeof configObject>;
|
|
333
|
+
/**
|
|
334
|
+
* Global browser options.
|
|
335
|
+
*/
|
|
336
|
+
export type ConfigObjectBrowser = z.infer<typeof configObjectBrowser>;
|
|
337
|
+
/**
|
|
338
|
+
* Global console options.
|
|
339
|
+
*/
|
|
340
|
+
export type ConfigObjectConsole = z.infer<typeof configObjectConsole>;
|
|
341
|
+
/**
|
|
342
|
+
* Options exclusive to the `bananass add` command.
|
|
343
|
+
*/
|
|
344
|
+
export type ConfigObjectAdd = z.infer<typeof configObjectAdd>;
|
|
345
|
+
/**
|
|
346
|
+
* Options exclusive to the `bananass bug` command.
|
|
347
|
+
*/
|
|
348
|
+
export type ConfigObjectBug = z.infer<typeof configObjectBug>;
|
|
349
|
+
/**
|
|
350
|
+
* Options exclusive to the `bananass build` command.
|
|
351
|
+
*/
|
|
352
|
+
export type ConfigObjectBuild = z.infer<typeof configObjectBuild>;
|
|
353
|
+
/**
|
|
354
|
+
* Options exclusive to the `bananass discussion` command.
|
|
355
|
+
*/
|
|
356
|
+
export type ConfigObjectDiscussion = z.infer<typeof configObjectDiscussion>;
|
|
357
|
+
/**
|
|
358
|
+
* Options exclusive to the `bananass home` command.
|
|
359
|
+
*/
|
|
360
|
+
export type ConfigObjectHome = z.infer<typeof configObjectHome>;
|
|
361
|
+
/**
|
|
362
|
+
* Options exclusive to the `bananass info` command.
|
|
363
|
+
*/
|
|
364
|
+
export type ConfigObjectInfo = z.infer<typeof configObjectInfo>;
|
|
365
|
+
/**
|
|
366
|
+
* Options exclusive to the `bananass open` command.
|
|
367
|
+
*/
|
|
368
|
+
export type ConfigObjectOpen = z.infer<typeof configObjectOpen>;
|
|
369
|
+
/**
|
|
370
|
+
* Options exclusive to the `bananass repo` command.
|
|
371
|
+
*/
|
|
372
|
+
export type ConfigObjectRepo = z.infer<typeof configObjectRepo>;
|
|
373
|
+
/**
|
|
374
|
+
* Options exclusive to the `bananass run` command.
|
|
375
|
+
*/
|
|
376
|
+
export type ConfigObjectRun = z.infer<typeof configObjectRun>;
|
|
377
|
+
/**
|
|
378
|
+
* Baekjoon problem number as a string.
|
|
379
|
+
* Problem number must be an integer greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
|
|
380
|
+
*/
|
|
381
|
+
export type Problem = z.infer<typeof problem>;
|
|
382
|
+
/**
|
|
383
|
+
* Baekjoon problem numbers as a nonempty string array.
|
|
384
|
+
* Each problem number must be an integer greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
|
|
385
|
+
*/
|
|
386
|
+
export type Problems = z.infer<typeof problems>;
|
|
387
|
+
/**
|
|
388
|
+
* Input value. Must be a `string` or `undefined`.
|
|
389
|
+
*/
|
|
390
|
+
export type Input = z.infer<typeof input>;
|
|
391
|
+
/**
|
|
392
|
+
* Output value. Must be a `string`, `number`, or `boolean`.
|
|
393
|
+
* (It can be a primitive type except for `bigint`, `symbol`, `undefined`, and `null`).
|
|
394
|
+
*
|
|
395
|
+
* Output values will be **coerced to a `string` and any trailing whitespace
|
|
396
|
+
* will be removed using `trimEnd()`** when running the `bananass run` command.
|
|
397
|
+
* (This behavior mimics how `console.log` converts values to a `string` before displaying them.)
|
|
398
|
+
*
|
|
399
|
+
* Note that `bigint` is not allowed, as `console.log(BigInt(1))` outputs `1n`,
|
|
400
|
+
* whereas `console.log(String(BigInt(1)))` outputs `1`, which have different representations.
|
|
401
|
+
*/
|
|
402
|
+
export type Output = z.infer<typeof output>;
|
|
403
|
+
/**
|
|
404
|
+
* Testcase object.
|
|
405
|
+
*/
|
|
406
|
+
export type Testcase = z.infer<typeof testcase>;
|
|
407
|
+
/**
|
|
408
|
+
* Testcases array.
|
|
409
|
+
*/
|
|
410
|
+
export type Testcases = z.infer<typeof testcases>;
|
|
411
|
+
/**
|
|
412
|
+
* Solution function.
|
|
413
|
+
*/
|
|
414
|
+
export type Solution = ReturnType<typeof solution.implement>;
|
|
415
|
+
import * as z from 'zod';
|