@joystick.js/cli-canary 0.0.0-canary.1007 → 0.0.0-canary.1009
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 s from"fs";import
|
|
1
|
+
import s from"fs";import l from"../get_files_in_path.js";import c from"./master_ignore_list.js";const{stat:p}=s.promises,u=async(i=[],o=[])=>{const n=await l("./",[]),_=c;return n.filter(e=>!o.some(t=>e.includes(t))).filter(e=>!i.some(t=>e.includes(t))).filter(e=>!_.some(t=>e.includes(t))).filter(e=>!s.lstatSync(e).isDirectory())};var x=u;export{x as default};
|
package/dist/lib/build/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import y from"chalk";import w from"child_process";import s from"fs";import{dirname as $}from"path";import x from"util";import z from"./build_files.js";import v from"./get_files_to_build.js";import k from"./get_file_operation.js";import F from"./get_path_platform.js";import j from"./get_tar_ignore_list.js";import B from"../load_settings.js";import P from"../loader.js";import f from"../path_exists.js";import S from"../../lib/encrypt_buffer.js";const{mkdir:A,copyFile:D,readFile:L,writeFile:q,readdir:C}=s.promises,l=x.promisify(w.exec),E=(r=[])=>r?.map(a=>({path:a,operation:k(a),platform:F(a)})),G=async(r={})=>{const a=new P,e=r?.type||"tar",p=r?.environment||"production";a.print(`Building app to ${e} for ${p}...`);const n=await B(p),u=n?.config?.build?.excluded_paths||n?.config?.build?.excludedPaths,
|
|
1
|
+
import y from"chalk";import w from"child_process";import s from"fs";import{dirname as $}from"path";import x from"util";import z from"./build_files.js";import v from"./get_files_to_build.js";import k from"./get_file_operation.js";import F from"./get_path_platform.js";import j from"./get_tar_ignore_list.js";import B from"../load_settings.js";import P from"../loader.js";import f from"../path_exists.js";import S from"../../lib/encrypt_buffer.js";const{mkdir:A,copyFile:D,readFile:L,writeFile:q,readdir:C}=s.promises,l=x.promisify(w.exec),E=(r=[])=>r?.map(a=>({path:a,operation:k(a),platform:F(a)})),G=async(r={})=>{const a=new P,e=r?.type||"tar",p=r?.environment||"production";a.print(`Building app to ${e} for ${p}...`);const n=await B(p),u=n?.config?.build?.excluded_paths||n?.config?.build?.excludedPaths,c=[];for(let t=0;t<n?.config?.build?.copy_paths?.length;t+=1){const i=n?.config?.build?.copy_paths[t];if(s.existsSync(i))if(s.lstatSync(i).isDirectory()){const h=await C(i,{recursive:!0});c.push(...(h||[])?.map(g=>`${i}/${g}`))}else c.push(i)}const m=await v(u,c),o=e==="tar"?".build/.tar":".build",_=E(m);await f(".build")&&await l("rm -rf .build");const d=[..._?.filter(t=>t?.operation==="copy_file"),...(c||[])?.map(t=>({path:t}))],b=_?.filter(t=>t?.operation==="build_file");for(let t=0;t<d?.length;t+=1){const i=d[t];await A($(`${o}/${i?.path}`),{recursive:!0}),await D(i?.path,`${o}/${i?.path}`)}if(await z({files:b,environment:p,output_path:o}).catch(t=>{console.warn(t)}),e==="tar"){const t=j(n?.config?.build?.excludedPaths);await l(`cd ${o} && tar --exclude=${t} -czf ../build.tar.gz .`),await l(`rm -rf ${o}`)}if(e==="tar"&&r?.encrypt_build){const t=o?.replace("/.tar","/build.tar.gz"),i=S(await L(t),r?.encryption_key);await q(".build/build.encrypted.tar.gz",i)}r?.silence_confirmation||console.log(y.greenBright(`
|
|
2
2
|
\u2714 App built as ${e} to ${e==="tar"?o?.replace("/.tar","/build.tar.gz"):o}!
|
|
3
3
|
`)),await f(".build/component_id_cache.json")&&await l("rm -rf .build/component_id_cache.json")};var Z=G;export{Z 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.
|
|
5
|
-
"canary_version": "0.0.0-canary.
|
|
4
|
+
"version": "0.0.0-canary.1009",
|
|
5
|
+
"canary_version": "0.0.0-canary.1008",
|
|
6
6
|
"description": "The CLI for Joystick.",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"bin": {
|
|
@@ -4,14 +4,19 @@ import master_ignore_list from "./master_ignore_list.js";
|
|
|
4
4
|
|
|
5
5
|
const { stat } = fs.promises;
|
|
6
6
|
|
|
7
|
-
const get_files_to_build = async (excluded_paths = [],
|
|
7
|
+
const get_files_to_build = async (excluded_paths = [], custom_copy_paths = []) => {
|
|
8
8
|
const files = await get_files_in_path("./", []);
|
|
9
9
|
|
|
10
|
-
const master_ignore_list_filtered_for_context =
|
|
11
|
-
return !file_to_ignore.includes('settings');
|
|
12
|
-
}) : master_ignore_list;
|
|
10
|
+
const master_ignore_list_filtered_for_context = master_ignore_list;
|
|
13
11
|
|
|
14
12
|
const filtered_files = files
|
|
13
|
+
.filter((path) => {
|
|
14
|
+
const is_custom_copy_path = custom_copy_paths.some((custom_copy_path) => {
|
|
15
|
+
return path.includes(custom_copy_path);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return !is_custom_copy_path;
|
|
19
|
+
})
|
|
15
20
|
.filter((path) => {
|
|
16
21
|
const is_excluded = excluded_paths.some((excluded_path) => {
|
|
17
22
|
return path.includes(excluded_path);
|
package/src/lib/build/index.js
CHANGED
|
@@ -36,14 +36,6 @@ const build = async (options = {}) => {
|
|
|
36
36
|
|
|
37
37
|
const settings = await load_settings(environment);
|
|
38
38
|
const excluded_paths = settings?.config?.build?.excluded_paths || settings?.config?.build?.excludedPaths;
|
|
39
|
-
const files_for_build = await get_files_to_build(excluded_paths);
|
|
40
|
-
const output_path = build_type === 'tar' ? '.build/.tar' : '.build';
|
|
41
|
-
const files_to_build_with_operation_and_platform = get_files_to_build_with_operation_and_platform(files_for_build);
|
|
42
|
-
|
|
43
|
-
if (await path_exists('.build')) {
|
|
44
|
-
await exec(`rm -rf .build`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
39
|
const custom_copy_paths = [];
|
|
48
40
|
|
|
49
41
|
for (let i = 0; i < settings?.config?.build?.copy_paths?.length; i += 1) {
|
|
@@ -65,7 +57,13 @@ const build = async (options = {}) => {
|
|
|
65
57
|
}
|
|
66
58
|
}
|
|
67
59
|
|
|
68
|
-
|
|
60
|
+
const files_for_build = await get_files_to_build(excluded_paths, custom_copy_paths);
|
|
61
|
+
const output_path = build_type === 'tar' ? '.build/.tar' : '.build';
|
|
62
|
+
const files_to_build_with_operation_and_platform = get_files_to_build_with_operation_and_platform(files_for_build);
|
|
63
|
+
|
|
64
|
+
if (await path_exists('.build')) {
|
|
65
|
+
await exec(`rm -rf .build`);
|
|
66
|
+
}
|
|
69
67
|
|
|
70
68
|
const files_to_copy = [
|
|
71
69
|
...files_to_build_with_operation_and_platform?.filter((file) => {
|