Skip to content

chore(native): make knip pass — drop duplicate deps, cwd-independent jest mapping - #58

Open
ivanbanov wants to merge 1 commit into
mainfrom
chore/knip-native
Open

chore(native): make knip pass — drop duplicate deps, cwd-independent jest mapping#58
ivanbanov wants to merge 1 commit into
mainfrom
chore/knip-native

Conversation

@ivanbanov

Copy link
Copy Markdown
Member

pnpm knip failed on the native shell alone, for four unrelated reasons:

  • expo, react and react-native were listed in both dependencies and
    devDependencies; the devDependencies copies go (the lockfile already
    resolved the dependencies specifiers).
  • jest-expo turns the nearest tsconfig's paths into moduleNameMapper
    entries relative to <rootDir>, which for this package points nowhere
    and which tsconfig is nearest depends on the cwd. Filter the @dunky.dev
    mappers out: the workspace links plus the resolver do that job.
  • knip's expo plugin infers expo-updates unless the manifest says
    updates are off (they are: updates.enabled: false), and expo-system-ui
    from userInterfaceStyle, which a stories harness has no use for on
    Android — ignored with the reason, alongside jest-expo's own
    @expo/vector-icons mapping and the babel-preset-expo / babel-jest
    modules the presets resolve themselves.
  • the on-device Storybook reaches the stories through the generated,
    gitignored storybook.requires.ts, so the story files are entries for
    knip, mirroring the react and solid workspaces.

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

…jest mapping

`pnpm knip` failed on the native shell alone, for four unrelated reasons:

- expo, react and react-native were listed in both dependencies and
  devDependencies; the devDependencies copies go (the lockfile already
  resolved the dependencies specifiers).
- jest-expo turns the nearest tsconfig's `paths` into moduleNameMapper
  entries relative to `<rootDir>`, which for this package points nowhere
  and which tsconfig is nearest depends on the cwd. Filter the @dunky.dev
  mappers out: the workspace links plus the resolver do that job.
- knip's expo plugin infers expo-updates unless the manifest says
  updates are off (they are: `updates.enabled: false`), and expo-system-ui
  from `userInterfaceStyle`, which a stories harness has no use for on
  Android — ignored with the reason, alongside jest-expo's own
  @expo/vector-icons mapping and the babel-preset-expo / babel-jest
  modules the presets resolve themselves.
- the on-device Storybook reaches the stories through the generated,
  gitignored storybook.requires.ts, so the story files are entries for
  knip, mirroring the react and solid workspaces.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant