@akanjs/cli 0.9.14 → 0.9.15

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.
package/cjs/index.js CHANGED
@@ -779,14 +779,16 @@ var getDockerRunScripts = (runs) => {
779
779
  if (typeof run === "string")
780
780
  return `RUN ${run}`;
781
781
  else
782
- return Object.entries(run).map(([arch, script]) => `RUN if [ "$TARGETARCH" = "${arch}" ]; then ${script}; fi`).join("\n");
782
+ return Object.entries(run).map(
783
+ ([arch, script]) => `RUN if [ "$TARGETARCH" = "${arch}" ]; then ${script} fi`
784
+ ).join("\n");
783
785
  });
784
786
  };
785
- var getDockerImageScript = (image) => {
787
+ var getDockerImageScript = (image, defaultImage) => {
786
788
  if (typeof image === "string")
787
789
  return `FROM ${image}`;
788
790
  else
789
- return Object.entries(image).map(([arch, image2]) => `FROM ${image2} AS ${arch}`).join("\n");
791
+ return archs.map((arch) => `FROM ${image[arch] ?? defaultImage} AS ${arch}`).join("\n");
790
792
  };
791
793
  var makeDockerfile = (type, config, props) => {
792
794
  const { name, repoName, serveDomain, env } = props;
@@ -795,7 +797,7 @@ var makeDockerfile = (type, config, props) => {
795
797
  const preRunScripts = getDockerRunScripts(config.preRuns ?? []);
796
798
  const postRunScripts = getDockerRunScripts(config.postRuns ?? []);
797
799
  if (type === "backend") {
798
- const imageScript = config.image ? getDockerImageScript(config.image) : "FROM node:22-slim";
800
+ const imageScript = config.image ? getDockerImageScript(config.image, "node:22-slim") : "FROM node:22-slim";
799
801
  const command = config.command ?? ["node", "main.js"];
800
802
  const content = `${imageScript}
801
803
  RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
@@ -809,7 +811,7 @@ WORKDIR /workspace
809
811
  COPY ./package.json ./package.json
810
812
  RUN npx pnpm i --prod
811
813
  COPY . .
812
- ENV PORT 8080
814
+ ENV PORT=8080
813
815
  ENV NODE_OPTIONS=--max_old_space_size=8192
814
816
  ENV NEXT_PUBLIC_REPO_NAME=${repoName}
815
817
  ENV NEXT_PUBLIC_SERVE_DOMAIN=${serveDomain}
@@ -826,7 +828,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
826
828
  command
827
829
  };
828
830
  } else {
829
- const imageScript = config.image ? getDockerImageScript(config.image) : "FROM node:22-alpine";
831
+ const imageScript = config.image ? getDockerImageScript(config.image, "node:22-alpine") : "FROM node:22-alpine";
830
832
  const command = config.command ?? ["npm", "start"];
831
833
  const content = `${imageScript}
832
834
  RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
@@ -858,6 +860,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
858
860
  };
859
861
 
860
862
  // pkgs/@akanjs/config/src/types.ts
863
+ var archs = ["amd64", "arm64"];
861
864
  var getDefaultFileScan = () => ({
862
865
  constants: {
863
866
  databases: [],
package/esm/index.js CHANGED
@@ -759,14 +759,16 @@ var getDockerRunScripts = (runs) => {
759
759
  if (typeof run === "string")
760
760
  return `RUN ${run}`;
761
761
  else
762
- return Object.entries(run).map(([arch, script]) => `RUN if [ "$TARGETARCH" = "${arch}" ]; then ${script}; fi`).join("\n");
762
+ return Object.entries(run).map(
763
+ ([arch, script]) => `RUN if [ "$TARGETARCH" = "${arch}" ]; then ${script} fi`
764
+ ).join("\n");
763
765
  });
764
766
  };
765
- var getDockerImageScript = (image) => {
767
+ var getDockerImageScript = (image, defaultImage) => {
766
768
  if (typeof image === "string")
767
769
  return `FROM ${image}`;
768
770
  else
769
- return Object.entries(image).map(([arch, image2]) => `FROM ${image2} AS ${arch}`).join("\n");
771
+ return archs.map((arch) => `FROM ${image[arch] ?? defaultImage} AS ${arch}`).join("\n");
770
772
  };
771
773
  var makeDockerfile = (type, config, props) => {
772
774
  const { name, repoName, serveDomain, env } = props;
@@ -775,7 +777,7 @@ var makeDockerfile = (type, config, props) => {
775
777
  const preRunScripts = getDockerRunScripts(config.preRuns ?? []);
776
778
  const postRunScripts = getDockerRunScripts(config.postRuns ?? []);
777
779
  if (type === "backend") {
778
- const imageScript = config.image ? getDockerImageScript(config.image) : "FROM node:22-slim";
780
+ const imageScript = config.image ? getDockerImageScript(config.image, "node:22-slim") : "FROM node:22-slim";
779
781
  const command = config.command ?? ["node", "main.js"];
780
782
  const content = `${imageScript}
781
783
  RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
@@ -789,7 +791,7 @@ WORKDIR /workspace
789
791
  COPY ./package.json ./package.json
790
792
  RUN npx pnpm i --prod
791
793
  COPY . .
792
- ENV PORT 8080
794
+ ENV PORT=8080
793
795
  ENV NODE_OPTIONS=--max_old_space_size=8192
794
796
  ENV NEXT_PUBLIC_REPO_NAME=${repoName}
795
797
  ENV NEXT_PUBLIC_SERVE_DOMAIN=${serveDomain}
@@ -806,7 +808,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
806
808
  command
807
809
  };
808
810
  } else {
809
- const imageScript = config.image ? getDockerImageScript(config.image) : "FROM node:22-alpine";
811
+ const imageScript = config.image ? getDockerImageScript(config.image, "node:22-alpine") : "FROM node:22-alpine";
810
812
  const command = config.command ?? ["npm", "start"];
811
813
  const content = `${imageScript}
812
814
  RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
@@ -838,6 +840,7 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
838
840
  };
839
841
 
840
842
  // pkgs/@akanjs/config/src/types.ts
843
+ var archs = ["amd64", "arm64"];
841
844
  var getDefaultFileScan = () => ({
842
845
  constants: {
843
846
  databases: [],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "sourceType": "module",
4
4
  "name": "@akanjs/cli",
5
- "version": "0.9.14",
5
+ "version": "0.9.15",
6
6
  "bin": {
7
7
  "akan": "esm/index.js"
8
8
  },