Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Lit as an explicit dependency of video-series-samples #5

Merged
merged 2 commits into from
Apr 15, 2022

Conversation

AndrewJakubowicz
Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz commented Apr 15, 2022

Context

When using npm install github:lit/video-series-samples, the dependencies are installed from the root package.json.

Why

This is needed to install the simple carousel from Github in the BWL002 video and have the lit dependency resolve. We need the root package.json to depend on the simple-carousel project.

Tradeoffs

This duplicates the Lit dependency in the root package.json which is used to install dependencies during a npm github install. This is a strange case because we want to allow npm install of the repo to use the simple-carousel easily, but we also want the simple carousel folder to be a self contained project that can also be installed.

The root package.json needs enough information to install dependencies and use the built simple-carousel. And the simple carousel folder also needs enough information to install itself as a self contained project (mimics the lit-starter-template structure).

@rictic perfectly resolved the tradeoff by suggesting a file dependency. Tested and it works! Dependencies are now DRY! Thank you!

Testing

Tested manually by using npm link and npm link video-series-samples. Then locally using this in create-react-app which is done in the video.

Commands used in video:

npx create-react-app@latest carousel-in-react

cd carousel-in-react

npm install github:lit/video-series-samples

@AndrewJakubowicz
Copy link
Contributor Author

AndrewJakubowicz commented Apr 15, 2022

@rictic gave offline feedback that instead of trying to duplicate the dependencies manually in the root package.json, a file: dependency is cleaner. It infinitely improved this PR and taught me something new. Thank you!

Requesting review.

@AndrewJakubowicz AndrewJakubowicz merged commit 3391485 into main Apr 15, 2022
@AndrewJakubowicz AndrewJakubowicz deleted the cleanup-accidental-command branch April 15, 2022 17:44
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