@joystick.js/cli-canary 0.0.0-canary.1636 → 0.0.0-canary.1638

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 o from"fs";import f from"esbuild";import r from"../path_exists.js";const{readFile:s,writeFile:a}=o.promises,m=async(i="")=>{if(await r(i)){const t=await s(i,"utf-8"),e=await f.transform(t,{minify:!0});await a(i,e.code)}};var d=m;export{d as default};
1
+ import r from"fs";import a from"esbuild";import f from"../path_exists.js";const{readFile:s,writeFile:m}=r.promises,n=async(i="")=>{if(await f(i)){const t=await s(i,"utf-8"),o=await a.transform(t,{minify:!0}).catch(e=>{console.warn(e)});await m(i,o.code)}};var d=n;export{d as default};
@@ -1,4 +1,4 @@
1
- import"chalk";import k from"fs";import r from"../../get_platform_safe_path.js";import c from"../../constants.js";import j from"./set_component_id.js";import E from"../../path_exists.js";const{readFile:f,writeFile:g}=k.promises,x=(t="",o=[])=>{for(let _=0;_<o?.length;_+=1){const n=o[_];t=t.replace(`%example:${_}%`,n)}},O=(t="",o="",_="")=>t.replace(`${o};`,`if (
1
+ import"chalk";import k from"fs";import r from"../../get_platform_safe_path.js";import c from"../../constants.js";import j from"./set_component_id.js";import E from"../../path_exists.js";const{readFile:f,writeFile:g}=k.promises,x=(t="",o=[])=>{for(let _=0;_<o?.length;_+=1){const n=o[_];t=t.replace(`%example:${_}%`,n)}},$=(t="",o="",_="")=>t.replace(`${o};`,`if (
2
2
  typeof window !== 'undefined' &&
3
3
  window.__joystick_should_auto_mount__ === true &&
4
4
  !window.__joystick_layout_url__ &&
@@ -11,7 +11,7 @@ import"chalk";import k from"fs";import r from"../../get_platform_safe_path.js";i
11
11
  }
12
12
 
13
13
  export default ${_};
14
- `),$=(t="",o="",_="")=>t.replace(`${o};`,`if (
14
+ `),O=(t="",o="",_="")=>t.replace(`${o};`,`if (
15
15
  typeof window !== 'undefined' &&
16
16
  window.__joystick_should_auto_mount__ === true &&
17
17
  window.__joystick_layout_url__ &&
@@ -30,4 +30,4 @@ import"chalk";import k from"fs";import r from"../../get_platform_safe_path.js";i
30
30
  }
31
31
 
32
32
  export default ${_};
33
- `),X=(t="")=>t.replace(c.JOYSTICK_COMMENT_REGEX,""),y=(t="")=>{let o=0;return t.replace(c.EXAMPLE_CODE_REGEX,()=>`%example:${o++}%`)},w=(t="")=>t.match(c.EXAMPLE_CODE_REGEX)||[],P=(t=null)=>(t&&t.split(" ")||[])?.pop(),R=(t=!1,o=null)=>t&&!!o,C=(t="")=>{const o=t.match(c.EXPORT_DEFAULT_REGEX)||[];return o&&o[0]},h=(t="")=>{const o=t.match(c.JOYSTICK_UI_REGEX)||[];return!!o&&!!o[0]},u=(t="",o={})=>[r(t)].some(_=>o.path.includes(_)),D=(t="")=>[r("ui/"),r("email/")].some(o=>t.includes(o)),G=(t={})=>{t.onLoad({filter:/\.js$/},async(o={})=>{const _=u("ui/layouts",o),n=u("ui/pages",o),p=u("email/",o);if(_||n||p){let e=await f(r(o.path),"utf-8");const l=h(e),i=C(e),s=R(l,i),m=w(e),a=P(i);return e=y(e),e=X(e),e=a&&_?$(e,i,a):e,e=a&&n?O(e,i,a):e,x(e,m),{contents:e,loader:"js"}}}).catch(o=>{console.log("ON LOAD",o)}),t.onEnd(()=>new Promise(async o=>{for(let _=0;_<t?.initialOptions?.entryPoints?.length;_+=1){const n=t?.initialOptions?.entryPoints[_],p=D(n),d=await E(`${t?.initialOptions?.outdir}/${n}`);if(p&&d){let e=await f(`${t?.initialOptions?.outdir}/${n}`,"utf-8");const l=h(e),i=w(e);if(e=y(e),l){e=await j(e);for(let s=0;s<i?.length;s+=1){const m=i[s];e=e.replace(`%example:${s}%`,m)}await g(`${t?.initialOptions?.outdir}/${n}`,e)}}}o()})).catch(o=>{console.log("ON END",o)})};var v=G;export{v as default};
33
+ `),X=(t="")=>t.replace(c.JOYSTICK_COMMENT_REGEX,""),y=(t="")=>{let o=0;return t.replace(c.EXAMPLE_CODE_REGEX,()=>`%example:${o++}%`)},w=(t="")=>t.match(c.EXAMPLE_CODE_REGEX)||[],P=(t=null)=>(t&&t.split(" ")||[])?.pop(),R=(t=!1,o=null)=>t&&!!o,C=(t="")=>{const o=t.match(c.EXPORT_DEFAULT_REGEX)||[];return o&&o[0]},h=(t="")=>{const o=t.match(c.JOYSTICK_UI_REGEX)||[];return!!o&&!!o[0]},u=(t="",o={})=>[r(t)].some(_=>o.path.includes(_)),G=(t="")=>[r("ui/"),r("email/")].some(o=>t.includes(o)),I=(t={})=>{t.onLoad({filter:/\.js$/},async(o={})=>{const _=u("ui/layouts",o),n=u("ui/pages",o),p=u("email/",o);if(_||n||p){let e=await f(r(o.path),"utf-8");const l=h(e),i=C(e),s=R(l,i),m=w(e),a=P(i);return e=y(e),e=X(e),e=a&&_?O(e,i,a):e,e=a&&n?$(e,i,a):e,x(e,m),{contents:e,loader:"js"}}}),t.onEnd(()=>new Promise(async o=>{for(let _=0;_<t?.initialOptions?.entryPoints?.length;_+=1){const n=t?.initialOptions?.entryPoints[_],p=G(n),d=await E(`${t?.initialOptions?.outdir}/${n}`);if(p&&d){let e=await f(`${t?.initialOptions?.outdir}/${n}`,"utf-8");const l=h(e),i=w(e);if(e=y(e),l){e=await j(e);for(let s=0;s<i?.length;s+=1){const m=i[s];e=e.replace(`%example:${s}%`,m)}await g(`${t?.initialOptions?.outdir}/${n}`,e)}}}o()}))};var B=I;export{B as default};
@@ -1 +1 @@
1
- import p from"fs";import t from"../../get_platform_safe_path.js";import m from"./update_file_map.js";const{readFile:n}=p.promises,s=(a={})=>{a.onLoad({filter:/\.js$/},async o=>{if(!["node_modules",".joystick","?","commonjsHelpers.js"].some(e=>t(o.path).includes(e))){const e=await n(t(o.path),"utf-8");await m(t(o.path),e)}}).catch(o=>{console.log("GFDM ON LOAD",o)})};var r=s;export{r as default};
1
+ import p from"fs";import o from"../../get_platform_safe_path.js";import m from"./update_file_map.js";const{readFile:n}=p.promises,s=(a={})=>{a.onLoad({filter:/\.js$/},async e=>{if(!["node_modules",".joystick","?","commonjsHelpers.js"].some(t=>o(e.path).includes(t))){const t=await n(o(e.path),"utf-8");await m(o(e.path),t)}})};var c=s;export{c as default};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@joystick.js/cli-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.1636",
5
- "canary_version": "0.0.0-canary.1635",
4
+ "version": "0.0.0-canary.1638",
5
+ "canary_version": "0.0.0-canary.1637",
6
6
  "description": "The CLI for Joystick.",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
@@ -7,7 +7,9 @@ const { readFile, writeFile } = fs.promises;
7
7
  const minify_file = async (path = "") => {
8
8
  if (await path_exists(path)) {
9
9
  const file = await readFile(path, "utf-8");
10
- const minified = await esbuild.transform(file, { minify: true });
10
+ const minified = await esbuild.transform(file, { minify: true }).catch((error) => {
11
+ console.warn(error);
12
+ });
11
13
  await writeFile(path, minified.code);
12
14
  }
13
15
  };
@@ -154,8 +154,6 @@ const bootstrap_component = (build = {}) => {
154
154
  loader: "js",
155
155
  };
156
156
  }
157
- }).catch((error) => {
158
- console.log('ON LOAD', error);
159
157
  });
160
158
 
161
159
  build.onEnd(() => {
@@ -187,8 +185,6 @@ const bootstrap_component = (build = {}) => {
187
185
 
188
186
  resolve();
189
187
  });
190
- }).catch((error) => {
191
- console.log('ON END', error);
192
188
  });
193
189
  };
194
190
 
@@ -14,8 +14,6 @@ const generate_file_dependency_map = (build = {}) => {
14
14
  const code = await readFile(get_platform_safe_path(args.path), "utf-8");
15
15
  await update_file_map(get_platform_safe_path(args.path), code);
16
16
  }
17
- }).catch((error) => {
18
- console.log('GFDM ON LOAD', error);
19
17
  });
20
18
  };
21
19