@joystick.js/cli-canary 0.0.0-canary.147 → 0.0.0-canary.149
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.
- package/dist/lib/dev/index.js +15 -0
- package/package.json +1 -1
- package/src/lib/dev/index.js +21 -0
package/dist/lib/dev/index.js
CHANGED
|
@@ -196,6 +196,10 @@ const handleAddOrChangeFile = async (context = {}, path2 = "", options = {}) =>
|
|
|
196
196
|
);
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
+
console.log("ADD/CHANGE FILE", {
|
|
200
|
+
context,
|
|
201
|
+
fileResultsHaveErrors
|
|
202
|
+
});
|
|
199
203
|
if (!fileResultsHaveErrors) {
|
|
200
204
|
process.initialBuildComplete = true;
|
|
201
205
|
if (context.isUIUpdate) {
|
|
@@ -213,6 +217,9 @@ const handleAddDirectory = (context = {}, path2 = "", options = {}) => {
|
|
|
213
217
|
try {
|
|
214
218
|
if (context.isAddDirectory) {
|
|
215
219
|
fs.mkdirSync(`./.joystick/build/${path2}`);
|
|
220
|
+
console.log("ADD DIR", {
|
|
221
|
+
context
|
|
222
|
+
});
|
|
216
223
|
if (context.isUIUpdate) {
|
|
217
224
|
handleNotifyHMRClients(context.isHTMLUpdate);
|
|
218
225
|
} else {
|
|
@@ -227,6 +234,9 @@ const handleCopyFile = (context = {}, path2 = "", options = {}) => {
|
|
|
227
234
|
try {
|
|
228
235
|
if (context.isFileToCopy && !context.isDirectory) {
|
|
229
236
|
fs.writeFileSync(`./.joystick/build/${path2}`, fs.readFileSync(path2));
|
|
237
|
+
console.log("COPY FILE", {
|
|
238
|
+
context
|
|
239
|
+
});
|
|
230
240
|
if (context.isUIUpdate) {
|
|
231
241
|
handleNotifyHMRClients(context.isHTMLUpdate);
|
|
232
242
|
} else {
|
|
@@ -241,6 +251,9 @@ const handleCopyDirectory = (context = {}, path2 = "", options = {}) => {
|
|
|
241
251
|
try {
|
|
242
252
|
if (context.isFileToCopy && context.isDirectory && !context.isExistingDirectoryInBuild) {
|
|
243
253
|
fs.mkdirSync(`./.joystick/build/${path2}`);
|
|
254
|
+
console.log("COPY DIR", {
|
|
255
|
+
context
|
|
256
|
+
});
|
|
244
257
|
if (context.isUIUpdate) {
|
|
245
258
|
handleNotifyHMRClients(context.isHTMLUpdate);
|
|
246
259
|
} else {
|
|
@@ -296,6 +309,7 @@ const handleStartAppServer = async (options = {}) => {
|
|
|
296
309
|
};
|
|
297
310
|
const handleNotifyHMRClients = async (indexHTMLChanged = false) => {
|
|
298
311
|
try {
|
|
312
|
+
console.log("CALLING HNHMRCLIENTS");
|
|
299
313
|
if (process.hmrProcess) {
|
|
300
314
|
const settings = await loadSettings(process.env.NODE_ENV);
|
|
301
315
|
console.log({
|
|
@@ -359,6 +373,7 @@ const startFileWatcher = (options = {}) => {
|
|
|
359
373
|
process.loader.text("Rebuilding app...");
|
|
360
374
|
}
|
|
361
375
|
const watchChangeContext = getWatchChangeContext(event, path2);
|
|
376
|
+
console.log("ON ALL CHANGES", watchChangeContext);
|
|
362
377
|
handleCopyDirectory(watchChangeContext, path2, options);
|
|
363
378
|
handleCopyFile(watchChangeContext, path2, options);
|
|
364
379
|
handleAddDirectory(watchChangeContext, path2, options);
|
package/package.json
CHANGED
package/src/lib/dev/index.js
CHANGED
|
@@ -243,6 +243,11 @@ const handleAddOrChangeFile = async (context = {}, path = '', options = {}) => {
|
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
console.log('ADD/CHANGE FILE', {
|
|
247
|
+
context,
|
|
248
|
+
fileResultsHaveErrors,
|
|
249
|
+
});
|
|
250
|
+
|
|
246
251
|
if (!fileResultsHaveErrors) {
|
|
247
252
|
process.initialBuildComplete = true;
|
|
248
253
|
|
|
@@ -263,6 +268,10 @@ const handleAddDirectory = (context = {}, path = '', options = {}) => {
|
|
|
263
268
|
if (context.isAddDirectory) {
|
|
264
269
|
fs.mkdirSync(`./.joystick/build/${path}`);
|
|
265
270
|
|
|
271
|
+
console.log('ADD DIR', {
|
|
272
|
+
context,
|
|
273
|
+
});
|
|
274
|
+
|
|
266
275
|
if (context.isUIUpdate) {
|
|
267
276
|
handleNotifyHMRClients(context.isHTMLUpdate);
|
|
268
277
|
} else {
|
|
@@ -279,6 +288,10 @@ const handleCopyFile = (context = {}, path = '', options = {}) => {
|
|
|
279
288
|
if (context.isFileToCopy && !context.isDirectory) {
|
|
280
289
|
fs.writeFileSync(`./.joystick/build/${path}`, fs.readFileSync(path));
|
|
281
290
|
|
|
291
|
+
console.log('COPY FILE', {
|
|
292
|
+
context,
|
|
293
|
+
});
|
|
294
|
+
|
|
282
295
|
if (context.isUIUpdate) {
|
|
283
296
|
handleNotifyHMRClients(context.isHTMLUpdate);
|
|
284
297
|
} else {
|
|
@@ -295,6 +308,10 @@ const handleCopyDirectory = (context = {}, path = '', options = {}) => {
|
|
|
295
308
|
if (context.isFileToCopy && context.isDirectory && !context.isExistingDirectoryInBuild) {
|
|
296
309
|
fs.mkdirSync(`./.joystick/build/${path}`);
|
|
297
310
|
|
|
311
|
+
console.log('COPY DIR', {
|
|
312
|
+
context,
|
|
313
|
+
});
|
|
314
|
+
|
|
298
315
|
if (context.isUIUpdate) {
|
|
299
316
|
handleNotifyHMRClients(context.isHTMLUpdate);
|
|
300
317
|
} else {
|
|
@@ -361,6 +378,8 @@ const handleStartAppServer = async (options = {}) => {
|
|
|
361
378
|
|
|
362
379
|
const handleNotifyHMRClients = async (indexHTMLChanged = false) => {
|
|
363
380
|
try {
|
|
381
|
+
console.log('CALLING HNHMRCLIENTS');
|
|
382
|
+
|
|
364
383
|
if (process.hmrProcess) {
|
|
365
384
|
const settings = await loadSettings(process.env.NODE_ENV);
|
|
366
385
|
console.log({
|
|
@@ -432,6 +451,8 @@ const startFileWatcher = (options = {}) => {
|
|
|
432
451
|
|
|
433
452
|
const watchChangeContext = getWatchChangeContext(event, path);
|
|
434
453
|
|
|
454
|
+
console.log('ON ALL CHANGES', watchChangeContext);
|
|
455
|
+
|
|
435
456
|
handleCopyDirectory(watchChangeContext, path, options);
|
|
436
457
|
handleCopyFile(watchChangeContext, path, options);
|
|
437
458
|
handleAddDirectory(watchChangeContext, path, options);
|