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

aurelia-config

v0.2.0-0

Published

A configuration service for aurelia plugins.

Downloads

91

Readme

aurelia-config

Aurelia-config is an aurelia plugin that allows you to load and configure plugins in a normalized manner.

Build Status Gitter

Overview

Using this plugin you can make it a lot easier to allow for configuration using IoC.

For plugin developers

You can allow app developers to configure your plugin through a simple config object. The way you expose it is simple: export an object literal called config, and give it a namespace / key to use. This is the same object your configure() function will receive upon plugin-configuration time.

// your-plugin.js

export function configure(aurelia, config) {
  // config is pojo
}

export {
  /* you need to namespace your defaults */
  'your-plugin': {
    /* This is your (optional) default config. */
  }
} as config;

Now app developers can use this config. Keep on reading to figure out how.

For app developers

In stead of using .plugin() for every plugin, you only use it for the aurelia-config plugin. Aurelia-config will register the rest of the plugins, using the corresponding namespace segment of your exported default config (if existing) merged with the appConfigOverwrites.

// Example config
let appConfigOverwrites = {
  'aurelia-api': {
    endpoints: [
      {name: 'api', url: 'http://127.0.0.1:1337/'}
    ]
  },
  'aurelia-notification': {
    baseClass: 'custom-notifications'
  }
};

// Configure function
export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .plugin('aurelia-config', configure => {
      return configure([
        'aurelia-api',
        'aurelia-notification',
      ], appConfigOverwrites);
    });
}

Used By

This library is used by plugins and applications.

Uses

Documentation

You can find usage examples and the documentation at aurelia-config-doc.

The changelog provides you with information about important changes.

Installation for plugin developers

If you additionally want to use aurelia-config to access the global configuration, you can install it for Jspm with jspm i aurelia-config from your plugin root resp. npm i aurelia-config --save for webpack or aurelia-cli.

Installation for applications

Aureli-Cli

Run npm i aurelia-config --save from your project root.

Aurelia-config makes use homefront. So, add following to the build.bundles.dependencies section of aurelia-project/aurelia.json.

"dependencies": [
  // ...
  {
    "name": "homefront",
    "path": "../node_modules/homefront/dist",
    "main": "index"
  },
  "aurelia-config",
  // ...
],

Jspm

Run jspm i aurelia-config from your project root.

Add aurelia-config to the bundles.dist.aurelia.includes section of build/bundles.js.

If the installation results in having forks, try resolving them by running:

jspm inspect --forks
jspm resolve --only registry:package-name@version

Webpack

Run npm i aurelia-config --save from your project root.

Add 'aurelia-config' in the coreBundles.aurelia section of your webpack.config.js.

Typescript

Npm-based installations pick up the typings automatically. For Jspm-based installations, run typings i github:spoonx/aurelia-config or add "aurelia-config": "github:spoonx/aurelia-config", to your typings.json and run typings i.