# parched-tasks-webapp

> Adds a webapp workflow to parched

Latest version **0.2.15** (published 2016-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install parched-tasks-webapp
pnpm add parched-tasks-webapp
yarn add parched-tasks-webapp
bun add parched-tasks-webapp
```

## 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.2.15 |
| Published | 2016-05-19 |
| First published | 2014-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mike Wyatt |
| Maintainers | mikewhy |
| Keywords | parched, tasks, webapp, browserify |

## Links

- npm: https://www.npmjs.com/package/parched-tasks-webapp
- Repository: https://github.com/raisedmedia/parched-tasks-webapp
- Issues: https://github.com/raisedmedia/parched-tasks-webapp/issues
- npm.io page: https://npm.io/package/parched-tasks-webapp

## Dependencies (11)

- [watchify](https://npm.io/package/watchify.md) ^3.4.0
- [browserify](https://npm.io/package/browserify.md) ^11.1.0
- [gulp-watch](https://npm.io/package/gulp-watch.md) ^4.3.5
- [gulp-cached](https://npm.io/package/gulp-cached.md) ^1.1.0
- [gulp-concat](https://npm.io/package/gulp-concat.md) ^2.6.0
- [browser-sync](https://npm.io/package/browser-sync.md) ^2.9.3
- [vinyl-buffer](https://npm.io/package/vinyl-buffer.md) ^1.0.0
- [gulp-remember](https://npm.io/package/gulp-remember.md) ^0.3.0
- [gulp-sourcemaps](https://npm.io/package/gulp-sourcemaps.md) v2.0.0-alpha
- [main-bower-files](https://npm.io/package/main-bower-files.md) ^2.9.0
- [vinyl-source-stream](https://npm.io/package/vinyl-source-stream.md) ^1.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.15 (latest) — 2016-05-19
- 0.2.14 — 2016-05-18
- 0.2.13 — 2016-05-18
- 0.2.12 — 2016-05-02
- 0.2.11 — 2016-04-29
- 0.2.10 — 2016-04-29
- 0.2.9 — 2015-12-11
- 0.2.8 — 2015-12-05
- 0.2.7 — 2015-11-04
- 0.2.6 — 2015-09-14
- 0.2.5 — 2015-08-28
- 0.2.4 — 2015-08-17
- 0.2.3 — 2015-06-05
- 0.2.2 — 2015-05-14
- 0.2.1 — 2015-05-13
- … 10 more at https://npm.io/package/parched-tasks-webapp/versions

## README

parched-tasks-webapp
====================

Uses features from [Parched](https://github.com/raisedmedia/parched) and
browserify for pain free development times.
Bower is also supported, though not given the exact same treatement as
`app/` or `vendor/`.

You do have to structure your app a certain way:

```
app/
├── assets/
├── scripts/
├── styles/
└── views/
vendor/
├── assets/
├── scripts/
├── styles/
└── views/
```

However, given this:

```bash
npm install --save gulp parched parched-tasks-webapp
# Okay now we will install some plugins
npm install --save parched-coffee \
    parched-jade \
    parched-minify-css \
    parched-sass \
    parched-svg2png \
    parched-uglify \
    parched-webfont
```

... and a `Gulpfile.js` containing:

```javascript
Parched.setup({
  gulp: gulp,

  parchedWillBuild: function(done) {
    console.log('Before');
    done();
  },

  parchedDidBuild: function(done) {
    console.log('After');
    done();
  }
});
```

... you have a process that will:

- Support bower dependencies.
- Support coffeescript (in `vendor/scripts/` and browserify).
- Support jade (in `app/views/`, `vendor/views/` and browserify).
- Support sass (in `app/styles/` and `vendor/styles/`).
- Support ordering of any concat'd files via `before` and `after` properties.
- Build a webfont based on .svg files in `app/assets/glyphs/`.
- Build both a retina and non-retina spritemap based on .svg files in `app/assets/sprites/`.
- Minify javascript in production.
- Minify css in production.
- Error hard in production.
- Use browserSync in development.
- Stay out of your way.
- Allow you to intervene at pretty much any point.

Usage
-----

To cleanup `public/` and `tmp/`:

```bash
gulp parched-clean
```

To watch files in development

```bash
gulp parched-watch
```

To build everything:

```bash
gulp parched-build
```

To build and minify everything:

```bash
NODE_ENV=production gulp parched-build
```

Bundles
-------

`parched-tasks-webapp` has a concept of "bundles". Directories of files
are considered to be a "bundle", provided there is some configuration.

The default bundle is `app`, and its configuration looks like:

```javascript
Parched.setup({
  webapp: {
    bundles: {
      app: {
        src: './app/',
        dest: './public/',
        shouldCopyVendor: true,
        shouldConcatVendor: false
      }
    }
  }
})
```

What this means is scripts in `./app/` will be built as
`./public/app.js`, styles will be concated to `./public/app.css`,
and any assets / views will go to `./public/`.

The `src` property will default to the bundle name and if no bundles
specify `shouldCopyVendor` then it is set for you on the first bundle.
Set `shouldConcatVendor` if you would like the vendor scripts and styles
to be concated to the beginning of the bundle files.

**Note for Parched plugin authors**

Because this behavior is specific to `parched-tasks-webapp` and messes
up any generic paths your workflow may assume, check for
`streamContext.bundleName` in your plugins method.

```javascript
export default function (Parched) {
  Parched.createPlugin({
    displayName: 'my-awesome-plugin',
    
    transform (streamContext) {
      let src = '**/*.svg'
      let dest = 'public/'
      
      if (streamContext.bundleName) {
        // we are being called by `parched-tasks-webapp`
        src = `${streamContext.bundleSrc}/**/*.js`
        dest = streamContext.bundleDest
      }
    }
  })
}
```

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