@joystick.js/cli-canary 0.0.0-canary.1666 → 0.0.0-canary.1667

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{exec as f,execSync as m}from"child_process";import s from"path";import{fileURLToPath as k}from"url";import d from"fs";const g=k(import.meta.url),_=s.dirname(g),$=()=>{try{return m("docker --version",{stdio:"ignore"}),!0}catch{return!1}},b=(e="",i="",{apt_deps:l=[],npm_deps:a=[]}={})=>new Promise((u,o)=>{if(!$()){process.loader.print("Push requires Docker to deploy your app. Please visit https://docs.docker.com/get-started/get-docker/ to download Docker for your OS."),o(new Error("Docker is not installed or not in the PATH"));return}process.loader.print("Building Docker image for deployment...");const n=s.join(_,"Dockerfile");if(!d.existsSync(n)){o(new Error(`Dockerfile not found at ${n}`));return}if(!i||!d.existsSync(s.join(i,".build"))){o(new Error("Invalid context path or .build directory not found"));return}const p=`docker build ${[`CUSTOM_APT_DEPS=${l.join(" ")}`,`GLOBAL_NPM_PACKAGES=${a.join(" ")}`,`CACHEBUST=${Date.now()}`].map(r=>`--build-arg ${r}`).join(" ")} -t ${e} -f "${n}" "${i}"`;f(p,{stdio:["pipe","pipe","pipe"]},(r,c,t)=>{if(r){console.error(`Error building Docker image: ${r.message}`),o(r);return}c.trim()&&process.loader.print(c),t.trim()&&!t.includes("Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them")&&console.error(`Docker build stderr: ${t}`),process.loader.print(`Successfully built Docker image: ${e}`),u()})});var w=b;export{w as default};
1
+ import{exec as f,execSync as m}from"child_process";import s from"path";import{fileURLToPath as p}from"url";import c from"fs";const k=p(import.meta.url),g=s.dirname(k),_=()=>{try{return m("docker --version",{stdio:"ignore"}),!0}catch{return!1}},$=(e="",i="",{apt_deps:d=[],npm_deps:l=[]}={})=>new Promise((a,r)=>{if(!_()){process.loader.print("Push requires Docker to deploy your app. Please visit https://docs.docker.com/get-started/get-docker/ to download Docker for your OS."),r(new Error("Docker is not installed or not in the PATH"));return}process.loader.print("Building Docker image for deployment...");const t=s.join(g,"Dockerfile");if(!c.existsSync(t)){r(new Error(`Dockerfile not found at ${t}`));return}if(!i||!c.existsSync(s.join(i,".build"))){r(new Error("Invalid context path or .build directory not found"));return}const u=`docker build --quiet ${[`CUSTOM_APT_DEPS=${d.join(" ")}`,`GLOBAL_NPM_PACKAGES=${l.join(" ")}`,`CACHEBUST=${Date.now()}`].map(o=>`--build-arg ${o}`).join(" ")} -t ${e} -f "${t}" "${i}"`;f(u,{stdio:["ignore","pipe","pipe"]},(o,y,n)=>{if(o){console.error(`Error building Docker image: ${o.message}`),r(o);return}n.trim()&&!n.includes("Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them")&&console.error(`Docker build stderr: ${n}`),process.loader.print(`Successfully built Docker image: ${e}`),a()})});var w=$;export{w 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.1666",
5
- "canary_version": "0.0.0-canary.1665",
4
+ "version": "0.0.0-canary.1667",
5
+ "canary_version": "0.0.0-canary.1666",
6
6
  "description": "The CLI for Joystick.",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
@@ -52,19 +52,17 @@ const build_docker_image = (
52
52
  `CACHEBUST=${Date.now()}` // Add timestamp to invalidate cache
53
53
  ].map(arg => `--build-arg ${arg}`).join(' ');
54
54
 
55
- const command = `docker build ${build_args} -t ${image_name} -f "${dockerfile_path}" "${context_path}"`;
55
+ // Add --quiet flag to suppress verbose output
56
+ const command = `docker build --quiet ${build_args} -t ${image_name} -f "${dockerfile_path}" "${context_path}"`;
56
57
 
57
- exec(command, { stdio: ['pipe', 'pipe', 'pipe'] }, (error, stdout, stderr) => {
58
+ exec(command, { stdio: ['ignore', 'pipe', 'pipe'] }, (error, stdout, stderr) => {
58
59
  if (error) {
59
60
  console.error(`Error building Docker image: ${error.message}`);
60
61
  reject(error);
61
62
  return;
62
63
  }
63
64
 
64
- // Only log stdout if it's not empty
65
- if (stdout.trim()) {
66
- process.loader.print(stdout);
67
- }
65
+ // The --quiet flag will output only the image ID, which we can ignore
68
66
 
69
67
  // Check if stderr contains actual error messages
70
68
  if (stderr.trim() && !stderr.includes("Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them")) {