@joystick.js/cli-canary 0.0.0-canary.1002 → 0.0.0-canary.1004

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,3 +1,3 @@
1
- import u from"chalk";import b from"child_process";import g from"fs";import{dirname as h}from"path";import w from"util";import y from"./build_files.js";import $ from"./get_files_to_build.js";import x from"./get_file_operation.js";import z from"./get_path_platform.js";import k from"./get_tar_ignore_list.js";import v from"../load_settings.js";import F from"../loader.js";import _ from"../path_exists.js";import j from"../../lib/encrypt_buffer.js";const{mkdir:B,copyFile:P,readFile:A,writeFile:L}=g.promises,l=w.promisify(b.exec),q=(r=[])=>r?.map(e=>({path:e,operation:x(e),platform:z(e)})),C=async(r={})=>{const e=new F,o=r?.type||"tar",n=r?.environment||"production";e.print(`Building app to ${o} for ${n}...`);const c=await v(n),f=c?.config?.build?.excluded_paths||c?.config?.build?.excludedPaths,s=await $(f),i=o==="tar"?".build/.tar":".build",p=q(s);await _(".build")&&await l("rm -rf .build");const d=p?.filter(t=>t?.operation==="copy_file"),m=p?.filter(t=>t?.operation==="build_file");for(let t=0;t<d?.length;t+=1){const a=d[t];await B(h(`${i}/${a?.path}`),{recursive:!0}),await P(a?.path,`${i}/${a?.path}`)}if(await y({files:m,environment:n,output_path:i}).catch(t=>{console.warn(t)}),o==="tar"){const t=k(c?.config?.build?.excludedPaths);await l(`cd ${i} && tar --exclude=${t} -czf ../build.tar.gz .`),await l(`rm -rf ${i}`)}if(o==="tar"&&r?.encrypt_build){const t=i?.replace("/.tar","/build.tar.gz"),a=j(await A(t),r?.encryption_key);await L(".build/build.encrypted.tar.gz",a)}r?.silence_confirmation||console.log(u.greenBright(`
1
+ import h from"chalk";import w from"child_process";import s from"fs";import{dirname as y}from"path";import $ from"util";import x from"./build_files.js";import z from"./get_files_to_build.js";import v from"./get_file_operation.js";import k from"./get_path_platform.js";import F from"./get_tar_ignore_list.js";import P from"../load_settings.js";import j from"../loader.js";import _ from"../path_exists.js";import B from"../../lib/encrypt_buffer.js";const{mkdir:S,copyFile:A,readFile:D,writeFile:L,readdir:M}=s.promises,l=$.promisify(w.exec),q=(r=[])=>r?.map(n=>({path:n,operation:v(n),platform:k(n)})),C=async(r={})=>{const n=new j,o=r?.type||"tar",c=r?.environment||"production";n.print(`Building app to ${o} for ${c}...`);const e=await P(c),u=e?.config?.build?.excluded_paths||e?.config?.build?.excludedPaths,m=await z(u),i=o==="tar"?".build/.tar":".build",p=q(m);await _(".build")&&await l("rm -rf .build"),console.log(e?.config?.build?.copy_paths);const d=e?.config?.build?.copy_paths?.length>0?await Promise.all(e?.config?.build?.copy_paths?.filter(t=>s.existsSync(t))?.flatMap(async(t="")=>(s.lstatSync(t).isDirectory()?await M(t,{recursive:!0}):[t])?.map(g=>({path:g})))):[];console.log({custom_copy_paths:d});const f=[...p?.filter(t=>t?.operation==="copy_file"),...d||[]],b=p?.filter(t=>t?.operation==="build_file");for(let t=0;t<f?.length;t+=1){const a=f[t];await S(y(`${i}/${a?.path}`),{recursive:!0}),await A(a?.path,`${i}/${a?.path}`)}if(await x({files:b,environment:c,output_path:i}).catch(t=>{console.warn(t)}),o==="tar"){const t=F(e?.config?.build?.excludedPaths);await l(`cd ${i} && tar --exclude=${t} -czf ../build.tar.gz .`),await l(`rm -rf ${i}`)}if(o==="tar"&&r?.encrypt_build){const t=i?.replace("/.tar","/build.tar.gz"),a=B(await D(t),r?.encryption_key);await L(".build/build.encrypted.tar.gz",a)}r?.silence_confirmation||console.log(h.greenBright(`
2
2
  \u2714 App built as ${o} to ${o==="tar"?i?.replace("/.tar","/build.tar.gz"):i}!
3
- `)),await _(".build/component_id_cache.json")&&await l("rm -rf .build/component_id_cache.json")};var U=C;export{U as default};
3
+ `)),await _(".build/component_id_cache.json")&&await l("rm -rf .build/component_id_cache.json")};var Y=C;export{Y 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.1002",
5
- "canary_version": "0.0.0-canary.1001",
4
+ "version": "0.0.0-canary.1004",
5
+ "canary_version": "0.0.0-canary.1003",
6
6
  "description": "The CLI for Joystick.",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
@@ -44,11 +44,13 @@ const build = async (options = {}) => {
44
44
  await exec(`rm -rf .build`);
45
45
  }
46
46
 
47
+ console.log(settings?.config?.build?.copy_paths);
48
+
47
49
  const custom_copy_paths = settings?.config?.build?.copy_paths?.length > 0 ? await Promise.all(
48
50
  settings?.config?.build?.copy_paths?.filter((custom_copy_path) => {
49
51
  return fs.existsSync(custom_copy_path);
50
52
  })?.flatMap(async (custom_copy_path = '') => {
51
- const stat = await fs.lstat(custom_copy_path);
53
+ const stat = fs.lstatSync(custom_copy_path);
52
54
  const paths = stat.isDirectory() ? await readdir(custom_copy_path, { recursive: true }) : [custom_copy_path];
53
55
  return paths?.map((path) => {
54
56
  return { path };
@@ -56,7 +58,7 @@ const build = async (options = {}) => {
56
58
  })
57
59
  ) : [];
58
60
 
59
- console.log(custom_copy_paths);
61
+ console.log({ custom_copy_paths });
60
62
 
61
63
  const files_to_copy = [
62
64
  ...files_to_build_with_operation_and_platform?.filter((file) => {