# evergreen-scripts

> Extra Evergreen Scripts

Latest version **0.0.7** (published 2019-02-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install evergreen-scripts
pnpm add evergreen-scripts
yarn add evergreen-scripts
bun add evergreen-scripts
```

Provides the command `evergreen-scripts`.

## 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.7 |
| Published | 2019-02-25 |
| First published | 2019-01-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 77.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Grant Hutchinson |
| Maintainers | hutchgrant |
| Keywords | Web Components, Lit Element, Evergreen |

## Links

- npm: https://www.npmjs.com/package/evergreen-scripts
- Repository: https://github.com/hutchgrant/evergreen-scripts
- Issues: https://github.com/hutchgrant/evergreen-scripts/issues
- npm.io page: https://npm.io/package/evergreen-scripts

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [commander](https://npm.io/package/commander.md) ^2.19.0

## Recent versions

- 0.0.7 (latest) — 2019-02-25
- 0.0.6 — 2019-02-25
- 0.0.5 — 2019-01-20
- 0.0.4 — 2019-01-19
- 0.0.3 — 2019-01-18
- 0.0.2 — 2019-01-16
- 0.0.1 — 2019-01-16

## README

# Evergreen Scripts

[![GitHub release](https://img.shields.io/github/tag/hutchgrant/evergreen-scripts.svg)](https://github.com/hutchgrant/evergreen-scripts/tags)
![CircleCI branch](https://img.shields.io/circleci/project/github/hutchgrant/evergreen-scripts/master.svg?style=plastic)
[![GitHub issues](https://img.shields.io/github/issues-raw/hutchgrant/evergreen-scripts.svg)](https://github.com/hutchgrant/evergreen-scripts/issues)
[![GitHub pulls](https://img.shields.io/github/issues-pr-raw/hutchgrant/evergreen-scripts.svg)](https://github.com/hutchgrant/evergreen-scripts/pulls)
[![GitHub license](https://img.shields.io/badge/license-apache-blue.svg)](https://raw.githubusercontent.com/hutchgrant/evergreen-scripts/master/LICENSE)

## Overview
Additional scripts for [evergreen applications](https://github.com/ProjectEvergreen/create-evergreen-app).

### Project Goals
Extending the functionality and usage of evergreen apps with additional scripts.

#### Under Development
This repo and Project Evergreen itself are still young and maturing rapidly.  The Project Evergreen GitHub organization [project tracker](https://github.com/ProjectEvergreen/project-evergreen/projects) captures the high level goals and next steps, with plans to keep adding those lessons learned as features and improvements to this repo.

> 🙏 Please feel free to contribute, we are always looking forward to meeting like minded developers to collaborate with!

## Serve apps via gh-pages

To make life easier and automate the task of deploying to gh-pages

Install Evergreen Scripts

```
npm i -D evergreen-scripts
```

Add your remote github repository:

```
git remote add YOUR_REPO
```

Modify your `package.json` by adding the script and your github pages url
```js
"homepage": "https://hutchgrant.github.io/evergreen-web-components/",
"scripts": {
    "gh-pages": "evergreen-scripts gh-pages"
}
```

Build, update, and serve files on github pages:

```
npm run gh-pages
```

The script will automatically:

1) (re)initialize git
2) create branch gh-pages, if master doesn't yet exist, it will create an initial commit
3) add git worktree dist with orphaned branch gh-pages
4) create a `ghpages.config.js` cache file containing a publicPath based on the `homepage` value in your package.json
5) create an additional webpack config for your github pages path
6) add a 404.html file that redirects to the index.html file so that routing works as you would expect in a SPA.
7) add a custom index.ghpages.html with a script to replace the state on client redirect
8) add a unique build script to your `package.json` file
9) build project using `webpack.config.ghpages.js`
10) git remove the previous files in gh-pages branch(`dist`)
11) copy build files to worktree(`dist`)
12) commit to gh-pages branch
13) push to gh-pages branch.

Optionally, as of 0.0.6, you can modify the default application `src` directory which the script uses, by adding the argument `--src <your-directory>` to the run script. 

E.g. in your `package.json`

```js
"scripts": {
    "gh-pages": "evergreen-scripts gh-pages --src docs"
}
```

Basic information on args and usage can be found by adding `--help` argument.

A guide for usage can be found within the [Project Evergreen wiki](https://github.com/ProjectEvergreen/create-evergreen-app/wiki/Guide-Serving-Apps-via-Github-Pages).  


### License

Released under the Apache-2.0 License

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