npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-schematic-builder

v0.2.0

Published

A tool for building Angular schematic projects. Compiles and packages your custom schematics, preparing them for publishing and use.

Readme

Angular Schematic Builder

A custom Angular builder for compiling and bundling Angular schematics.

Table of Contents

Overview

This project provides a builder for Angular schematics that:

  • Compiles TypeScript files using a specified tsconfig
  • Cleans the output directory
  • Copies specified project files to the output directory
  • Prepares a clean package.json for distribution

Getting Started

Create an empty schematics project

(skip if you have one)

Install cli globally

npm install -g @angular-devkit/schematics-cli

Create a new project

schematics blank --name=new-project

Installation dependencies

npm i -D @angular/cli ngx-schematic-builder

Usage

Create or edit (if you have) angular.json file and put build prop in projects.*project name*.architect.

You can copy the configuration from below.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "projects": {
    "schematic": {
      "projectType": "library",
      "root": "",
      "sourceRoot": "src",
      "architect": {
        "build": {
          "builder": "ngx-schematic-builder:build",
          "options": {
            "files": ["src/**", "LICENSE.md", "README.md"],
            "tsConfig": "tsconfig.json"
          }
        }
      }
    }
  }
}

Options

| Option | Type | Description | Required | | --- |-----------| --- | --- | | tsConfig | string | Path to the TypeScript configuration file | Yes | | files | string[] | Array of files to copy to the output directory | No |

TS Config update

{
  "compilerOptions": {
    "baseUrl": "tsconfig",
    "target": "es6",
    "declaration": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "noEmitOnError": true,
    "noFallthroughCasesInSwitch": true,
    "esModuleInterop": true,
    "noImplicitAny": true,
    "noImplicitThis": true,
    "noUnusedParameters": true,
    "noUnusedLocals": true,
    "skipDefaultLibCheck": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strictNullChecks": true,
    "types": ["node"],
    "outDir": "dist" // Add this
  }
}

Package.json update

Change package.json the "schematic" property from this

{
  "schematics": "./src/collection.json"
}

To this:

{
  "schematics": "./collection.json"
}

Why? After build, there is no src folder, and dist files are directly next to the package.json file.

Build

Run command:

ng build 

Output Structure

After running the build command, your output directory (as specified in your tsconfig) will contain:

  • Compiled JavaScript files from your TypeScript source
  • Declaration files (.d.ts)
  • A cleaned package.json (without scripts and devDependencies)
  • Any additional files specified in the files option

See usage in the package:

@ng-zen/cli

Features

  • TypeScript Compilation: Compiles your TypeScript files according to the specified tsconfig
  • Output Cleaning: Ensures a clean output directory before building
  • File Copying: Copies specified project files to the output directory
  • Package.json Optimization: Removes development-related configurations (scripts, devDependencies) from the output package.json

Build Process

The builder executes the following steps:

  1. Determines the output directory from the tsconfig
  2. Cleans the output directory
  3. Compiles TypeScript files
  4. Copies specified project files to the output directory
  5. Optimizes package.json by removing scripts and devDependencies

Troubleshooting

Common Issues

Issue: Error: Unable to locate or read the "schematic" file specified in package.json. You might need to remove src path Solution: If your tsconfig file has "rootDir": "src" & "outDir": "dist", make you sure your package.json file should looks like this:

{
  // ...
  "schematics": "./collection.json",
  // ...
}

Requirements

  • Node.js (v14.0.0 or later)
  • Angular CLI (v12.0.0 or later)
  • TypeScript (v4.0.0 or later)

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request