bananass 0.4.0 → 0.4.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 CHANGED
@@ -142,7 +142,7 @@ npm create bananass@latest
142
142
 
143
143
  ## 버전 정책<sup>Versioning</sup>
144
144
 
145
- 바나나 프레임워크는 [유의적 버전 정책<sup>Sementic Versioning</sup>](https://semver.org/lang/ko/)을 따릅니다. 모든 릴리즈 버전은 `주(MAJOR).부(MINOR).수(PATCH)` 형식을 따릅니다.
145
+ 바나나 프레임워크는 [유의적 버전 정책<sup>Semantic Versioning</sup>](https://semver.org/lang/ko/)을 따릅니다. 모든 릴리즈 버전은 `주(MAJOR).부(MINOR).수(PATCH)` 형식을 따릅니다.
146
146
 
147
147
  ## 기여자 행동 강령 규약<sup>Code of Conduct</sup>
148
148
 
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * @fileoverview `argument`s used in `commander` for `bananass` CLI.
3
3
  */
4
- /** @type {[string, string]} */
5
- export const problems: [string, string];
4
+ /** @satisfies {[string, string]} */
5
+ export const problems: ["<problems...>", "baekjoon problem numbers"];
@@ -1,16 +1,16 @@
1
- /** @type {string} */
2
- export const bug: string;
3
- /** @type {string} */
1
+ /** @satisfies {string} */
2
+ export const bug: "open the github issues in a browser";
3
+ /** @satisfies {string} */
4
4
  export const build: string;
5
- /** @type {string} */
6
- export const discussion: string;
7
- /** @type {string} */
8
- export const home: string;
9
- /** @type {string} */
10
- export const info: string;
11
- /** @type {string} */
12
- export const open: string;
13
- /** @type {string} */
14
- export const repo: string;
15
- /** @type {string} */
16
- export const run: string;
5
+ /** @satisfies {string} */
6
+ export const discussion: "open the github discussions in a browser";
7
+ /** @satisfies {string} */
8
+ export const home: "open the official documentation homepage in a browser";
9
+ /** @satisfies {string} */
10
+ export const info: "print relevant details about the current system which can be used to report bugs";
11
+ /** @satisfies {string} */
12
+ export const open: "open the given baekjoon problem numbers in a browser";
13
+ /** @satisfies {string} */
14
+ export const repo: "open the github repository in a browser";
15
+ /** @satisfies {string} */
16
+ export const run: "run generated testcases and compare them with the expected outputs";
@@ -1,20 +1,20 @@
1
- /** @type {[string, string]} */
2
- export const cwd: [string, string];
3
- /** @type {[string, string]} */
4
- export const entryDir: [string, string];
5
- /** @type {[string, string]} */
6
- export const outDir: [string, string];
7
- /** @type {[string, string]} */
8
- export const browser: [string, string];
9
- /** @type {[string, string]} */
10
- export const secret: [string, string];
11
- /** @type {[string, string]} */
12
- export const debug: [string, string];
13
- /** @type {[string, string]} */
14
- export const quiet: [string, string];
15
- /** @type {[string, string]} */
16
- export const clean: [string, string];
17
- /** @type {[string, string]} */
18
- export const templateType: [string, string];
19
- /** @type {[string, string]} */
20
- export const all: [string, string];
1
+ /** @satisfies {[string, string]} */
2
+ export const cwd: ["-c, --cwd <dir>", `current working directory ${string}`];
3
+ /** @satisfies {[string, string]} */
4
+ export const entryDir: ["-e, --entry-dir <dir>", `entry directory name ${string}`];
5
+ /** @satisfies {[string, string]} */
6
+ export const outDir: ["-o, --out-dir <dir>", `output directory name ${string}`];
7
+ /** @satisfies {[string, string]} */
8
+ export const browser: ["-b, --browser <browser>", `browser name. select from \`chrome\`, \`edge\`, \`firefox\`, \`brave\`, or \`default\` ${string}`];
9
+ /** @satisfies {[string, string]} */
10
+ export const secret: ["-s, --secret", `open browser in secret (private or incognito) mode ${string}`];
11
+ /** @satisfies {[string, string]} */
12
+ export const debug: ["-d, --debug", `enable debug mode ${string}`];
13
+ /** @satisfies {[string, string]} */
14
+ export const quiet: ["-q, --quiet", `enable quiet mode ${string}`];
15
+ /** @satisfies {[string, string]} */
16
+ export const clean: ["-C, --clean", `clean the output directory before emit ${string}`];
17
+ /** @satisfies {[string, string]} */
18
+ export const templateType: ["-t, --template-type <type>", `webpack entry file template type. select from \`fs\` (file system) or \`rl\` (read line) ${string}`];
19
+ /** @satisfies {[string, string]} */
20
+ export const all: ["-a, --all", `show all information including not found ${string}`];
@@ -1,21 +1,49 @@
1
- declare const _default: {
2
- cwd: string;
3
- entryDir: string;
4
- outDir: string;
5
- browser: ConfigObjectBrowser;
6
- console: ConfigObjectConsole;
7
- add: object;
8
- bug: object;
9
- build: ConfigObjectBuild;
10
- discussion: object;
11
- home: object;
12
- info: ConfigObjectInfo;
13
- open: object;
14
- repo: object;
15
- run: object;
16
- };
1
+ declare namespace _default {
2
+ export let cwd: string;
3
+ export { DEFAULT_ENTRY_DIR_NAME as entryDir };
4
+ export { DEFAULT_OUT_DIR_NAME as outDir };
5
+ export { browser };
6
+ export { console };
7
+ export { add };
8
+ export { bug };
9
+ export { build };
10
+ export { discussion };
11
+ export { home };
12
+ export { info };
13
+ export { open };
14
+ export { repo };
15
+ export { run };
16
+ }
17
17
  export default _default;
18
- import type { ConfigObjectBrowser } from '../../types.js';
19
- import type { ConfigObjectConsole } from '../../types.js';
20
- import type { ConfigObjectBuild } from '../../types.js';
21
- import type { ConfigObjectInfo } from '../../types.js';
18
+ import { DEFAULT_ENTRY_DIR_NAME } from '../../constants.js';
19
+ import { DEFAULT_OUT_DIR_NAME } from '../../constants.js';
20
+ declare namespace browser {
21
+ let browser_1: "default";
22
+ export { browser_1 as browser };
23
+ export let secret: false;
24
+ }
25
+ declare namespace console {
26
+ let debug: false;
27
+ let quiet: false;
28
+ }
29
+ /** @satisfies {ConfigObjectAdd} */
30
+ declare const add: {};
31
+ /** @satisfies {ConfigObjectBug} */
32
+ declare const bug: {};
33
+ declare namespace build {
34
+ let clean: false;
35
+ let templateType: "fs";
36
+ }
37
+ /** @satisfies {ConfigObjectDiscussion} */
38
+ declare const discussion: {};
39
+ /** @satisfies {ConfigObjectHome} */
40
+ declare const home: {};
41
+ declare namespace info {
42
+ let all: false;
43
+ }
44
+ /** @satisfies {ConfigObjectOpen} */
45
+ declare const open: {};
46
+ /** @satisfies {ConfigObjectRepo} */
47
+ declare const repo: {};
48
+ /** @satisfies {ConfigObjectRun} */
49
+ declare const run: {};
@@ -1,38 +1,39 @@
1
+ /** @satisfies {number} */
1
2
  export const BAEKJOON_PROBLEM_NUMBER_MIN: 1000;
2
- /** @type {string} */
3
+ /** @satisfies {string} */
3
4
  export const PKG_DESCRIPTION: string;
4
- /** @type {string} */
5
- export const PKG_NAME: string;
6
- /** @type {string} */
5
+ /** @satisfies {string} */
6
+ export const PKG_NAME: "bananass";
7
+ /** @satisfies {string} */
7
8
  export const PKG_VERSION: string;
8
- /** @type {string} */
9
- export const PKG_AUTHOR: string;
10
- /** @type {string} */
9
+ /** @satisfies {string} */
10
+ export const PKG_AUTHOR: "\uB8E8\uBC00LuMir";
11
+ /** @satisfies {string} */
11
12
  export const URL_HOMEPAGE: string;
12
- /** @type {string} */
13
- export const URL_NPM: string;
14
- /** @type {string} */
15
- export const URL_GITHUB_REPO: string;
16
- /** @type {string} */
17
- export const URL_GITHUB_ISSUES: string;
18
- /** @type {string} */
19
- export const URL_GITHUB_DISCUSSIONS: string;
20
- /** @type {string} */
21
- export const URL_BOJ_MAIN: string;
13
+ /** @satisfies {string} */
14
+ export const URL_NPM: "https://www.npmjs.com";
15
+ /** @satisfies {string} */
16
+ export const URL_GITHUB_REPO: "https://github.com/lumirlumir/npm-bananass";
17
+ /** @satisfies {string} */
18
+ export const URL_GITHUB_ISSUES: "https://github.com/lumirlumir/npm-bananass/issues";
19
+ /** @satisfies {string} */
20
+ export const URL_GITHUB_DISCUSSIONS: "https://github.com/lumirlumir/npm-bananass/discussions";
21
+ /** @satisfies {string} */
22
+ export const URL_BOJ_MAIN: "https://www.acmicpc.net";
22
23
  export function URL_BOJ_PROBLEM(problem: Problem): string;
23
- /** @type {string} */
24
- export const DEFAULT_ENTRY_DIR_NAME: string;
25
- /** @type {string} */
26
- export const DEFAULT_OUT_DIR_NAME: string;
27
- /** @type {string} */
28
- export const DEFAULT_OUT_FILE_EXTENSION: string;
24
+ /** @satisfies {string} */
25
+ export const DEFAULT_ENTRY_DIR_NAME: "bananass";
26
+ /** @satisfies {`.${name}`} */
27
+ export const DEFAULT_OUT_DIR_NAME: ".bananass";
28
+ /** @satisfies {string} */
29
+ export const DEFAULT_OUT_FILE_EXTENSION: ".cjs";
29
30
  /** @satisfies {string} */
30
31
  export const NODE_VERSION_BAEKJOON: "16.13.1";
31
32
  /** @satisfies {string} */
32
33
  export const NODE_VERSION_CODEFORCES: "15.8.0";
33
- /** @type {string} */
34
+ /** @satisfies {string} */
34
35
  export const WEBPACK_BANNER: string;
35
- export const BANANASS_PKG_NAMES: string[];
36
- export const SUPPORTED_SOLUTION_FILE_EXTENSIONS: string[];
37
- export const SUPPORTED_CONFIG_FILE_NAMES: string[];
36
+ export const BANANASS_PKG_NAMES: readonly ["bananass", "bananass-utils-console", "create-bananass", "eslint-config-bananass", "prettier-config-bananass"];
37
+ export const SUPPORTED_SOLUTION_FILE_EXTENSIONS: readonly [".js", ".mjs", ".cjs", ".ts", ".mts", ".cts"];
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")[];
38
39
  import type { Problem } from "./types.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bananass",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Baekjoon Framework for JavaScript.🍌",
6
6
  "exports": {
@@ -92,24 +92,24 @@
92
92
  "dev": "node src/cli.js"
93
93
  },
94
94
  "dependencies": {
95
- "@babel/core": "^7.28.0",
95
+ "@babel/core": "^7.28.4",
96
96
  "@babel/plugin-transform-modules-commonjs": "^7.27.1",
97
97
  "@babel/plugin-transform-typescript": "^7.28.0",
98
- "@babel/preset-env": "^7.28.0",
98
+ "@babel/preset-env": "^7.28.3",
99
99
  "babel-loader": "^10.0.0",
100
- "bananass-utils-console": "^0.4.0",
101
- "commander": "^14.0.0",
100
+ "bananass-utils-console": "^0.4.1",
101
+ "commander": "^14.0.1",
102
102
  "defu": "^6.1.4",
103
103
  "enhanced-resolve": "^5.18.3",
104
104
  "envinfo": "^7.14.0",
105
105
  "jiti": "^2.5.1",
106
106
  "open": "^10.2.0",
107
107
  "superstruct": "^2.0.2",
108
- "webpack": "^5.101.0"
108
+ "webpack": "^5.101.3"
109
109
  },
110
110
  "devDependencies": {
111
111
  "@types/babel__core": "^7.20.5",
112
112
  "@types/envinfo": "^7.8.4"
113
113
  },
114
- "gitHead": "9ef4b5d85c599fd179cd90de4619668d6ee6867f"
114
+ "gitHead": "8bf9720224d0ee59eedd738ef3da1c8713520701"
115
115
  }
@@ -147,7 +147,7 @@ export default async function build(problems, configObject = dco) {
147
147
 
148
148
  /** @see https://webpack.js.org/configuration/resolve/#resolveextensions */
149
149
  resolve: {
150
- extensions: SUPPORTED_SOLUTION_FILE_EXTENSIONS,
150
+ extensions: [...SUPPORTED_SOLUTION_FILE_EXTENSIONS],
151
151
  },
152
152
 
153
153
  /** @see https://webpack.js.org/concepts/#entry */
@@ -88,8 +88,8 @@ export default async function info(configObject = dco) {
88
88
  ],
89
89
  // @ts-expect-error -- TODO: Ain't yet supported by `@types/envinfo`.
90
90
  Monorepos: ['Lerna', 'Yarn Workspaces'],
91
- npmPackages: BANANASS_PKG_NAMES,
92
- npmGlobalPackages: BANANASS_PKG_NAMES,
91
+ npmPackages: [...BANANASS_PKG_NAMES],
92
+ npmGlobalPackages: [...BANANASS_PKG_NAMES],
93
93
  },
94
94
  { showNotFound: all },
95
95
  );
@@ -6,5 +6,8 @@
6
6
  // Export
7
7
  // --------------------------------------------------------------------------------
8
8
 
9
- /** @type {[string, string]} */
10
- export const problems = ['<problems...>', 'baekjoon problem numbers'];
9
+ /** @satisfies {[string, string]} */
10
+ export const problems = /** @type {const} */ ([
11
+ '<problems...>',
12
+ 'baekjoon problem numbers',
13
+ ]);
@@ -12,20 +12,20 @@ import { defaultConfigObject as dco } from '../conf/index.js';
12
12
  // Export
13
13
  // --------------------------------------------------------------------------------
14
14
 
15
- /** @type {string} */
15
+ /** @satisfies {string} */
16
16
  export const bug = 'open the github issues in a browser';
17
- /** @type {string} */
17
+ /** @satisfies {string} */
18
18
  export const build = `build and create bundled files using webpack and babel from the \`${dco.entryDir}\` directory and outputs them to the \`${dco.outDir}\` directory`;
19
- /** @type {string} */
19
+ /** @satisfies {string} */
20
20
  export const discussion = 'open the github discussions in a browser';
21
- /** @type {string} */
21
+ /** @satisfies {string} */
22
22
  export const home = 'open the official documentation homepage in a browser';
23
- /** @type {string} */
23
+ /** @satisfies {string} */
24
24
  export const info =
25
25
  'print relevant details about the current system which can be used to report bugs';
26
- /** @type {string} */
26
+ /** @satisfies {string} */
27
27
  export const open = 'open the given baekjoon problem numbers in a browser';
28
- /** @type {string} */
28
+ /** @satisfies {string} */
29
29
  export const repo = 'open the github repository in a browser';
30
- /** @type {string} */
30
+ /** @satisfies {string} */
31
31
  export const run = 'run generated testcases and compare them with the expected outputs';
@@ -23,65 +23,65 @@ function formatDefaultValue(defaultValue) {
23
23
  // Export
24
24
  // --------------------------------------------------------------------------------
25
25
 
26
- /** @type {[string, string]} */
27
- export const cwd = [
26
+ /** @satisfies {[string, string]} */
27
+ export const cwd = /** @type {const} */ ([
28
28
  '-c, --cwd <dir>',
29
29
  `current working directory ${formatDefaultValue(dco.cwd)}`,
30
- ];
31
- /** @type {[string, string]} */
32
- export const entryDir = [
30
+ ]);
31
+ /** @satisfies {[string, string]} */
32
+ export const entryDir = /** @type {const} */ ([
33
33
  '-e, --entry-dir <dir>',
34
34
  `entry directory name ${formatDefaultValue(dco.entryDir)}`,
35
- ];
36
- /** @type {[string, string]} */
37
- export const outDir = [
35
+ ]);
36
+ /** @satisfies {[string, string]} */
37
+ export const outDir = /** @type {const} */ ([
38
38
  '-o, --out-dir <dir>',
39
39
  `output directory name ${formatDefaultValue(dco.outDir)}`,
40
- ];
40
+ ]);
41
41
 
42
42
  /* Global */
43
43
 
44
44
  // browser
45
- /** @type {[string, string]} */
46
- export const browser = [
45
+ /** @satisfies {[string, string]} */
46
+ export const browser = /** @type {const} */ ([
47
47
  '-b, --browser <browser>',
48
48
  `browser name. select from \`chrome\`, \`edge\`, \`firefox\`, \`brave\`, or \`default\` ${formatDefaultValue(dco.browser.browser)}`,
49
- ];
50
- /** @type {[string, string]} */
51
- export const secret = [
49
+ ]);
50
+ /** @satisfies {[string, string]} */
51
+ export const secret = /** @type {const} */ ([
52
52
  '-s, --secret',
53
53
  `open browser in secret (private or incognito) mode ${formatDefaultValue(dco.browser.secret)}`,
54
- ];
54
+ ]);
55
55
 
56
56
  // console
57
- /** @type {[string, string]} */
58
- export const debug = [
57
+ /** @satisfies {[string, string]} */
58
+ export const debug = /** @type {const} */ ([
59
59
  '-d, --debug',
60
60
  `enable debug mode ${formatDefaultValue(dco.console.debug)}`,
61
- ];
62
- /** @type {[string, string]} */
63
- export const quiet = [
61
+ ]);
62
+ /** @satisfies {[string, string]} */
63
+ export const quiet = /** @type {const} */ ([
64
64
  '-q, --quiet',
65
65
  `enable quiet mode ${formatDefaultValue(dco.console.quiet)}`,
66
- ];
66
+ ]);
67
67
 
68
68
  /* Exclusive */
69
69
 
70
70
  // build
71
- /** @type {[string, string]} */
72
- export const clean = [
71
+ /** @satisfies {[string, string]} */
72
+ export const clean = /** @type {const} */ ([
73
73
  '-C, --clean',
74
74
  `clean the output directory before emit ${formatDefaultValue(dco.build.clean)}`,
75
- ];
76
- /** @type {[string, string]} */
77
- export const templateType = [
75
+ ]);
76
+ /** @satisfies {[string, string]} */
77
+ export const templateType = /** @type {const} */ ([
78
78
  '-t, --template-type <type>',
79
79
  `webpack entry file template type. select from \`fs\` (file system) or \`rl\` (read line) ${formatDefaultValue(dco.build.templateType)}`,
80
- ];
80
+ ]);
81
81
 
82
82
  // info
83
- /** @type {[string, string]} */
84
- export const all = [
83
+ /** @satisfies {[string, string]} */
84
+ export const all = /** @type {const} */ ([
85
85
  '-a, --all',
86
86
  `show all information including not found ${formatDefaultValue(dco.info.all)}`,
87
- ];
87
+ ]);
@@ -61,7 +61,7 @@ export default async function configLoader({
61
61
 
62
62
  const configFileConfigObject =
63
63
  configFilePath === null
64
- ? {}
64
+ ? /** @type {ConfigObject} */ ({})
65
65
  : /** @type {ConfigObject} */ (
66
66
  await jiti.import(configFilePath, { default: true })
67
67
  );
@@ -34,64 +34,68 @@ import { DEFAULT_ENTRY_DIR_NAME, DEFAULT_OUT_DIR_NAME } from '../../constants.js
34
34
  // Declarations
35
35
  // --------------------------------------------------------------------------------
36
36
 
37
+ // --------------------------------------------------------------------------------
37
38
  // #region Global
38
39
 
39
- /** @type {ConfigObjectBrowser} */
40
- const browser = {
40
+ /** @satisfies {ConfigObjectBrowser} */
41
+ const browser = /** @type {const} */ ({
41
42
  browser: 'default',
42
43
  secret: false,
43
- };
44
+ });
44
45
 
45
- /** @type {ConfigObjectConsole} */
46
- const console = {
46
+ /** @satisfies {ConfigObjectConsole} */
47
+ const console = /** @type {const} */ ({
47
48
  debug: false,
48
49
  quiet: false,
49
- };
50
+ });
50
51
 
51
52
  // #endregion Global
53
+ // --------------------------------------------------------------------------------
52
54
 
55
+ // --------------------------------------------------------------------------------
53
56
  // #region Exclusive
54
57
 
55
- /** @type {ConfigObjectAdd} */
56
- const add = {};
58
+ /** @satisfies {ConfigObjectAdd} */
59
+ const add = /** @type {const} */ ({});
57
60
 
58
- /** @type {ConfigObjectBug} */
59
- const bug = {};
61
+ /** @satisfies {ConfigObjectBug} */
62
+ const bug = /** @type {const} */ ({});
60
63
 
61
- /** @type {ConfigObjectBuild} */
62
- const build = {
64
+ /** @satisfies {ConfigObjectBuild} */
65
+ const build = /** @type {const} */ ({
63
66
  clean: false,
64
67
  templateType: 'fs',
65
- };
68
+ });
66
69
 
67
- /** @type {ConfigObjectDiscussion} */
68
- const discussion = {};
70
+ /** @satisfies {ConfigObjectDiscussion} */
71
+ const discussion = /** @type {const} */ ({});
69
72
 
70
- /** @type {ConfigObjectHome} */
71
- const home = {};
73
+ /** @satisfies {ConfigObjectHome} */
74
+ const home = /** @type {const} */ ({});
72
75
 
73
- /** @type {ConfigObjectInfo} */
74
- const info = {
76
+ /** @satisfies {ConfigObjectInfo} */
77
+ const info = /** @type {const} */ ({
75
78
  all: false,
76
- };
79
+ });
77
80
 
78
- /** @type {ConfigObjectOpen} */
79
- const open = {};
81
+ /** @satisfies {ConfigObjectOpen} */
82
+ const open = /** @type {const} */ ({});
80
83
 
81
- /** @type {ConfigObjectRepo} */
82
- const repo = {};
84
+ /** @satisfies {ConfigObjectRepo} */
85
+ const repo = /** @type {const} */ ({});
83
86
 
84
- /** @type {ConfigObjectRun} */
85
- const run = {};
87
+ /** @satisfies {ConfigObjectRun} */
88
+ const run = /** @type {const} */ ({});
86
89
 
87
90
  // #endregion Exclusive
91
+ // --------------------------------------------------------------------------------
88
92
 
89
93
  // --------------------------------------------------------------------------------
90
94
  // Export
91
95
  // --------------------------------------------------------------------------------
92
96
 
93
- /** @type {ConfigObject} */
94
- export default {
97
+ /** @satisfies {ConfigObject} */
98
+ export default /** @type {const} */ ({
95
99
  cwd: findRootDir(),
96
100
  entryDir: DEFAULT_ENTRY_DIR_NAME,
97
101
  outDir: DEFAULT_OUT_DIR_NAME,
@@ -108,4 +112,4 @@ export default {
108
112
  open,
109
113
  repo,
110
114
  run,
111
- };
115
+ });
@@ -20,6 +20,7 @@ import { createRequire } from 'node:module';
20
20
  // Declaration
21
21
  // --------------------------------------------------------------------------------
22
22
 
23
+ /** @type {{ description: string, homepage: string, name: 'bananass', version: string }} */
23
24
  const { description, homepage, name, version } = createRequire(import.meta.url)(
24
25
  '../../package.json',
25
26
  );
@@ -28,45 +29,47 @@ const { description, homepage, name, version } = createRequire(import.meta.url)(
28
29
  // Export
29
30
  // --------------------------------------------------------------------------------
30
31
 
32
+ // --------------------------------------------------------------------------------
31
33
  // #region Number
32
34
 
35
+ /** @satisfies {number} */
33
36
  export const BAEKJOON_PROBLEM_NUMBER_MIN = 1_000;
34
37
 
35
38
  // #endregion Number
36
-
37
39
  // --------------------------------------------------------------------------------
38
40
 
41
+ // --------------------------------------------------------------------------------
39
42
  // #region String
40
43
 
41
- /** @type {string} */
44
+ /** @satisfies {string} */
42
45
  export const PKG_DESCRIPTION = description;
43
- /** @type {string} */
46
+ /** @satisfies {string} */
44
47
  export const PKG_NAME = name;
45
- /** @type {string} */
48
+ /** @satisfies {string} */
46
49
  export const PKG_VERSION = version;
47
- /** @type {string} */
50
+ /** @satisfies {string} */
48
51
  export const PKG_AUTHOR = '루밀LuMir';
49
52
 
50
- /** @type {string} */
53
+ /** @satisfies {string} */
51
54
  export const URL_HOMEPAGE = homepage;
52
- /** @type {string} */
55
+ /** @satisfies {string} */
53
56
  export const URL_NPM = 'https://www.npmjs.com';
54
- /** @type {string} */
57
+ /** @satisfies {string} */
55
58
  export const URL_GITHUB_REPO = 'https://github.com/lumirlumir/npm-bananass';
56
- /** @type {string} */
59
+ /** @satisfies {string} */
57
60
  export const URL_GITHUB_ISSUES = `${URL_GITHUB_REPO}/issues`;
58
- /** @type {string} */
61
+ /** @satisfies {string} */
59
62
  export const URL_GITHUB_DISCUSSIONS = `${URL_GITHUB_REPO}/discussions`;
60
- /** @type {string} */
63
+ /** @satisfies {string} */
61
64
  export const URL_BOJ_MAIN = 'https://www.acmicpc.net';
62
65
  /** @param {Problem} problem */
63
66
  export const URL_BOJ_PROBLEM = problem => `${URL_BOJ_MAIN}/problem/${problem}`;
64
67
 
65
- /** @type {string} */
68
+ /** @satisfies {string} */
66
69
  export const DEFAULT_ENTRY_DIR_NAME = name;
67
- /** @type {string} */
70
+ /** @satisfies {`.${name}`} */
68
71
  export const DEFAULT_OUT_DIR_NAME = `.${name}`;
69
- /** @type {string} */
72
+ /** @satisfies {string} */
70
73
  export const DEFAULT_OUT_FILE_EXTENSION = '.cjs';
71
74
 
72
75
  /** @satisfies {string} */
@@ -74,7 +77,7 @@ export const NODE_VERSION_BAEKJOON = '16.13.1';
74
77
  /** @satisfies {string} */
75
78
  export const NODE_VERSION_CODEFORCES = '15.8.0';
76
79
 
77
- /** @type {string} */
80
+ /** @satisfies {string} */
78
81
  export const WEBPACK_BANNER = `
79
82
  /**
80
83
  * This file was generated using the Baekjoon Framework for JavaScript 'Bananass🍌'
@@ -90,30 +93,31 @@ export const WEBPACK_BANNER = `
90
93
  `.trim();
91
94
 
92
95
  // #endregion String
93
-
94
96
  // --------------------------------------------------------------------------------
95
97
 
98
+ // --------------------------------------------------------------------------------
96
99
  // #region Array
97
100
 
98
- export const BANANASS_PKG_NAMES = [
101
+ export const BANANASS_PKG_NAMES = /** @type {const} */ ([
99
102
  'bananass',
100
103
  'bananass-utils-console',
101
104
  'create-bananass',
102
105
  'eslint-config-bananass',
103
106
  'prettier-config-bananass',
104
- ];
107
+ ]);
105
108
 
106
- export const SUPPORTED_SOLUTION_FILE_EXTENSIONS = [
109
+ export const SUPPORTED_SOLUTION_FILE_EXTENSIONS = /** @type {const} */ ([
107
110
  '.js',
108
111
  '.mjs',
109
112
  '.cjs',
110
113
  '.ts',
111
114
  '.mts',
112
115
  '.cts',
113
- ];
116
+ ]);
114
117
 
115
118
  export const SUPPORTED_CONFIG_FILE_NAMES = SUPPORTED_SOLUTION_FILE_EXTENSIONS.map(
116
- ext => `${PKG_NAME}.config${ext}`,
119
+ ext => /** @type {const} */ (`${PKG_NAME}.config${ext}`),
117
120
  );
118
121
 
119
122
  // #endregion Array
123
+ // --------------------------------------------------------------------------------
@@ -34,6 +34,7 @@ export default function findRootDir() {
34
34
  const path = process.cwd();
35
35
  if (fs.existsSync(join(path, PACKAGE_JSON))) return path;
36
36
 
37
+ /** @type {string} */
37
38
  let pathFallback;
38
39
  try {
39
40
  pathFallback = resolve(
@@ -17,7 +17,7 @@ import { SUPPORTED_SOLUTION_FILE_EXTENSIONS } from '../../constants.js';
17
17
  * Webpack resolve using `enhanced-resolve` to resolve module paths.
18
18
  */
19
19
  const webpackResolve = enhancedResolve.create({
20
- extensions: SUPPORTED_SOLUTION_FILE_EXTENSIONS,
20
+ extensions: [...SUPPORTED_SOLUTION_FILE_EXTENSIONS],
21
21
  });
22
22
 
23
23
  // --------------------------------------------------------------------------------