@jtl-software/create-cloud-app 0.5.10 → 0.7.0
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/dist/index.js +11 -7
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -717,13 +717,14 @@ function environmentFromApi(api) {
|
|
|
717
717
|
if (h.includes("api.jtl-cloud.com")) return "prod";
|
|
718
718
|
return "other";
|
|
719
719
|
}
|
|
720
|
-
function writeFrontendPublicClient(root, authIssuer, publicClientId) {
|
|
720
|
+
function writeFrontendPublicClient(root, authIssuer, publicClientId, apiBase) {
|
|
721
721
|
const frontendDir = detectFrontend(root);
|
|
722
722
|
if (!frontendDir) return null;
|
|
723
723
|
const envFile = path2.join(frontendDir, ".env");
|
|
724
724
|
upsertEnv(envFile, {
|
|
725
725
|
VITE_JTL_CLIENT_ID: publicClientId,
|
|
726
|
-
VITE_JTL_ISSUER: authIssuer
|
|
726
|
+
VITE_JTL_ISSUER: authIssuer,
|
|
727
|
+
...apiBase ? { VITE_JTL_API_BASE: apiBase.replace(/\/$/, "") } : {}
|
|
727
728
|
});
|
|
728
729
|
return envFile;
|
|
729
730
|
}
|
|
@@ -763,7 +764,7 @@ function readExistingCredentials(backend) {
|
|
|
763
764
|
function authBaseFromApi(apiHost) {
|
|
764
765
|
return apiHost.replace(/:\/\/api\./, "://auth.").replace(/\/$/, "");
|
|
765
766
|
}
|
|
766
|
-
function writeBackendCredentials(backend, clientId, clientSecret, issuer, apiBase) {
|
|
767
|
+
function writeBackendCredentials(backend, clientId, clientSecret, issuer, apiBase, appId) {
|
|
767
768
|
const hosts = apiBase ? {
|
|
768
769
|
JTL_API_BASE: apiBase.replace(/\/$/, ""),
|
|
769
770
|
JTL_AUTH_BASE: authBaseFromApi(apiBase)
|
|
@@ -773,6 +774,7 @@ function writeBackendCredentials(backend, clientId, clientSecret, issuer, apiBas
|
|
|
773
774
|
CLIENT_ID: clientId,
|
|
774
775
|
CLIENT_SECRET: clientSecret,
|
|
775
776
|
...issuer ? { JTL_ISSUER: issuer } : {},
|
|
777
|
+
...appId ? { JTL_APP_ID: appId } : {},
|
|
776
778
|
...hosts
|
|
777
779
|
});
|
|
778
780
|
return backend.envFile;
|
|
@@ -1038,11 +1040,12 @@ async function applyProvisionResult(root, backend, opts, tenant, appId, provisio
|
|
|
1038
1040
|
const written = writeFrontendPublicClient(
|
|
1039
1041
|
root,
|
|
1040
1042
|
opts.auth,
|
|
1041
|
-
provisioned.publicClientId
|
|
1043
|
+
provisioned.publicClientId,
|
|
1044
|
+
opts.api
|
|
1042
1045
|
);
|
|
1043
1046
|
if (written) {
|
|
1044
1047
|
p2.log.success(
|
|
1045
|
-
`Wrote VITE_JTL_CLIENT_ID/VITE_JTL_ISSUER to ${pc2.cyan(path2.relative(root, written))}.`
|
|
1048
|
+
`Wrote VITE_JTL_CLIENT_ID/VITE_JTL_ISSUER/VITE_JTL_API_BASE to ${pc2.cyan(path2.relative(root, written))}.`
|
|
1046
1049
|
);
|
|
1047
1050
|
}
|
|
1048
1051
|
}
|
|
@@ -1105,7 +1108,8 @@ async function persistCredentials(backend, clientId, clientSecret, root, opts, c
|
|
|
1105
1108
|
clientId,
|
|
1106
1109
|
clientSecret,
|
|
1107
1110
|
opts.auth,
|
|
1108
|
-
opts.api
|
|
1111
|
+
opts.api,
|
|
1112
|
+
context.appId
|
|
1109
1113
|
);
|
|
1110
1114
|
printHubLink(
|
|
1111
1115
|
context.hub,
|
|
@@ -1920,7 +1924,7 @@ import os2 from "os";
|
|
|
1920
1924
|
import path6 from "path";
|
|
1921
1925
|
import { PostHog } from "posthog-node";
|
|
1922
1926
|
var TOKEN = "phc_SkFAxTIa4RUQxotci1Ftdw7xefZK2Ax0LEIGcl8zuD2";
|
|
1923
|
-
var CLI_VERSION = "0.
|
|
1927
|
+
var CLI_VERSION = "0.7.0";
|
|
1924
1928
|
var client = TOKEN ? new PostHog(TOKEN, { host: "https://e.jtl-cloud.com" }) : null;
|
|
1925
1929
|
function telemetryDisabledByEnv() {
|
|
1926
1930
|
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.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tool for scaffolding JTL Platform cloud apps",
|
|
6
6
|
"bin": {
|
|
@@ -19,18 +19,18 @@
|
|
|
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.1
|
|
22
|
+
"@jtl-software/cloud-app-template-backend-node": "0.2.1",
|
|
23
23
|
"@jtl-software/cloud-app-template-backend-php": "0.1.3",
|
|
24
|
-
"@jtl-software/cloud-app-template-frontend-react": "0.
|
|
25
|
-
"@jtl-software/cloud-app-template-shared": "0.
|
|
24
|
+
"@jtl-software/cloud-app-template-frontend-react": "0.3.0",
|
|
25
|
+
"@jtl-software/cloud-app-template-shared": "0.2.0",
|
|
26
26
|
"picocolors": "^1.1.1",
|
|
27
|
-
"posthog-node": "^5.
|
|
27
|
+
"posthog-node": "^5.51.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/node": "^26.
|
|
30
|
+
"@types/node": "^26.4.0",
|
|
31
31
|
"msw": "^2.15.0",
|
|
32
32
|
"tsup": "^8.5.1",
|
|
33
|
-
"tsx": "^4.23.
|
|
33
|
+
"tsx": "^4.23.13",
|
|
34
34
|
"typescript": "^6.0.3"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|