Skip to content

Commit 9de5a98

Browse files
committed
fix: fix bundle npm script
- fix bundle npm script - add new cli option: banner, ext-kind, templates - remove unused files - add `prettier-plugin-organize-imports` on pretter processing
1 parent d135b2c commit 9de5a98

16 files changed

+94
-118
lines changed

package.json

+6-9
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
"url": "git+https://github.com/imjuni/fast-maker.git"
4343
},
4444
"bin": {
45-
"fast-maker": "dist/cli.js"
45+
"fast-maker": "dist/cjs/cli.cjs"
4646
},
4747
"private": false,
4848
"author": "ByungJoon Lee",
4949
"license": "MIT",
50-
"main": "dist/cjs/fast-maker.js",
51-
"module": "dist/esm/fast-maker.js",
52-
"types": "dist/esm/fast-maker.d.ts",
50+
"main": "dist/cjs/index.cjs",
51+
"module": "dist/esm/index.,js",
52+
"types": "dist/types/index.d.ts",
5353
"exports": {
5454
".": {
5555
"require": {
@@ -74,7 +74,6 @@
7474
"@rollup/plugin-node-resolve": "^15.0.1",
7575
"@tsconfig/node18": "^18.2.2",
7676
"@types/cli-progress": "^3.11.0",
77-
"@types/figlet": "^1.5.5",
7877
"@types/inquirer": "^9.0.1",
7978
"@types/minimist": "^1.2.2",
8079
"@types/node": "^18.15.3",
@@ -104,12 +103,12 @@
104103
"lint-staged": "^15.2.0",
105104
"npm-run-all": "^4.1.5",
106105
"prettier-eslint": "^16.2.0",
107-
"prettier-plugin-organize-imports": "^3.2.2",
108106
"read-pkg": "^5.2.0",
109107
"rimraf": "^5.0.5",
110108
"rollup": "^4.9.1",
111109
"rollup-plugin-dts": "^6.1.0",
112110
"ts-node": "^10.9.1",
111+
"tsc-alias": "^1.8.8",
113112
"tsconfig-paths": "^4.1.2",
114113
"tslib": "^2.5.0",
115114
"typescript": "^5.3.3",
@@ -119,7 +118,6 @@
119118
"dependencies": {
120119
"@maeum/cli-logo": "^1.0.0",
121120
"chalk": "^4.1.2",
122-
"chokidar": "^3.5.3",
123121
"cli-progress": "^3.12.0",
124122
"cli-table3": "^0.6.3",
125123
"comment-parser": "^1.4.1",
@@ -144,12 +142,11 @@
144142
"my-only-either": "^1.3.0",
145143
"ora": "^5.4.1",
146144
"prettier": "^3.2.4",
147-
"rxjs": "^7.8.0",
145+
"prettier-plugin-organize-imports": "^3.2.4",
148146
"ts-morph": "^21.0.1",
149147
"type-fest": "^4.9.0",
150148
"url-join": "^4.0.1",
151149
"uuid": "^9.0.0",
152-
"xstate": "^5.4.1",
153150
"yargs": "^17.7.1"
154151
},
155152
"lint-staged": {

pnpm-lock.yaml

+48-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli.ts

-22
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,6 @@ const routeCmd: CommandModule<TRouteOption, TRouteOption> = {
4545
},
4646
};
4747

48-
// const watchCmd: CommandModule<TWatchOption, TWatchOption> = {
49-
// command: CE_COMMAND_LIST.WATCH,
50-
// aliases: CE_COMMAND_LIST.WATCH_ALIAS,
51-
// describe: 'watch for create route.ts file in your directory using by tsconfig.json',
52-
// builder: (argv) => watchBuilder(builder(argv)),
53-
// handler: async (argv) => {
54-
// try {
55-
// progress.isEnable = true;
56-
// spinner.isEnable = true;
57-
58-
// if (process.env.SYNC_MODE === 'true') {
59-
// await watchCommandSyncHandler(argv);
60-
// } else {
61-
// await watchCommandClusterHandler(argv);
62-
// }
63-
// } catch (caught) {
64-
// const err = isError(caught, new Error('unknown error raised'));
65-
// consola.error(err);
66-
// }
67-
// },
68-
// };
69-
7048
const parser = yargs(process.argv.slice(2));
7149

7250
parser

src/cli/builders/builder.ts

+23-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CE_DEFAULT_VALUE } from '#/configs/const-enum/CE_DEFAULT_VALUE';
1+
import { CE_EXT_KIND } from '#/configs/const-enum/CE_EXT_KIND';
22
import type { Argv } from 'yargs';
33

44
export function builder(args: Argv): Argv {
@@ -41,15 +41,29 @@ export function builder(args: Argv): Argv {
4141
type: 'boolean',
4242
default: false,
4343
})
44-
.option('max-workers', {
45-
describe: 'max worker count',
46-
type: 'number',
47-
default: undefined,
44+
.option('banner', {
45+
describe: '생성된 파일에 배너와 시간을 추가합니다',
46+
type: 'boolean',
47+
default: false,
4848
})
49-
.option('worker-timeout', {
50-
describe: 'route code generation worker timeout: default 90 seconds',
51-
type: 'number',
52-
default: CE_DEFAULT_VALUE.DEFAULT_TASK_WAIT_SECOND * 3,
49+
.option('templates', {
50+
description: '템플릿 파일 경로를 결정합니다',
51+
type: 'string',
52+
})
53+
.option('ext-kind', {
54+
describe: 'import 구문의 확장자 처리 방법을 결정합니다',
55+
type: 'string',
56+
choices: [
57+
CE_EXT_KIND.NONE,
58+
CE_EXT_KIND.KEEP,
59+
CE_EXT_KIND.JS,
60+
CE_EXT_KIND.CJS,
61+
CE_EXT_KIND.MJS,
62+
CE_EXT_KIND.TS,
63+
CE_EXT_KIND.CTS,
64+
CE_EXT_KIND.MTS,
65+
],
66+
default: CE_EXT_KIND.NONE,
5367
})
5468
.option('use-default-export', {
5569
description: 'route function in output file that use default export',

src/cli/builders/watchBuilder.ts

-12
This file was deleted.

0 commit comments

Comments
 (0)