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

aurelia-seabreeze

v0.0.2

Published

Aurelia breeze kickstarter

Readme

Aurelia Seabreeze

A small library to quickly get rocking with aurelia-breeze. Based on the sample northwind app: aurelia-breeze-northwind and tried to make the code more abstract/general and thus easily reusable for different entities.

Install

npm i aurelia-seabreeze --save

Usage

You will need to create the following:

  • EntityManager factory method
  • Section with entity router
  • Service (with service queries)
  • Entity lookups (with lookup queries)
  • Entity VM
  • Entities VM

Then you can create views for your VMs as you find appropriate to display/manage your entity data

EntityManager factory

breeze settings for EntityManager

// settings.js

export default {
  serviceName: "http://sampleservice.breezejs.com/api/northwind",
  pageSize: 100,
};

For the EntityManager factory method we use our settings.

// createEntityManager.js

import settings from './settings';
import { EntityManagerFactory } from 'aurelia-seabreeze';

export createEntityManager() {
  return new EntityManagerFactory(settings).entityManager;
} 

Note that the settings can also include a logger entry which provides a logger function logChanges(data). See src/logger.js for the default logger provided.

Entity Section

The OrderSection is the entry point for the Order entity is itself a child-router

// orders/order-sections

import { EntitySection } from 'aurelia-seabreeze'; 

class OrderSection extends EntitySection {
  constructor() {
    super('order');
  }
}

It will create a router with the following routes, defined in the getter routeMap (override if you need to).

  { route: '',    moduleId: `./order-list`, nav: false, title: '' },
  { route: ':id', moduleId: `./order`,      nav: false, title: '' },

Service queries

You should create a (possibly paged) list query and one or more queries to retrieve one entity (usually by id).

Example:

// service-queries.js

import query from '../query';

const pagedList = query()
      .from('Orders')
      .select('OrderID, Customer.CompanyName, Employee.FirstName, Employee.LastName, OrderDate, Freight')
      .orderByDesc('OrderDate')
      .skip(pageIndex * settings.pageSize)
      .take(settings.pageSize)
      .inlineCount();

function queriesById({id}) {
  return [
    query().from('Orders').where('OrderID', '==', id),
    query().from('OrderDetails').where('OrderID', '==', id)
  ]
}
 
export default {
  order: {
    list: pagedList,
    oneBy: queriesById
  }
}  

Entity service

We create an OrderService for the Order entity

import { EntityService } from 'aurelia-seabreeze';
import { serviceQueries } from './service-queries';
import { createEntityManager } from './entity-manager'

class OrderService extends EntityService {
  constructor() {
    super('order');
  } 

  get queries() {
    return serviceQueries;
  }

  get entityManager() {
    return createEntityManager();
  }
}

Entity lookup queries:

// lookup-queries.js

import query from './query';

const customersQuery = query()
  .from('Customers')
  .select('CustomerID, CompanyName')
  .orderBy('CompanyName');

const productsQuery = query()
  .from('Products')
  .select('ProductID, ProductName, UnitPrice')
  .orderBy('ProductName');

export default [
  {customers: customersQuery},
  {products: productsQuery}
]

We use this to create an EntityLookups aggregator

// lookups.js

import lookupQueries from './lookup-queries';
import { Lookups } from 'aurelia-seabreeze';

export class EntityLookups extends Lookups { 
  get entityManager() {
    return createEntityManager();
  }

  get lookupQueries() {
    return lookupQueries;
  }
}

Entity VM

For the Order VM we inject OrderService and EntityLookups as singletons.

import { Entity } from 'aurelia-seabreeze';
import { OrderService } from './order-service';
import { EntityLookups } from './entity-lookups';

@inject(OrderService, EntityLookups)
class Order extends Entity {
  constructor(service, lookups) {
    super('order', service, lookups);
  }
}

Entities VM

Then create an Order VM injecting OrderService and Router. We also pass the plural entity name as the route, ie. orders and optionally some settings, such as pageSize

import { EntityList } from 'aurelia-seabreeze';
import {OrderService} from './order-service';
import {Router} from './aurelia-framework';

@inject(Router, OrderService)
class OrderList extends EntityList {
  constructor(router, service}) {
    super('orders', router, service, {pageSize: 50})
  }  
}

Now we are good to go!!

PS: This is still very experimental! Let me know how it works out for you ;)

Notes

The included src files: lookup-queries.js and section/service-queries.js are simply there to demonstrate how these queries should be defined and exported for use.