@joystick.js/cli-canary 0.0.0-canary.146 → 0.0.0-canary.148

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.
@@ -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 {
@@ -258,6 +271,7 @@ const handleRestartApplicationProcess = async (options = {}) => {
258
271
  process.loader.text("Restarting app...");
259
272
  }
260
273
  process.serverProcess.kill();
274
+ console.log("GETTING TO HERE");
261
275
  await handleStartAppServer(options);
262
276
  return Promise.resolve();
263
277
  }
@@ -295,8 +309,14 @@ const handleStartAppServer = async (options = {}) => {
295
309
  };
296
310
  const handleNotifyHMRClients = async (indexHTMLChanged = false) => {
297
311
  try {
312
+ console.log("CALLING HNHMRCLIENTS");
298
313
  if (process.hmrProcess) {
299
314
  const settings = await loadSettings(process.env.NODE_ENV);
315
+ console.log({
316
+ type: "RESTART_SERVER",
317
+ settings: settings.parsed,
318
+ indexHTMLChanged
319
+ });
300
320
  process.hmrProcess.send(
301
321
  JSON.stringify({
302
322
  type: "RESTART_SERVER",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joystick.js/cli-canary",
3
- "version": "0.0.0-canary.146",
3
+ "version": "0.0.0-canary.148",
4
4
  "type": "module",
5
5
  "description": "CLI for the Joystick JavaScript framework.",
6
6
  "main": "development.js",
@@ -119,7 +119,7 @@ const handleHMRProcessMessages = (options = {}) => {
119
119
 
120
120
  if (message?.type === "HMR_UPDATE_COMPLETED") {
121
121
  // NOTE: Do a setTimeout to ensure that server is still available while the HMR update completes.
122
- // Necessary because some updates are instance, but others might mount a UI that needs a server
122
+ // Necessary because some updates are instant, but others might mount a UI that needs a server
123
123
  // available (e.g., runs API requests).
124
124
  setTimeout(() => {
125
125
  handleRestartApplicationProcess({
@@ -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 {
@@ -315,6 +332,7 @@ const handleRestartApplicationProcess = async (options = {}) => {
315
332
 
316
333
  process.serverProcess.kill();
317
334
 
335
+ console.log('GETTING TO HERE');
318
336
  await handleStartAppServer(options);
319
337
 
320
338
  return Promise.resolve();
@@ -360,8 +378,15 @@ const handleStartAppServer = async (options = {}) => {
360
378
 
361
379
  const handleNotifyHMRClients = async (indexHTMLChanged = false) => {
362
380
  try {
381
+ console.log('CALLING HNHMRCLIENTS');
382
+
363
383
  if (process.hmrProcess) {
364
384
  const settings = await loadSettings(process.env.NODE_ENV);
385
+ console.log({
386
+ type: "RESTART_SERVER",
387
+ settings: settings.parsed,
388
+ indexHTMLChanged,
389
+ });
365
390
  process.hmrProcess.send(
366
391
  JSON.stringify({
367
392
  type: "RESTART_SERVER",