Skip to content

Commit

Permalink
Generate dependencies.gen.json and clean src before pulling
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Jul 21, 2024
1 parent e9d9137 commit f1a236b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://github.com/keycloakify/keycloak-account-ui/actions">
<img src="https://github.com/keycloakify/keycloak-account-ui/actions/workflows/ci.yaml/badge.svg?branch=main">
</a>
<a href="https://www.npmjs.com/package/@keycloakify/keycloak-account-ui/v/25.0.1-rc.8">
<a href="https://www.npmjs.com/package/@keycloakify/keycloak-account-ui/v/25.0.1-rc.10">
<img src="https://img.shields.io/npm/dm/@keycloakify/keycloak-account-ui">
</a>
<p align="center">
Expand All @@ -26,17 +26,17 @@ All credits goes to the keycloak team for the original work. Mainly [@jonkoops
This re-packaged distribution exists to make it possible to take ownership of
some specific part of the Account UI to create your own custom version of it.
In straight forward therms it make the Account UI ejectable, you can copy
past [the source files](https://unpkg.com/browse/@keycloakify/keycloak-account-ui@25.0.1-rc.8/src/) that you want to modify into your codebase.
past [the source files](https://unpkg.com/browse/@keycloakify/keycloak-account-ui@25.0.1-rc.10/src/) that you want to modify into your codebase.

For more details on integrating this package into your project, refer to the [Keycloakify documentation](https://keycloakify.dev).

> **Note:** This package's GitHub repository does not contain any code as it is automatically generated at build time by [scripts/prepare.ts](/scripts/prepare.ts).
> You can browse the sources includes int the NPM package [here](https://unpkg.com/browse/@keycloakify/keycloak-account-ui@25.0.1-rc.8/src/).
> You can browse the sources includes int the NPM package [here](https://unpkg.com/browse/@keycloakify/keycloak-account-ui@25.0.1-rc.10/src/).
## Installation

> **Note:** This README file is automatically generated at build so the information above are guaranteed to be up to date.
> You are currently viewing the README of [`@keycloakify/keycloak-account-ui@25.0.1-rc.8`](https://www.npmjs.com/package/@keycloakify/keycloak-account-ui/v/25.0.1-rc.8) that
> You are currently viewing the README of [`@keycloakify/keycloak-account-ui@25.0.1-rc.10`](https://www.npmjs.com/package/@keycloakify/keycloak-account-ui/v/25.0.1-rc.10) that
> mirrors [`@keycloak/keycloak-account-ui@25.0.1`](https://www.npmjs.com/package/@keycloak/keycloak-account-ui/v/25.0.1).
> It is the version of the Account UI that ships with [**Keycloak 25.0.1**](https://github.com/keycloak/keycloak/tree/25.0.1/js/apps/account-ui).
Expand All @@ -48,7 +48,7 @@ It's important to respect the exact version range listed here to avoid any compa
```json
{
"dependencies": {
"@keycloakify/keycloak-account-ui": "25.0.1-rc.8",
"@keycloakify/keycloak-account-ui": "25.0.1-rc.10",
"@patternfly/patternfly": "^5.3.1",
"@patternfly/react-core": "^5.3.3",
"@patternfly/react-icons": "^5.3.2",
Expand All @@ -72,4 +72,4 @@ It's important to respect the exact version range listed here to avoid any compa
## Ejecting

You can take partial ownership of some parts of the Account UI by copy pasting the sources files you want to modify into your codebase.
You can browse the sources files **[here](https://unpkg.com/browse/@keycloakify/keycloak-account-ui@25.0.1-rc.8/src/)**.
You can browse the sources files **[here](https://unpkg.com/browse/@keycloakify/keycloak-account-ui@25.0.1-rc.10/src/)**.
20 changes: 20 additions & 0 deletions dependencies.gen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"dependencies": {
"@patternfly/patternfly": "^5.3.1",
"@patternfly/react-core": "^5.3.3",
"@patternfly/react-icons": "^5.3.2",
"@patternfly/react-table": "^5.3.3",
"i18next": "^23.11.5",
"i18next-http-backend": "^2.5.2",
"lodash-es": "^4.17.21",
"react-hook-form": "7.51.5",
"react-i18next": "^14.1.2",
"react-router-dom": "^6.23.1",
"keycloak-js": "25.0.1",
"@patternfly/react-styles": "^5.3.1",
"@keycloak/keycloak-admin-client": "25.0.1"
},
"devDependencies": {
"@types/lodash-es": "^4.17.12"
}
}
23 changes: 22 additions & 1 deletion scripts/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import * as child_process from "child_process";
const KEYCLOAK_VERSION = "25.0.1";

(async () => {
child_process.execSync("git clean -Xfd .", {
cwd: pathJoin(getThisCodebaseRootDirPath(), "src"),
});

const fetchOptions = getProxyFetchOptions({
npmConfigGetCwd: getThisCodebaseRootDirPath(),
});
Expand Down Expand Up @@ -371,6 +375,21 @@ const KEYCLOAK_VERSION = "25.0.1";
stdio: "ignore",
});

fs.writeFileSync(
pathJoin(getThisCodebaseRootDirPath(), "dependencies.gen.json"),
Buffer.from(
JSON.stringify(
{
dependencies: thisParsedPackageJson["peerDependencies"],
devDependencies: devDependenciesToInstall,
},
null,
2,
),
"utf8",
),
);

const readme = fs
.readFileSync(pathJoin(__dirname, "README-template.md"))
.toString("utf8")
Expand All @@ -387,7 +406,7 @@ const KEYCLOAK_VERSION = "25.0.1";
},
devDependencies: devDependenciesToInstall,
},
undefined,
null,
2,
),
);
Expand All @@ -397,6 +416,8 @@ const KEYCLOAK_VERSION = "25.0.1";
Buffer.from(readme, "utf8"),
);

child_process.execSync("yarn format");

console.log(
chalk.green(
`\n\nPulled @keycloak/keycloak-account-ui@${keycloakAccountUiVersion} from keycloak version ${KEYCLOAK_VERSION}`,
Expand Down

0 comments on commit f1a236b

Please sign in to comment.