@joystick.js/cli-canary 0.0.0-canary.604 → 0.0.0-canary.605

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.
@@ -1 +1 @@
1
- import _ from"query-string";import{WebSocketServer as g}from"ws";import l from"../generate_id.js";import N from"./get_translations.js";process.title="joystick_hmr";var R=(()=>{const a=new g({port:parseInt(process.env.PORT,10)+1,path:"/_joystick/hmr"});process.on("message",async r=>{const e=JSON.parse(r);if(typeof process.HMR_CONNECTIONS=="object"&&e?.type){const t=Object.values(process.HMR_CONNECTIONS);for(let s=0;s<t?.length;s+=1){const n=t[s];if(n?.connection?.send){if(console.log({parsed_message:e}),e?.type==="BUILD_ERROR")return console.log("SEND BUILD ERROR"),n.connection.send(JSON.stringify({type:"BUILD_ERROR"}));if(e?.type==="FILE_CHANGE")return console.log("SEND FILE CHANGE"),n.connection.send(JSON.stringify({type:"FILE_CHANGE",settings:e?.settings?{global:e?.settings?.global,public:e?.settings?.public}:null,i18n:e?.i18n_change?await N("./.joystick/build",n?.page_component_path,{headers:{"accept-language":n?.browser_language},context:{user:{language:n?.user_language}}}):null,index_html_changed:e?.index_html_change,index_css_changed:e?.index_css_change,index_client_changed:e?.index_client_change}))}}}}),a.on("connection",function(e,t={}){const s=l(16),[n,i]=t?.url?.split("?"),o=_.parse(i);process.HMR_CONNECTIONS={...process.HMR_CONNECTIONS||{},[s]:{connection:e,browser_language:o?.browser_language,user_language:o?.user_language,page_component_path:o?.page_component_path,watchlist:[]}},Object.keys(process.HMR_CONNECTIONS||{})?.length>0&&process.send({type:"HAS_HMR_CONNECTIONS"}),e.on("message",p=>{const c=JSON.parse(p);c?.type==="HMR_UPDATE_COMPLETE"&&process.send({type:"HMR_UPDATE_COMPLETE"}),c?.type==="HMR_WATCHLIST"&&process.HMR_CONNECTIONS[s]?.watchlist?.push(...c?.tags||[])}),e.on("close",()=>{process.HMR_CONNECTIONS[s]&&(delete process.HMR_CONNECTIONS[s],Object.keys(process.HMR_CONNECTIONS||{})?.length===0&&process.send({type:"HAS_NO_HMR_CONNECTIONS"}))})})})();export{R as default};
1
+ import _ from"query-string";import{WebSocketServer as g}from"ws";import N from"../generate_id.js";import l from"./get_translations.js";process.title="joystick_hmr";var h=(()=>{const a=new g({port:parseInt(process.env.PORT,10)+1,path:"/_joystick/hmr"});process.on("message",async r=>{const e=JSON.parse(r);if(typeof process.HMR_CONNECTIONS=="object"&&e?.type){const t=Object.values(process.HMR_CONNECTIONS);for(let s=0;s<t?.length;s+=1){const n=t[s];if(n?.connection?.send){if(e?.type==="BUILD_ERROR")return n.connection.send(JSON.stringify({type:"BUILD_ERROR"}));if(e?.type==="FILE_CHANGE")return n.connection.send(JSON.stringify({type:"FILE_CHANGE",settings:e?.settings?{global:e?.settings?.global,public:e?.settings?.public}:null,i18n:e?.i18n_change?await l("./.joystick/build",n?.page_component_path,{headers:{"accept-language":n?.browser_language},context:{user:{language:n?.user_language}}}):null,index_html_changed:e?.index_html_change,index_css_changed:e?.index_css_change,index_client_changed:e?.index_client_change}))}}}}),a.on("connection",function(e,t={}){const s=N(16),[n,i]=t?.url?.split("?"),o=_.parse(i);process.HMR_CONNECTIONS={...process.HMR_CONNECTIONS||{},[s]:{connection:e,browser_language:o?.browser_language,user_language:o?.user_language,page_component_path:o?.page_component_path,watchlist:[]}},Object.keys(process.HMR_CONNECTIONS||{})?.length>0&&process.send({type:"HAS_HMR_CONNECTIONS"}),e.on("message",p=>{const c=JSON.parse(p);c?.type==="HMR_UPDATE_COMPLETE"&&process.send({type:"HMR_UPDATE_COMPLETE"}),c?.type==="HMR_WATCHLIST"&&process.HMR_CONNECTIONS[s]?.watchlist?.push(...c?.tags||[])}),e.on("close",()=>{process.HMR_CONNECTIONS[s]&&(delete process.HMR_CONNECTIONS[s],Object.keys(process.HMR_CONNECTIONS||{})?.length===0&&process.send({type:"HAS_NO_HMR_CONNECTIONS"}))})})})();export{h as default};
@@ -1 +1 @@
1
- import e from"./get_platform_safe_path.js";var o=[e("api/"),e("cronJobs/"),e("cron_jobs/"),e("fixtures/"),e("lib/node"),e("queues/"),e("routes/"),e("tests/"),e("uploaders/"),e("websockets/"),"index.server.js"];export{o as default};
1
+ import e from"./get_platform_safe_path.js";var o=[e("api/"),e("cronJobs/"),e("cron_jobs/"),e("fixtures/"),e("indexes/"),e("lib/node"),e("queues/"),e("routes/"),e("tests/"),e("uploaders/"),e("websockets/"),"index.server.js"];export{o as default};
@@ -1 +1 @@
1
- import t from"../../build/copy_paths.js";const a=[{path:"api"},{path:"cronJobs"},{path:"cron_jobs"},{path:"email"},{path:"fixtures"},{path:"lib"},{path:"queues"},{path:"routes"},{path:"ui"},{path:"uploaders"},{path:"websockets"},{path:"index.client.js"},{path:"index.server.js"},...t];var h=a;export{h as default};
1
+ import t from"../../build/copy_paths.js";const a=[{path:"api"},{path:"cronJobs"},{path:"cron_jobs"},{path:"email"},{path:"fixtures"},{path:"indexes"},{path:"lib"},{path:"queues"},{path:"routes"},{path:"ui"},{path:"uploaders"},{path:"websockets"},{path:"index.client.js"},{path:"index.server.js"},...t];var e=a;export{e as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joystick.js/cli-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.604",
4
+ "version": "0.0.0-canary.605",
5
5
  "description": "The CLI for Joystick.",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
@@ -21,15 +21,11 @@ export default (() => {
21
21
  const connection = connections[i];
22
22
 
23
23
  if (connection?.connection?.send) {
24
- console.log({ parsed_message });
25
-
26
24
  if (parsed_message?.type === 'BUILD_ERROR') {
27
- console.log('SEND BUILD ERROR');
28
25
  return connection.connection.send(JSON.stringify({ type: 'BUILD_ERROR' }));
29
26
  }
30
27
 
31
28
  if (parsed_message?.type === 'FILE_CHANGE') {
32
- console.log('SEND FILE CHANGE');
33
29
  return connection.connection.send(
34
30
  JSON.stringify({
35
31
  type: "FILE_CHANGE",
@@ -5,6 +5,7 @@ export default [
5
5
  get_platform_safe_path("cronJobs/"),
6
6
  get_platform_safe_path("cron_jobs/"),
7
7
  get_platform_safe_path("fixtures/"),
8
+ get_platform_safe_path("indexes/"),
8
9
  get_platform_safe_path("lib/node"),
9
10
  get_platform_safe_path("queues/"),
10
11
  get_platform_safe_path("routes/"),
@@ -6,6 +6,7 @@ const watch_paths = [
6
6
  { path: "cron_jobs" },
7
7
  { path: "email" },
8
8
  { path: "fixtures" },
9
+ { path: "indexes" },
9
10
  { path: "lib" },
10
11
  { path: "queues" },
11
12
  { path: "routes" },