npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@webprovise1/bb-permission

v1.0.17

Published

Common permission library for all Bamboo applications

Downloads

157

Readme

permission-lib

Made with create-react-library

Development

Required

Ensure your environment has the environment variable NPM_TOKEN available or npm scripts will fail with the following error:

error An unexpected error occurred: "Failed to replace env in config: ${NPM_TOKEN}".
  • .env file will not work.
  • You will need to add via Environment Variables tool in Windows or simply export NPM_TOKEN= in *nix terminals. Any value is okay.

Install dependencies

$ yarn install

Build distribution

$ yarn build

Publish to NPM

Reference: https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions

In shorts:

  • POINT 1: Treat the <major.minor.patch> version as official release or the "master branch". Only bump the official version once it needs to be deployed for alpha deployment.
  • POINT 2: If the changes in other applications cannot be merged yet (due to back-end blocking, etc.) but you want to test the integration of the library: bump the major/minor/patch version and add '-alpha.<number>' (e.g: The current version is 1.0.14, you want to create a test a big feature => the new version is 2.0.0-alpha.1)

Note: For multiple people working on different features, you have to use different versions. (e.g: X and Y are working on different features, they should create separate alpha releases - 1.1.1-alpha.1 and 2.0.0-alpha.1; if they needs to re-release again just bump the specific number after alpha)

In-implementation features

If you want to deploy a test version:

  • Update the version property of package.json file using the second method (bump the version and add alpha suffix): major.minor.patch-alpha.number
  • Create a merge request along with your changes
  • The merge request pipeline should be triggered, including two steps:
    • build (to verify if the code can be built) - this step is ran automatically
    • deploy alpha to npm (to deploy the alpha version to npm) - this step must be ran manually, you cannot deploy from this step without having alpha suffix in package version deploy alpha to npm
  • After the alpha version is deployed, update the applications.

Official release

If the feature is approved and ready to merge into the master branch. You should do the following

  • Update the version property of package.json file using the first method (without alpha suffix): major.minor.patch
  • Push the change to your existing merge request
  • The merge request pipeline should be triggered, including two steps:
    • build (to verify if the code can be built) - this step is ran automatically
    • deploy alpha to npm (to deploy the alpha version to npm) - ignore this step, you cannot deploy from this step without having alpha suffix in package version
  • Get code review, approval and merge into the master branch. The pipeline will deploy the official version to NPM.
  • After the official release is deployed, update the applications.

Usage in applications

Install latest stable version:

Make sure the application project has the .npmrc file:

# .npmrc
@webprovise1:registry=https://registry.npmjs.org
//registry.npmjs.org/:_authToken=<TOKEN - get from team lead>
$ yarn add @webprovise1/bb-permission

Install local version:

  1. In this library project:
$ yarn build    # build files

$ yarn link     # mark the project to be ready for local usage

# You should see something like these
yarn link v1.22.10
success Registered "@webprovise1/bb-permission".
info You can now run `yarn link "@webprovise1/bb-permission"` in the projects where you want to use this package and it will be used instead.
Done in 0.06s.
  1. In the application project:
# Start using local library
$ yarn link "@webprovise1/bb-permission"

# You should see something like these
yarn link v1.22.10
success Using linked package for "@webprovise1/bb-permission".
Done in 0.07s.

# To use the NPM version again
$ yarn unlink "@webprovise1/bb-permission"

# remove and add again if you don't see the original version
$ yarn remove @webprovise1/bb-permission
$ yarn add @webprovise1/bb-permission

Import in codebase

import { PermissionRoute, TracePermission } from '@webprovise1/bb-permission';

License

MIT ©