# lightcraft

> Tool for deploying frontend apps to cloud

Latest version **0.0.3** (published 2017-10-29) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install lightcraft
pnpm add lightcraft
yarn add lightcraft
bun add lightcraft
```

Provides the command `lightcraft`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-10-29 |
| First published | 2017-10-29 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| Author | sunflowerdeath |
| Maintainers | sunflowerdeath |

## Links

- npm: https://www.npmjs.com/package/lightcraft
- npm.io page: https://npm.io/package/lightcraft

## Dependencies (7)

- [chalk](https://npm.io/package/chalk.md) ^2.3.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [nanoid](https://npm.io/package/nanoid.md) ^1.0.0
- [commander](https://npm.io/package/commander.md) ^2.11.0
- [node-emoji](https://npm.io/package/node-emoji.md) ^1.8.1
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^3.1.0
- [@google-cloud/storage](https://npm.io/package/@google-cloud/storage.md) ^1.4.0

## Recent versions

- 0.0.3 (latest) — 2017-10-29

## README

# :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](https://github.com/danethurber/webpack-manifest-plugin).


## Deploy process

During the deploy process Lightcraft performs following steps:

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

```js
// 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.

---
_Source: https://npm.io/package/lightcraft · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
