Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bigbinary/neeto-commons-frontend

Package Overview
Dependencies
Maintainers
11
Versions
352
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bigbinary/neeto-commons-frontend

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

  • 2.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.4K
decreased by-4.56%
Maintainers
11
Weekly downloads
 
Created
Source

neeto-commons-frontend

The commons frontend library for Neeto Applications.

Installation Instructions

Install from npm:

yarn add "@bigbinary/neeto-commons-frontend@2.0.8"

This package relies on the host project's tailwind configuration. So add neeto-commons-frontend to your project's tailwind.config.js file:

module.exports = {
  purge: {
    content: [
      // ... other content directories
      "./node_modules/@bigbinary/neeto-commons-frontend/**/*.js",
    ],
  },
  // ... other tailwind config options
};

Usage

This package exports four different sets of functions and components. Click on them to read more:

  1. Initializers
  2. React utilities
  3. Pure utility functions
  4. Web utility functions

Migrating from version 1 to 2

There is only a single breaking change from version 1 to version 2. The pure functions (which has only ramda as its peerDependency) have been moved to a separate bundle (named pure). You can import them from @bigbinary/neeto-commons-frontend/pure instead of @bigbinary/neeto-commons-frontend/utils.

Here is a list of functions that have been moved:

removeById, findById, replaceById, modifyById, findBy, removeBy, replaceBy,modifyBy, existsById, existsBy, findLastBy, findIndexById, findIndexBy,findLastIndexBy, filterBy, countBy, copyKeys, renameKeys, copyKeysDeep

noop, toLabelAndValue, getRandomInt, randomPick, dynamicArray, isNotNil, isNotEmpty, notEquals, isNot, notEqualsDeep, isNotEqualDeep

transformObjectDeep, keysToCamelCase, keysToSnakeCase, deepFreezeObject, matches, filterNonNull

slugify, humanize, snakeToCamelCase, camelToSnakeCase, capitalize, truncate

When you are migrating from version 1 to version 2, do the following:

  1. Search for all imports from @bigbinary/neeto-commons-frontend/utils and delete the above mentioned functions from those imports.
  2. Import these functions from @bigbinary/neeto-commons-frontend/pure instead.

Development instructions

  1. Clone this repository.
  2. Run yarn install to download the dependencies and setup the development environment.
  3. Have a host application ready.
  4. Run yarn build --watch to automatically transpile code as you save the file. You can omit the --watch flag if you want to run the build only once.
  5. In a different terminal, run yalc publish to publish the neeto-commons-frontend to the local yalc store.
  6. Run yalc install to install the neeto-commons-frontend to the host application.
  7. After making all changes to neeto-commons-frontend, run yalc push to push the changes to the host application.
  8. Video explanation on how to use yalc: https://vimeo.com/722958162/9e931b640c

Building and releasing.

This is how releases are managed in this repo.

  • We will create a branch with the next release version as its name (1.0.x) from master branch.
  • Version in README.md and package.json will be updated to the current branch name.
  • From now on, we can install the package to neeto-applications using the version 2.X.Y.
  • We will create a draft PR of this branch targeting master. This keeps the branch in sync with master branch (bot-bigbinary will auto-merge the changes).
  • When all features have been built, we will deploy it to all neeto-applications locally using yalc package manager. We won't raise PR until the deployment and verification is successfully done locally for all neeto-applications. The usage of yalc is explained in this video: https://vimeo.com/722958162/9e931b640c
  • In case if we notice any problem during verification, like any missed edge cases, we will fix the problem in this repo and re-run yalc push to install the latest changes.
  • Once everything is fine and the verification is complete, we will create a new github release from 2.X.Y branch with the exact same name for the tag (2.X.Y). The target branch will be kept as 2.X.Y. This will create a tag from the latest 2.X.Y branch and this ensures that the latest commit on that branch will remain intact even if that branch gets deleted.
  • Whenever a new release is created with a new version number, the github actions will automatically publish the built package to npm.
  • Now we will squash and merge the PR 2.X.Y to master and delete its source branch. This will delete all commits except the top one (since we have created a tag with it).
  • Immediately, we will open another branch with the next version (2.X.Y) and the cycle will continue.
  • Now we can run yalc remove neeto-commons-frontend to remove yalc based package and run yarn add neeto-commons-frontend@2.X.Y to fetch the latest changes from npm in all repos and raise PR. You might be able to slightly tweak this script to get the job done: https://gist.github.com/jagannathBhat/42a584748d97fe134f0abadb191ef29a

FAQs

Package last updated on 21 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc