Skip to content

Commit a3f0870

Browse files
committed
Merge pull request #6 from achambers/update-readme-for-0.5.0
Update README for 0.5.0
2 parents b618036 + 11fdc4c commit a3f0870

File tree

3 files changed

+62
-24
lines changed

3 files changed

+62
-24
lines changed

README.md

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,99 @@
11
# ember-cli-deploy-gzip
22

3-
NOTE: This plugin targets ember-cli-deploy 0.5.0 and later. 0.5.0 is in development at this time.
3+
> An ember-cli-deploy plugin to compress files in-place using gzip compression
44
5-
This ember-cli-deploy plugin compresses files in-place using gzip compression.
5+
<hr/>
6+
**WARNING: This plugin is only compatible with ember-cli-deploy versions >= 0.5.0**
7+
<hr/>
68

7-
This is helpful to prepare for upload to a asset host that expects files to be
8-
pre-compressed.
9+
This plugin compresses files in-place using gzip compression. This is helpful to prepare for upload to an asset host that expects files to be pre-compressed.
10+
11+
## What is an ember-cli-deploy plugin?
12+
13+
A plugin is an addon that can be executed as a part of the ember-cli-deploy pipeline. A plugin will implement one or more of the ember-cli-deploy's pipeline hooks.
14+
15+
For more information on what plugins are and how they work, please refer to the [Plugin Documentation][1].
16+
17+
## Quick Start
18+
19+
To get up and running quickly, do the following:
20+
21+
- Ensure [ember-cli-deploy-build][2] is installed and configured.
22+
23+
- Install this plugin
24+
25+
```bash
26+
$ ember install ember-cli-deploy-gzip
27+
```
28+
29+
- Run the pipeline
30+
31+
```bash
32+
$ ember deploy
33+
```
934

1035
## Installation
1136

12-
* `ember install ember-cli-deploy-gzip`
37+
Run the following command in your terminal:
38+
39+
```bash
40+
ember install ember-cli-deploy-gzip
41+
```
1342

1443
## ember-cli-deploy Hooks Implemented
1544

16-
* configure
17-
* willUpload
45+
For detailed information on what plugin hooks are and how they work, please refer to the [Plugin Documentation][1].
46+
47+
- `configure`
48+
- `willUpload`
49+
1850

1951
## Configuration Options
2052

53+
For detailed information on how configuration of plugins works, please refer to the [Plugin Documentation][1].
54+
2155
### filePattern
2256

2357
Files matching this pattern will be gzipped.
2458

25-
_Default:_ "\*\*/\*.{js,css,png,gif,jpg,map,xml,txt,svg,eot,ttf,woff,woff2}"
59+
*Default:* `'\*\*/\*.{js,css,png,gif,jpg,map,xml,txt,svg,eot,ttf,woff,woff2}'`
2660

2761
### distDir
2862

29-
Directory where assets have been written to
63+
The root directory where the files matching `filePattern` will be searched for. By default, this option will use the `distDir` property of the deployment context, provided by [ember-cli-deploy-build][2].
3064

31-
_Default:_ the `distDir` property of the deployment context
65+
*Default:* `context.distDir`
3266

3367
### distFiles
3468

35-
The Array of built assets.
69+
The list of built project files. This option should be relative to `distDir` and should include the files that match `filePattern`. By default, this option will use the `distFiles` property of the deployment context, provided by [ember-cli-deploy-build][2].
3670

37-
_Default:_ the `distFiles` property of the deployment context
71+
*Default:* `context.distDir`
3872

3973
### zopfli
4074

41-
Use node-zopfli for compression (better than regular gzip
42-
compression, but slower). If you set this to `true`, you
43-
will need to `npm install node-zopfli --save-dev` in your app.
75+
Use node-zopfli for compression (better than regular gzip compression, but slower).
76+
77+
If set to `true`, you will need to `npm install node-zopfli --save-dev` in your app.
4478

45-
_Default:_ false
79+
*Default:* `false`
4680

4781
## Prequisites
4882

49-
The default configuration of this plugin expects the deployment context to have `distDir` and `distFiles` properties. These are conveniently created by the [ember-cli-deploy-build](https://github.com/zapnito/ember-cli-deploy-build) plugin so will work out of the box if you are using that plugin.
83+
The following properties are expected to be present on the deployment `context` object:
84+
85+
- `distDir` (provided by [ember-cli-deploy-build][2])
86+
- `distFiles` (provided by [ember-cli-deploy-build][2])
5087

5188
## Plugins known to work well with this one
5289

53-
[ember-cli-deploy-build](https://github.com/zapnito/ember-cli-deploy-build)
54-
[ember-cli-deploy-s3](https://github.com/zapnito/ember-cli-deploy-s3)
90+
[ember-cli-deploy-build][2]
91+
[ember-cli-deploy-s3][3]
5592

5693
## Running Tests
5794

58-
* `npm test`
95+
- `npm test`
96+
97+
[1]: http://ember-cli.github.io/ember-cli-deploy/plugins "Plugin Documentation"
98+
[2]: https://github.com/zapnito/ember-cli-deploy-build "ember-cli-deploy-build"
99+
[3]: https://github.com/zapnito/ember-cli-deploy-s3 "ember-cli-deploy-s3"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"dependencies": {
4646
"chalk": "^1.0.0",
4747
"core-object": "^1.1.0",
48-
"ember-cli-deploy-plugin": "0.1.2",
48+
"ember-cli-deploy-plugin": "0.1.3",
4949
"ember-cli-babel": "^5.0.0",
5050
"minimatch": "^2.0.8",
5151
"redis": "^0.12.1",

tests/unit/index-nodetest.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ describe('gzip plugin', function() {
8989
ui: mockUi,
9090
config: config
9191
};
92-
debugger;
9392
plugin.beforeHook(context);
9493
});
9594
it('does not warn about missing optional config', function() {
@@ -101,7 +100,6 @@ describe('gzip plugin', function() {
101100

102101
return previous;
103102
}, []);
104-
console.log(messages);
105103
assert.equal(messages.length, 0);
106104
});
107105
});
@@ -151,7 +149,6 @@ describe('gzip plugin', function() {
151149
assert.deepEqual(result, { gzippedFiles: ['assets/foo.js'] });
152150
done();
153151
}).catch(function(reason){
154-
console.log(reason.actual.stack);
155152
done(reason);
156153
});
157154
});

0 commit comments

Comments
 (0)