@joystick.js/cli-canary 0.0.0-canary.636 → 0.0.0-canary.637
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
|
-
const t=(o="production")=>({development:"http://localhost:2603",staging:"https://staging.
|
|
1
|
+
const t=(o="production")=>({development:"http://localhost:2603",staging:"https://staging.provision.cheatcode.co",production:"https://provision.cheatcode.co"})[o];var e=t;export{e as default};
|
package/dist/lib/build/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import u from"chalk";import b from"child_process";import
|
|
2
|
-
\u2714 App built as ${
|
|
3
|
-
`)),await
|
|
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(`
|
|
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};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const get_provision_domain = (provision_server = 'production') => {
|
|
2
2
|
return {
|
|
3
3
|
development: 'http://localhost:2603',
|
|
4
|
-
staging: 'https://staging.
|
|
5
|
-
production: 'https://
|
|
4
|
+
staging: 'https://staging.provision.cheatcode.co',
|
|
5
|
+
production: 'https://provision.cheatcode.co',
|
|
6
6
|
}[provision_server];
|
|
7
7
|
};
|
|
8
8
|
|
package/src/lib/build/index.js
CHANGED
|
@@ -11,8 +11,9 @@ import get_tar_ignore_list from "./get_tar_ignore_list.js";
|
|
|
11
11
|
import load_settings from "../load_settings.js";
|
|
12
12
|
import Loader from "../loader.js";
|
|
13
13
|
import path_exists from "../path_exists.js";
|
|
14
|
+
import encrypt_buffer from '../../lib/encrypt_buffer.js';
|
|
14
15
|
|
|
15
|
-
const { mkdir, copyFile } = fs.promises;
|
|
16
|
+
const { mkdir, copyFile, readFile, writeFile } = fs.promises;
|
|
16
17
|
const exec = util.promisify(child_process.exec);
|
|
17
18
|
|
|
18
19
|
const get_files_to_build_with_operation_and_platform = (files = []) => {
|
|
@@ -75,6 +76,17 @@ const build = async (options = {}) => {
|
|
|
75
76
|
await exec(`rm -rf ${output_path}`);
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
if (build_type === "tar" && options?.encrypt_build) {
|
|
80
|
+
const build_path = output_path?.replace('/.tar', '/build.tar.gz');
|
|
81
|
+
|
|
82
|
+
const encrypted_build = encrypt_buffer(
|
|
83
|
+
await readFile(build_path),
|
|
84
|
+
options?.encryption_key,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
await writeFile(`.build/build.encrypted.tar.gz`, encrypted_build);
|
|
88
|
+
}
|
|
89
|
+
|
|
78
90
|
if (!options?.silence_confirmation) {
|
|
79
91
|
console.log(
|
|
80
92
|
chalk.greenBright(`\n✔ App built as ${build_type} to ${build_type === 'tar' ? output_path?.replace('/.tar', '/build.tar.gz') : output_path}!\n`)
|