@thewave-studio/code-library
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

The Wave - Code library

This library contains reusable pieces of code created by The Wave Studio, that can be used across multiple projects

HOW TO USE IT

  • Create a .npmrc file at the root of your project with this snippet of code
//registry.npmjs.org/:_authToken=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
  • Install the library as usual using npm i @thewave-studio/code-library or yarn add @thewave-studio/code-library
  • Use the library as usual, for example
import {useMousePosition} from "@thewave-studio/code-library"

HOW TO CONTRIBUTE TO THE LIBRARY

  • Install the modules by running npm i or yarn and then run npm prepare or yarn run prepare to install Husky hooks
  • The main branch is used to ship production ready code
  • DO NOT RUN git commit to do the commit. Run yarn run commit or npm run commit instead. Conventional Commits MUST BE USED to ensure that semantic release can identify the type of commit and increase the package version accordingly. Read more about it here.

REACT HOOKS

REGEX

  • VALID_URL_REGEX This regex validates an URL and it can also be used to determine whether an URL is external which can be useful when using routing in SPA
  • ITALIAN_PHONE_NUMBER_REGEX This regex validates an italian phone number (with prefix +39)

UTILITY

  • yarn new-hook nameOfTheHook or npm run new-hook nameOfTheHook (where nameOfTheHook is the hook name): this utility will help you create a folder structure and the necessary files to create a new hook (test, hook, markdown and demo). Keep in mind that this will create just some boilerplate files but with a consistent structure.

Package Sidebar

Install

npm i @thewave-studio/code-library

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

39.8 kB

Total Files

66

Last publish

Collaborators

  • the-wave-studio-coding