@nerdjs/nerd-network v2.0.8
@nerdjs/nerd-network library
A Nerd-network library to handle API calls. This library is bootstrapping with TSDX.
Features
- Zero-setup. After running
npm install
things will setup for you - RollupJS for multiple optimized bundles following the standard convention and Tree-shaking
- Prettier and TSLint for code formatting and consistency
- Automatic types
(*.d.ts)
file generation
Commands
TSDX scaffolds the new library inside /src
.
To run the library, use:
npm start # or yarn start
This builds to /dist
and runs the project in watch mode so any edits you save inside src
causes a rebuild to /dist
.
To do a one-off build, use npm run build
or yarn build
.
To run tests, use npm test
or yarn test
.
Importing library
You can import the generated bundle to use the whole library generated by this starter:
import <feature> from '@nerdjs/nerd-network'
NPM scripts
npm start
: Runnpm run build
in watch modenpm run build
: Generate bundles and typings, create docsnpm run lint
: Lints codeprettier-format
: Add setting up prettier format to code
Work locally
In order to use this library locally and make any change, inside /src
use:
yarn link
This will create a symlink that can be use in the main project as:
yarn link "@nerdjs/nerd-network"
Bundle Analysis
size-limit
is set up to calculate the real cost of your library with npm run size
and visualize the bundle with npm run analyze
.
Excluding peerDependencies
On library development, one might want to set some peer dependencies, and thus remove those from the final bundle. You can see in Rollup docs how to do that.
Rollup
TSDX uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.
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. 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.
2 months ago
3 months ago
4 months ago
5 months ago
5 months ago
8 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago