2.1.3 • Published 4 years ago

@p1t1ch/package-example v2.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

package-example

Example of simple opensource library with totally useless content 🙃

Point of this package is to show:

  1. how to create an opensource project and publish it to npm
  2. how to build a library with rollup bundler in esm/cjs formats
  3. how to make "tree-shakable" library
  4. how to write simple CLI script
  5. how to use Storybook for development

Usage

First things first, install package:

yarn add @p1t1ch/package-example

Library provides React component Operation and math helpers:

import React from 'react';
import { Operation, math } from '@p1t1ch/package-example';

const SomeComponent = () => <Operation a={16} b={13} func={math.sum} />;

And dummy CLI script – log with "Hello" and yor name from -n argument:

# Hello, p1t1ch
npx package-example -n p1t1ch

Development

yarn <command>Description
storybookStarts a Storybook in dev mode
storybook:buildBuild static Storybook version in docs folder
storybook:serveStarts a static server for docs browsing
buildBuild package
eslintLint all .js, .jsx, .ts and .tsx files
2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago