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 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-shell-schematic

v0.5.3

Published

A blank schematics

Downloads

20

Readme

pipeline status

Overview

This repository contains a single schematic usable with angular CLI ng new… command.

It will generate a new project in replacement of angular CLI default one.

It can be used like this:

# With Yarn
yarn global install angular-shell-schematic

# With Npm
npm install -g angular-shell-schematic

# In a unix-like shell
ng new <app name> --collection=angular-shell-schematic [--directory=<folder name>] [--title=<some text>] [--prefix=<some prefix>]

You can show a bit more logs by setting the VERBOSE variable:

VERBOSE=true ng new ...

What's in it?

  • Based on Angular CLI 7.3.0
  • TS Lint:
    • a few rxjs tslint rules
    • a few tweaks
  • TS Config:
    • esnext module => unlock dynamic imports => see docs/perfs.md
    • es2015 target => don't care about IE and too old browsers
    • angular language-service for completion, error hints, … in templates in VS Code and Webstorm
  • Docs:
    • nice starting point in docs/ folder with several chapters around perfs, build, git commits, coding style guide, etc. => see docs/
    • generation of automatic docs via yarn scripts (git book + compodoc) => see docs/build.md
  • Package:
    • npm dependencies and scripts required for a decent project
  • Perfs:
    • Icons:
      • Yarn script to generate an svg sprite => see docs/perfs.md
      • Include material icons
    • Bundles:
      • include yarn scripts to use webpack-bundle-analyser, source-maps-explorer and bundle-buddy to better understand what is included in each generated bundle => see docs/perfs.md
  • CI:
    • basic starting point for Gitlab CI
  • Configuration:
    • generate environment.ts via a custom script (CLI) that allows much more flexibility than duplicating it and declaring a new environment in angular.json => see docs/build.md
    • include a starting point to create a release via yarn scripts => see docs/build.md
  • Serve:
    • declare a default reverse proxy => see docs/build.md
    • include a mock module using angular-in-memory-web-api to allows the frontend and backend team to work concurrently (the backend is emulated in memory) => see docs/style.md
  • Tests:
    • use puppeteer for unit tests with karma
    • add jasmine-matchers for more explicit tests
    • add common stubs
  • PWA:
    • include angular service worker
    • cache google fonts
  • UI:
    • include angular material with a well structured and standard approach supporting theming => see docs/style.md
    • Routing:
      • Angular modules are preloaded by default once the app has started
      • On back navigation, it is possible to come back to a scrolled position or anchor
    • include a default navbar with activity indicator and responsive behavior
    • include a snackbar service and an acitivity indicator service
    • include a not found component
  • Redux:
    • include ngrx with effects, router serialization, meta-reducer store-freeze (for protection in development) and store-devtools (for compatibility with redux chrome extension)
    • include a standard lightweight router serializer for perfs
    • propose a simple default structure => see docs/style.md

Development

Building

Before testing it locally you need to build (transpile typescript to javascript).

yarn build

If you want to build automatically after changes, just use tsc watch mode:

yarn build -w

Running locally

To test locally, install @angular-devkit/schematics-cli globally and use the schematics command line tool. That tool acts the same as the generate command of the Angular CLI, but also has a debug mode.

schematics .:ng-new --name=<app name> [--directory=<folder name>] [--title=<some text>] [--prefix=<some prefix>]

Check the documentation with

schematics --help

Debugging

You can debug it with the classic toolkit (chrome devtools or your IDE):

node --inspect-brk $(which schematics) .:ng-new --name=<app name> [--directory=<folder name>] [--title=<some text>] [--prefix=<some prefix>]

With Chrome devtools for instance, you can then go to chrome://inspect and start debugging. For Webstorm, you will need to create a node debugging task, etc.

Unit Testing

yarn test will run the unit tests, using Jasmine as a runner and test framework.

Publishing

Semver versionning and npmjs publishing is done in Gitlab CI via a manual pipeline which takes one env variable as input: NEW_VERSION.

That's it!