https://github.com/josephschmitt/pnpm-dep-resolution-demo
https://github.com/josephschmitt/pnpm-dep-resolution-demo
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/josephschmitt/pnpm-dep-resolution-demo
- Owner: josephschmitt
- Created: 2018-12-27T17:24:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-27T17:29:38.000Z (over 6 years ago)
- Last Synced: 2025-01-22T13:40:15.847Z (4 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unexpected Inability to Require a Dependency Demo
This repo is built up of 2 published packages and a sample application:
- [`api-adapters`](./api-adapters) -- Multi-framework API adapters that wrap the JSONPlaceholder
API's. Multiple providers are available, depending on if your application uses `axios` or
`node-fetch` to avoid having multiple HTTP libraries installed.
- [`api-adapters-todos`](./api-adapters-todos) -- Uses the `axios` adapter to load todos.
- [`application`](./application) -- Uses the todos adapter to try and load todos## Installation and Startup
```sh
pnpm recursive install
cd application/
pnpm start
```## Expected result
Upon starting the application, I'd expect it to console log todos. `axios` is not a dependency of
the base adapters package since it provides multiple http-library adapters. However, the package
that actually uses the adapter does set `axios` as its dependency. Therefore I'd expect it to be
able to resolve the `axios` dependency in the application that requires the todos package.## Actual result
Upon starting the application, the `axios` dependency is not found, even though it was installed
since it is set as a dependency of `@joe-sh/api-adapters-todos`.## Workaround
```sh
pnpm install --shamefully-flatten
pnpm start
```When shamefully flattening, it all works as expected.