expo / expo/snack

Importing nested files causes dependency error

Open
#60 8 comments 0 reactions 0 assignees View on GitHub
snackager
Dominant language
TypeScript
Stars
510
Forks
178
Avg merge
5h 7m
Merged PRs (30d)
5

Description

When importing a repository from github, I have two issues that have been troubling:

### DevDependencies are not imported

When the package.json file is imported, it's clearing everything except for the dependencies entry. This causes problems when importing a project that uses dev dependencies. My particular case is usually for a project that includes tests and requires `react-test-renderer` as a devDependency. When imported the project complains that this dependency is missing. I don't want this to be installed as a regular dependency.

### Importing nested files causes dependency error

When importing from somewhere other than the root of a package, snack complains that the dependency is missing and prompts to install a dependency that includes the nested folder structure. If you do this, snack works, but the project fails locally because that package does not exist in npm (405 error).

For example:
```Add react-native-vector-icons/MaterialIcons to package.json?```
```Add @react-native-community/async-storage/jest/async-storage-mock to package.json?```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the GitHub import with a package.json containing devDependencies and imports such as react-native-vector-icons/MaterialIcons or @react-native-community/async-storage/jest/async-storage-mock. Trace the dependency extraction and install prompt for nested imports; done means devDependencies are preserved and nested paths resolve to their owning packages without suggesting nonexistent npm packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.