Skip to content

Commit

Permalink
feat(glob): fix @ctix-declaration issue
Browse files Browse the repository at this point in the history
- fix `@ctix-declaration` issue
  - fixed an issue where files were added to `index.ts` even if they were not included in the include option.
- enhance `README.md`
  • Loading branch information
imjuni committed Sep 5, 2024
1 parent 08f963b commit 940f762
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ ctix init

`ctix` needs a list of files to generate the `index.ts` file. You can provide this list using the `--include` option, which supports glob patterns. If you don't use the `--include` option, ctix will use the `include` setting from the `.ctirc` file. If neither the `--include` option nor the `.ctirc` file is provided, ctix will fall back to the `include` field in the `tsconfig.json` file.

![include-exclude-diagram](/static/img/file-include-exclude.png)

This diagram shows the file include/exclude mechanism.

#### How can I include wanted files?

`ctix` gets a glob pattern to generate the `index.ts` file. The glob pattern is obtained from various configuration files such as:
Expand Down
1 change: 1 addition & 0 deletions src/modules/commands/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export async function bundling(buildOptions: TCommandBuildOptions, bundleOption:
filePaths,
keyword: CE_INLINE_COMMENT_KEYWORD.FILE_DECLARATION_KEYWORD,
})
.filter((declaration) => include.isInclude(declaration.filePath))
.filter((declaration) => !exclude.isExclude(declaration.filePath))
.filter((declaration) => {
const sourceFile = project.getSourceFile(declaration.filePath);
Expand Down
Binary file added static/img/file-include-exclude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 940f762

Please sign in to comment.