@jtl-software/create-cloud-app 0.5.7 → 0.5.9

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 +13 -4
  2. package/package.json +4 -4
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,
@@ -1911,7 +1920,7 @@ import os2 from "os";
1911
1920
  import path6 from "path";
1912
1921
  import { PostHog } from "posthog-node";
1913
1922
  var TOKEN = "phc_SkFAxTIa4RUQxotci1Ftdw7xefZK2Ax0LEIGcl8zuD2";
1914
- var CLI_VERSION = "0.5.7";
1923
+ var CLI_VERSION = "0.5.9";
1915
1924
  var client = TOKEN ? new PostHog(TOKEN, { host: "https://e.jtl-cloud.com" }) : null;
1916
1925
  function telemetryDisabledByEnv() {
1917
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.7",
3
+ "version": "0.5.9",
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
- "@jtl-software/cloud-app-template-frontend-react": "0.1.5",
25
- "@jtl-software/cloud-app-template-shared": "0.1.2",
24
+ "@jtl-software/cloud-app-template-frontend-react": "0.1.6",
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
  },