@bluealba/platform-cli 0.2.0 → 0.3.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 +430 -50
- package/package.json +1 -1
- package/templates/customization-ui-module-template/src/root.component.tsx +2 -11
- package/templates/customization-ui-module-template/src/components/ExpandedNavbarLogo.tsx +0 -62
- package/templates/customization-ui-module-template/src/components/ExtensionPoints/index.tsx +0 -28
- package/templates/customization-ui-module-template/src/components/Logo.tsx +0 -55
- package/templates/customization-ui-module-template/src/components/SplashLogo.tsx +0 -52
- package/templates/customization-ui-module-template/src/hooks/useDynamicStyleSheet.ts +0 -18
package/dist/index.js
CHANGED
|
@@ -61,11 +61,10 @@ import React2 from "react";
|
|
|
61
61
|
import { Box as Box3, Text as Text3 } from "ink";
|
|
62
62
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
63
63
|
var ASCII_ART = [
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
" / | \\ "
|
|
64
|
+
"|---. .---|",
|
|
65
|
+
"| \\/ |",
|
|
66
|
+
"| /\\ |",
|
|
67
|
+
"|---' '---|"
|
|
69
68
|
];
|
|
70
69
|
var WelcomeBanner = React2.memo(function WelcomeBanner2({ version: version2 }) {
|
|
71
70
|
return /* @__PURE__ */ jsxs3(Box3, { borderStyle: "round", flexDirection: "column", paddingX: 1, paddingY: 1, children: [
|
|
@@ -125,8 +124,8 @@ function Spinner({ label }) {
|
|
|
125
124
|
import { Fzf } from "fzf";
|
|
126
125
|
|
|
127
126
|
// src/commands/create-application/create-application.command.ts
|
|
128
|
-
import { join as
|
|
129
|
-
import { cwd } from "process";
|
|
127
|
+
import { join as join10 } from "path";
|
|
128
|
+
import { cwd as cwd2 } from "process";
|
|
130
129
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
131
130
|
|
|
132
131
|
// src/commands/create-application/scaffold-application-monorepo.ts
|
|
@@ -465,6 +464,20 @@ function formatError(err) {
|
|
|
465
464
|
return err instanceof Error ? err.message : String(err);
|
|
466
465
|
}
|
|
467
466
|
|
|
467
|
+
// src/utils/platform-check.ts
|
|
468
|
+
import { access } from "fs/promises";
|
|
469
|
+
import { join as join9 } from "path";
|
|
470
|
+
import { cwd } from "process";
|
|
471
|
+
async function isPlatformInitialized() {
|
|
472
|
+
try {
|
|
473
|
+
await access(join9(cwd(), "core"));
|
|
474
|
+
await access(join9(cwd(), "local"));
|
|
475
|
+
return true;
|
|
476
|
+
} catch {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
468
481
|
// src/commands/create-application/create-application.command.ts
|
|
469
482
|
var CREATE_APPLICATION_COMMAND_NAME = "create-application";
|
|
470
483
|
var createApplicationCommand = {
|
|
@@ -481,10 +494,14 @@ async function createApplication(params, logger) {
|
|
|
481
494
|
hasUserInterface,
|
|
482
495
|
hasBackendService
|
|
483
496
|
} = params;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
497
|
+
if (!await isPlatformInitialized()) {
|
|
498
|
+
logger.log("Error: Cannot create an application \u2014 no platform initialized in this directory.");
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
const rootDir = cwd2();
|
|
502
|
+
const applicationDir = join10(rootDir, applicationName);
|
|
503
|
+
const bootstrapServiceDir = join10(applicationDir, "services", `${applicationName}-bootstrap-service`);
|
|
504
|
+
const localDir = join10(rootDir, "local");
|
|
488
505
|
logger.log(`Creating application monorepo "${applicationName}"...`);
|
|
489
506
|
try {
|
|
490
507
|
await scaffoldApplicationMonorepo(applicationDir, organizationName, platformName, applicationName, logger);
|
|
@@ -492,8 +509,8 @@ async function createApplication(params, logger) {
|
|
|
492
509
|
logger.log(`Error: Could not scaffold application monorepo \u2014 ${formatError(err)}`);
|
|
493
510
|
return;
|
|
494
511
|
}
|
|
495
|
-
await mkdir2(
|
|
496
|
-
await mkdir2(
|
|
512
|
+
await mkdir2(join10(applicationDir, "services"), { recursive: true });
|
|
513
|
+
await mkdir2(join10(applicationDir, "ui"), { recursive: true });
|
|
497
514
|
logger.log(`Creating bootstrap service "${applicationName}-bootstrap-service"...`);
|
|
498
515
|
const bootstrapServiceDir_var = `${applicationName}/services`;
|
|
499
516
|
try {
|
|
@@ -526,7 +543,7 @@ async function createApplication(params, logger) {
|
|
|
526
543
|
);
|
|
527
544
|
}
|
|
528
545
|
if (hasUserInterface) {
|
|
529
|
-
const uiDir =
|
|
546
|
+
const uiDir = join10(applicationDir, "ui", `${applicationName}-ui`);
|
|
530
547
|
const uiBaseDir = `${applicationName}/ui`;
|
|
531
548
|
try {
|
|
532
549
|
await scaffoldUiModule(uiDir, organizationName, platformName, applicationName, applicationDisplayName, uiBaseDir, logger);
|
|
@@ -536,7 +553,7 @@ async function createApplication(params, logger) {
|
|
|
536
553
|
}
|
|
537
554
|
}
|
|
538
555
|
if (hasBackendService) {
|
|
539
|
-
const serviceDir =
|
|
556
|
+
const serviceDir = join10(applicationDir, "services", `${applicationName}-service`);
|
|
540
557
|
const serviceBaseDir = `${applicationName}/services`;
|
|
541
558
|
try {
|
|
542
559
|
await scaffoldNestjsService(serviceDir, organizationName, applicationName, applicationDisplayName, serviceBaseDir, logger);
|
|
@@ -545,7 +562,7 @@ async function createApplication(params, logger) {
|
|
|
545
562
|
return;
|
|
546
563
|
}
|
|
547
564
|
}
|
|
548
|
-
const dockerComposePath =
|
|
565
|
+
const dockerComposePath = join10(localDir, `${applicationName}-docker-compose.yml`);
|
|
549
566
|
const basePort = await getNextAvailablePort(localDir);
|
|
550
567
|
const uiPort = hasUserInterface ? basePort : 0;
|
|
551
568
|
const servicePort = hasBackendService ? hasUserInterface ? basePort + 1 : basePort : 0;
|
|
@@ -558,14 +575,14 @@ async function createApplication(params, logger) {
|
|
|
558
575
|
servicePort,
|
|
559
576
|
logger
|
|
560
577
|
);
|
|
561
|
-
const rootDockerComposePath =
|
|
578
|
+
const rootDockerComposePath = join10(localDir, "docker-compose.yml");
|
|
562
579
|
await updateRootDockerCompose(rootDockerComposePath, applicationName, logger);
|
|
563
580
|
logger.log(`Done! Application "${applicationName}" created at ${applicationDir}`);
|
|
564
581
|
}
|
|
565
582
|
|
|
566
583
|
// src/commands/init/init.command.ts
|
|
567
|
-
import { join as
|
|
568
|
-
import { cwd as
|
|
584
|
+
import { join as join16 } from "path";
|
|
585
|
+
import { cwd as cwd3 } from "process";
|
|
569
586
|
|
|
570
587
|
// src/utils/string.ts
|
|
571
588
|
function camelize(name) {
|
|
@@ -574,8 +591,8 @@ function camelize(name) {
|
|
|
574
591
|
|
|
575
592
|
// src/commands/init/scaffold-platform.ts
|
|
576
593
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
577
|
-
import { join as
|
|
578
|
-
var templateDir =
|
|
594
|
+
import { join as join11, dirname as dirname7 } from "path";
|
|
595
|
+
var templateDir = join11(
|
|
579
596
|
dirname7(fileURLToPath6(import.meta.url)),
|
|
580
597
|
"..",
|
|
581
598
|
"templates",
|
|
@@ -587,8 +604,8 @@ async function scaffoldPlatform(outputDir, variables, logger) {
|
|
|
587
604
|
|
|
588
605
|
// src/commands/init/scaffold-platform-bootstrap.ts
|
|
589
606
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
590
|
-
import { join as
|
|
591
|
-
var templateDir2 =
|
|
607
|
+
import { join as join12, dirname as dirname8 } from "path";
|
|
608
|
+
var templateDir2 = join12(
|
|
592
609
|
dirname8(fileURLToPath7(import.meta.url)),
|
|
593
610
|
"..",
|
|
594
611
|
"templates",
|
|
@@ -600,8 +617,8 @@ async function scaffoldPlatformBootstrap(outputDir, variables, logger) {
|
|
|
600
617
|
|
|
601
618
|
// src/commands/init/scaffold-customization-ui.ts
|
|
602
619
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
603
|
-
import { join as
|
|
604
|
-
var templateDir3 =
|
|
620
|
+
import { join as join13, dirname as dirname9 } from "path";
|
|
621
|
+
var templateDir3 = join13(
|
|
605
622
|
dirname9(fileURLToPath8(import.meta.url)),
|
|
606
623
|
"..",
|
|
607
624
|
"templates",
|
|
@@ -612,10 +629,10 @@ async function scaffoldCustomizationUi(outputDir, variables, logger) {
|
|
|
612
629
|
}
|
|
613
630
|
|
|
614
631
|
// src/commands/init/register-customization-module.ts
|
|
615
|
-
import { join as
|
|
632
|
+
import { join as join14 } from "path";
|
|
616
633
|
import { readFile as readFile5, writeFile as writeFile5 } from "fs/promises";
|
|
617
634
|
async function registerCustomizationModule(bootstrapServiceDir, organizationName, logger) {
|
|
618
|
-
const modulesJsonPath =
|
|
635
|
+
const modulesJsonPath = join14(bootstrapServiceDir, "src", "data", "platform", "modules.json");
|
|
619
636
|
const entry = {
|
|
620
637
|
name: `@${organizationName}/platform-customization-ui`,
|
|
621
638
|
displayName: "Platform Customization UI",
|
|
@@ -638,7 +655,7 @@ async function registerCustomizationModule(bootstrapServiceDir, organizationName
|
|
|
638
655
|
|
|
639
656
|
// src/commands/init/generate-local-env.ts
|
|
640
657
|
import { readFile as readFile6, writeFile as writeFile6 } from "fs/promises";
|
|
641
|
-
import { join as
|
|
658
|
+
import { join as join15 } from "path";
|
|
642
659
|
|
|
643
660
|
// src/utils/random.ts
|
|
644
661
|
import { randomBytes } from "crypto";
|
|
@@ -648,8 +665,8 @@ function generateRandomSecret() {
|
|
|
648
665
|
|
|
649
666
|
// src/commands/init/generate-local-env.ts
|
|
650
667
|
async function generateLocalEnv(outputDir, logger) {
|
|
651
|
-
const examplePath =
|
|
652
|
-
const envPath =
|
|
668
|
+
const examplePath = join15(outputDir, "local", ".env.example");
|
|
669
|
+
const envPath = join15(outputDir, "local", ".env");
|
|
653
670
|
logger.log("Generating local/.env with random secrets...");
|
|
654
671
|
const content = await readFile6(examplePath, "utf-8");
|
|
655
672
|
const result = content.replace(/^(PAE_AUTH_JWT_SECRET|PAE_GATEWAY_SERVICE_ACCESS_SECRET|PAE_DB_PASSWORD)=$/gm, (_, key) => {
|
|
@@ -665,9 +682,13 @@ var initCommand = {
|
|
|
665
682
|
description: "Initialize a new platform"
|
|
666
683
|
};
|
|
667
684
|
async function init(params, logger) {
|
|
685
|
+
if (await isPlatformInitialized()) {
|
|
686
|
+
logger.log("Error: Cannot initialize a new platform \u2014 a platform is already initialized in this directory.");
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
668
689
|
const { organizationName, platformName, platformDisplayName } = params;
|
|
669
690
|
const platformTitle = camelize(platformName);
|
|
670
|
-
const outputDir =
|
|
691
|
+
const outputDir = cwd3();
|
|
671
692
|
logger.log(`Initializing ${platformTitle} platform for @${organizationName}...`);
|
|
672
693
|
const variables = {
|
|
673
694
|
organizationName,
|
|
@@ -691,7 +712,7 @@ async function init(params, logger) {
|
|
|
691
712
|
}
|
|
692
713
|
try {
|
|
693
714
|
await scaffoldPlatformBootstrap(
|
|
694
|
-
|
|
715
|
+
join16(outputDir, "core", "services", "platform-bootstrap-service"),
|
|
695
716
|
variables,
|
|
696
717
|
logger
|
|
697
718
|
);
|
|
@@ -701,7 +722,7 @@ async function init(params, logger) {
|
|
|
701
722
|
}
|
|
702
723
|
try {
|
|
703
724
|
await scaffoldCustomizationUi(
|
|
704
|
-
|
|
725
|
+
join16(outputDir, "core", "ui", "platform-customization-ui"),
|
|
705
726
|
variables,
|
|
706
727
|
logger
|
|
707
728
|
);
|
|
@@ -711,7 +732,7 @@ async function init(params, logger) {
|
|
|
711
732
|
}
|
|
712
733
|
try {
|
|
713
734
|
await registerCustomizationModule(
|
|
714
|
-
|
|
735
|
+
join16(outputDir, "core", "services", "platform-bootstrap-service"),
|
|
715
736
|
organizationName,
|
|
716
737
|
logger
|
|
717
738
|
);
|
|
@@ -723,8 +744,8 @@ async function init(params, logger) {
|
|
|
723
744
|
}
|
|
724
745
|
|
|
725
746
|
// src/commands/configure-idp/configure-idp.command.ts
|
|
726
|
-
import { join as
|
|
727
|
-
import { cwd as
|
|
747
|
+
import { join as join17 } from "path";
|
|
748
|
+
import { cwd as cwd4 } from "process";
|
|
728
749
|
import { fetch as undiciFetch, Agent } from "undici";
|
|
729
750
|
|
|
730
751
|
// src/utils/env-reader.ts
|
|
@@ -802,7 +823,11 @@ var configureIdpCommand = {
|
|
|
802
823
|
description: "Configure an Identity Provider (IDP) in the gateway"
|
|
803
824
|
};
|
|
804
825
|
async function configureIdp(params, logger) {
|
|
805
|
-
|
|
826
|
+
if (!await isPlatformInitialized()) {
|
|
827
|
+
logger.log("Error: Cannot configure an IDP \u2014 no platform initialized in this directory.");
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
const envPath = join17(cwd4(), "local", ".env");
|
|
806
831
|
let env;
|
|
807
832
|
try {
|
|
808
833
|
env = await readEnvFile(envPath);
|
|
@@ -853,6 +878,234 @@ async function configureIdp(params, logger) {
|
|
|
853
878
|
logger.log(`IDP provider "${params.name}" configured successfully.`);
|
|
854
879
|
}
|
|
855
880
|
|
|
881
|
+
// src/commands/create-service-module/create-service-module.command.ts
|
|
882
|
+
import { join as join19 } from "path";
|
|
883
|
+
import { cwd as cwd5 } from "process";
|
|
884
|
+
import { access as access2, readFile as readFile9 } from "fs/promises";
|
|
885
|
+
|
|
886
|
+
// src/commands/create-service-module/scaffold-service-module.ts
|
|
887
|
+
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
888
|
+
import { join as join18, dirname as dirname10 } from "path";
|
|
889
|
+
var nestjsServiceModuleTemplateDir2 = join18(
|
|
890
|
+
dirname10(fileURLToPath9(import.meta.url)),
|
|
891
|
+
"..",
|
|
892
|
+
"templates",
|
|
893
|
+
"nestjs-service-module-template"
|
|
894
|
+
);
|
|
895
|
+
async function scaffoldServiceModule(serviceDir, organizationName, serviceName, serviceDisplayName, serviceBaseDir, logger) {
|
|
896
|
+
logger.log(`Creating NestJS service "${serviceName}"...`);
|
|
897
|
+
await applyTemplate(
|
|
898
|
+
{
|
|
899
|
+
templateDir: nestjsServiceModuleTemplateDir2,
|
|
900
|
+
outputDir: serviceDir,
|
|
901
|
+
variables: { organizationName, serviceName, serviceDisplayName, serviceBaseDir }
|
|
902
|
+
},
|
|
903
|
+
(message) => logger.log(message)
|
|
904
|
+
);
|
|
905
|
+
logger.log(`Done! Service output: ${serviceDir}`);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/commands/create-service-module/service-module-entry-builder.ts
|
|
909
|
+
function buildCustomServiceModuleEntry(organizationName, serviceName, serviceDisplayName) {
|
|
910
|
+
return {
|
|
911
|
+
name: `@${organizationName}/${serviceName}`,
|
|
912
|
+
displayName: serviceDisplayName,
|
|
913
|
+
type: "service",
|
|
914
|
+
baseUrl: `/${serviceName}`,
|
|
915
|
+
service: {
|
|
916
|
+
host: serviceName,
|
|
917
|
+
port: 80
|
|
918
|
+
},
|
|
919
|
+
dependsOn: []
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// src/commands/create-service-module/append-docker-compose.ts
|
|
924
|
+
import { readFile as readFile8, writeFile as writeFile7 } from "fs/promises";
|
|
925
|
+
async function appendServiceToDockerCompose(dockerComposePath, serviceName, applicationName, port, logger) {
|
|
926
|
+
const block = `
|
|
927
|
+
${serviceName}:
|
|
928
|
+
build:
|
|
929
|
+
context: ../${applicationName}/services/${serviceName}
|
|
930
|
+
dockerfile: Dockerfile.development
|
|
931
|
+
args:
|
|
932
|
+
- BA_NPM_AUTH_TOKEN=$BA_NPM_AUTH_TOKEN
|
|
933
|
+
ports:
|
|
934
|
+
- ${port}:80
|
|
935
|
+
environment:
|
|
936
|
+
- GATEWAY_URL=\${PAE_GATEWAY_URL}
|
|
937
|
+
volumes:
|
|
938
|
+
- \${PWD}/../:/app/out
|
|
939
|
+
`;
|
|
940
|
+
try {
|
|
941
|
+
const existing = await readFile8(dockerComposePath, "utf-8");
|
|
942
|
+
await writeFile7(dockerComposePath, existing + block, "utf-8");
|
|
943
|
+
logger.log(`Updated docker-compose: ${dockerComposePath}`);
|
|
944
|
+
} catch (err) {
|
|
945
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
946
|
+
logger.log(`Warning: Could not update docker-compose \u2014 ${message}`);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// src/commands/create-service-module/create-service-module.command.ts
|
|
951
|
+
var CREATE_SERVICE_MODULE_COMMAND_NAME = "create-service-module";
|
|
952
|
+
var createServiceModuleCommand = {
|
|
953
|
+
name: CREATE_SERVICE_MODULE_COMMAND_NAME,
|
|
954
|
+
description: "Add a new service module to an existing application"
|
|
955
|
+
};
|
|
956
|
+
async function createServiceModule(params, logger) {
|
|
957
|
+
const { applicationName, serviceName, serviceDisplayName } = params;
|
|
958
|
+
if (!await isPlatformInitialized()) {
|
|
959
|
+
logger.log("Error: Cannot create a service module \u2014 no platform initialized in this directory.");
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
const rootDir = cwd5();
|
|
963
|
+
const applicationDir = join19(rootDir, applicationName);
|
|
964
|
+
try {
|
|
965
|
+
await access2(applicationDir);
|
|
966
|
+
} catch {
|
|
967
|
+
logger.log(`Error: The specified application "${applicationName}" does not exist in the platform.`);
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
const fullServiceName = `${serviceName}-service`;
|
|
971
|
+
const serviceDir = join19(applicationDir, "services", fullServiceName);
|
|
972
|
+
try {
|
|
973
|
+
await access2(serviceDir);
|
|
974
|
+
logger.log(`Error: A service named "${fullServiceName}" already exists in application "${applicationName}".`);
|
|
975
|
+
return;
|
|
976
|
+
} catch {
|
|
977
|
+
}
|
|
978
|
+
let organizationName;
|
|
979
|
+
try {
|
|
980
|
+
const corePackageJson = JSON.parse(
|
|
981
|
+
await readFile9(join19(rootDir, "core", "package.json"), "utf-8")
|
|
982
|
+
);
|
|
983
|
+
const scopeMatch = corePackageJson.name.match(/^@([^/]+)\//);
|
|
984
|
+
organizationName = scopeMatch?.[1];
|
|
985
|
+
if (!organizationName) {
|
|
986
|
+
throw new Error(`Could not parse organization from package name: "${corePackageJson.name}"`);
|
|
987
|
+
}
|
|
988
|
+
} catch (err) {
|
|
989
|
+
logger.log(`Error: Could not read core/package.json \u2014 ${formatError(err)}`);
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
const serviceBaseDir = `${applicationName}/services`;
|
|
993
|
+
try {
|
|
994
|
+
await scaffoldServiceModule(
|
|
995
|
+
serviceDir,
|
|
996
|
+
organizationName,
|
|
997
|
+
fullServiceName,
|
|
998
|
+
serviceDisplayName,
|
|
999
|
+
serviceBaseDir,
|
|
1000
|
+
logger
|
|
1001
|
+
);
|
|
1002
|
+
} catch (err) {
|
|
1003
|
+
logger.log(`Error: Could not scaffold NestJS service \u2014 ${formatError(err)}`);
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
const bootstrapServiceDir = join19(applicationDir, "services", `${applicationName}-bootstrap-service`);
|
|
1007
|
+
const moduleEntry = buildCustomServiceModuleEntry(organizationName, fullServiceName, serviceDisplayName);
|
|
1008
|
+
await addModuleEntry(bootstrapServiceDir, applicationName, moduleEntry, logger);
|
|
1009
|
+
const localDir = join19(rootDir, "local");
|
|
1010
|
+
const dockerComposePath = join19(localDir, `${applicationName}-docker-compose.yml`);
|
|
1011
|
+
const port = await getNextAvailablePort(localDir);
|
|
1012
|
+
await appendServiceToDockerCompose(dockerComposePath, fullServiceName, applicationName, port, logger);
|
|
1013
|
+
logger.log(`Done! Service module "${fullServiceName}" added to application "${applicationName}".`);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
// src/commands/create-ui-module/create-ui-module.command.ts
|
|
1017
|
+
import { join as join20 } from "path";
|
|
1018
|
+
import { cwd as cwd6 } from "process";
|
|
1019
|
+
import { access as access3, readdir as readdir3, readFile as readFile11 } from "fs/promises";
|
|
1020
|
+
|
|
1021
|
+
// src/commands/create-ui-module/append-ui-docker-compose.ts
|
|
1022
|
+
import { readFile as readFile10, writeFile as writeFile8 } from "fs/promises";
|
|
1023
|
+
async function appendUiToDockerCompose(dockerComposePath, applicationName, port, logger) {
|
|
1024
|
+
const block = `
|
|
1025
|
+
${applicationName}-ui:
|
|
1026
|
+
build:
|
|
1027
|
+
context: ../${applicationName}/ui/${applicationName}-ui
|
|
1028
|
+
dockerfile: Dockerfile.development
|
|
1029
|
+
ports:
|
|
1030
|
+
- ${port}:80
|
|
1031
|
+
volumes:
|
|
1032
|
+
- \${PWD}/../:/app/out
|
|
1033
|
+
`;
|
|
1034
|
+
try {
|
|
1035
|
+
const existing = await readFile10(dockerComposePath, "utf-8");
|
|
1036
|
+
await writeFile8(dockerComposePath, existing + block, "utf-8");
|
|
1037
|
+
logger.log(`Updated docker-compose: ${dockerComposePath}`);
|
|
1038
|
+
} catch (err) {
|
|
1039
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1040
|
+
logger.log(`Warning: Could not update docker-compose \u2014 ${message}`);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// src/commands/create-ui-module/create-ui-module.command.ts
|
|
1045
|
+
var CREATE_UI_MODULE_COMMAND_NAME = "create-ui-module";
|
|
1046
|
+
var createUiModuleCommand = {
|
|
1047
|
+
name: CREATE_UI_MODULE_COMMAND_NAME,
|
|
1048
|
+
description: "Add a UI module to an existing application"
|
|
1049
|
+
};
|
|
1050
|
+
async function createUiModule(params, logger) {
|
|
1051
|
+
const { applicationName, applicationDisplayName } = params;
|
|
1052
|
+
if (!await isPlatformInitialized()) {
|
|
1053
|
+
logger.log("Error: Cannot create a UI module \u2014 no platform initialized in this directory.");
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
const rootDir = cwd6();
|
|
1057
|
+
const applicationDir = join20(rootDir, applicationName);
|
|
1058
|
+
try {
|
|
1059
|
+
await access3(applicationDir);
|
|
1060
|
+
} catch {
|
|
1061
|
+
logger.log(`Error: The specified application "${applicationName}" does not exist in the platform.`);
|
|
1062
|
+
return;
|
|
1063
|
+
}
|
|
1064
|
+
const uiDir = join20(applicationDir, "ui");
|
|
1065
|
+
try {
|
|
1066
|
+
const uiEntries = await readdir3(uiDir);
|
|
1067
|
+
const existingUiModules = uiEntries.filter((e) => e !== ".gitkeep");
|
|
1068
|
+
if (existingUiModules.length > 0) {
|
|
1069
|
+
logger.log(`Error: Currently we support only one UI module per application. Application "${applicationName}" already has a UI module.`);
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
} catch {
|
|
1073
|
+
}
|
|
1074
|
+
let organizationName;
|
|
1075
|
+
let platformName;
|
|
1076
|
+
try {
|
|
1077
|
+
const corePackageJson = JSON.parse(
|
|
1078
|
+
await readFile11(join20(rootDir, "core", "package.json"), "utf-8")
|
|
1079
|
+
);
|
|
1080
|
+
const scopeMatch = corePackageJson.name.match(/^@([^/]+)\//);
|
|
1081
|
+
organizationName = scopeMatch?.[1];
|
|
1082
|
+
const rawName = corePackageJson.name.replace(/^@[^/]+\//, "").replace(/-core$/, "");
|
|
1083
|
+
platformName = rawName;
|
|
1084
|
+
if (!organizationName || !platformName) {
|
|
1085
|
+
throw new Error(`Could not parse organization/platform from package name: "${corePackageJson.name}"`);
|
|
1086
|
+
}
|
|
1087
|
+
} catch (err) {
|
|
1088
|
+
logger.log(`Error: Could not read core/package.json \u2014 ${formatError(err)}`);
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
const uiOutputDir = join20(uiDir, `${applicationName}-ui`);
|
|
1092
|
+
const uiBaseDir = `${applicationName}/ui`;
|
|
1093
|
+
try {
|
|
1094
|
+
await scaffoldUiModule(uiOutputDir, organizationName, platformName, applicationName, applicationDisplayName, uiBaseDir, logger);
|
|
1095
|
+
} catch (err) {
|
|
1096
|
+
logger.log(`Error: Could not scaffold UI module \u2014 ${formatError(err)}`);
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1099
|
+
const bootstrapServiceDir = join20(applicationDir, "services", `${applicationName}-bootstrap-service`);
|
|
1100
|
+
const moduleEntry = buildUiModuleEntry(organizationName, applicationName, applicationDisplayName);
|
|
1101
|
+
await addModuleEntry(bootstrapServiceDir, applicationName, moduleEntry, logger);
|
|
1102
|
+
const localDir = join20(rootDir, "local");
|
|
1103
|
+
const dockerComposePath = join20(localDir, `${applicationName}-docker-compose.yml`);
|
|
1104
|
+
const port = await getNextAvailablePort(localDir);
|
|
1105
|
+
await appendUiToDockerCompose(dockerComposePath, applicationName, port, logger);
|
|
1106
|
+
logger.log(`Done! UI module "${applicationName}-ui" added to application "${applicationName}".`);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
856
1109
|
// src/commands/registry.ts
|
|
857
1110
|
var CommandRegistry = class {
|
|
858
1111
|
commands = /* @__PURE__ */ new Map();
|
|
@@ -878,6 +1131,8 @@ var registry = new CommandRegistry();
|
|
|
878
1131
|
registry.register(createApplicationCommand);
|
|
879
1132
|
registry.register(initCommand);
|
|
880
1133
|
registry.register(configureIdpCommand);
|
|
1134
|
+
registry.register(createServiceModuleCommand);
|
|
1135
|
+
registry.register(createUiModuleCommand);
|
|
881
1136
|
|
|
882
1137
|
// src/app-state.ts
|
|
883
1138
|
var APP_STATE = {
|
|
@@ -891,9 +1146,9 @@ var APP_STATE = {
|
|
|
891
1146
|
import { useState as useState2, useCallback, useRef } from "react";
|
|
892
1147
|
|
|
893
1148
|
// src/controllers/ui/create-application.ui-controller.ts
|
|
894
|
-
import { readFile as
|
|
895
|
-
import { join as
|
|
896
|
-
import { cwd as
|
|
1149
|
+
import { readFile as readFile12 } from "fs/promises";
|
|
1150
|
+
import { join as join21 } from "path";
|
|
1151
|
+
import { cwd as cwd7 } from "process";
|
|
897
1152
|
|
|
898
1153
|
// src/services/create-application.service.ts
|
|
899
1154
|
async function createApplicationService(params, logger) {
|
|
@@ -902,11 +1157,15 @@ async function createApplicationService(params, logger) {
|
|
|
902
1157
|
|
|
903
1158
|
// src/controllers/ui/create-application.ui-controller.ts
|
|
904
1159
|
async function createApplicationUiController(ctx) {
|
|
1160
|
+
if (!await isPlatformInitialized()) {
|
|
1161
|
+
ctx.log("Error: Cannot create an application \u2014 no platform initialized in this directory.");
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
905
1164
|
let organizationName;
|
|
906
1165
|
let platformName;
|
|
907
1166
|
try {
|
|
908
1167
|
const corePackageJson = JSON.parse(
|
|
909
|
-
await
|
|
1168
|
+
await readFile12(join21(cwd7(), "core", "package.json"), "utf-8")
|
|
910
1169
|
);
|
|
911
1170
|
const scopeMatch = corePackageJson.name.match(/^@([^/]+)\//);
|
|
912
1171
|
organizationName = scopeMatch?.[1];
|
|
@@ -958,6 +1217,10 @@ async function initService(params, logger) {
|
|
|
958
1217
|
|
|
959
1218
|
// src/controllers/ui/init.ui-controller.ts
|
|
960
1219
|
async function initUiController(ctx) {
|
|
1220
|
+
if (await isPlatformInitialized()) {
|
|
1221
|
+
ctx.log("Error: Cannot initialize a new platform \u2014 a platform is already initialized in this directory.");
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
961
1224
|
const organizationName = await ctx.prompt("Organization name:");
|
|
962
1225
|
const platformName = await ctx.prompt("Platform name:");
|
|
963
1226
|
const platformDisplayName = await ctx.prompt("Platform display name:");
|
|
@@ -971,6 +1234,10 @@ async function configureIdpService(params, logger) {
|
|
|
971
1234
|
|
|
972
1235
|
// src/controllers/ui/configure-idp.ui-controller.ts
|
|
973
1236
|
async function configureIdpUiController(ctx) {
|
|
1237
|
+
if (!await isPlatformInitialized()) {
|
|
1238
|
+
ctx.log("Error: Cannot configure an IDP \u2014 no platform initialized in this directory.");
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
974
1241
|
const providers = getAllProviders();
|
|
975
1242
|
const options = providers.map((p, i) => `${i + 1}: ${p.displayName}`).join(", ");
|
|
976
1243
|
const selectionInput = await ctx.prompt(`Select IDP type (${options}):`);
|
|
@@ -994,11 +1261,64 @@ async function configureIdpUiController(ctx) {
|
|
|
994
1261
|
);
|
|
995
1262
|
}
|
|
996
1263
|
|
|
1264
|
+
// src/services/create-service-module.service.ts
|
|
1265
|
+
async function createServiceModuleService(params, logger) {
|
|
1266
|
+
await createServiceModule(params, logger);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
// src/controllers/ui/create-service-module.ui-controller.ts
|
|
1270
|
+
async function createServiceModuleUiController(ctx) {
|
|
1271
|
+
if (!await isPlatformInitialized()) {
|
|
1272
|
+
ctx.log("Error: Cannot create a service module \u2014 no platform initialized in this directory.");
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1275
|
+
const applicationName = await ctx.prompt("Application name:");
|
|
1276
|
+
if (!/^[a-z0-9-]+$/.test(applicationName)) {
|
|
1277
|
+
ctx.log(`Error: Application name "${applicationName}" is invalid. Use only lowercase letters, numbers, and hyphens.`);
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
const serviceName = await ctx.prompt("Service name:");
|
|
1281
|
+
if (!/^[a-z0-9-]+$/.test(serviceName)) {
|
|
1282
|
+
ctx.log(`Error: Service name "${serviceName}" is invalid. Use only lowercase letters, numbers, and hyphens.`);
|
|
1283
|
+
return;
|
|
1284
|
+
}
|
|
1285
|
+
const serviceDisplayName = await ctx.prompt("Service display name:");
|
|
1286
|
+
await createServiceModuleService(
|
|
1287
|
+
{ applicationName, serviceName, serviceDisplayName },
|
|
1288
|
+
ctx
|
|
1289
|
+
);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
// src/services/create-ui-module.service.ts
|
|
1293
|
+
async function createUiModuleService(params, logger) {
|
|
1294
|
+
await createUiModule(params, logger);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// src/controllers/ui/create-ui-module.ui-controller.ts
|
|
1298
|
+
async function createUiModuleUiController(ctx) {
|
|
1299
|
+
if (!await isPlatformInitialized()) {
|
|
1300
|
+
ctx.log("Error: Cannot create a UI module \u2014 no platform initialized in this directory.");
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
const applicationName = await ctx.prompt("Application name:");
|
|
1304
|
+
if (!/^[a-z0-9-]+$/.test(applicationName)) {
|
|
1305
|
+
ctx.log(`Error: Application name "${applicationName}" is invalid. Use only lowercase letters, numbers, and hyphens.`);
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
const applicationDisplayName = await ctx.prompt("Application display name:");
|
|
1309
|
+
await createUiModuleService(
|
|
1310
|
+
{ applicationName, applicationDisplayName },
|
|
1311
|
+
ctx
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
997
1315
|
// src/controllers/ui/registry.ts
|
|
998
1316
|
var uiControllers = /* @__PURE__ */ new Map([
|
|
999
1317
|
[CREATE_APPLICATION_COMMAND_NAME, createApplicationUiController],
|
|
1000
1318
|
[INIT_COMMAND_NAME, initUiController],
|
|
1001
|
-
[CONFIGURE_IDP_COMMAND_NAME, configureIdpUiController]
|
|
1319
|
+
[CONFIGURE_IDP_COMMAND_NAME, configureIdpUiController],
|
|
1320
|
+
[CREATE_SERVICE_MODULE_COMMAND_NAME, createServiceModuleUiController],
|
|
1321
|
+
[CREATE_UI_MODULE_COMMAND_NAME, createUiModuleUiController]
|
|
1002
1322
|
]);
|
|
1003
1323
|
|
|
1004
1324
|
// src/hooks/use-command-runner.ts
|
|
@@ -1202,10 +1522,14 @@ function App() {
|
|
|
1202
1522
|
}
|
|
1203
1523
|
|
|
1204
1524
|
// src/controllers/cli/create-application.cli-controller.ts
|
|
1205
|
-
import { readFile as
|
|
1206
|
-
import { join as
|
|
1207
|
-
import { cwd as
|
|
1525
|
+
import { readFile as readFile13 } from "fs/promises";
|
|
1526
|
+
import { join as join22 } from "path";
|
|
1527
|
+
import { cwd as cwd8 } from "process";
|
|
1208
1528
|
async function createApplicationCliController(args2) {
|
|
1529
|
+
if (!await isPlatformInitialized()) {
|
|
1530
|
+
console.error("Error: Cannot create an application \u2014 no platform initialized in this directory.");
|
|
1531
|
+
process.exit(1);
|
|
1532
|
+
}
|
|
1209
1533
|
const {
|
|
1210
1534
|
applicationName,
|
|
1211
1535
|
applicationDisplayName,
|
|
@@ -1225,7 +1549,7 @@ async function createApplicationCliController(args2) {
|
|
|
1225
1549
|
let platformName;
|
|
1226
1550
|
try {
|
|
1227
1551
|
const corePackageJson = JSON.parse(
|
|
1228
|
-
await
|
|
1552
|
+
await readFile13(join22(cwd8(), "core", "package.json"), "utf-8")
|
|
1229
1553
|
);
|
|
1230
1554
|
const scopeMatch = corePackageJson.name.match(/^@([^/]+)\//);
|
|
1231
1555
|
organizationName = scopeMatch?.[1];
|
|
@@ -1255,6 +1579,10 @@ async function createApplicationCliController(args2) {
|
|
|
1255
1579
|
|
|
1256
1580
|
// src/controllers/cli/init.cli-controller.ts
|
|
1257
1581
|
async function initCliController(args2) {
|
|
1582
|
+
if (await isPlatformInitialized()) {
|
|
1583
|
+
console.error("Error: Cannot initialize a new platform \u2014 a platform is already initialized in this directory.");
|
|
1584
|
+
process.exit(1);
|
|
1585
|
+
}
|
|
1258
1586
|
const { organizationName, platformName, platformDisplayName } = args2;
|
|
1259
1587
|
if (!organizationName || !platformName || !platformDisplayName) {
|
|
1260
1588
|
console.error("Error: organizationName, platformName, and platformDisplayName are required.");
|
|
@@ -1269,6 +1597,10 @@ async function initCliController(args2) {
|
|
|
1269
1597
|
// src/controllers/cli/configure-idp.cli-controller.ts
|
|
1270
1598
|
async function configureIdpCliController(args2) {
|
|
1271
1599
|
const logger = { log: console.log };
|
|
1600
|
+
if (!await isPlatformInitialized()) {
|
|
1601
|
+
console.error("Error: Cannot configure an IDP \u2014 no platform initialized in this directory.");
|
|
1602
|
+
process.exit(1);
|
|
1603
|
+
}
|
|
1272
1604
|
const { providerType, name, issuer, clientId, clientSecret } = args2;
|
|
1273
1605
|
if (!providerType || !name || !issuer || !clientId || !clientSecret) {
|
|
1274
1606
|
logger.log("Error: Missing required arguments: providerType, name, issuer, clientId, clientSecret");
|
|
@@ -1293,12 +1625,12 @@ async function configureIdpCliController(args2) {
|
|
|
1293
1625
|
|
|
1294
1626
|
// src/utils/run-npm-script.ts
|
|
1295
1627
|
import { spawn } from "child_process";
|
|
1296
|
-
import { access } from "fs/promises";
|
|
1297
|
-
import { join as
|
|
1628
|
+
import { access as access4 } from "fs/promises";
|
|
1629
|
+
import { join as join23 } from "path";
|
|
1298
1630
|
async function runNpmScript(scriptName, logger, signal) {
|
|
1299
|
-
const localDir =
|
|
1631
|
+
const localDir = join23(process.cwd(), "local");
|
|
1300
1632
|
try {
|
|
1301
|
-
await
|
|
1633
|
+
await access4(localDir);
|
|
1302
1634
|
} catch {
|
|
1303
1635
|
logger.log(`Error: "local/" directory not found. Run "platform init" first.`);
|
|
1304
1636
|
return;
|
|
@@ -1405,11 +1737,59 @@ function createLocalScriptCliController(scriptName) {
|
|
|
1405
1737
|
};
|
|
1406
1738
|
}
|
|
1407
1739
|
|
|
1740
|
+
// src/controllers/cli/create-service-module.cli-controller.ts
|
|
1741
|
+
async function createServiceModuleCliController(args2) {
|
|
1742
|
+
if (!await isPlatformInitialized()) {
|
|
1743
|
+
console.error("Error: Cannot create a service module \u2014 no platform initialized in this directory.");
|
|
1744
|
+
process.exit(1);
|
|
1745
|
+
}
|
|
1746
|
+
const { applicationName, serviceName, serviceDisplayName } = args2;
|
|
1747
|
+
if (!applicationName || !serviceName || !serviceDisplayName) {
|
|
1748
|
+
console.error("Error: applicationName, serviceName, and serviceDisplayName are required.");
|
|
1749
|
+
process.exit(1);
|
|
1750
|
+
}
|
|
1751
|
+
if (!/^[a-z0-9-]+$/.test(applicationName)) {
|
|
1752
|
+
console.error(`Error: Application name "${applicationName}" is invalid. Use only lowercase letters, numbers, and hyphens.`);
|
|
1753
|
+
process.exit(1);
|
|
1754
|
+
}
|
|
1755
|
+
if (!/^[a-z0-9-]+$/.test(serviceName)) {
|
|
1756
|
+
console.error(`Error: Service name "${serviceName}" is invalid. Use only lowercase letters, numbers, and hyphens.`);
|
|
1757
|
+
process.exit(1);
|
|
1758
|
+
}
|
|
1759
|
+
await createServiceModuleService(
|
|
1760
|
+
{ applicationName, serviceName, serviceDisplayName },
|
|
1761
|
+
{ log: console.log }
|
|
1762
|
+
);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
// src/controllers/cli/create-ui-module.cli-controller.ts
|
|
1766
|
+
async function createUiModuleCliController(args2) {
|
|
1767
|
+
if (!await isPlatformInitialized()) {
|
|
1768
|
+
console.error("Error: Cannot create a UI module \u2014 no platform initialized in this directory.");
|
|
1769
|
+
process.exit(1);
|
|
1770
|
+
}
|
|
1771
|
+
const { applicationName, applicationDisplayName } = args2;
|
|
1772
|
+
if (!applicationName || !applicationDisplayName) {
|
|
1773
|
+
console.error("Error: applicationName and applicationDisplayName are required.");
|
|
1774
|
+
process.exit(1);
|
|
1775
|
+
}
|
|
1776
|
+
if (!/^[a-z0-9-]+$/.test(applicationName)) {
|
|
1777
|
+
console.error(`Error: Application name "${applicationName}" is invalid. Use only lowercase letters, numbers, and hyphens.`);
|
|
1778
|
+
process.exit(1);
|
|
1779
|
+
}
|
|
1780
|
+
await createUiModuleService(
|
|
1781
|
+
{ applicationName, applicationDisplayName },
|
|
1782
|
+
{ log: console.log }
|
|
1783
|
+
);
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1408
1786
|
// src/controllers/cli/registry.ts
|
|
1409
1787
|
var cliControllers = /* @__PURE__ */ new Map([
|
|
1410
1788
|
[CREATE_APPLICATION_COMMAND_NAME, createApplicationCliController],
|
|
1411
1789
|
[INIT_COMMAND_NAME, initCliController],
|
|
1412
1790
|
[CONFIGURE_IDP_COMMAND_NAME, configureIdpCliController],
|
|
1791
|
+
[CREATE_SERVICE_MODULE_COMMAND_NAME, createServiceModuleCliController],
|
|
1792
|
+
[CREATE_UI_MODULE_COMMAND_NAME, createUiModuleCliController],
|
|
1413
1793
|
[INSTALL_COMMAND_NAME, createLocalScriptCliController(INSTALL_COMMAND_NAME)],
|
|
1414
1794
|
[BUILD_COMMAND_NAME, createLocalScriptCliController(BUILD_COMMAND_NAME)],
|
|
1415
1795
|
[START_COMMAND_NAME, createLocalScriptCliController(START_COMMAND_NAME)],
|
package/package.json
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
// import './styles/splash.css';
|
|
2
|
-
|
|
3
1
|
// @ts-expect-error test
|
|
4
2
|
import styles from '!css-loader!./styles/index.css';
|
|
5
3
|
import { RootComponentProps } from '@bluealba/pae-ui-react-core';
|
|
6
|
-
import ExtensionPoints from './components/ExtensionPoints';
|
|
7
|
-
import { useDynamicStyleSheet } from './hooks/useDynamicStyleSheet';
|
|
8
|
-
|
|
9
|
-
// injectFonts();
|
|
10
4
|
|
|
11
5
|
export default function Root(_props: RootComponentProps) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<ExtensionPoints />
|
|
16
|
-
);
|
|
6
|
+
// Your customization components here.
|
|
7
|
+
return null;
|
|
17
8
|
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
|
|
3
|
-
type ExpandedLogoProps = {
|
|
4
|
-
size?: number;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const ExpandedLogo: FC<ExpandedLogoProps> = ({ size = 232 }) => {
|
|
8
|
-
return (
|
|
9
|
-
<svg width={size} height={size * 0.135} viewBox="0 0 237 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
-
<title>Tradewinds Logo Large</title>
|
|
11
|
-
<g clipPath="url(#clip0_2118_4342)">
|
|
12
|
-
<path
|
|
13
|
-
fillRule="evenodd"
|
|
14
|
-
clipRule="evenodd"
|
|
15
|
-
d="M0 29.3925C11.8178 7.00634 34.7505 22.104 47.1931 5.49658C40.1388 30.9283 14.9154 15.7525 0 29.3925Z"
|
|
16
|
-
fill="#E4E4E7"
|
|
17
|
-
/>
|
|
18
|
-
<path
|
|
19
|
-
fillRule="evenodd"
|
|
20
|
-
clipRule="evenodd"
|
|
21
|
-
d="M0 29.3925C11.8178 7.00634 34.7505 22.104 47.1931 5.49658C36.9371 26.1907 13.1974 11.3534 0 29.3925Z"
|
|
22
|
-
fill="white"
|
|
23
|
-
/>
|
|
24
|
-
<path
|
|
25
|
-
fillRule="evenodd"
|
|
26
|
-
clipRule="evenodd"
|
|
27
|
-
d="M11.1411 25.2016C19.8613 22.5725 36.7029 24.9153 41.9611 17.5747C36.2344 29.9652 24.4947 24.707 11.1411 25.2016Z"
|
|
28
|
-
fill="#E4E4E7"
|
|
29
|
-
/>
|
|
30
|
-
<path
|
|
31
|
-
fillRule="evenodd"
|
|
32
|
-
clipRule="evenodd"
|
|
33
|
-
d="M11.1411 25.2016C19.8613 22.5725 36.7029 24.9153 41.9611 17.5747C35.9481 27.6745 21.0847 23.1973 11.1411 25.2016Z"
|
|
34
|
-
fill="white"
|
|
35
|
-
/>
|
|
36
|
-
<path
|
|
37
|
-
fillRule="evenodd"
|
|
38
|
-
clipRule="evenodd"
|
|
39
|
-
d="M11.7917 16.8458C26.1605 4.71566 40.8677 9.3751 48 2.47705C39.1236 15.6224 24 11.3794 11.7917 16.8458Z"
|
|
40
|
-
fill="#E4E4E7"
|
|
41
|
-
/>
|
|
42
|
-
<path
|
|
43
|
-
fillRule="evenodd"
|
|
44
|
-
clipRule="evenodd"
|
|
45
|
-
d="M11.7917 16.8458C26.1605 4.71566 40.8677 9.3751 48 2.47705C38.2646 13.2536 25.2234 8.02152 11.7917 16.8458Z"
|
|
46
|
-
fill="white"
|
|
47
|
-
/>
|
|
48
|
-
</g>
|
|
49
|
-
<path
|
|
50
|
-
d="M69.6133 24V9.72656H64.5156V6.82031H78.168V9.72656H73.082V24H69.6133ZM82.2109 24H78.918V11.5547H81.9766V13.3242C82.5 12.4883 82.9688 11.9375 83.3828 11.6719C83.8047 11.4062 84.2812 11.2734 84.8125 11.2734C85.5625 11.2734 86.2852 11.4805 86.9805 11.8945L85.9609 14.7656C85.4062 14.4062 84.8906 14.2266 84.4141 14.2266C83.9531 14.2266 83.5625 14.3555 83.2422 14.6133C82.9219 14.8633 82.668 15.3203 82.4805 15.9844C82.3008 16.6484 82.2109 18.0391 82.2109 20.1562V24ZM90.8711 15.3516L87.8828 14.8125C88.2188 13.6094 88.7969 12.7188 89.6172 12.1406C90.4375 11.5625 91.6562 11.2734 93.2734 11.2734C94.7422 11.2734 95.8359 11.4492 96.5547 11.8008C97.2734 12.1445 97.7773 12.5859 98.0664 13.125C98.3633 13.6562 98.5117 14.6367 98.5117 16.0664L98.4766 19.9102C98.4766 21.0039 98.5273 21.8125 98.6289 22.3359C98.7383 22.8516 98.9375 23.4062 99.2266 24H95.9688C95.8828 23.7812 95.7773 23.457 95.6523 23.0273C95.5977 22.832 95.5586 22.7031 95.5352 22.6406C94.9727 23.1875 94.3711 23.5977 93.7305 23.8711C93.0898 24.1445 92.4062 24.2812 91.6797 24.2812C90.3984 24.2812 89.3867 23.9336 88.6445 23.2383C87.9102 22.543 87.543 21.6641 87.543 20.6016C87.543 19.8984 87.7109 19.2734 88.0469 18.7266C88.3828 18.1719 88.8516 17.75 89.4531 17.4609C90.0625 17.1641 90.9375 16.9062 92.0781 16.6875C93.6172 16.3984 94.6836 16.1289 95.2773 15.8789V15.5508C95.2773 14.918 95.1211 14.4688 94.8086 14.2031C94.4961 13.9297 93.9062 13.793 93.0391 13.793C92.4531 13.793 91.9961 13.9102 91.668 14.1445C91.3398 14.3711 91.0742 14.7734 90.8711 15.3516ZM95.2773 18.0234C94.8555 18.1641 94.1875 18.332 93.2734 18.5273C92.3594 18.7227 91.7617 18.9141 91.4805 19.1016C91.0508 19.4062 90.8359 19.793 90.8359 20.2617C90.8359 20.7227 91.0078 21.1211 91.3516 21.457C91.6953 21.793 92.1328 21.9609 92.6641 21.9609C93.2578 21.9609 93.8242 21.7656 94.3633 21.375C94.7617 21.0781 95.0234 20.7148 95.1484 20.2852C95.2344 20.0039 95.2773 19.4688 95.2773 18.6797V18.0234ZM113.184 24H110.125V22.1719C109.617 22.8828 109.016 23.4141 108.32 23.7656C107.633 24.1094 106.938 24.2812 106.234 24.2812C104.805 24.2812 103.578 23.707 102.555 22.5586C101.539 21.4023 101.031 19.793 101.031 17.7305C101.031 15.6211 101.527 14.0195 102.52 12.9258C103.512 11.8242 104.766 11.2734 106.281 11.2734C107.672 11.2734 108.875 11.8516 109.891 13.0078V6.82031H113.184V24ZM104.395 17.5078C104.395 18.8359 104.578 19.7969 104.945 20.3906C105.477 21.25 106.219 21.6797 107.172 21.6797C107.93 21.6797 108.574 21.3594 109.105 20.7188C109.637 20.0703 109.902 19.1055 109.902 17.8242C109.902 16.3945 109.645 15.3672 109.129 14.7422C108.613 14.1094 107.953 13.793 107.148 13.793C106.367 13.793 105.711 14.1055 105.18 14.7305C104.656 15.3477 104.395 16.2734 104.395 17.5078ZM123.648 20.0391L126.93 20.5898C126.508 21.793 125.84 22.7109 124.926 23.3438C124.02 23.9688 122.883 24.2812 121.516 24.2812C119.352 24.2812 117.75 23.5742 116.711 22.1602C115.891 21.0273 115.48 19.5977 115.48 17.8711C115.48 15.8086 116.02 14.1953 117.098 13.0312C118.176 11.8594 119.539 11.2734 121.188 11.2734C123.039 11.2734 124.5 11.8867 125.57 13.1133C126.641 14.332 127.152 16.2031 127.105 18.7266H118.855C118.879 19.7031 119.145 20.4648 119.652 21.0117C120.16 21.5508 120.793 21.8203 121.551 21.8203C122.066 21.8203 122.5 21.6797 122.852 21.3984C123.203 21.1172 123.469 20.6641 123.648 20.0391ZM123.836 16.7109C123.812 15.7578 123.566 15.0352 123.098 14.543C122.629 14.043 122.059 13.793 121.387 13.793C120.668 13.793 120.074 14.0547 119.605 14.5781C119.137 15.1016 118.906 15.8125 118.914 16.7109H123.836ZM132.121 24L128.184 11.5547H131.383L133.715 19.7109L135.859 11.5547H139.035L141.109 19.7109L143.488 11.5547H146.734L142.738 24H139.574L137.43 15.9961L135.32 24H132.121ZM148.48 9.86719V6.82031H151.773V9.86719H148.48ZM148.48 24V11.5547H151.773V24H148.48ZM166.48 24H163.188V17.6484C163.188 16.3047 163.117 15.4375 162.977 15.0469C162.836 14.6484 162.605 14.3398 162.285 14.1211C161.973 13.9023 161.594 13.793 161.148 13.793C160.578 13.793 160.066 13.9492 159.613 14.2617C159.16 14.5742 158.848 14.9883 158.676 15.5039C158.512 16.0195 158.43 16.9727 158.43 18.3633V24H155.137V11.5547H158.195V13.3828C159.281 11.9766 160.648 11.2734 162.297 11.2734C163.023 11.2734 163.688 11.4062 164.289 11.6719C164.891 11.9297 165.344 12.2617 165.648 12.668C165.961 13.0742 166.176 13.5352 166.293 14.0508C166.418 14.5664 166.48 15.3047 166.48 16.2656V24ZM181.246 24H178.188V22.1719C177.68 22.8828 177.078 23.4141 176.383 23.7656C175.695 24.1094 175 24.2812 174.297 24.2812C172.867 24.2812 171.641 23.707 170.617 22.5586C169.602 21.4023 169.094 19.793 169.094 17.7305C169.094 15.6211 169.59 14.0195 170.582 12.9258C171.574 11.8242 172.828 11.2734 174.344 11.2734C175.734 11.2734 176.938 11.8516 177.953 13.0078V6.82031H181.246V24ZM172.457 17.5078C172.457 18.8359 172.641 19.7969 173.008 20.3906C173.539 21.25 174.281 21.6797 175.234 21.6797C175.992 21.6797 176.637 21.3594 177.168 20.7188C177.699 20.0703 177.965 19.1055 177.965 17.8242C177.965 16.3945 177.707 15.3672 177.191 14.7422C176.676 14.1094 176.016 13.793 175.211 13.793C174.43 13.793 173.773 14.1055 173.242 14.7305C172.719 15.3477 172.457 16.2734 172.457 17.5078ZM183.344 20.4492L186.648 19.9453C186.789 20.5859 187.074 21.0742 187.504 21.4102C187.934 21.7383 188.535 21.9023 189.309 21.9023C190.16 21.9023 190.801 21.7461 191.23 21.4336C191.52 21.2148 191.664 20.9219 191.664 20.5547C191.664 20.3047 191.586 20.0977 191.43 19.9336C191.266 19.7773 190.898 19.6328 190.328 19.5C187.672 18.9141 185.988 18.3789 185.277 17.8945C184.293 17.2227 183.801 16.2891 183.801 15.0938C183.801 14.0156 184.227 13.1094 185.078 12.375C185.93 11.6406 187.25 11.2734 189.039 11.2734C190.742 11.2734 192.008 11.5508 192.836 12.1055C193.664 12.6602 194.234 13.4805 194.547 14.5664L191.441 15.1406C191.309 14.6562 191.055 14.2852 190.68 14.0273C190.312 13.7695 189.785 13.6406 189.098 13.6406C188.23 13.6406 187.609 13.7617 187.234 14.0039C186.984 14.1758 186.859 14.3984 186.859 14.6719C186.859 14.9062 186.969 15.1055 187.188 15.2695C187.484 15.4883 188.508 15.7969 190.258 16.1953C192.016 16.5938 193.242 17.082 193.938 17.6602C194.625 18.2461 194.969 19.0625 194.969 20.1094C194.969 21.25 194.492 22.2305 193.539 23.0508C192.586 23.8711 191.176 24.2812 189.309 24.2812C187.613 24.2812 186.27 23.9375 185.277 23.25C184.293 22.5625 183.648 21.6289 183.344 20.4492ZM214.961 20.9414V24H203.418C203.543 22.8438 203.918 21.75 204.543 20.7188C205.168 19.6797 206.402 18.3047 208.246 16.5938C209.73 15.2109 210.641 14.2734 210.977 13.7812C211.43 13.1016 211.656 12.4297 211.656 11.7656C211.656 11.0312 211.457 10.4688 211.059 10.0781C210.668 9.67969 210.125 9.48047 209.43 9.48047C208.742 9.48047 208.195 9.6875 207.789 10.1016C207.383 10.5156 207.148 11.2031 207.086 12.1641L203.805 11.8359C204 10.0234 204.613 8.72266 205.645 7.93359C206.676 7.14453 207.965 6.75 209.512 6.75C211.207 6.75 212.539 7.20703 213.508 8.12109C214.477 9.03516 214.961 10.1719 214.961 11.5312C214.961 12.3047 214.82 13.043 214.539 13.7461C214.266 14.4414 213.828 15.1719 213.227 15.9375C212.828 16.4453 212.109 17.1758 211.07 18.1289C210.031 19.082 209.371 19.7148 209.09 20.0273C208.816 20.3398 208.594 20.6445 208.422 20.9414H214.961ZM217.902 24V20.707H221.195V24H217.902ZM229.445 6.75C231.109 6.75 232.41 7.34375 233.348 8.53125C234.465 9.9375 235.023 12.2695 235.023 15.5273C235.023 18.7773 234.461 21.1133 233.336 22.5352C232.406 23.707 231.109 24.293 229.445 24.293C227.773 24.293 226.426 23.6523 225.402 22.3711C224.379 21.082 223.867 18.7891 223.867 15.4922C223.867 12.2578 224.43 9.92969 225.555 8.50781C226.484 7.33594 227.781 6.75 229.445 6.75ZM229.445 9.48047C229.047 9.48047 228.691 9.60938 228.379 9.86719C228.066 10.1172 227.824 10.5703 227.652 11.2266C227.426 12.0781 227.312 13.5117 227.312 15.5273C227.312 17.543 227.414 18.9297 227.617 19.6875C227.82 20.4375 228.074 20.9375 228.379 21.1875C228.691 21.4375 229.047 21.5625 229.445 21.5625C229.844 21.5625 230.199 21.4375 230.512 21.1875C230.824 20.9297 231.066 20.4727 231.238 19.8164C231.465 18.9727 231.578 17.543 231.578 15.5273C231.578 13.5117 231.477 12.1289 231.273 11.3789C231.07 10.6211 230.812 10.1172 230.5 9.86719C230.195 9.60938 229.844 9.48047 229.445 9.48047Z"
|
|
51
|
-
fill="white"
|
|
52
|
-
/>
|
|
53
|
-
<defs>
|
|
54
|
-
<clipPath id="clip0_2118_4342">
|
|
55
|
-
<rect width="48" height="27.0456" fill="white" transform="translate(0 2.47705)" />
|
|
56
|
-
</clipPath>
|
|
57
|
-
</defs>
|
|
58
|
-
</svg>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default ExpandedLogo;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// import { ExtendExtensionPoint } from '@bluealba/pae-ui-react-core';
|
|
2
|
-
// import ExpandedLogo from '../ExpandedNavbarLogo';
|
|
3
|
-
// import Logo from '../Logo';
|
|
4
|
-
// import SplashLogo from '../SplashLogo';
|
|
5
|
-
|
|
6
|
-
function ExtensionPoints() {
|
|
7
|
-
return (
|
|
8
|
-
<>
|
|
9
|
-
{/* <ExtendExtensionPoint module="@bluealba/pae-shell-ui" point="SplashLogo">
|
|
10
|
-
<SplashLogo />
|
|
11
|
-
</ExtendExtensionPoint>
|
|
12
|
-
|
|
13
|
-
<ExtendExtensionPoint module="@bluealba/pae-shell-ui" point="NavbarPortalLogo">
|
|
14
|
-
<Logo />
|
|
15
|
-
</ExtendExtensionPoint>
|
|
16
|
-
|
|
17
|
-
<ExtendExtensionPoint module="@bluealba/pae-shell-ui" point="ExpandedNavbarPortalLogo">
|
|
18
|
-
<ExpandedLogo />
|
|
19
|
-
</ExtendExtensionPoint>
|
|
20
|
-
|
|
21
|
-
<ExtendExtensionPoint module="@bluealba/pae-shell-ui" point="VersionsLogo">
|
|
22
|
-
<Logo size={32} />
|
|
23
|
-
</ExtendExtensionPoint> */}
|
|
24
|
-
</>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default ExtensionPoints;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
interface LogoProps {
|
|
2
|
-
size?: number;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
const Logo = ({ size = 48 }: LogoProps) => {
|
|
6
|
-
return (
|
|
7
|
-
<svg role="image" width={size} height={size} viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8
|
-
<g clipPath="url(#clip0_2030_3682)">
|
|
9
|
-
<path
|
|
10
|
-
fillRule="evenodd"
|
|
11
|
-
clipRule="evenodd"
|
|
12
|
-
d="M0.5 36.9154C12.3178 14.5293 35.2505 29.6269 47.6931 13.0195C40.6388 38.4512 15.4154 23.2755 0.5 36.9154Z"
|
|
13
|
-
fill="#E4E4E7"
|
|
14
|
-
/>
|
|
15
|
-
<path
|
|
16
|
-
fillRule="evenodd"
|
|
17
|
-
clipRule="evenodd"
|
|
18
|
-
d="M0.5 36.9154C12.3178 14.5293 35.2505 29.6269 47.6931 13.0195C37.4371 33.7137 13.6974 18.8764 0.5 36.9154Z"
|
|
19
|
-
fill="white"
|
|
20
|
-
/>
|
|
21
|
-
<path
|
|
22
|
-
fillRule="evenodd"
|
|
23
|
-
clipRule="evenodd"
|
|
24
|
-
d="M11.6411 32.7246C20.3613 30.0955 37.2029 32.4382 42.4611 25.0977C36.7344 37.4881 24.9947 32.23 11.6411 32.7246Z"
|
|
25
|
-
fill="#E4E4E7"
|
|
26
|
-
/>
|
|
27
|
-
<path
|
|
28
|
-
fillRule="evenodd"
|
|
29
|
-
clipRule="evenodd"
|
|
30
|
-
d="M11.6411 32.7246C20.3613 30.0955 37.2029 32.4382 42.4611 25.0977C36.4481 35.1974 21.5847 30.7202 11.6411 32.7246Z"
|
|
31
|
-
fill="white"
|
|
32
|
-
/>
|
|
33
|
-
<path
|
|
34
|
-
fillRule="evenodd"
|
|
35
|
-
clipRule="evenodd"
|
|
36
|
-
d="M12.2917 24.3688C26.6605 12.2386 41.3677 16.898 48.5 10C39.6236 23.1453 24.5 18.9024 12.2917 24.3688Z"
|
|
37
|
-
fill="#E4E4E7"
|
|
38
|
-
/>
|
|
39
|
-
<path
|
|
40
|
-
fillRule="evenodd"
|
|
41
|
-
clipRule="evenodd"
|
|
42
|
-
d="M12.2917 24.3688C26.6605 12.2386 41.3677 16.898 48.5 10C38.7646 20.7766 25.7234 15.5445 12.2917 24.3688Z"
|
|
43
|
-
fill="white"
|
|
44
|
-
/>
|
|
45
|
-
</g>
|
|
46
|
-
<defs>
|
|
47
|
-
<clipPath id="clip0_2030_3682">
|
|
48
|
-
<rect width="48" height="27.0456" fill="white" transform="translate(0.5 10)" />
|
|
49
|
-
</clipPath>
|
|
50
|
-
</defs>
|
|
51
|
-
</svg>
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default Logo;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const SplashLogo = () => {
|
|
2
|
-
return (
|
|
3
|
-
<svg width="267" height="150" viewBox="0 0 267 150" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<title>Splash Logo</title>
|
|
5
|
-
<g clipPath="url(#clip0_2027_7665)">
|
|
6
|
-
<path
|
|
7
|
-
fillRule="evenodd"
|
|
8
|
-
clipRule="evenodd"
|
|
9
|
-
d="M-0.000244141 149.278C65.5435 25.1203 192.733 108.855 261.742 16.7468C222.618 157.796 82.7235 73.6284 -0.000244141 149.278Z"
|
|
10
|
-
fill="#E4E4E7"
|
|
11
|
-
/>
|
|
12
|
-
<path
|
|
13
|
-
fillRule="evenodd"
|
|
14
|
-
clipRule="evenodd"
|
|
15
|
-
d="M-0.000244141 149.278C65.5435 25.1203 192.733 108.855 261.742 16.7468C204.86 131.521 73.1951 49.23 -0.000244141 149.278Z"
|
|
16
|
-
fill="white"
|
|
17
|
-
/>
|
|
18
|
-
<path
|
|
19
|
-
fillRule="evenodd"
|
|
20
|
-
clipRule="evenodd"
|
|
21
|
-
d="M61.79 126.035C110.154 111.453 203.561 124.447 232.724 83.7344C200.962 152.454 135.852 123.292 61.79 126.035Z"
|
|
22
|
-
fill="#E4E4E7"
|
|
23
|
-
/>
|
|
24
|
-
<path
|
|
25
|
-
fillRule="evenodd"
|
|
26
|
-
clipRule="evenodd"
|
|
27
|
-
d="M61.79 126.035C110.154 111.453 203.561 124.447 232.724 83.7344C199.374 139.75 116.939 114.918 61.79 126.035Z"
|
|
28
|
-
fill="white"
|
|
29
|
-
/>
|
|
30
|
-
<path
|
|
31
|
-
fillRule="evenodd"
|
|
32
|
-
clipRule="evenodd"
|
|
33
|
-
d="M65.3994 79.692C145.091 12.4158 226.66 38.2579 266.217 0C216.987 72.9066 133.109 49.3744 65.3994 79.692Z"
|
|
34
|
-
fill="#E4E4E7"
|
|
35
|
-
/>
|
|
36
|
-
<path
|
|
37
|
-
fillRule="evenodd"
|
|
38
|
-
clipRule="evenodd"
|
|
39
|
-
d="M65.3994 79.692C145.091 12.4158 226.66 38.2579 266.217 0C212.223 59.769 139.894 30.7507 65.3994 79.692Z"
|
|
40
|
-
fill="white"
|
|
41
|
-
/>
|
|
42
|
-
</g>
|
|
43
|
-
<defs>
|
|
44
|
-
<clipPath id="clip0_2027_7665">
|
|
45
|
-
<rect width="266.217" height="150" fill="white" />
|
|
46
|
-
</clipPath>
|
|
47
|
-
</defs>
|
|
48
|
-
</svg>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default SplashLogo;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useModuleConfig } from '@bluealba/pae-ui-react-core';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
|
|
4
|
-
export const useDynamicStyleSheet = (styleSheet: string): void => {
|
|
5
|
-
const { cssCustomizationLoadingDelay = 1000 } = useModuleConfig();
|
|
6
|
-
|
|
7
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: Not idempotent
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const styleElement = document.createElement('style');
|
|
10
|
-
setTimeout(() => {
|
|
11
|
-
styleElement.innerHTML = styleSheet;
|
|
12
|
-
|
|
13
|
-
document.head.append(styleElement);
|
|
14
|
-
}, cssCustomizationLoadingDelay);
|
|
15
|
-
|
|
16
|
-
return () => styleElement.remove();
|
|
17
|
-
}, [styleSheet]);
|
|
18
|
-
};
|