Refactor: Replace barrel exports with explicit imports#53
Merged
YusukeHirao merged 3 commits intomainfrom Mar 9, 2026
Merged
Conversation
全21個の index.ts ファイルを削除・リネームし、CLAUDE.md の 「index.ts 禁止」ルールに準拠させる。 - crawler 内部バレルファイル (utils/*, archive/*, crawler/) を削除し、 インポートパスを実ファイルへの直接参照に変更 - 全パッケージの src/index.ts をリネーム (core.ts, crawler.ts, cli.ts 等) - 各 package.json の exports フィールドを新ファイル名に更新 - CLI の bin/nitpicker.js のインポートパスを更新 - テストファイルのインポートパスとモック対象を更新 Closes #15 https://claude.ai/code/session_01Bkk5HRFJFjAviGpaT94yDn
- Fix utils/types/ description: ParseURLOptions → Link, CrawlerError (ParseURLOptions is not in this file) - Add missing files to archive listing: safe-path, types - Add missing root-level files to crawler structure: crawler.ts, debug.ts, resolve-output-path.ts, types.ts - Fix test-server entry point: index.ts → server.ts - Add JSDoc descriptions to test-server createApp() and startServer() https://claude.ai/code/session_01Bkk5HRFJFjAviGpaT94yDn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR eliminates barrel export files (
index.ts) across the codebase and replaces them with explicit imports from individual modules. This improves tree-shaking, reduces circular dependency risks, and makes dependencies more explicit and traceable.closes: #15
Key Changes
Core Refactoring
Removed barrel exports: Deleted
index.tsfiles from:packages/@nitpicker/crawler/src/utils/(types, array, error, object subdirectories)packages/@nitpicker/crawler/src/archive/filesystem/packages/@nitpicker/crawler/src/archive/packages/@nitpicker/crawler/src/crawler/packages/@nitpicker/core/src/hooks/Updated all imports: Changed from barrel imports to explicit module imports across 30+ files:
import { foo } from './utils/index.js'→import { foo } from './utils/types/types.js'import { bar, baz } from './filesystem/index.js'→import { bar } from './filesystem/bar.js'; import { baz } from './filesystem/baz.js'Package Entry Points
index.ts→crawler.ts,cli.ts,core.ts,types.ts,axe-plugin.ts,lighthouse-plugin.ts, etc.package.jsonexports to reference new entry point namesbin/nitpicker.jsto import from new pathDocumentation & Tests
ARCHITECTURE.mdto reflect new file structureindex.jstoserver.jsImplementation Details
https://claude.ai/code/session_01Bkk5HRFJFjAviGpaT94yDn