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

@mskcc/components-react

v2.1.0

Published

**Deprecated**: This package has been deprecated. We recommend using `@mskcc/carbon-react`instead.

Downloads

22

Readme

Deprecated: This package has been deprecated. We recommend using @mskcc/carbon-reactinstead.

DSM React Component TypeScript and JavaScript transpiler.

TypeScript cheatsheet

This setup is meant for developing React component libraries that can be published to NPM.

Get Started

# npm
npm install @mskcc/components-react

# yarn
yarn @mskcc/components-react

Import into your component

import { Header, Footer } from '@mskcc/components-react';

If you get a hook error, you'll need to point component-react to the package's react and react-dom you're trying to run.

// in demo-react-spa directory
cd node_modules/react && npm link
cd .../react-dom && npm link

// Go to components-react direction
npm link react
npm link react-dom

How it works

  • This package builds to /dist.
  • New components are to be housed in src/ts with it being exported from src/index.ts.
    • Components are written in TypeScript, then transpiled to JavaScript.
  • demo directory has a lightweight page that will render your component.
  • The default demo imports and live reloads whatever is in /dist. No symlinking required via Parcel's aliasing.

Code Quality

Code quality is set up for you with prettier and eslint. Adjust the respective fields in package.json accordingly.

Setup Files

This is the folder structure we set up for you:

/demo
  index.html      # add cdn and other header elements here
  index.tsx       # add your component
  package.json
  tsconfig.json
/src
  index.ts        # export all your components here
  /components     # house your components here
rollup.config.js  # config file for transpiling to CJS, ESM, UMD
tsconfig.json     # config file to handle and compiling TypeScript files

Rollup

This package uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings.

TypeScript

tsconfig.json is set up to interpret dom and esnext types, as well as react for jsx. Adjust according to your needs.

Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in package.json and dist/index.js accordingly.

Deploying the demo Playground

The Playground is just a simple Parcel app, you can deploy it anywhere you would normally deploy that.

# components-react/demo/package.json
npm run build # builds to dist

Named Exports

always use named exports. Code split inside your React app instead of your React library.

Including Styles

  • CSS-in-JS
  • We can inject the style sheet into the component (TBD)