0.0.4 • Published 3 years ago

@live-ui/react v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Boilerplate to create library with Vite, Typescript and React.js

:black_nib: Author

:bust_in_silhouette: Pâmela Vieira da Silva - @panhavsilva


Install dependencies

yarn

Run the dev server

yarn dev

#dev server running at: http://localhost:3000/

Scripts

ScriptDescription
yarn devRun dev server
yarn buildGenerates production build
yarn lintRun linter
yarn lint:fixFix lint errors
yarn type-checkTS type checking
yarn ciRun lint, type checking and tests (meant to be used in a CI)
yarn prepareNot supposed to be manually used. It's just to configure husky

:rocket: Usage

Creating your token for publish in to NPM

  1. In the upper right corner of the page, click your profile picture, then click "Access Tokens".
  2. Click "Generate New Token".
  3. Name your token "NPM_TOKEN".
  4. Select the type of access token "Automation".
  5. Click "Generate Token".
  6. Copy the token from the top of page to include in Github secrets.

    Configuring your secrets on Github

  7. On GitHub, navigate to the main page of the repository.

  8. Under your repository name, click on the "Settings" tab.
  9. In the left sidebar, click "Secrets" after click "Actions".
  10. Click on button "New repositury secret" on the right. npm.io
  11. Type NPM_TOKEN in the "Name" input box.
  12. Type the value for your secret.
  13. Click "Add secret". npm.io

    Generate tag version on Github

  14. On GitHub, navigate to the main page of the repository.

  15. Under your repository name, click on the "Actions" tab.
  16. In the left sidebar, click "Generate tag version".
  17. Click on button "Run workflow".
  18. Select branch to use generate tag version workflow and select version (patch, minor or major). npm.io
  19. Click on button "Run workflow".

    Create Releases

  20. On GitHub, navigate to the main page of the repository.

  21. To the right of the list of files, click "Releases".
  22. Click on button "Create a new release" if your first realese or on button "Draft a new release".
  23. Click "Choose a tag", select a version number for your release.
  24. Click "Auto-generate release notes".
  25. Click on button "Publish release".

    Change in your project

  • In to folder lib:
    • Change main.tsx to name of your lib.tsx
    • Include code of your lib here.
  • In to package.json:
      {
        "name": "", //@+"your username NPM"/"name of your lib" without quotes and plus signal
        "description": "", //description of your lib
        "main": "./dist/name of your lib.umd.js", //put the name of your lib.umd.js
        "module": "./dist/name of your lib.es.js", //put the name of your lib.es.js
        "types": "./dist/lib/main.d.ts", // put the name of your lib.d.ts
        "exports": {
          ".": {
            "import": "./dist/name of your lib.es.js", // put the name of your lib.es.js
            "require": "./dist/name of your lib.umd.js" // put the name of your lib.umd.js
          }
        },
        "repository": {
          "type": "git",
          "url": "" //url of repository of your lib on Github
        },
        "keywords": [], //include keywords searched in NPM relative to your lib
        "author": "", //your name
        "bugs": {
          "url": "https://github.com/your username/your repository/issues" //url of repository of your lib on Github/issues
        },
        "homepage": "https://github.com/your username/your repository#readme" //url of repository of your lib on Github#readme
      }
  • In to tsconfig.node.json:
      {
        "paths": {
          "@username NPM/name of your lib": [ "./lib/name of your lib.tsx" ]
        } //put @ + your username NPM/name of your lib: put the name of your lib
      }
  • In to vite.config.ts:
      build: {
        lib: {
          entry: resolve('lib', 'main.tsx'),
          name: 'ReactFeatureFlag',
          fileName: (format) => `name of your lib.${format}.js`, //put the name of your lib
        },
        rollupOptions: {
          external: ['react'],
        },
      },
  • In to src/ app.tsx
    • Import your lib from ./lib.
    • Include your lib in the return function app.
  • Assets folder can be deleted
  • Change README.md

:handshake: Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.


✨ Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © current Pâmela Vieira da Silva - @panhavsilva. This project is MIT licensed.

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago