@joystick.js/cli-canary 0.0.0-canary.592 → 0.0.0-canary.594

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 e from"./get_platform_safe_path.js";const t=[e("api/"),e("cronJobs/"),e("fixtures/"),e("lib/node"),e("queues/"),e("routes/"),e("tests/"),"index.server.js"];var o=t;export{o as default};
1
+ import e from"./get_platform_safe_path.js";const o=[e("api/"),e("cronJobs/"),e("cron_jobs/"),e("fixtures/"),e("lib/node"),e("queues/"),e("routes/"),e("tests/"),"index.server.js"];var t=o;export{t as default};
@@ -1 +1 @@
1
- import p 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 r=new g({port:parseInt(process.env.PORT,10)+1,path:"/_joystick/hmr"});process.on("message",async a=>{const e=JSON.parse(a);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)switch(e?.type){case"BUILD_ERROR":return n.connection.send(JSON.stringify({type:"BUILD_ERROR"}));case"FILE_CHANGE":default: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}))}}}}),r.on("connection",function(e,t={}){const s=N(16),[n,_]=t?.url?.split("?"),o=p.parse(_);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",i=>{const c=JSON.parse(i);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
+ import p 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 h=(()=>{const r=new g({port:parseInt(process.env.PORT,10)+1,path:"/_joystick/hmr"});process.on("message",async a=>{const e=JSON.parse(a);if(console.log({parsed_message:e}),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)switch(e?.type){case"BUILD_ERROR":return n.connection.send(JSON.stringify({type:"BUILD_ERROR"}));case"FILE_CHANGE":default: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 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}))}}}}),r.on("connection",function(e,t={}){const s=l(16),[n,_]=t?.url?.split("?"),o=p.parse(_);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",i=>{const c=JSON.parse(i);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 r=[e("api/"),e("cronJobs/"),e("fixtures/"),e("lib/node"),e("queues/"),e("routes/"),e("tests/"),"index.server.js"];export{r as default};
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 +1 @@
1
- import t from"../../build/copy_paths.js";const a=[{path:"api"},{path:"cronJobs"},{path:"email"},{path:"fixtures"},{path:"lib"},{path:"ui"},{path:"routes"},{path:"queues"},{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:"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};
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.592",
4
+ "version": "0.0.0-canary.594",
5
5
  "description": "The CLI for Joystick.",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
@@ -3,6 +3,7 @@ import get_platform_safe_path from "./get_platform_safe_path.js";
3
3
  const node_paths = [
4
4
  get_platform_safe_path("api/"),
5
5
  get_platform_safe_path("cronJobs/"),
6
+ get_platform_safe_path("cron_jobs/"),
6
7
  get_platform_safe_path("fixtures/"),
7
8
  get_platform_safe_path("lib/node"),
8
9
  get_platform_safe_path("queues/"),
@@ -14,6 +14,8 @@ export default (() => {
14
14
  process.on("message", async (message) => {
15
15
  const parsed_message = JSON.parse(message);
16
16
 
17
+ console.log({ parsed_message });
18
+
17
19
  if (typeof process.HMR_CONNECTIONS === "object" && !!parsed_message?.type) {
18
20
  const connections = Object.values(process.HMR_CONNECTIONS);
19
21
  for (let i = 0; i < connections?.length; i += 1) {
@@ -3,10 +3,13 @@ import get_platform_safe_path from "./get_platform_safe_path.js";
3
3
  export default [
4
4
  get_platform_safe_path("api/"),
5
5
  get_platform_safe_path("cronJobs/"),
6
+ get_platform_safe_path("cron_jobs/"),
6
7
  get_platform_safe_path("fixtures/"),
7
8
  get_platform_safe_path("lib/node"),
8
9
  get_platform_safe_path("queues/"),
9
10
  get_platform_safe_path("routes/"),
10
11
  get_platform_safe_path("tests/"),
12
+ get_platform_safe_path("uploaders/"),
13
+ get_platform_safe_path("websockets/"),
11
14
  "index.server.js",
12
15
  ];
@@ -3,12 +3,15 @@ import copy_paths from "../../build/copy_paths.js";
3
3
  const watch_paths = [
4
4
  { path: "api" },
5
5
  { path: "cronJobs" },
6
+ { path: "cron_jobs" },
6
7
  { path: "email" },
7
8
  { path: "fixtures" },
8
9
  { path: "lib" },
9
- { path: "ui" },
10
- { path: "routes" },
11
10
  { path: "queues" },
11
+ { path: "routes" },
12
+ { path: "ui" },
13
+ { path: "uploaders" },
14
+ { path: "websockets" },
12
15
  { path: "index.client.js" },
13
16
  { path: "index.server.js" },
14
17
  ...copy_paths,