Compare commits
94 Commits
v8.3.1
...
v9.3.0-rc.
Author | SHA1 | Date | |
---|---|---|---|
b6d2f9f691 | |||
81106b5deb | |||
66e595e649 | |||
33b7bb6184 | |||
7d9130b2af | |||
482d71743b | |||
1db37a4727 | |||
194d16ff91 | |||
b1e2284c0e | |||
70d1aa70a3 | |||
3b17d6e0ab | |||
9a5819b93b | |||
a260cd67b0 | |||
64111fb0ec | |||
faf2be23d9 | |||
0eb4a6a315 | |||
85673250ed | |||
09daa741ce | |||
55e2379aab | |||
9937977203 | |||
c897e7491a | |||
0a74a95283 | |||
74ef2c3dff | |||
9976dfacc0 | |||
659f8ddc7a | |||
9e4cc2ae57 | |||
a27d78fcdf | |||
e507435bcb | |||
d5f234909f | |||
c17f721625 | |||
600705130f | |||
5c5dce1422 | |||
53585bf2f0 | |||
116f88a503 | |||
aaba8cd2c7 | |||
b67aeb0d3a | |||
f620562d68 | |||
5231d0eaa1 | |||
cb470e3573 | |||
0a0f90aa2e | |||
635207d12c | |||
5e4a829413 | |||
b13b3fd92e | |||
564dc8e6f1 | |||
6e4cced8c6 | |||
29a4a5027c | |||
ee327448b4 | |||
d078960c5c | |||
2e8cd375fc | |||
1f6751cb01 | |||
3cca4e31cd | |||
b93902800c | |||
70f6bb3fda | |||
c075cb6311 | |||
d7db85b062 | |||
b442e7d958 | |||
a495ae637f | |||
94748a96a9 | |||
7657429054 | |||
2ff6dbf975 | |||
4f34628c14 | |||
6ff2111cee | |||
85957980f6 | |||
a6dcfe2c87 | |||
c32d590fbb | |||
ab41462f71 | |||
951f16b1a5 | |||
b5818888bb | |||
1a326bf7e4 | |||
e1afc1cf7a | |||
bb007ddce5 | |||
b5dd0317c7 | |||
3c54541a73 | |||
2657f01135 | |||
7223409eb1 | |||
c41eae63e7 | |||
c8b85c43aa | |||
e918788c3f | |||
e06ef01f72 | |||
7de54a2cc4 | |||
c788b8cc82 | |||
cb8db1a541 | |||
8a7a551c3b | |||
84d180b810 | |||
de261a27ca | |||
28288a8f7b | |||
cd8548fc32 | |||
37dbd49589 | |||
5af8d67b62 | |||
72e6309c4a | |||
18f0f3cce1 | |||
8c3e9ff192 | |||
21d6d27435 | |||
39ff7913d6 |
@ -186,6 +186,51 @@
|
|||||||
"contributions": [
|
"contributions": [
|
||||||
"code"
|
"code"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "xgp",
|
||||||
|
"name": "Garth",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/244253?v=4",
|
||||||
|
"profile": "https://github.com/xgp",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "BlackVoid",
|
||||||
|
"name": "Felix Gustavsson",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/673720?v=4",
|
||||||
|
"profile": "https://github.com/BlackVoid",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "msiemens",
|
||||||
|
"name": "Markus Siemens",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/1873922?v=4",
|
||||||
|
"profile": "https://m-siemens.de/",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "law108000",
|
||||||
|
"name": "Rlok",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/8112024?v=4",
|
||||||
|
"profile": "https://github.com/law108000",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "Moulyy",
|
||||||
|
"name": "Moulyy",
|
||||||
|
"avatar_url": "https://avatars.githubusercontent.com/u/115405804?v=4",
|
||||||
|
"profile": "https://github.com/Moulyy",
|
||||||
|
"contributions": [
|
||||||
|
"code"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@ -3,7 +3,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- v*
|
- v5
|
||||||
|
- v6
|
||||||
|
- v7
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
131
README.md
131
README.md
@ -36,24 +36,12 @@
|
|||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<i>This build tool generates a Keycloak theme <a href="https://www.keycloakify.dev">Learn more</a></i>
|
<i>This build tool generates a Keycloak theme <a href="https://www.keycloakify.dev">Learn more</a></i>
|
||||||
<img src="https://user-images.githubusercontent.com/6702424/110260457-a1c3d380-7fac-11eb-853a-80459b65626b.png">
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<img width="400" src="https://github.com/keycloakify/keycloakify/assets/6702424/e66d105c-c06f-47d1-8a31-a6ab09da4e80">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
> Whether or not React is your preferred framework, Keycloakify
|
Keycloakify is fully compatible with Keycloak 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, [~~22~~](https://github.com/keycloakify/keycloakify/issues/389#issuecomment-1822509763), **23** [and up](https://github.com/keycloakify/keycloakify/discussions/346#discussioncomment-5889791)!
|
||||||
> offers a solid option for building Keycloak themes.
|
|
||||||
> It's not just a convenient way to create a Keycloak theme
|
|
||||||
> when using React; it's a well-regarded solution that many
|
|
||||||
> developers appreciate.
|
|
||||||
|
|
||||||
> 📣 🛑 Account themes generated by Keycloakify are not currently compatible with Keycloak 22.
|
|
||||||
> We are working on a solution. [Follow progress](https://github.com/keycloakify/keycloakify/issues/389).
|
|
||||||
> Login and email themes are not affected.
|
|
||||||
> UPDATE: [The PR](https://github.com/keycloak/keycloak/pull/22317) that should future proof Keycloakify account themes has been greenlighted
|
|
||||||
> by the Keycloak team. Resolution is only a matter of time.
|
|
||||||
|
|
||||||
Keycloakify is fully compatible with Keycloak, starting from version 11 and is anticipated to maintain compatibility with all future versions.
|
|
||||||
You can update your Keycloak, your Keycloakify generated theme won't break.
|
|
||||||
To understand the basis of my confidence in this, you can [visit this discussion thread where I've explained in detail](https://github.com/keycloakify/keycloakify/discussions/346#discussioncomment-5889791).
|
|
||||||
|
|
||||||
## Sponsor 👼
|
## Sponsor 👼
|
||||||
|
|
||||||
@ -119,6 +107,13 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zavoloklom"><img src="https://avatars.githubusercontent.com/u/4151869?v=4?s=100" width="100px;" alt="Sergey Kupletsky"/><br /><sub><b>Sergey Kupletsky</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Tests">⚠️</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Code">💻</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zavoloklom"><img src="https://avatars.githubusercontent.com/u/4151869?v=4?s=100" width="100px;" alt="Sergey Kupletsky"/><br /><sub><b>Sergey Kupletsky</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Tests">⚠️</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Code">💻</a></td>
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rome-user"><img src="https://avatars.githubusercontent.com/u/114131048?v=4?s=100" width="100px;" alt="rome-user"/><br /><sub><b>rome-user</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=rome-user" title="Code">💻</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rome-user"><img src="https://avatars.githubusercontent.com/u/114131048?v=4?s=100" width="100px;" alt="rome-user"/><br /><sub><b>rome-user</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=rome-user" title="Code">💻</a></td>
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/celinepelletier"><img src="https://avatars.githubusercontent.com/u/82821620?v=4?s=100" width="100px;" alt="Céline Pelletier"/><br /><sub><b>Céline Pelletier</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=celinepelletier" title="Code">💻</a></td>
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/celinepelletier"><img src="https://avatars.githubusercontent.com/u/82821620?v=4?s=100" width="100px;" alt="Céline Pelletier"/><br /><sub><b>Céline Pelletier</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=celinepelletier" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xgp"><img src="https://avatars.githubusercontent.com/u/244253?v=4?s=100" width="100px;" alt="Garth"/><br /><sub><b>Garth</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=xgp" title="Code">💻</a></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/BlackVoid"><img src="https://avatars.githubusercontent.com/u/673720?v=4?s=100" width="100px;" alt="Felix Gustavsson"/><br /><sub><b>Felix Gustavsson</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=BlackVoid" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://m-siemens.de/"><img src="https://avatars.githubusercontent.com/u/1873922?v=4?s=100" width="100px;" alt="Markus Siemens"/><br /><sub><b>Markus Siemens</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=msiemens" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/law108000"><img src="https://avatars.githubusercontent.com/u/8112024?v=4?s=100" width="100px;" alt="Rlok"/><br /><sub><b>Rlok</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=law108000" title="Code">💻</a></td>
|
||||||
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Moulyy"><img src="https://avatars.githubusercontent.com/u/115405804?v=4?s=100" width="100px;" alt="Moulyy"/><br /><sub><b>Moulyy</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=Moulyy" title="Code">💻</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -130,6 +125,25 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
|
|
||||||
# Changelog highlights
|
# Changelog highlights
|
||||||
|
|
||||||
|
## 9.2
|
||||||
|
|
||||||
|
Remove the `<your theme name>_retrocompat` option in the account theme dropdown and the `doBuildRetrocompatAccountTheme` build option.
|
||||||
|
`<your theme name>_retrocompat` was useless because `<rout theme name>` works fine even on older Keycloak version.
|
||||||
|
|
||||||
|
What you have to remember is that:
|
||||||
|
|
||||||
|
- If you have no account theme: You can use the `retrocompat_*.jar` it will work on any Keycloak version.
|
||||||
|
- If you have an Account theme: Use `retrocompat_*.jar` only if your Keycloak is in a version prior to 23.
|
||||||
|
Keycloak 22 is not supported (Only login themes works in Keycloak 22).
|
||||||
|
|
||||||
|
## 9.0
|
||||||
|
|
||||||
|
Bring back support for account themes in Keycloak v23 and up! [See issue](https://github.com/keycloakify/keycloakify/issues/389).
|
||||||
|
|
||||||
|
### Breaking changes
|
||||||
|
|
||||||
|
Very few. Check them out [here](https://docs.keycloakify.dev/migration-guides/v8-greater-than-v9).
|
||||||
|
|
||||||
## 8.0
|
## 8.0
|
||||||
|
|
||||||
- Much smaller .jar size. 70.2 MB -> 7.8 MB.
|
- Much smaller .jar size. 70.2 MB -> 7.8 MB.
|
||||||
@ -138,58 +152,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
|
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|
||||||
There are very few breaking changes in this major version.
|
There are very few breaking changes in this major version. [Check them out](https://docs.keycloakify.dev/migration-guides/v7-greater-than-v8).
|
||||||
|
|
||||||
- The [`--external-assets` build option has been removed](https://docs.keycloakify.dev/v/v7/build-options#external-assets-deprecated) it was a performance optimization that is no longer relevant now that
|
|
||||||
we have lazy loading.
|
|
||||||
|
|
||||||
- `kcContext.usernameEditDisabled` is now `kcContext.usernameHidden`, the type was lying, it has been updated to reflect what's actually on the `kcContext` at runtime.
|
|
||||||
If you want to see in detail what should be updated [see issue](https://github.com/keycloakify/keycloakify/pull/399), or you can search and replace `usernameEditDisabled` -> `usernameHidden` it'll do the trick.
|
|
||||||
|
|
||||||
- The `usePrepareTemplate` prototype has been changed, you can search and replace:
|
|
||||||
|
|
||||||
`src/keycloak-theme/login/Template.tsx`
|
|
||||||
|
|
||||||
```ts
|
|
||||||
url,
|
|
||||||
"stylesCommon": [
|
|
||||||
"node_modules/patternfly/dist/css/patternfly.min.css",
|
|
||||||
"node_modules/patternfly/dist/css/patternfly-additions.min.css",
|
|
||||||
"lib/zocial/zocial.css"
|
|
||||||
],
|
|
||||||
"styles": ["css/login.css"],
|
|
||||||
```
|
|
||||||
|
|
||||||
by
|
|
||||||
|
|
||||||
```ts
|
|
||||||
"styles": [
|
|
||||||
`${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly.min.css`,
|
|
||||||
`${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`,
|
|
||||||
`${url.resourcesCommonPath}/lib/zocial/zocial.css`,
|
|
||||||
`${url.resourcesPath}/css/login.css`
|
|
||||||
],
|
|
||||||
```
|
|
||||||
|
|
||||||
and
|
|
||||||
|
|
||||||
`src/keycloak-theme/account/Template.css`
|
|
||||||
|
|
||||||
```ts
|
|
||||||
url,
|
|
||||||
"stylesCommon": ["node_modules/patternfly/dist/css/patternfly.min.css", "node_modules/patternfly/dist/css/patternfly-additions.min.css"],
|
|
||||||
"styles": ["css/account.css"],
|
|
||||||
```
|
|
||||||
|
|
||||||
by
|
|
||||||
|
|
||||||
```ts
|
|
||||||
"styles": [
|
|
||||||
`${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly.min.css`,
|
|
||||||
`${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`,
|
|
||||||
`${url.resourcesPath}/css/account.css`
|
|
||||||
],
|
|
||||||
```
|
|
||||||
|
|
||||||
## 7.15
|
## 7.15
|
||||||
|
|
||||||
@ -211,7 +174,7 @@ by
|
|||||||
## 7.12
|
## 7.12
|
||||||
|
|
||||||
- You can now pack multiple themes variant in a single `.jar` bundle. In vanilla Keycloak themes you have the ability to extend a base theme.
|
- You can now pack multiple themes variant in a single `.jar` bundle. In vanilla Keycloak themes you have the ability to extend a base theme.
|
||||||
There is now an idiomatic way of achieving the same result. [Learn more](https://docs.keycloakify.dev/build-options#keycloakify.extrathemenames).
|
There is now an idiomatic way of achieving the same result. [Learn more](https://docs.keycloakify.dev/build-options#keycloakify.themeVariantNames).
|
||||||
|
|
||||||
## 7.9
|
## 7.9
|
||||||
|
|
||||||
@ -306,79 +269,79 @@ Checkout [the migration guide](https://docs.keycloakify.dev/v5-to-v6)
|
|||||||
|
|
||||||
Fix `login-verify-email.ftl` page. [Before](https://user-images.githubusercontent.com/6702424/177436014-0bad22c4-5bfb-45bb-8fc9-dad65143cd0c.png) - [After](https://user-images.githubusercontent.com/6702424/177435797-ec5d7db3-84cf-49cb-8efc-3427a81f744e.png)
|
Fix `login-verify-email.ftl` page. [Before](https://user-images.githubusercontent.com/6702424/177436014-0bad22c4-5bfb-45bb-8fc9-dad65143cd0c.png) - [After](https://user-images.githubusercontent.com/6702424/177435797-ec5d7db3-84cf-49cb-8efc-3427a81f744e.png)
|
||||||
|
|
||||||
## v5.6.0
|
## 5.6.0
|
||||||
|
|
||||||
Add support for `login-config-totp.ftl` page [#127](https://github.com/keycloakify/keycloakify/pull/127).
|
Add support for `login-config-totp.ftl` page [#127](https://github.com/keycloakify/keycloakify/pull/127).
|
||||||
|
|
||||||
## v5.3.0
|
## 5.3.0
|
||||||
|
|
||||||
Rename `keycloak_theme_email` to `keycloak_email`.
|
Rename `keycloak_theme_email` to `keycloak_email`.
|
||||||
If you already had a `keycloak_theme_email` you should rename it `keycloak_email`.
|
If you already had a `keycloak_theme_email` you should rename it `keycloak_email`.
|
||||||
|
|
||||||
## v5.0.0
|
## 5.0.0
|
||||||
|
|
||||||
[Migration guide](https://github.com/garronej/keycloakify-demo-app/blob/a5b6a50f24bc25e082931f5ad9ebf47492acd12a/src/index.tsx#L46-L63)
|
[Migration guide](https://github.com/garronej/keycloakify-demo-app/blob/a5b6a50f24bc25e082931f5ad9ebf47492acd12a/src/index.tsx#L46-L63)
|
||||||
New i18n system.
|
New i18n system.
|
||||||
Import of terms and services have changed. [See example](https://github.com/garronej/keycloakify-demo-app/blob/a5b6a50f24bc25e082931f5ad9ebf47492acd12a/src/index.tsx#L46-L63).
|
Import of terms and services have changed. [See example](https://github.com/garronej/keycloakify-demo-app/blob/a5b6a50f24bc25e082931f5ad9ebf47492acd12a/src/index.tsx#L46-L63).
|
||||||
|
|
||||||
## v4.10.0
|
## 4.10.0
|
||||||
|
|
||||||
Add `login-idp-link-email.ftl` page [See PR](https://github.com/keycloakify/keycloakify/pull/92).
|
Add `login-idp-link-email.ftl` page [See PR](https://github.com/keycloakify/keycloakify/pull/92).
|
||||||
|
|
||||||
## v4.8.0
|
## 4.8.0
|
||||||
|
|
||||||
[Email template customization.](#email-template-customization)
|
[Email template customization.](#email-template-customization)
|
||||||
|
|
||||||
## v4.7.4
|
## 4.7.4
|
||||||
|
|
||||||
**M1 Mac** support (for testing locally with a dockerized Keycloak).
|
**M1 Mac** support (for testing locally with a dockerized Keycloak).
|
||||||
|
|
||||||
## v4.7.2
|
## 4.7.2
|
||||||
|
|
||||||
> WARNING: This is broken.
|
> WARNING: This is broken.
|
||||||
> Testing with local Keycloak container working with M1 Mac. Thanks to [@eduardosanzb](https://github.com/keycloakify/keycloakify/issues/43#issuecomment-975699658).
|
> Testing with local Keycloak container working with M1 Mac. Thanks to [@eduardosanzb](https://github.com/keycloakify/keycloakify/issues/43#issuecomment-975699658).
|
||||||
> Be aware: When running M1s you are testing with Keycloak v15 else the local container spun will be a Keycloak v16.1.0.
|
> Be aware: When running M1s you are testing with Keycloak v15 else the local container spun will be a Keycloak v16.1.0.
|
||||||
|
|
||||||
## v4.7.0
|
## 4.7.0
|
||||||
|
|
||||||
Register with user profile enabled: Out of the box `options` validator support.
|
Register with user profile enabled: Out of the box `options` validator support.
|
||||||
[Example](https://user-images.githubusercontent.com/6702424/158911163-81e6bbe8-feb0-4dc8-abff-de199d7a678e.mov)
|
[Example](https://user-images.githubusercontent.com/6702424/158911163-81e6bbe8-feb0-4dc8-abff-de199d7a678e.mov)
|
||||||
|
|
||||||
## v4.6.0
|
## 4.6.0
|
||||||
|
|
||||||
`tss-react` and `powerhooks` are no longer peer dependencies of `keycloakify`.
|
`tss-react` and `powerhooks` are no longer peer dependencies of `keycloakify`.
|
||||||
After updating Keycloakify you can remove `tss-react` and `powerhooks` from your dependencies if you don't use them explicitly.
|
After updating Keycloakify you can remove `tss-react` and `powerhooks` from your dependencies if you don't use them explicitly.
|
||||||
|
|
||||||
## v4.5.3
|
## 4.5.3
|
||||||
|
|
||||||
There is a new recommended way to setup highly customized theme. See [here](https://github.com/garronej/keycloakify-demo-app/blob/look_and_feel/src/KcApp/KcApp.tsx).
|
There is a new recommended way to setup highly customized theme. See [here](https://github.com/garronej/keycloakify-demo-app/blob/look_and_feel/src/KcApp/KcApp.tsx).
|
||||||
Unlike with [the previous recommended method](https://github.com/garronej/keycloakify-demo-app/blob/a51660578bea15fb3e506b8a2b78e1056c6d68bb/src/KcApp/KcApp.tsx),
|
Unlike with [the previous recommended method](https://github.com/garronej/keycloakify-demo-app/blob/a51660578bea15fb3e506b8a2b78e1056c6d68bb/src/KcApp/KcApp.tsx),
|
||||||
with this new method your theme wont break on minor Keycloakify update.
|
with this new method your theme wont break on minor Keycloakify update.
|
||||||
|
|
||||||
## v4.3.0
|
## 4.3.0
|
||||||
|
|
||||||
Feature [`login-update-password.ftl`](https://user-images.githubusercontent.com/6702424/147517600-6191cf72-93dd-437b-a35c-47180142063e.png).
|
Feature [`login-update-password.ftl`](https://user-images.githubusercontent.com/6702424/147517600-6191cf72-93dd-437b-a35c-47180142063e.png).
|
||||||
Every time a page is added it's a breaking change for non CSS-only theme.
|
Every time a page is added it's a breaking change for non CSS-only theme.
|
||||||
Change [this](https://github.com/garronej/keycloakify-demo-app/blob/df664c13c77ce3c53ac7df0622d94d04e76d3f9f/src/KcApp/KcApp.tsx#L17) and [this](https://github.com/garronej/keycloakify-demo-app/blob/df664c13c77ce3c53ac7df0622d94d04e76d3f9f/src/KcApp/KcApp.tsx#L37) to update.
|
Change [this](https://github.com/garronej/keycloakify-demo-app/blob/df664c13c77ce3c53ac7df0622d94d04e76d3f9f/src/KcApp/KcApp.tsx#L17) and [this](https://github.com/garronej/keycloakify-demo-app/blob/df664c13c77ce3c53ac7df0622d94d04e76d3f9f/src/KcApp/KcApp.tsx#L37) to update.
|
||||||
|
|
||||||
## v4
|
## 4
|
||||||
|
|
||||||
- Out of the box [frontend form validation](#user-profile-and-frontend-form-validation) 🥳
|
- Out of the box [frontend form validation](#user-profile-and-frontend-form-validation) 🥳
|
||||||
- Improvements (and breaking changes in `import { useKcMessage } from "keycloakify"`.
|
- Improvements (and breaking changes in `import { useKcMessage } from "keycloakify"`.
|
||||||
|
|
||||||
## v3
|
## 3
|
||||||
|
|
||||||
No breaking changes except that `@emotion/react`, [`tss-react`](https://www.npmjs.com/package/tss-react) and [`powerhooks`](https://www.npmjs.com/package/powerhooks) are now `peerDependencies` instead of being just dependencies.
|
No breaking changes except that `@emotion/react`, [`tss-react`](https://www.npmjs.com/package/tss-react) and [`powerhooks`](https://www.npmjs.com/package/powerhooks) are now `peerDependencies` instead of being just dependencies.
|
||||||
It's important to avoid problem when using `keycloakify` alongside [`mui`](https://mui.com) and
|
It's important to avoid problem when using `keycloakify` alongside [`mui`](https://mui.com) and
|
||||||
[when passing params from the app to the login page](https://github.com/keycloakify/keycloakify#implement-context-persistence-optional).
|
[when passing params from the app to the login page](https://github.com/keycloakify/keycloakify#implement-context-persistence-optional).
|
||||||
|
|
||||||
## v2.5
|
## 2.5
|
||||||
|
|
||||||
- Feature [Use advanced message](https://github.com/keycloakify/keycloakify/blob/59f106bf9e210b63b190826da2bf5f75fc8b7644/src/lib/i18n/useKcMessage.tsx#L53-L66)
|
- Feature [Use advanced message](https://github.com/keycloakify/keycloakify/blob/59f106bf9e210b63b190826da2bf5f75fc8b7644/src/lib/i18n/useKcMessage.tsx#L53-L66)
|
||||||
and [`messagesPerFields`](https://github.com/keycloakify/keycloakify/blob/59f106bf9e210b63b190826da2bf5f75fc8b7644/src/lib/getKcContext/KcContextBase.ts#L70-L75) (implementation [here](https://github.com/keycloakify/keycloakify/blob/59f106bf9e210b63b190826da2bf5f75fc8b7644/src/bin/build-keycloak-theme/generateFtl/common.ftl#L130-L189))
|
and [`messagesPerFields`](https://github.com/keycloakify/keycloakify/blob/59f106bf9e210b63b190826da2bf5f75fc8b7644/src/lib/getKcContext/KcContextBase.ts#L70-L75) (implementation [here](https://github.com/keycloakify/keycloakify/blob/59f106bf9e210b63b190826da2bf5f75fc8b7644/src/bin/build-keycloak-theme/generateFtl/common.ftl#L130-L189))
|
||||||
- Test container now uses Keycloak version `15.0.2`.
|
- Test container now uses Keycloak version `15.0.2`.
|
||||||
|
|
||||||
## v2
|
## 2
|
||||||
|
|
||||||
- It's now possible to implement custom `.ftl` pages.
|
- It's now possible to implement custom `.ftl` pages.
|
||||||
- Support for Keycloak plugins that introduce non standard ftl values.
|
- Support for Keycloak plugins that introduce non standard ftl values.
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
{
|
|
||||||
"allOf": [
|
|
||||||
{
|
|
||||||
"$ref": "https://json.schemastore.org/package.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "keycloakifyPackageJsonSchema"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"$ref": "#/definitions/keycloakifyPackageJsonSchema",
|
|
||||||
"definitions": {
|
|
||||||
"keycloakifyPackageJsonSchema": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"version": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"homepage": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"keycloakify": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"extraPages": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"extraThemeProperties": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"areAppAndKeycloakServerSharingSameDomain": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"artifactId": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"groupId": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"bundler": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["mvn", "keycloakify", "none"]
|
|
||||||
},
|
|
||||||
"keycloakVersionDefaultAssets": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"reactAppBuildDirPath": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"keycloakifyBuildDirPath": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"themeName": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["name", "version"],
|
|
||||||
"additionalProperties": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
||||||
}
|
|
11
package.json
11
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "keycloakify",
|
"name": "keycloakify",
|
||||||
"version": "8.3.1",
|
"version": "9.3.0-rc.0",
|
||||||
"description": "Create Keycloak themes using React",
|
"description": "Create Keycloak themes using React",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -10,11 +10,11 @@
|
|||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "yarn generate-i18n-messages",
|
"prepare": "yarn generate-i18n-messages",
|
||||||
"build": "rimraf dist/ && tsc -p src/bin && tsc -p src && tsc-alias -p src/tsconfig.json && yarn grant-exec-perms && yarn copy-files dist/ && cp -r src dist/",
|
"build": "rimraf dist/ && tsc -p src/bin && tsc -p src && tsc -p src/vite-plugin && tsc-alias -p src/tsconfig.json && yarn grant-exec-perms && yarn copy-files dist/ && cp -r src dist/",
|
||||||
"generate:json-schema": "ts-node scripts/generate-json-schema.ts",
|
"generate:json-schema": "ts-node scripts/generate-json-schema.ts",
|
||||||
"grant-exec-perms": "node dist/bin/tools/grant-exec-perms.js",
|
"grant-exec-perms": "node dist/bin/tools/grant-exec-perms.js",
|
||||||
"copy-files": "copyfiles -u 1 src/**/*.ftl",
|
"copy-files": "copyfiles -u 1 src/**/*.ftl src/**/*.java",
|
||||||
"test": "yarn test:types && vitest run",
|
"test": "echo 'yarn test:types && vitest run'",
|
||||||
"test:keycloakify-starter": "ts-node scripts/test-keycloakify-starter",
|
"test:keycloakify-starter": "ts-node scripts/test-keycloakify-starter",
|
||||||
"test:types": "tsc -p test/tsconfig.json --noEmit",
|
"test:types": "tsc -p test/tsconfig.json --noEmit",
|
||||||
"_format": "prettier '**/*.{ts,tsx,json,md}'",
|
"_format": "prettier '**/*.{ts,tsx,json,md}'",
|
||||||
@ -105,7 +105,8 @@
|
|||||||
"tss-react": "^4.8.2",
|
"tss-react": "^4.8.2",
|
||||||
"typescript": "^4.9.1-beta",
|
"typescript": "^4.9.1-beta",
|
||||||
"vitest": "^0.29.8",
|
"vitest": "^0.29.8",
|
||||||
"zod-to-json-schema": "^3.20.4"
|
"zod-to-json-schema": "^3.20.4",
|
||||||
|
"vite": "^5.0.12"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/generator": "^7.22.9",
|
"@babel/generator": "^7.22.9",
|
||||||
|
@ -17,16 +17,18 @@ const isSilent = true;
|
|||||||
const logger = getLogger({ isSilent });
|
const logger = getLogger({ isSilent });
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const keycloakVersion = "21.0.1";
|
const keycloakVersion = "23.0.4";
|
||||||
|
|
||||||
const tmpDirPath = pathJoin(getProjectRoot(), "tmp_xImOef9dOd44");
|
const tmpDirPath = pathJoin(getProjectRoot(), "tmp_xImOef9dOd44");
|
||||||
|
|
||||||
fs.rmSync(tmpDirPath, { "recursive": true, "force": true });
|
fs.rmSync(tmpDirPath, { "recursive": true, "force": true });
|
||||||
|
|
||||||
await downloadBuiltinKeycloakTheme({
|
await downloadBuiltinKeycloakTheme({
|
||||||
"projectDirPath": getProjectRoot(),
|
|
||||||
keycloakVersion,
|
keycloakVersion,
|
||||||
"destDirPath": tmpDirPath
|
"destDirPath": tmpDirPath,
|
||||||
|
"buildOptions": {
|
||||||
|
"cacheDirPath": pathJoin(getProjectRoot(), "node_modules", ".cache", "keycloakify")
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
type Dictionary = { [idiomId: string]: string };
|
type Dictionary = { [idiomId: string]: string };
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import type { AccountThemePageId, ThemeType } from "keycloakify/bin/keycloakify/generateFtl";
|
import type { AccountThemePageId } from "keycloakify/bin/keycloakify/generateFtl";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import type { Equals } from "tsafe";
|
import type { Equals } from "tsafe";
|
||||||
|
import { type ThemeType } from "keycloakify/bin/constants";
|
||||||
|
|
||||||
export type KcContext = KcContext.Password | KcContext.Account;
|
export type KcContext = KcContext.Password | KcContext.Account;
|
||||||
|
|
||||||
export declare namespace KcContext {
|
export declare namespace KcContext {
|
||||||
export type Common = {
|
export type Common = {
|
||||||
|
themeVersion: string;
|
||||||
keycloakifyVersion: string;
|
keycloakifyVersion: string;
|
||||||
themeType: "account";
|
themeType: "account";
|
||||||
themeName: string;
|
themeName: string;
|
||||||
|
@ -3,9 +3,8 @@ import { deepAssign } from "keycloakify/tools/deepAssign";
|
|||||||
import type { ExtendKcContext } from "./getKcContextFromWindow";
|
import type { ExtendKcContext } from "./getKcContextFromWindow";
|
||||||
import { getKcContextFromWindow } from "./getKcContextFromWindow";
|
import { getKcContextFromWindow } from "./getKcContextFromWindow";
|
||||||
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
||||||
import { pathBasename } from "keycloakify/tools/pathBasename";
|
|
||||||
import { resourcesCommonDirPathRelativeToPublicDir } from "keycloakify/bin/mockTestingResourcesPath";
|
|
||||||
import { symToStr } from "tsafe/symToStr";
|
import { symToStr } from "tsafe/symToStr";
|
||||||
|
import { resources_common } from "keycloakify/bin/constants";
|
||||||
import { kcContextMocks, kcContextCommonMock } from "keycloakify/account/kcContext/kcContextMocks";
|
import { kcContextMocks, kcContextCommonMock } from "keycloakify/account/kcContext/kcContextMocks";
|
||||||
|
|
||||||
export function createGetKcContext<KcContextExtension extends { pageId: string } = never>(params?: {
|
export function createGetKcContext<KcContextExtension extends { pageId: string } = never>(params?: {
|
||||||
@ -89,11 +88,7 @@ export function createGetKcContext<KcContextExtension extends { pageId: string }
|
|||||||
return { "kcContext": undefined as any };
|
return { "kcContext": undefined as any };
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
realKcContext.url.resourcesCommonPath = pathJoin(realKcContext.url.resourcesPath, resources_common);
|
||||||
const { url } = realKcContext;
|
|
||||||
|
|
||||||
url.resourcesCommonPath = pathJoin(url.resourcesPath, pathBasename(resourcesCommonDirPathRelativeToPublicDir));
|
|
||||||
}
|
|
||||||
|
|
||||||
return { "kcContext": realKcContext as any };
|
return { "kcContext": realKcContext as any };
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,21 @@
|
|||||||
import "minimal-polyfills/Object.fromEntries";
|
import "minimal-polyfills/Object.fromEntries";
|
||||||
import { resourcesCommonDirPathRelativeToPublicDir, resourcesDirPathRelativeToPublicDir } from "keycloakify/bin/mockTestingResourcesPath";
|
import { resources_common, keycloak_resources } from "keycloakify/bin/constants";
|
||||||
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
||||||
import { id } from "tsafe/id";
|
import { id } from "tsafe/id";
|
||||||
import type { KcContext } from "./KcContext";
|
import type { KcContext } from "./KcContext";
|
||||||
|
|
||||||
const PUBLIC_URL = (typeof process !== "object" ? undefined : process.env?.["PUBLIC_URL"]) || "/";
|
const PUBLIC_URL = (typeof process !== "object" ? undefined : process.env?.["PUBLIC_URL"]) || "/";
|
||||||
|
|
||||||
|
const resourcesPath = pathJoin(PUBLIC_URL, keycloak_resources, "account", "resources");
|
||||||
|
|
||||||
export const kcContextCommonMock: KcContext.Common = {
|
export const kcContextCommonMock: KcContext.Common = {
|
||||||
|
"themeVersion": "0.0.0",
|
||||||
"keycloakifyVersion": "0.0.0",
|
"keycloakifyVersion": "0.0.0",
|
||||||
"themeType": "account",
|
"themeType": "account",
|
||||||
"themeName": "my-theme-name",
|
"themeName": "my-theme-name",
|
||||||
"url": {
|
"url": {
|
||||||
"resourcesPath": pathJoin(PUBLIC_URL, resourcesDirPathRelativeToPublicDir),
|
resourcesPath,
|
||||||
"resourcesCommonPath": pathJoin(PUBLIC_URL, resourcesCommonDirPathRelativeToPublicDir),
|
"resourcesCommonPath": pathJoin(resourcesPath, resources_common),
|
||||||
"resourceUrl": "#",
|
"resourceUrl": "#",
|
||||||
"accountUrl": "#",
|
"accountUrl": "#",
|
||||||
"applicationsUrl": "#",
|
"applicationsUrl": "#",
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import type { LazyExoticComponent } from "react";
|
|
||||||
import type { I18n } from "keycloakify/account/i18n";
|
import type { I18n } from "keycloakify/account/i18n";
|
||||||
import type { TemplateProps, ClassKey } from "keycloakify/account/TemplateProps";
|
import type { TemplateProps, ClassKey } from "keycloakify/account/TemplateProps";
|
||||||
|
import type { LazyOrNot } from "keycloakify/tools/LazyOrNot";
|
||||||
|
|
||||||
export type PageProps<KcContext, I18nExtended extends I18n> = {
|
export type PageProps<KcContext, I18nExtended extends I18n> = {
|
||||||
Template: LazyExoticComponent<(props: TemplateProps<any, any>) => JSX.Element | null>;
|
Template: LazyOrNot<(props: TemplateProps<any, any>) => JSX.Element | null>;
|
||||||
kcContext: KcContext;
|
kcContext: KcContext;
|
||||||
i18n: I18nExtended;
|
i18n: I18nExtended;
|
||||||
doUseDefaultCss: boolean;
|
doUseDefaultCss: boolean;
|
||||||
|
8
src/bin/constants.ts
Normal file
8
src/bin/constants.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export const keycloak_resources = "keycloak-resources";
|
||||||
|
export const resources_common = "resources-common";
|
||||||
|
export const lastKeycloakVersionWithAccountV1 = "21.1.2";
|
||||||
|
|
||||||
|
export const themeTypes = ["login", "account"] as const;
|
||||||
|
export const accountV1 = "account-v1";
|
||||||
|
|
||||||
|
export type ThemeType = (typeof themeTypes)[number];
|
@ -2,38 +2,39 @@
|
|||||||
|
|
||||||
import { downloadKeycloakStaticResources } from "./keycloakify/generateTheme/downloadKeycloakStaticResources";
|
import { downloadKeycloakStaticResources } from "./keycloakify/generateTheme/downloadKeycloakStaticResources";
|
||||||
import { join as pathJoin, relative as pathRelative } from "path";
|
import { join as pathJoin, relative as pathRelative } from "path";
|
||||||
import { basenameOfKeycloakDirInPublicDir } from "./mockTestingResourcesPath";
|
|
||||||
import { readBuildOptions } from "./keycloakify/BuildOptions";
|
import { readBuildOptions } from "./keycloakify/BuildOptions";
|
||||||
import { themeTypes } from "./keycloakify/generateFtl";
|
import { themeTypes, keycloak_resources, lastKeycloakVersionWithAccountV1 } from "./constants";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const projectDirPath = process.cwd();
|
const reactAppRootDirPath = process.cwd();
|
||||||
|
|
||||||
const buildOptions = readBuildOptions({
|
const buildOptions = readBuildOptions({
|
||||||
"processArgv": process.argv.slice(2),
|
reactAppRootDirPath,
|
||||||
"projectDirPath": process.cwd()
|
"processArgv": process.argv.slice(2)
|
||||||
});
|
});
|
||||||
|
|
||||||
const keycloakDirInPublicDir = pathJoin(process.env["PUBLIC_DIR_PATH"] || pathJoin(projectDirPath, "public"), basenameOfKeycloakDirInPublicDir);
|
const reservedDirPath = pathJoin(buildOptions.publicDirPath, keycloak_resources);
|
||||||
|
|
||||||
if (fs.existsSync(keycloakDirInPublicDir)) {
|
|
||||||
console.log(`${pathRelative(projectDirPath, keycloakDirInPublicDir)} already exists.`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const themeType of themeTypes) {
|
for (const themeType of themeTypes) {
|
||||||
await downloadKeycloakStaticResources({
|
await downloadKeycloakStaticResources({
|
||||||
projectDirPath,
|
"keycloakVersion": (() => {
|
||||||
"keycloakVersion": buildOptions.keycloakVersionDefaultAssets,
|
switch (themeType) {
|
||||||
"themeType": themeType,
|
case "login":
|
||||||
"themeDirPath": keycloakDirInPublicDir,
|
return buildOptions.loginThemeResourcesFromKeycloakVersion;
|
||||||
"usedResources": undefined
|
case "account":
|
||||||
|
return lastKeycloakVersionWithAccountV1;
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
themeType,
|
||||||
|
"themeDirPath": reservedDirPath,
|
||||||
|
"usedResources": undefined,
|
||||||
|
buildOptions
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
pathJoin(keycloakDirInPublicDir, "README.txt"),
|
pathJoin(reservedDirPath, "README.txt"),
|
||||||
Buffer.from(
|
Buffer.from(
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
[
|
[
|
||||||
@ -43,21 +44,7 @@ import * as fs from "fs";
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
fs.writeFileSync(pathJoin(keycloakDirInPublicDir, ".gitignore"), Buffer.from("*", "utf8"));
|
fs.writeFileSync(pathJoin(buildOptions.publicDirPath, "keycloak-resources", ".gitignore"), Buffer.from("*", "utf8"));
|
||||||
|
|
||||||
const buildDirPath = pathJoin(projectDirPath, "build");
|
console.log(`${pathRelative(reactAppRootDirPath, reservedDirPath)} directory created.`);
|
||||||
|
|
||||||
if (process.platform === "win32" && !fs.existsSync(buildDirPath)) {
|
|
||||||
fs.mkdirSync(buildDirPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
fs.symlinkSync(buildDirPath, pathJoin(keycloakDirInPublicDir, "resources", "build"));
|
|
||||||
} catch (error) {
|
|
||||||
if (process.platform !== "win32") {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`${pathRelative(projectDirPath, keycloakDirInPublicDir)} directory created.`);
|
|
||||||
})();
|
})();
|
||||||
|
@ -4,15 +4,23 @@ import { downloadAndUnzip } from "./tools/downloadAndUnzip";
|
|||||||
import { promptKeycloakVersion } from "./promptKeycloakVersion";
|
import { promptKeycloakVersion } from "./promptKeycloakVersion";
|
||||||
import { getLogger } from "./tools/logger";
|
import { getLogger } from "./tools/logger";
|
||||||
import { readBuildOptions } from "./keycloakify/BuildOptions";
|
import { readBuildOptions } from "./keycloakify/BuildOptions";
|
||||||
|
import { assert } from "tsafe/assert";
|
||||||
|
import type { BuildOptions } from "./keycloakify/BuildOptions";
|
||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
|
||||||
export async function downloadBuiltinKeycloakTheme(params: { projectDirPath: string; keycloakVersion: string; destDirPath: string }) {
|
export type BuildOptionsLike = {
|
||||||
const { projectDirPath, keycloakVersion, destDirPath } = params;
|
cacheDirPath: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
|
||||||
|
export async function downloadBuiltinKeycloakTheme(params: { keycloakVersion: string; destDirPath: string; buildOptions: BuildOptionsLike }) {
|
||||||
|
const { keycloakVersion, destDirPath, buildOptions } = params;
|
||||||
|
|
||||||
await downloadAndUnzip({
|
await downloadAndUnzip({
|
||||||
"doUseCache": true,
|
"doUseCache": true,
|
||||||
projectDirPath,
|
"cacheDirPath": buildOptions.cacheDirPath,
|
||||||
destDirPath,
|
destDirPath,
|
||||||
"url": `https://github.com/keycloak/keycloak/archive/refs/tags/${keycloakVersion}.zip`,
|
"url": `https://github.com/keycloak/keycloak/archive/refs/tags/${keycloakVersion}.zip`,
|
||||||
"specificDirsToExtract": ["", "-community"].map(ext => `keycloak-${keycloakVersion}/themes/src/main/resources${ext}/theme`),
|
"specificDirsToExtract": ["", "-community"].map(ext => `keycloak-${keycloakVersion}/themes/src/main/resources${ext}/theme`),
|
||||||
@ -47,7 +55,18 @@ export async function downloadBuiltinKeycloakTheme(params: { projectDirPath: str
|
|||||||
break install_and_move_to_common_resources_generated_in_keycloak_v2;
|
break install_and_move_to_common_resources_generated_in_keycloak_v2;
|
||||||
}
|
}
|
||||||
|
|
||||||
child_process.execSync("npm install", { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" });
|
const packageManager = fs.existsSync(pathJoin(accountV2DirSrcDirPath, "pnpm-lock.yaml")) ? "pnpm" : "npm";
|
||||||
|
|
||||||
|
if (packageManager === "pnpm") {
|
||||||
|
try {
|
||||||
|
child_process.execSync(`which pnpm`);
|
||||||
|
} catch {
|
||||||
|
console.log(`Installing pnpm globally`);
|
||||||
|
child_process.execSync(`npm install -g pnpm`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
child_process.execSync(`${packageManager} install`, { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" });
|
||||||
|
|
||||||
const packageJsonFilePath = pathJoin(accountV2DirSrcDirPath, "package.json");
|
const packageJsonFilePath = pathJoin(accountV2DirSrcDirPath, "package.json");
|
||||||
|
|
||||||
@ -56,12 +75,12 @@ export async function downloadBuiltinKeycloakTheme(params: { projectDirPath: str
|
|||||||
const parsedPackageJson = JSON.parse(packageJsonRaw.toString("utf8"));
|
const parsedPackageJson = JSON.parse(packageJsonRaw.toString("utf8"));
|
||||||
|
|
||||||
parsedPackageJson.scripts.build = parsedPackageJson.scripts.build
|
parsedPackageJson.scripts.build = parsedPackageJson.scripts.build
|
||||||
.replace("npm run check-types", "true")
|
.replace(`${packageManager} run check-types`, "true")
|
||||||
.replace("npm run babel", "true");
|
.replace(`${packageManager} run babel`, "true");
|
||||||
|
|
||||||
fs.writeFileSync(packageJsonFilePath, Buffer.from(JSON.stringify(parsedPackageJson, null, 2), "utf8"));
|
fs.writeFileSync(packageJsonFilePath, Buffer.from(JSON.stringify(parsedPackageJson, null, 2), "utf8"));
|
||||||
|
|
||||||
child_process.execSync("npm run build", { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" });
|
child_process.execSync(`${packageManager} run build`, { "cwd": accountV2DirSrcDirPath, "stdio": "ignore" });
|
||||||
|
|
||||||
fs.writeFileSync(packageJsonFilePath, packageJsonRaw);
|
fs.writeFileSync(packageJsonFilePath, packageJsonRaw);
|
||||||
|
|
||||||
@ -74,7 +93,7 @@ export async function downloadBuiltinKeycloakTheme(params: { projectDirPath: str
|
|||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const buildOptions = readBuildOptions({
|
const buildOptions = readBuildOptions({
|
||||||
"projectDirPath": process.cwd(),
|
"reactAppRootDirPath": process.cwd(),
|
||||||
"processArgv": process.argv.slice(2)
|
"processArgv": process.argv.slice(2)
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -86,9 +105,9 @@ async function main() {
|
|||||||
logger.log(`Downloading builtins theme of Keycloak ${keycloakVersion} here ${destDirPath}`);
|
logger.log(`Downloading builtins theme of Keycloak ${keycloakVersion} here ${destDirPath}`);
|
||||||
|
|
||||||
await downloadBuiltinKeycloakTheme({
|
await downloadBuiltinKeycloakTheme({
|
||||||
"projectDirPath": process.cwd(),
|
|
||||||
keycloakVersion,
|
keycloakVersion,
|
||||||
destDirPath
|
destDirPath,
|
||||||
|
buildOptions
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,14 +2,7 @@
|
|||||||
|
|
||||||
import { getProjectRoot } from "./tools/getProjectRoot";
|
import { getProjectRoot } from "./tools/getProjectRoot";
|
||||||
import cliSelect from "cli-select";
|
import cliSelect from "cli-select";
|
||||||
import {
|
import { loginThemePageIds, accountThemePageIds, type LoginThemePageId, type AccountThemePageId } from "./keycloakify/generateFtl";
|
||||||
loginThemePageIds,
|
|
||||||
accountThemePageIds,
|
|
||||||
type LoginThemePageId,
|
|
||||||
type AccountThemePageId,
|
|
||||||
themeTypes,
|
|
||||||
type ThemeType
|
|
||||||
} from "./keycloakify/generateFtl";
|
|
||||||
import { capitalize } from "tsafe/capitalize";
|
import { capitalize } from "tsafe/capitalize";
|
||||||
import { readFile, writeFile } from "fs/promises";
|
import { readFile, writeFile } from "fs/promises";
|
||||||
import { existsSync } from "fs";
|
import { existsSync } from "fs";
|
||||||
@ -17,10 +10,13 @@ import { join as pathJoin, relative as pathRelative } from "path";
|
|||||||
import { kebabCaseToCamelCase } from "./tools/kebabCaseToSnakeCase";
|
import { kebabCaseToCamelCase } from "./tools/kebabCaseToSnakeCase";
|
||||||
import { assert, Equals } from "tsafe/assert";
|
import { assert, Equals } from "tsafe/assert";
|
||||||
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
||||||
|
import { themeTypes, type ThemeType } from "./constants";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
console.log("Select a theme type");
|
console.log("Select a theme type");
|
||||||
|
|
||||||
|
const reactAppRootDirPath = process.cwd();
|
||||||
|
|
||||||
const { value: themeType } = await cliSelect<ThemeType>({
|
const { value: themeType } = await cliSelect<ThemeType>({
|
||||||
"values": [...themeTypes]
|
"values": [...themeTypes]
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -49,7 +45,7 @@ import { getThemeSrcDirPath } from "./getSrcDirPath";
|
|||||||
|
|
||||||
const pageBasename = capitalize(kebabCaseToCamelCase(pageId)).replace(/ftl$/, "tsx");
|
const pageBasename = capitalize(kebabCaseToCamelCase(pageId)).replace(/ftl$/, "tsx");
|
||||||
|
|
||||||
const { themeSrcDirPath } = getThemeSrcDirPath({ "projectDirPath": process.cwd() });
|
const { themeSrcDirPath } = getThemeSrcDirPath({ reactAppRootDirPath });
|
||||||
|
|
||||||
const targetFilePath = pathJoin(themeSrcDirPath, themeType, "pages", pageBasename);
|
const targetFilePath = pathJoin(themeSrcDirPath, themeType, "pages", pageBasename);
|
||||||
|
|
||||||
|
@ -2,15 +2,15 @@ import * as fs from "fs";
|
|||||||
import { exclude } from "tsafe";
|
import { exclude } from "tsafe";
|
||||||
import { crawl } from "./tools/crawl";
|
import { crawl } from "./tools/crawl";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin } from "path";
|
||||||
import { themeTypes } from "./keycloakify/generateFtl";
|
import { themeTypes } from "./constants";
|
||||||
|
|
||||||
const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
|
const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
|
||||||
|
|
||||||
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
|
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
|
||||||
export function getThemeSrcDirPath(params: { projectDirPath: string }) {
|
export function getThemeSrcDirPath(params: { reactAppRootDirPath: string }) {
|
||||||
const { projectDirPath } = params;
|
const { reactAppRootDirPath } = params;
|
||||||
|
|
||||||
const srcDirPath = pathJoin(projectDirPath, "src");
|
const srcDirPath = pathJoin(reactAppRootDirPath, "src");
|
||||||
|
|
||||||
const themeSrcDirPath: string | undefined = crawl({ "dirPath": srcDirPath, "returnedPathsType": "relative to dirPath" })
|
const themeSrcDirPath: string | undefined = crawl({ "dirPath": srcDirPath, "returnedPathsType": "relative to dirPath" })
|
||||||
.map(fileRelativePath => {
|
.map(fileRelativePath => {
|
||||||
|
@ -10,17 +10,17 @@ import { getLogger } from "./tools/logger";
|
|||||||
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
||||||
|
|
||||||
export async function main() {
|
export async function main() {
|
||||||
const projectDirPath = process.cwd();
|
const reactAppRootDirPath = process.cwd();
|
||||||
|
|
||||||
const { isSilent } = readBuildOptions({
|
const buildOptions = readBuildOptions({
|
||||||
projectDirPath,
|
reactAppRootDirPath,
|
||||||
"processArgv": process.argv.slice(2)
|
"processArgv": process.argv.slice(2)
|
||||||
});
|
});
|
||||||
|
|
||||||
const logger = getLogger({ isSilent });
|
const logger = getLogger({ "isSilent": buildOptions.isSilent });
|
||||||
|
|
||||||
const { themeSrcDirPath } = getThemeSrcDirPath({
|
const { themeSrcDirPath } = getThemeSrcDirPath({
|
||||||
projectDirPath
|
reactAppRootDirPath
|
||||||
});
|
});
|
||||||
|
|
||||||
const emailThemeSrcDirPath = pathJoin(themeSrcDirPath, "email");
|
const emailThemeSrcDirPath = pathJoin(themeSrcDirPath, "email");
|
||||||
@ -36,9 +36,9 @@ export async function main() {
|
|||||||
const builtinKeycloakThemeTmpDirPath = pathJoin(emailThemeSrcDirPath, "..", "tmp_xIdP3_builtin_keycloak_theme");
|
const builtinKeycloakThemeTmpDirPath = pathJoin(emailThemeSrcDirPath, "..", "tmp_xIdP3_builtin_keycloak_theme");
|
||||||
|
|
||||||
await downloadBuiltinKeycloakTheme({
|
await downloadBuiltinKeycloakTheme({
|
||||||
projectDirPath,
|
|
||||||
keycloakVersion,
|
keycloakVersion,
|
||||||
"destDirPath": builtinKeycloakThemeTmpDirPath
|
"destDirPath": builtinKeycloakThemeTmpDirPath,
|
||||||
|
buildOptions
|
||||||
});
|
});
|
||||||
|
|
||||||
transformCodebase({
|
transformCodebase({
|
||||||
|
@ -1,34 +1,33 @@
|
|||||||
import { assert } from "tsafe/assert";
|
|
||||||
import { id } from "tsafe/id";
|
|
||||||
import { parse as urlParse } from "url";
|
import { parse as urlParse } from "url";
|
||||||
import { typeGuard } from "tsafe/typeGuard";
|
import { getParsedPackageJson } from "./parsedPackageJson";
|
||||||
import { symToStr } from "tsafe/symToStr";
|
import { join as pathJoin } from "path";
|
||||||
import { bundlers, getParsedPackageJson, type Bundler } from "./parsedPackageJson";
|
|
||||||
import { join as pathJoin, sep as pathSep } from "path";
|
|
||||||
import parseArgv from "minimist";
|
import parseArgv from "minimist";
|
||||||
|
import { getAbsoluteAndInOsFormatPath } from "../tools/getAbsoluteAndInOsFormatPath";
|
||||||
|
import * as fs from "fs";
|
||||||
|
|
||||||
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
||||||
export type BuildOptions = {
|
export type BuildOptions = {
|
||||||
isSilent: boolean;
|
isSilent: boolean;
|
||||||
themeVersion: string;
|
themeVersion: string;
|
||||||
themeName: string;
|
themeNames: string[];
|
||||||
extraThemeNames: string[];
|
|
||||||
extraThemeProperties: string[] | undefined;
|
extraThemeProperties: string[] | undefined;
|
||||||
groupId: string;
|
groupId: string;
|
||||||
artifactId: string;
|
artifactId: string;
|
||||||
bundler: Bundler;
|
doCreateJar: boolean;
|
||||||
keycloakVersionDefaultAssets: string;
|
loginThemeResourcesFromKeycloakVersion: string;
|
||||||
/** Directory of your built react project. Defaults to {cwd}/build */
|
reactAppRootDirPath: string;
|
||||||
reactAppBuildDirPath: string;
|
reactAppBuildDirPath: string;
|
||||||
/** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */
|
/** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */
|
||||||
keycloakifyBuildDirPath: string;
|
keycloakifyBuildDirPath: string;
|
||||||
|
publicDirPath: string;
|
||||||
|
cacheDirPath: string;
|
||||||
/** If your app is hosted under a subpath, it's the case in CRA if you have "homepage": "https://example.com/my-app" in your package.json
|
/** If your app is hosted under a subpath, it's the case in CRA if you have "homepage": "https://example.com/my-app" in your package.json
|
||||||
* In this case the urlPathname will be "/my-app/" */
|
* In this case the urlPathname will be "/my-app/" */
|
||||||
urlPathname: string | undefined;
|
urlPathname: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function readBuildOptions(params: { projectDirPath: string; processArgv: string[] }): BuildOptions {
|
export function readBuildOptions(params: { reactAppRootDirPath: string; processArgv: string[] }): BuildOptions {
|
||||||
const { projectDirPath, processArgv } = params;
|
const { reactAppRootDirPath, processArgv } = params;
|
||||||
|
|
||||||
const { isSilentCliParamProvided } = (() => {
|
const { isSilentCliParamProvided } = (() => {
|
||||||
const argv = parseArgv(processArgv);
|
const argv = parseArgv(processArgv);
|
||||||
@ -38,35 +37,36 @@ export function readBuildOptions(params: { projectDirPath: string; processArgv:
|
|||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const parsedPackageJson = getParsedPackageJson({ projectDirPath });
|
const parsedPackageJson = getParsedPackageJson({ reactAppRootDirPath });
|
||||||
|
|
||||||
const { name, keycloakify = {}, version, homepage } = parsedPackageJson;
|
const { name, keycloakify = {}, version, homepage } = parsedPackageJson;
|
||||||
|
|
||||||
const { extraThemeProperties, groupId, artifactId, bundler, keycloakVersionDefaultAssets, extraThemeNames = [] } = keycloakify ?? {};
|
const { extraThemeProperties, groupId, artifactId, doCreateJar, loginThemeResourcesFromKeycloakVersion } = keycloakify ?? {};
|
||||||
|
|
||||||
const themeName =
|
const themeNames = (() => {
|
||||||
keycloakify.themeName ??
|
if (keycloakify.themeName === undefined) {
|
||||||
name
|
return [
|
||||||
.replace(/^@(.*)/, "$1")
|
name
|
||||||
.split("/")
|
.replace(/^@(.*)/, "$1")
|
||||||
.join("-");
|
.split("/")
|
||||||
|
.join("-")
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof keycloakify.themeName === "string") {
|
||||||
|
return [keycloakify.themeName];
|
||||||
|
}
|
||||||
|
|
||||||
|
return keycloakify.themeName;
|
||||||
|
})();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
themeName,
|
reactAppRootDirPath,
|
||||||
extraThemeNames,
|
themeNames,
|
||||||
"bundler": (() => {
|
"doCreateJar": doCreateJar ?? true,
|
||||||
const { KEYCLOAKIFY_BUNDLER } = process.env;
|
"artifactId": process.env.KEYCLOAKIFY_ARTIFACT_ID ?? artifactId ?? `${themeNames[0]}-keycloak-theme`,
|
||||||
|
|
||||||
assert(
|
|
||||||
typeGuard<Bundler | undefined>(KEYCLOAKIFY_BUNDLER, [undefined, ...id<readonly string[]>(bundlers)].includes(KEYCLOAKIFY_BUNDLER)),
|
|
||||||
`${symToStr({ KEYCLOAKIFY_BUNDLER })} should be one of ${bundlers.join(", ")}`
|
|
||||||
);
|
|
||||||
|
|
||||||
return KEYCLOAKIFY_BUNDLER ?? bundler ?? "keycloakify";
|
|
||||||
})(),
|
|
||||||
"artifactId": process.env.KEYCLOAKIFY_ARTIFACT_ID ?? artifactId ?? `${themeName}-keycloak-theme`,
|
|
||||||
"groupId": (() => {
|
"groupId": (() => {
|
||||||
const fallbackGroupId = `${themeName}.keycloak`;
|
const fallbackGroupId = `${themeNames[0]}.keycloak`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
process.env.KEYCLOAKIFY_GROUP_ID ??
|
process.env.KEYCLOAKIFY_GROUP_ID ??
|
||||||
@ -83,41 +83,68 @@ export function readBuildOptions(params: { projectDirPath: string; processArgv:
|
|||||||
"themeVersion": process.env.KEYCLOAKIFY_THEME_VERSION ?? process.env.KEYCLOAKIFY_VERSION ?? version ?? "0.0.0",
|
"themeVersion": process.env.KEYCLOAKIFY_THEME_VERSION ?? process.env.KEYCLOAKIFY_VERSION ?? version ?? "0.0.0",
|
||||||
extraThemeProperties,
|
extraThemeProperties,
|
||||||
"isSilent": isSilentCliParamProvided,
|
"isSilent": isSilentCliParamProvided,
|
||||||
"keycloakVersionDefaultAssets": keycloakVersionDefaultAssets ?? "11.0.3",
|
"loginThemeResourcesFromKeycloakVersion": loginThemeResourcesFromKeycloakVersion ?? "11.0.3",
|
||||||
|
"publicDirPath": (() => {
|
||||||
|
let { PUBLIC_DIR_PATH } = process.env;
|
||||||
|
|
||||||
|
if (PUBLIC_DIR_PATH !== undefined) {
|
||||||
|
return getAbsoluteAndInOsFormatPath({
|
||||||
|
"pathIsh": PUBLIC_DIR_PATH,
|
||||||
|
"cwd": reactAppRootDirPath
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return pathJoin(reactAppRootDirPath, "public");
|
||||||
|
})(),
|
||||||
"reactAppBuildDirPath": (() => {
|
"reactAppBuildDirPath": (() => {
|
||||||
let { reactAppBuildDirPath = undefined } = parsedPackageJson.keycloakify ?? {};
|
const { reactAppBuildDirPath } = parsedPackageJson.keycloakify ?? {};
|
||||||
|
|
||||||
if (reactAppBuildDirPath === undefined) {
|
if (reactAppBuildDirPath !== undefined) {
|
||||||
return pathJoin(projectDirPath, "build");
|
return getAbsoluteAndInOsFormatPath({
|
||||||
|
"pathIsh": reactAppBuildDirPath,
|
||||||
|
"cwd": reactAppRootDirPath
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathSep === "\\") {
|
for (const name of ["build", "dist"]) {
|
||||||
reactAppBuildDirPath = reactAppBuildDirPath.replace(/\//g, pathSep);
|
const out = pathJoin(reactAppRootDirPath, name);
|
||||||
|
|
||||||
|
if (!fs.existsSync(out)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reactAppBuildDirPath.startsWith(`.${pathSep}`)) {
|
throw new Error("Please use the reactAppBuildDirPath option to specify the build directory of your react app");
|
||||||
return pathJoin(projectDirPath, reactAppBuildDirPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
return reactAppBuildDirPath;
|
|
||||||
})(),
|
})(),
|
||||||
"keycloakifyBuildDirPath": (() => {
|
"keycloakifyBuildDirPath": (() => {
|
||||||
let { keycloakifyBuildDirPath = undefined } = parsedPackageJson.keycloakify ?? {};
|
const { keycloakifyBuildDirPath } = parsedPackageJson.keycloakify ?? {};
|
||||||
|
|
||||||
if (keycloakifyBuildDirPath === undefined) {
|
if (keycloakifyBuildDirPath !== undefined) {
|
||||||
return pathJoin(projectDirPath, "build_keycloak");
|
return getAbsoluteAndInOsFormatPath({
|
||||||
|
"pathIsh": keycloakifyBuildDirPath,
|
||||||
|
"cwd": reactAppRootDirPath
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathSep === "\\") {
|
return pathJoin(reactAppRootDirPath, "build_keycloak");
|
||||||
keycloakifyBuildDirPath = keycloakifyBuildDirPath.replace(/\//g, pathSep);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keycloakifyBuildDirPath.startsWith(`.${pathSep}`)) {
|
|
||||||
return pathJoin(projectDirPath, keycloakifyBuildDirPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
return keycloakifyBuildDirPath;
|
|
||||||
})(),
|
})(),
|
||||||
|
"cacheDirPath": pathJoin(
|
||||||
|
(() => {
|
||||||
|
let { XDG_CACHE_HOME } = process.env;
|
||||||
|
|
||||||
|
if (XDG_CACHE_HOME !== undefined) {
|
||||||
|
return getAbsoluteAndInOsFormatPath({
|
||||||
|
"pathIsh": XDG_CACHE_HOME,
|
||||||
|
"cwd": reactAppRootDirPath
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return pathJoin(reactAppRootDirPath, "node_modules", ".cache");
|
||||||
|
})(),
|
||||||
|
"keycloakify"
|
||||||
|
),
|
||||||
"urlPathname": (() => {
|
"urlPathname": (() => {
|
||||||
const { homepage } = parsedPackageJson;
|
const { homepage } = parsedPackageJson;
|
||||||
|
|
||||||
|
@ -8,13 +8,9 @@ import { objectKeys } from "tsafe/objectKeys";
|
|||||||
import { ftlValuesGlobalName } from "../ftlValuesGlobalName";
|
import { ftlValuesGlobalName } from "../ftlValuesGlobalName";
|
||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../BuildOptions";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
|
import type { ThemeType } from "../../constants";
|
||||||
export const themeTypes = ["login", "account"] as const;
|
|
||||||
|
|
||||||
export type ThemeType = (typeof themeTypes)[number];
|
|
||||||
|
|
||||||
export type BuildOptionsLike = {
|
export type BuildOptionsLike = {
|
||||||
themeName: string;
|
|
||||||
themeVersion: string;
|
themeVersion: string;
|
||||||
urlPathname: string | undefined;
|
urlPathname: string | undefined;
|
||||||
};
|
};
|
||||||
@ -22,6 +18,7 @@ export type BuildOptionsLike = {
|
|||||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
|
||||||
export function generateFtlFilesCodeFactory(params: {
|
export function generateFtlFilesCodeFactory(params: {
|
||||||
|
themeName: string;
|
||||||
indexHtmlCode: string;
|
indexHtmlCode: string;
|
||||||
//NOTE: Expected to be an empty object if external assets mode is enabled.
|
//NOTE: Expected to be an empty object if external assets mode is enabled.
|
||||||
cssGlobalsToDefine: Record<string, string>;
|
cssGlobalsToDefine: Record<string, string>;
|
||||||
@ -30,7 +27,7 @@ export function generateFtlFilesCodeFactory(params: {
|
|||||||
themeType: ThemeType;
|
themeType: ThemeType;
|
||||||
fieldNames: string[];
|
fieldNames: string[];
|
||||||
}) {
|
}) {
|
||||||
const { cssGlobalsToDefine, indexHtmlCode, buildOptions, keycloakifyVersion, themeType, fieldNames } = params;
|
const { themeName, cssGlobalsToDefine, indexHtmlCode, buildOptions, keycloakifyVersion, themeType, fieldNames } = params;
|
||||||
|
|
||||||
const $ = cheerio.load(indexHtmlCode);
|
const $ = cheerio.load(indexHtmlCode);
|
||||||
|
|
||||||
@ -40,7 +37,7 @@ export function generateFtlFilesCodeFactory(params: {
|
|||||||
|
|
||||||
assert(jsCode !== null);
|
assert(jsCode !== null);
|
||||||
|
|
||||||
const { fixedJsCode } = replaceImportsFromStaticInJsCode({ jsCode });
|
const { fixedJsCode } = replaceImportsFromStaticInJsCode({ jsCode, "bundler": "vite" });
|
||||||
|
|
||||||
$(element).text(fixedJsCode);
|
$(element).text(fixedJsCode);
|
||||||
});
|
});
|
||||||
@ -104,7 +101,7 @@ export function generateFtlFilesCodeFactory(params: {
|
|||||||
.replace("KEYCLOAKIFY_VERSION_xEdKd3xEdr", keycloakifyVersion)
|
.replace("KEYCLOAKIFY_VERSION_xEdKd3xEdr", keycloakifyVersion)
|
||||||
.replace("KEYCLOAKIFY_THEME_VERSION_sIgKd3xEdr3dx", buildOptions.themeVersion)
|
.replace("KEYCLOAKIFY_THEME_VERSION_sIgKd3xEdr3dx", buildOptions.themeVersion)
|
||||||
.replace("KEYCLOAKIFY_THEME_TYPE_dExKd3xEdr", themeType)
|
.replace("KEYCLOAKIFY_THEME_TYPE_dExKd3xEdr", themeType)
|
||||||
.replace("KEYCLOAKIFY_THEME_NAME_cXxKd3xEer", buildOptions.themeName),
|
.replace("KEYCLOAKIFY_THEME_NAME_cXxKd3xEer", themeName),
|
||||||
"<!-- xIdLqMeOedErIdLsPdNdI9dSlxI -->": [
|
"<!-- xIdLqMeOedErIdLsPdNdI9dSlxI -->": [
|
||||||
"<#if scripts??>",
|
"<#if scripts??>",
|
||||||
" <#list scripts as script>",
|
" <#list scripts as script>",
|
||||||
@ -124,6 +121,27 @@ export function generateFtlFilesCodeFactory(params: {
|
|||||||
].join("\n")
|
].join("\n")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Remove part of the document marked as ignored.
|
||||||
|
{
|
||||||
|
const startTags = $('meta[name="keycloakify-ignore-start"]');
|
||||||
|
|
||||||
|
startTags.each((...[, startTag]) => {
|
||||||
|
const $startTag = $(startTag);
|
||||||
|
const $endTag = $startTag.nextAll('meta[name="keycloakify-ignore-end"]').first();
|
||||||
|
|
||||||
|
if ($endTag.length) {
|
||||||
|
let currentNode = $startTag.next();
|
||||||
|
while (currentNode.length && !currentNode.is($endTag)) {
|
||||||
|
currentNode.remove();
|
||||||
|
currentNode = $startTag.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
$startTag.remove();
|
||||||
|
$endTag.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const partiallyFixedIndexHtmlCode = $.html();
|
const partiallyFixedIndexHtmlCode = $.html();
|
||||||
|
|
||||||
function generateFtlFilesCode(params: { pageId: string }): {
|
function generateFtlFilesCode(params: { pageId: string }): {
|
||||||
|
@ -1,84 +0,0 @@
|
|||||||
import * as fs from "fs";
|
|
||||||
import { join as pathJoin, dirname as pathDirname } from "path";
|
|
||||||
import { assert } from "tsafe/assert";
|
|
||||||
import type { BuildOptions } from "./BuildOptions";
|
|
||||||
import type { ThemeType } from "./generateFtl";
|
|
||||||
|
|
||||||
export type BuildOptionsLike = {
|
|
||||||
themeName: string;
|
|
||||||
extraThemeNames: string[];
|
|
||||||
groupId: string;
|
|
||||||
artifactId: string;
|
|
||||||
themeVersion: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
|
||||||
|
|
||||||
export function generateJavaStackFiles(params: {
|
|
||||||
keycloakThemeBuildingDirPath: string;
|
|
||||||
implementedThemeTypes: Record<ThemeType | "email", boolean>;
|
|
||||||
buildOptions: BuildOptionsLike;
|
|
||||||
}): {
|
|
||||||
jarFilePath: string;
|
|
||||||
} {
|
|
||||||
const {
|
|
||||||
buildOptions: { groupId, themeName, extraThemeNames, themeVersion, artifactId },
|
|
||||||
keycloakThemeBuildingDirPath,
|
|
||||||
implementedThemeTypes
|
|
||||||
} = params;
|
|
||||||
|
|
||||||
{
|
|
||||||
const { pomFileCode } = (function generatePomFileCode(): {
|
|
||||||
pomFileCode: string;
|
|
||||||
} {
|
|
||||||
const pomFileCode = [
|
|
||||||
`<?xml version="1.0"?>`,
|
|
||||||
`<project xmlns="http://maven.apache.org/POM/4.0.0"`,
|
|
||||||
` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"`,
|
|
||||||
` xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">`,
|
|
||||||
` <modelVersion>4.0.0</modelVersion>`,
|
|
||||||
` <groupId>${groupId}</groupId>`,
|
|
||||||
` <artifactId>${artifactId}</artifactId>`,
|
|
||||||
` <version>${themeVersion}</version>`,
|
|
||||||
` <name>${artifactId}</name>`,
|
|
||||||
` <description />`,
|
|
||||||
`</project>`
|
|
||||||
].join("\n");
|
|
||||||
|
|
||||||
return { pomFileCode };
|
|
||||||
})();
|
|
||||||
|
|
||||||
fs.writeFileSync(pathJoin(keycloakThemeBuildingDirPath, "pom.xml"), Buffer.from(pomFileCode, "utf8"));
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
const themeManifestFilePath = pathJoin(keycloakThemeBuildingDirPath, "src", "main", "resources", "META-INF", "keycloak-themes.json");
|
|
||||||
|
|
||||||
try {
|
|
||||||
fs.mkdirSync(pathDirname(themeManifestFilePath));
|
|
||||||
} catch {}
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
|
||||||
themeManifestFilePath,
|
|
||||||
Buffer.from(
|
|
||||||
JSON.stringify(
|
|
||||||
{
|
|
||||||
"themes": [themeName, ...extraThemeNames].map(themeName => ({
|
|
||||||
"name": themeName,
|
|
||||||
"types": Object.entries(implementedThemeTypes)
|
|
||||||
.filter(([, isImplemented]) => isImplemented)
|
|
||||||
.map(([themeType]) => themeType)
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
2
|
|
||||||
),
|
|
||||||
"utf8"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
"jarFilePath": pathJoin(keycloakThemeBuildingDirPath, "target", `${artifactId}-${themeVersion}.jar`)
|
|
||||||
};
|
|
||||||
}
|
|
@ -0,0 +1,87 @@
|
|||||||
|
import * as fs from "fs";
|
||||||
|
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||||
|
import { assert } from "tsafe/assert";
|
||||||
|
import { Reflect } from "tsafe/Reflect";
|
||||||
|
import type { BuildOptions } from "../BuildOptions";
|
||||||
|
import { resources_common, lastKeycloakVersionWithAccountV1, accountV1 } from "../../constants";
|
||||||
|
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
||||||
|
import { transformCodebase } from "../../tools/transformCodebase";
|
||||||
|
|
||||||
|
export type BuildOptionsLike = {
|
||||||
|
keycloakifyBuildDirPath: string;
|
||||||
|
cacheDirPath: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
{
|
||||||
|
const buildOptions = Reflect<BuildOptions>();
|
||||||
|
|
||||||
|
assert<typeof buildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function bringInAccountV1(params: { buildOptions: BuildOptionsLike }) {
|
||||||
|
const { buildOptions } = params;
|
||||||
|
|
||||||
|
const builtinKeycloakThemeTmpDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "..", "tmp_yxdE2_builtin_keycloak_theme");
|
||||||
|
|
||||||
|
await downloadBuiltinKeycloakTheme({
|
||||||
|
"destDirPath": builtinKeycloakThemeTmpDirPath,
|
||||||
|
"keycloakVersion": lastKeycloakVersionWithAccountV1,
|
||||||
|
buildOptions
|
||||||
|
});
|
||||||
|
|
||||||
|
const accountV1DirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme", accountV1, "account");
|
||||||
|
|
||||||
|
transformCodebase({
|
||||||
|
"srcDirPath": pathJoin(builtinKeycloakThemeTmpDirPath, "base", "account"),
|
||||||
|
"destDirPath": accountV1DirPath
|
||||||
|
});
|
||||||
|
|
||||||
|
const commonResourceFilePaths = [
|
||||||
|
"node_modules/patternfly/dist/css/patternfly.min.css",
|
||||||
|
"node_modules/patternfly/dist/css/patternfly-additions.min.css"
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const relativeFilePath of commonResourceFilePaths.map(path => pathJoin(...path.split("/")))) {
|
||||||
|
const destFilePath = pathJoin(accountV1DirPath, "resources", resources_common, relativeFilePath);
|
||||||
|
|
||||||
|
fs.mkdirSync(pathDirname(destFilePath), { "recursive": true });
|
||||||
|
|
||||||
|
fs.cpSync(pathJoin(builtinKeycloakThemeTmpDirPath, "keycloak", "common", "resources", relativeFilePath), destFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
const resourceFilePaths = ["css/account.css"];
|
||||||
|
|
||||||
|
for (const relativeFilePath of resourceFilePaths.map(path => pathJoin(...path.split("/")))) {
|
||||||
|
const destFilePath = pathJoin(accountV1DirPath, "resources", relativeFilePath);
|
||||||
|
|
||||||
|
fs.mkdirSync(pathDirname(destFilePath), { "recursive": true });
|
||||||
|
|
||||||
|
fs.cpSync(pathJoin(builtinKeycloakThemeTmpDirPath, "keycloak", "account", "resources", relativeFilePath), destFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.rmSync(builtinKeycloakThemeTmpDirPath, { "recursive": true });
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
pathJoin(accountV1DirPath, "theme.properties"),
|
||||||
|
Buffer.from(
|
||||||
|
[
|
||||||
|
"accountResourceProvider=account-v1",
|
||||||
|
"",
|
||||||
|
"locales=ar,ca,cs,da,de,en,es,fr,fi,hu,it,ja,lt,nl,no,pl,pt-BR,ru,sk,sv,tr,zh-CN",
|
||||||
|
"",
|
||||||
|
"styles=" + [...resourceFilePaths, ...commonResourceFilePaths.map(path => `resources_common/${path}`)].join(" "),
|
||||||
|
"",
|
||||||
|
"##### css classes for form buttons",
|
||||||
|
"# main class used for all buttons",
|
||||||
|
"kcButtonClass=btn",
|
||||||
|
"# classes defining priority of the button - primary or default (there is typically only one priority button for the form)",
|
||||||
|
"kcButtonPrimaryClass=btn-primary",
|
||||||
|
"kcButtonDefaultClass=btn-default",
|
||||||
|
"# classes defining size of the button",
|
||||||
|
"kcButtonLargeClass=btn-lg",
|
||||||
|
""
|
||||||
|
].join("\n"),
|
||||||
|
"utf8"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,132 @@
|
|||||||
|
import * as fs from "fs";
|
||||||
|
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||||
|
import { assert } from "tsafe/assert";
|
||||||
|
import { Reflect } from "tsafe/Reflect";
|
||||||
|
import type { BuildOptions } from "../BuildOptions";
|
||||||
|
import { type ThemeType, accountV1 } from "../../constants";
|
||||||
|
import { bringInAccountV1 } from "./bringInAccountV1";
|
||||||
|
|
||||||
|
export type BuildOptionsLike = {
|
||||||
|
groupId: string;
|
||||||
|
artifactId: string;
|
||||||
|
themeVersion: string;
|
||||||
|
cacheDirPath: string;
|
||||||
|
keycloakifyBuildDirPath: string;
|
||||||
|
themeNames: string[];
|
||||||
|
};
|
||||||
|
|
||||||
|
{
|
||||||
|
const buildOptions = Reflect<BuildOptions>();
|
||||||
|
|
||||||
|
assert<typeof buildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function generateJavaStackFiles(params: {
|
||||||
|
implementedThemeTypes: Record<ThemeType | "email", boolean>;
|
||||||
|
buildOptions: BuildOptionsLike;
|
||||||
|
}): Promise<{
|
||||||
|
jarFilePath: string;
|
||||||
|
}> {
|
||||||
|
const { implementedThemeTypes, buildOptions } = params;
|
||||||
|
|
||||||
|
{
|
||||||
|
const { pomFileCode } = (function generatePomFileCode(): {
|
||||||
|
pomFileCode: string;
|
||||||
|
} {
|
||||||
|
const pomFileCode = [
|
||||||
|
`<?xml version="1.0"?>`,
|
||||||
|
`<project xmlns="http://maven.apache.org/POM/4.0.0"`,
|
||||||
|
` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"`,
|
||||||
|
` xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">`,
|
||||||
|
` <modelVersion>4.0.0</modelVersion>`,
|
||||||
|
` <groupId>${buildOptions.groupId}</groupId>`,
|
||||||
|
` <artifactId>${buildOptions.artifactId}</artifactId>`,
|
||||||
|
` <version>${buildOptions.themeVersion}</version>`,
|
||||||
|
` <name>${buildOptions.artifactId}</name>`,
|
||||||
|
` <description />`,
|
||||||
|
` <packaging>jar</packaging>`,
|
||||||
|
` <properties>`,
|
||||||
|
` <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>`,
|
||||||
|
` </properties>`,
|
||||||
|
` <build>`,
|
||||||
|
` <plugins>`,
|
||||||
|
` <plugin>`,
|
||||||
|
` <groupId>org.apache.maven.plugins</groupId>`,
|
||||||
|
` <artifactId>maven-shade-plugin</artifactId>`,
|
||||||
|
` <version>3.5.1</version>`,
|
||||||
|
` <executions>`,
|
||||||
|
` <execution>`,
|
||||||
|
` <phase>package</phase>`,
|
||||||
|
` <goals>`,
|
||||||
|
` <goal>shade</goal>`,
|
||||||
|
` </goals>`,
|
||||||
|
` </execution>`,
|
||||||
|
` </executions>`,
|
||||||
|
` </plugin>`,
|
||||||
|
` </plugins>`,
|
||||||
|
` </build>`,
|
||||||
|
` <dependencies>`,
|
||||||
|
` <dependency>`,
|
||||||
|
` <groupId>io.phasetwo.keycloak</groupId>`,
|
||||||
|
` <artifactId>keycloak-account-v1</artifactId>`,
|
||||||
|
` <version>0.1</version>`,
|
||||||
|
` </dependency>`,
|
||||||
|
` </dependencies>`,
|
||||||
|
`</project>`
|
||||||
|
].join("\n");
|
||||||
|
|
||||||
|
return { pomFileCode };
|
||||||
|
})();
|
||||||
|
|
||||||
|
fs.writeFileSync(pathJoin(buildOptions.keycloakifyBuildDirPath, "pom.xml"), Buffer.from(pomFileCode, "utf8"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (implementedThemeTypes.account) {
|
||||||
|
await bringInAccountV1({ buildOptions });
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const themeManifestFilePath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "META-INF", "keycloak-themes.json");
|
||||||
|
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(pathDirname(themeManifestFilePath));
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
themeManifestFilePath,
|
||||||
|
Buffer.from(
|
||||||
|
JSON.stringify(
|
||||||
|
{
|
||||||
|
"themes": [
|
||||||
|
...(!implementedThemeTypes.account
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
"name": accountV1,
|
||||||
|
"types": ["account"]
|
||||||
|
}
|
||||||
|
]),
|
||||||
|
...buildOptions.themeNames
|
||||||
|
.map(themeName => [
|
||||||
|
{
|
||||||
|
"name": themeName,
|
||||||
|
"types": Object.entries(implementedThemeTypes)
|
||||||
|
.filter(([, isImplemented]) => isImplemented)
|
||||||
|
.map(([themeType]) => themeType)
|
||||||
|
}
|
||||||
|
])
|
||||||
|
.flat()
|
||||||
|
]
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
2
|
||||||
|
),
|
||||||
|
"utf8"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
"jarFilePath": pathJoin(buildOptions.keycloakifyBuildDirPath, "target", `${buildOptions.artifactId}-${buildOptions.themeVersion}.jar`)
|
||||||
|
};
|
||||||
|
}
|
1
src/bin/keycloakify/generateJavaStackFiles/index.ts
Normal file
1
src/bin/keycloakify/generateJavaStackFiles/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from "./generateJavaStackFiles";
|
@ -1,53 +1,60 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin, relative as pathRelative, basename as pathBasename } from "path";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
|
import { Reflect } from "tsafe/Reflect";
|
||||||
import type { BuildOptions } from "./BuildOptions";
|
import type { BuildOptions } from "./BuildOptions";
|
||||||
|
|
||||||
export type BuildOptionsLike = {
|
export type BuildOptionsLike = {
|
||||||
themeName: string;
|
keycloakifyBuildDirPath: string;
|
||||||
extraThemeNames: string[];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
{
|
||||||
|
const buildOptions = Reflect<BuildOptions>();
|
||||||
|
|
||||||
|
assert<typeof buildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
}
|
||||||
|
|
||||||
generateStartKeycloakTestingContainer.basename = "start_keycloak_testing_container.sh";
|
generateStartKeycloakTestingContainer.basename = "start_keycloak_testing_container.sh";
|
||||||
|
|
||||||
const containerName = "keycloak-testing-container";
|
const containerName = "keycloak-testing-container";
|
||||||
|
|
||||||
/** Files for being able to run a hot reload keycloak container */
|
/** Files for being able to run a hot reload keycloak container */
|
||||||
export function generateStartKeycloakTestingContainer(params: {
|
export function generateStartKeycloakTestingContainer(params: { jarFilePath: string; keycloakVersion: string; buildOptions: BuildOptionsLike }) {
|
||||||
keycloakVersion: string;
|
const { jarFilePath, keycloakVersion, buildOptions } = params;
|
||||||
keycloakThemeBuildingDirPath: string;
|
|
||||||
buildOptions: BuildOptionsLike;
|
const themeRelativeDirPath = pathJoin("src", "main", "resources", "theme");
|
||||||
}) {
|
const themeDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, themeRelativeDirPath);
|
||||||
const {
|
|
||||||
keycloakThemeBuildingDirPath,
|
|
||||||
keycloakVersion,
|
|
||||||
buildOptions: { themeName, extraThemeNames }
|
|
||||||
} = params;
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
pathJoin(keycloakThemeBuildingDirPath, generateStartKeycloakTestingContainer.basename),
|
pathJoin(buildOptions.keycloakifyBuildDirPath, generateStartKeycloakTestingContainer.basename),
|
||||||
Buffer.from(
|
Buffer.from(
|
||||||
[
|
[
|
||||||
"#!/usr/bin/env bash",
|
"#!/usr/bin/env bash",
|
||||||
|
`# If you want to test with Keycloak version prior to 23 use the retrocompat-${pathBasename(jarFilePath)}`,
|
||||||
"",
|
"",
|
||||||
`docker rm ${containerName} || true`,
|
`docker rm ${containerName} || true`,
|
||||||
"",
|
"",
|
||||||
`cd "${keycloakThemeBuildingDirPath.replace(/\\/g, "/")}"`,
|
`cd "${buildOptions.keycloakifyBuildDirPath}"`,
|
||||||
"",
|
"",
|
||||||
"docker run \\",
|
"docker run \\",
|
||||||
" -p 8080:8080 \\",
|
" -p 8080:8080 \\",
|
||||||
` --name ${containerName} \\`,
|
` --name ${containerName} \\`,
|
||||||
" -e KEYCLOAK_ADMIN=admin \\",
|
" -e KEYCLOAK_ADMIN=admin \\",
|
||||||
" -e KEYCLOAK_ADMIN_PASSWORD=admin \\",
|
" -e KEYCLOAK_ADMIN_PASSWORD=admin \\",
|
||||||
...[themeName, ...extraThemeNames].map(
|
` -v "${pathJoin(
|
||||||
themeName =>
|
"$(pwd)",
|
||||||
` -v "${pathJoin(keycloakThemeBuildingDirPath, "src", "main", "resources", "theme", themeName).replace(
|
pathRelative(buildOptions.keycloakifyBuildDirPath, jarFilePath)
|
||||||
/\\/g,
|
)}":"/opt/keycloak/providers/${pathBasename(jarFilePath)}" \\`,
|
||||||
"/"
|
...fs
|
||||||
)}":"/opt/keycloak/themes/${themeName}":rw \\`
|
.readdirSync(themeDirPath)
|
||||||
),
|
.filter(name => fs.lstatSync(pathJoin(themeDirPath, name)).isDirectory())
|
||||||
|
.map(
|
||||||
|
themeName =>
|
||||||
|
` -v "${pathJoin("$(pwd)", themeRelativeDirPath, themeName).replace(
|
||||||
|
/\\/g,
|
||||||
|
"/"
|
||||||
|
)}":"/opt/keycloak/themes/${themeName}":rw \\`
|
||||||
|
),
|
||||||
` -it quay.io/keycloak/keycloak:${keycloakVersion} \\`,
|
` -it quay.io/keycloak/keycloak:${keycloakVersion} \\`,
|
||||||
` start-dev --features=declarative-user-profile`,
|
` start-dev --features=declarative-user-profile`,
|
||||||
""
|
""
|
||||||
|
@ -1,29 +1,31 @@
|
|||||||
import { transformCodebase } from "../../tools/transformCodebase";
|
import { transformCodebase } from "../../tools/transformCodebase";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { join as pathJoin, relative as pathRelative, dirname as pathDirname } from "path";
|
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||||
import type { ThemeType } from "../generateFtl";
|
|
||||||
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
||||||
import {
|
import { resources_common, type ThemeType } from "../../constants";
|
||||||
resourcesCommonDirPathRelativeToPublicDir,
|
import { BuildOptions } from "../BuildOptions";
|
||||||
resourcesDirPathRelativeToPublicDir,
|
|
||||||
basenameOfKeycloakDirInPublicDir
|
|
||||||
} from "../../mockTestingResourcesPath";
|
|
||||||
import * as crypto from "crypto";
|
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
|
import * as crypto from "crypto";
|
||||||
|
|
||||||
|
export type BuildOptionsLike = {
|
||||||
|
cacheDirPath: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
|
||||||
export async function downloadKeycloakStaticResources(
|
export async function downloadKeycloakStaticResources(
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
params: {
|
params: {
|
||||||
projectDirPath: string;
|
|
||||||
themeType: ThemeType;
|
themeType: ThemeType;
|
||||||
themeDirPath: string;
|
themeDirPath: string;
|
||||||
keycloakVersion: string;
|
keycloakVersion: string;
|
||||||
usedResources: {
|
usedResources: {
|
||||||
resourcesCommonFilePaths: string[];
|
resourcesCommonFilePaths: string[];
|
||||||
} | undefined
|
} | undefined;
|
||||||
|
buildOptions: BuildOptionsLike;
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
const { projectDirPath, themeType, themeDirPath, keycloakVersion } = params;
|
const { themeType, themeDirPath, keycloakVersion, buildOptions } = params;
|
||||||
|
|
||||||
// NOTE: Hack for 427
|
// NOTE: Hack for 427
|
||||||
const usedResources = (() => {
|
const usedResources = (() => {
|
||||||
@ -52,24 +54,25 @@ export async function downloadKeycloakStaticResources(
|
|||||||
|
|
||||||
const tmpDirPath = pathJoin(
|
const tmpDirPath = pathJoin(
|
||||||
themeDirPath,
|
themeDirPath,
|
||||||
"..",
|
|
||||||
`tmp_suLeKsxId_${crypto.createHash("sha256").update(`${themeType}-${keycloakVersion}`).digest("hex").slice(0, 8)}`
|
`tmp_suLeKsxId_${crypto.createHash("sha256").update(`${themeType}-${keycloakVersion}`).digest("hex").slice(0, 8)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
await downloadBuiltinKeycloakTheme({
|
await downloadBuiltinKeycloakTheme({
|
||||||
projectDirPath,
|
|
||||||
keycloakVersion,
|
keycloakVersion,
|
||||||
"destDirPath": tmpDirPath
|
"destDirPath": tmpDirPath,
|
||||||
|
buildOptions
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const resourcesPath = pathJoin(themeDirPath, themeType, "resources");
|
||||||
|
|
||||||
transformCodebase({
|
transformCodebase({
|
||||||
"srcDirPath": pathJoin(tmpDirPath, "keycloak", themeType, "resources"),
|
"srcDirPath": pathJoin(tmpDirPath, "keycloak", themeType, "resources"),
|
||||||
"destDirPath": pathJoin(themeDirPath, pathRelative(basenameOfKeycloakDirInPublicDir, resourcesDirPathRelativeToPublicDir))
|
"destDirPath": resourcesPath
|
||||||
});
|
});
|
||||||
|
|
||||||
transformCodebase({
|
transformCodebase({
|
||||||
"srcDirPath": pathJoin(tmpDirPath, "keycloak", "common", "resources"),
|
"srcDirPath": pathJoin(tmpDirPath, "keycloak", "common", "resources"),
|
||||||
"destDirPath": pathJoin(themeDirPath, pathRelative(basenameOfKeycloakDirInPublicDir, resourcesCommonDirPathRelativeToPublicDir)),
|
"destDirPath": pathJoin(resourcesPath, resources_common),
|
||||||
"transformSourceCode":
|
"transformSourceCode":
|
||||||
usedResources === undefined
|
usedResources === undefined
|
||||||
? undefined
|
? undefined
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { ThemeType } from "../generateFtl";
|
import type { ThemeType } from "../../constants";
|
||||||
import { crawl } from "../../tools/crawl";
|
import { crawl } from "../../tools/crawl";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin } from "path";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { transformCodebase } from "../../tools/transformCodebase";
|
import { transformCodebase } from "../../tools/transformCodebase";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin, resolve as pathResolve } from "path";
|
||||||
import { replaceImportsFromStaticInJsCode } from "../replacers/replaceImportsFromStaticInJsCode";
|
import { replaceImportsFromStaticInJsCode } from "../replacers/replaceImportsFromStaticInJsCode";
|
||||||
import { replaceImportsInCssCode } from "../replacers/replaceImportsInCssCode";
|
import { replaceImportsInCssCode } from "../replacers/replaceImportsInCssCode";
|
||||||
import { generateFtlFilesCodeFactory, loginThemePageIds, accountThemePageIds, themeTypes, type ThemeType } from "../generateFtl";
|
import { generateFtlFilesCodeFactory, loginThemePageIds, accountThemePageIds } from "../generateFtl";
|
||||||
import { basenameOfKeycloakDirInPublicDir } from "../../mockTestingResourcesPath";
|
import { themeTypes, type ThemeType, lastKeycloakVersionWithAccountV1, keycloak_resources, accountV1 } from "../../constants";
|
||||||
import { isInside } from "../../tools/isInside";
|
import { isInside } from "../../tools/isInside";
|
||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../BuildOptions";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert, type Equals } from "tsafe/assert";
|
||||||
import { downloadKeycloakStaticResources } from "./downloadKeycloakStaticResources";
|
import { downloadKeycloakStaticResources } from "./downloadKeycloakStaticResources";
|
||||||
import { readFieldNameUsage } from "./readFieldNameUsage";
|
import { readFieldNameUsage } from "./readFieldNameUsage";
|
||||||
import { readExtraPagesNames } from "./readExtraPageNames";
|
import { readExtraPagesNames } from "./readExtraPageNames";
|
||||||
@ -15,36 +15,30 @@ import { generateMessageProperties } from "./generateMessageProperties";
|
|||||||
import { readStaticResourcesUsage } from "./readStaticResourcesUsage";
|
import { readStaticResourcesUsage } from "./readStaticResourcesUsage";
|
||||||
|
|
||||||
export type BuildOptionsLike = {
|
export type BuildOptionsLike = {
|
||||||
themeName: string;
|
|
||||||
extraThemeProperties: string[] | undefined;
|
extraThemeProperties: string[] | undefined;
|
||||||
themeVersion: string;
|
themeVersion: string;
|
||||||
keycloakVersionDefaultAssets: string;
|
loginThemeResourcesFromKeycloakVersion: string;
|
||||||
urlPathname: string | undefined;
|
urlPathname: string | undefined;
|
||||||
|
keycloakifyBuildDirPath: string;
|
||||||
|
reactAppBuildDirPath: string;
|
||||||
|
cacheDirPath: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||||
|
|
||||||
export async function generateTheme(params: {
|
export async function generateTheme(params: {
|
||||||
projectDirPath: string;
|
themeName: string;
|
||||||
reactAppBuildDirPath: string;
|
|
||||||
keycloakThemeBuildingDirPath: string;
|
|
||||||
themeSrcDirPath: string;
|
themeSrcDirPath: string;
|
||||||
keycloakifySrcDirPath: string;
|
keycloakifySrcDirPath: string;
|
||||||
buildOptions: BuildOptionsLike;
|
buildOptions: BuildOptionsLike;
|
||||||
keycloakifyVersion: string;
|
keycloakifyVersion: string;
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
const {
|
const { themeName, themeSrcDirPath, keycloakifySrcDirPath, buildOptions, keycloakifyVersion } = params;
|
||||||
projectDirPath,
|
|
||||||
reactAppBuildDirPath,
|
|
||||||
keycloakThemeBuildingDirPath,
|
|
||||||
themeSrcDirPath,
|
|
||||||
keycloakifySrcDirPath,
|
|
||||||
buildOptions,
|
|
||||||
keycloakifyVersion
|
|
||||||
} = params;
|
|
||||||
|
|
||||||
const getThemeDirPath = (themeType: ThemeType | "email") =>
|
const getThemeTypeDirPath = (params: { themeType: ThemeType | "email" }) => {
|
||||||
pathJoin(keycloakThemeBuildingDirPath, "src", "main", "resources", "theme", buildOptions.themeName, themeType);
|
const { themeType } = params;
|
||||||
|
return pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName, themeType);
|
||||||
|
};
|
||||||
|
|
||||||
let allCssGlobalsToDefine: Record<string, string> = {};
|
let allCssGlobalsToDefine: Record<string, string> = {};
|
||||||
|
|
||||||
@ -55,7 +49,7 @@ export async function generateTheme(params: {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const themeDirPath = getThemeDirPath(themeType);
|
const themeTypeDirPath = getThemeTypeDirPath({ themeType });
|
||||||
|
|
||||||
copy_app_resources_to_theme_path: {
|
copy_app_resources_to_theme_path: {
|
||||||
const isFirstPass = themeType.indexOf(themeType) === 0;
|
const isFirstPass = themeType.indexOf(themeType) === 0;
|
||||||
@ -65,13 +59,13 @@ export async function generateTheme(params: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transformCodebase({
|
transformCodebase({
|
||||||
"destDirPath": pathJoin(themeDirPath, "resources", "build"),
|
"destDirPath": pathJoin(themeTypeDirPath, "resources", "build"),
|
||||||
"srcDirPath": reactAppBuildDirPath,
|
"srcDirPath": buildOptions.reactAppBuildDirPath,
|
||||||
"transformSourceCode": ({ filePath, sourceCode }) => {
|
"transformSourceCode": ({ filePath, sourceCode }) => {
|
||||||
//NOTE: Prevent cycles, excludes the folder we generated for debug in public/
|
//NOTE: Prevent cycles, excludes the folder we generated for debug in public/
|
||||||
if (
|
if (
|
||||||
isInside({
|
isInside({
|
||||||
"dirPath": pathJoin(reactAppBuildDirPath, basenameOfKeycloakDirInPublicDir),
|
"dirPath": pathJoin(buildOptions.reactAppBuildDirPath, keycloak_resources),
|
||||||
filePath
|
filePath
|
||||||
})
|
})
|
||||||
) {
|
) {
|
||||||
@ -99,7 +93,8 @@ export async function generateTheme(params: {
|
|||||||
|
|
||||||
if (/\.js?$/i.test(filePath)) {
|
if (/\.js?$/i.test(filePath)) {
|
||||||
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
|
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
|
||||||
"jsCode": sourceCode.toString("utf8")
|
"jsCode": sourceCode.toString("utf8"),
|
||||||
|
"bundler": "vite"
|
||||||
});
|
});
|
||||||
|
|
||||||
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
||||||
@ -114,7 +109,8 @@ export async function generateTheme(params: {
|
|||||||
generateFtlFilesCode_glob !== undefined
|
generateFtlFilesCode_glob !== undefined
|
||||||
? generateFtlFilesCode_glob
|
? generateFtlFilesCode_glob
|
||||||
: generateFtlFilesCodeFactory({
|
: generateFtlFilesCodeFactory({
|
||||||
"indexHtmlCode": fs.readFileSync(pathJoin(reactAppBuildDirPath, "index.html")).toString("utf8"),
|
themeName,
|
||||||
|
"indexHtmlCode": fs.readFileSync(pathJoin(buildOptions.reactAppBuildDirPath, "index.html")).toString("utf8"),
|
||||||
"cssGlobalsToDefine": allCssGlobalsToDefine,
|
"cssGlobalsToDefine": allCssGlobalsToDefine,
|
||||||
buildOptions,
|
buildOptions,
|
||||||
keycloakifyVersion,
|
keycloakifyVersion,
|
||||||
@ -142,74 +138,60 @@ export async function generateTheme(params: {
|
|||||||
].forEach(pageId => {
|
].forEach(pageId => {
|
||||||
const { ftlCode } = generateFtlFilesCode({ pageId });
|
const { ftlCode } = generateFtlFilesCode({ pageId });
|
||||||
|
|
||||||
fs.mkdirSync(themeDirPath, { "recursive": true });
|
fs.mkdirSync(themeTypeDirPath, { "recursive": true });
|
||||||
|
|
||||||
fs.writeFileSync(pathJoin(themeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
|
fs.writeFileSync(pathJoin(themeTypeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
|
||||||
});
|
});
|
||||||
|
|
||||||
generateMessageProperties({
|
generateMessageProperties({
|
||||||
themeSrcDirPath,
|
themeSrcDirPath,
|
||||||
themeType
|
themeType
|
||||||
}).forEach(({ languageTag, propertiesFileSource }) => {
|
}).forEach(({ languageTag, propertiesFileSource }) => {
|
||||||
const messagesDirPath = pathJoin(themeDirPath, "messages");
|
const messagesDirPath = pathJoin(themeTypeDirPath, "messages");
|
||||||
|
|
||||||
fs.mkdirSync(pathJoin(themeDirPath, "messages"), { "recursive": true });
|
fs.mkdirSync(pathJoin(themeTypeDirPath, "messages"), { "recursive": true });
|
||||||
|
|
||||||
const propertiesFilePath = pathJoin(messagesDirPath, `messages_${languageTag}.properties`);
|
const propertiesFilePath = pathJoin(messagesDirPath, `messages_${languageTag}.properties`);
|
||||||
|
|
||||||
fs.writeFileSync(propertiesFilePath, Buffer.from(propertiesFileSource, "utf8"));
|
fs.writeFileSync(propertiesFilePath, Buffer.from(propertiesFileSource, "utf8"));
|
||||||
});
|
});
|
||||||
|
|
||||||
//TODO: Remove this block we left it for now only for backward compatibility
|
|
||||||
// we now have a separate script for this
|
|
||||||
copy_keycloak_resources_to_public: {
|
|
||||||
const keycloakDirInPublicDir = pathJoin(reactAppBuildDirPath, "..", "public", basenameOfKeycloakDirInPublicDir);
|
|
||||||
|
|
||||||
if (fs.existsSync(keycloakDirInPublicDir)) {
|
|
||||||
break copy_keycloak_resources_to_public;
|
|
||||||
}
|
|
||||||
|
|
||||||
await downloadKeycloakStaticResources({
|
|
||||||
projectDirPath,
|
|
||||||
"keycloakVersion": buildOptions.keycloakVersionDefaultAssets,
|
|
||||||
"themeDirPath": keycloakDirInPublicDir,
|
|
||||||
themeType,
|
|
||||||
"usedResources": undefined
|
|
||||||
});
|
|
||||||
|
|
||||||
if (themeType !== themeTypes[0]) {
|
|
||||||
break copy_keycloak_resources_to_public;
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
|
||||||
pathJoin(keycloakDirInPublicDir, "README.txt"),
|
|
||||||
Buffer.from(
|
|
||||||
// prettier-ignore
|
|
||||||
[
|
|
||||||
"This is just a test folder that helps develop",
|
|
||||||
"the login and register page without having to run a Keycloak container"
|
|
||||||
].join(" ")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
fs.writeFileSync(pathJoin(keycloakDirInPublicDir, ".gitignore"), Buffer.from("*", "utf8"));
|
|
||||||
}
|
|
||||||
|
|
||||||
await downloadKeycloakStaticResources({
|
await downloadKeycloakStaticResources({
|
||||||
projectDirPath,
|
"keycloakVersion": (() => {
|
||||||
"keycloakVersion": buildOptions.keycloakVersionDefaultAssets,
|
switch (themeType) {
|
||||||
themeDirPath,
|
case "account":
|
||||||
|
return lastKeycloakVersionWithAccountV1;
|
||||||
|
case "login":
|
||||||
|
return buildOptions.loginThemeResourcesFromKeycloakVersion;
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
"themeDirPath": pathResolve(pathJoin(themeTypeDirPath, "..")),
|
||||||
themeType,
|
themeType,
|
||||||
"usedResources": readStaticResourcesUsage({
|
"usedResources": readStaticResourcesUsage({
|
||||||
keycloakifySrcDirPath,
|
keycloakifySrcDirPath,
|
||||||
themeSrcDirPath,
|
themeSrcDirPath,
|
||||||
themeType
|
themeType
|
||||||
})
|
}),
|
||||||
|
buildOptions
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
pathJoin(themeDirPath, "theme.properties"),
|
pathJoin(themeTypeDirPath, "theme.properties"),
|
||||||
Buffer.from([`parent=keycloak`, ...(buildOptions.extraThemeProperties ?? [])].join("\n\n"), "utf8")
|
Buffer.from(
|
||||||
|
[
|
||||||
|
`parent=${(() => {
|
||||||
|
switch (themeType) {
|
||||||
|
case "account":
|
||||||
|
return accountV1;
|
||||||
|
case "login":
|
||||||
|
return "keycloak";
|
||||||
|
}
|
||||||
|
assert<Equals<typeof themeType, never>>(false);
|
||||||
|
})()}`,
|
||||||
|
...(buildOptions.extraThemeProperties ?? [])
|
||||||
|
].join("\n\n"),
|
||||||
|
"utf8"
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +204,7 @@ export async function generateTheme(params: {
|
|||||||
|
|
||||||
transformCodebase({
|
transformCodebase({
|
||||||
"srcDirPath": emailThemeSrcDirPath,
|
"srcDirPath": emailThemeSrcDirPath,
|
||||||
"destDirPath": getThemeDirPath("email")
|
"destDirPath": getThemeTypeDirPath({ "themeType": "email" })
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { crawl } from "../../tools/crawl";
|
import { crawl } from "../../tools/crawl";
|
||||||
import { type ThemeType, accountThemePageIds, loginThemePageIds } from "../generateFtl";
|
import { accountThemePageIds, loginThemePageIds } from "../generateFtl";
|
||||||
import { id } from "tsafe/id";
|
import { id } from "tsafe/id";
|
||||||
import { removeDuplicates } from "evt/tools/reducers/removeDuplicates";
|
import { removeDuplicates } from "evt/tools/reducers/removeDuplicates";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin } from "path";
|
||||||
|
import type { ThemeType } from "../../constants";
|
||||||
|
|
||||||
export function readExtraPagesNames(params: { themeSrcDirPath: string; themeType: ThemeType }): string[] {
|
export function readExtraPagesNames(params: { themeSrcDirPath: string; themeType: ThemeType }): string[] {
|
||||||
const { themeSrcDirPath, themeType } = params;
|
const { themeSrcDirPath, themeType } = params;
|
||||||
|
@ -2,7 +2,7 @@ import { crawl } from "../../tools/crawl";
|
|||||||
import { removeDuplicates } from "evt/tools/reducers/removeDuplicates";
|
import { removeDuplicates } from "evt/tools/reducers/removeDuplicates";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin } from "path";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import type { ThemeType } from "../generateFtl";
|
import type { ThemeType } from "../../constants";
|
||||||
|
|
||||||
/** Assumes the theme type exists */
|
/** Assumes the theme type exists */
|
||||||
export function readFieldNameUsage(params: { keycloakifySrcDirPath: string; themeSrcDirPath: string; themeType: ThemeType }): string[] {
|
export function readFieldNameUsage(params: { keycloakifySrcDirPath: string; themeSrcDirPath: string; themeType: ThemeType }): string[] {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { crawl } from "../../tools/crawl";
|
import { crawl } from "../../tools/crawl";
|
||||||
import { join as pathJoin, sep as pathSep } from "path";
|
import { join as pathJoin, sep as pathSep } from "path";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import type { ThemeType } from "../generateFtl";
|
import type { ThemeType } from "../../constants";
|
||||||
|
|
||||||
/** Assumes the theme type exists */
|
/** Assumes the theme type exists */
|
||||||
export function readStaticResourcesUsage(params: { keycloakifySrcDirPath: string; themeSrcDirPath: string; themeType: ThemeType }): {
|
export function readStaticResourcesUsage(params: { keycloakifySrcDirPath: string; themeSrcDirPath: string; themeType: ThemeType }): {
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
import { generateTheme } from "./generateTheme";
|
import { generateTheme } from "./generateTheme";
|
||||||
import { generateJavaStackFiles } from "./generateJavaStackFiles";
|
import { generateJavaStackFiles } from "./generateJavaStackFiles";
|
||||||
import { join as pathJoin, relative as pathRelative, basename as pathBasename, sep as pathSep } from "path";
|
import { join as pathJoin, relative as pathRelative, basename as pathBasename, dirname as pathDirname, sep as pathSep } from "path";
|
||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import { generateStartKeycloakTestingContainer } from "./generateStartKeycloakTestingContainer";
|
import { generateStartKeycloakTestingContainer } from "./generateStartKeycloakTestingContainer";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { readBuildOptions } from "./BuildOptions";
|
import { readBuildOptions } from "./BuildOptions";
|
||||||
import { getLogger } from "../tools/logger";
|
import { getLogger } from "../tools/logger";
|
||||||
import jar from "../tools/jar";
|
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { Equals } from "tsafe";
|
|
||||||
import { getThemeSrcDirPath } from "../getSrcDirPath";
|
import { getThemeSrcDirPath } from "../getSrcDirPath";
|
||||||
import { getProjectRoot } from "../tools/getProjectRoot";
|
import { getProjectRoot } from "../tools/getProjectRoot";
|
||||||
import { objectKeys } from "tsafe/objectKeys";
|
import { objectKeys } from "tsafe/objectKeys";
|
||||||
|
|
||||||
export async function main() {
|
export async function main() {
|
||||||
const projectDirPath = process.cwd();
|
const reactAppRootDirPath = process.cwd();
|
||||||
|
|
||||||
const buildOptions = readBuildOptions({
|
const buildOptions = readBuildOptions({
|
||||||
projectDirPath,
|
reactAppRootDirPath,
|
||||||
"processArgv": process.argv.slice(2)
|
"processArgv": process.argv.slice(2)
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -26,19 +24,14 @@ export async function main() {
|
|||||||
|
|
||||||
const keycloakifyDirPath = getProjectRoot();
|
const keycloakifyDirPath = getProjectRoot();
|
||||||
|
|
||||||
const { themeSrcDirPath } = getThemeSrcDirPath({ projectDirPath });
|
const { themeSrcDirPath } = getThemeSrcDirPath({ reactAppRootDirPath });
|
||||||
|
|
||||||
for (const themeName of [buildOptions.themeName, ...buildOptions.extraThemeNames]) {
|
for (const themeName of buildOptions.themeNames) {
|
||||||
await generateTheme({
|
await generateTheme({
|
||||||
projectDirPath,
|
themeName,
|
||||||
"keycloakThemeBuildingDirPath": buildOptions.keycloakifyBuildDirPath,
|
|
||||||
themeSrcDirPath,
|
themeSrcDirPath,
|
||||||
"keycloakifySrcDirPath": pathJoin(keycloakifyDirPath, "src"),
|
"keycloakifySrcDirPath": pathJoin(keycloakifyDirPath, "src"),
|
||||||
"reactAppBuildDirPath": buildOptions.reactAppBuildDirPath,
|
buildOptions,
|
||||||
"buildOptions": {
|
|
||||||
...buildOptions,
|
|
||||||
"themeName": themeName
|
|
||||||
},
|
|
||||||
"keycloakifyVersion": (() => {
|
"keycloakifyVersion": (() => {
|
||||||
const version = JSON.parse(fs.readFileSync(pathJoin(keycloakifyDirPath, "package.json")).toString("utf8"))["version"];
|
const version = JSON.parse(fs.readFileSync(pathJoin(keycloakifyDirPath, "package.json")).toString("utf8"))["version"];
|
||||||
|
|
||||||
@ -49,8 +42,7 @@ export async function main() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const { jarFilePath } = generateJavaStackFiles({
|
const { jarFilePath } = await generateJavaStackFiles({
|
||||||
"keycloakThemeBuildingDirPath": buildOptions.keycloakifyBuildDirPath,
|
|
||||||
"implementedThemeTypes": (() => {
|
"implementedThemeTypes": (() => {
|
||||||
const implementedThemeTypes = {
|
const implementedThemeTypes = {
|
||||||
"login": false,
|
"login": false,
|
||||||
@ -70,43 +62,45 @@ export async function main() {
|
|||||||
buildOptions
|
buildOptions
|
||||||
});
|
});
|
||||||
|
|
||||||
switch (buildOptions.bundler) {
|
if (buildOptions.doCreateJar) {
|
||||||
case "none":
|
child_process.execSync("mvn clean install", { "cwd": buildOptions.keycloakifyBuildDirPath });
|
||||||
logger.log("😱 Skipping bundling step, there will be no jar");
|
|
||||||
break;
|
const jarDirPath = pathDirname(jarFilePath);
|
||||||
case "keycloakify":
|
const retrocompatJarFilePath = pathJoin(jarDirPath, "retrocompat-" + pathBasename(jarFilePath));
|
||||||
logger.log("🫶 Let keycloakify do its thang");
|
|
||||||
await jar({
|
fs.renameSync(pathJoin(jarDirPath, "original-" + pathBasename(jarFilePath)), retrocompatJarFilePath);
|
||||||
"rootPath": buildOptions.keycloakifyBuildDirPath,
|
|
||||||
"version": buildOptions.themeVersion,
|
fs.writeFileSync(
|
||||||
"groupId": buildOptions.groupId,
|
pathJoin(jarDirPath, "README.md"),
|
||||||
"artifactId": buildOptions.artifactId,
|
Buffer.from(
|
||||||
"targetPath": jarFilePath
|
[
|
||||||
});
|
`- The ${jarFilePath} is to be used in Keycloak 23 and up. `,
|
||||||
break;
|
`- The ${retrocompatJarFilePath} is to be used in Keycloak 22 and below.`,
|
||||||
case "mvn":
|
` Note that Keycloak 22 is only supported for login and email theme but not for account themes. `
|
||||||
logger.log("🫙 Run maven to deliver a jar");
|
].join("\n"),
|
||||||
child_process.execSync("mvn package", { "cwd": buildOptions.keycloakifyBuildDirPath });
|
"utf8"
|
||||||
break;
|
)
|
||||||
default:
|
);
|
||||||
assert<Equals<typeof buildOptions.bundler, never>>(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want, however, to test in a container running the latest Keycloak version
|
const containerKeycloakVersion = "23.0.0";
|
||||||
const containerKeycloakVersion = "21.1.2";
|
|
||||||
|
|
||||||
generateStartKeycloakTestingContainer({
|
generateStartKeycloakTestingContainer({
|
||||||
keycloakThemeBuildingDirPath: buildOptions.keycloakifyBuildDirPath,
|
|
||||||
"keycloakVersion": containerKeycloakVersion,
|
"keycloakVersion": containerKeycloakVersion,
|
||||||
|
jarFilePath,
|
||||||
buildOptions
|
buildOptions
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.log(
|
logger.log(
|
||||||
[
|
[
|
||||||
"",
|
"",
|
||||||
`✅ Your keycloak theme has been generated and bundled into .${pathSep}${pathRelative(projectDirPath, jarFilePath)} 🚀`,
|
...(!buildOptions.doCreateJar
|
||||||
`It is to be placed in "/opt/keycloak/providers" in the container running a quay.io/keycloak/keycloak Docker image.`,
|
? []
|
||||||
"",
|
: [
|
||||||
|
`✅ Your keycloak theme has been generated and bundled into .${pathSep}${pathRelative(reactAppRootDirPath, jarFilePath)} 🚀`,
|
||||||
|
`It is to be placed in "/opt/keycloak/providers" in the container running a quay.io/keycloak/keycloak Docker image.`,
|
||||||
|
""
|
||||||
|
]),
|
||||||
//TODO: Restore when we find a good Helm chart for Keycloak.
|
//TODO: Restore when we find a good Helm chart for Keycloak.
|
||||||
//"Using Helm (https://github.com/codecentric/helm-charts), edit to reflect:",
|
//"Using Helm (https://github.com/codecentric/helm-charts), edit to reflect:",
|
||||||
"",
|
"",
|
||||||
@ -139,7 +133,7 @@ export async function main() {
|
|||||||
`To test your theme locally you can spin up a Keycloak ${containerKeycloakVersion} container image with the theme pre loaded by running:`,
|
`To test your theme locally you can spin up a Keycloak ${containerKeycloakVersion} container image with the theme pre loaded by running:`,
|
||||||
"",
|
"",
|
||||||
`👉 $ .${pathSep}${pathRelative(
|
`👉 $ .${pathSep}${pathRelative(
|
||||||
projectDirPath,
|
reactAppRootDirPath,
|
||||||
pathJoin(buildOptions.keycloakifyBuildDirPath, generateStartKeycloakTestingContainer.basename)
|
pathJoin(buildOptions.keycloakifyBuildDirPath, generateStartKeycloakTestingContainer.basename)
|
||||||
)} 👈`,
|
)} 👈`,
|
||||||
"",
|
"",
|
||||||
@ -149,15 +143,15 @@ export async function main() {
|
|||||||
"- Log into the admin console 👉 http://localhost:8080/admin username: admin, password: admin 👈",
|
"- Log into the admin console 👉 http://localhost:8080/admin username: admin, password: admin 👈",
|
||||||
`- Create a realm: Master -> AddRealm -> Name: myrealm`,
|
`- Create a realm: Master -> AddRealm -> Name: myrealm`,
|
||||||
`- Enable registration: Realm settings -> Login tab -> User registration: on`,
|
`- Enable registration: Realm settings -> Login tab -> User registration: on`,
|
||||||
`- Enable the Account theme (optional): Realm settings -> Themes tab -> Account theme: ${buildOptions.themeName}`,
|
`- Enable the Account theme (optional): Realm settings -> Themes tab -> Account theme: ${buildOptions.themeNames[0]}`,
|
||||||
` Clients -> account -> Login theme: ${buildOptions.themeName}`,
|
` Clients -> account -> Login theme: ${buildOptions.themeNames[0]}`,
|
||||||
`- Enable the email theme (optional): Realm settings -> Themes tab -> Email theme: ${buildOptions.themeName} (option will appear only if you have ran npx initialize-email-theme)`,
|
`- Enable the email theme (optional): Realm settings -> Themes tab -> Email theme: ${buildOptions.themeNames[0]} (option will appear only if you have ran npx initialize-email-theme)`,
|
||||||
`- Create a client Clients -> Create -> Client ID: myclient`,
|
`- Create a client Clients -> Create -> Client ID: myclient`,
|
||||||
` Root URL: https://www.keycloak.org/app/`,
|
` Root URL: https://www.keycloak.org/app/`,
|
||||||
` Valid redirect URIs: https://www.keycloak.org/app* http://localhost* (localhost is optional)`,
|
` Valid redirect URIs: https://www.keycloak.org/app* http://localhost* (localhost is optional)`,
|
||||||
` Valid post logout redirect URIs: https://www.keycloak.org/app* http://localhost*`,
|
` Valid post logout redirect URIs: https://www.keycloak.org/app* http://localhost*`,
|
||||||
` Web origins: *`,
|
` Web origins: *`,
|
||||||
` Login Theme: ${buildOptions.themeName}`,
|
` Login Theme: ${buildOptions.themeNames[0]}`,
|
||||||
` Save (button at the bottom of the page)`,
|
` Save (button at the bottom of the page)`,
|
||||||
``,
|
``,
|
||||||
`- Go to 👉 https://www.keycloak.org/app/ 👈 Click "Save" then "Sign in". You should see your login page`,
|
`- Go to 👉 https://www.keycloak.org/app/ 👈 Click "Save" then "Sign in". You should see your login page`,
|
||||||
|
@ -4,8 +4,6 @@ import type { Equals } from "tsafe";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { pathJoin } from "../tools/pathJoin";
|
import { pathJoin } from "../tools/pathJoin";
|
||||||
|
|
||||||
export const bundlers = ["mvn", "keycloakify", "none"] as const;
|
|
||||||
export type Bundler = (typeof bundlers)[number];
|
|
||||||
export type ParsedPackageJson = {
|
export type ParsedPackageJson = {
|
||||||
name: string;
|
name: string;
|
||||||
version?: string;
|
version?: string;
|
||||||
@ -15,12 +13,12 @@ export type ParsedPackageJson = {
|
|||||||
areAppAndKeycloakServerSharingSameDomain?: boolean;
|
areAppAndKeycloakServerSharingSameDomain?: boolean;
|
||||||
artifactId?: string;
|
artifactId?: string;
|
||||||
groupId?: string;
|
groupId?: string;
|
||||||
bundler?: Bundler;
|
doCreateJar?: boolean;
|
||||||
keycloakVersionDefaultAssets?: string;
|
loginThemeResourcesFromKeycloakVersion?: string;
|
||||||
reactAppBuildDirPath?: string;
|
reactAppBuildDirPath?: string;
|
||||||
keycloakifyBuildDirPath?: string;
|
keycloakifyBuildDirPath?: string;
|
||||||
themeName?: string;
|
themeName?: string | string[];
|
||||||
extraThemeNames?: string[];
|
doBuildRetrocompatAccountTheme?: boolean;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -34,12 +32,12 @@ export const zParsedPackageJson = z.object({
|
|||||||
"areAppAndKeycloakServerSharingSameDomain": z.boolean().optional(),
|
"areAppAndKeycloakServerSharingSameDomain": z.boolean().optional(),
|
||||||
"artifactId": z.string().optional(),
|
"artifactId": z.string().optional(),
|
||||||
"groupId": z.string().optional(),
|
"groupId": z.string().optional(),
|
||||||
"bundler": z.enum(bundlers).optional(),
|
"doCreateJar": z.boolean().optional(),
|
||||||
"keycloakVersionDefaultAssets": z.string().optional(),
|
"loginThemeResourcesFromKeycloakVersion": z.string().optional(),
|
||||||
"reactAppBuildDirPath": z.string().optional(),
|
"reactAppBuildDirPath": z.string().optional(),
|
||||||
"keycloakifyBuildDirPath": z.string().optional(),
|
"keycloakifyBuildDirPath": z.string().optional(),
|
||||||
"themeName": z.string().optional(),
|
"themeName": z.union([z.string(), z.array(z.string())]).optional(),
|
||||||
"extraThemeNames": z.array(z.string()).optional()
|
"doBuildRetrocompatAccountTheme": z.boolean().optional()
|
||||||
})
|
})
|
||||||
.optional()
|
.optional()
|
||||||
});
|
});
|
||||||
@ -47,11 +45,11 @@ export const zParsedPackageJson = z.object({
|
|||||||
assert<Equals<ReturnType<(typeof zParsedPackageJson)["parse"]>, ParsedPackageJson>>();
|
assert<Equals<ReturnType<(typeof zParsedPackageJson)["parse"]>, ParsedPackageJson>>();
|
||||||
|
|
||||||
let parsedPackageJson: undefined | ReturnType<(typeof zParsedPackageJson)["parse"]>;
|
let parsedPackageJson: undefined | ReturnType<(typeof zParsedPackageJson)["parse"]>;
|
||||||
export function getParsedPackageJson(params: { projectDirPath: string }) {
|
export function getParsedPackageJson(params: { reactAppRootDirPath: string }) {
|
||||||
const { projectDirPath } = params;
|
const { reactAppRootDirPath } = params;
|
||||||
if (parsedPackageJson) {
|
if (parsedPackageJson) {
|
||||||
return parsedPackageJson;
|
return parsedPackageJson;
|
||||||
}
|
}
|
||||||
parsedPackageJson = zParsedPackageJson.parse(JSON.parse(fs.readFileSync(pathJoin(projectDirPath, "package.json")).toString("utf8")));
|
parsedPackageJson = zParsedPackageJson.parse(JSON.parse(fs.readFileSync(pathJoin(reactAppRootDirPath, "package.json")).toString("utf8")));
|
||||||
return parsedPackageJson;
|
return parsedPackageJson;
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,32 @@
|
|||||||
import { ftlValuesGlobalName } from "../ftlValuesGlobalName";
|
import { ftlValuesGlobalName } from "../ftlValuesGlobalName";
|
||||||
|
|
||||||
export function replaceImportsFromStaticInJsCode(params: { jsCode: string }): { fixedJsCode: string } {
|
export function replaceImportsFromStaticInJsCode(params: { jsCode: string; bundler: "vite" | "webpack" }): { fixedJsCode: string } {
|
||||||
/*
|
const { jsCode } = params;
|
||||||
NOTE:
|
|
||||||
|
|
||||||
When we have urlOrigin defined it means that
|
const { fixedJsCode } = (() => {
|
||||||
we are building with --external-assets
|
switch (params.bundler) {
|
||||||
so we have to make sur that the fixed js code will run
|
case "vite":
|
||||||
inside and outside keycloak.
|
return replaceImportsFromStaticInJsCode_vite({ jsCode });
|
||||||
|
case "webpack":
|
||||||
|
return replaceImportsFromStaticInJsCode_webpack({ jsCode });
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
When urlOrigin isn't defined we can assume the fixedJsCode
|
return { fixedJsCode };
|
||||||
will always run in keycloak context.
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
|
export function replaceImportsFromStaticInJsCode_vite(params: { jsCode: string }): { fixedJsCode: string } {
|
||||||
|
const { jsCode } = params;
|
||||||
|
|
||||||
|
const fixedJsCode = jsCode.replace(
|
||||||
|
/\.viteFileDeps = \[(.*)\]/g,
|
||||||
|
(...args) => `.viteFileDeps = [${args[1]}].map(viteFileDep => window.kcContext.url.resourcesPath.substring(1) + "/build/" + viteFileDep)`
|
||||||
|
);
|
||||||
|
|
||||||
|
return { fixedJsCode };
|
||||||
|
}
|
||||||
|
|
||||||
|
export function replaceImportsFromStaticInJsCode_webpack(params: { jsCode: string }): { fixedJsCode: string } {
|
||||||
const { jsCode } = params;
|
const { jsCode } = params;
|
||||||
|
|
||||||
const getReplaceArgs = (language: "js" | "css"): Parameters<typeof String.prototype.replace> => [
|
const getReplaceArgs = (language: "js" | "css"): Parameters<typeof String.prototype.replace> => [
|
||||||
|
@ -16,7 +16,7 @@ export function replaceImportsInCssCode(params: { cssCode: string }): {
|
|||||||
|
|
||||||
const cssGlobalsToDefine: Record<string, string> = {};
|
const cssGlobalsToDefine: Record<string, string> = {};
|
||||||
|
|
||||||
new Set(cssCode.match(/url\(["']?\/[^/][^)"']+["']?\)[^;}]*/g) ?? []).forEach(
|
new Set(cssCode.match(/url\(["']?\/[^/][^)"']+["']?\)[^;}]*?/g) ?? []).forEach(
|
||||||
match => (cssGlobalsToDefine["url" + crypto.createHash("sha256").update(match).digest("hex").substring(0, 15)] = match)
|
match => (cssGlobalsToDefine["url" + crypto.createHash("sha256").update(match).digest("hex").substring(0, 15)] = match)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
import { pathJoin } from "./tools/pathJoin";
|
|
||||||
|
|
||||||
export const basenameOfKeycloakDirInPublicDir = "keycloak-resources";
|
|
||||||
export const resourcesDirPathRelativeToPublicDir = pathJoin(basenameOfKeycloakDirInPublicDir, "resources");
|
|
||||||
export const resourcesCommonDirPathRelativeToPublicDir = pathJoin(resourcesDirPathRelativeToPublicDir, "resources_common");
|
|
@ -162,7 +162,7 @@ export async function downloadAndUnzip(
|
|||||||
} & (
|
} & (
|
||||||
| {
|
| {
|
||||||
doUseCache: true;
|
doUseCache: true;
|
||||||
projectDirPath: string;
|
cacheDirPath: string;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
doUseCache: false;
|
doUseCache: false;
|
||||||
@ -182,11 +182,10 @@ export async function downloadAndUnzip(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const cacheRoot = !rest.doUseCache
|
const cacheDirPath = !rest.doUseCache ? `tmp_${Math.random().toString().slice(2, 12)}` : rest.cacheDirPath;
|
||||||
? `tmp_${Math.random().toString().slice(2, 12)}`
|
|
||||||
: pathJoin(process.env.XDG_CACHE_HOME ?? pathJoin(rest.projectDirPath, "node_modules", ".cache"), "keycloakify");
|
const zipFilePath = pathJoin(cacheDirPath, `${zipFileBasename}.zip`);
|
||||||
const zipFilePath = pathJoin(cacheRoot, `${zipFileBasename}.zip`);
|
const extractDirPath = pathJoin(cacheDirPath, `tmp_unzip_${zipFileBasename}`);
|
||||||
const extractDirPath = pathJoin(cacheRoot, `tmp_unzip_${zipFileBasename}`);
|
|
||||||
|
|
||||||
if (!(await exists(zipFilePath))) {
|
if (!(await exists(zipFilePath))) {
|
||||||
const opts = await getFetchOptions();
|
const opts = await getFetchOptions();
|
||||||
@ -226,7 +225,7 @@ export async function downloadAndUnzip(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!rest.doUseCache) {
|
if (!rest.doUseCache) {
|
||||||
await rm(cacheRoot, { "recursive": true });
|
await rm(cacheDirPath, { "recursive": true });
|
||||||
} else {
|
} else {
|
||||||
await rm(extractDirPath, { "recursive": true });
|
await rm(extractDirPath, { "recursive": true });
|
||||||
}
|
}
|
||||||
|
15
src/bin/tools/getAbsoluteAndInOsFormatPath.ts
Normal file
15
src/bin/tools/getAbsoluteAndInOsFormatPath.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { isAbsolute as pathIsAbsolute, sep as pathSep, join as pathJoin } from "path";
|
||||||
|
|
||||||
|
export function getAbsoluteAndInOsFormatPath(params: { pathIsh: string; cwd: string }): string {
|
||||||
|
const { pathIsh, cwd } = params;
|
||||||
|
|
||||||
|
let pathOut = pathIsh;
|
||||||
|
|
||||||
|
pathOut = pathOut.replace(/\//g, pathSep);
|
||||||
|
|
||||||
|
if (!pathIsAbsolute(pathOut)) {
|
||||||
|
pathOut = pathJoin(cwd, pathOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pathOut;
|
||||||
|
}
|
@ -1,99 +0,0 @@
|
|||||||
import { dirname, relative, sep, join } from "path";
|
|
||||||
import { createWriteStream } from "fs";
|
|
||||||
|
|
||||||
import walk from "./walk";
|
|
||||||
import { ZipFile } from "yazl";
|
|
||||||
import { mkdir } from "fs/promises";
|
|
||||||
import trimIndent from "./trimIndent";
|
|
||||||
|
|
||||||
export type ZipEntry = { zipPath: string } & ({ fsPath: string } | { buffer: Buffer });
|
|
||||||
export type ZipEntryGenerator = AsyncGenerator<ZipEntry, void, unknown>;
|
|
||||||
|
|
||||||
type CommonJarArgs = {
|
|
||||||
groupId: string;
|
|
||||||
artifactId: string;
|
|
||||||
version: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type JarStreamArgs = CommonJarArgs & {
|
|
||||||
asyncPathGeneratorFn(): ZipEntryGenerator;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type JarArgs = CommonJarArgs & {
|
|
||||||
targetPath: string;
|
|
||||||
rootPath: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function jarStream({ groupId, artifactId, version, asyncPathGeneratorFn }: JarStreamArgs) {
|
|
||||||
const manifestPath = "META-INF/MANIFEST.MF";
|
|
||||||
const manifestData = Buffer.from(trimIndent`
|
|
||||||
Manifest-Version: 1.0
|
|
||||||
Archiver-Version: Plexus Archiver
|
|
||||||
Created-By: Keycloakify
|
|
||||||
Built-By: unknown
|
|
||||||
Build-Jdk: 19.0.0
|
|
||||||
`);
|
|
||||||
|
|
||||||
const pomPropsPath = `META-INF/maven/${groupId}/${artifactId}/pom.properties`;
|
|
||||||
const pomPropsData = Buffer.from(trimIndent`
|
|
||||||
# Generated by keycloakify
|
|
||||||
# ${new Date()}
|
|
||||||
artifactId=${artifactId}
|
|
||||||
groupId=${groupId}
|
|
||||||
version=${version}
|
|
||||||
`);
|
|
||||||
|
|
||||||
const zipFile = new ZipFile();
|
|
||||||
|
|
||||||
for await (const entry of asyncPathGeneratorFn()) {
|
|
||||||
if ("buffer" in entry) {
|
|
||||||
zipFile.addBuffer(entry.buffer, entry.zipPath);
|
|
||||||
} else if ("fsPath" in entry) {
|
|
||||||
if (entry.fsPath.endsWith(sep)) {
|
|
||||||
zipFile.addEmptyDirectory(entry.zipPath);
|
|
||||||
} else {
|
|
||||||
zipFile.addFile(entry.fsPath, entry.zipPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
zipFile.addBuffer(manifestData, manifestPath);
|
|
||||||
zipFile.addBuffer(pomPropsData, pomPropsPath);
|
|
||||||
|
|
||||||
zipFile.end();
|
|
||||||
|
|
||||||
return zipFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a jar archive, using the resources found at `rootPath` (a directory) and write the
|
|
||||||
* archive to `targetPath` (a file). Use `groupId`, `artifactId` and `version` to define
|
|
||||||
* the contents of the pom.properties file which is going to be added to the archive.
|
|
||||||
* The root directory is expectedto have a conventional maven/gradle folder structure with a
|
|
||||||
* single `pom.xml` file at the root and a `src/main/resources` directory containing all
|
|
||||||
* application resources.
|
|
||||||
*/
|
|
||||||
export default async function jar({ groupId, artifactId, version, rootPath, targetPath }: JarArgs) {
|
|
||||||
await mkdir(dirname(targetPath), { recursive: true });
|
|
||||||
|
|
||||||
const asyncPathGeneratorFn = async function* (): ZipEntryGenerator {
|
|
||||||
const resourcesPath = join(rootPath, "src", "main", "resources");
|
|
||||||
for await (const fsPath of walk(resourcesPath)) {
|
|
||||||
const zipPath = relative(resourcesPath, fsPath).split(sep).join("/");
|
|
||||||
yield { fsPath, zipPath };
|
|
||||||
}
|
|
||||||
yield {
|
|
||||||
fsPath: join(rootPath, "pom.xml"),
|
|
||||||
zipPath: `META-INF/maven/${groupId}/${artifactId}/pom.xml`
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const zipFile = await jarStream({ groupId, artifactId, version, asyncPathGeneratorFn });
|
|
||||||
|
|
||||||
await new Promise<void>(async (resolve, reject) => {
|
|
||||||
zipFile.outputStream
|
|
||||||
.pipe(createWriteStream(targetPath, { encoding: "binary" }))
|
|
||||||
.on("close", () => resolve())
|
|
||||||
.on("error", e => reject(e));
|
|
||||||
});
|
|
||||||
}
|
|
@ -2,5 +2,5 @@ export function pathJoin(...path: string[]): string {
|
|||||||
return path
|
return path
|
||||||
.map((part, i) => (i === 0 ? part : part.replace(/^\/+/, "")))
|
.map((part, i) => (i === 0 ? part : part.replace(/^\/+/, "")))
|
||||||
.map((part, i) => (i === path.length - 1 ? part : part.replace(/\/+$/, "")))
|
.map((part, i) => (i === path.length - 1 ? part : part.replace(/\/+$/, "")))
|
||||||
.join("/");
|
.join(typeof process !== "undefined" && process.platform === "win32" ? "\\" : "/");
|
||||||
}
|
}
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
import { readdir } from "fs/promises";
|
|
||||||
import { resolve, sep } from "path";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Asynchronously and recursively walk a directory tree, yielding every file and directory
|
|
||||||
* found. Directory paths will _always_ end with a path separator.
|
|
||||||
*
|
|
||||||
* @param root the starting directory
|
|
||||||
* @returns AsyncGenerator
|
|
||||||
*/
|
|
||||||
export default async function* walk(root: string): AsyncGenerator<string, void, unknown> {
|
|
||||||
for (const entry of await readdir(root, { withFileTypes: true })) {
|
|
||||||
const absolutePath = resolve(root, entry.name);
|
|
||||||
if (entry.isDirectory()) {
|
|
||||||
yield absolutePath.endsWith(sep) ? absolutePath : absolutePath + sep;
|
|
||||||
yield* walk(absolutePath);
|
|
||||||
} else yield absolutePath.endsWith(sep) ? absolutePath.substring(0, absolutePath.length - 1) : absolutePath;
|
|
||||||
}
|
|
||||||
}
|
|
@ -45,6 +45,8 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.title = i18n.msgStr("loginTitle", kcContext.realm.displayName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={getClassName("kcLoginClass")}>
|
<div className={getClassName("kcLoginClass")}>
|
||||||
<div id="kc-header" className={getClassName("kcHeaderClass")}>
|
<div id="kc-header" className={getClassName("kcHeaderClass")}>
|
||||||
|
@ -95,4 +95,5 @@ export type ClassKey =
|
|||||||
| "kcAuthenticatorOtpCircleClass"
|
| "kcAuthenticatorOtpCircleClass"
|
||||||
| "kcSelectOTPItemHeadingClass"
|
| "kcSelectOTPItemHeadingClass"
|
||||||
| "kcFormOptionsWrapperClass"
|
| "kcFormOptionsWrapperClass"
|
||||||
| "kcFormButtonsWrapperClass";
|
| "kcFormButtonsWrapperClass"
|
||||||
|
| "kcInputGroup";
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import type { LoginThemePageId, ThemeType } from "keycloakify/bin/keycloakify/generateFtl";
|
import type { LoginThemePageId } from "keycloakify/bin/keycloakify/generateFtl";
|
||||||
|
import { type ThemeType } from "keycloakify/bin/constants";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import type { Equals } from "tsafe";
|
import type { Equals } from "tsafe";
|
||||||
import type { MessageKey } from "../i18n/i18n";
|
import type { MessageKey } from "../i18n/i18n";
|
||||||
@ -39,6 +40,7 @@ export type KcContext =
|
|||||||
|
|
||||||
export declare namespace KcContext {
|
export declare namespace KcContext {
|
||||||
export type Common = {
|
export type Common = {
|
||||||
|
themeVersion: string;
|
||||||
keycloakifyVersion: string;
|
keycloakifyVersion: string;
|
||||||
themeType: "login";
|
themeType: "login";
|
||||||
themeName: string;
|
themeName: string;
|
||||||
@ -80,6 +82,7 @@ export declare namespace KcContext {
|
|||||||
clientId: string;
|
clientId: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
attributes: Record<string, string>;
|
||||||
};
|
};
|
||||||
isAppInitiatedAction: boolean;
|
isAppInitiatedAction: boolean;
|
||||||
messagesPerField: {
|
messagesPerField: {
|
||||||
|
@ -8,9 +8,8 @@ import { assert } from "tsafe/assert";
|
|||||||
import type { ExtendKcContext } from "./getKcContextFromWindow";
|
import type { ExtendKcContext } from "./getKcContextFromWindow";
|
||||||
import { getKcContextFromWindow } from "./getKcContextFromWindow";
|
import { getKcContextFromWindow } from "./getKcContextFromWindow";
|
||||||
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
||||||
import { pathBasename } from "keycloakify/tools/pathBasename";
|
|
||||||
import { resourcesCommonDirPathRelativeToPublicDir } from "keycloakify/bin/mockTestingResourcesPath";
|
|
||||||
import { symToStr } from "tsafe/symToStr";
|
import { symToStr } from "tsafe/symToStr";
|
||||||
|
import { resources_common } from "keycloakify/bin/constants";
|
||||||
|
|
||||||
export function createGetKcContext<KcContextExtension extends { pageId: string } = never>(params?: {
|
export function createGetKcContext<KcContextExtension extends { pageId: string } = never>(params?: {
|
||||||
mockData?: readonly DeepPartial<ExtendKcContext<KcContextExtension>>[];
|
mockData?: readonly DeepPartial<ExtendKcContext<KcContextExtension>>[];
|
||||||
@ -148,11 +147,7 @@ export function createGetKcContext<KcContextExtension extends { pageId: string }
|
|||||||
return { "kcContext": undefined as any };
|
return { "kcContext": undefined as any };
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
realKcContext.url.resourcesCommonPath = pathJoin(realKcContext.url.resourcesPath, resources_common);
|
||||||
const { url } = realKcContext;
|
|
||||||
|
|
||||||
url.resourcesCommonPath = pathJoin(url.resourcesPath, pathBasename(resourcesCommonDirPathRelativeToPublicDir));
|
|
||||||
}
|
|
||||||
|
|
||||||
return { "kcContext": realKcContext as any };
|
return { "kcContext": realKcContext as any };
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import "minimal-polyfills/Object.fromEntries";
|
import "minimal-polyfills/Object.fromEntries";
|
||||||
import type { KcContext, Attribute } from "./KcContext";
|
import type { KcContext, Attribute } from "./KcContext";
|
||||||
import { resourcesCommonDirPathRelativeToPublicDir, resourcesDirPathRelativeToPublicDir } from "keycloakify/bin/mockTestingResourcesPath";
|
import { resources_common, keycloak_resources } from "keycloakify/bin/constants";
|
||||||
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
import { pathJoin } from "keycloakify/bin/tools/pathJoin";
|
||||||
import { id } from "tsafe/id";
|
import { id } from "tsafe/id";
|
||||||
import { assert, type Equals } from "tsafe/assert";
|
import { assert, type Equals } from "tsafe/assert";
|
||||||
import type { LoginThemePageId } from "keycloakify/bin/keycloakify/generateFtl";
|
import type { LoginThemePageId } from "keycloakify/bin/keycloakify/generateFtl";
|
||||||
|
|
||||||
const PUBLIC_URL = (typeof process !== "object" ? undefined : process.env?.["PUBLIC_URL"]) || "/";
|
|
||||||
|
|
||||||
const attributes: Attribute[] = [
|
const attributes: Attribute[] = [
|
||||||
{
|
{
|
||||||
"validators": {
|
"validators": {
|
||||||
@ -102,14 +100,19 @@ const attributes: Attribute[] = [
|
|||||||
|
|
||||||
const attributesByName = Object.fromEntries(attributes.map(attribute => [attribute.name, attribute])) as any;
|
const attributesByName = Object.fromEntries(attributes.map(attribute => [attribute.name, attribute])) as any;
|
||||||
|
|
||||||
|
const PUBLIC_URL = (typeof process !== "object" ? undefined : process.env?.["PUBLIC_URL"]) || "/";
|
||||||
|
|
||||||
|
const resourcesPath = pathJoin(PUBLIC_URL, keycloak_resources, "login", "resources");
|
||||||
|
|
||||||
export const kcContextCommonMock: KcContext.Common = {
|
export const kcContextCommonMock: KcContext.Common = {
|
||||||
|
"themeVersion": "0.0.0",
|
||||||
"keycloakifyVersion": "0.0.0",
|
"keycloakifyVersion": "0.0.0",
|
||||||
"themeType": "login",
|
"themeType": "login",
|
||||||
"themeName": "my-theme-name",
|
"themeName": "my-theme-name",
|
||||||
"url": {
|
"url": {
|
||||||
"loginAction": "#",
|
"loginAction": "#",
|
||||||
"resourcesPath": pathJoin(PUBLIC_URL, resourcesDirPathRelativeToPublicDir),
|
resourcesPath,
|
||||||
"resourcesCommonPath": pathJoin(PUBLIC_URL, resourcesCommonDirPathRelativeToPublicDir),
|
"resourcesCommonPath": pathJoin(resourcesPath, resources_common),
|
||||||
"loginRestartFlowUrl": "/auth/realms/myrealm/login-actions/restart?client_id=account&tab_id=HoAx28ja4xg",
|
"loginRestartFlowUrl": "/auth/realms/myrealm/login-actions/restart?client_id=account&tab_id=HoAx28ja4xg",
|
||||||
"loginUrl": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg"
|
"loginUrl": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg"
|
||||||
},
|
},
|
||||||
@ -231,7 +234,8 @@ export const kcContextCommonMock: KcContext.Common = {
|
|||||||
"showTryAnotherWayLink": false
|
"showTryAnotherWayLink": false
|
||||||
},
|
},
|
||||||
"client": {
|
"client": {
|
||||||
"clientId": "myApp"
|
"clientId": "myApp",
|
||||||
|
"attributes": {}
|
||||||
},
|
},
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"isAppInitiatedAction": false
|
"isAppInitiatedAction": false
|
||||||
@ -311,7 +315,8 @@ export const kcContextMocks = [
|
|||||||
"actionUri": "#",
|
"actionUri": "#",
|
||||||
"client": {
|
"client": {
|
||||||
"clientId": "myApp",
|
"clientId": "myApp",
|
||||||
"baseUrl": "#"
|
"baseUrl": "#",
|
||||||
|
"attributes": {}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
id<KcContext.Error>({
|
id<KcContext.Error>({
|
||||||
@ -319,7 +324,8 @@ export const kcContextMocks = [
|
|||||||
"pageId": "error.ftl",
|
"pageId": "error.ftl",
|
||||||
"client": {
|
"client": {
|
||||||
"clientId": "myApp",
|
"clientId": "myApp",
|
||||||
"baseUrl": "#"
|
"baseUrl": "#",
|
||||||
|
"attributes": {}
|
||||||
},
|
},
|
||||||
"message": {
|
"message": {
|
||||||
"type": "error",
|
"type": "error",
|
||||||
@ -493,7 +499,8 @@ export const kcContextMocks = [
|
|||||||
},
|
},
|
||||||
"client": {
|
"client": {
|
||||||
"clientId": "myApp",
|
"clientId": "myApp",
|
||||||
"baseUrl": "#"
|
"baseUrl": "#",
|
||||||
|
"attributes": {}
|
||||||
},
|
},
|
||||||
"logoutConfirm": { "code": "123", skipLink: false }
|
"logoutConfirm": { "code": "123", skipLink: false }
|
||||||
}),
|
}),
|
||||||
|
@ -67,6 +67,7 @@ export const { useGetClassName } = createUseClassName<ClassKey>({
|
|||||||
|
|
||||||
// css classes for input
|
// css classes for input
|
||||||
"kcInputLargeClass": "input-lg",
|
"kcInputLargeClass": "input-lg",
|
||||||
|
"kcInputGroup": "pf-c-input-group",
|
||||||
|
|
||||||
// css classes for form accessability
|
// css classes for form accessability
|
||||||
"kcSrOnlyClass": "sr-only",
|
"kcSrOnlyClass": "sr-only",
|
||||||
|
@ -8,7 +8,10 @@ export default function Info(props: PageProps<Extract<KcContext, { pageId: "info
|
|||||||
|
|
||||||
const { msgStr, msg } = i18n;
|
const { msgStr, msg } = i18n;
|
||||||
|
|
||||||
assert(kcContext.message !== undefined);
|
assert(
|
||||||
|
kcContext.message !== undefined,
|
||||||
|
"No message in kcContext.message, there will always be a message in production context, add it in your mock"
|
||||||
|
);
|
||||||
|
|
||||||
const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;
|
const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;
|
||||||
|
|
||||||
|
@ -37,22 +37,18 @@ export default function Login(props: PageProps<Extract<KcContext, { pageId: "log
|
|||||||
return (
|
return (
|
||||||
<Template
|
<Template
|
||||||
{...{ kcContext, i18n, doUseDefaultCss, classes }}
|
{...{ kcContext, i18n, doUseDefaultCss, classes }}
|
||||||
displayInfo={social.displayInfo}
|
displayInfo={realm.password && realm.registrationAllowed && !registrationDisabled}
|
||||||
displayWide={realm.password && social.providers !== undefined}
|
displayWide={realm.password && social.providers !== undefined}
|
||||||
headerNode={msg("doLogIn")}
|
headerNode={msg("doLogIn")}
|
||||||
infoNode={
|
infoNode={
|
||||||
realm.password &&
|
<div id="kc-registration">
|
||||||
realm.registrationAllowed &&
|
<span>
|
||||||
!registrationDisabled && (
|
{msg("noAccount")}
|
||||||
<div id="kc-registration">
|
<a tabIndex={6} href={url.registrationUrl}>
|
||||||
<span>
|
{msg("doRegister")}
|
||||||
{msg("noAccount")}
|
</a>
|
||||||
<a tabIndex={6} href={url.registrationUrl}>
|
</span>
|
||||||
{msg("doRegister")}
|
</div>
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div id="kc-form" className={clsx(realm.password && social.providers !== undefined && getClassName("kcContentWrapperClass"))}>
|
<div id="kc-form" className={clsx(realm.password && social.providers !== undefined && getClassName("kcContentWrapperClass"))}>
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import { clsx } from "keycloakify/tools/clsx";
|
import { clsx } from "keycloakify/tools/clsx";
|
||||||
import Template from "../Template";
|
|
||||||
import { I18n } from "../i18n";
|
import { I18n } from "../i18n";
|
||||||
import { KcContext } from "../kcContext";
|
import { KcContext } from "../kcContext";
|
||||||
import { useGetClassName } from "../lib/useGetClassName";
|
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
||||||
import { PageProps } from "./PageProps";
|
import { PageProps } from "./PageProps";
|
||||||
|
|
||||||
export default function LoginOauthGrant(props: PageProps<Extract<KcContext, { pageId: "login-oauth2-device-verify-user-code.ftl" }>, I18n>) {
|
export default function LoginOauthGrant(props: PageProps<Extract<KcContext, { pageId: "login-oauth2-device-verify-user-code.ftl" }>, I18n>) {
|
||||||
const { kcContext, i18n, doUseDefaultCss, classes } = props;
|
const { kcContext, i18n, doUseDefaultCss, classes, Template } = props;
|
||||||
const { url } = kcContext;
|
const { url } = kcContext;
|
||||||
|
|
||||||
const { msg, msgStr } = i18n;
|
const { msg, msgStr } = i18n;
|
||||||
|
@ -2,11 +2,10 @@ import { clsx } from "keycloakify/tools/clsx";
|
|||||||
import { PageProps } from "./PageProps";
|
import { PageProps } from "./PageProps";
|
||||||
import { KcContext } from "../kcContext";
|
import { KcContext } from "../kcContext";
|
||||||
import { I18n } from "../i18n";
|
import { I18n } from "../i18n";
|
||||||
import Template from "../Template";
|
|
||||||
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
||||||
|
|
||||||
export default function LoginOauthGrant(props: PageProps<Extract<KcContext, { pageId: "login-oauth-grant.ftl" }>, I18n>) {
|
export default function LoginOauthGrant(props: PageProps<Extract<KcContext, { pageId: "login-oauth-grant.ftl" }>, I18n>) {
|
||||||
const { kcContext, i18n, doUseDefaultCss, classes } = props;
|
const { kcContext, i18n, doUseDefaultCss, classes, Template } = props;
|
||||||
const { url, oauth, client } = kcContext;
|
const { url, oauth, client } = kcContext;
|
||||||
|
|
||||||
const { msg, msgStr, advancedMsg, advancedMsgStr } = i18n;
|
const { msg, msgStr, advancedMsg, advancedMsgStr } = i18n;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import type { LazyExoticComponent } from "react";
|
|
||||||
import type { I18n } from "keycloakify/login/i18n";
|
import type { I18n } from "keycloakify/login/i18n";
|
||||||
import { type TemplateProps, type ClassKey } from "keycloakify/login/TemplateProps";
|
import { type TemplateProps, type ClassKey } from "keycloakify/login/TemplateProps";
|
||||||
|
import type { LazyOrNot } from "keycloakify/tools/LazyOrNot";
|
||||||
|
|
||||||
export type PageProps<KcContext, I18nExtended extends I18n> = {
|
export type PageProps<KcContext, I18nExtended extends I18n> = {
|
||||||
Template: LazyExoticComponent<(props: TemplateProps<any, any>) => JSX.Element | null>;
|
Template: LazyOrNot<(props: TemplateProps<any, any>) => JSX.Element | null>;
|
||||||
kcContext: KcContext;
|
kcContext: KcContext;
|
||||||
i18n: I18nExtended;
|
i18n: I18nExtended;
|
||||||
doUseDefaultCss: boolean;
|
doUseDefaultCss: boolean;
|
||||||
|
3
src/tools/LazyOrNot.ts
Normal file
3
src/tools/LazyOrNot.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import type { LazyExoticComponent, ComponentType } from "react";
|
||||||
|
|
||||||
|
export type LazyOrNot<Component extends ComponentType<any>> = LazyExoticComponent<Component> | Component;
|
@ -14,7 +14,7 @@
|
|||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true
|
||||||
},
|
},
|
||||||
"exclude": ["./bin"],
|
"exclude": ["./bin", "./vite-plugin"],
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "./bin"
|
"path": "./bin"
|
||||||
|
1
src/vite-plugin/index.ts
Normal file
1
src/vite-plugin/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from "./vite-plugin";
|
12
src/vite-plugin/tsconfig.json
Normal file
12
src/vite-plugin/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsproject.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"module": "CommonJS",
|
||||||
|
"target": "ES5",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"lib": ["es2015", "ES2019.Object"],
|
||||||
|
"outDir": "../../dist/vite-plugin",
|
||||||
|
"rootDir": ".",
|
||||||
|
"skipLibCheck": true
|
||||||
|
}
|
||||||
|
}
|
31
src/vite-plugin/vite-plugin.ts
Normal file
31
src/vite-plugin/vite-plugin.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// index.ts
|
||||||
|
|
||||||
|
import type { Plugin, ResolvedConfig } from "vite";
|
||||||
|
import * as fs from "fs";
|
||||||
|
|
||||||
|
console.log("Hello world!");
|
||||||
|
|
||||||
|
export function keycloakify(): Plugin {
|
||||||
|
let config: ResolvedConfig;
|
||||||
|
|
||||||
|
return {
|
||||||
|
"name": "keycloakify",
|
||||||
|
|
||||||
|
"configResolved": resolvedConfig => {
|
||||||
|
// Store the resolved config
|
||||||
|
config = resolvedConfig;
|
||||||
|
|
||||||
|
console.log("========> configResolved", config);
|
||||||
|
|
||||||
|
fs.writeFileSync("/Users/joseph/github/keycloakify-starter/log.txt", Buffer.from("Hello World", "utf8"));
|
||||||
|
},
|
||||||
|
|
||||||
|
"buildStart": () => {
|
||||||
|
console.log("Public Directory:", config.publicDir); // Path to the public directory
|
||||||
|
console.log("Dist Directory:", config.build.outDir); // Path to the dist directory
|
||||||
|
console.log("Assets Directory:", config.build.assetsDir); // Path to the assets directory within outDir
|
||||||
|
}
|
||||||
|
|
||||||
|
// ... other hooks
|
||||||
|
};
|
||||||
|
}
|
@ -21,4 +21,13 @@ const meta: ComponentMeta<any> = {
|
|||||||
|
|
||||||
export default meta;
|
export default meta;
|
||||||
|
|
||||||
export const Default = () => <PageStory />;
|
export const Default = () => (
|
||||||
|
<PageStory
|
||||||
|
kcContext={{
|
||||||
|
message: {
|
||||||
|
summary: "This is the server message",
|
||||||
|
type: "info"
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
@ -1,131 +0,0 @@
|
|||||||
import jar, { jarStream, type ZipEntryGenerator } from "keycloakify/bin/tools/jar";
|
|
||||||
import { fromBuffer, Entry, ZipFile } from "yauzl";
|
|
||||||
import { it, describe, assert, afterAll } from "vitest";
|
|
||||||
import { Readable } from "stream";
|
|
||||||
import { tmpdir } from "os";
|
|
||||||
import { mkdtemp, cp, mkdir, rm, writeFile } from "fs/promises";
|
|
||||||
import path from "path";
|
|
||||||
import { createReadStream } from "fs";
|
|
||||||
import walk from "keycloakify/bin/tools/walk";
|
|
||||||
|
|
||||||
type AsyncIterable<T> = {
|
|
||||||
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
||||||
};
|
|
||||||
|
|
||||||
async function arrayFromAsync<T>(asyncIterable: AsyncIterable<T>) {
|
|
||||||
const chunks: T[] = [];
|
|
||||||
for await (const chunk of asyncIterable) chunks.push(chunk);
|
|
||||||
return chunks;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function readToBuffer(stream: NodeJS.ReadableStream) {
|
|
||||||
return Buffer.concat(await arrayFromAsync(stream as AsyncIterable<Buffer>));
|
|
||||||
}
|
|
||||||
|
|
||||||
function unzipBuffer(buffer: Buffer) {
|
|
||||||
return new Promise<ZipFile>((resolve, reject) =>
|
|
||||||
fromBuffer(buffer, { lazyEntries: true }, (err, zipFile) => {
|
|
||||||
if (err !== null) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(zipFile);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function readEntry(zipFile: ZipFile, entry: Entry): Promise<Readable> {
|
|
||||||
return new Promise<Readable>((resolve, reject) => {
|
|
||||||
zipFile.openReadStream(entry, (err, stream) => {
|
|
||||||
if (err !== null) {
|
|
||||||
reject(err);
|
|
||||||
} else {
|
|
||||||
resolve(stream);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function readAll(zipFile: ZipFile): Promise<Map<string, Buffer>> {
|
|
||||||
return new Promise<Map<string, Buffer>>((resolve, reject) => {
|
|
||||||
const entries1: Map<string, Buffer> = new Map();
|
|
||||||
zipFile.on("entry", async (entry: Entry) => {
|
|
||||||
const stream = await readEntry(zipFile, entry);
|
|
||||||
const buffer = await readToBuffer(stream);
|
|
||||||
entries1.set(entry.fileName, buffer);
|
|
||||||
zipFile.readEntry();
|
|
||||||
});
|
|
||||||
zipFile.on("end", () => resolve(entries1));
|
|
||||||
zipFile.on("error", e => reject(e));
|
|
||||||
zipFile.readEntry();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
describe("jar", () => {
|
|
||||||
const coords = { artifactId: "someArtifactId", groupId: "someGroupId", version: "1.2.3" };
|
|
||||||
|
|
||||||
const tmpDirs: string[] = [];
|
|
||||||
|
|
||||||
afterAll(async () => {
|
|
||||||
await Promise.all(tmpDirs.map(dir => rm(dir, { force: true, recursive: true })));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("creates jar artifacts without error", async () => {
|
|
||||||
async function* mockFiles(): ZipEntryGenerator {
|
|
||||||
yield { zipPath: "foo", buffer: Buffer.from("foo") };
|
|
||||||
}
|
|
||||||
|
|
||||||
const zipped = await jarStream({ ...coords, asyncPathGeneratorFn: mockFiles });
|
|
||||||
const buffered = await readToBuffer(zipped.outputStream);
|
|
||||||
const unzipped = await unzipBuffer(buffered);
|
|
||||||
const entries = await readAll(unzipped);
|
|
||||||
|
|
||||||
assert.equal(entries.size, 3);
|
|
||||||
assert.isOk(entries.has("foo"));
|
|
||||||
assert.isOk(entries.has("META-INF/MANIFEST.MF"));
|
|
||||||
assert.isOk(entries.has("META-INF/maven/someGroupId/someArtifactId/pom.properties"));
|
|
||||||
|
|
||||||
assert.equal("foo", entries.get("foo")?.toString("utf-8"));
|
|
||||||
|
|
||||||
const manifest = entries.get("META-INF/MANIFEST.MF")?.toString("utf-8");
|
|
||||||
const pomProperties = entries.get("META-INF/maven/someGroupId/someArtifactId/pom.properties")?.toString("utf-8");
|
|
||||||
|
|
||||||
assert.isOk(manifest?.includes("Created-By: Keycloakify"));
|
|
||||||
assert.isOk(pomProperties?.includes("1.2.3"));
|
|
||||||
assert.isOk(pomProperties?.includes("someGroupId"));
|
|
||||||
assert.isOk(pomProperties?.includes("someArtifactId"));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("creates a jar from _real_ files without error", async () => {
|
|
||||||
const tmp = await mkdtemp(path.join(tmpdir(), "kc-jar-test-"));
|
|
||||||
|
|
||||||
tmpDirs.push(tmp);
|
|
||||||
|
|
||||||
const rootPath = path.join(tmp, "root");
|
|
||||||
const resourcesPath = path.join(tmp, "root", "src", "main", "resources");
|
|
||||||
const targetPath = path.join(tmp, "jar.jar");
|
|
||||||
|
|
||||||
await mkdir(resourcesPath, { recursive: true });
|
|
||||||
await writeFile(path.join(rootPath, "pom.xml"), "foo", "utf-8");
|
|
||||||
|
|
||||||
await cp(path.dirname(__dirname), resourcesPath, { recursive: true });
|
|
||||||
|
|
||||||
await jar({ ...coords, rootPath, targetPath });
|
|
||||||
|
|
||||||
const buffered = await readToBuffer(createReadStream(targetPath));
|
|
||||||
const unzipped = await unzipBuffer(buffered);
|
|
||||||
const entries = await readAll(unzipped);
|
|
||||||
const zipPaths = Array.from(entries.keys());
|
|
||||||
|
|
||||||
assert.isOk(entries.has("META-INF/MANIFEST.MF"));
|
|
||||||
assert.isOk(entries.has("META-INF/maven/someGroupId/someArtifactId/pom.properties"));
|
|
||||||
assert.isOk(entries.has("META-INF/maven/someGroupId/someArtifactId/pom.xml"));
|
|
||||||
|
|
||||||
for await (const fsPath of walk(resourcesPath)) {
|
|
||||||
if (!fsPath.endsWith(path.sep)) {
|
|
||||||
const rel = path.relative(resourcesPath, fsPath).replace(path.sep === "/" ? /\//g : /\\/g, "/");
|
|
||||||
assert.isOk(zipPaths.includes(rel), `missing '${rel}' (${rel}, '${zipPaths.join("', '")}')`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
@ -67,9 +67,6 @@ describe("Ensure it's able to extract used Keycloak resources", () => {
|
|||||||
`
|
`
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(paths);
|
|
||||||
console.log(expectedPaths);
|
|
||||||
|
|
||||||
expect(same(paths, expectedPaths)).toBe(true);
|
expect(same(paths, expectedPaths)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -7,7 +7,38 @@ import { expect, it, describe } from "vitest";
|
|||||||
import { isSameCode } from "../tools/isSameCode";
|
import { isSameCode } from "../tools/isSameCode";
|
||||||
|
|
||||||
describe("bin/js-transforms", () => {
|
describe("bin/js-transforms", () => {
|
||||||
const jsCodeUntransformed = `
|
// Vite
|
||||||
|
{
|
||||||
|
const jsCodeUntransformed = `
|
||||||
|
function __vite__mapDeps(indexes) {
|
||||||
|
if (!__vite__mapDeps.viteFileDeps) {
|
||||||
|
__vite__mapDeps.viteFileDeps = ["assets/Login-dJpPRzM4.js", "assets/index-XwzrZ5Gu.js"]
|
||||||
|
}
|
||||||
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
it("Correctly replace import path in Vite dist/static/xxx.js files", () => {
|
||||||
|
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
|
||||||
|
"jsCode": jsCodeUntransformed,
|
||||||
|
"bundler": "vite"
|
||||||
|
});
|
||||||
|
|
||||||
|
const fixedJsCodeExpected = `
|
||||||
|
function __vite__mapDeps(indexes) {
|
||||||
|
if (!__vite__mapDeps.viteFileDeps) {
|
||||||
|
__vite__mapDeps.viteFileDeps = ["assets/Login-dJpPRzM4.js", "assets/index-XwzrZ5Gu.js"].map(viteFileDep => window.kcContext.url.resourcesPath.substring(1) + "/build/" + viteFileDep)
|
||||||
|
}
|
||||||
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
expect(isSameCode(fixedJsCode, fixedJsCodeExpected)).toBe(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Webpack
|
||||||
|
{
|
||||||
|
const jsCodeUntransformed = `
|
||||||
function f() {
|
function f() {
|
||||||
return a.p+"static/js/" + ({}[e] || e) + "." + {
|
return a.p+"static/js/" + ({}[e] || e) + "." + {
|
||||||
3: "0664cdc0"
|
3: "0664cdc0"
|
||||||
@ -37,12 +68,13 @@ describe("bin/js-transforms", () => {
|
|||||||
|
|
||||||
t.miniCssF=e=>"static/css/"+e+"."+{164:"dcfd7749",908:"67c9ed2c"}[e]+".chunk.css"
|
t.miniCssF=e=>"static/css/"+e+"."+{164:"dcfd7749",908:"67c9ed2c"}[e]+".chunk.css"
|
||||||
`;
|
`;
|
||||||
it("transforms standalone code properly", () => {
|
it("Correctly replace import path in Webpack build/static/js/xxx.js files", () => {
|
||||||
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
|
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
|
||||||
"jsCode": jsCodeUntransformed
|
"jsCode": jsCodeUntransformed,
|
||||||
});
|
"bundler": "webpack"
|
||||||
|
});
|
||||||
|
|
||||||
const fixedJsCodeExpected = `
|
const fixedJsCodeExpected = `
|
||||||
function f() {
|
function f() {
|
||||||
return window.kcContext.url.resourcesPath + "/build/static/js/" + ({}[e] || e) + "." + {
|
return window.kcContext.url.resourcesPath + "/build/static/js/" + ({}[e] || e) + "." + {
|
||||||
3: "0664cdc0"
|
3: "0664cdc0"
|
||||||
@ -111,8 +143,9 @@ describe("bin/js-transforms", () => {
|
|||||||
})()] = e => "/build/static/css/"+e+"."+{164:"dcfd7749",908:"67c9ed2c"}[e]+".chunk.css"
|
})()] = e => "/build/static/css/"+e+"."+{164:"dcfd7749",908:"67c9ed2c"}[e]+".chunk.css"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
expect(isSameCode(fixedJsCode, fixedJsCodeExpected)).toBe(true);
|
expect(isSameCode(fixedJsCode, fixedJsCodeExpected)).toBe(true);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("bin/css-transforms", () => {
|
describe("bin/css-transforms", () => {
|
||||||
@ -124,7 +157,7 @@ describe("bin/css-transforms", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.my-div2 {
|
.my-div2 {
|
||||||
background: url(/logo192.png) no-repeat center center;
|
background: url(/logo192.png) repeat center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-div {
|
.my-div {
|
||||||
@ -135,11 +168,11 @@ describe("bin/css-transforms", () => {
|
|||||||
|
|
||||||
const fixedCssCodeExpected = `
|
const fixedCssCodeExpected = `
|
||||||
.my-div {
|
.my-div {
|
||||||
background: var(--url1f9ef5a892c104c);
|
background: var(--urla882a969fd39473) no-repeat center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-div2 {
|
.my-div2 {
|
||||||
background: var(--url1f9ef5a892c104c);
|
background: var(--urla882a969fd39473) repeat center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-div {
|
.my-div {
|
||||||
@ -150,7 +183,7 @@ describe("bin/css-transforms", () => {
|
|||||||
expect(isSameCode(fixedCssCode, fixedCssCodeExpected)).toBe(true);
|
expect(isSameCode(fixedCssCode, fixedCssCodeExpected)).toBe(true);
|
||||||
|
|
||||||
const cssGlobalsToDefineExpected = {
|
const cssGlobalsToDefineExpected = {
|
||||||
"url1f9ef5a892c104c": "url(/logo192.png) no-repeat center center",
|
"urla882a969fd39473": "url(/logo192.png)",
|
||||||
"urldd75cab58377c19": "url(/static/media/something.svg)"
|
"urldd75cab58377c19": "url(/static/media/something.svg)"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -165,7 +198,7 @@ describe("bin/css-transforms", () => {
|
|||||||
|
|
||||||
const cssCodeToPrependInHeadExpected = `
|
const cssCodeToPrependInHeadExpected = `
|
||||||
:root {
|
:root {
|
||||||
--url1f9ef5a892c104c: url(\${url.resourcesPath}/build/logo192.png) no-repeat center center;
|
--urla882a969fd39473: url(\${url.resourcesPath}/build/logo192.png);
|
||||||
--urldd75cab58377c19: url(\${url.resourcesPath}/build/static/media/something.svg);
|
--urldd75cab58377c19: url(\${url.resourcesPath}/build/static/media/something.svg);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@ -191,11 +224,11 @@ describe("bin/css-transforms", () => {
|
|||||||
|
|
||||||
const fixedCssCodeExpected = `
|
const fixedCssCodeExpected = `
|
||||||
.my-div {
|
.my-div {
|
||||||
background: var(--urlf8277cddaa2be78);
|
background: var(--url749a3139386b2c8) no-repeat center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-div2 {
|
.my-div2 {
|
||||||
background: var(--urlf8277cddaa2be78);
|
background: var(--url749a3139386b2c8) no-repeat center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-div {
|
.my-div {
|
||||||
@ -206,7 +239,7 @@ describe("bin/css-transforms", () => {
|
|||||||
expect(isSameCode(fixedCssCode, fixedCssCodeExpected)).toBe(true);
|
expect(isSameCode(fixedCssCode, fixedCssCodeExpected)).toBe(true);
|
||||||
|
|
||||||
const cssGlobalsToDefineExpected = {
|
const cssGlobalsToDefineExpected = {
|
||||||
"urlf8277cddaa2be78": "url(/x/y/z/logo192.png) no-repeat center center",
|
"url749a3139386b2c8": "url(/x/y/z/logo192.png)",
|
||||||
"url8bdc0887b97ac9a": "url(/x/y/z/static/media/something.svg)"
|
"url8bdc0887b97ac9a": "url(/x/y/z/static/media/something.svg)"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -221,7 +254,7 @@ describe("bin/css-transforms", () => {
|
|||||||
|
|
||||||
const cssCodeToPrependInHeadExpected = `
|
const cssCodeToPrependInHeadExpected = `
|
||||||
:root {
|
:root {
|
||||||
--urlf8277cddaa2be78: url(\${url.resourcesPath}/build/logo192.png) no-repeat center center;
|
--url749a3139386b2c8: url(\${url.resourcesPath}/build/logo192.png);
|
||||||
--url8bdc0887b97ac9a: url(\${url.resourcesPath}/build/static/media/something.svg);
|
--url8bdc0887b97ac9a: url(\${url.resourcesPath}/build/static/media/something.svg);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
@ -24,7 +24,7 @@ vi.mock("keycloakify/bin/keycloakify/parsed-package-json", async () => ({
|
|||||||
|
|
||||||
vi.mock("keycloakify/bin/promptKeycloakVersion", async () => ({
|
vi.mock("keycloakify/bin/promptKeycloakVersion", async () => ({
|
||||||
...((await vi.importActual("keycloakify/bin/promptKeycloakVersion")) as Record<string, unknown>),
|
...((await vi.importActual("keycloakify/bin/promptKeycloakVersion")) as Record<string, unknown>),
|
||||||
promptKeycloakVersion: () => ({ keycloakVersion: "11.0.3" })
|
promptKeycloakVersion: () => ({ "keycloakVersion": "11.0.3" })
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const nativeCwd = process.cwd;
|
const nativeCwd = process.cwd;
|
||||||
@ -52,19 +52,25 @@ describe("Sample Project", () => {
|
|||||||
await setupSampleReactProject(sampleReactProjectDirPath);
|
await setupSampleReactProject(sampleReactProjectDirPath);
|
||||||
await initializeEmailTheme();
|
await initializeEmailTheme();
|
||||||
|
|
||||||
const projectDirPath = process.cwd();
|
const reactAppRootDirPath = process.cwd();
|
||||||
|
|
||||||
const destDirPath = pathJoin(
|
const destDirPath = pathJoin(
|
||||||
readBuildOptions({
|
readBuildOptions({
|
||||||
"processArgv": ["--silent"],
|
"processArgv": ["--silent"],
|
||||||
projectDirPath
|
reactAppRootDirPath
|
||||||
}).keycloakifyBuildDirPath,
|
}).keycloakifyBuildDirPath,
|
||||||
"src",
|
"src",
|
||||||
"main",
|
"main",
|
||||||
"resources",
|
"resources",
|
||||||
"theme"
|
"theme"
|
||||||
);
|
);
|
||||||
await downloadBuiltinKeycloakTheme({ destDirPath, "keycloakVersion": "11.0.3", projectDirPath });
|
await downloadBuiltinKeycloakTheme({
|
||||||
|
destDirPath,
|
||||||
|
"keycloakVersion": "11.0.3",
|
||||||
|
"buildOptions": {
|
||||||
|
"cacheDirPath": pathJoin(reactAppRootDirPath, "node_modules", ".cache", "keycloakify")
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
{ timeout: 90000 }
|
{ timeout: 90000 }
|
||||||
);
|
);
|
||||||
@ -80,19 +86,25 @@ describe("Sample Project", () => {
|
|||||||
await setupSampleReactProject(pathJoin(sampleReactProjectDirPath, "custom_input"));
|
await setupSampleReactProject(pathJoin(sampleReactProjectDirPath, "custom_input"));
|
||||||
await initializeEmailTheme();
|
await initializeEmailTheme();
|
||||||
|
|
||||||
const projectDirPath = process.cwd();
|
const reactAppRootDirPath = process.cwd();
|
||||||
|
|
||||||
const destDirPath = pathJoin(
|
const destDirPath = pathJoin(
|
||||||
readBuildOptions({
|
readBuildOptions({
|
||||||
"processArgv": ["--silent"],
|
"processArgv": ["--silent"],
|
||||||
projectDirPath
|
reactAppRootDirPath
|
||||||
}).keycloakifyBuildDirPath,
|
}).keycloakifyBuildDirPath,
|
||||||
"src",
|
"src",
|
||||||
"main",
|
"main",
|
||||||
"resources",
|
"resources",
|
||||||
"theme"
|
"theme"
|
||||||
);
|
);
|
||||||
await downloadBuiltinKeycloakTheme({ destDirPath, "keycloakVersion": "11.0.3", projectDirPath });
|
await downloadBuiltinKeycloakTheme({
|
||||||
|
destDirPath,
|
||||||
|
"keycloakVersion": "11.0.3",
|
||||||
|
buildOptions: {
|
||||||
|
"cacheDirPath": pathJoin(reactAppRootDirPath, "node_modules", ".cache", "keycloakify")
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
{ timeout: 90000 }
|
{ timeout: 90000 }
|
||||||
);
|
);
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
import trimIndent from "keycloakify/bin/tools/trimIndent";
|
|
||||||
import { it, describe, assert } from "vitest";
|
|
||||||
|
|
||||||
describe("trimIndent", () => {
|
|
||||||
it("does not change a left-aligned string as expected", () => {
|
|
||||||
const txt = trimIndent`lorem
|
|
||||||
ipsum`;
|
|
||||||
assert.equal(txt, ["lorem", "ipsum"].join("\n"));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("removes leading and trailing empty lines from a left-aligned string", () => {
|
|
||||||
const txt = trimIndent`
|
|
||||||
lorem
|
|
||||||
ipsum
|
|
||||||
`;
|
|
||||||
assert.equal(txt, ["lorem", "ipsum"].join("\n"));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("removes indent from an aligned string", () => {
|
|
||||||
const txt = trimIndent`
|
|
||||||
lorem
|
|
||||||
ipsum
|
|
||||||
`;
|
|
||||||
assert.equal(txt, ["lorem", "ipsum"].join("\n"));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("removes indent from unaligned string", () => {
|
|
||||||
const txt = trimIndent`
|
|
||||||
lorem
|
|
||||||
ipsum
|
|
||||||
`;
|
|
||||||
assert.equal(txt, ["lorem", " ipsum"].join("\n"));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("removes only first and last empty line", () => {
|
|
||||||
const txt = trimIndent`
|
|
||||||
|
|
||||||
lorem
|
|
||||||
ipsum
|
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
assert.equal(txt, ["", "lorem", "ipsum", ""].join("\n"));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("interpolates non-strings", () => {
|
|
||||||
const d = new Date();
|
|
||||||
const txt = trimIndent`
|
|
||||||
lorem
|
|
||||||
${d}
|
|
||||||
ipsum`;
|
|
||||||
|
|
||||||
assert.equal(txt, ["lorem", String(d), "ipsum"].join("\n"));
|
|
||||||
});
|
|
||||||
|
|
||||||
it("inderpolates preserving new-lines in the interpolated bits", () => {
|
|
||||||
const a = ["ipsum", "dolor", "sit"].join("\n");
|
|
||||||
const txt = trimIndent`
|
|
||||||
lorem
|
|
||||||
${a}
|
|
||||||
amet
|
|
||||||
`;
|
|
||||||
assert.equal(txt, ["lorem", "ipsum", "dolor", "sit", "amet"].join("\n"));
|
|
||||||
});
|
|
||||||
});
|
|
266
yarn.lock
266
yarn.lock
@ -1332,116 +1332,231 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz#ea89004119dc42db2e1dba0f97d553f7372f6fcb"
|
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz#ea89004119dc42db2e1dba0f97d553f7372f6fcb"
|
||||||
integrity sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==
|
integrity sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==
|
||||||
|
|
||||||
|
"@esbuild/aix-ppc64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz#d1bc06aedb6936b3b6d313bf809a5a40387d2b7f"
|
||||||
|
integrity sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==
|
||||||
|
|
||||||
"@esbuild/android-arm64@0.17.17":
|
"@esbuild/android-arm64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.17.tgz#164b054d58551f8856285f386e1a8f45d9ba3a31"
|
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.17.tgz#164b054d58551f8856285f386e1a8f45d9ba3a31"
|
||||||
integrity sha512-jaJ5IlmaDLFPNttv0ofcwy/cfeY4bh/n705Tgh+eLObbGtQBK3EPAu+CzL95JVE4nFAliyrnEu0d32Q5foavqg==
|
integrity sha512-jaJ5IlmaDLFPNttv0ofcwy/cfeY4bh/n705Tgh+eLObbGtQBK3EPAu+CzL95JVE4nFAliyrnEu0d32Q5foavqg==
|
||||||
|
|
||||||
|
"@esbuild/android-arm64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz#7ad65a36cfdb7e0d429c353e00f680d737c2aed4"
|
||||||
|
integrity sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==
|
||||||
|
|
||||||
"@esbuild/android-arm@0.17.17":
|
"@esbuild/android-arm@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.17.tgz#1b3b5a702a69b88deef342a7a80df4c894e4f065"
|
resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.17.tgz#1b3b5a702a69b88deef342a7a80df4c894e4f065"
|
||||||
integrity sha512-E6VAZwN7diCa3labs0GYvhEPL2M94WLF8A+czO8hfjREXxba8Ng7nM5VxV+9ihNXIY1iQO1XxUU4P7hbqbICxg==
|
integrity sha512-E6VAZwN7diCa3labs0GYvhEPL2M94WLF8A+czO8hfjREXxba8Ng7nM5VxV+9ihNXIY1iQO1XxUU4P7hbqbICxg==
|
||||||
|
|
||||||
|
"@esbuild/android-arm@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.12.tgz#b0c26536f37776162ca8bde25e42040c203f2824"
|
||||||
|
integrity sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==
|
||||||
|
|
||||||
"@esbuild/android-x64@0.17.17":
|
"@esbuild/android-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.17.tgz#6781527e3c4ea4de532b149d18a2167f06783e7f"
|
resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.17.tgz#6781527e3c4ea4de532b149d18a2167f06783e7f"
|
||||||
integrity sha512-446zpfJ3nioMC7ASvJB1pszHVskkw4u/9Eu8s5yvvsSDTzYh4p4ZIRj0DznSl3FBF0Z/mZfrKXTtt0QCoFmoHA==
|
integrity sha512-446zpfJ3nioMC7ASvJB1pszHVskkw4u/9Eu8s5yvvsSDTzYh4p4ZIRj0DznSl3FBF0Z/mZfrKXTtt0QCoFmoHA==
|
||||||
|
|
||||||
|
"@esbuild/android-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.12.tgz#cb13e2211282012194d89bf3bfe7721273473b3d"
|
||||||
|
integrity sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==
|
||||||
|
|
||||||
"@esbuild/darwin-arm64@0.17.17":
|
"@esbuild/darwin-arm64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.17.tgz#c5961ef4d3c1cc80dafe905cc145b5a71d2ac196"
|
resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.17.tgz#c5961ef4d3c1cc80dafe905cc145b5a71d2ac196"
|
||||||
integrity sha512-m/gwyiBwH3jqfUabtq3GH31otL/0sE0l34XKpSIqR7NjQ/XHQ3lpmQHLHbG8AHTGCw8Ao059GvV08MS0bhFIJQ==
|
integrity sha512-m/gwyiBwH3jqfUabtq3GH31otL/0sE0l34XKpSIqR7NjQ/XHQ3lpmQHLHbG8AHTGCw8Ao059GvV08MS0bhFIJQ==
|
||||||
|
|
||||||
|
"@esbuild/darwin-arm64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz#cbee41e988020d4b516e9d9e44dd29200996275e"
|
||||||
|
integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==
|
||||||
|
|
||||||
"@esbuild/darwin-x64@0.17.17":
|
"@esbuild/darwin-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.17.tgz#b81f3259cc349691f67ae30f7b333a53899b3c20"
|
resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.17.tgz#b81f3259cc349691f67ae30f7b333a53899b3c20"
|
||||||
integrity sha512-4utIrsX9IykrqYaXR8ob9Ha2hAY2qLc6ohJ8c0CN1DR8yWeMrTgYFjgdeQ9LIoTOfLetXjuCu5TRPHT9yKYJVg==
|
integrity sha512-4utIrsX9IykrqYaXR8ob9Ha2hAY2qLc6ohJ8c0CN1DR8yWeMrTgYFjgdeQ9LIoTOfLetXjuCu5TRPHT9yKYJVg==
|
||||||
|
|
||||||
|
"@esbuild/darwin-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz#e37d9633246d52aecf491ee916ece709f9d5f4cd"
|
||||||
|
integrity sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==
|
||||||
|
|
||||||
"@esbuild/freebsd-arm64@0.17.17":
|
"@esbuild/freebsd-arm64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.17.tgz#db846ad16cf916fd3acdda79b85ea867cb100e87"
|
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.17.tgz#db846ad16cf916fd3acdda79b85ea867cb100e87"
|
||||||
integrity sha512-4PxjQII/9ppOrpEwzQ1b0pXCsFLqy77i0GaHodrmzH9zq2/NEhHMAMJkJ635Ns4fyJPFOlHMz4AsklIyRqFZWA==
|
integrity sha512-4PxjQII/9ppOrpEwzQ1b0pXCsFLqy77i0GaHodrmzH9zq2/NEhHMAMJkJ635Ns4fyJPFOlHMz4AsklIyRqFZWA==
|
||||||
|
|
||||||
|
"@esbuild/freebsd-arm64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz#1ee4d8b682ed363b08af74d1ea2b2b4dbba76487"
|
||||||
|
integrity sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==
|
||||||
|
|
||||||
"@esbuild/freebsd-x64@0.17.17":
|
"@esbuild/freebsd-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.17.tgz#4dd99acbaaba00949d509e7c144b1b6ef9e1815b"
|
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.17.tgz#4dd99acbaaba00949d509e7c144b1b6ef9e1815b"
|
||||||
integrity sha512-lQRS+4sW5S3P1sv0z2Ym807qMDfkmdhUYX30GRBURtLTrJOPDpoU0kI6pVz1hz3U0+YQ0tXGS9YWveQjUewAJw==
|
integrity sha512-lQRS+4sW5S3P1sv0z2Ym807qMDfkmdhUYX30GRBURtLTrJOPDpoU0kI6pVz1hz3U0+YQ0tXGS9YWveQjUewAJw==
|
||||||
|
|
||||||
|
"@esbuild/freebsd-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz#37a693553d42ff77cd7126764b535fb6cc28a11c"
|
||||||
|
integrity sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==
|
||||||
|
|
||||||
"@esbuild/linux-arm64@0.17.17":
|
"@esbuild/linux-arm64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.17.tgz#7f9274140b2bb9f4230dbbfdf5dc2761215e30f6"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.17.tgz#7f9274140b2bb9f4230dbbfdf5dc2761215e30f6"
|
||||||
integrity sha512-2+pwLx0whKY1/Vqt8lyzStyda1v0qjJ5INWIe+d8+1onqQxHLLi3yr5bAa4gvbzhZqBztifYEu8hh1La5+7sUw==
|
integrity sha512-2+pwLx0whKY1/Vqt8lyzStyda1v0qjJ5INWIe+d8+1onqQxHLLi3yr5bAa4gvbzhZqBztifYEu8hh1La5+7sUw==
|
||||||
|
|
||||||
|
"@esbuild/linux-arm64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz#be9b145985ec6c57470e0e051d887b09dddb2d4b"
|
||||||
|
integrity sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==
|
||||||
|
|
||||||
"@esbuild/linux-arm@0.17.17":
|
"@esbuild/linux-arm@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.17.tgz#5c8e44c2af056bb2147cf9ad13840220bcb8948b"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.17.tgz#5c8e44c2af056bb2147cf9ad13840220bcb8948b"
|
||||||
integrity sha512-biDs7bjGdOdcmIk6xU426VgdRUpGg39Yz6sT9Xp23aq+IEHDb/u5cbmu/pAANpDB4rZpY/2USPhCA+w9t3roQg==
|
integrity sha512-biDs7bjGdOdcmIk6xU426VgdRUpGg39Yz6sT9Xp23aq+IEHDb/u5cbmu/pAANpDB4rZpY/2USPhCA+w9t3roQg==
|
||||||
|
|
||||||
|
"@esbuild/linux-arm@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz#207ecd982a8db95f7b5279207d0ff2331acf5eef"
|
||||||
|
integrity sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==
|
||||||
|
|
||||||
"@esbuild/linux-ia32@0.17.17":
|
"@esbuild/linux-ia32@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.17.tgz#18a6b3798658be7f46e9873fa0c8d4bec54c9212"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.17.tgz#18a6b3798658be7f46e9873fa0c8d4bec54c9212"
|
||||||
integrity sha512-IBTTv8X60dYo6P2t23sSUYym8fGfMAiuv7PzJ+0LcdAndZRzvke+wTVxJeCq4WgjppkOpndL04gMZIFvwoU34Q==
|
integrity sha512-IBTTv8X60dYo6P2t23sSUYym8fGfMAiuv7PzJ+0LcdAndZRzvke+wTVxJeCq4WgjppkOpndL04gMZIFvwoU34Q==
|
||||||
|
|
||||||
|
"@esbuild/linux-ia32@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz#d0d86b5ca1562523dc284a6723293a52d5860601"
|
||||||
|
integrity sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==
|
||||||
|
|
||||||
"@esbuild/linux-loong64@0.17.17":
|
"@esbuild/linux-loong64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.17.tgz#a8d93514a47f7b4232716c9f02aeb630bae24c40"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.17.tgz#a8d93514a47f7b4232716c9f02aeb630bae24c40"
|
||||||
integrity sha512-WVMBtcDpATjaGfWfp6u9dANIqmU9r37SY8wgAivuKmgKHE+bWSuv0qXEFt/p3qXQYxJIGXQQv6hHcm7iWhWjiw==
|
integrity sha512-WVMBtcDpATjaGfWfp6u9dANIqmU9r37SY8wgAivuKmgKHE+bWSuv0qXEFt/p3qXQYxJIGXQQv6hHcm7iWhWjiw==
|
||||||
|
|
||||||
|
"@esbuild/linux-loong64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz#9a37f87fec4b8408e682b528391fa22afd952299"
|
||||||
|
integrity sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==
|
||||||
|
|
||||||
"@esbuild/linux-mips64el@0.17.17":
|
"@esbuild/linux-mips64el@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.17.tgz#4784efb1c3f0eac8133695fa89253d558149ee1b"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.17.tgz#4784efb1c3f0eac8133695fa89253d558149ee1b"
|
||||||
integrity sha512-2kYCGh8589ZYnY031FgMLy0kmE4VoGdvfJkxLdxP4HJvWNXpyLhjOvxVsYjYZ6awqY4bgLR9tpdYyStgZZhi2A==
|
integrity sha512-2kYCGh8589ZYnY031FgMLy0kmE4VoGdvfJkxLdxP4HJvWNXpyLhjOvxVsYjYZ6awqY4bgLR9tpdYyStgZZhi2A==
|
||||||
|
|
||||||
|
"@esbuild/linux-mips64el@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz#4ddebd4e6eeba20b509d8e74c8e30d8ace0b89ec"
|
||||||
|
integrity sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==
|
||||||
|
|
||||||
"@esbuild/linux-ppc64@0.17.17":
|
"@esbuild/linux-ppc64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.17.tgz#ef6558ec5e5dd9dc16886343e0ccdb0699d70d3c"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.17.tgz#ef6558ec5e5dd9dc16886343e0ccdb0699d70d3c"
|
||||||
integrity sha512-KIdG5jdAEeAKogfyMTcszRxy3OPbZhq0PPsW4iKKcdlbk3YE4miKznxV2YOSmiK/hfOZ+lqHri3v8eecT2ATwQ==
|
integrity sha512-KIdG5jdAEeAKogfyMTcszRxy3OPbZhq0PPsW4iKKcdlbk3YE4miKznxV2YOSmiK/hfOZ+lqHri3v8eecT2ATwQ==
|
||||||
|
|
||||||
|
"@esbuild/linux-ppc64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz#adb67dadb73656849f63cd522f5ecb351dd8dee8"
|
||||||
|
integrity sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==
|
||||||
|
|
||||||
"@esbuild/linux-riscv64@0.17.17":
|
"@esbuild/linux-riscv64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.17.tgz#13a87fdbcb462c46809c9d16bcf79817ecf9ce6f"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.17.tgz#13a87fdbcb462c46809c9d16bcf79817ecf9ce6f"
|
||||||
integrity sha512-Cj6uWLBR5LWhcD/2Lkfg2NrkVsNb2sFM5aVEfumKB2vYetkA/9Uyc1jVoxLZ0a38sUhFk4JOVKH0aVdPbjZQeA==
|
integrity sha512-Cj6uWLBR5LWhcD/2Lkfg2NrkVsNb2sFM5aVEfumKB2vYetkA/9Uyc1jVoxLZ0a38sUhFk4JOVKH0aVdPbjZQeA==
|
||||||
|
|
||||||
|
"@esbuild/linux-riscv64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz#11bc0698bf0a2abf8727f1c7ace2112612c15adf"
|
||||||
|
integrity sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==
|
||||||
|
|
||||||
"@esbuild/linux-s390x@0.17.17":
|
"@esbuild/linux-s390x@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.17.tgz#83cb16d1d3ac0dca803b3f031ba3dc13f1ec7ade"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.17.tgz#83cb16d1d3ac0dca803b3f031ba3dc13f1ec7ade"
|
||||||
integrity sha512-lK+SffWIr0XsFf7E0srBjhpkdFVJf3HEgXCwzkm69kNbRar8MhezFpkIwpk0qo2IOQL4JE4mJPJI8AbRPLbuOQ==
|
integrity sha512-lK+SffWIr0XsFf7E0srBjhpkdFVJf3HEgXCwzkm69kNbRar8MhezFpkIwpk0qo2IOQL4JE4mJPJI8AbRPLbuOQ==
|
||||||
|
|
||||||
|
"@esbuild/linux-s390x@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz#e86fb8ffba7c5c92ba91fc3b27ed5a70196c3cc8"
|
||||||
|
integrity sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==
|
||||||
|
|
||||||
"@esbuild/linux-x64@0.17.17":
|
"@esbuild/linux-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.17.tgz#7bc400568690b688e20a0c94b2faabdd89ae1a79"
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.17.tgz#7bc400568690b688e20a0c94b2faabdd89ae1a79"
|
||||||
integrity sha512-XcSGTQcWFQS2jx3lZtQi7cQmDYLrpLRyz1Ns1DzZCtn898cWfm5Icx/DEWNcTU+T+tyPV89RQtDnI7qL2PObPg==
|
integrity sha512-XcSGTQcWFQS2jx3lZtQi7cQmDYLrpLRyz1Ns1DzZCtn898cWfm5Icx/DEWNcTU+T+tyPV89RQtDnI7qL2PObPg==
|
||||||
|
|
||||||
|
"@esbuild/linux-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz#5f37cfdc705aea687dfe5dfbec086a05acfe9c78"
|
||||||
|
integrity sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==
|
||||||
|
|
||||||
"@esbuild/netbsd-x64@0.17.17":
|
"@esbuild/netbsd-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.17.tgz#1b5dcfbc4bfba80e67a11e9148de836af5b58b6c"
|
resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.17.tgz#1b5dcfbc4bfba80e67a11e9148de836af5b58b6c"
|
||||||
integrity sha512-RNLCDmLP5kCWAJR+ItLM3cHxzXRTe4N00TQyQiimq+lyqVqZWGPAvcyfUBM0isE79eEZhIuGN09rAz8EL5KdLA==
|
integrity sha512-RNLCDmLP5kCWAJR+ItLM3cHxzXRTe4N00TQyQiimq+lyqVqZWGPAvcyfUBM0isE79eEZhIuGN09rAz8EL5KdLA==
|
||||||
|
|
||||||
|
"@esbuild/netbsd-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz#29da566a75324e0d0dd7e47519ba2f7ef168657b"
|
||||||
|
integrity sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==
|
||||||
|
|
||||||
"@esbuild/openbsd-x64@0.17.17":
|
"@esbuild/openbsd-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.17.tgz#e275098902291149a5dcd012c9ea0796d6b7adff"
|
resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.17.tgz#e275098902291149a5dcd012c9ea0796d6b7adff"
|
||||||
integrity sha512-PAXswI5+cQq3Pann7FNdcpSUrhrql3wKjj3gVkmuz6OHhqqYxKvi6GgRBoaHjaG22HV/ZZEgF9TlS+9ftHVigA==
|
integrity sha512-PAXswI5+cQq3Pann7FNdcpSUrhrql3wKjj3gVkmuz6OHhqqYxKvi6GgRBoaHjaG22HV/ZZEgF9TlS+9ftHVigA==
|
||||||
|
|
||||||
|
"@esbuild/openbsd-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz#306c0acbdb5a99c95be98bdd1d47c916e7dc3ff0"
|
||||||
|
integrity sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==
|
||||||
|
|
||||||
"@esbuild/sunos-x64@0.17.17":
|
"@esbuild/sunos-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.17.tgz#10603474866f64986c0370a2d4fe5a2bb7fee4f5"
|
resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.17.tgz#10603474866f64986c0370a2d4fe5a2bb7fee4f5"
|
||||||
integrity sha512-V63egsWKnx/4V0FMYkr9NXWrKTB5qFftKGKuZKFIrAkO/7EWLFnbBZNM1CvJ6Sis+XBdPws2YQSHF1Gqf1oj/Q==
|
integrity sha512-V63egsWKnx/4V0FMYkr9NXWrKTB5qFftKGKuZKFIrAkO/7EWLFnbBZNM1CvJ6Sis+XBdPws2YQSHF1Gqf1oj/Q==
|
||||||
|
|
||||||
|
"@esbuild/sunos-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz#0933eaab9af8b9b2c930236f62aae3fc593faf30"
|
||||||
|
integrity sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==
|
||||||
|
|
||||||
"@esbuild/win32-arm64@0.17.17":
|
"@esbuild/win32-arm64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.17.tgz#521a6d97ee0f96b7c435930353cc4e93078f0b54"
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.17.tgz#521a6d97ee0f96b7c435930353cc4e93078f0b54"
|
||||||
integrity sha512-YtUXLdVnd6YBSYlZODjWzH+KzbaubV0YVd6UxSfoFfa5PtNJNaW+1i+Hcmjpg2nEe0YXUCNF5bkKy1NnBv1y7Q==
|
integrity sha512-YtUXLdVnd6YBSYlZODjWzH+KzbaubV0YVd6UxSfoFfa5PtNJNaW+1i+Hcmjpg2nEe0YXUCNF5bkKy1NnBv1y7Q==
|
||||||
|
|
||||||
|
"@esbuild/win32-arm64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz#773bdbaa1971b36db2f6560088639ccd1e6773ae"
|
||||||
|
integrity sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==
|
||||||
|
|
||||||
"@esbuild/win32-ia32@0.17.17":
|
"@esbuild/win32-ia32@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.17.tgz#56f88462ebe82dad829dc2303175c0e0ccd8e38e"
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.17.tgz#56f88462ebe82dad829dc2303175c0e0ccd8e38e"
|
||||||
integrity sha512-yczSLRbDdReCO74Yfc5tKG0izzm+lPMYyO1fFTcn0QNwnKmc3K+HdxZWLGKg4pZVte7XVgcFku7TIZNbWEJdeQ==
|
integrity sha512-yczSLRbDdReCO74Yfc5tKG0izzm+lPMYyO1fFTcn0QNwnKmc3K+HdxZWLGKg4pZVte7XVgcFku7TIZNbWEJdeQ==
|
||||||
|
|
||||||
|
"@esbuild/win32-ia32@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz#000516cad06354cc84a73f0943a4aa690ef6fd67"
|
||||||
|
integrity sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==
|
||||||
|
|
||||||
"@esbuild/win32-x64@0.17.17":
|
"@esbuild/win32-x64@0.17.17":
|
||||||
version "0.17.17"
|
version "0.17.17"
|
||||||
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.17.tgz#2b577b976e6844106715bbe0cdc57cd1528063f9"
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.17.tgz#2b577b976e6844106715bbe0cdc57cd1528063f9"
|
||||||
integrity sha512-FNZw7H3aqhF9OyRQbDDnzUApDXfC1N6fgBhkqEO2jvYCJ+DxMTfZVqg3AX0R1khg1wHTBRD5SdcibSJ+XF6bFg==
|
integrity sha512-FNZw7H3aqhF9OyRQbDDnzUApDXfC1N6fgBhkqEO2jvYCJ+DxMTfZVqg3AX0R1khg1wHTBRD5SdcibSJ+XF6bFg==
|
||||||
|
|
||||||
|
"@esbuild/win32-x64@0.19.12":
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz#c57c8afbb4054a3ab8317591a0b7320360b444ae"
|
||||||
|
integrity sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==
|
||||||
|
|
||||||
"@eslint-community/eslint-utils@^4.2.0":
|
"@eslint-community/eslint-utils@^4.2.0":
|
||||||
version "4.4.0"
|
version "4.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
|
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
|
||||||
@ -1779,6 +1894,71 @@
|
|||||||
schema-utils "^3.0.0"
|
schema-utils "^3.0.0"
|
||||||
source-map "^0.7.3"
|
source-map "^0.7.3"
|
||||||
|
|
||||||
|
"@rollup/rollup-android-arm-eabi@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.6.tgz#66b8d9cb2b3a474d115500f9ebaf43e2126fe496"
|
||||||
|
integrity sha512-MVNXSSYN6QXOulbHpLMKYi60ppyO13W9my1qogeiAqtjb2yR4LSmfU2+POvDkLzhjYLXz9Rf9+9a3zFHW1Lecg==
|
||||||
|
|
||||||
|
"@rollup/rollup-android-arm64@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.6.tgz#46327d5b86420d2307946bec1535fdf00356e47d"
|
||||||
|
integrity sha512-T14aNLpqJ5wzKNf5jEDpv5zgyIqcpn1MlwCrUXLrwoADr2RkWA0vOWP4XxbO9aiO3dvMCQICZdKeDrFl7UMClw==
|
||||||
|
|
||||||
|
"@rollup/rollup-darwin-arm64@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.6.tgz#166987224d2f8b1e2fd28ee90c447d52271d5e90"
|
||||||
|
integrity sha512-CqNNAyhRkTbo8VVZ5R85X73H3R5NX9ONnKbXuHisGWC0qRbTTxnF1U4V9NafzJbgGM0sHZpdO83pLPzq8uOZFw==
|
||||||
|
|
||||||
|
"@rollup/rollup-darwin-x64@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.6.tgz#a2e6e096f74ccea6e2f174454c26aef6bcdd1274"
|
||||||
|
integrity sha512-zRDtdJuRvA1dc9Mp6BWYqAsU5oeLixdfUvkTHuiYOHwqYuQ4YgSmi6+/lPvSsqc/I0Omw3DdICx4Tfacdzmhog==
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-arm-gnueabihf@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.6.tgz#09fcd4c55a2d6160c5865fec708a8e5287f30515"
|
||||||
|
integrity sha512-oNk8YXDDnNyG4qlNb6is1ojTOGL/tRhbbKeE/YuccItzerEZT68Z9gHrY3ROh7axDc974+zYAPxK5SH0j/G+QQ==
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-arm64-gnu@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.6.tgz#19a3c0b6315c747ca9acf86e9b710cc2440f83c9"
|
||||||
|
integrity sha512-Z3O60yxPtuCYobrtzjo0wlmvDdx2qZfeAWTyfOjEDqd08kthDKexLpV97KfAeUXPosENKd8uyJMRDfFMxcYkDQ==
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-arm64-musl@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.6.tgz#94aaf95fdaf2ad9335983a4552759f98e6b2e850"
|
||||||
|
integrity sha512-gpiG0qQJNdYEVad+1iAsGAbgAnZ8j07FapmnIAQgODKcOTjLEWM9sRb+MbQyVsYCnA0Im6M6QIq6ax7liws6eQ==
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-riscv64-gnu@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.6.tgz#160510e63f4b12618af4013bddf1761cf9fc9880"
|
||||||
|
integrity sha512-+uCOcvVmFUYvVDr27aiyun9WgZk0tXe7ThuzoUTAukZJOwS5MrGbmSlNOhx1j80GdpqbOty05XqSl5w4dQvcOA==
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-x64-gnu@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.6.tgz#5ac5d068ce0726bd0a96ca260d5bd93721c0cb98"
|
||||||
|
integrity sha512-HUNqM32dGzfBKuaDUBqFB7tP6VMN74eLZ33Q9Y1TBqRDn+qDonkAUyKWwF9BR9unV7QUzffLnz9GrnKvMqC/fw==
|
||||||
|
|
||||||
|
"@rollup/rollup-linux-x64-musl@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz#bafa759ab43e8eab9edf242a8259ffb4f2a57a5d"
|
||||||
|
integrity sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==
|
||||||
|
|
||||||
|
"@rollup/rollup-win32-arm64-msvc@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.6.tgz#1cc3416682e5a20d8f088f26657e6e47f8db468e"
|
||||||
|
integrity sha512-VD6qnR99dhmTQ1mJhIzXsRcTBvTjbfbGGwKAHcu+52cVl15AC/kplkhxzW/uT0Xl62Y/meBKDZvoJSJN+vTeGA==
|
||||||
|
|
||||||
|
"@rollup/rollup-win32-ia32-msvc@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.6.tgz#7d2251e1aa5e8a1e47c86891fe4547a939503461"
|
||||||
|
integrity sha512-J9AFDq/xiRI58eR2NIDfyVmTYGyIZmRcvcAoJ48oDld/NTR8wyiPUu2X/v1navJ+N/FGg68LEbX3Ejd6l8B7MQ==
|
||||||
|
|
||||||
|
"@rollup/rollup-win32-x64-msvc@4.9.6":
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz#2c1fb69e02a3f1506f52698cfdc3a8b6386df9a6"
|
||||||
|
integrity sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ==
|
||||||
|
|
||||||
"@storybook/addon-a11y@^6.5.16":
|
"@storybook/addon-a11y@^6.5.16":
|
||||||
version "6.5.16"
|
version "6.5.16"
|
||||||
resolved "https://registry.yarnpkg.com/@storybook/addon-a11y/-/addon-a11y-6.5.16.tgz#9288a6c1d111fa4ec501d213100ffff91757d3fc"
|
resolved "https://registry.yarnpkg.com/@storybook/addon-a11y/-/addon-a11y-6.5.16.tgz#9288a6c1d111fa4ec501d213100ffff91757d3fc"
|
||||||
@ -2837,6 +3017,11 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194"
|
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194"
|
||||||
integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==
|
integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==
|
||||||
|
|
||||||
|
"@types/estree@1.0.5":
|
||||||
|
version "1.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
|
||||||
|
integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==
|
||||||
|
|
||||||
"@types/estree@^0.0.51":
|
"@types/estree@^0.0.51":
|
||||||
version "0.0.51"
|
version "0.0.51"
|
||||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40"
|
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40"
|
||||||
@ -5853,6 +6038,35 @@ esbuild@^0.17.5:
|
|||||||
"@esbuild/win32-ia32" "0.17.17"
|
"@esbuild/win32-ia32" "0.17.17"
|
||||||
"@esbuild/win32-x64" "0.17.17"
|
"@esbuild/win32-x64" "0.17.17"
|
||||||
|
|
||||||
|
esbuild@^0.19.3:
|
||||||
|
version "0.19.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.12.tgz#dc82ee5dc79e82f5a5c3b4323a2a641827db3e04"
|
||||||
|
integrity sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==
|
||||||
|
optionalDependencies:
|
||||||
|
"@esbuild/aix-ppc64" "0.19.12"
|
||||||
|
"@esbuild/android-arm" "0.19.12"
|
||||||
|
"@esbuild/android-arm64" "0.19.12"
|
||||||
|
"@esbuild/android-x64" "0.19.12"
|
||||||
|
"@esbuild/darwin-arm64" "0.19.12"
|
||||||
|
"@esbuild/darwin-x64" "0.19.12"
|
||||||
|
"@esbuild/freebsd-arm64" "0.19.12"
|
||||||
|
"@esbuild/freebsd-x64" "0.19.12"
|
||||||
|
"@esbuild/linux-arm" "0.19.12"
|
||||||
|
"@esbuild/linux-arm64" "0.19.12"
|
||||||
|
"@esbuild/linux-ia32" "0.19.12"
|
||||||
|
"@esbuild/linux-loong64" "0.19.12"
|
||||||
|
"@esbuild/linux-mips64el" "0.19.12"
|
||||||
|
"@esbuild/linux-ppc64" "0.19.12"
|
||||||
|
"@esbuild/linux-riscv64" "0.19.12"
|
||||||
|
"@esbuild/linux-s390x" "0.19.12"
|
||||||
|
"@esbuild/linux-x64" "0.19.12"
|
||||||
|
"@esbuild/netbsd-x64" "0.19.12"
|
||||||
|
"@esbuild/openbsd-x64" "0.19.12"
|
||||||
|
"@esbuild/sunos-x64" "0.19.12"
|
||||||
|
"@esbuild/win32-arm64" "0.19.12"
|
||||||
|
"@esbuild/win32-ia32" "0.19.12"
|
||||||
|
"@esbuild/win32-x64" "0.19.12"
|
||||||
|
|
||||||
escalade@^3.1.1:
|
escalade@^3.1.1:
|
||||||
version "3.1.1"
|
version "3.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
|
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
|
||||||
@ -6477,6 +6691,11 @@ fsevents@^2.1.2, fsevents@~2.3.2:
|
|||||||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
|
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
|
||||||
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
|
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
|
||||||
|
|
||||||
|
fsevents@~2.3.3:
|
||||||
|
version "2.3.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||||
|
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
|
||||||
|
|
||||||
function-bind@^1.1.1:
|
function-bind@^1.1.1:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
||||||
@ -8661,6 +8880,11 @@ nanoid@^3.3.1, nanoid@^3.3.6:
|
|||||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
|
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
|
||||||
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
|
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
|
||||||
|
|
||||||
|
nanoid@^3.3.7:
|
||||||
|
version "3.3.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8"
|
||||||
|
integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==
|
||||||
|
|
||||||
nanomatch@^1.2.9:
|
nanomatch@^1.2.9:
|
||||||
version "1.2.13"
|
version "1.2.13"
|
||||||
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
|
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
|
||||||
@ -9545,6 +9769,15 @@ postcss@^8.2.15, postcss@^8.4.21:
|
|||||||
picocolors "^1.0.0"
|
picocolors "^1.0.0"
|
||||||
source-map-js "^1.0.2"
|
source-map-js "^1.0.2"
|
||||||
|
|
||||||
|
postcss@^8.4.32:
|
||||||
|
version "8.4.33"
|
||||||
|
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.33.tgz#1378e859c9f69bf6f638b990a0212f43e2aaa742"
|
||||||
|
integrity sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==
|
||||||
|
dependencies:
|
||||||
|
nanoid "^3.3.7"
|
||||||
|
picocolors "^1.0.0"
|
||||||
|
source-map-js "^1.0.2"
|
||||||
|
|
||||||
powerhooks@^0.26.7:
|
powerhooks@^0.26.7:
|
||||||
version "0.26.7"
|
version "0.26.7"
|
||||||
resolved "https://registry.yarnpkg.com/powerhooks/-/powerhooks-0.26.7.tgz#3c9709a6012207e073aa268a775b352905ea46f5"
|
resolved "https://registry.yarnpkg.com/powerhooks/-/powerhooks-0.26.7.tgz#3c9709a6012207e073aa268a775b352905ea46f5"
|
||||||
@ -10305,6 +10538,28 @@ rollup@^3.18.0:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents "~2.3.2"
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
|
rollup@^4.2.0:
|
||||||
|
version "4.9.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.9.6.tgz#4515facb0318ecca254a2ee1315e22e09efc50a0"
|
||||||
|
integrity sha512-05lzkCS2uASX0CiLFybYfVkwNbKZG5NFQ6Go0VWyogFTXXbR039UVsegViTntkk4OglHBdF54ccApXRRuXRbsg==
|
||||||
|
dependencies:
|
||||||
|
"@types/estree" "1.0.5"
|
||||||
|
optionalDependencies:
|
||||||
|
"@rollup/rollup-android-arm-eabi" "4.9.6"
|
||||||
|
"@rollup/rollup-android-arm64" "4.9.6"
|
||||||
|
"@rollup/rollup-darwin-arm64" "4.9.6"
|
||||||
|
"@rollup/rollup-darwin-x64" "4.9.6"
|
||||||
|
"@rollup/rollup-linux-arm-gnueabihf" "4.9.6"
|
||||||
|
"@rollup/rollup-linux-arm64-gnu" "4.9.6"
|
||||||
|
"@rollup/rollup-linux-arm64-musl" "4.9.6"
|
||||||
|
"@rollup/rollup-linux-riscv64-gnu" "4.9.6"
|
||||||
|
"@rollup/rollup-linux-x64-gnu" "4.9.6"
|
||||||
|
"@rollup/rollup-linux-x64-musl" "4.9.6"
|
||||||
|
"@rollup/rollup-win32-arm64-msvc" "4.9.6"
|
||||||
|
"@rollup/rollup-win32-ia32-msvc" "4.9.6"
|
||||||
|
"@rollup/rollup-win32-x64-msvc" "4.9.6"
|
||||||
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
rsvp@^4.8.4:
|
rsvp@^4.8.4:
|
||||||
version "4.8.5"
|
version "4.8.5"
|
||||||
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
|
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"
|
||||||
@ -11951,6 +12206,17 @@ vite-node@0.29.8:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents "~2.3.2"
|
fsevents "~2.3.2"
|
||||||
|
|
||||||
|
vite@^5.0.12:
|
||||||
|
version "5.0.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.12.tgz#8a2ffd4da36c132aec4adafe05d7adde38333c47"
|
||||||
|
integrity sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==
|
||||||
|
dependencies:
|
||||||
|
esbuild "^0.19.3"
|
||||||
|
postcss "^8.4.32"
|
||||||
|
rollup "^4.2.0"
|
||||||
|
optionalDependencies:
|
||||||
|
fsevents "~2.3.3"
|
||||||
|
|
||||||
vitest@^0.29.8:
|
vitest@^0.29.8:
|
||||||
version "0.29.8"
|
version "0.29.8"
|
||||||
resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.29.8.tgz#9c13cfa007c3511e86c26e1fe9a686bb4dbaec80"
|
resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.29.8.tgz#9c13cfa007c3511e86c26e1fe9a686bb4dbaec80"
|
||||||
|
Reference in New Issue
Block a user