@guardian/pkgu
TypeScript icon, indicating that this package has built-in type declarations

0.6.2 • Public • Published

@guardian/pkgu

pikachu box

Automatically build @guardian packages for publishing to NPM inline with our recommendations.

npm (scoped)

Installation

Generic badge

yarn add -D @guardian/pkgu

or

npm install -D @guardian/pkgu

Usage

@guardian/pkgu installs a CLI tool called pkgu that you can use to create your build.

Commands

build

Example
// package.json
{
    ...,
    "scripts": {
        "prebuild": "rm -rf dist",
        "build": "pkgu build"
    },
    ...,
}

This will compile your project to a dist directory ready for publishing, performing the following steps:

  1. Lint your package.json and tsconfig.json files and update/add/remove any fields as necessary.
  2. Compile 3 versions of your project:
    1. CommonJS version targetting ES2018 (for Node 10+).
    2. ESM version targetting ES2020 for use by bundlers (see Using @guardian NPM packages in the recommendations for more info).
    3. TypeScript declaration files.
  3. Check that the build artefacts match the package.json config.
  4. If your package provides a CLI it will set the permissions needed to make it executable.

You should then be good to publish.

Requirements

  • Your source code is written in TypeScript.
  • The source code lives in a directory called src at the package root level.
  • There is one entry point: src/index.ts.

Readme

Keywords

none

Package Sidebar

Install

npm i @guardian/pkgu

Weekly Downloads

1

Version

0.6.2

License

MIT

Unpacked Size

27.8 kB

Total Files

55

Last publish

Collaborators

  • joecowton1
  • guardian-developers
  • akash1810
  • reetta
  • sndrs
  • mxdvl