Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nccpo

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nccpo

A tool to further optimize packages built with @zeit/ncc

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

ncc package optimization

nccpo sits on top of the @zeit/ncc project, and adds additional optimization to the generated builds by stripping away bundled package.json dependencies and automatically pack-ing the build.

Following in the steps of zeit's philosophy of zero configuration, there is no configuration needed to run nccpo:

nccpo build ./src/index.ts -o dist [-- pack arguments]

All other commands are passed directly to the @zeit/ncc module, making nccp a full stand-in:

npx nccpo run src/index.ts

Installation

The package can be installed globally or run by npx

yarn add nccpo @zeit/ncc@^0.20.5

Usage

This module provides a simple CLI command, nccpo, that fronts the @zeit/ncc project with a bit of additional build behavior.

If combined with Yarn or npm, it can be run as:

yarn nccpo help
# or
npx nccpo help

It can also be used as part of an npm script:

{
  "scripts": {
    "build": "tsc",
    "predist": "yarn test",
    "dist": "nccpo build src/index.js -o dist",
    "prepublishOnly": "yarn dist"
  },
  "devDependencies": {
    "@camacho/nccp": "latest"
  }
}
yarn format:pkg

CLI

The CLI accepts the @zeit/ncc build arguments:

yarn @camacho/nccp build src/index.ts -o dist

Integrating

Development

The repository comes with several built in tools to help maintain the package. All the scripts are run through yarn.

Building

To create a production ready version of the application, run:

yarn dist

To create a fresh, unbundled build of the application, run:

yarn build

To go into watch mode (which is not necessary for testing):

yarn dev

Docs

Documentation helps lower the barrier of entry and get new users involved. It can also make them feel welcome to the project and more willing to contribute or ask questions.

To keep the documentation up to date, run:

yarn docs

Formatting

To help remove any worries about content consistency, formatting is managed automatically with prettier, and format-package.

These formatters can be run with:

yarn format

Linting

The code linters help catch simple bugs and keep the codebase consistent. They can be run with:

yarn lint
Commit Messages

Commit messages are linted with commitlint to help with consistency and enable semantic-release in the future.

Git Hooks

A series of GitHooks have been setup and are managed through husky and lint-staged. These hooks automate dependency installation, formatting, testing, commit linting, and a host of other behavior.

Scripts

These scripts can be run via yarn or npm run:

ScriptDescription
buildtranspile TypeScript files in the src directory into JavaScript files in the build directory
cleanclean build and dist directory
devrun ts-node-dev with src/cli/index.ts entrypoint
distpackage a dist version of the repository (dogfooding)
docsupdate auto-generated-content blocks in Markdown files
formatformat repository code
format-packageformat package.json files using format-package
format-sourceformat source content using prettier
gamutrun the full gamut of checks - reset environment, generate docs, format and lint code, run tests, and build
lintlint the application code
prepublishOnlybuild the package before publishing
prereleaseyarn gamut
releasesemantic-release
resetclean dist, build, and node_modules directories
startrun the compiled application from dist directory
start-devrun the application using ncc run
type-checkcheck source types

Note - This repo depends on husky and lint-staged to automatically format code and update documents. If these commands are not run, code changes will most likely fail.

Keywords

FAQs

Package last updated on 04 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc