├── .gitignore
├── LICENSE
├── README.md
├── client
├── app
│ ├── actions
│ │ └── todo.actions.js
│ ├── app.component.js
│ ├── app.html
│ ├── app.js
│ ├── app.scss
│ ├── components
│ │ └── navigation
│ │ │ ├── navigation.component.js
│ │ │ ├── navigation.controller.js
│ │ │ ├── navigation.html
│ │ │ ├── navigation.js
│ │ │ ├── navigation.scss
│ │ │ └── navigation.spec.js
│ ├── constants
│ │ └── todos.js
│ ├── containers
│ │ └── home
│ │ │ ├── home.component.js
│ │ │ ├── home.controller.js
│ │ │ ├── home.html
│ │ │ ├── home.js
│ │ │ ├── home.scss
│ │ │ └── home.spec.js
│ └── reducers
│ │ ├── index.js
│ │ └── todos.reducer.js
└── index.html
├── generator
└── component
│ ├── temp.component.js
│ ├── temp.controller.js
│ ├── temp.html
│ ├── temp.js
│ ├── temp.scss
│ └── temp.spec.js
├── gulpfile.babel.js
├── karma.conf.js
├── node_modules
├── base64-arraybuffer
│ ├── README.md~
│ └── package.json~
├── console-control-strings
│ └── README.md~
├── fsevents
│ └── node_modules
│ │ ├── console-control-strings
│ │ └── README.md~
│ │ ├── gauge
│ │ ├── CHANGELOG.md~
│ │ └── README.md~
│ │ └── npmlog
│ │ └── CHANGELOG.md~
├── gauge
│ ├── CHANGELOG.md~
│ └── README.md~
├── in-publish
│ └── README.md~
├── normalize-package-data
│ └── test
│ │ └── normalize.js~
├── npmlog
│ └── CHANGELOG.md~
└── querystring
│ ├── .History.md.un~
│ ├── .Readme.md.un~
│ ├── .package.json.un~
│ └── test
│ └── .index.js.un~
├── package-lock.json
├── package.json
├── spec.bundle.js
├── webpack.config.js
├── webpack.dev.config.js
└── webpack.dist.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Component based angular 1.5 app example
2 |
3 | A demo for my blog post at: http://blog.grossman.io/
4 |
5 |
6 | Based on the https://github.com/angularclass/NG6-starter.git starter boilerplate.
--------------------------------------------------------------------------------
/client/app/actions/todo.actions.js:
--------------------------------------------------------------------------------
1 | import { TODOS } from '../constants/todos';
2 |
3 | function addTodo(todo){
4 | return {
5 | type: TODOS.ADD_TODO,
6 | payload: todo
7 | }
8 | }
9 |
10 | function removeTodo(index){
11 | return {
12 | type: TODOS.REMOVE_TODO,
13 | payload: index
14 | };
15 | }
16 |
17 | export default { addTodo, removeTodo };
18 |
--------------------------------------------------------------------------------
/client/app/app.component.js:
--------------------------------------------------------------------------------
1 | import template from './app.html';
2 | import './app.scss';
3 |
4 | let appComponent = {
5 | template,
6 | restrict: 'E'
7 | };
8 |
9 | export default appComponent;
10 |
--------------------------------------------------------------------------------
/client/app/app.html:
--------------------------------------------------------------------------------
1 |
24 |
--------------------------------------------------------------------------------
/client/app/containers/home/home.js:
--------------------------------------------------------------------------------
1 | import angular from 'angular';
2 | import uiRouter from 'angular-ui-router';
3 | import homeComponent from './home.component';
4 |
5 | const homeModule = angular.module('home', [
6 | uiRouter
7 | ])
8 |
9 | .component('home', homeComponent);
10 |
11 | export default homeModule;
12 |
--------------------------------------------------------------------------------
/client/app/containers/home/home.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scopsy/angular-1-redux-starter/3d2510eab606dfb55a16374139ba8fd220758e70/client/app/containers/home/home.scss
--------------------------------------------------------------------------------
/client/app/containers/home/home.spec.js:
--------------------------------------------------------------------------------
1 | import HomeModule from './home'
2 | import HomeController from './home.controller';
3 | import HomeComponent from './home.component';
4 | import HomeTemplate from './home.html';
5 |
6 | describe('Home', () => {
7 | let $rootScope, makeController;
8 |
9 | beforeEach(window.module(HomeModule.name));
10 | beforeEach(inject((_$rootScope_) => {
11 | $rootScope = _$rootScope_;
12 | makeController = () => {
13 | return new HomeController();
14 | };
15 | }));
16 |
17 | describe('Module', () => {
18 | // top-level specs: i.e., routes, injection, naming
19 | });
20 |
21 | describe('Controller', () => {
22 | // controller specs
23 | it('has a name property [REMOVE]', () => { // erase if removing this.name from the controller
24 | let controller = makeController();
25 | expect(controller).to.have.property('name');
26 | });
27 | });
28 |
29 | describe('Template', () => {
30 | // template specs
31 | // tip: use regex to ensure correct bindings are used e.g., {{ }}
32 | it('has name in template [REMOVE]', () => {
33 | expect(HomeTemplate).to.match(/{{\s?vm\.name\s?}}/g);
34 | });
35 | });
36 |
37 | describe('Component', () => {
38 | // component/directive specs
39 | let component = HomeComponent;
40 |
41 | it('includes the intended template',() => {
42 | expect(component.template).to.equal(HomeTemplate);
43 | });
44 |
45 | it('uses `controllerAs` syntax', () => {
46 | expect(component).to.have.property('controllerAs');
47 | });
48 |
49 | it('invokes the right controller', () => {
50 | expect(component.controller).to.equal(HomeController);
51 | });
52 | });
53 | });
54 |
--------------------------------------------------------------------------------
/client/app/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import { TodosReducer } from './todos.reducer';
3 |
4 | export const RootReducer = combineReducers({
5 | todos: TodosReducer
6 | });
7 |
--------------------------------------------------------------------------------
/client/app/reducers/todos.reducer.js:
--------------------------------------------------------------------------------
1 | import { TODOS } from '../constants/todos';
2 |
3 | const initialState = [];
4 |
5 | export function TodosReducer(state = initialState, action) {
6 | switch(action.type) {
7 | case TODOS.ADD_TODO:
8 | return [...state, action.payload];
9 | case TODOS.REMOVE_TODO:
10 | return [
11 | ...state.slice(0, action.payload),
12 | ...state.slice(action.payload + 1)
13 | ];
14 | default:
15 | return state;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/client/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Redux Todo
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/generator/component/temp.component.js:
--------------------------------------------------------------------------------
1 | import template from './<%= name %>.html';
2 | import controller from './<%= name %>.controller';
3 | import './<%= name %>.scss';
4 |
5 | let <%= name %>Component = {
6 | restrict: 'E',
7 | bindings: {},
8 | template,
9 | controller,
10 | controllerAs: 'vm'
11 | };
12 |
13 | export default <%= name %>Component;
14 |
--------------------------------------------------------------------------------
/generator/component/temp.controller.js:
--------------------------------------------------------------------------------
1 | class <%= upCaseName %>Controller {
2 | constructor() {
3 |
4 | }
5 | }
6 |
7 | export default <%= upCaseName %>Controller;
8 |
--------------------------------------------------------------------------------
/generator/component/temp.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scopsy/angular-1-redux-starter/3d2510eab606dfb55a16374139ba8fd220758e70/generator/component/temp.html
--------------------------------------------------------------------------------
/generator/component/temp.js:
--------------------------------------------------------------------------------
1 | import angular from 'angular';
2 | import uiRouter from 'angular-ui-router';
3 | import <%= name %>Component from './<%= name %>.component';
4 |
5 | const <%= name %>Module = angular.module('<%= name %>', [
6 | uiRouter
7 | ])
8 |
9 | .component('<%= name %>', <%= name %>Component);
10 |
11 | export default <%= name %>Module;
12 |
--------------------------------------------------------------------------------
/generator/component/temp.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scopsy/angular-1-redux-starter/3d2510eab606dfb55a16374139ba8fd220758e70/generator/component/temp.scss
--------------------------------------------------------------------------------
/generator/component/temp.spec.js:
--------------------------------------------------------------------------------
1 | import <%= upCaseName %>Module from './<%= name %>'
2 | import <%= upCaseName %>Controller from './<%= name %>.controller';
3 | import <%= upCaseName %>Component from './<%= name %>.component';
4 | import <%= upCaseName %>Template from './<%= name %>.html';
5 |
6 | describe('<%= upCaseName %>', () => {
7 | let $rootScope, makeController;
8 |
9 | beforeEach(window.module(<%= upCaseName %>Module.name));
10 | beforeEach(inject((_$rootScope_) => {
11 | $rootScope = _$rootScope_;
12 | makeController = () => {
13 | return new <%= upCaseName %>Controller();
14 | };
15 | }));
16 |
17 | describe('Module', () => {
18 | // top-level specs: i.e., routes, injection, naming
19 | });
20 |
21 | describe('Controller', () => {
22 | // controller specs
23 | it('has a name property [REMOVE]', () => { // erase if removing this.name from the controller
24 | let controller = makeController();
25 | expect(controller).to.have.property('name');
26 | });
27 | });
28 |
29 | describe('Template', () => {
30 | // template specs
31 | // tip: use regex to ensure correct bindings are used e.g., {{ }}
32 | it('has name in template [REMOVE]', () => {
33 | expect(<%= upCaseName %>Template).to.match(/{{\s?vm\.name\s?}}/g);
34 | });
35 | });
36 |
37 | describe('Component', () => {
38 | // component/directive specs
39 | let component = <%= upCaseName %>Component;
40 |
41 | it('includes the intended template',() => {
42 | expect(component.template).to.equal(<%= upCaseName %>Template);
43 | });
44 |
45 | it('uses `controllerAs` syntax', () => {
46 | expect(component).to.have.property('controllerAs');
47 | });
48 |
49 | it('invokes the right controller', () => {
50 | expect(component.controller).to.equal(<%= upCaseName %>Controller);
51 | });
52 | });
53 | });
54 |
--------------------------------------------------------------------------------
/gulpfile.babel.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | import gulp from 'gulp';
4 | import webpack from 'webpack';
5 | import path from 'path';
6 | import sync from 'run-sequence';
7 | import rename from 'gulp-rename';
8 | import template from 'gulp-template';
9 | import fs from 'fs';
10 | import yargs from 'yargs';
11 | import lodash from 'lodash';
12 | import gutil from 'gulp-util';
13 | import serve from 'browser-sync';
14 | import webpackDevMiddelware from 'webpack-dev-middleware';
15 | import webpachHotMiddelware from 'webpack-hot-middleware';
16 | import colorsSupported from 'supports-color';
17 | import historyApiFallback from 'connect-history-api-fallback';
18 |
19 | let root = 'client';
20 |
21 | // helper method for resolving paths
22 | let resolveToApp = (glob = '') => {
23 | return path.join(root, 'app', glob); // app/{glob}
24 | };
25 |
26 | let resolveToComponents = (glob = '') => {
27 | return path.join(root, 'app/components', glob); // app/components/{glob}
28 | };
29 |
30 | // map of all paths
31 | let paths = {
32 | js: resolveToComponents('**/*!(.spec.js).js'), // exclude spec files
33 | scss: resolveToApp('**/*.scss'), // stylesheets
34 | html: [
35 | resolveToApp('**/*.html'),
36 | path.join(root, 'index.html')
37 | ],
38 | entry: path.join(__dirname, root, 'app/app.js'),
39 | output: root,
40 | blankTemplates: path.join(__dirname, 'generator', 'component/**/*.**')
41 | };
42 |
43 | // use webpack.config.js to build modules
44 | gulp.task('webpack', (cb) => {
45 | const config = require('./webpack.dist.config');
46 | config.entry.app = paths.entry;
47 |
48 | webpack(config, (err, stats) => {
49 | if(err) {
50 | throw new gutil.PluginError("webpack", err);
51 | }
52 |
53 | gutil.log("[webpack]", stats.toString({
54 | colors: colorsSupported,
55 | chunks: false,
56 | errorDetails: true
57 | }));
58 |
59 | cb();
60 | });
61 | });
62 |
63 | gulp.task('serve', () => {
64 | const config = require('./webpack.dev.config');
65 | config.entry.app = [
66 | // this modules required to make HRM working
67 | // it responsible for all this webpack magic
68 | 'webpack-hot-middleware/client?reload=true',
69 | // application entry point
70 | paths.entry
71 | ];
72 |
73 | var compiler = webpack(config);
74 |
75 | serve({
76 | port: process.env.PORT || 3000,
77 | open: false,
78 | server: {baseDir: root},
79 | middleware: [
80 | historyApiFallback(),
81 | webpackDevMiddelware(compiler, {
82 | stats: {
83 | colors: colorsSupported,
84 | chunks: false,
85 | modules: false
86 | },
87 | publicPath: config.output.publicPath
88 | }),
89 | webpachHotMiddelware(compiler)
90 | ]
91 | });
92 | });
93 |
94 | gulp.task('watch', ['serve']);
95 |
96 | gulp.task('component', () => {
97 | const cap = (val) => {
98 | return val.charAt(0).toUpperCase() + val.slice(1);
99 | };
100 | const name = yargs.argv.name;
101 | const parentPath = yargs.argv.parent || '';
102 | const destPath = path.join(resolveToComponents(), parentPath, name);
103 |
104 | return gulp.src(paths.blankTemplates)
105 | .pipe(template({
106 | name: name,
107 | upCaseName: cap(name)
108 | }))
109 | .pipe(rename((path) => {
110 | path.basename = path.basename.replace('temp', name);
111 | }))
112 | .pipe(gulp.dest(destPath));
113 | });
114 |
115 | gulp.task('default', ['serve']);
116 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | module.exports = function (config) {
2 | config.set({
3 | // base path used to resolve all patterns
4 | basePath: '',
5 |
6 | // frameworks to use
7 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
8 | frameworks: ['mocha', 'chai'],
9 |
10 | // list of files/patterns to load in the browser
11 | files: [{ pattern: 'spec.bundle.js', watched: false }],
12 |
13 | // files to exclude
14 | exclude: [],
15 |
16 | plugins: [
17 | require("karma-chai"),
18 | require("karma-chrome-launcher"),
19 | require("karma-mocha"),
20 | require("karma-mocha-reporter"),
21 | require("karma-sourcemap-loader"),
22 | require("karma-webpack")
23 | ],
24 |
25 | // preprocess matching files before serving them to the browser
26 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
27 | preprocessors: { 'spec.bundle.js': ['webpack', 'sourcemap'] },
28 |
29 | webpack: {
30 | devtool: 'inline-source-map',
31 | module: {
32 | loaders: [
33 | { test: /\.js/, exclude: [/app\/lib/, /node_modules/], loader: 'babel' },
34 | { test: /\.html/, loader: 'raw' },
35 | { test: /\.scss$/, loader: 'style!css!sass' },
36 | { test: /\.css$/, loader: 'style!css' }
37 | ]
38 | }
39 | },
40 |
41 | webpackServer: {
42 | noInfo: true // prevent console spamming when running in Karma!
43 | },
44 |
45 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
46 | reporters: ['mocha'],
47 |
48 | // web server port
49 | port: 9876,
50 |
51 | // enable colors in the output
52 | colors: true,
53 |
54 | // level of logging
55 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
56 | logLevel: config.LOG_INFO,
57 |
58 | // toggle whether to watch files and rerun tests upon incurring changes
59 | autoWatch: false,
60 |
61 | // start these browsers
62 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
63 | browsers: ['Chrome'],
64 |
65 | // if true, Karma runs tests once and exits
66 | singleRun: true
67 | });
68 | };
69 |
--------------------------------------------------------------------------------
/node_modules/base64-arraybuffer/README.md~:
--------------------------------------------------------------------------------
1 | # base64-arraybuffer
2 |
3 | [](https://travis-ci.org/niklasvh/base64-arraybuffer)
4 |
5 | Encode/decode base64 data into ArrayBuffers
6 |
7 | ## Getting Started
8 | Install the module with: `npm install base64-arraybuffer`
9 |
10 | ## API
11 | The library encodes and decodes base64 to and from ArrayBuffers
12 |
13 | - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string
14 | - __decode(str)__ - Decodes base64 string to `ArrayBuffer`
15 |
16 | ## Release History
17 |
18 | - 0.1.2 - Fix old format of typed arrays
19 | - 0.1.0 - Initial version, basic decode/encode base64 to and from ArrayBuffer
20 |
21 | ## License
22 | Copyright (c) 2012 Niklas von Hertzen
23 | Licensed under the MIT license.
24 |
--------------------------------------------------------------------------------
/node_modules/base64-arraybuffer/package.json~:
--------------------------------------------------------------------------------
1 | {
2 | "name": "base64-arraybuffer",
3 | "description": "Encode/decode base64 data into ArrayBuffers",
4 | "version": "0.1.1",
5 | "homepage": "https://github.com/niklasvh/base64-arraybuffer",
6 | "author": {
7 | "name": "Niklas von Hertzen",
8 | "email": "niklasvh@gmail.com",
9 | "url": "http://hertzen.com"
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/niklasvh/base64-arraybuffer"
14 | },
15 | "bugs": {
16 | "url": "https://github.com/niklasvh/base64-arraybuffer/issues"
17 | },
18 | "licenses": [
19 | {
20 | "type": "MIT",
21 | "url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT"
22 | }
23 | ],
24 | "main": "lib/base64-arraybuffer",
25 | "engines": {
26 | "node": ">= 0.6.0"
27 | },
28 | "scripts": {
29 | "test": "grunt test"
30 | },
31 | "devDependencies": {
32 | "grunt": "~0.3.17"
33 | },
34 | "keywords": []
35 | }
36 |
--------------------------------------------------------------------------------
/node_modules/console-control-strings/README.md~:
--------------------------------------------------------------------------------
1 | # Console Control Strings
2 |
3 | A library of cross-platform tested terminal/console command strings for
4 | doing things like color and cursor positioning. This is a subset of both
5 | ansi and vt100. All control codes included work on both Windows & Unix-like
6 | OSes, except where noted.
7 |
8 | ## Usage
9 |
10 | ```js
11 | var consoleControl = require('console-control-strings')
12 |
13 | console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))
14 | process.stdout.write(consoleControl.goto(75, 10))
15 | ```
16 |
17 | ## Why Another?
18 |
19 | There are tons of libraries similar to this one. I wanted one that was:
20 |
21 | 1. Very clear about compatibility goals.
22 | 2. Could emit, for instance, a start color code without an end one.
23 | 3. Returned strings w/o writing to streams.
24 | 4. Was not weighed down with other unrelated baggage.
25 |
26 | ## Functions
27 |
28 | ### var code = consoleControl.up(_num = 1_)
29 |
30 | Returns the escape sequence to move _num_ lines up.
31 |
32 | ### var code = consoleControl.down(_num = 1_)
33 |
34 | Returns the escape sequence to move _num_ lines down.
35 |
36 | ### var code = consoleControl.forward(_num = 1_)
37 |
38 | Returns the escape sequence to move _num_ lines righ.
39 |
40 | ### var code = consoleControl.back(_num = 1_)
41 |
42 | Returns the escape sequence to move _num_ lines left.
43 |
44 | ### var code = consoleControl.nextLine(_num = 1_)
45 |
46 | Returns the escape sequence to move _num_ lines down and to the beginning of
47 | the line.
48 |
49 | ### var code = consoleControl.previousLine(_num = 1_)
50 |
51 | Returns the escape sequence to move _num_ lines up and to the beginning of
52 | the line.
53 |
54 | ### var code = consoleControl.eraseData()
55 |
56 | Returns the escape sequence to erase everything from the current cursor
57 | position to the bottom right of the screen. This is line based, so it
58 | erases the remainder of the current line and all following lines.
59 |
60 | ### var code = consoleControl.eraseLine()
61 |
62 | Returns the escape sequence to erase to the end of the current line.
63 |
64 | ### var code = consoleControl.goto(_x_, _y_)
65 |
66 | Returns the escape sequence to move the cursor to the designated position.
67 | Note that the origin is _1, 1_ not _0, 0_.
68 |
69 | ### var code = consoleControl.gotoSOL()
70 |
71 | Returns the escape sequence to move the cursor to the beginning of the
72 | current line. (That is, it returns a carriage return, `\r`.)
73 |
74 | ### var code = consoleControl.hideCursor()
75 |
76 | Returns the escape sequence to hide the cursor.
77 |
78 | ### var code = consoleControl.showCursor()
79 |
80 | Returns the escape sequence to show the cursor.
81 |
82 | ### var code = consoleControl.color(_colors = []_)
83 |
84 | ### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)
85 |
86 | Returns the escape sequence to set the current terminal display attributes
87 | (mostly colors). Arguments can either be a list of attributes or an array
88 | of attributes. The difference between passing in an array or list of colors
89 | and calling `.color` separately for each one, is that in the former case a
90 | single escape sequence will be produced where as in the latter each change
91 | will have its own distinct escape sequence. Each attribute can be one of:
92 |
93 | * Reset:
94 | * **reset** – Reset all attributes to the terminal default.
95 | * Styles:
96 | * **bold** – Display text as bold. In some terminals this means using a
97 | bold font, in others this means changing the color. In some it means
98 | both.
99 | * **italic** – Display text as italic. This is not available in most Windows terminals.
100 | * **underline** – Underline text. This is not available in most Windows Terminals.
101 | * **inverse** – Invert the foreground and background colors.
102 | * **stopBold** – Do not display text as bold.
103 | * **stopItalic** – Do not display text as italic.
104 | * **stopUnderline** – Do not underline text.
105 | * **stopInverse** – Do not invert foreground and background.
106 | * Colors:
107 | * **white**
108 | * **black**
109 | * **blue**
110 | * **cyan**
111 | * **green**
112 | * **magenta**
113 | * **red**
114 | * **yellow**
115 | * **grey** / **brightBlack**
116 | * **brightRed**
117 | * **brightGreen**
118 | * **brightYellow**
119 | * **brightBlue**
120 | * **brightMagenta**
121 | * **brightCyan**
122 | * **brightWhite**
123 | * Background Colors:
124 | * **bgWhite**
125 | * **bgBlack**
126 | * **bgBlue**
127 | * **bgCyan**
128 | * **bgGreen**
129 | * **bgMagenta**
130 | * **bgRed**
131 | * **bgYellow**
132 | * **bgGrey** / **bgBrightBlack**
133 | * **bgBrightRed**
134 | * **bgBrightGreen**
135 | * **bgBrightYellow**
136 | * **bgBrightBlue**
137 | * **bgBrightMagenta**
138 | * **bgBrightCyan**
139 | * **bgBrightWhite**
140 |
141 |
--------------------------------------------------------------------------------
/node_modules/fsevents/node_modules/console-control-strings/README.md~:
--------------------------------------------------------------------------------
1 | # Console Control Strings
2 |
3 | A library of cross-platform tested terminal/console command strings for
4 | doing things like color and cursor positioning. This is a subset of both
5 | ansi and vt100. All control codes included work on both Windows & Unix-like
6 | OSes, except where noted.
7 |
8 | ## Usage
9 |
10 | ```js
11 | var consoleControl = require('console-control-strings')
12 |
13 | console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))
14 | process.stdout.write(consoleControl.goto(75, 10))
15 | ```
16 |
17 | ## Why Another?
18 |
19 | There are tons of libraries similar to this one. I wanted one that was:
20 |
21 | 1. Very clear about compatibility goals.
22 | 2. Could emit, for instance, a start color code without an end one.
23 | 3. Returned strings w/o writing to streams.
24 | 4. Was not weighed down with other unrelated baggage.
25 |
26 | ## Functions
27 |
28 | ### var code = consoleControl.up(_num = 1_)
29 |
30 | Returns the escape sequence to move _num_ lines up.
31 |
32 | ### var code = consoleControl.down(_num = 1_)
33 |
34 | Returns the escape sequence to move _num_ lines down.
35 |
36 | ### var code = consoleControl.forward(_num = 1_)
37 |
38 | Returns the escape sequence to move _num_ lines righ.
39 |
40 | ### var code = consoleControl.back(_num = 1_)
41 |
42 | Returns the escape sequence to move _num_ lines left.
43 |
44 | ### var code = consoleControl.nextLine(_num = 1_)
45 |
46 | Returns the escape sequence to move _num_ lines down and to the beginning of
47 | the line.
48 |
49 | ### var code = consoleControl.previousLine(_num = 1_)
50 |
51 | Returns the escape sequence to move _num_ lines up and to the beginning of
52 | the line.
53 |
54 | ### var code = consoleControl.eraseData()
55 |
56 | Returns the escape sequence to erase everything from the current cursor
57 | position to the bottom right of the screen. This is line based, so it
58 | erases the remainder of the current line and all following lines.
59 |
60 | ### var code = consoleControl.eraseLine()
61 |
62 | Returns the escape sequence to erase to the end of the current line.
63 |
64 | ### var code = consoleControl.goto(_x_, _y_)
65 |
66 | Returns the escape sequence to move the cursor to the designated position.
67 | Note that the origin is _1, 1_ not _0, 0_.
68 |
69 | ### var code = consoleControl.gotoSOL()
70 |
71 | Returns the escape sequence to move the cursor to the beginning of the
72 | current line. (That is, it returns a carriage return, `\r`.)
73 |
74 | ### var code = consoleControl.hideCursor()
75 |
76 | Returns the escape sequence to hide the cursor.
77 |
78 | ### var code = consoleControl.showCursor()
79 |
80 | Returns the escape sequence to show the cursor.
81 |
82 | ### var code = consoleControl.color(_colors = []_)
83 |
84 | ### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)
85 |
86 | Returns the escape sequence to set the current terminal display attributes
87 | (mostly colors). Arguments can either be a list of attributes or an array
88 | of attributes. The difference between passing in an array or list of colors
89 | and calling `.color` separately for each one, is that in the former case a
90 | single escape sequence will be produced where as in the latter each change
91 | will have its own distinct escape sequence. Each attribute can be one of:
92 |
93 | * Reset:
94 | * **reset** – Reset all attributes to the terminal default.
95 | * Styles:
96 | * **bold** – Display text as bold. In some terminals this means using a
97 | bold font, in others this means changing the color. In some it means
98 | both.
99 | * **italic** – Display text as italic. This is not available in most Windows terminals.
100 | * **underline** – Underline text. This is not available in most Windows Terminals.
101 | * **inverse** – Invert the foreground and background colors.
102 | * **stopBold** – Do not display text as bold.
103 | * **stopItalic** – Do not display text as italic.
104 | * **stopUnderline** – Do not underline text.
105 | * **stopInverse** – Do not invert foreground and background.
106 | * Colors:
107 | * **white**
108 | * **black**
109 | * **blue**
110 | * **cyan**
111 | * **green**
112 | * **magenta**
113 | * **red**
114 | * **yellow**
115 | * **grey** / **brightBlack**
116 | * **brightRed**
117 | * **brightGreen**
118 | * **brightYellow**
119 | * **brightBlue**
120 | * **brightMagenta**
121 | * **brightCyan**
122 | * **brightWhite**
123 | * Background Colors:
124 | * **bgWhite**
125 | * **bgBlack**
126 | * **bgBlue**
127 | * **bgCyan**
128 | * **bgGreen**
129 | * **bgMagenta**
130 | * **bgRed**
131 | * **bgYellow**
132 | * **bgGrey** / **bgBrightBlack**
133 | * **bgBrightRed**
134 | * **bgBrightGreen**
135 | * **bgBrightYellow**
136 | * **bgBrightBlue**
137 | * **bgBrightMagenta**
138 | * **bgBrightCyan**
139 | * **bgBrightWhite**
140 |
141 |
--------------------------------------------------------------------------------
/node_modules/fsevents/node_modules/gauge/CHANGELOG.md~:
--------------------------------------------------------------------------------
1 | ### v2.5.3
2 |
3 | * Default to `enabled` only if we have a tty. Users can always override
4 | this by passing in the `enabled` option explicitly or by calling calling
5 | `gauge.enable()`.
6 |
7 | ### v2.5.2
8 |
9 | * Externalized `./console-strings.js` into `console-control-strings`.
10 |
11 | ### v2.5.1
12 |
13 | * Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the
14 | node profiler.
15 | * [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add
16 | a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012))
17 |
18 | ### v2.5.0
19 |
20 | * Add way to programmatically fetch a list of theme names in a themeset
21 | (`Themeset.getThemeNames`).
22 |
23 | ### v2.4.0
24 |
25 | * Add support for setting themesets on existing gauge objects.
26 | * Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when
27 | your terminal is interleaving output from multiple filehandles (ie, stdout
28 | & stderr).
29 |
30 | ### v2.3.1
31 |
32 | * Fix a refactor bug in setTheme where it wasn't accepting the various types
33 | of args it should.
34 |
35 | ### v2.3.0
36 |
37 | #### FEATURES
38 |
39 | * Add setTemplate & setTheme back in.
40 | * Add support for named themes, you can now ask for things like 'colorASCII'
41 | and 'brailleSpinner'. Of course, you can still pass in theme objects.
42 | Additionally you can now pass in an object with `hasUnicode`, `hasColor` and
43 | `platform` keys in order to override our guesses as to those values when
44 | selecting a default theme from the themeset.
45 | * Make the output stream optional (it defaults to `process.stderr` now).
46 | * Add `setWriteTo(stream[, tty])` to change the output stream and,
47 | optionally, tty.
48 |
49 | #### BUG FIXES & REFACTORING
50 |
51 | * Abort the display phase early if we're supposed to be hidden and we are.
52 | * Stop printing a bunch of spaces at the end of lines, since we're already
53 | using an erase-to-end-of-line code anyway.
54 | * The unicode themes were missing the subsection separator.
55 |
56 | ### v2.2.1
57 |
58 | * Fix image in readme
59 |
60 | ### v2.2.0
61 |
62 | * All new themes API– reference themes by name and pass in custom themes and
63 | themesets (themesets get platform support autodetection done on them to
64 | select the best theme). Theme mixins let you add features to all existing
65 | themes.
66 | * Much, much improved test coverage.
67 |
68 | ### v2.1.0
69 |
70 | * Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks
71 | to @yongtw123 for pointing out this had snuck in.
72 | * Fiddled with the demo output to make it easier to see the spinner spin. Also
73 | added prints before each platforms test output.
74 | * I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for
75 | finding this. Then I was lazy and made a new commit instead of using his
76 | PR. Again, thank you for your patience @KenenY.
77 | * Drastically speed up travis testing.
78 | * Add a small javascript demo (demo.js) for showing off the various themes
79 | (and testing them on diff platforms).
80 | * Change: The subsection separator from ⁄ and / (different chars) to >.
81 | * Fix crasher: A show or pulse without a label would cause the template renderer
82 | to complain about a missing value.
83 | * New feature: Add the ability to disable the clean-up-on-exit behavior.
84 | Not something I expect to be widely desirable, but important if you have
85 | multiple distinct gauge instances in your app.
86 | * Use our own color support detection.
87 | The `has-color` module proved too magic for my needs, making assumptions
88 | as to which stream we write to and reading command line arguments.
89 |
90 | ### v2.0.0
91 |
92 | This is a major rewrite of the internals. Externally there are fewer
93 | changes:
94 |
95 | * On node>0.8 gauge object now prints updates at a fixed rate. This means
96 | that when you call `show` it may wate up to `updateInterval` ms before it
97 | actually prints an update. You override this behavior with the
98 | `fixedFramerate` option.
99 | * The gauge object now keeps the cursor hidden as long as it's enabled and
100 | shown.
101 | * The constructor's arguments have changed, now it takes a mandatory output
102 | stream and an optional options object. The stream no longer needs to be
103 | an `ansi`ified stream, although it can be if you want (but we won't make
104 | use of its special features).
105 | * Previously the gauge was disabled by default if `process.stdout` wasn't a
106 | tty. Now it always defaults to enabled. If you want the previous
107 | behavior set the `enabled` option to `process.stdout.isTTY`.
108 | * The constructor's options have changed– see the docs for details.
109 | * Themes are entirely different. If you were using a custom theme, or
110 | referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then
111 | you'll need to change your code. You can get the equivalent of the latter
112 | with:
113 | ```
114 | var themes = require('gauge/themes')
115 | var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform
116 | ```
117 | The default themes no longer use any ambiguous width characters, so even
118 | if you choose to display those as wide your progress bar should still
119 | display correctly.
120 | * Templates are entirely different and if you were using a custom one, you
121 | should consult the documentation to learn how to recreate it. If you were
122 | using the default, be aware that it has changed and the result looks quite
123 | a bit different.
124 |
--------------------------------------------------------------------------------
/node_modules/fsevents/node_modules/gauge/README.md~:
--------------------------------------------------------------------------------
1 | gauge
2 | =====
3 |
4 | A nearly stateless terminal based horizontal gauge / progress bar.
5 |
6 | ```javascript
7 | var Gauge = require("gauge")
8 |
9 | var gauge = new Gauge()
10 |
11 | gauge.show("test", 0.20)
12 |
13 | gauge.pulse("this")
14 |
15 | gauge.hide()
16 | ```
17 |
18 | 
19 |
20 |
21 | ### CHANGES FROM 1.x
22 |
23 | Gauge 2.x is breaking release, please see the [changelog] for details on
24 | what's changed if you were previously a user of this module.
25 |
26 | [changelog]: CHANGELOG.md
27 |
28 | ### THE GAUGE CLASS
29 |
30 | This is the typical interface to the module– it provides a pretty
31 | fire-and-forget interface to displaying your status information.
32 |
33 | ```
34 | var Gauge = require("gauge")
35 |
36 | var gauge = new Gauge([stream], [options])
37 | ```
38 |
39 | * **stream** – *(optional, default STDERR)* A stream that progress bar
40 | updates are to be written to. Gauge honors backpressure and will pause
41 | most writing if it is indicated.
42 | * **options** – *(optional)* An option object.
43 |
44 | Constructs a new gauge. Gauges are drawn on a single line, and are not drawn
45 | if **stream** isn't a tty and a tty isn't explicitly provided.
46 |
47 | If **stream** is a terminal or if you pass in **tty** to **options** then we
48 | will detect terminal resizes and redraw to fit. We do this by watching for
49 | `resize` events on the tty. (To work around a bug in verisons of Node prior
50 | to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to
51 | larger window sizes will be clean, but shrinking the window will always
52 | result in some cruft.
53 |
54 | **IMPORTANT:** If you prevously were passing in a non-tty stream but you still
55 | want output (for example, a stream wrapped by the `ansi` module) then you
56 | need to pass in the **tty** option below, as `gauge` needs access to
57 | the underlying tty in order to do things like terminal resizes and terminal
58 | width detection.
59 |
60 | The **options** object can have the following properties, all of which are
61 | optional:
62 |
63 | * **updateInterval**: How often gauge updates should be drawn, in miliseconds.
64 | * **fixedFramerate**: Defaults to false on node 0.8, true on everything
65 | else. When this is true a timer is created to trigger once every
66 | `updateInterval` ms, when false, updates are printed as soon as they come
67 | in but updates more often than `updateInterval` are ignored. The reason
68 | 0.8 doesn't have this set to true is that it can't `unref` its timer and
69 | so it would stop your program from exiting– if you want to use this
70 | feature with 0.8 just make sure you call `gauge.disable()` before you
71 | expect your program to exit.
72 | * **themes**: A themeset to use when selecting the theme to use. Defaults
73 | to `gauge/themes`, see the [themes] documentation for details.
74 | * **theme**: Select a theme for use, it can be a:
75 | * Theme object, in which case the **themes** is not used.
76 | * The name of a theme, which will be looked up in the current *themes*
77 | object.
78 | * A configuration object with any of `hasUnicode`, `hasColor` or
79 | `platform` keys, which if wlll be used to override our guesses when making
80 | a default theme selection.
81 |
82 | If no theme is selected then a default is picked using a combination of our
83 | best guesses at your OS, color support and unicode support.
84 | * **template**: Describes what you want your gauge to look like. The
85 | default is what npm uses. Detailed [documentation] is later in this
86 | document.
87 | * **hideCursor**: Defaults to true. If true, then the cursor will be hidden
88 | while the gauge is displayed.
89 | * **tty**: The tty that you're ultimately writing to. Defaults to the same
90 | as **stream**. This is used for detecting the width of the terminal and
91 | resizes. The width used is `tty.columns - 1`. If no tty is available then
92 | a width of `79` is assumed.
93 | * **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true
94 | the gauge starts enabled. If disabled then all update commands are
95 | ignored and no gauge will be printed until you call `.enable()`.
96 | * **Plumbing**: The class to use to actually generate the gauge for
97 | printing. This defaults to `require('gauge/plumbing')` and ordinarly you
98 | shouldn't need to override this.
99 | * **cleanupOnExit**: Defaults to true. Ordinarily we register an exit
100 | handler to make sure your cursor is turned back on and the progress bar
101 | erased when your process exits, even if you Ctrl-C out or otherwise exit
102 | unexpectedly. You can disable this and it won't register the exit handler.
103 |
104 | [has-unicode]: https://www.npmjs.com/package/has-unicode
105 | [themes]: #themes
106 | [documentation]: #templates
107 |
108 | #### `gauge.show(section | status, [completed])`
109 |
110 | The first argument is either the section, the name of the current thing
111 | contributing to progress, or an object with keys like **section**,
112 | **subsection** & **completed** (or any others you have types for in a custom
113 | template). If you don't want to update or set any of these you can pass
114 | `null` and it will be ignored.
115 |
116 | The second argument is the percent completed as a value between 0 and 1.
117 | Without it, completion is just not updated. You'll also note that completion
118 | can be passed in as part of a status object as the first argument. If both
119 | it and the completed argument are passed in, the completed argument wins.
120 |
121 | #### `gauge.hide([cb])`
122 |
123 | Removes the gauge from the terminal. Optionally, callback `cb` after IO has
124 | had an opportunity to happen (currently this just means after `setImmediate`
125 | has called back.)
126 |
127 | It turns out this is important when you're pausing the progress bar on one
128 | filehandle and printing to another– otherwise (with a big enough print) node
129 | can end up printing the "end progress bar" bits to the progress bar filehandle
130 | while other stuff is printing to another filehandle. These getting interleaved
131 | can cause corruption in some terminals.
132 |
133 | #### `gauge.pulse([subsection])`
134 |
135 | * **subsection** – *(optional)* The specific thing that triggered this pulse
136 |
137 | Spins the spinner in the gauge to show output. If **subsection** is
138 | included then it will be combined with the last name passed to `gauge.show`.
139 |
140 | #### `gauge.disable()`
141 |
142 | Hides the gauge and ignores further calls to `show` or `pulse`.
143 |
144 | #### `gauge.enable()`
145 |
146 | Shows the gauge and resumes updating when `show` or `pulse` is called.
147 |
148 | #### `gauge.setThemeset(themes)`
149 |
150 | Change the themeset to select a theme from. The same as the `themes` option
151 | used in the constructor. The theme will be reselected from this themeset.
152 |
153 | #### `gauge.setTheme(theme)`
154 |
155 | Change the active theme, will be displayed with the next show or pulse. This can be:
156 |
157 | * Theme object, in which case the **themes** is not used.
158 | * The name of a theme, which will be looked up in the current *themes*
159 | object.
160 | * A configuration object with any of `hasUnicode`, `hasColor` or
161 | `platform` keys, which if wlll be used to override our guesses when making
162 | a default theme selection.
163 |
164 | If no theme is selected then a default is picked using a combination of our
165 | best guesses at your OS, color support and unicode support.
166 |
167 | #### `gauge.setTemplate(template)`
168 |
169 | Change the active template, will be displayed with the next show or pulse
170 |
171 | ### Tracking Completion
172 |
173 | If you have more than one thing going on that you want to track completion
174 | of, you may find the related [are-we-there-yet] helpful. It's `change`
175 | event can be wired up to the `show` method to get a more traditional
176 | progress bar interface.
177 |
178 | [are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet
179 |
180 | ### THEMES
181 |
182 | ```
183 | var themes = require('gauge/themes')
184 |
185 | // fetch the default color unicode theme for this platform
186 | var ourTheme = themes({hasUnicode: true, hasColor: true})
187 |
188 | // fetch the default non-color unicode theme for osx
189 | var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'})
190 |
191 | // create a new theme based on the color ascii theme for this platform
192 | // that brackets the progress bar with arrows
193 | var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), {
194 | preProgressbar: '→',
195 | postProgressbar: '←'
196 | })
197 | ```
198 |
199 | The object returned by `gauge/themes` is an instance of the `ThemeSet` class.
200 |
201 | ```
202 | var ThemeSet = require('gauge/theme-set')
203 | var themes = new ThemeSet()
204 | // or
205 | var themes = require('gauge/themes')
206 | var mythemes = themes.newThemeset() // creates a new themeset based on the default themes
207 | ```
208 |
209 | #### themes(opts)
210 | #### themes.getDefault(opts)
211 |
212 | Theme objects are a function that fetches the default theme based on
213 | platform, unicode and color support.
214 |
215 | Options is an object with the following properties:
216 |
217 | * **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is
218 | available then a non-unicode theme will be used.
219 | * **hasColor** - If true, fetch a color theme, if no color theme is
220 | available a non-color theme will be used.
221 | * **platform** (optional) - Defaults to `process.platform`. If no
222 | platform match is available then `fallback` is used instead.
223 |
224 | If no compatible theme can be found then an error will be thrown with a
225 | `code` of `EMISSINGTHEME`.
226 |
227 | #### themes.addTheme(themeName, themeObj)
228 | #### themes.addTheme(themeName, [parentTheme], newTheme)
229 |
230 | Adds a named theme to the themeset. You can pass in either a theme object,
231 | as returned by `themes.newTheme` or the arguments you'd pass to
232 | `themes.newTheme`.
233 |
234 | #### themes.getThemeNames()
235 |
236 | Return a list of all of the names of the themes in this themeset. Suitable
237 | for use in `themes.getTheme(…)`.
238 |
239 | #### themes.getTheme(name)
240 |
241 | Returns the theme object from this theme set named `name`.
242 |
243 | If `name` does not exist in this themeset an error will be thrown with
244 | a `code` of `EMISSINGTHEME`.
245 |
246 | #### themes.setDefault([opts], themeName)
247 |
248 | `opts` is an object with the following properties.
249 |
250 | * **platform** - Defaults to `'fallback'`. If your theme is platform
251 | specific, specify that here with the platform from `process.platform`, eg,
252 | `win32`, `darwin`, etc.
253 | * **hasUnicode** - Defaults to `false`. If your theme uses unicode you
254 | should set this to true.
255 | * **hasColor** - Defaults to `false`. If your theme uses color you should
256 | set this to true.
257 |
258 | `themeName` is the name of the theme (as given to `addTheme`) to use for
259 | this set of `opts`.
260 |
261 | #### themes.newTheme([parentTheme,] newTheme)
262 |
263 | Create a new theme object based on `parentTheme`. If no `parentTheme` is
264 | provided then a minimal parentTheme that defines functions for rendering the
265 | activity indicator (spinner) and progress bar will be defined. (This
266 | fallback parent is defined in `gauge/base-theme`.)
267 |
268 | newTheme should be a bare object– we'll start by discussing the properties
269 | defined by the default themes:
270 |
271 | * **preProgressbar** - displayed prior to the progress bar, if the progress
272 | bar is displayed.
273 | * **postProgressbar** - displayed after the progress bar, if the progress bar
274 | is displayed.
275 | * **progressBarTheme** - The subtheme passed through to the progress bar
276 | renderer, it's an object with `complete` and `remaining` properties
277 | that are the strings you want repeated for those sections of the progress
278 | bar.
279 | * **activityIndicatorTheme** - The theme for the activity indicator (spinner),
280 | this can either be a string, in which each character is a different step, or
281 | an array of strings.
282 | * **preSubsection** - Displayed as a separator between the `section` and
283 | `subsection` when the latter is printed.
284 |
285 | More generally, themes can have any value that would be a valid value when rendering
286 | templates. The properties in the theme are used when their name matches a type in
287 | the template. Their values can be:
288 |
289 | * **strings & numbers** - They'll be included as is
290 | * **function (values, theme, width)** - Should return what you want in your output.
291 | *values* is an object with values provided via `gauge.show`,
292 | *theme* is the theme specific to this item (see below) or this theme object,
293 | and *width* is the number of characters wide your result should be.
294 |
295 | There are a couple of special prefixes:
296 |
297 | * **pre** - Is shown prior to the property, if its displayed.
298 | * **post** - Is shown after the property, if its displayed.
299 |
300 | And one special suffix:
301 |
302 | * **Theme** - Its value is passed to a function-type item as the theme.
303 |
304 | #### themes.addToAllThemes(theme)
305 |
306 | This *mixes-in* `theme` into all themes currently defined. It also adds it
307 | to the default parent theme for this themeset, so future themes added to
308 | this themeset will get the values from `theme` by default.
309 |
310 | #### themes.newThemeset()
311 |
312 | Copy the current themeset into a new one. This allows you to easily inherit
313 | one themeset from another.
314 |
315 | ### TEMPLATES
316 |
317 | A template is an array of objects and strings that, after being evaluated,
318 | will be turned into the gauge line. The default template is:
319 |
320 | ```javascript
321 | [
322 | {type: 'progressbar', length: 20},
323 | {type: 'activityIndicator', kerning: 1, length: 1},
324 | {type: 'section', kerning: 1},
325 | {type: 'subsection', kerning: 1}
326 | ]
327 | ```
328 |
329 | The various template elements can either be **plain strings**, in which case they will
330 | be be included verbatum in the output, or objects with the following properties:
331 |
332 | * *type* can be any of the following plus any keys you pass into `gauge.show` plus
333 | any keys you have on a custom theme.
334 | * `section` – What big thing you're working on now.
335 | * `subsection` – What component of that thing is currently working.
336 | * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme`
337 | from your active theme.
338 | * `progressbar` – A progress bar representing your current `completed`
339 | using the `progressbarTheme` from your active theme.
340 | * *kerning* – Number of spaces that must be between this item and other
341 | items, if this item is displayed at all.
342 | * *maxLength* – The maximum length for this element. If its value is longer it
343 | will be truncated.
344 | * *minLength* – The minimum length for this element. If its value is shorter it
345 | will be padded according to the *align* value.
346 | * *align* – (Default: left) Possible values "left", "right" and "center". Works
347 | as you'd expect from word processors.
348 | * *length* – Provides a single value for both *minLength* and *maxLength*. If both
349 | *length* and *minLength or *maxLength* are specifed then the latter take precedence.
350 | * *value* – A literal value to use for this template item.
351 |
352 | ### PLUMBING
353 |
354 | This is the super simple, assume nothing, do no magic internals used by gauge to
355 | implement its ordinary interface.
356 |
357 | ```
358 | var Plumbing = require('gauge/plumbing')
359 | var gauge = new Plumbing(theme, template, width)
360 | ```
361 |
362 | * **theme**: The theme to use.
363 | * **template**: The template to use.
364 | * **width**: How wide your gauge should be
365 |
366 | #### `gauge.setTheme(theme)`
367 |
368 | Change the active theme.
369 |
370 | #### `gauge.setTemplate(template)`
371 |
372 | Change the active template.
373 |
374 | #### `gauge.setWidth(width)`
375 |
376 | Change the width to render at.
377 |
378 | #### `gauge.hide()`
379 |
380 | Return the string necessary to hide the progress bar
381 |
382 | #### `gauge.hideCursor()`
383 |
384 | Return a string to hide the cursor.
385 |
386 | #### `gauge.showCursor()`
387 |
388 | Return a string to show the cursor.
389 |
390 | #### `gauge.show(status)`
391 |
392 | Using `status` for values, render the provided template with the theme and return
393 | a string that is suitable for printing to update the gauge.
394 |
--------------------------------------------------------------------------------
/node_modules/fsevents/node_modules/npmlog/CHANGELOG.md~:
--------------------------------------------------------------------------------
1 | ### v3.1.1
2 |
3 | * Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to
4 | when a progress bar is enabled. In `1.x` if you didn't have a TTY the
5 | progress bar was never shown. In `2.x` it merely defaults to disabled,
6 | but you can enable it explicitly if you still want progress updates.
7 |
8 | ### v3.1.0
9 |
10 | * Update to `gauge@2.5.2`:
11 | * Updates the `signal-exit` dependency which fixes an incompatibility with
12 | the node profiler.
13 | * Uses externalizes its ansi code generation in `console-control-strings`
14 | * Make the default progress bar include the last line printed, colored as it
15 | would be when printing to a tty.
16 |
17 | ### v3.0.0
18 |
19 | * Switch to `gauge@2.0.0`, for better performance, better look.
20 | * Set stderr/stdout blocking if they're tty's, so that we can hide a
21 | progress bar going to stderr and then safely print to stdout. Without
22 | this the two can end up overlapping producing confusing and sometimes
23 | corrupted output.
24 |
25 | ### v2.0.0
26 |
27 | * Make the `error` event non-fatal so that folks can use it as a prefix.
28 |
29 | ### v1.0.0
30 |
31 | * Add progress bar with `gauge@1.1.0`
32 |
--------------------------------------------------------------------------------
/node_modules/gauge/CHANGELOG.md~:
--------------------------------------------------------------------------------
1 | ### v2.5.3
2 |
3 | * Default to `enabled` only if we have a tty. Users can always override
4 | this by passing in the `enabled` option explicitly or by calling calling
5 | `gauge.enable()`.
6 |
7 | ### v2.5.2
8 |
9 | * Externalized `./console-strings.js` into `console-control-strings`.
10 |
11 | ### v2.5.1
12 |
13 | * Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the
14 | node profiler.
15 | * [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add
16 | a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012))
17 |
18 | ### v2.5.0
19 |
20 | * Add way to programmatically fetch a list of theme names in a themeset
21 | (`Themeset.getThemeNames`).
22 |
23 | ### v2.4.0
24 |
25 | * Add support for setting themesets on existing gauge objects.
26 | * Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when
27 | your terminal is interleaving output from multiple filehandles (ie, stdout
28 | & stderr).
29 |
30 | ### v2.3.1
31 |
32 | * Fix a refactor bug in setTheme where it wasn't accepting the various types
33 | of args it should.
34 |
35 | ### v2.3.0
36 |
37 | #### FEATURES
38 |
39 | * Add setTemplate & setTheme back in.
40 | * Add support for named themes, you can now ask for things like 'colorASCII'
41 | and 'brailleSpinner'. Of course, you can still pass in theme objects.
42 | Additionally you can now pass in an object with `hasUnicode`, `hasColor` and
43 | `platform` keys in order to override our guesses as to those values when
44 | selecting a default theme from the themeset.
45 | * Make the output stream optional (it defaults to `process.stderr` now).
46 | * Add `setWriteTo(stream[, tty])` to change the output stream and,
47 | optionally, tty.
48 |
49 | #### BUG FIXES & REFACTORING
50 |
51 | * Abort the display phase early if we're supposed to be hidden and we are.
52 | * Stop printing a bunch of spaces at the end of lines, since we're already
53 | using an erase-to-end-of-line code anyway.
54 | * The unicode themes were missing the subsection separator.
55 |
56 | ### v2.2.1
57 |
58 | * Fix image in readme
59 |
60 | ### v2.2.0
61 |
62 | * All new themes API– reference themes by name and pass in custom themes and
63 | themesets (themesets get platform support autodetection done on them to
64 | select the best theme). Theme mixins let you add features to all existing
65 | themes.
66 | * Much, much improved test coverage.
67 |
68 | ### v2.1.0
69 |
70 | * Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks
71 | to @yongtw123 for pointing out this had snuck in.
72 | * Fiddled with the demo output to make it easier to see the spinner spin. Also
73 | added prints before each platforms test output.
74 | * I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for
75 | finding this. Then I was lazy and made a new commit instead of using his
76 | PR. Again, thank you for your patience @KenenY.
77 | * Drastically speed up travis testing.
78 | * Add a small javascript demo (demo.js) for showing off the various themes
79 | (and testing them on diff platforms).
80 | * Change: The subsection separator from ⁄ and / (different chars) to >.
81 | * Fix crasher: A show or pulse without a label would cause the template renderer
82 | to complain about a missing value.
83 | * New feature: Add the ability to disable the clean-up-on-exit behavior.
84 | Not something I expect to be widely desirable, but important if you have
85 | multiple distinct gauge instances in your app.
86 | * Use our own color support detection.
87 | The `has-color` module proved too magic for my needs, making assumptions
88 | as to which stream we write to and reading command line arguments.
89 |
90 | ### v2.0.0
91 |
92 | This is a major rewrite of the internals. Externally there are fewer
93 | changes:
94 |
95 | * On node>0.8 gauge object now prints updates at a fixed rate. This means
96 | that when you call `show` it may wate up to `updateInterval` ms before it
97 | actually prints an update. You override this behavior with the
98 | `fixedFramerate` option.
99 | * The gauge object now keeps the cursor hidden as long as it's enabled and
100 | shown.
101 | * The constructor's arguments have changed, now it takes a mandatory output
102 | stream and an optional options object. The stream no longer needs to be
103 | an `ansi`ified stream, although it can be if you want (but we won't make
104 | use of its special features).
105 | * Previously the gauge was disabled by default if `process.stdout` wasn't a
106 | tty. Now it always defaults to enabled. If you want the previous
107 | behavior set the `enabled` option to `process.stdout.isTTY`.
108 | * The constructor's options have changed– see the docs for details.
109 | * Themes are entirely different. If you were using a custom theme, or
110 | referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then
111 | you'll need to change your code. You can get the equivalent of the latter
112 | with:
113 | ```
114 | var themes = require('gauge/themes')
115 | var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform
116 | ```
117 | The default themes no longer use any ambiguous width characters, so even
118 | if you choose to display those as wide your progress bar should still
119 | display correctly.
120 | * Templates are entirely different and if you were using a custom one, you
121 | should consult the documentation to learn how to recreate it. If you were
122 | using the default, be aware that it has changed and the result looks quite
123 | a bit different.
124 |
--------------------------------------------------------------------------------
/node_modules/gauge/README.md~:
--------------------------------------------------------------------------------
1 | gauge
2 | =====
3 |
4 | A nearly stateless terminal based horizontal gauge / progress bar.
5 |
6 | ```javascript
7 | var Gauge = require("gauge")
8 |
9 | var gauge = new Gauge()
10 |
11 | gauge.show("test", 0.20)
12 |
13 | gauge.pulse("this")
14 |
15 | gauge.hide()
16 | ```
17 |
18 | 
19 |
20 |
21 | ### CHANGES FROM 1.x
22 |
23 | Gauge 2.x is breaking release, please see the [changelog] for details on
24 | what's changed if you were previously a user of this module.
25 |
26 | [changelog]: CHANGELOG.md
27 |
28 | ### THE GAUGE CLASS
29 |
30 | This is the typical interface to the module– it provides a pretty
31 | fire-and-forget interface to displaying your status information.
32 |
33 | ```
34 | var Gauge = require("gauge")
35 |
36 | var gauge = new Gauge([stream], [options])
37 | ```
38 |
39 | * **stream** – *(optional, default STDERR)* A stream that progress bar
40 | updates are to be written to. Gauge honors backpressure and will pause
41 | most writing if it is indicated.
42 | * **options** – *(optional)* An option object.
43 |
44 | Constructs a new gauge. Gauges are drawn on a single line, and are not drawn
45 | if **stream** isn't a tty and a tty isn't explicitly provided.
46 |
47 | If **stream** is a terminal or if you pass in **tty** to **options** then we
48 | will detect terminal resizes and redraw to fit. We do this by watching for
49 | `resize` events on the tty. (To work around a bug in verisons of Node prior
50 | to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to
51 | larger window sizes will be clean, but shrinking the window will always
52 | result in some cruft.
53 |
54 | **IMPORTANT:** If you prevously were passing in a non-tty stream but you still
55 | want output (for example, a stream wrapped by the `ansi` module) then you
56 | need to pass in the **tty** option below, as `gauge` needs access to
57 | the underlying tty in order to do things like terminal resizes and terminal
58 | width detection.
59 |
60 | The **options** object can have the following properties, all of which are
61 | optional:
62 |
63 | * **updateInterval**: How often gauge updates should be drawn, in miliseconds.
64 | * **fixedFramerate**: Defaults to false on node 0.8, true on everything
65 | else. When this is true a timer is created to trigger once every
66 | `updateInterval` ms, when false, updates are printed as soon as they come
67 | in but updates more often than `updateInterval` are ignored. The reason
68 | 0.8 doesn't have this set to true is that it can't `unref` its timer and
69 | so it would stop your program from exiting– if you want to use this
70 | feature with 0.8 just make sure you call `gauge.disable()` before you
71 | expect your program to exit.
72 | * **themes**: A themeset to use when selecting the theme to use. Defaults
73 | to `gauge/themes`, see the [themes] documentation for details.
74 | * **theme**: Select a theme for use, it can be a:
75 | * Theme object, in which case the **themes** is not used.
76 | * The name of a theme, which will be looked up in the current *themes*
77 | object.
78 | * A configuration object with any of `hasUnicode`, `hasColor` or
79 | `platform` keys, which if wlll be used to override our guesses when making
80 | a default theme selection.
81 |
82 | If no theme is selected then a default is picked using a combination of our
83 | best guesses at your OS, color support and unicode support.
84 | * **template**: Describes what you want your gauge to look like. The
85 | default is what npm uses. Detailed [documentation] is later in this
86 | document.
87 | * **hideCursor**: Defaults to true. If true, then the cursor will be hidden
88 | while the gauge is displayed.
89 | * **tty**: The tty that you're ultimately writing to. Defaults to the same
90 | as **stream**. This is used for detecting the width of the terminal and
91 | resizes. The width used is `tty.columns - 1`. If no tty is available then
92 | a width of `79` is assumed.
93 | * **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true
94 | the gauge starts enabled. If disabled then all update commands are
95 | ignored and no gauge will be printed until you call `.enable()`.
96 | * **Plumbing**: The class to use to actually generate the gauge for
97 | printing. This defaults to `require('gauge/plumbing')` and ordinarly you
98 | shouldn't need to override this.
99 | * **cleanupOnExit**: Defaults to true. Ordinarily we register an exit
100 | handler to make sure your cursor is turned back on and the progress bar
101 | erased when your process exits, even if you Ctrl-C out or otherwise exit
102 | unexpectedly. You can disable this and it won't register the exit handler.
103 |
104 | [has-unicode]: https://www.npmjs.com/package/has-unicode
105 | [themes]: #themes
106 | [documentation]: #templates
107 |
108 | #### `gauge.show(section | status, [completed])`
109 |
110 | The first argument is either the section, the name of the current thing
111 | contributing to progress, or an object with keys like **section**,
112 | **subsection** & **completed** (or any others you have types for in a custom
113 | template). If you don't want to update or set any of these you can pass
114 | `null` and it will be ignored.
115 |
116 | The second argument is the percent completed as a value between 0 and 1.
117 | Without it, completion is just not updated. You'll also note that completion
118 | can be passed in as part of a status object as the first argument. If both
119 | it and the completed argument are passed in, the completed argument wins.
120 |
121 | #### `gauge.hide([cb])`
122 |
123 | Removes the gauge from the terminal. Optionally, callback `cb` after IO has
124 | had an opportunity to happen (currently this just means after `setImmediate`
125 | has called back.)
126 |
127 | It turns out this is important when you're pausing the progress bar on one
128 | filehandle and printing to another– otherwise (with a big enough print) node
129 | can end up printing the "end progress bar" bits to the progress bar filehandle
130 | while other stuff is printing to another filehandle. These getting interleaved
131 | can cause corruption in some terminals.
132 |
133 | #### `gauge.pulse([subsection])`
134 |
135 | * **subsection** – *(optional)* The specific thing that triggered this pulse
136 |
137 | Spins the spinner in the gauge to show output. If **subsection** is
138 | included then it will be combined with the last name passed to `gauge.show`.
139 |
140 | #### `gauge.disable()`
141 |
142 | Hides the gauge and ignores further calls to `show` or `pulse`.
143 |
144 | #### `gauge.enable()`
145 |
146 | Shows the gauge and resumes updating when `show` or `pulse` is called.
147 |
148 | #### `gauge.setThemeset(themes)`
149 |
150 | Change the themeset to select a theme from. The same as the `themes` option
151 | used in the constructor. The theme will be reselected from this themeset.
152 |
153 | #### `gauge.setTheme(theme)`
154 |
155 | Change the active theme, will be displayed with the next show or pulse. This can be:
156 |
157 | * Theme object, in which case the **themes** is not used.
158 | * The name of a theme, which will be looked up in the current *themes*
159 | object.
160 | * A configuration object with any of `hasUnicode`, `hasColor` or
161 | `platform` keys, which if wlll be used to override our guesses when making
162 | a default theme selection.
163 |
164 | If no theme is selected then a default is picked using a combination of our
165 | best guesses at your OS, color support and unicode support.
166 |
167 | #### `gauge.setTemplate(template)`
168 |
169 | Change the active template, will be displayed with the next show or pulse
170 |
171 | ### Tracking Completion
172 |
173 | If you have more than one thing going on that you want to track completion
174 | of, you may find the related [are-we-there-yet] helpful. It's `change`
175 | event can be wired up to the `show` method to get a more traditional
176 | progress bar interface.
177 |
178 | [are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet
179 |
180 | ### THEMES
181 |
182 | ```
183 | var themes = require('gauge/themes')
184 |
185 | // fetch the default color unicode theme for this platform
186 | var ourTheme = themes({hasUnicode: true, hasColor: true})
187 |
188 | // fetch the default non-color unicode theme for osx
189 | var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'})
190 |
191 | // create a new theme based on the color ascii theme for this platform
192 | // that brackets the progress bar with arrows
193 | var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), {
194 | preProgressbar: '→',
195 | postProgressbar: '←'
196 | })
197 | ```
198 |
199 | The object returned by `gauge/themes` is an instance of the `ThemeSet` class.
200 |
201 | ```
202 | var ThemeSet = require('gauge/theme-set')
203 | var themes = new ThemeSet()
204 | // or
205 | var themes = require('gauge/themes')
206 | var mythemes = themes.newThemeset() // creates a new themeset based on the default themes
207 | ```
208 |
209 | #### themes(opts)
210 | #### themes.getDefault(opts)
211 |
212 | Theme objects are a function that fetches the default theme based on
213 | platform, unicode and color support.
214 |
215 | Options is an object with the following properties:
216 |
217 | * **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is
218 | available then a non-unicode theme will be used.
219 | * **hasColor** - If true, fetch a color theme, if no color theme is
220 | available a non-color theme will be used.
221 | * **platform** (optional) - Defaults to `process.platform`. If no
222 | platform match is available then `fallback` is used instead.
223 |
224 | If no compatible theme can be found then an error will be thrown with a
225 | `code` of `EMISSINGTHEME`.
226 |
227 | #### themes.addTheme(themeName, themeObj)
228 | #### themes.addTheme(themeName, [parentTheme], newTheme)
229 |
230 | Adds a named theme to the themeset. You can pass in either a theme object,
231 | as returned by `themes.newTheme` or the arguments you'd pass to
232 | `themes.newTheme`.
233 |
234 | #### themes.getThemeNames()
235 |
236 | Return a list of all of the names of the themes in this themeset. Suitable
237 | for use in `themes.getTheme(…)`.
238 |
239 | #### themes.getTheme(name)
240 |
241 | Returns the theme object from this theme set named `name`.
242 |
243 | If `name` does not exist in this themeset an error will be thrown with
244 | a `code` of `EMISSINGTHEME`.
245 |
246 | #### themes.setDefault([opts], themeName)
247 |
248 | `opts` is an object with the following properties.
249 |
250 | * **platform** - Defaults to `'fallback'`. If your theme is platform
251 | specific, specify that here with the platform from `process.platform`, eg,
252 | `win32`, `darwin`, etc.
253 | * **hasUnicode** - Defaults to `false`. If your theme uses unicode you
254 | should set this to true.
255 | * **hasColor** - Defaults to `false`. If your theme uses color you should
256 | set this to true.
257 |
258 | `themeName` is the name of the theme (as given to `addTheme`) to use for
259 | this set of `opts`.
260 |
261 | #### themes.newTheme([parentTheme,] newTheme)
262 |
263 | Create a new theme object based on `parentTheme`. If no `parentTheme` is
264 | provided then a minimal parentTheme that defines functions for rendering the
265 | activity indicator (spinner) and progress bar will be defined. (This
266 | fallback parent is defined in `gauge/base-theme`.)
267 |
268 | newTheme should be a bare object– we'll start by discussing the properties
269 | defined by the default themes:
270 |
271 | * **preProgressbar** - displayed prior to the progress bar, if the progress
272 | bar is displayed.
273 | * **postProgressbar** - displayed after the progress bar, if the progress bar
274 | is displayed.
275 | * **progressBarTheme** - The subtheme passed through to the progress bar
276 | renderer, it's an object with `complete` and `remaining` properties
277 | that are the strings you want repeated for those sections of the progress
278 | bar.
279 | * **activityIndicatorTheme** - The theme for the activity indicator (spinner),
280 | this can either be a string, in which each character is a different step, or
281 | an array of strings.
282 | * **preSubsection** - Displayed as a separator between the `section` and
283 | `subsection` when the latter is printed.
284 |
285 | More generally, themes can have any value that would be a valid value when rendering
286 | templates. The properties in the theme are used when their name matches a type in
287 | the template. Their values can be:
288 |
289 | * **strings & numbers** - They'll be included as is
290 | * **function (values, theme, width)** - Should return what you want in your output.
291 | *values* is an object with values provided via `gauge.show`,
292 | *theme* is the theme specific to this item (see below) or this theme object,
293 | and *width* is the number of characters wide your result should be.
294 |
295 | There are a couple of special prefixes:
296 |
297 | * **pre** - Is shown prior to the property, if its displayed.
298 | * **post** - Is shown after the property, if its displayed.
299 |
300 | And one special suffix:
301 |
302 | * **Theme** - Its value is passed to a function-type item as the theme.
303 |
304 | #### themes.addToAllThemes(theme)
305 |
306 | This *mixes-in* `theme` into all themes currently defined. It also adds it
307 | to the default parent theme for this themeset, so future themes added to
308 | this themeset will get the values from `theme` by default.
309 |
310 | #### themes.newThemeset()
311 |
312 | Copy the current themeset into a new one. This allows you to easily inherit
313 | one themeset from another.
314 |
315 | ### TEMPLATES
316 |
317 | A template is an array of objects and strings that, after being evaluated,
318 | will be turned into the gauge line. The default template is:
319 |
320 | ```javascript
321 | [
322 | {type: 'progressbar', length: 20},
323 | {type: 'activityIndicator', kerning: 1, length: 1},
324 | {type: 'section', kerning: 1},
325 | {type: 'subsection', kerning: 1}
326 | ]
327 | ```
328 |
329 | The various template elements can either be **plain strings**, in which case they will
330 | be be included verbatum in the output, or objects with the following properties:
331 |
332 | * *type* can be any of the following plus any keys you pass into `gauge.show` plus
333 | any keys you have on a custom theme.
334 | * `section` – What big thing you're working on now.
335 | * `subsection` – What component of that thing is currently working.
336 | * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme`
337 | from your active theme.
338 | * `progressbar` – A progress bar representing your current `completed`
339 | using the `progressbarTheme` from your active theme.
340 | * *kerning* – Number of spaces that must be between this item and other
341 | items, if this item is displayed at all.
342 | * *maxLength* – The maximum length for this element. If its value is longer it
343 | will be truncated.
344 | * *minLength* – The minimum length for this element. If its value is shorter it
345 | will be padded according to the *align* value.
346 | * *align* – (Default: left) Possible values "left", "right" and "center". Works
347 | as you'd expect from word processors.
348 | * *length* – Provides a single value for both *minLength* and *maxLength*. If both
349 | *length* and *minLength or *maxLength* are specifed then the latter take precedence.
350 | * *value* – A literal value to use for this template item.
351 |
352 | ### PLUMBING
353 |
354 | This is the super simple, assume nothing, do no magic internals used by gauge to
355 | implement its ordinary interface.
356 |
357 | ```
358 | var Plumbing = require('gauge/plumbing')
359 | var gauge = new Plumbing(theme, template, width)
360 | ```
361 |
362 | * **theme**: The theme to use.
363 | * **template**: The template to use.
364 | * **width**: How wide your gauge should be
365 |
366 | #### `gauge.setTheme(theme)`
367 |
368 | Change the active theme.
369 |
370 | #### `gauge.setTemplate(template)`
371 |
372 | Change the active template.
373 |
374 | #### `gauge.setWidth(width)`
375 |
376 | Change the width to render at.
377 |
378 | #### `gauge.hide()`
379 |
380 | Return the string necessary to hide the progress bar
381 |
382 | #### `gauge.hideCursor()`
383 |
384 | Return a string to hide the cursor.
385 |
386 | #### `gauge.showCursor()`
387 |
388 | Return a string to show the cursor.
389 |
390 | #### `gauge.show(status)`
391 |
392 | Using `status` for values, render the provided template with the theme and return
393 | a string that is suitable for printing to update the gauge.
394 |
--------------------------------------------------------------------------------
/node_modules/in-publish/README.md~:
--------------------------------------------------------------------------------
1 | in-publish
2 | ==========
3 |
4 | Detect if we were run as a result of `npm publish`. This is intended to allow you to
5 | easily have prepublish lifecycle scripts that don't run when you run `npm install`.
6 |
7 | ```
8 | $ npm install --save in-publish
9 | in-publish@1.0.0 node_modules/in-publish
10 | ```
11 |
12 | Then edit your package.json to have:
13 |
14 | ```json
15 | "scripts": {
16 | "prepublish": "in-publish && thing-I-dont-want-on-dev-install || in-install"
17 | }
18 | ```
19 |
20 | Now when you run:
21 | ```
22 | $ npm install
23 | ```
24 | Then `thing-I-dont-want-on-dev-install` won't be run, but...
25 |
26 | ```
27 | $ npm publish
28 | ```
29 | And `thing-I-dont-want-on-dev-install` will be run.
30 |
31 | Caveat Emptor
32 | =============
33 |
34 | This detects that its running as a part of publish command in a terrible,
35 | terrible way. NPM dumps out its config object blindly into the environment
36 | prior to running commands. This includes the command line it was invoked
37 | with. This module determines if its being run as a result of publish by
38 | looking at that env var. This is not a part of the documented npm interface
39 | and so it is not guarenteed to be stable.
40 |
41 |
--------------------------------------------------------------------------------
/node_modules/normalize-package-data/test/normalize.js~:
--------------------------------------------------------------------------------
1 | var tap = require("tap")
2 | var fs = require("fs")
3 | var path = require("path")
4 |
5 | var globals = Object.keys(global)
6 |
7 | var normalize = require("../lib/normalize")
8 | var warningMessages = require("../lib/warning_messages.json")
9 | var safeFormat = require("../lib/safe_format")
10 |
11 | var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json")
12 |
13 | tap.test("normalize some package data", function(t) {
14 | var packageData = require(rpjPath)
15 | var warnings = []
16 | normalize(packageData, function(warning) {
17 | warnings.push(warning)
18 | })
19 | // there's no readme data in this particular object
20 | t.equal( warnings.length, 1, "There's exactly one warning.")
21 | fs.readFile(rpjPath, function(err, data) {
22 | if(err) throw err
23 | // Various changes have been made
24 | t.notEqual(packageData, JSON.parse(data), "Output is different from input.")
25 | t.end()
26 | })
27 | })
28 |
29 | tap.test("runs without passing warning function", function(t) {
30 | var packageData = require(rpjPath)
31 | fs.readFile(rpjPath, function(err, data) {
32 | if(err) throw err
33 | normalize(JSON.parse(data))
34 | t.ok(true, "If you read this, this means I'm still alive.")
35 | t.end()
36 | })
37 | })
38 |
39 | tap.test("empty object", function(t) {
40 | var packageData = {}
41 | var expect =
42 | { name: '',
43 | version: '',
44 | readme: 'ERROR: No README data found!',
45 | _id: '@' }
46 |
47 | var warnings = []
48 | function warn(m) {
49 | warnings.push(m)
50 | }
51 | normalize(packageData, warn)
52 | t.same(packageData, expect)
53 | t.same(warnings, [
54 | warningMessages.missingDescription,
55 | warningMessages.missingRepository,
56 | warningMessages.missingReadme,
57 | warningMessages.missingLicense
58 | ])
59 | t.end()
60 | })
61 |
62 | tap.test("core module name", function(t) {
63 | var warnings = []
64 | function warn(m) {
65 | warnings.push(m)
66 | }
67 | var a
68 | normalize(a={
69 | name: "http",
70 | readme: "read yourself how about",
71 | homepage: 123,
72 | bugs: "what is this i don't even",
73 | repository: "Hello."
74 | }, warn)
75 |
76 | var expect = [
77 | safeFormat(warningMessages.conflictingName, 'http'),
78 | warningMessages.nonEmailUrlBugsString,
79 | warningMessages.emptyNormalizedBugs,
80 | warningMessages.nonUrlHomepage,
81 | warningMessages.missingLicense
82 | ]
83 | t.same(warnings, expect)
84 | t.end()
85 | })
86 |
87 | tap.test("urls required", function(t) {
88 | var warnings = []
89 | function warn(w) {
90 | warnings.push(w)
91 | }
92 | normalize({
93 | bugs: {
94 | url: "/1",
95 | email: "not an email address"
96 | }
97 | }, warn)
98 | var a
99 | normalize(a={
100 | readme: "read yourself how about",
101 | homepage: 123,
102 | bugs: "what is this i don't even",
103 | repository: "Hello."
104 | }, warn)
105 |
106 | console.error(a)
107 |
108 | var expect =
109 | [ warningMessages.missingDescription,
110 | warningMessages.missingRepository,
111 | warningMessages.nonUrlBugsUrlField,
112 | warningMessages.nonEmailBugsEmailField,
113 | warningMessages.emptyNormalizedBugs,
114 | warningMessages.missingReadme,
115 | warningMessages.missingLicense,
116 | warningMessages.nonEmailUrlBugsString,
117 | warningMessages.emptyNormalizedBugs,
118 | warningMessages.nonUrlHomepage,
119 | warningMessages.missingLicense]
120 | t.same(warnings, expect)
121 | t.end()
122 | })
123 |
124 | tap.test("homepage field must start with a protocol.", function(t) {
125 | var warnings = []
126 | function warn(w) {
127 | warnings.push(w)
128 | }
129 | var a
130 | normalize(a={
131 | homepage: 'example.org'
132 | }, warn)
133 |
134 | console.error(a)
135 |
136 | var expect =
137 | [ warningMessages.missingDescription,
138 | warningMessages.missingRepository,
139 | warningMessages.missingReadme,
140 | warningMessages.missingProtocolHomepage,
141 | warningMessages.missingLicense]
142 | t.same(warnings, expect)
143 | t.same(a.homepage, 'http://example.org')
144 | t.end()
145 | })
146 |
147 | tap.test("license field should be a valid SPDX expression", function(t) {
148 | var warnings = []
149 | function warn(w) {
150 | warnings.push(w)
151 | }
152 | var a
153 | normalize(a={
154 | license: 'Apache 2'
155 | }, warn)
156 |
157 | console.error(a)
158 |
159 | var expect =
160 | [ warningMessages.missingDescription,
161 | warningMessages.missingRepository,
162 | warningMessages.missingReadme,
163 | warningMessages.invalidLicense]
164 | t.same(warnings, expect)
165 | t.end()
166 | })
167 |
168 | tap.test("gist bugs url", function(t) {
169 | var d = {
170 | repository: "git@gist.github.com:123456.git"
171 | }
172 | normalize(d)
173 | t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' })
174 | t.same(d.bugs, { url: 'https://gist.github.com/123456' })
175 | t.end();
176 | });
177 |
178 | tap.test("singularize repositories", function(t) {
179 | var d = {repositories:["git@gist.github.com:123456.git"]}
180 | normalize(d)
181 | t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' })
182 | t.end()
183 | });
184 |
185 | tap.test("treat visionmedia/express as github repo", function(t) {
186 | var d = {repository: {type: "git", url: "visionmedia/express"}}
187 | normalize(d)
188 | t.same(d.repository, { type: "git", url: "git+https://github.com/visionmedia/express.git" })
189 | t.end()
190 | });
191 |
192 | tap.test("treat isaacs/node-graceful-fs as github repo", function(t) {
193 | var d = {repository: {type: "git", url: "isaacs/node-graceful-fs"}}
194 | normalize(d)
195 | t.same(d.repository, { type: "git", url: "git+https://github.com/isaacs/node-graceful-fs.git" })
196 | t.end()
197 | });
198 |
199 | tap.test("homepage field will set to github url if repository is a github repo", function(t) {
200 | var a
201 | normalize(a={
202 | repository: { type: "git", url: "https://github.com/isaacs/node-graceful-fs" }
203 | })
204 | t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs#readme')
205 | t.end()
206 | })
207 |
208 | tap.test("homepage field will set to github gist url if repository is a gist", function(t) {
209 | var a
210 | normalize(a={
211 | repository: { type: "git", url: "git@gist.github.com:123456.git" }
212 | })
213 | t.same(a.homepage, 'https://gist.github.com/123456')
214 | t.end()
215 | })
216 |
217 | tap.test("homepage field will set to github gist url if repository is a shorthand reference", function(t) {
218 | var a
219 | normalize(a={
220 | repository: { type: "git", url: "sindresorhus/chalk" }
221 | })
222 | t.same(a.homepage, 'https://github.com/sindresorhus/chalk#readme')
223 | t.end()
224 | })
225 |
226 | tap.test("don't mangle github shortcuts in dependencies", function(t) {
227 | var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}}
228 | normalize(d)
229 | t.same(d.dependencies, {"node-graceful-fs": "github:isaacs/node-graceful-fs" })
230 | t.end()
231 | });
232 |
233 | tap.test("deprecation warning for array in dependencies fields", function(t) {
234 | var a
235 | var warnings = []
236 | function warn(w) {
237 | warnings.push(w)
238 | }
239 | normalize(a={
240 | dependencies: [],
241 | devDependencies: [],
242 | optionalDependencies: []
243 | }, warn)
244 | t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'dependencies')), "deprecation warning")
245 | t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'devDependencies')), "deprecation warning")
246 | t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'optionalDependencies')), "deprecation warning")
247 | t.end()
248 | })
249 |
250 | tap.test('no new globals', function(t) {
251 | t.same(Object.keys(global), globals)
252 | t.end()
253 | })
254 |
--------------------------------------------------------------------------------
/node_modules/npmlog/CHANGELOG.md~:
--------------------------------------------------------------------------------
1 | ### v3.1.1
2 |
3 | * Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to
4 | when a progress bar is enabled. In `1.x` if you didn't have a TTY the
5 | progress bar was never shown. In `2.x` it merely defaults to disabled,
6 | but you can enable it explicitly if you still want progress updates.
7 |
8 | ### v3.1.0
9 |
10 | * Update to `gauge@2.5.2`:
11 | * Updates the `signal-exit` dependency which fixes an incompatibility with
12 | the node profiler.
13 | * Uses externalizes its ansi code generation in `console-control-strings`
14 | * Make the default progress bar include the last line printed, colored as it
15 | would be when printing to a tty.
16 |
17 | ### v3.0.0
18 |
19 | * Switch to `gauge@2.0.0`, for better performance, better look.
20 | * Set stderr/stdout blocking if they're tty's, so that we can hide a
21 | progress bar going to stderr and then safely print to stdout. Without
22 | this the two can end up overlapping producing confusing and sometimes
23 | corrupted output.
24 |
25 | ### v2.0.0
26 |
27 | * Make the `error` event non-fatal so that folks can use it as a prefix.
28 |
29 | ### v1.0.0
30 |
31 | * Add progress bar with `gauge@1.1.0`
32 |
--------------------------------------------------------------------------------
/node_modules/querystring/.History.md.un~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scopsy/angular-1-redux-starter/3d2510eab606dfb55a16374139ba8fd220758e70/node_modules/querystring/.History.md.un~
--------------------------------------------------------------------------------
/node_modules/querystring/.Readme.md.un~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scopsy/angular-1-redux-starter/3d2510eab606dfb55a16374139ba8fd220758e70/node_modules/querystring/.Readme.md.un~
--------------------------------------------------------------------------------
/node_modules/querystring/.package.json.un~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scopsy/angular-1-redux-starter/3d2510eab606dfb55a16374139ba8fd220758e70/node_modules/querystring/.package.json.un~
--------------------------------------------------------------------------------
/node_modules/querystring/test/.index.js.un~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scopsy/angular-1-redux-starter/3d2510eab606dfb55a16374139ba8fd220758e70/node_modules/querystring/test/.index.js.un~
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-1-redux-starter",
3 | "version": "0.0.1",
4 | "description": "Starter application for angular 1 using redux architecture.",
5 | "main": "index.js",
6 | "dependencies": {
7 | "angular": "^1.5.0",
8 | "angular-ui-router": "^0.2.15",
9 | "lodash": "^3.8.0",
10 | "ng-redux": "^3.4.0-beta.1",
11 | "node-sass": "^3.8.0",
12 | "normalize.css": "^3.0.3",
13 | "redux": "^3.5.2"
14 | },
15 | "devDependencies": {
16 | "angular-mocks": "^1.5.0",
17 | "babel-core": "^5.4.2",
18 | "babel-loader": "^5.0.0",
19 | "bootstrap": "3.3.6",
20 | "browser-sync": "^2.11.1",
21 | "chai": "^3.4.0",
22 | "connect-history-api-fallback": "^1.1.0",
23 | "css-loader": "^0.19.0",
24 | "file-loader": "^0.9.0",
25 | "fs-walk": "0.0.1",
26 | "gulp": "^3.9.0",
27 | "gulp-rename": "^1.2.2",
28 | "gulp-template": "^3.0.0",
29 | "gulp-util": "^3.0.7",
30 | "html-webpack-plugin": "^1.7.0",
31 | "karma": "^0.13.9",
32 | "karma-chai": "^0.1.0",
33 | "karma-chrome-launcher": "^0.2.0",
34 | "karma-mocha": "^0.2.0",
35 | "karma-mocha-reporter": "^1.0.2",
36 | "karma-sourcemap-loader": "^0.3.4",
37 | "karma-webpack": "^1.5.1",
38 | "mocha": "^2.3.0",
39 | "ng-annotate-loader": "0.0.10",
40 | "node-libs-browser": "^0.5.0",
41 | "raw-loader": "^0.5.1",
42 | "run-sequence": "^1.1.0",
43 | "sass-loader": "^3.1.2",
44 | "style-loader": "^0.12.2",
45 | "stylus-loader": "^1.1.1",
46 | "supports-color": "^3.1.2",
47 | "url-loader": "^0.5.7",
48 | "webpack": "^1.9.5",
49 | "webpack-dev-middleware": "^1.4.0",
50 | "webpack-hot-middleware": "^2.6.0",
51 | "yargs": "^3.9.0"
52 | },
53 | "scripts": {
54 | "test": "karma start"
55 | },
56 | "keywords": [
57 | "angular",
58 | "webpack",
59 | "es6"
60 | ],
61 | "repository": {
62 | "type": "git",
63 | "url": "https://github.com/angularclass/NG6-starter.git"
64 | },
65 | "author": "AngularClass",
66 | "license": "Apache-2.0"
67 | }
68 |
--------------------------------------------------------------------------------
/spec.bundle.js:
--------------------------------------------------------------------------------
1 | /*
2 | * When testing with Webpack and ES6, we have to do some
3 | * preliminary setup. Because we are writing our tests also in ES6,
4 | * we must transpile those as well, which is handled inside
5 | * `karma.conf.js` via the `karma-webpack` plugin. This is the entry
6 | * file for the Webpack tests. Similarly to how Webpack creates a
7 | * `bundle.js` file for the compressed app source files, when we
8 | * run our tests, Webpack, likewise, compiles and bundles those tests here.
9 | */
10 |
11 | import angular from 'angular';
12 |
13 | // Built by the core Angular team for mocking dependencies
14 | import mocks from 'angular-mocks';
15 |
16 | // We use the context method on `require` which Webpack created
17 | // in order to signify which files we actually want to require or import.
18 | // Below, `context` will be a/an function/object with file names as keys.
19 | // Using that regex, we scan within `client/app` and target
20 | // all files ending with `.spec.js` and trace its path.
21 | // By passing in true, we permit this process to occur recursively.
22 | let context = require.context('./client/app', true, /\.spec\.js/);
23 |
24 | // Get all files, for each file, call the context function
25 | // that will require the file and load it here. Context will
26 | // loop and require those spec files here.
27 | context.keys().forEach(context);
28 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var webpack = require('webpack');
3 | var HtmlWebpackPlugin = require('html-webpack-plugin');
4 |
5 | module.exports = {
6 | devtool: 'sourcemap',
7 | entry: {},
8 | module: {
9 | loaders: [
10 | { test: /\.js$/, exclude: [/app\/lib/, /node_modules/], loader: 'ng-annotate!babel' },
11 | { test: /\.html$/, loader: 'raw' },
12 | {
13 | test : /\.woff/,
14 | loader : require.resolve("url-loader") + '?prefix=font/&limit=10000&mimetype=application/font-woff&name=assets/[hash].[ext]'
15 | },
16 | {
17 | test : /\.ttf/,
18 | loader : require.resolve("file-loader") + '?prefix=font/&name=assets/[hash].[ext]'
19 | },
20 | {
21 | test : /\.eot/,
22 | loader : require.resolve("file-loader") + '?prefix=font/&name=assets/[hash].[ext]'
23 | },
24 | {
25 | test : /\.svg/,
26 | loader : require.resolve("file-loader") + '?prefix=font/&name=assets/[hash].[ext]'
27 | },
28 | { test: /\.scss$/, loader: 'style!css?sourceMap!sass?sourceMap' },
29 | { test: /\.css$/, loader: 'style!css' }
30 | ]
31 | },
32 | plugins: [
33 | // Injects bundles in your index.html instead of wiring all manually.
34 | // It also adds hash to all injected assets so we don't have problems
35 | // with cache purging during deployment.
36 | new HtmlWebpackPlugin({
37 | template: 'client/index.html',
38 | inject: 'body',
39 | hash: true
40 | }),
41 |
42 | // Automatically move all modules defined outside of application directory to vendor bundle.
43 | // If you are using more complicated project structure, consider to specify common chunks manually.
44 | new webpack.optimize.CommonsChunkPlugin({
45 | name: 'vendor',
46 | minChunks: function (module, count) {
47 | return module.resource && module.resource.indexOf(path.resolve(__dirname, 'client')) === -1;
48 | }
49 | })
50 | ]
51 | };
52 |
--------------------------------------------------------------------------------
/webpack.dev.config.js:
--------------------------------------------------------------------------------
1 | var webpack = require('webpack');
2 | var path = require('path');
3 | var config = require('./webpack.config');
4 |
5 | config.output = {
6 | filename: '[name].bundle.js',
7 | publicPath: '/',
8 | path: path.resolve(__dirname, 'client')
9 | };
10 |
11 | config.plugins = config.plugins.concat([
12 |
13 | // Adds webpack HMR support. It act's like livereload,
14 | // reloading page after webpack rebuilt modules.
15 | // It also updates stylesheets and inline assets without page reloading.
16 | new webpack.HotModuleReplacementPlugin()
17 | ]);
18 |
19 | module.exports = config;
20 |
--------------------------------------------------------------------------------
/webpack.dist.config.js:
--------------------------------------------------------------------------------
1 | var webpack = require('webpack');
2 | var path = require('path');
3 | var config = require('./webpack.config');
4 |
5 | config.output = {
6 | filename: '[name].bundle.js',
7 | publicPath: '',
8 | path: path.resolve(__dirname, 'dist')
9 | };
10 |
11 | config.plugins = config.plugins.concat([
12 |
13 | // Reduces bundles total size
14 | new webpack.optimize.UglifyJsPlugin({
15 | mangle: {
16 |
17 | // You can specify all variables that should not be mangled.
18 | // For example if your vendor dependency doesn't use modules
19 | // and relies on global variables. Most of angular modules relies on
20 | // angular global variable, so we should keep it unchanged
21 | except: ['$super', '$', 'exports', 'require', 'angular']
22 | }
23 | })
24 | ]);
25 |
26 | module.exports = config;
27 |
--------------------------------------------------------------------------------