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

@chopsui/log-viewer

v1.4.0

Published

React and MUI based log data viewer.

Downloads

30

Readme

Log-viewer component

A component library that provides UI to display and handle logs. It was built using ReactJS, MUI, and Virtusoo.

Installation

  1. Install the required dependencies:

    npm install react react-dom @mui/material @emotion/react @emotion/styled
  2. Install via npm:

    npm install @chopsui/log-viewer

Note: Ensure that @chopsui packages are allowlisted in Skia NPM registry for your project.

Local development

There are two methods to locally test the component:

  1. Testing the component with Storebook.

  2. Testing the component's integration with your project.

Using Storybook

  • You can build log-viewer's components and see how look and act in isolation using Storybook.

  • An example of this works is included under src/base_component/base_component.stories.tsx.

Integrating the component with your project

In order to integrate the component with your project we will use npm-link. NPM-link creates a symbolic link for the project in the global NPM repository.

Set up local development:

  1. At the top directory of log-viewer run:

    npm link

    This will create a link to your local npm library copy in your global node_modules.

  2. Then at your UI project's top directory run:

    npm link @chopsui/log-viewer
  3. Ensure that your jest config in your project has the following config:

    moduleDirectories: ['<rootDir>/node_modules', 'node_modules']

    This ensures that the library can work with local development environments and jest.

    This will use the linked version of the log-viewer from your global npm_modules.

Clean up after local development:

  1. Only run this after you have finished your work and after publishing the changes to npm registry.

  2. Update the version of @chopsui/log-viewer in your package.json to the one you have published.

  3. At your project's top directory run:

    npm ci @chopsui/log-viewer

    This will install the version you just published and undo the linking.

This will not remove the link we created in the global node_modules, which allows us to reuse this link later, rather this will only remove it from the project.

If you want to delete the global link as well, run this in the top directory of log-viewer:

npm unlink -g

If you are not yet ready to use the published version, you can skip step 2 and just run step 3, which reset the version to the one you had before linking.

Integrating the component with your project (Without Linking)

Alternatively, you can utilize npm local paths to test local changes against your project.

e.g. directly install the library in your project's top level directory:

npm install -S /usr/local/google/home/$USER/cr/infra/crdx/packages/log-viewer

Technical guidelines for development

  1. All components must be extracted in the top directory, except for sub components.

  2. All folders must include an index.ts files that exposes the components and files that will be exposed as an external API.

  3. Ensure that your changes are backwards compatible and ideally also forward compatible, if a breaking change has to be introduced, then discuss this with the other team.

  4. Versioning: a. Use PATCH versions for bugfixes and security updates. b. use MINOR versions for new components or features.

  5. After making your changes and before subtmitting the CL, you must run this command to ensure the version is updated in the same CL:

    npm run versionPatch # for patch updates
    
    npm run versionMinor # for minor updates

Publishing the library to npm

  1. Only publish the package after you have submitted your changes CL changes.

  2. After versioning your package run:

    npm publish