Skip to content

Commit

Permalink
fix: fix bundle npm script
Browse files Browse the repository at this point in the history
- fix bundle npm script
- add new cli option: banner, ext-kind, templates
- remove unused files
- add `prettier-plugin-organize-imports` on pretter processing
  • Loading branch information
imjuni committed Feb 6, 2024
1 parent d135b2c commit 9de5a98
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 118 deletions.
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
"url": "git+https://github.com/imjuni/fast-maker.git"
},
"bin": {
"fast-maker": "dist/cli.js"
"fast-maker": "dist/cjs/cli.cjs"
},
"private": false,
"author": "ByungJoon Lee",
"license": "MIT",
"main": "dist/cjs/fast-maker.js",
"module": "dist/esm/fast-maker.js",
"types": "dist/esm/fast-maker.d.ts",
"main": "dist/cjs/index.cjs",
"module": "dist/esm/index.,js",
"types": "dist/types/index.d.ts",
"exports": {
".": {
"require": {
Expand All @@ -74,7 +74,6 @@
"@rollup/plugin-node-resolve": "^15.0.1",
"@tsconfig/node18": "^18.2.2",
"@types/cli-progress": "^3.11.0",
"@types/figlet": "^1.5.5",
"@types/inquirer": "^9.0.1",
"@types/minimist": "^1.2.2",
"@types/node": "^18.15.3",
Expand Down Expand Up @@ -104,12 +103,12 @@
"lint-staged": "^15.2.0",
"npm-run-all": "^4.1.5",
"prettier-eslint": "^16.2.0",
"prettier-plugin-organize-imports": "^3.2.2",
"read-pkg": "^5.2.0",
"rimraf": "^5.0.5",
"rollup": "^4.9.1",
"rollup-plugin-dts": "^6.1.0",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.8",
"tsconfig-paths": "^4.1.2",
"tslib": "^2.5.0",
"typescript": "^5.3.3",
Expand All @@ -119,7 +118,6 @@
"dependencies": {
"@maeum/cli-logo": "^1.0.0",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"cli-progress": "^3.12.0",
"cli-table3": "^0.6.3",
"comment-parser": "^1.4.1",
Expand All @@ -144,12 +142,11 @@
"my-only-either": "^1.3.0",
"ora": "^5.4.1",
"prettier": "^3.2.4",
"rxjs": "^7.8.0",
"prettier-plugin-organize-imports": "^3.2.4",
"ts-morph": "^21.0.1",
"type-fest": "^4.9.0",
"url-join": "^4.0.1",
"uuid": "^9.0.0",
"xstate": "^5.4.1",
"yargs": "^17.7.1"
},
"lint-staged": {
Expand Down
79 changes: 48 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,6 @@ const routeCmd: CommandModule<TRouteOption, TRouteOption> = {
},
};

// const watchCmd: CommandModule<TWatchOption, TWatchOption> = {
// command: CE_COMMAND_LIST.WATCH,
// aliases: CE_COMMAND_LIST.WATCH_ALIAS,
// describe: 'watch for create route.ts file in your directory using by tsconfig.json',
// builder: (argv) => watchBuilder(builder(argv)),
// handler: async (argv) => {
// try {
// progress.isEnable = true;
// spinner.isEnable = true;

// if (process.env.SYNC_MODE === 'true') {
// await watchCommandSyncHandler(argv);
// } else {
// await watchCommandClusterHandler(argv);
// }
// } catch (caught) {
// const err = isError(caught, new Error('unknown error raised'));
// consola.error(err);
// }
// },
// };

const parser = yargs(process.argv.slice(2));

parser
Expand Down
32 changes: 23 additions & 9 deletions src/cli/builders/builder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CE_DEFAULT_VALUE } from '#/configs/const-enum/CE_DEFAULT_VALUE';
import { CE_EXT_KIND } from '#/configs/const-enum/CE_EXT_KIND';
import type { Argv } from 'yargs';

export function builder(args: Argv): Argv {
Expand Down Expand Up @@ -41,15 +41,29 @@ export function builder(args: Argv): Argv {
type: 'boolean',
default: false,
})
.option('max-workers', {
describe: 'max worker count',
type: 'number',
default: undefined,
.option('banner', {
describe: '생성된 파일에 배너와 시간을 추가합니다',
type: 'boolean',
default: false,
})
.option('worker-timeout', {
describe: 'route code generation worker timeout: default 90 seconds',
type: 'number',
default: CE_DEFAULT_VALUE.DEFAULT_TASK_WAIT_SECOND * 3,
.option('templates', {
description: '템플릿 파일 경로를 결정합니다',
type: 'string',
})
.option('ext-kind', {
describe: 'import 구문의 확장자 처리 방법을 결정합니다',
type: 'string',
choices: [
CE_EXT_KIND.NONE,
CE_EXT_KIND.KEEP,
CE_EXT_KIND.JS,
CE_EXT_KIND.CJS,
CE_EXT_KIND.MJS,
CE_EXT_KIND.TS,
CE_EXT_KIND.CTS,
CE_EXT_KIND.MTS,
],
default: CE_EXT_KIND.NONE,
})
.option('use-default-export', {
description: 'route function in output file that use default export',
Expand Down
12 changes: 0 additions & 12 deletions src/cli/builders/watchBuilder.ts

This file was deleted.

Loading

0 comments on commit 9de5a98

Please sign in to comment.