funkophile 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +280 -247
  3. package/index.ts +394 -342
  4. package/package.json +1 -1
  5. package/tsconfig.json +11 -11
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ declare const _default: () => void;
2
+ export default _default;
package/index.js CHANGED
@@ -30,271 +30,304 @@ var fs_extra_1 = require("fs-extra");
30
30
  var glob_promise_1 = require("glob-promise");
31
31
  var path_1 = require("path");
32
32
  var bluebird_1 = require("bluebird");
33
- if (process.argv[2] && (process.argv[3] === "watch" || process.argv[3] === "build")) {
34
- var configFile = path_1.default.resolve(process.argv[2]);
35
- var mode_1 = process.argv[3];
36
- // console.log("configfile", configFile);
37
- Promise.resolve("".concat(configFile)).then(function (s) { return require(s); }).then(function (funkophileConfigModule) {
38
- var funkophileConfig = funkophileConfigModule.default;
39
- // console.log("funkophileConfig", (funkophileConfig));
40
- bluebird_1.default.config({
41
- cancellation: true
42
- });
43
- var INITIALIZE = 'INITIALIZE';
44
- var UPSERT = 'UPSERT';
45
- var REMOVE = 'REMOVE';
46
- var previousState = {};
47
- var outputPromise = bluebird_1.default.resolve();
48
- var logger = {
49
- watchError: function (p) { return console.log("\u001b[7m ! \u001b[0m" + p); },
50
- watchReady: function (p) { return console.log("\u001b[7m\u001b[36m < \u001b[0m" + p); },
51
- watchAdd: function (p) { return console.log("\u001b[7m\u001b[34m + \u001b[0m./" + p); },
52
- watchChange: function (p) { return console.log("\u001b[7m\u001b[35m * \u001b[0m" + p); },
53
- watchUnlink: function (p) { return console.log("\u001b[7m\u001b[31m - \u001b[0m./" + p); },
54
- stateChange: function () { return console.log("\u001b[7m\u001b[31m --- Redux state changed --- \u001b[0m"); },
55
- cleaningEmptyfolder: function (p) { return console.log("\u001b[31m\u001b[7m XXX! \u001b[0m" + p); },
56
- readingFile: function (p) { return console.log("\u001b[31m <-- \u001b[0m" + p); },
57
- removedFile: function (p) { return console.log("\u001b[31m\u001b[7m ??? \u001b[0m./" + p); },
58
- writingString: function (p) { return console.log("\u001b[32m --> \u001b[0m" + p); },
59
- writingFunction: function (p) { return console.log("\u001b[33m ... \u001b[0m" + p); },
60
- writingPromise: function (p) { return console.log("\u001b[33m ... \u001b[0m" + p); },
61
- writingError: function (p, message) { return console.log("\u001b[31m !!! \u001b[0m" + p + " " + message); },
62
- waiting: function () { return console.log("\u001b[7m Funkophile is done for now but waiting on changes...\u001b[0m "); },
63
- done: function () { return console.log("\u001b[7m Funkophile is done!\u001b[0m "); }
64
- };
65
- function cleanEmptyFoldersRecursively(folder) {
66
- var isDir = fs_1.default.statSync(folder).isDirectory();
67
- if (!isDir) {
68
- return;
69
- }
70
- var files = fs_1.default.readdirSync(folder);
71
- if (files.length > 0) {
72
- files.forEach(function (file) {
73
- var fullPath = path_1.default.join(folder, file);
74
- });
75
- // re-evaluate files; after deleting subfolder
76
- // we may have parent folder empty now
77
- files = fs_1.default.readdirSync(folder);
78
- }
79
- if (files.length == 0) {
80
- logger.cleaningEmptyfolder(folder);
81
- fs_1.default.rmdirSync(folder);
82
- return;
83
- }
84
- }
85
- var dispatchUpsert = function (store, key, file, encodings) {
86
- var fileType = file.split('.').slice(-2, -1)[0];
87
- var encoding = Object.keys(encodings).find(function (e) { return encodings[e].includes(fileType); });
88
- if (!fileType || !encoding) {
89
- console.log("Unknown file type for ", file, "Defaulting to utf8");
90
- encoding = 'utf8';
91
- }
92
- // console.log("dispatchUpsert", encoding, file)
93
- logger.readingFile(file);
94
- store.dispatch({
95
- type: UPSERT,
96
- payload: {
97
- key: key,
98
- src: file,
99
- contents: fs_extra_1.default.readFileSync(file, encoding)
100
- }
33
+ exports.default = (function () {
34
+ if (process.argv[2] &&
35
+ (process.argv[3] === "watch" || process.argv[3] === "build")) {
36
+ var configFile = path_1.default.resolve(process.argv[2]);
37
+ var mode_1 = process.argv[3];
38
+ // console.log("configfile", configFile);
39
+ Promise.resolve("".concat(configFile)).then(function (s) { return require(s); }).then(function (funkophileConfigModule) {
40
+ var funkophileConfig = funkophileConfigModule.default;
41
+ // console.log("funkophileConfig", (funkophileConfig));
42
+ bluebird_1.default.config({
43
+ cancellation: true,
101
44
  });
102
- };
103
- function omit(key, obj) {
104
- var _a = obj, _b = key, omitted = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
105
- return rest;
106
- }
107
- var store = (0, redux_1.createStore)(function (state, action) {
108
- var _a, _b, _c;
109
- if (state === void 0) { state = __assign(__assign({ initialLoad: true }, funkophileConfig.initialState), { timestamp: Date.now() }); }
110
- // console.log("\u001b[7m\u001b[35m ||| Redux recieved action \u001b[0m", action.type)
111
- if (!action.type.includes('@@redux')) {
112
- if (action.type === INITIALIZE) {
113
- return __assign(__assign({}, state), { initialLoad: false, timestamp: Date.now() });
45
+ var INITIALIZE = "INITIALIZE";
46
+ var UPSERT = "UPSERT";
47
+ var REMOVE = "REMOVE";
48
+ var previousState = {};
49
+ var outputPromise = bluebird_1.default.resolve();
50
+ var logger = {
51
+ watchError: function (p) { return console.log("\u001b[7m ! \u001b[0m" + p); },
52
+ watchReady: function (p) {
53
+ return console.log("\u001b[7m\u001b[36m < \u001b[0m" + p);
54
+ },
55
+ watchAdd: function (p) {
56
+ return console.log("\u001b[7m\u001b[34m + \u001b[0m./" + p);
57
+ },
58
+ watchChange: function (p) {
59
+ return console.log("\u001b[7m\u001b[35m * \u001b[0m" + p);
60
+ },
61
+ watchUnlink: function (p) {
62
+ return console.log("\u001b[7m\u001b[31m - \u001b[0m./" + p);
63
+ },
64
+ stateChange: function () {
65
+ return console.log("\u001b[7m\u001b[31m --- Redux state changed --- \u001b[0m");
66
+ },
67
+ cleaningEmptyfolder: function (p) {
68
+ return console.log("\u001b[31m\u001b[7m XXX! \u001b[0m" + p);
69
+ },
70
+ readingFile: function (p) { return console.log("\u001b[31m <-- \u001b[0m" + p); },
71
+ removedFile: function (p) {
72
+ return console.log("\u001b[31m\u001b[7m ??? \u001b[0m./" + p);
73
+ },
74
+ writingString: function (p) {
75
+ return console.log("\u001b[32m --> \u001b[0m" + p);
76
+ },
77
+ writingFunction: function (p) {
78
+ return console.log("\u001b[33m ... \u001b[0m" + p);
79
+ },
80
+ writingPromise: function (p) {
81
+ return console.log("\u001b[33m ... \u001b[0m" + p);
82
+ },
83
+ writingError: function (p, message) {
84
+ return console.log("\u001b[31m !!! \u001b[0m" + p + " " + message);
85
+ },
86
+ waiting: function () {
87
+ return console.log("\u001b[7m Funkophile is done for now but waiting on changes...\u001b[0m ");
88
+ },
89
+ done: function () { return console.log("\u001b[7m Funkophile is done!\u001b[0m "); },
90
+ };
91
+ function cleanEmptyFoldersRecursively(folder) {
92
+ var isDir = fs_1.default.statSync(folder).isDirectory();
93
+ if (!isDir) {
94
+ return;
114
95
  }
115
- else if (action.type === UPSERT) {
116
- return __assign(__assign({}, state), (_a = {}, _a[action['payload'].key] = __assign(__assign({}, state[action.payload.key]), (_b = {},
117
- _b[action['payload'].src] = action['payload'].contents,
118
- _b)), _a.timestamp = Date.now(), _a));
119
- }
120
- else if (action.type === REMOVE) {
121
- return __assign(__assign({}, state), (_c = {}, _c[action['payload'].key] = omit(action['payload'].file, state[action['payload'].key]), _c.timestamp = Date.now(), _c));
96
+ var files = fs_1.default.readdirSync(folder);
97
+ if (files.length > 0) {
98
+ files.forEach(function (file) {
99
+ var fullPath = path_1.default.join(folder, file);
100
+ });
101
+ // re-evaluate files; after deleting subfolder
102
+ // we may have parent folder empty now
103
+ files = fs_1.default.readdirSync(folder);
122
104
  }
123
- else {
124
- console.error("Redux was asked to handle an unknown action type: " + action.type);
125
- process.exit(-1);
105
+ if (files.length == 0) {
106
+ logger.cleaningEmptyfolder(folder);
107
+ fs_1.default.rmdirSync(folder);
108
+ return;
126
109
  }
127
- // return state
128
110
  }
129
- });
130
- var finalSelector = funkophileConfig.outputs(Object.keys(funkophileConfig.inputs).reduce(function (mm, inputKey) {
131
- var _a;
132
- return __assign(__assign({}, mm), (_a = {}, _a[inputKey] = (0, reselect_1.createSelector)([function (x) { return x; }], function (root) { return root[inputKey]; }), _a));
133
- }, {}));
134
- // Wait for all the file watchers to check in
135
- bluebird_1.default.all(Object.keys(funkophileConfig.inputs)
136
- .map(function (inputRuleKey) {
137
- var p = path_1.default.resolve("./".concat(funkophileConfig.options.inFolder, "/").concat(funkophileConfig.inputs[inputRuleKey] || ''));
138
- return new bluebird_1.default(function (fulfill, reject) {
139
- if (mode_1 === "build") {
140
- (0, glob_promise_1.default)(p, {}).then(function (files) {
141
- files.forEach(function (file) {
142
- dispatchUpsert(store, inputRuleKey, file, funkophileConfig.encodings);
143
- });
144
- }).then(function () {
145
- fulfill();
146
- });
147
- }
148
- else if (mode_1 === "watch") {
149
- chokidar_1.default.watch(p, {})
150
- .on('error', function (error) {
151
- logger.watchError(p);
152
- })
153
- .on('ready', function () {
154
- logger.watchReady(p);
155
- fulfill();
156
- })
157
- .on('add', function (p) {
158
- logger.watchAdd(p);
159
- dispatchUpsert(store, inputRuleKey, './' + p, funkophileConfig.encodings);
160
- })
161
- .on('change', function (p) {
162
- logger.watchChange(p);
163
- dispatchUpsert(store, inputRuleKey, './' + p, funkophileConfig.encodings);
164
- })
165
- .on('unlink', function (p) {
166
- logger.watchUnlink(p);
167
- store.dispatch({
168
- type: REMOVE,
169
- payload: {
170
- key: inputRuleKey,
171
- file: './' + p
172
- }
173
- });
174
- })
175
- .on('unlinkDir', function (p) {
176
- logger.watchUnlink(p);
177
- });
178
- // .on('raw', (event, p, details) => { // internal
179
- // log('Raw event info:', event, p, details);
180
- // })
111
+ var dispatchUpsert = function (store, key, file, encodings) {
112
+ var fileType = file.split(".").slice(-2, -1)[0];
113
+ var encoding = Object.keys(encodings).find(function (e) {
114
+ return encodings[e].includes(fileType);
115
+ });
116
+ if (!fileType || !encoding) {
117
+ console.log("Unknown file type for ", file, "Defaulting to utf8");
118
+ encoding = "utf8";
181
119
  }
182
- else {
183
- console.error("The 3rd argument should be 'watch' or 'build', not \"".concat(mode_1, "\""));
184
- process.exit(-1);
120
+ // console.log("dispatchUpsert", encoding, file)
121
+ logger.readingFile(file);
122
+ store.dispatch({
123
+ type: UPSERT,
124
+ payload: {
125
+ key: key,
126
+ src: file,
127
+ contents: fs_extra_1.default.readFileSync(file, encoding),
128
+ },
129
+ });
130
+ };
131
+ function omit(key, obj) {
132
+ var _a = obj, _b = key, omitted = _a[_b], rest = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
133
+ return rest;
134
+ }
135
+ var store = (0, redux_1.createStore)(function (state, action) {
136
+ var _a, _b, _c;
137
+ if (state === void 0) { state = __assign(__assign({ initialLoad: true }, funkophileConfig.initialState), { timestamp: Date.now() }); }
138
+ // console.log("\u001b[7m\u001b[35m ||| Redux recieved action \u001b[0m", action.type)
139
+ if (!action.type.includes("@@redux")) {
140
+ if (action.type === INITIALIZE) {
141
+ return __assign(__assign({}, state), { initialLoad: false, timestamp: Date.now() });
142
+ }
143
+ else if (action.type === UPSERT) {
144
+ return __assign(__assign({}, state), (_a = {}, _a[action["payload"].key] = __assign(__assign({}, state[action.payload.key]), (_b = {},
145
+ _b[action["payload"].src] = action["payload"].contents,
146
+ _b)), _a.timestamp = Date.now(), _a));
147
+ }
148
+ else if (action.type === REMOVE) {
149
+ return __assign(__assign({}, state), (_c = {}, _c[action["payload"].key] = omit(action["payload"].file, state[action["payload"].key]), _c.timestamp = Date.now(), _c));
150
+ }
151
+ else {
152
+ console.error("Redux was asked to handle an unknown action type: " +
153
+ action.type);
154
+ process.exit(-1);
155
+ }
156
+ // return state
185
157
  }
186
158
  });
187
- })).then(function () {
188
- // listen for changes to the store
189
- store.subscribe(function () {
190
- var s = store.getState();
191
- logger.stateChange();
192
- var outputs = finalSelector(s);
193
- if (outputPromise.isPending()) {
194
- console.log('cancelling previous write!');
195
- outputPromise.cancel();
196
- }
197
- outputPromise = bluebird_1.default.all(Array.from(new Set(Object.keys(previousState).concat(Object.keys(outputs))))
198
- .map(function (key) {
199
- return new bluebird_1.default(function (fulfill, reject) {
200
- if (!outputs[key]) {
201
- var file = funkophileConfig.options.outFolder + "/" + key;
202
- logger.removedFile(file);
203
- try {
204
- fs_extra_1.default.unlinkSync('./' + file);
205
- cleanEmptyFoldersRecursively('./' + file.substring(0, file.lastIndexOf("/")));
206
- }
207
- catch (ex) {
208
- // console.error('inner', ex.message);
209
- // throw ex;
210
- }
211
- finally {
212
- // console.log('finally');
213
- return;
214
- }
215
- // delete previousState[key]
216
- // fulfill()
217
- }
218
- else {
219
- if (outputs[key] !== previousState[key]) {
220
- previousState[key] = outputs[key];
221
- var relativeFilePath_1 = './' + funkophileConfig.options.outFolder + "/" + key;
222
- var contents = outputs[key];
223
- if (typeof contents === "function") {
224
- logger.writingFunction(relativeFilePath_1);
225
- contents(function (err, res) {
226
- fs_extra_1.default.outputFile(relativeFilePath_1, res, fulfill);
227
- logger.writingString(relativeFilePath_1);
228
- });
229
- }
230
- else if (typeof contents === 'string') {
231
- fs_extra_1.default.outputFile(relativeFilePath_1, contents, fulfill);
232
- logger.writingString(relativeFilePath_1);
159
+ var finalSelector = funkophileConfig.outputs(Object.keys(funkophileConfig.inputs).reduce(function (mm, inputKey) {
160
+ var _a;
161
+ return __assign(__assign({}, mm), (_a = {}, _a[inputKey] = (0, reselect_1.createSelector)([function (x) { return x; }], function (root) { return root[inputKey]; }), _a));
162
+ }, {}));
163
+ // Wait for all the file watchers to check in
164
+ bluebird_1.default.all(Object.keys(funkophileConfig.inputs)
165
+ .map(function (inputRuleKey) {
166
+ var p = path_1.default.resolve("./".concat(funkophileConfig.options.inFolder, "/").concat(funkophileConfig.inputs[inputRuleKey] || ""));
167
+ return new bluebird_1.default(function (fulfill, reject) {
168
+ if (mode_1 === "build") {
169
+ (0, glob_promise_1.default)(p, {})
170
+ .then(function (files) {
171
+ files.forEach(function (file) {
172
+ dispatchUpsert(store, inputRuleKey, file, funkophileConfig.encodings);
173
+ });
174
+ })
175
+ .then(function () {
176
+ fulfill();
177
+ });
178
+ }
179
+ else if (mode_1 === "watch") {
180
+ chokidar_1.default
181
+ .watch(p, {})
182
+ .on("error", function (error) {
183
+ logger.watchError(p);
184
+ })
185
+ .on("ready", function () {
186
+ logger.watchReady(p);
187
+ fulfill();
188
+ })
189
+ .on("add", function (p) {
190
+ logger.watchAdd(p);
191
+ dispatchUpsert(store, inputRuleKey, "./" + p, funkophileConfig.encodings);
192
+ })
193
+ .on("change", function (p) {
194
+ logger.watchChange(p);
195
+ dispatchUpsert(store, inputRuleKey, "./" + p, funkophileConfig.encodings);
196
+ })
197
+ .on("unlink", function (p) {
198
+ logger.watchUnlink(p);
199
+ store.dispatch({
200
+ type: REMOVE,
201
+ payload: {
202
+ key: inputRuleKey,
203
+ file: "./" + p,
204
+ },
205
+ });
206
+ })
207
+ .on("unlinkDir", function (p) {
208
+ logger.watchUnlink(p);
209
+ });
210
+ // .on('raw', (event, p, details) => { // internal
211
+ // log('Raw event info:', event, p, details);
212
+ // })
213
+ }
214
+ else {
215
+ console.error("The 3rd argument should be 'watch' or 'build', not \"".concat(mode_1, "\""));
216
+ process.exit(-1);
217
+ }
218
+ });
219
+ })).then(function () {
220
+ // listen for changes to the store
221
+ store.subscribe(function () {
222
+ var s = store.getState();
223
+ logger.stateChange();
224
+ var outputs = finalSelector(s);
225
+ if (outputPromise.isPending()) {
226
+ console.log("cancelling previous write!");
227
+ outputPromise.cancel();
228
+ }
229
+ outputPromise = bluebird_1.default.all(Array.from(new Set(Object.keys(previousState).concat(Object.keys(outputs)))).map(function (key) {
230
+ return new bluebird_1.default(function (fulfill, reject) {
231
+ if (!outputs[key]) {
232
+ var file = funkophileConfig.options.outFolder + "/" + key;
233
+ logger.removedFile(file);
234
+ try {
235
+ fs_extra_1.default.unlinkSync("./" + file);
236
+ cleanEmptyFoldersRecursively("./" + file.substring(0, file.lastIndexOf("/")));
233
237
  }
234
- else if (Buffer.isBuffer(contents)) {
235
- fs_extra_1.default.outputFile(relativeFilePath_1, contents, fulfill);
236
- logger.writingString(relativeFilePath_1);
238
+ catch (ex) {
239
+ // console.error('inner', ex.message);
240
+ // throw ex;
237
241
  }
238
- else if (Array.isArray(contents)) {
239
- fs_extra_1.default.outputFile(relativeFilePath_1, JSON.stringify(contents), fulfill);
240
- logger.writingString(relativeFilePath_1);
242
+ finally {
243
+ // console.log('finally');
244
+ return;
241
245
  }
242
- else if (typeof contents.then === 'function') {
243
- logger.writingPromise(relativeFilePath_1);
244
- bluebird_1.default.resolve(contents).then(function (value) {
245
- if (value instanceof Error) {
246
- logger.writingError(relativeFilePath_1, value.message);
247
- }
248
- else {
249
- fs_extra_1.default.outputFile(relativeFilePath_1, value, fulfill);
246
+ // delete previousState[key]
247
+ // fulfill()
248
+ }
249
+ else {
250
+ if (outputs[key] !== previousState[key]) {
251
+ previousState[key] = outputs[key];
252
+ var relativeFilePath_1 = "./" + funkophileConfig.options.outFolder + "/" + key;
253
+ var contents = outputs[key];
254
+ if (typeof contents === "function") {
255
+ logger.writingFunction(relativeFilePath_1);
256
+ contents(function (err, res) {
257
+ fs_extra_1.default.outputFile(relativeFilePath_1, res, fulfill);
250
258
  logger.writingString(relativeFilePath_1);
251
- }
252
- }, function (value) {
253
- // not called
254
- });
255
- }
256
- else if (typeof contents === 'object') {
257
- fs_extra_1.default.outputFile(relativeFilePath_1, JSON.stringify(contents), fulfill);
258
- logger.writingString(relativeFilePath_1);
259
+ });
260
+ }
261
+ else if (typeof contents === "string") {
262
+ fs_extra_1.default.outputFile(relativeFilePath_1, contents, fulfill);
263
+ logger.writingString(relativeFilePath_1);
264
+ }
265
+ else if (Buffer.isBuffer(contents)) {
266
+ fs_extra_1.default.outputFile(relativeFilePath_1, contents, fulfill);
267
+ logger.writingString(relativeFilePath_1);
268
+ }
269
+ else if (Array.isArray(contents)) {
270
+ fs_extra_1.default.outputFile(relativeFilePath_1, JSON.stringify(contents), fulfill);
271
+ logger.writingString(relativeFilePath_1);
272
+ }
273
+ else if (typeof contents.then === "function") {
274
+ logger.writingPromise(relativeFilePath_1);
275
+ bluebird_1.default.resolve(contents).then(function (value) {
276
+ if (value instanceof Error) {
277
+ logger.writingError(relativeFilePath_1, value.message);
278
+ }
279
+ else {
280
+ fs_extra_1.default.outputFile(relativeFilePath_1, value, fulfill);
281
+ logger.writingString(relativeFilePath_1);
282
+ }
283
+ }, function (value) {
284
+ // not called
285
+ });
286
+ }
287
+ else if (typeof contents === "object") {
288
+ fs_extra_1.default.outputFile(relativeFilePath_1, JSON.stringify(contents), fulfill);
289
+ logger.writingString(relativeFilePath_1);
290
+ }
291
+ else {
292
+ console.log("I don't recognize what this is but I will try to write it to a file: " +
293
+ relativeFilePath_1, typeof contents, contents);
294
+ fs_extra_1.default.outputFile(relativeFilePath_1, contents, fulfill);
295
+ logger.writingString(relativeFilePath_1);
296
+ }
259
297
  }
260
298
  else {
261
- console.log("I don't recognize what this is but I will try to write it to a file: " + relativeFilePath_1, typeof contents, contents);
262
- fs_extra_1.default.outputFile(relativeFilePath_1, contents, fulfill);
263
- logger.writingString(relativeFilePath_1);
299
+ fulfill();
264
300
  }
265
301
  }
266
- else {
267
- fulfill();
268
- }
302
+ });
303
+ })).then(function () {
304
+ cleanEmptyFoldersRecursively(funkophileConfig.options.outFolder);
305
+ if (mode_1 === "build") {
306
+ logger.done();
307
+ }
308
+ else if (mode_1 === "watch") {
309
+ logger.waiting();
310
+ }
311
+ else {
312
+ console.error("The 3rd argument should be 'watch' or 'build', not \"".concat(mode_1, "\""));
313
+ process.exit(-1);
269
314
  }
270
315
  });
271
- })).then(function () {
272
- cleanEmptyFoldersRecursively(funkophileConfig.options.outFolder);
273
- if (mode_1 === "build") {
274
- logger.done();
275
- }
276
- else if (mode_1 === "watch") {
277
- logger.waiting();
278
- }
279
- else {
280
- console.error("The 3rd argument should be 'watch' or 'build', not \"".concat(mode_1, "\""));
281
- process.exit(-1);
282
- }
283
316
  });
284
- });
285
- // lastly, turn the store `on`.
286
- // This is to prevent unecessary recomputations when initialy adding files to redux
287
- store.dispatch({
288
- type: INITIALIZE,
289
- payload: true
317
+ // lastly, turn the store `on`.
318
+ // This is to prevent unecessary recomputations when initialy adding files to redux
319
+ store.dispatch({
320
+ type: INITIALIZE,
321
+ payload: true,
322
+ });
290
323
  });
291
324
  });
292
- });
293
- }
294
- else {
295
- console.error("command line arguments do not make sense");
296
- console.error("first argument should be a funkophile config file");
297
- console.error("second argument should be a 'build' or 'watch'");
298
- console.error("You passed", process.argv);
299
- process.exit(-1);
300
- }
325
+ }
326
+ else {
327
+ console.error("command line arguments do not make sense");
328
+ console.error("first argument should be a funkophile config file");
329
+ console.error("second argument should be a 'build' or 'watch'");
330
+ console.error("You passed", process.argv);
331
+ process.exit(-1);
332
+ }
333
+ });