keycloakify 11.6.0 → 11.6.2

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.
Files changed (49) hide show
  1. package/bin/{805.index.js → 174.index.js} +111 -2
  2. package/bin/363.index.js +1528 -0
  3. package/bin/453.index.js +1 -1
  4. package/bin/{33.index.js → 568.index.js} +2 -113
  5. package/bin/735.index.js +53 -24
  6. package/bin/{653.index.js → 840.index.js} +387 -213
  7. package/bin/921.index.js +1 -1
  8. package/bin/930.index.js +165 -0
  9. package/bin/946.index.js +20 -0
  10. package/bin/initialize-admin-theme.d.ts +4 -0
  11. package/bin/main.js +72 -18
  12. package/bin/{eject-file.d.ts → own.d.ts} +2 -1
  13. package/bin/shared/addSyncExtensionsToPostinstallScript.d.ts +10 -0
  14. package/bin/shared/customHandler.d.ts +1 -1
  15. package/bin/shared/customHandler.js.map +1 -1
  16. package/bin/{postinstall/uiModuleMeta.d.ts → sync-extensions/extensionModuleMeta.d.ts} +5 -5
  17. package/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts +12 -0
  18. package/bin/sync-extensions/index.d.ts +1 -0
  19. package/bin/{postinstall/installUiModulesPeerDependencies.d.ts → sync-extensions/installExtensionModulesPeerDependencies.d.ts} +3 -3
  20. package/bin/{postinstall → sync-extensions}/managedGitignoreFile.d.ts +4 -4
  21. package/bin/tools/isKnownByGit.d.ts +3 -0
  22. package/bin/tools/npmInstall.d.ts +1 -1
  23. package/package.json +27 -22
  24. package/src/bin/eject-page.ts +1 -3
  25. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +3 -1
  26. package/src/bin/initialize-admin-theme.ts +146 -0
  27. package/src/bin/main.ts +76 -17
  28. package/src/bin/own.ts +209 -0
  29. package/src/bin/shared/addSyncExtensionsToPostinstallScript.ts +70 -0
  30. package/src/bin/shared/customHandler.ts +1 -0
  31. package/src/bin/{postinstall/uiModuleMeta.ts → sync-extensions/extensionModuleMeta.ts} +55 -43
  32. package/src/bin/{postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts → sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts} +32 -21
  33. package/src/bin/sync-extensions/index.ts +1 -0
  34. package/src/bin/{postinstall/installUiModulesPeerDependencies.ts → sync-extensions/installExtensionModulesPeerDependencies.ts} +16 -14
  35. package/src/bin/{postinstall → sync-extensions}/managedGitignoreFile.ts +18 -18
  36. package/src/bin/{postinstall/postinstall.ts → sync-extensions/sync-extension.ts} +14 -26
  37. package/src/bin/tools/isKnownByGit.ts +45 -0
  38. package/src/bin/tools/listInstalledModules.ts +2 -2
  39. package/src/bin/tools/npmInstall.ts +46 -9
  40. package/src/bin/tools/untrackFromGit.ts +19 -3
  41. package/bin/356.index.js +0 -755
  42. package/bin/854.index.js +0 -68
  43. package/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts +0 -12
  44. package/bin/postinstall/index.d.ts +0 -1
  45. package/bin/tools/isTrackedByGit.d.ts +0 -3
  46. package/src/bin/eject-file.ts +0 -68
  47. package/src/bin/postinstall/index.ts +0 -1
  48. package/src/bin/tools/isTrackedByGit.ts +0 -29
  49. /package/bin/{postinstall/postinstall.d.ts → sync-extensions/sync-extension.d.ts} +0 -0
@@ -9,8 +9,9 @@ import { objectKeys } from "tsafe/objectKeys";
9
9
  import { getAbsoluteAndInOsFormatPath } from "./getAbsoluteAndInOsFormatPath";
10
10
  import { exclude } from "tsafe/exclude";
11
11
  import { rmSync } from "./fs.rmSync";
12
+ import { Deferred } from "evt/tools/Deferred";
12
13
 
13
- export function npmInstall(params: { packageJsonDirPath: string }) {
14
+ export async function npmInstall(params: { packageJsonDirPath: string }) {
14
15
  const { packageJsonDirPath } = params;
15
16
 
16
17
  const packageManagerBinName = (() => {
@@ -68,7 +69,7 @@ export function npmInstall(params: { packageJsonDirPath: string }) {
68
69
 
69
70
  console.log(chalk.green("Installing in a way that won't break the links..."));
70
71
 
71
- installWithoutBreakingLinks({
72
+ await installWithoutBreakingLinks({
72
73
  packageJsonDirPath,
73
74
  garronejLinkInfos
74
75
  });
@@ -77,9 +78,9 @@ export function npmInstall(params: { packageJsonDirPath: string }) {
77
78
  }
78
79
 
79
80
  try {
80
- child_process.execSync(`${packageManagerBinName} install`, {
81
- cwd: packageJsonDirPath,
82
- stdio: "inherit"
81
+ await runPackageManagerInstall({
82
+ packageManagerBinName,
83
+ cwd: packageJsonDirPath
83
84
  });
84
85
  } catch {
85
86
  console.log(
@@ -90,6 +91,42 @@ export function npmInstall(params: { packageJsonDirPath: string }) {
90
91
  }
91
92
  }
92
93
 
94
+ async function runPackageManagerInstall(params: {
95
+ packageManagerBinName: string;
96
+ cwd: string;
97
+ }) {
98
+ const { packageManagerBinName, cwd } = params;
99
+
100
+ const dCompleted = new Deferred<void>();
101
+
102
+ const child = child_process.spawn(packageManagerBinName, ["install"], {
103
+ cwd,
104
+ env: process.env,
105
+ shell: true
106
+ });
107
+
108
+ child.stdout.on("data", data => process.stdout.write(data));
109
+
110
+ child.stderr.on("data", data => {
111
+ if (data.toString("utf8").includes("peer dependency")) {
112
+ return;
113
+ }
114
+
115
+ process.stderr.write(data);
116
+ });
117
+
118
+ child.on("exit", code => {
119
+ if (code !== 0) {
120
+ dCompleted.reject(new Error(`Failed with code ${code}`));
121
+ return;
122
+ }
123
+
124
+ dCompleted.resolve();
125
+ });
126
+
127
+ await dCompleted.pr;
128
+ }
129
+
93
130
  function getGarronejLinkInfos(params: {
94
131
  packageJsonDirPath: string;
95
132
  }): { linkedModuleNames: string[]; yarnHomeDirPath: string } | undefined {
@@ -180,7 +217,7 @@ function getGarronejLinkInfos(params: {
180
217
  return { linkedModuleNames, yarnHomeDirPath };
181
218
  }
182
219
 
183
- function installWithoutBreakingLinks(params: {
220
+ async function installWithoutBreakingLinks(params: {
184
221
  packageJsonDirPath: string;
185
222
  garronejLinkInfos: Exclude<ReturnType<typeof getGarronejLinkInfos>, undefined>;
186
223
  }) {
@@ -261,9 +298,9 @@ function installWithoutBreakingLinks(params: {
261
298
  pathJoin(tmpProjectDirPath, YARN_LOCK)
262
299
  );
263
300
 
264
- child_process.execSync(`yarn install`, {
265
- cwd: tmpProjectDirPath,
266
- stdio: "inherit"
301
+ await runPackageManagerInstall({
302
+ packageManagerBinName: "yarn",
303
+ cwd: tmpProjectDirPath
267
304
  });
268
305
 
269
306
  // NOTE: Moving the modules from the tmp project to the actual project
@@ -1,15 +1,31 @@
1
1
  import * as child_process from "child_process";
2
- import { dirname as pathDirname, basename as pathBasename } from "path";
2
+ import {
3
+ dirname as pathDirname,
4
+ basename as pathBasename,
5
+ join as pathJoin,
6
+ sep as pathSep
7
+ } from "path";
3
8
  import { Deferred } from "evt/tools/Deferred";
9
+ import { existsAsync } from "./fs.existsAsync";
4
10
 
5
11
  export async function untrackFromGit(params: { filePath: string }): Promise<void> {
6
12
  const { filePath } = params;
7
13
 
8
14
  const dDone = new Deferred<void>();
9
15
 
16
+ let relativePath = pathBasename(filePath);
17
+
18
+ let dirPath = pathDirname(filePath);
19
+
20
+ while (!(await existsAsync(dirPath))) {
21
+ relativePath = pathJoin(pathBasename(dirPath), relativePath);
22
+
23
+ dirPath = pathDirname(dirPath);
24
+ }
25
+
10
26
  child_process.exec(
11
- `git rm --cached ${pathBasename(filePath)}`,
12
- { cwd: pathDirname(filePath) },
27
+ `git rm --cached '${relativePath.split(pathSep).join("/")}'`,
28
+ { cwd: dirPath },
13
29
  error => {
14
30
  if (error !== null) {
15
31
  dDone.reject(error);