@joystick.js/cli-canary 0.0.0-canary.1662 → 0.0.0-canary.1663
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.
|
@@ -7,14 +7,13 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|
|
7
7
|
# Set up environment variables
|
|
8
8
|
ENV NODE_VERSION=20.x
|
|
9
9
|
|
|
10
|
-
# Install Node.js 20
|
|
10
|
+
# Install Node.js 20 and common dependencies
|
|
11
11
|
RUN apt-get update && apt-get install -y \
|
|
12
12
|
curl \
|
|
13
13
|
zip \
|
|
14
14
|
unzip \
|
|
15
15
|
git \
|
|
16
16
|
build-essential \
|
|
17
|
-
snapd \
|
|
18
17
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
19
18
|
&& apt-get install -y nodejs \
|
|
20
19
|
&& apt-get clean \
|
|
@@ -23,9 +22,6 @@ RUN apt-get update && apt-get install -y \
|
|
|
23
22
|
# Verify Node.js version
|
|
24
23
|
RUN node --version
|
|
25
24
|
|
|
26
|
-
# Initialize snap
|
|
27
|
-
RUN snap install core
|
|
28
|
-
|
|
29
25
|
# Allow custom apt dependencies to be passed as build argument
|
|
30
26
|
ARG CUSTOM_APT_DEPS=""
|
|
31
27
|
|
|
@@ -36,14 +32,6 @@ RUN if [ ! -z "$CUSTOM_APT_DEPS" ]; then \
|
|
|
36
32
|
&& rm -rf /var/lib/apt/lists/*; \
|
|
37
33
|
fi
|
|
38
34
|
|
|
39
|
-
# Allow custom snap dependencies to be passed as build argument
|
|
40
|
-
ARG CUSTOM_SNAP_DEPS=""
|
|
41
|
-
|
|
42
|
-
# Install custom snap dependencies if provided
|
|
43
|
-
RUN if [ ! -z "$CUSTOM_SNAP_DEPS" ]; then \
|
|
44
|
-
snap install $CUSTOM_SNAP_DEPS; \
|
|
45
|
-
fi
|
|
46
|
-
|
|
47
35
|
# Allow custom global npm packages to be passed as build argument
|
|
48
36
|
ARG GLOBAL_NPM_PACKAGES=""
|
|
49
37
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{exec as
|
|
1
|
+
import{exec as m,execSync as f}from"child_process";import n from"path";import{fileURLToPath as k}from"url";import g from"fs";const _=k(import.meta.url),c=n.dirname(_),$=()=>{try{return f("docker --version",{stdio:"ignore"}),!0}catch{return!1}},D=(r="",s="",{apt_deps:l=[],npm_deps:d=[]}={})=>new Promise((a,i)=>{if(!$())return console.log(`
|
|
2
2
|
`),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."),console.log(`
|
|
3
|
-
`),process.exit();
|
|
3
|
+
`),process.exit();process.loader.print("Building Docker image for deployment...");const e=n.join(c,"Dockerfile");if(!g.existsSync(e)){i(new Error(`Dockerfile not found at ${e}`));return}const u=`docker build ${[`CUSTOM_APT_DEPS=${l.join(" ")}`,`GLOBAL_NPM_PACKAGES=${d.join(" ")}`].map(o=>`--build-arg ${o}`).join(" ")} -t ${r} -f "${e}" "${s||c}"`;m(u,(o,p,t)=>{if(o){console.error(`Error building Docker image: ${o.message}`),i(o);return}t&&console.error(`Docker build stderr: ${t}`),process.loader.print(p),process.loader.print(`Successfully built Docker image: ${r}`),a()})});var x=D;export{x 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.1663",
|
|
5
|
+
"canary_version": "0.0.0-canary.1662",
|
|
6
6
|
"description": "The CLI for Joystick.",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"bin": {
|
|
@@ -7,14 +7,13 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|
|
7
7
|
# Set up environment variables
|
|
8
8
|
ENV NODE_VERSION=20.x
|
|
9
9
|
|
|
10
|
-
# Install Node.js 20
|
|
10
|
+
# Install Node.js 20 and common dependencies
|
|
11
11
|
RUN apt-get update && apt-get install -y \
|
|
12
12
|
curl \
|
|
13
13
|
zip \
|
|
14
14
|
unzip \
|
|
15
15
|
git \
|
|
16
16
|
build-essential \
|
|
17
|
-
snapd \
|
|
18
17
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
19
18
|
&& apt-get install -y nodejs \
|
|
20
19
|
&& apt-get clean \
|
|
@@ -23,9 +22,6 @@ RUN apt-get update && apt-get install -y \
|
|
|
23
22
|
# Verify Node.js version
|
|
24
23
|
RUN node --version
|
|
25
24
|
|
|
26
|
-
# Initialize snap
|
|
27
|
-
RUN snap install core
|
|
28
|
-
|
|
29
25
|
# Allow custom apt dependencies to be passed as build argument
|
|
30
26
|
ARG CUSTOM_APT_DEPS=""
|
|
31
27
|
|
|
@@ -36,14 +32,6 @@ RUN if [ ! -z "$CUSTOM_APT_DEPS" ]; then \
|
|
|
36
32
|
&& rm -rf /var/lib/apt/lists/*; \
|
|
37
33
|
fi
|
|
38
34
|
|
|
39
|
-
# Allow custom snap dependencies to be passed as build argument
|
|
40
|
-
ARG CUSTOM_SNAP_DEPS=""
|
|
41
|
-
|
|
42
|
-
# Install custom snap dependencies if provided
|
|
43
|
-
RUN if [ ! -z "$CUSTOM_SNAP_DEPS" ]; then \
|
|
44
|
-
snap install $CUSTOM_SNAP_DEPS; \
|
|
45
|
-
fi
|
|
46
|
-
|
|
47
35
|
# Allow custom global npm packages to be passed as build argument
|
|
48
36
|
ARG GLOBAL_NPM_PACKAGES=""
|
|
49
37
|
|
|
@@ -20,7 +20,6 @@ const build_docker_image = (
|
|
|
20
20
|
context_path = '',
|
|
21
21
|
{
|
|
22
22
|
apt_deps = [],
|
|
23
|
-
snap_deps = [],
|
|
24
23
|
npm_deps = []
|
|
25
24
|
} = {}
|
|
26
25
|
) => {
|
|
@@ -29,8 +28,7 @@ const build_docker_image = (
|
|
|
29
28
|
console.log('\n');
|
|
30
29
|
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.");
|
|
31
30
|
console.log('\n');
|
|
32
|
-
process.exit();
|
|
33
|
-
return;
|
|
31
|
+
return process.exit();
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
process.loader.print('Building Docker image for deployment...');
|
|
@@ -45,7 +43,6 @@ const build_docker_image = (
|
|
|
45
43
|
// Prepare build arguments for dependencies
|
|
46
44
|
const build_args = [
|
|
47
45
|
`CUSTOM_APT_DEPS=${apt_deps.join(' ')}`,
|
|
48
|
-
`CUSTOM_SNAP_DEPS=${snap_deps.join(' ')}`,
|
|
49
46
|
`GLOBAL_NPM_PACKAGES=${npm_deps.join(' ')}`
|
|
50
47
|
].map(arg => `--build-arg ${arg}`).join(' ');
|
|
51
48
|
|