0.1.0 • Published 4 years ago

@silkstudio/styled-utils v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Styled Utils

Utility functions used for creating styled components with the ability to be styled within jsx through props.

Development

yarn start or npm start           # Run TSDX
yarn build or npm run build       # Create a one-off build
yarn test or npm test             # Run jest tests

Styled Utils is scaffolded using TSDX within /src. yarn start builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.

size-limit is set up to calculate the real cost of the library with npm run size and visualize the bundle with npm run analyze.

TSDX uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.

Continuous Integration

GitHub Actions

Two actions are added by default:

  • main which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
  • size which comments cost comparison of your library on every pull request using size-limit

Optimizations

Please see the main tsdx optimizations docs. In particular, know that you can take advantage of development-only optimizations:

// ./types/index.d.ts
declare var __DEV__: boolean;

// inside your code...
if (__DEV__) {
  console.log('foo');
}

You can also choose to install and use invariant and warning functions.

Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in package.json and dist/index.js accordingly. Please report if any issues are found.

Named Exports

Per Palmer Group guidelines, always use named exports. Code split inside your React app instead of your React library.