HarveyD / react-component-library

A project skeleton to get your very own React Component Library up and running using Rollup, Typescript, SASS + Storybook
https://blog.harveydelaney.com/creating-your-own-react-component-library/
MIT License
790 stars 167 forks source link

Install with "npm install gitlab:repo/name" doesn't work #13

Closed lioshi closed 4 years ago

lioshi commented 4 years ago

There is only files

Install localy works... https://github.com/HarveyD/react-component-library#installing-component-library-locally An idea?

HarveyD commented 4 years ago

Hi Lioshi,

Make sure you've built your project before publishing it: npm run build && npm publish.

Also make sure your package.json files entry has the directory that contains your compiled files: https://github.com/HarveyD/react-component-library/blob/master/package.json#L7

Cheers.

lioshi commented 4 years ago

Thanks. As a solution I have added "prepare" script

  "scripts": {
    "prepare": "npm run build",
HarveyD commented 4 years ago

"prepublishOnly": "npm run build" should do this. https://docs.npmjs.com/misc/scripts

lioshi commented 4 years ago

Yes only when publish on NPM registry, but I use a gitlab repo and install (your great job) react-component-library with npm i "git+https://gitlab.com/name/react-component-library.git"

HarveyD commented 4 years ago

Right, you'll need to remove build from .gitignore and commit the contents of the build folder then I imagine. I'll add instructions in the README

HarveyD commented 4 years ago

I've included instructions on how to do this in the README. Hope it helps!