Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

lightcraft

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightcraft

Tool for deploying frontend apps to cloud

latest
npmnpm
Version
0.0.3
Version published
Weekly downloads
7
75%
Maintainers
1
Weekly downloads
 
Created
Source

:rocket: Lightcraft

Lightcraft is a tool for deploying frontend apps to cloud.

Install

npm install lightcraft

Introduction

To deploy with Lightcraft, you don't need to set up any infrastructure, all you need is an account at some cloud storage service. Currently it supports only Google Cloud Storage, but adding more providers is not hard.

Lightcraft supports rolling releases, so you always can switch back to the previous release if something goes wrong.

To ensure that files that have not changed across deployments remain cached on clients, Lightcraft stores files of all releases in the single directory. Because of this you need to set up your build to:

  • Insert hashes of files content into the filenames.
  • Generate manifest.json file. If you use webpack, you can do it with webpack-manifest-plugin.

Deploy process

During the deploy process Lightcraft performs following steps:

  • Creates lockfile in the upload directory, so another deploy process can't be started, until current deploy is finished.
  • Uploads new files. To save time if some of the files was not changed since last release, it will not reupload them.
  • Uploads manifest and updates releases.json file.
  • Cleans up. Removes old releases that you no longer want to keep and files remaining after unsuccessful deployments.
  • Removes lockfile.

Configuration

Lightcraft can load configuration from .lightcraftrc file in JSON/YAML format or lightcraft.config.js file in your project. Configuration has following options:

// lightcraft.config.js
module.exports = {
    // path to directory with files
    filesPath: './build',

    // path to manifest file
    manifestPath: './build/manifest.json',

    // path for deploy on server
    uploadPath: 'releases',

    // number of releases you want to keep
    keepReleases: 3,

    // cloud provider, currently only Google Cloud Storage is supported
    provider: 'GCS',

    // options for Google Cloud Storage
    GCSOptions: {
        projectId: 'project-id',
        bucketName: 'bucket-name',
        keyFilename: './key.json'
    }
}

Commands

deploy [--config file]

Deploy files to cloud.

cleanup [--config file]

Clean files of old and unsuccessfull releases.

unlock [--config file]

Manually unlock. Use when something went wrong.

reset [--config file]

Removes deploy directory.

License

This software is released into the public domain. See the LICENSE file.

FAQs

Package last updated on 29 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts