bananass 0.6.0 → 0.7.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/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2024-present 루밀LuMir(lumirlumir)
3
+ Copyright (c) 2024-present lumir(lumirlumir)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # 바나나<sup>Bananass</sup>
2
2
 
3
- [![lint](https://img.shields.io/github/actions/workflow/status/lumirlumir/npm-bananass/lint.yml?label=lint&color=fff478&labelColor=333333&logo=github)](https://github.com/lumirlumir/npm-bananass/actions/workflows/lint.yml)
3
+ [![ci](https://img.shields.io/github/actions/workflow/status/lumirlumir/npm-bananass/ci.yml?label=ci&color=fff478&labelColor=333333&logo=github)](https://github.com/lumirlumir/npm-bananass/actions/workflows/ci.yml)
4
4
  [![test](https://img.shields.io/github/actions/workflow/status/lumirlumir/npm-bananass/test.yml?label=test&color=fff478&labelColor=333333&logo=github)](https://github.com/lumirlumir/npm-bananass/actions/workflows/test.yml)
5
- [![test-cross-platform](https://img.shields.io/github/actions/workflow/status/lumirlumir/npm-bananass/test-cross-platform.yml?label=test-cross-platform&color=fff478&labelColor=333333&logo=github)](https://github.com/lumirlumir/npm-bananass/actions/workflows/test-cross-platform.yml)
6
5
  [![Codecov](https://img.shields.io/codecov/c/gh/lumirlumir/npm-bananass?token=2zUCHlMFT3&label=Codecov&color=fff478&labelColor=333333&logo=codecov)](https://codecov.io/gh/lumirlumir/npm-bananass)
7
6
  ![Node Current](https://img.shields.io/node/v/bananass?label=Node&color=fff478&labelColor=333333&logo=node.js)
8
7
 
@@ -31,7 +31,7 @@ export default function configLoader({ cwd, cliConfigObject, defaultConfigObject
31
31
  bug?: Readonly<Record<string, never>> | undefined;
32
32
  build?: Readonly<{
33
33
  clean?: boolean | undefined;
34
- templateType?: "fs" | "rl" | undefined;
34
+ templateType?: "rl" | "fs" | undefined;
35
35
  }> | undefined;
36
36
  discussion?: Readonly<Record<string, never>> | undefined;
37
37
  home?: Readonly<Record<string, never>> | undefined;
@@ -58,7 +58,7 @@ export default function configLoader({ cwd, cliConfigObject, defaultConfigObject
58
58
  bug?: Readonly<Record<string, never>> | undefined;
59
59
  build?: Readonly<{
60
60
  clean?: boolean | undefined;
61
- templateType?: "fs" | "rl" | undefined;
61
+ templateType?: "rl" | "fs" | undefined;
62
62
  }> | undefined;
63
63
  discussion?: Readonly<Record<string, never>> | undefined;
64
64
  home?: Readonly<Record<string, never>> | undefined;
@@ -1,13 +1,16 @@
1
+ /**
2
+ * @import { Problem } from "./types/index.js"
3
+ */
1
4
  /** @satisfies {number} */
2
5
  export const BAEKJOON_PROBLEM_NUMBER_MIN: 1000;
3
6
  /** @satisfies {string} */
4
7
  export const PKG_DESCRIPTION: string;
5
- /** @satisfies {string} */
8
+ /** @type {'bananass'} */
6
9
  export const PKG_NAME: "bananass";
7
10
  /** @satisfies {string} */
8
11
  export const PKG_VERSION: string;
9
12
  /** @satisfies {string} */
10
- export const PKG_AUTHOR: "\uB8E8\uBC00LuMir";
13
+ export const PKG_AUTHOR: "lumir";
11
14
  /** @satisfies {string} */
12
15
  export const URL_HOMEPAGE: string;
13
16
  /** @satisfies {string} */
@@ -23,7 +26,7 @@ export const URL_BOJ_MAIN: "https://www.acmicpc.net";
23
26
  export function URL_BOJ_PROBLEM(problem: Problem): string;
24
27
  /** @satisfies {string} */
25
28
  export const DEFAULT_ENTRY_DIR_NAME: "bananass";
26
- /** @satisfies {`.${name}`} */
29
+ /** @satisfies {'.bananass'} */
27
30
  export const DEFAULT_OUT_DIR_NAME: ".bananass";
28
31
  /** @satisfies {string} */
29
32
  export const DEFAULT_OUT_FILE_EXTENSION: ".cjs";
@@ -54,10 +54,6 @@
54
54
  * Global browser options.
55
55
  */
56
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
57
  browser: z.ZodOptional<z.ZodEnum<{
62
58
  default: "default";
63
59
  chrome: "chrome";
@@ -65,25 +61,13 @@ export const configObjectBrowser: z.ZodReadonly<z.ZodObject<{
65
61
  firefox: "firefox";
66
62
  brave: "brave";
67
63
  }>>;
68
- /**
69
- * Open browser in secret (private or incognito) mode.
70
- * @default false
71
- */
72
64
  secret: z.ZodOptional<z.ZodBoolean>;
73
65
  }, z.core.$strict>>;
74
66
  /**
75
67
  * Global console options.
76
68
  */
77
69
  export const configObjectConsole: z.ZodReadonly<z.ZodObject<{
78
- /**
79
- * Enable debug mode.
80
- * @default false
81
- */
82
70
  debug: z.ZodOptional<z.ZodBoolean>;
83
- /**
84
- * Enable quiet mode.
85
- * @default false
86
- */
87
71
  quiet: z.ZodOptional<z.ZodBoolean>;
88
72
  }, z.core.$strict>>;
89
73
  /**
@@ -98,18 +82,10 @@ export const configObjectBug: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
98
82
  * Options exclusive to the `bananass build` command.
99
83
  */
100
84
  export const configObjectBuild: z.ZodReadonly<z.ZodObject<{
101
- /**
102
- * Clean the output directory before emit.
103
- * @default false
104
- */
105
85
  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
86
  templateType: z.ZodOptional<z.ZodEnum<{
111
- fs: "fs";
112
87
  rl: "rl";
88
+ fs: "fs";
113
89
  }>>;
114
90
  }, z.core.$strict>>;
115
91
  /**
@@ -124,10 +100,6 @@ export const configObjectHome: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
124
100
  * Options exclusive to the `bananass info` command.
125
101
  */
126
102
  export const configObjectInfo: z.ZodReadonly<z.ZodObject<{
127
- /**
128
- * Show all information including Not Found.
129
- * @default false
130
- */
131
103
  all: z.ZodOptional<z.ZodBoolean>;
132
104
  }, z.core.$strict>>;
133
105
  /**
@@ -146,29 +118,10 @@ export const configObjectRun: z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>;
146
118
  * Bananass configuration object.
147
119
  */
148
120
  export const configObject: z.ZodReadonly<z.ZodObject<{
149
- /**
150
- * Current working directory.
151
- * @default findRootDir()
152
- */
153
121
  cwd: z.ZodOptional<z.ZodString>;
154
- /**
155
- * Entry directory name.
156
- * @default 'bananass'
157
- */
158
122
  entryDir: z.ZodOptional<z.ZodString>;
159
- /**
160
- * Output directory name.
161
- * @default '.bananass'
162
- */
163
123
  outDir: z.ZodOptional<z.ZodString>;
164
- /**
165
- * Global browser options.
166
- */
167
124
  browser: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
168
- /**
169
- * Browser name. Select from `'chrome'`, `'edge'`, `'firefox'`, `'brave'`, or `'default'`.
170
- * @default 'default'
171
- */
172
125
  browser: z.ZodOptional<z.ZodEnum<{
173
126
  default: "default";
174
127
  chrome: "chrome";
@@ -176,82 +129,28 @@ export const configObject: z.ZodReadonly<z.ZodObject<{
176
129
  firefox: "firefox";
177
130
  brave: "brave";
178
131
  }>>;
179
- /**
180
- * Open browser in secret (private or incognito) mode.
181
- * @default false
182
- */
183
132
  secret: z.ZodOptional<z.ZodBoolean>;
184
133
  }, z.core.$strict>>>;
185
- /**
186
- * Global console options.
187
- */
188
134
  console: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
189
- /**
190
- * Enable debug mode.
191
- * @default false
192
- */
193
135
  debug: z.ZodOptional<z.ZodBoolean>;
194
- /**
195
- * Enable quiet mode.
196
- * @default false
197
- */
198
136
  quiet: z.ZodOptional<z.ZodBoolean>;
199
137
  }, z.core.$strict>>>;
200
- /**
201
- * Options exclusive to the `bananass add` command.
202
- */
203
138
  add: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
204
- /**
205
- * Options exclusive to the `bananass bug` command.
206
- */
207
139
  bug: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
208
- /**
209
- * Options exclusive to the `bananass build` command.
210
- */
211
140
  build: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
212
- /**
213
- * Clean the output directory before emit.
214
- * @default false
215
- */
216
141
  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
142
  templateType: z.ZodOptional<z.ZodEnum<{
222
- fs: "fs";
223
143
  rl: "rl";
144
+ fs: "fs";
224
145
  }>>;
225
146
  }, z.core.$strict>>>;
226
- /**
227
- * Options exclusive to the `bananass discussion` command.
228
- */
229
147
  discussion: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
230
- /**
231
- * Options exclusive to the `bananass home` command.
232
- */
233
148
  home: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
234
- /**
235
- * Options exclusive to the `bananass info` command.
236
- */
237
149
  info: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
238
- /**
239
- * Show all information including Not Found.
240
- * @default false
241
- */
242
150
  all: z.ZodOptional<z.ZodBoolean>;
243
151
  }, z.core.$strict>>>;
244
- /**
245
- * Options exclusive to the `bananass open` command.
246
- */
247
152
  open: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
248
- /**
249
- * Options exclusive to the `bananass repo` command.
250
- */
251
153
  repo: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
252
- /**
253
- * Options exclusive to the `bananass run` command.
254
- */
255
154
  run: z.ZodOptional<z.ZodReadonly<z.ZodObject<{}, z.core.$strict>>>;
256
155
  }, z.core.$strict>>;
257
156
  /**
@@ -284,42 +183,14 @@ export const output: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean
284
183
  * Testcase object.
285
184
  */
286
185
  export const testcase: z.ZodReadonly<z.ZodObject<{
287
- /**
288
- * Input value. Must be a `string` or `undefined`.
289
- */
290
186
  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
187
  output: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
303
188
  }, z.core.$strict>>;
304
189
  /**
305
190
  * Testcases array.
306
191
  */
307
192
  export const testcases: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
308
- /**
309
- * Input value. Must be a `string` or `undefined`.
310
- */
311
193
  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
194
  output: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
324
195
  }, z.core.$strict>>>>;
325
196
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bananass",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "description": "Baekjoon Framework for JavaScript.🍌",
6
6
  "exports": {
@@ -29,13 +29,13 @@
29
29
  ".": [
30
30
  "./build/core/types/index.d.ts"
31
31
  ],
32
- "./commands": [
32
+ "commands": [
33
33
  "./build/commands/index.d.ts"
34
34
  ],
35
- "./core/constants": [
35
+ "core/constants": [
36
36
  "./build/core/constants.d.ts"
37
37
  ],
38
- "./core/types": [
38
+ "core/types": [
39
39
  "./build/core/types/index.d.ts"
40
40
  ]
41
41
  }
@@ -61,7 +61,8 @@
61
61
  "javascript",
62
62
  "typescript"
63
63
  ],
64
- "author": "루밀LuMir <rpfos@naver.com> (https://github.com/lumirlumir)",
64
+ "author": "lumir <rpfos@naver.com> (https://github.com/lumirlumir)",
65
+ "funding": "https://github.com/sponsors/lumirlumir",
65
66
  "license": "MIT",
66
67
  "homepage": "https://bananass.lumir.page",
67
68
  "repository": {
@@ -80,27 +81,27 @@
80
81
  },
81
82
  "scripts": {
82
83
  "prepublishOnly": "npm run build",
83
- "build": "npx tsc && node ../../scripts/cp.mjs ../../LICENSE.md LICENSE.md ../../README.md README.md",
84
+ "build": "tsc && node ../../scripts/cp.js ../../LICENSE.md LICENSE.md ../../README.md README.md",
84
85
  "test": "npm run test:types && npm run test:unit",
85
86
  "test:types": "tsc -p ./tsconfig.test.json",
86
87
  "test:unit": "node --experimental-test-module-mocks --test",
87
88
  "dev": "node src/cli.js"
88
89
  },
89
90
  "dependencies": {
90
- "@babel/core": "^7.29.0",
91
- "@babel/plugin-transform-modules-commonjs": "^7.28.6",
92
- "@babel/plugin-transform-typescript": "^7.28.6",
93
- "@babel/preset-env": "^7.29.0",
94
- "babel-loader": "^10.0.0",
95
- "bananass-utils-console": "^0.6.0",
96
- "commander": "^14.0.2",
97
- "defu": "^6.1.4",
98
- "enhanced-resolve": "^5.18.3",
91
+ "@babel/core": "^7.29.7",
92
+ "@babel/plugin-transform-modules-commonjs": "^7.29.7",
93
+ "@babel/plugin-transform-typescript": "^7.29.7",
94
+ "@babel/preset-env": "^7.29.7",
95
+ "babel-loader": "^10.1.1",
96
+ "bananass-utils-console": "^0.7.0",
97
+ "commander": "^14.0.3",
98
+ "defu": "^6.1.7",
99
+ "enhanced-resolve": "^5.21.0",
99
100
  "envinfo": "^7.21.0",
100
- "jiti": "^2.6.1",
101
+ "jiti": "^2.7.0",
101
102
  "open": "^10.2.0",
102
- "webpack": "^5.105.1",
103
- "zod": "^4.3.5"
103
+ "webpack": "^5.107.1",
104
+ "zod": "^4.4.2"
104
105
  },
105
106
  "devDependencies": {
106
107
  "@types/babel__core": "^7.20.5",
@@ -6,7 +6,7 @@
6
6
  // Import
7
7
  // --------------------------------------------------------------------------------
8
8
 
9
- import { createRequire } from 'node:module';
9
+ import pkg from '../../package.json' with { type: 'json' };
10
10
 
11
11
  // --------------------------------------------------------------------------------
12
12
  // Typedefs
@@ -16,15 +16,6 @@ import { createRequire } from 'node:module';
16
16
  * @import { Problem } from "./types/index.js"
17
17
  */
18
18
 
19
- // --------------------------------------------------------------------------------
20
- // Declaration
21
- // --------------------------------------------------------------------------------
22
-
23
- /** @type {{ description: string, homepage: string, name: 'bananass', version: string }} */
24
- const { description, homepage, name, version } = createRequire(import.meta.url)(
25
- '../../package.json',
26
- );
27
-
28
19
  // --------------------------------------------------------------------------------
29
20
  // Export
30
21
  // --------------------------------------------------------------------------------
@@ -42,16 +33,16 @@ export const BAEKJOON_PROBLEM_NUMBER_MIN = 1_000;
42
33
  // #region String
43
34
 
44
35
  /** @satisfies {string} */
45
- export const PKG_DESCRIPTION = description;
46
- /** @satisfies {string} */
47
- export const PKG_NAME = name;
36
+ export const PKG_DESCRIPTION = pkg.description;
37
+ /** @type {'bananass'} */
38
+ export const PKG_NAME = /** @type {'bananass'} */ (pkg.name);
48
39
  /** @satisfies {string} */
49
- export const PKG_VERSION = version;
40
+ export const PKG_VERSION = pkg.version;
50
41
  /** @satisfies {string} */
51
- export const PKG_AUTHOR = '루밀LuMir';
42
+ export const PKG_AUTHOR = 'lumir';
52
43
 
53
44
  /** @satisfies {string} */
54
- export const URL_HOMEPAGE = homepage;
45
+ export const URL_HOMEPAGE = pkg.homepage;
55
46
  /** @satisfies {string} */
56
47
  export const URL_NPM = 'https://www.npmjs.com';
57
48
  /** @satisfies {string} */
@@ -66,9 +57,9 @@ export const URL_BOJ_MAIN = 'https://www.acmicpc.net';
66
57
  export const URL_BOJ_PROBLEM = problem => `${URL_BOJ_MAIN}/problem/${problem}`;
67
58
 
68
59
  /** @satisfies {string} */
69
- export const DEFAULT_ENTRY_DIR_NAME = name;
70
- /** @satisfies {`.${name}`} */
71
- export const DEFAULT_OUT_DIR_NAME = `.${name}`;
60
+ export const DEFAULT_ENTRY_DIR_NAME = PKG_NAME;
61
+ /** @satisfies {'.bananass'} */
62
+ export const DEFAULT_OUT_DIR_NAME = `.${PKG_NAME}`;
72
63
  /** @satisfies {string} */
73
64
  export const DEFAULT_OUT_FILE_EXTENSION = '.cjs';
74
65