Skip to content

[DONE] Pattern Lab 코드에서 아무도 읽지 않는 이름 둘이 빠지고, 다른 파일이 읽지 않는 export 62개가 파일 안으로 들어간다 - #237

Merged
patternflow-bot merged 2 commits into
devfrom
claude/lsh-pf-round91-ocieby
Oct 25, 2026
Merged

patternflow-bot merged 2 commits into
devfrom
claude/lsh-pf-round91-ocieby

Conversation

@patternflow-bot

@patternflow-bot patternflow-bot commented Oct 25, 2026 •

Copy link
Copy Markdown

lsh / https://claude.ai/code/session_019Ted7kvLRcnQBfHBm7xX9i

Pattern Lab 코드에서 다른 파일이 하나도 읽지 않던 export 64개를 정리했어요. 부르는 곳이 아예 없던 이름 둘은 지우고, 나머지 62개는 export 낱말만 떼서 그 파일 안에서만 쓰여요. 화면과 동작은 그대로이고, 머지하면 Lab 파일을 열었을 때 밖에서 쓰는 이름만 export 로 보여요.

좋아지는 것: 없음

한 일

knip 5 를 스크래치에 깔아 web/ 에서 돌리니 lib/lab/ 와 app/pattern-lab/ 에 다른 파일이 읽지 않는 export 가 64개(값 32개, 타입 32개, 33개 파일) 나왔어요. 표에 적힌 59개보다 다섯이 많아요. 표는 같은 이름이 다른 파일에 한 번이라도 나오면 셈에서 뺐는데, 다섯은 이름만 같고 이 파일의 것을 읽지는 않아요.

  • useShowEditing.ts 의 sortedLane: lib/lab/director/bake.ts 에 몸이 같은 함수가 따로 있어요. 둘을 하나로 모으는 건 표 2위라 여기선 export 만 뗐어요.
  • useShowEditing.ts 의 Selection: 다른 곳의 Selection 은 DOM 타입이거나 제 타입이에요.
  • annotations.ts 의 DEFAULT_KNOB_LABELS, stripKnobsAnnotation: lib/pattern/knobs.ts 에서 받아 다시 내보내던 이름인데, 부르는 곳은 다 lib/pattern/knobs 에서 바로 받아요. 다시 내보내기 목록에서만 뺐고 파일 안에선 그대로 써요.
  • store/project.ts 의 ProjectSlice: capture/client.ts 가 같은 이름의 제 타입을 둬요.

지운 이름 둘은 표대로예요. capture/shaderSource.ts 의 SHADER_PREAMBLE_LINES 는 머리글이 끝에 #line 1 을 두어서 줄 번호를 따로 셀 일이 없어요. director/useTimelineZoom.ts 의 TimelineZoom 은 DirectorPanel.tsx 가 훅을 바로 부르고 그 타입은 쓰지 않아요.

export 를 뗀 뒤 noUnusedLocals 에 걸린 것은 없었어요. 떼어 낸 이름은 다 그 파일 안에서 쓰여요.

증거

$ knip --no-progress --include exports,types --reporter json   (스크래치의 knip 5.88.1, web/ 에서)
dev           all 267   lab 64 (values 32, types 32)
이 브랜치     all 203   lab 0  (values 0,  types 0)

$ git diff --stat dev -- web/src
 35 files changed, 60 insertions(+), 67 deletions(-)

$ npm run typecheck
> tsc --noEmit && tsc --noEmit -p ../tools/virtual-panel
(오류 없음)
$ npm run lint -- --max-warnings=0
> eslint --max-warnings=0
(경고 0)

$ npm run build
○  (Static)   prerendered as static content
●  (SSG)      prerendered as static HTML (uses generateStaticParams)
ƒ  (Dynamic)  server-rendered on demand

$ npm run check:ci
 Test Files  100 passed (100)
      Tests  1261 passed (1261)
passed audio-vectors · bom · bom-schematic · changelog · editions · features · markers · midi-vectors
passed mqtt-vectors · osc-vectors · presets · rest-vectors · shared · virtual-panel
skipped links-absolute · roadmap   (gh 로그인과 태그가 없는 컨테이너라서요. drift.yml 이 다시 돌려요)

GitHub 에서도 bb3c701 의 Drift checks 와 Web CI 가 둘 다 success 예요. npm ci 는 web/ 에서 그대로 지났어요. dev(edd8a88)는 이 브랜치가 갈라진 뒤 움직이지 않아서 merge 할 것이 없었어요.

이름마다 web/src, web/scripts, web/test, tools, firmware/toolchain, docs, web/content 와 레포의 마크다운을 git grep -w 했어요. 다른 파일에 나온 이름은 위 다섯과 incoming/ROUND.md 의 표 글뿐이에요.

화면을 바꾸지 않아서 사진은 없어요.

실행법

cd web && npm ci && npm run typecheck && npm run check:panels
# knip 은 package.json 을 고치지 않게 스크래치에 깔아 web/ 에서 돌려요
npm i --prefix /tmp/knip knip@5 && /tmp/knip/node_modules/.bin/knip --include exports,types

가정

  • 표의 확인 칸이 「knip 을 다시 돌려 Lab 경로가 0개」라서, 표가 이름 겹침으로 뺀 다섯도 같이 정리했어요. 표의 「57개」 대신 62개예요.
  • sortedLane 은 export 만 떼고 두 벌을 그대로 뒀어요. 하나로 모으는 일은 표 2위 몫이에요.
  • 표 밖: knip 은 Lab 밖에도 export 203개를 더 내요. 지울 만한 다섯은 표 11위에 있어요.

Changelog

Web

  • Pattern Lab's modules export only what another file reads. knip found 64 exports in lib/lab and app/pattern-lab with no importer; two names with no reader at all are gone and the other 62 are file-local.

경험

언제: knip 의 안 쓰는 export 를 「이름이 다른 파일에 나오는지」 git grep -w 로 다시 거를 때
교훈: 이름만 같은 다른 정의(DOM 타입, 같은 이름의 제 타입, 다시 내보내기)는 그 파일을 읽는 게 아니니, 다른 파일의 import 줄을 보고 가려요
근거: #237 에서 표 1위는 59개라 했지만 knip 은 64개를 냈고, 빠진 다섯(Selection, ProjectSlice, sortedLane, 다시 내보내기 둘)은 이름만 겹쳤어요

바퀴

바퀴 91 · 후보 1 「Pattern Lab 코드에서 아무도 읽지 않는 이름 둘이 빠지고, 다른 파일이 읽지 않는 export 57개가 파일 안으로 들어간다」

다음 바퀴

  • 2위 「Pattern Lab 에 두세 번 적힌 도우미 다섯이 한 곳에서 온다」: sortedLane 두 벌이 이제 둘 다 파일 안에만 있어서, 하나로 모으면 export 를 다시 붙여요.
  • 3위 「Layers 패널의 규칙 24개가 dock 틀 CSS 에서 Layers 패널의 CSS 로 간다」: 바퀴 89 의 getComputedStyle 비교를 그대로 써요.
  • 4위 「Lab 머리줄 규칙 24개가 여럿이 쓰는 PatternLab.module.css 에서 셸의 CSS 로 간다」: 3위와 같은 비교에 labCss.test.ts 의 새 시험 하나예요.

https://claude.ai/code/session_019Ted7kvLRcnQBfHBm7xX9i


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Ted7kvLRcnQBfHBm7xX9i
@patternflow-bot patternflow-bot changed the title [WIP] 91바퀴 — 고를 일을 찾는 중 [WIP] Pattern Lab 코드에서 아무도 읽지 않는 이름 둘이 빠지고, 다른 파일이 읽지 않는 export 가 파일 안으로 들어간다 Oct 25, 2026
knip found 64 exports in lib/lab and app/pattern-lab that no file imports.
SHADER_PREAMBLE_LINES and TimelineZoom had no reader at all and go; the
other 62 lose the export keyword.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Ted7kvLRcnQBfHBm7xX9i
@patternflow-bot patternflow-bot changed the title [WIP] Pattern Lab 코드에서 아무도 읽지 않는 이름 둘이 빠지고, 다른 파일이 읽지 않는 export 가 파일 안으로 들어간다 [WIP] Pattern Lab 코드에서 아무도 읽지 않는 이름 둘이 빠지고, 다른 파일이 읽지 않는 export 62개가 파일 안으로 들어간다 Oct 25, 2026
@patternflow-bot patternflow-bot changed the title [WIP] Pattern Lab 코드에서 아무도 읽지 않는 이름 둘이 빠지고, 다른 파일이 읽지 않는 export 62개가 파일 안으로 들어간다 [DONE] Pattern Lab 코드에서 아무도 읽지 않는 이름 둘이 빠지고, 다른 파일이 읽지 않는 export 62개가 파일 안으로 들어간다 Oct 25, 2026
@patternflow-bot
patternflow-bot marked this pull request as ready for review October 25, 2026 02:35
@patternflow-bot
patternflow-bot merged commit 33b7add into dev Oct 25, 2026
2 checks passed
@patternflow-bot
patternflow-bot deleted the claude/lsh-pf-round91-ocieby branch October 25, 2026 02:36
engmung pushed a commit to engmung/Patternflow that referenced this pull request Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants