keycloakify 11.8.31 → 11.8.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/main.js CHANGED
@@ -16235,7 +16235,7 @@ program
16235
16235
  .task({
16236
16236
  skip,
16237
16237
  handler: async ({ projectDirPath, keycloakVersion, port, realmJsonFilePath }) => {
16238
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(226), __nccwpck_require__.e(297), __nccwpck_require__.e(97)]).then(__nccwpck_require__.bind(__nccwpck_require__, 64097));
16238
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(69), __nccwpck_require__.e(910), __nccwpck_require__.e(375)]).then(__nccwpck_require__.bind(__nccwpck_require__, 64097));
16239
16239
  await command({
16240
16240
  buildContext: getBuildContext({ projectDirPath }),
16241
16241
  cliCommandOptions: {
@@ -16355,7 +16355,7 @@ program
16355
16355
  .task({
16356
16356
  skip,
16357
16357
  handler: async ({ projectDirPath }) => {
16358
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(226), __nccwpck_require__.e(363), __nccwpck_require__.e(946)]).then(__nccwpck_require__.bind(__nccwpck_require__, 74946));
16358
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(69), __nccwpck_require__.e(97), __nccwpck_require__.e(946)]).then(__nccwpck_require__.bind(__nccwpck_require__, 74946));
16359
16359
  await command({ buildContext: getBuildContext({ projectDirPath }) });
16360
16360
  }
16361
16361
  });
@@ -16409,7 +16409,7 @@ program
16409
16409
  .task({
16410
16410
  skip,
16411
16411
  handler: async ({ projectDirPath, path, revert }) => {
16412
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(226), __nccwpck_require__.e(363), __nccwpck_require__.e(930)]).then(__nccwpck_require__.bind(__nccwpck_require__, 71930));
16412
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(69), __nccwpck_require__.e(97), __nccwpck_require__.e(930)]).then(__nccwpck_require__.bind(__nccwpck_require__, 71930));
16413
16413
  await command({
16414
16414
  buildContext: getBuildContext({ projectDirPath }),
16415
16415
  cliCommandOptions: { path, isRevert: revert }
@@ -0,0 +1,6 @@
1
+ export declare const getIsKnownByGit: (params: {
2
+ filePath: string;
3
+ }) => Promise<boolean>;
4
+ export declare const untrackFromGit: (params: {
5
+ filePath: string;
6
+ }) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.8.31",
3
+ "version": "11.8.32",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -745,8 +745,8 @@
745
745
  "src/bin/tools/getAbsoluteAndInOsFormatPath.ts",
746
746
  "src/bin/tools/getInstalledModuleDirPath.ts",
747
747
  "src/bin/tools/getThisCodebaseRootDirPath.ts",
748
+ "src/bin/tools/gitUtils.ts",
748
749
  "src/bin/tools/isInside.ts",
749
- "src/bin/tools/isKnownByGit.ts",
750
750
  "src/bin/tools/isRootPath.ts",
751
751
  "src/bin/tools/kebabCaseToSnakeCase.ts",
752
752
  "src/bin/tools/listInstalledModules.ts",
@@ -756,7 +756,6 @@
756
756
  "src/bin/tools/readThisNpmPackageVersion.ts",
757
757
  "src/bin/tools/runPrettier.ts",
758
758
  "src/bin/tools/transformCodebase.ts",
759
- "src/bin/tools/untrackFromGit.ts",
760
759
  "src/bin/tsconfig.json",
761
760
  "src/bin/update-kc-gen.ts",
762
761
  "src/lib/BASE_URL.ts",
@@ -1107,8 +1106,8 @@
1107
1106
  "bin/tools/getAbsoluteAndInOsFormatPath.d.ts",
1108
1107
  "bin/tools/getInstalledModuleDirPath.d.ts",
1109
1108
  "bin/tools/getThisCodebaseRootDirPath.d.ts",
1109
+ "bin/tools/gitUtils.d.ts",
1110
1110
  "bin/tools/isInside.d.ts",
1111
- "bin/tools/isKnownByGit.d.ts",
1112
1111
  "bin/tools/isRootPath.d.ts",
1113
1112
  "bin/tools/kebabCaseToSnakeCase.d.ts",
1114
1113
  "bin/tools/listInstalledModules.d.ts",
@@ -1121,27 +1120,26 @@
1121
1120
  "bin/tools/String.prototype.replaceAll.d.ts",
1122
1121
  "bin/tools/Stringifyable.d.ts",
1123
1122
  "bin/tools/transformCodebase.d.ts",
1124
- "bin/tools/untrackFromGit.d.ts",
1125
1123
  "bin/update-kc-gen.d.ts",
1126
1124
  "bin/main.js",
1127
- "bin/226.index.js",
1128
1125
  "bin/266.index.js",
1129
- "bin/297.index.js",
1130
1126
  "bin/304.index.js",
1131
1127
  "bin/355.index.js",
1132
- "bin/363.index.js",
1133
1128
  "bin/369.index.js",
1129
+ "bin/375.index.js",
1134
1130
  "bin/40.index.js",
1135
1131
  "bin/453.index.js",
1136
1132
  "bin/502.index.js",
1137
1133
  "bin/656.index.js",
1138
1134
  "bin/658.index.js",
1135
+ "bin/69.index.js",
1139
1136
  "bin/712.index.js",
1140
1137
  "bin/720.index.js",
1141
1138
  "bin/780.index.js",
1142
1139
  "bin/783.index.js",
1143
1140
  "bin/786.index.js",
1144
1141
  "bin/877.index.js",
1142
+ "bin/910.index.js",
1145
1143
  "bin/930.index.js",
1146
1144
  "bin/932.index.js",
1147
1145
  "bin/946.index.js",
@@ -9,8 +9,7 @@ import { dirname as pathDirname } from "path";
9
9
  import { join as pathJoin } from "path";
10
10
  import { existsAsync } from "../tools/fs.existsAsync";
11
11
  import * as fsPr from "fs/promises";
12
- import { getIsKnownByGit } from "../tools/isKnownByGit";
13
- import { untrackFromGit } from "../tools/untrackFromGit";
12
+ import { getIsKnownByGit, untrackFromGit } from "../tools/gitUtils";
14
13
 
15
14
  export async function command(params: { buildContext: BuildContext }) {
16
15
  const { buildContext } = params;
@@ -0,0 +1,86 @@
1
+ import * as child_process from "child_process";
2
+ import {
3
+ dirname as pathDirname,
4
+ basename as pathBasename,
5
+ join as pathJoin,
6
+ sep as pathSep
7
+ } from "path";
8
+ import { Deferred } from "evt/tools/Deferred";
9
+ import * as fs from "fs";
10
+ import * as runExclusive from "run-exclusive";
11
+ import { existsAsync } from "./fs.existsAsync";
12
+
13
+ const groupRef = runExclusive.createGroupRef();
14
+
15
+ export const getIsKnownByGit = runExclusive.build(
16
+ groupRef,
17
+ (params: { filePath: string }): Promise<boolean> => {
18
+ const { filePath } = params;
19
+
20
+ const dIsKnownByGit = new Deferred<boolean>();
21
+
22
+ let relativePath = pathBasename(filePath);
23
+
24
+ let dirPath = pathDirname(filePath);
25
+
26
+ while (!fs.existsSync(dirPath)) {
27
+ relativePath = pathJoin(pathBasename(dirPath), relativePath);
28
+
29
+ dirPath = pathDirname(dirPath);
30
+ }
31
+
32
+ child_process.exec(
33
+ `git ls-files --error-unmatch '${relativePath.split(pathSep).join("/")}'`,
34
+ { cwd: dirPath },
35
+ error => {
36
+ if (error === null) {
37
+ dIsKnownByGit.resolve(true);
38
+ return;
39
+ }
40
+
41
+ if (error.code === 1) {
42
+ dIsKnownByGit.resolve(false);
43
+ return;
44
+ }
45
+
46
+ dIsKnownByGit.reject(error);
47
+ }
48
+ );
49
+
50
+ return dIsKnownByGit.pr;
51
+ }
52
+ );
53
+
54
+ export const untrackFromGit = runExclusive.build(
55
+ groupRef,
56
+ async (params: { filePath: string }): Promise<void> => {
57
+ const { filePath } = params;
58
+
59
+ const dDone = new Deferred<void>();
60
+
61
+ let relativePath = pathBasename(filePath);
62
+
63
+ let dirPath = pathDirname(filePath);
64
+
65
+ while (!(await existsAsync(dirPath))) {
66
+ relativePath = pathJoin(pathBasename(dirPath), relativePath);
67
+
68
+ dirPath = pathDirname(dirPath);
69
+ }
70
+
71
+ child_process.exec(
72
+ `git rm --cached '${relativePath.split(pathSep).join("/")}'`,
73
+ { cwd: dirPath },
74
+ error => {
75
+ if (error !== null) {
76
+ dDone.reject(error);
77
+ return;
78
+ }
79
+
80
+ dDone.resolve();
81
+ }
82
+ );
83
+
84
+ await dDone.pr;
85
+ }
86
+ );