Giter VIP home page Giter VIP logo

react-use-widget's Introduction

Description

This is a demonstration to publish npm package publicly and use it.

  1. https://github.com/DonzTea/react-widget repo demonstrating how to publish a react component as public npm package.
  2. https://github.com/DonzTea/react-use-widget (this repo) demonstrating how to use published npm package.

Installation

  1. git clone [email protected]:DonzTea/react-widget.git
  2. git clone [email protected]:DonzTea/react-use-widget.git

Test NPM Package Locally

  1. on react-widget, set "name": "project-name" in package.json
  2. on react-widget, set "main": "./src/index.tsx" in package.json
  3. on react-widget, run npm link
  4. on react-use-widget, run npm link <project-name>
  5. on react-use-widget, import the package then use it
  6. on react-use-widget, run npm unlink --no-save <project-name>
  7. on react-widget, run npm unlink --no-save <project-name>

Publish NPM Package

  1. on react-widget, run npm login
  2. on react-widget, remove "private": true from package.json
  3. on react-widget, run npm publish

Publish Scoped NPM Package

  1. on react-widget, run npm login
  2. on react-widget, remove "private": true from package.json
  3. on react-widget, change "name": "project-name" in package.json to "name": โ€œ@username/project-name"
  4. on react-widget, run npm publish --access=public

react-use-widget's People

Contributors

donztea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.