keycloakify 10.0.0-rc.62 → 10.0.0-rc.64
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/bin/193.index.js +552 -0
- package/bin/{991.index.js → 240.index.js} +40 -2
- package/bin/{952.index.js → 363.index.js} +702 -154
- package/bin/{214.index.js → 430.index.js} +2 -161
- package/bin/526.index.js +111 -93
- package/bin/538.index.js +37 -28
- package/bin/{98.index.js → 827.index.js} +39 -187
- package/bin/{941.index.js → 890.index.js} +159 -2
- package/bin/932.index.js +37 -66
- package/bin/97.index.js +1 -1
- package/bin/main.js +7 -7
- package/package.json +9 -9
- package/src/bin/add-story.ts +1 -1
- package/src/bin/keycloakify/buildJars/buildJar.ts +24 -27
- package/src/bin/keycloakify/buildJars/buildJars.ts +5 -5
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +33 -32
- package/src/bin/keycloakify/generateResources/generateResourcesForThemeVariant.ts +22 -26
- package/src/bin/shared/getImplementedThemeTypes.ts +23 -0
- package/src/bin/shared/getThemeSrcDirPath.ts +44 -32
- package/src/bin/shared/metaInfKeycloakThemes.ts +16 -60
- package/src/bin/start-keycloak/appBuild.ts +1 -1
- package/src/bin/start-keycloak/keycloakifyBuild.ts +3 -2
- package/src/bin/start-keycloak/start-keycloak.ts +37 -71
- package/vite-plugin/index.js +1848 -30
- package/bin/190.index.js +0 -597
@@ -2,7 +2,7 @@ import { getBuildContext } from "../shared/buildContext";
|
|
2
2
|
import { exclude } from "tsafe/exclude";
|
3
3
|
import type { CliCommandOptions as CliCommandOptions_common } from "../main";
|
4
4
|
import { promptKeycloakVersion } from "../shared/promptKeycloakVersion";
|
5
|
-
import {
|
5
|
+
import { getImplementedThemeTypes } from "../shared/getImplementedThemeTypes";
|
6
6
|
import { accountV1ThemeName, containerName } from "../shared/constants";
|
7
7
|
import { SemVer } from "../tools/SemVer";
|
8
8
|
import type { KeycloakVersionRange } from "../shared/KeycloakVersionRange";
|
@@ -91,66 +91,8 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
91
91
|
|
92
92
|
const buildContext = getBuildContext({ cliCommandOptions });
|
93
93
|
|
94
|
-
{
|
95
|
-
const { isAppBuildSuccess } = await appBuild({
|
96
|
-
buildContext
|
97
|
-
});
|
98
|
-
|
99
|
-
if (!isAppBuildSuccess) {
|
100
|
-
console.log(
|
101
|
-
chalk.red(
|
102
|
-
`App build failed, exiting. Try running 'yarn build-keycloak-theme' and see what's wrong.`
|
103
|
-
)
|
104
|
-
);
|
105
|
-
process.exit(1);
|
106
|
-
}
|
107
|
-
|
108
|
-
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
109
|
-
onlyBuildJarFileBasename: undefined,
|
110
|
-
buildContext
|
111
|
-
});
|
112
|
-
|
113
|
-
if (!isKeycloakifyBuildSuccess) {
|
114
|
-
console.log(
|
115
|
-
chalk.red(
|
116
|
-
`Keycloakify build failed, exiting. Try running 'yarn build-keycloak-theme' and see what's wrong.`
|
117
|
-
)
|
118
|
-
);
|
119
|
-
process.exit(1);
|
120
|
-
}
|
121
|
-
}
|
122
|
-
|
123
|
-
const { doesImplementAccountTheme } = await (async () => {
|
124
|
-
const latestJarFilePath = fs
|
125
|
-
.readdirSync(buildContext.keycloakifyBuildDirPath)
|
126
|
-
.filter(fileBasename => fileBasename.endsWith(".jar"))
|
127
|
-
.map(fileBasename =>
|
128
|
-
pathJoin(buildContext.keycloakifyBuildDirPath, fileBasename)
|
129
|
-
)
|
130
|
-
.sort((a, b) => fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs)[0];
|
131
|
-
|
132
|
-
assert(latestJarFilePath !== undefined);
|
133
|
-
|
134
|
-
const metaInfKeycloakThemes = await readMetaInfKeycloakThemes_fromJar({
|
135
|
-
jarFilePath: latestJarFilePath
|
136
|
-
});
|
137
|
-
|
138
|
-
const mainThemeEntry = metaInfKeycloakThemes.themes.find(
|
139
|
-
({ name }) => name === buildContext.themeNames[0]
|
140
|
-
);
|
141
|
-
|
142
|
-
assert(mainThemeEntry !== undefined);
|
143
|
-
|
144
|
-
const doesImplementAccountTheme = mainThemeEntry.types.includes("account");
|
145
|
-
|
146
|
-
return { doesImplementAccountTheme };
|
147
|
-
})();
|
148
|
-
|
149
94
|
const { keycloakVersion, keycloakMajorNumber: keycloakMajorVersionNumber } =
|
150
|
-
await (async
|
151
|
-
keycloakVersion: string;
|
152
|
-
keycloakMajorNumber: number;
|
153
|
-
}> {
|
95
|
+
await (async () => {
|
154
96
|
if (cliCommandOptions.keycloakVersion !== undefined) {
|
155
97
|
return {
|
156
98
|
keycloakVersion: cliCommandOptions.keycloakVersion,
|
@@ -173,20 +115,14 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
173
115
|
|
174
116
|
const keycloakMajorNumber = SemVer.parse(keycloakVersion).major;
|
175
117
|
|
176
|
-
if (doesImplementAccountTheme && keycloakMajorNumber === 22) {
|
177
|
-
console.log(
|
178
|
-
[
|
179
|
-
"Unfortunately, Keycloakify themes that implements an account theme do not work on Keycloak 22",
|
180
|
-
"Please select any other Keycloak version"
|
181
|
-
].join(" ")
|
182
|
-
);
|
183
|
-
return getKeycloakMajor();
|
184
|
-
}
|
185
|
-
|
186
118
|
return { keycloakVersion, keycloakMajorNumber };
|
187
119
|
})();
|
188
120
|
|
189
121
|
const keycloakVersionRange: KeycloakVersionRange = (() => {
|
122
|
+
const doesImplementAccountTheme = getImplementedThemeTypes({
|
123
|
+
projectDirPath: buildContext.projectDirPath
|
124
|
+
}).implementedThemeTypes.account;
|
125
|
+
|
190
126
|
if (doesImplementAccountTheme) {
|
191
127
|
const keycloakVersionRange = (() => {
|
192
128
|
if (keycloakMajorVersionNumber <= 21) {
|
@@ -233,6 +169,35 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
233
169
|
|
234
170
|
const { jarFileBasename } = getJarFileBasename({ keycloakVersionRange });
|
235
171
|
|
172
|
+
{
|
173
|
+
const { isAppBuildSuccess } = await appBuild({
|
174
|
+
buildContext
|
175
|
+
});
|
176
|
+
|
177
|
+
if (!isAppBuildSuccess) {
|
178
|
+
console.log(
|
179
|
+
chalk.red(
|
180
|
+
`App build failed, exiting. Try running 'npm run build-keycloak-theme' and see what's wrong.`
|
181
|
+
)
|
182
|
+
);
|
183
|
+
process.exit(1);
|
184
|
+
}
|
185
|
+
|
186
|
+
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
187
|
+
onlyBuildJarFileBasename: jarFileBasename,
|
188
|
+
buildContext
|
189
|
+
});
|
190
|
+
|
191
|
+
if (!isKeycloakifyBuildSuccess) {
|
192
|
+
console.log(
|
193
|
+
chalk.red(
|
194
|
+
`Keycloakify build failed, exiting. Try running 'npm run build-keycloak-theme' and see what's wrong.`
|
195
|
+
)
|
196
|
+
);
|
197
|
+
process.exit(1);
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
236
201
|
console.log(`Using Keycloak ${chalk.bold(jarFileBasename)}`);
|
237
202
|
|
238
203
|
const realmJsonFilePath = await (async () => {
|
@@ -421,7 +386,8 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
421
386
|
...(realmJsonFilePath === undefined ? [] : ["--import-realm"])
|
422
387
|
],
|
423
388
|
{
|
424
|
-
cwd: buildContext.keycloakifyBuildDirPath
|
389
|
+
cwd: buildContext.keycloakifyBuildDirPath,
|
390
|
+
shell: true
|
425
391
|
}
|
426
392
|
] as const;
|
427
393
|
|