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

donejs-deploy

v0.4.2

Published

* [Configuration](#configuration) * [S3 Configuration Options](#s3-configuration-options) * [Firebase Configuration Options](#firebase-configuration-options) * [Writing a New Service](#writing-a-new-service)

Downloads

40

Readme

donejs deploy

The donejs deploy command allows you to bundle up your static assets not touched during the steal build process and deploy them and your JS bundles to a third-party storage/hosting provider like Amazon's S3.

Deploying your assets can be as simple as typing one command: donejs deploy [service].

Configuration

Here is a sample configuration for deploying to Amazon's S3. All deploy configuration options exist in the donejs.deploy of package.json.

"deploy": {
	"root": "dist",
	"services": {
	}
}

deploy.root {String="./dist"}

The relative destination directory for your static assets not bundled by building with StealJS Tools. This should be the same value as dest in your stealTools.build function.

deploy.services {Object}

An object where each property is the name of a service that can be used as an argument to donejs deploy <service>.

The properties in each service object are specific to each service with the exception of type and default.

"services": {
	"production": {
		"type": "s3",
		"default": true,
		"bucket": "donejs.deploy",
		"configPath": "./aws.s3.json"
	}
}

services.<service name>.type {String}

The service that you want to deploy to. There is currently only one option for this property: s3. This is used to select which service module to load from the services directory.

services.<service name>.default {Boolean}

A service that is marked as default is loaded when no argument is provided to the donejs deploy command. If there are multiple objects with default properties that are true, the first one is loaded.

S3 Configuration Options

services.<service name>.bucket {String}

The name of the S3 bucket. If one is not created on S3, a bucket will be created with the name provided. If this property is not provided the value of the name property in package.json is used as default.

services.<service name>.credentials {String}

The relative path to a file containing the two authentication properties: accessKeyId and secretAccessKey. For example, ./aws.s3.json would contain something like:

{
	"accessKeyId": "KFJSKJD9234DSFI",
	"secretAccessKey": "6f5902ac237024bdd0c176cb93063dc4"
}

If this property is not provided the default behavior is to read S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY from the nodejs environment.

Read Configuring the SDK in Node.js for more information about this topic.

Firebase Configuration Options

services.<service name>.config {Object}

The Firebase configuration object specific to your deployment.

Writing a New Service

Create a file in the services directory where the name of the file matches the following convention: service-*.js. The * will be used as the value for the package.donejs.deploy.<service name>.type property. This file should export two properties: properties and deploy.

properties {Array [Object]}

The properties array contains objects with name and desc properties.

properties[].name {String}

The name of a configuration property required by this service type.

properties[].desc {String}

The description of the named property. This is output to the console when the usage is displayed.

properties[].default {Function| String | Number | Boolean | Array}

This value is used by the service if the property does not exist in the selected service object. If the value of default is a function, the property will validate as long as the function returns a truthy value. In the function, this.env can be used to access the process environment, and this.pkg can be used to access the package.json object. The default value or value returned by the function will be placed on the service object so that it can be accessed with the property name expected.

deploy {Function(package, deploy, options, files, err)}

The deploy function is where the service's magic happens.

package {Object}

The package.json object. Provided in case there are contextual project values you wish to use.

deploy {Object}

The deploy property object of package.json.

options {Object}

This is the configuration object of the selected service. It has two properties, name which is the configuration name, and service which is the service configuration specific to your deployment.

files {Array [String]}

The files moved to the directory configured by the dest property.

error {Function(message)}

Call this function when an error has occurred and provide the string that should be shown to the user.