Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{".":"0.4.0"}
{".":"0.4.1"}
27 changes: 1 addition & 26 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@
# package.json의 engines 필드를 엄격하게 검사
# node 버전이나 package manager 버전이 맞지 않으면 설치 불가
engine-strict=true

# peer dependencies를 자동으로 설치
# 예: React 라이브러리가 'react'를 peer dependency로 가질 때 자동 설치
auto-install-peers=true

# peer dependencies 버전 충돌 시 경고만 하고 설치 진행
# false: 충돌이 있어도 설치 진행
# true: 충돌 시 설치 중단
strict-peer-dependencies=false

# workspace 패키지 간 의존성 버전 관리 방식
# rolling: 항상 최신 버전 사용
# fixed: 명시된 버전 사용
save-workspace-protocol=rolling

# 추가 권장 설정들:

# node_modules 위치 지정 (프로젝트 루트에 고정)
shamefully-hoist=true

# 패키지 잠금 파일 생성 (pnpm-lock.yaml)
lockfile=true

# 패키지 설치 시 누락된 peer dependencies 경고
strict-peer-dependencies=false

# 프로덕션 환경에서 devDependencies 설치 방지
production=false

# 패키지 설치 시 진행 상황 자세히 표시
loglevel=verbose
loglevel=verbose
13 changes: 0 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
// 파일 저장 시 자동 포맷팅
"editor.formatOnSave": true,

// TypeScript/JavaScript 파일에 대한 기본 포맷터로 Prettier 사용
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

// Markdown 및 MDX 파일에 대한 ESLint 및 Prettier 비활성화
"[markdown]": {
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
Expand All @@ -23,21 +18,13 @@
"source.fixAll.eslint": "never"
}
},

// ESLint 설정
"eslint.enable": true,
"eslint.validate": ["javascript", "typescript"],

// 파일 저장 시 ESLint 자동 수정 (Markdown/MDX 제외)
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},

// Prettier 설정
"prettier.requireConfig": true,
"prettier.configPath": ".prettierrc",
"prettier.disableLanguages": ["markdown", "mdx"],

// TypeScript 설정
"typescript.tsdk": "node_modules/typescript/lib"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.4.1](https://github.com/do-pa/itdoc/compare/v0.4.0...v0.4.1) (2025-08-21)


### 🩹 Fixes

* og_image is not working ([#231](https://github.com/do-pa/itdoc/issues/231)) ([d1070ec](https://github.com/do-pa/itdoc/commit/d1070ec1064cf914b576e2eb9153378903ccaf89)), closes [#230](https://github.com/do-pa/itdoc/issues/230)
* resolve issue causing LLM script to not run properly ([#235](https://github.com/do-pa/itdoc/issues/235)) ([1fa8d90](https://github.com/do-pa/itdoc/commit/1fa8d90fe14c37031baaa58f375550785f055275))

## [0.4.0](https://github.com/do-pa/itdoc/compare/v0.3.0...v0.4.0) (2025-08-08)


Expand Down
23 changes: 11 additions & 12 deletions bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const program = new Command()

program
.name("itdoc")
.usage("A CLI tool for generating ITDOC test code using LLM") // ✅ 직접 Usage 설정
.usage("A CLI tool for generating ITDOC test code using LLM")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Restore a syntax-focused usage string.

.usage should describe the command signature; changing it to narrative text now yields Usage: itdoc A CLI tool..., which breaks the help output. Keep .usage for syntax and move the sentence into .description or addHelpText.

 program
     .name("itdoc")
-    .usage("A CLI tool for generating ITDOC test code using LLM")
+    .usage("[command] [options]")
+    .description("A CLI tool for generating ITDOC test code using LLM")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.usage("A CLI tool for generating ITDOC test code using LLM")
program
.name("itdoc")
.usage("[command] [options]")
.description("A CLI tool for generating ITDOC test code using LLM")
🤖 Prompt for AI Agents
In bin/index.ts around line 46, the .usage call was changed to narrative text
which causes the help output to show "Usage: itdoc A CLI tool..." instead of a
command signature; restore .usage to contain the command syntax/signature (e.g.,
the expected command name and options/arguments) and move the descriptive
sentence "A CLI tool for generating ITDOC test code using LLM" into .description
or addHelpText so the help output renders correctly.

.addHelpText(
"after",
`
Expand All @@ -55,22 +55,19 @@ Example:
program
.command("generate")
.description("Generate ITDOC test code based on LLM.")
.option("-p, --path <testspecPath>", "Path to the markdown test spec file.")
.option("-a, --app <appPath>", "Path to the Express root app file.")
.option("-e, --env <envPath>", "Path to the .env file.")
.action((options: { path?: string; env?: string; app?: string }) => {
.action(async (options: { env?: string; app?: string }) => {
const envPath = options.env
? path.isAbsolute(options.env)
? options.env
: path.resolve(process.cwd(), options.env)
: path.resolve(process.cwd(), ".env")

if (!options.path && !options.app) {
if (!options.app) {
logger.error(
"Either a test spec path (-p) or an Express app path (-a) must be provided. By default, the OpenAI key (OPENAI_API_KEY in .env) is loaded from the root directory, but you can customize the path if needed",
"An Express app path (-a) must be provided. By default, the OpenAI key (OPENAI_API_KEY in .env) is loaded from the root directory, but you can customize the path with -e/--env if needed.",
)
logger.info("ex) itdoc generate -p ../md/testspec.md")
logger.info("ex) itdoc generate --path ../md/testspec.md")
logger.info("ex) itdoc generate -a ../app.js")
logger.info("ex) itdoc generate --app ../app.js")
logger.info("ex) itdoc generate -a ../app.js -e <custom path : env>")
Expand All @@ -80,12 +77,14 @@ program
logger.box("ITDOC LLM START")
if (options.app) {
const appPath = resolvePath(options.app)

logger.info(`Running analysis based on Express app path: ${appPath}`)
generateByLLM("", appPath, envPath)
} else if (options.path) {
const specPath = resolvePath(options.path)
logger.info(`Running analysis based on test spec (MD) path: ${specPath}`)
generateByLLM(specPath, "", envPath)
try {
await generateByLLM(appPath, envPath)
} catch (err) {
logger.error(`LLM generation failed: ${(err as Error).message}`)
process.exit(1)
}
}
})

Expand Down
58 changes: 29 additions & 29 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export default tseslint.config(
"output/**",
],
},
// ESLint 기본 추천 규칙
// Apply the default ESLint recommended rules.
eslint.configs.recommended,
// TypeScript 추천 규칙
// Apply the TypeScript recommended rules.
...tseslint.configs.recommended,
// JSDoc 문서화 추천 규칙
// Apply the recommended JSDoc documentation rules.
jsdoc.configs["flat/recommended"],
// Mocha 플러그인 설정
// Configure the Mocha plugin.
{
plugins: {
mocha: mochaPlugin,
Expand All @@ -34,17 +34,17 @@ export default tseslint.config(
{
files: ["**/*.ts"],
languageOptions: {
// 사용할 JavaScript 버전 지정
// Target the specified JavaScript version.
ecmaVersion: 2022,
// ESM 모듈 시스템 사용
// Use the ESM module system.
sourceType: "module",
// TypeScript 파서 사용
// Use the TypeScript parser.
parser: tseslint.parser,
parserOptions: {
// TypeScript 설정 파일 지정
// Reference the TypeScript project configuration files.
project: ["./tsconfig.json", "./tsconfig.test.json"],
},
// env 대신 globals 사용
// Provide globals instead of using env shortcuts.
globals: {
...globals.node,
...globals.es2022,
Expand All @@ -56,45 +56,45 @@ export default tseslint.config(
"license-header": licenseHeader,
},
rules: {
// TypeScript 관련 규칙
// 함수의 반환 타입 명시 필수 -> widdershins 모듈문제로 임시 비활성화
// Configure TypeScript-specific rules.
// Require explicit return types, temporarily disabled due to the widdershins module.
"@typescript-eslint/explicit-function-return-type": "off",
// 사용하지 않는 변수 에러 처리 (_로 시작하는 변수는 제외)
"@typescript-eslint/no-explicit-any": "warn", // error에서 warn으로 변경
// Flag unused variables while allowing names that start with an underscore.
"@typescript-eslint/no-explicit-any": "warn", // Set severity to warn instead of error.
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
// 클래스 멤버의 접근 제한자 명시 필수
// Require explicit access modifiers on class members.
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ accessibility: "explicit" },
],
"@typescript-eslint/no-require-imports": "warn", // error에서 warn으로 변경
"@typescript-eslint/no-require-imports": "warn", // Set severity to warn instead of error.

// JSDoc 규칙 완화
// Relax certain JSDoc rules.
"jsdoc/require-description": "warn",
"jsdoc/require-param-description": "warn",
"jsdoc/require-returns-description": "warn",
"jsdoc/require-example": "off", // 필수 예제 비활성화
"jsdoc/check-examples": "off", // 예제 검사 비활성화
"jsdoc/require-example": "off", // Disable mandatory examples.
"jsdoc/check-examples": "off", // Disable example validation.
"jsdoc/require-throws": "warn",
"jsdoc/require-param": "warn",
"jsdoc/require-returns": "warn",
"jsdoc/require-param-type": "warn",

// 코드 품질 규칙
// 중첩 콜백 최대 3개까지 허용
// Configure code-quality rules.
// Allow up to three nested callbacks.
"max-nested-callbacks": ["error", 3],
// 함수당 최대 50줄 제한 (빈 줄과 주석 제외)
// Warn when a function exceeds 150 lines excluding blanks and comments.
"max-lines-per-function": [
"warn", // error에서 warn으로 변경
"warn", // Set severity to warn instead of error.
{ max: 150, skipBlankLines: true, skipComments: true },
],

// Mocha 테스트 규칙
// Configure Mocha test rules.
"mocha/no-skipped-tests": "warn",
// 단독 실행 테스트 금지
// Forbid exclusive tests.
"mocha/no-exclusive-tests": "error",

// 라이센스 헤더 규칙
// Enforce the license header rule.
"license-header/header": [
"error",
[
Expand All @@ -116,14 +116,14 @@ export default tseslint.config(
],
],

// no-console 규칙: widdershins 모듈문제로 임시 비활성화
// Temporarily disable no-console because of the widdershins module.
"no-console": "off",
},
// JSDoc 설정
// Configure JSDoc settings.
settings: {
jsdoc: {
mode: "typescript",
// 태그 이름 설정
// Configure tag name preferences.
tagNamePreference: {
returns: "returns",
example: "example",
Expand All @@ -138,6 +138,6 @@ export default tseslint.config(
"max-nested-callbacks": "off",
},
},
// Prettier와의 충돌 방지
// Prevent conflicts with Prettier.
eslintConfigPrettier,
)
Loading
Loading