@jtl-software/create-cloud-app 0.5.6 → 0.5.8

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -760,12 +760,20 @@ function readExistingCredentials(backend) {
760
760
  return {};
761
761
  }
762
762
  }
763
- function writeBackendCredentials(backend, clientId, clientSecret, issuer) {
763
+ function authBaseFromApi(apiHost) {
764
+ return apiHost.replace(/:\/\/api\./, "://auth.").replace(/\/$/, "");
765
+ }
766
+ function writeBackendCredentials(backend, clientId, clientSecret, issuer, apiBase) {
767
+ const hosts = apiBase ? {
768
+ JTL_API_BASE: apiBase.replace(/\/$/, ""),
769
+ JTL_AUTH_BASE: authBaseFromApi(apiBase)
770
+ } : {};
764
771
  if (backend.kind === "node") {
765
772
  upsertEnv(backend.envFile, {
766
773
  CLIENT_ID: clientId,
767
774
  CLIENT_SECRET: clientSecret,
768
- ...issuer ? { JTL_ISSUER: issuer } : {}
775
+ ...issuer ? { JTL_ISSUER: issuer } : {},
776
+ ...hosts
769
777
  });
770
778
  return backend.envFile;
771
779
  }
@@ -1096,7 +1104,8 @@ async function persistCredentials(backend, clientId, clientSecret, root, opts, c
1096
1104
  backend,
1097
1105
  clientId,
1098
1106
  clientSecret,
1099
- opts.auth
1107
+ opts.auth,
1108
+ opts.api
1100
1109
  );
1101
1110
  printHubLink(
1102
1111
  context.hub,
@@ -1768,8 +1777,10 @@ function applyManifestAuthentication(appJsonPath, opts) {
1768
1777
  };
1769
1778
  }
1770
1779
  manifest.authentication = authentication;
1780
+ if (!frontend || !backend) {
1781
+ manifest.lifecycle = {};
1782
+ }
1771
1783
  if (!frontend) {
1772
- delete manifest.lifecycle;
1773
1784
  if (manifest.capabilities) {
1774
1785
  delete manifest.capabilities.hub;
1775
1786
  if (manifest.capabilities.erp) {
@@ -1909,7 +1920,7 @@ import os2 from "os";
1909
1920
  import path6 from "path";
1910
1921
  import { PostHog } from "posthog-node";
1911
1922
  var TOKEN = "phc_SkFAxTIa4RUQxotci1Ftdw7xefZK2Ax0LEIGcl8zuD2";
1912
- var CLI_VERSION = "0.5.6";
1923
+ var CLI_VERSION = "0.5.8";
1913
1924
  var client = TOKEN ? new PostHog(TOKEN, { host: "https://e.jtl-cloud.com" }) : null;
1914
1925
  function telemetryDisabledByEnv() {
1915
1926
  const dnt = process.env.DO_NOT_TRACK;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jtl-software/create-cloud-app",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "type": "module",
5
5
  "description": "CLI tool for scaffolding JTL Platform cloud apps",
6
6
  "bin": {
@@ -19,10 +19,10 @@
19
19
  "dependencies": {
20
20
  "@clack/prompts": "^1.7.0",
21
21
  "@jtl-software/cloud-app-template-backend-dotnet": "0.0.13",
22
- "@jtl-software/cloud-app-template-backend-node": "0.0.16",
22
+ "@jtl-software/cloud-app-template-backend-node": "0.0.17",
23
23
  "@jtl-software/cloud-app-template-backend-php": "0.1.3",
24
24
  "@jtl-software/cloud-app-template-frontend-react": "0.1.5",
25
- "@jtl-software/cloud-app-template-shared": "0.1.2",
25
+ "@jtl-software/cloud-app-template-shared": "0.1.3",
26
26
  "picocolors": "^1.1.1",
27
27
  "posthog-node": "^5.49.1"
28
28
  },